Re: [evolution-patches] fix for 57653 : toolbar visibility



JP Rosevear wrote:
So I'm fine for this patch, except for the fact i prefer the "Toolbar"
menu item to be at the bottom after a separator.  This will require some
slight twiddling of the the component merging.  Doable?

Hmm, should be doable. It works fine for everything except mail. It looks like the mail component is not putting things in the View menu at the placeholder but always tacking them on the end.

For example, removing the MailMessageView and MailListView placeholders from the View submenu definition in ui/evolution-mail-global.xml seems to have no effect. They show up either way.

Am I missing something?

Thanks,
Jon
Index: shell/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/shell/ChangeLog,v
retrieving revision 1.1427
diff -p -u -r1.1427 ChangeLog
--- shell/ChangeLog	3 May 2004 14:28:48 -0000	1.1427
+++ shell/ChangeLog	3 May 2004 21:32:18 -0000
@@ -1,3 +1,13 @@
+2004-04-30  William Jon McCann  <mccann jhu edu>
+
+	* e-shell-window.c (setup_widgets): Set initial state of toolbar
+	visibility.
+
+	* e-shell-window-commands.c (view_toolbar_item_toggled_handler):
+	New function to handle toggling toolbar visibility and saving state.
+
+	* apps_evolution_shell.schemas.in.in: Added schema for toolbar_visible.
+
 2004-05-03  Dan Winship  <danw ximian com>
 
 	* e-shell-importer.c (e_shell_importer_start_import): Fix warnings
Index: shell/apps_evolution_shell.schemas.in.in
===================================================================
RCS file: /cvs/gnome/evolution/shell/apps_evolution_shell.schemas.in.in,v
retrieving revision 1.2
diff -p -u -r1.2 apps_evolution_shell.schemas.in.in
--- shell/apps_evolution_shell.schemas.in.in	30 Apr 2004 19:07:22 -0000	1.2
+++ shell/apps_evolution_shell.schemas.in.in	3 May 2004 21:32:18 -0000
@@ -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>
Index: shell/e-shell-window-commands.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window-commands.c,v
retrieving revision 1.14
diff -p -u -r1.14 e-shell-window-commands.c
--- shell/e-shell-window-commands.c	30 Apr 2004 19:05:34 -0000	1.14
+++ shell/e-shell-window-commands.c	3 May 2004 21:32:18 -0000
@@ -44,6 +44,7 @@
 
 #include <bonobo/bonobo-ui-component.h>
 
+#include <gconf/gconf-client.h>
 
 /* Utility functions.  */
 
@@ -428,6 +429,29 @@ shell_line_status_changed_cb (EShell *sh
 }
 
 
+static void
+view_toolbar_item_toggled_handler (BonoboUIComponent           *ui_component,
+				   const char                  *path,
+				   Bonobo_UIComponent_EventType type,
+				   const char                  *state,
+				   EShellWindow                *shell_window)
+{
+	gboolean s;
+	GConfClient *gconf_client = gconf_client_get_default ();
+
+	s = (strcmp (state, "1") == 0);
+
+	bonobo_ui_component_set_prop (ui_component, "/Toolbar",
+				      "hidden", s ? "0" : "1", NULL);
+
+	gconf_client_set_bool (gconf_client,
+			       "/apps/evolution/shell/view_defaults/toolbar_visible",
+			       s,
+			       NULL);
+
+	g_object_unref (gconf_client);
+}
+
 /* Public API.  */
 
 void
@@ -447,6 +471,10 @@ e_shell_window_commands_setup (EShellWin
 	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);
 
Index: shell/e-shell-window.c
===================================================================
RCS file: /cvs/gnome/evolution/shell/e-shell-window.c,v
retrieving revision 1.22
diff -p -u -r1.22 e-shell-window.c
--- shell/e-shell-window.c	30 Apr 2004 06:22:04 -0000	1.22
+++ shell/e-shell-window.c	3 May 2004 21:32:19 -0000
@@ -560,6 +560,7 @@ setup_widgets (EShellWindow *window)
 	GtkWidget *contents_vbox;
 	GSList *p;
 	int button_id;
+	gboolean toolbar_visible;
 
 	priv->paned = gtk_hpaned_new ();
 
