sync with sylpheed 0.5.3cvs4
authorPaul Mangan <paul@claws-mail.org>
Wed, 22 Aug 2001 10:58:38 +0000 (10:58 +0000)
committerPaul Mangan <paul@claws-mail.org>
Wed, 22 Aug 2001 10:58:38 +0000 (10:58 +0000)
24 files changed:
ChangeLog
ChangeLog.claws
ChangeLog.jp
TODO
TODO.jp
configure.in
src/folderview.c
src/gtkutils.c
src/inc.c
src/inc.h
src/mainwindow.c
src/mainwindow.h
src/manage_window.c
src/manage_window.h
src/menu.c
src/menu.h
src/pop.c
src/prefs_common.c
src/prefs_common.h
src/prefs_filter.c
src/progressdialog.c
src/send.c
src/summaryview.c
src/summaryview.h

index a74b082..732ae77 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,65 @@
+2001-08-21
+
+       * src/pop.c: pop3_getsize_list_recv(), pop3_retr_recv(),
+         pop3_delete_recv(): don't try to receive messages which are not
+         exist.
+
+2001-08-21
+
+       * src/mainwindow.c: main_window_lock(), main_window_unlock():
+         removed the whole menubar locking.
+         main_window_set_menu_sensitive(): process the sensitivity change
+         with a table, and deal with locking.
+
+2001-08-20
+
+       * src/summaryview.[ch]: summary_get_selection_type(): new.
+         It returns the current selection state of summary view.
+         summary_key_pressed(): abort on some commands if main window
+         is locked.
+       * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+         increase/decrease the lock count.
+
+2001-08-19
+
+       * src/prefs_filter.c: prefs_filter_create(): added List-Id to the
+         default header list.
+       * src/prefs_common.[ch]: added the option for receive dialog mode
+         to the Interface tab.
+       * src/inc.[ch]: inc_progress_dialog_create(): don't make the dialog
+         transient, and show dialog only if the setting is
+         RECV_DIALOG_ALWAYS, or RECV_DIALOG_ACTIVE and a window is active.
+       * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+         new. Lock / unlock the user-interface.
+       * src/progressdialog.c: progress_dialog_create(): don't make the
+         dialog modal.
+
+2001-08-18
+
+       * src/folderview.c: folderview_update_node(): suppressed unnecessary
+         recursive call.
+       * src/menu.[ch]: menu_button_position(): new. It calculates the
+         position of popup menu.
+       * src/mainwindow.c: toolbar_account_button_pressed(),
+         ac_label_button_pressed(): put the popup menu to the correct
+         position. Change the style of the button while opening the menu.
+         ac_menu_popup_closed(): new function called on selection_done
+         event.
+       * src/gtkutils.c: gtkut_ctree_node_next(): fixed a crash bug when
+         node == NULL.
+       * src/summaryview.c: applied the summary fix patch from Sergey Vlasov
+         (thanks!).
+         Fixed the bug that didn't select previous message in refresh mode
+         if threads were not expanded.
+         summary_select_node(): new.
+       * src/inc.c: applied the summary view update optimization patch from
+         Sergey Vlasov (thanks!).
+         If no new messages are received, don't perform summary refreshing.
+         In addition to the Vlasov's patch, POP3 receive information is
+         also used.
+       * src/inc.h: added a new member cur_total_num to Pop3State.
+       * src/pop.c: pop3_retr_recv(): increase state->cur_total_num.
+
 2001-08-14
 
        * version 0.5.3
index aea2e92..afb7f3d 100644 (file)
@@ -1,3 +1,10 @@
+2001-08-22 [paul]
+
+       * configure.in
+               change version number to 0.5.3claws2
+
+       * sync with sylpheed 0.5.3cvs4
+
 2001-08-21 [paul]
 
        * src/summaryview.c
index 529b3f9..991bd2f 100644 (file)
@@ -1,3 +1,66 @@
+2001-08-21
+
+       * src/pop.c: pop3_getsize_list_recv(), pop3_retr_recv(),
+         pop3_delete_recv(): Â¸ºß¤·¤Ê¤¤¥á¥Ã¥»¡¼¥¸¤ò¼èÆÀ¤·¤è¤¦¤È¤·¤Ê¤¤¤è¤¦
+         ¤Ë¤·¤¿¡£
+
+2001-08-21
+
+       * src/mainwindow.c: main_window_lock(), main_window_unlock():
+         ¥á¥Ë¥å¡¼¥Ð¡¼Á´ÂΤΥí¥Ã¥¯¤òºï½ü¡£
+         main_window_set_menu_sensitive(): sensitivity ¤ÎÊѹ¹¤ò¥Æ¡¼¥Ö¥ë
+         ¤Ç¹Ô¤¦¤è¤¦¤Ë¤·¡¢¥í¥Ã¥¯¤ËÂбþ¡£
+
+2001-08-20
+
+       * src/summaryview.[ch]: summary_get_selection_type(): ¿·µ¬¡£¥µ¥Þ¥ê
+         ¥Ó¥å¡¼¤Î¸½ºß¤ÎÁªÂò¾õÂÖ¤òÊÖ¤¹¡£
+         summary_key_pressed(): ¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤¬¥í¥Ã¥¯¤µ¤ì¤Æ¤¤¤¿¤é
+         ¤¤¤¯¤Ä¤«¤Î¥³¥Þ¥ó¥É¤ÇÈ´¤±¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+         ¥í¥Ã¥¯¥«¥¦¥ó¥È¤òÁý²Ã/¸º¾¯¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-19
+
+       * src/prefs_filter.c: prefs_filter_create(): ¥Ç¥Õ¥©¥ë¥È¤Î¥Ø¥Ã¥À
+         ¥ê¥¹¥È¤Ë List-Id ¤òÄɲá£
+       * src/prefs_common.[ch]: ¼õ¿®¥À¥¤¥¢¥í¥°¥â¡¼¥É¤Î¥ª¥×¥·¥ç¥ó¤ò
+         ¥¤¥ó¥¿¥Õ¥§¡¼¥¹¥¿¥Ö¤ËÄɲá£
+       * src/inc.[ch]: inc_progress_dialog_create(): ¥À¥¤¥¢¥í¥°¤ò transient
+         ¤Ë¤·¤Ê¤¤¤è¤¦¤Ë¤·¡¢ÀßÄ꤬ RECV_DIALOG_ALWAYS ¤«¡¢¤Þ¤¿¤Ï
+         RECV_DIALOG_ACTIVE ¤Ç¥¦¥£¥ó¥É¥¦¤¬¥¢¥¯¥Æ¥£¥Ö¤Î¤È¤­¤Î¤ß¥À¥¤¥¢¥í¥°¤ò
+         É½¼¨¤¹¤ë¤è¤¦¤Ë¤·¤¿¡£
+       * src/mainwindow.[ch]: main_window_lock(), main_window_unlock():
+         ¿·µ¬¡£¥æ¡¼¥¶¥¤¥ó¥¿¥Õ¥§¡¼¥¹¤ò¥í¥Ã¥¯/¥í¥Ã¥¯²ò½ü¤¹¤ë¡£
+       * src/progressdialog.c: progress_dialog_create(): ¥À¥¤¥¢¥í¥°¤ò
+         ¥â¡¼¥À¥ë¤Ë¤·¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+
+2001-08-18
+
+       * src/folderview.c: folderview_update_node(): ÉÔÍפʺƵ¢¸Æ¤Ó½Ð¤·¤ò
+         ÍÞÀ©¡£
+       * src/menu.[ch]: menu_button_position(): ¿·µ¬¡£¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼
+         ¤Î°ÌÃÖ¤ò·×»»¤¹¤ë¡£
+       * src/mainwindow.c: toolbar_account_button_pressed(),
+         ac_label_button_pressed(): ¥Ý¥Ã¥×¥¢¥Ã¥×¥á¥Ë¥å¡¼¤òÀµ¤·¤¤°ÌÃÖ¤Ë
+         ÃÖ¤¯¤è¤¦¤Ë¤·¤¿¡£¥á¥Ë¥å¡¼¤ò³«¤¤¤Æ¤¤¤ë´Ö¥Ü¥¿¥ó¤Î¥¹¥¿¥¤¥ë¤òÊѲ½
+         ¤µ¤»¤ë¤è¤¦¤Ë¤·¤¿¡£
+         ac_menu_popup_closed(): selection_done ¥¤¥Ù¥ó¥È»þ¤Ë¸Æ¤Ð¤ì¤ë¿·µ¬
+         ´Ø¿ô¡£
+       * src/gtkutils.c: gtkut_ctree_node_next(): node == NULL ¤Î¤È¤­¤Ë
+         ¥¯¥é¥Ã¥·¥å¤¹¤ë¥Ð¥°¤ò½¤Àµ¡£
+       * src/summaryview.c: Sergey Vlasov ¤µ¤ó¤«¤é¤Î¥µ¥Þ¥ê½¤Àµ¥Ñ¥Ã¥Á¤ò
+         Å¬ÍÑ(thanks!)¡£
+         ¥¹¥ì¥Ã¥É¤òŸ³«¤·¤Ê¤¤¾ì¹ç¤Ë¹¹¿·¥â¡¼¥É¤Ç°ÊÁ°¤Î¥á¥Ã¥»¡¼¥¸¤òÁªÂò
+         ¤Ç¤­¤Ê¤¤¥Ð¥°¤ò½¤Àµ¡£
+         summary_select_node(): ¿·µ¬¡£
+       * src/inc.c: Sergey Vlasov ¤µ¤ó¤«¤é¤Î¥µ¥Þ¥ê¥Ó¥å¡¼¹¹¿·ºÇŬ²½¥Ñ¥Ã¥Á
+         ¤òŬÍÑ(thanks!)¡£
+         ¿·Ãå¥á¥Ã¥»¡¼¥¸¤¬¼õ¿®¤µ¤ì¤Ê¤±¤ì¤Ð¡¢¥µ¥Þ¥ê¤Î¹¹¿·¤ò¹Ô¤ï¤Ê¤¤¤è¤¦¤Ë¤·¤¿¡£
+         Vlasov »á¤Î¥Ñ¥Ã¥Á¤Ë²Ã¤¨¡¢ POP3 ¤Î¼õ¿®¾ðÊó¤âƱÍͤ˻ÈÍÑ¡£
+       * src/inc.h: Pop3State ¤Ë¿·¥á¥ó¥Ð cur_total_num ¤òÄɲá£
+       * src/pop.c: pop3_retr_recv(): state->cur_total_num ¤òÁý²Ã¤µ¤»¤ë¡£
+
 2001-08-14
 
        * version 0.5.3
