2007-05-07 Murray Cumming <murrayc@murrayc.com>
+
+ (modest_wizard_dialog_force_title_update):
+ * src/maemo/easysetup/modest-wizard-dialog.h:
+ * src/maemo/easysetup/modest-wizard-dialog.c: (set_property):
+ For GTK+ 2.10, when present, connect to the GtkNotebook signals so we
+ can update the title when appropriate. Otherwise the title is wrong if the
+ pages are added after adding the notebook to the dialog.
+ This must be a problem in HildonWizardDialog too.
+ Added modest_wizard_dialog_force_title_update() for GTK+ 2.6.
+
+ * src/maemo/easysetup/modest-easysetup-wizard.c:
+ (create_subsequent_customsetup_pages),
+ (create_subsequent_easysetup_pages):
+ Call modest_wizard_dialog_force_title_update() so that the title is
+ correct even with GTK+ < 2.10.
+ This fixes projects.maemo.org bug NB#56145 .
+
+2007-05-07 Murray Cumming <murrayc@murrayc.com>
* src/maemo/modest-platform.c:
(modest_platform_set_update_interval): Use the ALARM_EVENT_NO_DIALOG
if (!gtk_widget_get_parent (GTK_WIDGET (self->page_complete_customsetup)))
gtk_notebook_append_page (notebook, self->page_complete_customsetup,
gtk_label_new (_("mcen_ti_emailsetup_complete")));
+
+ /* This is unnecessary with GTK+ 2.10: */
+ modest_wizard_dialog_force_title_update (MODEST_WIZARD_DIALOG(self));
}
static void create_subsequent_easysetup_pages (ModestEasysetupWizardDialog *self)
gtk_notebook_append_page (notebook, self->page_complete_easysetup,
gtk_label_new (_("mcen_ti_emailsetup_complete")));
+ /* This is unnecessary with GTK+ 2.10: */
+ modest_wizard_dialog_force_title_update (MODEST_WIZARD_DIALOG(self));
}
/* After the user details page,
* the following pages depend on whether "Other" was chosen
#include <gtk/gtkhbox.h>
#include <gtk/gtkvbox.h>
#include <gtk/gtkbutton.h>
+#include <gtk/gtk.h>
#ifdef HAVE_CONFIG_H
#include <config.h>
G_CALLBACK (response), NULL);
}
+#if GTK_CHECK_VERSION(2, 10, 0) /* These signals were added in GTK+ 2.10: */
+static void on_notebook_page_added(ModestWizardDialog* dialog,
+ GtkWidget *child,
+ guint page_num,
+ gpointer user_data)
+{
+ /* The title should show the total number of pages: */
+ create_title (dialog);
+}
+
+static void on_notebook_page_removed(ModestWizardDialog* dialog,
+ GtkWidget *child,
+ guint page_num,
+ gpointer user_data)
+{
+ /* The title should show the total number of pages: */
+ create_title (dialog);
+}
+#endif /* GTK_CHECK_VERSION */
+
+static void
+connect_to_notebook_signals(ModestWizardDialog* dialog)
+{
+#if GTK_CHECK_VERSION(2, 10, 0) /* These signals were added in GTK+ 2.10: */
+ ModestWizardDialogPrivate *priv = MODEST_WIZARD_DIALOG(dialog)->priv;
+ g_return_if_fail (priv->notebook);
+
+ /* Connect to the notebook signals,
+ * so we can update the title when necessary: */
+ g_signal_connect (G_OBJECT (priv->notebook), "page-added",
+ G_CALLBACK (on_notebook_page_added), NULL);
+ g_signal_connect (G_OBJECT (priv->notebook), "page-removed",
+ G_CALLBACK (on_notebook_page_removed), NULL);
+#endif /* GTK_CHECK_VERSION */
+}
+
+
static void
set_property (GObject *object,
guint property_id,
* all that is required to display the dialog correctly */
gtk_widget_show ( GTK_WIDGET (priv->notebook));
- /* Update dialog title to reflect current page stats etc */
+ /* Update dialog title to reflect current page stats etc */
+ ModestWizardDialog *wizard_dialog = MODEST_WIZARD_DIALOG (object);
if (priv->wizard_name && priv->autotitle)
- create_title (MODEST_WIZARD_DIALOG (object));
+ create_title (wizard_dialog);
+
+ connect_to_notebook_signals (wizard_dialog);
- } break;
+ }break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
return widget;
}
+/**
+ * modest_wizard_dialog_force_title_update:
+ * @wizard_dialog: The wizard dialog
+ *
+ * Force the title to be rebuilt, for instance when you have added or
+ * removed notebook pages. This function is not necessary when using GTK+ 2.10,
+ * because that has GtkNotebook signals that will be used to update the title
+ * automatically.
+ */
+void
+modest_wizard_dialog_force_title_update (ModestWizardDialog *wizard_dialog)
+{
+ create_title (wizard_dialog);
+}
+
static gboolean
invoke_before_next_vfunc (ModestWizardDialog *wizard_dialog)
{