aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2007-12-11 20:35:28 +0800
committerMilan Crha <mcrha@src.gnome.org>2007-12-11 20:35:28 +0800
commite3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf (patch)
tree2b3f94c9439917925ee28e7a287dd546fe738fd4
parent3f9be257867130c5c908cd0f13e488689a0ac9a7 (diff)
downloadgsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.tar
gsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.tar.gz
gsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.tar.bz2
gsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.tar.lz
gsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.tar.xz
gsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.tar.zst
gsoc2013-evolution-e3e9fc8d4a8c1ebd9cff9852c1f17be5d38d48cf.zip
** Fix for bug #502318
2007-12-11 Milan Crha <mcrha@redhat.com> ** Fix for bug #502318 * em-format-html-display.c: (struct _EMFormatHTMLDisplayPrivate), (efhd_search_destroy), (em_format_html_get_search_dialog), (em_format_html_display_search), (em_format_html_display_search_with), (em_format_html_display_search_close), (efhd_complete): Track search dialog activity rather based on flag than on widget existence, because the pointer to that widget it still there (non-NULL) even after destroy of that widget. svn path=/trunk/; revision=34689
-rw-r--r--mail/ChangeLog12
-rw-r--r--mail/em-format-html-display.c36
2 files changed, 34 insertions, 14 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 514285c279..c3ab44e4f8 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,17 @@
2007-12-11 Milan Crha <mcrha@redhat.com>
+ ** Fix for bug #502318
+
+ * em-format-html-display.c: (struct _EMFormatHTMLDisplayPrivate),
+ (efhd_search_destroy), (em_format_html_get_search_dialog),
+ (em_format_html_display_search), (em_format_html_display_search_with),
+ (em_format_html_display_search_close), (efhd_complete):
+ Track search dialog activity rather based on flag than on widget
+ existence, because the pointer to that widget it still
+ there (non-NULL) even after destroy of that widget.
+
+2007-12-11 Milan Crha <mcrha@redhat.com>
+
** Fix for bug #336074
* mail-send-recv.c: (get_folders):
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index 0c7c46def4..eb06d8a095 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -135,6 +135,7 @@ struct _EMFormatHTMLDisplayPrivate {
GtkWidget *search_case_check;
char *search_text;
int search_wrap; /* are we doing a wrap search */
+ gboolean search_active; /* if the search is active */
/* for Attachment bar */
GtkWidget *attachment_bar;
@@ -601,6 +602,7 @@ efhd_search_destroy(GtkWidget *w, EMFormatHTMLDisplay *efhd)
p->search_text = NULL;
gtk_widget_hide((GtkWidget *)p->search_dialog);
em_format_html_display_set_search(efhd, EM_FORMAT_HTML_DISPLAY_SEARCH_PRIMARY, NULL);
+ p->search_active = FALSE;
}
static void
@@ -705,6 +707,8 @@ em_format_html_get_search_dialog (EMFormatHTMLDisplay *efhd)
g_signal_connect (button2, "clicked", G_CALLBACK(efhd_search_response), efhd);
g_signal_connect (button3, "clicked", G_CALLBACK(efhd_search_response_back), efhd);
+ p->search_active = FALSE;
+
efhd_update_matches(efhd);
return (GtkWidget *)p->search_dialog;
@@ -737,14 +741,17 @@ em_format_html_display_search(EMFormatHTMLDisplay *efhd)
struct _EMFormatHTMLDisplayPrivate *p = efhd->priv;
if (p->search_dialog){
- GtkWidget *toplevel;
- gtk_widget_show ( (GtkWidget *)(p->search_dialog));
- gtk_widget_grab_focus ( (GtkWidget *)(p->search_entry));
- gtk_widget_show ( (GtkWidget *) p->search_entry_box);
+ GtkWidget *toplevel;
+
+ gtk_widget_show (GTK_WIDGET (p->search_dialog));
+ gtk_widget_grab_focus (p->search_entry);
+ gtk_widget_show (p->search_entry_box);
+
+ p->search_active = TRUE;
- toplevel = gtk_widget_get_toplevel ((GtkWidget *)(p->search_dialog));
+ toplevel = gtk_widget_get_toplevel (GTK_WIDGET (p->search_dialog));
- g_signal_connect (toplevel, "set-focus",
+ g_signal_connect (toplevel, "set-focus",
G_CALLBACK (set_focus_cb), efhd);
}
@@ -761,14 +768,15 @@ em_format_html_display_search_with (EMFormatHTMLDisplay *efhd, char *word)
struct _EMFormatHTMLDisplayPrivate *p = efhd->priv;
if (p->search_dialog){
- gtk_widget_show ( (GtkWidget *)(p->search_dialog));
+ gtk_widget_show (GTK_WIDGET (p->search_dialog));
+ p->search_active = TRUE;
- /* Set the query */
- gtk_entry_set_text (GTK_ENTRY (p->search_entry), word);
- gtk_widget_hide ( (GtkWidget *) p->search_entry_box);
+ /* Set the query */
+ gtk_entry_set_text (GTK_ENTRY (p->search_entry), word);
+ gtk_widget_hide (p->search_entry_box);
- /* Trigger the search */
- gtk_signal_emit_by_name (GTK_OBJECT (p->search_entry), "activate", efhd);
+ /* Trigger the search */
+ gtk_signal_emit_by_name (GTK_OBJECT (p->search_entry), "activate", efhd);
}
}
@@ -777,7 +785,7 @@ em_format_html_display_search_close (EMFormatHTMLDisplay *efhd)
{
struct _EMFormatHTMLDisplayPrivate *p = efhd->priv;
- if (p->search_dialog)
+ if (p->search_dialog && p->search_active)
efhd_search_destroy(GTK_WIDGET (p->search_dialog), efhd);
}
@@ -919,7 +927,7 @@ efhd_complete(EMFormat *emf)
{
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)emf;
- if (efhd->priv->search_dialog)
+ if (efhd->priv->search_dialog && efhd->priv->search_active)
efhd_update_matches(efhd);
if (efhd->priv->files) {