evolution r36018 - in branches/kill-bonobo: . addressbook addressbook/gui/component art calendar calendar/gui composer data/icons e-util help help/C mail mail/default/C po shell widgets/misc



Author: mbarnes
Date: Mon Aug 18 16:18:42 2008
New Revision: 36018
URL: http://svn.gnome.org/viewvc/evolution?rev=36018&view=rev

Log:
Merge revisions 35993:36015 from trunk.
Adapt recent "crash recovery" changes to new architecture.


Removed:
   branches/kill-bonobo/art/offline.png
   branches/kill-bonobo/art/online.png
Modified:
   branches/kill-bonobo/ChangeLog
   branches/kill-bonobo/addressbook/ChangeLog
   branches/kill-bonobo/addressbook/gui/component/addressbook-component.c
   branches/kill-bonobo/art/ChangeLog
   branches/kill-bonobo/art/Makefile.am
   branches/kill-bonobo/calendar/ChangeLog
   branches/kill-bonobo/calendar/gui/calendar-component.c
   branches/kill-bonobo/calendar/gui/gnome-cal.c
   branches/kill-bonobo/calendar/gui/memos-component.c
   branches/kill-bonobo/calendar/gui/tasks-component.c
   branches/kill-bonobo/composer/ChangeLog
   branches/kill-bonobo/composer/e-composer-private.c
   branches/kill-bonobo/data/icons/Makefile.am
   branches/kill-bonobo/e-util/ChangeLog
   branches/kill-bonobo/e-util/e-icon-factory.c
   branches/kill-bonobo/help/C/evolution.xml
   branches/kill-bonobo/help/ChangeLog
   branches/kill-bonobo/mail/ChangeLog
   branches/kill-bonobo/mail/default/C/Inbox
   branches/kill-bonobo/mail/em-folder-browser.c
   branches/kill-bonobo/mail/em-folder-browser.h
   branches/kill-bonobo/mail/mail-component.c
   branches/kill-bonobo/po/ChangeLog
   branches/kill-bonobo/po/POTFILES.in
   branches/kill-bonobo/po/es.po
   branches/kill-bonobo/po/et.po
   branches/kill-bonobo/po/gl.po
   branches/kill-bonobo/po/ja.po
   branches/kill-bonobo/po/kn.po
   branches/kill-bonobo/po/nb.po
   branches/kill-bonobo/shell/ChangeLog
   branches/kill-bonobo/shell/apps_evolution_shell.schemas.in
   branches/kill-bonobo/shell/e-shell-window-private.h
   branches/kill-bonobo/shell/e-shell-window.c
   branches/kill-bonobo/shell/e-shell-window.h
   branches/kill-bonobo/shell/e-shell.c
   branches/kill-bonobo/shell/e-user-creatable-items-handler.c
   branches/kill-bonobo/shell/main.c
   branches/kill-bonobo/widgets/misc/ChangeLog
   branches/kill-bonobo/widgets/misc/e-online-button.c

Modified: branches/kill-bonobo/addressbook/gui/component/addressbook-component.c
==============================================================================
--- branches/kill-bonobo/addressbook/gui/component/addressbook-component.c	(original)
+++ branches/kill-bonobo/addressbook/gui/component/addressbook-component.c	Mon Aug 18 16:18:42 2008
@@ -193,6 +193,7 @@
 static GNOME_Evolution_ComponentView
 impl_createView (PortableServer_Servant servant,
 		 GNOME_Evolution_ShellView parent,
+		 CORBA_boolean select_item,
 		 CORBA_Environment *ev)
 {
 	AddressbookComponent *addressbook_component = ADDRESSBOOK_COMPONENT (bonobo_object_from_servant (servant));

Modified: branches/kill-bonobo/art/Makefile.am
==============================================================================
--- branches/kill-bonobo/art/Makefile.am	(original)
+++ branches/kill-bonobo/art/Makefile.am	Mon Aug 18 16:18:42 2008
@@ -1,6 +1,4 @@
 images_DATA = \
-	offline.png			\
-	online.png			\
 	world_map-960.png		\
 	plus.png			\
 	minus.png

Modified: branches/kill-bonobo/calendar/gui/calendar-component.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/calendar-component.c	(original)
+++ branches/kill-bonobo/calendar/gui/calendar-component.c	Mon Aug 18 16:18:42 2008
@@ -802,7 +802,7 @@
 		g_return_if_reached ();
 	}
 
-	e_info_label_set_info (component_view->info_label, _("Calendar"), buffer);
+	e_info_label_set_info (component_view->info_label, _("Calendars"), buffer);
 }
 
 static void
@@ -1550,6 +1550,7 @@
 static GNOME_Evolution_ComponentView
 impl_createView (PortableServer_Servant servant,
 		 GNOME_Evolution_ShellView parent,
+		 CORBA_boolean select_item,
 		 CORBA_Environment *ev)
 {
 	CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant));

Modified: branches/kill-bonobo/calendar/gui/gnome-cal.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/gnome-cal.c	(original)
+++ branches/kill-bonobo/calendar/gui/gnome-cal.c	Mon Aug 18 16:18:42 2008
@@ -2870,7 +2870,8 @@
 		g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source));
 
 		/* FIXME Is there a better way to handle this? */
-		g_object_unref (priv->default_client[source_type]);
+		if (priv->default_client[source_type])
+			g_object_unref (priv->default_client[source_type]);
 		priv->default_client[source_type] = NULL;
 
 		g_signal_emit (gcal, gnome_calendar_signals[SOURCE_REMOVED], 0, source_type, source);

