[anjal/evolution-2-30] Adapt to some recent API changes in Evolution master.



commit b2d42124c600368e3272b979f99406151451b04d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Mon Dec 14 09:35:42 2009 -0500

    Adapt to some recent API changes in Evolution master.

 src/em-format-mail-display.c |    1 -
 src/mail-composer-view.c     |    4 ++--
 src/mail-shell.c             |   19 ++++++++-----------
 src/main.c                   |   15 +--------------
 4 files changed, 11 insertions(+), 28 deletions(-)
---
diff --git a/src/em-format-mail-display.c b/src/em-format-mail-display.c
index e2364a4..ee4ad2e 100644
--- a/src/em-format-mail-display.c
+++ b/src/em-format-mail-display.c
@@ -55,7 +55,6 @@
 #include <camel/camel-string-utils.h>
 #include <camel/camel-operation.h>
 
-#include <misc/e-cursors.h>
 #include <e-util/e-util.h>
 
 #include <libedataserver/e-flag.h>
diff --git a/src/mail-composer-view.c b/src/mail-composer-view.c
index 8798b73..9e0fdc0 100644
--- a/src/mail-composer-view.c
+++ b/src/mail-composer-view.c
@@ -28,7 +28,7 @@
 
 #include <glib/gi18n.h>
 
-#include <e-util/e-error.h>
+#include <e-util/e-alert-dialog.h>
 
 #include "mail-view.h"
 #include "mail-composer-view.h"
@@ -290,7 +290,7 @@ mail_composer_view_can_quit (MailComposerView *mcv)
 		subject = e_composer_header_table_get_subject (table);
 		if (subject == NULL || *subject == '\0')
 			subject = _("Untitled Message");
