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



This is the patch with Changelog.
If it is ok, please commit to trunk.

Bill

在2004年03月17日的14:53,Not Zed写道:
Hi,

I suspect the label is only translated in the created object.

However, this is totally pointless, you know which item it is, its the
second in the list, just setup a #define with the item index (1) just
below the icon_context_menu_info definition.

Then use that index ..

e.g.

#define ICON_CONTEXT_MENU_PROPERTIES (1)

and:

gtk_widget_set_sensitive(icon_context_menu_info[ICON_CONTEXT_MENU_PROPERTIES].widget,
	g_list_length(selection) == 1);

all in 1 line.

 Michael


On Wed, 2004-03-17 at 14:25 +0800, Bill Zhu wrote:


> 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: /export/src/cvs/evolution/composer/e-msg-composer-attachment-bar.c,v
retrieving revision 1.1.1.1.2.3.2.1
diff -u -r1.1.1.1.2.3.2.1 e-msg-composer-attachment-bar.c
--- e-msg-composer-attachment-bar.c	2004/01/19 02:02:35	1.1.1.1.2.3.2.1
+++ e-msg-composer-attachment-bar.c	2004/03/17 12:29:34
@@ -468,6 +468,8 @@
 	GNOMEUIINFO_END
 };
 
+#define ICON_CONTEXT_MENU_PROPERTIES (1)
+
 static GtkWidget *
 get_icon_context_menu (EMsgComposerAttachmentBar *bar)
 {
@@ -486,8 +488,15 @@
 			 GdkEventButton *event)
 {
 	GtkWidget *menu;
-	
+	GnomeIconList *icon_list;
+	GList *selection;
+
 	menu = get_icon_context_menu (bar);
+	icon_list = GNOME_ICON_LIST (bar);
+	selection = gnome_icon_list_get_selection (icon_list);
+
+	gtk_widget_set_sensitive (icon_context_menu_info[ICON_CONTEXT_MENU_PROPERTIES].widget, g_list_length (selection) == 1);
+
 	gnome_popup_menu_do_popup (menu, NULL, NULL, event, bar, NULL);
 }
 
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/composer/ChangeLog,v
retrieving revision 1.610
diff -u -r1.610 ChangeLog
--- ChangeLog	7 Mar 2004 15:00:51 -0000	1.610
+++ ChangeLog	17 Mar 2004 12:40:32 -0000
@@ -1,3 +1,10 @@
+2004-03-17  Bill Zhu  <bill zhu sun com>
+
+	* e-msg_composer-attachment-bar.c: If we select multi-attachments, the
+	"properities" menu item in popup icon context menu will be disabled.
+
+	Fixes bug #55299
+	
 2004-03-07  Jeffrey Stedfast  <fejj ximian com>
 
 	* e-msg-composer.c (do_exit): If the subject is empty, use


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