From 1dc38431986cdda1c99d58a11dfb667acf25c2c9 Mon Sep 17 00:00:00 2001 From: Jose Dapena Paz Date: Wed, 4 Nov 2009 13:30:52 +0100 Subject: [PATCH] Replace all usage of HildonEntry with ModestEntry methods in toolkit factory --- src/hildon2/modest-address-book.c | 4 +- .../modest-connection-specific-smtp-edit-window.c | 24 +++++----- .../modest-default-account-settings-dialog.c | 7 ++- src/hildon2/modest-easysetup-wizard-dialog.c | 42 +++++++++--------- src/hildon2/modest-maemo-security-options-view.c | 4 +- src/hildon2/modest-msg-edit-window.c | 4 +- src/hildon2/modest-platform.c | 2 +- src/modest-ui-actions.c | 46 ++++---------------- 8 files changed, 51 insertions(+), 82 deletions(-) diff --git a/src/hildon2/modest-address-book.c b/src/hildon2/modest-address-book.c index 4e19d89..97d2b1d 100644 --- a/src/hildon2/modest-address-book.c +++ b/src/hildon2/modest-address-book.c @@ -395,7 +395,7 @@ run_add_email_addr_to_contact_dlg(const gchar * contact_name, gtk_box_pack_start(GTK_BOX(GTK_DIALOG(add_email_addr_to_contact_dlg)->vbox), cptn_cntrl, FALSE, FALSE, 0); - email_entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + email_entry = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); cptn_cntrl = modest_maemo_utils_create_captioned (size_group, NULL, _("mcen_fi_add_email_name"), FALSE, email_entry); @@ -412,7 +412,7 @@ run_add_email_addr_to_contact_dlg(const gchar * contact_name, if (result == GTK_RESPONSE_ACCEPT) { const gchar *invalid_char_offset = NULL; - new_email_addr = g_strdup(hildon_entry_get_text(HILDON_ENTRY(email_entry))); + new_email_addr = g_strdup(modest_entry_get_text(email_entry)); new_email_addr = g_strstrip(new_email_addr); if (!modest_text_utils_validate_email_address (new_email_addr, &invalid_char_offset)) { gtk_widget_grab_focus(email_entry); diff --git a/src/hildon2/modest-connection-specific-smtp-edit-window.c b/src/hildon2/modest-connection-specific-smtp-edit-window.c index cbbd201..79d8286 100644 --- a/src/hildon2/modest-connection-specific-smtp-edit-window.c +++ b/src/hildon2/modest-connection-specific-smtp-edit-window.c @@ -165,12 +165,12 @@ on_mandatory_entry_changed (GtkWidget* widget, ModestConnectionSpecificSmtpEditW auth_proto = modest_secureauth_picker_get_active_secureauth (MODEST_SECUREAUTH_PICKER (priv->outgoing_auth_picker)); if (modest_protocol_registry_protocol_type_is_secure (modest_runtime_get_protocol_registry (), auth_proto)) { - text = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username)); + text = modest_entry_get_text (priv->entry_user_username); if (!text || (strlen(text) == 0)) sensitive = FALSE; } - text = hildon_entry_get_text (HILDON_ENTRY (priv->entry_outgoingserver)); + text = modest_entry_get_text (priv->entry_outgoingserver); if (!text || (strlen(text) == 0)) sensitive = FALSE; @@ -238,7 +238,7 @@ on_response (GtkDialog *dialog, int response_id, gpointer user_data) ModestConnectionSpecificSmtpEditWindowPrivate *priv = CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW_GET_PRIVATE (self); - hostname = hildon_entry_get_text (HILDON_ENTRY (priv->entry_outgoingserver)); + hostname = modest_entry_get_text (priv->entry_outgoingserver); /* Don't close the dialog if a range error occured */ if(response_id == GTK_RESPONSE_OK && priv->range_error_occured) @@ -375,7 +375,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd /* The outgoing server widgets: */ if (!priv->entry_outgoingserver) - priv->entry_outgoingserver = hildon_entry_new (MODEST_EDITABLE_SIZE); + priv->entry_outgoingserver = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL); g_signal_connect(G_OBJECT(priv->entry_outgoingserver), "changed", G_CALLBACK(on_mandatory_entry_changed), self); @@ -425,7 +425,7 @@ modest_connection_specific_smtp_edit_window_init (ModestConnectionSpecificSmtpEd gtk_entry_set_max_length (GTK_ENTRY (priv->entry_user_username), 64); /* The password widgets: */ - priv->entry_user_password = hildon_entry_new (MODEST_EDITABLE_SIZE); + priv->entry_user_password = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_password), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); @@ -540,11 +540,11 @@ modest_connection_specific_smtp_edit_window_set_connection ( if (priv->account_name) g_free (priv->account_name); priv->account_name = g_strdup (modest_server_account_settings_get_account_name (server_settings)); - hildon_entry_set_text (HILDON_ENTRY (priv->entry_outgoingserver), + modest_entry_set_text (priv->entry_outgoingserver, modest_server_account_settings_get_hostname (server_settings)); - hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_username), + modest_entry_set_text (priv->entry_user_username, modest_server_account_settings_get_username (server_settings)); - hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_password), + modest_entry_set_text (priv->entry_user_password, modest_server_account_settings_get_password (server_settings)); modest_serversecurity_picker_set_active_serversecurity ( @@ -574,7 +574,7 @@ modest_connection_specific_smtp_edit_window_get_settings (ModestConnectionSpecif const gchar *outgoing_server = NULL; priv = CONNECTION_SPECIFIC_SMTP_EDIT_WINDOW_GET_PRIVATE (window); - outgoing_server = hildon_entry_get_text (HILDON_ENTRY (priv->entry_outgoingserver)); + outgoing_server = modest_entry_get_text (priv->entry_outgoingserver); /* If the outgoing server is NULL, we are removing the connection specific * settings */ @@ -585,13 +585,13 @@ modest_connection_specific_smtp_edit_window_get_settings (ModestConnectionSpecif server_settings = modest_server_account_settings_new (); modest_server_account_settings_set_hostname (server_settings, - hildon_entry_get_text (HILDON_ENTRY (priv->entry_outgoingserver))); + modest_entry_get_text (priv->entry_outgoingserver)); modest_server_account_settings_set_protocol (server_settings, MODEST_PROTOCOLS_TRANSPORT_SMTP); modest_server_account_settings_set_username (server_settings, - hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username))); + modest_entry_get_text (priv->entry_user_username)); modest_server_account_settings_set_password (server_settings, - hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_password))); + modest_entry_get_text (priv->entry_user_password)); modest_server_account_settings_set_security_protocol (server_settings, modest_serversecurity_picker_get_active_serversecurity ( diff --git a/src/hildon2/modest-default-account-settings-dialog.c b/src/hildon2/modest-default-account-settings-dialog.c index 11422d9..35f49a3 100644 --- a/src/hildon2/modest-default-account-settings-dialog.c +++ b/src/hildon2/modest-default-account-settings-dialog.c @@ -548,7 +548,7 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self, on_entry_max, self); /* The password widgets: */ - priv->entry_user_password = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + priv->entry_user_password = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_password), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); @@ -635,7 +635,7 @@ create_page_incoming (ModestDefaultAccountSettingsDialog *self, /* The incoming server widgets: */ if(!priv->entry_incomingserver) - priv->entry_incomingserver = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + priv->entry_incomingserver = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_incomingserver), HILDON_GTK_INPUT_MODE_FULL); @@ -732,8 +732,7 @@ create_page_outgoing (ModestDefaultAccountSettingsDialog *self, /* The outgoing server widgets: */ if (!priv->entry_outgoingserver) - priv->entry_outgoingserver = - hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + priv->entry_outgoingserver = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL); smtp_caption_label = g_strconcat (_("mcen_li_emailsetup_smtp"), "\n(SMTP)", NULL); diff --git a/src/hildon2/modest-easysetup-wizard-dialog.c b/src/hildon2/modest-easysetup-wizard-dialog.c index 42474d1..03fda44 100644 --- a/src/hildon2/modest-easysetup-wizard-dialog.c +++ b/src/hildon2/modest-easysetup-wizard-dialog.c @@ -374,7 +374,7 @@ on_serviceprovider_picker_button_value_changed (HildonPickerButton *widget, gpoi else gtk_widget_show (priv->caption_account_title); - hildon_entry_set_text (HILDON_ENTRY (priv->entry_account_title), default_account_name); + modest_entry_set_text (priv->entry_account_title, default_account_name); g_free (default_account_name); } @@ -492,7 +492,7 @@ update_user_email_from_provider (ModestEasysetupWizardDialog *self) with_at = g_strdup (MODEST_EXAMPLE_EMAIL_ADDRESS); if (priv->entry_user_email) - hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_email), with_at); + modest_entry_set_text (priv->entry_user_email, with_at); g_free (with_at); g_free (provider_id); @@ -573,7 +573,7 @@ create_page_account_details (ModestEasysetupWizardDialog *self) g_free (default_account_name_start); default_account_name_start = NULL; - hildon_entry_set_text (HILDON_ENTRY (priv->entry_account_title), default_account_name); + modest_entry_set_text (priv->entry_account_title, default_account_name); g_free (default_account_name); default_account_name = NULL; @@ -646,7 +646,7 @@ on_user_username_changed(GtkWidget* widget, ModestEasysetupWizardDialog *self) gchar *email_address; gchar *domain_name = modest_presets_get_domain (priv->presets, provider_id); - current_username = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username)); + current_username = modest_entry_get_text (priv->entry_user_username); if (current_username && strstr (current_username, "@")) { email_address = g_strdup (current_username); @@ -657,7 +657,7 @@ on_user_username_changed(GtkWidget* widget, ModestEasysetupWizardDialog *self) } /* Update the email address */ - hildon_entry_set_text (HILDON_ENTRY (priv->entry_user_email), email_address); + modest_entry_set_text (priv->entry_user_email, email_address); g_free (email_address); g_free (domain_name); @@ -748,7 +748,7 @@ create_page_user_details (ModestEasysetupWizardDialog *self) on_entry_max, self); /* The password widgets: */ - priv->entry_user_password = hildon_entry_new (MODEST_EDITABLE_SIZE); + priv->entry_user_password = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_password), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); @@ -957,7 +957,7 @@ create_page_custom_incoming (ModestEasysetupWizardDialog *self) gtk_box_pack_start (GTK_BOX (box), priv->incoming_servertype_picker, FALSE, FALSE, 0); gtk_widget_show (priv->incoming_servertype_picker); - priv->entry_incomingserver = hildon_entry_new (MODEST_EDITABLE_SIZE); + priv->entry_incomingserver = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_incomingserver), HILDON_GTK_INPUT_MODE_FULL); @@ -1089,7 +1089,7 @@ create_page_custom_outgoing (ModestEasysetupWizardDialog *self) /* The outgoing server widgets: */ priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self); - priv->entry_outgoingserver = hildon_entry_new (MODEST_EDITABLE_SIZE); + priv->entry_outgoingserver = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off: */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_outgoingserver), HILDON_GTK_INPUT_MODE_FULL); @@ -1847,13 +1847,13 @@ set_default_custom_servernames (ModestEasysetupWizardDialog *self) /* This could happen when the combo box has still no active iter */ if (protocol_type != MODEST_PROTOCOL_REGISTRY_TYPE_INVALID) { - const gchar* email_address = hildon_entry_get_text (HILDON_ENTRY(priv->entry_user_email)); + const gchar* email_address = modest_entry_get_text (priv->entry_user_email); gchar* servername = util_get_default_servername_from_email_address (email_address, protocol_type); /* Do not set the INCOMING_CHANGED flag because of this edit */ g_signal_handlers_block_by_func (G_OBJECT (priv->entry_incomingserver), G_CALLBACK (on_entry_incoming_servername_changed), self); - hildon_entry_set_text (HILDON_ENTRY (priv->entry_incomingserver), servername); + modest_entry_set_text (priv->entry_incomingserver, servername); g_signal_handlers_unblock_by_func (G_OBJECT (priv->entry_incomingserver), G_CALLBACK (on_entry_incoming_servername_changed), self); g_free (servername); @@ -1868,13 +1868,13 @@ set_default_custom_servernames (ModestEasysetupWizardDialog *self) if (priv->entry_user_email && ((priv->server_changes & MODEST_EASYSETUP_WIZARD_DIALOG_OUTGOING_CHANGED) == 0)) { - const gchar* email_address = hildon_entry_get_text (HILDON_ENTRY(priv->entry_user_email)); + const gchar* email_address = modest_entry_get_text (priv->entry_user_email); gchar* servername = util_get_default_servername_from_email_address (email_address, MODEST_PROTOCOLS_TRANSPORT_SMTP); /* Do not set the OUTGOING_CHANGED flag because of this edit */ g_signal_handlers_block_by_func (G_OBJECT (priv->entry_outgoingserver), G_CALLBACK (on_entry_outgoing_servername_changed), self); - hildon_entry_set_text (HILDON_ENTRY (priv->entry_outgoingserver), servername); + modest_entry_set_text (priv->entry_outgoingserver, servername); g_signal_handlers_unblock_by_func (G_OBJECT (priv->entry_outgoingserver), G_CALLBACK (on_entry_outgoing_servername_changed), self); g_free (servername); @@ -1888,7 +1888,7 @@ get_entered_account_title (ModestEasysetupWizardDialog *self) const gchar* account_title; priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE(self); - account_title = hildon_entry_get_text (HILDON_ENTRY (priv->entry_account_title)); + account_title = modest_entry_get_text (priv->entry_account_title); if (!account_title || (g_utf8_strlen (account_title, -1) == 0)) { return NULL; @@ -1955,7 +1955,7 @@ on_before_next (ModestWizardDialog *dialog, GtkWidget *current_page, GtkWidget * } else if (current_page == priv->page_user_details) { /* Check that the email address is valud: */ - const gchar* email_address = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_email)); + const gchar* email_address = modest_entry_get_text (priv->entry_user_email); if ((!email_address) || (g_utf8_strlen (email_address, -1) == 0)) return FALSE; @@ -2030,7 +2030,7 @@ static gboolean entry_is_empty (GtkWidget *entry) if (!entry) return FALSE; - const gchar* text = hildon_entry_get_text (HILDON_ENTRY (entry)); + const gchar* text = modest_entry_get_text (entry); if ((!text) || (g_utf8_strlen (text, -1) == 0)) return TRUE; else { @@ -2240,8 +2240,8 @@ save_to_settings (ModestEasysetupWizardDialog *self) } /* username and password (for both incoming and outgoing): */ - username = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_username)); - password = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_password)); + username = modest_entry_get_text (priv->entry_user_username); + password = modest_entry_get_text (priv->entry_user_password); store_settings = modest_account_settings_get_store_settings (priv->settings); transport_settings = modest_account_settings_get_transport_settings (priv->settings); @@ -2313,7 +2313,7 @@ save_to_settings (ModestEasysetupWizardDialog *self) modest_server_account_settings_set_port (store_settings, store_port); } else { /* Use custom pages because no preset was specified: */ - store_hostname = g_strdup (hildon_entry_get_text (HILDON_ENTRY (priv->entry_incomingserver) )); + store_hostname = g_strdup (modest_entry_get_text (priv->entry_incomingserver )); store_protocol = modest_servertype_picker_get_active_servertype ( MODEST_SERVERTYPE_PICKER (priv->incoming_servertype_picker)); @@ -2390,7 +2390,7 @@ save_to_settings (ModestEasysetupWizardDialog *self) registry = modest_runtime_get_protocol_registry (); /* Use custom pages because no preset was specified: */ - transport_hostname = g_strdup (hildon_entry_get_text (HILDON_ENTRY (priv->entry_outgoingserver) )); + transport_hostname = g_strdup (modest_entry_get_text (priv->entry_outgoingserver )); store_proto = modest_protocol_registry_get_protocol_by_type (registry, store_protocol); @@ -2419,8 +2419,8 @@ save_to_settings (ModestEasysetupWizardDialog *self) if (alternate_username) g_free (alternate_username); - fullname = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_name)); - email_address = hildon_entry_get_text (HILDON_ENTRY (priv->entry_user_email)); + fullname = modest_entry_get_text (priv->entry_user_name); + email_address = modest_entry_get_text (priv->entry_user_email); modest_account_settings_set_fullname (priv->settings, fullname); modest_account_settings_set_email_address (priv->settings, email_address); /* we don't set retrieve type to preserve advanced settings if diff --git a/src/hildon2/modest-maemo-security-options-view.c b/src/hildon2/modest-maemo-security-options-view.c index a9d7d4e..9cc1143 100644 --- a/src/hildon2/modest-maemo-security-options-view.c +++ b/src/hildon2/modest-maemo-security-options-view.c @@ -231,7 +231,7 @@ on_entry_changed (GtkEditable *editable, } if (is_secure && - !g_strcmp0 (hildon_entry_get_text (HILDON_ENTRY (ppriv->user_entry)), "")) { + !g_strcmp0 (modest_entry_get_text (ppriv->user_entry), "")) { priv->missing_data = TRUE; } else { priv->missing_data = FALSE; @@ -312,7 +312,7 @@ create_outgoing_security (ModestSecurityOptionsView* self, on_entry_max, self); /* Password widgets */ - ppriv->pwd_entry = hildon_entry_new (MODEST_EDITABLE_SIZE); + ppriv->pwd_entry = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); /* Auto-capitalization is the default, so let's turn it off */ hildon_gtk_entry_set_input_mode (GTK_ENTRY (ppriv->pwd_entry), diff --git a/src/hildon2/modest-msg-edit-window.c b/src/hildon2/modest-msg-edit-window.c index d5d70ae..24dee61 100644 --- a/src/hildon2/modest-msg-edit-window.c +++ b/src/hildon2/modest-msg-edit-window.c @@ -907,10 +907,10 @@ init_window (ModestMsgEditWindow *obj) priv->subject_box = gtk_hbox_new (FALSE, MODEST_MARGIN_NONE); priv->priority_icon = gtk_image_new (); gtk_box_pack_start (GTK_BOX (priv->subject_box), priv->priority_icon, FALSE, FALSE, 0); - priv->subject_field = hildon_entry_new (MODEST_EDITABLE_SIZE); + priv->subject_field = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); gtk_entry_set_max_length (GTK_ENTRY (priv->subject_field) ,SUBJECT_MAX_LENGTH); g_object_set (G_OBJECT (priv->subject_field), "truncate-multiline", TRUE, NULL); - hildon_entry_set_placeholder ((HildonEntry *) priv->subject_field, _("mail_va_no_subject")); + modest_entry_set_hint (priv->subject_field, _("mail_va_no_subject")); hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->subject_field), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_AUTOCAP); gtk_box_pack_start (GTK_BOX (priv->subject_box), priv->subject_field, TRUE, TRUE, 0); diff --git a/src/hildon2/modest-platform.c b/src/hildon2/modest-platform.c index 68272c6..b8203bc 100644 --- a/src/hildon2/modest-platform.c +++ b/src/hildon2/modest-platform.c @@ -1031,7 +1031,7 @@ modest_platform_run_folder_common_dialog (GtkWindow *parent_window, if (show_name) { label_entry = gtk_label_new (label_text); - entry = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); + entry = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); gtk_entry_set_max_length (GTK_ENTRY (entry), 20); gtk_misc_set_alignment (GTK_MISC (label_entry), 0.0, 0.5); diff --git a/src/modest-ui-actions.c b/src/modest-ui-actions.c index 1e9006c..b97fa67 100644 --- a/src/modest-ui-actions.c +++ b/src/modest-ui-actions.c @@ -4021,19 +4021,11 @@ password_dialog_check_field (GtkEditable *editable, const gchar *value; gboolean any_value_empty = FALSE; -#ifdef MODEST_TOOLKIT_HILDON2 - value = hildon_entry_get_text (HILDON_ENTRY (fields->username)); -#else - value = gtk_entry_get_text (GTK_ENTRY (fields->username)); -#endif + value = modest_entry_get_text (fields->username); if ((value == NULL) || value[0] == '\0') { any_value_empty = TRUE; } -#ifdef MODEST_TOOLKIT_HILDON2 - value = hildon_entry_get_text (HILDON_ENTRY (fields->password)); -#else - value = gtk_entry_get_text (GTK_ENTRY (fields->password)); -#endif + value = modest_entry_get_text (fields->password); if ((value == NULL) || value[0] == '\0') { any_value_empty = TRUE; } @@ -4122,15 +4114,10 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, gchar *initial_username = modest_account_mgr_get_server_account_username ( modest_runtime_get_account_mgr(), server_account_name); -#ifdef MODEST_TOOLKIT_HILDON2 - GtkWidget *entry_username = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); - if (initial_username) - hildon_entry_set_text (HILDON_ENTRY (entry_username), initial_username); -#else - GtkWidget *entry_username = gtk_entry_new (); + GtkWidget *entry_username = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); if (initial_username) - gtk_entry_set_text (GTK_ENTRY (entry_username), initial_username); -#endif + modest_entry_set_text (entry_username, initial_username); + /* Dim this if a connection has ever succeeded with this username, * as per the UI spec: */ /* const gboolean username_known = */ @@ -4170,11 +4157,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, #endif /* !MODEST_TOOLKIT_GTK */ /* password: */ -#ifdef MODEST_TOOLKIT_HILDON2 - GtkWidget *entry_password = hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH); -#else - GtkWidget *entry_password = gtk_entry_new (); -#endif + GtkWidget *entry_password = modest_toolkit_factory_create_entry (modest_runtime_get_toolkit_factory ()); gtk_entry_set_visibility (GTK_ENTRY(entry_password), FALSE); /* gtk_entry_set_invisible_char (GTK_ENTRY(entry_password), "*"); */ @@ -4183,14 +4166,9 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, hildon_gtk_entry_set_input_mode (GTK_ENTRY (entry_password), HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_INVISIBLE); -#ifdef MODEST_TOOLKIT_HILDON2 caption = modest_maemo_utils_create_captioned (sizegroup, NULL, _("mail_fi_password"), FALSE, entry_password); -#else - caption = hildon_caption_new (sizegroup, - _("mail_fi_password"), entry_password, NULL, HILDON_CAPTION_MANDATORY); -#endif gtk_widget_show (entry_password); gtk_box_pack_start (GTK_BOX(GTK_DIALOG(dialog)->vbox), caption, FALSE, FALSE, MODEST_MARGIN_HALF); @@ -4225,11 +4203,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) { if (username) { -#ifdef MODEST_TOOLKIT_HILDON2 - *username = g_strdup (hildon_entry_get_text (HILDON_ENTRY(entry_username))); -#else - *username = g_strdup (gtk_entry_get_text (GTK_ENTRY(entry_username))); -#endif + *username = g_strdup (modest_entry_get_text (entry_username)); /* Note that an empty field becomes the "" string */ if (*username && strlen (*username) > 0) { @@ -4255,11 +4229,7 @@ modest_ui_actions_on_password_requested (TnyAccountStore *account_store, } if (password) { -#ifdef MODEST_TOOLKIT_HILDON2 - *password = g_strdup (hildon_entry_get_text (HILDON_ENTRY(entry_password))); -#else - *password = g_strdup (gtk_entry_get_text (GTK_ENTRY(entry_password))); -#endif + *password = g_strdup (modest_entry_get_text (entry_password)); /* We do not save the password in the configuration, * because this function is only called for passwords that should -- 1.7.9.5