[evolution/webkit] Rip out Anjal-specific cruft we don't need.



commit 63027e70565f0459cd2962624cd7c56ca74ce178
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Mar 27 18:22:23 2011 -0400

    Rip out Anjal-specific cruft we don't need.
    
    Need to trim off the fat if we're ever going to merge the souped up mail
    account wizard.  Still a long way to go...

 capplet/anjal-settings-main.c         |   56 +-----
 capplet/settings/Makefile.am          |    2 -
 capplet/settings/anjal-mail-view.c    |   41 ----
 capplet/settings/anjal-mail-view.h    |    6 -
 capplet/settings/mail-capplet-shell.c |   16 --
 capplet/settings/mail-capplet-shell.h |    2 -
 capplet/settings/mail-decoration.c    |  359 ---------------------------------
 capplet/settings/mail-decoration.h    |   68 ------
 capplet/settings/mail-view.c          |  116 -----------
 capplet/settings/mail-view.h          |   15 +--
 10 files changed, 3 insertions(+), 678 deletions(-)
---
diff --git a/capplet/anjal-settings-main.c b/capplet/anjal-settings-main.c
index 4a281b6..07dbda2 100644
--- a/capplet/anjal-settings-main.c
+++ b/capplet/anjal-settings-main.c
@@ -56,17 +56,9 @@
 #endif
 #endif
 
-gboolean windowed = FALSE;
-gboolean anjal_icon_decoration = FALSE;
-gboolean default_app =  FALSE;
 guint32 socket_id = 0;
 GtkWidget *main_window;
 static gchar **remaining_args;
-extern gchar *shell_moduledir;
-
-#define GCONF_KEY_MAILTO_ENABLED "/desktop/gnome/url-handlers/mailto/enabled"
-#define GCONF_KEY_MAILTO_COMMAND "/desktop/gnome/url-handlers/mailto/command"
-#define ANJAL_MAILTO_COMMAND "anjal %s"
 
 static void
 categories_icon_theme_hack (void)
@@ -99,48 +91,17 @@ categories_icon_theme_hack (void)
 }
 
 static void
