aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--capplet/settings/mail-account-view.c1
-rw-r--r--capplet/settings/mail-capplet-shell.c4
-rw-r--r--capplet/settings/mail-capplet-shell.h3
-rw-r--r--configure.ac4
-rw-r--r--e-util/e-config.c37
-rw-r--r--e-util/e-config.h1
-rw-r--r--mail/em-account-editor.c66
-rw-r--r--mail/em-account-editor.h10
-rw-r--r--modules/Makefile.am1
-rw-r--r--modules/mail/em-account-prefs.c16
-rw-r--r--modules/startup-wizard/Makefile.am30
-rw-r--r--modules/startup-wizard/evolution-startup-wizard.c620
-rw-r--r--plugins/startup-wizard/Makefile.am39
-rw-r--r--plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml25
-rw-r--r--plugins/startup-wizard/startup-wizard.c295
-rw-r--r--po/POTFILES.in3
-rw-r--r--shell/e-shell.c8
17 files changed, 743 insertions, 420 deletions
diff --git a/capplet/settings/mail-account-view.c b/capplet/settings/mail-account-view.c
index 54401412e2..4410fa475d 100644
--- a/capplet/settings/mail-account-view.c
+++ b/capplet/settings/mail-account-view.c
@@ -1004,6 +1004,7 @@ mail_account_view_construct (MailAccountView *view)
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, "org.gnome.evolution.mail.config.accountWizard", view->wpages);
+ gtk_widget_hide (e_config_create_widget (E_CONFIG (view->edit->config)));
view->edit->emae_check_servers = emae_check_servers;
if (!view->original) {
e_account_set_bool (em_account_editor_get_modified_account(view->edit), E_ACCOUNT_SOURCE_SAVE_PASSWD, TRUE);
diff --git a/capplet/settings/mail-capplet-shell.c b/capplet/settings/mail-capplet-shell.c
index 33b22f80be..d27e4d85fc 100644
--- a/capplet/settings/mail-capplet-shell.c
+++ b/capplet/settings/mail-capplet-shell.c
@@ -274,13 +274,13 @@ mail_capplet_shell_toolbar_height (MailCappletShell *shell)
return allocation.height;
}
-MailCappletShell *
+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 shell;
+ return GTK_WIDGET (shell);
}
#define PERSONAL_RELATIVE_URI "system"
diff --git a/capplet/settings/mail-capplet-shell.h b/capplet/settings/mail-capplet-shell.h
index 5845973065..05159a5595 100644
--- a/capplet/settings/mail-capplet-shell.h
+++ b/capplet/settings/mail-capplet-shell.h
@@ -51,8 +51,7 @@ typedef struct _MailCappletShellClass {
} MailCappletShellClass;
GType mail_capplet_shell_get_type (void);
-MailCappletShell *
- mail_capplet_shell_new (gint socket_id,
+GtkWidget * mail_capplet_shell_new (gint socket_id,
gboolean just_druid,
gboolean main_loop);
gint mail_capplet_shell_toolbar_height
diff --git a/configure.ac b/configure.ac
index f9938df788..4cf822b083 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1435,7 +1435,7 @@ AC_ARG_ENABLE([plugins],
[enable_plugins="$enableval"],[enable_plugins=all])
dnl Add any new plugins here
-plugins_base_always="calendar-file calendar-http itip-formatter plugin-manager default-source addressbook-file startup-wizard mark-all-read groupwise-features publish-calendar caldav imap-features google-account-setup webdav-account-setup"
+plugins_base_always="calendar-file calendar-http itip-formatter plugin-manager default-source addressbook-file mark-all-read groupwise-features publish-calendar caldav imap-features google-account-setup webdav-account-setup"
plugins_base="$plugins_base_always $SA_JUNK_PLUGIN $BF_JUNK_PLUGIN"
dist_plugins_base="$plugins_base_always calendar-weather sa-junk-plugin bogo-junk-plugin"
@@ -1785,6 +1785,7 @@ modules/connman/Makefile
modules/plugin-lib/Makefile
modules/plugin-mono/Makefile
modules/plugin-python/Makefile
+modules/startup-wizard/Makefile
modules/windows-sens/Makefile
plugins/Makefile
plugins/addressbook-file/Makefile
@@ -1817,7 +1818,6 @@ plugins/pst-import/Makefile
plugins/publish-calendar/Makefile
plugins/sa-junk-plugin/Makefile
plugins/save-calendar/Makefile
-plugins/startup-wizard/Makefile
plugins/subject-thread/Makefile
plugins/templates/Makefile
plugins/tnef-attachments/Makefile
diff --git a/e-util/e-config.c b/e-util/e-config.c
index e8eedffef8..39f4087dac 100644
--- a/e-util/e-config.c
+++ b/e-util/e-config.c
@@ -404,7 +404,8 @@ ec_assistant_find_page (EConfig *ec, GtkWidget *page, gint *page_index)
if (wn->frame == page
&& (wn->item->type == E_CONFIG_PAGE
|| wn->item->type == E_CONFIG_PAGE_START
- || wn->item->type == E_CONFIG_PAGE_FINISH))
+ || wn->item->type == E_CONFIG_PAGE_FINISH
+ || wn->item->type == E_CONFIG_PAGE_PROGRESS))
break;
link = g_list_next (link);
@@ -503,7 +504,8 @@ ec_assistant_forward (gint current_page, gpointer user_data)
if (!wn->empty && wn->frame != NULL
&& (wn->item->type == E_CONFIG_PAGE
|| wn->item->type == E_CONFIG_PAGE_START
- || wn->item->type == E_CONFIG_PAGE_FINISH))
+ || wn->item->type == E_CONFIG_PAGE_FINISH
+ || wn->item->type == E_CONFIG_PAGE_PROGRESS))
break;
}
}
@@ -559,9 +561,10 @@ ec_rebuild (EConfig *emp)
/* If the last section doesn't contain any visible widgets, hide it */
if (sectionnode != NULL
&& sectionnode->frame != NULL
- && (item->type == E_CONFIG_PAGE_START
+ && (item->type == E_CONFIG_PAGE
+ || item->type == E_CONFIG_PAGE_START
|| item->type == E_CONFIG_PAGE_FINISH
- || item->type == E_CONFIG_PAGE
+ || item->type == E_CONFIG_PAGE_PROGRESS
|| item->type == E_CONFIG_SECTION
|| item->type == E_CONFIG_SECTION_TABLE)) {
if ((sectionnode->empty = (itemno == 0 || n_visible_widgets == 0))) {
@@ -586,9 +589,10 @@ ec_rebuild (EConfig *emp)
/* If the last page doesn't contain anything, hide it */
if (pagenode != NULL
&& pagenode->frame != NULL
- && (item->type == E_CONFIG_PAGE_START
+ && (item->type == E_CONFIG_PAGE
+ || item->type == E_CONFIG_PAGE_START
|| item->type == E_CONFIG_PAGE_FINISH
- || item->type == E_CONFIG_PAGE)) {
+ || item->type == E_CONFIG_PAGE_PROGRESS)) {
if ((pagenode->empty = sectionno == 0)) {
gtk_widget_hide(pagenode->frame);
pageno--;
@@ -727,7 +731,8 @@ ec_rebuild (EConfig *emp)
sectionnode = NULL;
sectionno = 1; /* never want to hide these */
break;
- case E_CONFIG_PAGE: {
+ case E_CONFIG_PAGE:
+ case E_CONFIG_PAGE_PROGRESS:
/* CONFIG_PAGEs depend on the config type.
E_CONFIG_BOOK:
The page is a VBox, stored in the notebook.
@@ -739,6 +744,11 @@ ec_rebuild (EConfig *emp)
g_warning("EConfig page defined before container widget: %s", item->path);
break;
}
+ if (item->type == E_CONFIG_PAGE_PROGRESS &&
+ emp->type != E_CONFIG_ASSISTANT) {
+ g_warning("EConfig assistant progress pages can't be used on E_CONFIG_BOOKs");
+ break;
+ }
if (item->factory) {
page = item->factory(emp, item, root, wn->frame, wn->context->data);
@@ -763,7 +773,7 @@ ec_rebuild (EConfig *emp)
} else {
gtk_assistant_prepend_page (GTK_ASSISTANT (assistant), page);
}
- gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, GTK_ASSISTANT_PAGE_CONTENT);
+ gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page, item->type == E_CONFIG_PAGE ? GTK_ASSISTANT_PAGE_CONTENT : GTK_ASSISTANT_PAGE_PROGRESS);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page, translated_label);
gtk_widget_show_all (page);
@@ -794,7 +804,7 @@ ec_rebuild (EConfig *emp)
wn->widget = page;
if (page)
g_signal_connect(page, "destroy", G_CALLBACK(gtk_widget_destroyed), &wn->widget);
- break; }
+ break;
case E_CONFIG_SECTION:
case E_CONFIG_SECTION_TABLE:
/* The section factory is always called with
@@ -1314,7 +1324,8 @@ e_config_page_get(EConfig *ec, const gchar *pageid)
if (!wn->empty
&& (wn->item->type == E_CONFIG_PAGE
|| wn->item->type == E_CONFIG_PAGE_START
- || wn->item->type == E_CONFIG_PAGE_FINISH)
+ || wn->item->type == E_CONFIG_PAGE_FINISH
+ || wn->item->type == E_CONFIG_PAGE_PROGRESS)
&& !strcmp(wn->item->path, pageid))
return wn->frame;
@@ -1350,7 +1361,8 @@ e_config_page_next(EConfig *ec, const gchar *pageid)
if (!wn->empty
&& (wn->item->type == E_CONFIG_PAGE
|| wn->item->type == E_CONFIG_PAGE_START
- || wn->item->type == E_CONFIG_PAGE_FINISH)) {
+ || wn->item->type == E_CONFIG_PAGE_FINISH
+ || wn->item->type == E_CONFIG_PAGE_PROGRESS)) {
if (found)
return wn->item->path;
else if (strcmp(wn->item->path, pageid) == 0)
@@ -1389,7 +1401,8 @@ e_config_page_prev(EConfig *ec, const gchar *pageid)
if (!wn->empty
&& (wn->item->type == E_CONFIG_PAGE
|| wn->item->type == E_CONFIG_PAGE_START
- || wn->item->type == E_CONFIG_PAGE_FINISH)) {
+ || wn->item->type == E_CONFIG_PAGE_FINISH
+ || wn->item->type == E_CONFIG_PAGE_PROGRESS)) {
if (found)
return wn->item->path;
else if (strcmp(wn->item->path, pageid) == 0)
diff --git a/e-util/e-config.h b/e-util/e-config.h
index 77215b0b1d..6df90ceb52 100644
--- a/e-util/e-config.h
+++ b/e-util/e-config.h
@@ -133,6 +133,7 @@ enum _e_config_t {
E_CONFIG_PAGE,
E_CONFIG_PAGE_START, /* only allowed in assistant types */
E_CONFIG_PAGE_FINISH, /* only allowed in assistant types */
+ E_CONFIG_PAGE_PROGRESS, /* only allowed in assistant types */
E_CONFIG_SECTION,
E_CONFIG_SECTION_TABLE,
E_CONFIG_ITEM,
diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c
index 5c3c90e3b2..9476a05874 100644
--- a/mail/em-account-editor.c
+++ b/mail/em-account-editor.c
@@ -609,8 +609,17 @@ emae_display_license (EMAccountEditor *emae, CamelProvider *prov)
gtk_text_view_set_editable ((GtkTextView *)w, FALSE);
response = gtk_dialog_run ((GtkDialog *)dialog);
} else {
- e_alert_run_dialog_for_args (emae->editor ? (GtkWindow *)gtk_widget_get_toplevel (emae->editor) : e_shell_get_active_window (NULL),
- "mail:no-load-license", prov->license_file, NULL);
+ GtkWidget *editor;
+ GtkWindow *window;
+
+ editor = E_CONFIG (emae->config)->window;
+ if (editor != NULL)
+ window = (GtkWindow *) gtk_widget_get_toplevel (editor);
+ else
+ window = e_shell_get_active_window (NULL);
+ e_alert_run_dialog_for_args (
+ window, "mail:no-load-license",
+ prov->license_file, NULL);
}
gtk_widget_destroy (dialog);
@@ -1882,9 +1891,16 @@ emae_refresh_authtype (EMAccountEditor *emae, EMAccountEditorService *service)
camel_url_free (url);
}
-static void emae_check_authtype_done (const gchar *uri, CamelProviderType type, GList *types, gpointer data)
+static void
+emae_check_authtype_done (const gchar *uri,
+ CamelProviderType type,
+ GList *types,
+ gpointer data)
{
EMAccountEditorService *service = data;
+ GtkWidget *editor;
+
+ editor = E_CONFIG (service->emae->config)->window;
if (service->check_dialog) {
if (service->authtypes)
@@ -1895,41 +1911,52 @@ static void emae_check_authtype_done (const gchar *uri, CamelProviderType type,
gtk_widget_destroy (service->check_dialog);
}
- if (service->emae->editor)
- gtk_widget_set_sensitive (service->emae->editor, TRUE);
+ if (editor != NULL)
+ gtk_widget_set_sensitive (editor, TRUE);
service->check_id = -1;
g_object_unref (service->emae);
}
-static void emae_check_authtype_response (GtkWidget *d, gint button, EMAccountEditorService *service)
+static void
+emae_check_authtype_response (GtkWidget *d,
+ gint button,
+ EMAccountEditorService *service)
{
+ GtkWidget *editor;
+
+ editor = E_CONFIG (service->emae->config)->window;
+
mail_msg_cancel (service->check_id);
gtk_widget_destroy (service->check_dialog);
service->check_dialog = NULL;
- if (service->emae->editor)
- gtk_widget_set_sensitive (service->emae->editor, TRUE);
+ if (editor != NULL)
+ gtk_widget_set_sensitive (editor, TRUE);
}
-static void emae_check_authtype (GtkWidget *w, EMAccountEditorService *service)
+static void
+emae_check_authtype (GtkWidget *w,
+ EMAccountEditorService *service)
{
EMAccountEditor *emae = service->emae;
EAccount *account;
+ GtkWidget *editor;
const gchar *uri;
account = em_account_editor_get_modified_account (emae);
+ editor = E_CONFIG (service->emae->config)->window;
/* TODO: do we need to remove the auth mechanism from the uri? */
uri = e_account_get_string (account, emae_service_info[service->type].account_uri_key);
g_object_ref (emae);
- service->check_dialog = e_alert_dialog_new_for_args (emae->editor ? (GtkWindow *)gtk_widget_get_toplevel (emae->editor) : (GtkWindow *)gtk_widget_get_toplevel (w),
+ service->check_dialog = e_alert_dialog_new_for_args (editor ? (GtkWindow *)gtk_widget_get_toplevel (editor) : (GtkWindow *)gtk_widget_get_toplevel (w),
"mail:checking-service", NULL);
g_signal_connect (service->check_dialog, "response", G_CALLBACK(emae_check_authtype_response), service);
gtk_widget_show (service->check_dialog);
- if (emae->editor)
- gtk_widget_set_sensitive (emae->editor, FALSE);
+ if (editor != NULL)
+ gtk_widget_set_sensitive (editor, FALSE);
service->check_id = mail_check_service (uri, service->type, emae_check_authtype_done, service);
}
@@ -3363,13 +3390,6 @@ em_account_editor_commit (EMAccountEditor *emae)
}
static void
-emae_editor_destroyed (GtkWidget *dialog, EMAccountEditor *emae)
-{
- emae->editor = NULL;
- g_object_unref (emae);
-}
-
-static void
em_account_editor_construct (EMAccountEditor *emae, EMAccountEditorType type, const gchar *id)
{
EMAccountEditorPrivate *priv = emae->priv;
@@ -3464,13 +3484,5 @@ em_account_editor_construct (EMAccountEditor *emae, EMAccountEditorType type, co
account = em_account_editor_get_modified_account (emae);
target = em_config_target_new_account (ec, account);
e_config_set_target ((EConfig *)ec, (EConfigTarget *)target);
-
- if (type != EMAE_PAGES) {
- emae->editor = e_config_create_window ((EConfig *)ec, NULL, type==EMAE_NOTEBOOK?_("Account Editor"):_("Evolution Account Assistant"));
- g_signal_connect (emae->editor, "destroy", G_CALLBACK(emae_editor_destroyed), emae);
- } else {
- GtkWidget *noshow = e_config_create_widget ((EConfig *)ec);
- gtk_widget_hide (noshow);
- }
}
diff --git a/mail/em-account-editor.h b/mail/em-account-editor.h
index c864f1f3ed..a8128afb6c 100644
--- a/mail/em-account-editor.h
+++ b/mail/em-account-editor.h
@@ -77,7 +77,6 @@ struct _EMAccountEditor {
EMAccountEditorPrivate *priv;
EMAccountEditorType type;
- GtkWidget *editor; /* gtknotebook or gtkassistant, depending on type */
EMConfig *config; /* driver object */
@@ -108,15 +107,8 @@ EAccount * em_account_editor_get_original_account
void em_account_editor_commit (EMAccountEditor *emae);
gboolean em_account_editor_check (EMAccountEditor *emae,
const gchar *page);
-gboolean em_account_editor_save (EMAccountEditor *emae);
-void em_account_editor_destroy (EMAccountEditor *emae);
-void em_account_editor_build_extra_conf
- (EMAccountEditor *emae,
- const gchar *url);
-void em_account_editor_auto_detect_extra_conf
- (EMAccountEditor *emae);
GtkWidget * em_account_editor_get_widget (EMAccountEditor *emae,
- const gchar *name);
+ const gchar *name);
G_END_DECLS
diff --git a/modules/Makefile.am b/modules/Makefile.am
index f42e3000a7..75f7713b56 100644
--- a/modules/Makefile.am
+++ b/modules/Makefile.am
@@ -24,6 +24,7 @@ SUBDIRS = \
mail \
mailto-handler \
plugin-lib \
+ startup-wizard \
$(MONO_DIR) \
$(PYTHON_DIR) \
$(NETWORK_MANAGER_DIR) \
diff --git a/modules/mail/em-account-prefs.c b/modules/mail/em-account-prefs.c
index 0ac397fc72..90aaa968f7 100644
--- a/modules/mail/em-account-prefs.c
+++ b/modules/mail/em-account-prefs.c
@@ -124,7 +124,13 @@ account_prefs_add_account (EAccountManager *manager)
emae = em_account_editor_new (
NULL, EMAE_ASSISTANT,
"org.gnome.evolution.mail.config.accountAssistant");
- priv->assistant = emae->editor;
+ e_config_create_window (
+ E_CONFIG (emae->config), NULL,
+ _("Evolution Account Assistant"));
+ priv->assistant = E_CONFIG (emae->config)->window;
+ g_object_set_data_full (
+ G_OBJECT (priv->assistant), "AccountEditor",
+ emae, (GDestroyNotify) g_object_unref);
} else {
priv->assistant = mail_capplet_shell_new (0, TRUE, FALSE);
}
@@ -168,10 +174,14 @@ account_prefs_edit_account (EAccountManager *manager)
emae = em_account_editor_new (
account, EMAE_NOTEBOOK,
"org.gnome.evolution.mail.config.accountEditor");
- priv->editor = emae->editor;
+ e_config_create_window (
+ E_CONFIG (emae->config), parent, _("Account Editor"));
+ priv->editor = E_CONFIG (emae->config)->window;
+ g_object_set_data_full (
+ G_OBJECT (priv->editor), "AccountEditor",
+ emae, (GDestroyNotify) g_object_unref);
g_object_add_weak_pointer (G_OBJECT (priv->editor), &priv->editor);
- gtk_window_set_transient_for (GTK_WINDOW (priv->editor), parent);
gtk_widget_show (priv->editor);
}
diff --git a/modules/startup-wizard/Makefile.am b/modules/startup-wizard/Makefile.am
new file mode 100644
index 0000000000..90ee736f5c
--- /dev/null
+++ b/modules/startup-wizard/Makefile.am
@@ -0,0 +1,30 @@
+module_LTLIBRARIES = libevolution-module-startup-wizard.la
+
+libevolution_module_startup_wizard_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ -I$(top_srcdir) \
+ -I$(top_srcdir)/widgets \
+ -DG_LOG_DOMAIN=\"evolution-startup-wizard\" \
+ $(GNOME_PLATFORM_CFLAGS) \
+ $(EVOLUTION_CALENDAR_CFLAGS) \
+ $(EVOLUTION_MAIL_CFLAGS)
+
+libevolution_module_startup_wizard_la_SOURCES = \
+ evolution-startup-wizard.c
+
+libevolution_module_startup_wizard_la_LIBADD = \
+ $(top_builddir)/e-util/libeutil.la \
+ $(top_builddir)/shell/libeshell.la \
+ $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \
+ $(top_builddir)/widgets/misc/libemiscwidgets.la \
+ $(top_builddir)/calendar/gui/libevolution-calendar.la \
+ $(top_builddir)/mail/libevolution-mail.la \
+ $(top_builddir)/capplet/settings/libevolution-mail-settings.la \
+ $(GNOME_PLATFORM_LIBS) \
+ $(EVOLUTION_CALENDAR_LIBS) \
+ $(EVOLUTION_MAIL_LIBS)
+
+libevolution_module_startup_wizard_la_LDFLAGS = \
+ -module -avoid-version $(NO_UNDEFINED)
+
+-include $(top_srcdir)/git.mk
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
new file mode 100644
index 0000000000..1b9cbcd9b0
--- /dev/null
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -0,0 +1,620 @@
+/*
+ * evolution-startup-wizard.c
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with the program; if not, see <http://www.gnu.org/licenses/>
+ *
+ */
+
+#include <config.h>
+#include <glib/gi18n-lib.h>
+
+#include <shell/e-shell.h>
+#include <e-util/e-account-utils.h>
+#include <e-util/e-alert-dialog.h>
+#include <e-util/e-extension.h>
+#include <e-util/e-import.h>
+
+#include <mail/em-account-editor.h>
+#include <capplet/settings/mail-capplet-shell.h>
+#include <calendar/gui/calendar-config.h>
+
+/* Standard GObject macros */
+#define E_TYPE_STARTUP_WIZARD \
+ (e_startup_wizard_get_type ())
+#define E_STARTUP_WIZARD(obj) \
+ (G_TYPE_CHECK_INSTANCE_CAST \
+ ((obj), E_TYPE_STARTUP_WIZARD, EStartupWizard))
+
+typedef struct _EStartupWizard EStartupWizard;
+typedef struct _EStartupWizardClass EStartupWizardClass;
+
+struct _EStartupWizard {
+ EExtension parent;
+
+ EConfig *config;
+
+ EImport *import;
+ EImportTarget *import_target;
+
+ /* Currently active importer. */
+ EImportImporter *import_importer;
+
+ /* List of available importers. */
+ GSList *import_importers;
+
+ /* List node of the active importer. */
+ GSList *import_iterator;
+
+ gboolean import_cancelled;
+ gint import_progress_page_num;
+ GtkWidget *import_progress_bar;
+ GtkWidget *import_cancelled_msg;
+ GtkWidget *import_completed_msg;
+};
+
+struct _EStartupWizardClass {
+ EExtensionClass parent_class;
+};
+
+/* Module Entry Points */
+void e_module_load (GTypeModule *type_module);
+void e_module_unload (GTypeModule *type_module);
+
+/* Forward Declarations */
+GType e_startup_wizard_get_type (void);
+
+G_DEFINE_DYNAMIC_TYPE (EStartupWizard, e_startup_wizard, E_TYPE_EXTENSION)
+
+G_GNUC_NORETURN static void
+startup_wizard_terminate (void) {
+ gtk_main_quit ();
+ _exit (0);
+}
+
+static EShell *
+startup_wizard_get_shell (EStartupWizard *extension)
+{
+ EExtensible *extensible;
+
+ extensible = e_extension_get_extensible (E_EXTENSION (extension));
+
+ return E_SHELL (extensible);
+}
+
+static void
+startup_wizard_import_status (EImport *import,
+ const gchar *what,
+ gint percentage,
+ EStartupWizard *extension)
+{
+ GtkProgressBar *progress_bar;
+ gfloat fraction;
+
+ fraction = (gfloat) (percentage / 100.0);
+ progress_bar = GTK_PROGRESS_BAR (extension->import_progress_bar);
+ gtk_progress_bar_set_fraction (progress_bar, fraction);
+ gtk_progress_bar_set_text (progress_bar, what);
+}
+
+static void
+startup_wizard_import_complete (EImport *import,
+ EStartupWizard *extension)
+{
+ EConfig *config = extension->config;
+
+ extension->import_importer = NULL;
+ extension->import_iterator = g_slist_next (extension->import_iterator);
+ e_config_target_changed (config, E_CONFIG_TARGET_CHANGED_STATE);
+}
+
+static gboolean
+startup_wizard_check_progress (EConfig *config,
+ const gchar *page_id,
+ EStartupWizard *extension)
+{
+ if (extension->import_cancelled)
+ goto cancelled;
+
+ if (extension->import_iterator == NULL)
+ goto completed;
+
+ gtk_widget_hide (extension->import_cancelled_msg);
+ gtk_widget_hide (extension->import_completed_msg);
+
+ extension->import_importer = extension->import_iterator->data;
+ startup_wizard_import_status (extension->import, "", 0, extension);
+
+ e_import_import (
+ extension->import,
+ extension->import_target,
+ extension->import_importer,
+ (EImportStatusFunc) startup_wizard_import_status,
+ (EImportCompleteFunc) startup_wizard_import_complete,
+ extension);
+
+ return FALSE;
+
+cancelled:
+
+ gtk_widget_show (extension->import_cancelled_msg);
+ startup_wizard_import_status (extension->import, "", 0, extension);
+
+ return TRUE;
+
+completed:
+
+ gtk_widget_show (extension->import_completed_msg);
+ startup_wizard_import_status (extension->import, "", 100, extension);
+
+ return TRUE;
+}
+
+static void
+startup_wizard_config_abort (EConfig *config,
+ GSList *items,
+ EStartupWizard *extension)
+{
+ GtkAssistant *assistant;
+ gint page_num;
+
+ assistant = GTK_ASSISTANT (config->widget);
+ page_num = gtk_assistant_get_current_page (assistant);
+
+ /* If we're not on the import progress page, terminate. */
+ if (page_num != extension->import_progress_page_num) {
+ startup_wizard_terminate ();
+ g_assert_not_reached ();
+ }
+
+ /* XXX Overloading the cancel button like this is a bit evil,
+ * but if we're on the import progress page and the import
+ * has already been cancelled, terminate. */
+ if (extension->import_cancelled) {
+ startup_wizard_terminate ();
+ g_assert_not_reached ();
+ }
+
+ e_import_cancel (
+ extension->import,
+ extension->import_target,
+ extension->import_importer);
+
+ extension->import_cancelled = TRUE;
+ e_config_target_changed (config, E_CONFIG_TARGET_CHANGED_STATE);
+
+ /* Prevent EConfig from destroying the GtkAssistant. */
+ g_signal_stop_emission_by_name (assistant, "cancel");
+}
+
+static void
+startup_wizard_config_commit (EConfig *config,
+ GSList *items,
+ EStartupWizard *extension)
+{
+ EShell *shell;
+ EShellSettings *shell_settings;
+ gchar *location;
+
+ shell = startup_wizard_get_shell (extension);
+ shell_settings = e_shell_get_shell_settings (shell);
+
+ /* Use System Timezone by default. */
+ e_shell_settings_set_boolean (
+ shell_settings, "cal-use-system-timezone", TRUE);
+ location = e_cal_util_get_system_timezone_location ();
+ e_shell_settings_set_string (
+ shell_settings, "cal-timezone-string", location);
+ g_free (location);
+
+ gtk_main_quit ();
+}
+
+static void
+startup_wizard_config_free (EConfig *config,
+ GSList *items,
+ EStartupWizard *extension)
+{
+ while (items != NULL) {
+ EConfigItem *config_item = items->data;
+
+ g_free (config_item->path);
+ g_object_unref (config_item->user_data);
+ g_slice_free (EConfigItem, config_item);
+
+ items = g_slist_delete_link (items, items);
+ }
+
+ g_object_unref (extension);
+}
+
+static GtkWidget *
+startup_wizard_importer_page (EConfig *config,
+ EConfigItem *item,
+ GtkAssistant *assistant,
+ GtkWidget *old,
+ EStartupWizard *extension)
+{
+ GtkWidget *container;
+ GtkWidget *widget;
+ GtkWidget *page;
+ GSList *list, *iter;
+ const gchar *title;
+ guint n_importers;
+ gint row = 0;
+
+ list = extension->import_importers;
+ n_importers = g_slist_length (list);
+
+ /* Skip this page if there's nothing to import. */
+ if (n_importers == 0)
+ return NULL;
+
+ page = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (page), 12);
+ gtk_widget_show (page);
+
+ container = page;
+
+ widget = gtk_label_new (
+ _("Please select the information "
+ "that you would like to import:"));
+ gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.5);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ widget = gtk_hseparator_new ();
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ widget = gtk_table_new (n_importers, 2, FALSE);
+ gtk_table_set_col_spacings (GTK_TABLE (widget), 12);
+ gtk_table_set_row_spacings (GTK_TABLE (widget), 12);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ for (iter = list; iter != NULL; iter = iter->next) {
+ EImportImporter *importer = iter->data;
+ gchar *text;
+
+ widget = e_import_get_widget (
+ extension->import,
+ extension->import_target, importer);
+ if (widget == NULL)
+ continue;
+ gtk_table_attach (
+ GTK_TABLE (container), widget,
+ 1, 2, row, row + 1, GTK_FILL, 0, 0, 0);
+ gtk_widget_show (widget);
+
+ text = g_strdup_printf (_("From %s:"), importer->name);
+ widget = gtk_label_new (text);
+ gtk_misc_set_alignment (GTK_MISC (widget), 0.0, 0.0);
+ gtk_table_attach (
+ GTK_TABLE (container), widget,
+ 0, 1, row, row + 1, GTK_FILL, GTK_FILL, 0, 0);
+ gtk_widget_show (widget);
+
+ row++;
+ }
+
+ title = _("Importing Files");
+ gtk_assistant_append_page (assistant, page);
+ gtk_assistant_set_page_title (assistant, page, title);
+
+ return page;
+}
+
+static GtkWidget *
+startup_wizard_progress_page (EConfig *config,
+ EConfigItem *item,
+ GtkAssistant *assistant,
+ GtkWidget *old,
+ EStartupWizard *extension)
+{
+ GtkSizeGroup *size_group;
+ GtkWidget *container;
+ GtkWidget *widget;
+ GtkWidget *page;
+ const gchar *title;
+ gint page_num;
+
+ /* Skip this page if there's nothing to import. */
+ if (extension->import_importers == NULL)
+ return NULL;
+
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+
+ page = gtk_vbox_new (FALSE, 12);
+ gtk_container_set_border_width (GTK_CONTAINER (page), 12);
+ gtk_widget_show (page);
+
+ container = page;
+
+ /* Just a spacer. */
+ widget = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
+ gtk_size_group_add_widget (size_group, widget);
+ gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ gtk_widget_show (widget);
+
+ widget = gtk_progress_bar_new ();
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ extension->import_progress_bar = widget;
+ gtk_widget_show (widget);
+
+ widget = gtk_vbox_new (FALSE, 12);
+ gtk_size_group_add_widget (size_group, widget);
+ gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
+ gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ extension->import_cancelled_msg = widget;
+ gtk_widget_show (widget);
+
+ widget = gtk_alignment_new (0.5, 0.0, 0.0, 0.0);
+ gtk_box_pack_start (GTK_BOX (container), widget, TRUE, TRUE, 0);
+ extension->import_completed_msg = widget;
+ gtk_widget_show (widget);
+
+ container = extension->import_cancelled_msg;
+
+ widget = gtk_hbox_new (FALSE, 6);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = gtk_image_new_from_stock (
+ GTK_STOCK_CANCEL, GTK_ICON_SIZE_MENU);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ widget = gtk_label_new (
+ _("Import cancelled. Click \"Forward\" to continue."));
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ container = extension->import_completed_msg;
+
+ widget = gtk_hbox_new (FALSE, 6);
+ gtk_container_add (GTK_CONTAINER (container), widget);
+ gtk_widget_show (widget);
+
+ container = widget;
+
+ widget = gtk_image_new_from_icon_name (
+ "emblem-default", GTK_ICON_SIZE_MENU);
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ widget = gtk_label_new (
+ _("Import complete. Click \"Forward\" to continue."));
+ gtk_box_pack_start (GTK_BOX (container), widget, FALSE, FALSE, 0);
+ gtk_widget_show (widget);
+
+ title = _("Importing Files");
+ page_num = gtk_assistant_append_page (assistant, page);
+ gtk_assistant_set_page_title (assistant, page, title);
+
+ extension->import_progress_page_num = page_num;
+
+ return page;
+}
+
+static GtkWidget *
+startup_wizard_new_assistant (EStartupWizard *extension)
+{
+ EMAccountEditor *emae;
+ EConfig *config;
+ EConfigItem *config_item;
+ GtkWidget *widget;
+ GSList *items = NULL;
+
+ emae = em_account_editor_new (
+ NULL, EMAE_ASSISTANT,
+ "org.gnome.evolution.mail.config.accountWizard");
+
+ config = E_CONFIG (emae->config);
+ extension->config = g_object_ref (config);
+
+ /* Insert the importer page. */
+
+ config_item = g_slice_new0 (EConfigItem);
+ config_item->type = E_CONFIG_PAGE;
+ config_item->path = g_strdup ("60.importers");
+ config_item->factory =
+ (EConfigItemFactoryFunc) startup_wizard_importer_page;
+ config_item->user_data = g_object_ref (extension);
+ items = g_slist_prepend (items, config_item);
+
+ /* Insert the progress page. */
+
+ config_item = g_slice_new0 (EConfigItem);
+ config_item->type = E_CONFIG_PAGE_PROGRESS;
+ config_item->path = g_strdup ("70.progress");
+ config_item->factory =
+ (EConfigItemFactoryFunc) startup_wizard_progress_page;
+ config_item->user_data = g_object_ref (extension);
+ items = g_slist_prepend (items, config_item);
+
+ e_config_add_items (
+ config, items,
+ (EConfigItemsFunc) startup_wizard_config_commit,
+ (EConfigItemsFunc) startup_wizard_config_abort,
+ (EConfigItemsFunc) startup_wizard_config_free,
+ g_object_ref (extension));
+
+ e_config_add_page_check (
+ config, "70.progress", (EConfigCheckFunc)
+ startup_wizard_check_progress, extension);
+
+ e_config_create_window (config, NULL, _("Evolution Setup Assistant"));
+
+ /* Additional tweaks. The window must be created at this point. */
+
+ widget = e_config_page_get (config, "0.start");
+ gtk_assistant_set_page_title (
+ GTK_ASSISTANT (config->widget), widget, _("Welcome"));
+
+ widget = em_account_editor_get_widget (emae, "start_page_label");
+ gtk_label_set_text (
+ GTK_LABEL (widget),
+ _("Welcome to Evolution. The next few screens will "
+ "allow Evolution to connect to your email accounts, "
+ "and to import files from other applications. \n\n"
+ "Please click the \"Forward\" button to continue. "));
+
+ /* Finalize the EMAccountEditor along with the GtkAssistant. */
+ g_object_set_data_full (
+ G_OBJECT (config->window), "AccountEditor",
+ emae, (GDestroyNotify) g_object_unref);
+
+ return config->window;
+}
+
+static GtkWidget *
+startup_wizard_new_capplet (EStartupWizard *extension)
+{
+ GtkWidget *capplet;
+
+ capplet = mail_capplet_shell_new (0, TRUE, TRUE);
+
+ g_signal_connect (
+ capplet, "destroy",
+ G_CALLBACK (gtk_main_quit), NULL);
+
+ return capplet;
+}
+
+static void
+startup_wizard_run (EStartupWizard *extension)
+{
+ EShell *shell;
+ GtkWidget *window;
+ EAccountList *account_list;
+ const gchar *startup_view;
+ gboolean express_mode;
+
+ shell = e_shell_get_default ();
+ express_mode = e_shell_get_express_mode (shell);
+ startup_view = e_shell_get_startup_view (shell);
+
+ account_list = e_get_account_list ();
+ if (e_list_length (E_LIST (account_list)) > 0)
+ return;
+
+ if (express_mode && g_strcmp0 (startup_view, "mail") != 0)
+ return;
+
+ if (express_mode)
+ window = startup_wizard_new_capplet (extension);
+ else
+ window = startup_wizard_new_assistant (extension);
+
+ g_signal_connect (
+ window, "delete-event",
+ G_CALLBACK (startup_wizard_terminate), NULL);
+
+ gtk_widget_show (window);
+
+ gtk_main ();
+}
+
+static void
+startup_wizard_dispose (GObject *object)
+{
+ EStartupWizard *extension;
+
+ extension = E_STARTUP_WIZARD (object);
+
+ if (extension->config != NULL) {
+ g_object_unref (extension->config);
+ extension->config = NULL;
+ }
+
+ if (extension->import != NULL) {
+ e_import_target_free (
+ extension->import,
+ extension->import_target);
+ g_object_unref (extension->import);
+ extension->import_target = NULL;
+ extension->import = NULL;
+ }
+
+ g_slist_free (extension->import_importers);
+ extension->import_importers = NULL;
+
+ /* Chain up to parent's dispose() method. */
+ G_OBJECT_CLASS (e_startup_wizard_parent_class)->dispose (object);
+}
+
+static void
+startup_wizard_constructed (GObject *object)
+{
+ EStartupWizard *extension;
+ EShell *shell;
+
+ extension = E_STARTUP_WIZARD (object);
+ shell = startup_wizard_get_shell (extension);
+
+ g_signal_connect_swapped (
+ shell, "event::ready-to-start",
+ G_CALLBACK (startup_wizard_run), extension);
+}
+
+static void
+e_startup_wizard_class_init (EStartupWizardClass *class)
+{
+ GObjectClass *object_class;
+ EExtensionClass *extension_class;
+
+ object_class = G_OBJECT_CLASS (class);
+ object_class->dispose = startup_wizard_dispose;
+ object_class->constructed = startup_wizard_constructed;
+
+ extension_class = E_EXTENSION_CLASS (class);
+ extension_class->extensible_type = E_TYPE_SHELL;
+}
+
+static void
+e_startup_wizard_class_finalize (EStartupWizardClass *class)
+{
+}
+
+static void
+e_startup_wizard_init (EStartupWizard *extension)
+{
+ extension->import =
+ e_import_new ("org.gnome.evolution.shell.importer");
+ extension->import_target = (EImportTarget *)
+ e_import_target_new_home (extension->import);
+ extension->import_importers = e_import_get_importers (
+ extension->import, extension->import_target);
+ extension->import_iterator = extension->import_importers;
+}
+
+G_MODULE_EXPORT void
+e_module_load (GTypeModule *type_module)
+{
+ e_startup_wizard_register_type (type_module);
+}
+
+G_MODULE_EXPORT void
+e_module_unload (GTypeModule *type_module)
+{
+}
diff --git a/plugins/startup-wizard/Makefile.am b/plugins/startup-wizard/Makefile.am
deleted file mode 100644
index 589b61ef37..0000000000
--- a/plugins/startup-wizard/Makefile.am
+++ /dev/null
@@ -1,39 +0,0 @@
-plugin_LTLIBRARIES = liborg-gnome-evolution-startup-wizard.la
-
-@EVO_PLUGIN_RULE@
-
-plugin_DATA = org-gnome-evolution-startup-wizard.eplug
-
-liborg_gnome_evolution_startup_wizard_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- -I . \
- -I$(top_srcdir) \
- -I$(top_srcdir)/widgets \
- -I$(top_builddir)/shell \
- $(GNOME_PLATFORM_CFLAGS) \
- $(EVOLUTION_CALENDAR_CFLAGS) \
- $(EVOLUTION_MAIL_CFLAGS)
-
-liborg_gnome_evolution_startup_wizard_la_SOURCES = \
- startup-wizard.c
-
-liborg_gnome_evolution_startup_wizard_la_LIBADD = \
- $(top_builddir)/e-util/libeutil.la \
- $(top_builddir)/shell/libeshell.la \
- $(top_builddir)/widgets/e-timezone-dialog/libetimezonedialog.la \
- $(top_builddir)/widgets/misc/libemiscwidgets.la \
- $(top_builddir)/calendar/gui/libevolution-calendar.la \
- $(top_builddir)/mail/libevolution-mail.la \
- $(top_builddir)/capplet/settings/libevolution-mail-settings.la \
- $(EVOLUTION_CALENDAR_LIBS) \
- $(EVOLUTION_MAIL_LIBS) \
- $(GNOME_PLATFORM_LIBS)
-
-liborg_gnome_evolution_startup_wizard_la_LDFLAGS = -module -avoid-version $(NO_UNDEFINED)
-
-EXTRA_DIST = org-gnome-evolution-startup-wizard.eplug.xml
-
-BUILT_SOURCES = $(plugin_DATA)
-CLEANFILES = $(BUILT_SOURCES)
-
--include $(top_srcdir)/git.mk
diff --git a/plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml b/plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml
deleted file mode 100644
index e52cd6a71e..0000000000
--- a/plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<?xml version="1.0"?>
-<e-plugin-list>
- <e-plugin
- type="shlib"
- id="org.gnome.evolution.plugin.startup-wizard"
- location="@PLUGINDIR@/liborg-gnome-evolution-startup-wizard@SOEXT@"
- _name="Setup Assistant">
- <author name="JP Rosevear" email="jpr@novell.com"/>
- <_description>Guides you through your initial account setup.</_description>
- <hook class="org.gnome.evolution.shell.events:1.0">
- <event
- id="upgrade.done"
- handle="startup_wizard"
- target="upgrade"
- />
- </hook>
-
- <hook class="org.gnome.evolution.mail.config:1.0">
- <group target="account" id="org.gnome.evolution.mail.config.accountWizard" commit="startup_wizard_commit" abort="startup_wizard_abort">
- <item type="page" path="60.importers" factory="startup_wizard_importer_page"/>
- </group>
- </hook>
-
- </e-plugin>
-</e-plugin-list>
diff --git a/plugins/startup-wizard/startup-wizard.c b/plugins/startup-wizard/startup-wizard.c
deleted file mode 100644
index 904e630487..0000000000
--- a/plugins/startup-wizard/startup-wizard.c
+++ /dev/null
@@ -1,295 +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:
- * JP Rosevear <jpr@novell.com>
- *
- * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com)
- *
- */
-
-#include <unistd.h>
-#include <gconf/gconf-client.h>
-#include <glib/gi18n.h>
-#include <gtk/gtk.h>
-#include "e-util/e-alert-dialog.h"
-#include "e-util/e-import.h"
-#include "shell/e-shell.h"
-#include "shell/es-event.h"
-#include "mail/em-config.h"
-#include "mail/em-account-editor.h"
-#include "calendar/gui/calendar-config.h"
-
-#include "capplet/settings/mail-capplet-shell.h"
-
-gint e_plugin_lib_enable (EPlugin *ep, gint enable);
-void startup_wizard (EPlugin *ep, ESEventTargetUpgrade *target);
-GtkWidget *startup_wizard_importer_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data);
-gboolean startup_wizard_check (EPlugin *ep, EConfigHookPageCheckData *check_data);
-void startup_wizard_commit (EPlugin *ep, EMConfigTargetAccount *target);
-void startup_wizard_abort (EPlugin *ep, EMConfigTargetAccount *target) G_GNUC_NORETURN;
-
-static EImport *import;
-static EImportTargetHome *import_target;
-static EImportImporter *import_importer;
-static GtkWidget *import_dialog, *import_progress, *import_label;
-static GSList *import_iterator, *import_importers;
-
-gint
-e_plugin_lib_enable (EPlugin *ep, gint enable)
-{
- return 0;
-}
-
-G_GNUC_NORETURN static void
-startup_wizard_terminate (void) {
- gtk_main_quit ();
- _exit (0);
-}
-
-static void
-startup_wizard_close (void) {
- gtk_main_quit ();
-}
-
-void
-startup_wizard (EPlugin *ep, ESEventTargetUpgrade *target)
-{
- EShell *shell;
- GtkWidget *start_page;
- GtkLabel *start_page_label;
- GConfClient *client;
- GSList *accounts;
- EConfig *config;
- EMAccountEditor *emae;
- const gchar *req_view;
-
- shell = e_shell_get_default ();
- req_view = e_shell_get_startup_view (shell);
-
- if (req_view && strcmp (req_view, "mail") && e_shell_get_express_mode (shell)) {
- return;
- }
-
- client = gconf_client_get_default ();
- accounts = gconf_client_get_list (client, "/apps/evolution/mail/accounts", GCONF_VALUE_STRING, NULL);
- g_object_unref (client);
-
- if (accounts != NULL) {
- g_slist_foreach (accounts, (GFunc) g_free, NULL);
- g_slist_free (accounts);
-
- return;
- }
-
- if (e_shell_get_express_mode (shell)) {
- start_page = (GtkWidget *)mail_capplet_shell_new (0, TRUE, TRUE);
- gtk_widget_show (start_page);
-
- g_signal_connect (
- start_page, "delete-event",
- G_CALLBACK (startup_wizard_terminate), NULL);
- g_signal_connect (
- start_page, "destroy",
- G_CALLBACK (startup_wizard_close), NULL);
-
- gtk_main ();
-
- return;
- }
-
- /** @HookPoint-EMConfig: New Mail Account Wizard
- * @Id: org.gnome.evolution.mail.config.accountWizard
- * @Type: E_CONFIG_ASSISTANT
- * @Class: org.gnome.evolution.mail.config:1.0
- * @Target: EMConfigTargetAccount
- *
- * The new mail account assistant.
- */
- emae = em_account_editor_new (
- NULL, EMAE_ASSISTANT,
- "org.gnome.evolution.mail.config.accountWizard");
-
- gtk_window_set_title (
- GTK_WINDOW (emae->editor), _("Evolution Setup Assistant"));
-
- config = (EConfig *) emae->config;
- start_page = e_config_page_get (config, "0.start");
-
- gtk_assistant_set_page_title (GTK_ASSISTANT (config->widget), start_page, _("Welcome"));
- start_page_label = GTK_LABEL (em_account_editor_get_widget (emae, "start_page_label"));
- if (start_page_label) {
- gtk_label_set_text (start_page_label, _(""
- "Welcome to Evolution. The next few screens will allow Evolution to connect "
- "to your email accounts, and to import files from other applications. \n"
- "\n"
- "Please click the \"Forward\" button to continue. "));
- }
-
- g_signal_connect (
- emae->editor, "delete-event",
- G_CALLBACK (startup_wizard_terminate), NULL);
-
- gtk_widget_show (emae->editor);
-
- gtk_main ();
-}
-
-GtkWidget *
-startup_wizard_importer_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
-{
- GtkWidget *page, *label, *sep, *table;
- GSList *l;
- gint row=0;
-
- if (import == NULL) {
- import = e_import_new("org.gnome.evolution.shell.importer");
- import_target = e_import_target_new_home(import);
- import_importers = e_import_get_importers(import, (EImportTarget *)import_target);
- }
-
- if (import_importers == NULL)
- return NULL;
-
- page = gtk_vbox_new (FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (page), 12);
-
- label = gtk_label_new (_("Please select the information that you would like to import:"));
- gtk_box_pack_start (GTK_BOX (page), label, FALSE, FALSE, 3);
-
- sep = gtk_hseparator_new ();
- gtk_box_pack_start (GTK_BOX (page), sep, FALSE, FALSE, 3);
-
- table = gtk_table_new(g_slist_length(import_importers), 2, FALSE);
- for (l = import_importers; l; l = l->next) {
- EImportImporter *eii = l->data;
- gchar *str;
- /* *label already declared */
- GtkWidget *w, *label;
-
- w = e_import_get_widget(import, (EImportTarget *)import_target, eii);
-
- str = g_strdup_printf(_("From %s:"), eii->name);
- label = gtk_label_new(str);
- gtk_widget_show(label);
- g_free(str);
-
- gtk_misc_set_alignment((GtkMisc *)label, 0, .5);
-
- gtk_table_attach((GtkTable *)table, label, 0, 1, row, row+1, GTK_FILL, 0, 0, 0);
- if (w)
- gtk_table_attach((GtkTable *)table, w, 1, 2, row, row+1, GTK_FILL, 0, 3, 0);
- row++;
- }
-
- gtk_box_pack_start (GTK_BOX (page), table, FALSE, FALSE, 3);
-
- gtk_widget_show_all (page);
- gtk_assistant_append_page (GTK_ASSISTANT (hook_data->parent), page);
- gtk_assistant_set_page_title (GTK_ASSISTANT (hook_data->parent), page, _("Importing files"));
-
- return page;
-}
-
-static void
-import_status(EImport *import, const gchar *what, gint pc, gpointer d)
-{
- gtk_progress_bar_set_fraction((GtkProgressBar *)import_progress, (gfloat)(pc/100.0));
- gtk_progress_bar_set_text((GtkProgressBar *)import_progress, what);
-}
-
-static void
-import_dialog_response(GtkDialog *d, guint button, gpointer data)
-{
- if (button == GTK_RESPONSE_CANCEL)
- e_import_cancel(import, (EImportTarget *)import_target, import_importer);
-}
-
-static void
-import_done(EImport *ei, gpointer d)
-{
- if (import_iterator && (import_iterator = import_iterator->next)) {
- import_status(ei, "", 0, NULL);
- import_importer = import_iterator->data;
- e_import_import(import, (EImportTarget *)import_target, import_importer, import_status, import_done, NULL);
- } else {
- gtk_widget_destroy(import_dialog);
-
- g_slist_free(import_importers);
- import_importers = NULL;
- import_importer = NULL;
- e_import_target_free(import, (EImportTarget *)import_target);
- import_target = NULL;
- g_object_unref(import);
- import = NULL;
-
- gtk_main_quit();
- }
-}
-
-void
-startup_wizard_commit (EPlugin *ep, EMConfigTargetAccount *target)
-{
- EShell *shell;
- EShellSettings *shell_settings;
- GtkWidget *content_area;
- gchar *location;
-
- shell = e_shell_get_default ();
- shell_settings = e_shell_get_shell_settings (shell);
-
- /* Use System Timezone by default */
- e_shell_settings_set_boolean (
- shell_settings, "cal-use-system-timezone", TRUE);
- location = e_cal_util_get_system_timezone_location ();
- e_shell_settings_set_string (
- shell_settings, "cal-timezone-string", location);
- g_free (location);
-
- if (import_importers) {
- import_iterator = import_importers;
- import_importer = import_iterator->data;
-
- import_dialog = e_alert_dialog_new_for_args (
- e_shell_get_active_window (shell),
- "shell:importing", _("Importing data."), NULL);
- content_area = gtk_dialog_get_content_area (
- GTK_DIALOG (import_dialog));
- g_signal_connect (
- import_dialog, "response",
- G_CALLBACK (import_dialog_response), NULL);
- import_label = gtk_label_new(_("Please wait"));
- import_progress = gtk_progress_bar_new();
- gtk_box_pack_start (
- GTK_BOX (content_area),
- import_label, FALSE, FALSE, 0);
- gtk_box_pack_start (
- GTK_BOX (content_area),
- import_progress, FALSE, FALSE, 0);
- gtk_widget_show_all(import_dialog);
-
- e_import_import (
- import, (EImportTarget *) import_target,
- import_importer, import_status, import_done, NULL);
- } else {
- gtk_main_quit();
- }
-}
-
-void
-startup_wizard_abort (EPlugin *ep, EMConfigTargetAccount *target)
-{
- startup_wizard_terminate ();
-}
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e8b6a1da78..7e498d27e1 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -283,6 +283,7 @@ modules/mailto-handler/apps-evolution-mail-prompts-checkdefault.schemas.in
modules/mailto-handler/evolution-mailto-handler.c
modules/plugin-python/example/org-gnome-hello-python-ui.xml
modules/plugin-python/example/org-gnome-hello-python.eplug.xml
+modules/startup-wizard/evolution-startup-wizard.c
plugins/addressbook-file/org-gnome-addressbook-file.eplug.xml
plugins/attachment-reminder/apps-evolution-attachment-reminder.schemas.in
plugins/attachment-reminder/attachment-reminder.c
@@ -390,8 +391,6 @@ plugins/save-calendar/ical-format.c
plugins/save-calendar/org-gnome-save-calendar.eplug.xml
plugins/save-calendar/rdf-format.c
plugins/save-calendar/save-calendar.c
-plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml
-plugins/startup-wizard/startup-wizard.c
plugins/subject-thread/org-gnome-subject-thread.eplug.xml
plugins/subject-thread/subject-thread.c
plugins/templates/apps-evolution-template-placeholders.schemas.in
diff --git a/shell/e-shell.c b/shell/e-shell.c
index 60bbe30526..2345d70654 100644
--- a/shell/e-shell.c
+++ b/shell/e-shell.c
@@ -1948,13 +1948,17 @@ e_shell_adapt_window_size (EShell *shell,
void
e_shell_set_startup_view (EShell *shell,
- const gchar *view)
+ const gchar *view)
{
- shell->priv->startup_view = g_strdup(view);
+ g_return_if_fail (E_IS_SHELL (shell));
+
+ shell->priv->startup_view = g_strdup (view);
}
const gchar *
e_shell_get_startup_view (EShell *shell)
{
+ g_return_val_if_fail (E_IS_SHELL (shell), NULL);
+
return shell->priv->startup_view;
}