if (self->account_manager)
g_object_unref (G_OBJECT (self->account_manager));
- if (self->specific_window)
- gtk_widget_destroy (self->specific_window);
-
if (self->signature_dialog)
gtk_widget_destroy (self->signature_dialog);
on_button_signature (GtkButton *button, gpointer user_data)
{
ModestAccountSettingsDialog * self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
-
+ gint response;
+
/* Create the window, if necessary: */
if (!(self->signature_dialog)) {
self->signature_dialog = GTK_WIDGET (modest_signature_editor_dialog_new ());
}
/* Show the window: */
- gtk_window_set_transient_for (GTK_WINDOW (self->signature_dialog), GTK_WINDOW (self));
- gtk_window_set_modal (GTK_WINDOW (self->signature_dialog), TRUE);
- const gint response = gtk_dialog_run (GTK_DIALOG (self->signature_dialog));
- gtk_widget_hide (self->signature_dialog);
- if (response != GTK_RESPONSE_OK) {
- /* Destroy the widget now, and its data: */
- gtk_widget_destroy (self->signature_dialog);
- self->signature_dialog = NULL;
- }
- else {
- /* Mark modified, so we use the dialog's data later: */
- self->modified = TRUE;
- }
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (self->signature_dialog));
+
+ response = gtk_dialog_run (GTK_DIALOG (self->signature_dialog));
+ gtk_widget_hide (self->signature_dialog);
+ if (response != GTK_RESPONSE_OK) {
+ /* Destroy the widget now, and its data: */
+ gtk_widget_destroy (self->signature_dialog);
+ self->signature_dialog = NULL;
+ } else {
+ /* Mark modified, so we use the dialog's data later: */
+ self->modified = TRUE;
+ }
}
static GtkWidget*
* as required by our UI specification: */
modest_validating_entry_set_unallowed_characters_whitespace (
MODEST_VALIDATING_ENTRY (self->entry_user_username));
+ modest_validating_entry_set_func (MODEST_VALIDATING_ENTRY (self->entry_user_username),
+ modest_maemo_utils_on_entry_invalid_character,
+ self);
/* Set max length as in the UI spec:
* The UI spec seems to want us to show a dialog if we hit the maximum. */
on_button_outgoing_smtp_servers (GtkButton *button, gpointer user_data)
{
ModestAccountSettingsDialog * self = MODEST_ACCOUNT_SETTINGS_DIALOG (user_data);
-
+ ModestConnectionSpecificSmtpWindow *smtp_win;
+
/* Create the window if necessary: */
- if (!(self->specific_window)) {
- self->specific_window = GTK_WIDGET (modest_connection_specific_smtp_window_new ());
- modest_connection_specific_smtp_window_fill_with_connections (
- MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (self->specific_window), self->account_manager);
- }
+ smtp_win = modest_connection_specific_smtp_window_new ();
+ modest_connection_specific_smtp_window_fill_with_connections (smtp_win, self->account_manager);
/* Show the window: */
- gtk_window_set_transient_for (GTK_WINDOW (self->specific_window), GTK_WINDOW (self));
- gtk_window_set_modal (GTK_WINDOW (self->specific_window), TRUE);
- gtk_widget_show (self->specific_window);
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (smtp_win));
+ gtk_widget_show (GTK_WIDGET (smtp_win));
self->modified = TRUE;
}
if(error == NULL || error->domain != modest_utils_get_supported_secure_authentication_error_quark() ||
error->code != MODEST_UTILS_GET_SUPPORTED_SECURE_AUTHENTICATION_ERROR_CANCELED)
hildon_banner_show_information(GTK_WIDGET (self), NULL,
- _("Could not discover supported secure authentication methods."));
+ _("mcen_ib_unableto_discover_auth_methods"));
if(error != NULL)
g_error_free(error);
g_object_unref (store_settings);
g_object_unref (transport_settings);
- if (self->save_password)
+ if (!self->save_password)
hildon_banner_show_information(NULL, NULL, _("mcen_ib_advsetup_settings_saved"));
}
} else {
if (account_name != NULL)
modest_account_mgr_save_account_settings (dialog->account_manager, dialog->settings);
- if (dialog->specific_window) {
- return modest_connection_specific_smtp_window_save_server_accounts (
- MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (dialog->specific_window));
- } else {
- return TRUE;
- }
-
+ return TRUE;
}
static gboolean entry_is_empty (GtkWidget *entry)
enable_ok);
}
+void
+modest_account_settings_dialog_check_allow_changes (ModestAccountSettingsDialog *self)
+{
+ ModestServerAccountSettings *incoming_settings;
+ const gchar *server_account_name;
+ gboolean username_known;
+
+ if (!G_IS_OBJECT (self->settings))
+ return;
+
+ incoming_settings = modest_account_settings_get_store_settings (self->settings);
+ server_account_name = modest_server_account_settings_get_account_name (incoming_settings);
+
+ username_known = modest_account_mgr_get_server_account_username_has_succeeded (self->account_manager,
+ server_account_name);
+
+ /* Enable or disable widgets */
+ gtk_widget_set_sensitive (self->entry_user_username, !username_known);
+ gtk_widget_set_sensitive (self->entry_incomingserver, !username_known);
+ /* gtk_widget_set_sensitive (self->entry_outgoingserver, !username_known); */
+ /* gtk_widget_set_sensitive (self->entry_outgoing_username, !username_known); */
+ gtk_widget_set_sensitive (self->entry_incoming_port, !username_known);
+/* gtk_widget_set_sensitive (self->entry_outgoing_port, !username_known); */
+ gtk_widget_set_sensitive (self->combo_incoming_security, !username_known);
+/* gtk_widget_set_sensitive (self->combo_outgoing_security, !username_known); */
+}
+
void
modest_account_settings_dialog_set_modified (ModestAccountSettingsDialog *dialog, gboolean modified)
{