[evolution-patches] Patch to add Properties menu popup on a store



Hey,

Attaching a patch which activates the previously greyed out Properties
Pop up on a store at right click. The action now launches the Account
Editor window on a store and retains the action on a folder.

Cheers,
Shreyas
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
retrieving revision 1.3639
diff -u -p -w -r1.3639 ChangeLog
--- ChangeLog	20 May 2005 13:13:27 -0000	1.3639
+++ ChangeLog	23 May 2005 11:00:27 -0000
@@ -1,3 +1,10 @@
+2005-05-23  Shreyas Srinivasan	<sshreyas novell com>
+
+	* em-folder-tree.c: Add conditional to emft_popup_properties to
+	handle properties for store.
+
+	* em-folder-tree-model.c: Add account checked enabled.
+	
 2005-05-20  Not Zed  <NotZed Ximian com>
 
 	* mail-component.c (mail_component_peek_session): add helper for
Index: em-folder-tree-model.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree-model.c,v
retrieving revision 1.66
diff -u -p -w -r1.66 em-folder-tree-model.c
--- em-folder-tree-model.c	1 Feb 2005 19:30:49 -0000	1.66
+++ em-folder-tree-model.c	23 May 2005 11:01:11 -0000
@@ -380,8 +380,7 @@ account_changed (EAccountList *accounts,
 		return;
 	
 	em_folder_tree_model_remove_store (model, si->store);
-	
-	if (!(uri = account->source->url))
+	if (!account->enabled || !(uri = account->source->url))
 		return;
 	
 	camel_exception_init (&ex);
Index: em-folder-tree.c
===================================================================
RCS file: /cvs/gnome/evolution/mail/em-folder-tree.c,v
retrieving revision 1.150
diff -u -p -w -r1.150 em-folder-tree.c
--- em-folder-tree.c	19 May 2005 06:06:35 -0000	1.150
+++ em-folder-tree.c	23 May 2005 11:04:11 -0000
@@ -62,6 +62,7 @@
 #include "mail-component.h"
 #include "mail-vfolder.h"
 
+#include "em-account-editor.h"
 #include "em-utils.h"
 #include "em-popup.h"
 #include "em-marshal.h"
@@ -2088,17 +2089,26 @@ emft_popup_properties (EPopup *ep, EPopu
 {
 	EMFolderTree *emft = data;
 	struct _EMFolderTreePrivate *priv = emft->priv;
+	EAccount *account;
 	GtkTreeSelection *selection;
 	GtkTreeModel *model;
 	GtkTreeIter iter;
+	gboolean is_store;
 	char *uri;
 	
 	selection = gtk_tree_view_get_selection (priv->treeview);
 	if (!emft_selection_get_selected (selection, &model, &iter))
 		return;
 	
-	gtk_tree_model_get (model, &iter, COL_STRING_URI, &uri, -1);
+	gtk_tree_model_get (model, &iter, COL_BOOL_IS_STORE, &is_store, COL_STRING_URI, &uri, -1);
+	if (is_store){
+		account = mail_config_get_account_by_source_url (uri);
+		em_account_editor_new(account, EMAE_NOTEBOOK, "org.gnome.evolution.mail.config.accountEditor");
+	}
+	else
+	{
 	em_folder_properties_show (NULL, NULL, uri);
+	}
 	g_free (uri);
 }
 
@@ -2120,7 +2130,7 @@ static EPopupItem emft_popup_items[] = {
 	{ E_POPUP_ITEM, "20.emc.02", N_("_Rename..."), emft_popup_rename_folder, NULL, NULL, 0, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_DELETE },
 	
 	{ E_POPUP_BAR, "80.emc" },
-	{ E_POPUP_ITEM, "80.emc.00", N_("_Properties"), emft_popup_properties, NULL, "stock_folder-properties", 0, EM_POPUP_FOLDER_FOLDER|EM_POPUP_FOLDER_SELECT }
+	{ E_POPUP_ITEM, "80.emc.00", N_("_Properties"), emft_popup_properties, NULL, "stock_folder-properties", 0, EM_POPUP_FOLDER_INFERIORS }
 };
 
 static void


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