aboutsummaryrefslogtreecommitdiffstats
path: root/shell
diff options
context:
space:
mode:
authorWilliam Jon McCann <mccann@jhu.edu>2004-06-03 04:37:14 +0800
committerWilliam Jon McCann <mccann@src.gnome.org>2004-06-03 04:37:14 +0800
commit846953d493d286b63b3345442834591551c6d338 (patch)
treef17d41b9f4fa29a25541cdf59abec326ecbd5424 /shell
parentd9deb731a06228dcb0023e9fe0c00a847c5b65f1 (diff)
downloadgsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.gz
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.tar.zst
gsoc2013-evolution-846953d493d286b63b3345442834591551c6d338.zip
Add listener for the ViewToolbar command.
2004-06-01 William Jon McCann <mccann@jhu.edu> * e-shell-window-commands.c (e_shell_window_commands_setup): Add listener for the ViewToolbar command. (view_toolbar_item_toggled_handler): New function to handle toggling toolbar visibility and saving state. * e-shell-window.c (e_shell_window_save_defaults): Save the status of the toolbar visibility. (setup_widgets): Set initial state of toolbar visibility. * apps_evolution_shell.schemas.in.in: Added schema for toolbar_visible. svn path=/trunk/; revision=26157
Diffstat (limited to 'shell')
-rw-r--r--shell/ChangeLog13
-rw-r--r--shell/apps_evolution_shell.schemas.in.in12
-rw-r--r--shell/e-shell-window-commands.c19
-rw-r--r--shell/e-shell-window.c30
4 files changed, 74 insertions, 0 deletions
diff --git a/shell/ChangeLog b/shell/ChangeLog
index 03da33a026..11f5f37da6 100644
--- a/shell/ChangeLog
+++ b/shell/ChangeLog
@@ -1,3 +1,16 @@
+2004-06-01 William Jon McCann <mccann@jhu.edu>
+
+ * e-shell-window-commands.c (e_shell_window_commands_setup):
+ Add listener for the ViewToolbar command.
+ (view_toolbar_item_toggled_handler):
+ New function to handle toggling toolbar visibility and saving state.
+
+ * e-shell-window.c (e_shell_window_save_defaults):
+ Save the status of the toolbar visibility.
+ (setup_widgets): Set initial state of toolbar visibility.
+
+ * apps_evolution_shell.schemas.in.in: Added schema for toolbar_visible.
+
2004-06-01 Christophe Fergeau <teuf@gnome.org>
* e-shell-importer.c: sort the various available importer plugins by
diff --git a/shell/apps_evolution_shell.schemas.in.in b/shell/apps_evolution_shell.schemas.in.in
index e71bbb4537..e26cb28717 100644
--- a/shell/apps_evolution_shell.schemas.in.in
+++ b/shell/apps_evolution_shell.schemas.in.in
@@ -84,6 +84,18 @@
</schema>
<schema>
+ <key>/schemas/apps/evolution/shell/view_defaults/toolbar_visible</key>
+ <applyto>/apps/evolution/shell/view_defaults/toolbar_visible</applyto>
+ <owner>evolution</owner>
+ <type>bool</type>
+ <default>TRUE</default>
+ <locale name="C">
+ <short>Toolbar is visible</short>
+ <long>Whether the toolbar should be visible.</long>
+ </locale>
+ </schema>
+
+ <schema>
<key>/schemas/apps/evolution/shell/view_defaults/component_id</key>
<applyto>/apps/evolution/shell/view_defaults/component_id</applyto>
<owner>evolution</owner>
diff --git a/shell/e-shell-window-commands.c b/shell/e-shell-window-commands.c
index 35ccb7d40e..b8e067c3d7 100644
--- a/shell/e-shell-window-commands.c
+++ b/shell/e-shell-window-commands.c
@@ -46,6 +46,7 @@
#include <bonobo/bonobo-ui-component.h>
+#include <string.h>
/* Utility functions. */
@@ -608,6 +609,21 @@ shell_line_status_changed_cb (EShell *shell,
update_offline_menu_item (shell_window, new_status);
}
+static void
+view_toolbar_item_toggled_handler (BonoboUIComponent *ui_component,
+ const char *path,
+ Bonobo_UIComponent_EventType type,
+ const char *state,
+ EShellWindow *shell_window)
+{
+ gboolean is_visible;
+
+ is_visible = state[0] == '1';
+
+ bonobo_ui_component_set_prop (ui_component, "/Toolbar",
+ "hidden", is_visible ? "0" : "1", NULL);
+}
+
/* Public API. */
@@ -628,6 +644,9 @@ e_shell_window_commands_setup (EShellWindow *shell_window)
bonobo_ui_component_add_verb_list_with_data (uic, actions_verbs, shell_window);
bonobo_ui_component_add_verb_list_with_data (uic, tools_verbs, shell_window);
bonobo_ui_component_add_verb_list_with_data (uic, help_verbs, shell_window);
+ bonobo_ui_component_add_listener (uic, "ViewToolbar",
+ (BonoboUIListenerFn)view_toolbar_item_toggled_handler,
+ (gpointer)shell_window);
e_pixmaps_update (uic, pixmaps);
diff --git a/shell/e-shell-window.c b/shell/e-shell-window.c
index 996c151db9..3b7ed348bc 100644
--- a/shell/e-shell-window.c
+++ b/shell/e-shell-window.c
@@ -574,6 +574,7 @@ setup_widgets (EShellWindow *window)
GSList *p;
GString *xml;
int button_id;
+ gboolean toolbar_visible;
priv->paned = gtk_hpaned_new ();
@@ -595,6 +596,20 @@ setup_widgets (EShellWindow *window)
gtk_paned_set_position (GTK_PANED (priv->paned),
gconf_client_get_int (gconf_client, "/apps/evolution/shell/view_defaults/folder_bar/width", NULL));
+ toolbar_visible = gconf_client_get_bool (gconf_client,
+ "/apps/evolution/shell/view_defaults/toolbar_visible",
+ NULL);
+ bonobo_ui_component_set_prop (e_shell_window_peek_bonobo_ui_component (window),
+ "/commands/ViewToolbar",
+ "state",
+ toolbar_visible ? "1" : "0",
+ NULL);
+ bonobo_ui_component_set_prop (e_shell_window_peek_bonobo_ui_component (window),
+ "/Toolbar",
+ "hidden",
+ toolbar_visible ? "0" : "1",
+ NULL);
+
button_id = 0;
xml = g_string_new("");
for (p = e_component_registry_peek_list (registry); p != NULL; p = p->next) {
@@ -862,6 +877,8 @@ void
e_shell_window_save_defaults (EShellWindow *window)
{
GConfClient *client = gconf_client_get_default ();
+ char *prop;
+ gboolean toolbar_visible;
gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/width",
GTK_WIDGET (window)->allocation.width, NULL);
@@ -871,6 +888,19 @@ e_shell_window_save_defaults (EShellWindow *window)
gconf_client_set_int (client, "/apps/evolution/shell/view_defaults/folder_bar/width",
gtk_paned_get_position (GTK_PANED (window->priv->paned)), NULL);
+ prop = bonobo_ui_component_get_prop (e_shell_window_peek_bonobo_ui_component (window),
+ "/commands/ViewToolbar",
+ "state",
+ NULL);
+ if (prop) {
+ toolbar_visible = prop[0] == '1';
+ gconf_client_set_bool (client,
+ "/apps/evolution/shell/view_defaults/toolbar_visible",
+ toolbar_visible,
+ NULL);
+ g_free (prop);
+ }
+
g_object_unref (client);
}
patch to 2.1.5pav2005-02-182-4/+4 * postfix's optional postgres support doesn't work with the new Postgres portleeym2005-02-081-20/+3 * [PATCH] mail/postfix: Update to libspf2-2.1.5-5edwin2004-11-274-26/+6 * - Support SPF and TLS at the same timepav2004-11-152-1/+22 * - Fix build with SASLKRB5 optionpav2004-10-261-2/+2 * update mail/postfix to latestedwin2004-10-133-12/+12 * Make sure this patch applies correctly when PATCH_STRIP=-p1, as is thedes2004-09-041-2/+2 * Fix build on 6.0.des2004-08-312-0/+22 * - Add VDA (Virtual Delivery Agent) patchpav2004-08-222-1/+9 * Add a patch to optionnaly add libspf2mat2004-08-183-2/+21 * - Update to 2.1.4pav2004-07-143-4/+8 * - Update IPv6 patches to 2.1.3pav2004-06-252-11/+11 * - Update to 2.1.3pav2004-06-233-10/+10 * - Wordsmithing in commentpav2004-06-111-1/+1 * - Update IPv6 patches to 1.24pav2004-05-222-7/+7 * update mail/postfix to latest releaseedwin2004-05-142-3/+3 * - Update to 2.1.0pav2004-05-1214-283/+288 * - Update to 2.0.20pav2004-05-032-4/+5 * Use /usr/sbin/nologin instead of /sbin/nologin if it exists and isdes2004-04-131-4/+13 * - Kill trailing whitespacepav2004-04-021-2/+2 * - Add support for db42pav2004-03-301-10/+23 * - Update 2.0.19clement2004-03-232-3/+5 * s/USE_OPENLDAP_VER/WANT_OPENLDAP_VER/g in comments.ale2004-03-111-2/+2 * Use USE_MYSQL and USE_OPENLDAP.ale2004-03-111-21/+9 * Fix build with LDAP.osa2004-02-201-3/+3 * Update to latest released version. Update TLS/IPv6 patches to match.eik2004-01-313-9/+20 * Respect ${CC} flag.osa2003-12-311-1/+1 * Add the rc.conf pid-file specification line for startup.petef2003-12-211-0/+1 * - add CONFLICTSdinoex2003-10-141-0/+1 * Update to 2.0.16osa2003-10-023-10/+13 * Update postfix to latest release (mainly a Solaris bug workaround).osa2003-09-092-2/+2 * Update to 2.0.14 [1]osa2003-08-284-99/+99 * Fix plist at optional IPv6 configuration.kuriyama2003-08-172-1/+7 * Fix non-default dependency on openldap2[012] which is broken by splitting.kuriyama2003-08-151-3/+3 * One of the patch files for postfix was not PREFIX-clean. This makes iterwin2003-07-231-7/+7 * Included in this email is a patch to postfix which I need applied forerwin2003-07-101-1/+13 * Fix building with SASL2 case.osa2003-07-071-4/+1 * update mail/postfix: 2.0.12 --> 2.0.13daichi2003-07-023-17/+12 * Upgrade to 2.0.12.obraun2003-06-28