diff --git a/TODO b/TODO
index 5edd9d5..e8bf552 100644 (file)
--- a/TODO
+++ b/TODO
@@ -6,6 +6,7 @@ TODO
 o POP before SMTP
 o full-text search of messages (plain, or hooking up with Namazu)
 o original icons and logos
+o autosave
 o template function
 o speed-up of filtering
 o regular expression support at filtering
diff --git a/TODO.jp b/TODO.jp
index bc25168..2b5c506 100644 (file)
--- a/TODO.jp
+++ b/TODO.jp
@@ -6,6 +6,7 @@ TODO
 o POP before SMTP
 o ¥á¥Ã¥»¡¼¥¸¤ÎÁ´Ê¸¸¡º÷ (¥Ù¥¿¡¢ Namazu ¤È¤ÎÏ¢·È)
 o ¥ª¥ê¥¸¥Ê¥ë¤Î¥¢¥¤¥³¥ó¤È¥í¥´
+o ¼«Æ°Êݸµ¡Ç½
 o ¥Æ¥ó¥×¥ì¡¼¥Èµ¡Ç½
 o ¿¶¤êʬ¤±½èÍý¤Î¶¯²½
 o ¿¶¤êʬ¤±¤ÇÀµµ¬É½¸½¤ËÂбþ¤¹¤ë
index 4e77a96..362971e 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=5
 MICRO_VERSION=3
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws1
+EXTRA_VERSION=claws2
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index d27cb30..fa206ed 100644 (file)
@@ -824,7 +824,6 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
 {
        GtkCTree *ctree = GTK_CTREE(folderview->ctree);
        GtkStyle *style = NULL;
-       GtkCTreeNode *parent;
        FolderItem *item;
        GdkPixmap *xpm, *openxpm;
        GdkBitmap *mask, *openmask;
@@ -930,7 +929,7 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
        }
 
        if (item->stype == F_TRASH) return;
-
+               use_bold = use_color = FALSE;
        if (item->stype == F_QUEUE) {
                /* highlight queue folder if there are any messages */
                use_bold = use_color = (item->total > 0);
@@ -972,10 +971,8 @@ static void folderview_update_node(FolderView *folderview, GtkCTreeNode *node)
 
        gtk_ctree_node_set_row_style(ctree, node, style);
 
-       parent = node;
-       while ((parent = gtkut_ctree_find_collapsed_parent(ctree, parent))
-              != NULL)
-               folderview_update_node(folderview, parent);
+       if ((node = gtkut_ctree_find_collapsed_parent(ctree, node)) != NULL)
+               folderview_update_node(folderview, node);
 }
 
 void folderview_update_item(FolderItem *item, gboolean update_summary)
index f01f588..e65adba 100644 (file)
@@ -173,6 +173,8 @@ GtkCTreeNode *gtkut_ctree_node_next(GtkCTree *ctree, GtkCTreeNode *node)
 {
        GtkCTreeNode *parent;
 
+       if (!node) return NULL;
+
        if (GTK_CTREE_ROW(node)->children)
                return GTK_CTREE_ROW(node)->children;
 
index cd1ccc5..35d1bc6 100644 (file)
--- a/src/inc.c
+++ b/src/inc.c
@@ -75,8 +75,9 @@ GdkBitmap *okxpmmask;
 
 #define MSGBUFSIZE     8192
 
-static void inc_finished               (MainWindow             *mainwin);
-static void inc_account_mail           (PrefsAccount           *account,
+static void inc_finished               (MainWindow             *mainwin,
+                                        gboolean                new_messages);
+static gint inc_account_mail           (PrefsAccount           *account,
                                         MainWindow             *mainwin);
 
 static IncProgressDialog *inc_progress_dialog_create   (void);
@@ -86,7 +87,7 @@ static IncSession *inc_session_new    (PrefsAccount           *account);
 static void inc_session_destroy                (IncSession             *session);
 static Pop3State *inc_pop3_state_new   (PrefsAccount           *account);
 static void inc_pop3_state_destroy     (Pop3State              *state);
-static void inc_start                  (IncProgressDialog      *inc_dialog);
+static gint inc_start                  (IncProgressDialog      *inc_dialog);
 static IncState inc_pop3_session_do    (IncSession             *session);
 static gint pop3_automaton_terminate   (SockInfo               *source,
                                         Automaton              *atm);
@@ -116,7 +117,16 @@ static void inc_all_spool(void);
 
 static gint inc_autocheck_func         (gpointer        data);
 
-static void inc_finished(MainWindow *mainwin)
+/**
+ * inc_finished:
+ * @mainwin: Main window.
+ * @new_messages: TRUE if some messages have been received.
+ * 
+ * Update the folder view and the summary view after receiving
+ * messages.  If @new_messages is FALSE, this function avoids unneeded
+ * updating.
+ **/
+static void inc_finished(MainWindow *mainwin, gboolean new_messages)
 {
        FolderItem *item;
 
@@ -139,6 +149,7 @@ static void inc_finished(MainWindow *mainwin)
 
        /* XXX: filtering_happened is reset by summary_show() */
 
+       if (!new_messages && !prefs_common.scan_all_after_inc) return;
 
        if (prefs_common.open_inbox_on_inc) {
                item = cur_account && cur_account->inbox
@@ -155,8 +166,11 @@ static void inc_finished(MainWindow *mainwin)
 
 void inc_mail(MainWindow *mainwin)
 {
+       gint new_msgs = 0;
+
        inc_autocheck_timer_remove();
        summary_write_cache(mainwin->summaryview);
+       main_window_lock(mainwin);
 
        if (prefs_common.use_extinc && prefs_common.extinc_path) {
                gint pid;
@@ -164,6 +178,7 @@ void inc_mail(MainWindow *mainwin)
                /* external incorporating program */
                if ((pid = fork()) < 0) {
                        perror("fork");
+                       main_window_unlock(mainwin);
                        inc_autocheck_timer_set();
                        return;
                }
@@ -181,27 +196,28 @@ void inc_mail(MainWindow *mainwin)
                /* wait until child process is terminated */
                waitpid(pid, NULL, 0);
 
-               if (prefs_common.inc_local) inc_spool();
-               inc_all_spool();
+               if (prefs_common.inc_local)
+                       new_msgs = inc_spool();
        } else {
-               if (prefs_common.inc_local) inc_spool();
-               inc_all_spool();
+               if (prefs_common.inc_local)
+                       new_msgs = inc_spool();
 
-               inc_account_mail(cur_account, mainwin);
+               new_msgs += inc_account_mail(cur_account, mainwin);
        }
 
-       inc_finished(mainwin);
+       inc_finished(mainwin, new_msgs > 0);
+       main_window_unlock(mainwin);
        inc_autocheck_timer_set();
 }
 
-static void inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
+static gint inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
 {
        IncProgressDialog *inc_dialog;
        IncSession *session;
        gchar *text[3];
 
        session = inc_session_new(account);
-       if (!session) return;
+       if (!session) return 0;
 
        inc_dialog = inc_progress_dialog_create();
        inc_dialog->queue_list = g_list_append(inc_dialog->queue_list, session);
@@ -213,22 +229,26 @@ static void inc_account_mail(PrefsAccount *account, MainWindow *mainwin)
        text[2] = _("Standby");
        gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
 
-       inc_start(inc_dialog);
+       return inc_start(inc_dialog);
 }
 
 void inc_all_account_mail(MainWindow *mainwin)
 {
        GList *list, *queue_list = NULL;
        IncProgressDialog *inc_dialog;
+       gint new_msgs = 0;
 
        inc_autocheck_timer_remove();
        summary_write_cache(mainwin->summaryview);
+       main_window_lock(mainwin);
 
-       if (prefs_common.inc_local) inc_spool();
+       if (prefs_common.inc_local)
+               new_msgs = inc_spool();
 
        list = account_get_list();
        if (!list) {
-               inc_finished(mainwin);
+               inc_finished(mainwin, new_msgs > 0);
+               main_window_unlock(mainwin);
                inc_autocheck_timer_set();
                return;
        }
@@ -245,7 +265,8 @@ void inc_all_account_mail(MainWindow *mainwin)
        }
 
        if (!queue_list) {
-               inc_finished(mainwin);
+               inc_finished(mainwin, new_msgs > 0);
+               main_window_unlock(mainwin);
                inc_autocheck_timer_set();
                return;
        }
@@ -265,9 +286,10 @@ void inc_all_account_mail(MainWindow *mainwin)
                gtk_clist_append(GTK_CLIST(inc_dialog->dialog->clist), text);
        }
 
-       inc_start(inc_dialog);
+       new_msgs += inc_start(inc_dialog);
 
-       inc_finished(mainwin);
+       inc_finished(mainwin, new_msgs > 0);
+       main_window_unlock(mainwin);
        inc_autocheck_timer_set();
 }
 
@@ -285,25 +307,18 @@ static IncProgressDialog *inc_progress_dialog_create(void)
                           GTK_SIGNAL_FUNC(inc_cancel), dialog);
        gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
                           GTK_SIGNAL_FUNC(gtk_true), NULL);
