2005-08-05 [paul] 1.9.13cvs14
authorPaul Mangan <paul@claws-mail.org>
Fri, 5 Aug 2005 09:12:51 +0000 (09:12 +0000)
committerPaul Mangan <paul@claws-mail.org>
Fri, 5 Aug 2005 09:12:51 +0000 (09:12 +0000)
* src/prefs_common.c
* src/prefs_common.h
* src/prefs_summaries.c
* src/summaryview.c
replace 'open_unread_on_enter' option with
'select_on_entry' option. opening/not opening
is now exclusively controlled by 'always_show_msg'

ChangeLog-gtk2.claws
PATCHSETS
configure.ac
src/prefs_common.c
src/prefs_common.h
src/prefs_summaries.c
src/summaryview.c

index 9bc033f..a8b9ee4 100644 (file)
@@ -1,3 +1,13 @@
+2005-08-05 [paul]      1.9.13cvs14
+
+       * src/prefs_common.c
+       * src/prefs_common.h
+       * src/prefs_summaries.c
+       * src/summaryview.c
+               replace 'open_unread_on_enter' option with
+               'select_on_entry' option. opening/not opening
+               is now exclusively controlled by 'always_show_msg'
+
 2005-08-04 [colin]     1.9.13cvs13
 
        * src/compose.c
index 652d1d7..99f173f 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.60.2.22 -r 1.60.2.23 src/addressbook.c;  cvs diff -u -r 1.14.2.6 -r 1.14.2.7 src/editaddress.c;  cvs diff -u -r 1.11.2.6 -r 1.11.2.7 src/editgroup.c;  cvs diff -u -r 1.96.2.67 -r 1.96.2.68 src/textview.c;  ) > 1.9.13cvs11.patchset
 ( cvs diff -u -r 1.105.2.29 -r 1.105.2.30 src/prefs_account.c;  ) > 1.9.13cvs12.patchset
 ( cvs diff -u -r 1.382.2.145 -r 1.382.2.146 src/compose.c;  cvs diff -u -r 1.207.2.50 -r 1.207.2.51 src/folderview.c;  cvs diff -u -r 1.94.2.58 -r 1.94.2.59 src/messageview.c;  cvs diff -u -r 1.101.2.11 -r 1.101.2.12 src/news.c;  cvs diff -u -r 1.2.2.7 -r 1.2.2.8 src/news_gtk.c;  cvs diff -u -r 1.1.2.1 -r 1.1.2.2 src/news_gtk.h;  cvs diff -u -r 1.1.2.19 -r 1.1.2.20 src/gtk/quicksearch.c;  ) > 1.9.13cvs13.patchset