-		response = e_error_run (GTK_WINDOW (composer), "mail-composer:exit-unsaved", subject, NULL);
+		response = e_alert_run_dialog_for_args (GTK_WINDOW (composer), "mail-composer:exit-unsaved", subject, NULL);
 		if (response ==  GTK_RESPONSE_YES) {
 			e_msg_composer_request_close (composer);
 			gtk_action_activate (gtkhtml_editor_get_action (editor, "save-draft"));
diff --git a/src/mail-shell.c b/src/mail-shell.c
index 1e6e237..cb4dd37 100644
--- a/src/mail-shell.c
+++ b/src/mail-shell.c
@@ -111,7 +111,6 @@ struct  _MailShellPrivate {
 	MailViewChild *settings_view;
 
 	EShellTaskbar *task_bar;
-	GtkWidget *status_bar;
 	
 	guint task_bar_id;
 
@@ -153,10 +152,10 @@ static gboolean
 cleanup_status (EShellWindow *eshell)
 {
 	MailShell *shell = (MailShell *)eshell;
-	int count = e_shell_taskbar_get_task_count (shell->priv->task_bar);
+	int count = e_shell_taskbar_get_activity_count (shell->priv->task_bar);
 
-	if (count == 0 && GTK_WIDGET_VISIBLE(shell->priv->status_bar))
-		gtk_widget_hide (shell->priv->status_bar);
+	if (count == 0 && e_shell_window_get_taskbar_visible (eshell))
+		e_shell_window_set_taskbar_visible (eshell, FALSE);
 
 
 	return TRUE;
@@ -165,7 +164,7 @@ cleanup_status (EShellWindow *eshell)
 static void
 ms_activity_added (EShellWindow *window, EActivity *activity)
 {
-	gtk_widget_show (((MailShell *)window)->priv->status_bar);
+	e_shell_window_set_taskbar_visible (window, TRUE);
 }
 
 static void
@@ -228,9 +227,8 @@ idle_cb (EShellWindow *eshell)
 	gtk_widget_show ((GtkWidget *)view);
 	
 	shell->priv->task_bar = e_shell_view_get_shell_taskbar (shell_view);
-	shell->priv->status_bar = e_shell_window_get_status_area (eshell);
 	shell->priv->task_bar_id = g_timeout_add (10 * 1000, (GSourceFunc) cleanup_status, eshell);
-	gtk_widget_hide (shell->priv->status_bar);
+	e_shell_window_set_taskbar_visible (eshell, FALSE);
 	es = e_shell_get_default ();
 	backend = e_shell_get_backend_by_name (es, "anjal");
 	g_signal_connect_swapped (backend, "activity-added", G_CALLBACK(ms_activity_added), eshell);
@@ -255,12 +253,9 @@ static void
 ms_construct_toolbar (EShellWindow *eshell, GtkWidget *container)
 {
 	MailShell *shell = (MailShell *)eshell;
-	MailShellPrivate *priv;
+	MailShellPrivate *priv = shell->priv;
 	GtkWidget *box, *tmp, *lbl, *ar1;
 	
-	/* Argh, its constructed even before init. Fix the design */
-	priv = shell->priv = g_new0(MailShellPrivate, 1);
-
 	priv->top_bar = gtk_toolbar_new ();
 	gtk_box_pack_start ((GtkBox *)container, priv->top_bar, FALSE, FALSE, 0);
 	gtk_widget_show_all (priv->top_bar);
@@ -404,6 +399,8 @@ mail_shell_init (MailShell  *shell)
 {
 	GtkWidget *widget;
 	GConfClient *client = gconf_client_get_default();
+
+	shell->priv = g_new0 (MailShellPrivate, 1);
 	shell->priv->people = NULL;
 	shell->priv->settings_view = NULL;
 
diff --git a/src/main.c b/src/main.c
index d7b4922..2289402 100644
--- a/src/main.c
+++ b/src/main.c
@@ -34,12 +34,10 @@
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 #include <glib/gi18n.h>
-#include <misc/e-cursors.h>
 #include <libedataserverui/e-passwords.h>
 #include <mail/mail-mt.h>
 #include "mail-shell.h"
 #include <gconf/gconf-client.h>
-#include <e-util/e-icon-factory.h>
 #include <libedataserver/e-categories.h>
 #include <dbus/dbus-glib.h>
 
@@ -238,6 +236,7 @@ create_default_shell (void)
 	shell = g_object_new (
 		E_TYPE_SHELL,
 		"name", "org.gnome.Anjal",
+		"module-directory", ANJAL_MODULEDIR,
 		"online", online,
 		NULL);
 
@@ -247,10 +246,6 @@ create_default_shell (void)
 
 	g_object_unref (client);
 
-	/* EShell keeps its own reference to the first instance for use
-	 * in e_shell_get_default(), so it's safe to unreference here. */
-	g_object_unref (shell);
-
 	g_idle_add ((GSourceFunc) idle_cb, remaining_args);
 }
 
@@ -261,10 +256,6 @@ main (int argc, char *argv[])
 	EShell *default_shell;
 	GConfClient *client = gconf_client_get_default();
 
-	shell_moduledir = ANJAL_MODULEDIR;
-
-	if (!g_thread_supported ()) 
-		g_thread_init (NULL);
 #ifdef G_OS_WIN32
 	extern void link_shutdown (void);
 	set_paths ();
@@ -299,13 +290,11 @@ main (int argc, char *argv[])
 		g_error_free(error);
 	}
 #endif	
-	g_type_init ();
 	if (!g_thread_get_initialized ())
 		g_thread_init (NULL);
 	dbus_g_thread_init ();
 
 	e_passwords_init();
-	e_icon_factory_init ();
 	gtk_icon_theme_append_search_path (gtk_icon_theme_get_default(), PACKAGE_DATA_DIR G_DIR_SEPARATOR_S "anjal" G_DIR_SEPARATOR_S "icons");
 	categories_icon_theme_hack ();
 
@@ -345,8 +334,6 @@ main (int argc, char *argv[])
 	if (E_IS_SHELL (default_shell))
 		g_warning ("Shell not finalized on exit");
 	
-	e_icon_factory_shutdown ();
-	
 #ifdef G_OS_WIN32
 	link_shutdown ();
 #endif



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