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);