diff options
author | Milan Crha <mcrha@redhat.com> | 2011-08-19 23:57:47 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2011-08-19 23:58:54 +0800 |
commit | dab7c5cd2cbb0dd2d05fae6d2a519955e87f0a27 (patch) | |
tree | 85c1a49c22f879e1154e763ff428e6b22ed7d61c | |
parent | 4b461ef363b736d361054f3e50d44d1b241dd320 (diff) | |
download | gsoc2013-evolution-dab7c5cd2cbb0dd2d05fae6d2a519955e87f0a27.tar.gz gsoc2013-evolution-dab7c5cd2cbb0dd2d05fae6d2a519955e87f0a27.tar.zst gsoc2013-evolution-dab7c5cd2cbb0dd2d05fae6d2a519955e87f0a27.zip |
Cannot add folder to previously saved Search folder
-rw-r--r-- | mail/mail-vfolder.c | 36 |
1 files changed, 23 insertions, 13 deletions
diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index a24d9dcb45..2a7ed99893 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -1248,6 +1248,25 @@ vfolder_edit (EShellView *shell_view) gtk_widget_destroy (dialog); } +static void +vfolder_edit_response_cb (GtkWidget *dialog, gint response_id, gpointer user_data) +{ + if (response_id == GTK_RESPONSE_OK) { + EFilterRule *rule = g_object_get_data (G_OBJECT (dialog), "vfolder-rule"); + EFilterRule *newrule = g_object_get_data (G_OBJECT (dialog), "vfolder-newrule"); + const gchar *config_dir; + gchar *user; + + e_filter_rule_copy (rule, newrule); + config_dir = mail_session_get_config_dir (); + user = g_build_filename (config_dir, "vfolders.xml", NULL); + e_rule_context_save ((ERuleContext *) context, user); + g_free (user); + } + + gtk_widget_destroy (dialog); +} + void vfolder_edit_rule (EMailBackend *backend, const gchar *folder_uri) @@ -1305,21 +1324,12 @@ vfolder_edit_rule (EMailBackend *backend, gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); gtk_widget_show (widget); - if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { - const gchar *config_dir; - gchar *user; - - e_filter_rule_copy (rule, newrule); - config_dir = mail_session_get_config_dir (); - user = g_build_filename (config_dir, "vfolders.xml", NULL); - e_rule_context_save ((ERuleContext *) context, user); - g_free (user); - } + g_object_set_data_full (G_OBJECT (dialog), "vfolder-rule", rule, g_object_unref); + g_object_set_data_full (G_OBJECT (dialog), "vfolder-newrule", newrule, g_object_unref); - gtk_widget_destroy (dialog); + g_signal_connect (dialog, "response", G_CALLBACK (vfolder_edit_response_cb), NULL); - g_object_unref (rule); - g_object_unref (newrule); + gtk_widget_show (dialog); } static void |