Modified: branches/kill-bonobo/calendar/gui/memos-component.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/memos-component.c	(original)
+++ branches/kill-bonobo/calendar/gui/memos-component.c	Mon Aug 18 16:18:42 2008
@@ -1215,6 +1215,7 @@
 static GNOME_Evolution_ComponentView
 impl_createView (PortableServer_Servant servant,
 		 GNOME_Evolution_ShellView parent,
+		 CORBA_boolean select_item,
 		 CORBA_Environment *ev)
 {
 	MemosComponent *component = MEMOS_COMPONENT (bonobo_object_from_servant (servant));

Modified: branches/kill-bonobo/calendar/gui/tasks-component.c
==============================================================================
--- branches/kill-bonobo/calendar/gui/tasks-component.c	(original)
+++ branches/kill-bonobo/calendar/gui/tasks-component.c	Mon Aug 18 16:18:42 2008
@@ -1207,6 +1207,7 @@
 static GNOME_Evolution_ComponentView
 impl_createView (PortableServer_Servant servant,
 		 GNOME_Evolution_ShellView parent,
+		 CORBA_boolean select_item,
 		 CORBA_Environment *ev)
 {
 	TasksComponent *component = TASKS_COMPONENT (bonobo_object_from_servant (servant));

Modified: branches/kill-bonobo/composer/e-composer-private.c
==============================================================================
--- branches/kill-bonobo/composer/e-composer-private.c	(original)
+++ branches/kill-bonobo/composer/e-composer-private.c	Mon Aug 18 16:18:42 2008
@@ -87,6 +87,8 @@
 	GtkWidget *widget;
 	GtkWidget *expander;
 	GtkWidget *container;
+	GtkWidget *send_widget;
+	const gchar *path;
 	gchar *filename;
 	GError *error = NULL;
 
@@ -120,6 +122,11 @@
 	gtk_ui_manager_add_ui_from_file (manager, filename, &error);
 	g_free (filename);
 
+	/* We set the send button as important to have a label */
+	path = "/main-toolbar/pre-main-toolbar/send";
+	send_widget = gtk_ui_manager_get_widget (manager, path);
+	gtk_tool_item_set_is_important (GTK_TOOL_ITEM (send_widget), TRUE);
+
 	composer_setup_charset_menu (composer);
 
 	if (error != NULL) {

Modified: branches/kill-bonobo/data/icons/Makefile.am
==============================================================================
--- branches/kill-bonobo/data/icons/Makefile.am	(original)
+++ branches/kill-bonobo/data/icons/Makefile.am	Mon Aug 18 16:18:42 2008
@@ -25,11 +25,11 @@
 	$(NULL)
 
 private_icons = \
-    hicolor_apps_16x16_contact-editor.png \
-    hicolor_apps_22x22_contact-editor.png \
-    hicolor_apps_24x24_contact-editor.png \
-    hicolor_apps_32x32_contact-editor.png \
-    hicolor_apps_48x48_contact-editor.png \
+	hicolor_apps_16x16_contact-editor.png \
+	hicolor_apps_22x22_contact-editor.png \
+	hicolor_apps_24x24_contact-editor.png \
+	hicolor_apps_32x32_contact-editor.png \
+	hicolor_apps_48x48_contact-editor.png \
 	hicolor_actions_16x16_folder-copy.png \
 	hicolor_actions_16x16_folder-move.png \
 	hicolor_actions_16x16_mail-copy.png \
@@ -79,6 +79,8 @@
 	hicolor_places_24x24_mail-inbox.png \
 	hicolor_places_24x24_mail-outbox.png \
 	hicolor_places_24x24_mail-sent.png \
+	hicolor_status_32x32_offline.png \
+	hicolor_status_32x32_online.png \
 	$(NULL)
 
 noinst_DATA = \
@@ -105,6 +107,8 @@
 	hicolor_places_22x22_mail-inbox.svg \
 	hicolor_places_22x22_mail-outbox.svg \
 	hicolor_places_22x22_mail-sent.svg \
+	hicolor_status_32x32_offline.svg \
+	hicolor_status_32x32_online.svg \
  	$(NULL)
 
 EXTRA_DIST = \

Modified: branches/kill-bonobo/e-util/e-icon-factory.c
==============================================================================
--- branches/kill-bonobo/e-util/e-icon-factory.c	(original)
+++ branches/kill-bonobo/e-util/e-icon-factory.c	Mon Aug 18 16:18:42 2008
@@ -34,21 +34,14 @@
 #include <libgnomeui/gnome-thumbnail.h>
 #endif
 
+#include <gtk/gtkiconfactory.h>
+
 #include "e-icon-factory.h"
 #include "e-util-private.h"
 
 #include "art/broken-image-16.xpm"
 #include "art/broken-image-24.xpm"
-
-static int sizes[E_ICON_NUM_SIZES] = {
-	16, /* menu */
-	20, /* button */
-	18, /* small toolbar */
-	24, /* large toolbar */
-	32, /* dnd */
-	48, /* dialog */
-};
-
+#define d(x)
 
 typedef struct {
 	char *name;
@@ -173,21 +166,25 @@
 	return icon_new (icon_key, pixbuf);
 }
 
-
-/* temporary workaround for code that has not yet been ported to the new icon_size API */
-static int
-pixel_size_to_icon_size (int pixel_size)
+static GtkIconSize
+e_icon_size_to_gtk_icon_size (guint size)
 {
-	int i, icon_size = -1;
-
-	for (i = 0; i < E_ICON_NUM_SIZES; i++) {
-		if (pixel_size == sizes[i]) {
-			icon_size = i;
-			break;
-		}
+	switch (size) {
+	case E_ICON_SIZE_MENU:
+		return GTK_ICON_SIZE_MENU;
+	case E_ICON_SIZE_BUTTON:
+		return GTK_ICON_SIZE_BUTTON;
+	case E_ICON_SIZE_SMALL_TOOLBAR:
+		return GTK_ICON_SIZE_SMALL_TOOLBAR;
+	case E_ICON_SIZE_LARGE_TOOLBAR:
+		return GTK_ICON_SIZE_LARGE_TOOLBAR;
+	case E_ICON_SIZE_DND:
+		return GTK_ICON_SIZE_DND;
+	case E_ICON_SIZE_DIALOG:
+		return GTK_ICON_SIZE_DIALOG;
+	default:
+		g_assert_not_reached ();
 	}
-
-	return icon_size;
 }
 
 static void
@@ -264,21 +261,30 @@
 {
 	GtkIconInfo *icon_info;
 	char *filename;
+	gint width, height;
 
 	g_return_val_if_fail (icon_name != NULL, NULL);
 	g_return_val_if_fail (strcmp (icon_name, ""), NULL);
 
 	if (icon_size >= E_ICON_NUM_SIZES) {
-		g_warning (
+		g_critical (
 			"calling %s with unknown icon_size value (%d)",
 			G_STRFUNC, icon_size);
-		if ((icon_size = pixel_size_to_icon_size (icon_size)) == -1)
+		/* if ((icon_size = pixel_size_to_icon_size (icon_size)) == -1)*/
 			return NULL;
 	}
 
+	if (! gtk_icon_size_lookup_for_settings (gtk_settings_get_default (),
+	    	e_icon_size_to_gtk_icon_size (icon_size),
+		&width, &height))
+		return NULL;
+
+	d(g_message ("Size is %d", icon_size));
+	d(g_message ("looking up %s at %dx%d", icon_name, width, height));
+
 	g_static_mutex_lock (&mutex);
 	icon_info = gtk_icon_theme_lookup_icon (
-		icon_theme, icon_name, sizes[icon_size], 0);
+		icon_theme, icon_name, height, 0);
 	if (icon_info != NULL) {
 		filename = g_strdup (
 			gtk_icon_info_get_filename (icon_info));
@@ -310,17 +316,25 @@
 	GdkPixbuf *pixbuf;
 	char *icon_key;
 	Icon *icon;
-	int size;
+	int size, width, height;
 
 	if (icon_size >= E_ICON_NUM_SIZES) {
-		g_warning (
+		g_critical (
 			"calling %s with unknown icon_size value (%d)",
 			G_STRFUNC, icon_size);
-		if ((icon_size = pixel_size_to_icon_size (icon_size)) == -1)
+		/*if ((icon_size = pixel_size_to_icon_size (icon_size)) == -1) */
 			return NULL;
 	}
 
-	size = sizes[icon_size];
+	if (! gtk_icon_size_lookup_for_settings (gtk_settings_get_default (),
+	    	e_icon_size_to_gtk_icon_size (icon_size),
+		&width, &height))
+		return NULL;
+
+	d(g_message ("Size is %d", icon_size));
+	d(g_message ("looking up %s at %dx%d", icon_name, width, height));
+
+	size = height;
 
 	if (icon_name == NULL || !strcmp (icon_name, "")) {
 		if (size >= 24)

Modified: branches/kill-bonobo/help/C/evolution.xml
==============================================================================
--- branches/kill-bonobo/help/C/evolution.xml	(original)
+++ branches/kill-bonobo/help/C/evolution.xml	Mon Aug 18 16:18:42 2008
@@ -1013,12 +1013,6 @@
    </section>
   </section>
 
-  <section id="b1a5acwx">
-   <title>Crash Recovery</title>
-   <para>Evolution displays a crash detection message when you restart it after a crash.</para>
-   <mediaobject id="b1a5aezg"><imageobject><imagedata format="PNG" fileref="figures/evo_crash_recovery.png"/></imageobject></mediaobject>
-   <para>Click Ignore to restore the preview pane displayed when Evolution crashed. If you click Recover, Evolution opens with all preview panes hidden.</para>
-  </section>
   <section id="bsekq8r">
    <title>Command Line Options</title>
    <para>Evolution has a number of command line options that you can use. For more information about command line options, open a terminal window and type <command>evolution --help</command>.</para>

Modified: branches/kill-bonobo/mail/default/C/Inbox
==============================================================================
--- branches/kill-bonobo/mail/default/C/Inbox	(original)
+++ branches/kill-bonobo/mail/default/C/Inbox	Mon Aug 18 16:18:42 2008
@@ -12,7 +12,7 @@
 From: "The Evolution Team" <evolution novell com>
 To: Evolution Users <evolution novell com>
 Content-Type: multipart/related; type="multipart/alternative"; boundary="=-t4dRE6cqcdSBHOrMdTQ1"
-X-Mailer: Evolution 2.10.0
+X-Mailer: Evolution 2.24.0
 Date: 14 March 2007 12:00:00 +0000
 Message-Id: <1001418302 27070 20 camel spectrolite>
 Mime-Version: 1.0
@@ -47,15 +47,6 @@
 	For a complete guide to Evolution, select "Table of
 	Contents" from the "Help" menu, or press the F1 key. 
 
-New Features
-
-	Evolution 2.10 brings you
-	
-	# Integration with gtk-print
-	# Customizable fetching of IMAP headers.
-	# Faster Performance, lots of Memory Fixes and Memory Reduction
-	# Lots of Bug fixes and lots of other Improvements
-
 Bug Reporting
 
 	Bugs should be reported to http://bugzilla.gnome.org.
@@ -71,7 +62,6 @@
 
 Yours Sincerely,
 The Evolution Team
-evolution novell com
 
 
 --=-2gZ1roA/HoYrlRDVGyiM
@@ -129,26 +119,6 @@
 </blockquote>
 
 <h2>
-New Features
-</h2>
-
-<blockquote>
-	Evolution 2.10 brings you 
-	<ul>
-	<li>
-	Integration with gtk-print
-	</li><li>
-	Customizable fetching of IMAP headers
-	</li><li>
-	Faster Performance, lots of Memory Fixes and Memory Reduction
-	</li><li>
-	Lots of Bug fixes and lots of other Improvements
-	</li>
-	</ul>
-<br>
-</blockquote>
-
-<h2>
 Bug Reporting
 </h2>
 <blockquote>
@@ -176,7 +146,6 @@
 Yours Sincerely,
 <br>
 The Evolution Team
-<br><a href="mailto:evolution novell com">evolution novell com</a>
 
 </BODY>
 </HTML>

Modified: branches/kill-bonobo/mail/em-folder-browser.c
==============================================================================
--- branches/kill-bonobo/mail/em-folder-browser.c	(original)
+++ branches/kill-bonobo/mail/em-folder-browser.c	Mon Aug 18 16:18:42 2008
@@ -122,6 +122,7 @@
 	guint folder_changed_id;
 
 	guint show_wide:1;
+	guint suppress_message_selection:1;
 	gboolean scope_restricted;
 
 	EMMenu *menu;		/* toplevel menu manager */
@@ -2001,6 +2002,7 @@
 {
 	EMFolderBrowser *emfb = (EMFolderBrowser *) emfv;
 	struct _EMFolderBrowserPrivate *p = emfb->priv;
+	gboolean different_folder;
 
 	message_list_freeze(emfv->list);
 
@@ -2019,6 +2021,10 @@
 		emfb->priv->folder_changed_id = 0;
 	}
 
+	different_folder =
+		emfb->view.folder != NULL &&
+		folder != emfb->view.folder;
+
 	emfb_parent->set_folder(emfv, folder, uri);
 
 	/* This is required since we get activated the first time
@@ -2102,15 +2108,20 @@
 			e_search_bar_paint ((ESearchBar *)emfb->search);
 		}
 
-		/* set the query manually, so we dont pop up advanced or saved search stuff */
+		/* This function gets triggered several times at startup,
+		 * so we don't want to reset the message suppression state
+		 * unless we're actually switching to a different folder. */
+		if (different_folder)
+			p->suppress_message_selection = FALSE;
+
+		if (!p->suppress_message_selection)
+			sstate = camel_object_meta_get (
+				folder, "evolution:selected_uid");
+		else
+			sstate = NULL;
 
-		if ((sstate = camel_object_meta_get (folder, "evolution:selected_uid"))) {
-			g_free (emfb->priv->select_uid);
-			emfb->priv->select_uid = sstate;
-		} else {
-			g_free(p->select_uid);
-			p->select_uid = NULL;
-		}
+		g_free (p->select_uid);
+		p->select_uid = sstate;
 
 		if (emfv->list->cursor_uid == NULL && emfb->priv->list_built_id == 0)
 			p->list_built_id = g_signal_connect(emfv->list, "message_list_built", G_CALLBACK (emfb_list_built), emfv);
@@ -2222,3 +2233,9 @@
 		emfb_parent->activate(emfv, uic, act);
 	}
 }
+
+void
+em_folder_browser_suppress_message_selection (EMFolderBrowser *emfb)
+{
+	emfb->priv->suppress_message_selection = TRUE;
+}

Modified: branches/kill-bonobo/mail/em-folder-browser.h
==============================================================================
--- branches/kill-bonobo/mail/em-folder-browser.h	(original)
+++ branches/kill-bonobo/mail/em-folder-browser.h	Mon Aug 18 16:18:42 2008
@@ -57,6 +57,8 @@
 void em_folder_browser_show_preview(EMFolderBrowser *emfv, gboolean state);
 void em_folder_browser_show_wide(EMFolderBrowser *emfv, gboolean state);
 gboolean em_folder_browser_get_wide(EMFolderBrowser *emfv);
+void em_folder_browser_suppress_message_selection(EMFolderBrowser *emfb);
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: branches/kill-bonobo/mail/mail-component.c
==============================================================================
--- branches/kill-bonobo/mail/mail-component.c	(original)
+++ branches/kill-bonobo/mail/mail-component.c	Mon Aug 18 16:18:42 2008
@@ -711,6 +711,7 @@
 static GNOME_Evolution_ComponentView
 impl_createView (PortableServer_Servant servant,
 		 GNOME_Evolution_ShellView parent,
+		 CORBA_boolean select_item,
 		 CORBA_Environment *ev)
 {
 	MailComponent *mail_component = MAIL_COMPONENT (bonobo_object_from_servant (servant));
@@ -726,6 +727,10 @@
 
 	view_widget = em_folder_browser_new ();
 
+	if (!select_item)
+		em_folder_browser_suppress_message_selection (
+			(EMFolderBrowser *) view_widget);
+
 	tree_widget = (GtkWidget *) em_folder_tree_new_with_model (priv->model);
 	em_folder_tree_set_excluded ((EMFolderTree *) tree_widget, 0);
 	em_folder_tree_enable_drag_and_drop ((EMFolderTree *) tree_widget);

Modified: branches/kill-bonobo/po/POTFILES.in
==============================================================================
--- branches/kill-bonobo/po/POTFILES.in	(original)
+++ branches/kill-bonobo/po/POTFILES.in	Mon Aug 18 16:18:42 2008
@@ -191,6 +191,7 @@
 e-util/e-plugin.c
 e-util/e-print.c
 e-util/e-system.error.xml
+e-util/e-util.c
 e-util/e-util-labels.c
 e-util/gconf-bridge.c
 filter/filter-datespec.c

Modified: branches/kill-bonobo/shell/apps_evolution_shell.schemas.in
==============================================================================
--- branches/kill-bonobo/shell/apps_evolution_shell.schemas.in	(original)
+++ branches/kill-bonobo/shell/apps_evolution_shell.schemas.in	Mon Aug 18 16:18:42 2008
@@ -41,31 +41,6 @@
       </locale>
     </schema>
 
-    <!-- Recovery -->
-     <schema>
-      <key>/schemas/apps/evolution/shell/skip_recovery_dialog</key>
-      <applyto>/apps/evolution/shell/skip_recovery_dialog</applyto>
-      <owner>evolution</owner>
-      <type>bool</type>
-      <default>false</default>
-      <locale name="C">
-        <short>Skip recovery warning dialog</short>
-	<long>Whether the warning dialog in recovery of Evolution is skipped.</long>
-      </locale>
-    </schema>
-
-    <schema>
-      <key>/schemas/apps/evolution/shell/recovery</key>
-      <applyto>/apps/evolution/shell/recovery</applyto>
-      <owner>evolution</owner>
-      <type>bool</type>
-      <default>true</default>
-      <locale name="C">
-        <short>Whether crash detection should be done or not</short>
-	<long>Decides whether the crash detection should be run or not.</long>
-      </locale>
-    </schema>
-
  <!-- Offline Mode -->
 
     <schema>

Modified: branches/kill-bonobo/shell/e-shell-window-private.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window-private.h	(original)
+++ branches/kill-bonobo/shell/e-shell-window-private.h	Mon Aug 18 16:18:42 2008
@@ -79,6 +79,7 @@
 	/* Miscellaneous */
 
 	gboolean destroyed;  /* XXX Do we still need this? */
+	gboolean safe_mode;
 };
 
 void		e_shell_window_private_init	(EShellWindow *window);

Modified: branches/kill-bonobo/shell/e-shell-window.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window.c	(original)
+++ branches/kill-bonobo/shell/e-shell-window.c	Mon Aug 18 16:18:42 2008
@@ -39,9 +39,48 @@
 
 #include <string.h>
 
+enum {
+	PROP_0,
+	PROP_SAFE_MODE
+};
+
 static gpointer parent_class;
 
 static void
+shell_window_set_property (GObject *object,
+                           guint property_id,
+			   const GValue *value,
+			   GParamSpec *pspec)
+{
+	switch (property_id) {
+		case PROP_SAFE_MODE:
+			e_shell_window_set_safe_mode (
+				E_SHELL_WINDOW (object),
+				g_value_get_boolean (value));
+			break;
+	}
+
+	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
+shell_window_get_property (GObject *object,
+                           guint property_id,
+			   GValue *value,
+			   GParamSpec *pspec)
+{
+	switch (property_id) {
+		case PROP_SAFE_MODE:
+			g_value_set_boolean (
+				value, e_shell_window_get_safe_mode (
+				E_SHELL_WINDOW (object)));
+			break;
+	}
+
+	G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+}
+
+static void
 shell_window_dispose (GObject *object)
 {
 	e_shell_window_private_dispose (E_SHELL_WINDOW (object));
@@ -68,8 +107,21 @@
 	g_type_class_add_private (class, sizeof (EShellWindowPrivate));
 
 	object_class = G_OBJECT_CLASS (class);
+	object_class->set_property = shell_window_set_property;
+	object_class->get_property = shell_window_get_property;
 	object_class->dispose = shell_window_dispose;
 	object_class->finalize = shell_window_finalize;
+
+	g_object_class_install_property (
+		object_class,
+		PROP_SAFE_MODE,
+		g_param_spec_boolean (
+			"safe-mode",
+			NULL,
+			NULL,
+			FALSE,
+			G_PARAM_READWRITE |
+			G_PARAM_CONSTRUCT));
 }
 
 static void
@@ -114,9 +166,10 @@
 }
 
 GtkWidget *
-e_shell_window_new (void)
+e_shell_window_new (gboolean safe_mode)
 {
-	return g_object_new (E_TYPE_SHELL_WINDOW, NULL);
+	return g_object_new (
+		E_TYPE_SHELL_WINDOW, "safe-mode", safe_mode, NULL);
 }
 
 GtkUIManager *
@@ -199,203 +252,21 @@
 	return widget;
 }
 
-#if 0
-static void
-init_view (EShellWindow *window,
-	   ComponentView *view)
+gboolean
+e_shell_window_get_safe_mode (EShellWindow *window)
 {
-	EShellWindowPrivate *priv = window->priv;
-	EComponentRegistry *registry = e_shell_peek_component_registry (window->priv->shell);
-	GNOME_Evolution_Component component_iface;
-	GNOME_Evolution_ComponentView component_view;
-	Bonobo_UIContainer container;
-	Bonobo_Control sidebar_control;
-	Bonobo_Control view_control;
-	Bonobo_Control statusbar_control;
-	CORBA_Environment ev;
-	int sidebar_notebook_page_num;
-	int content_notebook_page_num;
-
-	g_return_if_fail (view->view_widget == NULL);
-	g_return_if_fail (view->sidebar_widget == NULL);
-	g_return_if_fail (view->notebook_page_num == -1);
-
-	CORBA_exception_init (&ev);
-
-	/* 1. Activate component.  (FIXME: Shouldn't do this here.)  */
-
-	component_iface = e_component_registry_activate (registry, view->component_id, &ev);
-	if (BONOBO_EX (&ev) || component_iface == CORBA_OBJECT_NIL) {
-		char *ex_text = bonobo_exception_get_text (&ev);
-		g_warning ("Cannot activate component  %s: %s", view->component_id, ex_text);
-		g_free (ex_text);
-		CORBA_exception_free (&ev);
-		return;
-	}
-
-	/* 2. Set up view.  */
-
-	/* The rest of the code assumes that the component is valid and can create
-	   controls; if this fails something is really wrong in the component
-	   (e.g. methods not implemented)...  So handle it as if there was no
-	   component at all.  */
-
-	component_view = GNOME_Evolution_Component_createView(component_iface, BONOBO_OBJREF(priv->shell_view), &ev);
-	if (component_view == NULL || BONOBO_EX (&ev)) {
-		g_warning ("Cannot create view for %s", view->component_id);
-		bonobo_object_release_unref (component_iface, NULL);
-		CORBA_exception_free (&ev);
-		return;
-	}
-
-	GNOME_Evolution_ComponentView_getControls(component_view, &sidebar_control, &view_control, &statusbar_control, &ev);
-	if (BONOBO_EX (&ev)) {
-		g_warning ("Cannot create view for %s", view->component_id);
-		bonobo_object_release_unref (component_iface, NULL);
-		CORBA_exception_free (&ev);
-		return;
-	}
-
-	view->component_view = component_view;
-
-	CORBA_exception_free (&ev);
+	g_return_val_if_fail (E_IS_SHELL_WINDOW (window), FALSE);
 
-	container = bonobo_ui_component_get_container (priv->ui_component);
-
-	view->sidebar_widget = bonobo_widget_new_control_from_objref (sidebar_control, container);
-	gtk_widget_show (view->sidebar_widget);
-	bonobo_object_release_unref (sidebar_control, NULL);
-
-	view->view_widget = bonobo_widget_new_control_from_objref (view_control, container);
-	gtk_widget_show (view->view_widget);
-	bonobo_object_release_unref (view_control, NULL);
-
-	view->statusbar_widget = bonobo_widget_new_control_from_objref (statusbar_control, container);
-	gtk_widget_show (view->statusbar_widget);
-	bonobo_object_release_unref (statusbar_control, NULL);
-
-	gtk_notebook_append_page (GTK_NOTEBOOK (priv->sidebar_notebook), view->sidebar_widget, NULL);
-	gtk_notebook_append_page (GTK_NOTEBOOK (priv->content_notebook), view->view_widget, NULL);
-	gtk_notebook_append_page (GTK_NOTEBOOK (priv->statusbar_notebook), view->statusbar_widget, NULL);
-
-	sidebar_notebook_page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->sidebar_notebook), view->sidebar_widget);
-	content_notebook_page_num = gtk_notebook_page_num (GTK_NOTEBOOK (priv->content_notebook), view->view_widget);
-
-	/* Since we always add a view page and a sidebar page at the same time...  */
-	g_return_if_fail (sidebar_notebook_page_num == content_notebook_page_num);
-
-	view->notebook_page_num = content_notebook_page_num;
-
-	/* 3. Switch to the new page.  */
-
-	gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->content_notebook), content_notebook_page_num);
-	gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->sidebar_notebook), content_notebook_page_num);
-	gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->statusbar_notebook), content_notebook_page_num);
-
-	priv->current_view = view;
-
-	bonobo_object_release_unref (component_iface, NULL);
+	return window->priv->safe_mode;
 }
 
