summaryrefslogtreecommitdiff
blob: 8eb0e288f606337bb5d72839cfba28ea6150530f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
diff -u -ruN evolution-2.5.5.1.orig/mail/em-folder-browser.c evolution-2.5.5.1/mail/em-folder-browser.c
--- evolution-2.5.5.1.orig/mail/em-folder-browser.c	2006-01-16 06:12:24.000000000 -0500
+++ evolution-2.5.5.1/mail/em-folder-browser.c	2006-01-21 00:12:22.000000000 -0500
@@ -114,6 +114,8 @@
 	guint folder_changed_id;
 
 	EMMenu *menu;		/* toplevel menu manager */
+
+	int show_wide:1;
 };
 
 static void emfb_activate(EMFolderView *emfv, BonoboUIComponent *uic, int state);
@@ -220,7 +222,9 @@
 		gtk_box_pack_start((GtkBox *)emfb, (GtkWidget *)emfb->search, FALSE, TRUE, 0);
 	}
 
-	emfb->vpane = gtk_vpaned_new();
+	emfb->priv->show_wide = gconf_client_get_bool(mail_config_get_gconf_client(), "/apps/evolution/mail/display/show_wide", NULL);
+	emfb->vpane = emfb->priv->show_wide?gtk_hpaned_new():gtk_vpaned_new();
+
 	g_signal_connect(emfb->vpane, "realize", G_CALLBACK(emfb_pane_realised), emfb);
 	emfb->priv->vpane_resize_id = g_signal_connect(emfb->vpane, "button_release_event", G_CALLBACK(emfb_pane_button_release_event), emfb);
 
@@ -375,6 +379,33 @@
 	/* FIXME: need to update menu's to reflect ui changes */
 }
 
+void em_folder_browser_show_wide(EMFolderBrowser *emfb, gboolean state)
+{
+	GtkWidget *w;
+
+	if ((emfb->priv->show_wide ^ state) == 0
+	    || emfb->view.list == NULL
+	    || emfb->view.preview_active == 0) {
+		emfb->priv->show_wide = state;
+		return;
+	}
+
+	emfb->priv->show_wide = state;
+
+	w = emfb->priv->show_wide?gtk_hpaned_new():gtk_vpaned_new();
+
+	g_signal_handler_disconnect(emfb->vpane, emfb->priv->vpane_resize_id);
+	g_signal_connect(w, "realize", G_CALLBACK(emfb_pane_realised), emfb);
+	emfb->priv->vpane_resize_id = g_signal_connect(w, "button_release_event", G_CALLBACK(emfb_pane_button_release_event), emfb);
+
+	gtk_widget_show(w);
+	gtk_box_pack_start_defaults((GtkBox *)emfb, w);
+	gtk_widget_reparent((GtkWidget *)emfb->view.list, w);
+	gtk_widget_reparent((GtkWidget *)emfb->priv->preview, w);
+	gtk_widget_destroy(emfb->vpane);
+	emfb->vpane = w;
+}
+
 /* ********************************************************************** */
 
 /* FIXME: Need to separate system rules from user ones */
@@ -942,6 +973,21 @@
 }
 
 static void
