evolution r36918 - branches/kill-bonobo/mail



Author: mbarnes
Date: Thu Dec 18 21:41:00 2008
New Revision: 36918
URL: http://svn.gnome.org/viewvc/evolution?rev=36918&view=rev

Log:
Implement yet more mail actions.


Modified:
   branches/kill-bonobo/mail/Makefile.am
   branches/kill-bonobo/mail/e-mail-shell-view-actions.c
   branches/kill-bonobo/mail/e-mail-shell-view-private.h
   branches/kill-bonobo/mail/em-folder-browser.c
   branches/kill-bonobo/mail/em-subscribe-editor.c
   branches/kill-bonobo/mail/em-subscribe-editor.h
   branches/kill-bonobo/mail/em-vfolder-editor.c
   branches/kill-bonobo/mail/em-vfolder-editor.h
   branches/kill-bonobo/mail/mail-vfolder.c
   branches/kill-bonobo/mail/mail-vfolder.h

Modified: branches/kill-bonobo/mail/Makefile.am
==============================================================================
--- branches/kill-bonobo/mail/Makefile.am	(original)
+++ branches/kill-bonobo/mail/Makefile.am	Thu Dec 18 21:41:00 2008
@@ -125,6 +125,8 @@
 	em-search-context.h				\
 	em-stripsig-filter.c				\
 	em-stripsig-filter.h				\
+	em-subscribe-editor.c				\
+	em-subscribe-editor.h				\
 	em-sync-stream.c				\
 	em-sync-stream.h				\
 	em-utils.c					\