@@ -580,6 +581,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;
 	for (p = e_component_registry_peek_list (registry); p != NULL; p = p->next) {
Index: ui/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/ui/ChangeLog,v
retrieving revision 1.389
diff -p -u -r1.389 ChangeLog
--- ui/ChangeLog	3 May 2004 14:34:16 -0000	1.389
+++ ui/ChangeLog	3 May 2004 21:32:19 -0000
@@ -1,3 +1,7 @@
+2004-04-30  William Jon McCann  <mccann jhu edu>
+
+	* evolution.xml: Add Toolbar item to View menu.
+
 2004-04-30  Dave Fallon <davef tetsubo com>
 
        * ui/evolution-addressbook.xml: Fixed Bug #57611.
Index: ui/evolution-addressbook.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-addressbook.xml,v
retrieving revision 1.62
diff -p -u -r1.62 evolution-addressbook.xml
--- ui/evolution-addressbook.xml	3 May 2004 14:34:16 -0000	1.62
+++ ui/evolution-addressbook.xml	3 May 2004 21:32:19 -0000
@@ -82,8 +82,10 @@
     </submenu>
 
     <submenu name="View" _label="_View">
-      <menuitem name="ContactsViewPreview" verb="" _label="_Preview Pane"/>
-      <separator f="" name="addressbookglobal"/>
+      <placeholder name="ViewBegin">
+        <menuitem name="ContactsViewPreview" verb="" _label="_Preview Pane"/>
+        <separator f="" name="addressbookglobal"/>
+      </placeholder>
     </submenu>
 
     <placeholder name="EditPlaceholder">
Index: ui/evolution-mail-global.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-mail-global.xml,v
retrieving revision 1.26
diff -p -u -r1.26 evolution-mail-global.xml
--- ui/evolution-mail-global.xml	26 Jan 2004 22:35:19 -0000	1.26
+++ ui/evolution-mail-global.xml	3 May 2004 21:32:19 -0000
@@ -35,10 +35,12 @@
   <menu>
 
     <submenu name="View" _label="_View">
-      <menuitem name="ViewPreview" verb="" _label="_Preview Pane"/>
-      <separator f="" name="emailglobal"/>
-      <placeholder name="MailMessageView"/>
-      <placeholder name="MailListView"/>
+      <placeholder name="ViewBegin">
+        <menuitem name="ViewPreview" verb="" _label="_Preview Pane"/>
+        <separator f="" name="emailglobal"/>
+        <placeholder name="MailMessageView"/>
+        <placeholder name="MailListView"/>
+      </placeholder>
     </submenu>
 
     <placeholder name="EditPlaceholder">
Index: ui/evolution-mail-list.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution-mail-list.xml,v
retrieving revision 1.18
diff -p -u -r1.18 evolution-mail-list.xml
--- ui/evolution-mail-list.xml	23 Jan 2004 20:24:16 -0000	1.18
+++ ui/evolution-mail-list.xml	3 May 2004 21:32:19 -0000
@@ -102,7 +102,7 @@
         <menuitem name="ViewHideSelected" verb="" _label="Hide S_elected Messages"/>
         <menuitem name="ViewHideRead" verb="" _label="Hide _Read Messages"/>
         <menuitem name="ViewShowAll" verb="" _label="Sh_ow Hidden Messages"/>
-     </placeholder>
+      </placeholder>
     </submenu>
 
     <submenu name="Actions" _label="_Actions">
Index: ui/evolution.xml
===================================================================
RCS file: /cvs/gnome/evolution/ui/evolution.xml,v
retrieving revision 1.90
diff -p -u -r1.90 evolution.xml
--- ui/evolution.xml	9 Apr 2004 15:57:18 -0000	1.90
+++ ui/evolution.xml	3 May 2004 21:32:19 -0000
@@ -10,6 +10,9 @@
     <cmd name="FileExit" _label="E_xit" _tip="Exit the program"
       pixtype="stock" pixname="Quit" accel="*Control*q"/>
 
+    <cmd name="ViewToolbar" _label="Toolbar" type="toggle"
+      _tip="Change the visibility of the toolbar" state="1"/>
+
     <cmd name="HelpSubmitBug" _label="Submit Bug Report"
       _tip="Submit a bug report using Bug Buddy"/>
 
@@ -70,6 +73,8 @@
     <submenu name="View" _label="_View">
       <placeholder name="ViewBegin"/>
       <placeholder name="ViewAfterControl"/>
+      <separator />
+      <menuitem name="ViewToolbar" id="ViewToolbar" verb=""/>
     </submenu>
 
     <submenu name="Actions" _label="_Actions">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]