+( cvs diff -u -r 1.204.2.47 -r 1.204.2.48 src/prefs_common.c;  cvs diff -u -r 1.103.2.21 -r 1.103.2.22 src/prefs_common.h;  cvs diff -u -r 1.1.2.6 -r 1.1.2.7 src/prefs_summaries.c;  cvs diff -u -r 1.395.2.100 -r 1.395.2.101 src/summaryview.c;  ) > 1.9.13cvs14.patchset
index 6dbf0d3..9809869 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=9
 MICRO_VERSION=13
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=13
+EXTRA_VERSION=14
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index 6430005..602d072 100644 (file)
@@ -468,8 +468,8 @@ static PrefParam param[] = {
        {"always_show_message_when_selected", "FALSE",
         &prefs_common.always_show_msg,
         P_BOOL, NULL, NULL, NULL},
-       {"open_unread_on_enter", "FALSE", &prefs_common.open_unread_on_enter,
-        P_BOOL, NULL, NULL, NULL},
+       {"select_on_entry", NULL, &prefs_common.select_on_entry,
+        P_ENUM, NULL, NULL, NULL},
        {"mark_as_read_on_new_window", "FALSE",
         &prefs_common.mark_as_read_on_new_window,
         P_BOOL, NULL, NULL, NULL},
index a69b3ba..ef32263 100644 (file)
@@ -53,6 +53,12 @@ typedef enum {
        SEND_DIALOG_NEVER
 } SendDialogMode;
 
+typedef enum
+{
+       SELECTONENTRY_UNREAD = 1 << 0,
+       SELECTONENTRY_NEW    = 1 << 1
+} SelectOnEntry;
+
 typedef enum
 {
        NEXTUNREADMSGDIALOG_ALWAYS,
@@ -267,11 +273,11 @@ struct _PrefsCommon
        gboolean sep_msg;
        gboolean emulate_emacs;
        gboolean always_show_msg;
-       gboolean open_unread_on_enter;
        gboolean mark_as_read_on_new_window;
        gboolean mark_as_read_delay;
        gboolean open_inbox_on_inc;
        gboolean immediate_exec;
+       SelectOnEntry select_on_entry;
        NextUnreadMsgDialogShow next_unread_msg_dialog;
        gboolean add_address_by_click;
        gchar *pixmap_theme_path;
index 36e4e49..c0c5319 100644 (file)
@@ -57,10 +57,10 @@ typedef struct _SummariesPage
        GtkWidget *entry_datefmt;
 
        GtkWidget *checkbtn_always_show_msg;
-       GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
+       GtkWidget *optmenu_select_on_entry;
        GtkWidget *optmenu_nextunreadmsgdialog;
 
 } SummariesPage;
@@ -707,7 +707,6 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *button_dispitem;
 
        GtkWidget *checkbtn_always_show_msg;
-       GtkWidget *checkbtn_openunread;
        GtkWidget *checkbtn_mark_as_read_on_newwin;
        GtkWidget *checkbtn_openinbox;
        GtkWidget *checkbtn_immedexec;
@@ -716,6 +715,8 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        GtkWidget *menu;
        GtkWidget *menuitem;
        GtkWidget *button_keybind;
+       GtkWidget *hbox_select_on_entry;
+       GtkWidget *optmenu_select_on_entry;
        GtkWidget *hbox_nextunreadmsgdialog;
        GtkWidget *optmenu_nextunreadmsgdialog;
 
@@ -828,10 +829,6 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
                (vbox2, checkbtn_always_show_msg,
                 _("Always open messages in summary when selected"));
 
-       PACK_CHECK_BUTTON
-               (vbox2, checkbtn_openunread,
-                _("Open first unread message when entering a folder"));
-
        PACK_CHECK_BUTTON
                (vbox2, checkbtn_mark_as_read_on_newwin,
                 _("Only mark message as read when opened in new window"));
@@ -858,7 +855,29 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_widget_show (hbox1);
        gtk_box_pack_start (GTK_BOX (vbox3), hbox1, FALSE, FALSE, 0);
 
-       /* Next Unread Message Dialog */
+       hbox_select_on_entry = gtk_hbox_new (FALSE, 8);
+       gtk_widget_show (hbox_select_on_entry);
+       gtk_box_pack_start (GTK_BOX (vbox1), hbox_select_on_entry, FALSE, FALSE, 0);
+
+       label = gtk_label_new (_("When entering a folder"));
+       gtk_widget_show (label);
+       gtk_box_pack_start (GTK_BOX (hbox_select_on_entry), label, FALSE, FALSE, 8);
+
+       optmenu_select_on_entry = gtk_option_menu_new ();
+       gtk_widget_show (optmenu_select_on_entry);
+       gtk_box_pack_start (GTK_BOX (hbox_select_on_entry),
+                           optmenu_select_on_entry, FALSE, FALSE, 8);
+       
+       menu = gtk_menu_new ();
+       MENUITEM_ADD (menu, menuitem, _("Do nothing"), 0);
+       MENUITEM_ADD (menu, menuitem, _("Select first unread message"),
+                     SELECTONENTRY_UNREAD);
+       MENUITEM_ADD (menu, menuitem, _("Select first new message"),
+                     SELECTONENTRY_NEW);
+
+       gtk_option_menu_set_menu (GTK_OPTION_MENU (optmenu_select_on_entry), menu);
+       
+       /* Next Unread Message Dialog */
        hbox_nextunreadmsgdialog = gtk_hbox_new (FALSE, 8);
        gtk_widget_show (hbox_nextunreadmsgdialog);
        gtk_box_pack_start (GTK_BOX (vbox1), hbox_nextunreadmsgdialog, FALSE, FALSE, 0);
@@ -910,8 +929,6 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
 
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_always_show_msg),
                        prefs_common.always_show_msg);
-       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_openunread),
-                       prefs_common.open_unread_on_enter);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_mark_as_read_on_newwin),
                        prefs_common.mark_as_read_on_new_window);
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_openinbox),
@@ -919,6 +936,8 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbtn_immedexec),
                        prefs_common.immediate_exec);
 
