This commit is contained in:
Alexander S. Aganichev
2001-04-15 19:24:44 +00:00
parent 54e47b7b0a
commit 4934ba030c
72 changed files with 348 additions and 348 deletions

View File

@@ -34,7 +34,7 @@
#ifndef GMB_NOEZY
#include <gmoezyc.h>
#endif
#if not defined(GMB_NOHUDS) and not defined(GMB_NOGOLD)
#if !defined(GMB_NOHUDS) && !defined(GMB_NOGOLD)
#include <gmohuds.h>
#endif
#ifndef GMB_NOJAM

View File

@@ -207,7 +207,7 @@ void AreaList::AddNewArea(AreaCfg* aa) {
#endif
#ifndef GMB_NOXBBS
case MT_ADEPTXBBS:
#if not defined(__OS2__)
#if !defined(__OS2__)
return;
#else
if(*aa->path == NUL)
@@ -224,7 +224,7 @@ void AreaList::AddNewArea(AreaCfg* aa) {
#ifndef GMB_NOJAM
case MT_JAM:
#endif
#if not defined(GMB_NOJAM) or not defined(GMB_NOSQSH)
#if !defined(GMB_NOJAM) || !defined(GMB_NOSQSH)
if(*aa->path == NUL)
return;
MapPath(aa->path);

View File

@@ -127,7 +127,7 @@ CmdKey DefaultKeyset[] = {
{ Key_C_U , KK_EditUnDelete , KT_E },
{ Key_A_BS , KK_EditUndo , KT_E },
{ Key_A_Z , KK_EditZapQuoteBelow , KT_E },
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ Key_C_Ins , KK_EditCopy , KT_E },
{ Key_S_Del , KK_EditCut , KT_E },
{ Key_C_Del , KK_EditDelete , KT_E },
@@ -366,7 +366,7 @@ tglobalkey globalkeys[] = {
{ CRC_HEADERTOGGLESCANNED , KK_HeaderToggleScanned , KT_H }, // 0x0459
{ CRC_READTOGGLEHIDDEN , KK_ReadToggleHidden , KT_R }, // 0x04CE
{ CRC_EDITIMPORTTEXT , KK_EditImportText , KT_E }, // 0x0586
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SEND , Key_S_End , 0 }, // 0x0590
#endif
{ CRC_READGOTOPREVMSG , KK_ReadGotoPrevMsg , KT_R }, // 0x06D9
@@ -413,7 +413,7 @@ tglobalkey globalkeys[] = {
{ CRC_AREAABORT , KK_AreaAbort , KT_A }, // 0x1E02
{ CRC_READTOGGLEMARK , KK_ReadToggleMark , KT_R }, // 0x1E64
{ CRC_READFIDORENUMBER , KK_ReadFidoRenumber , KT_R }, // 0x1E7C
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SDEL , Key_S_Del , 0 }, // 0x1EB9
#endif
{ CRC_EDITCOPY , KK_EditCopy , KT_E }, // 0x1F77
@@ -491,7 +491,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
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SUP , Key_S_Up , 0 }, // 0x4151
#endif
{ CRC_AREAGOTOFIRST , KK_AreaGotoFirst , KT_A }, // 0x41CB
@@ -552,7 +552,7 @@ tglobalkey globalkeys[] = {
{ CRC_EDITEXPORTTEXT , KK_EditExportText , KT_E }, // 0x5AED
{ CRC_EDITLOOKUPORIG , KK_EditLookupOrig , KT_E }, // 0x5AFB
{ CRC_AREAHEAT , KK_AreaHeat , KT_A }, // 0x5B15
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SRIGHT , Key_S_Rgt , 0 }, // 0x5B1F
#endif
{ CRC_READGOTONEXTAREA , KK_ReadGotoNextArea , KT_R }, // 0x5B23
@@ -709,12 +709,12 @@ tglobalkey globalkeys[] = {
{ CRC_READQUITNOW , KK_ReadQuitNow , KT_R }, // 0xAC15
{ CRC_HEADERTOGGLEUPDREQ , KK_HeaderToggleUpdreq , KT_H }, // 0xAC35
{ CRC_EDITDELLINE , KK_EditDelLine , KT_E }, // 0xACCF
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SPGDN , Key_S_PgDn , 0 }, // 0xAD44
#endif
{ CRC_READSOUNDKILL , KK_ReadSoundkill , KT_R }, // 0xAE29
{ CRC_LISTUNDEFINE , KK_ListUndefine , KT_M }, // 0xAF86
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SHOME , Key_S_Home , 0 }, // 0xAF9D
#endif
{ CRC_READTOGGLEQUOTE , KK_ReadToggleQuote , KT_R }, // 0xB293
@@ -728,7 +728,7 @@ tglobalkey globalkeys[] = {
{ CRC_K_CINS , Key_C_Ins , 0 }, // 0xBA0E
{ CRC_READGOTONEXTUNREAD , KK_ReadGotoNextUnread , KT_R }, // 0xBA34
{ CRC_READADDRESSBOOK , KK_ReadAddressbook , KT_R }, // 0xBAC1
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SPGUP , Key_S_PgUp , 0 }, // 0xBC5A
#endif
{ CRC_FILEABORT , KK_FileAbort , KT_F }, // 0xBCED
@@ -742,13 +742,13 @@ tglobalkey globalkeys[] = {
{ CRC_READTOGGLEROT13 , KK_ReadToggleROT13 , KT_R }, // 0xC157
{ CRC_EDITTOGGLECASE , KK_EditToggleCase , KT_E }, // 0xC282
{ CRC_FILEGOTOLAST , KK_FileGotoLast , KT_F }, // 0xC40A
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SINS , Key_S_Ins , 0 }, // 0xC40B
#endif
{ CRC_AREASCANPM , KK_AreaScanPM , KT_A }, // 0xC4FF
{ CRC_READMSGEND , KK_ReadMsgEnd , KT_R }, // 0xC5AD
{ CRC_AREATOGGLE , KK_AreaToggle , KT_A }, // 0xC734
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SLEFT , Key_S_Lft , 0 }, // 0xC902
#endif
{ CRC_HEADERTOGGLEORPHAN , KK_HeaderToggleOrphan , KT_H }, // 0xC98A
@@ -805,7 +805,7 @@ tglobalkey globalkeys[] = {
{ CRC_READGOTOPREVAREA , KK_ReadGotoPrevArea , KT_R }, // 0xEECB
{ CRC_READFINDALL , KK_ReadFindAll , KT_R }, // 0xEF19
{ CRC_NODEDOSSHELL , KK_NodeDosShell , KT_N }, // 0xF084
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
{ CRC_K_SDOWN , Key_S_Dwn , 0 }, // 0xF0FB
#endif
{ CRC_READCHANGEXLATIMPORT , KK_ReadChangeXlatImport , KT_R }, // 0xF169

View File

@@ -510,7 +510,7 @@ const word CRC_K_SPACE = 0x1281;
const word CRC_KK_MACRO = 0x4BE9;
const word CRC_KK_AUTO = 0x60E2;
#if not defined(__UNIX__) or defined(__USE_NCURSES__)
#if !defined(__UNIX__) || defined(__USE_NCURSES__)
const word CRC_K_SINS = 0xC40B;
const word CRC_K_SDEL = 0x1EB9;
const word CRC_K_SHOME = 0xAF9D;

View File

@@ -317,7 +317,7 @@ int MakeColor(char* colors) {
char* ink_;
char* paper_;
#if defined(__UNIX__) or defined(__USE_NCURSES__)
#if defined(__UNIX__) || defined(__USE_NCURSES__)
blink = 0;
#else
blink = (stridela("blinking", colors) ? 128 : 0);

View File

@@ -551,7 +551,6 @@ struct MLst {
time_t arrived;
time_t received;
char goldmark;
bool initialized;
};

View File

@@ -120,7 +120,7 @@ void Area::DeleteMsg(GMsg* msg, int direction) {
if(isnet() and isfido())
TouchNetscan(false);
if(not issmb() and not (isjam() and not CFG->switches.get(jamharddelete))) {
if(not issmb() and not iswildcat() and not (isjam() and not CFG->switches.get(jamharddelete))) {
// Remove message from internal table
Msgn.Del(msg->msgno);
}

View File

@@ -143,7 +143,7 @@ void Cleanup(void) {
freonkey(); // Free all onkeys (macros)
FreePastebuf(); // Free the internal editor cut'n'paste buffer
#if not defined(__UNIX__) and not defined(__USE_NCURSES__)
#if !defined(__UNIX__) && !defined(__USE_NCURSES__)
if(CFG->screenpalette[16])
gvid->setpalette(gvid->orig.color.palette);
@@ -286,13 +286,11 @@ int ShellToDos(char* command, char* message, int cls, int cursor, int pause) {
if(CFG->screenpalette[16])
gvid->setpalette(gvid->orig.color.palette);
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
gkbd_tty_reset();
#endif
#ifdef __USE_NCURSES__
#if defined(__USE_NCURSES__)
def_prog_mode();
reset_shell_mode();
#elif defined(__UNIX__)
gkbd_tty_reset();
#endif
// Write message on screen

View File

@@ -528,7 +528,7 @@ void CreateFileMsgs(int mode, GMsg* msg) {
);
}
sprintf(subj, "%s%s%s%s%s ", fspec[x].delsent ? "^" : "", fspec[x].path, fspec[x].fblk ? (fspec[x].fblk[m].name ? fspec[x].fblk[m].name : "") : "", *fspec[x].password ? " " : "", fspec[x].password);
#if not defined(__UNIX__)
#if !defined(__UNIX__)
strupr(subj);
#endif

View File

@@ -429,7 +429,7 @@ int EditHeaderinfo(int mode, GMsgHeaderView &view) {
vcurshow();
if(not (hedit.lookup or AA->isnet())) {
char date2[25] = {""};
char date2[25] = "";
strsetsz(date2, view.width - CFG->disphdrdateset.pos);
view.window.prints(3, CFG->disphdrdateset.pos, view.to_color, date2);
}

View File

@@ -565,7 +565,7 @@ void Initialize(int argc, char* argv[]) {
"-M Mute sounds. Disables all noises in GoldED+." << endl <<
"-N Disable share-compatible file opens during startup." << endl <<
"-NOSCAN Temporarily disable area scan during startup." << endl <<
#if defined(GUTLOS_FUNCS) and not defined(__MSDOS__)
#if defined(GUTLOS_FUNCS) && !defined(__MSDOS__)
"-P Increase program priority to run faster." << endl <<
#endif
"-S<sortspec> Sorts all mail areas according to the sort specs." << endl <<

View File

@@ -71,7 +71,7 @@ class GMsgList : public gwinpick {
gwindow window;
GMsg msg;
vector<MLst> mlst;
MLst **mlst;
uint msgmark2;
void open(); // Called after window is opened
@@ -86,8 +86,19 @@ public:
void Run();
GMsgList() { memset(&msg, 0, sizeof(GMsg)); };
~GMsgList() { ResetMsg(&msg); };
GMsgList() {
memset(&msg, 0, sizeof(GMsg));
mlst = NULL;
maximum_index = AA->Msgn.Count()-1;
};
~GMsgList() {
ResetMsg(&msg);
if(mlst) {
for(uint i=0; i<= maximum_index; i++)
throw_xdelete(mlst[i]);
throw_free(mlst);
}
};
};
@@ -113,11 +124,14 @@ void GMsgList::close() {
void GMsgList::ReadMlst(int n) {
MLst* ml = &mlst[n];
MLst* ml = mlst[n];
if(ml->initialized)
if(ml != NULL)
return;
ml = mlst[n] = new MLst;
throw_new(ml);
ml->high = 0;
strcpy(ml->marks, " ");
@@ -164,11 +178,11 @@ void GMsgList::ReadMlst(int n) {
ml->high |= MLST_HIGH_FROM;
// Highlight if unread
if(msg.timesread == 0 and CFG->switches.get(highlightunread))
if((msg.timesread == 0) and CFG->switches.get(highlightunread))
ml->high |= MLST_HIGH_UNREAD;
// Highlight if unsent
if(msg.attr.uns()and not msg.attr.rcv() and not msg.attr.del())
if(msg.attr.uns() and not msg.attr.rcv() and not msg.attr.del())
ml->high |= MLST_HIGH_UNSENT;
ml->written = msg.written;
@@ -187,8 +201,8 @@ void GMsgList::do_delayed() {
// Update header and statusline
if(AA->Msglistheader()) {
ReadMlst(index);
AA->LoadMsg(&msg, mlst[index].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
mlst[index].goldmark = goldmark;
AA->LoadMsg(&msg, mlst[index]->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar));
mlst[index]->goldmark = goldmark;
int mlstwh = whandle();
HeaderView->Use(AA, &msg);
HeaderView->Paint();
@@ -197,7 +211,7 @@ void GMsgList::do_delayed() {
if(CFG->switches.get(msglistviewsubj)) {
ReadMlst(index);
wtitle(mlst[index].re, TCENTER|TBOTTOM, tattr);
wtitle(mlst[index]->re, TCENTER|TBOTTOM, tattr);
}
if(CFG->switches.get(msglistpagebar))
@@ -243,7 +257,7 @@ void GMsgList::print_line(uint idx, uint pos, bool isbar) {
int resiz = mlst_resiz + fldadd2;
ReadMlst(idx);
MLst* ml = &mlst[idx];
MLst* ml = mlst[idx];
int wattr_, hattr_, mattr_;
if(isbar) {
@@ -379,12 +393,12 @@ bool GMsgList::handle_key() {
case KK_ListToggleMark:
{
ulong temp = AA->Mark.Find(mlst[index].msgno);
ulong temp = AA->Mark.Find(mlst[index]->msgno);
if(temp) {
AA->Mark.DelReln(temp);
}
else {
AA->Mark.Add(mlst[index].msgno);
AA->Mark.Add(mlst[index]->msgno);
}
}
if(index < maximum_index)
@@ -394,24 +408,24 @@ bool GMsgList::handle_key() {
break;
case KK_ListToggleBookMark:
if(AA->bookmark == mlst[index].msgno) {
mlst[index].marks[0] = ' ';
if(AA->bookmark == mlst[index]->msgno) {
mlst[index]->marks[0] = ' ';
AA->bookmark = 0;
mlst[index].high &= ~MLST_HIGH_BOOK;
mlst[index]->high &= ~MLST_HIGH_BOOK;
display_bar();
}
else {
long prevbm = AA->Msgn.ToReln(AA->bookmark-1);
long newbm = index;
AA->bookmark = mlst[index].msgno;
mlst[index].marks[0] = MMRK_BOOK;
mlst[index].high |= MLST_HIGH_BOOK;
AA->bookmark = mlst[index]->msgno;
mlst[index]->marks[0] = MMRK_BOOK;
mlst[index]->high |= MLST_HIGH_BOOK;
display_bar();
if(prevbm) {
if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) {
ReadMlst(prevbm);
mlst[prevbm].marks[0] = ' ';
mlst[prevbm].high &= ~MLST_HIGH_BOOK;
mlst[prevbm]->marks[0] = ' ';
mlst[prevbm]->high &= ~MLST_HIGH_BOOK;
index = prevbm;
position += prevbm - newbm;
display_line();
@@ -427,16 +441,16 @@ bool GMsgList::handle_key() {
long prevbm = AA->Msgn.ToReln(AA->bookmark-1);
long newbm = index;
index = prevbm;
AA->bookmark = mlst[newbm].msgno;
AA->bookmark = mlst[newbm]->msgno;
if(in_range((long)position + prevbm - newbm, 0l, (long)maximum_position)) {
mlst[newbm].marks[0] = MMRK_BOOK;
mlst[newbm].high |= MLST_HIGH_BOOK;
mlst[newbm]->marks[0] = MMRK_BOOK;
mlst[newbm]->high |= MLST_HIGH_BOOK;
index = newbm;
display_line();
index = prevbm;
ReadMlst(index);
mlst[index].marks[0] = ' ';
mlst[index].high &= ~MLST_HIGH_BOOK;
mlst[index]->marks[0] = ' ';
mlst[index]->high &= ~MLST_HIGH_BOOK;
position += prevbm - newbm;
display_bar();
}
@@ -506,6 +520,15 @@ bool GMsgList::handle_key() {
void GMsgList::Run() {
if(maximum_index == 0) {
aborted = true;
return;
}
index = AA->Msgn.ToReln(reader_msg->msgno)-1;
minimum_index = 0;
msgmark2 = AA->Msgn.ToReln(AA->bookmark);
ypos = AA->Msglistheader() ? 6 : 1; // Window Starting Row
xpos = 0; // Window Starting Column
ylen = MAXROW-3-ypos; // Window Height
@@ -521,11 +544,6 @@ void GMsgList::Run() {
helpcat = H_MessageBrowser; // Window Help Category
listwrap = CFG->switches.get(displistwrap);
index = AA->Msgn.ToReln(reader_msg->msgno)-1;
minimum_index = 0;
maximum_index = AA->Msgn.Count()-1;
msgmark2 = AA->Msgn.ToReln(AA->bookmark);
if(AA->Msglistdate() != MSGLISTDATE_NONE) {
if(AA->Msglistdate() != MSGLISTDATE_WRITTEN) {
if(AA->ishudson() or AA->isgoldbase() or AA->ispcboard())
@@ -540,23 +558,18 @@ void GMsgList::Run() {
fldadd1 = (MAXCOL-80)/3;
fldadd2 = (MAXCOL-80) - (fldadd1*2);
mlst.clear();
mlst = (MLst **)throw_malloc(sizeof(MLst *) * (maximum_index + 1));
MLst dummy_mlst;
dummy_mlst.initialized = false;
for(uint i=0; i<= maximum_index; i++)
mlst.push_back(dummy_mlst);
mlst[i] = NULL;
maximum_position = MinV((uint)maximum_index, (uint)ylen - 1);
if(mlst.size() != 0)
run_picker();
else
aborted = true;
run_picker();
if(not aborted) {
ReadMlst(index);
AA->set_lastread(AA->Msgn.ToReln(mlst[index].msgno));
AA->set_lastread(AA->Msgn.ToReln(mlst[index]->msgno));
}
}
@@ -766,7 +779,7 @@ void GThreadlist::print_line(uint idx, uint pos, bool isbar) {
GenTree(buf2, idx);
#if defined(__UNIX__) and not defined(__USE_NCURSES__)
#if defined(__UNIX__) && !defined(__USE_NCURSES__)
gvid_boxcvt(buf2);
#endif

View File

@@ -100,6 +100,7 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
MakeAttrStr(attr, sizeof(attr), &msg->attr);
const char *xmailer = get_informative_string();
const char *osver = ggetosstring();
time_t t = time(NULL);
struct tm* written_tm = localtime(&t);
@@ -364,6 +365,8 @@ char* TokenXlat(int mode, char* input, GMsg* msg, GMsg* oldmsg, int __origarea)
continue;
if(tokenxchg(dst, "@widepid", xmailer))
continue;
if(tokenxchg(dst, "@osver", osver))
continue;
if(tokenxchg(dst, "@osslash", __gver_platform__))
continue;
if(tokenxchg(dst, "@subject", modereptr))

View File

@@ -106,7 +106,7 @@ const char* __gver_shortver__ = __GVER_SVER__(__GVER_MAJOR__,__GVER_MINOR__,__GV
#define __GVER_SHORTPLATFORM__ "LNX"
#define __GVER_SHORTLOGNAME__ "L"
#define __GVER_CFGEXT__ ".gel"
#elif defined(__FreeBSD__) or defined(__OpenBSD__)
#elif defined(__FreeBSD__) || defined(__OpenBSD__)
#define __GVER_PLATFORM__ "/BSD"
#define __GVER_SHORTPLATFORM__ "BSD"
#define __GVER_SHORTLOGNAME__ "B"