aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2009-01-27 13:22:57 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2009-01-27 13:22:57 +0800
commit4b140a897f1b45515ac9987e0b2d343c12f02f1c (patch)
treef6059f221bc93189d894659a96324a80a4da1f00 /mail
parent98d262b594caefd053a2d075e2d8482b2d8a12c8 (diff)
downloadgsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar
gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar.gz
gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar.bz2
gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar.lz
gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar.xz
gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar.zst
gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.zip
Make action group management in shell windows more elegant.
svn path=/branches/kill-bonobo/; revision=37137
Diffstat (limited to 'mail')
-rw-r--r--mail/e-mail-shell-content.c3
-rw-r--r--mail/e-mail-shell-view-actions.c9
-rw-r--r--mail/e-mail-shell-view-actions.h2
-rw-r--r--mail/e-mail-shell-view-private.c15
-rw-r--r--mail/e-mail-shell-view-private.h5
5 files changed, 11 insertions, 23 deletions
diff --git a/mail/e-mail-shell-content.c b/mail/e-mail-shell-content.c
index 5019d234bc..7b91ae1934 100644
--- a/mail/e-mail-shell-content.c
+++ b/mail/e-mail-shell-content.c
@@ -37,6 +37,7 @@
#include "e-mail-reader.h"
#include "e-mail-shell-module.h"
+#include "e-mail-shell-view-actions.h"
#define E_MAIL_SHELL_CONTENT_GET_PRIVATE(obj) \
(G_TYPE_INSTANCE_GET_PRIVATE \
@@ -431,7 +432,7 @@ mail_shell_content_get_action_group (EMailReader *reader)
shell_view = e_shell_content_get_shell_view (shell_content);
shell_window = e_shell_view_get_shell_window (shell_view);
- return e_shell_window_get_action_group (shell_window, "mail");
+ return E_SHELL_WINDOW_ACTION_GROUP_MAIL (shell_window);
}
static gboolean
diff --git a/mail/e-mail-shell-view-actions.c b/mail/e-mail-shell-view-actions.c
index c0e08f4270..3c3cae101c 100644
--- a/mail/e-mail-shell-view-actions.c
+++ b/mail/e-mail-shell-view-actions.c
@@ -1011,21 +1011,17 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view)
EShellView *shell_view;
EShellWindow *shell_window;
GtkActionGroup *action_group;
- GtkUIManager *ui_manager;
GConfBridge *bridge;
GObject *object;
GObject *src_object;
GObject *dst_object;
- const gchar *domain;
const gchar *key;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
- ui_manager = e_shell_window_get_ui_manager (shell_window);
- domain = GETTEXT_PACKAGE;
- action_group = mail_shell_view->priv->mail_actions;
- gtk_action_group_set_translation_domain (action_group, domain);
+ /* Mail Actions */
+ action_group = ACTION_GROUP (MAIL);
gtk_action_group_add_actions (
action_group, mail_entries,
G_N_ELEMENTS (mail_entries), mail_shell_view);
@@ -1049,7 +1045,6 @@ e_mail_shell_view_actions_init (EMailShellView *mail_shell_view)
G_N_ELEMENTS (mail_scope_entries),
MAIL_SCOPE_CURRENT_FOLDER,
NULL, NULL);
- gtk_ui_manager_insert_action_group (ui_manager, action_group, 0);
/* Bind GObject properties for GConf keys. */
diff --git a/mail/e-mail-shell-view-actions.h b/mail/e-mail-shell-view-actions.h
index 7e144ad4d7..3760b39da9 100644
--- a/mail/e-mail-shell-view-actions.h
+++ b/mail/e-mail-shell-view-actions.h
@@ -255,5 +255,7 @@
/* Action Groups */
#define E_SHELL_WINDOW_ACTION_GROUP_MAIL(window) \
E_SHELL_WINDOW_ACTION_GROUP ((window), "mail")
+#define E_SHELL_WINDOW_ACTION_GROUP_MAIL_FILTER(window) \
+ E_SHELL_WINDOW_ACTION_GROUP ((window), "mail-filter")
#endif /* E_MAIL_SHELL_VIEW_ACTIONS_H */
diff --git a/mail/e-mail-shell-view-private.c b/mail/e-mail-shell-view-private.c
index 160e1b8828..b9fe7ab4fd 100644
--- a/mail/e-mail-shell-view-private.c
+++ b/mail/e-mail-shell-view-private.c
@@ -141,13 +141,6 @@ void
e_mail_shell_view_private_init (EMailShellView *mail_shell_view,
EShellViewClass *shell_view_class)
{
- EMailShellViewPrivate *priv = mail_shell_view->priv;
-
- /* Note: EMailShellContent retrieves the "mail" action group
- * by name to satisfy its EMailReader interface. */
- priv->mail_actions = gtk_action_group_new ("mail");
- priv->filter_actions = gtk_action_group_new ("mail-filter");
-
if (!gal_view_collection_loaded (shell_view_class->view_collection))
mail_shell_view_load_view_collection (shell_view_class);
@@ -164,6 +157,7 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
EShellView *shell_view;
EShellContent *shell_content;
EShellSidebar *shell_sidebar;
+ EShellWindow *shell_window;
EMFolderTreeModel *folder_tree_model;
EMFolderTree *folder_tree;
MessageList *message_list;
@@ -173,6 +167,10 @@ e_mail_shell_view_private_constructed (EMailShellView *mail_shell_view)
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_content = e_shell_view_get_shell_content (shell_view);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ shell_window = e_shell_view_get_shell_window (shell_view);
+
+ e_shell_window_add_action_group (shell_window, "mail");
+ e_shell_window_add_action_group (shell_window, "mail-filter");
/* Cache these to avoid lots of awkward casting. */
priv->mail_shell_content = g_object_ref (shell_content);
@@ -237,9 +235,6 @@ e_mail_shell_view_private_dispose (EMailShellView *mail_shell_view)
{
EMailShellViewPrivate *priv = mail_shell_view->priv;
- DISPOSE (priv->mail_actions);
- DISPOSE (priv->filter_actions);
-
DISPOSE (priv->mail_shell_content);
DISPOSE (priv->mail_shell_sidebar);
}
diff --git a/mail/e-mail-shell-view-private.h b/mail/e-mail-shell-view-private.h
index a6f493216b..87c300213b 100644
--- a/mail/e-mail-shell-view-private.h
+++ b/mail/e-mail-shell-view-private.h
@@ -113,11 +113,6 @@ enum {
struct _EMailShellViewPrivate {
- /*** UI Management ***/
-
- GtkActionGroup *mail_actions;
- GtkActionGroup *filter_actions;
-
/*** Other Stuff ***/
/* These are just for convenience. */