Commiting text now commits times as well.
Originally committed to SVN as r1141.
This commit is contained in:
parent
399a7396cf
commit
577295495e
3 changed files with 24 additions and 12 deletions
|
@ -116,6 +116,7 @@ Please visit http://aegisub.net to download latest version
|
||||||
- Fixed drawing of inactive lines in audio display to prevent it from being drawn over selection. (AMZ)
|
- Fixed drawing of inactive lines in audio display to prevent it from being drawn over selection. (AMZ)
|
||||||
- Style Editor dialog was redesigned to be more horizontal. (AMZ)
|
- Style Editor dialog was redesigned to be more horizontal. (AMZ)
|
||||||
- Style Editor dialog received a realtime styles preview box. (AMZ)
|
- Style Editor dialog received a realtime styles preview box. (AMZ)
|
||||||
|
- Commiting text now commits times as well. (AMZ)
|
||||||
|
|
||||||
|
|
||||||
= 1.10 beta - 2006.08.07 ===========================
|
= 1.10 beta - 2006.08.07 ===========================
|
||||||
|
|
|
@ -627,6 +627,7 @@ void SubsEditBox::OnStartTimeChange(wxCommandEvent &event) {
|
||||||
if (StartTime->time > EndTime->time) StartTime->SetTime(EndTime->time.GetMS());
|
if (StartTime->time > EndTime->time) StartTime->SetTime(EndTime->time.GetMS());
|
||||||
bool join = Options.AsBool(_T("Link Time Boxes Commit")) && EndTime->HasBeenModified();
|
bool join = Options.AsBool(_T("Link Time Boxes Commit")) && EndTime->HasBeenModified();
|
||||||
StartTime->Update();
|
StartTime->Update();
|
||||||
|
Duration->Update();
|
||||||
if (join) EndTime->Update();
|
if (join) EndTime->Update();
|
||||||
CommitTimes(true,join,true);
|
CommitTimes(true,join,true);
|
||||||
}
|
}
|
||||||
|
@ -638,6 +639,7 @@ void SubsEditBox::OnEndTimeChange(wxCommandEvent &event) {
|
||||||
if (StartTime->time > EndTime->time) EndTime->SetTime(StartTime->time.GetMS());
|
if (StartTime->time > EndTime->time) EndTime->SetTime(StartTime->time.GetMS());
|
||||||
bool join = Options.AsBool(_T("Link Time Boxes Commit")) && StartTime->HasBeenModified();
|
bool join = Options.AsBool(_T("Link Time Boxes Commit")) && StartTime->HasBeenModified();
|
||||||
EndTime->Update();
|
EndTime->Update();
|
||||||
|
Duration->Update();
|
||||||
if (join) StartTime->Update();
|
if (join) StartTime->Update();
|
||||||
CommitTimes(join,true,false);
|
CommitTimes(join,true,false);
|
||||||
}
|
}
|
||||||
|
@ -647,6 +649,8 @@ void SubsEditBox::OnEndTimeChange(wxCommandEvent &event) {
|
||||||
// Duration changed
|
// Duration changed
|
||||||
void SubsEditBox::OnDurationChange(wxCommandEvent &event) {
|
void SubsEditBox::OnDurationChange(wxCommandEvent &event) {
|
||||||
EndTime->SetTime(StartTime->time.GetMS() + Duration->time.GetMS());
|
EndTime->SetTime(StartTime->time.GetMS() + Duration->time.GetMS());
|
||||||
|
StartTime->Update();
|
||||||
|
EndTime->Update();
|
||||||
Duration->Update();
|
Duration->Update();
|
||||||
CommitTimes(false,true,true);
|
CommitTimes(false,true,true);
|
||||||
}
|
}
|
||||||
|
@ -654,10 +658,9 @@ void SubsEditBox::OnDurationChange(wxCommandEvent &event) {
|
||||||
|
|
||||||
///////////////////////
|
///////////////////////
|
||||||
// Commit time changes
|
// Commit time changes
|
||||||
void SubsEditBox::CommitTimes(bool start,bool end,bool fromStart) {
|
void SubsEditBox::CommitTimes(bool start,bool end,bool fromStart,bool commit) {
|
||||||
// Get selection
|
// Get selection
|
||||||
if (!start && !end) return;
|
if (!start && !end) return;
|
||||||
grid->BeginBatch();
|
|
||||||
wxArrayInt sel = grid->GetSelection();
|
wxArrayInt sel = grid->GetSelection();
|
||||||
int n = sel.Count();
|
int n = sel.Count();
|
||||||
if (n == 0) return;
|
if (n == 0) return;
|
||||||
|
@ -677,18 +680,16 @@ void SubsEditBox::CommitTimes(bool start,bool end,bool fromStart) {
|
||||||
if (fromStart) cur->End = cur->Start;
|
if (fromStart) cur->End = cur->Start;
|
||||||
else cur->Start = cur->End;
|
else cur->Start = cur->End;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Update
|
|
||||||
cur->UpdateData();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Commit
|
// Commit
|
||||||
grid->ass->FlagAsModified(_("commit times"));
|
if (commit) {
|
||||||
grid->CommitChanges();
|
grid->ass->FlagAsModified(_("modify times"));
|
||||||
grid->EndBatch();
|
grid->CommitChanges();
|
||||||
audio->SetDialogue(grid,grid->GetDialogue(sel[0]),sel[0]);
|
audio->SetDialogue(grid,grid->GetDialogue(sel[0]),sel[0]);
|
||||||
VideoContext::Get()->UpdateDisplays(false);
|
VideoContext::Get()->UpdateDisplays(false);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -866,8 +867,18 @@ void SubsEditBox::CommitText(bool weak) {
|
||||||
|
|
||||||
// Update line
|
// Update line
|
||||||
if (cur) {
|
if (cur) {
|
||||||
|
// Update text
|
||||||
cur->Text = TextEdit->GetText();
|
cur->Text = TextEdit->GetText();
|
||||||
cur->UpdateData();
|
|
||||||
|
// Update times
|
||||||
|
cur->Start = StartTime->time;
|
||||||
|
cur->End = EndTime->time;
|
||||||
|
if (cur->Start > cur->End) cur->End = cur->Start;
|
||||||
|
StartTime->Update();
|
||||||
|
EndTime->Update();
|
||||||
|
Duration->Update();
|
||||||
|
|
||||||
|
// Update audio
|
||||||
if (!weak) {
|
if (!weak) {
|
||||||
grid->Refresh(false);
|
grid->Refresh(false);
|
||||||
audio->SetDialogue(grid,cur,linen);
|
audio->SetDialogue(grid,cur,linen);
|
||||||
|
|
|
@ -103,7 +103,7 @@ private:
|
||||||
wxSizer *BottomSizer;
|
wxSizer *BottomSizer;
|
||||||
|
|
||||||
void SetControlsState(bool state);
|
void SetControlsState(bool state);
|
||||||
void CommitTimes(bool start,bool end,bool fromStart);
|
void CommitTimes(bool start,bool end,bool fromStart,bool commit=true);
|
||||||
|
|
||||||
int BlockAtPos(int pos);
|
int BlockAtPos(int pos);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue