add common prefs option '/Interface/Open next message on deletion'
authorPaul Mangan <paul@claws-mail.org>
Tue, 15 Apr 2003 20:47:05 +0000 (20:47 +0000)
committerPaul Mangan <paul@claws-mail.org>
Tue, 15 Apr 2003 20:47:05 +0000 (20:47 +0000)
ChangeLog.claws
configure.ac
src/prefs_common.c
src/prefs_common.h
src/summaryview.c

index 6d37778..5c092ff 100644 (file)
@@ -1,3 +1,9 @@
+2003-04-15 [paul]      0.8.11claws93
+
+       * src/prefs_common.[ch]
+         src/summaryview.c
+               add new option '/Interface/Open next message on deletion'
+
 2003-04-15 [paul]      0.8.11claws92
 
        * src/summaryview.[ch]
index 5c56403..1265c10 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws92
+EXTRA_VERSION=claws93
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 6150292..31efade 100644 (file)
@@ -207,6 +207,7 @@ static struct Interface {
        GtkWidget *checkbtn_show_msg_with_cursor;
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
+       GtkWidget *checkbtn_open_on_delete;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
        GtkWidget *optmenu_recvdialog;
@@ -742,6 +743,10 @@ static PrefParam param[] = {
         &prefs_common.mark_as_read_on_new_window,
         P_BOOL, &interface.checkbtn_mark_as_read_on_newwin,
         prefs_set_data_from_toggle, prefs_set_toggle},
+       {"open_on_delete", "TRUE",
+        &prefs_common.open_on_delete,
+        P_BOOL, &interface.checkbtn_open_on_delete,
+        prefs_set_data_from_toggle, prefs_set_toggle},
        {"open_inbox_on_inc", "FALSE", &prefs_common.open_inbox_on_inc,
         P_BOOL, &interface.checkbtn_openinbox,
         prefs_set_data_from_toggle, prefs_set_toggle},
@@ -2597,6 +2602,7 @@ static void prefs_interface_create(void)
        GtkWidget *checkbtn_show_msg_with_cursor;
        GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
+       GtkWidget *checkbtn_open_on_delete;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
        GtkWidget *frame_dialogs;
@@ -2648,6 +2654,10 @@ static void prefs_interface_create(void)
                (vbox2, checkbtn_mark_as_read_on_newwin,
                 _("Only mark message as read when opened in new window"));
 
+       PACK_CHECK_BUTTON
+               (vbox2, checkbtn_open_on_delete,
+                _("Open next message on deletion"));
+
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_openinbox,
                 _("Go to inbox after receiving new mail"));
@@ -2784,6 +2794,8 @@ static void prefs_interface_create(void)
        interface.checkbtn_openunread         = checkbtn_openunread;
        interface.checkbtn_mark_as_read_on_newwin
                                              = checkbtn_mark_as_read_on_newwin;
+       interface.checkbtn_open_on_delete
+                                             = checkbtn_open_on_delete;
        interface.checkbtn_openinbox          = checkbtn_openinbox;
        interface.checkbtn_immedexec          = checkbtn_immedexec;
        interface.optmenu_recvdialog          = optmenu_recvdialog;
index 0209d8e..57e7a69 100644 (file)
@@ -241,6 +241,7 @@ struct _PrefsCommon
        gboolean show_msg_with_cursor_key;
        gboolean open_unread_on_enter;
        gboolean mark_as_read_on_new_window;
+       gboolean open_on_delete;
        gboolean open_inbox_on_inc;
        gboolean immediate_exec;
        RecvDialogMode recv_dialog_mode;
index a2fae74..6e3678c 100644 (file)
@@ -3094,7 +3094,7 @@ void summary_delete(SummaryView *summaryview)
        if (!node)
                node = summary_find_prev_msg(summaryview, sel_last);
 
-       if (node) {
+       if (node && prefs_common.open_on_delete) {
                if (sel_last && node == gtkut_ctree_node_next(ctree, sel_last))
                        summary_step(summaryview, GTK_SCROLL_STEP_FORWARD);
                else if (sel_last && node == GTK_CTREE_NODE_PREV(sel_last))
@@ -3105,7 +3105,10 @@ void summary_delete(SummaryView *summaryview)
                                 messageview_is_visible(summaryview->messageview),
                                 FALSE);
        }
-
+       else {
+               summary_select_node(summaryview, node, FALSE, FALSE);
+       }
+       
        if (prefs_common.immediate_exec || item->stype == F_TRASH) {
                summary_execute(summaryview);
                /* after deleting, the anchor may be at an invalid row