New menu item mark_thread_as_read added to mark_what menu

This commit is contained in:
Ianos Gnatiuc 2005-10-24 03:50:49 +00:00
parent 7d4f2d56fa
commit 5f82a68461
8 changed files with 50 additions and 16 deletions

View File

@ -322,6 +322,7 @@ MI_YOURMAIL "Y Your personal mail "
MI_FROMTOSUBJ "H Header (From/To/Subj) " MI_FROMTOSUBJ "H Header (From/To/Subj) "
MI_TEXTHDR "T Text and header " MI_TEXTHDR "T Text and header "
MI_THREAD "R Reply thread " MI_THREAD "R Reply thread "
MI_ASREAD "s Mark thread as read "
MI_NEWMSGS "N New msgs >current " MI_NEWMSGS "N New msgs >current "
MI_OLDMSGS "O Old msgs <current " MI_OLDMSGS "O Old msgs <current "
MI_ALLMSGS "A All msgs " MI_ALLMSGS "A All msgs "

View File

@ -10,6 +10,11 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ New menu item "Mark thread as read" added to "Mark What?" menu.
+ Added new keyword for the language configuration file
MI_ASREAD "s Mark thread as read "
! ReadFindNext default key was changed to Alt-F6. ! ReadFindNext default key was changed to Alt-F6.
- All gmtime and localtime calls was rewritten to internal defined functions. - All gmtime and localtime calls was rewritten to internal defined functions.

View File

