diff options
author | Milan Crha <mcrha@redhat.com> | 2012-02-07 19:57:29 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2012-02-07 19:57:29 +0800 |
commit | 5483b65b5e2212383b4ecf9a8fe9ef958ef582ad (patch) | |
tree | bf9a1f91a6964e6258656f19cd518b30103402b0 /mail/em-account-editor.c | |
parent | 22281b32d33694e763ea6c793e2bb2007709fb63 (diff) | |
download | gsoc2013-evolution-5483b65b5e2212383b4ecf9a8fe9ef958ef582ad.tar.gz gsoc2013-evolution-5483b65b5e2212383b4ecf9a8fe9ef958ef582ad.tar.zst gsoc2013-evolution-5483b65b5e2212383b4ecf9a8fe9ef958ef582ad.zip |
Bug #309945 - Ability to filter folders other than INBOX too
Diffstat (limited to 'mail/em-account-editor.c')
-rw-r--r-- | mail/em-account-editor.c | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 6b54c2ae1b..b2759f3ad9 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -3136,6 +3136,26 @@ emae_receive_page (EConfig *ec, return w; } +static void +emae_set_option_dependency (EMAccountEditorService *service, + CamelProviderConfEntry *conf, + GtkWidget *widget) +{ + if (conf->depname != NULL) { + const gchar *depname = conf->depname; + + if (*depname == '!') + depname++; + + g_object_bind_property ( + service->settings, depname, + widget, "sensitive", + G_BINDING_SYNC_CREATE | + (depname == conf->depname ? 0 : G_BINDING_INVERT_BOOLEAN)); + gtk_widget_set_margin_left (widget, INDENT_MARGIN); + } +} + static GtkWidget * emae_option_toggle (EMAccountEditorService *service, CamelProviderConfEntry *conf) @@ -3150,13 +3170,7 @@ emae_option_toggle (EMAccountEditorService *service, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); - if (conf->depname != NULL) { - g_object_bind_property ( - service->settings, conf->depname, - widget, "sensitive", - G_BINDING_SYNC_CREATE); - gtk_widget_set_margin_left (widget, INDENT_MARGIN); - } + emae_set_option_dependency (service, conf, widget); return widget; } @@ -3177,14 +3191,7 @@ emae_option_entry (EMAccountEditorService *service, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); - if (conf->depname != NULL) { - g_object_bind_property ( - service->settings, conf->depname, - widget, "sensitive", - G_BINDING_SYNC_CREATE); - gtk_widget_set_margin_left ( - GTK_WIDGET (label_for_mnemonic), INDENT_MARGIN); - } + emae_set_option_dependency (service, conf, widget); g_object_bind_property ( widget, "sensitive", @@ -3353,13 +3360,7 @@ emae_option_checkspin (EMAccountEditorService *service, gtk_widget_show (label); } - if (conf->depname != NULL) { - g_object_bind_property ( - service->settings, conf->depname, - hbox, "sensitive", - G_BINDING_SYNC_CREATE); - gtk_widget_set_margin_left (hbox, INDENT_MARGIN); - } + emae_set_option_dependency (service, conf, hbox); return hbox; } |