aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-05-24 17:01:55 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-05-24 17:01:55 +0800
commit321e9a1cf7473808eef43771c7052c84664fa81d (patch)
treeee0b1bdc41021a1e380a4e5aafe07a756f3cbceb /mail
parent12f71865cfdf20295f5cd98b145f6d83df8ee8df (diff)
downloadgsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.tar
gsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.tar.gz
gsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.tar.bz2
gsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.tar.lz
gsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.tar.xz
gsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.tar.zst
gsoc2013-evolution-321e9a1cf7473808eef43771c7052c84664fa81d.zip
don't enable the widget based on its writability if it is a dependent
2004-05-24 Not Zed <NotZed@Ximian.com> * mail-account-gui.c (mail_account_gui_build_extra_conf): don't enable the widget based on its writability if it is a dependent option which is now disable. (setup_toggle): return whether the widget is sensitive too. #57171. svn path=/trunk/; revision=26062
Diffstat (limited to 'mail')
-rw-r--r--mail/ChangeLog6
-rw-r--r--mail/mail-account-gui.c18
2 files changed, 17 insertions, 7 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index f65ee96cf3..3b5f604c6f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,11 @@
2004-05-24 Not Zed <NotZed@Ximian.com>
+ * mail-account-gui.c (mail_account_gui_build_extra_conf): don't
+ enable the widget based on its writability if it is a dependent
+ option which is now disable.
+ (setup_toggle): return whether the widget is sensitive too.
+ #57171.
+
* em-popup.c (em_popup_target_new_select): only enable add sender
if we also have 1 selected. #56663.
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index e3d02cf278..83605dbbfd 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -917,19 +917,22 @@ toggle_sensitivity (GtkToggleButton *toggle, GtkWidget *widget)
gtk_widget_set_sensitive (widget, gtk_toggle_button_get_active (toggle));
}
-static void
+/* Returns true if the widget is enabled */
+static gboolean
setup_toggle (GtkWidget *widget, const char *depname, MailAccountGui *gui)
{
GtkToggleButton *toggle;
if (!strcmp (depname, "UNIMPLEMENTED")) {
gtk_widget_set_sensitive (widget, FALSE);
- return;
+ return FALSE;
}
toggle = g_hash_table_lookup (gui->extra_config, depname);
g_signal_connect (toggle, "toggled", G_CALLBACK (toggle_sensitivity), widget);
toggle_sensitivity (toggle, widget);
+
+ return gtk_toggle_button_get_active(toggle);
}
void
@@ -1019,6 +1022,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
rows = main_table->nrows;
for (i = 0; ; i++) {
GtkWidget *enable_widget = NULL;
+ int enabled = TRUE;
switch (entries[i].type) {
case CAMEL_PROVIDER_CONF_SECTION_START:
@@ -1107,8 +1111,8 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
rows++;
g_hash_table_insert (gui->extra_config, entries[i].name, checkbox);
if (entries[i].depname)
- setup_toggle (checkbox, entries[i].depname, gui);
-
+ enabled = setup_toggle(checkbox, entries[i].depname, gui);
+
enable_widget = checkbox;
break;
}
@@ -1153,7 +1157,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
if (entries[i].depname) {
setup_toggle (entry, entries[i].depname, gui);
- setup_toggle (label, entries[i].depname, gui);
+ enabled = setup_toggle (label, entries[i].depname, gui);
}
g_hash_table_insert (gui->extra_config, entries[i].name, entry);
@@ -1220,7 +1224,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
if (entries[i].depname) {
setup_toggle (checkbox, entries[i].depname, gui);
setup_toggle (spin, entries[i].depname, gui);
- setup_toggle (label, entries[i].depname, gui);
+ enabled = setup_toggle (label, entries[i].depname, gui);
}
enable_widget = hbox;
@@ -1234,7 +1238,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
goto done;
}
- if (enable_widget)
+ if (enabled && enable_widget)
gtk_widget_set_sensitive(enable_widget, e_account_writable_option(gui->account, gui->source.provider->protocol, entries[i].name));
}