Modified: branches/kill-bonobo/mail/e-mail-shell-view-actions.c
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-view-actions.c	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-view-actions.c	Thu Dec 18 21:41:00 2008
@@ -322,8 +322,20 @@
 action_mail_folder_expunge_cb (GtkAction *action,
                                EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+	EShellWindow *shell_window;
+	EShellView *shell_view;
+
+	shell_view = E_SHELL_VIEW (mail_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+	g_return_if_fail (folder_view->folder != NULL);
+
+	em_utils_expunge_folder (
+		GTK_WIDGET (shell_window), folder_view->folder);
 }
 
 static void
@@ -439,16 +451,26 @@
 action_mail_folder_select_thread_cb (GtkAction *action,
                                      EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	message_list_select_thread (folder_view->list);
 }
 
 static void
 action_mail_folder_select_subthread_cb (GtkAction *action,
                                         EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	message_list_select_subthread (folder_view->list);
 }
 
 static void
@@ -563,16 +585,32 @@
 action_mail_hide_read_cb (GtkAction *action,
                           EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	message_list_hide_add (
+		folder_view->list,
+		"(match-all (system-flag \"seen\"))",
+		ML_HIDE_SAME, ML_HIDE_SAME);
 }
 
 static void
 action_mail_hide_selected_cb (GtkAction *action,
                               EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+	GPtrArray *uids;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	uids = message_list_get_selected (folder_view->list);
+	message_list_hide_uids (folder_view->list, uids);
+	message_list_free_uids (folder_view->list, uids);
 }
 
 static void
@@ -759,8 +797,13 @@
 action_mail_message_post_cb (GtkAction *action,
                              EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	em_utils_post_to_folder (folder_view->folder);
 }
 
 static void
@@ -1159,8 +1202,13 @@
 action_mail_show_hidden_cb (GtkAction *action,
                             EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	message_list_hide_clear (folder_view->list);
 }
 
 static void
@@ -1175,24 +1223,33 @@
 action_mail_stop_cb (GtkAction *action,
                      EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	mail_cancel_all ();
 }
 
 static void
 action_mail_threads_collapse_all_cb (GtkAction *action,
                                      EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	message_list_set_threaded_collapse_all (folder_view->list);
 }
 
 static void
 action_mail_threads_expand_all_cb (GtkAction *action,
                                    EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EMailShellContent *mail_shell_content;
+	EMFolderView *folder_view;
+
+	mail_shell_content = mail_shell_view->priv->mail_shell_content;
+	folder_view = e_mail_shell_content_get_folder_view (mail_shell_content);
+
+	message_list_set_threaded_expand_all (folder_view->list);
 }
 
 static void
@@ -1207,24 +1264,38 @@
 action_mail_tools_filters_cb (GtkAction *action,
                               EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EShellWindow *shell_window;
+	EShellView *shell_view;
+
+	shell_view = E_SHELL_VIEW (mail_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+
+	em_utils_edit_filters (GTK_WIDGET (shell_window));
 }
 
 static void
 action_mail_tools_search_folders_cb (GtkAction *action,
                                      EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	vfolder_edit (E_SHELL_VIEW (mail_shell_view));
 }
 
 static void
 action_mail_tools_subscriptions_cb (GtkAction *action,
                                     EMailShellView *mail_shell_view)
 {
-	/* FIXME */
-	g_print ("Action: %s\n", gtk_action_get_name (GTK_ACTION (action)));
+	EShellWindow *shell_window;
+	EShellView *shell_view;
+	GtkWidget *dialog;
+
+	shell_view = E_SHELL_VIEW (mail_shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
+
+	dialog = em_subscribe_editor_new ();
+	gtk_window_set_transient_for (
+		GTK_WINDOW (dialog), GTK_WINDOW (shell_window));
+	gtk_dialog_run (GTK_DIALOG (dialog));
+	/* XXX Dialog destroys itself. */
 }
 
 static void

Modified: branches/kill-bonobo/mail/e-mail-shell-view-private.h
==============================================================================
--- branches/kill-bonobo/mail/e-mail-shell-view-private.h	(original)
+++ branches/kill-bonobo/mail/e-mail-shell-view-private.h	Thu Dec 18 21:41:00 2008
@@ -35,6 +35,7 @@
 #include "em-folder-properties.h"
 #include "em-folder-selector.h"
 #include "em-folder-utils.h"
+#include "em-subscribe-editor.h"
 #include "em-utils.h"
 #include "mail-autofilter.h"
 #include "mail-ops.h"

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	Thu Dec 18 21:41:00 2008
@@ -1459,156 +1459,156 @@
 		}
 }
 
-static void
-emfb_edit_select_thread(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	message_list_select_thread(emfv->list);
-}
-
-static void
-emfb_edit_select_subthread(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	message_list_select_subthread (emfv->list);
-}
-
-static void
-emfb_folder_properties(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-
-	if (emfb->view.folder_uri)
-		em_folder_properties_show(NULL, emfb->view.folder, emfb->view.folder_uri);
-}
+//static void
+//emfb_edit_select_thread(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//
+//	message_list_select_thread(emfv->list);
+//}
+
+//static void
+//emfb_edit_select_subthread(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//
+//	message_list_select_subthread (emfv->list);
+//}
+
+//static void
+//emfb_folder_properties(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//
+//	if (emfb->view.folder_uri)
+//		em_folder_properties_show(NULL, emfb->view.folder, emfb->view.folder_uri);
+//}
 
 /* VIEWTHREADED*/
-static void
-emfb_expand_all_threads(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	message_list_set_threaded_expand_all(emfv->list);
-
-}
-
-static void
-emfb_collapse_all_threads(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	message_list_set_threaded_collapse_all(emfv->list);
-}
-
-static void
-emfb_folder_copy(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-	CamelFolderInfo *fi = NULL;
-	CamelException ex;
-
-	/* FIXME: This function MUST become multi-threaded.
-	   FIXME: This interface should NOT use a folderinfo */
-
-	camel_exception_init (&ex);
-
-	if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
-					       emfb->view.folder->full_name,
-					       CAMEL_STORE_FOLDER_INFO_FAST,
-					       &ex)) != NULL)
-		em_folder_utils_copy_folder(fi, FALSE);
-
-	camel_exception_clear (&ex);
-
-	return;
-}
-
-static void
-emfb_folder_move(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-	CamelFolderInfo *fi = NULL;
-	CamelException ex;
-
-	camel_exception_init (&ex);
-
-	/* FIXME: This function MUST become multi-threaded.
-	   FIXME: This interface should NOT use a folderinfo */
-
-	if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
-					       emfb->view.folder->full_name,
-					       CAMEL_STORE_FOLDER_INFO_FAST,
-					       &ex)) != NULL)
-		em_folder_utils_copy_folder(fi, TRUE);
-
-	camel_exception_clear (&ex);
-
-	return;
-}
-
-static void
-emfb_folder_delete(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-
-	em_folder_utils_delete_folder (emfb->view.folder);
-
-	return;
-}
-
-static void
-emfb_folder_refresh(BonoboUIComponent *uid, void *data, const char *path)
-{
-        EMFolderBrowser *emfb = data;
-	EMFolderTree *tree = g_object_get_data (G_OBJECT (emfb), "foldertree");
-        CamelFolder *folder;
-
-        if ((folder = em_folder_tree_get_selected_folder (tree)) != NULL)
-                mail_refresh_folder(folder, NULL, NULL);
-}
-
-
-static void
-emfb_folder_rename(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-
-	em_folder_utils_rename_folder (emfb->view.folder);
-
-	return;
-}
-
-static void
-emfb_folder_create(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-	CamelFolderInfo *fi = NULL;
-	EMFolderTree *tree = g_object_get_data (G_OBJECT (emfb), "foldertree");
-
-	/* FIXME: This function MUST be multithreaded
-	   FIXME: This interface should NOT use a folderinfo */
-	if (emfb->view.folder) {
-		if ((fi = em_folder_tree_get_selected_folder_info (tree)) != NULL) {
-			em_folder_utils_create_folder(fi, tree);
-			camel_folder_info_free(fi);
-		}
-	} else {
-		em_folder_utils_create_folder(NULL, tree);
-	}
-
-	return;
-}
-
-static void
-emfb_folder_expunge(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-
-	if (emfb->view.folder)
-		em_utils_expunge_folder(gtk_widget_get_toplevel((GtkWidget *)emfb), emfb->view.folder);
-}
+//static void
+//emfb_expand_all_threads(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//
+//	message_list_set_threaded_expand_all(emfv->list);
+//
+//}
+
+//static void
+//emfb_collapse_all_threads(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//
+//	message_list_set_threaded_collapse_all(emfv->list);
+//}
+
+//static void
+//emfb_folder_copy(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//	CamelFolderInfo *fi = NULL;
+//	CamelException ex;
+//
+//	/* FIXME: This function MUST become multi-threaded.
+//	   FIXME: This interface should NOT use a folderinfo */
+//
+//	camel_exception_init (&ex);
+//
+//	if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
+//					       emfb->view.folder->full_name,
+//					       CAMEL_STORE_FOLDER_INFO_FAST,
+//					       &ex)) != NULL)
+//		em_folder_utils_copy_folder(fi, FALSE);
+//
+//	camel_exception_clear (&ex);
+//
+//	return;
+//}
+
+//static void
+//emfb_folder_move(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//	CamelFolderInfo *fi = NULL;
+//	CamelException ex;
+//
+//	camel_exception_init (&ex);
+//
+//	/* FIXME: This function MUST become multi-threaded.
+//	   FIXME: This interface should NOT use a folderinfo */
+//
+//	if ((fi = camel_store_get_folder_info (emfb->view.folder->parent_store,
+//					       emfb->view.folder->full_name,
+//					       CAMEL_STORE_FOLDER_INFO_FAST,
+//					       &ex)) != NULL)
+//		em_folder_utils_copy_folder(fi, TRUE);
+//
+//	camel_exception_clear (&ex);
+//
+//	return;
+//}
+
+//static void
+//emfb_folder_delete(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//
+//	em_folder_utils_delete_folder (emfb->view.folder);
+//
+//	return;
+//}
+
+//static void
+//emfb_folder_refresh(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//        EMFolderBrowser *emfb = data;
+//	EMFolderTree *tree = g_object_get_data (G_OBJECT (emfb), "foldertree");
+//        CamelFolder *folder;
+//
+//        if ((folder = em_folder_tree_get_selected_folder (tree)) != NULL)
+//                mail_refresh_folder(folder, NULL, NULL);
+//}
+
+
+//static void
+//emfb_folder_rename(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//
+//	em_folder_utils_rename_folder (emfb->view.folder);
+//
+//	return;
+//}
+
+//static void
+//emfb_folder_create(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//	CamelFolderInfo *fi = NULL;
+//	EMFolderTree *tree = g_object_get_data (G_OBJECT (emfb), "foldertree");
+//
+//	/* FIXME: This function MUST be multithreaded
+//	   FIXME: This interface should NOT use a folderinfo */
+//	if (emfb->view.folder) {
+//		if ((fi = em_folder_tree_get_selected_folder_info (tree)) != NULL) {
+//			em_folder_utils_create_folder(fi, tree);
+//			camel_folder_info_free(fi);
+//		}
+//	} else {
+//		em_folder_utils_create_folder(NULL, tree);
+//	}
+//
+//	return;
+//}
+
+//static void
+//emfb_folder_expunge(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//
+//	if (emfb->view.folder)
+//		em_utils_expunge_folder(gtk_widget_get_toplevel((GtkWidget *)emfb), emfb->view.folder);
+//}
 
 static void
 emfb_mark_all_read(BonoboUIComponent *uid, void *data, const char *path)
