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
F6 READfindheader
^F6 READfindnext
#Tab READgotobookmark
BackSpace READgotobookmark
< READgotofirstmsg

View File

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

View File

@ -10,6 +10,10 @@ ______________________________________________________________________
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
! Added Microsoft Developer Studio 6.0 Workspace and GoldEd Project files

View File

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

View File

@ -223,6 +223,7 @@ CmdKey DefaultKeyset[] = {
{ Key_Z , KK_ReadFindHeader , KT_R },
{ Key_A_Z , 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_BS , KK_ReadGotoBookMark , KT_R },
{ Key_Lsr , KK_ReadGotoFirstMsg , KT_R },
@ -654,6 +655,7 @@ tglobalkey globalkeys[] = {
{ CRC_K_CEND , Key_C_End , 0 }, // 0x7B95
{ CRC_READSTYLESSHOW , KK_ReadStylesShow , KT_R }, // 0x7D0D
{ CRC_K_APGUP , Key_A_PgUp , 0 }, // 0x7E61
{ CRC_READFINDNEXT , KK_ReadFindNext , KT_R }, // 0x8082
{ CRC_EDITQUITNOW , KK_EditQuitNow , KT_E }, // 0x80BA
{ CRC_LISTMARKINGOPTIONS , KK_ListMarkingOptions , KT_M }, // 0x8138
{ 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_READFINDALL = 0xEF19;
const word CRC_READFINDHEADER = 0x6343;
const word CRC_READFINDNEXT = 0x8082;
const word CRC_READGOTOBOOKMARK = 0x4383;
const word CRC_READGOTOFIRSTMSG = 0x392F;
const word CRC_READGOTOLASTMSG = 0x9E72;

View File

@ -40,12 +40,19 @@ void FindAll(GMsg* msg, int& topline, int& keyok) {
if(AA->Msgn.Count()) {
topline = 0;
AA->attr().hex0();
strcpy(CFG->searchfor, AA->Searchfor());
if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderText, H_FindString)) {
AA->SetSearchfor(CFG->searchfor);
if(FindString(msg, AA->Searchfor(), GFIND_HDRTXT))
keyok = true;
if (AA->get_findfirst())
{
strcpy(CFG->searchfor, AA->Searchfor());
if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderText, H_FindString)) {
AA->SetSearchfor(CFG->searchfor);
if(FindString(msg, AA->Searchfor(), GFIND_HDRTXT))
keyok = true;
AA->set_findfirst(false);
}
}
else if(FindString(msg, AA->Searchfor(), GFIND_HDRTXT))
keyok = true;
}
}
@ -57,12 +64,19 @@ void FindHdr(GMsg* msg, int& topline, int& keyok) {
if(AA->Msgn.Count()) {
topline = 0;
AA->attr().hex0();
strcpy(CFG->searchfor, AA->Searchfor());
if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderOnly, H_FindString)) {
AA->SetSearchfor(CFG->searchfor);
if(FindString(msg, AA->Searchfor(), GFIND_HDR))
keyok = true;
if (AA->get_findfirst())
{
strcpy(CFG->searchfor, AA->Searchfor());
if(edit_string(CFG->searchfor, sizeof(INam), LNG->HeaderOnly, H_FindString)) {
AA->SetSearchfor(CFG->searchfor);
if(FindString(msg, AA->Searchfor(), GFIND_HDR))
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());
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)) {
bool success;
// If hit, search again current mail without shortcircuit evaluation
success = srchmgr.search(msg, false, true);
if(success)
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;
if(MsgIsTwit(msg, istwitto, istwitsubj) != TWIT_SKIP) {
HandleGEvent(EVTT_SEARCHSUCCESS);

View File

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

View File

@ -809,13 +809,29 @@ void Reader() {
break;
case KK_ReadFindAll:
AA->set_findfirst(true);
AA->set_findtype(1);
FindAll(msg, reader_topline, reader_keyok);
break;
case KK_ReadFindHeader:
AA->set_findfirst(true);
AA->set_findtype(2);
FindHdr(msg, reader_topline, reader_keyok);
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:
AdvancedSearch(msg, reader_topline, reader_keyok);
break;

View File

@ -345,7 +345,9 @@ class Area {
private:
word marks; // storing 16 different marks
bool findfirst;
uint findtype; //1 - FindAll, 2 - FindHdr
word marks; // storing 16 different marks
friend class AreaList;
@ -382,6 +384,11 @@ public:
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 isunreadchg : 1; // TRUE if unread was changed since last scan