Re: [evolution-patches] patch for 50646



please mention what component the patch is for in the Subject field of
your messages. it makes it easier for us to decide who needs to look
over the patch.

Jeff


On Mon, 2004-01-05 at 09:10, Charles Zhang wrote:
> Hello all,
> this is a patch for bug 50646.
> It fixes the bug  of multi dialog appearing while do replacing.
> In it, I add a member to record replace-ask-dialog, and use exist 
> replace-ask-dialog next time.
> Please seek it.
> 
> Charles
> 
> Charles Zhang wrote:
> 
> > Hello all
> >
> > Some file has been modified, so I attach a new patch this time.
> > Please seek it.
> >
> > Best Regards
> > Charles Zhang
> >
> > Charles Zhang wrote:
> >
> >> Hello all.
> >>
> >> This is a patch for bug 50646.
> >> It fixes the bug of multi dialog appearing while do replace action.
> >> In it, I add a member to record replace-ask-dialog, and use exist 
> >> replace-ask-dialog next time.
> >> Please seek it.
> >>
> >> Best Regards
> >> Charles Zhang
> >>
> >> ------------------------------------------------------------------------
> >>
> >> Index: components/html-editor/ChangeLog
> >> ===================================================================
> >> RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
> >> retrieving revision 1.410.2.11
> >> diff -u -p -r1.410.2.11 ChangeLog
> >> --- components/html-editor/ChangeLog    8 Dec 2003 19:09:38 -0000    
> >> 1.410.2.11
> >> +++ components/html-editor/ChangeLog    9 Dec 2003 16:31:51 -0000
> >> @@ -0,0 +0,6 @@
> >> +2003-12-09  Charles Zhang  <charles zhang sun com>
> >> +
> >> +    * replace.c (ask):  use exist dialog, don't new dialog blindly.
> >> +    (ask_dialog_new): record existing dialog.
> >> +    Fixes bug #50646
> >> +
> >> Index: components/html-editor/replace.c
> >> ===================================================================
> >> RCS file: /cvs/gnome/gtkhtml/components/html-editor/replace.c,v
> >> retrieving revision 1.18
> >> diff -u -p -r1.18 replace.c
> >> --- components/html-editor/replace.c    12 May 2003 20:46:48 -0000    
> >> 1.18
> >> +++ components/html-editor/replace.c    9 Dec 2003 16:31:52 -0000
> >> @@ -27,6 +27,7 @@
> >> #include "replace.h"
> >> #include "dialog.h"
> >> #include "htmlengine.h"
> >> +#include "htmlreplace.h"
> >>
> >> struct _GtkHTMLReplaceAskDialog {
> >>     GtkDialog  *dialog;
> >> @@ -79,6 +80,7 @@ ask_dialog_new (HTMLEngine *e)
> >>                                  _("Replace"), 0,
> >>                                  NULL));
> >>     d->engine = e;
> >> +    e->replace_info->ask_dialog = d;
> >>
> >>     gnome_window_icon_set_from_file (GTK_WINDOW (d->dialog), ICONDIR 
> >> "/search-and-replace-24.png");
> >>     g_signal_connect (d->dialog, "response", G_CALLBACK 
> >> (ask_dialog_response), d);
> >> @@ -90,6 +92,14 @@ static void
> >> ask (HTMLEngine *e, gpointer data)
> >> {
> >>     GtkHTMLReplaceAskDialog *ask_dialog;
> >> +
> >> +    g_assert (e && e->replace_info);
> >> +
> >> +    ask_dialog = (GtkHTMLReplaceAskDialog *) 
> >> e->replace_info->ask_dialog;
> >> +    if (ask_dialog) {
> >> +        gtk_dialog_run (ask_dialog->dialog);
> >> +        return;
> >> +    }
> >>
> >>     ask_dialog = ask_dialog_new (e);
> >>     gtk_dialog_run (ask_dialog->dialog);
> >> Index: src/ChangeLog
> >> ===================================================================
> >> RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
> >> retrieving revision 1.1814.2.18
> >> diff -u -p -r1.1814.2.18 ChangeLog
> >> --- src/ChangeLog    28 Nov 2003 11:02:25 -0000    1.1814.2.18
> >> +++ src/ChangeLog    9 Dec 2003 16:32:56 -0000
> >> @@ -0,0 +0,6 @@
> >> +2003-12-07  Charles Zhang  <charles zhang sun com>
> >> +
> >> +    * htmlreplace.h: add member ask_dialog.
> >> +    * htmlreplace.c(html_replace_new): init member ask_dialog.
> >> +    Fixes bug #50646
> >> +
> >> Index: src/htmlreplace.c
> >> ===================================================================
> >> RCS file: /cvs/gnome/gtkhtml/src/htmlreplace.c,v
> >> retrieving revision 1.4
> >> diff -u -p -r1.4 htmlreplace.c
> >> --- src/htmlreplace.c    13 Dec 2000 23:10:51 -0000    1.4
> >> +++ src/htmlreplace.c    9 Dec 2003 16:33:11 -0000
> >> @@ -33,6 +33,7 @@ html_replace_new (const gchar *text, voi
> >>     nr->replaced = 0;
> >>     nr->ask      = ask;
> >>     nr->ask_data = ask_data;
> >> +    nr->ask_dialog = NULL;
> >>
> >>     return nr;
> >> }
> >> Index: src/htmlreplace.h
> >> ===================================================================
> >> RCS file: /cvs/gnome/gtkhtml/src/htmlreplace.h,v
> >> retrieving revision 1.4
> >> diff -u -p -r1.4 htmlreplace.h
> >> --- src/htmlreplace.h    21 Nov 2000 10:42:26 -0000    1.4
> >> +++ src/htmlreplace.h    9 Dec 2003 16:33:11 -0000
> >> @@ -30,6 +30,7 @@ struct _HTMLReplace {
> >>     gint   replaced;
> >>     void (*ask) (HTMLEngine *, gpointer);
> >>     gpointer ask_data;
> >> +    gpointer ask_dialog;
> >> };
> >>
> >> HTMLReplace     *html_replace_new            (const gchar *text, void 
> >> (*ask) (HTMLEngine *, gpointer), gpointer ask_data);
> >>  
> >>
> >------------------------------------------------------------------------
> >
> >Index: components/html-editor/ChangeLog
> >===================================================================
> >RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
> >retrieving revision 1.410.2.12
> >diff -u -p -r1.410.2.12 ChangeLog
> >--- components/html-editor/ChangeLog	10 Dec 2003 03:35:55 -0000	1.410.2.12
> >+++ components/html-editor/ChangeLog	10 Dec 2003 11:17:17 -0000
> >@@ -0,0 +0,5 @@
> >+2003-12-09  Charles Zhang  <charles zhang sun com>
> >+
> >+	* replace.c (ask):  use exist dialog, don't new dialog blindly.
> >+	Fixes bug #50646
> >+
> >Index: components/html-editor/replace.c
> >===================================================================
> >RCS file: /cvs/gnome/gtkhtml/components/html-editor/replace.c,v
> >retrieving revision 1.18.6.1
> >diff -u -p -r1.18.6.1 replace.c
> >--- components/html-editor/replace.c	10 Dec 2003 03:35:56 -0000	1.18.6.1
> >+++ components/html-editor/replace.c	10 Dec 2003 11:17:21 -0000
> >@@ -27,6 +27,7 @@
> > #include "replace.h"
> > #include "dialog.h"
> > #include "htmlengine.h"
> >+#include "htmlreplace.h"
> > 
> > struct _GtkHTMLReplaceAskDialog {
> > 	GtkDialog  *dialog;
> >@@ -79,6 +80,7 @@ ask_dialog_new (HTMLEngine *e)
> > 							     _("_Replace"), 0,
> > 							     NULL));
> > 	d->engine = e;
> >+	e->replace_info->ask_dialog = d;
> > 
> > 	gnome_window_icon_set_from_file (GTK_WINDOW (d->dialog), ICONDIR "/search-and-replace-24.png");
> > 	g_signal_connect (d->dialog, "response", G_CALLBACK (ask_dialog_response), d);
> >@@ -91,6 +93,14 @@ ask (HTMLEngine *e, gpointer data)
> > {
> > 	GtkHTMLReplaceAskDialog *ask_dialog;
> > 
> >+	g_assert (e && e->replace_info);
> >+
> >+	ask_dialog = (GtkHTMLReplaceAskDialog *) e->replace_info->ask_dialog;
> >+	if (ask_dialog) {
> >+		gtk_dialog_run (ask_dialog->dialog);
> >+		return;
> >+	}
> >+
> > 	ask_dialog = ask_dialog_new (e);
> > 	gtk_dialog_run (ask_dialog->dialog);
> > 	gtk_widget_destroy (GTK_WIDGET (ask_dialog->dialog));
> >Index: src/ChangeLog
> >===================================================================
> >RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
> >retrieving revision 1.1814.2.18
> >diff -u -p -r1.1814.2.18 ChangeLog
> >--- src/ChangeLog	28 Nov 2003 11:02:25 -0000	1.1814.2.18
> >+++ src/ChangeLog	10 Dec 2003 11:19:46 -0000
> >@@ -0,0 +0,6 @@
> >+2003-12-07  Charles Zhang  <charles zhang sun com>
> >+
> >+	* htmlreplace.h: add member ask_dialog.
> >+	* htmlreplace.c(html_replace_new): init member ask_dialog.
> >+	Fixes bug #50646
> >+
> >Index: src/htmlreplace.c
> >===================================================================
> >RCS file: /cvs/gnome/gtkhtml/src/htmlreplace.c,v
> >retrieving revision 1.4
> >diff -u -p -r1.4 htmlreplace.c
> >--- src/htmlreplace.c	13 Dec 2000 23:10:51 -0000	1.4
> >+++ src/htmlreplace.c	10 Dec 2003 11:19:49 -0000
> >@@ -33,6 +33,7 @@ html_replace_new (const gchar *text, voi
> > 	nr->replaced = 0;
> > 	nr->ask      = ask;
> > 	nr->ask_data = ask_data;
> >+	nr->ask_dialog = NULL;
> > 
> > 	return nr;
> > }
> >Index: src/htmlreplace.h
> >===================================================================
> >RCS file: /cvs/gnome/gtkhtml/src/htmlreplace.h,v
> >retrieving revision 1.4
> >diff -u -p -r1.4 htmlreplace.h
> >--- src/htmlreplace.h	21 Nov 2000 10:42:26 -0000	1.4
> >+++ src/htmlreplace.h	10 Dec 2003 11:19:49 -0000
> >@@ -30,6 +30,7 @@ struct _HTMLReplace {
> > 	gint   replaced;
> > 	void (*ask) (HTMLEngine *, gpointer);
> > 	gpointer ask_data;
> >+	gpointer ask_dialog;
> > };
> > 
> > HTMLReplace     *html_replace_new            (const gchar *text, void (*ask) (HTMLEngine *, gpointer), gpointer ask_data);
> >  
> >
> 
> ______________________________________________________________________
> Index: components/html-editor/ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
> retrieving revision 1.410.2.12
> diff -u -p -r1.410.2.12 ChangeLog
> --- components/html-editor/ChangeLog	10 Dec 2003 03:35:55 -0000	1.410.2.12
> +++ components/html-editor/ChangeLog	10 Dec 2003 11:17:17 -0000
> @@ -0,0 +0,5 @@
> +2003-12-09  Charles Zhang  <charles zhang sun com>
> +
> +	* replace.c (ask):  use exist dialog, don't new dialog blindly.
> +	Fixes bug #50646
> +
> Index: components/html-editor/replace.c
> ===================================================================
> RCS file: /cvs/gnome/gtkhtml/components/html-editor/replace.c,v
> retrieving revision 1.18.6.1
> diff -u -p -r1.18.6.1 replace.c
> --- components/html-editor/replace.c	10 Dec 2003 03:35:56 -0000	1.18.6.1
> +++ components/html-editor/replace.c	10 Dec 2003 11:17:21 -0000
> @@ -27,6 +27,7 @@
>  #include "replace.h"
>  #include "dialog.h"
>  #include "htmlengine.h"
> +#include "htmlreplace.h"
>  
>  struct _GtkHTMLReplaceAskDialog {
>  	GtkDialog  *dialog;
> @@ -79,6 +80,7 @@ ask_dialog_new (HTMLEngine *e)
>  							     _("_Replace"), 0,
>  							     NULL));
>  	d->engine = e;
> +	e->replace_info->ask_dialog = d;
>  
>  	gnome_window_icon_set_from_file (GTK_WINDOW (d->dialog), ICONDIR "/search-and-replace-24.png");
>  	g_signal_connect (d->dialog, "response", G_CALLBACK (ask_dialog_response), d);
> @@ -91,6 +93,14 @@ ask (HTMLEngine *e, gpointer data)
>  {
>  	GtkHTMLReplaceAskDialog *ask_dialog;
>  
> +	g_assert (e && e->replace_info);
> +
> +	ask_dialog = (GtkHTMLReplaceAskDialog *) e->replace_info->ask_dialog;
> +	if (ask_dialog) {
> +		gtk_dialog_run (ask_dialog->dialog);
> +		return;
> +	}
> +
>  	ask_dialog = ask_dialog_new (e);
>  	gtk_dialog_run (ask_dialog->dialog);
>  	gtk_widget_destroy (GTK_WIDGET (ask_dialog->dialog));
> Index: src/ChangeLog
> ===================================================================
> RCS file: /cvs/gnome/gtkhtml/src/ChangeLog,v
> retrieving revision 1.1814.2.18
> diff -u -p -r1.1814.2.18 ChangeLog
> --- src/ChangeLog	28 Nov 2003 11:02:25 -0000	1.1814.2.18
> +++ src/ChangeLog	10 Dec 2003 11:19:46 -0000
> @@ -0,0 +0,6 @@
> +2003-12-07  Charles Zhang  <charles zhang sun com>
> +
> +	* htmlreplace.h: add member ask_dialog.
> +	* htmlreplace.c(html_replace_new): init member ask_dialog.
> +	Fixes bug #50646
> +
> Index: src/htmlreplace.c
> ===================================================================
> RCS file: /cvs/gnome/gtkhtml/src/htmlreplace.c,v
> retrieving revision 1.4
> diff -u -p -r1.4 htmlreplace.c
> --- src/htmlreplace.c	13 Dec 2000 23:10:51 -0000	1.4
> +++ src/htmlreplace.c	10 Dec 2003 11:19:49 -0000
> @@ -33,6 +33,7 @@ html_replace_new (const gchar *text, voi
>  	nr->replaced = 0;
>  	nr->ask      = ask;
>  	nr->ask_data = ask_data;
> +	nr->ask_dialog = NULL;
>  
>  	return nr;
>  }
> Index: src/htmlreplace.h
> ===================================================================
> RCS file: /cvs/gnome/gtkhtml/src/htmlreplace.h,v
> retrieving revision 1.4
> diff -u -p -r1.4 htmlreplace.h
> --- src/htmlreplace.h	21 Nov 2000 10:42:26 -0000	1.4
> +++ src/htmlreplace.h	10 Dec 2003 11:19:49 -0000
> @@ -30,6 +30,7 @@ struct _HTMLReplace {
>  	gint   replaced;
>  	void (*ask) (HTMLEngine *, gpointer);
>  	gpointer ask_data;
> +	gpointer ask_dialog;
>  };
>  
>  HTMLReplace     *html_replace_new            (const gchar *text, void (*ask) (HTMLEngine *, gpointer), gpointer ask_data);




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