From f1b2b4a3da3537ef6ebaa55599ffbabe3ec410c1 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 10 May 2012 14:19:02 +0000 Subject: [PATCH] Don't allow opening multiple copies of the spell checker dialog Originally committed to SVN as r6757. --- aegisub/src/command/subtitle.cpp | 3 ++- aegisub/src/dialog_spellchecker.cpp | 6 ------ aegisub/src/dialog_spellchecker.h | 1 - 3 files changed, 2 insertions(+), 8 deletions(-) diff --git a/aegisub/src/command/subtitle.cpp b/aegisub/src/command/subtitle.cpp index 81c84e008..f0ad5e249 100644 --- a/aegisub/src/command/subtitle.cpp +++ b/aegisub/src/command/subtitle.cpp @@ -52,6 +52,7 @@ #include "../ass_file.h" #include "../compat.h" #include "../dialog_attachments.h" +#include "../dialog_manager.h" #include "../dialog_properties.h" #include "../dialog_search_replace.h" #include "../dialog_spellchecker.h" @@ -437,7 +438,7 @@ struct subtitle_spellcheck : public Command { void operator()(agi::Context *c) { c->videoController->Stop(); - new DialogSpellChecker(c); + c->dialog->Show(c); } }; } diff --git a/aegisub/src/dialog_spellchecker.cpp b/aegisub/src/dialog_spellchecker.cpp index d687ac240..de7a94268 100644 --- a/aegisub/src/dialog_spellchecker.cpp +++ b/aegisub/src/dialog_spellchecker.cpp @@ -157,8 +157,6 @@ DialogSpellChecker::DialogSpellChecker(agi::Context *context) if (FindNext()) Show(); - - Bind(wxEVT_COMMAND_BUTTON_CLICKED, &DialogSpellChecker::OnClose, this, wxID_CANCEL); } DialogSpellChecker::~DialogSpellChecker() { @@ -201,10 +199,6 @@ void DialogSpellChecker::OnChangeSuggestion(wxCommandEvent&) { replace_word->SetValue(suggest_list->GetStringSelection()); } -void DialogSpellChecker::OnClose(wxCommandEvent&) { - Destroy(); -} - bool DialogSpellChecker::FindNext() { AssDialogue *real_active_line = context->selectionController->GetActiveLine(); // User has changed the active line; restart search from this position diff --git a/aegisub/src/dialog_spellchecker.h b/aegisub/src/dialog_spellchecker.h index 6ed99d7d1..67fc3a0d3 100644 --- a/aegisub/src/dialog_spellchecker.h +++ b/aegisub/src/dialog_spellchecker.h @@ -96,7 +96,6 @@ class DialogSpellChecker : public wxDialog { void OnIgnore(wxCommandEvent&); void OnIgnoreAll(wxCommandEvent&); void OnAdd(wxCommandEvent&); - void OnClose(wxCommandEvent&); public: DialogSpellChecker(agi::Context *context);