[evolution/account-mgmt: 24/48] Adapt modules/mail to the new ESource API.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/account-mgmt: 24/48] Adapt modules/mail to the new ESource API.
- Date: Fri, 11 Nov 2011 01:27:24 +0000 (UTC)
commit 994bb8b8e60a9ebfba8d00bd6088b37a64dfaad6
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Apr 13 10:31:24 2011 -0400
Adapt modules/mail to the new ESource API.
modules/mail/e-mail-shell-backend.c | 27 +++++++++++++++-
modules/mail/e-mail-shell-view-actions.c | 40 +++++++++++-------------
modules/mail/e-mail-shell-view-private.c | 26 +++++++++++++---
modules/mail/e-mail-shell-view-private.h | 2 +-
modules/mail/e-mail-shell-view.c | 35 ++++++++++++++-------
modules/mail/em-account-prefs.c | 48 ++++++++++++++++++++---------
modules/mail/em-account-prefs.h | 7 ++--
modules/mail/em-composer-prefs.c | 26 ++-------------
8 files changed, 128 insertions(+), 83 deletions(-)
---
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index ce56312..a6b9502 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -27,6 +27,9 @@
#include <glib/gi18n.h>
+#include <libedataserver/e-source-registry.h>
+#include <libedataserver/e-source-mail-transport.h>
+
#include "e-util/e-import.h"
#include "e-util/e-util.h"
#include "shell/e-shell.h"
@@ -152,15 +155,25 @@ action_mail_message_new_cb (GtkAction *action,
EShellSidebar *shell_sidebar;
EShellView *shell_view;
EShell *shell;
+ ESourceRegistry *registry;
EMFolderTree *folder_tree;
CamelFolder *folder = NULL;
CamelStore *store;
+ GList *list;
+ const gchar *extension_name;
const gchar *view_name;
+ gboolean no_transport_defined;
gchar *folder_name;
shell = e_shell_window_get_shell (shell_window);
+ registry = e_shell_get_registry (shell);
+
+ extension_name = E_SOURCE_EXTENSION_MAIL_TRANSPORT;
+ list = e_source_registry_list_sources (registry, extension_name);
+ no_transport_defined = (list == NULL);
+ g_list_free (list);
- if (!em_utils_check_user_can_send_mail ())
+ if (no_transport_defined)
return;
/* Take care not to unnecessarily load the mail shell view. */
@@ -265,10 +278,20 @@ mail_shell_backend_handle_uri_cb (EShell *shell,
const gchar *uri,
EMailShellBackend *mail_shell_backend)
{
+ ESourceRegistry *registry;
+ GList *list;
+ const gchar *extension_name;
+ gboolean transport_defined;
gboolean handled = FALSE;
+ registry = e_shell_get_registry (shell);
+ extension_name = E_SOURCE_EXTENSION_MAIL_TRANSPORT;
+ list = e_source_registry_list_sources (registry, extension_name);
+ transport_defined = (list != NULL);
+ g_list_free (list);
+
if (g_str_has_prefix (uri, "mailto:")) {
- if (em_utils_check_user_can_send_mail ())
+ if (transport_defined)
em_utils_compose_new_message_with_mailto (
shell, uri, NULL);
handled = TRUE;
diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c
index f752506..5057206 100644
--- a/modules/mail/e-mail-shell-view-actions.c
+++ b/modules/mail/e-mail-shell-view-actions.c
@@ -82,24 +82,21 @@ action_mail_account_disable_cb (GtkAction *action,
EMailShellView *mail_shell_view)
{
EMailShellSidebar *mail_shell_sidebar;
- EShellBackend *shell_backend;
+ EShell *shell;
EShellView *shell_view;
- EMailBackend *backend;
- EMailSession *session;
+ EShellBackend *shell_backend;
EMFolderTree *folder_tree;
CamelService *service;
CamelStore *store;
- EAccountList *account_list;
- EAccount *account;
+ ESource *source;
+ ESourceRegistry *registry;
const gchar *uid;
mail_shell_sidebar = mail_shell_view->priv->mail_shell_sidebar;
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
-
- backend = E_MAIL_BACKEND (shell_backend);
- session = e_mail_backend_get_session (backend);
+ shell = e_shell_backend_get_shell (shell_backend);
folder_tree = e_mail_shell_sidebar_get_folder_tree (mail_shell_sidebar);
store = em_folder_tree_get_selected_store (folder_tree);
@@ -107,22 +104,21 @@ action_mail_account_disable_cb (GtkAction *action,
service = CAMEL_SERVICE (store);
uid = camel_service_get_uid (service);
- account = e_get_account_by_uid (uid);
- g_return_if_fail (account != NULL);
-
- account_list = e_get_account_list ();
-
- if (e_account_list_account_has_proxies (account_list, account))
- e_account_list_remove_account_proxies (account_list, account);
-
- account->enabled = !account->enabled;
- e_account_list_change (account_list, account);
- e_mail_store_remove_by_account (session, account);
+ registry = e_shell_get_registry (shell);
+ source = e_source_registry_lookup_by_uid (registry, uid);
+ g_return_if_fail (source != NULL);
+
+#if 0 /* ACCOUNT_MGMT */
+ /* FIXME This is GroupWise-specific behavior. */
+ if (e_source_get_parent (source) != NULL) {
+ e_source_registry_remove_source (registry, source);
+ return;
+ }
+#endif /* ACCOUNT_MGMT */
- if (account->parent_uid != NULL)
- e_account_list_remove (account_list, account);
+ e_source_set_enabled (source, FALSE);
- e_account_list_save (account_list);
+ e_shell_view_submit_source (shell_view, source);
}
static void
diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c
index 50525c7..02e09fc 100644
--- a/modules/mail/e-mail-shell-view-private.c
+++ b/modules/mail/e-mail-shell-view-private.c
@@ -933,10 +933,13 @@ void
e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view)
{
EMailShellContent *mail_shell_content;
+ EShellBackend *shell_backend;
EShellSidebar *shell_sidebar;
EShellView *shell_view;
+ EShell *shell;
EMailReader *reader;
EMailView *mail_view;
+ ESourceRegistry *registry;
CamelStore *local_store;
CamelStore *parent_store;
CamelFolder *folder;
@@ -957,8 +960,12 @@ e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view)
mail_view = e_mail_shell_content_get_mail_view (mail_shell_content);
shell_view = E_SHELL_VIEW (mail_shell_view);
+ shell_backend = e_shell_view_get_shell_backend (shell_view);
shell_sidebar = e_shell_view_get_shell_sidebar (shell_view);
+ shell = e_shell_backend_get_shell (shell_backend);
+ registry = e_shell_get_registry (shell);
+
reader = E_MAIL_READER (mail_view);
folder = e_mail_reader_get_folder (reader);
@@ -1022,19 +1029,19 @@ e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view)
num_junked), num_junked);
/* "Drafts" folder */
- } else if (em_utils_folder_is_drafts (folder)) {
+ } else if (em_utils_folder_is_drafts (registry, folder)) {
g_string_append_printf (
buffer, ngettext ("%d draft", "%d drafts",
num_visible), num_visible);
/* "Outbox" folder */
- } else if (em_utils_folder_is_outbox (folder)) {
+ } else if (em_utils_folder_is_outbox (registry, folder)) {
g_string_append_printf (
buffer, ngettext ("%d unsent", "%d unsent",
num_visible), num_visible);
/* "Sent" folder */
- } else if (em_utils_folder_is_sent (folder)) {
+ } else if (em_utils_folder_is_sent (registry, folder)) {
g_string_append_printf (
buffer, ngettext ("%d sent", "%d sent",
num_visible), num_visible);
@@ -1099,8 +1106,6 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
shell_window = e_shell_view_get_shell_window (shell_view);
shell_backend = e_shell_view_get_shell_backend (shell_view);
- em_utils_clear_get_password_canceled_accounts_flag ();
-
if (!account_uid) {
switch (mode) {
case E_MAIL_SEND_RECEIVE_BOTH:
@@ -1117,6 +1122,7 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
mail_send (E_MAIL_BACKEND (shell_backend));
break;
}
+#if 0 /* ACCOUNT_MGMT */
} else {
/* allow only receive on individual accounts */
EAccount *account;
@@ -1127,9 +1133,11 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view,
if (account->enabled && account->source != NULL)
mail_receive_account (
E_MAIL_BACKEND (shell_backend), account);
+#endif /* ACCOUNT_MGMT */
}
}
+#if 0 /* ACCOUNT_MGMT */
static GtkMenuItem *
send_receive_find_account_menu_item (GtkMenuShell *menu,
EAccount *account)
@@ -1381,13 +1389,16 @@ menu_weak_ref_cb (gpointer accounts,
accounts, G_SIGNAL_MATCH_DATA,
0, 0, NULL, NULL, where_the_object_was);
}
+#endif /* ACCOUNT_MGMT */
static GtkWidget *
create_send_receive_submenu (EMailShellView *mail_shell_view)
{
EShellView *shell_view;
EShellWindow *shell_window;
+#if 0 /* ACCOUNT_MGMT */
EAccountList *accounts;
+#endif /* ACCOUNT_MGMT */
GtkWidget *menu;
GtkAccelGroup *accel_group;
GtkUIManager *ui_manager;
@@ -1398,7 +1409,10 @@ create_send_receive_submenu (EMailShellView *mail_shell_view)
shell_view = E_SHELL_VIEW (mail_shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+#if 0 /* ACCOUNT_MGMT */
accounts = e_get_account_list ();
+#endif /* ACCOUNT_MGMT */
+
menu = gtk_menu_new ();
ui_manager = e_shell_window_get_ui_manager (shell_window);
accel_group = gtk_ui_manager_get_accel_group (ui_manager);
@@ -1427,6 +1441,7 @@ create_send_receive_submenu (EMailShellView *mail_shell_view)
GTK_MENU_SHELL (menu),
gtk_separator_menu_item_new ());
+#if 0 /* ACCOUNT_MGMT */
if (accounts) {
EIterator *iterator;
@@ -1462,6 +1477,7 @@ create_send_receive_submenu (EMailShellView *mail_shell_view)
g_object_weak_ref (
G_OBJECT (menu), menu_weak_ref_cb, accounts);
}
+#endif /* ACCOUNT_MGMT */
gtk_widget_show_all (menu);
diff --git a/modules/mail/e-mail-shell-view-private.h b/modules/mail/e-mail-shell-view-private.h
index 9bd276d..9bab406 100644
--- a/modules/mail/e-mail-shell-view-private.h
+++ b/modules/mail/e-mail-shell-view-private.h
@@ -27,10 +27,10 @@
#include <glib/gi18n.h>
#include <gtkhtml/gtkhtml.h>
#include <camel/camel-search-private.h> /* for camel_search_word */
+#include <libedataserver/e-source-mail-account.h>
#include "e-util/e-util.h"
#include "e-util/gconf-bridge.h"
-#include "e-util/e-account-utils.h"
#include "e-util/e-ui-manager.h"
#include "filter/e-filter-part.h"
#include "widgets/misc/e-web-view.h"
diff --git a/modules/mail/e-mail-shell-view.c b/modules/mail/e-mail-shell-view.c
index 5759b58..54dd844 100644
--- a/modules/mail/e-mail-shell-view.c
+++ b/modules/mail/e-mail-shell-view.c
@@ -224,6 +224,7 @@ mail_shell_view_execute_search (EShellView *shell_view)
EActionComboBox *combo_box;
EMailBackend *backend;
EMailSession *session;
+ ESourceRegistry *registry;
EMFolderTree *folder_tree;
GtkWidget *message_list;
EFilterRule *rule;
@@ -257,6 +258,7 @@ mail_shell_view_execute_search (EShellView *shell_view)
shell = e_shell_window_get_shell (shell_window);
shell_settings = e_shell_get_shell_settings (shell);
+ registry = e_shell_get_registry (shell);
backend = E_MAIL_BACKEND (shell_backend);
session = e_mail_backend_get_session (backend);
@@ -393,7 +395,7 @@ filter:
break;
case MAIL_FILTER_RECENT_MESSAGES:
- if (em_utils_folder_is_sent (folder))
+ if (em_utils_folder_is_sent (registry, folder))
temp = g_strdup_printf (
"(and %s (match-all "
"(> (get-sent-date) "
@@ -410,7 +412,7 @@ filter:
break;
case MAIL_FILTER_LAST_5_DAYS_MESSAGES:
- if (em_utils_folder_is_sent (folder))
+ if (em_utils_folder_is_sent (registry, folder))
temp = g_strdup_printf (
"(and %s (match-all "
"(> (get-sent-date) "
@@ -824,12 +826,14 @@ mail_shell_view_update_actions (EShellView *shell_view)
EMailShellSidebar *mail_shell_sidebar;
EShellSidebar *shell_sidebar;
EShellWindow *shell_window;
+ EShell *shell;
EMFolderTree *folder_tree;
EMFolderTreeModel *model;
EMailReader *reader;
EMailView *mail_view;
CamelStore *store;
- EAccount *account;
+ ESourceRegistry *registry;
+ ESource *source = NULL;
GtkAction *action;
GList *list, *link;
const gchar *label;
@@ -853,6 +857,8 @@ mail_shell_view_update_actions (EShellView *shell_view)
E_SHELL_VIEW_CLASS (parent_class)->update_actions (shell_view);
shell_window = e_shell_view_get_shell_window (shell_view);
+ shell = e_shell_window_get_shell (shell_window);
+ registry = e_shell_get_registry (shell);
mail_shell_view = E_MAIL_SHELL_VIEW (shell_view);
mail_shell_content = mail_shell_view->priv->mail_shell_content;
@@ -892,9 +898,19 @@ mail_shell_view_update_actions (EShellView *shell_view)
service = CAMEL_SERVICE (store);
uid = camel_service_get_uid (service);
- account = e_get_account_by_uid (uid);
- } else
- account = NULL;
+ source = e_source_registry_lookup_by_uid (registry, uid);
+ }
+
+ if (source != NULL) {
+ const gchar *backend_name;
+
+ backend_name = e_source_get_backend_name (source);
+
+ /* FIXME This belongs in a GroupWise plugin. */
+ account_is_groupwise =
+ (g_strcmp0 (backend_name, "groupwise") == 0) &&
+ (e_source_get_parent (source) != NULL);
+ }
if (uri != NULL) {
GtkTreeRowReference *reference;
@@ -918,11 +934,6 @@ mail_shell_view_update_actions (EShellView *shell_view)
g_free (folder_uri);
}
- /* FIXME This belongs in a GroupWise plugin. */
- account_is_groupwise =
- (g_strrstr (uri, "groupwise://") != NULL) &&
- account != NULL && account->parent_uid != NULL;
-
reference = em_folder_tree_model_lookup_uri (model, uri);
if (reference != NULL) {
GtkTreePath *path;
@@ -953,7 +964,7 @@ mail_shell_view_update_actions (EShellView *shell_view)
g_list_free (list);
action = ACTION (MAIL_ACCOUNT_DISABLE);
- sensitive = (account != NULL) && folder_is_store;
+ sensitive = (source != NULL) && folder_is_store;
if (account_is_groupwise)
label = _("Proxy _Logout");
else
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index ddf51d8..0a4596f 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -19,10 +19,11 @@
*
*/
-/* XXX EAccountManager handles all the user interface stuff. This subclass
- * applies policies using mailer resources that EAccountManager does not
- * have access to. The desire is to someday move account management
- * completely out of the mailer, perhaps to evolution-data-server. */
+/* XXX EMailAccountManager handles all the user interface stuff.
+ * This subclass applies policies using mailer resources that
+ * EMailAccountManager does not have access to. The desire is
+ * to someday move account management completely out of the mailer,
+ * perhaps to evolution-data-server. */
#ifdef HAVE_CONFIG_H
#include <config.h>
@@ -33,7 +34,6 @@
#include <glib/gi18n.h>
#include "e-util/e-alert-dialog.h"
-#include "e-util/e-account-utils.h"
#include "e-mail-backend.h"
#include "e-mail-local.h"
@@ -59,8 +59,9 @@ enum {
G_DEFINE_TYPE (
EMAccountPrefs,
em_account_prefs,
- E_TYPE_ACCOUNT_MANAGER)
+ E_TYPE_MAIL_ACCOUNT_MANAGER)
+#if 0 /* ACCOUNT_MGMT */
static gboolean
account_prefs_toggle_enable_special (EMAccountPrefs *prefs,
EAccountTreeViewSelectedType type,
@@ -155,6 +156,7 @@ account_prefs_disable_account_cb (EAccountTreeView *tree_view,
e_mail_store_remove_by_account (session, account);
}
+#endif /* ACCOUNT_MGMT */
static void
account_prefs_set_backend (EMAccountPrefs *prefs,
@@ -230,8 +232,9 @@ account_prefs_dispose (GObject *object)
}
static void
-account_prefs_add_account (EAccountManager *manager)
+account_prefs_add_account (EMailAccountManager *manager)
{
+#if 0 /* ACCOUNT_MGMT */
EMAccountPrefsPrivate *priv;
EMAccountEditor *emae;
gpointer parent;
@@ -272,11 +275,13 @@ account_prefs_add_account (EAccountManager *manager)
g_object_add_weak_pointer (G_OBJECT (priv->assistant), &priv->assistant);
gtk_window_set_transient_for (GTK_WINDOW (priv->assistant), parent);
gtk_widget_show (priv->assistant);
+#endif /* ACCOUNT_MGMT */
}
static void
-account_prefs_edit_account (EAccountManager *manager)
+account_prefs_edit_account (EMailAccountManager *manager)
{
+#if 0 /* ACCOUNT_MGMT */
EMAccountPrefsPrivate *priv;
EMAccountEditor *emae;
EAccountTreeView *tree_view;
@@ -317,11 +322,13 @@ account_prefs_edit_account (EAccountManager *manager)
g_object_add_weak_pointer (G_OBJECT (priv->editor), &priv->editor);
gtk_widget_show (priv->editor);
+#endif /* ACCOUNT_MGMT */
}
static void
-account_prefs_delete_account (EAccountManager *manager)
+account_prefs_delete_account (EMailAccountManager *manager)
{
+#if 0 /* ACCOUNT_MGMT */
EMAccountPrefsPrivate *priv;
EAccountTreeView *tree_view;
EAccountList *account_list;
@@ -371,13 +378,14 @@ account_prefs_delete_account (EAccountManager *manager)
e_account_list_remove (account_list, account);
e_account_list_save (account_list);
+#endif /* ACCOUNT_MGMT */
}
static void
em_account_prefs_class_init (EMAccountPrefsClass *class)
{
GObjectClass *object_class;
- EAccountManagerClass *account_manager_class;
+ EMailAccountManagerClass *account_manager_class;
g_type_class_add_private (class, sizeof (EMAccountPrefsPrivate));
@@ -386,7 +394,7 @@ em_account_prefs_class_init (EMAccountPrefsClass *class)
object_class->get_property = account_prefs_get_property;
object_class->dispose = account_prefs_dispose;
- account_manager_class = E_ACCOUNT_MANAGER_CLASS (class);
+ account_manager_class = E_MAIL_ACCOUNT_MANAGER_CLASS (class);
account_manager_class->add_account = account_prefs_add_account;
account_manager_class->edit_account = account_prefs_edit_account;
account_manager_class->delete_account = account_prefs_delete_account;
@@ -406,14 +414,17 @@ em_account_prefs_class_init (EMAccountPrefsClass *class)
static void
em_account_prefs_init (EMAccountPrefs *prefs)
{
- EAccountManager *manager;
- EAccountTreeView *tree_view;
+#if 0 /* ACCOUNT_MGMT */
+ EMailAccountManager *manager;
+ EMailAccountTreeView *tree_view;
+#endif /* ACCOUNT_MGMT */
prefs->priv = G_TYPE_INSTANCE_GET_PRIVATE (
prefs, EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsPrivate);
- manager = E_ACCOUNT_MANAGER (prefs);
- tree_view = e_account_manager_get_tree_view (manager);
+#if 0 /* ACCOUNT_MGMT */
+ manager = E_MAIL_ACCOUNT_MANAGER (prefs);
+ tree_view = e_mail_account_manager_get_tree_view (manager);
g_signal_connect (
tree_view, "enable-account",
@@ -422,8 +433,10 @@ em_account_prefs_init (EMAccountPrefs *prefs)
g_signal_connect (
tree_view, "disable-account",
G_CALLBACK (account_prefs_disable_account_cb), prefs);
+#endif /* ACCOUNT_MGMT */
}
+#if 0 /* ACCOUNT_MGMT */
static void
account_tree_view_sort_order_changed_cb (EAccountTreeView *tree_view,
EMailBackend *backend)
@@ -442,10 +455,12 @@ account_tree_view_sort_order_changed_cb (EAccountTreeView *tree_view,
g_slist_foreach (account_uids, (GFunc) g_free, NULL);
g_slist_free (account_uids);
}
+#endif /* ACCOUNT_MGMT */
GtkWidget *
em_account_prefs_new (EPreferencesWindow *window)
{
+#if 0 /* ACCOUNT_MGMT */
EShell *shell;
EShellBackend *shell_backend;
EAccountList *account_list;
@@ -502,6 +517,9 @@ em_account_prefs_new (EPreferencesWindow *window)
G_CALLBACK (account_tree_view_sort_order_changed_cb), shell_backend);
return res;
+#endif /* ACCOUNT_MGMT */
+
+ return NULL;
}
EMailBackend *
diff --git a/modules/mail/em-account-prefs.h b/modules/mail/em-account-prefs.h
index 667b83f..f78f105 100644
--- a/modules/mail/em-account-prefs.h
+++ b/modules/mail/em-account-prefs.h
@@ -24,9 +24,8 @@
#include <gtk/gtk.h>
#include <table/e-table.h>
-#include <libedataserver/e-account-list.h>
#include <mail/e-mail-backend.h>
-#include <misc/e-account-manager.h>
+#include <misc/e-mail-account-manager.h>
#include <widgets/misc/e-preferences-window.h>
/* Standard GObject macros */
@@ -55,12 +54,12 @@ typedef struct _EMAccountPrefsClass EMAccountPrefsClass;
typedef struct _EMAccountPrefsPrivate EMAccountPrefsPrivate;
struct _EMAccountPrefs {
- EAccountManager parent;
+ EMailAccountManager parent;
EMAccountPrefsPrivate *priv;
};
struct _EMAccountPrefsClass {
- EAccountManagerClass parent_class;
+ EMailAccountManagerClass parent_class;
};
GType em_account_prefs_get_type (void);
diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c
index 8453b88..d5d25ce 100644
--- a/modules/mail/em-composer-prefs.c
+++ b/modules/mail/em-composer-prefs.c
@@ -30,7 +30,6 @@
#include <unistd.h>
#include <fcntl.h>
-#include "e-util/e-signature-utils.h"
#include "e-util/gconf-bridge.h"
#include "em-composer-prefs.h"
@@ -46,9 +45,7 @@
#include <e-util/e-util.h>
#include <e-util/e-util-private.h>
#include <misc/e-charset-combo-box.h>
-#include <misc/e-signature-editor.h>
-#include <misc/e-signature-manager.h>
-#include <misc/e-signature-preview.h>
+#include <misc/e-mail-signature-manager.h>
#include "em-config.h"
#include "em-folder-selection-button.h"
@@ -321,8 +318,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
GtkWidget *toplevel, *widget, *info_pixmap;
GtkWidget *container;
EShellSettings *shell_settings;
- ESignatureList *signature_list;
- ESignatureTreeView *signature_tree_view;
+ ESourceRegistry *registry;
GtkTreeView *view;
GtkListStore *store;
GtkTreeSelection *selection;
@@ -333,6 +329,7 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
GSList *l;
gint i;
+ registry = e_shell_get_registry (shell);
shell_settings = e_shell_get_shell_settings (shell);
/* Make sure our custom widget classes are registered with
@@ -540,10 +537,9 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
NULL, (GDestroyNotify) NULL);
/* Signatures */
- signature_list = e_get_signature_list ();
container = e_builder_get_widget (
prefs->builder, "signature-alignment");
- widget = e_signature_manager_new (signature_list);
+ widget = e_mail_signature_manager_new (registry);
gtk_container_add (GTK_CONTAINER (container), widget);
gtk_widget_show (widget);
@@ -560,20 +556,6 @@ em_composer_prefs_construct (EMComposerPrefs *prefs,
widget, "prefer-html",
G_BINDING_SYNC_CREATE);
- signature_tree_view = e_signature_manager_get_tree_view (
- E_SIGNATURE_MANAGER (widget));
-
- container = e_builder_get_widget (
- prefs->builder, "signature-preview-scrolled-window");
- widget = e_signature_preview_new ();
- gtk_container_add (GTK_CONTAINER (container), widget);
- gtk_widget_show (widget);
-
- g_object_bind_property (
- signature_tree_view, "selected",
- widget, "signature",
- G_BINDING_SYNC_CREATE);
-
/* Sanitize the dialog for Express mode */
e_shell_hide_widgets_for_express_mode (
shell, prefs->builder,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]