@@ -1630,83 +1630,83 @@
 	}
 }
 
-static void
-emfb_view_hide_read(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	message_list_hide_add(emfv->list, "(match-all (system-flag \"seen\"))", ML_HIDE_SAME, ML_HIDE_SAME);
-}
-
-static void
-emfb_view_hide_selected(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-	GPtrArray *uids;
-
-	/* TODO: perhaps this should sit directly on message_list? */
-	/* is it worth it, it's so trivial */
-
-	/* A new flag CAMEL_MESSAGE_HIDDEN is added by Sankar
-	while extending the CAMEL_MESSAGE_FLAGS for proxy permissions.
-	This can be used to hide messages.  */
-
-	uids = message_list_get_selected(emfv->list);
-	message_list_hide_uids(emfv->list, uids);
-	message_list_free_uids(emfv->list, uids);
-}
-
-static void
-emfb_view_show_all(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-
-	message_list_hide_clear(emfv->list);
-}
+//static void
+//emfb_view_hide_read(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//
+//	message_list_hide_add(emfv->list, "(match-all (system-flag \"seen\"))", ML_HIDE_SAME, ML_HIDE_SAME);
+//}
+
+//static void
+//emfb_view_hide_selected(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//	GPtrArray *uids;
+//
+//	/* TODO: perhaps this should sit directly on message_list? */
+//	/* is it worth it, it's so trivial */
+//
+//	/* A new flag CAMEL_MESSAGE_HIDDEN is added by Sankar
+//	while extending the CAMEL_MESSAGE_FLAGS for proxy permissions.
+//	This can be used to hide messages.  */
+//
+//	uids = message_list_get_selected(emfv->list);
+//	message_list_hide_uids(emfv->list, uids);
+//	message_list_free_uids(emfv->list, uids);
+//}
+
+//static void
+//emfb_view_show_all(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//
+//	message_list_hide_clear(emfv->list);
+//}
 
 /* ********************************************************************** */
 
