aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2010-06-02 08:20:35 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-06-03 04:36:11 +0800
commit7959b11113a399f649c28b86fb57daf8c6c542b9 (patch)
treec0485f8ba9e9555cb4a22e22edf3625a79bfbd75 /e-util
parentf5f7d23c543fc3d110c9713e9335c1cd41a16aff (diff)
downloadgsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.tar
gsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.tar.gz
gsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.tar.bz2
gsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.tar.lz
gsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.tar.xz
gsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.tar.zst
gsoc2013-evolution-7959b11113a399f649c28b86fb57daf8c6c542b9.zip
Convert "startup-wizard" to an EExtension.
Convert the "startup-wizard" EPlugin to an EExtension, and fix up the importing UI a bit (but it still needs a lot more love). Importing progress is now shown directly in the GtkAssistant window. Define a new EConfigItem type (E_CONFIG_PAGE_PROGRESS) for creating progress pages in a GtkAssistant. Also, change EMAccountEditor semantics slightly: you now have to call e_config_create_window() manually after creating a new EMAccountEditor instance. This allows extra EConfigItems (specifications for the window content) to be added manually before the window is created.
Diffstat (limited to 'e-util')
-rw-r--r--e-util/e-config.c37
-rw-r--r--e-util/e-config.h1
2 files changed, 26 insertions, 12 deletions
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,