aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@src.gnome.org>2008-10-05 12:12:09 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2008-10-05 12:12:09 +0800
commit6d1aea1b231c120441061c2046157b40e34f8e3a (patch)
treee28bb0e3ea779b19b6d838a3a989ba57aba6324a /addressbook
parent2c71859895d091f51dea23f9ed9552a0962b7ba4 (diff)
downloadgsoc2013-evolution-6d1aea1b231c120441061c2046157b40e34f8e3a.tar.gz
gsoc2013-evolution-6d1aea1b231c120441061c2046157b40e34f8e3a.tar.zst
gsoc2013-evolution-6d1aea1b231c120441061c2046157b40e34f8e3a.zip
Support migration in the new shell design.
Some code got duplicated for calendars and tasks. Made a note to revisit. svn path=/branches/kill-bonobo/; revision=36560
Diffstat (limited to 'addressbook')
-rw-r--r--addressbook/gui/component/Makefile.am4
-rw-r--r--addressbook/gui/component/e-book-shell-module-migrate.c (renamed from addressbook/gui/component/addressbook-migrate.c)28
-rw-r--r--addressbook/gui/component/e-book-shell-module-migrate.h (renamed from addressbook/gui/component/addressbook-migrate.h)13
-rw-r--r--addressbook/gui/component/e-book-shell-module.c52
-rw-r--r--addressbook/gui/component/e-book-shell-view-private.c2
5 files changed, 52 insertions, 47 deletions
diff --git a/addressbook/gui/component/Makefile.am b/addressbook/gui/component/Makefile.am
index 0df52c0336..9bfdabe13d 100644
--- a/addressbook/gui/component/Makefile.am
+++ b/addressbook/gui/component/Makefile.am
@@ -28,8 +28,6 @@ module_LTLIBRARIES = libevolution-addressbook.la
libevolution_addressbook_la_SOURCES = \
addressbook-config.c \
addressbook-config.h \
- addressbook-migrate.c \
- addressbook-migrate.h \
autocompletion-config.c \
autocompletion-config.h \
addressbook.c \
@@ -37,6 +35,8 @@ libevolution_addressbook_la_SOURCES = \
e-book-shell-content.c \
e-book-shell-content.h \
e-book-shell-module.c \
+ e-book-shell-module-migrate.c \
+ e-book-shell-module-migrate.h \
e-book-shell-sidebar.c \
e-book-shell-sidebar.h \
e-book-shell-view.c \
diff --git a/addressbook/gui/component/addressbook-migrate.c b/addressbook/gui/component/e-book-shell-module-migrate.c
index c77c70e2b8..d0b41cf661 100644
--- a/addressbook/gui/component/addressbook-migrate.c
+++ b/addressbook/gui/component/e-book-shell-module-migrate.c
@@ -1,4 +1,6 @@
/*
+ * e-book-shell-module-migrate.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
@@ -45,7 +47,7 @@
#include "e-util/e-xml-utils.h"
#include "e-util/e-folder-map.h"
-#include "addressbook-migrate.h"
+#include "e-book-shell-module-migrate.h"
/*#define SLOW_MIGRATION*/
@@ -1110,11 +1112,11 @@ migration_context_free (MigrationContext *context)
}
gboolean
-addressbook_migrate (EShellModule *shell_module,
- gint major,
- gint minor,
- gint revision,
- GError **error)
+e_book_shell_module_migrate (EShellModule *shell_module,
+ gint major,
+ gint minor,
+ gint micro,
+ GError **error)
{
ESourceGroup *on_this_computer;
ESourceGroup *on_ldap_servers;
@@ -1123,8 +1125,6 @@ addressbook_migrate (EShellModule *shell_module,
gboolean need_dialog = FALSE;
const gchar *data_dir;
- printf ("addressbook_migrate (%d.%d.%d)\n", major, minor, revision);
-
g_return_val_if_fail (E_IS_SHELL_MODULE (shell_module), FALSE);
data_dir = e_shell_module_get_data_dir (shell_module);
@@ -1139,7 +1139,7 @@ addressbook_migrate (EShellModule *shell_module,
if (major == 1
/* we only need the most recent upgrade point here.
further decomposition will happen below. */
- && (minor < 5 || (minor == 5 && revision <= 10)))
+ && (minor < 5 || (minor == 5 && micro <= 10)))
need_dialog = TRUE;
if (need_dialog)
@@ -1147,7 +1147,7 @@ addressbook_migrate (EShellModule *shell_module,
if (major == 1) {
- if (minor < 5 || (minor == 5 && revision <= 2)) {
+ if (minor < 5 || (minor == 5 && micro <= 2)) {
/* initialize our dialog */
dialog_set_label (context,
_("The location and hierarchy of the Evolution contact "
@@ -1162,7 +1162,7 @@ addressbook_migrate (EShellModule *shell_module,
migrate_completion_folders (context);
}
- if (minor < 5 || (minor == 5 && revision <= 7)) {
+ if (minor < 5 || (minor == 5 && micro <= 7)) {
dialog_set_label (context,
_("The format of mailing list contacts has changed.\n\n"
"Please be patient while Evolution migrates your "
@@ -1171,7 +1171,7 @@ addressbook_migrate (EShellModule *shell_module,
migrate_contact_lists_for_local_folders (context, on_this_computer);
}
- if (minor < 5 || (minor == 5 && revision <= 8)) {
+ if (minor < 5 || (minor == 5 && micro <= 8)) {
dialog_set_label (context,
_("The way Evolution stores some phone numbers has changed.\n\n"
"Please be patient while Evolution migrates your "
@@ -1180,7 +1180,7 @@ addressbook_migrate (EShellModule *shell_module,
migrate_company_phone_for_local_folders (context, on_this_computer);
}
- if (minor < 5 || (minor == 5 && revision <= 10)) {
+ if (minor < 5 || (minor == 5 && micro <= 10)) {
char *old_path, *new_path;
dialog_set_label (context, _("Evolution's Palm Sync changelog and map files have changed.\n\n"
@@ -1199,7 +1199,7 @@ addressbook_migrate (EShellModule *shell_module,
during one phase of development, as they take
precedent over relative uris (but aren't updated
when editing an ESource). */
- if (minor == 5 && revision <= 11) {
+ if (minor == 5 && micro <= 11) {
GSList *g;
for (g = e_source_list_peek_groups (context->source_list); g; g = g->next) {
ESourceGroup *group = g->data;
diff --git a/addressbook/gui/component/addressbook-migrate.h b/addressbook/gui/component/e-book-shell-module-migrate.h
index 189978b212..8e19c73989 100644
--- a/addressbook/gui/component/addressbook-migrate.h
+++ b/addressbook/gui/component/e-book-shell-module-migrate.h
@@ -1,4 +1,5 @@
/*
+ * e-book-shell-module-migrate.h
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -21,20 +22,20 @@
*
*/
-#ifndef _ADDRESSBOOK_MIGRATE_H_
-#define _ADDRESSBOOK_MIGRATE_H_
+#ifndef E_BOOK_SHELL_MODULE_MIGRATE_H
+#define E_BOOK_SHELL_MODULE_MIGRATE_H
#include <glib.h>
-#include <e-shell-module.h>
+#include <shell/e-shell-module.h>
G_BEGIN_DECLS
-gboolean addressbook_migrate (EShellModule *shell_module,
+gboolean e_book_shell_module_migrate (EShellModule *shell_module,
gint major,
gint minor,
- gint revision,
+ gint micro,
GError **error);
G_END_DECLS
-#endif /* _ADDRESSBOOK_MIGRATE_H_ */
+#endif /* E_BOOK_SHELL_MODULE_MIGRATE_H */
diff --git a/addressbook/gui/component/e-book-shell-module.c b/addressbook/gui/component/e-book-shell-module.c
index e533a1a864..276e6f0a24 100644
--- a/addressbook/gui/component/e-book-shell-module.c
+++ b/addressbook/gui/component/e-book-shell-module.c
@@ -27,19 +27,21 @@
#include <libedataserver/e-source-list.h>
#include <libedataserver/e-source-group.h>
-#include <e-shell.h>
-#include <e-shell-module.h>
-#include <e-shell-window.h>
+#include "shell/e-shell.h"
+#include "shell/e-shell-module.h"
+#include "shell/e-shell-window.h"
-#include <e-util/e-import.h>
-#include <addressbook/importers/evolution-addressbook-importers.h>
+#include "e-util/e-import.h"
+#include "addressbook/importers/evolution-addressbook-importers.h"
#include <eab-config.h>
#include <eab-gui-util.h>
-#include <e-book-shell-view.h>
#include <addressbook-config.h>
#include <autocompletion-config.h>
+#include "e-book-shell-view.h"
+#include "e-book-shell-module-migrate.h"
+
#define MODULE_NAME "addressbook"
#define MODULE_ALIASES "contacts"
#define MODULE_SCHEMES ""
@@ -52,7 +54,7 @@
void e_shell_module_init (GTypeModule *type_module);
static void
-book_module_ensure_sources (EShellModule *shell_module)
+book_shell_module_ensure_sources (EShellModule *shell_module)
{
/* XXX This is basically the same algorithm across all modules.
* Maybe we could somehow integrate this into EShellModule? */
@@ -182,7 +184,7 @@ book_module_ensure_sources (EShellModule *shell_module)
}
static void
-book_module_init_importers (void)
+book_shell_module_init_importers (void)
{
EImportClass *import_class;
EImportImporter *importer;
@@ -206,9 +208,9 @@ book_module_init_importers (void)
}
static void
-book_module_book_loaded_cb (EBook *book,
- EBookStatus status,
- gpointer user_data)
+book_shell_module_book_loaded_cb (EBook *book,
+ EBookStatus status,
+ gpointer user_data)
{
EContact *contact;
GtkAction *action;
@@ -266,7 +268,8 @@ action_contact_new_cb (GtkAction *action,
if (book == NULL)
book = e_book_new_default_addressbook (NULL);
- e_book_async_open (book, FALSE, book_module_book_loaded_cb, action);
+ e_book_async_open (
+ book, FALSE, book_shell_module_book_loaded_cb, action);
}
static void
@@ -304,21 +307,21 @@ static GtkActionEntry source_entries[] = {
};
static gboolean
-book_module_is_busy (EShellModule *shell_module)
+book_shell_module_is_busy (EShellModule *shell_module)
{
return !eab_editor_request_close_all ();
}
static gboolean
-book_module_shutdown (EShellModule *shell_module)
+book_shell_module_shutdown (EShellModule *shell_module)
{
/* FIXME */
return TRUE;
}
static gboolean
-book_module_handle_uri (EShellModule *shell_module,
- const gchar *uri)
+book_shell_module_handle_uri (EShellModule *shell_module,
+ const gchar *uri)
{
EUri *euri;
const gchar *cp;
@@ -383,8 +386,8 @@ book_module_handle_uri (EShellModule *shell_module,
}
static void
-book_module_window_created (EShellModule *shell_module,
- EShellWindow *shell_window)
+book_shell_module_window_created (EShellModule *shell_module,
+ EShellWindow *shell_window)
{
const gchar *module_name;
@@ -407,8 +410,9 @@ static EShellModuleInfo module_info = {
MODULE_SORT_ORDER,
/* Methods */
- book_module_is_busy,
- book_module_shutdown
+ book_shell_module_is_busy,
+ book_shell_module_shutdown,
+ e_book_shell_module_migrate
};
void
@@ -425,18 +429,18 @@ e_shell_module_init (GTypeModule *type_module)
e_shell_module_set_info (shell_module, &module_info);
- book_module_init_importers ();
- book_module_ensure_sources (shell_module);
+ book_shell_module_init_importers ();
+ book_shell_module_ensure_sources (shell_module);
e_plugin_hook_register_type (eab_config_get_type ());
g_signal_connect_swapped (
shell, "handle-uri",
- G_CALLBACK (book_module_handle_uri), shell_module);
+ G_CALLBACK (book_shell_module_handle_uri), shell_module);
g_signal_connect_swapped (
shell, "window-created",
- G_CALLBACK (book_module_window_created), shell_module);
+ G_CALLBACK (book_shell_module_window_created), shell_module);
autocompletion_config_init ();
}
diff --git a/addressbook/gui/component/e-book-shell-view-private.c b/addressbook/gui/component/e-book-shell-view-private.c
index bbabb6d1cd..c3eecb5a8a 100644
--- a/addressbook/gui/component/e-book-shell-view-private.c
+++ b/addressbook/gui/component/e-book-shell-view-private.c
@@ -70,7 +70,7 @@ selection_change (EBookShellView *book_shell_view,
EShellView *shell_view;
gint n_selected;
- shell_view = E_SHELL_VIEW (shell_view);
+ shell_view = E_SHELL_VIEW (book_shell_view);
book_shell_content = book_shell_view->priv->book_shell_content;
current_view = e_book_shell_content_get_current_view (book_shell_content);