-static void
-emfb_mail_stop(BonoboUIComponent *uid, void *data, const char *path)
-{
-	mail_cancel_all();
-}
-
-static void
-emfb_mail_post(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderView *emfv = data;
-	em_utils_post_to_folder (emfv->folder);
-}
-
-static void
-emfb_tools_filters(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-
-	em_utils_edit_filters ((GtkWidget *) emfb);
-}
-
-static void
-emfb_subscribe_editor_destroy(GtkWidget *w, EMFolderBrowser *emfb)
-{
-	emfb->priv->subscribe_editor = NULL;
-}
-
-static void
-emfb_tools_subscriptions(BonoboUIComponent *uid, void *data, const char *path)
-{
-	EMFolderBrowser *emfb = data;
-
-	if (emfb->priv->subscribe_editor) {
-		gdk_window_show(emfb->priv->subscribe_editor->window);
-	} else {
-		emfb->priv->subscribe_editor = (GtkWidget *)em_subscribe_editor_new();
-		e_dialog_set_transient_for((GtkWindow *)emfb->priv->subscribe_editor, (GtkWidget *)emfb);
-		g_signal_connect(emfb->priv->subscribe_editor, "destroy", G_CALLBACK(emfb_subscribe_editor_destroy), emfb);
-		gtk_widget_show(emfb->priv->subscribe_editor);
-	}
-}
+//static void
+//emfb_mail_stop(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	mail_cancel_all();
+//}
+
+//static void
+//emfb_mail_post(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderView *emfv = data;
+//	em_utils_post_to_folder (emfv->folder);
+//}
+
+//static void
+//emfb_tools_filters(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//
+//	em_utils_edit_filters ((GtkWidget *) emfb);
+//}
+
+//static void
+//emfb_subscribe_editor_destroy(GtkWidget *w, EMFolderBrowser *emfb)
+//{
+//	emfb->priv->subscribe_editor = NULL;
+//}
+
+//static void
+//emfb_tools_subscriptions(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	EMFolderBrowser *emfb = data;
+//
+//	if (emfb->priv->subscribe_editor) {
+//		gdk_window_show(emfb->priv->subscribe_editor->window);
+//	} else {
+//		emfb->priv->subscribe_editor = (GtkWidget *)em_subscribe_editor_new();
+//		e_dialog_set_transient_for((GtkWindow *)emfb->priv->subscribe_editor, (GtkWidget *)emfb);
+/		g_signal_connect(emfb->priv->subscribe_editor, "destroy", G_CALLBACK(emfb_subscribe_editor_destroy), emfb);
+///		gtk_widget_show(emfb->priv->subscribe_editor);
+//	}
+//}
 
 static void
 emfb_focus_search(BonoboUIComponent *uid, void *data, const char *path)
