From 80fdea74e66a6aa92a300c1311836f224eaaba41 Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Tue, 19 Jan 2010 01:05:51 +0000 Subject: [PATCH] Merge r3994 from the 2.1.8 branch. Closes #999. Originally committed to SVN as r3995. --- aegisub/src/dialog_spellchecker.cpp | 4 +++- aegisub/src/dialog_spellchecker.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/aegisub/src/dialog_spellchecker.cpp b/aegisub/src/dialog_spellchecker.cpp index b634065ca..6408baab9 100644 --- a/aegisub/src/dialog_spellchecker.cpp +++ b/aegisub/src/dialog_spellchecker.cpp @@ -145,7 +145,7 @@ DialogSpellChecker::DialogSpellChecker(wxFrame *parent) actionsSizer->Add(new wxButton(this,BUTTON_REPLACE_ALL,_("Replace All")),0,wxEXPAND | wxBOTTOM,5); actionsSizer->Add(new wxButton(this,BUTTON_IGNORE,_("Ignore")),0,wxEXPAND | wxBOTTOM,5); actionsSizer->Add(new wxButton(this,BUTTON_IGNORE_ALL,_("Ignore all")),0,wxEXPAND | wxBOTTOM,5); - actionsSizer->Add(new wxButton(this,BUTTON_ADD,_("Add to dictionary")),0,wxEXPAND | wxBOTTOM,5); + actionsSizer->Add(addButton = new wxButton(this,BUTTON_ADD,_("Add to dictionary")),0,wxEXPAND | wxBOTTOM,5); actionsSizer->Add(new HelpButton(this,_T("Spell Checker")),0,wxEXPAND | wxBOTTOM,0); actionsSizer->AddStretchSpacer(1); @@ -274,6 +274,8 @@ void DialogSpellChecker::SetWord(wxString word) { grid->editBox->SetToLine(line); grid->editBox->TextEdit->SetSelectionU(wordStart,wordEnd); grid->EndBatch(); + + addButton->Enable(spellchecker->CanAddWord(word)); } diff --git a/aegisub/src/dialog_spellchecker.h b/aegisub/src/dialog_spellchecker.h index 5894c28d4..2a20fcda6 100644 --- a/aegisub/src/dialog_spellchecker.h +++ b/aegisub/src/dialog_spellchecker.h @@ -101,6 +101,7 @@ private: /// DOCME wxComboBox *language; + wxButton *addButton; bool FindOrDie(); bool FindNext(int startLine=-1,int startPos=-1);