-static void
-switch_view (EShellWindow *window, ComponentView *component_view)
+void
+e_shell_window_set_safe_mode (EShellWindow *window,
+                              gboolean safe_mode)
 {
-	EShellWindowPrivate *priv = window->priv;
-	GConfClient *gconf_client = gconf_client_get_default ();
-	EComponentRegistry *registry = e_shell_peek_component_registry (window->priv->shell);
-	EComponentInfo *info = e_component_registry_peek_info (registry,
-							       ECR_FIELD_ID,
-							       component_view->component_id);
-	char *title;
-
-	if (component_view->sidebar_widget == NULL) {
-		init_view (window, component_view);
-	} else {
-		priv->current_view = component_view;
-
-		gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->content_notebook), component_view->notebook_page_num);
-		gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->sidebar_notebook), component_view->notebook_page_num);
-		gtk_notebook_set_current_page (GTK_NOTEBOOK (priv->statusbar_notebook), component_view->notebook_page_num);
-	}
-
-	if (component_view->title == NULL) {
-		/* To translators: This is the window title and %s is the 
-		component name. Most translators will want to keep it as is. */
-		title = g_strdup_printf (_("%s - Evolution"), info->button_label);
-		gtk_window_set_title (GTK_WINDOW (window), title);
-		g_free (title);
-	} else
-		gtk_window_set_title (GTK_WINDOW (window), component_view->title);
-
-	if (info->icon_name)
-		gtk_window_set_icon_name (GTK_WINDOW (window), info->icon_name);
-
-	gconf_client_set_string (gconf_client, "/apps/evolution/shell/view_defaults/component_id",
-				 (component_view->component_alias != NULL
-				  ? component_view->component_alias
-				  : component_view->component_id),
-				 NULL);
-
-	g_object_unref (gconf_client);
-
-	/** @Event: Shell component activated or switched to.
-	 * @Id: component.activated
-	 * @Target: ESEventTargetComponent
-	 * 
-	 * This event is emitted whenever the shell successfully activates component
-	 * view.
-	 */
-	e_event_emit ((EEvent *) es_event_peek (), "component.activated", (EEventTarget *) es_event_target_new_component (es_event_peek (), component_view->component_id));
-
-	g_object_notify (G_OBJECT (window), "current-view");
-}
-#endif
-
+	g_return_if_fail (E_IS_SHELL_WINDOW (window));
 
