Don't update the initial line state after undo
This commit is contained in:
parent
9a36e5cfe1
commit
31d2054ab3
2 changed files with 8 additions and 2 deletions
|
@ -27,10 +27,15 @@ InitialLineState::InitialLineState(agi::Context *c)
|
||||||
}
|
}
|
||||||
|
|
||||||
void InitialLineState::OnActiveLineChanged(AssDialogue *new_line) {
|
void InitialLineState::OnActiveLineChanged(AssDialogue *new_line) {
|
||||||
if (new_line)
|
if (new_line) {
|
||||||
|
if (new_line->Id == line_id) return;
|
||||||
|
line_id = new_line->Id;
|
||||||
initial_text = new_line->Text;
|
initial_text = new_line->Text;
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
|
line_id = 0;
|
||||||
initial_text.clear();
|
initial_text.clear();
|
||||||
|
}
|
||||||
|
|
||||||
InitialStateChanged(initial_text);
|
InitialStateChanged(initial_text);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ class AssDialogue;
|
||||||
class InitialLineState {
|
class InitialLineState {
|
||||||
agi::signal::Connection active_line_connection;
|
agi::signal::Connection active_line_connection;
|
||||||
wxString initial_text;
|
wxString initial_text;
|
||||||
|
int line_id;
|
||||||
|
|
||||||
agi::signal::Signal<wxString const&> InitialStateChanged;
|
agi::signal::Signal<wxString const&> InitialStateChanged;
|
||||||
void OnActiveLineChanged(AssDialogue *new_line);
|
void OnActiveLineChanged(AssDialogue *new_line);
|
||||||
|
|
Loading…
Reference in a new issue