@@ -1722,12 +1722,12 @@
 	mail_component_show_logger ((GtkWidget *) data);
 }
 
-static void
-emfb_tools_vfolders(BonoboUIComponent *uid, void *data, const char *path)
-{
-	/* FIXME: rename/refactor this */
-	vfolder_edit();
-}
+//static void
+//emfb_tools_vfolders(BonoboUIComponent *uid, void *data, const char *path)
+//{
+//	/* FIXME: rename/refactor this */
+//	vfolder_edit();
+//}
 
 static BonoboUIVerb emfb_verbs[] = {
 	BONOBO_UI_UNSAFE_VERB ("EditCut", emfb_edit_cut),
@@ -1736,33 +1736,33 @@
 
 	BONOBO_UI_UNSAFE_VERB ("EditInvertSelection", emfb_edit_invert_selection),
 	BONOBO_UI_UNSAFE_VERB ("EditSelectAll", emfb_edit_select_all),
-        BONOBO_UI_UNSAFE_VERB ("EditSelectThread", emfb_edit_select_thread),
-	BONOBO_UI_UNSAFE_VERB ("EditSelectSubthread", emfb_edit_select_subthread),
-	BONOBO_UI_UNSAFE_VERB ("ChangeFolderProperties", emfb_folder_properties),
-	BONOBO_UI_UNSAFE_VERB ("FolderExpunge", emfb_folder_expunge),
+//        BONOBO_UI_UNSAFE_VERB ("EditSelectThread", emfb_edit_select_thread),
+//	BONOBO_UI_UNSAFE_VERB ("EditSelectSubthread", emfb_edit_select_subthread),
+//	BONOBO_UI_UNSAFE_VERB ("ChangeFolderProperties", emfb_folder_properties),
+//	BONOBO_UI_UNSAFE_VERB ("FolderExpunge", emfb_folder_expunge),
 	/* HideDeleted is a toggle */
 	BONOBO_UI_UNSAFE_VERB ("MessageMarkAllAsRead", emfb_mark_all_read),
-	BONOBO_UI_UNSAFE_VERB ("ViewHideRead", emfb_view_hide_read),
-	BONOBO_UI_UNSAFE_VERB ("ViewHideSelected", emfb_view_hide_selected),
-	BONOBO_UI_UNSAFE_VERB ("ViewShowAll", emfb_view_show_all),
+//	BONOBO_UI_UNSAFE_VERB ("ViewHideRead", emfb_view_hide_read),
+//	BONOBO_UI_UNSAFE_VERB ("ViewHideSelected", emfb_view_hide_selected),
+//	BONOBO_UI_UNSAFE_VERB ("ViewShowAll", emfb_view_show_all),
 	/* ViewThreaded is a toggle */
 
-	BONOBO_UI_UNSAFE_VERB ("ViewThreadsExpandAll", emfb_expand_all_threads),
-	BONOBO_UI_UNSAFE_VERB ("ViewThreadsCollapseAll", emfb_collapse_all_threads),
+//	BONOBO_UI_UNSAFE_VERB ("ViewThreadsExpandAll", emfb_expand_all_threads),
+//	BONOBO_UI_UNSAFE_VERB ("ViewThreadsCollapseAll", emfb_collapse_all_threads),
 
-	BONOBO_UI_UNSAFE_VERB ("FolderCopy", emfb_folder_copy),
-	BONOBO_UI_UNSAFE_VERB ("FolderMove", emfb_folder_move),
-	BONOBO_UI_UNSAFE_VERB ("FolderDelete", emfb_folder_delete),
-	BONOBO_UI_UNSAFE_VERB ("FolderRefresh", emfb_folder_refresh),
-	BONOBO_UI_UNSAFE_VERB ("FolderRename", emfb_folder_rename),
-	BONOBO_UI_UNSAFE_VERB ("FolderCreate", emfb_folder_create),
+//	BONOBO_UI_UNSAFE_VERB ("FolderCopy", emfb_folder_copy),
+//	BONOBO_UI_UNSAFE_VERB ("FolderMove", emfb_folder_move),
+//	BONOBO_UI_UNSAFE_VERB ("FolderDelete", emfb_folder_delete),
+//	BONOBO_UI_UNSAFE_VERB ("FolderRefresh", emfb_folder_refresh),
+//	BONOBO_UI_UNSAFE_VERB ("FolderRename", emfb_folder_rename),
+//	BONOBO_UI_UNSAFE_VERB ("FolderCreate", emfb_folder_create),
 	BONOBO_UI_UNSAFE_VERB ("HelpDebug", emfb_help_debug),
 
-	BONOBO_UI_UNSAFE_VERB ("MailPost", emfb_mail_post),
-	BONOBO_UI_UNSAFE_VERB ("MailStop", emfb_mail_stop),
-	BONOBO_UI_UNSAFE_VERB ("ToolsFilters", emfb_tools_filters),
+//	BONOBO_UI_UNSAFE_VERB ("MailPost", emfb_mail_post),
+//	BONOBO_UI_UNSAFE_VERB ("MailStop", emfb_mail_stop),
+//	BONOBO_UI_UNSAFE_VERB ("ToolsFilters", emfb_tools_filters),
 	BONOBO_UI_UNSAFE_VERB ("ToolsSubscriptions", emfb_tools_subscriptions),
-	BONOBO_UI_UNSAFE_VERB ("ToolsVFolders", emfb_tools_vfolders),
+//	BONOBO_UI_UNSAFE_VERB ("ToolsVFolders", emfb_tools_vfolders),
 	BONOBO_UI_UNSAFE_VERB ("FocusSearch", emfb_focus_search),
 
 	/* ViewPreview is a toggle */

Modified: branches/kill-bonobo/mail/em-subscribe-editor.c
==============================================================================
--- branches/kill-bonobo/mail/em-subscribe-editor.c	(original)
+++ branches/kill-bonobo/mail/em-subscribe-editor.c	Thu Dec 18 21:41:00 2008
@@ -786,7 +786,8 @@
 	g_object_unref (gconf);
 }
 
