Improved and fixed folder view 'Mark all read'
authorMelvin Hadasht <melvin.hadasht@free.fr>
Sat, 26 Jan 2002 11:03:43 +0000 (11:03 +0000)
committerMelvin Hadasht <melvin.hadasht@free.fr>
Sat, 26 Jan 2002 11:03:43 +0000 (11:03 +0000)
ChangeLog.claws
configure.in
src/folderview.c
src/summaryview.c

index aa7518970b266623cfee2d20adb4a87f65fc5edd..1a4f40ed5d12ced9cdb0047a40d9560f06addc8e 100644 (file)
@@ -1,3 +1,13 @@
+2002-01-26 [melvin]    0.7.0claws30
+
+       * src/folderview.c
+       * src/summaryview.c
+               Readded 'Mark all read' into summary view popup menu
+               Added 'Mark all read' in folder view popup menu for IMAP
+               and NNTP.
+               Made it insensitive if the selected folder is not the shown
+               one to avoid 'Mark all read' on the wrong folder.
+               
 2002-01-26 [paul]      0.7.0claws29
 
        * src/folderview.c
index 27c824a95fcc3af0617fa2ca643c93090f870382..e9e5b977e377ba50d32edad030dc8f9e6ab36d18 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=7
 MICRO_VERSION=0
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws29
+EXTRA_VERSION=claws30
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 367505d6e375805e52b90cd65114474db55887af..dac11072cbc287cd79b830e3283a43780d8aa24a 100644 (file)
@@ -271,6 +271,8 @@ static GtkItemFactoryEntry folderview_mail_popup_entries[] =
 
 static GtkItemFactoryEntry folderview_imap_popup_entries[] =
 {
+       {N_("/Mark all _read"),         NULL, mark_all_read_cb, 0, NULL},
+       {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/Create _new folder..."),  NULL, folderview_new_imap_folder_cb, 0, NULL},
        {N_("/_Rename folder..."),      NULL, NULL, 0, NULL},
        {N_("/_Delete folder"),         NULL, folderview_rm_imap_folder_cb, 0, NULL},
@@ -289,6 +291,8 @@ static GtkItemFactoryEntry folderview_imap_popup_entries[] =
 
 static GtkItemFactoryEntry folderview_news_popup_entries[] =
 {
+       {N_("/Mark all _read"),         NULL, mark_all_read_cb, 0, NULL},
+       {N_("/---"),                    NULL, NULL, 0, "<Separator>"},
        {N_("/_Subscribe to newsgroup..."),
                                         NULL, folderview_new_news_group_cb, 0, NULL},
        {N_("/_Remove newsgroup"),       NULL, folderview_rm_news_group_cb, 0, NULL},
@@ -579,8 +583,8 @@ void folderview_select(FolderView *folderview, FolderItem *item)
 static void mark_all_read_cb(FolderView *folderview, guint action,
                              GtkWidget *widget)
 {
-       if (!folderview->selected) return;
-               summary_mark_all_read(folderview->summaryview);
+       if (folderview->selected)
+               summary_mark_all_read(folderview->summaryview);
 }
 
 static void folderview_select_node(FolderView *folderview, GtkCTreeNode *node)
@@ -1398,6 +1402,9 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
 
 #define SET_SENS(factory, name, sens) \
        menu_set_sensitive(folderview->factory, name, sens)
+       
+       mark_all_read = mark_all_read && 
+                       (item == folderview->summaryview->folder_item);
 
        if (FOLDER_IS_LOCAL(folder)) {
                popup = folderview->mail_popup;
@@ -1416,6 +1423,7 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
        } else if (FOLDER_TYPE(folder) == F_IMAP) {
                popup = folderview->imap_popup;
                menu_set_insensitive_all(GTK_MENU_SHELL(popup));
+               SET_SENS(imap_factory, "/Mark all read", mark_all_read);
                SET_SENS(imap_factory, "/Create new folder...", new_folder);
                SET_SENS(imap_factory, "/Rename folder...", rename_folder);
                SET_SENS(imap_factory, "/Delete folder", delete_folder);
@@ -1428,6 +1436,7 @@ static void folderview_button_pressed(GtkWidget *ctree, GdkEventButton *event,
        } else if (FOLDER_TYPE(folder) == F_NEWS) {
                popup = folderview->news_popup;
                menu_set_insensitive_all(GTK_MENU_SHELL(popup));
+               SET_SENS(news_factory, "/Mark all read", mark_all_read);
                SET_SENS(news_factory, "/Subscribe to newsgroup...", new_folder);
                SET_SENS(news_factory, "/Remove newsgroup", delete_folder);
 #if 0
index 136c275d5bb533a564700aad97f956ca9a1333c1..2b07f57cbf235191eff0da0dd21a8266fc35fab4 100644 (file)
@@ -406,6 +406,7 @@ static GtkItemFactoryEntry summary_popup_entries[] =
        {N_("/_Mark/---"),              NULL, NULL,             0, "<Separator>"},
        {N_("/_Mark/Mark as unr_ead"),  NULL, summary_mark_as_unread, 0, NULL},
        {N_("/_Mark/Mark as rea_d"),    NULL, summary_mark_as_read, 0, NULL},
+       {N_("/_Mark/Mark all read"),    NULL, summary_mark_all_read, 0, NULL},
        {N_("/_Mark/Ignore thread"),    NULL, summary_ignore_thread, 0, NULL},
        {N_("/_Mark/Unignore thread"),  NULL, summary_unignore_thread, 0, NULL},
        {N_("/Color la_bel"),           NULL, NULL,             0, NULL},
@@ -1045,6 +1046,7 @@ static void summary_set_menu_sensitive(SummaryView *summaryview)
 
        menu_set_sensitive(ifactory, "/Mark/Mark as unread", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Mark as read",   TRUE);
+       menu_set_sensitive(ifactory, "/Mark/Mark all read", TRUE);
        menu_set_sensitive(ifactory, "/Mark/Ignore thread",   TRUE);
        menu_set_sensitive(ifactory, "/Mark/Unignore thread", TRUE);