-/* Functions to update the sensitivity of buttons and menu items depending on the status.  */
-
-#if 0
-static void
-update_offline_toggle_status (EShellWindow *window)
-{
-	EShellWindowPrivate *priv;
-	GtkWidget *widget;
-	const gchar *tooltip;
-	gboolean online;
-	gboolean sensitive;
-	guint32 flags = 0;
-
-	priv = window->priv;
-
-	switch (e_shell_get_line_status ()) {
-	case E_SHELL_LINE_STATUS_ONLINE:
-		online      = TRUE;
-		sensitive   = TRUE;
-		tooltip     = _("Evolution is currently online.\n"
-				"Click on this button to work offline.");
-		flags = ES_MENU_SHELL_ONLINE;
-		break;
-	case E_SHELL_LINE_STATUS_GOING_OFFLINE:
-		online      = TRUE;
-		sensitive   = FALSE;
-		tooltip     = _("Evolution is in the process of going offline.");
-		flags = ES_MENU_SHELL_OFFLINE;
-		break;
-	case E_SHELL_LINE_STATUS_OFFLINE:
-	case E_SHELL_LINE_STATUS_FORCED_OFFLINE:
-		online      = FALSE;
-		sensitive   = TRUE;
-		tooltip     = _("Evolution is currently offline.\n"
-				"Click on this button to work online.");
-		flags = ES_MENU_SHELL_OFFLINE;
-		break;
-	default:
-		g_return_if_reached ();
-	}
+	window->priv->safe_mode = safe_mode;
 
-	widget = window->priv->online_button;
-	gtk_widget_set_sensitive (widget, sensitive);
-	gtk_widget_set_tooltip_text (widget, tooltip);
-	e_online_button_set_online (E_ONLINE_BUTTON (widget), online);
+	g_object_notify (G_OBJECT (window), "safe-mode");
 }
