aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-03-18 21:20:41 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-03-18 21:20:41 +0800
commit50822889bc546a1be8ca4f568b848cec79c99237 (patch)
tree6e8f20f96d5589cab8fd33992d874fa905b03722
parentdfade5600534026595bd1f9819077e4d401cbf63 (diff)
downloadgsoc2013-evolution-50822889bc546a1be8ca4f568b848cec79c99237.tar.gz
gsoc2013-evolution-50822889bc546a1be8ca4f568b848cec79c99237.tar.zst
gsoc2013-evolution-50822889bc546a1be8ca4f568b848cec79c99237.zip
save the source and transport vbox's to enable/disable the whole lot
2004-03-18 Not Zed <NotZed@Ximian.com> * mail-account-gui.c (mail_account_gui_new): save the source and transport vbox's to enable/disable the whole lot easier. (mail_account_gui_setup): enable above based on perms. (mail_account_gui_build_extra_conf): also disable extra page, as above. * em-account-prefs.c (account_cursor_change): disable the whole account editor if accounts are ro. svn path=/trunk/; revision=25114
-rw-r--r--mail/ChangeLog15
-rw-r--r--mail/em-account-prefs.c3
-rw-r--r--mail/mail-account-gui.c29
-rw-r--r--mail/mail-account-gui.h2
-rw-r--r--mail/mail-config.c45
-rw-r--r--mail/mail-config.h22
6 files changed, 34 insertions, 82 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 44db55f400..40691ec27a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,11 +1,14 @@
2004-03-18 Not Zed <NotZed@Ximian.com>
- * mail-config.c (mail_config_writable): started writing this, but
- i couldn't be fucked right now - apparently gnome is supposed to
- use the gconf thing which just doens't work. i'll waste a few
- hours trying to get it to work again first before i keep going
- with this.
-
+ * mail-account-gui.c (mail_account_gui_new): save the source and
+ transport vbox's to enable/disable the whole lot easier.
+ (mail_account_gui_setup): enable above based on perms.
+ (mail_account_gui_build_extra_conf): also disable extra page, as
+ above.
+
+ * em-account-prefs.c (account_cursor_change): disable the whole
+ account editor if accounts are ro.
+
2004-03-17 Not Zed <NotZed@Ximian.com>
* em-format-html.c (efh_message_deliverystatus): format as plain
diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c
index ee0337562e..9026ce53fe 100644
--- a/mail/em-account-prefs.c
+++ b/mail/em-account-prefs.c
@@ -402,8 +402,9 @@ account_cursor_change (GtkTreeSelection *selection, EMAccountPrefs *prefs)
} else {
gtk_widget_grab_focus (GTK_WIDGET (prefs->mail_add));
}
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs), TRUE);
} else {
- gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_add), FALSE);
+ gtk_widget_set_sensitive (GTK_WIDGET (prefs), FALSE);
}
gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), state);
diff --git a/mail/mail-account-gui.c b/mail/mail-account-gui.c
index ebf8e6f5a6..15a4523cb7 100644
--- a/mail/mail-account-gui.c
+++ b/mail/mail-account-gui.c
@@ -806,7 +806,7 @@ mail_account_gui_build_extra_conf (MailAccountGui *gui, const char *url_string)
camel_url_free (url);
return;
} else
- gtk_widget_set_sensitive (GTK_WIDGET (main_table), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(main_table), e_account_writable(gui->account, E_ACCOUNT_SOURCE_URL));
/* Set up our hash table. */
if (gui->extra_config)
@@ -1521,7 +1521,6 @@ MailAccountGui *
mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
{
MailAccountGui *gui;
- GtkWidget *button;
g_object_ref (account);
@@ -1538,7 +1537,7 @@ mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
if (!mail_config_get_default_account ()
|| (account == mail_config_get_default_account ()))
gtk_toggle_button_set_active (gui->default_account, TRUE);
-
+
/* Identity */
gui->full_name = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_full_name"));
gui->email_address = GTK_ENTRY (glade_xml_get_widget (gui->xml, "identity_address"));
@@ -1560,6 +1559,7 @@ mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
/* Source */
gui->source.provider_type = CAMEL_PROVIDER_STORE;
+ gui->source.container = glade_xml_get_widget(gui->xml, "source_vbox");
gui->source.type = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "source_type_omenu"));
gui->source.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "source_description"));
gui->source.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "source_host"));
@@ -1585,6 +1585,7 @@ mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
/* Transport */
gui->transport.provider_type = CAMEL_PROVIDER_TRANSPORT;
+ gui->transport.container = glade_xml_get_widget(gui->xml, "transport_vbox");
gui->transport.type = GTK_OPTION_MENU (glade_xml_get_widget (gui->xml, "transport_type_omenu"));
gui->transport.description = GTK_LABEL (glade_xml_get_widget (gui->xml, "transport_description"));
gui->transport.hostname = GTK_ENTRY (glade_xml_get_widget (gui->xml, "transport_host"));
@@ -1625,7 +1626,7 @@ mail_account_gui_new (EAccount *account, EMAccountPrefs *dialog)
em_folder_selection_button_set_selection((EMFolderSelectionButton *)gui->sent_folder_button, gui->sent_folder_uri);
/* Special Folders "Reset Defaults" button */
- gui->restore_folders_button = glade_xml_get_widget (gui->xml, "default_folders_button");
+ gui->restore_folders_button = (GtkButton *)glade_xml_get_widget (gui->xml, "default_folders_button");
g_signal_connect (gui->restore_folders_button, "clicked", G_CALLBACK (default_folders_clicked), gui);
/* Always Cc */
@@ -1880,13 +1881,24 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
}
/* FIXME: drive by table?? */
- if (gui->source.provider) {
+ if (gui->source.provider == NULL
+ || !e_account_writable(gui->account, E_ACCOUNT_SOURCE_URL)) {
+ gtk_widget_set_sensitive(gui->source.container, FALSE);
+ } else {
+ gtk_widget_set_sensitive(gui->source.container, TRUE);
gtk_widget_set_sensitive((GtkWidget *)gui->source.authtype, e_account_writable_option(gui->account, gui->source.provider->protocol, "auth"));
+ gtk_widget_set_sensitive((GtkWidget *)gui->source.check_supported, e_account_writable_option(gui->account, gui->source.provider->protocol, "auth"));
gtk_widget_set_sensitive((GtkWidget *)gui->source.use_ssl, e_account_writable_option(gui->account, gui->source.provider->protocol, "use_ssl"));
+ gtk_widget_set_sensitive((GtkWidget *)gui->source.remember, e_account_writable(gui->account, E_ACCOUNT_SOURCE_SAVE_PASSWD));
}
- if (gui->transport.provider) {
+ if (gui->transport.provider == NULL
+ || !e_account_writable(gui->account, E_ACCOUNT_TRANSPORT_URL)) {
+ gtk_widget_set_sensitive(gui->transport.container, FALSE);
+ } else {
gtk_widget_set_sensitive((GtkWidget *)gui->transport.authtype, e_account_writable_option(gui->account, gui->transport.provider->protocol, "auth"));
+ gtk_widget_set_sensitive((GtkWidget *)gui->transport.check_supported, e_account_writable_option(gui->account, gui->transport.provider->protocol, "auth"));
gtk_widget_set_sensitive((GtkWidget *)gui->transport.use_ssl, e_account_writable_option(gui->account, gui->transport.provider->protocol, "use_ssl"));
+ gtk_widget_set_sensitive((GtkWidget *)gui->transport.remember, e_account_writable(gui->account, E_ACCOUNT_TRANSPORT_SAVE_PASSWD));
}
gtk_widget_set_sensitive((GtkWidget *)gui->drafts_folder_button, e_account_writable(gui->account, E_ACCOUNT_DRAFTS_FOLDER_URI));
@@ -1894,9 +1906,10 @@ mail_account_gui_setup (MailAccountGui *gui, GtkWidget *top)
gtk_widget_set_sensitive((GtkWidget *)gui->restore_folders_button,
e_account_writable(gui->account, E_ACCOUNT_SENT_FOLDER_URI)
|| e_account_writable(gui->account, E_ACCOUNT_DRAFTS_FOLDER_URI));
- gtk_widget_set_sensitive((GtkWidget *)gui->source.remember, e_account_writable(gui->account, E_ACCOUNT_SOURCE_SAVE_PASSWD));
- gtk_widget_set_sensitive((GtkWidget *)gui->transport.remember, e_account_writable(gui->account, E_ACCOUNT_TRANSPORT_SAVE_PASSWD));
gtk_widget_set_sensitive((GtkWidget *)gui->sig_option_menu, e_account_writable(gui->account, E_ACCOUNT_ID_DEF_SIGNATURE));
+ gtk_widget_set_sensitive(glade_xml_get_widget(gui->xml, "sigAddNew"),
+ gconf_client_key_is_writable(mail_config_get_gconf_client(),
+ "/apps/evolution/mail/signatures", NULL));
gtk_widget_set_sensitive((GtkWidget *)gui->source_auto_check, e_account_writable(gui->account, E_ACCOUNT_SOURCE_AUTO_CHECK));
gtk_widget_set_sensitive((GtkWidget *)gui->source_auto_check_min, e_account_writable(gui->account, E_ACCOUNT_SOURCE_AUTO_CHECK_TIME));
}
diff --git a/mail/mail-account-gui.h b/mail/mail-account-gui.h
index 0b1d16c0da..53b6292c66 100644
--- a/mail/mail-account-gui.h
+++ b/mail/mail-account-gui.h
@@ -39,6 +39,8 @@ extern "C" {
#include "em-account-prefs.h"
typedef struct {
+ GtkWidget *container;
+
GtkOptionMenu *type;
GtkLabel *description;
GtkEntry *hostname;
diff --git a/mail/mail-config.c b/mail/mail-config.c
index ed578b4b58..99419f7250 100644
--- a/mail/mail-config.c
+++ b/mail/mail-config.c
@@ -1524,48 +1524,3 @@ mail_config_signature_set_html (MailConfigSignature *sig, gboolean html)
mail_config_signature_emit_event (MAIL_CONFIG_SIG_EVENT_HTML_CHANGED, sig);
}
}
-
-static const struct _mc_perm {
- const char *key;
- guint32 perm;
-} mc_perms[] = {
- { "composer/charset", },
- { "composer/send_html", },
- { "composer/magic_smileys", },
- { "composer/inline_spelling", },
- { "format/forward_style", },
- { "format/reply_style", },
- { "trash/empty_on_exit", },
- { "trash/empty_on_exit_days", },
- { "display/charset" },
- { "display/headers" },
- { "display/labels" },
- { "display/fonts/monospace" },
- { "display/fonts/variable" },
- { "display/load_http_images" },
-};
-
-struct _mc_item {
-} mc_items[MAIL_CONFIG_ITEM_LAST] = {
- { /* MAIL_CONFIG_ACCOUNTS */ },
- { /* MAIL_CONFIG_COMPOSER_CHARSET */ },
- { /* MAIL_CONFIG_COMPOSER_SEND_HTML */ },
- { /* MAIL_CONFIG_COMPOSER_MAGIC_SMILEYS */ },
- { /* MAIL_CONFIG_COMPOSER_SPELL_CHECK */ },
- { /* MAIL_CONFIG_FORMAT_FORWARD_STYLE */ },
- { /* MAIL_CONFIG_FORMAT_REPLY_STYLE */ },
- { /* MAIL_CONFIG_TRASH_EMPTY_ON_EXIT */ },
- { /* MAIL_CONFIG_TRASH_EMPTY_ON_EXIT_DAYS */ },
- { /* MAIL_CONFIG_DISPLAY_CHARSET */ },
- { /* MAIL_CONFIG_DISPLAY_HEADERS */ },
- { /* MAIL_CONFIG_DISPLAY_LABELS */ },
- { /* MAIL_CONFIG_DISPLAY_FONT_MONO */ },
- { /* MAIL_CONFIG_DISPLAY_FONT_PROP */ },
- { /* MAIL_CONFIG_DISPLAY_LOAD_HTTP */ },
-};
-
-gboolean mail_config_writable(mail_config_item_t item)
-{
-
-}
-
diff --git a/mail/mail-config.h b/mail/mail-config.h
index 34b9d12498..36891eccb4 100644
--- a/mail/mail-config.h
+++ b/mail/mail-config.h
@@ -179,28 +179,6 @@ void mail_config_signature_emit_event (MailConfigSigEvent event, MailConfigSigna
void mail_config_write_account_sig (EAccount *account, int i);
char *mail_config_signature_run_script (char *script);
-typedef enum _mail_config_item_t {
- MAIL_CONFIG_ACCOUNTS, /* should this be on e-account-list? */
- MAIL_CONFIG_COMPOSER_CHARSET,
- MAIL_CONFIG_COMPOSER_SEND_HTML,
- MAIL_CONFIG_COMPOSER_MAGIC_SMILEYS,
- MAIL_CONFIG_COMPOSER_SPELL_CHECK,
- MAIL_CONFIG_FORMAT_FORWARD_STYLE,
- MAIL_CONFIG_FORMAT_REPLY_STYLE,
- MAIL_CONFIG_TRASH_EMPTY_ON_EXIT,
- MAIL_CONFIG_TRASH_EMPTY_ON_EXIT_DAYS,
- MAIL_CONFIG_DISPLAY_CHARSET,
- MAIL_CONFIG_DISPLAY_HEADERS,
- MAIL_CONFIG_DISPLAY_LABELS,
- MAIL_CONFIG_DISPLAY_FONT_MONO,
- MAIL_CONFIG_DISPLAY_FONT_PROP,
- MAIL_CONFIG_DISPLAY_LOAD_HTTP,
-
- MAIL_CONFIG_ITEM_LAST
-} mail_config_item_t;
-
-gboolean mail_config_writable(mail_config_item_t item);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */