2007-07-05 Johannes Schmid <johannes.schmid@openismus.com>
[modest] / src / maemo / easysetup / modest-wizard-dialog.c
index 8103fd0..20797b1 100644 (file)
 #include <config.h>
 #endif
 
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_HILDON0_WIDGETS
 #include <hildon-widgets/hildon-defines.h>
 #else
 #include <hildon/hildon-defines.h>
-#endif /*MODEST_HILDON_VERSION_0*/
+#endif /*MODEST_HAVE_HILDON0_WIDGETS*/
 
 #include "modest-wizard-dialog.h"
 
@@ -255,12 +255,13 @@ init (ModestWizardDialog *wizard_dialog)
     gtk_dialog_set_has_separator (dialog, FALSE);
     wizard_dialog->priv = priv;
     priv->box = GTK_BOX (gtk_hbox_new (FALSE, 0));
-#ifdef MODEST_HILDON_VERSION_0
+#ifdef MODEST_HAVE_HILDON0_WIDGETS
     priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard",
                                                HILDON_ICON_SIZE_WIDG_WIZARD);
 #else
+               int icon_size = gtk_icon_size_register("hildon_wizard", 50, 50);
     priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard",
-                                               HILDON_ICON_SIZE_WIZARD);
+                                               icon_size);
 #endif /*MODEST_HILDON_VERSION_0*/
     /* Default values for user provided properties */
     priv->notebook = NULL;
@@ -441,7 +442,6 @@ get_property (GObject      *object,
 static void
 create_title (ModestWizardDialog *wizard_dialog)
 {
-    gint pages, current;
     gchar *str = NULL;
     ModestWizardDialogPrivate *priv = NULL;
     GtkNotebook *notebook = NULL;
@@ -456,22 +456,37 @@ create_title (ModestWizardDialog *wizard_dialog)
         return;
 
     /* Get page information, we'll need that when creating title */
-    pages = gtk_notebook_get_n_pages (notebook);
-    current = gtk_notebook_get_current_page (priv->notebook);
+    gint pages = gtk_notebook_get_n_pages (notebook);
+    if (pages == 0)
+      return;
+       
+    gint current = gtk_notebook_get_current_page (priv->notebook);
     if (current < 0)
         current = 0;
 
     /* the welcome title on the initial page */
+    /* This is the standard wizard title, with, e.g., 1/4 at the end,
+        * but the Modest UI spec does not want this. */
+       /*
     if (current == 0) {
         str = g_strdup_printf (_("ecdg_ti_wizard_welcome"), 
                 priv->wizard_name, pages);
     } else {
-        const gchar *steps = gtk_notebook_get_tab_label_text (notebook,
-                gtk_notebook_get_nth_page (notebook, current));
-
+    */
+       const gchar *steps = gtk_notebook_get_tab_label_text (notebook,
+               gtk_notebook_get_nth_page (notebook, current));
+                
+               /* This is the standard wizard title, with, e.g., 1/4 at the end,
+                * but the Modest UI spec does not want this.
+                */
+               /*
         str = g_strdup_printf (_("ecdg_ti_wizard_step"), 
                 priv->wizard_name, current + 1, pages, steps);
-    }
+        */
+
+        str = g_strdup_printf (_("%s: %s"), 
+                priv->wizard_name, steps);
+    /* } */
 
     /* Update the dialog to display the generated title */
     gtk_window_set_title (GTK_WINDOW (wizard_dialog), str);