New features: ReplyLinkFloat & ReplyLinkShowAlways

This commit is contained in:
Stas Degteff 2005-09-20 18:57:30 +00:00
parent eb75fd337c
commit 5cab8ee60e
18 changed files with 99 additions and 20 deletions

View File

@ -634,6 +634,15 @@ REPLYLINK Direct ; Link directly to the original message.
;REPLYLINKLIST FAST ; Use only header/subfield data.
REPLYLINKLIST FULL ; Use full msgbody, parsing kludges, origin etc.
// Show floating replylink threads (default: yes)
;ReplyLinkFloat No
ReplyLinkFloat Yes
// For messages without replies show it's as replylink threads too
// (default: yes)
;ReplyLinkShowAlways No
ReplyLinkShowAlways Yes
----------------------------------------------------------------------
-- CARBON COPY AND CROSSPOSTING

View File

@ -704,6 +704,15 @@ ReplyLink Direct ;
;ReplyLinkList Fast ; ˆá¯®«ì§®¢ âì ⮫쪮 § £®«®¢®ª.
ReplyLinkList Full ; ˆá¯®«ì§®¢ âì ¯®«­®áâìî ¢áñ á®®¡é¥­¨¥.
// <20>®ª §ë¢ âì ¯« ¢ î騥 â।ë (¯® 㬮«ç ­¨î: yes)
;ReplyLinkFloat No
ReplyLinkFloat Yes
// <20>®ª §ë¢ âì â। ¤ ¦¥ ¢ ⮬ á«ãç ¥, ª®£¤  ã ¯¨á쬠 ­¥â ®â¢¥â®¢
// (¯® 㬮«ç ­¨î: yes)
;ReplyLinkShowAlways No
ReplyLinkShowAlways Yes
----------------------------------------------------------------------
-- ˆ<CB86>€Ÿ <20>Ž—

View File

@ -10,6 +10,11 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
+ New reply-linking features: show floating reply link threads and show
messages without replies in replylinking threads view. New config file
tokens: REPLYLINKFLOAT (yes/no), REPLYLINKSHOWALWAYS (yes/no).
(Patch from Ianos Gnatiuc 2:5030/830.17)
+ New AKA matching feature: match for "From" field then (if not matched)
match for "To" field. New config token AKAMATCHFROMTO (yes/no).
(Patch from Ianos Gnatiuc 2:5030/830.17)

View File

@ -43,11 +43,6 @@ To fix:
* UUdecoder not 100% reliable: any volunteers for uulib maintaining?
* Need some workarounds on -install feature under UNIX-like OS.
* Win32 (only when runned under Win9x) version does not support case
insensitive search of regexp's for high part of ASCII table. That's
a limitation of Microsoft C RTL, I can't do anything easy for that
but probably someday I provide a huge patch (I wonder if Microsoft
accept patches? =))...
______________________________________________________________________
Known wishes that not currently planned (any volunteers?):

View File

