static gboolean
save_configuration (ModestDefaultAccountSettingsDialog *dialog);
+static void on_missing_mandatory_data (ModestSecurityOptionsView *security_view,
+ gboolean missing,
+ gpointer user_data);
+
static const gchar * null_means_empty (const gchar * str);
static const gchar *
}
static GtkWidget*
-create_page_account_details (ModestDefaultAccountSettingsDialog *self)
+create_page_account_details (ModestDefaultAccountSettingsDialog *self,
+ GtkSizeGroup *title_sizegroup,
+ GtkSizeGroup *value_sizegroup)
{
ModestDefaultAccountSettingsDialogPrivate *priv;
- GtkWidget *box;
- GtkSizeGroup* title_sizegroup;
- GtkSizeGroup* value_sizegroup;
- GtkWidget *hbox;
+ GtkWidget *box, *hbox, *caption;
+ gchar *tmp = NULL;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
- title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
-
+
/* The description widgets: */
priv->entry_account_title = GTK_WIDGET (modest_validating_entry_new ());
/* Do use auto-capitalization: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_account_title),
HILDON_GTK_INPUT_MODE_FULL | HILDON_GTK_INPUT_MODE_AUTOCAP);
- GtkWidget *caption = create_captioned (self, title_sizegroup, value_sizegroup,
- _("mcen_fi_account_title"), FALSE,
- priv->entry_account_title);
+ tmp = g_strconcat (_("mcen_fi_account_title"), "*", NULL);
+ caption = create_captioned (self, title_sizegroup, value_sizegroup,
+ tmp, FALSE,
+ priv->entry_account_title);
+ g_free (tmp);
gtk_widget_show (priv->entry_account_title);
connect_for_modified (self, priv->entry_account_title);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 0);
gtk_widget_show (caption);
-
+
/* Prevent the use of some characters in the account title,
* as required by our UI specification: */
GList *list_prevent = NULL;
gtk_box_pack_start (GTK_BOX (box), priv->checkbox_leave_messages, FALSE, FALSE, 0);
gtk_widget_show (priv->checkbox_leave_messages);
- g_object_unref (title_sizegroup);
- g_object_unref (value_sizegroup);
-
gtk_widget_show (GTK_WIDGET (box));
return GTK_WIDGET (box);
}
static GtkWidget*
-create_page_user_details (ModestDefaultAccountSettingsDialog *self)
+create_page_user_details (ModestDefaultAccountSettingsDialog *self,
+ GtkSizeGroup *title_sizegroup,
+ GtkSizeGroup *value_sizegroup)
{
ModestDefaultAccountSettingsDialogPrivate *priv;
GtkWidget *box;
- GtkSizeGroup* title_sizegroup;
- GtkSizeGroup* value_sizegroup;
+ gchar *tmp;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
box = gtk_vbox_new (FALSE, MODEST_MARGIN_NONE);
- title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
- value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
/* The name widgets: */
priv->entry_user_name = GTK_WIDGET (modest_validating_entry_new ());
priv->entry_user_username = GTK_WIDGET (modest_validating_entry_new ());
/* Auto-capitalization is the default, so let's turn it off: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_username), HILDON_GTK_INPUT_MODE_FULL);
+ tmp = g_strconcat (_("mail_fi_username"), "*", NULL);
caption = create_captioned (self, title_sizegroup, value_sizegroup,
- _("mail_fi_username"), FALSE,
+ tmp, FALSE,
priv->entry_user_username);
+ g_free (tmp);
gtk_widget_show (priv->entry_user_username);
connect_for_modified (self, priv->entry_user_username);
gtk_box_pack_start (GTK_BOX (box), caption, FALSE, FALSE, 0);
priv->entry_user_email = GTK_WIDGET (modest_validating_entry_new ());
/* Auto-capitalization is the default, so let's turn it off: */
hildon_gtk_entry_set_input_mode (GTK_ENTRY (priv->entry_user_email), HILDON_GTK_INPUT_MODE_FULL);
+ tmp = g_strconcat (_("mcen_li_emailsetup_email_address"), "*", NULL);
caption = create_captioned (self, title_sizegroup, value_sizegroup,
- _("mcen_li_emailsetup_email_address"), FALSE, priv->entry_user_email);
+ tmp, FALSE, priv->entry_user_email);
+ g_free (tmp);
gtk_entry_set_text (GTK_ENTRY (priv->entry_user_email), MODEST_EXAMPLE_EMAIL_ADDRESS); /* Default text. */
gtk_widget_show (priv->entry_user_email);
connect_for_modified (self, priv->entry_user_email);
RESPONSE_SIGNATURE_DUMMY);
gtk_widget_show (priv->button_signature);
- g_object_unref (title_sizegroup);
- g_object_unref (value_sizegroup);
-
gtk_widget_show (GTK_WIDGET (box));
return GTK_WIDGET (box);
gtk_widget_show (priv->incoming_security);
gtk_widget_show (GTK_WIDGET (box));
+ g_signal_connect (priv->incoming_security, "missing-mandatory-data",
+ G_CALLBACK (on_missing_mandatory_data), self);
return GTK_WIDGET (box);
}
hildon_entry_new (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH);
/* 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<small>(SMTP)</small>", NULL);
+ smtp_caption_label = g_strconcat (_("mcen_li_emailsetup_smtp"), "*\n<small>(SMTP)</small>", NULL);
GtkWidget *caption = create_captioned (self, security_title_sizegroup, security_value_sizegroup,
smtp_caption_label, TRUE, priv->entry_outgoingserver);
g_free (smtp_caption_label);
GtkWidget *separator = gtk_hseparator_new ();
gtk_box_pack_start (GTK_BOX (box), separator, FALSE, FALSE, MODEST_MARGIN_DEFAULT);
+ hildon_gtk_widget_set_theme_size (separator, HILDON_SIZE_AUTO);
gtk_widget_show (separator);
/* connection-specific checkbox: */
return GTK_WIDGET (box);
}
-
+
static gboolean
check_data (ModestDefaultAccountSettingsDialog *self)
{
account_title = get_entered_account_title (self);
if (!account_title)
return FALSE; /* Should be prevented already anyway. */
-
- if (strcmp(account_title, priv->original_account_title) != 0) {
+
+ if (g_strcmp0 (account_title, priv->original_account_title) != 0) {
gboolean name_in_use;
/* Check the changed title: */
name_in_use = modest_account_mgr_account_with_display_name_exists (priv->account_manager,
account_title);
-
+
if (name_in_use) {
/* Warn the user via a dialog: */
modest_platform_information_banner(NULL, NULL, _("mail_ib_account_name_already_existing"));
-
+
g_free (account_title);
return FALSE;
}
}
-
+
g_free (account_title);
account_title = NULL;
if ((!email_address) || (strlen(email_address) == 0)) {
return FALSE;
}
-
+
if (!modest_text_utils_validate_email_address (email_address, NULL)) {
/* Warn the user via a dialog: */
modest_platform_information_banner (NULL, NULL, _("mcen_ib_invalid_email"));
GtkWidget *pannable;
GtkWidget *separator;
GtkWidget *align;
+ GtkSizeGroup* account_title_sizegroup;
+ GtkSizeGroup* account_value_sizegroup;
GtkSizeGroup *sec_title_sizegroup, *sec_value_sizegroup;
priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE(self);
priv->protocol_authentication_incoming = MODEST_PROTOCOLS_AUTH_PASSWORD;
/* Create the common pages */
- priv->page_account_details = create_page_account_details (self);
- priv->page_user_details = create_page_user_details (self);
+ account_title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ account_value_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
+ priv->page_account_details = create_page_account_details (self, account_title_sizegroup, account_value_sizegroup);
+ priv->page_user_details = create_page_user_details (self, account_title_sizegroup, account_value_sizegroup);
+ g_object_unref (account_title_sizegroup);
+ g_object_unref (account_value_sizegroup);
+
/* Create size groups for security settings */
sec_title_sizegroup = gtk_size_group_new(GTK_SIZE_GROUP_HORIZONTAL);
FALSE, FALSE, 0);
separator = gtk_hseparator_new ();
+ hildon_gtk_widget_set_theme_size (separator, HILDON_SIZE_AUTO);
gtk_box_pack_start (GTK_BOX (priv->main_container), separator,
FALSE, FALSE, MODEST_MARGIN_DEFAULT);
gtk_widget_show (separator);
priv->page_incoming,
FALSE, FALSE, 0);
separator = gtk_hseparator_new ();
+ hildon_gtk_widget_set_theme_size (separator, HILDON_SIZE_AUTO);
gtk_box_pack_start (GTK_BOX (priv->main_container), separator,
FALSE, FALSE, MODEST_MARGIN_DEFAULT);
gtk_widget_show (separator);