aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-09-07 07:23:57 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-09-09 02:53:45 +0800
commitfa9051e04051156a9e11e2af72a0d7342f4ea2e4 (patch)
tree0d064bddb366257c660722359dc33f5ef3c610c7 /shell
parentc9e7aa7aee6b407659843131cc8becdafa71992a (diff)
downloadgsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.gz
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.bz2
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.lz
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.xz
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.tar.zst
gsoc2013-evolution-fa9051e04051156a9e11e2af72a0d7342f4ea2e4.zip
Finish killing Bonobo.
Diffstat (limited to 'shell')
-rw-r--r--shell/e-shell-view.c10
-rw-r--r--shell/e-shell-window-private.c16
-rw-r--r--shell/e-shell.c34
3 files changed, 20 insertions, 40 deletions
diff --git a/shell/e-shell-view.c b/shell/e-shell-view.c
index f580b1aa4e..0bfa17c0cc 100644
--- a/shell/e-shell-view.c
+++ b/shell/e-shell-view.c
@@ -401,6 +401,12 @@ shell_view_constructed (GObject *object)
/* Invoke factory methods. */
+ /* Create the taskbar widget first so the content and
+ * sidebar widgets can access it during construction. */
+ widget = shell_view_class->new_shell_taskbar (shell_view);
+ shell_view->priv->shell_taskbar = g_object_ref_sink (widget);
+ gtk_widget_show (widget);
+
widget = shell_view_class->new_shell_content (shell_view);
shell_view->priv->shell_content = g_object_ref_sink (widget);
gtk_widget_show (widget);
@@ -409,10 +415,6 @@ shell_view_constructed (GObject *object)
shell_view->priv->shell_sidebar = g_object_ref_sink (widget);
gtk_widget_show (widget);
- widget = shell_view_class->new_shell_taskbar (shell_view);
- shell_view->priv->shell_taskbar = g_object_ref_sink (widget);
- gtk_widget_show (widget);
-
/* Size group should be safe to unreference now. */
g_object_unref (shell_view->priv->size_group);
shell_view->priv->size_group = NULL;
diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c
index 2cf24ba061..2934a82730 100644
--- a/shell/e-shell-window-private.c
+++ b/shell/e-shell-window-private.c
@@ -107,23 +107,20 @@ shell_window_init_switcher_style (EShellWindow *shell_window)
static void
shell_window_menu_item_select_cb (EShellWindow *shell_window,
- GtkWidget *menu_item)
+ GtkWidget *widget)
{
GtkAction *action;
GtkLabel *label;
- gchar *tooltip = NULL;
+ const gchar *tooltip;
- action = g_object_get_data (G_OBJECT (menu_item), "action");
- g_return_if_fail (GTK_IS_ACTION (action));
-
- g_object_get (action, "tooltip", &tooltip, NULL);
+ action = gtk_widget_get_action (widget);
+ tooltip = gtk_action_get_tooltip (action);
if (tooltip == NULL)
return;
label = GTK_LABEL (shell_window->priv->tooltip_label);
gtk_label_set_text (label, tooltip);
- g_free (tooltip);
gtk_widget_show (shell_window->priv->tooltip_label);
gtk_widget_hide (shell_window->priv->status_notebook);
@@ -144,11 +141,6 @@ shell_window_connect_proxy_cb (EShellWindow *shell_window,
if (!GTK_IS_MENU_ITEM (proxy))
return;
- g_object_set_data_full (
- G_OBJECT (proxy),
- "action", g_object_ref (action),
- (GDestroyNotify) g_object_unref);
-
g_signal_connect_swapped (
proxy, "select",
G_CALLBACK (shell_window_menu_item_select_cb),
diff --git a/shell/e-shell.c b/shell/e-shell.c
index d2a82675ae..bf664649fc 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -371,7 +371,7 @@ shell_load_modules (EShell *shell)
}
}
-/* Helper for shell_process_backend() */
+/* Helper for shell_add_backend() */
static void
shell_split_and_insert_items (GHashTable *hash_table,
const gchar *items,
@@ -392,14 +392,17 @@ shell_split_and_insert_items (GHashTable *hash_table,
}
static void
-shell_process_backend (EShell *shell,
- EShellBackend *shell_backend)
+shell_add_backend (GType type,
+ EShell *shell)
{
EShellBackendClass *class;
+ EShellBackend *shell_backend;
GHashTable *backends_by_name;
GHashTable *backends_by_scheme;
const gchar *string;
+ shell_backend = g_object_new (type, "shell", shell, NULL);
+
shell->priv->loaded_backends = g_list_insert_sorted (
shell->priv->loaded_backends, shell_backend,
(GCompareFunc) e_shell_backend_compare);
@@ -425,26 +428,6 @@ shell_process_backend (EShell *shell,
}
static void
-shell_create_backends (EShell *shell)
-{
- GType *children;
- guint ii, n_children;
-
- /* Create an instance of each EShellBackend subclass. */
- children = g_type_children (E_TYPE_SHELL_BACKEND, &n_children);
-
- for (ii = 0; ii < n_children; ii++) {
- EShellBackend *shell_backend;
- GType type = children[ii];
-
- shell_backend = g_object_new (type, "shell", shell, NULL);
- shell_process_backend (shell, shell_backend);
- }
-
- g_free (children);
-}
-
-static void
shell_sm_quit_requested_cb (EShell *shell,
EggSMClient *sm_client)
{
@@ -596,7 +579,10 @@ shell_constructed (GObject *object)
e_file_lock_create ();
shell_load_modules (E_SHELL (object));
- shell_create_backends (E_SHELL (object));
+
+ e_type_traverse (
+ E_TYPE_SHELL_BACKEND, (ETypeFunc)
+ shell_add_backend, object);
}
static gboolean