@ -753,7 +753,9 @@ CfgGed::CfgGed() {
quotewraphard = false;
ra2usersbbs = 0;
replylink = REPLYLINK_DIRECT;
replylinkfloat = true;
replylinklist = 0;
replylinkshowalways = true;
screenblanker = 180;
screenblankertype = BLANK_SLIDEWIN;
screenmaxcol = 0;

View File

@ -306,7 +306,9 @@ const word CRC_RCVDISABLESCFM = 0xD3B2;
const word CRC_REGISTERKEY = 0xF428;
const word CRC_REGISTERNAME = 0x2CAF;
const word CRC_REPLYLINK = 0x88A1;
const word CRC_REPLYLINKFLOAT = 0xA3EC;
const word CRC_REPLYLINKLIST = 0x104F;
const word CRC_REPLYLINKSHOWALWAYS = 0x2BCD;
const word CRC_ROBOTNAME = 0x7393;
const word CRC_SCREENBLANKER = 0x5CF7;
const word CRC_SCREENMAXCOL = 0xFFFC;

View File

@ -497,7 +497,9 @@ SwitchR:
switch(crc) {
case CRC_RA2USERSBBS : CfgRa2usersbbs (); break;
case CRC_REPLYLINK : CfgReplylink (); break;
case CRC_REPLYLINKFLOAT : CfgReplylinkfloat (); break;
case CRC_REPLYLINKLIST : CfgReplylinklist (); break;
case CRC_REPLYLINKSHOWALWAYS:CfgReplylinkshowalways();break;
case CRC_ROBOTNAME : CfgRobotname (); break;
default : found = false;
}

View File

@ -178,6 +178,13 @@ void CfgReplylink() {
// ------------------------------------------------------------------
void CfgReplylinkfloat()
{
CFG->replylinkfloat = (0 != GetYesno(val));
}
// ------------------------------------------------------------------
void CfgReplylinklist() {
if(strieql(val, "Fast"))
@ -188,6 +195,12 @@ void CfgReplylinklist() {
// ------------------------------------------------------------------
void CfgReplylinkshowalways()
{
CFG->replylinkshowalways = (0 != GetYesno(val));
}
// ------------------------------------------------------------------
void CfgRobotname(const char* v) {
char* ptr = val = throw_strdup(v);
@ -287,7 +300,7 @@ void CfgScreensize() {
// ------------------------------------------------------------------
void CfgSearchfor() {
INam buf;
strxcpy(buf, StripQuotes(val), sizeof(buf));
if(cfgingroup)
@ -444,7 +457,7 @@ void CfgSoupbadmsgs() {
// ------------------------------------------------------------------
void CfgSoupemail() {
strupr(strxcpy(CFG->soupemail, val, sizeof(Echo)));
}

View File

@ -292,7 +292,9 @@ void CfgQwkreplylinker ();
void CfgQwktosslog ();
void CfgRa2usersbbs ();
void CfgReplylink ();
void CfgReplylinkfloat ();
void CfgReplylinklist ();
void CfgReplylinkshowalways();
void CfgReplyto ();
void CfgRobotname ();
void CfgScreenblanker ();

View File

@ -540,6 +540,8 @@ void SelMaskPick::Run() {
index = position = AL.mask;
replylinkfloat = CFG->replylinkfloat;
run_picker();
if(not aborted)

View File

@ -84,6 +84,7 @@ GPickArealist::GPickArealist() {
pmscan = false;
area_fuzidx = 0;
replylinkfloat = CFG->replylinkfloat;
}

View File

@ -294,7 +294,9 @@ public:
bool quotewraphard;
int ra2usersbbs; // RA2;
int replylink;
bool replylinkfloat;
int replylinklist;
bool replylinkshowalways;
gstrarray robotname;
int screenblanker; // blanktime;
int screenblankertype;

View File

@ -98,6 +98,7 @@ public:
void gfileselect::open() {
replylinkfloat = CFG->replylinkfloat;
display_page();
}

View File

@ -97,6 +97,7 @@ public:
memset(&msg, 0, sizeof(GMsg));
mlst = NULL;
maximum_index = AA->Msgn.Count()-1;
replylinkfloat = CFG->replylinkfloat;
};
~GMsgList() {
ResetMsg(&msg);
@ -684,7 +685,6 @@ private:
GMsg msg;
std::vector<ThreadEntry> list;
ThreadEntry t;
uint h_offset;
void BuildThreadIndex(dword msgno);
void recursive_build(ulong msgn, ulong rn, ulong level);
@ -702,7 +702,7 @@ public:
void Run();
GThreadlist() { memset(&msg, 0, sizeof(GMsg)); };
GThreadlist() { memset(&msg, 0, sizeof(GMsg)); replylinkfloat = CFG->replylinkfloat; };
~GThreadlist() { ResetMsg(&msg); };
};
@ -930,6 +930,17 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
break;
}
if (CFG->replylinkfloat && isbar)
{
int l1 = strlen(buf2);
int l2 = strlen(msg.By());
if ((l1 + l2) > tdlen)
new_hoffset = (l1 + l2)-tdlen+1;
else
new_hoffset = 0;
}
if((strlen(buf2) > h_offset) and (strlen(&buf2[h_offset]) < tdlen)) {
strxcpy(buf, msg.By(), tdlen - strlen(&buf2[h_offset]));
window.prints(pos, 8+strlen(&buf2[h_offset]), isbar ? sattr : attr, buf);
@ -1022,6 +1033,7 @@ void GThreadlist::BuildThreadIndex(dword msgn) {
maximum_position = MinV((uint) list.size() - 1, (uint) ylen - 1);
index = 0;
h_offset = 0;
new_hoffset = 0;
for(uint i = 0; i<list.size(); i++) {
if(list[i].msgno == msgn)
@ -1087,7 +1099,7 @@ bool GThreadlist::handle_key() {
case KK_ListGotoPrev:
case KK_ListGotoNext:
NextThread((key == KK_ListGotoNext));
if(list.size() <= 1)
if (!CFG->replylinkshowalways && (list.size() <= 1))
return false;
center(CFG->displistcursor);
break;
@ -1194,7 +1206,7 @@ void GThreadlist::Run() {
BuildThreadIndex(reader_msg->msgno);
if(list.size() > 1)
if(CFG->replylinkshowalways || (list.size() > 1))
run_picker();
else {
w_info(LNG->NoThreadlist);

View File

@ -38,6 +38,7 @@ guserbase::guserbase() {
long tries = 0;
strcpy(fname, AddPath(CFG->goldpath, CFG->golduser));
replylinkfloat = CFG->replylinkfloat;
do {
usrbase.open(fname, O_RDWR|O_CREAT|O_BINARY, SH_DENYNO, S_STDRW);
@ -506,7 +507,7 @@ bool guserbase::read_entry(uint idx, gusrbaseentry *ent) {
clear_entry(ent);
return false;
}
else {
else {
usrbase.lseek(idx*sizeof(gusrbaseentry)+sizeof(gusrbaseheader), SEEK_SET);
usrbase.read(ent->macro, sizeof(ent->macro));
usrbase.read(ent->name, sizeof(ent->name));
@ -600,7 +601,7 @@ void guserbase::update_screen(bool force) {
need_update = false;
}
}
// ------------------------------------------------------------------
@ -634,7 +635,7 @@ bool guserbase::handle_key() {
write_entry(nidx);
index = nidx;
}
unlock();
unlock();
center(CFG->displistcursor);
}
break;
@ -719,7 +720,7 @@ bool guserbase::run(GMsg* msg, bool selectonly) {
void guserbase::update_addressbook(GMsg* msg, bool reverse, bool force) {
Addr fidoaddr;
Addr fidoaddr;
IAdr iaddr;
INam name;
@ -960,7 +961,7 @@ bool lookup_addressbook(GMsg* msg, char* name, char* aka, bool browser) {
return result;
}
// ------------------------------------------------------------------
void build_pseudo(GMsg* msg, bool direction) {
@ -972,7 +973,7 @@ void build_pseudo(GMsg* msg, bool direction) {
p.build_pseudo(msg, strbtrim(msg->To()), AA->isinternet() ? msg->iaddr : msg->dest.make_string(buf));
else
p.build_pseudo(msg, strbtrim(msg->By()), AA->isinternet() ? msg->iorig : msg->orig.make_string(buf), false);
}
}
// ------------------------------------------------------------------

View File

@ -385,8 +385,8 @@ public:
bool isscanned : 1; // TRUE if scanned
bool ispmscanned : 1; // TRUE if pmscanned
bool istossed : 1; // TRUE if msgs were tossed to this area
// ----------------------------------------------------------------
// Access config data

View File

@ -49,6 +49,8 @@ gwinpick::gwinpick() {
maximum_index = minimum_index = maximum_position = index = position = 0;
aborted = listwrap = false;
direction = 0;
replylinkfloat = 0;
}
@ -150,7 +152,7 @@ void gwinpick::cursor_pagedown() {
while(not is_selectable(max_index)) --max_index;
uint max_position = max_index - index + position;
if(position < max_position) {
if(index == max_index) {
if(maximum_position < maximum_index) {
@ -313,6 +315,18 @@ void gwinpick::display_page() {
uint n;
if (replylinkfloat)
{
if (h_offset == new_hoffset)
{
for (n=0; n<=maximum_position and n<=m; n++)
if (position == n)
print_line(index+n, n, true);
}
h_offset = new_hoffset;
}
for(n=0; n<=maximum_position and n<=m; n++)
print_line(index+n, n, (position == n));
@ -486,6 +500,9 @@ int gwinpick::run_picker() {
keyok = default_handle_key();
if (replylinkfloat && (h_offset != new_hoffset))
display_page();
} while(keyok);
#ifdef GOLD_MOUSE

View File

@ -56,6 +56,10 @@ protected:
gkey key;
bool keyok;
uint new_hoffset;
uint h_offset;
bool replylinkfloat; // in derived classes set this with CFG->replylinkfloat
// before call display_page() and run_picker()
void cursor_up();
void cursor_down();