static void
on_caption_entry_changed (GtkEditable *editable, gpointer user_data)
{
- ModestEasysetupWizardDialog *self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
- g_assert(self);
+ ModestEasysetupWizardDialog *self;
+ gboolean mandatory, empty;
+ ModestEasysetupWizardDialogPrivate *priv;
+
+ g_return_if_fail (user_data);
+
+ self = MODEST_EASYSETUP_WIZARD_DIALOG (user_data);
+ priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self);
+
invoke_enable_buttons_vfunc(self);
+
+ empty = !g_utf8_collate (gtk_entry_get_text (GTK_ENTRY (editable)), "");
+ mandatory = ((GtkWidget *) editable == priv->entry_account_title) ||
+ ((GtkWidget *) editable == priv->entry_user_username) ||
+ ((GtkWidget *) editable == priv->entry_user_email);
+
+ /* Show a banner & get focus */
+ if (empty && mandatory) {
+ modest_platform_information_banner ((GtkWidget *) editable, NULL,
+ _CS("ckct_ib_enter_some_text"));
+ gtk_widget_grab_focus (GTK_WIDGET (editable));
+ }
}
static void
modest_connection_specific_smtp_window_fill_with_connections (MODEST_CONNECTION_SPECIFIC_SMTP_WINDOW (specific_window), priv->account_manager);
/* Show the window */
- modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (specific_window));
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (specific_window), GTK_WINDOW (self));
gtk_widget_show (specific_window);
}
}
modest_account_settings_dialog_load_settings (dialog, priv->settings);
- modest_window_mgr_set_modal (modest_runtime_get_window_mgr (), GTK_WINDOW (dialog));
+ modest_window_mgr_set_modal (modest_runtime_get_window_mgr (),
+ GTK_WINDOW (dialog), GTK_WINDOW (self));
response = gtk_dialog_run (GTK_DIALOG (dialog));
/* Aavoid a clash with an existing display name: */
const gboolean name_in_use = modest_account_mgr_account_with_display_name_exists (
priv->account_manager, account_title);
+ g_free (account_title);
if (name_in_use) {
/* Warn the user via a dialog: */
{
ModestEasysetupWizardDialogPrivate *priv = MODEST_EASYSETUP_WIZARD_DIALOG_GET_PRIVATE (self);
guint special_port;
- gchar *provider_id;
+ gchar *provider_id = NULL;
gchar* display_name;
const gchar *username, *password;
gchar *store_hostname, *transport_hostname;
"but it's not a ModestAccountProtocol");
}
+ g_free (provider_id);
return;
}
display_name = get_entered_account_title (self);
modest_account_settings_set_display_name (priv->settings, display_name);
g_free (display_name);
+ g_free (provider_id);
}