From 2ded685104c5a4ea820dd191e66caccc7cad75b5 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sun, 8 Jan 2006 15:03:54 +0000 Subject: [PATCH] New reader key READGotoThNextUnread added, that will cycle thorough all unread messages of current thread --- cfgs/config/goldkeys.cfg | 1 + cfgs/config/goldkeys.rus | 3 +- docs/notework.txt | 3 ++ golded3/gckeys.cpp | 2 ++ golded3/gckeys.h | 1 + golded3/gekeys.h | 48 +++++++++++++++++++++++---- golded3/gemlst.cpp | 71 ++++++++++++++++++++++++++++++++++++++++ golded3/geprot.h | 1 + golded3/geread.cpp | 4 +++ 9 files changed, 127 insertions(+), 7 deletions(-) diff --git a/cfgs/config/goldkeys.cfg b/cfgs/config/goldkeys.cfg index 2e61054..9053e8e 100644 --- a/cfgs/config/goldkeys.cfg +++ b/cfgs/config/goldkeys.cfg @@ -350,6 +350,7 @@ Left READgotoprevmsg * READgotoreplynext - READgotoreplyprev ^Left READgotoreplyprev +@Down READGotoThNextUnread ; READhidekludge ; READhidehidden ; READhidehiddklud diff --git a/cfgs/config/goldkeys.rus b/cfgs/config/goldkeys.rus index 2cf35f8..c4e597f 100644 --- a/cfgs/config/goldkeys.rus +++ b/cfgs/config/goldkeys.rus @@ -338,7 +338,8 @@ Left READgotoprevmsg + READgotoreplies ^Right READgotoreplies / READGoToReply1st ; Пеpеход к пеpвому ответу на это сообщение в цепочке ответов -* READGoToReplyNext ; Для JAM_базы ; Перейти к следующему ответу на это сообщение +* READGoToReplyNext ; Перейти к следующему ответу на это сообщение +@Down READGotoThNextUnread ; Переход к следующему непрочитанному сообщению в треде ^M READmainmenu ^L READmakeuserlist ^K READmakepathreport diff --git a/docs/notework.txt b/docs/notework.txt index f5775ab..9a46274 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,9 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ ++ New reader key READGotoThNextUnread (default: @Down) added, that will + cycle thorough all unread messages of current thread. + - Win32: file attach is no more translated to upper case. + New russian and ukrainian charset tables (conversion from/to ISO 8859-5). diff --git a/golded3/gckeys.cpp b/golded3/gckeys.cpp index 5982c17..0c31251 100644 --- a/golded3/gckeys.cpp +++ b/golded3/gckeys.cpp @@ -246,6 +246,7 @@ CmdKey DefaultKeyset[] = { { Key_Multi , KK_ReadGotoReplyNext , KT_R }, { Key_Minus , KK_ReadGotoReplyPrev , KT_R }, { Key_C_Lft , KK_ReadGotoReplyPrev , KT_R }, + { Key_A_Dwn , KK_ReadGotoThNextUnread , KT_R }, { Key_S_F10 , KK_ReadLookupDest , KT_R }, { Key_F10 , KK_ReadLookupOrig , KT_R }, { Key_C_L , KK_ReadMakeUserlist , KT_R }, @@ -511,6 +512,7 @@ tglobalkey globalkeys[] = { { CRC_K_AZ , Key_A_Z , 0 }, // 0x405A { CRC_K_ADEL , Key_A_Del , 0 }, // 0x40C0 { CRC_NODEMACRO , KK_NodeMacro , KT_N }, // 0x4129 + { CRC_READGOTOTHNEXTUNREAD , KK_ReadGotoThNextUnread , KT_R }, // 0x413E #if !defined(__UNIX__) || defined(__USE_NCURSES__) { CRC_K_SUP , Key_S_Up , 0 }, // 0x4151 #endif diff --git a/golded3/gckeys.h b/golded3/gckeys.h index 46b9cbb..2fcfb1c 100644 --- a/golded3/gckeys.h +++ b/golded3/gckeys.h @@ -247,6 +247,7 @@ const word CRC_READGOTOREPLIES = 0x1A6B; const word CRC_READGOTOREPLY1ST = 0xE54F; const word CRC_READGOTOREPLYNEXT = 0x844F; const word CRC_READGOTOREPLYPREV = 0xDBE7; +const word CRC_READGOTOTHNEXTUNREAD = 0x413E; const word CRC_READINCREASEMARGIN = 0x1797; const word CRC_READLOOKUPDEST = 0x0023; const word CRC_READLOOKUPORIG = 0xA41C; diff --git a/golded3/gekeys.h b/golded3/gekeys.h index 0f623d3..a5df001 100644 --- a/golded3/gekeys.h +++ b/golded3/gekeys.h @@ -52,6 +52,7 @@ const gkey KK_FileMacro = 0xFE03; const gkey KK_ListMacro = 0xFE04; const gkey KK_NodeMacro = 0xFE05; const gkey KK_ReadMacro = 0xFE06; + // = 0xFE07-0xFE7F const gkey KK_Commands = 0xFE80; const gkey KK_ExternUtil01 = 0xFE81; @@ -79,6 +80,12 @@ const gkey KK_ExternUtil22 = 0xFE96; const gkey KK_ExternUtil23 = 0xFE97; const gkey KK_ExternUtil24 = 0xFE98; const gkey KK_ExternUtil25 = 0xFE99; + // = 0xFE9A; + // = 0xFE9B; + // = 0xFE9C; + // = 0xFE9D; + // = 0xFE9E; + // = 0xFE9F; const gkey KK_AreaAbort = 0xFEA0; const gkey KK_AreaAskExit = 0xFEA1; @@ -94,6 +101,7 @@ const gkey KK_AreaHeat = 0xFEAA; const gkey KK_AreaJump = 0xFEAC; const gkey KK_AreaJumpNextMatch = 0xFEAD; const gkey KK_AreaMainMenu = 0xFEAE; + // = 0xFEAF; const gkey KK_AreaQuitNow = 0xFEB0; const gkey KK_AreaScan = 0xFEB1; const gkey KK_AreaScanPM = 0xFEB2; @@ -106,6 +114,10 @@ const gkey KK_AreaWriteGoldlast = 0xFEB8; const gkey KK_AreaZap = 0xFEB9; const gkey KK_AreaMark = 0xFEBA; const gkey KK_AreaUnmark = 0xFEBB; + // = 0xFEBC; + // = 0xFEBD; + // = 0xFEBE; + // = 0xFEBF; const gkey KK_EditAbort = 0xFEC0; const gkey KK_EditAnchor = 0xFEC1; @@ -143,10 +155,13 @@ const gkey KK_EditGoWordRight = 0xFEE0; const gkey KK_EditHeader = 0xFEE1; const gkey KK_EditImportQuotebuf = 0xFEE2; const gkey KK_EditImportText = 0xFEE3; + // = 0xFEE4; const gkey KK_EditLoadFile = 0xFEE5; const gkey KK_EditLookupCursor = 0xFEE6; const gkey KK_EditLookupDest = 0xFEE7; const gkey KK_EditLookupOrig = 0xFEE8; + // = 0xFEE9; + // = 0xFEEA; const gkey KK_EditNewline = 0xFEEB; const gkey KK_EditPaste = 0xFEEC; const gkey KK_EditQuitNow = 0xFEED; @@ -185,6 +200,7 @@ const gkey KK_EditSCodeReverse = 0xFF0C; const gkey KK_EditSCheckerMenu = 0xFF0D; #endif const gkey KK_EditDrawLines = 0xFF0E; + // = 0xFE0F; const gkey KK_FileAbort = 0xFF10; const gkey KK_FileAskExit = 0xFF11; @@ -195,6 +211,7 @@ const gkey KK_FileGotoNext = 0xFF15; const gkey KK_FileGotoPrev = 0xFF16; const gkey KK_FileMark = 0xFF17; const gkey KK_FileMarkAll = 0xFF18; + // = 0xFE19; const gkey KK_FileQuitNow = 0xFF1A; const gkey KK_FileSelect = 0xFF1B; const gkey KK_FileToggleMark = 0xFF1C; @@ -212,6 +229,7 @@ const gkey KK_ListGotoNext = 0xFF26; const gkey KK_ListGotoPrev = 0xFF27; const gkey KK_ListMainMenu = 0xFF28; const gkey KK_ListMarkingOptions = 0xFF29; + // = 0xFE2A; const gkey KK_ListQuitNow = 0xFF2B; const gkey KK_ListSelect = 0xFF2C; const gkey KK_ListToggleBookMark = 0xFF2D; @@ -223,6 +241,18 @@ const gkey KK_ListUnmark = 0xFF32; const gkey KK_ListWideSubj = 0xFF33; const gkey KK_ListNarrowSubj = 0xFF34; + // = 0xFE35; + // = 0xFE36; + // = 0xFE37; + // = 0xFE38; + // = 0xFE39; + // = 0xFE3A; + // = 0xFE3B; + // = 0xFE3C; + // = 0xFE3D; + // = 0xFE3E; + // = 0xFE3F; + const gkey KK_NodeAbort = 0xFF40; const gkey KK_NodeAskExit = 0xFF41; const gkey KK_NodeDosShell = 0xFF42; @@ -230,6 +260,8 @@ const gkey KK_NodeGotoFirst = 0xFF43; const gkey KK_NodeGotoLast = 0xFF44; const gkey KK_NodeGotoNext = 0xFF45; const gkey KK_NodeGotoPrev = 0xFF46; + // = 0xFE47; + // = 0xFE48; const gkey KK_NodeQuitNow = 0xFF49; const gkey KK_NodeSelect = 0xFF4A; @@ -243,6 +275,8 @@ const gkey KK_ReadAddressbookAdd = 0xFF50; const gkey KK_ReadAskExit = 0xFF51; const gkey KK_ReadChangeAka = 0xFF52; const gkey KK_ReadChangeAttrs = 0xFF53; + // = 0xFE54; + // = 0xFE55; const gkey KK_ReadChangeMsg = 0xFF56; const gkey KK_ReadChangeOrigin = 0xFF57; const gkey KK_ReadChangeTagline = 0xFF58; @@ -273,12 +307,13 @@ const gkey KK_ReadGotoReplies = 0xFF70; const gkey KK_ReadGotoReply1st = 0xFF71; const gkey KK_ReadGotoReplyNext = 0xFF72; const gkey KK_ReadGotoReplyPrev = 0xFF73; -const gkey KK_ReadIncreaseMargin = 0xFF74; -const gkey KK_ReadLookupDest = 0xFF75; -const gkey KK_ReadLookupOrig = 0xFF76; -const gkey KK_ReadMainMenu = 0xFF77; -const gkey KK_ReadMakeUserlist = 0xFF78; -const gkey KK_ReadMarkingOptions = 0xFF79; +const gkey KK_ReadGotoThNextUnread = 0xFE74; +const gkey KK_ReadIncreaseMargin = 0xFF75; +const gkey KK_ReadLookupDest = 0xFF76; +const gkey KK_ReadLookupOrig = 0xFF77; +const gkey KK_ReadMainMenu = 0xFF78; +const gkey KK_ReadMakeUserlist = 0xFF79; +const gkey KK_ReadMarkingOptions = 0xFF7A; const gkey KK_ReadMessageList = 0xFF7B; const gkey KK_ReadMakePathreport = 0xFF7C; const gkey KK_ReadMoveCommentMsg = 0xFF7D; @@ -298,6 +333,7 @@ const gkey KK_ReadQuoteMsg = 0xFF8A; const gkey KK_ReadReplyMsg = 0xFF8B; const gkey KK_ReadSearch = 0xFF8C; const gkey KK_ReadSoundkill = 0xFF8D; + // = 0xFE8E; const gkey KK_ReadThreadtree = 0xFF8F; const gkey KK_ReadToggleBookMark = 0xFF90; const gkey KK_ReadToggleHexdump = 0xFF91; diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index 0245f5e..689c990 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -722,6 +722,7 @@ public: bool handle_key(); // Handles keypress void Run(); + bool GoNextUnread(bool reader); GThreadlist() { memset(&msg, 0, sizeof(GMsg)); replylinkfloat = CFG->replylinkfloat; }; ~GThreadlist() { ResetMsg(&msg); }; @@ -1260,6 +1261,58 @@ void GThreadlist::Run() { } +// ------------------------------------------------------------------ + +bool GThreadlist::GoNextUnread(bool reader) +{ + if (reader) + BuildThreadIndex(reader_msg->msgno); + + bool found = false; + size_t size = list.size(); + + if (size > 1) + { + size_t idx; + + for (idx = index + 1; idx < size; idx++) + { + t = list[idx]; + AA->LoadHdr(&msg, t.msgno); + if (msg.timesread == 0) + { + found = true; + break; + } + } + + if (!found) + { + for (idx = 0; idx < index; idx++) + { + t = list[idx]; + AA->LoadHdr(&msg, t.msgno); + if (msg.timesread == 0) + { + found = true; + break; + } + } + } + + if (found) + { + index = idx; + + if (reader) + AA->set_lastread(AA->Msgn.ToReln(list[idx].msgno)); + } + } + + return found; +} + + // ------------------------------------------------------------------ void MsgThreadlist() { @@ -1271,4 +1324,22 @@ void MsgThreadlist() { } +// ------------------------------------------------------------------ + +void GotoThNextUnread() +{ + w_info(LNG->Wait); + reader_direction = DIR_NEXT; + + GThreadlist p; + if (!p.GoNextUnread(true)) + { + SayBibi(); + reader_keyok = true; + } + + w_info(NULL); +} + + // ------------------------------------------------------------------ diff --git a/golded3/geprot.h b/golded3/geprot.h index efbc4c0..9d18d92 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -322,6 +322,7 @@ void GotoReplies(); void GotoReply1st(); void GotoReplyNext(); void GotoReplyPrev(); +void GotoThNextUnread(); void IncMargin(); void MakeUserList(); void MakePathreport(); diff --git a/golded3/geread.cpp b/golded3/geread.cpp index 6cf5649..b1a7a46 100644 --- a/golded3/geread.cpp +++ b/golded3/geread.cpp @@ -673,6 +673,10 @@ void Reader() { GotoPrevUnread(); break; + case KK_ReadGotoThNextUnread: + GotoThNextUnread(); + break; + case KK_ReadShowHiddKlud: if(not AA->Viewhidden() and not AA->Viewkludge()) ToggleHiddKlud();