diff options
author | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-06-18 12:54:07 +0800 |
---|---|---|
committer | Srinivasa Ragavan <sragavan@src.gnome.org> | 2007-06-18 12:54:07 +0800 |
commit | 494cc008639cfbaef55113d98da76c791770a987 (patch) | |
tree | e5470f3b3e1c102dd0608437d3ec68a4a84e8486 /widgets | |
parent | 20f692fb88bfcad5557c2732c41e5b7977ffce21 (diff) | |
download | gsoc2013-evolution-494cc008639cfbaef55113d98da76c791770a987.tar.gz gsoc2013-evolution-494cc008639cfbaef55113d98da76c791770a987.tar.zst gsoc2013-evolution-494cc008639cfbaef55113d98da76c791770a987.zip |
** Fix for bug #263207
svn path=/trunk/; revision=33689
Diffstat (limited to 'widgets')
-rw-r--r-- | widgets/misc/ChangeLog | 10 | ||||
-rw-r--r-- | widgets/misc/e-filter-bar.c | 30 |
2 files changed, 34 insertions, 6 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog index 706a3abad2..a3335297e3 100644 --- a/widgets/misc/ChangeLog +++ b/widgets/misc/ChangeLog @@ -1,3 +1,13 @@ +2007-06-15 Milan Crha <mcrha@redhat.com> + + ** Fix for bug #263207 + + * e-filter-bar.c: (dialog_rule_changed): New callback + for disabling OK button in dialog when rule isn't valid. + * e-filter-bar.c: (do_advanced), (save_search_dialog): + Connecting dialog_rule_changed on "changed" signal of + actual rule. + 2007-06-15 Matthew Barnes <mbarnes@redhat.com> ** Fixes part of bug #447727 diff --git a/widgets/misc/e-filter-bar.c b/widgets/misc/e-filter-bar.c index e8e0a1d6e3..4e94c27c14 100644 --- a/widgets/misc/e-filter-bar.c +++ b/widgets/misc/e-filter-bar.c @@ -145,6 +145,18 @@ rule_advanced_response (GtkWidget *dialog, int response, void *data) } static void +dialog_rule_changed (FilterRule *fr, GtkWidget *dialog) +{ + gboolean sensitive; + + g_return_if_fail (dialog != NULL); + + sensitive = fr && fr->parts; + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_OK, sensitive); + gtk_dialog_set_response_sensitive (GTK_DIALOG (dialog), GTK_RESPONSE_APPLY, sensitive); +} + +static void do_advanced (ESearchBar *esb) { EFilterBar *efb = (EFilterBar *)esb; @@ -184,7 +196,10 @@ do_advanced (ESearchBar *esb) g_object_ref (rule); g_object_set_data_full ((GObject *) dialog, "rule", rule, (GDestroyNotify) g_object_unref); - + + g_signal_connect (rule, "changed", G_CALLBACK (dialog_rule_changed), dialog); + dialog_rule_changed (rule, dialog); + g_signal_connect (dialog, "response", G_CALLBACK (rule_advanced_response), efb); g_object_weak_ref ((GObject *) dialog, (GWeakNotify) rule_editor_destroyed, efb); @@ -222,18 +237,21 @@ save_search_dialog (ESearchBar *esb) gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->vbox), 0); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 12); - + gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 300); - + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), w, TRUE, TRUE, 0); - + g_object_ref (rule); g_object_set_data_full ((GObject *) dialog, "rule", rule, (GDestroyNotify) g_object_unref); g_signal_connect (dialog, "response", G_CALLBACK (rule_editor_response), efb); g_object_weak_ref ((GObject *) dialog, (GWeakNotify) rule_editor_destroyed, efb); - + + g_signal_connect (rule, "changed", G_CALLBACK (dialog_rule_changed), dialog); + dialog_rule_changed (rule, dialog); + e_search_bar_set_menu_sensitive (esb, E_FILTERBAR_SAVE_ID, FALSE); - + gtk_widget_show (dialog); } |