-       if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-           ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
-               manage_window_set_transient(GTK_WINDOW(progress->window));
-       }
 
        progress_dialog_set_value(progress, 0.0);
 
-       if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-           ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
-               gtk_widget_show(progress->window);
-       }
-
        PIXMAP_CREATE(progress->clist, okxpm, okxpmmask, complete_xpm);
        PIXMAP_CREATE(progress->clist,
                      currentxpm, currentxpmmask, continue_xpm);
        PIXMAP_CREATE(progress->clist, errorxpm, errorxpmmask, error_xpm);
 
-       if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-           ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+       if (prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS ||
+           (prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE &&
+            manage_window_get_focus_window())) {
+               dialog->show_dialog = TRUE;
                gtk_widget_show_now(progress->window);
        }
 
@@ -392,7 +407,7 @@ static void inc_pop3_state_destroy(Pop3State *state)
        g_free(state);
 }
 
-static void inc_start(IncProgressDialog *inc_dialog)
+static gint inc_start(IncProgressDialog *inc_dialog)
 {
        IncSession *session;
        GtkCList *clist = GTK_CLIST(inc_dialog->dialog->clist);
@@ -400,6 +415,7 @@ static void inc_start(IncProgressDialog *inc_dialog)
        IncState inc_state;
        gint num = 0;
        gint error_num = 0;
+       gint new_msgs = 0;
 
        while (inc_dialog->queue_list != NULL) {
                session = inc_dialog->queue_list->data;
@@ -407,8 +423,6 @@ static void inc_start(IncProgressDialog *inc_dialog)
 
                inc_progress_dialog_clear(inc_dialog);
 
-               gtk_clist_moveto(clist, num, 0, 1.0, 0.0);
-
                pop3_state->user = g_strdup(pop3_state->ac_prefs->userid);
                if (pop3_state->ac_prefs->passwd)
                        pop3_state->pass =
@@ -428,11 +442,10 @@ static void inc_start(IncProgressDialog *inc_dialog)
                        pass = input_dialog_with_invisible(_("Input password"),
                                                           message, NULL);
                        g_free(message);
-                       if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-                           ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
-                               manage_window_focus_in(inc_dialog->mainwin->window,
-                                                      NULL, NULL);
-                       }
+                       if (inc_dialog->show_dialog)
+                               manage_window_focus_in
+                                       (inc_dialog->mainwin->window,
+                                        NULL, NULL);
                        if (pass) {
                                pop3_state->ac_prefs->tmp_pass = g_strdup(pass);
                                pop3_state->pass = pass;
@@ -470,8 +483,8 @@ static void inc_start(IncProgressDialog *inc_dialog)
 
                if (pop3_state->error_val == PS_AUTHFAIL) {
                        if(!prefs_common.noerrorpanel) {
-                               if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-                                   ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+                               if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
+                                   ((prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE) && focus_window)) {
                                        manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
                                }
                                alertpanel_error
@@ -482,11 +495,9 @@ static void inc_start(IncProgressDialog *inc_dialog)
                }
 
                statusbar_pop_all();
-               if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-                   ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
-                       manage_window_focus_in(inc_dialog->mainwin->window, NULL, NULL);
-               }
-               
+
+               new_msgs += pop3_state->cur_total_num;
+
                if (!prefs_common.scan_all_after_inc) {
                        folder_item_scan_foreach(pop3_state->folder_table);
                        folderview_update_item_foreach
@@ -517,9 +528,13 @@ static void inc_start(IncProgressDialog *inc_dialog)
        }
 
        if (error_num) {
-               manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
+               if (inc_dialog->show_dialog)
+                       manage_window_focus_in(inc_dialog->dialog->window,
+                                              NULL, NULL);
                alertpanel_error(_("Some errors occured while getting mail."));
-               manage_window_focus_out(inc_dialog->dialog->window, NULL, NULL);
+               if (inc_dialog->show_dialog)
+                       manage_window_focus_out(inc_dialog->dialog->window,
+                                               NULL, NULL);
        }
 
        while (inc_dialog->queue_list != NULL) {
@@ -530,6 +545,8 @@ static void inc_start(IncProgressDialog *inc_dialog)
        }
 
        inc_progress_dialog_destroy(inc_dialog);
+
+       return new_msgs;
 }
 
 