-GtkDialog *em_subscribe_editor_new(void)
+GtkWidget *
+em_subscribe_editor_new(void)
 {
 	EMSubscribeEditor *se;
 	EAccountList *accounts;
@@ -890,5 +891,5 @@
 	gtk_window_set_default_size ((GtkWindow *) se->dialog, window_size.width, window_size.height);
 	g_signal_connect (se->dialog, "size-allocate", G_CALLBACK (window_size_allocate), NULL);
 
-	return se->dialog;
+	return GTK_WIDGET (se->dialog);
 }

Modified: branches/kill-bonobo/mail/em-subscribe-editor.h
==============================================================================
--- branches/kill-bonobo/mail/em-subscribe-editor.h	(original)
+++ branches/kill-bonobo/mail/em-subscribe-editor.h	Thu Dec 18 21:41:00 2008
@@ -23,6 +23,6 @@
 
 #include <gtk/gtk.h>
 
-GtkDialog *em_subscribe_editor_new(void);
+GtkWidget *em_subscribe_editor_new(void);
 
 #endif /* ! _EM_SUBSCRIBE_EDITOR_H */

Modified: branches/kill-bonobo/mail/em-vfolder-editor.c
==============================================================================
--- branches/kill-bonobo/mail/em-vfolder-editor.c	(original)
+++ branches/kill-bonobo/mail/em-vfolder-editor.c	Thu Dec 18 21:41:00 2008
@@ -99,7 +99,7 @@
  *
  * Return value: A new #EMVFolderEditor object.
  **/
