2005-08-10 [colin] 1.9.13cvs30
[claws.git] / src / mainwindow.c
index f1f639581d347f9c7d73ffdbfb794281660e9825..bdad4c82382e54a650123ee4fbc2f5b02f89b909 100644 (file)
@@ -524,9 +524,9 @@ static GtkItemFactoryEntry mainwin_entries[] =
        {N_("/_View/E_xpand all threads"),      NULL, expand_threads_cb, 0, NULL},
        {N_("/_View/Co_llapse all threads"),    NULL, collapse_threads_cb, 0, NULL},
        {N_("/_View/_Hide read messages"),      NULL, hide_read_messages, 0, "<ToggleItem>"},
-       {N_("/_View/Set displayed _items"),     NULL, NULL, 0, "<Branch>"},
-       {N_("/_View/Set displayed _items/ in _Summary view..."),NULL, set_summary_display_item_cb, 0, NULL},
-       {N_("/_View/Set displayed _items/ in _Folder view..."), NULL, set_folder_display_item_cb, 0, NULL},
+       {N_("/_View/Set displayed _columns"),   NULL, NULL, 0, "<Branch>"},
+       {N_("/_View/Set displayed _columns/in _Folder list..."),        NULL, set_folder_display_item_cb, 0, NULL},
+       {N_("/_View/Set displayed _columns/in _Message list..."),NULL, set_summary_display_item_cb, 0, NULL},
 
        {N_("/_View/---"),                      NULL, NULL, 0, "<Separator>"},
        {N_("/_View/_Go to"),                   NULL, NULL, 0, "<Branch>"},
@@ -848,7 +848,6 @@ MainWindow *main_window_create(SeparateType type)
        GtkWidget *menuitem;
        gint i;
        guint n_menu_entries;
-       gboolean hide_messageview = FALSE;
 
        static GdkGeometry geometry;
 
@@ -1049,8 +1048,7 @@ MainWindow *main_window_create(SeparateType type)
        debug_print("done.\n");
 
        messageview->visible = prefs_common.msgview_visible;
-       hide_messageview = !messageview->visible;
-       
+
        main_window_set_widgets(mainwin, type);
 
        g_signal_connect(G_OBJECT(window), "size_allocate",
@@ -1146,9 +1144,6 @@ MainWindow *main_window_create(SeparateType type)
        if (prefs_common.work_offline)
                online_switch_clicked (GTK_BUTTON(online_switch), mainwin);
 
-       if (mainwin->type == SEPARATE_NONE && hide_messageview)
-               main_window_toggle_message_view(mainwin);
-
        return mainwin;
 }
 
@@ -1668,13 +1663,16 @@ void main_window_empty_trash(MainWindow *mainwin, gboolean confirm)
                folder = FOLDER(list->data);
                if (folder && folder->trash && folder->trash->total_msgs > 0)
                        has_trash++;
+               if (folder->account && folder->account->set_trash_folder && 
+                   folder_find_item_from_identifier(folder->account->trash_folder))
+                       has_trash++;
        }
 
        if (!has_trash) return;
        
        if (confirm) {
                if (alertpanel(_("Empty trash"),
-                              _("Empty all messages in trash?"),
+                              _("Delete all messages in trash folders?"),
                               GTK_STOCK_YES, GTK_STOCK_NO, NULL)
                    != G_ALERTDEFAULT)
                        return;
@@ -1764,8 +1762,9 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
                state |= M_NOT_NEWS;
        if (selection == SUMMARY_SELECTED_SINGLE &&
            (item &&
-            (item->stype == F_OUTBOX || item->stype == F_DRAFT ||
-             item->stype == F_QUEUE)))
+            (folder_has_parent_of_type(item, F_DRAFT) ||
+             folder_has_parent_of_type(item, F_OUTBOX) ||
+             folder_has_parent_of_type(item, F_QUEUE))))
                state |= M_ALLOW_REEDIT;
        if (cur_account)
                state |= M_HAVE_ACCOUNT;
@@ -3126,7 +3125,23 @@ static void new_account_cb(MainWindow *mainwin, guint action,
 static void account_selector_menu_cb(GtkMenuItem *menuitem, gpointer data)
 {
        cur_account = (PrefsAccount *)data;
-       main_window_reflect_prefs_all();
+       FolderItem *item = NULL;
+       
+       if (!mainwindow_get_mainwindow())
+               return;
+       main_window_show_cur_account(mainwindow_get_mainwindow());
+       toolbar_update(TOOLBAR_MAIN, mainwindow_get_mainwindow());
+       main_window_set_menu_sensitive(mainwindow_get_mainwindow());
+       toolbar_main_set_sensitive(mainwindow_get_mainwindow());
+       
+       item = folderview_get_selected_item(
+                       mainwindow_get_mainwindow()->folderview);
+       if (item) {
+               toolbar_set_compose_button
+                       (mainwindow_get_mainwindow()->toolbar,
+                        FOLDER_TYPE(item->folder) == F_NEWS ? 
+                        COMPOSEBUTTON_NEWS : COMPOSEBUTTON_MAIL);
+       }
 }
 
 static void account_receive_menu_cb(GtkMenuItem *menuitem, gpointer data)