diff --git a/data/en.mse-locale/locale b/data/en.mse-locale/locale index bc906c69..20e89b21 100644 --- a/data/en.mse-locale/locale +++ b/data/en.mse-locale/locale @@ -1,4 +1,4 @@ -mse version: 0.3.8 +mse version: 0.3.8 installer group: translations/English full name: English version: 2008-08-08 @@ -571,6 +571,7 @@ button: show lines: Show &lines around fields show editing hints: Show boxes and hints for &editing zoom export: Use zoom and rotation settings when e&xporting + spellcheck enabled: Show &spelling errors on cards check now: Check &Now always: Always if internet connection exists: If internet connection exists diff --git a/src/data/settings.cpp b/src/data/settings.cpp index 76c9ec58..da99bc8d 100644 --- a/src/data/settings.cpp +++ b/src/data/settings.cpp @@ -123,21 +123,23 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(GameSettings) { StyleSheetSettings::StyleSheetSettings() - : card_zoom (1.0, true) - , card_angle (0, true) - , card_anti_alias (true, true) - , card_borders (true, true) - , card_draw_editing (true, true) - , card_normal_export(true, true) + : card_zoom (1.0, true) + , card_angle (0, true) + , card_anti_alias (true, true) + , card_borders (true, true) + , card_draw_editing (true, true) + , card_normal_export (true, true) + , card_spellcheck_enabled(true, true) {} void StyleSheetSettings::useDefault(const StyleSheetSettings& ss) { - if (card_zoom .isDefault()) card_zoom .assignDefault(ss.card_zoom); - if (card_angle .isDefault()) card_angle .assignDefault(ss.card_angle); - if (card_anti_alias .isDefault()) card_anti_alias .assignDefault(ss.card_anti_alias); - if (card_borders .isDefault()) card_borders .assignDefault(ss.card_borders); - if (card_draw_editing .isDefault()) card_draw_editing .assignDefault(ss.card_draw_editing); - if (card_normal_export.isDefault()) card_normal_export.assignDefault(ss.card_normal_export); + if (card_zoom .isDefault()) card_zoom .assignDefault(ss.card_zoom); + if (card_angle .isDefault()) card_angle .assignDefault(ss.card_angle); + if (card_anti_alias .isDefault()) card_anti_alias .assignDefault(ss.card_anti_alias); + if (card_borders .isDefault()) card_borders .assignDefault(ss.card_borders); + if (card_draw_editing .isDefault()) card_draw_editing .assignDefault(ss.card_draw_editing); + if (card_normal_export .isDefault()) card_normal_export .assignDefault(ss.card_normal_export); + if (card_spellcheck_enabled.isDefault()) card_spellcheck_enabled.assignDefault(ss.card_spellcheck_enabled); } IMPLEMENT_REFLECTION_NO_SCRIPT(StyleSheetSettings) { @@ -147,6 +149,7 @@ IMPLEMENT_REFLECTION_NO_SCRIPT(StyleSheetSettings) { REFLECT(card_borders); REFLECT(card_draw_editing); REFLECT(card_normal_export); + REFLECT(card_spellcheck_enabled); } // ----------------------------------------------------------------------------- : Settings diff --git a/src/data/settings.hpp b/src/data/settings.hpp index 86ecf68a..72c75d4a 100644 --- a/src/data/settings.hpp +++ b/src/data/settings.hpp @@ -103,6 +103,7 @@ class StyleSheetSettings : public IntrusivePtrBase { Defaultable card_borders; Defaultable card_draw_editing; Defaultable card_normal_export; + Defaultable card_spellcheck_enabled; /// Where the settings are the default, use the value from ss void useDefault(const StyleSheetSettings& ss); diff --git a/src/gui/preferences_window.cpp b/src/gui/preferences_window.cpp index 5eef511a..b52976a4 100644 --- a/src/gui/preferences_window.cpp +++ b/src/gui/preferences_window.cpp @@ -54,7 +54,7 @@ class DisplayPreferencesPage : public PreferencesPage { private: DECLARE_EVENT_TABLE(); - wxCheckBox* high_quality, *borders, *draw_editing; + wxCheckBox* high_quality, *borders, *draw_editing, *spellcheck_enabled; #if USE_ZOOM_COMBOBOX wxComboBox* zoom; int zoom_int; @@ -195,9 +195,10 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent) : PreferencesPage(parent) { // init controls - high_quality = new wxCheckBox(this, wxID_ANY, _BUTTON_("high quality")); - borders = new wxCheckBox(this, wxID_ANY, _BUTTON_("show lines")); - draw_editing = new wxCheckBox(this, wxID_ANY, _BUTTON_("show editing hints")); + high_quality = new wxCheckBox(this, wxID_ANY, _BUTTON_("high quality")); + borders = new wxCheckBox(this, wxID_ANY, _BUTTON_("show lines")); + draw_editing = new wxCheckBox(this, wxID_ANY, _BUTTON_("show editing hints")); + spellcheck_enabled = new wxCheckBox(this, wxID_ANY, _BUTTON_("spellcheck enabled")); #if USE_ZOOM_COMBOBOX zoom = new wxComboBox(this, ID_ZOOM); #else @@ -206,10 +207,11 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent) non_normal_export = new wxCheckBox(this, wxID_ANY, _BUTTON_("zoom export")); //wxButton* columns = new wxButton(this, ID_SELECT_COLUMNS, _BUTTON_("select")); // set values - high_quality-> SetValue( settings.default_stylesheet_settings.card_anti_alias()); - borders-> SetValue( settings.default_stylesheet_settings.card_borders()); - draw_editing-> SetValue( settings.default_stylesheet_settings.card_draw_editing()); - non_normal_export->SetValue(!settings.default_stylesheet_settings.card_normal_export()); + high_quality-> SetValue( settings.default_stylesheet_settings.card_anti_alias()); + borders-> SetValue( settings.default_stylesheet_settings.card_borders()); + draw_editing-> SetValue( settings.default_stylesheet_settings.card_draw_editing()); + spellcheck_enabled->SetValue( settings.default_stylesheet_settings.card_spellcheck_enabled()); + non_normal_export-> SetValue(!settings.default_stylesheet_settings.card_normal_export()); #if USE_ZOOM_COMBOBOX zoom_int = static_cast(settings.default_stylesheet_settings.card_zoom() * 100); zoom->SetValue(String::Format(_("%d%%"),zoom_int)); @@ -224,9 +226,10 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent) // init sizer wxSizer* s = new wxBoxSizer(wxVERTICAL); wxSizer* s2 = new wxStaticBoxSizer(wxVERTICAL, this, _LABEL_("card display")); - s2->Add(high_quality, 0, wxEXPAND | wxALL, 4); - s2->Add(borders, 0, wxEXPAND | wxALL, 4); - s2->Add(draw_editing, 0, wxEXPAND | wxALL, 4); + s2->Add(high_quality, 0, wxEXPAND | wxALL, 4); + s2->Add(borders, 0, wxEXPAND | wxALL, 4); + s2->Add(draw_editing, 0, wxEXPAND | wxALL, 4); + s2->Add(spellcheck_enabled, 0, wxEXPAND | wxALL, 4); wxSizer* s3 = new wxBoxSizer(wxHORIZONTAL); s3->Add(new wxStaticText(this, wxID_ANY, _LABEL_("zoom")), 0, wxALL & ~wxLEFT, 4); s3->AddSpacer(2); @@ -249,9 +252,10 @@ DisplayPreferencesPage::DisplayPreferencesPage(Window* parent) } void DisplayPreferencesPage::store() { - settings.default_stylesheet_settings.card_anti_alias = high_quality->GetValue(); - settings.default_stylesheet_settings.card_borders = borders->GetValue(); - settings.default_stylesheet_settings.card_draw_editing = draw_editing->GetValue(); + settings.default_stylesheet_settings.card_anti_alias = high_quality->GetValue(); + settings.default_stylesheet_settings.card_borders = borders->GetValue(); + settings.default_stylesheet_settings.card_draw_editing = draw_editing->GetValue(); + settings.default_stylesheet_settings.card_spellcheck_enabled = spellcheck_enabled->GetValue(); #if USE_ZOOM_COMBOBOX updateZoom(); settings.default_stylesheet_settings.card_zoom = zoom_int / 100.0; diff --git a/src/resource/common/expected_locale_keys b/src/resource/common/expected_locale_keys index 70b98b25..77e1cd70 100644 --- a/src/resource/common/expected_locale_keys +++ b/src/resource/common/expected_locale_keys @@ -84,6 +84,7 @@ button: select all: 0 select cards: 0 select none: 0 + spellcheck enabled: 0 show: 0 show editing hints: 0 show lines: 0 diff --git a/src/script/functions/spelling.cpp b/src/script/functions/spelling.cpp index bef06de4..cb19b9ce 100644 --- a/src/script/functions/spelling.cpp +++ b/src/script/functions/spelling.cpp @@ -12,6 +12,7 @@ #include