@@ -605,8 +622,8 @@ static IncState inc_pop3_session_do(IncSession *session)
                log_warning(_("Can't connect to POP3 server: %s:%d\n"),
                            server, port);
                if(!prefs_common.noerrorpanel) {
-                       if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-                           ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+                       if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
+                           ((prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE) && focus_window)) {
                                manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
                        }
                        alertpanel_error(_("Can't connect to POP3 server: %s:%d"),
@@ -763,8 +780,8 @@ static gint connection_check_cb(Automaton *atm)
                log_warning(_("Can't connect to POP3 server: %s:%d\n"),
                            sockinfo->hostname, sockinfo->port);
                if(!prefs_common.noerrorpanel) {
-                       if((prefs_common.receive_dialog == RECVDIALOG_ALWAYS) ||
-                           ((prefs_common.receive_dialog == RECVDIALOG_WINDOW_ACTIVE) && focus_window)) {
+                       if((prefs_common.recv_dialog_mode == RECV_DIALOG_ALWAYS) ||
+                           ((prefs_common.recv_dialog_mode == RECV_DIALOG_ACTIVE) && focus_window)) {
                                manage_window_focus_in(inc_dialog->dialog->window, NULL, NULL);
                        }
                        alertpanel_error(_("Can't connect to POP3 server: %s:%d"),
index 0513b42..0bee861 100644 (file)
--- a/src/inc.h
+++ b/src/inc.h
@@ -53,6 +53,8 @@ struct _IncProgressDialog
 
        MainWindow *mainwin;
 
+       gboolean show_dialog;
+
        GList *queue_list;      /* list of IncSession */
 };
 
@@ -81,6 +83,7 @@ struct _Pop3State
        gint new;
        gint total_bytes;
        gint cur_msg;
+       gint cur_total_num;
        gint cur_total_bytes;
        gint *sizes;
 
index 0d9c966..23f2019 100644 (file)
@@ -148,6 +148,8 @@ static void toolbar_account_button_pressed  (GtkWidget      *widget,
 static void ac_label_button_pressed            (GtkWidget      *widget,
                                                 GdkEventButton *event,
                                                 gpointer        data);
+static void ac_menu_popup_closed               (GtkMenuShell   *menu_shell,
+                                                gpointer        data);
 
 static gint main_window_close_cb (GtkWidget    *widget,
                                  GdkEventAny   *event,
@@ -786,6 +788,8 @@ MainWindow *main_window_create(SeparateType type)
        /* set account selection menu */
        ac_menu = gtk_item_factory_get_widget
                (ifactory, "/Configuration/Change current account");
+       gtk_signal_connect(GTK_OBJECT(ac_menu), "selection_done",
+                          GTK_SIGNAL_FUNC(ac_menu_popup_closed), mainwin);
        mainwin->ac_menu = ac_menu;
 
        main_window_set_toolbar_sensitive(mainwin, FALSE);
@@ -805,6 +809,7 @@ MainWindow *main_window_create(SeparateType type)
        header_window_init(mainwin->headerwin);
        log_window_init(mainwin->logwin);
 
+       mainwin->lock_count = 0;
        mainwin->cursor_count = 0;
 
        if (!watch_cursor)
@@ -817,6 +822,7 @@ MainWindow *main_window_create(SeparateType type)
 
 void main_window_cursor_wait(MainWindow *mainwin)
 {
+
        if (mainwin->cursor_count == 0)
                gdk_window_set_cursor(mainwin->window->window, watch_cursor);
 
@@ -836,6 +842,32 @@ void main_window_cursor_normal(MainWindow *mainwin)
        gdk_flush();
 }
 
+/* lock / unlock the user-interface */
+void main_window_lock(MainWindow *mainwin)
+{
+       if (mainwin->lock_count == 0) {
+               gtk_widget_set_sensitive(mainwin->toolbar, FALSE);
+               gtk_widget_set_sensitive(mainwin->ac_button, FALSE);
+       }
+
+       mainwin->lock_count++;
+
+       main_window_set_menu_sensitive(mainwin);
+}
+
+void main_window_unlock(MainWindow *mainwin)
+{
+       if (mainwin->lock_count)
+               mainwin->lock_count--;
+
+       main_window_set_menu_sensitive(mainwin);
+
+       if (mainwin->lock_count == 0) {
+               gtk_widget_set_sensitive(mainwin->toolbar, TRUE);
+               gtk_widget_set_sensitive(mainwin->ac_button, TRUE);
+       }
+}
+
 void main_window_reflect_prefs_all(void)
 {
        GList *cur;
@@ -1140,69 +1172,92 @@ void main_window_set_toolbar_sensitive(MainWindow *mainwin, gboolean sensitive)
                gtk_widget_set_sensitive(mainwin->delete_btn, sensitive);
 }
 
-void main_window_set_menu_sensitive(MainWindow *mainwin, gint selection)
+typedef enum
+{
+       M_UNLOCKED             = 1 << 0,
+       M_MSG_EXIST            = 1 << 1,
+       M_TARGET_EXIST         = 1 << 2,
+       M_SINGLE_TARGET_EXIST  = 1 << 3,
+       M_EXEC                 = 1 << 4,
+       M_ALLOW_REEDIT         = 1 << 5
+} MenuItemSensitiveCond;
+
+void main_window_set_menu_sensitive(MainWindow *mainwin)
 {
        GtkItemFactory *ifactory;
-       gboolean sens;
-       gboolean exec;
+       SummarySelection selection;
+       MenuItemSensitiveCond state = 0;
+       gboolean sensitive;
+       gint i;
 
-       ifactory = gtk_item_factory_from_widget(mainwin->menubar);
+       static const struct {
+               gchar *const entry;
+               MenuItemSensitiveCond cond;
+       } entry[] = {
+               {"/File/Add mailbox..."        , M_UNLOCKED},
+               {"/File/Update folder tree"    , M_UNLOCKED},
+               {"/File/Folder"                , M_UNLOCKED},
+               {"/File/Import mbox file..."   , M_UNLOCKED},
+               {"/File/Export to mbox file...", M_UNLOCKED},
+               {"/File/Empty trash"           , M_UNLOCKED},
+               {"/File/Save as...", M_SINGLE_TARGET_EXIST|M_UNLOCKED},
+               {"/File/Print..."  , M_TARGET_EXIST|M_UNLOCKED},
+               {"/File/Close", M_UNLOCKED},
+               {"/File/Exit" , M_UNLOCKED},
+
+               {"/Message/Get new mail"         , M_UNLOCKED},
+               {"/Message/Get from all accounts", M_UNLOCKED},
+               {"/Message/Reply"                , M_SINGLE_TARGET_EXIST},
+               {"/Message/Reply to sender"      , M_SINGLE_TARGET_EXIST},
+               {"/Message/Reply to all"         , M_SINGLE_TARGET_EXIST},
+               {"/Message/Forward"              , M_SINGLE_TARGET_EXIST},
+               {"/Message/Forward as attachment", M_SINGLE_TARGET_EXIST},
+               {"/Message/Open in new window"   , M_SINGLE_TARGET_EXIST},
+               {"/Message/Show all header"      , M_SINGLE_TARGET_EXIST},
+               {"/Message/View source"          , M_SINGLE_TARGET_EXIST},
+               {"/Message/Move...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Message/Copy...", M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Message/Delete" , M_TARGET_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Message/Mark"   , M_TARGET_EXIST},
+               {"/Message/Re-edit", M_ALLOW_REEDIT},
+
+               {"/Summary/Delete duplicated messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Summary/Filter messages", M_MSG_EXIST|M_EXEC|M_UNLOCKED},
+               {"/Summary/Execute"            , M_MSG_EXIST|M_UNLOCKED},
+               {"/Summary/Prev message"       , M_MSG_EXIST},
+               {"/Summary/Next message"       , M_MSG_EXIST},
+               {"/Summary/Next unread message", M_MSG_EXIST},
+               {"/Summary/Sort"               , M_MSG_EXIST},
+
+               {"/Configuration", M_UNLOCKED},
+
+               {NULL, 0}
+       };
 
-       if (selection == SUMMARY_SELECTED_SINGLE)
-               sens = TRUE;
-       else
-               sens = FALSE;
-       if (!mainwin->summaryview->folder_item ||
-           mainwin->summaryview->folder_item->folder->type == F_NEWS)
-               exec = FALSE;
-       else
-               exec = TRUE;
-
-       menu_set_sensitive(ifactory, "/File/Save as...", sens);
-       menu_set_sensitive(ifactory, "/Message/Reply", sens);
-       menu_set_sensitive(ifactory, "/Message/Reply to sender", sens);
-       menu_set_sensitive(ifactory, "/Message/Reply to all", sens);
-       menu_set_sensitive(ifactory, "/Message/Forward", TRUE);
-       menu_set_sensitive(ifactory, "/Message/Forward as attachment", TRUE);
-       menu_set_sensitive(ifactory, "/Message/Open in new window", sens);
-       menu_set_sensitive(ifactory, "/Message/Show all header", sens);
-       menu_set_sensitive(ifactory, "/Message/View source", sens);
-       if (sens && (!mainwin->summaryview->folder_item ||
-                    mainwin->summaryview->folder_item->stype != F_DRAFT))
-               sens = FALSE;
-       menu_set_sensitive(ifactory, "/Message/Re-edit", sens);
+       ifactory = gtk_item_factory_from_widget(mainwin->menubar);
+       selection = summary_get_selection_type(mainwin->summaryview);
 
+       if (mainwin->lock_count == 0)
+               state |= M_UNLOCKED;
+       if (selection != SUMMARY_NONE)
+               state |= M_MSG_EXIST;
        if (selection == SUMMARY_SELECTED_SINGLE ||
            selection == SUMMARY_SELECTED_MULTIPLE)
-               sens = TRUE;
-       else
-               sens = FALSE;
-
-       menu_set_sensitive(ifactory, "/File/Print..."  , sens);
-       menu_set_sensitive(ifactory, "/Message/Move...", sens && exec);
-       menu_set_sensitive(ifactory, "/Message/Copy...", sens && exec);
-       menu_set_sensitive(ifactory, "/Message/Delete" , sens && exec);
-       menu_set_sensitive(ifactory, "/Message/Mark"   , sens);
-
-       if (selection != SUMMARY_NONE)
-               sens = TRUE;
-       else
-               sens = FALSE;
-
-       menu_set_sensitive(ifactory, "/Summary/Delete duplicated messages", sens && exec);
-       menu_set_sensitive(ifactory, "/Summary/Filter messages", sens && exec);
-       menu_set_sensitive(ifactory, "/Summary/Execute", sens);
-       menu_set_sensitive(ifactory, "/Summary/Prev message", sens);
-       menu_set_sensitive(ifactory, "/Summary/Next message", sens);
-       menu_set_sensitive(ifactory, "/Summary/Next unread message", sens);
-       menu_set_sensitive(ifactory, "/Summary/Sort", sens);
-
+               state |= M_TARGET_EXIST;
+       if (selection == SUMMARY_SELECTED_SINGLE)
+               state |= M_SINGLE_TARGET_EXIST;
        if (mainwin->summaryview->folder_item &&
-           mainwin->summaryview->folder_item->folder->account)
-               sens = mainwin->summaryview->folder_item->folder->account->protocol == A_NNTP;
-       else
-               sens = FALSE;
-       menu_set_sensitive(ifactory, "/Message/Follow-up and reply to", sens);
+           mainwin->summaryview->folder_item->folder->type != F_NEWS)
+               state |= M_EXEC;
+       if (selection == SUMMARY_SELECTED_SINGLE &&
+           (mainwin->summaryview->folder_item &&
+            mainwin->summaryview->folder_item->stype == F_DRAFT))
+               state |= M_ALLOW_REEDIT;
+
+       for (i = 0; entry[i].entry != NULL; i++) {
+               sensitive = ((entry[i].cond & state) == entry[i].cond);
+               menu_set_sensitive(ifactory, entry[i].entry, sensitive);
+       }
 }
 
 void main_window_popup(MainWindow *mainwin)
@@ -1898,7 +1953,12 @@ static void toolbar_account_button_pressed(GtkWidget *widget,
        if (!event) return;
        if (event->button != 3) return;
 
-       gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL, NULL, NULL,
+       gtk_button_set_relief(GTK_BUTTON(widget), GTK_RELIEF_NORMAL);
+       gtk_object_set_data(GTK_OBJECT(mainwin->ac_menu), "menu_button",
+                           widget);
+
+       gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL,
+                      menu_button_position, widget,
                       event->button, event->time);
 }
 
@@ -1909,10 +1969,25 @@ static void ac_label_button_pressed(GtkWidget *widget, GdkEventButton *event,
 
        if (!event) return;
 
-       gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL, NULL, NULL,
+       gtk_button_set_relief(GTK_BUTTON(widget), GTK_RELIEF_NORMAL);
+       gtk_object_set_data(GTK_OBJECT(mainwin->ac_menu), "menu_button",
+                           widget);
+
+       gtk_menu_popup(GTK_MENU(mainwin->ac_menu), NULL, NULL,
+                      menu_button_position, widget,
                       event->button, event->time);
 }
 
+static void ac_menu_popup_closed(GtkMenuShell *menu_shell, gpointer data)
+{
+       MainWindow *mainwin = (MainWindow *)data;
+       GtkWidget *button;
+
+       button = gtk_object_get_data(GTK_OBJECT(menu_shell), "menu_button");
+       gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
+       gtk_object_remove_data(GTK_OBJECT(mainwin->ac_menu), "menu_button");
+}
+
 static gint main_window_close_cb(GtkWidget *widget, GdkEventAny *event,
                                 gpointer data)
 {
@@ -2391,7 +2466,6 @@ static void thread_cb(MainWindow *mainwin, guint action, GtkWidget *widget)
                menu_set_sensitive(ifactory, "/Summary/Thread view",   TRUE);
                menu_set_sensitive(ifactory, "/Summary/Unthread view", FALSE);
        }
-       
 }
 
 static void set_display_item_cb(MainWindow *mainwin, guint action,
index aaeb940..e8cb412 100644 (file)
@@ -81,7 +81,7 @@ struct _MainWindow
        GtkWidget *vbox;
        GtkWidget *menubar;
 
-       /* tool bar */
+       /* toolbar */
        GtkWidget *handlebox;
        GtkWidget *toolbar;
        GtkWidget *get_btn;
@@ -122,6 +122,7 @@ struct _MainWindow
 
        ToolbarStyle toolbar_style;
 
+       guint lock_count;
        guint cursor_count;
 
        FolderView      *folderview;
@@ -132,22 +133,29 @@ struct _MainWindow
 };
 
 MainWindow *main_window_create         (SeparateType    type);
+
 void main_window_cursor_wait           (MainWindow     *mainwin);
 void main_window_cursor_normal         (MainWindow     *mainwin);
+
+void main_window_lock                  (MainWindow     *mainwin);
+void main_window_unlock                        (MainWindow     *mainwin);
+
 void main_window_reflect_prefs_all     (void);
 void main_window_set_account_menu      (GList          *account_list);
 void main_window_separation_change     (MainWindow     *mainwin,
                                         SeparateType    type);
+
 void main_window_get_size              (MainWindow     *mainwin);
 void main_window_get_position          (MainWindow     *mainwin);
+
 void main_window_empty_trash           (MainWindow     *mainwin,
                                         gboolean        confirm);
 void main_window_add_mailbox           (MainWindow     *mainwin);
 
 void main_window_set_toolbar_sensitive (MainWindow     *mainwin,
                                         gboolean        sensitive);
-void main_window_set_menu_sensitive    (MainWindow     *mainwin,
-                                        gint            selection);
+void main_window_set_menu_sensitive    (MainWindow     *mainwin);
+
 void main_window_popup                 (MainWindow     *mainwin);
 /*void main_window_set_thread_option      (MainWindow *mainwin);*/
 
index e58c5eb..aba9f50 100644 (file)
@@ -56,3 +56,8 @@ void manage_window_set_transient(GtkWindow *window)
        if (window && focus_window)
                gtk_window_set_transient_for(window, GTK_WINDOW(focus_window));
 }
+
+GtkWidget *manage_window_get_focus_window(void)
+{
+       return focus_window;
+}
index fc956f9..0477560 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -35,4 +35,7 @@ void manage_window_set_transient      (GtkWindow      *window);
 
 extern GtkWidget *focus_window;
 
+GtkWidget *manage_window_get_focus_window      (void);
+
+
 #endif /* __MANAGE_WINDOW_H__ */
index 54330e1..0906a1e 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
- * Copyright (C) 1999,2000 Hiroyuki Yamamoto
+ * Copyright (C) 1999-2001 Hiroyuki Yamamoto
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -27,6 +27,8 @@
 #include <gtk/gtkmenubar.h>
 #include <gtk/gtkitemfactory.h>
 #include <gtk/gtkcheckmenuitem.h>
+#include <gtk/gtkbutton.h>
+
 
 #include "intl.h"
 #include "menu.h"
@@ -98,4 +100,42 @@ void menu_set_toggle(GtkItemFactory *ifactory, const gchar *path,
 
        widget = gtk_item_factory_get_item(ifactory, path);
        gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(widget), active);
-}
\ No newline at end of file
+}
+
+void menu_button_position(GtkMenu *menu, gint *x, gint *y, gpointer user_data)
+{
+       GtkWidget *button;
+       GtkRequisition requisition;
+       gint button_xpos, button_ypos;
+       gint xpos, ypos;
+       gint width, height;
+       gint scr_width, scr_height;
+
+       g_return_if_fail(user_data != NULL);
+       g_return_if_fail(GTK_IS_BUTTON(user_data));
+
+       button = GTK_WIDGET(user_data);
+
+       gtk_widget_get_child_requisition(GTK_WIDGET(menu), &requisition);
+       width = requisition.width;
+       height = requisition.height;
+       gdk_window_get_origin(button->window, &button_xpos, &button_ypos);
+
+       xpos = button_xpos;
+       ypos = button_ypos + button->allocation.height;
+
+       scr_width = gdk_screen_width();
+       scr_height = gdk_screen_height();
+
+       if (xpos + width > scr_width)
+               xpos -= (xpos + width) - scr_width;
+       if (ypos + height > scr_height)
+               ypos = button_ypos - height;
+       if (xpos < 0)
+               xpos = 0;
+       if (ypos < 0)
+               ypos = 0;
+
+       *x = xpos;
+       *y = ypos;
+}
index 0b8ac36..8d5fb32 100644 (file)
@@ -52,5 +52,9 @@ void menu_set_insensitive_all (GtkMenuShell           *menu_shell);
 void menu_set_toggle           (GtkItemFactory         *ifactory,
                                 const gchar            *path,
                                 gboolean                active);
