Re: [evolution-patches] 41043, accelerators in send/receive dialogue



Presuming this is okay with Anna, looks good.

Jeff

On Mon, 2003-04-14 at 02:54, Not Zed wrote:
> Not really a great fix, it just turns the accelerators off on the
> individual sources (then again, its not a great loss of functionality?).
> 
> I put in a helper so that we can change the labels of stock widgets
> properly elsewhere (i thought the code in the old cancel all case did
> that, but it doesn't).
> 
>  Z
> 
> 
> ______________________________________________________________________
> ? e-util/a.out
> ? e-util/bag.c
> ? e-util/bag.ps
> ? e-util/e-msgport.c.new
> ? e-util/e-trie.c.fixed
> ? e-util/mutex.c
> ? e-util/mutex.ps
> ? e-util/test.c
> Index: mail/ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/ChangeLog,v
> retrieving revision 1.2690
> diff -u -3 -r1.2690 ChangeLog
> --- mail/ChangeLog	11 Apr 2003 21:18:07 -0000	1.2690
> +++ mail/ChangeLog	14 Apr 2003 06:42:55 -0000
> @@ -1,3 +1,14 @@
> +2003-04-14  Not Zed  <NotZed Ximian com>
> +
> +	* mail-send-recv.c (build_dialogue): create a stock cancel button
> +	with a cancel all text.
> +	(build_dialogue): Create stock-like cancel buttons with no
> +	accelerators.  A workaround for #41043.
> +
> +	* message-list.c (ml_tree_value_at): if the node is the root node,
> +	do nothing.  etable shouldn' really be searching the root node if
> +	it isn't visible ...?  For #41190.
> +
>  2003-04-11  Jeffrey Stedfast  <fejj ximian com>
>  
>  	Fixes bug #41243.
> Index: mail/mail-send-recv.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/mail/mail-send-recv.c,v
> retrieving revision 1.69
> diff -u -3 -r1.69 mail-send-recv.c
> --- mail/mail-send-recv.c	10 Apr 2003 19:19:29 -0000	1.69
> +++ mail/mail-send-recv.c	14 Apr 2003 06:42:55 -0000
> @@ -34,6 +34,8 @@
>  #include <gtk/gtkstock.h>
>  #include <libgnomeui/gnome-window-icon.h>
>  
> +#include "e-util/e-gtk-utils.h"
> +
>  #include "filter/filter-filter.h"
>  #include "camel/camel-filter-driver.h"
>  #include "camel/camel-folder.h"
> @@ -295,8 +297,7 @@
>  	EIterator *iter;
>  	
>  	gd = (GtkDialog *)send_recv_dialogue = gtk_dialog_new_with_buttons(_("Send & Receive Mail"), NULL, 0, NULL);
> -	stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
> -	gtk_button_set_label(stop, _("Cancel All"));
> +	stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel _All"), GTK_STOCK_CANCEL);
>  	gtk_widget_show((GtkWidget *)stop);
>  	gtk_dialog_add_action_widget(gd, (GtkWidget *)stop, GTK_RESPONSE_CANCEL);
>  	g_object_set(gd, "resizable", FALSE, NULL);
> @@ -376,7 +377,8 @@
>  		
>  		bar = (GtkProgressBar *)gtk_progress_bar_new ();
>  		
> -		stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
> +		stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel"), GTK_STOCK_CANCEL);
> +
>  		status_label = (GtkLabel *)gtk_label_new ((info->type == SEND_UPDATE) ? _("Updating...") :
>  							  _("Waiting..."));
>  		
> @@ -432,7 +434,8 @@
>  		g_free (pretty_url);
>  		
>  		bar = (GtkProgressBar *)gtk_progress_bar_new ();
> -		stop = (GtkButton *)gtk_button_new_from_stock(GTK_STOCK_CANCEL);
> +		stop = (GtkButton *)e_gtk_button_new_with_icon(_("Cancel"), GTK_STOCK_CANCEL);
> +
>  		status_label = (GtkLabel *)gtk_label_new (_("Waiting..."));
>  		
>  		gtk_misc_set_alignment (GTK_MISC (label), 0, .5);
> Index: e-util/ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/evolution/e-util/ChangeLog,v
> retrieving revision 1.377
> diff -u -3 -r1.377 ChangeLog
> --- e-util/ChangeLog	9 Apr 2003 18:41:17 -0000	1.377
> +++ e-util/ChangeLog	14 Apr 2003 06:42:57 -0000
> @@ -1,3 +1,8 @@
> +2003-04-14  Not Zed  <NotZed Ximian com>
> +
> +	* e-gtk-utils.c (e_gtk_button_new_with_icon): Utility function to
> +	create a button with a stock icon.
> +
>  2003-04-09  Jeffrey Stedfast  <fejj ximian com>
>  
>  	* e-host-utils.c (e_gethostbyaddr_r): Change the 'len' argument to
> Index: e-util/e-gtk-utils.c
> ===================================================================
> RCS file: /cvs/gnome/evolution/e-util/e-gtk-utils.c,v
> retrieving revision 1.11
> diff -u -3 -r1.11 e-gtk-utils.c
> --- e-util/e-gtk-utils.c	2 Jan 2003 21:32:14 -0000	1.11
> +++ e-util/e-gtk-utils.c	14 Apr 2003 06:42:57 -0000
> @@ -28,6 +28,12 @@
>  #include <gtk/gtklayout.h>
>  #include <gtk/gtksignal.h>
>  #include <gtk/gtkwidget.h>
> +#include <gtk/gtkbutton.h>
> +#include <gtk/gtkstock.h>
> +#include <gtk/gtklabel.h>
> +#include <gtk/gtkimage.h>
> +#include <gtk/gtkhbox.h>
> +#include <gtk/gtkalignment.h>
>  
>  #include <gdk/gdkx.h>
>  
> @@ -166,4 +172,47 @@
>  e_make_widget_backing_stored  (GtkWidget *widget)
>  {
>  	g_signal_connect (widget, "realize", G_CALLBACK (widget_realize_callback_for_backing_store), NULL);
> +}
> +
> +
> +/**
> + * e_gtk_button_new_with_icon:
> + * @text: The mnemonic text for the label.
> + * @stock: The name of the stock item to get the icon from.
> + * 
> + * Create a gtk button with a custom label and a stock icon.
> + *
> + * 
> + * Return value: The widget.
> + **/
> +GtkWidget *
> +e_gtk_button_new_with_icon(const char *text, const char *stock)
> +{
> +	GtkWidget *button, *label;
> +	GtkStockItem item;
> +
> +	button = gtk_button_new();
> +	label = gtk_label_new_with_mnemonic(text);
> +	gtk_label_set_mnemonic_widget((GtkLabel *)label, button);
> +
> +	if (gtk_stock_lookup(stock, &item)) {
> +		GtkWidget *image, *hbox, *align;
> +
> +		printf("new stock button '%s' label '%s'\n", stock, text);
> +
> +		image = gtk_image_new_from_stock(stock, GTK_ICON_SIZE_BUTTON);
> +		hbox = gtk_hbox_new(FALSE, 2);
> +		align = gtk_alignment_new(0.5, 0.5, 0.0, 0.0);
> +		gtk_box_pack_start((GtkBox *)hbox, image, FALSE, FALSE, 0);
> +		gtk_box_pack_end((GtkBox *)hbox, label, FALSE, FALSE, 0);
> +		gtk_container_add((GtkContainer *)align, hbox);
> +		gtk_container_add((GtkContainer *)button, align);
> +		gtk_widget_show_all(align);
> +	} else {
> +		gtk_misc_set_alignment((GtkMisc *)label, 0.5, 0.5);
> +		gtk_container_add((GtkContainer *)button, label);
> +		gtk_widget_show(label);
> +	}
> +
> +	return button;
>  }
> Index: e-util/e-gtk-utils.h
> ===================================================================
> RCS file: /cvs/gnome/evolution/e-util/e-gtk-utils.h,v
> retrieving revision 1.8
> diff -u -3 -r1.8 e-gtk-utils.h
> --- e-util/e-gtk-utils.h	19 Dec 2002 22:11:01 -0000	1.8
> +++ e-util/e-gtk-utils.h	14 Apr 2003 06:42:57 -0000
> @@ -44,4 +44,6 @@
>  
>  void  e_make_widget_backing_stored  (GtkWidget *widget);
>  
> +GtkWidget *e_gtk_button_new_with_icon(const char *text, const char *stock);
> +
>  #endif
-- 
Jeffrey Stedfast
Evolution Hacker - Ximian, Inc.
fejj ximian com  - www.ximian.com




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