[evolution] startup-wizard: Avoid em_account_editor_get_widget().



commit 1b5a2be5511354345887d954f156d6e61ca320b1
Author: Matthew Barnes <mbarnes redhat com>
Date:   Wed Mar 7 09:27:54 2012 -0500

    startup-wizard: Avoid em_account_editor_get_widget().
    
    em_account_editor_get_widget() won't be around much longer.
    Instead, use gtk_container_foreach() to scan for a GtkLabel.

 modules/startup-wizard/evolution-startup-wizard.c |   25 ++++++++++++++++-----
 1 files changed, 19 insertions(+), 6 deletions(-)
---
diff --git a/modules/startup-wizard/evolution-startup-wizard.c b/modules/startup-wizard/evolution-startup-wizard.c
index 50db857..7dd1c67 100644
--- a/modules/startup-wizard/evolution-startup-wizard.c
+++ b/modules/startup-wizard/evolution-startup-wizard.c
@@ -127,6 +127,20 @@ startup_wizard_import_complete (EImport *import,
 	e_config_target_changed (config, E_CONFIG_TARGET_CHANGED_STATE);
 }
 
+static void
+startup_wizard_tweak_welcome_label (GtkWidget *child)
+{
+	const gchar *welcome_text;
+
+	welcome_text =
+		_("Welcome to Evolution. The next few screens will "
+		  "allow Evolution to connect to your email accounts, "
+		  "and to import files from other applications.");
+
+	if (GTK_IS_LABEL (child))
+		gtk_label_set_text (GTK_LABEL (child), welcome_text);
+}
+
 static gboolean
 startup_wizard_check_progress (EConfig *config,
                                const gchar *page_id,
@@ -499,12 +513,11 @@ startup_wizard_new_assistant (EStartupWizard *extension)
 	gtk_assistant_set_page_title (
 		GTK_ASSISTANT (config->widget), widget, _("Welcome"));
 
-	widget = em_account_editor_get_widget (emae, "start_page_label");
-	gtk_label_set_text (
-		GTK_LABEL (widget),
-		_("Welcome to Evolution. The next few screens will "
-		  "allow Evolution to connect to your email accounts, "
-		  "and to import files from other applications."));
+	/* The welcome page should be a GtkBox with a GtkLabel
+	 * packed inside.  We need to alter the GtkLabel text. */
+	gtk_container_foreach (
+		GTK_CONTAINER (widget),
+		(GtkCallback) startup_wizard_tweak_welcome_label, NULL);
 
 	/* Finalize the EMAccountEditor along with the GtkAssistant. */
 	g_object_set_data_full (



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]