+void menu_button_position      (GtkMenu                *menu,
+                                gint                   *x,
+                                gint                   *y,
+                                gpointer                user_data);
 
 #endif /* __MENU_H__ */
index 51beec7..48853c4 100644 (file)
--- a/src/pop.c
+++ b/src/pop.c
@@ -298,11 +298,11 @@ gint pop3_getsize_list_recv(SockInfo *sock, gpointer data)
        state->cur_total_bytes = 0;
 
        while (sock_gets(sock, buf, sizeof(buf)) >= 0) {
-               gint num, size;
+               guint num, size;
 
                if (buf[0] == '.') break;
                if (sscanf(buf, "%u %u", &num, &size) != 2)
-                       break;
+                       return -1;
 
                if (num > 0 && num <= state->count)
                        state->sizes[num] = size;
@@ -310,6 +310,13 @@ gint pop3_getsize_list_recv(SockInfo *sock, gpointer data)
                        state->cur_total_bytes += size;
        }
 
+       while (state->sizes[state->cur_msg] == 0) {
+               if (state->cur_msg == state->count)
+                       return POP3_LOGOUT_SEND;
+               else
+                       state->cur_msg++;
+       }
+
        return POP3_RETR_SEND;
 }
 
@@ -336,12 +343,14 @@ gint pop3_retr_recv(SockInfo *sock, gpointer data)
                        return -1;
                }
 
