Re: [evolution-patches] #55299: Can't change several attachment property in Mail



I have done as what you said.

the third one is not a problem.  Because have tested in the Chinese version. It works ok.

Bill

在2004年03月16日的23:55,Jeffrey Stedfast写道:
a few issues still:

- please set disposition inline next time (attachment properties -> "Suggest to show inline")

- multi-line for-loops should be bracketed, makes it easier to read.

- I don't think you can strcmp on the icon_context_menu_info[i].label as it will be translated, won't it?

Jeff


From: Bill Zhu <bill zhu sun com>
To: Jeffrey Stedfast <fejj ximian com>
Subject: Re: [evolution-patches] #55299: Can't change several attachment property in Mail
Date: Tue, 16 Mar 2004 19:21:27 +0800

Hi, Jeff
this is my new patch. please review it.

btw:
I finally find that the bug of gnome_icon_list_get_selection is result from gnome-2.2.

Regards

Bill

在2004年03月12日的03:27,Jeffrey Stedfast写道:
Next time, please set the attachment to Disposition: inline so replying auto-quotes the patch text...

that said:

- please following the coding style

if (foo)
   bar;
else
   baz;

not:

if (foo)
{
   bar;
}
else {
   baz;
}

- if (g_list_length(p) >= 2)  should be: if (g_list_length (p) > 1)

"> 1" is clearer (also note the space before the '(')

- don't put gratuitous spacing in the variable declarations:

+       GList     *p, *menu_item;

GList *p, *menu_item;

also, in this case 'p' isn't very informative. A better variable name here would be 'selection'

- (GtkWidget *)(menu_item->data)

to be more consistant with the rest of the mailer code, just use: (GtkWidget *) menu_item->data

- doing menu_item->data is just gross and is very likely to break if we ever decide to add a new menu item or change the order of the menu items later (which is possible). A better solution would involve either naming the menu items or having a table somewhere that defined the order of the menu items and using that table to get the proper one.

Jeff

On Thu, 2004-03-11 at 14:46 +0800, Bill Zhu wrote:

Hi, please see this bug:
   
http://bugzilla.ximian.com/show_bug.cgi?id=55299
I think it is not necessary to popup many dialogs for each attachments.
so I disabled the "properities" menu item when selecting multi attachments.

Bill
Index: e-msg-composer-attachment-bar.c
===================================================================
RCS file: /cvs/gnome/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.80
diff -u -r1.80 e-msg-composer-attachment-bar.c
--- e-msg-composer-attachment-bar.c	24 Sep 2003 20:12:02 -0000	1.80
+++ e-msg-composer-attachment-bar.c	17 Mar 2004 06:14:25 -0000
@@ -465,9 +465,29 @@
 			 gint num,
 			 GdkEventButton *event)
 {
-	GtkWidget *menu;
-	
+	GtkWidget *menu, *menu_item;
+	GnomeIconList *icon_list;
+	GList *selection;
+	int i;
+
 	menu = get_icon_context_menu (bar);
+	icon_list = GNOME_ICON_LIST (bar);
+	selection = gnome_icon_list_get_selection (icon_list);
+	
+	for (i = 0; i < sizeof (icon_context_menu_info)/sizeof (icon_context_menu_info[0]); i++) {
+		if (strcmp (icon_context_menu_info[i].label, "_Properties") == 0) {
+			menu_item = icon_context_menu_info[i].widget;
+			break;
+		}
+	}
+
+	if (menu_item) {
+		if (g_list_length (selection) > 1)
+			gtk_widget_set_sensitive (menu_item, FALSE);
+		else 
+			gtk_widget_set_sensitive (menu_item, TRUE);
+	}
+
 	gnome_popup_menu_do_popup (menu, NULL, NULL, event, bar, NULL);
 }
 


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