-EMVFolderEditor *
+GtkWidget *
 em_vfolder_editor_new (EMVFolderContext *vc)
 {
 	EMVFolderEditor *ve = (EMVFolderEditor *) g_object_new (em_vfolder_editor_get_type(), NULL);
@@ -116,7 +116,7 @@
         gtk_widget_hide(glade_xml_get_widget (gui, "filter_source"));
 	g_object_unref (gui);
 
-	return ve;
+	return GTK_WIDGET (ve);
 }
 
 static FilterRule *

Modified: branches/kill-bonobo/mail/em-vfolder-editor.h
==============================================================================
--- branches/kill-bonobo/mail/em-vfolder-editor.h	(original)
+++ branches/kill-bonobo/mail/em-vfolder-editor.h	Thu Dec 18 21:41:00 2008
@@ -47,6 +47,6 @@
 
 GType em_vfolder_editor_get_type (void);
 
-EMVFolderEditor *em_vfolder_editor_new (EMVFolderContext *vc);
+GtkWidget *em_vfolder_editor_new (EMVFolderContext *vc);
 
 #endif /* ! _EM_VFOLDER_EDITOR_H */

Modified: branches/kill-bonobo/mail/mail-vfolder.c
==============================================================================
--- branches/kill-bonobo/mail/mail-vfolder.c	(original)
+++ branches/kill-bonobo/mail/mail-vfolder.c	Thu Dec 18 21:41:00 2008
@@ -31,8 +31,8 @@
 #include <camel/camel-vee-folder.h>
 #include <camel/camel-vee-store.h>
 #include <camel/camel-vtrash-folder.h>
