aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-account-editor.c
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2005-04-08 12:34:25 +0800
committerMichael Zucci <zucchi@src.gnome.org>2005-04-08 12:34:25 +0800
commit3262cba6ce9e55ae6afd71dd7cee7173992fa493 (patch)
tree0ef215df4550d905711ca6662e30fedab20cb376 /mail/em-account-editor.c
parent74adbf2671566b78409acb8ac33088498bd33ea2 (diff)
downloadgsoc2013-evolution-3262cba6ce9e55ae6afd71dd7cee7173992fa493.tar.gz
gsoc2013-evolution-3262cba6ce9e55ae6afd71dd7cee7173992fa493.tar.zst
gsoc2013-evolution-3262cba6ce9e55ae6afd71dd7cee7173992fa493.zip
removed. (em_utils_handle_receipt): asynchronously load message if none is
2005-04-08 Not Zed <NotZed@Ximian.com> * em-composer-utils.c (em_utils_ask_receipt): removed. (em_utils_handle_receipt): asynchronously load message if none is supplied. * em-folder-view.c (emfv_set_seen): pass message in. * em-composer-utils.c (em_utils_ask_receipt): strip leading lwsp on the disposition address. (em_utils_ask_receipt): added a comment about which rfc. (em_utils_handle_receipt): merged ask_receipt into here. Changed api to take a message instead, so we don't have to load the message every time. Also only set receipt-handled if we have a receipt requested in the first place. 2005-04-05 ERDI Gergo <cactus@cactus.rulez.org> * mail-errors.xml: Added new dialog for receipt requests * em-composer-utils.c (em_utils_guess_account): Made guess_account public, to be callable from em-folder-view (em_utils_send_receipt): New function to send an RFC 2298-compliant message delivery notification svn path=/trunk/; revision=29185
Diffstat (limited to 'mail/em-account-editor.c')
-rw-r--r--mail/em-account-editor.c61
1 files changed, 61 insertions, 0 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 3e25485134..56c7b50aad 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -724,6 +724,64 @@ emae_setup_signatures(EMAccountEditor *emae, GladeXML *xml)
}
static void
+emae_receipt_policy_changed(GtkComboBox *dropdown, EMAccountEditor *emae)
+{
+ int id = gtk_combo_box_get_active(dropdown);
+ GtkTreeModel *model;
+ GtkTreeIter iter;
+ EAccountReceiptPolicy policy;
+
+ if (id != -1) {
+ model = gtk_combo_box_get_model(dropdown);
+ if (gtk_tree_model_iter_nth_child(model, &iter, NULL, id)) {
+ gtk_tree_model_get(model, &iter, 1, &policy, -1);
+ e_account_set_int (emae->account, E_ACCOUNT_RECEIPT_POLICY, policy);
+ }
+ }
+
+}
+
+static GtkWidget *
+emae_setup_receipt_policy (EMAccountEditor *emae, GladeXML *xml)
+{
+ GtkComboBox *dropdown = (GtkComboBox *)glade_xml_get_widget(xml, "receipt_policy_dropdown");
+ GtkListStore *store;
+ int i = 0, active = 0;
+ GtkTreeIter iter;
+ EAccountReceiptPolicy current = emae->account->receipt_policy;
+ static struct {
+ EAccountReceiptPolicy policy;
+ char *label;
+ } receipt_policies[] = {
+ { E_ACCOUNT_RECEIPT_NEVER, N_("Never") },
+ { E_ACCOUNT_RECEIPT_ALWAYS, N_("Always") },
+ { E_ACCOUNT_RECEIPT_ASK, N_("Ask for each message") }
+ };
+
+ gtk_widget_show((GtkWidget *)dropdown);
+
+ store = gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_INT);
+
+ for (i = 0; i < 3; ++i) {
+ gtk_list_store_append (store, &iter);
+ gtk_list_store_set (store, &iter,
+ 0, _(receipt_policies[i].label),
+ 1, receipt_policies[i].policy,
+ -1);
+ if (current == receipt_policies[i].policy)
+ active = i;
+ }
+
+ gtk_combo_box_set_model(dropdown, (GtkTreeModel *)store);
+ gtk_combo_box_set_active(dropdown, active);
+
+ g_signal_connect(dropdown, "changed", G_CALLBACK(emae_receipt_policy_changed), emae);
+ gtk_widget_set_sensitive((GtkWidget *)dropdown, e_account_writable(emae->account, E_ACCOUNT_RECEIPT_POLICY));
+
+ return (GtkWidget *)dropdown;
+}
+
+static void
emae_account_entry_changed(GtkEntry *entry, EMAccountEditor *emae)
{
int item = GPOINTER_TO_INT(g_object_get_data((GObject *)entry, "account-item"));
@@ -2081,6 +2139,9 @@ emae_defaults_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
gtk_widget_set_sensitive((GtkWidget *)gui->restore_folders_button,
e_account_writable(emae->account, E_ACCOUNT_SENT_FOLDER_URI)
|| e_account_writable(emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI));
+
+ /* Receipt policy */
+ emae_setup_receipt_policy (emae, xml);
w = glade_xml_get_widget(xml, item->label);
gtk_notebook_append_page((GtkNotebook *)parent, w, gtk_label_new(_("Defaults")));