+emfb_show_wide(BonoboUIComponent *uic, const char *path, Bonobo_UIComponent_EventType type, const char *state, void *data)
+{
+	GConfClient *gconf;
+	EMFolderBrowser *emfb = data;
+
+	if (type != Bonobo_UIComponent_STATE_CHANGED)
+		return;
+
+	gconf = mail_config_get_gconf_client ();
+	gconf_client_set_bool(gconf, "/apps/evolution/mail/display/show_wide", state[0] != '0', NULL);
+
+	em_folder_browser_show_wide(emfb, state[0] != '0');
+}
+
+static void
 emfb_list_scrolled (MessageList *ml, EMFolderBrowser *emfb)
 {
 	EMFolderView *emfv = (EMFolderView *) emfb;
@@ -1220,6 +1266,12 @@
 		bonobo_ui_component_add_listener(uic, "ViewThreaded", emfb_view_threaded, emfv);
 		message_list_set_threaded(emfv->list, state);
 
+		/* Show wide display */
+		state = gconf_client_get_bool(gconf, "/apps/evolution/mail/display/show_wide", NULL);
+		bonobo_ui_component_set_prop(uic, "/commands/ViewWide", "state", state ? "1" : "0", NULL);
+		bonobo_ui_component_add_listener(uic, "ViewWide", emfb_show_wide, emfv);
+		em_folder_browser_show_wide((EMFolderBrowser *)emfv, state);
+
 		/* FIXME: Selection state */
 
 		/* FIXME: property menu customisation */
diff -u -ruN evolution-2.5.5.1.orig/mail/em-folder-browser.h evolution-2.5.5.1/mail/em-folder-browser.h
--- evolution-2.5.5.1.orig/mail/em-folder-browser.h	2005-05-16 03:53:53.000000000 -0400
+++ evolution-2.5.5.1/mail/em-folder-browser.h	2006-01-21 00:12:22.000000000 -0500
@@ -51,6 +51,7 @@
 GtkWidget *em_folder_browser_new(void);
 
 void em_folder_browser_show_preview(EMFolderBrowser *emfv, gboolean state);
+void em_folder_browser_show_wide(EMFolderBrowser *emfv, gboolean state);
 
 #ifdef __cplusplus
 }
diff -u -ruN evolution-2.5.5.1.orig/mail/evolution-mail.schemas.in.in evolution-2.5.5.1/mail/evolution-mail.schemas.in.in
--- evolution-2.5.5.1.orig/mail/evolution-mail.schemas.in.in	2006-01-02 06:38:59.000000000 -0500
+++ evolution-2.5.5.1/mail/evolution-mail.schemas.in.in	2006-01-21 00:12:22.000000000 -0500
@@ -360,6 +360,20 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/evolution/mail/display/show_wide</key>
+      <applyto>/apps/evolution/mail/display/show_wide</applyto>
+      <owner>evolution-mail</owner>
+      <type>bool</type>
+      <default>false</default>
+      <locale name="C">
+         <short>Use side-by-side or vertical layout</short>
+         <long>
+	  If the &quot;Preview&quot; pane is on, then show it side-by-side rather than vertically.
+         </long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/evolution/mail/display/fonts/variable</key>
       <applyto>/apps/evolution/mail/display/fonts/variable</applyto>
       <owner>evolution-mail</owner>
diff -u -ruN evolution-2.5.5.1.orig/shell/apps_evolution_shell.schemas.in.in evolution-2.5.5.1/shell/apps_evolution_shell.schemas.in.in
--- evolution-2.5.5.1.orig/shell/apps_evolution_shell.schemas.in.in	2005-03-21 16:40:25.000000000 -0500
+++ evolution-2.5.5.1/shell/apps_evolution_shell.schemas.in.in	2006-01-21 00:12:22.000000000 -0500
@@ -131,6 +131,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/evolution/shell/view_defaults/sidebar_visible</key>
+      <applyto>/apps/evolution/shell/view_defaults/sidebar_visible</applyto>
+      <owner>evolution</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Sidebar is visible</short>
+        <long>Whether the sidebar 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 -u -ruN evolution-2.5.5.1.orig/shell/e-shell-window.c evolution-2.5.5.1/shell/e-shell-window.c
--- evolution-2.5.5.1.orig/shell/e-shell-window.c	2006-01-09 02:51:27.000000000 -0500
+++ evolution-2.5.5.1/shell/e-shell-window.c	2006-01-21 00:12:22.000000000 -0500
@@ -745,6 +745,15 @@
 				      visible ? "0" : "1",
 				      NULL);
 
