Re: [evolution-patches] patch for 49702
- From: Charles Zhang <Charles Zhang Sun Com>
- To: Charles Zhang <Charles Zhang Sun Com>
- Cc: Not Zed <notzed ximian com>, evolution-patches <evolution-patches lists ximian com>, Ettore Perazzoli <ettore ximian com>
- Subject: Re: [evolution-patches] patch for 49702
- Date: Mon, 03 Nov 2003 21:07:52 +0800
Hi Michael
Can you spare some time to this patch?
In it, I grayed out the find button when nothing found, and light it
when some search condition changed or searching text changed.
Charles Zhang wrote:
Thank you all.
Please check if this one is what we want.
This time, I grayed out the button while nothing found.
Not Zed wrote:
grey out, yeah, something like that.
*shrug*
On Fri, 2003-10-24 at 22:11, Charles Zhang wrote:
en. you mean that after pressing find button but find nothing matches,
I should gray out the find button and leave the dialog open?
Not Zed wrote:
see ettore's followup. I think greying out the 'find' button
should be
sufficient, if thats what other apps are doing.
On Thu, 2003-10-16 at 21:43, Charles Zhang wrote:
En, I cannot master the custom in evolution well.
What do you think of this?
If this bug is reasonable, what should we indicate the user and in
which way, what words?
Not Zed wrote:
ugh, do we really want to do this? another popup?
On Thu, 2003-10-16 at 03:45, Charles Zhang wrote:
Hello all
This is a patch for #49702.
This bug says that after searing in a composer, if nothing
found, there is no indicating but close the searching dialog.
So in this patch, I popup a message dialog to indicate the
user while found nothing after searching.
Please review.
Best Regards
Charles Zhang
______________________________________________________________________
? components/html-editor/GNOME_GtkHTML_Editor-emacs.xml
? components/html-editor/test_editor
Index: components/html-editor/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.410.2.9
diff -u -p -r1.410.2.9 ChangeLog
--- components/html-editor/ChangeLog 15 Sep 2003 16:19:12
-0000 1.410.2.9
+++ components/html-editor/ChangeLog 15 Oct 2003 18:06:05 -0000
@@ -0,0 +0,5 @@
+2003-10-14 Charles Zhang <charles zhang sun com>
+
+ * search.c (search_dialog_response): if found nothing,
indicate + the user. [49702]
+
Index: components/html-editor/search.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/search.c,v
retrieving revision 1.22
diff -u -p -r1.22 search.c
--- components/html-editor/search.c 12 May 2003 20:46:48
-0000 1.22
+++ components/html-editor/search.c 15 Oct 2003 18:06:06 -0000
@@ -55,12 +55,25 @@ entry_activate (GtkWidget *entry, GtkHTM
static void
search_dialog_response (GtkDialog *dialog, gint response_id,
GtkHTMLSearchDialog *d)
{
+ gboolean found;
+ GtkWidget *notfound;
+
switch (response_id) {
case 0: /* Search */
gtk_widget_hide (GTK_WIDGET (d->dialog));
- html_engine_search (d->html->engine, gtk_entry_get_text
(GTK_ENTRY (d->entry)),
- GTK_TOGGLE_BUTTON (d->case_sensitive)->active,
- GTK_TOGGLE_BUTTON (d->backward)->active ==
0, d->cd->regular);
+ found = html_engine_search (d->html->engine,
gtk_entry_get_text (GTK_ENTRY (d->entry)),
+ GTK_TOGGLE_BUTTON
(d->case_sensitive)->active,
+ GTK_TOGGLE_BUTTON (d->backward)->active
== 0, d->cd->regular);
+
+ if (!found) {
+ notfound = gtk_message_dialog_new (GTK_WINDOW
(dialog),
+ GTK_DIALOG_DESTROY_WITH_PARENT,
+ GTK_MESSAGE_INFO,
+ GTK_BUTTONS_CLOSE,
+ _("Searching text not found."));
+ gtk_dialog_run (GTK_DIALOG (notfound));
+ gtk_widget_destroy (notfound);
+ }
break;
}
}
------------------------------------------------------------------------
Index: components/html-editor/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.410.2.10
diff -u -p -r1.410.2.10 ChangeLog
--- components/html-editor/ChangeLog 14 Oct 2003 13:43:31 -0000 1.410.2.10
+++ components/html-editor/ChangeLog 28 Oct 2003 15:53:33 -0000
@@ -0,0 +0,12 @@
+2003-10-27 Charles Zhang <charles zhang sun com>
+
+ * search.c (search_dialog_response): if found nothing, disable
+ the find button, and leave the searchdialog visible, else destroy
+ the search dialog. Handle GTK_RESPONSE_CLOSE to make close button
+ looks fine.
+ (search): if the searchdialog isn't visible, then destroy it.
+ (condition_changed): enable the find button.
+ (entry_changed): when entry changed, enable the find button.
+ (gtk_html_search_dialog_new): connect toggled signal to checkbutton.
+ [49702]
+
2003-10-13 Frederic Crozat <fcrozat mandrakesoft com>
* popup.c: Add missing header include.
Index: components/html-editor/search.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/search.c,v
retrieving revision 1.22
diff -u -p -r1.22 search.c
--- components/html-editor/search.c 12 May 2003 20:46:48 -0000 1.22
+++ components/html-editor/search.c 28 Oct 2003 15:53:34 -0000
@@ -39,11 +39,18 @@ struct _GtkHTMLSearchDialog {
};
static void
+condition_changed (GtkWidget *widget, GtkHTMLSearchDialog *d)
+{
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (d->dialog), 0, TRUE);
+}
+
+static void
entry_changed (GtkWidget *entry, GtkHTMLSearchDialog *d)
{
if (d->cd->search_text)
g_free (d->cd->search_text);
d->cd->search_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (d->entry)));
+ condition_changed (entry, d);
}
static void
@@ -55,12 +62,21 @@ entry_activate (GtkWidget *entry, GtkHTM
static void
search_dialog_response (GtkDialog *dialog, gint response_id, GtkHTMLSearchDialog *d)
{
+ gboolean found = FALSE;
+
switch (response_id) {
case 0: /* Search */
+ found = html_engine_search (d->html->engine, gtk_entry_get_text (GTK_ENTRY (d->entry)),
+ GTK_TOGGLE_BUTTON (d->case_sensitive)->active,
+ GTK_TOGGLE_BUTTON (d->backward)->active == 0, d->cd->regular);
+ if (!found) {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (d->dialog), 0, FALSE);
+ break;
+ }
+
+ case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET (d->dialog));
- html_engine_search (d->html->engine, gtk_entry_get_text (GTK_ENTRY (d->entry)),
- GTK_TOGGLE_BUTTON (d->case_sensitive)->active,
- GTK_TOGGLE_BUTTON (d->backward)->active == 0, d->cd->regular);
+ gtk_html_search_dialog_destroy (d);
break;
}
}
@@ -108,6 +124,8 @@ gtk_html_search_dialog_new (GtkHTML *htm
g_signal_connect (dialog->dialog, "response", G_CALLBACK (search_dialog_response), dialog);
g_signal_connect (dialog->entry, "changed", G_CALLBACK (entry_changed), dialog);
g_signal_connect (dialog->entry, "activate", G_CALLBACK (entry_activate), dialog);
+ g_signal_connect (dialog->backward, "toggled", G_CALLBACK (condition_changed), dialog);
+ g_signal_connect (dialog->case_sensitive, "toggled", G_CALLBACK (condition_changed), dialog);
return dialog;
}
@@ -124,7 +142,6 @@ search (GtkHTMLControlData *cd, gboolean
{
cd->regular = regular;
RUN_DIALOG (search, regular ? _("Find Regular Expression") : _("Find"));
- gtk_html_search_dialog_destroy (cd->search_dialog);
cd->search_dialog = NULL;
}
Index: components/html-editor/ChangeLog
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/ChangeLog,v
retrieving revision 1.410.2.10
diff -u -p -r1.410.2.10 ChangeLog
--- components/html-editor/ChangeLog 14 Oct 2003 13:43:31 -0000 1.410.2.10
+++ components/html-editor/ChangeLog 28 Oct 2003 15:53:33 -0000
@@ -0,0 +0,12 @@
+2003-10-27 Charles Zhang <charles zhang sun com>
+
+ * search.c (search_dialog_response): if found nothing, disable
+ the find button, and leave the searchdialog visible, else destroy
+ the search dialog. Handle GTK_RESPONSE_CLOSE to make close button
+ looks fine.
+ (search): if the searchdialog isn't visible, then destroy it.
+ (condition_changed): enable the find button.
+ (entry_changed): when entry changed, enable the find button.
+ (gtk_html_search_dialog_new): connect toggled signal to checkbutton.
+ [49702]
+
2003-10-13 Frederic Crozat <fcrozat mandrakesoft com>
* popup.c: Add missing header include.
Index: components/html-editor/search.c
===================================================================
RCS file: /cvs/gnome/gtkhtml/components/html-editor/search.c,v
retrieving revision 1.22
diff -u -p -r1.22 search.c
--- components/html-editor/search.c 12 May 2003 20:46:48 -0000 1.22
+++ components/html-editor/search.c 28 Oct 2003 15:53:34 -0000
@@ -39,11 +39,18 @@ struct _GtkHTMLSearchDialog {
};
static void
+condition_changed (GtkWidget *widget, GtkHTMLSearchDialog *d)
+{
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (d->dialog), 0, TRUE);
+}
+
+static void
entry_changed (GtkWidget *entry, GtkHTMLSearchDialog *d)
{
if (d->cd->search_text)
g_free (d->cd->search_text);
d->cd->search_text = g_strdup (gtk_entry_get_text (GTK_ENTRY (d->entry)));
+ condition_changed (entry, d);
}
static void
@@ -55,12 +62,21 @@ entry_activate (GtkWidget *entry, GtkHTM
static void
search_dialog_response (GtkDialog *dialog, gint response_id, GtkHTMLSearchDialog *d)
{
+ gboolean found = FALSE;
+
switch (response_id) {
case 0: /* Search */
+ found = html_engine_search (d->html->engine, gtk_entry_get_text (GTK_ENTRY (d->entry)),
+ GTK_TOGGLE_BUTTON (d->case_sensitive)->active,
+ GTK_TOGGLE_BUTTON (d->backward)->active == 0, d->cd->regular);
+ if (!found) {
+ gtk_dialog_set_response_sensitive (GTK_DIALOG (d->dialog), 0, FALSE);
+ break;
+ }
+
+ case GTK_RESPONSE_CLOSE:
gtk_widget_hide (GTK_WIDGET (d->dialog));
- html_engine_search (d->html->engine, gtk_entry_get_text (GTK_ENTRY (d->entry)),
- GTK_TOGGLE_BUTTON (d->case_sensitive)->active,
- GTK_TOGGLE_BUTTON (d->backward)->active == 0, d->cd->regular);
+ gtk_html_search_dialog_destroy (d);
break;
}
}
@@ -108,6 +124,8 @@ gtk_html_search_dialog_new (GtkHTML *htm
g_signal_connect (dialog->dialog, "response", G_CALLBACK (search_dialog_response), dialog);
g_signal_connect (dialog->entry, "changed", G_CALLBACK (entry_changed), dialog);
g_signal_connect (dialog->entry, "activate", G_CALLBACK (entry_activate), dialog);
+ g_signal_connect (dialog->backward, "toggled", G_CALLBACK (condition_changed), dialog);
+ g_signal_connect (dialog->case_sensitive, "toggled", G_CALLBACK (condition_changed), dialog);
return dialog;
}
@@ -124,7 +142,6 @@ search (GtkHTMLControlData *cd, gboolean
{
cd->regular = regular;
RUN_DIALOG (search, regular ? _("Find Regular Expression") : _("Find"));
- gtk_html_search_dialog_destroy (cd->search_dialog);
cd->search_dialog = NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]