diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 22:51:58 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-29 22:51:58 +0000 |
commit | 544e50602d5f0f75810df55b5de6d2f578e31cdb (patch) | |
tree | b160d9b778d0d6c460a1526b6354100a0eef98cf | |
parent | 22fbe5aa7bf2f31b35d0fc5d695316066a53518d (diff) | |
download | chromium_src-544e50602d5f0f75810df55b5de6d2f578e31cdb.zip chromium_src-544e50602d5f0f75810df55b5de6d2f578e31cdb.tar.gz chromium_src-544e50602d5f0f75810df55b5de6d2f578e31cdb.tar.bz2 |
Only show the language restart warning once, and only if needed.
BUG=2835
Review URL: http://codereview.chromium.org/8195
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4179 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/views/options/languages_page_view.cc | 12 | ||||
-rw-r--r-- | chrome/browser/views/options/languages_page_view.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 60735ae..c7470ac 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -484,6 +484,7 @@ LanguagesPageView::LanguagesPageView(Profile* profile) dictionary_language_label_(NULL), OptionsPageView(profile), language_table_edited_(false), + language_warning_shown_(false), spellcheck_language_index_selected_(-1) { accept_languages_.Init(prefs::kAcceptLanguages, profile->GetPrefs(), NULL); @@ -710,14 +711,19 @@ void LanguagesPageView::NotifyPrefChanged(const std::wstring* pref_name) { void LanguagesPageView::ItemChanged(views::ComboBox* sender, int prev_index, int new_index) { + if (prev_index == new_index) + return; + if (sender == change_ui_language_combobox_) { UserMetricsRecordAction(L"Options_AppLanguage", g_browser_process->local_state()); app_locale_.SetValue(ui_language_model_->GetLocaleFromIndex(new_index)); - RestartMessageBox::ShowMessageBox(GetRootWindow()); + if (!language_warning_shown_) { + RestartMessageBox::ShowMessageBox(GetRootWindow()); + language_warning_shown_ = true; + } } else if (sender == change_dictionary_language_combobox_) { - if (new_index != prev_index) - spellcheck_language_index_selected_ = new_index; + spellcheck_language_index_selected_ = new_index; } } diff --git a/chrome/browser/views/options/languages_page_view.h b/chrome/browser/views/options/languages_page_view.h index 9f5666d1..1f0b7c7 100644 --- a/chrome/browser/views/options/languages_page_view.h +++ b/chrome/browser/views/options/languages_page_view.h @@ -100,6 +100,7 @@ class LanguagesPageView : public OptionsPageView, int spellcheck_language_index_selected_; bool language_table_edited_; + bool language_warning_shown_; DISALLOW_EVIL_CONSTRUCTORS(LanguagesPageView); }; |