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
|
/// @brief Undo
|
||||||
void FrameMain::OnUndo(wxCommandEvent&) {
|
void FrameMain::OnUndo(wxCommandEvent&) {
|
||||||
VideoContext::Get()->Stop();
|
VideoContext::Get()->Stop();
|
||||||
|
std::vector<int> selected_lines = SubsGrid->GetAbsoluteSelection();
|
||||||
|
int active_line = SubsGrid->GetDialogueIndex(SubsGrid->GetActiveLine());
|
||||||
AssFile::top->Undo();
|
AssFile::top->Undo();
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
SubsGrid->UpdateMaps();
|
SubsGrid->UpdateMaps();
|
||||||
|
SubsGrid->SetSelectionFromAbsolute(selected_lines);
|
||||||
|
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(active_line));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Redo
|
/// @brief Redo
|
||||||
void FrameMain::OnRedo(wxCommandEvent&) {
|
void FrameMain::OnRedo(wxCommandEvent&) {
|
||||||
VideoContext::Get()->Stop();
|
VideoContext::Get()->Stop();
|
||||||
|
std::vector<int> selected_lines = SubsGrid->GetAbsoluteSelection();
|
||||||
|
int active_line = SubsGrid->GetDialogueIndex(SubsGrid->GetActiveLine());
|
||||||
AssFile::top->Redo();
|
AssFile::top->Redo();
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
SubsGrid->UpdateMaps();
|
SubsGrid->UpdateMaps();
|
||||||
|
SubsGrid->SetSelectionFromAbsolute(selected_lines);
|
||||||
|
SubsGrid->SetActiveLine(SubsGrid->GetDialogue(active_line));
|
||||||
}
|
}
|
||||||
|
|
||||||
/// @brief Find
|
/// @brief Find
|
||||||
|
|
Loading…
Reference in a new issue