* src/modest-ui-actions.[ch]:
[modest] / src / modest-ui-actions.c
index 7f0ec85..2fd335f 100644 (file)
@@ -241,11 +241,11 @@ modest_ui_actions_on_accounts (GtkAction *action, ModestWindow *win)
         * because it requires a providers preset file which is not publically available.
         */
 #ifdef MODEST_PLATFORM_MAEMO /* Defined in config.h */
-       GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr());
+       GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr(), 
+                               TRUE /* enabled accounts only */);
        gboolean accounts_exist = account_names != NULL;
        g_slist_free (account_names);
        
-/* To test, while modest_account_mgr_account_names() is broken: accounts_exist = TRUE; */
        if (!accounts_exist) {
                /* If there are no accounts yet, just show the easy-setup wizard, as per the UI spec: */
                ModestEasysetupWizardDialog *wizard = modest_easysetup_wizard_dialog_new ();
@@ -761,7 +761,8 @@ do_send_receive_auto (ModestWindow *win)
                tny_device_is_online(modest_runtime_get_device()) ? "yes":"no");
 
        /* TODO: Delete the item->data strings as well as the list? */
-       GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr());
+       GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr(), 
+                               TRUE /* enabled accounts only */);
        GSList *iter = account_names;
        while (iter) {                  
                const gchar * account_name = (const char*) iter->data;
@@ -799,7 +800,8 @@ void
 modest_ui_actions_on_send_receive (GtkAction *action,  ModestWindow *win)
 {
        /* Check that at least one account exists: */
-       GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr());
+       GSList *account_names = modest_account_mgr_account_names (modest_runtime_get_account_mgr(),
+                               TRUE /* enabled accounts only */);
        gboolean accounts_exist = account_names != NULL;
        g_slist_free (account_names);
        
@@ -832,7 +834,7 @@ modest_ui_actions_toggle_header_list_view (GtkAction *action, ModestMainWindow *
        /* what is saved/restored is depending on the style; thus; we save with
         * old style, then update the style, and restore for this new style
         */
-       modest_widget_memory_save (conf, G_OBJECT(header_view), "header-view");
+       modest_widget_memory_save (conf, G_OBJECT(header_view), MODEST_CONF_HEADER_VIEW_KEY);
        
        if (modest_header_view_get_style
            (MODEST_HEADER_VIEW(header_view)) == MODEST_HEADER_VIEW_STYLE_DETAILS)
@@ -843,7 +845,7 @@ modest_ui_actions_toggle_header_list_view (GtkAction *action, ModestMainWindow *
                                              MODEST_HEADER_VIEW_STYLE_DETAILS);
 
        modest_widget_memory_restore (conf, G_OBJECT(header_view),
-                                     "header-view");
+                                     MODEST_CONF_HEADER_VIEW_KEY);
 }
 
 
@@ -1056,9 +1058,9 @@ modest_ui_actions_on_folder_selection_changed (ModestFolderView *folder_view,
                        modest_header_view_set_folder (MODEST_HEADER_VIEW(header_view),
                                                       TNY_FOLDER (folder_store));
                        modest_widget_memory_restore (conf, G_OBJECT(header_view),
-                                                     "header-view");
+                                                     MODEST_CONF_HEADER_VIEW_KEY);
                } else {
-                       modest_widget_memory_save (conf, G_OBJECT (header_view), "header-view");
+                       modest_widget_memory_save (conf, G_OBJECT (header_view), MODEST_CONF_HEADER_VIEW_KEY);
                        modest_header_view_set_folder (MODEST_HEADER_VIEW(header_view), NULL);
                }
        } else if (TNY_IS_ACCOUNT (folder_store)) {
@@ -1225,6 +1227,9 @@ modest_ui_actions_on_send (GtkWidget *widget, ModestMsgEditWindow *edit_window)
        ModestAccountMgr *account_mgr;
 
        g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW(edit_window));
+
+       if (!modest_msg_edit_window_check_names (edit_window))
+               return;
        
        data = modest_msg_edit_window_get_msg_data (edit_window);
 
@@ -2032,6 +2037,13 @@ modest_ui_actions_on_select_contacts (GtkAction *action, ModestMsgEditWindow *wi
        modest_msg_edit_window_select_contacts (window);
 }
 
+void
+modest_ui_actions_on_check_names (GtkAction *action, ModestMsgEditWindow *window)
+{
+       g_return_if_fail (MODEST_IS_MSG_EDIT_WINDOW (window));
+       modest_msg_edit_window_check_names (window);
+}
+
 
 static GtkWidget*
 create_move_to_dialog (ModestWindow *win,