aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-09 13:13:07 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-09 13:13:07 +0800
commit2b9c72826a8574385d0360267217cc068e27a910 (patch)
tree7793d8e5cfb7785417c69117e04c3e76fecf64c4
parent19f1e3fe20c29690aaf07d26e81760405cc577df (diff)
downloadgsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.tar
gsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.tar.gz
gsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.tar.bz2
gsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.tar.lz
gsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.tar.xz
gsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.tar.zst
gsoc2013-evolution-2b9c72826a8574385d0360267217cc068e27a910.zip
Fix a weird UI merging bug.
svn path=/branches/kill-bonobo/; revision=37020
-rw-r--r--mail/e-mail-shell-view.c8
-rw-r--r--shell/e-shell-view.c8
2 files changed, 12 insertions, 4 deletions
diff --git a/mail/e-mail-shell-view.c b/mail/e-mail-shell-view.c
index f71f988467..3be18b9804 100644
--- a/mail/e-mail-shell-view.c
+++ b/mail/e-mail-shell-view.c
@@ -71,6 +71,7 @@ mail_shell_view_toggled (EShellView *shell_view)
EShellWindow *shell_window;
GtkUIManager *ui_manager;
const gchar *basename;
+ gboolean view_is_active;
/* Chain up to parent's toggled() method. */
E_SHELL_VIEW_CLASS (parent_class)->toggled (shell_view);
@@ -79,15 +80,18 @@ mail_shell_view_toggled (EShellView *shell_view)
shell_window = e_shell_view_get_shell_window (shell_view);
ui_manager = e_shell_window_get_ui_manager (shell_window);
+ view_is_active = e_shell_view_is_active (shell_view);
basename = E_MAIL_READER_UI_DEFINITION;
- if (e_shell_view_is_active (shell_view)) {
+ if (view_is_active && priv->merge_id == 0) {
priv->merge_id = e_load_ui_definition (ui_manager, basename);
e_mail_reader_create_charset_menu (
E_MAIL_READER (priv->mail_shell_content),
ui_manager, priv->merge_id);
- } else
+ } else if (!view_is_active && priv->merge_id != 0) {
gtk_ui_manager_remove_ui (ui_manager, priv->merge_id);
+ priv->merge_id = 0;
+ }
gtk_ui_manager_ensure_update (ui_manager);
}
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index 16c90b6e4e..f1f1ffb476 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -349,16 +349,20 @@ shell_view_toggled (EShellView *shell_view)
EShellWindow *shell_window;
GtkUIManager *ui_manager;
const gchar *basename;
+ gboolean view_is_active;
shell_view_class = E_SHELL_VIEW_GET_CLASS (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
ui_manager = e_shell_window_get_ui_manager (shell_window);
+ view_is_active = e_shell_view_is_active (shell_view);
basename = shell_view_class->ui_definition;
- if (e_shell_view_is_active (shell_view))
+ if (view_is_active && priv->merge_id == 0)
priv->merge_id = e_load_ui_definition (ui_manager, basename);
- else
+ else if (!view_is_active && priv->merge_id != 0) {
gtk_ui_manager_remove_ui (ui_manager, priv->merge_id);
+ priv->merge_id = 0;
+ }
gtk_ui_manager_ensure_update (ui_manager);
}