+       gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_select_on_entry),
+                       prefs_common.select_on_entry);
        gtk_option_menu_set_history(GTK_OPTION_MENU(optmenu_nextunreadmsgdialog),
                        prefs_common.next_unread_msg_dialog);
 
@@ -931,10 +950,10 @@ void prefs_summaries_create_widget(PrefsPage *_page, GtkWindow *window,
        prefs_summaries->entry_datefmt = entry_datefmt;
 
        prefs_summaries->checkbtn_always_show_msg = checkbtn_always_show_msg;
-       prefs_summaries->checkbtn_openunread = checkbtn_openunread;
        prefs_summaries->checkbtn_mark_as_read_on_newwin = checkbtn_mark_as_read_on_newwin;
        prefs_summaries->checkbtn_openinbox = checkbtn_openinbox;
        prefs_summaries->checkbtn_immedexec = checkbtn_immedexec;
+       prefs_summaries->optmenu_select_on_entry = optmenu_select_on_entry;
        prefs_summaries->optmenu_nextunreadmsgdialog = optmenu_nextunreadmsgdialog;
 
        prefs_summaries->page.widget = vbox1;
@@ -965,8 +984,6 @@ void prefs_summaries_save(PrefsPage *_page)
 
        prefs_common.always_show_msg = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_always_show_msg));
-       prefs_common.open_unread_on_enter = gtk_toggle_button_get_active(
-               GTK_TOGGLE_BUTTON(page->checkbtn_openunread));
        prefs_common.mark_as_read_on_new_window = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_mark_as_read_on_newwin));
        prefs_common.open_inbox_on_inc = gtk_toggle_button_get_active(
@@ -974,6 +991,11 @@ void prefs_summaries_save(PrefsPage *_page)
        prefs_common.immediate_exec = gtk_toggle_button_get_active(
                GTK_TOGGLE_BUTTON(page->checkbtn_immedexec));
 
+       menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_select_on_entry));
+       menuitem = gtk_menu_get_active(GTK_MENU(menu));
+       prefs_common.select_on_entry = GPOINTER_TO_INT
+               (g_object_get_data(G_OBJECT(menuitem), MENU_VAL_ID));
+       
        menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(page->optmenu_nextunreadmsgdialog));
        menuitem = gtk_menu_get_active(GTK_MENU(menu));
        prefs_common.next_unread_msg_dialog = GPOINTER_TO_INT
index fcef86b..994622c 100644 (file)
@@ -1014,26 +1014,31 @@ gboolean summary_show(SummaryView *summaryview, FolderItem *item)
                        summary_lock(summaryview);
                }
        } else {
-               /* select first unread message */
-               node = summary_find_next_flagged_msg(summaryview, NULL,
-                                                    MSG_UNREAD, FALSE);
+               switch (prefs_common.select_on_entry) {
+                       case SELECTONENTRY_UNREAD:
+                               node = summary_find_next_flagged_msg(summaryview, NULL,
+                                                                    MSG_UNREAD, FALSE);
+                               break;
+                       case SELECTONENTRY_NEW:
+                               node = summary_find_next_flagged_msg(summaryview, NULL,
+                                                                    MSG_NEW, FALSE);
+                               break;
+                       default:
+                               node = summary_find_next_flagged_msg(summaryview, NULL,
+                                                                    0, FALSE);
+               }
+
                if (node == NULL && GTK_CLIST(ctree)->row_list != NULL) {
                        node = gtk_ctree_node_nth
                                (ctree,
                                 item->sort_type == SORT_DESCENDING
                                 ? 0 : GTK_CLIST(ctree)->rows - 1);
                }
-               if (prefs_common.open_unread_on_enter) {
-                       summary_unlock(summaryview);
-                       summary_select_node(summaryview, node, 
-                                           messageview_is_visible(summaryview->messageview), 
-                                           TRUE);
-                       summary_lock(summaryview);
-               } else {
-                       summary_unlock(summaryview);
-                       summary_select_node(summaryview, node, prefs_common.always_show_msg, TRUE);
-                       summary_lock(summaryview);
-               }
+               summary_unlock(summaryview);
+               summary_select_node(summaryview, node,
+                                   prefs_common.always_show_msg,
+                                   TRUE);
+               summary_lock(summaryview);
        }
 
        summary_set_column_titles(summaryview);