diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-27 13:22:57 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2009-01-27 13:22:57 +0800 |
commit | 4b140a897f1b45515ac9987e0b2d343c12f02f1c (patch) | |
tree | f6059f221bc93189d894659a96324a80a4da1f00 /addressbook | |
parent | 98d262b594caefd053a2d075e2d8482b2d8a12c8 (diff) | |
download | gsoc2013-evolution-4b140a897f1b45515ac9987e0b2d343c12f02f1c.tar.gz 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 'addressbook')
-rw-r--r-- | addressbook/gui/component/e-book-shell-view-actions.c | 19 | ||||
-rw-r--r-- | addressbook/gui/component/e-book-shell-view-private.c | 8 | ||||
-rw-r--r-- | addressbook/gui/component/e-book-shell-view-private.h | 5 |
3 files changed, 8 insertions, 24 deletions
diff --git a/addressbook/gui/component/e-book-shell-view-actions.c b/addressbook/gui/component/e-book-shell-view-actions.c index a264f7f84b..ed88b54855 100644 --- a/addressbook/gui/component/e-book-shell-view-actions.c +++ b/addressbook/gui/component/e-book-shell-view-actions.c @@ -839,21 +839,16 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) EShellView *shell_view; EShellWindow *shell_window; GtkActionGroup *action_group; - GtkUIManager *ui_manager; GConfBridge *bridge; GtkAction *action; GObject *object; - const gchar *domain; const gchar *key; shell_view = E_SHELL_VIEW (book_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; /* Contact Actions */ - action_group = book_shell_view->priv->contact_actions; - gtk_action_group_set_translation_domain (action_group, domain); + action_group = ACTION_GROUP (CONTACTS); gtk_action_group_add_actions ( action_group, contact_entries, G_N_ELEMENTS (contact_entries), book_shell_view); @@ -868,12 +863,6 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) G_N_ELEMENTS (contact_search_entries), CONTACT_SEARCH_NAME_CONTAINS, NULL, NULL); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); - - /* Filter Actions (empty) */ - action_group = book_shell_view->priv->filter_actions; - gtk_action_group_set_translation_domain (action_group, domain); - gtk_ui_manager_insert_action_group (ui_manager, action_group, 0); /* Lockdown Printing Actions */ action_group = ACTION_GROUP (LOCKDOWN_PRINTING); @@ -909,8 +898,9 @@ e_book_shell_view_actions_init (EBookShellView *book_shell_view) void e_book_shell_view_update_search_filter (EBookShellView *book_shell_view) { - EShellContent *shell_content; EShellView *shell_view; + EShellContent *shell_content; + EShellWindow *shell_window; GtkActionGroup *action_group; GtkRadioAction *radio_action; GList *list, *iter; @@ -919,8 +909,9 @@ e_book_shell_view_update_search_filter (EBookShellView *book_shell_view) shell_view = E_SHELL_VIEW (book_shell_view); shell_content = e_shell_view_get_shell_content (shell_view); - action_group = book_shell_view->priv->filter_actions; + shell_window = e_shell_view_get_shell_window (shell_view); + action_group = ACTION_GROUP (CONTACTS_FILTER); e_action_group_remove_all_actions (action_group); /* Add the standard filter actions. */ diff --git a/addressbook/gui/component/e-book-shell-view-private.c b/addressbook/gui/component/e-book-shell-view-private.c index 509547c6c0..c41e0672b4 100644 --- a/addressbook/gui/component/e-book-shell-view-private.c +++ b/addressbook/gui/component/e-book-shell-view-private.c @@ -420,8 +420,6 @@ e_book_shell_view_private_init (EBookShellView *book_shell_view, (GDestroyNotify) g_free); priv->source_list = g_object_ref (source_list); - priv->contact_actions = gtk_action_group_new ("contacts"); - priv->filter_actions = gtk_action_group_new ("contacts-filter"); priv->uid_to_view = uid_to_view; priv->uid_to_editor = uid_to_editor; @@ -448,6 +446,9 @@ e_book_shell_view_private_constructed (EBookShellView *book_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, "contacts"); + e_shell_window_add_action_group (shell_window, "contacts-filter"); + /* Cache these to avoid lots of awkward casting. */ priv->book_shell_content = g_object_ref (shell_content); priv->book_shell_sidebar = g_object_ref (shell_sidebar); @@ -491,9 +492,6 @@ e_book_shell_view_private_dispose (EBookShellView *book_shell_view) DISPOSE (priv->source_list); - DISPOSE (priv->contact_actions); - DISPOSE (priv->filter_actions); - DISPOSE (priv->book_shell_content); DISPOSE (priv->book_shell_sidebar); diff --git a/addressbook/gui/component/e-book-shell-view-private.h b/addressbook/gui/component/e-book-shell-view-private.h index 050c13d6eb..6f0d0af147 100644 --- a/addressbook/gui/component/e-book-shell-view-private.h +++ b/addressbook/gui/component/e-book-shell-view-private.h @@ -96,11 +96,6 @@ struct _EBookShellViewPrivate { ESourceList *source_list; - /*** UI Management ***/ - - GtkActionGroup *contact_actions; - GtkActionGroup *filter_actions; - /*** Other Stuff ***/ /* These are just for convenience. */ |