-#endif

Modified: branches/kill-bonobo/shell/e-shell-window.h
==============================================================================
--- branches/kill-bonobo/shell/e-shell-window.h	(original)
+++ branches/kill-bonobo/shell/e-shell-window.h	Mon Aug 18 16:18:42 2008
@@ -59,7 +59,7 @@
 };
 
 GType		e_shell_window_get_type		(void);
-GtkWidget *	e_shell_window_new		(void);
+GtkWidget *	e_shell_window_new		(gboolean safe_mode);
 GtkUIManager *	e_shell_window_get_ui_manager	(EShellWindow *window);
 GtkAction *	e_shell_window_get_action	(EShellWindow *window,
 						 const gchar *action_name);
@@ -68,6 +68,9 @@
 GtkWidget *	e_shell_window_get_managed_widget
 						(EShellWindow *window,
 						 const gchar *widget_path);
+gboolean	e_shell_window_get_safe_mode	(EShellWindow *window);
+void		e_shell_window_set_safe_mode	(EShellWindow *window,
+						 gboolean safe_mode);
 
 G_END_DECLS
 

Modified: branches/kill-bonobo/shell/e-shell.c
==============================================================================
--- branches/kill-bonobo/shell/e-shell.c	(original)
+++ branches/kill-bonobo/shell/e-shell.c	Mon Aug 18 16:18:42 2008
@@ -104,8 +104,13 @@
 e_shell_create_window (void)
 {
 	GtkWidget *shell_window;
+	gboolean safe_mode;
 
-	shell_window = e_shell_window_new ();
+	/* Put the first window into safe mode if we detect the previous
+	 * session did not shut down cleanly, perhaps due to a crash. */
+	safe_mode = (active_windows == NULL) && e_file_lock_exists ();
+
+	shell_window = e_shell_window_new (safe_mode);
 
 	active_windows = g_list_prepend (active_windows, shell_window);
 

Modified: branches/kill-bonobo/shell/e-user-creatable-items-handler.c
==============================================================================
--- branches/kill-bonobo/shell/e-user-creatable-items-handler.c	(original)
+++ branches/kill-bonobo/shell/e-user-creatable-items-handler.c	Mon Aug 18 16:18:42 2008
@@ -60,6 +60,7 @@
 	char *tooltip;
 	char *component;
 	GdkPixbuf *icon;
+	GdkPixbuf *icon_toolbar;
 };
 typedef struct _MenuItem MenuItem;
 
