If handle_calendar is not handler, then don't show the calendar containers
[modest] / src / hildon2 / modest-default-account-settings-dialog.c
index b688662..e6461e5 100644 (file)
@@ -138,6 +138,10 @@ enable_buttons (ModestDefaultAccountSettingsDialog *self);
 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 *
@@ -321,25 +325,27 @@ create_page_account_details (ModestDefaultAccountSettingsDialog *self,
                             GtkSizeGroup *value_sizegroup)
 {
        ModestDefaultAccountSettingsDialogPrivate *priv;
-       GtkWidget *box;
-       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);
-           
+
        /* 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;
@@ -482,6 +488,7 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self,
 {
        ModestDefaultAccountSettingsDialogPrivate *priv;
        GtkWidget *box;
+       gchar *tmp;
 
        priv = MODEST_DEFAULT_ACCOUNT_SETTINGS_DIALOG_GET_PRIVATE (self);
 
@@ -523,9 +530,11 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self,
        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);
@@ -563,8 +572,10 @@ create_page_user_details (ModestDefaultAccountSettingsDialog *self,
        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);
@@ -660,6 +671,8 @@ create_page_incoming (ModestDefaultAccountSettingsDialog *self,
 
        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);
 }
@@ -732,7 +745,7 @@ create_page_outgoing (ModestDefaultAccountSettingsDialog *self,
                        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);
@@ -790,7 +803,7 @@ create_page_outgoing (ModestDefaultAccountSettingsDialog *self,
 
        return GTK_WIDGET (box);
 }
-       
+
 static gboolean
 check_data (ModestDefaultAccountSettingsDialog *self)
 {
@@ -806,23 +819,23 @@ 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;
 
@@ -831,7 +844,7 @@ check_data (ModestDefaultAccountSettingsDialog *self)
        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"));