2007-06-08 [wwp] 2.9.2cvs50
[claws.git] / src / mainwindow.c
index b8a3b4eeb0c0f577e695fbcfd9151e211262d1ab..7ac43eaaae2ee6f11aa3d59da1267100a876cc0e 100644 (file)
@@ -864,8 +864,8 @@ static GtkItemFactoryEntry mainwin_entries[] =
                                                NULL, ssl_manager_open_cb, 0, NULL},
 #endif
        {N_("/_Tools/---"),                     NULL, NULL, 0, "<Separator>"},
-       {N_("/_Tools/Filtering debug window"),  NULL, filtering_debug_window_show_cb, 0, NULL},
-       {N_("/_Tools/_Log window"),             "<shift><control>L", log_window_show_cb, 0, NULL},
+       {N_("/_Tools/Filtering Log"),           NULL, filtering_debug_window_show_cb, 0, NULL},
+       {N_("/_Tools/Protocol _Log"),           "<shift><control>L", log_window_show_cb, 0, NULL},
 
        {N_("/_Configuration"),                 NULL, NULL, 0, "<Branch>"},
        {N_("/_Configuration/C_hange current account"),
@@ -1320,9 +1320,9 @@ MainWindow *main_window_create()
                                prefs_common.filtering_debug_cliplog,
                                prefs_common.filtering_debug_loglength);
        if (prefs_common.enable_filtering_debug)
-               log_message(LOG_DEBUG_FILTERING, _("filtering debug enabled\n"));
+               log_message(LOG_DEBUG_FILTERING, _("filtering log enabled\n"));
        else
-               log_message(LOG_DEBUG_FILTERING, _("filtering debug disabled\n"));
+               log_message(LOG_DEBUG_FILTERING, _("filtering log disabled\n"));
 
        folderview->mainwin      = mainwin;
        folderview->summaryview  = summaryview;
@@ -1475,7 +1475,8 @@ MainWindow *main_window_create()
            prefs_common.layout_mode == SMALL_LAYOUT) {
                summary_relayout(mainwin->summaryview); 
        }
-
+       summary_update_unread(mainwin->summaryview, NULL);
+       
        gtk_widget_show(mainwin->window);
 
        /* initialize views */
@@ -2139,7 +2140,7 @@ void main_window_add_mailbox(MainWindow *mainwin)
 
        path = input_dialog(_("Add mailbox"),
                            _("Input the location of mailbox.\n"
-                             "If the existing mailbox is specified, it will be\n"
+                             "If an existing mailbox is specified, it will be\n"
                              "scanned automatically."),
                            "Mail");
        if (!path) return;
@@ -2240,6 +2241,8 @@ SensitiveCond main_window_get_current_state(MainWindow *mainwin)
 
        if (inc_is_active())
                state |= M_INC_ACTIVE;
+       if (imap_cancel_all_enabled())
+               state |= M_INC_ACTIVE;
 
        if (mainwin->summaryview->deleted > 0 ||
            mainwin->summaryview->moved > 0 ||
@@ -2272,8 +2275,8 @@ void main_window_set_menu_sensitive(MainWindow *mainwin)
                {"/File/Synchronise folders", M_WANT_SYNC},
                {"/File/Exit"      , M_UNLOCKED},
 
-               {"/Edit/Select thread"             , M_SINGLE_TARGET_EXIST},
-               {"/Edit/Delete thread"             , M_SINGLE_TARGET_EXIST},
+               {"/Edit/Select thread"             , M_TARGET_EXIST},
+               {"/Edit/Delete thread"             , M_TARGET_EXIST},
                {"/Edit/Find in current message...", M_SINGLE_TARGET_EXIST},
 
                {"/View/Set displayed columns/in Folder list..."
@@ -2653,6 +2656,13 @@ void main_window_popup(MainWindow *mainwin)
                main_window_show(mainwin);
 
        gtkut_window_popup(mainwin->window);
+       if (prefs_common.layout_mode == SMALL_LAYOUT) {
+               if (mainwin->in_folder) {
+                       mainwindow_enter_folder(mainwin);
+               } else {
+                       mainwindow_exit_folder(mainwin);
+               }
+       }
 }
 
 void main_window_show(MainWindow *mainwin)
@@ -3172,6 +3182,7 @@ static void set_layout_cb(MainWindow *mainwin, guint action,
                mainwindow_exit_folder(mainwin);
        }
        summary_relayout(mainwin->summaryview); 
+       summary_update_unread(mainwin->summaryview, NULL);
 }
 
 void main_window_toggle_work_offline (MainWindow *mainwin, gboolean offline,
@@ -3215,8 +3226,9 @@ static void mainwindow_check_synchronise(MainWindow *mainwin, gboolean ask)
                        _("Do you want to synchronise your folders now?"),
                        GTK_STOCK_CANCEL, _("+_Synchronise"), NULL) != G_ALERTALTERNATE)
                return;
