This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
deb-goldedplus/golded3/gccfgg3.cpp

373 lines
8.2 KiB
C++
Raw Normal View History

2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
// GoldED+
// Copyright (C) 1990-1999 Odinn Sorensen
// Copyright (C) 1999-2000 Alexander S. Aganichev
// ------------------------------------------------------------------
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License as
// published by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston,
// MA 02111-1307 USA
// ------------------------------------------------------------------
// $Id$
// ------------------------------------------------------------------
// Configuration functions, part 3.
// ------------------------------------------------------------------
#include <golded.h>
#include <gcprot.h>
// ------------------------------------------------------------------
extern char* val;
// ------------------------------------------------------------------
void CfgDispmargin() {
2001-08-07 10:51:00 +00:00
CFG->dispmargin = atoi(val);
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgDispmsgsize() {
if(strieql("NO", val))
CFG->dispmsgsize = NO;
else if(strieql("BYTES", val))
CFG->dispmsgsize = DISPMSGSIZE_BYTES;
else if(strieql("KBYTES", val))
CFG->dispmsgsize = DISPMSGSIZE_KBYTES;
else if(strieql("LINES", val))
2001-03-03 13:16:14 +00:00
CFG->dispmsgsize = DISPMSGSIZE_LINES;
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgDispareano() {
CFG->dispareano = GetYesno(val);
}
// ------------------------------------------------------------------
2005-10-04 20:58:47 +00:00
void CfgDisppmfirst() {
2005-10-22 02:45:18 +00:00
CFG->disppmfirst = make_bool(GetYesno(val));
2005-10-04 20:58:47 +00:00
}
// ------------------------------------------------------------------
2000-02-25 11:04:07 +00:00
void CfgDisptabsize() {
CFG->disptabsize = atoi(val);
}
// ------------------------------------------------------------------
void CfgEditautoattach() {
2005-10-22 02:45:18 +00:00
EDIT->AutoAttach(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEditautosave() {
EDIT->AutoSave(atoi(val));
}
// ------------------------------------------------------------------
void CfgEditchangedate() {
EDIT->ChangeDate(GetYesno(val));
}
// ------------------------------------------------------------------
void CfgEditcharpara() {
char ch = *StripQuotes(val);
if(ch)
EDIT->CharPara(ch);
}
// ------------------------------------------------------------------
void CfgEditcharspace() {
char ch = *StripQuotes(val);
if(ch)
EDIT->CharSpace(ch);
}
// ------------------------------------------------------------------
void CfgEditcomment() {
char* key;
getkeyval(&key, &val);
StripQuotes(key);
StripQuotes(val);
EDIT->Comment.Add(key, val);
}
// ------------------------------------------------------------------
void CfgEditcompletion() {
char* key;
getkeyval(&key, &val);
StripQuotes(key);
StripQuotes(val);
EDIT->Completion.Add(key, val);
}
// ------------------------------------------------------------------
void CfgEditcrlfterm() {
2005-10-22 02:45:18 +00:00
EDIT->CrLfTerm(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEditfieldclear() {
2005-10-22 02:45:18 +00:00
EDIT->FieldClear(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEdithardline() {
EDIT->HardLine(StripQuotes(val));
}
// ------------------------------------------------------------------
void CfgEdithardlines() {
2005-10-22 02:45:18 +00:00
EDIT->HardLines(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEdithardterm() {
2005-10-22 02:45:18 +00:00
bool flag = make_bool(GetYesno(val));
2000-02-25 11:04:07 +00:00
if(cfgingroup)
CFG->grp.AddItm(GRP_EDITHARDTERM, flag);
else
EDIT->HardTerm(flag);
}
// ------------------------------------------------------------------
void CfgEdithdrnameset() {
char* key;
getkeyval(&key, &val);
EDIT->HdrNamePos(atoi(key));
EDIT->HdrNameLen(atoi(val));
}
// ------------------------------------------------------------------
void CfgEdithdrnodeset() {
char* key;
getkeyval(&key, &val);
EDIT->HdrNodePos(atoi(key));
EDIT->HdrNodeLen(atoi(val));
}
// ------------------------------------------------------------------
void CfgEditheaderattrs() {
2005-10-22 02:45:18 +00:00
EDIT->HeaderAttrs(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEditheaderfirst() {
int v = EDITHEADERFIRST_NO;
GTok t;
if(t.First(val)) {
do {
if(strieql("NEW", t.Token()))
v |= EDITHEADERFIRST_NEW;
else if(strieql("CHANGES", t.Token()))
v |= EDITHEADERFIRST_CHANGES;
else if(strieql("REPLIES", t.Token()))
v |= EDITHEADERFIRST_REPLIES;
else if(strieql("FORWARDS", t.Token()))
v |= EDITHEADERFIRST_FORWARDS;
else
v = GetYesno(t.Token()) ? EDITHEADERFIRST_YES : EDITHEADERFIRST_NO;
} while(t.Next());
}
EDIT->HeaderFirst(v);
}
// ------------------------------------------------------------------
void CfgEditinternal() {
2005-10-22 02:45:18 +00:00
EDIT->Internal(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEditmenu() {
2005-10-22 02:45:18 +00:00
EDIT->Menu(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEditmixcase() {
2005-10-22 02:45:18 +00:00
bool flag = make_bool(GetYesno(val));
2000-02-25 11:04:07 +00:00
if(cfgingroup)
CFG->grp.AddItm(GRP_EDITMIXCASE, flag);
else
EDIT->MixCase(flag);
}
// ------------------------------------------------------------------
void CfgEditor() {
EDIT->External(val);
}
// ------------------------------------------------------------------
void CfgEditorfile() {
EDIT->File(val);
}
// ------------------------------------------------------------------
void CfgEditquotemargin() {
EDIT->QuoteMargin(atoi(val));
}
// ------------------------------------------------------------------
void CfgEditreplyre() {
int replyre;
if(strieql(val, "NUMERIC"))
replyre = REPLYRE_NUMERIC;
else
replyre = GetYesno(val) ? REPLYRE_YES : REPLYRE_NO;
if(cfgingroup)
CFG->grp.AddItm(GRP_EDITREPLYRE, replyre);
else
EDIT->ReplyRe(replyre);
}
// ------------------------------------------------------------------
void CfgEditsavemenu() {
2005-10-22 02:45:18 +00:00
EDIT->SaveMenu(make_bool(GetYesno(val)));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEditsaveutil() {
char* _key;
getkeyval(&_key, &val);
int n = atoi(_key);
EDIT->SaveUtil.Add(n, StripQuotes(val));
}
// ------------------------------------------------------------------
void CfgEditsoftcrxlat() {
EDIT->SoftCrXlat(*val);
}
// ------------------------------------------------------------------
#if defined(GCFG_NOSPELLDLL)
2000-02-25 11:04:07 +00:00
void CfgEditspellcheck() {
EDIT->SpellChecker(val);
}
#endif
2000-02-25 11:04:07 +00:00
// ------------------------------------------------------------------
void CfgEditundelete() {
EDIT->UnDelete(atoi(val));
}
// ------------------------------------------------------------------
2000-02-25 11:04:07 +00:00
void CfgEncodeemailheaders() {
2005-10-22 02:45:18 +00:00
CFG->encodeemailheaders = make_bool(GetYesno(val));
2000-02-25 11:04:07 +00:00
}
// ------------------------------------------------------------------
void CfgEndgroup() {
cfgingroup = false;
}
// ------------------------------------------------------------------
void CfgEvent(char* v) { val = v; CfgEvent(); }
void CfgEvent() {
char* key;
word x;
std::vector<GEvent>::iterator n;
2000-02-25 11:04:07 +00:00
GEvent tmp;
x = getkeyvalcrc(&key, &val);
for(n = CFG->event.begin(); n != CFG->event.end(); n++)
if(x == n->type)
break;
tmp.type = x;
getkeyval(&key, &val);
if(strieql(key, "PLAY")) {
tmp.command = EVTC_PLAY;
FileToGPlay(&tmp.play, val);
}
if(n == CFG->event.end())
CFG->event.push_back(tmp);
else
*n = tmp;
}
// ------------------------------------------------------------------