X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fwidgets%2Fmodest-wizard-dialog.c;h=e5eb272b4a774415a84c32efbe3accb84ab9f3ab;hb=97b8abd58253731cfab9e6eba29a126a2fcc6df1;hp=ea04f8bc81f97add60f2e1ad5158bcbcf6a36a61;hpb=08fbf7bb286a60fddbc00cd041b7e54bb735f118;p=modest diff --git a/src/widgets/modest-wizard-dialog.c b/src/widgets/modest-wizard-dialog.c index ea04f8b..e5eb272 100644 --- a/src/widgets/modest-wizard-dialog.c +++ b/src/widgets/modest-wizard-dialog.c @@ -55,11 +55,7 @@ #endif #ifndef MODEST_TOOLKIT_GTK -#if MODEST_HILDON_API == 0 -#include -#else #include -#endif /*MODEST_HILDON_API == 0*/ #endif /*!MODEST_TOOLKIT_GTK*/ #include "modest-wizard-dialog.h" @@ -265,16 +261,11 @@ init (ModestWizardDialog *wizard_dialog) #ifdef MODEST_TOOLKIT_GTK priv->image = gtk_image_new_from_stock (GTK_STOCK_PREFERENCES, GTK_ICON_SIZE_DIALOG); #else /*MODEST_TOOLKIT_GTK*/ -#if MODEST_HILDON_API == 0 - priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard", - HILDON_ICON_SIZE_WIDG_WIZARD); -#else static int icon_size = 0; if (!icon_size) icon_size = gtk_icon_size_register("modest_wizard", 50, 50); priv->image = gtk_image_new_from_icon_name ("qgn_widg_wizard", icon_size); -#endif /*MODEST_HILDON_API == 0*/ #endif /*!MODEST_TOOLKIT_GTK*/ #endif /*MODEST_TOOLKIT_HILDON2 */ /* Default values for user provided properties */ @@ -285,8 +276,12 @@ init (ModestWizardDialog *wizard_dialog) /* Build wizard layout */ gtk_box_pack_start (GTK_BOX (dialog->vbox), GTK_WIDGET (priv->box), TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (priv->box), GTK_WIDGET (vbox), FALSE, FALSE, 0); - if (priv->image) - gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->image), TRUE, TRUE, 0); + gtk_widget_show (vbox); + gtk_widget_show (GTK_WIDGET (priv->box)); + if (priv->image) { + gtk_box_pack_start (GTK_BOX (vbox), GTK_WIDGET (priv->image), TRUE, TRUE, 0); + gtk_widget_show (priv->image); + } /* Add response buttons: finish, previous, next, cancel */ #ifdef MODEST_TOOLKIT_HILDON1 @@ -310,8 +305,7 @@ init (ModestWizardDialog *wizard_dialog) /* Set initial button states: previous and finish buttons are disabled */ make_buttons_sensitive (wizard_dialog, FALSE, FALSE, TRUE); - /* Show all the internal widgets */ - gtk_widget_show_all (GTK_WIDGET (dialog->vbox)); + gtk_widget_show (GTK_WIDGET (dialog->vbox)); /* connect to dialog's response signal */ g_signal_connect (G_OBJECT (dialog), "response", @@ -487,48 +481,33 @@ create_title (ModestWizardDialog *wizard_dialog) gchar *str = NULL; ModestWizardDialogPrivate *priv = NULL; GtkNotebook *notebook = NULL; + gint pages, current; + const gchar *steps; g_return_if_fail (MODEST_IS_WIZARD_DIALOG(wizard_dialog)); g_return_if_fail (wizard_dialog->priv != NULL); - priv = wizard_dialog->priv; + priv = wizard_dialog->priv; notebook = priv->notebook; if (!notebook) return; /* Get page information, we'll need that when creating title */ - gint pages = gtk_notebook_get_n_pages (notebook); + pages = gtk_notebook_get_n_pages (notebook); if (pages == 0) - return; - - gint current = gtk_notebook_get_current_page (priv->notebook); + return; + + 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 (_HL("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)); - - /* 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 (_HL("ecdg_ti_wizard_step"), - priv->wizard_name, current + 1, pages, steps); - */ - - str = g_strdup_printf ((steps&&*steps)?_HL("%s: %s"):_HL("%s"), - priv->wizard_name, steps); - /* } */ + current = 0; + + steps = gtk_notebook_get_tab_label_text (notebook, + gtk_notebook_get_nth_page (notebook, current)); + + str = g_strdup_printf ((steps&&*steps)?_HL("%s%s %s"):_HL("%s"), + priv->wizard_name, _HL("ecdg_ti_caption_separator"), + steps); /* Update the dialog to display the generated title */ gtk_window_set_title (GTK_WINDOW (wizard_dialog), str);