@@ -258,8 +259,13 @@
 
 				if (corba_item->iconName == NULL || *corba_item->iconName == '\0') {
 					item->icon = NULL;
+					item->icon_toolbar = NULL;
 				} else {
 					item->icon = e_icon_factory_get_icon (corba_item->iconName, E_ICON_SIZE_MENU);
+					if (item_is_default (item, component->alias))
+						item->icon_toolbar = e_icon_factory_get_icon (corba_item->iconName, E_ICON_SIZE_LARGE_TOOLBAR);
+					else
+						item->icon_toolbar = NULL;
 				}
 
 				if (corba_item->type == GNOME_Evolution_CREATABLE_OBJECT)
@@ -304,6 +310,9 @@
 		if (item->icon != NULL)
 			g_object_unref (item->icon);
 
+		if (item->icon_toolbar != NULL)
+			g_object_unref (item->icon_toolbar);
+
 		g_free (item->component);
 		g_free (item);
 	}
@@ -698,7 +707,7 @@
 	val = gconf_client_get_string (gconf, "/desktop/gnome/interface/toolbar_style", NULL);
 
 	set_combo_button_style (E_COMBO_BUTTON (priv->new_button),
-				val, priv->default_menu_item->icon);
+				val, priv->default_menu_item->icon_toolbar ? priv->default_menu_item->icon_toolbar : priv->default_menu_item->icon);
 
 	g_free (val);
 	gtk_widget_show (priv->new_button);