+	visible = gconf_client_get_bool (gconf_client,
+						 "/apps/evolution/shell/view_defaults/sidebar_visible",
+						 NULL);
+	bonobo_ui_component_set_prop (e_shell_window_peek_bonobo_ui_component (window),
+				      "/commands/ViewSidebar",
+				      "state",
+				      visible ? "1" : "0",
+				      NULL);
+
 	button_id = 0;
 	xml = g_string_new("");
 	for (p = e_component_registry_peek_list (registry); p != NULL; p = p->next) {
@@ -803,6 +812,9 @@
 	gtk_box_pack_start (GTK_BOX (contents_vbox), priv->status_bar, FALSE, TRUE, 0);
 	gtk_widget_show (contents_vbox);
 
+	if (!visible)
+		gtk_widget_hide (priv->sidebar);
+
 	/* We only display this when a menu item is actually selected.  */
 	gtk_widget_hide (priv->menu_hint_label);
 
@@ -810,7 +822,6 @@
 	g_object_unref (gconf_client);
 }
 
-
 /* GObject methods.  */
 
 static void
@@ -1094,6 +1105,19 @@
 		g_free (prop);
 	}
 
+	prop = bonobo_ui_component_get_prop (e_shell_window_peek_bonobo_ui_component (window),
+					     "/commands/ViewSidebar",
+					     "state",
+					     NULL);
+	if (prop) {
+		visible = prop[0] == '1';
+		gconf_client_set_bool (client,
+				       "/apps/evolution/shell/view_defaults/sidebar_visible",
+				       visible,
+				       NULL);
+		g_free (prop);
+	}
+
 	g_object_unref (client);
 }
 
diff -u -ruN evolution-2.5.5.1.orig/shell/e-shell-window.h evolution-2.5.5.1/shell/e-shell-window.h
--- evolution-2.5.5.1.orig/shell/e-shell-window.h	2006-01-02 06:39:13.000000000 -0500
+++ evolution-2.5.5.1/shell/e-shell-window.h	2006-01-21 00:12:22.000000000 -0500
@@ -52,7 +52,7 @@
 
 
 #include "e-shell.h"
-
+#include "e-sidebar.h"
 
 GType  e_shell_window_get_type  (void);
 
diff -u -ruN evolution-2.5.5.1.orig/ui/evolution-mail-global.xml evolution-2.5.5.1/ui/evolution-mail-global.xml
--- evolution-2.5.5.1.orig/ui/evolution-mail-global.xml	2006-01-16 06:12:29.000000000 -0500
+++ evolution-2.5.5.1/ui/evolution-mail-global.xml	2006-01-21 00:12:22.000000000 -0500
@@ -35,6 +35,10 @@
      accel="*Control*m"
      type="toggle"/>
 
+    <cmd name="ViewWide"
+      _tip="Show message side-by-side with list"
+      type="toggle"/>
+ 
   </commands>
 
   <keybindings>
@@ -52,6 +56,7 @@
     <submenu name="View" _label="_View">
       <placeholder name="ViewPreview">
         <menuitem name="ViewPreview" verb="" _label="Message _Preview"/>
+        <menuitem name="ViewWide" verb="" _label="_View Side By Side"/>
       </placeholder>
 
       <separator f="" name="emailglobal"/>
diff -u -ruN evolution-2.5.5.1.orig/ui/evolution.xml evolution-2.5.5.1/ui/evolution.xml
--- evolution-2.5.5.1.orig/ui/evolution.xml	2006-01-16 06:12:29.000000000 -0500
+++ evolution-2.5.5.1/ui/evolution.xml	2006-01-21 00:13:47.000000000 -0500
@@ -31,6 +31,9 @@
     <cmd name="ViewStatusBar" _label="_View Status Bar" type="toggle"
       _tip="View/Hide the Status Bar" state="1"/>
 
+    <cmd name="ViewSidebar" _label="_Sidebar" type="toggle"
+      _tip="Change the visibility of the sidebar" state="1"/>
+
     <cmd name="HelpSubmitBug" _label="Submit Bug Report"
       _tip="Submit a bug report using Bug Buddy"/>
 
@@ -112,6 +115,7 @@
       <placeholder name="ViewBegin"/>
       <submenu name="Window" _label="_Window"/>
       <menuitem name="ViewToolbar" id="ViewToolbar" verb=""/>
+      <menuitem name="ViewSidebar" id="ViewSidebar" verb=""/>
       <menuitem name="ViewStatusBar" id="ViewStatusBar"/>
       <placeholder name="ViewPreview"/>
       <submenu name="Buttons" _label="_Switcher Appearance">