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

@@ -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