+#include <libedataserver/e-account-list.h>
 
-#include "libedataserver/e-account-list.h"
 #include "e-util/e-error.h"
 #include "e-util/e-util-private.h"
 
@@ -1024,48 +1024,42 @@
 	g_free(user);
 }
 
-static GtkWidget *vfolder_editor = NULL;
-
-static void
-em_vfolder_editor_response (GtkWidget *dialog, int button, void *data)
+void
+vfolder_edit (EShellView *shell_view)
 {
+	EShellModule *shell_module;
+	EShellWindow *shell_window;
+	GtkWidget *dialog;
 	const gchar *data_dir;
-	char *user;
-
-	data_dir = e_shell_module_get_data_dir (mail_shell_module);
-	user = g_build_filename (data_dir, "vfolders.xml", NULL);
-
-	switch(button) {
-	case GTK_RESPONSE_OK:
-		rule_context_save((RuleContext *)context, user);
-		break;
-	default:
-		rule_context_revert((RuleContext *)context, user);
-	}
+	gchar *filename;
 
-	vfolder_editor = NULL;
+	g_return_if_fail (E_IS_SHELL_VIEW (shell_view));
 
-	gtk_widget_destroy(dialog);
+	shell_module = e_shell_view_get_shell_module (shell_view);
+	shell_window = e_shell_view_get_shell_window (shell_view);
 
-	g_free (user);
-}
-
-void
-vfolder_edit (void)
-{
-	if (vfolder_editor) {
-		gdk_window_raise (GTK_WIDGET (vfolder_editor)->window);
-		return;
-	}
+	data_dir = e_shell_module_get_data_dir (shell_module);
+	filename = g_build_filename (data_dir, "vfolders.xml", NULL);
 
 	/* ensures vfolder is running */
 	vfolder_load_storage ();
 
-	vfolder_editor = GTK_WIDGET (em_vfolder_editor_new (context));
-	gtk_window_set_title (GTK_WINDOW (vfolder_editor), _("Search Folders"));
-	g_signal_connect(vfolder_editor, "response", G_CALLBACK(em_vfolder_editor_response), NULL);
+	dialog = em_vfolder_editor_new (context);
+	gtk_window_set_title (
+		GTK_WINDOW (dialog), _("Search Folders"));
+	gtk_window_set_transient_for (
+		GTK_WINDOW (dialog), GTK_WINDOW (shell_window));
+
+	switch (gtk_dialog_run (GTK_DIALOG (dialog))) {
+		case GTK_RESPONSE_OK:
+			rule_context_save ((RuleContext *) context, filename);
+			break;
+		default:
+			rule_context_revert ((RuleContext *) context, filename);
+			break;
+	}
 
-	gtk_widget_show (vfolder_editor);
+	gtk_widget_destroy (dialog);
 }
 
 static void

Modified: branches/kill-bonobo/mail/mail-vfolder.h
==============================================================================
--- branches/kill-bonobo/mail/mail-vfolder.h	(original)
+++ branches/kill-bonobo/mail/mail-vfolder.h	Thu Dec 18 21:41:00 2008
@@ -22,6 +22,8 @@
 #ifndef _MAIL_VFOLDER_H
 #define _MAIL_VFOLDER_H
 
+#include <shell/e-shell-view.h>
+
 struct _CamelStore;
 struct _FilterPart;
 struct _FilterRule;
@@ -32,7 +34,7 @@
 void vfolder_load_storage(void);
 void vfolder_revert(void);
 
-void vfolder_edit (void);
+void vfolder_edit (EShellView *shell_view);
 void vfolder_edit_rule(const char *name);
 struct _FilterPart *vfolder_create_part (const char *name);
 struct _FilterRule *vfolder_clone_rule (struct _FilterRule *in);



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