new reader key readfindnext added

This commit is contained in:
Ianos Gnatiuc 2005-10-06 22:15:17 +00:00
parent 7c5e65cfcd
commit d52a0df653
10 changed files with 63 additions and 13 deletions

View File

@ -318,6 +318,7 @@ F READfindall
Z READfindheader Z READfindheader
@Z READfindheader @Z READfindheader
F6 READfindheader F6 READfindheader
^F6 READfindnext
#Tab READgotobookmark #Tab READgotobookmark
BackSpace READgotobookmark BackSpace READgotobookmark
< READgotofirstmsg < READgotofirstmsg

View File

@ -316,6 +316,7 @@ F READfindall
Z READfindheader Z READfindheader
@Z READfindheader @Z READfindheader
F6 READfindheader F6 READfindheader
^F6 READfindnext
#Tab READgotobookmark #Tab READgotobookmark
BackSpace READgotobookmark BackSpace READgotobookmark
- READgotoreplyprev - READgotoreplyprev

View File

@ -10,6 +10,10 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ New reader key READfindnext (default: ^F6) added.
READfindall and READfindheader will not search from next message,
use READfindnext instead.
+ Win32 version: pressing SHIFT+EditGo* keys will work as EditBlock* keys + Win32 version: pressing SHIFT+EditGo* keys will work as EditBlock* keys
! Added Microsoft Developer Studio 6.0 Workspace and GoldEd Project files ! Added Microsoft Developer Studio 6.0 Workspace and GoldEd Project files

View File

@ -986,6 +986,7 @@ Area::Area(gmo_area* a) {
isscanned = false; isscanned = false;
ispmscanned = false; ispmscanned = false;
istossed = false; istossed = false;
findfirst = true;
} }

View File