@ -302,6 +302,7 @@ static LangCrc LangCrcs[] = {
{ CRC_MI_FROMTOSUBJ , NULL , "H Header (From/To/Subj) " }, { CRC_MI_FROMTOSUBJ , NULL , "H Header (From/To/Subj) " },
{ CRC_MI_TEXTHDR , NULL , "T Text and header " }, { CRC_MI_TEXTHDR , NULL , "T Text and header " },
{ CRC_MI_THREAD , NULL , "R Reply thread " }, { CRC_MI_THREAD , NULL , "R Reply thread " },
{ CRC_MI_ASREAD , NULL , "s Mark thread as read " },
{ CRC_MI_NEWMSGS , NULL , "N New msgs >current " }, { CRC_MI_NEWMSGS , NULL , "N New msgs >current " },
{ CRC_MI_OLDMSGS , NULL , "O Old msgs <current " }, { CRC_MI_OLDMSGS , NULL , "O Old msgs <current " },
{ CRC_MI_ALLMSGS , NULL , "A All msgs " }, { CRC_MI_ALLMSGS , NULL , "A All msgs " },

View File

@ -300,6 +300,7 @@ const word CRC_MI_YOURMAIL = 0x1143;
const word CRC_MI_FROMTOSUBJ = 0x52FC; const word CRC_MI_FROMTOSUBJ = 0x52FC;
const word CRC_MI_TEXTHDR = 0x1564; const word CRC_MI_TEXTHDR = 0x1564;
const word CRC_MI_THREAD = 0x5FE1; const word CRC_MI_THREAD = 0x5FE1;
const word CRC_MI_ASREAD = 0x4B91;
const word CRC_MI_NEWMSGS = 0x6211; const word CRC_MI_NEWMSGS = 0x6211;
const word CRC_MI_OLDMSGS = 0x2104; const word CRC_MI_OLDMSGS = 0x2104;
const word CRC_MI_ALLMSGS = 0x470D; const word CRC_MI_ALLMSGS = 0x470D;

View File

@ -536,6 +536,7 @@ enum {
TAG_MARKHEADER, TAG_MARKHEADER,
TAG_MARKTXTHDR, TAG_MARKTXTHDR,
TAG_MARKTHREAD, TAG_MARKTHREAD,
TAG_MARKASREAD,
TAG_MARKNEWMSGS, TAG_MARKNEWMSGS,
TAG_MARKOLDMSGS, TAG_MARKOLDMSGS,
TAG_MARKALLMSGS, TAG_MARKALLMSGS,

View File

@ -289,6 +289,7 @@ struct LangGed {
char* FromToSubj; // MI_FROMTOSUBJ char* FromToSubj; // MI_FROMTOSUBJ
char* TextHdr; // MI_TEXTHDR char* TextHdr; // MI_TEXTHDR
char* Thread; // MI_THREAD char* Thread; // MI_THREAD
char* AsRead; // MI_ASREAD
char* NewMsgs; // MI_NEWMSGS char* NewMsgs; // MI_NEWMSGS
char* OldMsgs; // MI_OLDMSGS char* OldMsgs; // MI_OLDMSGS
char* AllMsgs; // MI_ALLMSGS char* AllMsgs; // MI_ALLMSGS

View File

@ -423,6 +423,7 @@ int GMenuMarkMsgs::Run() {
Item(TAG_MARKHEADER, LNG->FromToSubj); Item(TAG_MARKHEADER, LNG->FromToSubj);
Item(TAG_MARKTXTHDR, LNG->TextHdr); Item(TAG_MARKTXTHDR, LNG->TextHdr);
Item(TAG_MARKTHREAD, LNG->Thread); Item(TAG_MARKTHREAD, LNG->Thread);
Item(TAG_MARKASREAD, LNG->AsRead);
Item(TAG_MARKNEWMSGS, LNG->NewMsgs); Item(TAG_MARKNEWMSGS, LNG->NewMsgs);
Item(TAG_MARKOLDMSGS, LNG->OldMsgs); Item(TAG_MARKOLDMSGS, LNG->OldMsgs);
Item(TAG_MARKALLMSGS, LNG->AllMsgs); Item(TAG_MARKALLMSGS, LNG->AllMsgs);

View File

@ -218,8 +218,8 @@ void MarkMsgs_Txt(int item, char* markstring) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
static void recursive_mark(GMsg* msg, uint32_t msgno) { static void recursive_mark(GMsg* msg, uint32_t msgno, bool markasread)
{
int i; int i;
gmsg_links templink; gmsg_links templink;
@ -227,21 +227,29 @@ static void recursive_mark(GMsg* msg, uint32_t msgno) {
templink = msg->link; templink = msg->link;
if (!markasread)
{
if(templink.first()) if(templink.first())
AA->Mark.Add(templink.first()); AA->Mark.Add(templink.first());
for(i = 0; i < templink.list_max(); i++) { for(i = 0; i < templink.list_max(); i++)
if(templink.list(i)) { {
if(templink.list(i))
AA->Mark.Add(templink.list(i)); AA->Mark.Add(templink.list(i));
} }
} }
else if (!msg->timesread)
{
msg->timesread++;
AA->UpdateTimesread(msg);
}
if(templink.first()) if(templink.first())
recursive_mark(msg, templink.first()); recursive_mark(msg, templink.first(), markasread);
for(i = 0; i < templink.list_max(); i++) { for(i = 0; i < templink.list_max(); i++) {
if(templink.list(i)) { if(templink.list(i)) {
recursive_mark(msg, templink.list(i)); recursive_mark(msg, templink.list(i), markasread);
} }
} }
} }
@ -250,25 +258,39 @@ static void recursive_mark(GMsg* msg, uint32_t msgno) {
// ------------------------------------------------------------------ // ------------------------------------------------------------------
void MarkMsgs_Thread(GMsg* msg) { void MarkMsgs_Thread(GMsg* msg, bool markasread)
{
GMsg* tempmsg = (GMsg*)throw_calloc(1, sizeof(GMsg)); GMsg* tempmsg = (GMsg*)throw_calloc(1, sizeof(GMsg));
tempmsg->msgno = msg->msgno; tempmsg->msgno = msg->msgno;
w_info(LNG->Wait); w_info(LNG->Wait);
if (!markasread)
AA->Mark.Add(msg->msgno); AA->Mark.Add(msg->msgno);
else if (!msg->timesread)
{
msg->timesread++;
AA->UpdateTimesread(msg);
}
uint32_t msgno = msg->link.to(); uint32_t msgno = msg->link.to();
while(AA->Msgn.ToReln(msgno)) { // Search backwards while(AA->Msgn.ToReln(msgno)) // Search backwards
{
if (!markasread)
AA->Mark.Add(msgno); AA->Mark.Add(msgno);
if(not AA->LoadHdr(tempmsg, msgno, false)) if(not AA->LoadHdr(tempmsg, msgno, false))
tempmsg->link.to_set(0); tempmsg->link.to_set(0);
else if (markasread && !tempmsg->timesread)
{
tempmsg->timesread++;
AA->UpdateTimesread(msg);
}
msgno = tempmsg->link.to(); msgno = tempmsg->link.to();
} }
recursive_mark(tempmsg, tempmsg->msgno); recursive_mark(tempmsg, tempmsg->msgno, markasread);
w_info(NULL); w_info(NULL);
@ -336,7 +358,8 @@ void MarkMsgs(GMsg* msg) {
// --------------------------------------------------------------- // ---------------------------------------------------------------
case TAG_MARKTHREAD: case TAG_MARKTHREAD:
MarkMsgs_Thread(msg); case TAG_MARKASREAD:
MarkMsgs_Thread(msg, item == TAG_MARKASREAD);
break; break;
} }