aboutsummaryrefslogtreecommitdiffstats
path: root/shell/e-shell-window-actions.c
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2009-12-02 08:38:52 +0800
committerMatthew Barnes <mbarnes@redhat.com>2009-12-02 11:27:11 +0800
commit793e57e24ca2ac458baa0897ad971dfbf08e8291 (patch)
treebaf73cba7ce97485e03502d4eab2f551120bfb7e /shell/e-shell-window-actions.c
parent9379111ae48dd0e9eaea3fcdd14593414a60c115 (diff)
downloadgsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.tar
gsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.tar.gz
gsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.tar.bz2
gsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.tar.lz
gsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.tar.xz
gsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.tar.zst
gsoc2013-evolution-793e57e24ca2ac458baa0897ad971dfbf08e8291.zip
Add private virtual methods to EShellWindowClass.
So Anjal can override what it needs to for its own purpose. Also makes the EShellWindow design a little cleaner. Methods added: GtkWidget * (*construct_menubar) (EShellWindow *shell_window); GtkWidget * (*construct_toolbar) (EShellWindow *shell_window); GtkWidget * (*construct_sidebar) (EShellWindow *shell_window); GtkWidget * (*construct_content) (EShellWindow *shell_window); GtkWidget * (*construct_taskbar) (EShellWindow *shell_window); EShellView * (*create_shell_view) (EShellWindow *shell_window, const gchar *view_name); Also added some new GObject properties to help decouple actions from internal EShellWindow widgets created by these methods: EShellWindow:sidebar-visible EShellWindow:switcher-visible EShellWindow:taskbar-visible EShellWindow:toolbar-visible
Diffstat (limited to 'shell/e-shell-window-actions.c')
-rw-r--r--shell/e-shell-window-actions.c97
1 files changed, 33 insertions, 64 deletions
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c
index d961ebef55..fdaac72abd 100644
--- a/shell/e-shell-window-actions.c
+++ b/shell/e-shell-window-actions.c
@@ -1192,60 +1192,24 @@ action_send_receive_cb (GtkAction *action,
*
* Main menu item: View -> Layout -> Show Side Bar
**/
-static void
-action_show_sidebar_cb (GtkToggleAction *action,
- EShellWindow *shell_window)
-{
- GtkPaned *paned;
- GtkWidget *widget;
- gboolean active;
-
- paned = GTK_PANED (shell_window->priv->content_pane);
-
- widget = gtk_paned_get_child1 (paned);
- active = gtk_toggle_action_get_active (action);
- g_object_set (widget, "visible", active, NULL);
-}
/**
- * E_SHELL_WINDOW_ACTION_SHOW_STATUSBAR:
+ * E_SHELL_WINDOW_ACTION_SHOW_SWITCHER:
* @window: an #EShellWindow
*
- * This toggle action controls whether the status bar is visible.
+ * This toggle action controls whether the switcher buttons are visible.
*
- * Main menu item: View -> Layout -> Show Status Bar
+ * Main menu item: View -> Switcher Appearance -> Show Buttons
**/
-static void
-action_show_statusbar_cb (GtkToggleAction *action,
- EShellWindow *shell_window)
-{
- GtkWidget *widget;
- gboolean active;
-
- widget = shell_window->priv->status_area;
- active = gtk_toggle_action_get_active (action);
- g_object_set (widget, "visible", active, NULL);
-}
/**
- * E_SHELL_WINDOW_ACTION_SHOW_SWITCHER:
+ * E_SHELL_WINDOW_ACTION_SHOW_TASKBAR:
* @window: an #EShellWindow
*
- * This toggle action controls whether the switcher buttons are visible.
+ * This toggle action controls whether the task bar is visible.
*
- * Main menu item: View -> Switcher Appearance -> Show Buttons
+ * Main menu item: View -> Layout -> Show Status Bar
**/
-static void
-action_show_switcher_cb (GtkToggleAction *action,
- EShellWindow *shell_window)
-{
- EShellSwitcher *switcher;
- gboolean active;
-
- switcher = E_SHELL_SWITCHER (shell_window->priv->switcher);
- active = gtk_toggle_action_get_active (action);
- e_shell_switcher_set_visible (switcher, active);
-}
/**
* E_SHELL_WINDOW_ACTION_SHOW_TOOLBAR:
@@ -1255,17 +1219,6 @@ action_show_switcher_cb (GtkToggleAction *action,
*
* Main menu item: View -> Layout -> Show Tool Bar
**/
-static void
-action_show_toolbar_cb (GtkToggleAction *action,
- EShellWindow *shell_window)
-{
- GtkWidget *widget;
- gboolean active;
-
- widget = shell_window->priv->main_toolbar;
- active = gtk_toggle_action_get_active (action);
- g_object_set (widget, "visible", active, NULL);
-}
/**
* E_SHELL_WINDOW_ACTION_SUBMIT_BUG:
@@ -1708,15 +1661,7 @@ static GtkToggleActionEntry shell_toggle_entries[] = {
N_("Show Side _Bar"),
NULL,
N_("Show the side bar"),
- G_CALLBACK (action_show_sidebar_cb),
- TRUE },
-
- { "show-statusbar",
- NULL,
- N_("Show _Status Bar"),
NULL,
- N_("Show the status bar"),
- G_CALLBACK (action_show_statusbar_cb),
TRUE },
{ "show-switcher",
@@ -1724,15 +1669,23 @@ static GtkToggleActionEntry shell_toggle_entries[] = {
N_("Show _Buttons"),
NULL,
N_("Show the switcher buttons"),
- G_CALLBACK (action_show_switcher_cb),
+ NULL,
+ TRUE },
+
+ { "show-taskbar",
+ NULL,
+ N_("Show _Status Bar"),
+ NULL,
+ N_("Show the status bar"),
+ NULL,
TRUE },
{ "show-toolbar",
NULL,
N_("Show _Tool Bar"),
NULL,
- N_("Show the toolbar"),
- G_CALLBACK (action_show_toolbar_cb),
+ N_("Show the tool bar"),
+ NULL,
TRUE }
};
@@ -1932,6 +1885,22 @@ e_shell_window_actions_init (EShellWindow *shell_window)
g_object_set (ACTION (SEND_RECEIVE), "is-important", TRUE, NULL);
+ e_mutual_binding_new (
+ shell_window, "sidebar-visible",
+ ACTION (SHOW_SIDEBAR), "active");
+
+ e_mutual_binding_new (
+ shell_window, "switcher-visible",
+ ACTION (SHOW_SWITCHER), "active");
+
+ e_mutual_binding_new (
+ shell_window, "taskbar-visible",
+ ACTION (SHOW_TASKBAR), "active");
+
+ e_mutual_binding_new (
+ shell_window, "toolbar-visible",
+ ACTION (SHOW_TOOLBAR), "active");
+
e_binding_new (
ACTION (SHOW_SIDEBAR), "active",
ACTION (SHOW_SWITCHER), "sensitive");