diff options
author | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-14 04:31:08 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2008-08-14 04:31:08 +0800 |
commit | 08bd7765721e5d866c4d7a546b94f691cf62d972 (patch) | |
tree | aaca52e83da675b32534d29176e94ebc0b13a53b /shell | |
parent | 5f6a18500c3119731663ac4c059426c62a3b37f6 (diff) | |
download | gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.gz gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.bz2 gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.lz gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.xz gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.tar.zst gsoc2013-evolution-08bd7765721e5d866c4d7a546b94f691cf62d972.zip |
Get a basic shell window working.
svn path=/branches/kill-bonobo/; revision=35982
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-window-actions.c | 122 | ||||
-rw-r--r-- | shell/e-shell-window-actions.h | 4 | ||||
-rw-r--r-- | shell/e-shell-window-private.c | 19 | ||||
-rw-r--r-- | shell/e-sidebar.c | 6 | ||||
-rw-r--r-- | shell/e-sidebar.h | 7 |
5 files changed, 119 insertions, 39 deletions
diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 0f959fa668..81934a46ea 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -668,6 +668,13 @@ action_close_cb (GtkAction *action, } static void +action_contents_cb (GtkAction *action, + EShellWindow *window) +{ + /* FIXME Unfinished. */ +} + +static void action_faq_cb (GtkAction *action, EShellWindow *window) { @@ -801,18 +808,6 @@ action_shell_view_cb (GtkRadioAction *action, } static void -action_show_buttons_cb (GtkToggleAction *action, - EShellWindow *window) -{ - ESidebar *sidebar; - gboolean active; - - sidebar = E_SIDEBAR (window->priv->sidebar); - active = gtk_toggle_action_get_active (action); - e_sidebar_set_actions_visible (sidebar, active); -} - -static void action_show_sidebar_cb (GtkToggleAction *action, EShellWindow *window) { @@ -837,6 +832,18 @@ action_show_statusbar_cb (GtkToggleAction *action, } static void +action_show_switcher_cb (GtkToggleAction *action, + EShellWindow *window) +{ + ESidebar *sidebar; + gboolean active; + + sidebar = E_SIDEBAR (window->priv->sidebar); + active = gtk_toggle_action_get_active (action); + e_sidebar_set_actions_visible (sidebar, active); +} + +static void action_show_toolbar_cb (GtkToggleAction *action, EShellWindow *window) { @@ -873,6 +880,14 @@ action_submit_bug_cb (GtkAction *action, } static void +action_switcher_style_cb (GtkRadioAction *action, + GtkRadioAction *current, + EShellWindow *window) +{ + /* FIXME Unfinished. */ +} + +static void action_sync_options_cb (GtkAction *action, EShellWindow *window) { @@ -914,7 +929,7 @@ static GtkActionEntry shell_entries[] = { { "about", GTK_STOCK_ABOUT, - N_("_About"), + NULL, NULL, N_("Show information about Evolution"), G_CALLBACK (action_about_cb) }, @@ -926,6 +941,13 @@ static GtkActionEntry shell_entries[] = { N_("Close this window"), G_CALLBACK (action_close_cb) }, + { "contents", + GTK_STOCK_HELP, + N_("_Contents"), + NULL, + N_("Open the Evolution User Guide"), + G_CALLBACK (action_contents_cb) }, + { "faq", GTK_STOCK_DIALOG_INFO, N_("Evolution _FAQ"), @@ -956,14 +978,14 @@ static GtkActionEntry shell_entries[] = { { "page-setup", GTK_STOCK_PAGE_SETUP, - N_("Page Set_up..."), + NULL, NULL, N_("Change the page settings for your current printer"), G_CALLBACK (action_page_setup_cb) }, { "preferences", GTK_STOCK_PREFERENCES, - N_("Prefere_nces"), + NULL, "<Control><Shift>s", N_("Configure Evolution"), G_CALLBACK (action_preferences_cb) }, @@ -977,8 +999,8 @@ static GtkActionEntry shell_entries[] = { { "quit", GTK_STOCK_QUIT, - N_("_Quit"), - "<Control>q", + NULL, + NULL, N_("Exit the program"), G_CALLBACK (action_quit_cb) }, @@ -1040,6 +1062,13 @@ static GtkActionEntry shell_entries[] = { NULL, NULL }, + { "layout-menu", + NULL, + N_("Lay_out"), + NULL, + NULL, + NULL }, + { "new-menu", GTK_STOCK_NEW, N_("_New"), @@ -1054,6 +1083,13 @@ static GtkActionEntry shell_entries[] = { NULL, NULL }, + { "switcher-menu", + NULL, + N_("_Switcher Appearance"), + NULL, + NULL, + NULL }, + { "view-menu", NULL, N_("_View"), @@ -1071,14 +1107,6 @@ static GtkActionEntry shell_entries[] = { static GtkToggleActionEntry shell_toggle_entries[] = { - { "show-buttons", - NULL, - N_("Show _Buttons"), - NULL, - N_("Show the switcher buttons"), - G_CALLBACK (action_show_buttons_cb), - TRUE }, - { "show-sidebar", NULL, N_("Show Side _Bar"), @@ -1095,6 +1123,14 @@ static GtkToggleActionEntry shell_toggle_entries[] = { G_CALLBACK (action_show_statusbar_cb), TRUE }, + { "show-switcher", + NULL, + N_("Show _Buttons"), + NULL, + N_("Show the switcher buttons"), + G_CALLBACK (action_show_switcher_cb), + TRUE }, + { "show-toolbar", NULL, N_("Show _Toolbar"), @@ -1104,6 +1140,37 @@ static GtkToggleActionEntry shell_toggle_entries[] = { TRUE } }; +static GtkRadioActionEntry shell_switcher_style_entries[] = { + + { "switcher-style-icons", + NULL, + N_("_Icons Only"), + NULL, + N_("Display window buttons with icons only"), + E_SWITCHER_ICONS }, + + { "switcher-style-text", + NULL, + N_("_Text Only"), + NULL, + N_("Display window buttons with text only"), + E_SWITCHER_TEXT }, + + { "switcher-style-both", + NULL, + N_("Icons _and Text"), + NULL, + N_("Display window buttons with icons and text"), + E_SWITCHER_BOTH }, + + { "switcher-style-user", + NULL, + N_("Tool_bar Style"), + NULL, + N_("Display window buttons using the desktop toolbar setting"), + E_SWITCHER_USER } +}; + void e_shell_window_actions_init (EShellWindow *window) { @@ -1125,6 +1192,11 @@ e_shell_window_actions_init (EShellWindow *window) gtk_action_group_add_toggle_actions ( action_group, shell_toggle_entries, G_N_ELEMENTS (shell_toggle_entries), window); + gtk_action_group_add_radio_actions ( + action_group, shell_switcher_style_entries, + G_N_ELEMENTS (shell_switcher_style_entries), + E_SWITCHER_USER, + G_CALLBACK (action_switcher_style_cb), window); gtk_ui_manager_insert_action_group (manager, action_group, 0); /* New Item Actions (empty) */ diff --git a/shell/e-shell-window-actions.h b/shell/e-shell-window-actions.h index a36d91ebb6..a05165cdbd 100644 --- a/shell/e-shell-window-actions.h +++ b/shell/e-shell-window-actions.h @@ -50,12 +50,12 @@ E_SHELL_WINDOW_ACTION ((window), "quit") #define E_SHELL_WINDOW_ACTION_SEND_RECEIVE(window) \ E_SHELL_WINDOW_ACTION ((window), "send-receive") -#define E_SHELL_WINDOW_ACTION_SHOW_BUTTONS(window) \ - E_SHELL_WINDOW_ACTION ((window), "show-buttons") #define E_SHELL_WINDOW_ACTION_SHOW_SIDEBAR(window) \ E_SHELL_WINDOW_ACTION ((window), "show-sidebar") #define E_SHELL_WINDOW_ACTION_SHOW_STATUSBAR(window) \ E_SHELL_WINDOW_ACTION ((window), "show-statusbar") +#define E_SHELL_WINDOW_ACTION_SHOW_SWITCHER(window) \ + E_SHELL_WINDOW_ACTION ((window), "show-switcher") #define E_SHELL_WINDOW_ACTION_SHOW_TOOLBAR(window) \ E_SHELL_WINDOW_ACTION ((window), "show-toolbar") #define E_SHELL_WINDOW_ACTION_SUBMIT_BUG(window) \ diff --git a/shell/e-shell-window-private.c b/shell/e-shell-window-private.c index 4c278e9b48..be25861c73 100644 --- a/shell/e-shell-window-private.c +++ b/shell/e-shell-window-private.c @@ -20,6 +20,7 @@ #include "e-shell-window-private.h" +#include "e-util/e-util.h" #include "e-util/gconf-bridge.h" #ifdef NM_SUPPORT_GLIB @@ -70,7 +71,8 @@ shell_window_connect_proxy_cb (EShellWindow *window, return; g_object_set_data_full ( - G_OBJECT (proxy), "action", action, + G_OBJECT (proxy), + "action", g_object_ref (action), (GDestroyNotify) g_object_unref); g_signal_connect_swapped ( @@ -112,7 +114,7 @@ e_shell_window_private_init (EShellWindow *window) priv->shell_views = g_ptr_array_new (); - /* XXX Load UI file. */ + e_load_ui_definition (priv->manager, "evolution-shell.ui"); e_shell_window_actions_init (window); @@ -128,6 +130,7 @@ e_shell_window_private_init (EShellWindow *window) widget = gtk_vbox_new (FALSE, 0); gtk_container_add (GTK_CONTAINER (window), widget); + gtk_widget_show (widget); container = widget; @@ -142,7 +145,7 @@ e_shell_window_private_init (EShellWindow *window) gtk_widget_show (widget); widget = gtk_hpaned_new (); - gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); priv->content_pane = g_object_ref (widget); gtk_widget_show (widget); @@ -213,18 +216,18 @@ e_shell_window_private_init (EShellWindow *window) key = "/apps/evolution/shell/view_defaults/folder_bar/width"; gconf_bridge_bind_property_delayed (bridge, key, object, "position"); - object = G_OBJECT (ACTION (SHOW_BUTTONS)); - key = "/apps/evolution/shell/view-defaults/buttons_visible"; - gconf_bridge_bind_property (bridge, key, object, "active"); - object = G_OBJECT (ACTION (SHOW_SIDEBAR)); - key = "/apps/evolution/shell/view-defaults/sidebar_visible"; + key = "/apps/evolution/shell/view_defaults/sidebar_visible"; gconf_bridge_bind_property (bridge, key, object, "active"); object = G_OBJECT (ACTION (SHOW_STATUSBAR)); key = "/apps/evolution/shell/view_defaults/statusbar_visible"; gconf_bridge_bind_property (bridge, key, object, "active"); + object = G_OBJECT (ACTION (SHOW_SWITCHER)); + key = "/apps/evolution/shell/view_defaults/buttons_visible"; + gconf_bridge_bind_property (bridge, key, object, "active"); + object = G_OBJECT (ACTION (SHOW_TOOLBAR)); key = "/apps/evolution/shell/view_defaults/toolbar_visible"; gconf_bridge_bind_property (bridge, key, object, "active"); diff --git a/shell/e-sidebar.c b/shell/e-sidebar.c index aa63f00ed4..aca9765e87 100644 --- a/shell/e-sidebar.c +++ b/shell/e-sidebar.c @@ -336,7 +336,6 @@ sidebar_get_style (GtkToolShell *shell) static GtkReliefStyle sidebar_get_relief_style (GtkToolShell *shell) { - g_debug ("%s", G_STRFUNC); return GTK_RELIEF_NORMAL; } @@ -459,12 +458,11 @@ e_sidebar_add_action (ESidebar *sidebar, gtk_tool_item_set_is_important (GTK_TOOL_ITEM (widget), TRUE); gtk_widget_show (widget); - sidebar->priv->proxies = g_list_append (sidebar->priv->proxies, widget); + sidebar->priv->proxies = g_list_append ( + sidebar->priv->proxies, widget); gtk_widget_set_parent (widget, GTK_WIDGET (sidebar)); gtk_widget_queue_resize (GTK_WIDGET (sidebar)); - - g_debug ("Relief Style: %d", gtk_tool_item_get_relief_style (GTK_TOOL_ITEM (widget))); } gboolean diff --git a/shell/e-sidebar.h b/shell/e-sidebar.h index e5f195cbf7..6024b6e229 100644 --- a/shell/e-sidebar.h +++ b/shell/e-sidebar.h @@ -44,6 +44,13 @@ G_BEGIN_DECLS +typedef enum { + E_SWITCHER_ICONS, + E_SWITCHER_TEXT, + E_SWITCHER_BOTH, + E_SWITCHER_USER +} ESwitcherStyle; + typedef struct _ESidebar ESidebar; typedef struct _ESidebarClass ESidebarClass; typedef struct _ESidebarPrivate ESidebarPrivate; |