[evolution-patches] Re: new patch for bug 49912(based on 1.4.5)



On Mon, 2003-10-27 at 04:22, leon.zhang wrote:
> hi, Chris
> 
> I give a new patch for bug 49912, it can:
> 1) set a flag in EText to trace status popup menu.
> 2) connect two signals to Etext, and sent by popup menu(when it activate and  deactivate).
> 3) skip FOCUS CHANGE event in e-minicard-label and e-minicard if there is an activiated popup menu.
> 
> pls, review it and give your suggestions
> 
> thx
> 
> leon
> 
> ______________________________________________________________________
> Index: evolution/addressbook/ChangeLog
> ===================================================================
> RCS file: /export/src/cvs/evolution/addressbook/ChangeLog,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 ChangeLog
> --- evolution/addressbook/ChangeLog	2003/09/26 06:34:28	1.1.1.1
> +++ evolution/addressbook/ChangeLog	2003/10/27 12:03:14
> @@ -1,3 +1,16 @@
> +2003-10-28 Leon Zhang <leon zhang sun com>
> +
> +	* gui/widgets/e-minicard.c:
> +	(e_minicard_event): skip focus change event if there is an 
> +	activated popup menu.
> +	(add_field): support signal "populate_popup".
> +	(popup_activated): callback of signal "populate_popup", set flag
> +	for popup menu.
> +
> +	* gui/widgets/e-minicard-label.c:
> +	(e_minicard_label_event): skip focus change event if there is an
> +	activated popup menu.
> +
>  2003-09-05  Dan Winship  <danw ximian com>
>  
>  	* gui/component/select-names/Makefile.am: Make libeselectnames.la
> Index: evolution/addressbook/gui/widgets/e-minicard.c
> ===================================================================
> RCS file: /export/src/cvs/evolution/addressbook/gui/widgets/e-minicard.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 e-minicard.c
> --- evolution/addressbook/gui/widgets/e-minicard.c	2003/09/26 06:34:28	1.1.1.1
> +++ evolution/addressbook/gui/widgets/e-minicard.c	2003/10/27 12:03:14
> @@ -552,6 +552,24 @@
>  	switch( event->type ) {
>  	case GDK_FOCUS_CHANGE:
>  		{
> +			/* if there is an activated popup menu, skip current event */
> +			GList *list;
> +			gboolean popup = FALSE;
> +                        for (list = e_minicard->fields; list; list = list->next) {
> +				EMinicardField *field = E_MINICARD_FIELD(list->data);
> +				EMinicardLabel *e_minicard_label = E_MINICARD_LABEL(GTK_OBJECT(field->label));
> +				if (e_minicard_label->has_focus){
> +					EText *t = E_TEXT(e_minicard_label->field);
> +					if (t->has_popup) {

I'd rather this be a read only property on the EText.  i.e. this code
should be:

{
  g_object_get (e_minicard_label->field, "has_popup", &popup);
  if (popup) break;
}
 
>  static void
> +popup_activated (EText *text, EMinicard *e_minicard)
> +{
> +        text->has_popup = TRUE;
> +}

that function should not be in the minicard code - it should be in the
e-text code.  The only thing that modifies EText's private members
should be EText.

> Index: evolution/addressbook/gui/widgets/e-minicard-label.c
> ===================================================================
> RCS file: /export/src/cvs/evolution/addressbook/gui/widgets/e-minicard-label.c,v
> retrieving revision 1.1.1.1
> diff -u -r1.1.1.1 e-minicard-label.c
> --- evolution/addressbook/gui/widgets/e-minicard-label.c	2003/09/26 06:34:28	1.1.1.1
> +++ evolution/addressbook/gui/widgets/e-minicard-label.c	2003/10/27 12:03:14
> @@ -364,6 +364,10 @@
>  		}
>  		break;
>  	case GDK_FOCUS_CHANGE: {
> +		EText *text = E_TEXT (e_minicard_label->field);
> +		if (text->has_popup)
> +			break;

again, use g_object_get.

Chris



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