aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-account-editor.c
diff options
context:
space:
mode:
Diffstat (limited to 'mail/em-account-editor.c')
-rw-r--r--mail/em-account-editor.c81
1 files changed, 55 insertions, 26 deletions
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 2b13e7e015..e5f0f98001 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -51,10 +51,11 @@
#include <libgnomeui/gnome-druid.h>
#include <libgnomeui/gnome-druid-page-standard.h>
-#include <libedataserver/e-account-list.h>
#include <e-util/e-signature-list.h>
#include "e-util/e-error.h"
+#include "e-util/e-account-utils.h"
+#include "e-util/e-signature-utils.h"
#include "e-util/e-util-private.h"
#include "em-config.h"
@@ -62,14 +63,15 @@
#include "em-account-editor.h"
#include "mail-session.h"
#include "mail-send-recv.h"
-#include "mail-signature-editor.h"
-#include "mail-component.h"
+#include "e-signature-editor.h"
#include "em-utils.h"
#include "em-composer-prefs.h"
#include "mail-config.h"
#include "mail-ops.h"
#include "mail-mt.h"
+#include "e-mail-shell-backend.h"
+
#if defined (HAVE_NSS)
#include "smime/gui/e-cert-selector.h"
#endif
@@ -209,7 +211,7 @@ emae_finalise(GObject *o)
EMAccountEditorPrivate *p = emae->priv;
if (p->sig_added_id) {
- ESignatureList *signatures = mail_config_get_signatures();
+ ESignatureList *signatures = e_get_signature_list ();
g_signal_handler_disconnect(signatures, p->sig_added_id);
g_signal_handler_disconnect(signatures, p->sig_removed_id);
@@ -467,11 +469,13 @@ default_folders_clicked (GtkButton *button, gpointer user_data)
EMAccountEditor *emae = user_data;
const char *uri;
- uri = mail_component_get_folder_uri(NULL, MAIL_COMPONENT_FOLDER_DRAFTS);
+ uri = e_mail_shell_backend_get_folder_uri (
+ global_mail_shell_backend, E_MAIL_FOLDER_DRAFTS);
em_folder_selection_button_set_selection((EMFolderSelectionButton *)emae->priv->drafts_folder_button, uri);
emae_account_folder_changed((EMFolderSelectionButton *)emae->priv->drafts_folder_button, emae);
- uri = mail_component_get_folder_uri(NULL, MAIL_COMPONENT_FOLDER_SENT);
+ uri = e_mail_shell_backend_get_folder_uri (
+ global_mail_shell_backend, E_MAIL_FOLDER_SENT);
em_folder_selection_button_set_selection((EMFolderSelectionButton *)emae->priv->sent_folder_button, uri);
emae_account_folder_changed((EMFolderSelectionButton *)emae->priv->sent_folder_button, emae);
}
@@ -482,7 +486,10 @@ GtkWidget *em_account_editor_folder_selector_button_new (char *widget_name, char
GtkWidget *
em_account_editor_folder_selector_button_new (char *widget_name, char *string1, char *string2, int int1, int int2)
{
- return (GtkWidget *)em_folder_selection_button_new(string1 ? string1 : _("Select Folder"), NULL);
+ EMFolderTreeModel *model;
+
+ model = e_mail_shell_backend_get_folder_tree_model (global_mail_shell_backend);
+ return (GtkWidget *)em_folder_selection_button_new(model, string1 ? string1 : _("Select Folder"), NULL);
}
GtkWidget *em_account_editor_dropdown_new(char *widget_name, char *string1, char *string2, int int1, int int2);
@@ -675,10 +682,19 @@ emae_signaturetype_changed(GtkComboBox *dropdown, EMAccountEditor *emae)
static void
emae_signature_new(GtkWidget *w, EMAccountEditor *emae)
{
- /* TODO: why is this in composer prefs? apart from it being somewhere to put it? */
- em_composer_prefs_new_signature((GtkWindow *)gtk_widget_get_toplevel(w),
- gconf_client_get_bool(mail_config_get_gconf_client(),
- "/apps/evolution/mail/composer/send_html", NULL));
+ EShell *shell;
+ EShellSettings *shell_settings;
+ GtkWidget *parent;
+ gboolean html_mode;
+
+ shell = e_shell_get_default ();
+ shell_settings = e_shell_get_shell_settings (shell);
+ parent = gtk_widget_get_toplevel (w);
+
+ html_mode = e_shell_settings_get_boolean (
+ shell_settings, "composer-format-html");
+
+ em_composer_prefs_new_signature (GTK_WINDOW (parent), html_mode);
}
static GtkWidget *
@@ -703,7 +719,7 @@ emae_setup_signatures(EMAccountEditor *emae, GladeXML *xml)
gtk_list_store_append(store, &iter);
gtk_list_store_set(store, &iter, 0, _("None"), 1, NULL, -1);
- signatures = mail_config_get_signatures ();
+ signatures = e_get_signature_list ();
if (p->sig_added_id == 0) {
p->sig_added_id = g_signal_connect(signatures, "signature-added", G_CALLBACK(emae_signature_added), emae);
@@ -909,7 +925,11 @@ emae_account_folder(EMAccountEditor *emae, const char *name, int item, int deffo
em_folder_selection_button_set_selection(folder, tmp);
g_free(tmp);
} else {
- em_folder_selection_button_set_selection(folder, mail_component_get_folder_uri(NULL, deffolder));
+ const gchar *uri;
+
+ uri = e_mail_shell_backend_get_folder_uri (
+ global_mail_shell_backend, deffolder);
+ em_folder_selection_button_set_selection(folder, uri);
}
g_object_set_data((GObject *)folder, "account-item", GINT_TO_POINTER(item));
@@ -1402,8 +1422,8 @@ emae_refresh_providers(EMAccountEditor *emae, EMAccountEditorService *service)
int active = 0, i;
struct _service_info *info = &emae_service_info[service->type];
const char *uri = e_account_get_string(account, info->account_uri_key);
- const char *tmp;
char *current = NULL;
+ const gchar *tmp;
CamelURL *url;
dropdown = service->providers;
@@ -1815,8 +1835,8 @@ emae_identity_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
gui->management_frame = glade_xml_get_widget(xml, "management_frame");
gui->default_account = GTK_TOGGLE_BUTTON (glade_xml_get_widget (xml, "management_default"));
- if (!mail_config_get_default_account ()
- || (account == mail_config_get_default_account ())
+ if (!e_get_default_account ()
+ || (account == e_get_default_account ())
|| (GPOINTER_TO_INT(g_object_get_data (G_OBJECT (emae->account), "default_flagged"))) )
gtk_toggle_button_set_active (gui->default_account, TRUE);
@@ -2401,8 +2421,8 @@ emae_defaults_page(EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, st
g_free (gladefile);
/* Special folders */
- gui->drafts_folder_button = (GtkButton *)emae_account_folder(emae, "drafts_button", E_ACCOUNT_DRAFTS_FOLDER_URI, MAIL_COMPONENT_FOLDER_DRAFTS, xml);
- gui->sent_folder_button = (GtkButton *)emae_account_folder(emae, "sent_button", E_ACCOUNT_SENT_FOLDER_URI, MAIL_COMPONENT_FOLDER_SENT, xml);
+ gui->drafts_folder_button = (GtkButton *)emae_account_folder(emae, "drafts_button", E_ACCOUNT_DRAFTS_FOLDER_URI, E_MAIL_FOLDER_DRAFTS, xml);
+ gui->sent_folder_button = (GtkButton *)emae_account_folder(emae, "sent_button", E_ACCOUNT_SENT_FOLDER_URI, E_MAIL_FOLDER_SENT, xml);
/* Special Folders "Reset Defaults" button */
gui->restore_folders_button = (GtkButton *)glade_xml_get_widget (xml, "default_folders_button");
@@ -2832,7 +2852,6 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
g_warning("buz2\n");
}
-
} else if (!strcmp(pageid, "20.receive_options")) {
if (emae->priv->source.provider
&& emae->priv->extra_provider != emae->priv->source.provider) {
@@ -2849,7 +2868,7 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
len = strlen(tmp);
template = alloca(len + 14);
strcpy(template, tmp);
- while (mail_config_get_account_by_name(template))
+ while (e_get_account_by_name (template))
sprintf(template + len, " (%d)", i++);
gtk_entry_set_text(emae->priv->identity_entries[0], template);
@@ -2902,7 +2921,7 @@ emae_check_complete(EConfig *ec, const char *pageid, void *data)
if (ok && (pageid == NULL || !strcmp(pageid, "40.management"))) {
ok = (tmp = e_account_get_string(emae->account, E_ACCOUNT_NAME))
&& tmp[0]
- && ((ea = mail_config_get_account_by_name(tmp)) == NULL
+ && ((ea = e_get_account_by_name (tmp)) == NULL
|| ea == emae->original);
if (!ok) {
d(printf("management page incomplete\n"));
@@ -2922,6 +2941,7 @@ em_account_editor_check (EMAccountEditor *emae, const char *page)
static void
add_new_store (char *uri, CamelStore *store, void *user_data)
{
+#if 0 /* KILL-BONOBO: Try to actually fix this? */
MailComponent *component = mail_component_peek ();
EAccount *account = user_data;
@@ -2929,13 +2949,14 @@ add_new_store (char *uri, CamelStore *store, void *user_data)
return;
mail_component_add_store (component, store, account->name);
+#endif
}
static void
emae_commit(EConfig *ec, GSList *items, void *data)
{
EMAccountEditor *emae = data;
- EAccountList *accounts = mail_config_get_accounts();
+ EAccountList *accounts = e_get_account_list ();
EAccount *account;
/* the mail-config*acconts* api needs a lot of work */
@@ -3001,13 +3022,21 @@ em_account_editor_construct(EMAccountEditor *emae, EAccount *account, em_account
emae->do_signature = TRUE;
} else {
+ const gchar *uri;
+
/* TODO: have a get_default_account thing?? */
emae->account = e_account_new();
emae->account->enabled = TRUE;
- e_account_set_string(emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI,
- mail_component_get_folder_uri(NULL, MAIL_COMPONENT_FOLDER_DRAFTS));
- e_account_set_string(emae->account, E_ACCOUNT_SENT_FOLDER_URI,
- mail_component_get_folder_uri(NULL, MAIL_COMPONENT_FOLDER_SENT));
+
+ uri = e_mail_shell_backend_get_folder_uri (
+ global_mail_shell_backend, E_MAIL_FOLDER_DRAFTS);
+ e_account_set_string (
+ emae->account, E_ACCOUNT_DRAFTS_FOLDER_URI, uri);
+
+ uri = e_mail_shell_backend_get_folder_uri (
+ global_mail_shell_backend, E_MAIL_FOLDER_SENT);
+ e_account_set_string (
+ emae->account, E_ACCOUNT_SENT_FOLDER_URI, uri);
}
/* sort the providers, remote first */