aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Makefile.am5
-rw-r--r--capplet/.gitignore24
-rw-r--r--capplet/Makefile.am67
-rw-r--r--capplet/anjal-settings-main.c196
-rw-r--r--capplet/settings/Makefile.am68
-rw-r--r--capplet/settings/anjal-mail-view.c80
-rw-r--r--capplet/settings/anjal-mail-view.h58
-rw-r--r--capplet/settings/mail-account-view.c1177
-rw-r--r--capplet/settings/mail-account-view.h93
-rw-r--r--capplet/settings/mail-capplet-shell.c302
-rw-r--r--capplet/settings/mail-capplet-shell.h59
-rw-r--r--capplet/settings/mail-settings-view.c297
-rw-r--r--capplet/settings/mail-settings-view.h59
-rw-r--r--capplet/settings/mail-view.c656
-rw-r--r--capplet/settings/mail-view.h87
-rw-r--r--configure.ac16
-rw-r--r--data/Makefile.am6
-rw-r--r--modules/mail/Makefile.am5
-rw-r--r--modules/mail/e-mail-shell-backend.c17
-rw-r--r--modules/startup-wizard/Makefile.am5
-rw-r--r--modules/startup-wizard/evolution-startup-wizard.c17
-rw-r--r--po/POTFILES.in6
22 files changed, 1 insertions, 3299 deletions
diff --git a/Makefile.am b/Makefile.am
index 13724725f0..015fcf5fe4 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -39,10 +39,6 @@ if ENABLE_SMIME
SMIME_SUBDIR=smime
endif
-if WITH_CAPPLET
-CAPPLET_SUBDIR=capplet
-endif
-
if WITH_HELP
HELP_SUBDIR=help
endif
@@ -71,7 +67,6 @@ SUBDIRS = \
composer \
mail \
calendar \
- $(CAPPLET_SUBDIR) \
art \
plugins \
modules \
diff --git a/capplet/.gitignore b/capplet/.gitignore
deleted file mode 100644
index d0925c275f..0000000000
--- a/capplet/.gitignore
+++ /dev/null
@@ -1,24 +0,0 @@
-/*.bak
-/*.lo
-/*.o
-/*.orig
-/*.rej
-/*.tab.c
-/*~
-/.*.sw[nop]
-/.deps
-/.dirstamp
-/.gitignore
-/.libs
-/GPATH
-/GRTAGS
-/GSYMS
-/GTAGS
-/ID
-/Makefile
-/Makefile.in
-/TAGS
-/_libs
-/evolution-settings
-/so_locations
-/tags
diff --git a/capplet/Makefile.am b/capplet/Makefile.am
deleted file mode 100644
index c339a63853..0000000000
--- a/capplet/Makefile.am
+++ /dev/null
@@ -1,67 +0,0 @@
-SUBDIRS = settings
-
-bin_PROGRAMS = evolution-settings
-
-evolution_settings_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -I$(top_srcdir)/widgets \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_srcdir) \
- -I$(top_srcdir)/em-format \
- -I$(top_srcdir)/mail \
- -I$(top_srcdir)/composer \
- -I$(top_builddir)/composer \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -I$(top_srcdir)/smime/lib \
- -I$(top_srcdir)/smime/gui \
- $(EVOLUTION_DATA_SERVER_CFLAGS) \
- $(GNOME_PLATFORM_CFLAGS) \
- $(CERT_UI_CFLAGS) \
- $(CANBERRA_CFLAGS) \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_ICONSDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \
- -DEVOLUTION_MODULEDIR=\""$(moduledir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -DEVOLUTION_BUTTONSDIR=\""$(buttonsdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_UIDIR=\""$(uidir)"\" \
- -DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"evolution-mail\" \
- -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -DPACKAGE_DATA_DIR=\""$(datadir)"\"
-
-evolution_settings_SOURCES = \
- anjal-settings-main.c
-
-if OS_WIN32
-evolution_settings_LDFLAGS = -mwindows
-endif
-
-evolution_settings_LDADD = \
- $(EVOLUTION_DATA_SERVER_LIBS) \
- $(GNOME_PLATFORM_LIBS) \
- $(CERT_UI_LIBS) \
- $(CANBERRA_LIBS) \
- $(GTKHTML_LIBS) \
- $(SMIME_LIBS) \
- $(top_builddir)/libemail-engine/libemail-engine.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/widgets/table/libetable.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/mail/libevolution-mail.la \
- $(top_builddir)/capplet/settings/libevolution-mail-settings.la \
- $(top_builddir)/addressbook/gui/contact-editor/libecontacteditor.la \
- $(top_builddir)/addressbook/gui/contact-list-editor/libecontactlisteditor.la \
- $(top_builddir)/addressbook/util/libeabutil.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/composer/libcomposer.la \
- $(top_builddir)/em-format/libemformat.la \
- $(top_builddir)/libemail-utils/libemail-utils.la
-
--include $(top_srcdir)/git.mk
diff --git a/capplet/anjal-settings-main.c b/capplet/anjal-settings-main.c
deleted file mode 100644
index be287fbae8..0000000000
--- a/capplet/anjal-settings-main.c
+++ /dev/null
@@ -1,196 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Intel Corporation (www.intel.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <locale.h>
-#include <unistd.h>
-#include <string.h>
-#include <stdio.h>
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <libedataserverui/e-passwords.h>
-#include <libemail-utils/mail-mt.h>
-#include "settings/mail-capplet-shell.h"
-#include <libedataserver/e-categories.h>
-#include "e-util/e-plugin.h"
-#include "e-util/e-plugin-ui.h"
-#include "shell/es-event.h"
-#include "shell/e-shell-meego.h"
-#include "e-util/e-import.h"
-
-#ifdef G_OS_WIN32
-#define WIN32_LEAN_AND_MEAN
-#ifdef DATADIR
-#undef DATADIR
-#endif
-#define _WIN32_WINNT 0x0601
-#include <windows.h>
-#include <conio.h>
-#include <io.h>
-#ifndef PROCESS_DEP_ENABLE
-#define PROCESS_DEP_ENABLE 0x00000001
-#endif
-#ifndef PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION
-#define PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION 0x00000002
-#endif
-#endif
-
-guint32 socket_id = 0;
-GtkWidget *main_window;
-static gchar **remaining_args;
-
-static void
-categories_icon_theme_hack (void)
-{
- GtkIconTheme *icon_theme;
- const gchar *category_name;
- const gchar *filename;
- gchar *dirname;
-
- /* XXX Allow the category icons to be referenced as named
- * icons, since GtkAction does not support GdkPixbufs. */
-
- /* Get the icon file for some default category. Doesn't matter
- * which, so long as it has an icon. We're just interested in
- * the directory components. */
- category_name = _("Birthday");
- filename = e_categories_get_icon_file_for (category_name);
- g_return_if_fail (filename != NULL && *filename != '\0');
-
- /* Extract the directory components. */
- dirname = g_path_get_dirname (filename);
-
- /* Add it to the icon theme's search path. This relies on
- * GtkIconTheme's legacy feature of using image files found
- * directly in the search path. */
- icon_theme = gtk_icon_theme_get_default ();
- gtk_icon_theme_append_search_path (icon_theme, dirname);
-
- g_free (dirname);
-}
-
-static EShell *
-create_default_shell (void)
-{
- main_window = mail_capplet_shell_new (socket_id, FALSE, TRUE);
- if (!socket_id)
- gtk_widget_show (main_window);
-
- return e_shell_get_default ();
-}
-
-gint
-main (gint argc,
- gchar *argv[])
-{
- GError *error = NULL;
- EShell *shell;
-
-#ifdef G_OS_WIN32
- /* Reduce risks */
- {
- typedef BOOL (WINAPI *t_SetDllDirectoryA) (LPCSTR lpPathName);
- t_SetDllDirectoryA p_SetDllDirectoryA;
-
- p_SetDllDirectoryA = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetDllDirectoryA");
- if (p_SetDllDirectoryA)
- (*p_SetDllDirectoryA) ("");
- }
-#ifndef _WIN64
- {
- typedef BOOL (WINAPI *t_SetProcessDEPPolicy) (DWORD dwFlags);
- t_SetProcessDEPPolicy p_SetProcessDEPPolicy;
-
- p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy");
- if (p_SetProcessDEPPolicy)
- (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION);
- }
-#endif
-
- if (fileno (stdout) != -1 && _get_osfhandle (fileno (stdout)) != -1) {
- /* stdout is fine, presumably redirected to a file or pipe */
- } else {
- typedef BOOL (* WINAPI AttachConsole_t) (DWORD);
-
- AttachConsole_t p_AttachConsole =
- (AttachConsole_t) GetProcAddress (GetModuleHandle ("kernel32.dll"), "AttachConsole");
-
- if (p_AttachConsole && p_AttachConsole (ATTACH_PARENT_PROCESS)) {
- freopen ("CONOUT$", "w", stdout);
- dup2 (fileno (stdout), 1);
- freopen ("CONOUT$", "w", stderr);
- dup2 (fileno (stderr), 2);
- }
- }
-#endif
-
- static GOptionEntry entries[] = {
- { "socket",
- 's',
- G_OPTION_FLAG_IN_MAIN,
- G_OPTION_ARG_INT,
- &socket_id,
- /* TRANSLATORS: don't translate the terms in brackets */
- N_("ID of the socket to embed in"),
- N_("socket") },
- { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, NULL },
- { NULL, 0, 0, 0, NULL, NULL, NULL }
- };
-
-#ifdef ENABLE_NLS
- bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
- bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
- textdomain (GETTEXT_PACKAGE);
-#endif
-
- setlocale (LC_ALL, NULL);
-
- if (!gtk_init_with_args (&argc, &argv, NULL, entries, NULL, &error))
- g_error ("%s", error->message);
-
- e_passwords_init ();
- categories_icon_theme_hack ();
-
- shell = create_default_shell ();
- e_shell_load_modules (shell);
-
- /* Register built-in plugin hook types. */
- es_event_hook_get_type ();
- e_import_hook_get_type ();
- e_plugin_ui_hook_get_type ();
-
- /* All EPlugin and EPluginHook subclasses should be
- * registered in GType now, so load plugins now. */
- e_plugin_load_plugins ();
-
- gtk_main ();
-
- return 0;
-}
diff --git a/capplet/settings/Makefile.am b/capplet/settings/Makefile.am
deleted file mode 100644
index 51975da697..0000000000
--- a/capplet/settings/Makefile.am
+++ /dev/null
@@ -1,68 +0,0 @@
-privsolib_LTLIBRARIES = libevolution-mail-settings.la
-
-libevolution_mail_settings_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -I$(top_srcdir)/widgets \
- -I$(top_srcdir)/widgets/misc \
- -I$(top_srcdir) \
- -I$(top_srcdir)/e-util \
- -I$(top_srcdir)/em-format \
- -I$(top_srcdir)/mail \
- -I$(top_srcdir)/composer \
- -I$(top_builddir)/composer \
- -I$(top_builddir)/shell \
- -I$(top_srcdir)/shell \
- -I$(top_srcdir)/smime/lib \
- -I$(top_srcdir)/smime/gui \
- $(EVOLUTION_DATA_SERVER_CFLAGS) \
- $(GNOME_PLATFORM_CFLAGS) \
- $(CERT_UI_CFLAGS) \
- $(CANBERRA_CFLAGS) \
- $(GTKHTML_CFLAGS) \
- -DANJAL_SETTINGS \
- -DEVOLUTION_DATADIR=\""$(datadir)"\" \
- -DEVOLUTION_PRIVDATADIR=\""$(privdatadir)"\" \
- -DEVOLUTION_ETSPECDIR=\""$(etspecdir)"\" \
- -DEVOLUTION_ICONSDIR=\""$(imagesdir)"\" \
- -DEVOLUTION_MODULEDIR=\""$(moduledir)"\" \
- -DEVOLUTION_IMAGES=\""$(imagesdir)"\" \
- -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \
- -DEVOLUTION_BUTTONSDIR=\""$(buttonsdir)"\" \
- -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \
- -DEVOLUTION_UIDIR=\""$(uidir)"\" \
- -DCAMEL_PROVIDERDIR=\""$(camel_providerdir)"\" \
- -DPREFIX=\""$(prefix)"\" \
- -DG_LOG_DOMAIN=\"evolution-mail\" \
- -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
- -DPACKAGE_DATA_DIR=\""$(datadir)"\"
-
-libevolution_mail_settings_la_SOURCES = \
- mail-settings-view.c \
- mail-settings-view.h \
- mail-account-view.c \
- mail-account-view.h \
- mail-view.c \
- mail-view.h \
- mail-capplet-shell.c \
- mail-capplet-shell.h \
- anjal-mail-view.h \
- anjal-mail-view.c
-
-libevolution_mail_settings_la_LIBADD = \
- $(EVOLUTION_DATA_SERVER_LIBS) \
- $(GNOME_PLATFORM_LIBS) \
- $(CERT_UI_LIBS) \
- $(CANBERRA_LIBS) \
- $(GTKHTML_LIBS) \
- $(SMIME_LIBS) \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/filter/libfilter.la \
- $(top_builddir)/mail/libevolution-mail.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/libemail-utils/libemail-utils.la \
- $(top_builddir)/libemail-engine/libemail-engine.la \
- $(top_builddir)/e-util/libeutil.la
-
-libevolution_mail_settings_la_LDFLAGS = -avoid-version $(NO_UNDEFINED)
-
--include $(top_srcdir)/git.mk
diff --git a/capplet/settings/anjal-mail-view.c b/capplet/settings/anjal-mail-view.c
deleted file mode 100644
index 9307b0aeca..0000000000
--- a/capplet/settings/anjal-mail-view.c
+++ /dev/null
@@ -1,80 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include "anjal-mail-view.h"
-#include <glib/gi18n.h>
-#include "mail/em-utils.h"
-#include "mail/mail-send-recv.h"
-#include "libemail-engine/mail-ops.h"
-#include "mail/em-folder-tree.h"
-
-G_DEFINE_TYPE (AnjalMailView, anjal_mail_view, GTK_TYPE_NOTEBOOK)
-
-static void
-view_set_folder_uri (AnjalMailView *mail_view,
- const gchar *uri)
-{
-}
-
-static void
-view_set_folder_tree_widget (AnjalMailView *mail_view,
- GtkWidget *tree)
-{
-}
-
-static void
-view_set_folder_tree (AnjalMailView *mail_view,
- EMFolderTree *tree)
-{
-}
-
-static void
-view_set_search (AnjalMailView *mail_view,
- const gchar *search)
-{
-}
-
-static void
-view_init_search (AnjalMailView *mail_view,
- GtkWidget *search)
-{
-}
-
-static void
-anjal_mail_view_class_init (AnjalMailViewClass *class)
-{
- class->set_folder_uri = view_set_folder_uri;
- class->set_folder_tree_widget = view_set_folder_tree_widget;
- class->set_folder_tree = view_set_folder_tree;
- class->set_search = view_set_search;
- class->init_search = view_init_search;
-};
-
-static void
-anjal_mail_view_init (AnjalMailView *shell)
-{
-}
-
diff --git a/capplet/settings/anjal-mail-view.h b/capplet/settings/anjal-mail-view.h
deleted file mode 100644
index 115a877d9f..0000000000
--- a/capplet/settings/anjal-mail-view.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef _ANJAL_MAIL_VIEW_H_
-#define _ANJAL_MAIL_VIEW_H_
-
-#include <gtk/gtk.h>
-#include <mail/em-folder-tree.h>
-
-#define ANJAL_MAIL_VIEW_TYPE (anjal_mail_view_get_type ())
-#define ANJAL_MAIL_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), ANJAL_MAIL_VIEW_TYPE, AnjalMailView))
-#define ANJAL_MAIL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), ANJAL_MAIL_VIEW_TYPE, AnjalMailViewClass))
-#define ANJAL_IS_MAIL_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), ANJAL_MAIL_VIEW_TYPE))
-#define ANJAL_IS_MAIL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), ANJAL_MAIL_VIEW_TYPE))
-#define ANJAL_MAIL_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), ANJAL_MAIL_VIEW_TYPE, AnjalMailViewClass))
-
-typedef struct _AnjalMailViewPrivate AnjalMailViewPrivate;
-
-typedef struct _AnjalMailView {
- GtkNotebook parent;
-
- AnjalMailViewPrivate *priv;
-} AnjalMailView;
-
-typedef struct _AnjalMailViewClass {
- GtkNotebookClass parent_class;
- void (*set_folder_uri) (AnjalMailView *mail_view,
- const gchar *uri);
- void (*set_folder_tree_widget) (AnjalMailView *mail_view,
- GtkWidget *tree);
- void (*set_folder_tree) (AnjalMailView *mail_view,
- EMFolderTree *tree);
- void (*set_search) (AnjalMailView *mail_view,
- const gchar *search);
- void (* init_search) (AnjalMailView *mail_view, GtkWidget *search);
-} AnjalMailViewClass;
-
-GType anjal_mail_view_get_type (void);
-#endif
diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c
deleted file mode 100644
index cf746606ef..0000000000
--- a/capplet/settings/mail-account-view.c
+++ /dev/null
@@ -1,1177 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-#include "mail-account-view.h"
-#include <libedataserverui/e-passwords.h>
-#include "mail-view.h"
-#include "e-util/e-config.h"
-#include "mail/e-mail-backend.h"
-
-struct _MailAccountViewPrivate {
- GtkWidget *tab_str;
-
- GtkWidget *calendar;
- GtkWidget *gcontacts;
- GtkWidget *gmail_info_label;
-
- GtkWidget *account_label;
- GtkWidget *gmail_link;
- GtkWidget *yahoo_cal_box;
-
- gboolean is_gmail;
- gboolean is_yahoo;
- gboolean do_gcontacts;
- gboolean do_calendar;
-
- gchar *username;
- GList *providers;
-
- GtkWidget *yahoo_cal_entry;
-};
-
-G_DEFINE_TYPE (MailAccountView, mail_account_view, GTK_TYPE_VBOX)
-
-enum {
- VIEW_CLOSE,
- LAST_SIGNAL
-};
-
-enum {
- ERROR_NO_FULLNAME = 1,
- ERROR_NO_EMAIL = 2,
- ERROR_INVALID_EMAIL = 3,
- ERROR_NO_PASSWORD = 4,
-};
-
-struct _dialog_errors {
- gint error;
- const gchar *detail;
-} dialog_errors[] = {
- { ERROR_NO_FULLNAME, N_("Please enter your full name.") },
- { ERROR_NO_EMAIL, N_("Please enter your email address.") },
- { ERROR_INVALID_EMAIL, N_("The email address you have entered is invalid.") },
- { ERROR_NO_PASSWORD, N_("Please enter your password.") }
-};
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static void
-mail_account_view_init (MailAccountView *shell)
-{
- shell->priv = g_new0 (MailAccountViewPrivate, 1);
-
- shell->priv->is_gmail = FALSE;
- shell->priv->is_yahoo = FALSE;
- shell->priv->username = NULL;
-}
-
-static void
-mail_account_view_finalize (GObject *object)
-{
- MailAccountView *shell = (MailAccountView *) object;
-
- g_free (shell->priv->username);
- g_list_free (shell->priv->providers);
-
- G_OBJECT_CLASS (mail_account_view_parent_class)->finalize (object);
-}
-
-static void
-mail_account_view_class_init (MailAccountViewClass *class)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (class);
-
- object_class->finalize = mail_account_view_finalize;
-
- signals[VIEW_CLOSE] =
- g_signal_new ("view-close",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (MailAccountViewClass , view_close),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
-}
-
-#ifdef NOT_USED
-
-enum {
- GMAIL = 0,
- YAHOO,
- AOL
-};
-struct _server_prefill {
- gchar *key;
- gchar *recv;
- gchar *send;
- gchar *proto;
- gchar *ssl;
-} std_server[] = {
- {"gmail", "imap.gmail.com", "smtp.gmail.com", "imap", "always"},
- {"yahoo", "pop3.yahoo.com", "smtp.yahoo.com", "pop", "never"},
- {"aol", "imap.aol.com", "smtp.aol.com", "pop", "never"},
- {"msn", "pop3.email.msn.com", "smtp.email.msn.com", "pop", "never"}
-};
-static gint
-check_servers (gchar *server)
-{
- gint len = G_N_ELEMENTS (std_server), i;
-
- for (i = 0; i < len; i++) {
- if (strstr (server, std_server[i].key) != NULL)
- return i;
- }
-
- return -1;
-}
-#endif
-static void
-save_identity (MailAccountView *view)
-{
-}
-
-static gint
-validate_identity (MailAccountView *view)
-{
-#if 0 /* ACCOUNT_MGMT */
- gchar *user = (gchar *) e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_NAME);
- gchar *email = (gchar *) e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_ADDRESS);
- gchar *tmp;
- const gchar *pwd = gtk_entry_get_text ((GtkEntry *) view->password);
-
- if (!user || !*user)
- return ERROR_NO_FULLNAME;
- if (!email || !*email)
- return ERROR_NO_EMAIL;
- if (view->original) /* We don't query/store pwd on edit. */
- return 0;
- if (!pwd || !*pwd)
- return ERROR_NO_PASSWORD;
-
- tmp = strchr (email, '@');
- if (!tmp || tmp[1] == 0)
- return ERROR_INVALID_EMAIL;
-#endif /* ACCOUNT_MGMT */
-
- return 0;
-}
-
-#define PACK_BOX(w) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, 12); gtk_widget_show(box);
-#define PACK_BOXF(w) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, 0); gtk_widget_show(box);
-
-#define CALENDAR_CALDAV_URI "caldav://%s@www.google.com/calendar/dav/%s/events"
-#define GMAIL_CALENDAR_LOCATION "://www.google.com/calendar/feeds/"
-#define CALENDAR_DEFAULT_PATH "/private/full"
-#define SELECTED_CALENDARS "/apps/evolution/calendar/display/selected_calendars"
-#define YAHOO_CALENDAR_LOCATION "%s@caldav.calendar.yahoo.com/dav/%s/Calendar/%s"
-static gboolean
-is_email (const gchar *address)
-{
- /* This is supposed to check if the address's domain could be
- * an FQDN but alas, it's not worth the pain and suffering. */
- const gchar *at;
-
- at = strchr (address, '@');
- /* make sure we have an '@' and that it's not the first or last gchar */
- if (!at || at == address || *(at + 1) == '\0')
- return FALSE;
-
- return TRUE;
-}
-
-static gchar *
-sanitize_user_mail (const gchar *user)
-{
- if (!user)
- return NULL;
-
- if (strstr (user, "%40") != NULL) {
- return g_strdup (user);
- } else if (!is_email (user)) {
- return g_strconcat (user, "%40gmail.com", NULL);
- } else {
- gchar *tmp = g_malloc0 (sizeof (gchar) * (1 + strlen (user) + 2));
- gchar *at = strchr (user, '@');
-
- strncpy (tmp, user, at - user);
- strcat (tmp, "%40");
- strcat (tmp, at + 1);
-
- return tmp;
- }
-}
-
-static void
-setup_yahoo_account (MailAccountView *mav)
-{
- mav->priv->do_gcontacts = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->gcontacts);
- mav->priv->do_calendar = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->calendar);
-
-#if 0 /* ACCOUNT_MGMT */
- if (mav->priv->do_calendar) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- ESource *calendar;
- gchar *sanitize_uname, *abs_uri, *rel_uri;
- const gchar *email = e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_ID_ADDRESS);
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources");
- sgrp = e_source_list_peek_group_by_base_uri (slist, "caldav://");
- if (!sgrp) {
- sgrp = e_source_list_ensure_group (slist, _("CalDAV"), "caldav://", TRUE);
- }
-
- printf("Setting up Yahoo Calendar: list:%p CalDAVGrp: %p\n", slist, sgrp);
-
- /* FIXME: Not sure if we should localize 'Calendar' */
- calendar = e_source_new ("Yahoo", "");
- e_source_set_property (calendar, "ssl", "1");
- e_source_set_property (calendar, "refresh", "30");
- e_source_set_property (calendar, "refresh-type", "0");
- e_source_set_property (calendar, "auth", "1");
- e_source_set_property (calendar, "offline_sync", "1");
- e_source_set_property (calendar, "username", email);
- e_source_set_property (calendar, "default", "true");
- e_source_set_property (calendar, "alarm", "true");
-
- e_source_set_readonly (calendar, FALSE);
-
- sanitize_uname = sanitize_user_mail (email);
-
- abs_uri = g_strdup_printf ("caldav://%s@caldav.calendar.yahoo.com/dav/%s/Calendar/%s/", sanitize_uname, email, gtk_entry_get_text((GtkEntry *)mav->priv->yahoo_cal_entry));
- e_passwords_add_password (abs_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, abs_uri);
-
- rel_uri = g_strdup_printf (YAHOO_CALENDAR_LOCATION, sanitize_uname, email, gtk_entry_get_text ((GtkEntry *) mav->priv->yahoo_cal_entry));
- e_source_set_relative_uri (calendar, rel_uri);
-
- e_source_group_add_source (sgrp, calendar, -1);
- e_source_list_sync (slist, NULL);
-
- g_free (abs_uri);
- g_free (rel_uri);
- g_free (sanitize_uname);
- g_object_unref (slist);
- g_object_unref (sgrp);
- g_object_unref (calendar);
- } else
- printf("Not setting up Yahoo Calendar\n");
-
- if (mav->priv->do_gcontacts) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- ESource *abook;
- gchar *rel_uri;;
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/addressbook/sources" );
-
- sgrp = e_source_list_peek_group_by_base_uri (slist, "google://");
-
- /* FIXME: Not sure if we should localize 'Contacts' */
- abook = e_source_new ("Contacts", "");
- e_source_set_property (abook, "default", "true");
- e_source_set_property (abook, "offline_sync", "1");
- e_source_set_property (abook, "auth", "plain/password");
- e_source_set_property (abook, "use-ssl", "true");
- e_source_set_property (abook, "remember_password", "true");
- e_source_set_property (abook, "refresh-interval", "86400");
- e_source_set_property (abook, "completion", "true");
- e_source_set_property (abook, "username", mav->priv->username);
- e_source_set_relative_uri (abook, mav->priv->username);
-
- rel_uri = g_strdup_printf("google://%s/", mav->priv->username);
- e_passwords_add_password (rel_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, rel_uri);
- e_source_group_add_source (sgrp, abook, -1);
- e_source_list_sync (slist, NULL);
-
- g_free (rel_uri);
- g_object_unref (slist);
- g_object_unref (sgrp);
- g_object_unref (abook);
-
- }
-#endif /* ACCOUNT_MGMT */
-}
-
-static void
-setup_google_accounts (MailAccountView *mav)
-{
- mav->priv->do_gcontacts = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->gcontacts);
- mav->priv->do_calendar = gtk_toggle_button_get_active ((GtkToggleButton *) mav->priv->calendar);
-
-#if 0 /* ACCOUNT_MGMT */
- if (mav->priv->do_calendar) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- ESource *calendar;
- gchar *sanitize_uname, *abs_uri, *rel_uri;
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources");
- sgrp = e_source_list_ensure_group (slist, _("Google"), "google://", TRUE);
-
- /* FIXME: Not sure if we should localize 'Calendar' */
- calendar = e_source_new ("Calendar", "");
- e_source_set_property (calendar, "ssl", "1");
- e_source_set_property (calendar, "refresh", "30");
- e_source_set_property (calendar, "auth", "1");
- e_source_set_property (calendar, "offline_sync", "1");
- e_source_set_property (calendar, "username", mav->priv->username);
- e_source_set_property (calendar, "setup-username", mav->priv->username);
- e_source_set_property (calendar, "default", "true");
- e_source_set_readonly (calendar, FALSE);
-
- e_source_group_add_source (sgrp, calendar, -1);
-
- sanitize_uname = sanitize_user_mail (mav->priv->username);
-
- abs_uri = g_strdup_printf (CALENDAR_CALDAV_URI, sanitize_uname, mav->priv->username);
- e_source_set_absolute_uri (calendar, abs_uri);
-
- e_passwords_add_password (abs_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, abs_uri);
- rel_uri = g_strconcat ("https", GMAIL_CALENDAR_LOCATION, sanitize_uname, CALENDAR_DEFAULT_PATH, NULL);
- e_source_set_relative_uri (calendar, rel_uri);
-
- e_source_list_sync (slist, NULL);
-
- g_free (abs_uri);
- g_free (rel_uri);
- g_free (sanitize_uname);
- g_object_unref (slist);
- g_object_unref (sgrp);
- g_object_unref (calendar);
- }
-
- if (mav->priv->do_gcontacts) {
- ESourceList *slist;
- ESourceGroup *sgrp;
- GSList *sources;
- gboolean source_already_exists = FALSE;
-
- slist = e_source_list_new_for_gconf (gconf, "/apps/evolution/addressbook/sources" );
-
- sgrp = e_source_list_ensure_group (slist, _("Google"), "google://", TRUE);
-
- sources = e_source_group_peek_sources (sgrp);
- for (; sources; sources = sources->next) {
- ESource *existing = (ESource *) sources->data;
-
- if (!g_strcmp0 (e_source_peek_relative_uri (existing),
- mav->priv->username)) {
- source_already_exists = TRUE;
- break;
- }
- }
-
- if (!source_already_exists) {
- ESource *abook;
- gchar *rel_uri;
-
- /* FIXME: Not sure if we should localize 'Contacts' */
- abook = e_source_new ("Contacts", "");
- e_source_set_property (abook, "default", "true");
- e_source_set_property (abook, "offline_sync", "1");
- e_source_set_property (abook, "auth", "plain/password");
- e_source_set_property (abook, "use-ssl", "true");
- e_source_set_property (abook, "remember_password", "true");
- e_source_set_property (abook, "refresh-interval", "86400");
- e_source_set_property (abook, "completion", "true");
- e_source_set_property (abook, "username", mav->priv->username);
-
- e_source_group_add_source (sgrp, abook, -1);
-
- e_source_set_relative_uri (abook, mav->priv->username);
-
- rel_uri = g_strdup_printf ("google://%s/", mav->priv->username);
- e_passwords_add_password (rel_uri, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, rel_uri);
- e_source_list_sync (slist, NULL);
-
- g_free (rel_uri);
- g_object_unref (abook);
- }
-
- g_object_unref (slist);
- g_object_unref (sgrp);
- }
-#endif /* ACCOUNT_MGMT */
-}
-
-#define INDENTATION 10
-
-static GtkWidget *
-create_review (MailAccountView *view)
-{
-#if 0 /* ACCOUNT_MGMT */
- GtkWidget *table, *box, *label, *entry;
- gchar *buff;
- CamelNetworkSettings *source_settings = NULL;
- CamelNetworkSettings *transport_settings = NULL;
- const gchar *encryption;
- const gchar *protocol;
- gchar *host = NULL;
- gchar *user = NULL;
- CamelNetworkSecurityMethod method;
- EMConfigTargetSettings *target;
-
- target = (EMConfigTargetSettings *) ((EConfig *) view->edit->config)->target;
- g_object_get (view->edit, "store-settings", &source_settings, NULL);
- g_object_get (view->edit, "transport-settings", &transport_settings, NULL);
-
- protocol = target->storage_protocol;
-
- g_object_get (
- source_settings,
- "host", &host, "user", &user,
- "security-method", &method, NULL);
- switch (method) {
- case CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT:
- encryption = _("Always (SSL)");
- break;
- case CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT:
- encryption = _("When possible (TLS)");
- break;
- default:
- encryption = _("Never");
- break;
- }
-
- table = gtk_table_new (4,2, FALSE);
- gtk_table_set_row_spacings ((GtkTable *) table, 4);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Personal details:"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- g_free (buff);
- gtk_widget_show (label);
- PACK_BOXF (label)
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (_("Name:"));
- gtk_widget_show (label);
- PACK_BOX (label);
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- entry = gtk_label_new (e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_NAME));
- gtk_widget_show (entry);
- PACK_BOX (entry)
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 1, 2, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (_("Email address:"));
- gtk_widget_show (label);
- PACK_BOX (label)
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- entry = gtk_label_new (e_account_get_string (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_ID_ADDRESS));
- gtk_widget_show (entry);
- PACK_BOX (entry)
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 2, 3, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Details:"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- g_free (buff);
- gtk_widget_show (label);
- PACK_BOXF (label);
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Receiving"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- g_free (buff);
- gtk_widget_show (label);
- PACK_BOXF (label);
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (_("Server type:"));
- gtk_widget_show (label);
- PACK_BOX (label);
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- entry = gtk_label_new (protocol);
- gtk_widget_show (entry);
- PACK_BOX (entry)
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (_("Server address:"));
- gtk_widget_show (label);
- PACK_BOX (label);
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- entry = gtk_label_new (host);
- gtk_widget_show (entry);
- PACK_BOX (entry);
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (_("Username:"));
- gtk_widget_show (label);
- PACK_BOX (label);
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- entry = gtk_label_new (user);
- gtk_widget_show (entry);
- PACK_BOX (entry);
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- label = gtk_label_new (_("Use encryption:"));
- gtk_widget_show (label);
- PACK_BOX (label);
- gtk_table_attach ((GtkTable *) table, box, 0, 1, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- entry = gtk_label_new (encryption);
- gtk_widget_show (entry);
- PACK_BOX (entry);
- gtk_table_attach ((GtkTable *) table, box, 1, 2, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- view->priv->username = g_strdup (user);
-
- g_free (host);
- g_free (user);
-
- g_object_get (
- transport_settings,
- "host", &host, "user", &user,
- "security-method", &method, NULL);
- protocol = target->transport_protocol;
-
- switch (method) {
- case CAMEL_NETWORK_SECURITY_METHOD_SSL_ON_ALTERNATE_PORT:
- encryption = _("Always (SSL)");
- break;
- case CAMEL_NETWORK_SECURITY_METHOD_STARTTLS_ON_STANDARD_PORT:
- encryption = _("When possible (TLS)");
- break;
- default:
- encryption = _("Never");
- break;
- }
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Sending"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- g_free (buff);
- gtk_widget_show (label);
- PACK_BOXF (label);
- gtk_table_attach ((GtkTable *) table, box, 2, 3, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- entry = gtk_label_new (protocol);
- gtk_widget_show (entry);
- PACK_BOX (entry)
- gtk_table_attach ((GtkTable *) table, box, 2, 3, 4, 5, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- entry = gtk_label_new (host);
- gtk_widget_show (entry);
- PACK_BOX (entry);
- gtk_table_attach ((GtkTable *) table, box, 2, 3, 5, 6, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- entry = gtk_label_new (user);
- gtk_widget_show (entry);
- PACK_BOX (entry);
- gtk_table_attach ((GtkTable *) table, box, 2, 3, 6, 7, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
- entry = gtk_label_new (encryption);
- gtk_widget_show (entry);
- PACK_BOX (entry);
- gtk_table_attach ((GtkTable *) table, box, 2, 3, 7, 8, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
-
-/*
- label = gtk_label_new (_("Organization:"));
- gtk_widget_show (label);
- entry = gtk_entry_new ();
- gtk_widget_show (entry);
- gtk_table_attach (table, label, 0, 1, 3, 4, GTK_SHRINK, GTK_SHRINK, INDENTATION, 0);
- gtk_table_attach (table, entry, 1, 2, 3, 4, GTK_EXPAND | GTK_FILL, GTK_SHRINK, INDENTATION, 0);
- */
-
- gtk_widget_show (table);
- g_free (host);
- g_free (user);
-
- return table;
-#endif /* ACCOUNT_MGMT */
-
- return NULL;
-}
-
-#define IDENTITY_DETAIL N_("To use the email application you'll need to setup an account. Put your email address and password in below and we'll try and work out all the settings. If we can't do it automatically you'll need your server details as well.")
-
-#define RECEIVE_DETAIL N_("Sorry, we can't work out the settings to get your mail automatically. Please enter them below. We've tried to make a start with the details you just entered but you may need to change them.")
-
-#define RECEIVE_OPT_DETAIL N_("You can specify more options to configure the account.")
-
-#define SEND_DETAIL N_("Now we need your settings for sending mail. We've tried to make some guesses but you should check them over to make sure.")
-#define DEFAULTS_DETAIL N_("You can specify your default settings for your account.")
-#define REVIEW_DETAIL N_("Time to check things over before we try and connect to the server and fetch your mail.")
-struct _page_text {
- gint id;
- const gchar *head;
- const gchar *next;
- const gchar *prev;
- const gchar *next_edit;
- const gchar *prev_edit;
- const gchar *detail;
- const gchar *path;
- GtkWidget * (*create_page) (MailAccountView *view);
- void (*fill_page) (MailAccountView *view);
- void (*save_page) (MailAccountView *view);
- gint (*validate_page) (MailAccountView *view);
-} mail_account_pages[] = {
- { MAV_IDENTITY_PAGE, N_("Identity"), N_("Next - Receiving mail"), NULL, N_("Next - Receiving mail"), NULL, IDENTITY_DETAIL, "00.identity",NULL, NULL, save_identity, validate_identity},
- { MAV_RECV_PAGE, N_("Receiving mail"), N_("Next - Sending mail"), N_("Back - Identity"), N_("Next - Receiving options"), N_("Back - Identity"), RECEIVE_DETAIL, "10.receive", NULL, NULL, NULL, NULL },
- { MAV_RECV_OPT_PAGE, N_("Receiving options"), NULL, NULL, N_("Next - Sending mail"), N_("Back - Receiving mail"), RECEIVE_OPT_DETAIL, "10.receive", NULL, NULL, NULL, NULL },
-
- { MAV_SEND_PAGE, N_("Sending mail"), N_("Next - Review account"), N_("Back - Receiving mail"), N_("Next - Defaults"), N_("Back - Receiving options"), SEND_DETAIL, "30.send", NULL, NULL, NULL, NULL},
- { MAV_DEFAULTS_PAGE, N_("Defaults"), NULL, NULL, N_("Next - Review account"), N_("Back - Sending mail"), DEFAULTS_DETAIL, "40.defaults", NULL, NULL, NULL, NULL},
-
- { MAV_REVIEW_PAGE, N_("Review account"), N_("Finish"), N_("Back - Sending"), N_("Finish"), N_("Back - Sending"), REVIEW_DETAIL, NULL, create_review, NULL, NULL},
-};
-
-static gboolean
-mav_check_same_source_transport (MailAccountView *mav)
-{
-#if 0 /* ACCOUNT_MGMT */
- EAccount *account = em_account_editor_get_modified_account (mav->edit);
- const gchar *uri;
- gchar *current = NULL;
- gboolean ret = FALSE;
-
- uri = e_account_get_string (account, E_ACCOUNT_SOURCE_URL);
- if (uri) {
- const gchar *colon = strchr (uri, ':');
- gint len;
-
- if (colon) {
- len = colon - uri;
- current = g_alloca (len + 1);
- memcpy (current, uri, len);
- current[len] = 0;
- }
- }
-
- if (current) {
- GList *l;
- for (l = mav->priv->providers; l; l = l->next) {
- CamelProvider *provider = l->data;
-
- if (strcmp (provider->protocol, current) == 0 &&
- CAMEL_PROVIDER_IS_STORE_AND_TRANSPORT (provider)) {
- ret = TRUE;
- break;
- }
- }
-
- }
-
- return ret;
-#endif /* ACCOUNT_MGMT */
-
- return FALSE; /* ACCOUNT_MGMT */
-}
-
-static void
-mav_next_pressed (GtkButton *button,
- MailAccountView *mav)
-{
-#if 0 /* ACCOUNT_MGMT */
- if (mail_account_pages[mav->current_page].validate_page) {
- gint ret = (*mail_account_pages[mav->current_page].validate_page) (mav);
- MAVPage *page = mav->pages[mav->current_page];
- if (ret) {
- gtk_label_set_text ((GtkLabel *) page->error_label, _(dialog_errors[ret - 1].detail));
- gtk_widget_show (page->error);
- return;
- }
- gtk_widget_hide (page->error);
- gtk_label_set_text ((GtkLabel *)page->error_label, "");
- }
- if (mail_account_pages[mav->current_page].save_page) {
- (*mail_account_pages[mav->current_page].save_page) (mav);
- }
-
- if (mav->current_page == MAV_LAST - 1) {
- gchar *uri = (gchar *) e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_URL);
- CamelURL *url;
-
- e_account_set_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_NAME, e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_ID_ADDRESS));
- if (uri != NULL && (url = camel_url_new (uri, NULL)) != NULL) {
- camel_url_set_param(url, "check-all", "true");
- camel_url_set_param(url, "stay-synchronized", "true");
- if (!mav->original) {
- e_account_set_bool (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_AUTO_CHECK, TRUE);
- }
-
- if (!mav->original && strcmp (url->protocol, "pop") == 0) {
- e_account_set_bool (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_KEEP_ON_SERVER, TRUE);
- }
-
- uri = camel_url_to_string (url, 0);
- e_account_set_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_SOURCE_URL, uri);
- g_free (uri);
- camel_url_free (url);
- }
-
- if (!mav->original) {
- EAccount *account = em_account_editor_get_modified_account (mav->edit);
- CamelURL *aurl;
- gchar *surl;
- /* Save the password ahead of time */
- aurl = camel_url_new (account->source->url, NULL);
- surl = camel_url_to_string (aurl, CAMEL_URL_HIDE_ALL);
-#if 0 /* ACCOUNT_MGMT */
- e_passwords_add_password (surl, gtk_entry_get_text ((GtkEntry *) mav->password));
- e_passwords_remember_password (NULL, surl);
-#endif /* ACCOUNT_MGMT */
- camel_url_free (aurl);
- g_free (surl);
- }
-
- if (mav->priv->is_gmail && !mav->original)
- setup_google_accounts (mav);
- else if (mav->priv->is_yahoo && !mav->original)
- setup_yahoo_account (mav);
-
- em_account_editor_commit (mav->edit);
- g_signal_emit (mav, signals[VIEW_CLOSE], 0);
- return;
- }
-
- gtk_widget_hide (mav->pages[mav->current_page]->box);
- mav->current_page++;
-
- if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
- mav->current_page++; /* Skip recv options in new account creation. */
- if (mav->current_page == MAV_SEND_PAGE && mav_check_same_source_transport (mav)) {
- mav->current_page++; /* Skip send page if the provider does both source and transport */
- }
- if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
- mav->current_page++; /* Skip defaults in new account creation. */
-
- if (mav->current_page == MAV_LAST - 1) {
- MAVPage *page = mav->pages[mav->current_page];
- GtkWidget *tmp;
- EAccount *account = em_account_editor_get_modified_account (mav->edit);
- CamelNetworkSettings *settings = NULL;
- const gchar *host = NULL;
-
- g_object_get (mav->edit, "store-settings", &settings, NULL);
- host = camel_network_settings_get_host (settings);
-
- if (page->main)
- gtk_widget_destroy (page->main);
-
- tmp = mail_account_pages[mav->current_page].create_page (mav);
- page->main = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (page->main);
- if (tmp) {
- gtk_box_pack_start ((GtkBox *) page->main, tmp, FALSE, FALSE, 0);
- gtk_widget_show (tmp);
- }
- gtk_box_pack_start ((GtkBox *) page->box, page->main, FALSE, FALSE, 3);
-
- if (mav->priv->is_gmail) {
- gtk_widget_destroy (mav->priv->gcontacts);
- gtk_widget_destroy (mav->priv->calendar);
- gtk_widget_destroy (mav->priv->gmail_info_label);
- if (mav->priv->account_label) {
- gtk_widget_destroy (mav->priv->account_label);
- mav->priv->account_label = NULL;
- }
- if (mav->priv->gmail_link) {
- gtk_widget_destroy (mav->priv->gmail_link);
- mav->priv->gmail_link = NULL;
- }
- } else if (mav->priv->is_yahoo) {
- gtk_widget_destroy (mav->priv->calendar);
- gtk_widget_destroy (mav->priv->gmail_info_label);
- gtk_widget_destroy (mav->priv->yahoo_cal_entry);
- if (mav->priv->account_label) {
- gtk_widget_destroy (mav->priv->account_label);
- mav->priv->account_label = NULL;
- }
- if (mav->priv->yahoo_cal_box) {
- gtk_widget_destroy (mav->priv->yahoo_cal_box);
- mav->priv->yahoo_cal_box = NULL;
- }
- }
-
- if (mav->original == NULL && (g_strrstr(host, "gmail") ||
- g_strrstr(host, "googlemail"))) {
- /* Google accounts*/
- gchar *buff;
- mav->priv->is_gmail = TRUE;
-
- mav->priv->gcontacts = gtk_check_button_new_with_label (_("Setup Google contacts with Evolution"));
- mav->priv->calendar = gtk_check_button_new_with_label (_("Setup Google calendar with Evolution"));
-
- gtk_toggle_button_set_active ((GtkToggleButton *) mav->priv->gcontacts, TRUE);
- gtk_toggle_button_set_active ((GtkToggleButton *) mav->priv->calendar, TRUE);
-
- mav->priv->gmail_info_label = gtk_label_new (_("You may need to enable IMAP access."));
- gtk_label_set_selectable ((GtkLabel *) mav->priv->gmail_info_label, TRUE);
-
- gtk_widget_show (mav->priv->gcontacts);
- gtk_widget_show (mav->priv->calendar);
- gtk_widget_show (mav->priv->gmail_info_label);
-
- mav->priv->account_label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Google account settings:"));
- gtk_label_set_markup ((GtkLabel *) mav->priv->account_label, buff);
- g_free (buff);
- gtk_widget_show (mav->priv->account_label);
-
-#define PACK_IN_BOX(wid,child,num) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, child, FALSE, FALSE, num); gtk_widget_show (tbox); gtk_box_pack_start ((GtkBox *)wid, tbox, FALSE, FALSE, 0); }
-
- PACK_IN_BOX (page->box,mav->priv->account_label,12);
- PACK_IN_BOX (page->box,mav->priv->gcontacts,24);
- PACK_IN_BOX (page->box,mav->priv->calendar,24);
-#undef PACK_IN_BOX
-#define PACK_IN_BOX(wid,child1,child2,num1,num2) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, child1, FALSE, FALSE, num1); gtk_box_pack_start ((GtkBox *)tbox, child2, FALSE, FALSE, num2); gtk_widget_show_all (tbox); gtk_box_pack_start ((GtkBox *)wid, tbox, FALSE, FALSE, 0); }
-
- mav->priv->gmail_link = gtk_link_button_new ("https://mail.google.com/mail/?ui=2&amp;shva=1#settings/fwdandpop");
- PACK_IN_BOX (page->box,mav->priv->gmail_info_label,mav->priv->gmail_link, 24, 0);
-#undef PACK_IN_BOX
- } else if (mav->original == NULL &&
- (g_strrstr(host, "yahoo.") ||
- g_strrstr(host, "ymail.") ||
- g_strrstr(host, "rocketmail."))) {
- /* Yahoo accounts*/
- gchar *cal_name;
- gchar *buff;
-
- mav->priv->is_yahoo = TRUE;
- printf("Google account: %s\n", account->source->url);
- mav->priv->calendar = gtk_check_button_new_with_label (_("Setup Yahoo calendar with Evolution"));
-
- gtk_toggle_button_set_active ((GtkToggleButton *) mav->priv->calendar, TRUE);
-
- mav->priv->gmail_info_label = gtk_label_new (_("Yahoo calendars are named as firstname_lastname. We have tried to form the calendar name. So please confirm and re-enter the calendar name if it is not correct."));
- gtk_label_set_line_wrap ((GtkLabel *) mav->priv->gmail_info_label, TRUE);
- gtk_label_set_line_wrap_mode ((GtkLabel *) mav->priv->gmail_info_label, PANGO_WRAP_WORD);
- gtk_label_set_selectable ((GtkLabel *) mav->priv->gmail_info_label, TRUE);
-
- gtk_widget_show (mav->priv->calendar);
- gtk_widget_show (mav->priv->gmail_info_label);
-
- mav->priv->account_label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Yahoo account settings:"));
- gtk_label_set_markup ((GtkLabel *) mav->priv->account_label, buff);
- g_free (buff);
- gtk_widget_show (mav->priv->account_label);
-
-#define PACK_IN_BOX(wid,child,num) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, child, FALSE, FALSE, num); gtk_widget_show (tbox); gtk_box_pack_start ((GtkBox *)wid, tbox, FALSE, FALSE, 0); }
-#define PACK_IN_BOX_AND_TEXT(txt,box,child,num) { GtkWidget *txtlbl = gtk_label_new (txt); box = gtk_hbox_new (FALSE, 12); gtk_box_pack_start ((GtkBox *)box, txtlbl, FALSE, FALSE, num); gtk_box_pack_start ((GtkBox *)box, child, FALSE, FALSE, num); gtk_widget_show_all (box);}
-
- PACK_IN_BOX (page->box,mav->priv->account_label,12);
- PACK_IN_BOX (page->box,mav->priv->calendar,24);
-
- mav->priv->yahoo_cal_entry = gtk_entry_new ();
- gtk_widget_show (mav->priv->yahoo_cal_entry);
- PACK_IN_BOX (page->box,mav->priv->gmail_info_label, 24);
- PACK_IN_BOX_AND_TEXT(_("Yahoo Calendar name:"), mav->priv->yahoo_cal_box, mav->priv->yahoo_cal_entry, 0);
- PACK_IN_BOX (page->box, mav->priv->yahoo_cal_box, 24);
- cal_name = g_strdup (e_account_get_string (em_account_editor_get_modified_account (mav->edit), E_ACCOUNT_ID_NAME));
- cal_name = g_strdelimit(cal_name, " ", '_');
- gtk_entry_set_text ((GtkEntry *) mav->priv->yahoo_cal_entry, cal_name);
- g_free (cal_name);
-#undef PACK_IN_BOX
- } else {
- mav->priv->is_gmail = FALSE;
- mav->priv->is_yahoo = FALSE;
- }
-
- }
-
- gtk_widget_show (mav->pages[mav->current_page]->box);
- if (!mav->pages[mav->current_page]->done) {
- mav->pages[mav->current_page]->done = TRUE;
- if (mail_account_pages[mav->current_page].path) {
-
- if (!mav->original && em_account_editor_check (mav->edit, mail_account_pages[mav->current_page].path))
- mav_next_pressed (NULL, mav);
- }
- }
-#endif /* ACCOUNT_MGMT */
-}
-
-static void
-mav_prev_pressed (GtkButton *button,
- MailAccountView *mav)
-{
- if (mav->current_page == 0)
- return;
-
- gtk_widget_hide (mav->pages[mav->current_page]->box);
- mav->current_page--;
-
- if (mav->current_page == MAV_DEFAULTS_PAGE && mav->original == NULL)
- mav->current_page--; /* Skip defaults in new account creation. */
- if (mav->current_page == MAV_SEND_PAGE && mav_check_same_source_transport (mav)) {
- mav->current_page--; /* Skip send page if the provider does both source and transport */
- }
- if (mav->current_page == MAV_RECV_OPT_PAGE && mav->original == NULL)
- mav->current_page--; /* Skip recv options in new account creation. */
- gtk_widget_show (mav->pages[mav->current_page]->box);
-
-}
-
-static GtkWidget *
-mav_construct_page (MailAccountView *view,
- MAVPageType type)
-{
- MAVPage *page = g_new0 (MAVPage, 1);
- GtkWidget *box, *tmp, *error_box;
- gchar *str;
-
- page->type = type;
-
- page->box = gtk_vbox_new (FALSE, 2);
-
- error_box = gtk_hbox_new (FALSE, 2);
- page->error_label = gtk_label_new ("");
- tmp = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_MENU);
- gtk_box_pack_start ((GtkBox *) error_box, tmp, FALSE, FALSE, 2);
- gtk_box_pack_start ((GtkBox *) error_box, page->error_label, FALSE, FALSE, 2);
- gtk_widget_hide (tmp);
- gtk_widget_show (page->error_label);
- page->error = tmp;
- gtk_widget_show (error_box);
-
- box = gtk_hbox_new (FALSE, 12);
- gtk_widget_show (box);
- gtk_box_pack_start ((GtkBox *) page->box, box, FALSE, FALSE, 12);
- tmp = gtk_label_new (NULL);
- str = g_strdup_printf("<span size=\"xx-large\" weight=\"heavy\">%s</span>", _(mail_account_pages[type].head));
- gtk_label_set_markup ((GtkLabel *) tmp, str);
- g_free (str);
- gtk_widget_show (tmp);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 12);
-
- box = gtk_hbox_new (FALSE, 12);
- gtk_widget_show (box);
- gtk_box_pack_start ((GtkBox *) page->box, box, FALSE, FALSE, 12);
- tmp = gtk_label_new (_(mail_account_pages[type].detail));
- gtk_widget_set_size_request (tmp, 600, -1);
- gtk_label_set_line_wrap ((GtkLabel *) tmp, TRUE);
- gtk_label_set_line_wrap_mode ((GtkLabel *) tmp, PANGO_WRAP_WORD);
- gtk_widget_show (tmp);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 12);
-
- page->main = NULL;
- if (mail_account_pages[type].create_page && mail_account_pages[type].path) {
- tmp = (*mail_account_pages[type].create_page) (view);
- gtk_box_pack_start ((GtkBox *) page->box, tmp, FALSE, FALSE, 3);
- page->main = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (page->main);
- gtk_box_pack_start ((GtkBox *) page->main, tmp, FALSE, FALSE, 0);
- }
-
- if (mail_account_pages[type].fill_page) {
- (*mail_account_pages[type].fill_page) (view);
- }
-
- if ((view->original && mail_account_pages[type].prev_edit) || mail_account_pages[type].prev) {
- box = gtk_hbox_new (FALSE, 0);
- if (FALSE) {
- tmp = gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_BUTTON);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 0);
- }
- tmp = gtk_label_new (_(view->original ? mail_account_pages[type].prev_edit : mail_account_pages[type].prev));
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 3);
- page->prev = gtk_button_new ();
- gtk_container_add ((GtkContainer *) page->prev, box);
- gtk_widget_show_all (page->prev);
- g_signal_connect (
- page->prev, "clicked",
- G_CALLBACK (mav_prev_pressed), view);
- }
-
- if ((view->original && mail_account_pages[type].next_edit) || mail_account_pages[type].next) {
- box = gtk_hbox_new (FALSE, 0);
- tmp = gtk_label_new (_(view->original ? mail_account_pages[type].next_edit : mail_account_pages[type].next));
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 3);
- if (FALSE) {
- tmp = gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_BUTTON);
- gtk_box_pack_start ((GtkBox *) box, tmp, FALSE, FALSE, 0);
- }
- page->next = gtk_button_new ();
- gtk_widget_set_can_default (page->next, TRUE);
- gtk_container_add ((GtkContainer *) page->next, box);
- gtk_widget_show_all (page->next);
- g_signal_connect (
- page->next, "clicked",
- G_CALLBACK (mav_next_pressed), view);
- }
-
- box = gtk_hbox_new (FALSE, 0);
- if (page->prev)
- gtk_box_pack_start ((GtkBox *) box, page->prev, FALSE, FALSE, 12);
- if (page->next)
- gtk_box_pack_end ((GtkBox *) box, page->next, FALSE, FALSE, 12);
- gtk_widget_show (box);
- gtk_box_pack_end ((GtkBox *) page->box, box, FALSE, FALSE, 6);
- gtk_widget_show (page->box);
- gtk_box_pack_end ((GtkBox *) page->box, error_box, FALSE, FALSE, 2);
- return (GtkWidget *) page;
-}
-
-static void
-next_page (GtkWidget *entry,
- MailAccountView *mav)
-{
- mav_next_pressed (NULL, mav);
-}
-
-#if 0 /* ACCOUNT_MGMT */
-static void
-mail_account_view_construct (MailAccountView *view,
- EMailBackend *backend)
-{
- gint i;
- EShell *shell;
-
- view->scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy ((GtkScrolledWindow *) view->scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- gtk_scrolled_window_set_shadow_type ((GtkScrolledWindow *) view->scroll, GTK_SHADOW_NONE);
- view->page_widget = gtk_vbox_new (FALSE, 3);
- gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) view->scroll, view->page_widget);
- gtk_widget_show_all (view->scroll);
- gtk_widget_set_size_request ((GtkWidget *) view, -1, 300);
- for (i = 0; i < MAV_LAST; i++) {
- view->pages[i] = (MAVPage *) mav_construct_page (view, i);
- view->pages[i]->done = FALSE;
- view->wpages[i] = view->pages[i]->box;
- gtk_box_pack_start ((GtkBox *) view->page_widget, view->pages[i]->box, TRUE, TRUE, 0);
- gtk_widget_hide (view->pages[i]->box);
- }
- gtk_widget_show (view->pages[0]->box);
- view->current_page = 0;
- gtk_box_pack_start ((GtkBox *) view, view->scroll, TRUE, TRUE, 0);
- view->edit = em_account_editor_new_for_pages (
- view->original, EMAE_PAGES, session,
- "org.gnome.evolution.mail.config.accountWizard", view->wpages);
- gtk_widget_hide (e_config_create_widget (E_CONFIG (view->edit->config)));
- if (!view->original) {
- e_account_set_bool (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_SOURCE_SAVE_PASSWD, TRUE);
- e_account_set_bool (em_account_editor_get_modified_account (view->edit), E_ACCOUNT_TRANSPORT_SAVE_PASSWD, TRUE);
- }
- em_account_editor_check (view->edit, mail_account_pages[0].path);
- view->pages[0]->done = TRUE;
-
- view->priv->providers = camel_provider_list (TRUE);
-
- shell = e_shell_get_default ();
- if (!shell || e_shell_get_express_mode (shell)) {
- GtkWidget *table = em_account_editor_get_widget (view->edit, "identity-required-table");
- GtkWidget *label, *pwd;
- gtk_widget_hide (em_account_editor_get_widget (view->edit, "identity-optional-section"));
-
- if (!view->original) {
- label = gtk_label_new (_("Password:"));
- pwd = gtk_entry_new ();
- gtk_entry_set_visibility ((GtkEntry *) pwd, FALSE);
-/* gtk_entry_set_activates_default ((GtkEntry *)pwd, TRUE); */
- g_signal_connect (
- pwd, "activate",
- G_CALLBACK (next_page), view);
- gtk_widget_show (label);
- gtk_widget_show (pwd);
- gtk_table_attach ((GtkTable *) table, label, 0, 1, 2, 3, GTK_FILL, 0, 0, 0);
- gtk_table_attach ((GtkTable *) table, pwd, 1, 2, 2, 3, GTK_FILL | GTK_EXPAND, 0, 0, 0);
-
- view->password = pwd;
- }
- }
-
- /* assume the full name is known from the system */
- gtk_widget_grab_focus (em_account_editor_get_widget (view->edit, "identity_address"));
-}
-
-MailAccountView *
-mail_account_view_new (EAccount *account,
- EMailBackend *backend)
-{
- MailAccountView *view = g_object_new (MAIL_ACCOUNT_VIEW_TYPE, NULL);
- view->type = MAIL_VIEW_ACCOUNT;
- view->uri = "account://";
- view->original = account;
- mail_account_view_construct (view, backend);
-
- return view;
-}
-#endif /* ACCOUNT_MGMT */
-
-static void
-mav_close (GtkButton *w,
- MailAccountView *mfv)
-{
- g_signal_emit (mfv, signals[VIEW_CLOSE], 0);
-}
-
-GtkWidget *
-mail_account_view_get_tab_widget (MailAccountView *mcv)
-{
- GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
-
- GtkWidget *tool, *box, *img;
- gint w=-1, h=-1;
- GtkWidget *tab_label;
-
- img = (GtkWidget *) gtk_image_new_from_pixbuf (pbuf);
-
- tool = gtk_button_new ();
- gtk_button_set_relief ((GtkButton *) tool, GTK_RELIEF_NONE);
- gtk_button_set_focus_on_click ((GtkButton *) tool, FALSE);
- gtk_widget_set_tooltip_text (tool, _("Close Tab"));
- g_signal_connect (
- tool, "clicked",
- G_CALLBACK (mav_close), mcv);
-
- box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start ((GtkBox *) box, img, FALSE, FALSE, 0);
- gtk_container_add ((GtkContainer *) tool, box);
- gtk_widget_show_all (tool);
- gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (tool) , GTK_ICON_SIZE_MENU, &w, &h);
- gtk_widget_set_size_request (tool, w + 2, h + 2);
-
- box = gtk_label_new (_("Account Wizard"));
- tab_label = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start ((GtkBox *) tab_label, box, FALSE, FALSE, 2);
- gtk_box_pack_start ((GtkBox *) tab_label, tool, FALSE, FALSE, 0);
- gtk_widget_show_all (tab_label);
-
- return tab_label;
-
-}
-
-void
-mail_account_view_activate (MailAccountView *mcv,
- GtkWidget *tree,
- GtkWidget *folder_tree,
- GtkWidget *check_mail,
- GtkWidget *sort_by,
- gboolean act)
-{
- if (!check_mail || !sort_by)
- return;
- gtk_widget_set_sensitive (check_mail, TRUE);
- gtk_widget_set_sensitive (sort_by, FALSE);
-}
diff --git a/capplet/settings/mail-account-view.h b/capplet/settings/mail-account-view.h
deleted file mode 100644
index f69f5b86a8..0000000000
--- a/capplet/settings/mail-account-view.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef _MAIL_ACCOUNT_VIEW_H_
-#define _MAIL_ACCOUNT_VIEW_H_
-
-#include <gtk/gtk.h>
-#include "mail-view.h"
-
-#define MAIL_ACCOUNT_VIEW_TYPE (mail_account_view_get_type ())
-#define MAIL_ACCOUNT_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_ACCOUNT_VIEW_TYPE, MailFolderView))
-#define MAIL_ACCOUNT_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MAIL_ACCOUNT_VIEW_TYPE, MailFolderViewClass))
-#define IS_MAIL_ACCOUNT_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_ACCOUNT_VIEW_TYPE))
-#define IS_MAIL_ACCOUNT_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_ACCOUNT_VIEW_TYPE))
-#define MAIL_ACCOUNT_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_ACCOUNT_VIEW_TYPE, MailFolderViewClass))
-
-typedef struct _MailAccountViewPrivate MailAccountViewPrivate;
-typedef struct _MailAccountService MailAccountService;
-
-typedef enum {
- MAV_IDENTITY_PAGE = 0,
- MAV_RECV_PAGE,
- MAV_RECV_OPT_PAGE,
- MAV_SEND_PAGE,
- MAV_DEFAULTS_PAGE,
- MAV_REVIEW_PAGE,
- MAV_LAST,
-} MAVPageType;
-
-typedef struct _MAVPage {
- GtkWidget *box;
- GtkWidget *main;
- GtkWidget *error;
- GtkWidget *error_label;
- MAVPageType type;
- GtkWidget *next;
- GtkWidget *prev;
- gboolean done;
-}MAVPage;
-
-typedef struct _MailAccountView {
- GtkVBox parent;
- gint type;
- const gchar *uri;
- MailViewFlags flags;
- /* Base class of MailChildView ends */
-
- GtkWidget *scroll;
- GtkWidget *page_widget;
-
- MAVPage *pages[6];
- struct _EAccount *original;
- GtkWidget *wpages[6];
- gint current_page;
- struct _EMAccountEditor *edit;
- GtkWidget *password;
-
- MailAccountViewPrivate *priv;
-} MailAccountView;
-
-typedef struct _MailAccountViewClass {
- GtkVBoxClass parent_class;
-
- void (* view_close) (MailAccountView *);
-
-} MailAccountViewClass;
-
-GType mail_account_view_get_type (void);
-#if 0 /* ACCOUNT_MGMT */
-MailAccountView *mail_account_view_new (EAccount *account, EMailBackend *backend);
-#endif /* ACCOUNT_MGMT */
-GtkWidget * mail_account_view_get_tab_widget (MailAccountView *mcv);
-void mail_account_view_activate (MailAccountView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, gboolean act);
-#endif
diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c
deleted file mode 100644
index a65479025d..0000000000
--- a/capplet/settings/mail-capplet-shell.c
+++ /dev/null
@@ -1,302 +0,0 @@
-/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
-
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@gnome.org>
- * Srinivasa Ragavan <srini@linux.intel.com>
- *
- * Copyright (C) 2010 Intel Corporation. (www.intel.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <gtk/gtkx.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include "mail-capplet-shell.h"
-#include "mail-view.h"
-#include <gdk/gdkkeysyms.h>
-
-#include <e-util/e-util.h>
-
-#include <mail/em-utils.h>
-#include <mail/em-composer-utils.h>
-#include <libemail-engine/mail-config.h>
-#include <libemail-utils/mail-mt.h>
-
-#include <shell/e-shell.h>
-
-enum {
- CTRL_W_PRESSED,
- CTRL_Q_PRESSED,
- LAST_SIGNAL
-};
-
-/* Re usable colors */
-
-GdkColor *pcolor_sel;
-gchar *scolor_sel;
-GdkColor *pcolor_fg_sel;
-gchar *scolor_fg_sel;
-GdkColor *pcolor_bg_norm;
-gchar *scolor_bg_norm;
-GdkColor *pcolor_norm;
-gchar *scolor_norm;
-GdkColor *pcolor_fg_norm;
-gchar *scolor_fg_norm;
-
-static guint mail_capplet_shell_signals[LAST_SIGNAL];
-
-struct _MailCappletShellPrivate {
-
- EMailBackend *backend;
- GtkWidget *box;
-
- GtkWidget * top_bar;
- GtkWidget *message_pane;
- GtkWidget *bottom_bar;
-
- /* Top Bar */
- GtkWidget *action_bar;
- GtkWidget *quit;
-
- gboolean main_loop;
-
- MailViewChild *settings_view;
-};
-
-static void mail_capplet_shell_quit (MailCappletShell *shell);
-
-G_DEFINE_TYPE (MailCappletShell, mail_capplet_shell, GTK_TYPE_WINDOW)
-
-static void
-mail_capplet_shell_init (MailCappletShell *shell)
-{
- shell->priv = g_new0 (MailCappletShellPrivate, 1);
- shell->priv->settings_view = NULL;
-}
-
-static void
-mail_capplet_shell_finalize (GObject *object)
-{
- G_OBJECT_CLASS (mail_capplet_shell_parent_class)->finalize (object);
-}
-
-static void
-ms_ctrl_w_pressed (MailCappletShell *shell)
-{
- mail_view_close_view ((MailView *) shell->view);
-}
-
-static void
-ms_ctrl_q_pressed (MailCappletShell *shell)
-{
- mail_capplet_shell_quit (shell);
-}
-
-static void
-mail_capplet_shell_class_init (MailCappletShellClass *class)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (class);
- GtkBindingSet *binding_set;
-
- object_class->finalize = mail_capplet_shell_finalize;
- class->ctrl_w_pressed = ms_ctrl_w_pressed;
- class->ctrl_q_pressed = ms_ctrl_q_pressed;
-
- mail_capplet_shell_signals[CTRL_W_PRESSED] =
- g_signal_new ("ctrl_w_pressed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (MailCappletShellClass, ctrl_w_pressed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- mail_capplet_shell_signals[CTRL_Q_PRESSED] =
- g_signal_new ("ctrl_q_pressed",
- G_TYPE_FROM_CLASS (object_class),
- G_SIGNAL_RUN_LAST | G_SIGNAL_ACTION,
- G_STRUCT_OFFSET (MailCappletShellClass, ctrl_q_pressed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- binding_set = gtk_binding_set_by_class (class);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_W, GDK_CONTROL_MASK, "ctrl_w_pressed", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_w, GDK_CONTROL_MASK, "ctrl_w_pressed", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0);
- gtk_binding_entry_add_signal (binding_set, GDK_KEY_Q, GDK_CONTROL_MASK, "ctrl_q_pressed", 0);
-
-};
-
-static void
-ms_init_style (GtkStyle *style)
-{
- pcolor_sel = &style->base[GTK_STATE_SELECTED];
- scolor_sel = gdk_color_to_string (pcolor_sel);
-
- pcolor_norm = &style->bg[GTK_STATE_NORMAL];
- scolor_norm = gdk_color_to_string (pcolor_norm);
-
- pcolor_bg_norm = &style->base[GTK_STATE_NORMAL];
- scolor_bg_norm = gdk_color_to_string (pcolor_bg_norm);
-
- pcolor_fg_sel =&style->fg[GTK_STATE_SELECTED];
- scolor_fg_sel = gdk_color_to_string (pcolor_fg_sel);
-
- pcolor_fg_norm =&style->fg[GTK_STATE_NORMAL];
- scolor_fg_norm = gdk_color_to_string (pcolor_fg_norm);
-}
-
-static void
-mail_capplet_shell_quit (MailCappletShell *shell)
-{
- MailCappletShellPrivate *priv = shell->priv;
-
- if (!priv->main_loop)
- gtk_widget_hide ((GtkWidget *) shell);
-}
-
-static void
-ms_delete_event (MailCappletShell *shell,
- GdkEvent *event G_GNUC_UNUSED,
- gpointer data G_GNUC_UNUSED)
-{
- mail_capplet_shell_quit (shell);
- gtk_main_quit ();
-}
-
-static void
-ms_show_post_druid (MailViewChild *mfv G_GNUC_UNUSED,
- MailCappletShell *shell)
-{
- gtk_main_quit ();
- g_timeout_add_seconds (5, (GSourceFunc) gtk_widget_destroy, shell);
-}
-
-#define PACK_IN_TOOL(wid,icon) { GtkWidget *tbox; tbox = gtk_hbox_new (FALSE, 0); gtk_box_pack_start ((GtkBox *)tbox, gtk_image_new_from_icon_name(icon, GTK_ICON_SIZE_BUTTON), FALSE, FALSE, 0); wid = (GtkWidget *)gtk_tool_button_new (tbox, NULL); }
-
-static void
-mail_capplet_shell_construct (MailCappletShell *shell,
- gint socket_id,
- gboolean just_druid,
- gboolean main_loop)
-{
- MailCappletShellPrivate *priv = shell->priv;
- GtkStyle *style = gtk_widget_get_default_style ();
- EShell *eshell;
- EMailSession *session;
-
- gtk_window_set_icon_name ((GtkWindow *)shell, "evolution");
- gtk_window_set_title ((GtkWindow *)shell, _("Evolution account assistant"));
- ms_init_style (style);
- g_signal_connect (
- shell, "delete-event",
- G_CALLBACK (ms_delete_event), NULL);
- gtk_window_set_type_hint ((GtkWindow *) shell, GDK_WINDOW_TYPE_HINT_NORMAL);
- if (g_getenv("ANJAL_NO_MAX") == NULL && FALSE) {
- GdkScreen *scr = gtk_widget_get_screen ((GtkWidget *) shell);
- gtk_window_set_default_size ((GtkWindow *) shell, gdk_screen_get_width (scr), gdk_screen_get_height (scr));
- gtk_window_set_decorated ((GtkWindow *) shell, FALSE);
- } else {
- gtk_window_set_default_size ((GtkWindow *) shell, 1024, 500);
- }
-
- priv->main_loop = main_loop;
- priv->box = (GtkWidget *) gtk_vbox_new (FALSE, 0);
- gtk_widget_show ((GtkWidget *) priv->box);
-
- if (!socket_id) {
- gtk_container_add ((GtkContainer *) shell, priv->box);
- } else {
- GtkWidget *plug = gtk_plug_new (socket_id);
-
- gtk_container_add ((GtkContainer *) plug, priv->box);
- g_signal_connect (
- plug, "destroy",
- G_CALLBACK (gtk_main_quit), NULL);
- gtk_widget_show (plug);
- gtk_widget_hide ((GtkWidget *) shell);
-
- }
-
- if (camel_init (e_get_user_data_dir (), TRUE) != 0)
- exit (0);
-
- camel_provider_init ();
-
- eshell = e_shell_get_default ();
-
- if (eshell == NULL) {
- GError *error = NULL;
-
- eshell = g_initable_new (
- E_TYPE_SHELL, NULL, &error,
- "application-id", "org.gnome.Evolution",
- "flags", G_APPLICATION_HANDLES_OPEN | G_APPLICATION_HANDLES_COMMAND_LINE,
- "geometry", NULL,
- "module-directory", EVOLUTION_MODULEDIR,
- "meego-mode", TRUE,
- "express-mode", TRUE,
- "small-screen-mode", TRUE,
- "online", TRUE,
- NULL);
-
- if (error != NULL)
- g_error ("%s", error->message);
-
- e_shell_load_modules (eshell);
- }
-
- shell->priv->backend = E_MAIL_BACKEND (e_shell_get_backend_by_name (eshell, "mail"));
- session = e_mail_backend_get_session (shell->priv->backend);
-
- shell->view = mail_view_new ();
- shell->view->backend = shell->priv->backend;
- gtk_widget_show ((GtkWidget *) shell->view);
- gtk_box_pack_end ((GtkBox *) priv->box, (GtkWidget *) shell->view, TRUE, TRUE, 2);
-
- mail_config_init (session);
- mail_msg_init ();
-
- if (just_druid) {
- MailViewChild *mc;
-
- gtk_notebook_set_show_tabs ((GtkNotebook *) shell->view, FALSE);
- mc = mail_view_add_page ((MailView *) shell->view, MAIL_VIEW_ACCOUNT, NULL);
- g_signal_connect (
- mc, "view-close",
- G_CALLBACK (ms_show_post_druid), shell);
- } else
- shell->priv->settings_view = mail_view_add_page ((MailView *) shell->view, MAIL_VIEW_SETTINGS, NULL);
-
-}
-
-GtkWidget *
-mail_capplet_shell_new (gint socket_id,
- gboolean just_druid,
- gboolean main_loop)
-{
- MailCappletShell *shell = g_object_new (MAIL_CAPPLET_SHELL_TYPE, NULL);
- mail_capplet_shell_construct (shell, socket_id, just_druid, main_loop);
-
- return GTK_WIDGET (shell);
-}
diff --git a/capplet/settings/mail-capplet-shell.h b/capplet/settings/mail-capplet-shell.h
deleted file mode 100644
index 5ddbe4cba8..0000000000
--- a/capplet/settings/mail-capplet-shell.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@gnome.org>
- * Srinivasa Ragavan <srini@linux.intel.com>
- *
- * Copyright (C) 2010 Intel Corporation. (www.intel.com)
- *
- */
-
-#ifndef _MAIL_CAPPLET_SHELL_H_
-#define _MAIL_CAPPLET_SHELL_H_
-
-#include <gtk/gtk.h>
-#include "mail-view.h"
-
-#define MAIL_CAPPLET_SHELL_TYPE (mail_capplet_shell_get_type ())
-#define MAIL_CAPPLET_SHELL(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_CAPPLET_SHELL_TYPE, MailCappletShell))
-#define MAIL_CAPPLET_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MAIL_CAPPLET_SHELL_TYPE, MailCappletShellClass))
-#define IS_MAIL_CAPPLET_SHELL(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_CAPPLET_SHELL_TYPE))
-#define IS_MAIL_CAPPLET_SHELL_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_CAPPLET_SHELL_TYPE))
-#define MAIL_CAPPLET_SHELL_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_CAPPLET_SHELL_TYPE, MailCappletShellClass))
-
-typedef struct _MailCappletShellPrivate MailCappletShellPrivate;
-
-typedef struct _MailCappletShell {
- GtkWindow parent;
- MailView *view;
-
- MailCappletShellPrivate *priv;
-} MailCappletShell;
-
-typedef struct _MailCappletShellClass {
- GtkWindowClass parent_class;
-
- void (* ctrl_w_pressed) (MailCappletShell *class);
- void (* ctrl_q_pressed) (MailCappletShell *class);
-} MailCappletShellClass;
-
-GType mail_capplet_shell_get_type (void);
-GtkWidget * mail_capplet_shell_new (gint socket_id,
- gboolean just_druid,
- gboolean main_loop);
-
-#endif
-
diff --git a/capplet/settings/mail-settings-view.c b/capplet/settings/mail-settings-view.c
deleted file mode 100644
index d302aca057..0000000000
--- a/capplet/settings/mail-settings-view.c
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-
-#include "mail-settings-view.h"
-#include "mail-view.h"
-
-struct _MailSettingsViewPrivate {
- GtkWidget *tab_str;
-
- GtkWidget *scroll;
- GtkWidget *box;
-
-#if 0 /* ACCOUNT_MGMT */
- EAccountList *accounts;
-#endif /* ACCOUNT_MGMT */
-};
-
-G_DEFINE_TYPE (MailSettingsView, mail_settings_view, GTK_TYPE_VBOX)
-
-enum {
- VIEW_CLOSE,
- SHOW_ACCOUNT,
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-static void msv_regen_view (MailSettingsView *acview);
-
-static void
-mail_settings_view_init (MailSettingsView *shell)
-{
- shell->priv = g_new0 (MailSettingsViewPrivate, 1);
-}
-
-static void
-mail_settings_view_class_init (MailSettingsViewClass *class)
-{
- GObjectClass * object_class = G_OBJECT_CLASS (class);
-
- signals[VIEW_CLOSE] =
- g_signal_new ("view-close",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (MailSettingsViewClass , view_close),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
- signals[SHOW_ACCOUNT] =
- g_signal_new ("show-account",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (MailSettingsViewClass , show_account),
- NULL, NULL,
- g_cclosure_marshal_VOID__POINTER,
- G_TYPE_NONE, 1, G_TYPE_POINTER);
-
-}
-
-static void
-msv_edit_account (GtkButton *button,
- MailSettingsView *msv)
-{
-#if 0 /* ACCOUNT_MGMT */
- EAccount *acc = g_object_get_data((GObject *)button, "account");
-
- g_signal_emit (msv, signals[SHOW_ACCOUNT], 0, acc);
-#endif /* ACCOUNT_MGMT */
-}
-
-static void
-msv_delete_account (GtkButton *button,
- MailSettingsView *msv)
-{
-#if 0 /* ACCOUNT_MGMT */
- EAccount *account = g_object_get_data((GObject *)button, "account");
- EAccountList *account_list = e_get_account_list ();
-
- e_account_list_remove (account_list, account);
-
- e_account_list_save (account_list);
-
- msv_regen_view (msv);
-#endif /* ACCOUNT_MGMT */
-}
-
-#if 0 /* ACCOUNT_MGMT */
-static void
-msv_account_added (EAccountList *al,
- EAccount *account,
- MailSettingsView *msv)
-{
- msv_regen_view (msv);
-}
-#endif /* ACCOUNT_MGMT */
-
-#define PACK_BOX(w,s) box = gtk_hbox_new(FALSE, 0); gtk_box_pack_start((GtkBox *)box, w, FALSE, FALSE, s); gtk_widget_show(box); gtk_widget_show(w); gtk_box_pack_start((GtkBox *)acview->priv->box, box, FALSE, FALSE, 3);
-
-#if 0 /* ACCOUNT_MGMT */
-static void
-build_account_button (MailSettingsView *acview,
- EAccount *account)
-{
- GtkWidget *box, *box1, *label, *tbox, *tlabel;
- gchar *tmp;
-
- box1 = gtk_hbox_new (FALSE, 0);
- gtk_widget_show (box1);
-
- label = gtk_button_new ();
- tbox = gtk_hbox_new (FALSE, 0);
-
- if (FALSE) {
- tlabel = (GtkWidget *)gtk_image_new_from_stock (account ? "gtk-edit" : "gtk-new", GTK_ICON_SIZE_BUTTON);
- gtk_widget_show (tlabel);
- gtk_box_pack_start ((GtkBox *) tbox, tlabel, FALSE, FALSE, 6);
- }
-
- if (account)
- tmp = g_strdup_printf (_("Modify %s..."), e_account_get_string(account, E_ACCOUNT_ID_ADDRESS));
- else
- tmp = _("Add a new account");
- tlabel = gtk_label_new (tmp);
- if (account)
- g_free (tmp);
- gtk_widget_show (tlabel);
- gtk_box_pack_start ((GtkBox *) tbox, tlabel, FALSE, FALSE, 0);
- gtk_widget_show (tbox);
- gtk_container_add ((GtkContainer *) label, tbox);
- g_object_set_data ((GObject *)label, "account", account);
- g_signal_connect (
- label, "clicked",
- G_CALLBACK (msv_edit_account), acview);
- gtk_box_pack_start ((GtkBox *) box1, label, FALSE, FALSE, 0);
- gtk_widget_show (label);
-
- if (account) {
- tlabel = gtk_button_new_from_stock ("gtk-delete");
- gtk_box_pack_start ((GtkBox *) box1, tlabel, FALSE, FALSE, 12);
- gtk_widget_show (tlabel);
- g_object_set_data ((GObject *)tlabel, "account", account);
- g_signal_connect (
- tlabel, "clicked",
- G_CALLBACK (msv_delete_account), acview);
- }
-
- PACK_BOX (box1,24);
-}
-#endif /* ACCOUNT_MGMT */
-
-static void
-msv_regen_view (MailSettingsView *acview)
-{
-#if 0 /* ACCOUNT_MGMT */
- EAccount *account;
- EAccountList *accounts = acview->priv->accounts;
- EIterator *node;
- GtkWidget *box, *label;
- gchar *buff;
-
- gtk_container_foreach ((GtkContainer *) acview->priv->box, (GtkCallback) gtk_widget_destroy, NULL);
-
- label = gtk_label_new (NULL);
- buff = g_markup_printf_escaped ("<span size=\"large\" weight=\"bold\">%s</span>", _("Account management"));
- gtk_label_set_markup ((GtkLabel *) label, buff);
- g_free (buff);
- PACK_BOX (label,12);
-
- node = e_list_get_iterator ((EList *) accounts);
- while (e_iterator_is_valid (node)) {
- account = (EAccount *) e_iterator_get (node);
- build_account_button (acview, account);
- e_iterator_next (node);
- }
- g_object_unref (node);
- build_account_button (acview, NULL);
-#endif /* ACCOUNT_MGMT */
-}
-
-static void
-mail_settings_view_construct (MailSettingsView *acview)
-{
- acview->priv->scroll = gtk_scrolled_window_new (NULL, NULL);
- gtk_widget_show (acview->priv->scroll);
- gtk_container_add ((GtkContainer *) acview, acview->priv->scroll);
- gtk_scrolled_window_set_policy ((GtkScrolledWindow *) acview->priv->scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
- acview->priv->box = gtk_vbox_new (FALSE, 0);
- gtk_widget_show (acview->priv->box);
- gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *) acview->priv->scroll, acview->priv->box);
-
-#if 0 /* ACCOUNT_MGMT */
- acview->priv->accounts = e_get_account_list ();
- g_signal_connect (
- acview->priv->accounts, "account-added",
- G_CALLBACK (msv_account_added), acview);
-#endif /* ACCOUNT_MGMT */
- msv_regen_view (acview);
- gtk_widget_show ((GtkWidget *) acview);
-
-}
-
-MailSettingsView *
-mail_settings_view_new ()
-{
- MailSettingsView *view = g_object_new (MAIL_SETTINGS_VIEW_TYPE, NULL);
- view->type = MAIL_VIEW_SETTINGS;
- view->uri = "settings://";
-
- mail_settings_view_construct (view);
-
- return view;
-}
-
-static void
-msv_close (GtkButton *w,
- MailSettingsView *mfv)
-{
- g_signal_emit (mfv, signals[VIEW_CLOSE], 0);
-}
-
-GtkWidget *
-mail_settings_view_get_tab_widget (MailSettingsView *mcv)
-{
- GdkPixbuf *pbuf = gtk_widget_render_icon ((GtkWidget *)mcv, "gtk-close", GTK_ICON_SIZE_MENU, NULL);
-
- GtkWidget *tool, *box, *img;
- gint w=-1, h=-1;
- GtkWidget *tab_label;
-
- img = gtk_image_new_from_pixbuf (pbuf);
-
- tool = gtk_button_new ();
- gtk_button_set_relief ((GtkButton *) tool, GTK_RELIEF_NONE);
- gtk_button_set_focus_on_click ((GtkButton *) tool, FALSE);
- gtk_widget_set_tooltip_text (tool, _("Close Tab"));
- g_signal_connect (
- tool, "clicked",
- G_CALLBACK (msv_close), mcv);
-
- box = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start ((GtkBox *) box, img, FALSE, FALSE, 0);
- gtk_container_add ((GtkContainer *) tool, box);
- gtk_widget_show_all (tool);
- gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (tool) , GTK_ICON_SIZE_MENU, &w, &h);
- gtk_widget_set_size_request (tool, w + 2, h + 2);
-
- box = gtk_label_new (_("Settings"));
- tab_label = gtk_hbox_new (FALSE, 0);
- gtk_box_pack_start ((GtkBox *) tab_label, box, FALSE, FALSE, 2);
-#ifndef ANJAL_SETTINGS
- gtk_box_pack_start ((GtkBox *) tab_label, tool, FALSE, FALSE, 0);
-#endif
- gtk_widget_show_all (tab_label);
-
- return tab_label;
-
-}
-
-void
-mail_settings_view_activate (MailSettingsView *mcv,
- GtkWidget *tree,
- GtkWidget *folder_tree,
- GtkWidget *check_mail,
- GtkWidget *sort_by,
- GtkWidget *slider,
- gboolean act)
-{
- if (!check_mail || !sort_by)
- return;
- gtk_widget_set_sensitive (check_mail, TRUE);
- gtk_widget_set_sensitive (sort_by, FALSE);
-}
diff --git a/capplet/settings/mail-settings-view.h b/capplet/settings/mail-settings-view.h
deleted file mode 100644
index 299d25b5e7..0000000000
--- a/capplet/settings/mail-settings-view.h
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef _MAIL_SETTINGS_VIEW_H_
-#define _MAIL_SETTINGS_VIEW_H_
-
-#include <gtk/gtk.h>
-#include "mail-view.h"
-
-#define MAIL_SETTINGS_VIEW_TYPE (mail_settings_view_get_type ())
-#define MAIL_SETTINGS_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_SETTINGS_VIEW_TYPE, MailFolderView))
-#define MAIL_SETTINGS_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MAIL_SETTINGS_VIEW_TYPE, MailFolderViewClass))
-#define IS_MAIL_SETTINGS_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_SETTINGS_VIEW_TYPE))
-#define IS_MAIL_SETTINGS_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_SETTINGS_VIEW_TYPE))
-#define MAIL_SETTINGS_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_SETTINGS_VIEW_TYPE, MailFolderViewClass))
-
-typedef struct _MailSettingsViewPrivate MailSettingsViewPrivate;
-
-typedef struct _MailSettingsView {
- GtkVBox parent;
- gint type;
- const gchar *uri;
- MailViewFlags flags;
- /* Base class of MailChildView ends */
-
- MailSettingsViewPrivate *priv;
-} MailSettingsView;
-
-typedef struct _MailSettingsViewClass {
- GtkVBoxClass parent_class;
-
- void (* view_close) (MailSettingsView *);
- void (* show_account) (MailSettingsView *, gpointer);
-} MailSettingsViewClass;
-
-GType mail_settings_view_get_type (void);
-MailSettingsView *mail_settings_view_new (void);
-GtkWidget * mail_settings_view_get_tab_widget (MailSettingsView *mcv);
-void mail_settings_view_activate (MailSettingsView *mcv, GtkWidget *tree, GtkWidget *folder_tree, GtkWidget *check_mail, GtkWidget *sort_by, GtkWidget *slider, gboolean act);
-#endif
diff --git a/capplet/settings/mail-view.c b/capplet/settings/mail-view.c
deleted file mode 100644
index dfc50f50da..0000000000
--- a/capplet/settings/mail-view.c
+++ /dev/null
@@ -1,656 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#include <glib/gi18n.h>
-#include "mail/em-utils.h"
-#include "mail/mail-send-recv.h"
-#include "libemail-engine/mail-ops.h"
-#include "mail-view.h"
-#ifndef ANJAL_SETTINGS
-#include "mail-folder-view.h"
-#include "mail-composer-view.h"
-#include "mail-conv-view.h"
-#endif
-
-#include "mail-settings-view.h"
-
-#include "anjal-mail-view.h"
-#include "mail-account-view.h"
-#include "mail/em-folder-tree.h"
-#include <shell/e-shell-searchbar.h>
-
-#define MAIL_VIEW_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE \
- ((obj), MAIL_VIEW_TYPE, MailViewPrivate))
-
-struct _MailViewPrivate {
- GtkWidget *box;
- GList *children;
- MailViewChild *current_view;
- GtkWidget *new;
- GtkWidget *search;
- GtkWidget *search_entry;
-};
-
-enum {
- VIEW_NEW,
- LAST_SIGNAL
-};
-
-static guint signals[LAST_SIGNAL] = { 0 };
-
-G_DEFINE_TYPE (MailView, mail_view, ANJAL_MAIL_VIEW_TYPE)
-#ifndef ANJAL_SETTINGS
-static MailConvView * mv_switch_message_view (MailView *mv, const gchar *uri);
-#endif
-
-#define REALIGN_NODES(list,pdata) if (list->data != pdata) { \
- list = g_list_remove (list, pdata); \
- list = g_list_prepend (list, pdata); \
- }
-
-void anjal_shell_view_restore_state (EShellView *view, const gchar *uri);
-
-static void
-mail_view_init (MailView *shell)
-{
- shell->priv = MAIL_VIEW_GET_PRIVATE (shell);
-}
-
-static void
-mail_view_finalize (GObject *object)
-{
- MailViewPrivate *priv;
-
- priv = MAIL_VIEW_GET_PRIVATE (object);
-
- g_list_free (priv->children);
-
- G_OBJECT_CLASS (mail_view_parent_class)->finalize (object);
-}
-
-static void
-mv_set_folder_uri (AnjalMailView *mv,
- const gchar *uri)
-{
-#ifndef ANJAL_SETTINGS
- mail_view_set_folder_uri ((MailView *) mv, uri);
-#endif
-}
-
-static void
-set_folder_tree (AnjalMailView *mv,
- EMFolderTree *tree)
-{
- mail_view_set_folder_tree ((MailView *) mv, (GtkWidget *) tree);
-}
-
-static void
-set_search (AnjalMailView *mv,
- const gchar *search)
-{
-#ifndef ANJAL_SETTINGS
- mail_view_set_search ((MailView *) mv, search);
-#endif
-}
-
-static void
-mail_view_class_init (MailViewClass *class)
-{
- GObjectClass *object_class;
-
- g_type_class_add_private (class, sizeof (MailViewPrivate));
-
- object_class = G_OBJECT_CLASS (class);
- object_class->finalize = mail_view_finalize;
-
- signals[VIEW_NEW] =
- g_signal_new ("view-new",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (MailViewClass , view_new),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
-
- ((AnjalMailViewClass *) class)->set_folder_uri = mv_set_folder_uri;
- ((AnjalMailViewClass *) class)->set_folder_tree = set_folder_tree;
- ((AnjalMailViewClass *) class)->set_search = set_search;
-
-};
-
-static void
-mv_switch (GtkNotebook *notebook,
- GtkWidget *page,
- guint page_num,
- gpointer user_data)
-{
- MailView *shell = (MailView *) notebook;
- MailViewPrivate *priv = shell->priv;
- MailViewChild *curr = priv->current_view;
- MailViewChild *child;
- gint current_child = gtk_notebook_get_current_page (notebook);
-
- curr->flags &= ~MAIL_VIEW_HOLD_FOCUS;
-
- child = (MailViewChild *) gtk_notebook_get_nth_page (notebook, current_child);
-
- priv->current_view = child;
- REALIGN_NODES (shell->priv->children,child);
-
-#ifndef ANJAL_SETTINGS
- if (child->type == MAIL_VIEW_COMPOSER)
- mail_composer_view_activate ((MailComposerView *) child, shell->folder_tree, shell->check_mail, shell->sort_by, TRUE);
- else if (child->type == MAIL_VIEW_MESSAGE)
- mail_conv_view_activate ((MailConvView *) child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
- else if (child->type == MAIL_VIEW_FOLDER) {
- mail_folder_view_activate ((MailFolderView *) child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, shell->slider, TRUE);
- anjal_shell_view_restore_state (shell->shell_view, child->uri);
- } else if (child->type == MAIL_VIEW_ACCOUNT)
- mail_account_view_activate ((MailAccountView *) child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
- else if (child->type == MAIL_VIEW_SETTINGS)
- mail_settings_view_activate ((MailSettingsView *) child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, shell->slider, FALSE);
-#else
- if (child->type == MAIL_VIEW_ACCOUNT)
- mail_account_view_activate ((MailAccountView *) child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, FALSE);
- else if (child->type == MAIL_VIEW_SETTINGS)
- mail_settings_view_activate ((MailSettingsView *) child, shell->tree, shell->folder_tree, shell->check_mail, shell->sort_by, shell->slider, FALSE);
-#endif
-}
-
-static void
-mail_view_construct (MailView *shell)
-{
- gtk_notebook_set_show_tabs ((GtkNotebook *) shell, TRUE);
- gtk_notebook_set_scrollable ((GtkNotebook *) shell, TRUE);
- gtk_notebook_popup_disable ((GtkNotebook *) shell);
-
- g_signal_connect_after (
- shell, "switch-page",
- G_CALLBACK (mv_switch), shell);
-}
-
-MailView *
-mail_view_new ()
-{
- MailView *shell = g_object_new (MAIL_VIEW_TYPE, NULL);
- mail_view_construct (shell);
-
- return shell;
-}
-
-static gint
-mv_get_page_number (GtkNotebook *note,
- GtkWidget *widget)
-{
- gint i, total;
-
- total = gtk_notebook_get_n_pages (note);
- for (i = 0; i < total; i++) {
- if (gtk_notebook_get_nth_page (note, i) == widget)
- return i;
- }
-
- return total - 1;
-}
-
-static void
-mv_close_mcv (MailViewChild *mfv,
- MailView *mv)
-{
- gint n = mv_get_page_number ((GtkNotebook *) mv, (GtkWidget *) mfv);
- gint pos = gtk_notebook_get_current_page ((GtkNotebook *) mv);
- MailViewChild *child;
- gboolean removing_viewed = FALSE;
-
- if (g_list_length (mv->priv->children) == 1)
- return;
-
-#ifndef ANJAL_SETTINGS
- /* Make sure atleast one folder view is open. */
- if (mfv->type == MAIL_VIEW_FOLDER) {
- GList *tmp = mv->priv->children;
- gboolean found = FALSE;
-
- while (!found && tmp) {
- MailViewChild *tchild = (MailViewChild *) tmp->data;
-
- if (tchild && tchild != mfv && tchild->type == MAIL_VIEW_FOLDER)
- found = true;
- tmp = tmp->next;
- }
-
- if (!found)
- return;
- }
-
- if (mfv->type == MAIL_VIEW_COMPOSER) {
- if (!mail_composer_view_can_quit ((MailComposerView *) mfv))
- return;
- }
-#endif
-
- g_signal_handlers_block_by_func (mv, mv_switch, mv);
- gtk_notebook_remove_page ((GtkNotebook *) mv, n);
- g_signal_handlers_unblock_by_func (mv, mv_switch, mv);
-
- if (mfv == mv->priv->children->data)
- removing_viewed = TRUE;
- mv->priv->children = g_list_remove (mv->priv->children, mfv);
-
- if (!removing_viewed)
- return;
-
- child = (MailViewChild *) mv->priv->children->data;
- mv->priv->current_view = child;
- pos = mv_get_page_number ((GtkNotebook *) mv, (GtkWidget *) child);
- gtk_notebook_set_current_page ((GtkNotebook *) mv, pos);
-
-#ifndef ANJAL_SETTINGS
- if (child->type == MAIL_VIEW_COMPOSER)
- mail_composer_view_activate ((MailComposerView *) child, mv->folder_tree, mv->check_mail, mv->sort_by, TRUE);
- else if (child->type == MAIL_VIEW_MESSAGE)
- mail_conv_view_activate ((MailConvView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
- else if (child->type == MAIL_VIEW_FOLDER) {
- mail_folder_view_activate ((MailFolderView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, TRUE);
- anjal_shell_view_restore_state ((EShellView *) mv->shell_view, child->uri);
- } else if (child->type == MAIL_VIEW_ACCOUNT)
- mail_account_view_activate ((MailAccountView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
- else if (child->type == MAIL_VIEW_SETTINGS)
- mail_settings_view_activate ((MailSettingsView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
-#else
- if (child->type == MAIL_VIEW_ACCOUNT)
- mail_account_view_activate ((MailAccountView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
- else if (child->type == MAIL_VIEW_SETTINGS)
- mail_settings_view_activate ((MailSettingsView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
-
-#endif
-}
-
-#ifndef ANJAL_SETTINGS
-static void
-mv_message_new (MailFolderView *mfv,
- gpointer data,
- gchar *umid,
- MailView *mv)
-{
- MailConvView *conv = (MailConvView *) mv_switch_message_view (mv, umid);
- *(MailConvView **)data = conv;
-
- if (conv)
- conv->uri = g_strdup (umid);
-
- return;
-}
-
-static void
-mv_search_set (MailFolderView *mfv,
- MailView *mv)
-{
- anjal_shell_view_restore_state (mv->shell_view, ((MailViewChild *) mfv)->uri);
-}
-
-static void
-mv_folder_loaded (MailFolderView *mfv,
- MailView *mv)
-{
- g_signal_handlers_block_by_func (mfv, mv_folder_loaded, mv);
- g_signal_emit (mv, signals[VIEW_NEW], 0);
-}
-
-static MailViewChild *
-mail_view_add_folder (MailView *mv,
- gpointer data,
- gboolean block)
-{
- MailFolderView *mfv = mail_folder_view_new ();
- gint position = 0;
- mail_folder_view_set_folder_pane (mfv, mv->folder_tree);
- if (!block)
- mv->priv->current_view = (MailViewChild *) mfv;
- mv->priv->children = block ? g_list_append (mv->priv->children, mfv) : g_list_prepend (mv->priv->children, mfv);
- position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) mfv, mfv->tab_label);
- gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mfv, TRUE);
- gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) mfv, FALSE);
-
- g_signal_connect (
- mfv, "view-close",
- G_CALLBACK (mv_close_mcv), mv);
-
- if (!block)
- gtk_notebook_set_current_page ((GtkNotebook *) mv, position);
-
- g_signal_connect (
- mfv, "message-shown",
- G_CALLBACK (mv_message_shown), mv);
- g_signal_connect (
- mfv, "message-new",
- G_CALLBACK (mv_message_new), mv);
- g_signal_connect (
- mfv, "search-set",
- G_CALLBACK (mv_search_set), mv);
- g_signal_connect (
- mfv, "view-loaded",
- G_CALLBACK (mv_folder_loaded), mv);
-
- if (!block)
- mail_folder_view_activate (mfv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, TRUE);
-
- return (MailViewChild *) mfv;
-}
-
-static MailViewChild *
-mail_view_add_composer (MailView *mv,
- gpointer data,
- gboolean block)
-{
- MailComposerView *mcv;
- gint position = 0;
- gboolean special = FALSE;
-
- if (!data)
- mcv = mail_composer_view_new ();
- else if (data == (gpointer) - 1) {
- special = TRUE;
- data = NULL;
- } else
- mcv = mail_composer_view_new_with_composer ((GtkWidget *) data);
- if (!block)
- mv->priv->current_view = (MailViewChild *) mcv;
- mv->priv->children = block ? g_list_append (mv->priv->children, mcv) : g_list_prepend (mv->priv->children, mcv);
-
- if (!special)
- position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label);
- else {
- gint position = gtk_notebook_get_current_page ((GtkNotebook *) mv);
- gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mcv->tab_label, position + 1);
- }
-
- gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, TRUE);
- gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, FALSE);
- if (!block)
- gtk_notebook_set_current_page ((GtkNotebook *) mv, position);
- if (!block)
- mail_composer_view_activate (mcv, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
-
- g_signal_connect (
- mcv, "view-close",
- G_CALLBACK (mv_close_mcv), mv);
- g_signal_connect (
- mcv, "message-shown",
- G_CALLBACK (mv_message_shown), mv);
-
- return (MailViewChild *) mcv;
-}
-
-static MailViewChild *
-mail_view_add_message (MailView *mv,
- gpointer data,
- gboolean block)
-{
- MailConvView *mcv = mail_conv_view_new ();
- gint position = 0;
-
- gtk_widget_show ((GtkWidget *) mcv);
- mcv->type = MAIL_VIEW_MESSAGE;
- if (!block)
- mv->priv->current_view = (MailViewChild *) mcv;
- mv->priv->children = block ? g_list_append (mv->priv->children, mcv) : g_list_prepend (mv->priv->children, mcv);
-
- position = gtk_notebook_get_current_page ((GtkNotebook *) mv);
- gtk_notebook_insert_page ((GtkNotebook *) mv, (GtkWidget *) mcv, mail_conv_view_get_tab_widget (mcv), position + 1);
- gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, TRUE);
- gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) mcv, FALSE);
- if (!block)
- gtk_notebook_set_current_page ((GtkNotebook *) mv, position + 1);
- if (!block)
- mail_conv_view_activate (mcv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
-
- g_signal_connect (
- mcv, "view-close",
- G_CALLBACK (mv_close_mcv), mv);
- g_signal_connect (
- mcv, "message-shown",
- G_CALLBACK (mv_message_shown), mv);
-
- return (MailViewChild *) mcv;
-}
-
-#endif
-
-#if 0 /* ACCOUNT_MGMT */
-static void
-mv_show_acc_mcv (MailViewChild *mfv,
- EAccount *account,
- MailView *mv)
-{
- mail_view_add_page (mv, MAIL_VIEW_ACCOUNT, account);
-}
-#endif /* ACCOUNT_MGMT */
-
-static MailViewChild *
-mail_view_add_settings (MailView *mv,
- gpointer data,
- gboolean block)
-{
- MailSettingsView *msv = mail_settings_view_new ();
- gint position = 0;
-
- gtk_widget_show ((GtkWidget *) msv);
- if (!block)
- mv->priv->current_view = (MailViewChild *) msv;
- mv->priv->children = block ? g_list_append (mv->priv->children, msv) : g_list_prepend (mv->priv->children, msv);
-
- position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) msv, mail_settings_view_get_tab_widget (msv));
- g_signal_connect (
- msv, "view-close",
- G_CALLBACK (mv_close_mcv), mv);
-#if 0 /* ACCOUNT_MGMT */
- g_signal_connect (
- msv, "show-account",
- G_CALLBACK (mv_show_acc_mcv), mv);
-#endif /* ACCOUNT_MGMT */
- gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, TRUE);
- gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, FALSE);
- if (!block)
- gtk_notebook_set_current_page ((GtkNotebook *) mv, position);
- if (!block)
- mail_settings_view_activate (msv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, mv->slider, FALSE);
-
- return (MailViewChild *) msv;
-}
-
-static MailViewChild *
-mail_view_add_account (MailView *mv,
- gpointer data,
- gboolean block)
-{
-#if 0 /* ACCOUNT_MGMT */
- MailAccountView *msv;
- gint position = 0;
-
- msv = mail_account_view_new (data, mv->backend);
- gtk_widget_show ((GtkWidget *) msv);
- if (!block)
- mv->priv->current_view = (MailViewChild *) msv;
- mv->priv->children = block ? g_list_append (mv->priv->children, msv) : g_list_prepend (mv->priv->children, msv);
- position = gtk_notebook_append_page ((GtkNotebook *) mv, (GtkWidget *) msv, mail_account_view_get_tab_widget (msv));
- g_signal_connect_after (
- msv, "view-close",
- G_CALLBACK (mv_close_mcv), mv);
- gtk_notebook_set_tab_reorderable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, TRUE);
- gtk_notebook_set_tab_detachable (GTK_NOTEBOOK (mv), (GtkWidget *) msv, FALSE);
- if (!block)
- gtk_notebook_set_current_page ((GtkNotebook *) mv, position);
- if (!block)
- mail_account_view_activate (msv, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
-
- return (MailViewChild *) msv;
-#endif /* ACCOUNT_MGMT */
-
- return NULL;
-}
-
-MailViewChild *
-mail_view_add_page (MailView *mv,
- guint16 type,
- gpointer data)
-{
- MailViewChild *child = NULL, *current_child;
- gboolean block = FALSE;
-
- current_child = mv->priv->current_view;
- if (current_child && (current_child->flags & MAIL_VIEW_HOLD_FOCUS))
- block = TRUE;
-
- g_signal_handlers_block_by_func (mv, mv_switch, mv);
- switch (type) {
-#ifndef ANJAL_SETTINGS
- case MAIL_VIEW_FOLDER:
- child = mail_view_add_folder (mv, data, block);
- break;
-
- case MAIL_VIEW_COMPOSER:
- child = mail_view_add_composer (mv, data, block);
- break;
- case MAIL_VIEW_MESSAGE:
- child = mail_view_add_message (mv, data, block);
- break;
-#endif
- case MAIL_VIEW_SETTINGS:
- child = mail_view_add_settings (mv, data, block);
- break;
- case MAIL_VIEW_ACCOUNT:
- child = mail_view_add_account (mv, data, block);
- break;
- }
- gtk_widget_grab_focus ((GtkWidget *) child);
- child->type = type;
- g_signal_handlers_unblock_by_func (mv, mv_switch, mv);
-
- child->flags = 0;
-
- return child;
-}
-
-#ifndef ANJAL_SETTINGS
-static void
-mv_switch_folder_view (MailView *mv,
- const gchar *uri)
-{
- gint i = 0, len = g_list_length (mv->priv->children);
- GList *tmp = mv->priv->children;
- while (i < len) {
- MailViewChild *child = (MailViewChild *) gtk_notebook_get_nth_page ((GtkNotebook *) mv, i);
-
- if (child->type == MAIL_VIEW_FOLDER && !strcmp (uri, child->uri)) {
- if (child != mv->priv->current_view) {
- gtk_notebook_set_current_page ((GtkNotebook *) mv, i);
- }
- return;
- }
- i++;
- tmp = tmp->next;
- }
-
- mail_view_add_page (mv, MAIL_VIEW_FOLDER, NULL);
- mail_folder_view_set_folder_uri ((MailFolderView *) mv->priv->current_view, uri);
-}
-
-static MailConvView *
-mv_switch_message_view (MailView *mv,
- const gchar *uri)
-{
- gint i = 0;
- GList *tmp = mv->priv->children;
- while (tmp) {
- MailViewChild *child = tmp->data;
- if (child->type == MAIL_VIEW_MESSAGE && !strcmp (uri, child->uri)) {
- gtk_notebook_set_current_page ((GtkNotebook *) mv, i);
- mail_conv_view_activate ((MailConvView *) child, mv->tree, mv->folder_tree, mv->check_mail, mv->sort_by, FALSE);
- REALIGN_NODES (mv->priv->children,child);
- return NULL;
- }
- i++;
- tmp = tmp->next;
- }
-
- return (MailConvView *) mail_view_add_page (mv, MAIL_VIEW_MESSAGE, NULL);
-}
-
-void
-mail_view_set_folder_uri (MailView *mv,
- const gchar *uri)
-{
-
- mv_switch_folder_view (mv, uri);
-}
-
-#endif
-void
-mail_view_close_view (MailView *mv)
-{
- MailViewChild *child = (MailViewChild *) mv->priv->current_view;
-
- mv_close_mcv (child, mv);
-}
-
-void
-mail_view_set_folder_tree (MailView *mv,
- GtkWidget *tree)
-{
- mv->tree = tree;
-}
-
-#ifndef ANJAL_SETTINGS
-static void
-mv_spinner_done (CamelFolder *f,
- gpointer data)
-{
- MailView *mv = (MailView *) data;
- mv_spinner_show (mv, FALSE);
-}
-
-void
-mail_view_set_search (MailView *mv,
- const gchar *search)
-{
- MailViewChild *child = (MailViewChild *) mv->priv->current_view;
-
- if (child && child->type == MAIL_VIEW_FOLDER) {
- MailFolderView *mfv = (MailFolderView *) child;
-
- mail_folder_view_set_search (mfv, search, e_shell_searchbar_get_search_text ((EShellSearchbar *) mv->priv->search_entry));
- }
-}
-#endif
-
-void
-mail_view_set_shell_view (MailView *mv,
- EShellView *shell)
-{
- mv->shell_view = shell;
-}
diff --git a/capplet/settings/mail-view.h b/capplet/settings/mail-view.h
deleted file mode 100644
index 3295cdb61c..0000000000
--- a/capplet/settings/mail-view.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * 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 <http://www.gnu.org/licenses/>
- *
- *
- * Authors:
- * Srinivasa Ragavan <sragavan@novell.com>
- *
- * Copyright (C) 2009 Novell, Inc. (www.novell.com)
- *
- */
-
-#ifndef _MAIL_VIEW_H_
-#define _MAIL_VIEW_H_
-
-#include <shell/e-shell-view.h>
-#include <mail/e-mail-backend.h>
-
-#include "anjal-mail-view.h"
-
-#define MAIL_VIEW_TYPE (mail_view_get_type ())
-#define MAIL_VIEW(o) (G_TYPE_CHECK_INSTANCE_CAST ((o), MAIL_VIEW_TYPE, MailView))
-#define MAIL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_CAST((k), MAIL_VIEW_TYPE, MailViewClass))
-#define IS_MAIL_VIEW(o) (G_TYPE_CHECK_INSTANCE_TYPE ((o), MAIL_VIEW_TYPE))
-#define IS_MAIL_VIEW_CLASS(k) (G_TYPE_CHECK_CLASS_TYPE ((k), MAIL_VIEW_TYPE))
-#define MAIL_VIEW_GET_CLASS(o) (G_TYPE_INSTANCE_GET_CLASS((o), MAIL_VIEW_TYPE, MailViewClass))
-
-enum {
- MAIL_VIEW_FOLDER = 1,
- MAIL_VIEW_COMPOSER,
- MAIL_VIEW_MESSAGE,
- MAIL_VIEW_ACCOUNT,
- MAIL_VIEW_SETTINGS
-};
-
-typedef struct _MailViewPrivate MailViewPrivate;
-
-typedef struct _MailView {
- AnjalMailView parent;
-
- EMailBackend *backend;
- GtkWidget *tree; /* Actual tree */
- GtkWidget *folder_tree;
- GtkWidget *slider;
- GtkWidget *check_mail;
- GtkWidget *sort_by;
- MailViewPrivate *priv;
- EShellView *shell_view;
-} MailView;
-
-typedef struct _MailViewClass {
- AnjalMailViewClass parent_class;
- void (* view_new) (MailView *);
-
-} MailViewClass;
-
-typedef enum {
- MAIL_VIEW_HOLD_FOCUS = 1,
-} MailViewFlags;
-
-typedef struct _MailViewChild {
- GtkVBox parent;
- gint type;
- gchar *uri;
- MailViewFlags flags;
-}MailViewChild;
-
-GType mail_view_get_type (void);
-MailView * mail_view_new (void);
-void mail_view_set_folder_uri (MailView *mv, const gchar *uri);
-void mail_view_close_view (MailView *mv);
-void mail_view_set_folder_tree (MailView *mv, GtkWidget *tree);
-MailViewChild * mail_view_add_page (MailView *mv, guint16 type, gpointer data);
-void mail_view_set_search (MailView *view, const gchar *search);
-void mail_view_set_shell_view (MailView *mv, EShellView *shell);
-
-#endif
diff --git a/configure.ac b/configure.ac
index af960211cc..27ad00ccaf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -293,20 +293,6 @@ AC_ARG_WITH([help],
AM_CONDITIONAL(WITH_HELP, test "x$with_help" != "xno")
AC_MSG_RESULT([$with_help])
-dnl ****************
-dnl Settings Capplet
-dnl ****************
-AC_MSG_CHECKING([whether to build the settings capplet])
-AC_ARG_WITH([capplet],
- [AS_HELP_STRING([--with-capplet],
- [Build the account settings capplet [default=no]])],
- [with_capplet="$withval"],[with_capplet="no"])
-if test "x$with_capplet" = "xyes"; then
- AC_DEFINE(WITH_CAPPLET, 1, [Define if building the settings capplet])
-fi
-AM_CONDITIONAL(WITH_CAPPLET, test "x$with_capplet" = "xyes")
-AC_MSG_RESULT([$with_capplet])
-
dnl ******************************
dnl iconv checking
dnl ******************************
@@ -1588,8 +1574,6 @@ smime/Makefile
smime/lib/Makefile
smime/gui/Makefile
sounds/Makefile
-capplet/Makefile
-capplet/settings/Makefile
evolution-zip
evolution-calendar.pc
evolution-mail.pc
diff --git a/data/Makefile.am b/data/Makefile.am
index 05a1d57f7a..9790533cb2 100644
--- a/data/Makefile.am
+++ b/data/Makefile.am
@@ -1,11 +1,7 @@
SUBDIRS = icons
-if WITH_CAPPLET
-evolution_settings_desktop_in = evolution-settings.desktop.in
-endif
-
desktopdir = $(datadir)/applications
-desktop_in_files = evolution.desktop.in $(evolution_settings_desktop_in)
+desktop_in_files = evolution.desktop.in
desktop_DATA = $(desktop_in_files:.desktop.in=.desktop)
autostartdir = $(sysconfdir)/xdg/autostart
diff --git a/modules/mail/Makefile.am b/modules/mail/Makefile.am
index 7d7f298b6c..74391b28ce 100644
--- a/modules/mail/Makefile.am
+++ b/modules/mail/Makefile.am
@@ -49,11 +49,6 @@ module_mail_la_SOURCES = \
em-network-prefs.c \
em-network-prefs.h
-if WITH_CAPPLET
-libevolution_mail_settings_la = \
- $(top_builddir)/capplet/settings/libevolution-mail-settings.la
-endif
-
module_mail_la_LIBADD = \
$(top_builddir)/libemail-utils/libemail-utils.la \
$(top_builddir)/libemail-engine/libemail-engine.la \
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c
index 2079d28cdc..8b00ccf0a2 100644
--- a/modules/mail/e-mail-shell-backend.c
+++ b/modules/mail/e-mail-shell-backend.c
@@ -33,10 +33,6 @@
#include <shell/e-shell.h>
#include <shell/e-shell-window.h>
-#ifdef WITH_CAPPLET
-#include <capplet/settings/mail-capplet-shell.h>
-#endif
-
#include <composer/e-msg-composer.h>
#include <widgets/misc/e-preferences-window.h>
@@ -793,11 +789,6 @@ e_mail_shell_backend_new_account (EMailShellBackend *mail_shell_backend,
EMailBackend *backend;
EMailSession *session;
-#ifdef WITH_CAPPLET
- EShell *shell;
- EShellBackend *shell_backend;
-#endif /* WITH_CAPPLET */
-
g_return_if_fail (mail_shell_backend != NULL);
g_return_if_fail (E_IS_MAIL_SHELL_BACKEND (mail_shell_backend));
@@ -811,14 +802,6 @@ e_mail_shell_backend_new_account (EMailShellBackend *mail_shell_backend,
backend = E_MAIL_BACKEND (mail_shell_backend);
session = e_mail_backend_get_session (backend);
-#ifdef WITH_CAPPLET
- shell_backend = E_SHELL_BACKEND (mail_shell_backend);
- shell = e_shell_backend_get_shell (shell_backend);
-
- if (e_shell_get_express_mode (shell))
- assistant = mail_capplet_shell_new (0, TRUE, FALSE);
-#endif /* WITH_CAPPLET */
-
if (assistant == NULL)
assistant = e_mail_config_assistant_new (session);
diff --git a/modules/startup-wizard/Makefile.am b/modules/startup-wizard/Makefile.am
index 4e0aa52038..0642691c49 100644
--- a/modules/startup-wizard/Makefile.am
+++ b/modules/startup-wizard/Makefile.am
@@ -21,11 +21,6 @@ module_startup_wizard_la_SOURCES = \
e-mail-config-import-progress-page.h \
$(NULL)
-if WITH_CAPPLET
-libevolution_mail_settings_la = \
- $(top_builddir)/capplet/settings/libevolution-mail-settings.la
-endif
-
module_startup_wizard_la_LIBADD = \
$(top_builddir)/e-util/libeutil.la \
$(top_builddir)/shell/libeshell.la \
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
index ef3cdb5afe..1ddeaa5168 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -32,10 +32,6 @@
#include <mail/e-mail-config-assistant.h>
#include <mail/e-mail-config-welcome-page.h>
-#ifdef WITH_CAPPLET
-#include <capplet/settings/mail-capplet-shell.h>
-#endif
-
#include "e-startup-assistant.h"
#include "e-mail-config-import-page.h"
#include "e-mail-config-import-progress-page.h"
@@ -105,14 +101,6 @@ startup_wizard_new_assistant (EStartupWizard *extension)
return e_startup_assistant_new (session);
}
-#ifdef WITH_CAPPLET
-static GtkWidget *
-startup_wizard_new_capplet (EStartupWizard *extension)
-{
- return mail_capplet_shell_new (0, TRUE, TRUE);
-}
-#endif /* WITH_CAPPLET */
-
static gboolean
startup_wizard_have_mail_account (EStartupWizard *extension)
{
@@ -194,11 +182,6 @@ startup_wizard_run (EStartupWizard *extension)
if (express_mode && g_strcmp0 (startup_view, "mail") != 0)
return;
-#ifdef WITH_CAPPLET
- if (express_mode)
- window = startup_wizard_new_capplet (extension);
-#endif /* WITH_CAPPLET */
-
if (window == NULL) {
window = startup_wizard_new_assistant (extension);
g_signal_connect (
diff --git a/po/POTFILES.in b/po/POTFILES.in
index c62210b7a2..5265689c54 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -119,12 +119,6 @@ calendar/gui/tasktypes.xml
calendar/gui/weekday-picker.c
calendar/importers/icalendar-importer.c
calendar/zones.h
-capplet/anjal-settings-main.c
-capplet/settings/anjal-mail-view.c
-capplet/settings/mail-account-view.c
-capplet/settings/mail-capplet-shell.c
-capplet/settings/mail-settings-view.c
-capplet/settings/mail-view.c
composer/e-composer-actions.c
composer/e-composer-header.c
composer/e-composer-header-table.c