diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2006-07-11 03:28:01 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2006-07-11 03:28:01 +0800 |
commit | 2a9853a35481dd27d4aad63523c01c00b636d024 (patch) | |
tree | 73587b51ed5eed719465f357a6f3010042fc97e6 | |
parent | 22932f6b1bd176b72473df2a9e05d04448929006 (diff) | |
download | gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.tar gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.tar.gz gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.tar.bz2 gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.tar.lz gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.tar.xz gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.tar.zst gsoc2013-epiphany-2a9853a35481dd27d4aad63523c01c00b636d024.zip |
Fix for empty menubar accel setting. Don't activate insensitive actions,
2006-07-10 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-window.c: (settings_change_notify),
(ephy_window_key_press_event):
Fix for empty menubar accel setting.
Don't activate insensitive actions, bug #347022.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/ephy-window.c | 32 |
2 files changed, 33 insertions, 7 deletions
@@ -1,5 +1,13 @@ 2006-07-10 Christian Persch <chpe@cvs.gnome.org> + * src/ephy-window.c: (settings_change_notify), + (ephy_window_key_press_event): + + Fix for empty menubar accel setting. + Don't activate insensitive actions, bug #347022. + +2006-07-10 Christian Persch <chpe@cvs.gnome.org> + * lib/widgets/ephy-location-entry.c: (entry_key_press_cb), (entry_key_press_after_cb), (entry_activate_after_cb), (match_selected_cb), (action_activated_after_cb), diff --git a/src/ephy-window.c b/src/ephy-window.c index 14ecf0f8e..332c5dcfb 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -511,10 +511,23 @@ settings_change_notify (GtkSettings *settings, NULL); g_return_if_fail (menubar_accel_accel != NULL); - - gtk_accelerator_parse (menubar_accel_accel, - &priv->menubar_accel_keyval, - &priv->menubar_accel_modifier); + + if (menubar_accel_accel != NULL && menubar_accel_accel[0] != '\0') + { + gtk_accelerator_parse (menubar_accel_accel, + &priv->menubar_accel_keyval, + &priv->menubar_accel_modifier); + if (priv->menubar_accel_keyval == 0) + { + g_warning ("Failed to parse menu bar accelerator '%s'\n", + menubar_accel_accel); + } + } + else + { + priv->menubar_accel_keyval = 0; + priv->menubar_accel_modifier = 0; + } priv->key_theme_is_emacs = key_theme_name && @@ -819,8 +832,12 @@ ephy_window_key_press_event (GtkWidget *widget, ephy_toolbar_get_action_group (priv->toolbar) : priv->action_group, extra_keybindings[i].action); - gtk_action_activate (action); - return TRUE; + if (gtk_action_is_sensitive (action)) + { + gtk_action_activate (action); + return TRUE; + } + break; } } @@ -831,7 +848,8 @@ ephy_window_key_press_event (GtkWidget *widget, } /* Show and activate the menubar, if it isn't visible */ - if (event->keyval == priv->menubar_accel_keyval && + if (priv->menubar_accel_keyval != 0 && + event->keyval == priv->menubar_accel_keyval && modifier == priv->menubar_accel_modifier) { menubar = gtk_ui_manager_get_widget (window->priv->manager, "/menubar"); |