diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-18 02:18:31 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-06-18 02:18:31 +0000 |
commit | a29928fc2e031c55c5f90869d2492a22fa68adc3 (patch) | |
tree | 57c341b3700f0bf1491020e7b844fe8324711edb /chrome | |
parent | 09dd56ed5a64e726f8eb47c5fbcb5846ebd2c73e (diff) | |
download | chromium_src-a29928fc2e031c55c5f90869d2492a22fa68adc3.zip chromium_src-a29928fc2e031c55c5f90869d2492a22fa68adc3.tar.gz chromium_src-a29928fc2e031c55c5f90869d2492a22fa68adc3.tar.bz2 |
GTK: disable "OK" in App shortcut creation dialog when appropriate.
BUG=46706
TEST=see bug
Review URL: http://codereview.chromium.org/2845014
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc | 17 | ||||
-rw-r--r-- | chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h | 3 |
2 files changed, 20 insertions, 0 deletions
diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc index 9859646..5da0c61 100644 --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.cc @@ -68,12 +68,16 @@ CreateApplicationShortcutsDialogGtk::CreateApplicationShortcutsDialogGtk( l10n_util::GetStringUTF8(IDS_CREATE_SHORTCUTS_DESKTOP_CHKBOX).c_str()); gtk_box_pack_start(GTK_BOX(vbox), desktop_checkbox_, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(desktop_checkbox_), true); + g_signal_connect(desktop_checkbox_, "toggled", + G_CALLBACK(OnToggleCheckboxThunk), this); // Menu checkbox. menu_checkbox_ = gtk_check_button_new_with_label( l10n_util::GetStringUTF8(IDS_CREATE_SHORTCUTS_MENU_CHKBOX).c_str()); gtk_box_pack_start(GTK_BOX(vbox), menu_checkbox_, FALSE, FALSE, 0); gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(menu_checkbox_), false); + g_signal_connect(menu_checkbox_, "toggled", + G_CALLBACK(OnToggleCheckboxThunk), this); g_signal_connect(create_dialog_, "response", G_CALLBACK(OnCreateDialogResponseThunk), this); @@ -174,3 +178,16 @@ void CreateApplicationShortcutsDialogGtk::ShowErrorDialog() { G_CALLBACK(OnErrorDialogResponseThunk), this); gtk_widget_show_all(error_dialog_); } + +void CreateApplicationShortcutsDialogGtk::OnToggleCheckbox(GtkWidget* sender) { + gboolean can_accept = FALSE; + + if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(desktop_checkbox_)) || + gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(menu_checkbox_))) { + can_accept = TRUE; + } + + gtk_dialog_set_response_sensitive(GTK_DIALOG(create_dialog_), + GTK_RESPONSE_ACCEPT, + can_accept); +} diff --git a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h index 8196ad7..6ee0336 100644 --- a/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h +++ b/chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h @@ -40,6 +40,9 @@ class CreateApplicationShortcutsDialogGtk CHROMEGTK_CALLBACK_1(CreateApplicationShortcutsDialogGtk, void, OnErrorDialogResponse, int); + CHROMEGTK_CALLBACK_0(CreateApplicationShortcutsDialogGtk, void, + OnToggleCheckbox); + void CreateDesktopShortcut( const ShellIntegration::ShortcutInfo& shortcut_info); void ShowErrorDialog(); |