@@ -738,7 +747,7 @@
 	gtk_widget_set_sensitive (priv->new_button, TRUE);
 
 	set_combo_button_style (E_COMBO_BUTTON (priv->new_button),
-				val, priv->default_menu_item->icon);
+				val, priv->default_menu_item->icon_toolbar ? priv->default_menu_item->icon_toolbar : priv->default_menu_item->icon);
 
 	gconf_client_notify_add(gconf,"/desktop/gnome/interface/toolbar_style",
 		(GConfClientNotifyFunc)new_button_change, handler, NULL, NULL);

Modified: branches/kill-bonobo/shell/main.c
==============================================================================
--- branches/kill-bonobo/shell/main.c	(original)
+++ branches/kill-bonobo/shell/main.c	Mon Aug 18 16:18:42 2008
@@ -86,10 +86,6 @@
 
 #define SKIP_WARNING_DIALOG_KEY \
 	"/apps/evolution/shell/skip_warning_dialog"
-#define SKIP_RECOVERY_DIALOG_KEY \
-	"/apps/evolution/shell/skip_recovery_dialog"
-#define RECOVERY_KEY \
-	"/apps/evolution/shell/recovery"
 
 /* Command-line options.  */
 static gboolean start_online = FALSE;
@@ -268,70 +264,6 @@
 
 #endif /* DEVELOPMENT */
 