@ -223,6 +223,7 @@ CmdKey DefaultKeyset[] = {
{ Key_Z , KK_ReadFindHeader , KT_R }, { Key_Z , KK_ReadFindHeader , KT_R },
{ Key_A_Z , KK_ReadFindHeader , KT_R }, { Key_A_Z , KK_ReadFindHeader , KT_R },
{ Key_F6 , KK_ReadFindHeader , KT_R }, { Key_F6 , KK_ReadFindHeader , KT_R },
{ Key_C_F6 , KK_ReadFindNext , KT_R },
{ Key_S_Tab , KK_ReadGotoBookMark , KT_R }, { Key_S_Tab , KK_ReadGotoBookMark , KT_R },
{ Key_BS , KK_ReadGotoBookMark , KT_R }, { Key_BS , KK_ReadGotoBookMark , KT_R },
{ Key_Lsr , KK_ReadGotoFirstMsg , KT_R }, { Key_Lsr , KK_ReadGotoFirstMsg , KT_R },
@ -654,6 +655,7 @@ tglobalkey globalkeys[] = {
{ CRC_K_CEND , Key_C_End , 0 }, // 0x7B95 { CRC_K_CEND , Key_C_End , 0 }, // 0x7B95
{ CRC_READSTYLESSHOW , KK_ReadStylesShow , KT_R }, // 0x7D0D { CRC_READSTYLESSHOW , KK_ReadStylesShow , KT_R }, // 0x7D0D
{ CRC_K_APGUP , Key_A_PgUp , 0 }, // 0x7E61 { CRC_K_APGUP , Key_A_PgUp , 0 }, // 0x7E61
{ CRC_READFINDNEXT , KK_ReadFindNext , KT_R }, // 0x8082
{ CRC_EDITQUITNOW , KK_EditQuitNow , KT_E }, // 0x80BA { CRC_EDITQUITNOW , KK_EditQuitNow , KT_E }, // 0x80BA
{ CRC_LISTMARKINGOPTIONS , KK_ListMarkingOptions , KT_M }, // 0x8138 { CRC_LISTMARKINGOPTIONS , KK_ListMarkingOptions , KT_M }, // 0x8138
{ CRC_EDITZAPQUOTEBELOW , KK_EditZapQuoteBelow , KT_E }, // 0x814F { CRC_EDITZAPQUOTEBELOW , KK_EditZapQuoteBelow , KT_E }, // 0x814F

View File

@ -228,6 +228,7 @@ const word CRC_READFIDORENUMBER = 0x1E7C;
const word CRC_READFILEREQUEST = 0x0A07; const word CRC_READFILEREQUEST = 0x0A07;
const word CRC_READFINDALL = 0xEF19; const word CRC_READFINDALL = 0xEF19;
const word CRC_READFINDHEADER = 0x6343; const word CRC_READFINDHEADER = 0x6343;
const word CRC_READFINDNEXT = 0x8082;
const word CRC_READGOTOBOOKMARK = 0x4383; const word CRC_READGOTOBOOKMARK = 0x4383;
const word CRC_READGOTOFIRSTMSG = 0x392F; const word CRC_READGOTOFIRSTMSG = 0x392F;
const word CRC_READGOTOLASTMSG = 0x9E72; const word CRC_READGOTOLASTMSG = 0x9E72;

View File

@ -40,13 +40,20 @@ void FindAll(GMsg* msg, int& topline, int& keyok) {
if(AA->Msgn.Count()) { if(AA->Msgn.Count()) {
topline = 0; topline = 0;
AA->attr().hex0(); AA->attr().hex0();
if (AA->get_findfirst())
{
strcpy(CFG->searchfor, AA->Searchfor()); strcpy(CFG->searchfor, AA->Searchfor());
if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderText, H_FindString)) { if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderText, H_FindString)) {
AA->SetSearchfor(CFG->searchfor); AA->SetSearchfor(CFG->searchfor);
if(FindString(msg, AA->Searchfor(), GFIND_HDRTXT)) if(FindString(msg, AA->Searchfor(), GFIND_HDRTXT))
keyok = true; keyok = true;
AA->set_findfirst(false);
} }
} }
else if(FindString(msg, AA->Searchfor(), GFIND_HDRTXT))
keyok = true;
}
} }
@ -57,13 +64,20 @@ void FindHdr(GMsg* msg, int& topline, int& keyok) {
if(AA->Msgn.Count()) { if(AA->Msgn.Count()) {
topline = 0; topline = 0;
AA->attr().hex0(); AA->attr().hex0();
if (AA->get_findfirst())
{
strcpy(CFG->searchfor, AA->Searchfor()); strcpy(CFG->searchfor, AA->Searchfor());
if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderOnly, H_FindString)) { if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderOnly, H_FindString)) {
AA->SetSearchfor(CFG->searchfor); AA->SetSearchfor(CFG->searchfor);
if(FindString(msg, AA->Searchfor(), GFIND_HDR)) if(FindString(msg, AA->Searchfor(), GFIND_HDR))
keyok = true; keyok = true;
AA->set_findfirst(false);
} }
} }
else if(FindString(msg, AA->Searchfor(), GFIND_HDR))
keyok = true;
}
} }
@ -102,15 +116,17 @@ bool FindString(GMsg* msg, const char* prompt, int what) {
update_statuslinef(LNG->ReadingMsg, AA->lastread(), AA->Msgn.Count()); update_statuslinef(LNG->ReadingMsg, AA->lastread(), AA->Msgn.Count());
w_progress(MODE_UPDATE, C_INFOW, AA->lastread(), AA->Msgn.Count(), LNG->AdvancedSearch); w_progress(MODE_UPDATE, C_INFOW, AA->lastread(), AA->Msgn.Count(), LNG->AdvancedSearch);
bool success = false;
if(AA->LoadMsg(msg, AA->Msgn.CvtReln(AA->lastread()), margin)) { if(AA->LoadMsg(msg, AA->Msgn.CvtReln(AA->lastread()), margin)) {
bool success;
// If hit, search again current mail without shortcircuit evaluation // If hit, search again current mail without shortcircuit evaluation
success = srchmgr.search(msg, false, true); success = srchmgr.search(msg, false, true);
if(success) if(success)
srchmgr.search(msg, false, false); srchmgr.search(msg, false, false);
if((srchmgr.reverse ? not success : success) and (lastfound != msg->msgno)) { if(((srchmgr.reverse ? !success : success) && (lastfound != msg->msgno))
|| (success && AA->get_findfirst()))
{
bool istwitto, istwitsubj; bool istwitto, istwitsubj;
if(MsgIsTwit(msg, istwitto, istwitsubj) != TWIT_SKIP) { if(MsgIsTwit(msg, istwitto, istwitsubj) != TWIT_SKIP) {
HandleGEvent(EVTT_SEARCHSUCCESS); HandleGEvent(EVTT_SEARCHSUCCESS);

View File

@ -342,6 +342,7 @@ const gkey KK_ReadShowHTML = 0xFFBB;
const gkey KK_ReadToggleHTML = 0xFFBC; const gkey KK_ReadToggleHTML = 0xFFBC;
const gkey KK_ReadShowQuote = 0xFFBD; const gkey KK_ReadShowQuote = 0xFFBD;
const gkey KK_ReadHideQuote = 0xFFBE; const gkey KK_ReadHideQuote = 0xFFBE;
const gkey KK_ReadFindNext = 0xFFBF;
const gkey KK_HeaderAddressbook = 0xFFC0; const gkey KK_HeaderAddressbook = 0xFFC0;
const gkey KK_HeaderLookup = 0xFFC1; const gkey KK_HeaderLookup = 0xFFC1;

View File

@ -809,13 +809,29 @@ void Reader() {
break; break;
case KK_ReadFindAll: case KK_ReadFindAll:
AA->set_findfirst(true);
AA->set_findtype(1);
FindAll(msg, reader_topline, reader_keyok); FindAll(msg, reader_topline, reader_keyok);
break; break;
case KK_ReadFindHeader: case KK_ReadFindHeader:
AA->set_findfirst(true);
AA->set_findtype(2);
FindHdr(msg, reader_topline, reader_keyok); FindHdr(msg, reader_topline, reader_keyok);
break; break;
case KK_ReadFindNext:
if (!AA->get_findfirst())
{
if (AA->get_findtype() == 1)
FindAll(msg, reader_topline, reader_keyok);
else
FindHdr(msg, reader_topline, reader_keyok);
}
else
reader_keyok = false;
break;
case KK_ReadSearch: case KK_ReadSearch:
AdvancedSearch(msg, reader_topline, reader_keyok); AdvancedSearch(msg, reader_topline, reader_keyok);
break; break;

View File

@ -345,6 +345,8 @@ class Area {
private: private:
bool findfirst;
uint findtype; //1 - FindAll, 2 - FindHdr
word marks; // storing 16 different marks word marks; // storing 16 different marks
friend class AreaList; friend class AreaList;
@ -382,6 +384,11 @@ public:
void set_lastread(uint lr); void set_lastread(uint lr);
void set_findfirst(bool ff) { findfirst = ff; }
void set_findtype(uint ft) { findtype = ft; }
bool get_findfirst() { return findfirst; }
uint get_findtype() { return findtype; }
bool isopen() { return area->isopen; } bool isopen() { return area->isopen; }
bool isunreadchg : 1; // TRUE if unread was changed since last scan bool isunreadchg : 1; // TRUE if unread was changed since last scan