diff options
author | Milan Crha <mcrha@redhat.com> | 2012-07-10 23:01:12 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-07-10 23:02:20 +0800 |
commit | a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b (patch) | |
tree | 288c40f33a685c4fa838ed756e47d64deaa59b95 /mail | |
parent | 0163eacc4ac1826a53cfdd4adac9f7a5fa139890 (diff) | |
download | gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.gz gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.tar.zst gsoc2013-evolution-a3bd7ff42fe0e2be150cfad7640a5e8d62d8821b.zip |
Add "auto-update" option to Search Folder Editor
Diffstat (limited to 'mail')
-rw-r--r-- | mail/em-vfolder-editor-rule.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/mail/em-vfolder-editor-rule.c b/mail/em-vfolder-editor-rule.c index c5473a5a94..b1fdadd1ea 100644 --- a/mail/em-vfolder-editor-rule.c +++ b/mail/em-vfolder-editor-rule.c @@ -251,7 +251,14 @@ select_source_with_changed (GtkWidget *widget, gtk_widget_set_sensitive (data->source_selector, !with); - data->vr->with = with; + em_vfolder_rule_set_with (data->vr, with); +} + +static void +autoupdate_toggled_cb (GtkToggleButton *toggle, + struct _source_data *data) +{ + em_vfolder_rule_set_autoupdate (data->vr, gtk_toggle_button_get_active (toggle)); } static void @@ -302,7 +309,7 @@ vfr_folder_response (EMFolderSelector *selector, g_hash_table_insert (known_uris, g_strdup (uri), GINT_TO_POINTER (1)); - g_queue_push_tail (&data->vr->sources, g_strdup (uri)); + g_queue_push_tail (em_vfolder_rule_get_sources (data->vr), g_strdup (uri)); markup = e_mail_folder_uri_to_markup (session, uri, NULL); @@ -444,6 +451,7 @@ get_widget (EFilterRule *fr, EMVFolderRule *vr = (EMVFolderRule *) fr; EMailSession *session; GtkWidget *widget, *frame, *label, *combobox, *hgrid, *vgrid, *tree_view, *scrolled_window; + GtkWidget *autoupdate; GtkListStore *model; GtkCellRenderer *renderer; struct _source_data *data; @@ -495,6 +503,17 @@ get_widget (EFilterRule *fr, gtk_grid_set_column_spacing (GTK_GRID (hgrid), 6); gtk_container_add (GTK_CONTAINER (vgrid), hgrid); + autoupdate = gtk_check_button_new_with_mnemonic (_("Automatically update on any _source folder change")); + gtk_container_add (GTK_CONTAINER (hgrid), autoupdate); + + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (autoupdate), em_vfolder_rule_get_autoupdate (vr)); + g_signal_connect (autoupdate, "toggled", G_CALLBACK (autoupdate_toggled_cb), data); + + hgrid = gtk_grid_new (); + gtk_orientable_set_orientation (GTK_ORIENTABLE (hgrid), GTK_ORIENTATION_HORIZONTAL); + gtk_grid_set_column_spacing (GTK_GRID (hgrid), 6); + gtk_container_add (GTK_CONTAINER (vgrid), hgrid); + combobox = gtk_combo_box_text_new (); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combobox), NULL, _("All local folders")); gtk_combo_box_text_append (GTK_COMBO_BOX_TEXT (combobox), NULL, _("All active remote folders")); @@ -573,7 +592,7 @@ get_widget (EFilterRule *fr, data->source_selector = hgrid; - gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 3 - vr->with); + gtk_combo_box_set_active (GTK_COMBO_BOX (combobox), 3 - em_vfolder_rule_get_with (vr)); g_signal_connect ( combobox, "changed", G_CALLBACK (select_source_with_changed), data); |