-
-       folder_synchronise(NULL);
+       
+       if (offline_ask_sync)
+               folder_synchronise(NULL);
 }
 
 static void online_switch_clicked (GtkButton *btn, gpointer data) 
@@ -3281,6 +3293,7 @@ static void filtering_debug_window_show_cb(MainWindow *mainwin, guint action,
 static void inc_cancel_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
 {
        inc_cancel_all();
+       imap_cancel_all();
 }
 
 static void move_to_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
@@ -4058,7 +4071,7 @@ void mainwindow_learn (MainWindow *mainwin, gboolean is_spam)
        summary_mark_as_spam(mainwin->summaryview, is_spam, NULL);
 }
 
-void mainwindow_jump_to(const gchar *target)
+void mainwindow_jump_to(const gchar *target, gboolean popup)
 {
        gchar *tmp = NULL;
        gchar *p = NULL;
@@ -4084,7 +4097,8 @@ void mainwindow_jump_to(const gchar *target)
        if ((item = folder_find_item_from_identifier(tmp))) {
                printf("selecting folder '%s'\n", tmp);
                folderview_select(mainwin->folderview, item);
-               main_window_popup(mainwin);
+               if (popup)
+                       main_window_popup(mainwin);
                g_free(tmp);
                return;
        }
@@ -4102,7 +4116,8 @@ void mainwindow_jump_to(const gchar *target)
                        printf("selecting message %d\n", atoi(msg));
                        summary_select_by_msgnum(mainwin->summaryview, atoi(msg));
                        summary_display_msg_selected(mainwin->summaryview, FALSE);
-                       main_window_popup(mainwin);
+                       if (popup)
+                               main_window_popup(mainwin);
                        g_free(tmp);
                        return;
                } else if (item && msg[0] == '<' && msg[strlen(msg)-1] == '>') {
@@ -4114,7 +4129,8 @@ void mainwindow_jump_to(const gchar *target)
                                printf("selecting message %s\n", msg);
                                summary_select_by_msgnum(mainwin->summaryview, msginfo->msgnum);
                                summary_display_msg_selected(mainwin->summaryview, FALSE);
-                               main_window_popup(mainwin);
+                               if (popup)
+                                       main_window_popup(mainwin);
                                g_free(tmp);
                                procmsg_msginfo_free(msginfo);
                                return;
@@ -4135,15 +4151,15 @@ void mainwindow_exit_folder(MainWindow *mainwin) {
        if (prefs_common.layout_mode == SMALL_LAYOUT) {
                folderview_close_opened(mainwin->folderview);
                mainwin_paned_show_first(GTK_PANED(mainwin->hpaned));
-               mainwin->in_folder = FALSE;
        }
+       mainwin->in_folder = FALSE;
 }
 
 void mainwindow_enter_folder(MainWindow *mainwin) {
        if (prefs_common.layout_mode == SMALL_LAYOUT) {
                mainwin_paned_show_last(GTK_PANED(mainwin->hpaned));
-               mainwin->in_folder = TRUE;
        }
+       mainwin->in_folder = TRUE;
 }
 
 #ifdef MAEMO