Save selection over undo/redo.
Originally committed to SVN as r4668.
This commit is contained in:
parent
2e5dc176db
commit
5e22a0f151
1 changed files with 8 additions and 0 deletions
|
@ -1168,17 +1168,25 @@ void FrameMain::OnShiftToFrame (wxCommandEvent &) {
|
|||
/// @brief Undo
|
||||
void FrameMain::OnUndo(wxCommandEvent&) {
|
||||
VideoContext::Get()->Stop();
|
||||
std::vector<int> selected_lines = SubsGrid->GetAbsoluteSelection();
|
||||
int active_line = SubsGrid->GetDialogueIndex(SubsGrid->GetActiveLine());
|
||||
AssFile::top->Undo();
|
||||
UpdateTitle();
|
||||
SubsGrid->UpdateMaps();
|
||||
SubsGrid->SetSelectionFromAbsolute(selected_lines);
|
||||
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(active_line));
|
||||
}
|
||||
|
||||
/// @brief Redo
|
||||
void FrameMain::OnRedo(wxCommandEvent&) {
|
||||
VideoContext::Get()->Stop();
|
||||
std::vector<int> selected_lines = SubsGrid->GetAbsoluteSelection();
|
||||
int active_line = SubsGrid->GetDialogueIndex(SubsGrid->GetActiveLine());
|
||||
AssFile::top->Redo();
|
||||
UpdateTitle();
|
||||
SubsGrid->UpdateMaps();
|
||||
SubsGrid->SetSelectionFromAbsolute(selected_lines);
|
||||
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(active_line));
|
||||
}
|
||||
|
||||
/// @brief Find
|
||||
|
|
Loading…
Reference in a new issue