-               state->cur_total_bytes += state->sizes[state->cur_msg];
-
                if ((drop_ok = inc_drop_message(file, state)) < 0) {
                        state->inc_state = INC_ERROR;
                        return -1;
                }
+
+               state->cur_total_bytes += state->sizes[state->cur_msg];
+               state->cur_total_num++;
+
                if (drop_ok == 0 && state->ac_prefs->rmmail)
                        return POP3_DELETE_SEND;
 
@@ -355,6 +364,12 @@ gint pop3_retr_recv(SockInfo *sock, gpointer data)
 
                if (state->cur_msg < state->count) {
                        state->cur_msg++;
+                       while (state->sizes[state->cur_msg] == 0) {
+                               if (state->cur_msg == state->count)
+                                       return POP3_LOGOUT_SEND;
+                               else
+                                       state->cur_msg++;
+                       }
                        return POP3_RETR_SEND;
                } else
                        return POP3_LOGOUT_SEND;
@@ -383,6 +398,12 @@ gint pop3_delete_recv(SockInfo *sock, gpointer data)
        if ((ok = pop3_ok(sock, NULL)) == PS_SUCCESS) {
                if (state->cur_msg < state->count) {
                        state->cur_msg++;
+                       while (state->sizes[state->cur_msg] == 0) {
+                               if (state->cur_msg == state->count)
+                                       return POP3_LOGOUT_SEND;
+                               else
+                                       state->cur_msg++;
+                       }
                        return POP3_RETR_SEND;
                } else
                        return POP3_LOGOUT_SEND;
index e474df5..0aa5476 100644 (file)
@@ -168,7 +168,7 @@ static struct Privacy {
 #endif
 
 static struct Interface {
-       GtkWidget *checkbtn_emacs;
+       /* GtkWidget *checkbtn_emacs; */
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
@@ -177,7 +177,7 @@ static struct Interface {
        GtkWidget *checkbtn_askonclean;
        GtkWidget *checkbtn_warnqueued;
        GtkWidget *checkbtn_addaddrbyclick;
-       GtkWidget *recvdialog_optmenu;
+       GtkWidget *optmenu_recvdialog;
 } interface;
 
 static struct Other {
@@ -209,8 +209,8 @@ static void prefs_common_default_signkey_set_data_from_optmenu
                                                        (PrefParam *pparam);
 static void prefs_common_default_signkey_set_optmenu   (PrefParam *pparam);
 #endif
-static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam);
-static void prefs_recvdialog_set_optmenu(PrefParam *pparam);
+static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam);
+static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam);
 
 static void prefs_dictionary_set_data_from_optmenu(PrefParam *param);
 static void prefs_dictionary_set_optmenu(PrefParam *pparam);
@@ -564,8 +564,8 @@ static PrefParam param[] = {
        {"separate_message", "FALSE", &prefs_common.sep_msg, P_BOOL,
         NULL, NULL, NULL},
 
-       {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
-        NULL, NULL, NULL},
+       /* {"emulate_emacs", "FALSE", &prefs_common.emulate_emacs, P_BOOL,
+        NULL, NULL, NULL}, */
 
        {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
         P_BOOL, &interface.checkbtn_openunread,
@@ -576,14 +576,14 @@ static PrefParam param[] = {
        {"immediate_execution", "TRUE", &prefs_common.immediate_exec, P_BOOL,
         &interface.checkbtn_immedexec,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"receive_dialog_mode", "1", &prefs_common.recv_dialog_mode, P_ENUM,
+        &interface.optmenu_recvdialog,
+        prefs_common_recv_dialog_set_data_from_optmenu,
+        prefs_common_recv_dialog_set_optmenu},
+
        {"add_address_by_click", "FALSE", &prefs_common.add_address_by_click,
         P_BOOL, &interface.checkbtn_addaddrbyclick,
         prefs_set_data_from_toggle, prefs_set_toggle},
-       {"receive_dialog", NULL, &prefs_common.receive_dialog, P_ENUM,
-        &interface.recvdialog_optmenu,
-        prefs_recvdialog_set_data_from_optmenu,
-        prefs_recvdialog_set_optmenu},
-
        {"confirm_on_exit", "TRUE", &prefs_common.confirm_on_exit, P_BOOL,
         &interface.checkbtn_confonexit,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -1949,20 +1949,22 @@ static void prefs_interface_create(void)
        GtkWidget *vbox1;
        GtkWidget *vbox2;
        GtkWidget *vbox3;
-       GtkWidget *checkbtn_emacs;
+       /* GtkWidget *checkbtn_emacs; */
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
-       GtkWidget *checkbtn_addaddrbyclick;
-       GtkWidget *hbox;
-       GtkWidget *recvdialog_optmenu;
-       GtkWidget *recvdialog_optmenu_menu;
-       GtkWidget *recvdialog_menuitem;
+       GtkWidget *hbox1;
        GtkWidget *label;
+       GtkWidget *optmenu_recvdialog;
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       GtkWidget *frame_addr;
+        GtkWidget *vbox_addr;
+       GtkWidget *checkbtn_addaddrbyclick;
 
        GtkWidget *frame_exit;
        GtkWidget *vbox_exit;
-       GtkWidget *hbox1;
        GtkWidget *checkbtn_confonexit;
        GtkWidget *checkbtn_cleanonexit;
        GtkWidget *checkbtn_askonclean;
@@ -1977,11 +1979,11 @@ static void prefs_interface_create(void)
        gtk_widget_show (vbox2);
        gtk_box_pack_start (GTK_BOX (vbox1), vbox2, FALSE, FALSE, 0);
 
-       PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
+       /* PACK_CHECK_BUTTON (vbox2, checkbtn_emacs,
                           _("Emulate the behavior of mouse operation of\n"
                             "Emacs-based mailer"));
        gtk_label_set_justify (GTK_LABEL (GTK_BIN (checkbtn_emacs)->child),
-                              GTK_JUSTIFY_LEFT);
+                              GTK_JUSTIFY_LEFT);   */
 
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_openunread,
@@ -2009,13 +2011,40 @@ static void prefs_interface_create(void)
        gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 8);
        gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
 
+       hbox1 = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox1);
+       gtk_box_pack_start (GTK_BOX (vbox2), hbox1, FALSE, FALSE, 0);
+
+       label = gtk_label_new (_("Show receive dialog"));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox1), label, FALSE, FALSE, 0);
+
+       optmenu_recvdialog = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_recvdialog);
+       gtk_box_pack_start (GTK_BOX (hbox1), optmenu_recvdialog,
+                           FALSE, FALSE, 0);
+
+       menu = gtk_menu_new ();
+       MENUITEM_ADD (menu, menuitem, _("Always"), RECV_DIALOG_ALWAYS);
+       MENUITEM_ADD (menu, menuitem, _("Only if a window is active"),
+                     RECV_DIALOG_ACTIVE);
+       MENUITEM_ADD (menu, menuitem, _("Never"), RECV_DIALOG_NEVER);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_recvdialog), menu);
+
+       PACK_FRAME (vbox1, frame_addr, _("Address book"));
+
+       vbox_addr = gtk_vbox_new (FALSE, VSPACING_NARROW);
+       gtk_widget_show (vbox_addr);
+       gtk_container_add (GTK_CONTAINER (frame_addr), vbox_addr);
+       gtk_container_set_border_width (GTK_CONTAINER (vbox_addr), 8);
+
        PACK_CHECK_BUTTON
-               (vbox2, checkbtn_addaddrbyclick,
+               (vbox_addr, checkbtn_addaddrbyclick,
                 _("Add address to destination when double-clicked"));
 
-
        /* Receive Dialog */
-       hbox = gtk_hbox_new (FALSE, 8);
+/*     hbox = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox);
        gtk_box_pack_start (GTK_BOX (vbox2), hbox, FALSE, FALSE, 0);
 
@@ -2033,7 +2062,7 @@ static void prefs_interface_create(void)
        MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Only if a sylpheed window is active"),  RECVDIALOG_WINDOW_ACTIVE);
        MENUITEM_ADD (recvdialog_optmenu_menu, recvdialog_menuitem, _("Never"), RECVDIALOG_NEVER);
 
-       gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu);
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (recvdialog_optmenu), recvdialog_optmenu_menu);     */
 
        /* On Exit */
        PACK_FRAME (vbox1, frame_exit, _("On exit"));
@@ -2059,12 +2088,12 @@ static void prefs_interface_create(void)
        PACK_CHECK_BUTTON (vbox_exit, checkbtn_warnqueued,
                           _("Warn if there are queued messages"));
 
-       interface.checkbtn_emacs          = checkbtn_emacs;
+       /* interface.checkbtn_emacs          = checkbtn_emacs; */
        interface.checkbtn_openunread     = checkbtn_openunread;
        interface.checkbtn_openinbox      = checkbtn_openinbox;
        interface.checkbtn_immedexec      = checkbtn_immedexec;
+       interface.optmenu_recvdialog      = recvdialog_optmenu;
        interface.checkbtn_addaddrbyclick = checkbtn_addaddrbyclick;
-       interface.recvdialog_optmenu      = recvdialog_optmenu;
        interface.checkbtn_confonexit     = checkbtn_confonexit;
        interface.checkbtn_cleanonexit    = checkbtn_cleanonexit;
        interface.checkbtn_askonclean     = checkbtn_askonclean;
@@ -3107,6 +3136,42 @@ static void prefs_common_charset_set_optmenu(PrefParam *pparam)
        prefs_common_charset_set_data_from_optmenu(pparam);
 }
 