-static int
-show_recovery_warning(void)
-{
-	GtkWidget *vbox;
-	GtkWidget *label;
-	GtkWidget *warning_dialog;
-	GtkWidget *checkbox;
-	GtkWidget *alignment;
-	gboolean skip;
-	char *text;
-	int flags = 0, response;
-
-	warning_dialog = gtk_dialog_new ();
-	gtk_window_set_title (GTK_WINDOW (warning_dialog), _("Evolution Crash Detection"));
-	gtk_window_set_modal (GTK_WINDOW (warning_dialog), TRUE);
-	gtk_dialog_add_button (GTK_DIALOG (warning_dialog), _("Ig_nore"), GTK_RESPONSE_CANCEL);
-	gtk_dialog_add_button (GTK_DIALOG (warning_dialog), _("_Recover"), GTK_RESPONSE_OK);
-
-	gtk_dialog_set_has_separator (GTK_DIALOG (warning_dialog), FALSE);
-
-	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (warning_dialog)->vbox), 0);
-	gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (warning_dialog)->action_area), 12);
-
-	vbox = gtk_vbox_new (FALSE, 12);
-	gtk_container_set_border_width (GTK_CONTAINER (vbox), 12);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (warning_dialog)->vbox), vbox,
-			    TRUE, TRUE, 0);
-
-	text = g_strdup(
-		/* xgettext:no-c-format */
-		_("Evolution appears to have exited unexpectedly the last time it was\n"
-		  "run.  As a precautionary measure, all preview panes will be hidden.\n"
-		  "You can restore the preview panes from the View menu.\n"));
-	label = gtk_label_new (text);
-	g_free(text);
-
-	gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-	gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
-
-	gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0);
-
-	checkbox = gtk_check_button_new_with_mnemonic (_("_Do not show this message again"));
-
-	alignment = gtk_alignment_new (0.0, 0.0, 0.0, 0.0);
-
-	gtk_container_add (GTK_CONTAINER (alignment), checkbox);
-	gtk_box_pack_start (GTK_BOX (vbox), alignment, TRUE, TRUE, 0);
-
-	gtk_widget_show_all (warning_dialog);
-
-	response = gtk_dialog_run (GTK_DIALOG (warning_dialog));
-	
-	if (response != GTK_RESPONSE_CANCEL)
-		flags = flags|(1<<1);
-
-	skip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox));
-	if (skip)
-		flags = flags|(1<<2);
-
-	gtk_widget_destroy (warning_dialog);
-
-	return flags;
-}
-
 static void
 open_uris (gchar **uris)
 {
@@ -370,32 +302,6 @@
 		open_uris (uris);
 	else {
 		EShellWindow *shell_window;
-		GConfClient *client = gconf_client_get_default ();
-		
-		if (gconf_client_get_bool (client, RECOVERY_KEY, NULL) && e_file_lock_exists ()) {
-			/* It should have crashed last time or a force-shutdown */
-			gboolean skip = gconf_client_get_bool (client, SKIP_RECOVERY_DIALOG_KEY, NULL);
-			gboolean recover = TRUE;
-			if (!skip){
-				int flags = show_recovery_warning ();
-
-				gconf_client_set_bool (client, SKIP_RECOVERY_DIALOG_KEY, (flags & (1<<2)) ? TRUE : FALSE, NULL);
-				recover = (flags & (1<<1)) ? TRUE: FALSE;
-			}
-
-			if (recover) {
-				/* Disable the previews */
-				gconf_client_set_bool (client, "/apps/evolution/mail/display/show_preview", FALSE, NULL);
-				gconf_client_set_bool (client, "/apps/evolution/mail/display/safe_list", TRUE, NULL);
-				gconf_client_set_bool (client, "/apps/evolution/addressbook/display/show_preview", FALSE, NULL);
-				gconf_client_set_bool (client, "/apps/evolution/calendar/display/show_task_preview", FALSE, NULL);
-			}
-			/* Let us not delete and recreate a lock, instead reuse it. We don't use timestamps anyways */
-		} else {
-			/* What great can we do, if lock creation fails ?*/
-			e_file_lock_create ();
-		}
-		g_object_unref (client);
 
 		shell_window = e_shell_create_window ();
 		/* XXX Switch to default_component_id. */
@@ -710,5 +616,9 @@
 #ifdef G_OS_WIN32
 	link_shutdown ();
 #endif
+
+	/* Indicates a clean shut down to the next session. */
+	e_file_lock_destroy ();
+
 	return 0;
 }

Modified: branches/kill-bonobo/widgets/misc/e-online-button.c
==============================================================================
--- branches/kill-bonobo/widgets/misc/e-online-button.c	(original)
+++ branches/kill-bonobo/widgets/misc/e-online-button.c	Mon Aug 18 16:18:42 2008
@@ -22,9 +22,6 @@
 
 #include <glib/gi18n.h>
 
-#define ONLINE_IMAGE	"online.png"
-#define OFFLINE_IMAGE	"offline.png"
-
 #define E_ONLINE_BUTTON_GET_PRIVATE(obj) \
 	(G_TYPE_INSTANCE_GET_PRIVATE \
 	((obj), E_TYPE_ONLINE_BUTTON, EOnlineButtonPrivate))
@@ -177,18 +174,25 @@
                             gboolean online)
 {
 	GtkImage *image;
-	gchar *filename;
-	const gchar *image_name;
+	GtkIconInfo *icon_info;
+	GtkIconTheme *icon_theme;
+	const gchar *filename;
+	const gchar *icon_name;
 
 	g_return_if_fail (E_IS_ONLINE_BUTTON (button));
 
 	button->priv->online = online;
-	image_name = online ? ONLINE_IMAGE : OFFLINE_IMAGE;
 
 	image = GTK_IMAGE (button->priv->image);
-	filename = g_build_filename (EVOLUTION_IMAGES, image_name, NULL);
+	icon_name = online ? "online" : "offline";
+	icon_theme = gtk_icon_theme_get_default ();
+
+	/* Prevent GTK+ from scaling these rectangular icons. */
+	icon_info = gtk_icon_theme_lookup_icon (
+		icon_theme, icon_name, GTK_ICON_SIZE_BUTTON, 0);
+	filename = gtk_icon_info_get_filename (icon_info);
 	gtk_image_set_from_file (image, filename);
-	g_free (filename);
+	gtk_icon_info_free (icon_info);
 
 	g_object_notify (G_OBJECT (button), "online");
 }



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