From 03ca12814b49f7f7999c635d7449dabce0b145b5 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 23 May 2009 22:13:47 -0400 Subject: =?UTF-8?q?Bug=20583339=20=E2=80=93=20Edit->Preferences->Mail=20Ac?= =?UTF-8?q?counts=20inconsistent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mail/e-mail-shell-backend.c | 4 +- mail/em-account-prefs.c | 681 +++------- mail/em-account-prefs.h | 30 +- mail/mail-config.glade | 782 ++++++------ mail/mail-dialogs.glade | 2484 ++++++++++++++---------------------- widgets/misc/Makefile.am | 4 + widgets/misc/e-account-combo-box.c | 1 + widgets/misc/e-account-combo-box.h | 1 + widgets/misc/e-account-manager.c | 461 +++++++ widgets/misc/e-account-manager.h | 82 ++ widgets/misc/e-account-tree-view.c | 621 +++++++++ widgets/misc/e-account-tree-view.h | 84 ++ widgets/misc/e-signature-manager.c | 18 +- widgets/misc/e-signature-manager.h | 4 +- 14 files changed, 2838 insertions(+), 2419 deletions(-) create mode 100644 widgets/misc/e-account-manager.c create mode 100644 widgets/misc/e-account-manager.h create mode 100644 widgets/misc/e-account-tree-view.c create mode 100644 widgets/misc/e-account-tree-view.h diff --git a/mail/e-mail-shell-backend.c b/mail/e-mail-shell-backend.c index 8b5f6542c7..15d9e0d063 100644 --- a/mail/e-mail-shell-backend.c +++ b/mail/e-mail-shell-backend.c @@ -501,8 +501,10 @@ static GtkActionEntry source_entries[] = { static void mail_shell_backend_init_preferences (EShell *shell) { + EAccountList *account_list; GtkWidget *preferences_window; + account_list = e_get_account_list (); preferences_window = e_shell_get_preferences_window (shell); e_preferences_window_add_page ( @@ -510,7 +512,7 @@ mail_shell_backend_init_preferences (EShell *shell) "mail-accounts", "preferences-mail-accounts", _("Mail Accounts"), - em_account_prefs_new (), + em_account_prefs_new (account_list), 100); e_preferences_window_add_page ( diff --git a/mail/em-account-prefs.c b/mail/em-account-prefs.c index bd72edd91a..5431a4dad3 100644 --- a/mail/em-account-prefs.c +++ b/mail/em-account-prefs.c @@ -1,4 +1,6 @@ /* + * em-account-prefs.c + * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either @@ -13,13 +15,17 @@ * License along with the program; if not, see * * - * Authors: - * Jeffrey Stedfast - * * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * */ +/* 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. */ + +#include "em-account-prefs.h" + #ifdef HAVE_CONFIG_H #include #endif @@ -28,562 +34,295 @@ #include -#include "mail-config.h" -#include "mail-ops.h" -#include "mail-send-recv.h" - -#include "e-util/e-account-utils.h" #include "e-util/e-error.h" -#include "e-util/e-util-private.h" -#include "em-account-prefs.h" +#include "em-config.h" #include "em-account-editor.h" #include "e-mail-shell-backend.h" +#include "mail-config.h" -static void em_account_prefs_class_init (EMAccountPrefsClass *class); -static void em_account_prefs_init (EMAccountPrefs *prefs); -static void em_account_prefs_finalise (GObject *obj); -static void em_account_prefs_destroy (GtkObject *object); - -static void mail_accounts_load (EMAccountPrefs *prefs); - - -static GtkVBoxClass *parent_class = NULL; - - -#define PREFS_WINDOW(prefs) GTK_WINDOW (gtk_widget_get_ancestor (GTK_WIDGET (prefs), GTK_TYPE_WINDOW)) - - -GType -em_account_prefs_get_type (void) -{ - static GType type = 0; - - if (!type) { - GTypeInfo type_info = { - sizeof (EMAccountPrefsClass), - NULL, NULL, - (GClassInitFunc) em_account_prefs_class_init, - NULL, NULL, - sizeof (EMAccountPrefs), - 0, - (GInstanceInitFunc) em_account_prefs_init, - }; - - type = g_type_register_static (gtk_vbox_get_type (), "EMAccountPrefs", &type_info, 0); - } - - return type; -} - -static void -em_account_prefs_class_init (EMAccountPrefsClass *klass) -{ - GtkObjectClass *gtk_object_class = (GtkObjectClass *) klass; - GObjectClass *object_class = (GObjectClass *) klass; - - parent_class = g_type_class_ref (gtk_vbox_get_type ()); - - gtk_object_class->destroy = em_account_prefs_destroy; +#define EM_ACCOUNT_PREFS_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), EM_TYPE_ACCOUNT_PREFS, EMAccountPrefsPrivate)) - object_class->finalize = em_account_prefs_finalise; -} +struct _EMAccountPrefsPrivate { + gpointer druid; /* weak pointer */ + gpointer editor; /* weak pointer */ +}; -static void -em_account_prefs_init (EMAccountPrefs *prefs) -{ - prefs->druid = NULL; - prefs->editor = NULL; -} +static gpointer parent_class; static void -em_account_prefs_destroy (GtkObject *obj) +account_prefs_enable_account_cb (EAccountTreeView *tree_view) { - EMAccountPrefs *prefs = (EMAccountPrefs *) obj; + EAccount *account; - prefs->destroyed = TRUE; + account = e_account_tree_view_get_selected (tree_view); + g_return_if_fail (account != NULL); - GTK_OBJECT_CLASS (parent_class)->destroy (obj); + e_mail_shell_backend_load_store_by_uri ( + global_mail_shell_backend, + account->source->url, account->name); } static void -em_account_prefs_finalise (GObject *obj) +account_prefs_disable_account_cb (EAccountTreeView *tree_view) { - EMAccountPrefs *prefs = (EMAccountPrefs *) obj; - - g_object_unref (prefs->gui); + EAccountList *account_list; + EAccount *account; + gpointer parent; + gint response; - G_OBJECT_CLASS (parent_class)->finalize (obj); -} + account = e_account_tree_view_get_selected (tree_view); + g_return_if_fail (account != NULL); -static void -account_add_finished (EMAccountPrefs *prefs, GObject *deadbeef) -{ - /* Either Cancel or Finished was clicked in the druid so reload the accounts */ - prefs->druid = NULL; + account_list = e_account_tree_view_get_account_list (tree_view); + g_return_if_fail (account_list != NULL); - if (!prefs->destroyed) - mail_accounts_load (prefs); + if (!e_account_list_account_has_proxies (account_list, account)) + return; - g_object_unref (prefs); -} + parent = gtk_widget_get_toplevel (GTK_WIDGET (tree_view)); + parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; -#include "em-config.h" + response = e_error_run ( + parent, "mail:ask-delete-proxy-accounts", NULL); -static void -account_add_clicked (GtkButton *button, gpointer user_data) -{ - EMAccountPrefs *prefs = (EMAccountPrefs *) user_data; - - if (prefs->druid == NULL) { - EMAccountEditor *emae; - - /** @HookPoint-EMConfig: New Mail Account Druid - * @Id: org.gnome.evolution.mail.config.accountDruid - * @Type: E_CONFIG_DRUID - * @Class: org.gnome.evolution.mail.config:1.0 - * @Target: EMConfigTargetAccount - * - * The new mail account druid. - */ - emae = em_account_editor_new(NULL, EMAE_DRUID, "org.gnome.evolution.mail.config.accountDruid"); - prefs->druid = emae->editor; - - gtk_window_set_transient_for((GtkWindow *)prefs->druid, (GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)prefs)); - g_object_ref(prefs); - /* rather nasty hack to reload the accounts, it should just listen to the e-account-list */ - g_object_weak_ref((GObject *) prefs->druid, (GWeakNotify) account_add_finished, prefs); - gtk_widget_show(emae->editor); - } else { - gdk_window_raise (prefs->druid->window); + if (response != GTK_RESPONSE_YES) { + g_signal_stop_emission_by_name (tree_view, "disable-account"); + return; } -} -static void -account_edit_finished (EMAccountPrefs *prefs, GObject *deadbeef) -{ - prefs->editor = NULL; + e_account_list_remove_account_proxies (account_list, account); - if (!prefs->destroyed) - mail_accounts_load (prefs); - - g_object_unref (prefs); + e_mail_shell_backend_remove_store_by_uri ( + global_mail_shell_backend, account->source->url); } static void -account_edit_clicked (GtkButton *button, gpointer user_data) +account_prefs_add_account (EAccountManager *manager) { - EMAccountPrefs *prefs = (EMAccountPrefs *) user_data; - EAccountList *account_list; + EMAccountPrefsPrivate *priv; + EMAccountEditor *emae; + gpointer parent; - account_list = e_get_account_list (); - - if (prefs->editor == NULL) { - GtkTreeSelection *selection; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, 3, &account, -1); - - if (account && !account->parent_uid && !e_account_list_account_has_proxies (account_list, account)) { - EMAccountEditor *emae; - - /** @HookPoint-EMConfig: Mail Account Editor - * @Id: org.gnome.evolution.mail.config.accountEditor - * @Type: E_CONFIG_BOOK - * @Class: org.gnome.evolution.mail.config:1.0 - * @Target: EMConfigTargetAccount - * - * The account editor window. - */ - emae = em_account_editor_new(account, EMAE_NOTEBOOK, "org.gnome.evolution.mail.config.accountEditor"); - prefs->editor = emae->editor; - - gtk_window_set_transient_for((GtkWindow *)prefs->editor, (GtkWindow *)gtk_widget_get_toplevel((GtkWidget *)prefs)); - g_object_ref(prefs); - /* rather nasty hack to reload the accounts, it should just listen to the e-account-list */ - g_object_weak_ref((GObject *)prefs->editor, (GWeakNotify) account_edit_finished, prefs); - gtk_widget_show(emae->editor); - } - } else { - gdk_window_raise (prefs->editor->window); - } -} + priv = EM_ACCOUNT_PREFS_GET_PRIVATE (manager); -static void -account_delete_clicked (GtkButton *button, gpointer user_data) -{ - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; - EAccount *account = NULL; - EAccountList *accounts; - GtkTreeModel *model; - GtkTreeIter iter; - int ans; - gboolean has_proxies = FALSE; - - accounts = e_get_account_list (); - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, 3, &account, -1); - - /* make sure we have a valid account selected and that we aren't editing anything... */ - if (account == NULL || prefs->editor != NULL) + if (priv->druid != NULL) { + gtk_window_present (GTK_WINDOW (priv->druid)); return; - - has_proxies = e_account_list_account_has_proxies (accounts, account); - ans = e_error_run(PREFS_WINDOW(prefs), has_proxies?"mail:ask-delete-account-with-proxies":"mail:ask-delete-account",NULL); - - if (ans == GTK_RESPONSE_YES) { - int len; - - /* remove it from the folder-tree in the shell */ - if (account->enabled && account->source && account->source->url) - e_mail_shell_backend_remove_store_by_uri ( - global_mail_shell_backend, account->source->url); - - /* remove all the proxies account has created*/ - if (has_proxies) - e_account_list_remove_account_proxies (accounts, account); - - /* remove it from the config file */ - e_account_list_remove (accounts, account); - - mail_config_write (); - - gtk_list_store_remove ((GtkListStore *) model, &iter); - - len = e_list_length ((EList *) accounts); - if (len > 0) { - if ( !gtk_list_store_iter_is_valid ((GtkListStore *) model, &iter)) - gtk_tree_model_get_iter_first (model, &iter); - - gtk_tree_selection_select_iter (selection, &iter); - } else { - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), FALSE); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), FALSE); - } } + + parent = gtk_widget_get_toplevel (GTK_WIDGET (manager)); + parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; + + /** @HookPoint-EMConfig: New Mail Account Druid + * @Id: org.gnome.evolution.mail.config.accountDruid + * @Type: E_CONFIG_DRUID + * @Class: org.gnome.evolution.mail.config:1.0 + * @Target: EMConfigTargetAccount + * + * The new mail account druid. + */ + emae = em_account_editor_new ( + NULL, EMAE_DRUID, + "org.gnome.evolution.mail.config.accountDruid"); + priv->druid = emae->editor; + + g_object_add_weak_pointer (G_OBJECT (priv->druid), &priv->druid); + gtk_window_set_transient_for (GTK_WINDOW (priv->druid), parent); + gtk_widget_show (priv->druid); } static void -account_default_clicked (GtkButton *button, gpointer user_data) +account_prefs_edit_account (EAccountManager *manager) { - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - - selection = gtk_tree_view_get_selection (prefs->table); - if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, 3, &account, -1); - - if (account) { - e_set_default_account (account); - - mail_config_write (); + EMAccountPrefsPrivate *priv; + EMAccountEditor *emae; + EAccountTreeView *tree_view; + EAccountList *account_list; + EAccount *account; + gpointer parent; - mail_accounts_load (prefs); - } -} + priv = EM_ACCOUNT_PREFS_GET_PRIVATE (manager); -static void -account_able_changed(EAccount *account) -{ - /* FIXME: do this directly by listening to the mail accounts changed events in the relevant components */ - - if (account->source->url) { - if (account->enabled) - e_mail_shell_backend_load_store_by_uri ( - global_mail_shell_backend, - account->source->url, account->name); - else - e_mail_shell_backend_remove_store_by_uri ( - global_mail_shell_backend, account->source->url); + if (priv->editor != NULL) { + gtk_window_present (GTK_WINDOW (priv->editor)); + return; } - mail_config_write (); + account_list = e_account_manager_get_account_list (manager); + tree_view = e_account_manager_get_tree_view (manager); + account = e_account_tree_view_get_selected (tree_view); + g_return_if_fail (account != NULL); + + parent = gtk_widget_get_toplevel (GTK_WIDGET (manager)); + parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; + + /** @HookPoint-EMConfig: Mail Account Editor + * @Id: org.gnome.evolution.mail.config.accountEditor + * @Type: E_CONFIG_BOOK + * @Class: org.gnome.evolution.mail.config:1.0 + * @Target: EMConfigTargetAccount + * + * The account editor window. + */ + emae = em_account_editor_new ( + account, EMAE_NOTEBOOK, + "org.gnome.evolution.mail.config.accountEditor"); + priv->editor = emae->editor; + + g_object_add_weak_pointer (G_OBJECT (priv->editor), &priv->editor); + gtk_window_set_transient_for (GTK_WINDOW (priv->editor), parent); + gtk_widget_show (priv->editor); } static void -account_able_toggled (GtkCellRendererToggle *renderer, char *arg1, gpointer user_data) +account_prefs_delete_account (EAccountManager *manager) { - EMAccountPrefs *prefs = user_data; - GtkTreeSelection *selection; + EMAccountPrefsPrivate *priv; + EAccountTreeView *tree_view; EAccountList *account_list; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreePath *path; - GtkTreeIter iter; + EAccount *account; + gboolean has_proxies; + gpointer parent; + gint response; - account_list = e_get_account_list (); + priv = EM_ACCOUNT_PREFS_GET_PRIVATE (manager); - path = gtk_tree_path_new_from_string (arg1); - model = gtk_tree_view_get_model (prefs->table); - selection = gtk_tree_view_get_selection (prefs->table); + account_list = e_account_manager_get_account_list (manager); + tree_view = e_account_manager_get_tree_view (manager); + account = e_account_tree_view_get_selected (tree_view); + g_return_if_fail (account != NULL); - if (gtk_tree_model_get_iter (model, &iter, path)) { - gtk_tree_model_get (model, &iter, 3, &account, -1); + /* Make sure we aren't editing anything... */ + if (priv->editor != NULL) + return; - if (e_account_list_account_has_proxies (account_list, account)) { - int ans; + parent = gtk_widget_get_toplevel (GTK_WIDGET (manager)); + parent = GTK_WIDGET_TOPLEVEL (parent) ? parent : NULL; - ans = e_error_run(PREFS_WINDOW(prefs), "mail:ask-delete-proxy-accounts",NULL); + has_proxies = + e_account_list_account_has_proxies (account_list, account); - if (ans == GTK_RESPONSE_NO) { - gtk_tree_path_free (path); - return; - } + response = e_error_run ( + parent, has_proxies ? + "mail:ask-delete-account-with-proxies" : + "mail:ask-delete-account", NULL); - e_account_list_remove_account_proxies (account_list, account); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), 1); - } + if (response != GTK_RESPONSE_YES) { + g_signal_stop_emission_by_name (manager, "delete-account"); + return; + } - account->enabled = !account->enabled; - e_account_list_change(e_get_account_list (), account); - account_able_changed (account); - gtk_list_store_set ((GtkListStore *) model, &iter, 0, account->enabled, -1); + /* Remove the account from the folder tree. */ + if (account->enabled && account->source && account->source->url) + e_mail_shell_backend_remove_store_by_uri ( + global_mail_shell_backend, account->source->url); - /* let the rest of the application know it changed */ - } + /* Remove all the proxies the account has created. */ + if (has_proxies) + e_account_list_remove_account_proxies (account_list, account); - gtk_tree_path_free (path); -} + /* Remove it from the config file. */ + e_account_list_remove (account_list, account); -static void -account_double_click (GtkTreeView *treeview, GtkTreePath *path, - GtkTreeViewColumn *column, EMAccountPrefs *prefs) -{ - account_edit_clicked (NULL, prefs); + mail_config_write (); } static void -account_cursor_change (GtkTreeSelection *selection, EMAccountPrefs *prefs) +account_prefs_dispose (GObject *object) { - EAccountList *account_list; - EAccount *account = NULL; - GtkTreeModel *model; - GtkTreeIter iter; - const char *url = NULL; - int state; - EAccount *default_account; - - account_list = e_get_account_list (); - default_account = e_get_default_account (); - - state = gconf_client_key_is_writable(mail_config_get_gconf_client(), "/apps/evolution/mail/accounts", NULL); - if (state) { - state = gtk_tree_selection_get_selected (selection, &model, &iter); - if (state) { - gtk_tree_model_get (model, &iter, 3, &account, -1); - url = e_account_get_string (account, E_ACCOUNT_SOURCE_URL); - } 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), FALSE); - } + EMAccountPrefsPrivate *priv; - if (url != NULL) { - gboolean has_proxies; + priv = EM_ACCOUNT_PREFS_GET_PRIVATE (object); - has_proxies = e_account_list_account_has_proxies (account_list, account); - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_edit), !has_proxies); + if (priv->druid != NULL) { + g_object_remove_weak_pointer ( + G_OBJECT (priv->druid), &priv->druid); + priv->druid = NULL; } - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_delete), state); - - if(account == default_account) - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), FALSE); - else - gtk_widget_set_sensitive (GTK_WIDGET (prefs->mail_default), state); -} - -static void -mail_accounts_load (EMAccountPrefs *prefs) -{ - EAccount *default_account; - EAccountList *accounts; - GtkListStore *model; - GtkTreeIter iter; - char *name, *val; - EIterator *node; - int row = 0; - GtkTreeSelection *selection; - - model = (GtkListStore *) gtk_tree_view_get_model (prefs->table); - gtk_list_store_clear (model); - - default_account = e_get_default_account (); - - accounts = e_get_account_list (); - node = e_list_get_iterator ((EList *) accounts); - selection = gtk_tree_view_get_selection(prefs->table); - - while (e_iterator_is_valid (node)) { - EAccount *account; - CamelURL *url; - - account = (EAccount *) e_iterator_get (node); - - if (!account->parent_uid) { - url = account->source && account->source->url ? camel_url_new (account->source->url, NULL) : NULL; - - gtk_list_store_append (model, &iter); - if (account == default_account) { - /* translators: default account indicator */ - name = val = g_strdup_printf ("%s %s", account->name, _("[Default]")); - } else { - val = account->name; - name = NULL; - } - - gtk_list_store_set (model, &iter, - 0, account->enabled, - 1, val, - 2, url && url->protocol ? url->protocol : (char *) _("None"), - 3, account, - -1); - g_free (name); - - if (url) - camel_url_free (url); - - /* select the first row by default */ - if (row == 0 && !prefs->changed) - gtk_tree_selection_select_iter (selection, &iter); - row++; - } - - e_iterator_next (node); + if (priv->editor != NULL) { + g_object_remove_weak_pointer ( + G_OBJECT (priv->editor), &priv->editor); + priv->editor = NULL; } - g_object_unref (node); + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (parent_class)->dispose (object); } - - -GtkWidget *em_account_prefs_treeview_new (char *widget_name, char *string1, char *string2, - int int1, int int2); - -GtkWidget * -em_account_prefs_treeview_new (char *widget_name, char *string1, char *string2, int int1, int int2) +static void +account_prefs_class_init (EMAccountPrefsClass *class) { - GtkWidget *table, *scrolled; - GtkTreeSelection *selection; - GtkCellRenderer *renderer; - GtkListStore *model; - - scrolled = gtk_scrolled_window_new (NULL, NULL); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled), - GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled), GTK_SHADOW_IN); - - renderer = gtk_cell_renderer_toggle_new (); - g_object_set ((GObject *) renderer, "activatable", TRUE, NULL); + GObjectClass *object_class; + EAccountManagerClass *account_manager_class; - model = gtk_list_store_new (4, G_TYPE_BOOLEAN, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_POINTER); - table = gtk_tree_view_new_with_model ((GtkTreeModel *) model); - g_object_unref (model); - gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Enabled"), - renderer, "active", 0, NULL); + parent_class = g_type_class_peek_parent (class); + g_type_class_add_private (class, sizeof (EMAccountPrefsPrivate)); - g_object_set_data ((GObject *) scrolled, "renderer", renderer); + object_class = G_OBJECT_CLASS (class); + object_class->dispose = account_prefs_dispose; - renderer = gtk_cell_renderer_text_new (); - gtk_tree_view_insert_column_with_attributes ((GtkTreeView *) table, -1, _("Account name"), - renderer, "text", 1, NULL); - gtk_tree_view_insert_column_with_attributes ((GtkTreeView *)table, -1, _("Protocol"), - renderer, "text", 2, NULL); - selection = gtk_tree_view_get_selection ((GtkTreeView *) table); - gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - gtk_tree_view_set_headers_visible ((GtkTreeView *) table, TRUE); - atk_object_set_name (gtk_widget_get_accessible (table), _("Mail Accounts")); - - - /* FIXME: column auto-resize? */ - /* Is this needed? - gtk_tree_view_column_set_alignment (gtk_tree_view_get_column (prefs->table, 0), 1.0);*/ - - gtk_container_add (GTK_CONTAINER (scrolled), table); - - g_object_set_data ((GObject *) scrolled, "table", table); - - gtk_widget_show (scrolled); - gtk_widget_show (table); - - return scrolled; + account_manager_class = E_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; } static void -em_account_prefs_construct (EMAccountPrefs *prefs) +account_prefs_init (EMAccountPrefs *prefs) { - GtkWidget *toplevel, *widget; - GtkCellRenderer *renderer; - GladeXML *gui; - char *gladefile; - - gladefile = g_build_filename (EVOLUTION_GLADEDIR, - "mail-config.glade", - NULL); - gui = glade_xml_new (gladefile, "accounts_tab", NULL); - g_free (gladefile); - - prefs->gui = gui; + EAccountManager *manager; + EAccountTreeView *tree_view; - /* get our toplevel widget */ - toplevel = glade_xml_get_widget (gui, "toplevel"); + prefs->priv = EM_ACCOUNT_PREFS_GET_PRIVATE (prefs); - /* reparent */ - g_object_ref (toplevel); - gtk_container_remove (GTK_CONTAINER (toplevel->parent), toplevel); - gtk_container_add (GTK_CONTAINER (prefs), toplevel); - g_object_unref (toplevel); + manager = E_ACCOUNT_MANAGER (prefs); + tree_view = e_account_manager_get_tree_view (manager); - widget = glade_xml_get_widget (gui, "etableMailAccounts"); + g_signal_connect ( + tree_view, "enable-account", + G_CALLBACK (account_prefs_enable_account_cb), NULL); - prefs->table = (GtkTreeView *) g_object_get_data ((GObject *) widget, "table"); - - renderer = g_object_get_data ((GObject *) widget, "renderer"); - g_signal_connect (renderer, "toggled", G_CALLBACK (account_able_toggled), prefs); - - prefs->changed = FALSE; - mail_accounts_load (prefs); - prefs->changed = TRUE; - - prefs->mail_add = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountAdd")); - g_signal_connect (prefs->mail_add, "clicked", G_CALLBACK (account_add_clicked), prefs); - - prefs->mail_edit = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountEdit")); - g_signal_connect (prefs->mail_edit, "clicked", G_CALLBACK (account_edit_clicked), prefs); + g_signal_connect ( + tree_view, "disable-account", + G_CALLBACK (account_prefs_disable_account_cb), NULL); +} - prefs->mail_delete = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDelete")); - g_signal_connect (prefs->mail_delete, "clicked", G_CALLBACK (account_delete_clicked), prefs); +GType +em_account_prefs_get_type (void) +{ + static GType type = 0; - prefs->mail_default = GTK_BUTTON (glade_xml_get_widget (gui, "cmdAccountDefault")); - g_signal_connect (prefs->mail_default, "clicked", G_CALLBACK (account_default_clicked), prefs); + if (G_UNLIKELY (type == 0)) { + static const GTypeInfo type_info = { + sizeof (EMAccountPrefsClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) account_prefs_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EMAccountPrefs), + 0, /* n_preallocs */ + (GInstanceInitFunc) account_prefs_init, + NULL /* value_table */ + }; - g_signal_connect (gtk_tree_view_get_selection (prefs->table), - "changed", G_CALLBACK (account_cursor_change), prefs); - g_signal_connect (prefs->table, "row-activated", G_CALLBACK (account_double_click), prefs); + type = g_type_register_static ( + E_TYPE_ACCOUNT_MANAGER, "EMAccountPrefs", + &type_info, 0); + } - account_cursor_change(gtk_tree_view_get_selection(prefs->table), prefs); + return type; } GtkWidget * -em_account_prefs_new (void) +em_account_prefs_new (EAccountList *account_list) { - EMAccountPrefs *new; - - new = (EMAccountPrefs *) g_object_new (em_account_prefs_get_type (), NULL); - em_account_prefs_construct (new); + g_return_val_if_fail (E_IS_ACCOUNT_LIST (account_list), NULL); - return (GtkWidget *) new; + return g_object_new ( + EM_TYPE_ACCOUNT_PREFS, "account-list", account_list, NULL); } diff --git a/mail/em-account-prefs.h b/mail/em-account-prefs.h index c3932aefc9..4c02d716b8 100644 --- a/mail/em-account-prefs.h +++ b/mail/em-account-prefs.h @@ -1,4 +1,5 @@ /* + * em-account-prefs.h * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -14,9 +15,6 @@ * License along with the program; if not, see * * - * Authors: - * Jeffrey Stedfast - * * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) * */ @@ -25,8 +23,9 @@ #define EM_ACCOUNT_PREFS_H #include -#include #include +#include +#include /* Standard GObject macros */ #define EM_TYPE_ACCOUNT_PREFS \ @@ -51,32 +50,19 @@ G_BEGIN_DECLS typedef struct _EMAccountPrefs EMAccountPrefs; typedef struct _EMAccountPrefsClass EMAccountPrefsClass; +typedef struct _EMAccountPrefsPrivate EMAccountPrefsPrivate; struct _EMAccountPrefs { - GtkVBox parent_object; - - GladeXML *gui; - - GtkWidget *druid; - GtkWidget *editor; - - GtkTreeView *table; - - GtkButton *mail_add; - GtkButton *mail_edit; - GtkButton *mail_delete; - GtkButton *mail_default; - - guint destroyed : 1; - guint changed : 1; + EAccountManager parent; + EMAccountPrefsPrivate *priv; }; struct _EMAccountPrefsClass { - GtkVBoxClass parent_class; + EAccountManagerClass parent_class; }; GType em_account_prefs_get_type (void); -GtkWidget * em_account_prefs_new (void); +GtkWidget * em_account_prefs_new (EAccountList *account_list); G_END_DECLS diff --git a/mail/mail-config.glade b/mail/mail-config.glade index 42c691fb82..0124d086a3 100644 --- a/mail/mail-config.glade +++ b/mail/mail-config.glade @@ -1,8 +1,9 @@ - - - + + + + Evolution Account Assistant @@ -12,7 +13,7 @@ True - GNOME_EDGE_START + Edge Start Mail Configuration Welcome to the Evolution Mail Configuration Assistant. @@ -37,6 +38,7 @@ Click "Forward" to begin. False + 0 @@ -64,6 +66,7 @@ Click "Forward" to begin. False + 0 @@ -91,6 +94,7 @@ Click "Forward" to begin. False + 0 @@ -119,6 +123,7 @@ This name will be used for display purposes only. False + 0 @@ -131,7 +136,7 @@ This name will be used for display purposes only. True - GNOME_EDGE_FINISH + Edge Finish Done Congratulations, your mail configuration is complete. @@ -170,6 +175,7 @@ Click "Apply" to save your settings. False False + 0 @@ -183,6 +189,7 @@ Click "Apply" to save your settings. False False + 0 @@ -204,6 +211,7 @@ For example: "Work" or "Personal" False + 0 @@ -215,12 +223,13 @@ For example: "Work" or "Personal" True _Name: True - GTK_JUSTIFY_RIGHT + right management_name False False + 0 @@ -228,7 +237,6 @@ For example: "Work" or "Personal" True True True - * 1 @@ -256,6 +264,7 @@ For example: "Work" or "Personal" False False + 0 @@ -272,6 +281,7 @@ For example: "Work" or "Personal" False False + 0 @@ -285,6 +295,7 @@ For example: "Work" or "Personal" False False + 0 @@ -303,10 +314,9 @@ For example: "Work" or "Personal" True True - * - - + + @@ -349,10 +359,9 @@ For example: "Work" or "Personal" True True - * - - + + @@ -394,6 +403,7 @@ For example: "Work" or "Personal" False False + 0 @@ -407,6 +417,7 @@ For example: "Work" or "Personal" False False + 0 @@ -443,21 +454,22 @@ For example: "Work" or "Personal" False False + 0 + Add Ne_w Signature... True True - Add Ne_w Signature... + False True - 0 False False - GTK_PACK_END + end 1 @@ -475,10 +487,9 @@ For example: "Work" or "Personal" True True - * - - + + @@ -508,10 +519,9 @@ For example: "Work" or "Personal" True True - * - - + + @@ -528,7 +538,7 @@ For example: "Work" or "Personal" 0 Re_ply-To: True - GTK_JUSTIFY_CENTER + center identity_reply_to @@ -540,11 +550,11 @@ For example: "Work" or "Personal" + _Make this my default account True True - _Make this my default account + False True - 0 True @@ -577,11 +587,11 @@ For example: "Work" or "Personal" True Identity True - GTK_JUSTIFY_CENTER + center - tab False + tab @@ -606,7 +616,7 @@ For example: "Work" or "Personal" 0 Server _Type: True - GTK_JUSTIFY_RIGHT + right source_type_dropdown @@ -620,7 +630,7 @@ For example: "Work" or "Personal" 0 0 Description: - GTK_JUSTIFY_CENTER + center 1 @@ -662,6 +672,7 @@ For example: "Work" or "Personal" False False + 0 @@ -688,6 +699,7 @@ For example: "Work" or "Personal" False False + 0 @@ -701,6 +713,7 @@ For example: "Work" or "Personal" False False + 0 @@ -747,7 +760,6 @@ For example: "Work" or "Personal" True True - * 1 @@ -759,7 +771,6 @@ For example: "Work" or "Personal" True True - * 1 @@ -830,6 +841,7 @@ For example: "Work" or "Personal" False False + 0 @@ -843,6 +855,7 @@ For example: "Work" or "Personal" False False + 0 @@ -858,12 +871,13 @@ For example: "Work" or "Personal" True _Use Secure Connection: True - GTK_JUSTIFY_CENTER + center source_use_ssl False False + 0 @@ -881,6 +895,7 @@ For example: "Work" or "Personal" False False + 0 @@ -895,6 +910,7 @@ For example: "Work" or "Personal" False False + 0 @@ -903,7 +919,7 @@ For example: "Work" or "Personal" 0 <b>SSL is not supported in this build of Evolution</b> True - GTK_JUSTIFY_CENTER + center False @@ -949,6 +965,7 @@ For example: "Work" or "Personal" False False + 0 @@ -962,6 +979,7 @@ For example: "Work" or "Personal" False False + 0 @@ -980,15 +998,16 @@ For example: "Work" or "Personal" False False + 0 + Ch_eck for Supported Types True True - Ch_eck for Supported Types + False True - 0 False @@ -997,15 +1016,18 @@ For example: "Work" or "Personal" + + 0 + + Re_member password True True + False Note: you will not be prompted for a password until you connect for the first time - Re_member password True - 0 True @@ -1032,6 +1054,9 @@ For example: "Work" or "Personal" + + 0 + @@ -1043,12 +1068,12 @@ For example: "Work" or "Personal" True Receiving Email True - GTK_JUSTIFY_CENTER + center - tab 1 False + tab @@ -1074,7 +1099,7 @@ For example: "Work" or "Personal" 0 Server _Type: True - GTK_JUSTIFY_RIGHT + right transport_type_dropdown @@ -1088,7 +1113,7 @@ For example: "Work" or "Personal" 0 0 Description: - GTK_JUSTIFY_RIGHT + right 1 @@ -1126,6 +1151,9 @@ For example: "Work" or "Personal" + + 0 + @@ -1154,6 +1182,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1167,6 +1196,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1190,7 +1220,7 @@ For example: "Work" or "Personal" 1 _Server: True - GTK_JUSTIFY_RIGHT + right transport_host @@ -1202,7 +1232,6 @@ For example: "Work" or "Personal" True True - * 1 @@ -1213,15 +1242,16 @@ For example: "Work" or "Personal" False + 0 + Ser_ver requires authentication True True - Ser_ver requires authentication + False True - 0 True @@ -1243,6 +1273,9 @@ For example: "Work" or "Personal" + + 0 + @@ -1258,6 +1291,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1271,6 +1305,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1286,12 +1321,13 @@ For example: "Work" or "Personal" True _Use Secure Connection: True - GTK_JUSTIFY_CENTER + center transport_use_ssl False False + 0 @@ -1306,6 +1342,9 @@ For example: "Work" or "Personal" + + 0 + @@ -1319,6 +1358,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1327,7 +1367,7 @@ For example: "Work" or "Personal" 0 <b>SSL is not supported in this build of Evolution</b> True - GTK_JUSTIFY_CENTER + center False @@ -1369,6 +1409,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1382,6 +1423,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1406,7 +1448,7 @@ For example: "Work" or "Personal" 0 T_ype: True - GTK_JUSTIFY_CENTER + center transport_auth_dropdown @@ -1420,7 +1462,7 @@ For example: "Work" or "Personal" 0 User_name: True - GTK_JUSTIFY_RIGHT + right transport_user @@ -1434,7 +1476,6 @@ For example: "Work" or "Personal" True True - * 1 @@ -1456,15 +1497,16 @@ For example: "Work" or "Personal" False False + 0 + Ch_eck for Supported Types True True - Ch_eck for Supported Types + False True - 0 False @@ -1490,15 +1532,16 @@ For example: "Work" or "Personal" False + 0 + Remember _password True True - Remember _password + False True - 0 True @@ -1533,6 +1576,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1545,12 +1589,12 @@ For example: "Work" or "Personal" True Sending Mail True - GTK_JUSTIFY_CENTER + center - tab 2 False + tab @@ -1572,6 +1616,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1585,6 +1630,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1603,9 +1649,6 @@ For example: "Work" or "Personal" 3 12 6 - - - True @@ -1689,15 +1732,16 @@ For example: "Work" or "Personal" True + gtk-revert-to-saved True True - gtk-revert-to-saved + False True - 0 False False + 0 @@ -1716,7 +1760,13 @@ For example: "Work" or "Personal" 3 + + + + + 0 + @@ -1734,6 +1784,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1750,6 +1801,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1763,6 +1815,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1782,16 +1835,17 @@ For example: "Work" or "Personal" 6 + Alway_s carbon-copy (cc) to: True True - Alway_s carbon-copy (cc) to: + False True - 0 True False False + 0 @@ -1805,6 +1859,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1820,8 +1875,10 @@ For example: "Work" or "Personal" True True - * + + 0 + @@ -1843,16 +1900,17 @@ For example: "Work" or "Personal" 6 + Always _blind carbon-copy (bcc) to: True True - Always _blind carbon-copy (bcc) to: + False True - 0 True False False + 0 @@ -1866,6 +1924,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1881,8 +1940,10 @@ For example: "Work" or "Personal" True True - * + + 0 + @@ -1935,6 +1996,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1948,6 +2010,7 @@ For example: "Work" or "Personal" False False + 0 @@ -1964,6 +2027,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2002,12 +2066,12 @@ For example: "Work" or "Personal" True Defaults True - GTK_JUSTIFY_CENTER + center - tab 3 False + tab @@ -2029,6 +2093,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2042,6 +2107,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2068,13 +2134,13 @@ For example: "Work" or "Personal" False False + 0 True True - * 1 @@ -2084,15 +2150,16 @@ For example: "Work" or "Personal" False False + 0 + Al_ways sign outgoing messages when using this account True True - Al_ways sign outgoing messages when using this account + False True - 0 True @@ -2103,11 +2170,11 @@ For example: "Work" or "Personal" + _Do not sign meeting requests (for Outlook compatibility) True True - _Do not sign meeting requests (for Outlook compatibility) + False True - 0 True @@ -2118,11 +2185,11 @@ For example: "Work" or "Personal" + Always encrypt to _myself when sending encrypted messages True True - Always encrypt to _myself when sending encrypted messages + False True - 0 True True @@ -2134,11 +2201,11 @@ For example: "Work" or "Personal" + Always _trust keys in my keyring when encrypting True True - Always _trust keys in my keyring when encrypting + False True - 0 True @@ -2163,6 +2230,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2179,6 +2247,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2192,6 +2261,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2205,7 +2275,6 @@ For example: "Work" or "Personal" True True - * 1 @@ -2219,7 +2288,6 @@ For example: "Work" or "Personal" True True - * 1 @@ -2231,11 +2299,11 @@ For example: "Work" or "Personal" + Also encrypt to sel_f when sending encrypted messages True True - Also encrypt to sel_f when sending encrypted messages + False True - 0 True @@ -2248,11 +2316,11 @@ For example: "Work" or "Personal" + Encrypt out_going messages (by default) True True - Encrypt out_going messages (by default) + False True - 0 True @@ -2265,11 +2333,11 @@ For example: "Work" or "Personal" + Digitally sign o_utgoing messages (by default) True True - Digitally sign o_utgoing messages (by default) + False True - 0 True @@ -2329,7 +2397,7 @@ For example: "Work" or "Personal" True True - 0 + False True @@ -2347,6 +2415,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2369,13 +2438,14 @@ For example: "Work" or "Personal" False False + 0 True True - 0 + False True @@ -2393,6 +2463,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2436,7 +2507,7 @@ For example: "Work" or "Personal" True True - 0 + False True @@ -2454,6 +2525,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2476,13 +2548,14 @@ For example: "Work" or "Personal" False False + 0 True True - 0 + False True @@ -2500,6 +2573,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2562,131 +2636,12 @@ For example: "Work" or "Personal" True Security True - GTK_JUSTIFY_CENTER + center - tab 4 False - - - - - - - Email Accounts - - - True - 6 - - - True - em_account_prefs_treeview_new - - - - - True - 6 - - - True - 6 - GTK_BUTTONBOX_START - - - True - True - True - gtk-add - True - 0 - - - - - True - False - True - True - 0 - - - True - 0 - 0 - - - True - 2 - - - True - gtk-properties - - - False - False - - - - - True - _Edit - True - - - False - False - 1 - - - - - - - - - 1 - - - - - True - False - True - True - gtk-delete - True - 0 - - - 2 - - - - - 89 - 36 - True - False - True - True - De_fault - True - 0 - - - 3 - - - - - - - False - 1 + tab @@ -2718,6 +2673,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2731,6 +2687,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2744,16 +2701,17 @@ For example: "Work" or "Personal" 6 + _Use the same fonts as other applications True True - _Use the same fonts as other applications + False True - 0 True False False + 0 @@ -2769,7 +2727,7 @@ For example: "Work" or "Personal" 0 S_tandard Font: True - GTK_JUSTIFY_RIGHT + right FontVariable @@ -2781,7 +2739,7 @@ For example: "Work" or "Personal" True True - 0 + False Select HTML fixed width font @@ -2798,7 +2756,7 @@ For example: "Work" or "Personal" True True - 0 + False Select HTML variable width font @@ -2815,7 +2773,7 @@ For example: "Work" or "Personal" 0 Fix_ed width Font: True - GTK_JUSTIFY_RIGHT + right FontFixed @@ -2846,6 +2804,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2862,6 +2821,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2875,6 +2835,7 @@ For example: "Work" or "Personal" False False + 0 @@ -2892,16 +2853,17 @@ For example: "Work" or "Personal" 6 + _Mark messages as read after True True - _Mark messages as read after + False True - 0 True False False + 0 @@ -2912,7 +2874,7 @@ For example: "Work" or "Personal" 1 1 True - GTK_UPDATE_IF_VALID + if-valid False @@ -2924,7 +2886,7 @@ For example: "Work" or "Personal" True seconds - GTK_JUSTIFY_CENTER + center False @@ -2933,6 +2895,9 @@ For example: "Work" or "Personal" + + 0 + @@ -2940,16 +2905,17 @@ For example: "Work" or "Personal" 4 + Do not format messages when text si_ze exceeds True True - Do not format messages when text si_ze exceeds + False True - 0 True False False + 0 @@ -2987,16 +2953,17 @@ For example: "Work" or "Personal" True + _Shrink To / Cc / Bcc headers to True True - _Shrink To / Cc / Bcc headers to + False True - 0 True False False + 0 @@ -3034,11 +3001,11 @@ For example: "Work" or "Personal" + Enable Magic S_pacebar True True - Enable Magic S_pacebar + False True - 0 True @@ -3053,24 +3020,25 @@ For example: "Work" or "Personal" 6 + Highlight _quotations with True True - Highlight _quotations with + False True - 0 True True False False + 0 True True - 0 + False Pick a color @@ -3083,7 +3051,7 @@ For example: "Work" or "Personal" True color - GTK_JUSTIFY_CENTER + center False @@ -3105,19 +3073,20 @@ For example: "Work" or "Personal" True Default character e_ncoding: True - GTK_JUSTIFY_CENTER + center omenuCharset False False + 0 True True - 0 + False False @@ -3136,24 +3105,25 @@ For example: "Work" or "Personal" 6 + Enable Sea_rch Folders True True - Enable Sea_rch Folders + False True - 0 True True False False + 0 True (Note: Requires restart of the application) - GTK_JUSTIFY_CENTER + center False @@ -3199,6 +3169,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3212,6 +3183,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3229,23 +3201,24 @@ For example: "Work" or "Personal" 4 + Empty trash folders on e_xit True True - Empty trash folders on e_xit + False True - 0 True False False + 0 True True - 0 + False False @@ -3254,14 +3227,17 @@ For example: "Work" or "Personal" + + 0 + + Confirm _when expunging a folder True True - Confirm _when expunging a folder + False True - 0 True @@ -3296,11 +3272,11 @@ For example: "Work" or "Personal" True General True - GTK_JUSTIFY_CENTER + center - tab False + tab @@ -3318,6 +3294,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3331,6 +3308,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3339,25 +3317,26 @@ For example: "Work" or "Personal" 6 + _Show image animations True True - _Show image animations + False True - 0 True False False + 0 + _Prompt on sending HTML mail to contacts that do not want them True True - _Prompt on sending HTML mail to contacts that do not want them + False True - 0 True @@ -3394,6 +3373,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3407,6 +3387,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3415,25 +3396,26 @@ For example: "Work" or "Personal" 6 + _Never load images from the Internet True True - _Never load images from the Internet + False True - 0 True False False + 0 + _Load images in messages from contacts True True - _Load images in messages from contacts + False True - 0 True radImagesNever @@ -3445,11 +3427,11 @@ For example: "Work" or "Personal" + _Always load images from the Internet True True - _Always load images from the Internet + False True - 0 True radImagesNever @@ -3490,12 +3472,12 @@ For example: "Work" or "Personal" True HTML Messages True - GTK_JUSTIFY_CENTER + center - tab 1 False + tab @@ -3513,6 +3495,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3537,12 +3520,12 @@ For example: "Work" or "Personal" True Labels True - GTK_JUSTIFY_CENTER + center - tab 2 False + tab @@ -3566,39 +3549,43 @@ For example: "Work" or "Personal" False False + 0 False False + 0 - + True True + _Show the photograph of sender in the message preview True True - _Show the photograph of sender in the message preview + False True - 0 True False False 10 + 0 False False + 0 @@ -3606,17 +3593,18 @@ For example: "Work" or "Personal" True + S_earch for sender photograph only in local address books True True - S_earch for sender photograph only in local address books + False True - 0 True False False 10 + 0 @@ -3637,6 +3625,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3665,6 +3654,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3675,27 +3665,27 @@ For example: "Work" or "Personal" True True - * False False + 0 True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in True True False - Mail Headers Table + Mail Headers Table @@ -3715,25 +3705,26 @@ For example: "Work" or "Personal" 6 + gtk-add True False True - gtk-add + False True - 0 False False + 0 + gtk-remove True True - gtk-remove + False True - 0 False @@ -3765,9 +3756,9 @@ For example: "Work" or "Personal" True - tab 3 False + tab @@ -3788,6 +3779,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3811,6 +3803,7 @@ For example: "Work" or "Personal" False False 6 + 0 @@ -3833,12 +3826,12 @@ For example: "Work" or "Personal" + Check incoming _messages for junk True True + False Checks incoming mail messages to be Junk - Check incoming _messages for junk True - 0 True @@ -3859,6 +3852,7 @@ For example: "Work" or "Personal" False False + 0 @@ -3886,23 +3880,24 @@ For example: "Work" or "Personal" 4 + Delete junk messages on e_xit True True - Delete junk messages on e_xit + False True - 0 True False False + 0 True True - 0 + False False @@ -3920,11 +3915,11 @@ For example: "Work" or "Personal" + Check cu_stom headers for junk True True - Check cu_stom headers for junk + False True - 0 True @@ -3943,9 +3938,9 @@ For example: "Work" or "Personal" True True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in True @@ -3953,31 +3948,41 @@ For example: "Work" or "Personal" + + 0 + True - GTK_BUTTONBOX_SPREAD + spread + gtk-add True True True - gtk-add + False True - 0 + + False + False + 0 + + gtk-remove True True True - gtk-remove + False True - 0 + False + False 1 @@ -3996,11 +4001,11 @@ For example: "Work" or "Personal" + Do not mar_k messages as junk if sender is in my address book True True - Do not mar_k messages as junk if sender is in my address book + False True - 0 True @@ -4013,11 +4018,11 @@ For example: "Work" or "Personal" + _Lookup in local address book only True True - _Lookup in local address book only + False True - 0 True @@ -4039,6 +4044,7 @@ For example: "Work" or "Personal" False + 0 @@ -4068,6 +4074,7 @@ For example: "Work" or "Personal" False False + 0 @@ -4092,9 +4099,9 @@ For example: "Work" or "Personal" True - tab 4 False + tab @@ -4125,6 +4132,7 @@ For example: "Work" or "Personal" False False + 0 @@ -4138,6 +4146,7 @@ For example: "Work" or "Personal" False False + 0 @@ -4151,25 +4160,26 @@ For example: "Work" or "Personal" 8 + Format messages in _HTML True True - Format messages in _HTML + False True - 0 True False False + 0 + Automatically insert _emoticon images True True - Automatically insert _emoticon images + False True - 0 True @@ -4180,11 +4190,11 @@ For example: "Work" or "Personal" + Always request rea_d receipt True True - Always request rea_d receipt + False True - 0 True @@ -4195,11 +4205,11 @@ For example: "Work" or "Personal" + Start _typing at the bottom on replying True True - Start _typing at the bottom on replying + False True - 0 True @@ -4210,11 +4220,11 @@ For example: "Work" or "Personal" + Encode file names in an Outlook/GMail way True True - Encode file names in an Outlook/GMail way + False True - 0 True @@ -4236,7 +4246,7 @@ For example: "Work" or "Personal" 0 _Reply style: True - GTK_JUSTIFY_CENTER + center 1 @@ -4249,7 +4259,7 @@ For example: "Work" or "Personal" True True - 0 + False 1 @@ -4266,7 +4276,7 @@ For example: "Work" or "Personal" 0 _Forward style: True - GTK_JUSTIFY_CENTER + center GTK_FILL @@ -4338,15 +4348,16 @@ Do Not Quote False False + 0 + _Keep Signature above the original message on replying True True - _Keep Signature above the original message on replying + False True - 0 True @@ -4359,6 +4370,9 @@ Do Not Quote + + 0 + @@ -4401,6 +4415,7 @@ Do Not Quote False False + 0 @@ -4414,25 +4429,26 @@ Do Not Quote 6 + _Prompt when sending messages with an empty subject line True True - _Prompt when sending messages with an empty subject line + False True - 0 True False False + 0 + Pr_ompt when sending messages with only Bcc recipients defined True True - Pr_ompt when sending messages with only Bcc recipients defined + False True - 0 True @@ -4459,6 +4475,7 @@ Do Not Quote False False + 0 @@ -4468,11 +4485,11 @@ Do Not Quote True General True - GTK_JUSTIFY_CENTER + center - tab False + tab @@ -4491,11 +4508,11 @@ Do Not Quote <b>Sig_natures</b> True True - listSignatures False False + 0 @@ -4511,6 +4528,9 @@ Do Not Quote + + 0 + @@ -4526,6 +4546,7 @@ Do Not Quote False False + 0 @@ -4539,15 +4560,16 @@ Do Not Quote False False + 0 True False - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in @@ -4580,12 +4602,12 @@ Do Not Quote True Signatures True - GTK_JUSTIFY_CENTER + center - tab 1 False + tab @@ -4609,6 +4631,7 @@ Do Not Quote False False + 0 @@ -4622,6 +4645,7 @@ Do Not Quote False False + 0 @@ -4643,24 +4667,33 @@ Do Not Quote True False - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN + automatic + automatic + in True True False - Languages Table + Languages Table + + 0 + + + 0 + + + 0 + @@ -4674,6 +4707,7 @@ Do Not Quote False + 0 @@ -4694,6 +4728,9 @@ Do Not Quote + + 0 + @@ -4706,6 +4743,9 @@ Do Not Quote + + 0 + @@ -4721,6 +4761,7 @@ Do Not Quote False False + 0 @@ -4734,6 +4775,7 @@ Do Not Quote False False + 0 @@ -4742,16 +4784,17 @@ Do Not Quote 6 + Check spelling while I _type True True - Check spelling while I _type + False True - 0 True False False + 0 @@ -4763,19 +4806,20 @@ Do Not Quote True Color for _misspelled words: True - GTK_JUSTIFY_CENTER + center colorButtonSpellCheckColor False False + 0 True True - 0 + False Pick a color @@ -4816,12 +4860,12 @@ Do Not Quote True Spell Checking True - GTK_JUSTIFY_CENTER + center - tab 2 False + tab @@ -4850,6 +4894,7 @@ Do Not Quote False False + 0 @@ -4863,6 +4908,7 @@ Do Not Quote False False + 0 @@ -4878,7 +4924,7 @@ Do Not Quote 0 V_ariable-width: True - GTK_JUSTIFY_CENTER + center print_variable @@ -4892,7 +4938,7 @@ Do Not Quote 0 Fi_xed-width: True - GTK_JUSTIFY_CENTER + center print_fixed @@ -4906,7 +4952,7 @@ Do Not Quote True True - 0 + False Select HTML fixed width font for printing @@ -4923,7 +4969,7 @@ Do Not Quote True True - 0 + False Select HTML variable width font for printing @@ -4955,7 +5001,7 @@ Do Not Quote - GDK_WINDOW_TYPE_HINT_NORMAL + normal False @@ -4978,8 +5024,11 @@ Do Not Quote True 0 gtk-dialog-info - 6 + 6 + + 0 + @@ -5000,6 +5049,7 @@ for display purposes only. False False + 0 @@ -5015,7 +5065,7 @@ for display purposes only. 0 _Name: True - GTK_JUSTIFY_CENTER + center entry_add_script_name @@ -5029,7 +5079,7 @@ for display purposes only. 0 _Script: True - GTK_JUSTIFY_CENTER + center filechooserbutton_add_script @@ -5043,7 +5093,6 @@ for display purposes only. True True - * 1 @@ -5074,6 +5123,7 @@ for display purposes only. False False + 0 @@ -5084,13 +5134,13 @@ for display purposes only. True - GTK_BUTTONBOX_END + end True True True - 0 + False True @@ -5108,6 +5158,7 @@ for display purposes only. False False + 0 @@ -5127,24 +5178,32 @@ for display purposes only. + + False + False + 0 + + gtk-cancel True True True - gtk-cancel + False True - 0 + False + False 1 False - GTK_PACK_END + end + 0 @@ -5173,6 +5232,9 @@ for display purposes only. <span weight="bold">Proxy Settings</span> True + + 0 + @@ -5181,21 +5243,24 @@ for display purposes only. 8 + _Use system defaults True True - _Use system defaults + False True - 0 True + + 0 + + _Direct connection to the Internet True True - _Direct connection to the Internet + False True - 0 True rdoSysSettings @@ -5205,11 +5270,11 @@ for display purposes only. + _Manual proxy configuration: True True - _Manual proxy configuration: + False True - 0 True rdoSysSettings @@ -5294,7 +5359,6 @@ for display purposes only. True True - * 1 @@ -5306,7 +5370,6 @@ for display purposes only. True True - * 1 @@ -5320,7 +5383,6 @@ for display purposes only. True True - * 1 @@ -5420,7 +5482,6 @@ for display purposes only. True True - * 1 @@ -5433,15 +5494,16 @@ for display purposes only. False + 0 + Use Authe_ntication True True - Use Authe_ntication + False True - 0 True @@ -5492,7 +5554,6 @@ for display purposes only. True True - * 1 @@ -5504,7 +5565,6 @@ for display purposes only. True True False - * 1 @@ -5531,11 +5591,11 @@ for display purposes only. + _Automatic proxy configuration URL: True True - _Automatic proxy configuration URL: + False True - 0 True rdoSysSettings @@ -5551,7 +5611,6 @@ for display purposes only. True True - * @@ -5569,6 +5628,7 @@ for display purposes only. False + 0 @@ -5579,8 +5639,8 @@ for display purposes only. General - tab False + tab diff --git a/mail/mail-dialogs.glade b/mail/mail-dialogs.glade index 1ecf410ed5..19a20fe629 100644 --- a/mail/mail-dialogs.glade +++ b/mail/mail-dialogs.glade @@ -1,1555 +1,933 @@ - - - + - - - - 6 - True - Find in Message - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_CENTER - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-find - True - GTK_RELIEF_NORMAL - True - -3 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 6 - - - - True - False - 12 - - - - True - F_ind: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - search_entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - True - True - 0 - - True - * - False - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - True - Case _sensitive - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - - False - False - GTK_JUSTIFY_CENTER - False - False - 1 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - True - - - - - - 0 - True - True - - - - - - - - 6 - True - Security Information - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 6 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - False - 18 - - - - True - False - 6 - - - - True - <span weight="bold">Digital Signature</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 12 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 1 - 1 - False - 2 - 6 - - - - True - False - 0 - - - - - - - 0 - 1 - 0 - 1 - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - True - False - 6 - - - - True - <span weight="bold">Encryption</span> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 12 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - 1 - 1 - False - 2 - 6 - - - - True - False - 0 - - - - - - - 0 - 1 - 0 - 1 - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - False - False - - - - - - - - - - - Folder Subscriptions - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - 600 - 400 - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-refresh - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - True - True - True - gtk-close - True - GTK_RELIEF_NORMAL - True - -7 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 12 - True - False - 12 - - - - True - False - 12 - - - - True - S_erver: - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - store_menu - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - 0 - - - - - - - True - None Selected - True - - - - - - - - 0 - False - False - - - - - - True - GTK_PROGRESS_LEFT_TO_RIGHT - 0 - 0.10000000149 - - PANGO_ELLIPSIZE_NONE - - - 0 - False - False - GTK_PACK_END - - - - - 0 - False - False - - - - - - True - False - 6 - - - - - - - 0 - True - True - - - - - 0 - True - True - - - - - - - - True - License Agreement - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - True - - - - True - False - 0 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-no - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - GTK_RELIEF_NORMAL - True - -3 - - - - True - 0.5 - 0.5 - 0 - 0 - 0 - 0 - 0 - 0 - - - - True - False - 2 - - - - True - gtk-yes - 4 - 0.5 - 0.5 - 0 - 0 - - - 0 - False - False - - - - - - True - _Accept License - True - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - True - GTK_POLICY_ALWAYS - GTK_POLICY_ALWAYS - GTK_SHADOW_NONE - GTK_CORNER_TOP_LEFT - - - - 500 - 400 - True - True - True - False - True - GTK_JUSTIFY_LEFT - GTK_WRAP_NONE - True - 0 - 0 - 0 - 0 - 0 - 0 - - - - - - 0 - True - True - - - - - - True - True - _Tick this to accept the license agreement - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - 6 - Flag to Follow Up - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 12 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - 0 - - - - - 0 - False - True - GTK_PACK_END - - - - - - 6 - True - False - 12 - - - - True - False - 6 - - - - True - e_create_image_widget - stock_mail-flag-for-followup - 0 - 0 - Wed, 08 Dec 2004 02:35:27 GMT - - - 0 - False - False - - - - - - True - The messages you have selected for follow up are listed below. -Please select a follow up action from the "Flag" menu. - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - 0 - False - False - - - - - - True - GTK_POLICY_AUTOMATIC - GTK_POLICY_AUTOMATIC - GTK_SHADOW_IN - GTK_CORNER_TOP_LEFT - - - - True - True - True - False - False - True - False - False - False - - - - - 0 - True - True - - - - - - True - 3 - 3 - False - 6 - 6 - - - - True - _Flag: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - combo-entry - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 0 - 1 - fill - - - - - - - True - _Due By: - True - False - GTK_JUSTIFY_CENTER - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - 1 - 1 - 2 - fill - - - - - - - True - True - gtk-clear - True - GTK_RELIEF_NORMAL - True - - - 2 - 3 - 0 - 1 - fill - - - - - - - True - False - True - False - True - False - - - - True - True - True - True - 0 - - True - * - False - - - - - - True - GTK_SELECTION_BROWSE - - - - True - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - - - - - - - 1 - 2 - 0 - 1 - - - - - - - True - target_date_new - 0 - 0 - Sat, 09 Feb 2002 00:20:24 GMT - - - 1 - 3 - 1 - 2 - fill - - - - - - True - True - Co_mpleted - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 1 - 3 - 2 - 3 - fill - - - - - - 0 - False - False - - - - - 0 - True - True - - - - - - - - 6 - True - - GTK_WINDOW_TOPLEVEL - GTK_WIN_POS_NONE - False - True - False - True - False - False - GDK_WINDOW_TYPE_HINT_DIALOG - GDK_GRAVITY_NORTH_WEST - True - False - - - - True - False - 6 - - - - True - GTK_BUTTONBOX_END - - - - True - True - True - gtk-cancel - True - GTK_RELIEF_NORMAL - True - -6 - - - - - - True - True - True - gtk-apply - True - GTK_RELIEF_NORMAL - True - 0 - - - - - - True - True - True - gtk-ok - True - GTK_RELIEF_NORMAL - True - -5 - - - - - 0 - False - True - GTK_PACK_END - - - - - - True - False - 6 - - - - True - <b>Search Folder Sources</b> - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - True - False - 0 - - - - True - - False - False - GTK_JUSTIFY_LEFT - False - False - 0.5 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 - - - 0 - False - False - - - - - - 6 - True - False - 6 - - - - True - True - All local folders - True - GTK_RELIEF_NORMAL - True - False - False - True - - - 0 - False - False - - - - - - True - True - All active remote folders - True - GTK_RELIEF_NORMAL - True - False - False - True - local_rb - - - 0 - False - False - - - - - - True - True - All local and active remote folders - True - GTK_RELIEF_NORMAL - True - False - False - True - local_rb - - - 0 - False - False - - - - - - True - True - Specific folders - True - GTK_RELIEF_NORMAL - True - False - False - True - local_rb - - - - 0 - False - False - - - - - - True - False - 6 - - - - True - em_vfolder_editor_sourcelist_new - 0 - 0 - Fri, 13 Dec 2002 00:22:39 GMT - - - 0 - True - True - - - - - - True - False - 1 - - - - True - GTK_BUTTONBOX_DEFAULT_STYLE - 6 - - - - True - True - True - gtk-add - True - GTK_RELIEF_NORMAL - True - - - - - - True - True - True - gtk-remove - True - GTK_RELIEF_NORMAL - True - - - - - 0 - False - False - - - - - 0 - False - False - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 0 - True - True - - - - - 3 - True - True - - - - - - + + + + True + 6 + Security Information + dialog + False + + + True + 6 + + + True + 12 + 18 + + + True + 6 + + + True + 0 + <span weight="bold">Digital Signature</span> + True + + + False + False + 0 + + + + + True + + + True + 12 + + + False + False + 0 + + + + + True + 6 + 2 + + + True + + + + + + + + 1 + + + + + 1 + + + + + False + False + 0 + + + + + True + 6 + + + True + 0 + <span weight="bold">Encryption</span> + True + + + False + False + 0 + + + + + True + + + True + 12 + + + False + False + 0 + + + + + True + 6 + 2 + + + True + + + + + + + + 1 + + + + + 1 + + + + + False + False + 1 + + + + + 1 + + + + + True + end + + + gtk-ok + -5 + True + True + True + False + True + + + False + False + 0 + + + + + False + end + 0 + + + + + + + Folder Subscriptions + 600 + 400 + dialog + False + + + True + + + True + 12 + 12 + + + True + 12 + + + True + S_erver: + True + store_menu + + + False + False + 0 + + + + + True + True + False + + + False + False + 1 + + + + + True + 0.10000000149 + + + False + False + end + 2 + + + + + False + False + 0 + + + + + True + 6 + + + + + + 1 + + + + + 1 + + + + + True + end + + + gtk-refresh + True + True + True + False + True + + + False + False + 0 + + + + + gtk-close + -7 + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + + True + License Agreement + dialog + + + True + + + True + + + True + + + False + False + 0 + + + + + True + True + + + 500 + 400 + True + True + + + + + 1 + + + + + _Tick this to accept the license agreement + True + True + False + True + True + + + False + False + 2 + + + + + 2 + + + + + True + end + + + gtk-no + -6 + True + True + True + False + True + + + False + False + 0 + + + + + -3 + True + True + True + False + + + True + 0 + 0 + + + True + 2 + + + True + gtk-yes + 4 + + + False + False + 0 + + + + + True + _Accept License + True + + + False + False + 1 + + + + + + + + + False + False + 1 + + + + + False + end + 0 + + + + + + + 6 + Flag to Follow Up + dialog + False + + + True + 12 + + + True + 6 + 12 + + + True + 6 + + + True + e_create_image_widget + stock_mail-flag-for-followup + + + False + False + 0 + + + + + True + The messages you have selected for follow up are listed below. +Please select a follow up action from the "Flag" menu. + + + False + False + 1 + + + + + False + False + 0 + + + + + True + False + automatic + automatic + in + + + True + True + + + + + 1 + + + + + True + 3 + 3 + 6 + 6 + + + True + 0 + _Flag: + True + center + combo-entry + + + GTK_FILL + + + + + + True + 0 + _Due By: + True + center + + + 1 + 2 + GTK_FILL + + + + + + gtk-clear + True + True + False + True + + + 2 + 3 + GTK_FILL + + + + + + True + False + + + True + True + + + 0 + + + + + True + browse + + + True + + + + + + + 1 + 2 + + + + + + True + target_date_new + + + 1 + 3 + 1 + 2 + GTK_FILL + + + + + Co_mpleted + True + True + False + True + True + + + 1 + 3 + 2 + 3 + GTK_FILL + + + + + + + + + False + False + 2 + + + + + 1 + + + + + True + end + + + gtk-ok + True + True + True + False + True + + + False + False + 0 + + + + + gtk-cancel + True + True + True + False + True + + + False + False + 1 + + + + + False + end + 0 + + + + + + + True + 6 + dialog + False + + + True + 6 + + + True + 6 + + + True + 0 + <b>Search Folder Sources</b> + True + + + False + False + 0 + + + + + True + + + True + + + + False + False + 0 + + + + + True + 6 + 6 + + + All local folders + True + True + False + True + True + + + False + False + 0 + + + + + All active remote folders + True + True + False + True + True + local_rb + + + False + False + 1 + + + + + All local and active remote folders + True + True + False + True + True + local_rb + + + False + False + 2 + + + + + Specific folders + True + True + False + True + True + local_rb + + + False + False + 3 + + + + + True + 6 + + + True + em_vfolder_editor_sourcelist_new + + + 0 + + + + + True + 1 + + + True + 6 + + + gtk-add + True + True + True + False + True + + + False + False + 0 + + + + + gtk-remove + True + True + True + False + True + + + False + False + 1 + + + + + False + False + 0 + + + + + False + False + 1 + + + + + 4 + + + + + 1 + + + + + 1 + + + + + 3 + 1 + + + + + True + end + + + gtk-cancel + -6 + True + True + True + False + True + + + False + False + 0 + + + + + gtk-apply + True + True + True + False + True + + + False + False + 1 + + + + + gtk-ok + -5 + True + True + True + False + True + + + False + False + 2 + + + + + False + end + 0 + + + + + diff --git a/widgets/misc/Makefile.am b/widgets/misc/Makefile.am index bd2c9f9f36..6067149bb5 100644 --- a/widgets/misc/Makefile.am +++ b/widgets/misc/Makefile.am @@ -28,6 +28,8 @@ glade_DATA = e-send-options.glade widgetsinclude_HEADERS = \ $(pilot_headers) \ e-account-combo-box.h \ + e-account-manager.h \ + e-account-tree-view.h \ e-action-combo-box.h \ e-activity.h \ e-activity-proxy.h \ @@ -90,6 +92,8 @@ libemiscwidgets_la_SOURCES = \ $(widgetsinclude_HEADERS) \ $(pilot_sources) \ e-account-combo-box.c \ + e-account-manager.c \ + e-account-tree-view.c \ e-action-combo-box.c \ e-activity.c \ e-activity-proxy.c \ diff --git a/widgets/misc/e-account-combo-box.c b/widgets/misc/e-account-combo-box.c index 21f30b697c..f9dd3905a7 100644 --- a/widgets/misc/e-account-combo-box.c +++ b/widgets/misc/e-account-combo-box.c @@ -1,4 +1,5 @@ /* + * e-account-combo-box.c * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/widgets/misc/e-account-combo-box.h b/widgets/misc/e-account-combo-box.h index 87f7eb9704..57f2ebe8ba 100644 --- a/widgets/misc/e-account-combo-box.h +++ b/widgets/misc/e-account-combo-box.h @@ -1,4 +1,5 @@ /* + * e-account-combo-box.h * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public diff --git a/widgets/misc/e-account-manager.c b/widgets/misc/e-account-manager.c new file mode 100644 index 0000000000..04e050b71d --- /dev/null +++ b/widgets/misc/e-account-manager.c @@ -0,0 +1,461 @@ +/* + * e-account-manager.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#include "e-account-manager.h" + +#include +#include +#include "e-util/e-binding.h" +#include "e-account-tree-view.h" + +#define E_ACCOUNT_MANAGER_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ACCOUNT_MANAGER, EAccountManagerPrivate)) + +struct _EAccountManagerPrivate { + EAccountList *account_list; + + GtkWidget *tree_view; + GtkWidget *add_button; + GtkWidget *edit_button; + GtkWidget *delete_button; + GtkWidget *default_button; +}; + +enum { + PROP_0, + PROP_ACCOUNT_LIST +}; + +enum { + ADD_ACCOUNT, + EDIT_ACCOUNT, + DELETE_ACCOUNT, + LAST_SIGNAL +}; + +static gpointer parent_class; +static guint signals[LAST_SIGNAL]; + +static void +account_manager_default_clicked_cb (EAccountManager *manager) +{ + EAccountTreeView *tree_view; + EAccountList *account_list; + EAccount *account; + + tree_view = e_account_manager_get_tree_view (manager); + account_list = e_account_manager_get_account_list (manager); + account = e_account_tree_view_get_selected (tree_view); + g_return_if_fail (account != NULL); + + e_account_list_set_default (account_list, account); + + /* This signals the tree view to refresh. */ + e_account_list_change (account_list, account); +} + +static gboolean +account_manager_key_press_event_cb (EAccountManager *manager, + GdkEventKey *event) +{ + if (event->keyval == GDK_Delete) { + e_account_manager_delete_account (manager); + return TRUE; + } + + return FALSE; +} + +static void +account_manager_selection_changed_cb (EAccountManager *manager, + GtkTreeSelection *selection) +{ + EAccountTreeView *tree_view; + EAccountList *account_list; + EAccount *default_account; + EAccount *account; + GtkWidget *add_button; + GtkWidget *edit_button; + GtkWidget *delete_button; + GtkWidget *default_button; + const gchar *url = NULL; + gboolean has_proxies; + gboolean sensitive; + + add_button = manager->priv->add_button; + edit_button = manager->priv->edit_button; + delete_button = manager->priv->delete_button; + default_button = manager->priv->default_button; + + tree_view = e_account_manager_get_tree_view (manager); + account = e_account_tree_view_get_selected (tree_view); + account_list = e_account_tree_view_get_account_list (tree_view); + + if (account != NULL) + url = e_account_get_string (account, E_ACCOUNT_SOURCE_URL); + else + gtk_widget_grab_focus (add_button); + + has_proxies = (url != NULL) && + e_account_list_account_has_proxies (account_list, account); + + /* XXX EAccountList misuses const */ + default_account = (EAccount *) + e_account_list_get_default (account_list); + + sensitive = (account != NULL) && !has_proxies; + gtk_widget_set_sensitive (edit_button, sensitive); + + sensitive = (account != NULL); + gtk_widget_set_sensitive (delete_button, sensitive); + + sensitive = (account != NULL && account != default_account); + gtk_widget_set_sensitive (default_button, sensitive); +} + +static void +account_manager_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ACCOUNT_LIST: + e_account_manager_set_account_list ( + E_ACCOUNT_MANAGER (object), + g_value_get_object (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +account_manager_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ACCOUNT_LIST: + g_value_set_object ( + value, + e_account_manager_get_account_list ( + E_ACCOUNT_MANAGER (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +account_manager_dispose (GObject *object) +{ + EAccountManagerPrivate *priv; + + priv = E_ACCOUNT_MANAGER_GET_PRIVATE (object); + + if (priv->account_list != NULL) { + g_object_unref (priv->account_list); + priv->account_list = NULL; + } + + if (priv->tree_view != NULL) { + g_object_unref (priv->tree_view); + priv->tree_view = NULL; + } + + if (priv->add_button != NULL) { + g_object_unref (priv->add_button); + priv->add_button = NULL; + } + + if (priv->edit_button != NULL) { + g_object_unref (priv->edit_button); + priv->edit_button = NULL; + } + + if (priv->delete_button != NULL) { + g_object_unref (priv->delete_button); + priv->delete_button = NULL; + } + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (parent_class)->dispose (object); +} + +static void +account_manager_class_init (EAccountManagerClass *class) +{ + GObjectClass *object_class; + + parent_class = g_type_class_peek_parent (class); + g_type_class_add_private (class, sizeof (EAccountManagerPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->set_property = account_manager_set_property; + object_class->get_property = account_manager_get_property; + object_class->dispose = account_manager_dispose; + + /* XXX If we moved the account editor to /widgets/misc we + * could handle adding and editing accounts directly. */ + + g_object_class_install_property ( + object_class, + PROP_ACCOUNT_LIST, + g_param_spec_object ( + "account-list", + "Account List", + NULL, + E_TYPE_ACCOUNT_LIST, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); + + signals[ADD_ACCOUNT] = g_signal_new ( + "add-account", + G_OBJECT_CLASS_TYPE (class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (EAccountManagerClass, add_account), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[EDIT_ACCOUNT] = g_signal_new ( + "edit-account", + G_OBJECT_CLASS_TYPE (class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (EAccountManagerClass, edit_account), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[DELETE_ACCOUNT] = g_signal_new ( + "delete-account", + G_OBJECT_CLASS_TYPE (class), + G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (EAccountManagerClass, delete_account), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +account_manager_init (EAccountManager *manager) +{ + GtkTreeSelection *selection; + GtkWidget *container; + GtkWidget *widget; + + manager->priv = E_ACCOUNT_MANAGER_GET_PRIVATE (manager); + + gtk_table_resize (GTK_TABLE (manager), 1, 2); + gtk_table_set_col_spacings (GTK_TABLE (manager), 6); + gtk_table_set_row_spacings (GTK_TABLE (manager), 12); + + container = GTK_WIDGET (manager); + + widget = gtk_scrolled_window_new (NULL, NULL); + gtk_scrolled_window_set_policy ( + GTK_SCROLLED_WINDOW (widget), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type ( + GTK_SCROLLED_WINDOW (widget), GTK_SHADOW_IN); + gtk_table_attach ( + GTK_TABLE (container), widget, 0, 1, 0, 1, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_widget_show (widget); + + container = widget; + + widget = e_account_tree_view_new (); + gtk_container_add (GTK_CONTAINER (container), widget); + manager->priv->tree_view = g_object_ref (widget); + gtk_widget_show (widget); + + e_mutual_binding_new ( + G_OBJECT (manager), "account-list", + G_OBJECT (widget), "account-list"); + + g_signal_connect_swapped ( + widget, "key-press-event", + G_CALLBACK (account_manager_key_press_event_cb), + manager); + + g_signal_connect_swapped ( + widget, "row-activated", + G_CALLBACK (e_account_manager_edit_account), + manager); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)); + + g_signal_connect_swapped ( + selection, "changed", + G_CALLBACK (account_manager_selection_changed_cb), + manager); + + container = GTK_WIDGET (manager); + + widget = gtk_vbutton_box_new (); + gtk_button_box_set_layout ( + GTK_BUTTON_BOX (widget), GTK_BUTTONBOX_START); + gtk_box_set_spacing (GTK_BOX (widget), 6); + gtk_table_attach ( + GTK_TABLE (container), widget, + 1, 2, 0, 2, 0, GTK_FILL, 0, 0); + gtk_widget_show (widget); + + container = widget; + + widget = gtk_button_new_from_stock (GTK_STOCK_ADD); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + manager->priv->add_button = g_object_ref (widget); + gtk_widget_show (widget); + + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (e_account_manager_add_account), manager); + + widget = gtk_button_new_from_stock (GTK_STOCK_EDIT); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + manager->priv->edit_button = g_object_ref (widget); + gtk_widget_show (widget); + + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (e_account_manager_edit_account), manager); + + widget = gtk_button_new_from_stock (GTK_STOCK_DELETE); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + manager->priv->delete_button = g_object_ref (widget); + gtk_widget_show (widget); + + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (e_account_manager_delete_account), manager); + + widget = gtk_button_new_with_mnemonic (_("De_fault")); + gtk_button_set_image ( + GTK_BUTTON (widget), gtk_image_new_from_icon_name ( + "emblem-default", GTK_ICON_SIZE_BUTTON)); + gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0); + manager->priv->default_button = g_object_ref (widget); + gtk_widget_show (widget); + + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (account_manager_default_clicked_cb), manager); +} + +GType +e_account_manager_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) { + static const GTypeInfo type_info = { + sizeof (EAccountManagerClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) account_manager_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_init */ + sizeof (EAccountManager), + 0, /* n_preallocs */ + (GInstanceInitFunc) account_manager_init, + NULL /* value_table */ + }; + + type = g_type_register_static ( + GTK_TYPE_TABLE, "EAccountManager", &type_info, 0); + } + + return type; +} + +GtkWidget * +e_account_manager_new (EAccountList *account_list) +{ + g_return_val_if_fail (E_IS_ACCOUNT_LIST (account_list), NULL); + + return g_object_new ( + E_TYPE_ACCOUNT_MANAGER, + "account-list", account_list, NULL); +} + +void +e_account_manager_add_account (EAccountManager *manager) +{ + g_return_if_fail (E_IS_ACCOUNT_MANAGER (manager)); + + g_signal_emit (manager, signals[ADD_ACCOUNT], 0); +} + +void +e_account_manager_edit_account (EAccountManager *manager) +{ + g_return_if_fail (E_IS_ACCOUNT_MANAGER (manager)); + + g_signal_emit (manager, signals[EDIT_ACCOUNT], 0); +} + +void +e_account_manager_delete_account (EAccountManager *manager) +{ + g_return_if_fail (E_IS_ACCOUNT_MANAGER (manager)); + + g_signal_emit (manager, signals[DELETE_ACCOUNT], 0); +} + +EAccountList * +e_account_manager_get_account_list (EAccountManager *manager) +{ + g_return_val_if_fail (E_IS_ACCOUNT_MANAGER (manager), NULL); + + return manager->priv->account_list; +} + +void +e_account_manager_set_account_list (EAccountManager *manager, + EAccountList *account_list) +{ + g_return_if_fail (E_IS_ACCOUNT_MANAGER (manager)); + + if (account_list != NULL) { + g_return_if_fail (E_IS_ACCOUNT_LIST (account_list)); + g_object_ref (account_list); + } + + if (manager->priv->account_list != NULL) + g_object_unref (manager->priv->account_list); + + manager->priv->account_list = account_list; + + g_object_notify (G_OBJECT (manager), "account-list"); +} + +EAccountTreeView * +e_account_manager_get_tree_view (EAccountManager *manager) +{ + g_return_val_if_fail (E_IS_ACCOUNT_MANAGER (manager), NULL); + + return E_ACCOUNT_TREE_VIEW (manager->priv->tree_view); +} diff --git a/widgets/misc/e-account-manager.h b/widgets/misc/e-account-manager.h new file mode 100644 index 0000000000..c714576357 --- /dev/null +++ b/widgets/misc/e-account-manager.h @@ -0,0 +1,82 @@ +/* + * e-account-manager.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#ifndef E_ACCOUNT_MANAGER_H +#define E_ACCOUNT_MANAGER_H + +#include +#include +#include + +/* Standard GObject macros */ +#define E_TYPE_ACCOUNT_MANAGER \ + (e_account_manager_get_type ()) +#define E_ACCOUNT_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_ACCOUNT_MANAGER, EAccountManager)) +#define E_ACCOUNT_MANAGER_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_ACCOUNT_MANAGER, EAccountManagerClass)) +#define E_IS_ACCOUNT_MANAGER(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_ACCOUNT_MANAGER)) +#define E_IS_ACCOUNT_MANAGER_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_ACCOUNT_MANAGER)) +#define E_ACCOUNT_MANAGER_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_ACCOUNT_MANAGER, EAccountManagerClass)) + +G_BEGIN_DECLS + +typedef struct _EAccountManager EAccountManager; +typedef struct _EAccountManagerClass EAccountManagerClass; +typedef struct _EAccountManagerPrivate EAccountManagerPrivate; + +struct _EAccountManager { + GtkTable parent; + EAccountManagerPrivate *priv; +}; + +struct _EAccountManagerClass { + GtkTableClass parent_class; + + void (*add_account) (EAccountManager *manager); + void (*edit_account) (EAccountManager *manager); + void (*delete_account) (EAccountManager *manager); +}; + +GType e_account_manager_get_type (void); +GtkWidget * e_account_manager_new (EAccountList *account_list); +void e_account_manager_add_account (EAccountManager *manager); +void e_account_manager_edit_account (EAccountManager *manager); +void e_account_manager_delete_account(EAccountManager *manager); +EAccountList * e_account_manager_get_account_list + (EAccountManager *manager); +void e_account_manager_set_account_list + (EAccountManager *manager, + EAccountList *account_list); +EAccountTreeView * + e_account_manager_get_tree_view (EAccountManager *manager); + +G_END_DECLS + +#endif /* E_ACCOUNT_MANAGER_H */ diff --git a/widgets/misc/e-account-tree-view.c b/widgets/misc/e-account-tree-view.c new file mode 100644 index 0000000000..9f2d33a050 --- /dev/null +++ b/widgets/misc/e-account-tree-view.c @@ -0,0 +1,621 @@ +/* + * e-account-tree-view.c + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#include "e-account-tree-view.h" + +#include +#include + +#define E_ACCOUNT_TREE_VIEW_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), E_TYPE_ACCOUNT_TREE_VIEW, EAccountTreeViewPrivate)) + +enum { + COLUMN_ACCOUNT, + COLUMN_DEFAULT, + COLUMN_ENABLED, + COLUMN_NAME, + COLUMN_PROTOCOL +}; + +enum { + PROP_0, + PROP_ACCOUNT_LIST, + PROP_SELECTED +}; + +enum { + ENABLE_ACCOUNT, + DISABLE_ACCOUNT, + REFRESHED, + LAST_SIGNAL +}; + +struct _EAccountTreeViewPrivate { + EAccountList *account_list; + GHashTable *index; +}; + +static gpointer parent_class; +static guint signals[LAST_SIGNAL]; + +static void +account_tree_view_refresh_cb (EAccountList *account_list, + EAccount *account, + EAccountTreeView *tree_view) +{ + GtkListStore *store; + GtkTreeModel *model; + GtkTreeIter tree_iter; + EIterator *account_iter; + EAccount *default_account; + GHashTable *index; + GList *list = NULL; + GList *iter; + + store = gtk_list_store_new ( + 5, E_TYPE_ACCOUNT, G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, + G_TYPE_STRING, G_TYPE_STRING); + model = GTK_TREE_MODEL (store); + index = tree_view->priv->index; + + g_hash_table_remove_all (index); + + if (account_list == NULL) + goto skip; + + /* XXX EAccountList misuses const. */ + default_account = (EAccount *) + e_account_list_get_default (account_list); + + /* Build a list of EAccounts to display. */ + account_iter = e_list_get_iterator (E_LIST (account_list)); + while (e_iterator_is_valid (account_iter)) { + + /* XXX EIterator misuses const. */ + account = (EAccount *) e_iterator_get (account_iter); + list = g_list_prepend (list, account); + e_iterator_next (account_iter); + } + g_object_unref (account_iter); + + list = g_list_reverse (list); + + /* Populate the list store and index. */ + for (iter = list; iter != NULL; iter = iter->next) { + GtkTreeRowReference *reference; + GtkTreePath *path; + CamelURL *url = NULL; + gboolean is_default; + const gchar *protocol; + + account = iter->data; + + /* Skip proxy accounts. */ + if (account->parent_uid != NULL) + continue; + + is_default = (account == default_account); + + if (account->source != NULL && account->source->url != NULL) + url = camel_url_new (account->source->url, NULL); + + if (url != NULL && url->protocol != NULL) + protocol = url->protocol; + else + protocol = _("None"); + + gtk_list_store_append (store, &tree_iter); + gtk_list_store_set ( + store, &tree_iter, + COLUMN_ACCOUNT, account, + COLUMN_DEFAULT, is_default, + COLUMN_ENABLED, account->enabled, + COLUMN_NAME, account->name, + COLUMN_PROTOCOL, protocol, -1); + + path = gtk_tree_model_get_path (model, &tree_iter); + reference = gtk_tree_row_reference_new (model, path); + g_hash_table_insert (index, account, reference); + gtk_tree_path_free (path); + + if (url != NULL) + camel_url_free (url); + } + +skip: + /* Restore the previously selected account. */ + account = e_account_tree_view_get_selected (tree_view); + if (account != NULL) + g_object_ref (account); + gtk_tree_view_set_model (GTK_TREE_VIEW (tree_view), model); + e_account_tree_view_set_selected (tree_view, account); + if (account != NULL) + g_object_unref (account); + + g_signal_emit (tree_view, signals[REFRESHED], 0); +} + +static void +account_tree_view_enabled_toggled_cb (EAccountTreeView *tree_view, + gchar *path_string, + GtkCellRendererToggle *renderer) +{ + /* Change the selection first so we enable or disable the + * correct account. */ + + if (gtk_cell_renderer_toggle_get_active (renderer)) + e_account_tree_view_disable_account (tree_view); + else + e_account_tree_view_enable_account (tree_view); +} + +static void +account_tree_view_selection_changed_cb (EAccountTreeView *tree_view) +{ + g_object_notify (G_OBJECT (tree_view), "selected"); +} + +static GObject * +account_tree_view_constructor (GType type, + guint n_construct_properties, + GObjectConstructParam *construct_properties) +{ + GObject *object; + GtkTreeView *tree_view; + GtkTreeViewColumn *column; + GtkCellRenderer *renderer; + + /* Chain up to parent's constructor() method. */ + object = G_OBJECT_CLASS (parent_class)->constructor ( + type, n_construct_properties, construct_properties); + + tree_view = GTK_TREE_VIEW (object); + gtk_tree_view_set_headers_visible (tree_view, TRUE); + + /* Column: Enabled */ + + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_expand (column, FALSE); + gtk_tree_view_column_set_title (column, _("Enabled")); + + renderer = gtk_cell_renderer_toggle_new (); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + + g_signal_connect_swapped ( + renderer, "toggled", + G_CALLBACK (account_tree_view_enabled_toggled_cb), + tree_view); + + gtk_tree_view_column_add_attribute ( + column, renderer, "active", COLUMN_ENABLED); + + gtk_tree_view_append_column (tree_view, column); + + /* Column: Account Name */ + + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_expand (column, TRUE); + gtk_tree_view_column_set_title (column, _("Account Name")); + + renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, NULL); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + + gtk_tree_view_column_add_attribute ( + column, renderer, "text", COLUMN_NAME); + + renderer = gtk_cell_renderer_text_new (); + g_object_set (renderer, "text", _("Default"), NULL); + gtk_tree_view_column_pack_end (column, renderer, FALSE); + + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_DEFAULT); + + renderer = gtk_cell_renderer_pixbuf_new (); + g_object_set ( + renderer, "icon-name", "emblem-default", + "stock-size", GTK_ICON_SIZE_MENU, NULL); + gtk_tree_view_column_pack_end (column, renderer, FALSE); + + gtk_tree_view_column_add_attribute ( + column, renderer, "visible", COLUMN_DEFAULT); + + gtk_tree_view_append_column (tree_view, column); + + /* Column: Protocol */ + + column = gtk_tree_view_column_new (); + gtk_tree_view_column_set_expand (column, FALSE); + gtk_tree_view_column_set_title (column, _("Protocol")); + + renderer = gtk_cell_renderer_text_new (); + gtk_tree_view_column_pack_start (column, renderer, TRUE); + + gtk_tree_view_column_add_attribute ( + column, renderer, "text", COLUMN_PROTOCOL); + + gtk_tree_view_append_column (tree_view, column); + + return object; +} + +static void +account_tree_view_set_property (GObject *object, + guint property_id, + const GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ACCOUNT_LIST: + e_account_tree_view_set_account_list ( + E_ACCOUNT_TREE_VIEW (object), + g_value_get_object (value)); + return; + + case PROP_SELECTED: + e_account_tree_view_set_selected ( + E_ACCOUNT_TREE_VIEW (object), + g_value_get_object (value)); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +account_tree_view_get_property (GObject *object, + guint property_id, + GValue *value, + GParamSpec *pspec) +{ + switch (property_id) { + case PROP_ACCOUNT_LIST: + g_value_set_object ( + value, + e_account_tree_view_get_account_list ( + E_ACCOUNT_TREE_VIEW (object))); + return; + + case PROP_SELECTED: + g_value_set_object ( + value, + e_account_tree_view_get_selected ( + E_ACCOUNT_TREE_VIEW (object))); + return; + } + + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); +} + +static void +account_tree_view_dispose (GObject *object) +{ + EAccountTreeViewPrivate *priv; + + priv = E_ACCOUNT_TREE_VIEW_GET_PRIVATE (object); + + if (priv->account_list != NULL) { + g_signal_handlers_disconnect_by_func ( + priv->account_list, + account_tree_view_refresh_cb, object); + g_object_unref (priv->account_list); + priv->account_list = NULL; + } + + g_hash_table_remove_all (priv->index); + + /* Chain up to parent's dispose() method. */ + G_OBJECT_CLASS (parent_class)->dispose (object); +} + +static void +account_tree_view_finalize (GObject *object) +{ + EAccountTreeViewPrivate *priv; + + priv = E_ACCOUNT_TREE_VIEW_GET_PRIVATE (object); + + g_hash_table_destroy (priv->index); + + /* Chain up to parent's finalize() method. */ + G_OBJECT_CLASS (parent_class)->finalize (object); +} + +static void +account_tree_view_enable_account (EAccountTreeView *tree_view) +{ + EAccountList *account_list; + EAccount *account; + + account = e_account_tree_view_get_selected (tree_view); + if (account == NULL || account->enabled) + return; + + account_list = e_account_tree_view_get_account_list (tree_view); + g_return_if_fail (account_list != NULL); + + account->enabled = TRUE; + e_account_list_change (account_list, account); +} + +static void +account_tree_view_disable_account (EAccountTreeView *tree_view) +{ + EAccountList *account_list; + EAccount *account; + + account = e_account_tree_view_get_selected (tree_view); + if (account == NULL || !account->enabled) + return; + + account_list = e_account_tree_view_get_account_list (tree_view); + g_return_if_fail (account_list != NULL); + + account->enabled = FALSE; + e_account_list_change (account_list, account); +} + +static void +account_tree_view_class_init (EAccountTreeViewClass *class) +{ + GObjectClass *object_class; + + parent_class = g_type_class_peek_parent (class); + g_type_class_add_private (class, sizeof (EAccountTreeViewPrivate)); + + object_class = G_OBJECT_CLASS (class); + object_class->constructor = account_tree_view_constructor; + object_class->set_property = account_tree_view_set_property; + object_class->get_property = account_tree_view_get_property; + object_class->dispose = account_tree_view_dispose; + object_class->finalize = account_tree_view_finalize; + + class->enable_account = account_tree_view_enable_account; + class->disable_account = account_tree_view_disable_account; + + g_object_class_install_property ( + object_class, + PROP_SELECTED, + g_param_spec_object ( + "selected", + "Selected Account", + NULL, + E_TYPE_ACCOUNT, + G_PARAM_READWRITE)); + + g_object_class_install_property ( + object_class, + PROP_ACCOUNT_LIST, + g_param_spec_object ( + "account-list", + "Account List", + NULL, + E_TYPE_ACCOUNT_LIST, + G_PARAM_READWRITE | + G_PARAM_CONSTRUCT)); + + signals[ENABLE_ACCOUNT] = g_signal_new ( + "enable-account", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAccountTreeViewClass, enable_account), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[DISABLE_ACCOUNT] = g_signal_new ( + "disable-account", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAccountTreeViewClass, disable_account), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[REFRESHED] = g_signal_new ( + "refreshed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (EAccountTreeViewClass, refreshed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); +} + +static void +account_tree_view_init (EAccountTreeView *tree_view) +{ + GHashTable *index; + GtkTreeSelection *selection; + + /* Reverse-lookup index */ + index = g_hash_table_new_full ( + g_direct_hash, g_direct_equal, + (GDestroyNotify) g_object_unref, + (GDestroyNotify) gtk_tree_row_reference_free); + + tree_view->priv = E_ACCOUNT_TREE_VIEW_GET_PRIVATE (tree_view); + tree_view->priv->index = index; + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + + g_signal_connect_swapped ( + selection, "changed", + G_CALLBACK (account_tree_view_selection_changed_cb), + tree_view); +} + +GType +e_account_tree_view_get_type (void) +{ + static GType type = 0; + + if (G_UNLIKELY (type == 0)) { + static const GTypeInfo type_info = { + sizeof (EAccountTreeViewClass), + (GBaseInitFunc) NULL, + (GBaseFinalizeFunc) NULL, + (GClassInitFunc) account_tree_view_class_init, + (GClassFinalizeFunc) NULL, + NULL, /* class_data */ + sizeof (EAccountTreeView), + 0, /* n_preallocs */ + (GInstanceInitFunc) account_tree_view_init, + NULL /* value_table */ + }; + + type = g_type_register_static ( + GTK_TYPE_TREE_VIEW, "EAccountTreeView", + &type_info, 0); + } + + return type; +} + +GtkWidget * +e_account_tree_view_new (void) +{ + return g_object_new (E_TYPE_ACCOUNT_TREE_VIEW, NULL); +} + +void +e_account_tree_view_enable_account (EAccountTreeView *tree_view) +{ + g_return_if_fail (E_IS_ACCOUNT_TREE_VIEW (tree_view)); + + g_signal_emit (tree_view, signals[ENABLE_ACCOUNT], 0); +} + +void +e_account_tree_view_disable_account (EAccountTreeView *tree_view) +{ + g_return_if_fail (E_IS_ACCOUNT_TREE_VIEW (tree_view)); + + g_signal_emit (tree_view, signals[DISABLE_ACCOUNT], 0); +} + +EAccountList * +e_account_tree_view_get_account_list (EAccountTreeView *tree_view) +{ + g_return_val_if_fail (E_IS_ACCOUNT_TREE_VIEW (tree_view), NULL); + + return tree_view->priv->account_list; +} + +void +e_account_tree_view_set_account_list (EAccountTreeView *tree_view, + EAccountList *account_list) +{ + EAccountTreeViewPrivate *priv; + + g_return_if_fail (E_IS_ACCOUNT_TREE_VIEW (tree_view)); + + if (account_list != NULL) + g_return_if_fail (E_IS_ACCOUNT_LIST (account_list)); + + priv = E_ACCOUNT_TREE_VIEW_GET_PRIVATE (tree_view); + + if (priv->account_list != NULL) { + g_signal_handlers_disconnect_by_func ( + priv->account_list, + account_tree_view_refresh_cb, tree_view); + g_object_unref (priv->account_list); + priv->account_list = NULL; + } + + if (account_list != NULL) { + priv->account_list = g_object_ref (account_list); + + /* Listen for changes to the account list. */ + g_signal_connect ( + priv->account_list, "account-added", + G_CALLBACK (account_tree_view_refresh_cb), + tree_view); + g_signal_connect ( + priv->account_list, "account-changed", + G_CALLBACK (account_tree_view_refresh_cb), + tree_view); + g_signal_connect ( + priv->account_list, "account-removed", + G_CALLBACK (account_tree_view_refresh_cb), + tree_view); + } + + account_tree_view_refresh_cb (account_list, NULL, tree_view); + + g_object_notify (G_OBJECT (tree_view), "account-list"); +} + +EAccount * +e_account_tree_view_get_selected (EAccountTreeView *tree_view) +{ + EAccount *account; + GtkTreeSelection *selection; + GtkTreeModel *model; + GtkTreeIter iter; + + g_return_val_if_fail (E_IS_ACCOUNT_TREE_VIEW (tree_view), NULL); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + if (!gtk_tree_selection_get_selected (selection, &model, &iter)) + return NULL; + + gtk_tree_model_get (model, &iter, COLUMN_ACCOUNT, &account, -1); + + return account; +} + +gboolean +e_account_tree_view_set_selected (EAccountTreeView *tree_view, + EAccount *account) +{ + GtkTreeRowReference *reference; + GtkTreeSelection *selection; + GtkTreePath *path; + + g_return_val_if_fail (E_IS_ACCOUNT_TREE_VIEW (tree_view), FALSE); + + if (account != NULL) + g_return_val_if_fail (E_IS_ACCOUNT (account), FALSE); + + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (tree_view)); + + /* NULL means clear the selection. */ + if (account == NULL) { + gtk_tree_selection_unselect_all (selection); + return TRUE; + } + + /* Lookup the tree row reference for the account. */ + reference = g_hash_table_lookup (tree_view->priv->index, account); + if (reference == NULL) + return FALSE; + + /* Select the referenced path. */ + path = gtk_tree_row_reference_get_path (reference); + gtk_tree_selection_select_path (selection, path); + gtk_tree_path_free (path); + + g_object_notify (G_OBJECT (tree_view), "selected"); + + return TRUE; +} diff --git a/widgets/misc/e-account-tree-view.h b/widgets/misc/e-account-tree-view.h new file mode 100644 index 0000000000..9d86a8f803 --- /dev/null +++ b/widgets/misc/e-account-tree-view.h @@ -0,0 +1,84 @@ +/* + * e-account-tree-view.h + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * + */ + +#ifndef E_ACCOUNT_TREE_VIEW_H +#define E_ACCOUNT_TREE_VIEW_H + +#include +#include +#include + +/* Standard GObject macros */ +#define E_TYPE_ACCOUNT_TREE_VIEW \ + (e_account_tree_view_get_type ()) +#define E_ACCOUNT_TREE_VIEW(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_ACCOUNT_TREE_VIEW, EAccountTreeView)) +#define E_ACCOUNT_TREE_VIEW_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_ACCOUNT_TREE_VIEW, EAccountTreeViewClass)) +#define E_IS_ACCOUNT_TREE_VIEW(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_ACCOUNT_TREE_VIEW)) +#define E_IS_ACCOUNT_TREE_VIEW_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((cls), E_TYPE_ACCOUNT_TREE_VIEW)) +#define E_ACCOUNT_TREE_VIEW_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_ACCOUNT_TREE_VIEW, EAccountTreeViewClass)) + +G_BEGIN_DECLS + +typedef struct _EAccountTreeView EAccountTreeView; +typedef struct _EAccountTreeViewClass EAccountTreeViewClass; +typedef struct _EAccountTreeViewPrivate EAccountTreeViewPrivate; + +struct _EAccountTreeView { + GtkTreeView parent; + EAccountTreeViewPrivate *priv; +}; + +struct _EAccountTreeViewClass { + GtkTreeViewClass parent_class; + + void (*enable_account) (EAccountTreeView *tree_view); + void (*disable_account) (EAccountTreeView *tree_view); + void (*refreshed) (EAccountTreeView *tree_view); +}; + +GType e_account_tree_view_get_type (void); +GtkWidget * e_account_tree_view_new (void); +void e_account_tree_view_enable_account + (EAccountTreeView *tree_view); +void e_account_tree_view_disable_account + (EAccountTreeView *tree_view); +EAccountList * e_account_tree_view_get_account_list + (EAccountTreeView *tree_view); +void e_account_tree_view_set_account_list + (EAccountTreeView *tree_view, + EAccountList *account_list); +EAccount * e_account_tree_view_get_selected(EAccountTreeView *tree_view); +gboolean e_account_tree_view_set_selected(EAccountTreeView *tree_view, + EAccount *account); + +G_END_DECLS + +#endif /* E_ACCOUNT_TREE_VIEW_H */ diff --git a/widgets/misc/e-signature-manager.c b/widgets/misc/e-signature-manager.c index 0c145e9821..a602710fd3 100644 --- a/widgets/misc/e-signature-manager.c +++ b/widgets/misc/e-signature-manager.c @@ -143,21 +143,21 @@ static void signature_manager_selection_changed_cb (ESignatureManager *manager, GtkTreeSelection *selection) { + ESignatureTreeView *tree_view; + ESignature *signature; GtkWidget *edit_button; GtkWidget *remove_button; - GtkTreeModel *model; - GtkTreeIter iter; + gboolean sensitive; edit_button = manager->priv->edit_button; remove_button = manager->priv->remove_button; - if (gtk_tree_selection_get_selected (selection, &model, &iter)) { - gtk_widget_set_sensitive (edit_button, TRUE); - gtk_widget_set_sensitive (remove_button, TRUE); - } else { - gtk_widget_set_sensitive (edit_button, FALSE); - gtk_widget_set_sensitive (remove_button, FALSE); - } + tree_view = e_signature_manager_get_tree_view (manager); + signature = e_signature_tree_view_get_selected (tree_view); + sensitive = (signature != NULL); + + gtk_widget_set_sensitive (edit_button, sensitive); + gtk_widget_set_sensitive (remove_button, sensitive); } static void diff --git a/widgets/misc/e-signature-manager.h b/widgets/misc/e-signature-manager.h index 6c182badab..f00ad143ec 100644 --- a/widgets/misc/e-signature-manager.h +++ b/widgets/misc/e-signature-manager.h @@ -24,8 +24,8 @@ #include #include -#include -#include +#include +#include /* Standard GObject macros */ #define E_TYPE_SIGNATURE_MANAGER \ -- cgit v1.2.3