+static void prefs_common_recv_dialog_set_data_from_optmenu(PrefParam *pparam)
+{
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(*pparam->widget));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       *((RecvDialogMode *)pparam->data) = GPOINTER_TO_INT
+               (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
+}
+
+static void prefs_common_recv_dialog_set_optmenu(PrefParam *pparam)
+{
+       RecvDialogMode mode = *((RecvDialogMode *)pparam->data);
+       GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
+       GtkWidget *menu;
+       GtkWidget *menuitem;
+
+       switch (mode) {
+       case RECV_DIALOG_ALWAYS:
+               gtk_option_menu_set_history(optmenu, 0);
+               break;
+       case RECV_DIALOG_ACTIVE:
+               gtk_option_menu_set_history(optmenu, 1);
+               break;
+       case RECV_DIALOG_NEVER:
+               gtk_option_menu_set_history(optmenu, 2);
+               break;
+       default:
+       }
+
+       menu = gtk_option_menu_get_menu(optmenu);
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
+}
+
 static gint prefs_common_deleted(GtkWidget *widget, GdkEventAny *event,
                                 gpointer data)
 {
@@ -3326,7 +3391,7 @@ static void compose_prefs_key_pressed(GtkWidget *widget, GdkEventKey *event)
        }
 }
 
-static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
+/* static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
 {
        GtkWidget *menu;
        GtkWidget *menuitem;
@@ -3335,9 +3400,9 @@ static void prefs_recvdialog_set_data_from_optmenu(PrefParam *pparam)
        menuitem = gtk_menu_get_active(GTK_MENU(menu));
        *((RecvDialogShow *)pparam->data) = GPOINTER_TO_INT
                (gtk_object_get_user_data(GTK_OBJECT(menuitem)));
-}
+}  */
 
-static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
+/* static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
 {
        RecvDialogShow dialog_show;
        GtkOptionMenu *optmenu = GTK_OPTION_MENU(*pparam->widget);
@@ -3362,4 +3427,4 @@ static void prefs_recvdialog_set_optmenu(PrefParam *pparam)
        menu = gtk_option_menu_get_menu(optmenu);
        menuitem = gtk_menu_get_active(GTK_MENU(menu));
        gtk_menu_item_activate(GTK_MENU_ITEM(menuitem));
-}
+}     */
index 0e32033..85d1e37 100644 (file)
 
 typedef struct _PrefsCommon    PrefsCommon;
 
-typedef enum
-{
-       RECVDIALOG_ALWAYS,
-       RECVDIALOG_WINDOW_ACTIVE,
-       RECVDIALOG_NEVER
-} RecvDialogShow;
+typedef enum {
+       RECV_DIALOG_ALWAYS,
+       RECV_DIALOG_ACTIVE,
+       RECV_DIALOG_NEVER
+} RecvDialogMode;
 
 struct _PrefsCommon
 {
@@ -194,8 +193,8 @@ struct _PrefsCommon
        gboolean open_unread_on_enter;
        gboolean open_inbox_on_inc;
        gboolean immediate_exec;
+       RecvDialogMode recv_dialog_mode;
        gboolean add_address_by_click;
-       RecvDialogShow receive_dialog;
 
        gboolean confirm_on_exit;
        gboolean clean_on_exit;
index 68819f9..f0ae198 100644 (file)
@@ -269,8 +269,8 @@ static void prefs_filter_create(void)
        gtk_widget_set_usize (hdr_combo1, 96, -1);
        gtkut_combo_set_items (GTK_COMBO (hdr_combo1),
                               "Subject", "From", "To", "Cc", "Reply-To",
-                              "Sender", "X-ML-Name", "X-List", "X-Sequence",
-                              "X-Mailer",
+                              "Sender", "List-Id",
+                              "X-ML-Name", "X-List", "X-Sequence", "X-Mailer",
                               NULL);
 
        hdr_combo2 = gtk_combo_new ();
@@ -280,8 +280,8 @@ static void prefs_filter_create(void)
        gtk_widget_set_usize (hdr_combo2, 96, -1);
        gtkut_combo_set_items (GTK_COMBO (hdr_combo2), _("(none)"),
                               "Subject", "From", "To", "Cc", "Reply-To",
-                              "Sender", "X-ML-Name", "X-List", "X-Sequence",
-                              "X-Mailer",
+                              "Sender", "List-Id",
+                              "X-ML-Name", "X-List", "X-Sequence", "X-Mailer",
                               NULL);
 
        key_label = gtk_label_new (_("Keyword"));
index b2bc0f3..1b28c6a 100644 (file)
@@ -59,8 +59,8 @@ ProgressDialog *progress_dialog_create(void)
        gtk_widget_set_usize(window, 450, -1);
        gtk_container_set_border_width(GTK_CONTAINER(window), 8);
        gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
-       gtk_window_set_modal(GTK_WINDOW(window), TRUE);
        gtk_window_set_policy(GTK_WINDOW(window), FALSE, TRUE, TRUE);
+       gtk_widget_realize(window);
 
        vbox = gtk_vbox_new(FALSE, 8);
        gtk_container_add(GTK_CONTAINER(window), vbox);
index 39d1811..1fec8be 100644 (file)
@@ -499,6 +499,7 @@ static SendProgressDialog *send_progress_dialog_create(void)
                           GTK_SIGNAL_FUNC(send_cancel), dialog);
        gtk_signal_connect(GTK_OBJECT(progress->window), "delete_event",
                           GTK_SIGNAL_FUNC(gtk_true), NULL);
+       gtk_window_set_modal(GTK_WINDOW(progress->window), TRUE);
        manage_window_set_transient(GTK_WINDOW(progress->window));
 
        progress_dialog_set_value(progress, 0.0);
index 49c97ff..f66df0c 100644 (file)
@@ -150,6 +150,10 @@ static void summary_write_cache_func       (GtkCTree               *ctree,
 static void summary_set_menu_sensitive (SummaryView            *summaryview);
 static void summary_set_add_sender_menu        (SummaryView            *summaryview);
 
+static void summary_select_node                (SummaryView            *summaryview,
+                                        GtkCTreeNode           *node,
+                                        gboolean                display_msg);
+
 static guint summary_get_msgnum                (SummaryView            *summaryview,
                                         GtkCTreeNode           *node);
 
@@ -907,11 +911,20 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        gboolean is_refresh;
        guint selected_msgnum = 0;
        guint displayed_msgnum = 0;
-
        GtkCTreeNode *selected_node = summaryview->folderview->selected;
        GSList *cur;
        gint sort_mode;
        gint sort_type;
+        static gboolean locked = FALSE;
+
+       if (locked) {
+               g_print("Summary view is locked, waiting...\n");
+               return FALSE;
+               /* while (locked)
+                       gtk_main_iteration();
+               g_print("unlocked.\n"); */
+       }
+       locked = TRUE;
 
        STATUSBAR_POP(summaryview->mainwin);
 
@@ -935,8 +948,10 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                        summary_execute(summaryview);
                else if (G_ALERTALTERNATE == val)
                        summary_write_cache(summaryview);
-               else
-                       return FALSE;
+               else {
+                       locked = FALSE;
+                        return FALSE;
+               }
                folder_update_op_count();
        }
        else if (!summaryview->filtering_happened) {
@@ -966,6 +981,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                summary_clear_all(summaryview);
                summaryview->folder_item = item;
                gtk_clist_thaw(GTK_CLIST(ctree));
+               locked = FALSE;
                return TRUE;
        }
        g_free(buf);
@@ -1053,6 +1069,15 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
                if (!summaryview->displayed)
                        messageview_clear(summaryview->messageview);
                summary_select_by_msgnum(summaryview, selected_msgnum);
