aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGilles Dartiguelongue <gdartigu@src.gnome.org>2009-02-05 06:32:46 +0800
committerGilles Dartiguelongue <gdartigu@src.gnome.org>2009-02-05 06:32:46 +0800
commit1365d235d75998d31ac6b272569f9d6a8706d24b (patch)
tree325a8f024b35a3f3c95af4a1439a429b7b60b30d
parent73a91dd01b307d91f68ef4325d93e4e3676e538a (diff)
downloadgsoc2013-evolution-1365d235d75998d31ac6b272569f9d6a8706d24b.tar.gz
gsoc2013-evolution-1365d235d75998d31ac6b272569f9d6a8706d24b.tar.zst
gsoc2013-evolution-1365d235d75998d31ac6b272569f9d6a8706d24b.zip
** Fix for bug #568176
* em-migrate.c: (em_migrate_setup_progress_dialog), (em_migrate_close_progress_dialog), (em_migrate_set_folder_name), (em_migrate_local_folders_1_4), (migrate_to_db): Make the migration dialog look better. svn path=/trunk/; revision=37226
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-migrate.c73
2 files changed, 56 insertions, 26 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 998d547fcd..53ad3b10c0 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2009-02-04 Gilles Dartiguelongue <gdartigu@svn.gnome.org>
+
+ ** Fix for bug #568176
+
+ * em-migrate.c: (em_migrate_setup_progress_dialog),
+ (em_migrate_close_progress_dialog), (em_migrate_set_folder_name),
+ (em_migrate_local_folders_1_4), (migrate_to_db):
+ Make the migration dialog look better.
+
2009-02-03 Srinivasa Ragavan <sragavan@novell.com>
** Fix for bug #569986
diff --git a/mail/em-migrate.c b/mail/em-migrate.c
index 7f7e6a1c44..128569edc3 100644
--- a/mail/em-migrate.c
+++ b/mail/em-migrate.c
@@ -1199,50 +1199,71 @@ static GtkLabel *label;
static GtkProgressBar *progress;
static void
-em_migrate_setup_progress_dialog (const char *desc)
+em_migrate_setup_progress_dialog (const char *title, const char *desc)
{
GtkWidget *vbox, *hbox, *w;
+ gchar *markup;
window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
- gtk_window_set_title ((GtkWindow *) window, _("Migrating..."));
- gtk_window_set_modal ((GtkWindow *) window, TRUE);
- gtk_container_set_border_width ((GtkContainer *) window, 6);
- vbox = gtk_vbox_new (FALSE, 6);
- gtk_widget_show (vbox);
- gtk_container_add ((GtkContainer *) window, vbox);
-
- w = gtk_label_new (desc);
-
- gtk_label_set_line_wrap ((GtkLabel *) w, TRUE);
- gtk_widget_show (w);
- gtk_box_pack_start_defaults ((GtkBox *) vbox, w);
+ gtk_window_set_title (GTK_WINDOW (window), _("Migrating..."));
+ gtk_window_set_modal (GTK_WINDOW (window), TRUE);
+ gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
+ gtk_container_set_border_width (GTK_CONTAINER (window), 6);
- hbox = gtk_hbox_new (FALSE, 6);
- gtk_widget_show (hbox);
- gtk_box_pack_start_defaults ((GtkBox *) vbox, hbox);
+ hbox = gtk_hbox_new (FALSE, 24);
- label = (GtkLabel *) gtk_label_new ("");
- gtk_widget_show ((GtkWidget *) label);
- gtk_box_pack_start_defaults ((GtkBox *) hbox, (GtkWidget *) label);
+ /* Install the info image */
+ w = gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
+ gtk_misc_set_alignment (GTK_MISC (w), 0.5, 0.0);
+ gtk_box_pack_start_defaults (GTK_BOX (hbox), w);
- progress = (GtkProgressBar *) gtk_progress_bar_new ();
- gtk_widget_show ((GtkWidget *) progress);
- gtk_box_pack_start_defaults ((GtkBox *) hbox, (GtkWidget *) progress);
+ /* Prepare the message */
+ vbox = gtk_vbox_new (FALSE, 12);
+ gtk_widget_show (vbox);
+ gtk_box_pack_start_defaults (GTK_BOX (hbox), vbox);
+
+ w = gtk_label_new (NULL);
+ gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.0);
+ markup = g_strconcat ("<big><b>", title ? title : _("Migration"), "</b></big>", NULL);
+ gtk_label_set_markup (GTK_LABEL (w), markup);
+ gtk_box_pack_start_defaults (GTK_BOX (vbox), w);
+ g_free (markup);
+
+ w = gtk_label_new (desc);
+ gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.0);
+ gtk_label_set_line_wrap (GTK_LABEL (w), TRUE);
+ gtk_box_pack_start_defaults (GTK_BOX (vbox), w);
+ /* Progress bar */
+ w = gtk_vbox_new (FALSE, 6);
+ gtk_box_pack_start_defaults (GTK_BOX (vbox), w);
+
+ label = GTK_LABEL (gtk_label_new (""));
+ gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+ gtk_label_set_line_wrap (label, TRUE);
+ gtk_widget_show (GTK_WIDGET (label));
+ gtk_box_pack_start_defaults (GTK_BOX (w), GTK_WIDGET (label));
+
+ progress = GTK_PROGRESS_BAR (gtk_progress_bar_new ());
+ gtk_widget_show (GTK_WIDGET (progress));
+ gtk_box_pack_start_defaults (GTK_BOX (w), GTK_WIDGET (progress));
+
+ gtk_container_add (GTK_CONTAINER (window), hbox);
+ gtk_widget_show_all (hbox);
gtk_widget_show (window);
}
static void
em_migrate_close_progress_dialog (void)
{
- gtk_widget_destroy ((GtkWidget *) window);
+ gtk_widget_destroy (GTK_WIDGET (window));
}
static void
em_migrate_set_folder_name (const char *folder_name)
{
- char *text;
+ gchar *text;
text = g_strdup_printf (_("Migrating '%s':"), folder_name);
gtk_label_set_text (label, text);
@@ -1865,7 +1886,7 @@ em_migrate_local_folders_1_4 (EMMigrateSession *session, CamelException *ex)
return -1;
}
- em_migrate_setup_progress_dialog (_("The location and hierarchy of the Evolution mailbox "
+ em_migrate_setup_progress_dialog (NULL, _("The location and hierarchy of the Evolution mailbox "
"folders has changed since Evolution 1.x.\n\nPlease be "
"patient while Evolution migrates your folders..."));
@@ -2950,7 +2971,7 @@ migrate_to_db()
camel_session_set_online ((CamelSession *) session, FALSE);
- em_migrate_setup_progress_dialog (_("The summary format of the Evolution mailbox "
+ em_migrate_setup_progress_dialog (_("Migrating Folders"), _("The summary format of the Evolution mailbox "
"folders has been moved to SQLite since Evolution 2.24.\n\nPlease be "
"patient while Evolution migrates your folders..."));