-check_and_set_default_mail (void)
-{
-	GConfClient *client = gconf_client_get_default ();
-	gchar *mailer;
-
-	mailer  = gconf_client_get_string (client, GCONF_KEY_MAILTO_COMMAND, NULL);
-	if (mailer && *mailer && (strcmp (mailer, ANJAL_MAILTO_COMMAND) == 0)) {
-		g_object_unref (client);
-		return; /* Anjal is the default mailer */
-	}
-
-	gconf_client_set_bool (client, GCONF_KEY_MAILTO_ENABLED, TRUE, NULL);
-	gconf_client_set_string (client, GCONF_KEY_MAILTO_COMMAND, ANJAL_MAILTO_COMMAND, NULL);
-	g_object_unref (client);
-}
-
-static gboolean
-idle_cb (MailCappletShell *mshell G_GNUC_UNUSED)
-{
-
-	if (default_app) {
-		check_and_set_default_mail ();
-	}
-
-	return FALSE;
-}
-
-static void
 create_default_shell (void)
 {
 	main_window = mail_capplet_shell_new (socket_id, FALSE, TRUE);
 	if (!socket_id)
 		gtk_widget_show (main_window);
-	g_idle_add ((GSourceFunc) idle_cb, remaining_args);
 }
 
 gint
 main (gint argc, gchar *argv[])
 {
 	GError *error = NULL;
-	GConfClient *client;
-
 
 #ifdef G_OS_WIN32
 	/* Reduce risks */
@@ -181,8 +142,6 @@ main (gint argc, gchar *argv[])
 #endif
 
 	static GOptionEntry entries[] = {
-		{ "windowed", 'w', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &windowed,N_("Run Anjal in a window"), NULL },
-		{ "default-mailer", 'd', G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_NONE, &default_app,N_("Make Anjal the default email client"), NULL },
 		{ "socket",
 		  's',
 		  G_OPTION_FLAG_IN_MAIN,
@@ -203,28 +162,17 @@ main (gint argc, gchar *argv[])
 
 	setlocale (LC_ALL, NULL);
 
-	if (!gtk_init_with_args (&argc, &argv, _("Anjal email client"), entries, NULL, &error)) {
-		g_error ("Unable to start Anjal: %s\n", error->message);
-		g_error_free (error);
-	}
+	if (!gtk_init_with_args (&argc, &argv, NULL, entries, NULL, &error))
+		g_error ("%s", error->message);
 
 	if (!g_thread_get_initialized ())
 		g_thread_init (NULL);
 
-	client = gconf_client_get_default ();
-
 	e_passwords_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 ();
 
-	gconf_client_set_bool (client, "/apps/evolution/mail/display/enable_vfolders", FALSE, NULL);
-	g_object_unref (client);
-
 	create_default_shell ();
 
-	if (windowed)
-		anjal_icon_decoration = TRUE;
-
 	gtk_main ();
 
 	return 0;
diff --git a/capplet/settings/Makefile.am b/capplet/settings/Makefile.am
index 61b74c8..e6ea573 100644
--- a/capplet/settings/Makefile.am
+++ b/capplet/settings/Makefile.am
@@ -45,8 +45,6 @@ libevolution_mail_settings_la_SOURCES = \
 	mail-view.h \
 	mail-capplet-shell.c \
 	mail-capplet-shell.h \
-	mail-decoration.c \
-	mail-decoration.h \
 	anjal-mail-view.h \
 	anjal-mail-view.c \
 	mail-guess-servers.c \
diff --git a/capplet/settings/anjal-mail-view.c b/capplet/settings/anjal-mail-view.c
index 92c811b..6779e2e 100644
--- a/capplet/settings/anjal-mail-view.c
+++ b/capplet/settings/anjal-mail-view.c
@@ -93,44 +93,3 @@ anjal_mail_view_class_init (AnjalMailViewClass *klass)
 	klass->init_search = view_init_search;
 };
 
-AnjalMailView *
-anjal_mail_view_new ()
-{
-	AnjalMailView *shell = g_object_new (ANJAL_MAIL_VIEW_TYPE, NULL);
-
-	return shell;
-}
-
-void
-anjal_mail_view_set_folder_uri (AnjalMailView *mv, const gchar *uri)
-{
-	if (!mv || !uri)
-		return;
-
-	ANJAL_MAIL_VIEW_GET_CLASS (mv)->set_folder_uri (mv, uri);
-}
-
-void
-anjal_mail_view_set_folder_tree_widget (AnjalMailView *mv, GtkWidget *tree)
-{
-	ANJAL_MAIL_VIEW_GET_CLASS (mv)->set_folder_tree_widget (mv, tree);
-}
-
-void
-anjal_mail_view_set_folder_tree (AnjalMailView *mv, GtkWidget *tree)
-{
-	ANJAL_MAIL_VIEW_GET_CLASS (mv)->set_folder_tree (mv, (EMFolderTree *)tree);
-}
-
-void
-anjal_mail_view_set_search (AnjalMailView *view, const gchar *search)
-{
-	ANJAL_MAIL_VIEW_GET_CLASS (view)->set_search (view, search);
-}
-
-void
-anjal_mail_view_init_search (AnjalMailView *mv, GtkWidget *search)
-{
-	ANJAL_MAIL_VIEW_GET_CLASS (mv)->init_search (mv, search);
-}
-
diff --git a/capplet/settings/anjal-mail-view.h b/capplet/settings/anjal-mail-view.h
index 953aa4b..115a877 100644
--- a/capplet/settings/anjal-mail-view.h
+++ b/capplet/settings/anjal-mail-view.h
@@ -55,10 +55,4 @@ typedef struct _AnjalMailViewClass {
 } AnjalMailViewClass;
 
 GType anjal_mail_view_get_type (void);
-AnjalMailView * anjal_mail_view_new (void);
-void  anjal_mail_view_set_folder_uri (AnjalMailView *mv, const gchar *uri);
-void anjal_mail_view_set_folder_tree_widget (AnjalMailView *mv, GtkWidget *tree);
-void anjal_mail_view_set_folder_tree (AnjalMailView *mv, GtkWidget *tree);
-void anjal_mail_view_set_search (AnjalMailView *view, const gchar *search);
-void anjal_mail_view_init_search (AnjalMailView *mv, GtkWidget *search);
 #endif
diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c
index 030de15..cb5c7ec 100644
--- a/capplet/settings/mail-capplet-shell.c
+++ b/capplet/settings/mail-capplet-shell.c
@@ -37,7 +37,6 @@
 
 #include <e-util/e-util.h>
 
-#include "mail-decoration.h"
 #include <mail/em-utils.h>
 #include <mail/em-composer-utils.h>
 #include <mail/mail-config.h>
@@ -254,31 +253,16 @@ mail_capplet_shell_construct (MailCappletShell *shell, gint socket_id, gboolean
 
 	if (just_druid) {
 		MailViewChild *mc;
-		gchar *pdir = g_build_filename (g_get_home_dir(), ".gnome2_private", NULL);
 
 		gtk_notebook_set_show_tabs ((GtkNotebook *)shell->view, FALSE);
 		mc = mail_view_add_page ((MailView *)shell->view, MAIL_VIEW_ACCOUNT, NULL);
 		g_signal_connect (mc, "view-close", G_CALLBACK(ms_show_post_druid), shell);
 		setup_abooks ();
-		if (!g_file_test (pdir, G_FILE_TEST_EXISTS)) {
-			g_mkdir (pdir, 0700);
-		}
-		g_free (pdir);
 	} else
 		shell->priv->settings_view = mail_view_add_page ((MailView *)shell->view, MAIL_VIEW_SETTINGS, NULL);
 
 }
 
-gint
-mail_capplet_shell_toolbar_height (MailCappletShell *shell)
-{
-	GtkAllocation allocation;
-
-	gtk_widget_get_allocation (shell->priv->top_bar, &allocation);
-
-	return allocation.height;
-}
-
 GtkWidget *
 mail_capplet_shell_new (gint socket_id, gboolean just_druid, gboolean main_loop)
 {
diff --git a/capplet/settings/mail-capplet-shell.h b/capplet/settings/mail-capplet-shell.h
index 05159a5..5ddbe4c 100644
--- a/capplet/settings/mail-capplet-shell.h
+++ b/capplet/settings/mail-capplet-shell.h
@@ -54,8 +54,6 @@ GType		mail_capplet_shell_get_type	(void);
 GtkWidget *	mail_capplet_shell_new		(gint socket_id,
 						 gboolean just_druid,
 						 gboolean main_loop);
-gint		mail_capplet_shell_toolbar_height
-						(MailCappletShell *shell);
 
 #endif
 
diff --git a/capplet/settings/mail-view.c b/capplet/settings/mail-view.c
index 356916d..4c7c9dd 100644
--- a/capplet/settings/mail-view.c
+++ b/capplet/settings/mail-view.c
@@ -425,17 +425,6 @@ mail_view_add_settings (MailView *mv, gpointer data, gboolean block)
 	return (MailViewChild *)msv;
 }
 
-void
-mail_view_switch_to_settings (MailView* mv, MailViewChild *mpv)
-{
-	gint position = 0;
-
-	position = mv_get_page_number ((GtkNotebook *)mv, (GtkWidget *)mpv);
-	REALIGN_NODES (mv->priv->children,mpv);
-	gtk_notebook_set_current_page ((GtkNotebook *)mv, position);
-	mail_settings_view_activate ((MailSettingsView *)mpv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
-}
-
 static MailViewChild *
 mail_view_add_account (MailView *mv,
                        gpointer data,
@@ -551,23 +540,6 @@ mail_view_set_folder_uri (MailView *mv, const gchar *uri)
 	 mv_switch_folder_view (mv, uri);
 }
 
-void
-mail_view_show_sort_popup (MailView *mv, GtkWidget *button)
-{
-	mail_folder_view_show_sort_popup ((MailFolderView *)mv->priv->current_view, button);
-}
-
-void
-mail_view_show_list (MailView *mv)
-{
-	 MailViewChild *child = (MailViewChild *)mv->priv->current_view;
-
-	 if (child->type == MAIL_VIEW_MESSAGE)
-		  mv_close_mcv (child, mv);
-	 else if (child->type == MAIL_VIEW_FOLDER)
-		  mail_folder_view_show_list ((MailFolderView *)mv->priv->current_view);
-
-}
 #endif
 void
 mail_view_close_view (MailView *mv)
@@ -577,52 +549,12 @@ mail_view_close_view (MailView *mv)
 	 mv_close_mcv (child, mv);
 }
 
-#ifndef ANJAL_SETTINGS
-static void
-mv_slider_clicked (GtkButton *slider, MailView *mv)
-{
-	gtk_widget_hide (mv->slider);
-	gtk_widget_show (mv->folder_tree);
-	if (mv->priv->current_view->type == MAIL_VIEW_FOLDER)
-		 mail_folder_view_show_list ((MailFolderView *)mv->priv->current_view);
-	else {
-		 gtk_widget_show (mv->folder_tree);
-		 gtk_widget_hide ((GtkWidget *)slider);
-	}
-}
-
-void
-mail_view_set_slider (MailView *mv, GtkWidget *slider)
-{
-	mv->slider = slider;
-	g_signal_connect (slider, "clicked", G_CALLBACK(mv_slider_clicked), mv);
-}
-#endif
-
-void
-mail_view_set_folder_tree_widget (MailView *mv, GtkWidget *tree)
-{
-	mv->folder_tree = tree;
-}
-
 void
 mail_view_set_folder_tree (MailView *mv, GtkWidget *tree)
 {
 	mv->tree = tree;
 }
 
-void
-mail_view_set_check_email (MailView *mv, GtkWidget *button)
-{
-	 mv->check_mail = button;;
-}
-
-void
-mail_view_set_sort_by  (MailView *mv, GtkWidget *button)
-{
-	 mv->sort_by = button;;
-}
-
 #ifndef ANJAL_SETTINGS
 static void
 mv_spinner_done (CamelFolder *f, gpointer data)
@@ -632,42 +564,6 @@ mv_spinner_done (CamelFolder *f, gpointer data)
 }
 
 void
-mail_view_check_mail (MailView *mv, gboolean deep)
-{
-	 MailViewChild *child = (MailViewChild *)mv->priv->current_view;
-
-	 if (child && child->type == MAIL_VIEW_FOLDER) {
-		  mail_folder_view_check_mail ((MailFolderView *)child);
-		  CamelFolder *folder;
-
-		  if ((folder = em_folder_tree_get_selected_folder ((EMFolderTree *)mv->tree)) != NULL) {
-			   mv_spinner_show (mv, TRUE);
-			   mail_refresh_folder (folder, mv_spinner_done, mv);
-		  }
-	 }
-
-	if (deep) {
-		em_utils_clear_get_password_canceled_accounts_flag ();
-		mail_send_receive (NULL);
-	}
-}
-
-void
-mail_view_save (MailView *mv)
-{
-	 GList *child = mv->priv->children;
-	 MailViewChild *cview;
-
-	 while (child) {
-		  cview = (MailViewChild *)child->data;
-		  if (cview->type == MAIL_VIEW_FOLDER) {
-			   mail_folder_view_save ((MailFolderView *)cview);
-		  }
-		  child = child->next;
-	 }
-}
-
-void
 mail_view_set_search (MailView *mv, const gchar *search)
 {
 	MailViewChild *child = (MailViewChild *)mv->priv->current_view;
@@ -681,18 +577,6 @@ mail_view_set_search (MailView *mv, const gchar *search)
 #endif
 
 void
-mail_view_set_search_entry (MailView *mv, GtkWidget *entry)
-{
-	mv->priv->search_entry = entry;
-}
-
-void
-mail_view_init_search (MailView *mv, GtkWidget *search)
-{
-	mv->priv->search = search;
-}
-
-void
 mail_view_set_shell_view (MailView *mv, EShellView *shell)
 {
 	mv->shell_view = shell;
diff --git a/capplet/settings/mail-view.h b/capplet/settings/mail-view.h
index 904338e..558bb94 100644
--- a/capplet/settings/mail-view.h
+++ b/capplet/settings/mail-view.h
@@ -40,8 +40,7 @@ enum {
 	MAIL_VIEW_COMPOSER,
 	MAIL_VIEW_MESSAGE,
 	MAIL_VIEW_ACCOUNT,
-	MAIL_VIEW_SETTINGS,
-	MAIL_VIEW_PEOPLE
+	MAIL_VIEW_SETTINGS
 };
 
 typedef struct _MailViewPrivate MailViewPrivate;
@@ -79,22 +78,10 @@ typedef struct _MailViewChild {
 GType mail_view_get_type (void);
 MailView * mail_view_new (void);
 void  mail_view_set_folder_uri (MailView *mv, const gchar *uri);
-void mail_view_show_sort_popup (MailView *mv, GtkWidget *);
-void mail_view_show_list (MailView *mv);
 void mail_view_close_view (MailView *mv);
-void mail_view_set_check_email (MailView *mv, GtkWidget *button);
-void mail_view_set_sort_by  (MailView *mv, GtkWidget *button);
-void mail_view_check_mail (MailView *mv, gboolean deep);
-void mail_view_set_folder_tree_widget (MailView *mv, GtkWidget *tree);
 void mail_view_set_folder_tree (MailView *mv, GtkWidget *tree);
-void mail_view_save (MailView *mv);
 MailViewChild * mail_view_add_page (MailView *mv, guint16 type, gpointer data);
 void mail_view_set_search (MailView *view, const gchar *search);
-void mail_view_set_slider (MailView *mv, GtkWidget *slider);
-void mail_view_init_search (MailView *mv, GtkWidget *search);
-void mail_view_switch_to_people (MailView* mv, MailViewChild *mpv);
-void mail_view_switch_to_settings (MailView* mv, MailViewChild *mpv);
-void mail_view_set_search_entry (MailView *mv, GtkWidget *entry);
 void mail_view_set_shell_view (MailView *mv, EShellView *shell);
 
 #endif



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