+               if (!summaryview->selected) {
+                       /* no selected message - select first unread
+                          message, but do not display it */
+                       node = summary_find_next_unread_msg(summaryview, NULL);
+                       if (node == NULL && GTK_CLIST(ctree)->row_list != NULL)
+                               node = GTK_CTREE_NODE
+                                       (GTK_CLIST(ctree)->row_list_end);
+                       summary_select_node(summaryview, node, FALSE);
+               }
        } else {
                /* select first unread message */
                if (sort_mode == SORT_BY_SCORE)
@@ -1063,15 +1088,8 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
 
                if (node == NULL && GTK_CLIST(ctree)->row_list != NULL)
                        node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list_end);
-               if (node) {
-                       GTK_EVENTS_FLUSH();
-                       gtkut_ctree_expand_parent_all(ctree, node);
-                       gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
-                       gtk_widget_grab_focus(GTK_WIDGET(ctree));
-                       if (prefs_common.open_unread_on_enter)
-                               summaryview->display_msg = TRUE;
-                       gtk_sctree_select(GTK_SCTREE(ctree), node);
-               }
+               summary_select_node(summaryview, node,
+                                   prefs_common.open_unread_on_enter);
        }
 
        summary_status_show(summaryview);
@@ -1085,6 +1103,7 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item,
        STATUSBAR_PUSH(summaryview->mainwin, _("Done."));
 
        main_window_cursor_normal(summaryview->mainwin);
+       locked = FALSE;
 
        return TRUE;
 }
@@ -1150,11 +1169,9 @@ void summary_clear_all(SummaryView *summaryview)
        summary_status_show(summaryview);
 }
 
-static void summary_set_menu_sensitive(SummaryView *summaryview)
+SummarySelection summary_get_selection_type(SummaryView *summaryview)
 {
-       GtkItemFactory *ifactory = summaryview->popupfactory;
        GtkCList *clist = GTK_CLIST(summaryview->ctree);
-       gboolean sens;
        SummarySelection selection;
 
        if (!clist->row_list)
@@ -1166,7 +1183,17 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
        else
                selection = SUMMARY_SELECTED_MULTIPLE;
 
-       main_window_set_menu_sensitive(summaryview->mainwin, selection);
+       return selection;
+}
+
+static void summary_set_menu_sensitive(SummaryView *summaryview)
+{
+       GtkItemFactory *ifactory = summaryview->popupfactory;
+       SummarySelection selection;
+       gboolean sens;
+
+       selection = summary_get_selection_type(summaryview);
+       main_window_set_menu_sensitive(summaryview->mainwin);
 
        if (selection == SUMMARY_NONE) {
                GtkWidget *submenu;
@@ -1357,9 +1384,25 @@ void summary_select_prev_marked(SummaryView *summaryview)
 void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
 {
        GtkCTreeNode *node;
-       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        node = summary_find_msg_by_msgnum(summaryview, msgnum);
+       summary_select_node(summaryview, node, FALSE);
+}
+
+/**
+ * summary_select_node:
+ * @summaryview: Summary view.
+ * @node: Summary tree node.
+ * @display_msg: TRUE to display the selected message.
+ *
+ * Select @node (bringing it into view by scrolling and expanding its
+ * thread, if necessary) and unselect all others.  If @display_msg is
+ * TRUE, display the corresponding message in the message view.
+ **/
+static void summary_select_node(SummaryView *summaryview, GtkCTreeNode *node,
+                               gboolean display_msg)
+{
+       GtkCTree *ctree = GTK_CTREE(summaryview->ctree);
 
        if (node) {
                GTK_EVENTS_FLUSH();
@@ -1367,7 +1410,7 @@ void summary_select_by_msgnum(SummaryView *summaryview, guint msgnum)
                gtk_ctree_node_moveto(ctree, node, -1, 0.5, 0);
                gtk_widget_grab_focus(GTK_WIDGET(ctree));
                gtk_sctree_unselect_all(GTK_SCTREE(ctree));
-               summaryview->display_msg = FALSE;
+               summaryview->display_msg = display_msg;
                gtk_sctree_select(GTK_SCTREE(ctree), node);
        }
 }
@@ -1452,7 +1495,7 @@ static GtkCTreeNode *summary_find_msg_by_msgnum(SummaryView *summaryview,
 
        node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
 
-       for (; node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+       for (; node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = gtk_ctree_node_get_row_data(ctree, node);
                if (msginfo->msgnum == msgnum) break;
        }
@@ -1611,7 +1654,7 @@ static void summary_update_status(SummaryView *summaryview)
        summaryview->deleted = summaryview->moved = summaryview->copied = 0;
 
        for (node = GTK_CTREE_NODE(GTK_CLIST(ctree)->row_list);
-            node != NULL; node = GTK_CTREE_NODE_NEXT(node)) {
+            node != NULL; node = gtkut_ctree_node_next(ctree, node)) {
                msginfo = GTKUT_CTREE_NODE_GET_ROW_DATA(node);
 
                if (MSG_IS_NEW(msginfo->flags) /*&& !MSG_IS_IGNORE_THREAD(msginfo->flags)*/)
@@ -3040,7 +3083,7 @@ void summary_execute(SummaryView *summaryview)
 
        node = GTK_CTREE_NODE(clist->row_list);
        while (node != NULL) {
-               next = GTK_CTREE_NODE_NEXT(node);
+               next = gtkut_ctree_node_next(ctree, node);
                if (gtk_ctree_node_get_row_data(ctree, node) == NULL) {
                        if (node == summaryview->displayed) {
                                messageview_clear(summaryview->messageview);
@@ -3514,6 +3557,9 @@ void summary_pass_key_press_event(SummaryView *summaryview, GdkEventKey *event)
 #define BREAK_ON_MODIFIER_KEY() \
        if ((event->state & (GDK_MOD1_MASK|GDK_CONTROL_MASK)) != 0) break
 
+#define RETURN_IF_LOCKED() \
+       if (summaryview->mainwin->lock_count) return
+
 #define KEY_PRESS_EVENT_STOP() \
        if (gtk_signal_n_emissions_by_name \
                (GTK_OBJECT(ctree), "key_press_event") > 0) { \
@@ -3533,6 +3579,7 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
        switch (event->keyval) {
        case GDK_g:             /* Go */
        case GDK_G:
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
                KEY_PRESS_EVENT_STOP();
                to_folder = foldersel_folder_sel(NULL, NULL);
@@ -3555,11 +3602,13 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                        compose_new(NULL);
                return;
        case GDK_D:             /* Empty trash */
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
                KEY_PRESS_EVENT_STOP();
                main_window_empty_trash(summaryview->mainwin, TRUE);
                return;
        case GDK_Q:             /* Quit */
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
 
                if (prefs_common.confirm_on_exit) {
@@ -3640,6 +3689,7 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                summary_mark_as_unread(summaryview);
                break;
        case GDK_d:             /* Delete */
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
                summary_delete(summaryview);
                break;
@@ -3649,15 +3699,18 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
                summary_unmark(summaryview);
                break;
        case GDK_o:             /* Move */
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
                summary_move_to(summaryview);
                break;
        case GDK_O:             /* Copy */
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
                summary_copy_to(summaryview);
                break;
        case GDK_x:             /* Execute */
        case GDK_X:
+               RETURN_IF_LOCKED();
                BREAK_ON_MODIFIER_KEY();
                KEY_PRESS_EVENT_STOP();
                summary_execute(summaryview);
@@ -3690,6 +3743,7 @@ static void summary_key_pressed(GtkWidget *widget, GdkEventKey *event,
 }
 
 #undef BREAK_ON_MODIFIER_KEY
+#undef RETURN_IF_LOCKED
 #undef KEY_PRESS_EVENT_STOP
 
 static void summary_open_row(GtkSCTree *sctree, SummaryView *summaryview)
index 55b5df3..4891981 100644 (file)
@@ -153,15 +153,14 @@ private:
 SummaryView    *summary_create(void);
 
 void summary_init                (SummaryView          *summaryview);
-
 gboolean summary_show            (SummaryView          *summaryview,
                                   FolderItem           *fitem,
                                   gboolean              update_cache);
-
-                                  
 void summary_clear_list                  (SummaryView          *summaryview);
 void summary_clear_all           (SummaryView          *summaryview);
 
+SummarySelection summary_get_selection_type    (SummaryView    *summaryview);
+
 void summary_select_next_unread          (SummaryView          *summaryview);
 void summary_select_next_marked   (SummaryView         *summaryview);
 void summary_select_prev_marked   (SummaryView         *summaryview);
@@ -169,7 +168,7 @@ void summary_select_by_msgnum         (SummaryView          *summaryview,
                                   guint                 msgnum);
 guint summary_get_current_msgnum  (SummaryView         *summaryview);
 void summary_thread_build        (SummaryView          *summaryview,
-                                  gboolean             init);
+                                  gboolean              init);
 void summary_unthread            (SummaryView          *summaryview);
 void summary_filter              (SummaryView          *summaryview);
 void summary_sort                (SummaryView          *summaryview,