diff options
author | Christian Persch <chpe@cvs.gnome.org> | 2005-02-03 03:53:26 +0800 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2005-02-03 03:53:26 +0800 |
commit | fd568c15b290afbdc80b2864f65c954cdff420e4 (patch) | |
tree | 7e4db887f86434a9a478f0b16b11bc242977324a /src/ephy-window.c | |
parent | e074659671a4545808f509de37597fc9161bb993 (diff) | |
download | gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.tar gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.tar.gz gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.tar.bz2 gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.tar.lz gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.tar.xz gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.tar.zst gsoc2013-epiphany-fd568c15b290afbdc80b2864f65c954cdff420e4.zip |
Revert the fix for bug #165550, it wasn't correct.
2005-02-02 Christian Persch <chpe@cvs.gnome.org>
* src/ephy-window.c: (sync_chromes_visibility), (setup_ui_manager),
(ephy_window_set_print_preview):
Revert the fix for bug #165550, it wasn't correct.
Diffstat (limited to 'src/ephy-window.c')
-rw-r--r-- | src/ephy-window.c | 46 |
1 files changed, 16 insertions, 30 deletions
diff --git a/src/ephy-window.c b/src/ephy-window.c index 17695d395..4a7adbc45 100644 --- a/src/ephy-window.c +++ b/src/ephy-window.c @@ -548,8 +548,6 @@ sync_chromes_visibility (EphyWindow *window) { EphyWindowPrivate *priv = window->priv; GtkWidget *menubar; - GtkAccelGroup *accel_group; - GSList *groups; gboolean show_statusbar, show_menubar, show_toolbar, show_bookmarksbar; get_chromes_visibility (window, &show_menubar, @@ -570,23 +568,6 @@ sync_chromes_visibility (EphyWindow *window) { g_object_set (priv->fullscreen_popup, "visible", !show_toolbar, NULL); } - - /* en/disable accel group */ - accel_group = gtk_ui_manager_get_accel_group (window->priv->manager); - groups = gtk_accel_groups_from_object (G_OBJECT (window)); - - if (priv->chrome & EPHY_EMBED_CHROME_MENUBAR && - priv->ppv_mode == FALSE) - { - if (g_slist_find (groups, accel_group) == NULL) - { - gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); - } - } - else if (g_slist_find (groups, accel_group) != NULL) - { - gtk_window_remove_accel_group (GTK_WINDOW (window), accel_group); - } } static void @@ -1179,6 +1160,8 @@ setup_ui_manager (EphyWindow *window) window->priv->manager = manager; g_signal_connect (manager, "add_widget", G_CALLBACK (add_widget), window); + gtk_window_add_accel_group (GTK_WINDOW (window), + gtk_ui_manager_get_accel_group (manager)); } static void @@ -2803,30 +2786,33 @@ ephy_window_new_with_chrome (EphyEmbedChrome chrome) * Sets whether the window is in print preview mode. **/ void -ephy_window_set_print_preview (EphyWindow *window, - gboolean enabled) +ephy_window_set_print_preview (EphyWindow *window, gboolean enabled) { - EphyWindowPrivate *priv = window->priv; + GtkAccelGroup *accel_group; - if (priv->ppv_mode == enabled) return; + accel_group = gtk_ui_manager_get_accel_group (window->priv->manager); + + if (window->priv->ppv_mode == enabled) return; - priv->ppv_mode = enabled; + window->priv->ppv_mode = enabled; sync_chromes_visibility (window); - ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (priv->notebook), !enabled); + ephy_notebook_set_show_tabs (EPHY_NOTEBOOK (window->priv->notebook), !enabled); if (enabled) { - g_return_if_fail (priv->ppview_toolbar == NULL); + g_return_if_fail (window->priv->ppview_toolbar == NULL); - priv->ppview_toolbar = ppview_toolbar_new (window); + window->priv->ppview_toolbar = ppview_toolbar_new (window); + gtk_window_remove_accel_group (GTK_WINDOW (window), accel_group); } else { - g_return_if_fail (priv->ppview_toolbar != NULL); + g_return_if_fail (window->priv->ppview_toolbar != NULL); - g_object_unref (priv->ppview_toolbar); - priv->ppview_toolbar = NULL; + g_object_unref (window->priv->ppview_toolbar); + window->priv->ppview_toolbar = NULL; + gtk_window_add_accel_group (GTK_WINDOW (window), accel_group); } g_object_notify (G_OBJECT (window), "print-preview-mode"); |