Stylecodes now may be used in random system groups. Patch from Ianos Gnatiuc 2:5030/830.17

This commit is contained in:
Stas Degteff 2005-10-03 16:55:00 +00:00
parent 9cc99a0265
commit 49294f1f56
11 changed files with 51 additions and 31 deletions

View File

@ -2285,6 +2285,7 @@ EndGroup
// QuoteChars // QuoteChars
// QuoteString // QuoteString
// SearchFor // SearchFor
// StyleCodes
// Tagline // Tagline
// TaglineChar // TaglineChar
// TaglineFile // TaglineFile

View File

@ -10,6 +10,8 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/ Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________ ______________________________________________________________________
+ Stylecodes now may be used in random system groups.
+ New color config file item: "COLOR HEADER LOCATION". This is used for define + New color config file item: "COLOR HEADER LOCATION". This is used for define
colors of the originate node location information (see DISPHDRLOCATION and colors of the originate node location information (see DISPHDRLOCATION and
LOCATIONALIAS). LOCATIONALIAS).

View File

@ -88,13 +88,22 @@ void CfgStylecodepunct() {
void CfgStylecodes() { void CfgStylecodes() {
if(strieql(val, "HIDE")) { bool flag1 = false, flag2;
CFG->hidestylies = true;
CFG->usestylies = true; if (strieql(val, "HIDE"))
flag1 = flag2 = true;
else
flag2 = GetYesno(val);
if (cfgingroup)
{
CFG->grp.AddItm(GRP_HIDESTYLIES, flag1);
CFG->grp.AddItm(GRP_USESTYLIES, flag2);
} }
else { else
CFG->hidestylies = false; {
CFG->usestylies = GetYesno(val); CFG->hidestylies = flag1;
CFG->usestylies = flag2;
} }
} }

View File

@ -91,7 +91,7 @@ void Container::StyleCodeHighlight(const char* text, int row, int col, bool dohi
char* punctchars = CFG->stylecodepunct; char* punctchars = CFG->stylecodepunct;
char* stylestopchars = CFG->stylecodestops; char* stylestopchars = CFG->stylecodestops;
char prevchar = ' '; char prevchar = ' ';
bool usestylies = dohide or CFG->usestylies; bool usestylies = dohide or AA->adat->usestylies;
if(usestylies or CFG->highlighturls) { if(usestylies or CFG->highlighturls) {
while(*ptr) { while(*ptr) {

View File

@ -293,12 +293,12 @@ void IEclass::dispstring(const char* __string, uint __row, int attr, Line* line)
savechar = _buf[endblock]; savechar = _buf[endblock];
_buf[endblock] = NUL; _buf[endblock] = NUL;
bool oldusestylies = CFG->usestylies; bool oldusestylies = AA->adat->usestylies;
bool oldhighlighturls = CFG->highlighturls; bool oldhighlighturls = CFG->highlighturls;
CFG->usestylies = false; AA->adat->usestylies = false;
CFG->highlighturls = false; CFG->highlighturls = false;
StyleCodeHighlight(_buf+begblock, __row, mincol+begblock, false, C_READA); StyleCodeHighlight(_buf+begblock, __row, mincol+begblock, false, C_READA);
CFG->usestylies = oldusestylies; AA->adat->usestylies = oldusestylies;
CFG->highlighturls = oldhighlighturls; CFG->highlighturls = oldhighlighturls;
_buf[endblock] = savechar; _buf[endblock] = savechar;
StyleCodeHighlight(_buf+endblock, __row, mincol+endblock, false, attr); StyleCodeHighlight(_buf+endblock, __row, mincol+endblock, false, attr);
@ -308,32 +308,32 @@ void IEclass::dispstring(const char* __string, uint __row, int attr, Line* line)
char savechar = _buf[blockmark]; char savechar = _buf[blockmark];
_buf[blockmark] = NUL; _buf[blockmark] = NUL;
bool oldusestylies = CFG->usestylies; bool oldusestylies = AA->adat->usestylies;
bool oldhighlighturls = CFG->highlighturls; bool oldhighlighturls = CFG->highlighturls;
if(selected) { if(selected) {
CFG->usestylies = false; AA->adat->usestylies = false;
CFG->highlighturls = false; CFG->highlighturls = false;
} }
StyleCodeHighlight(_buf, __row, mincol, false, selected ? C_READA : attr); StyleCodeHighlight(_buf, __row, mincol, false, selected ? C_READA : attr);
CFG->usestylies = oldusestylies; AA->adat->usestylies = oldusestylies;
_buf[blockmark] = savechar; _buf[blockmark] = savechar;
if(not selected) { if(not selected) {
CFG->usestylies = false; AA->adat->usestylies = false;
CFG->highlighturls = false; CFG->highlighturls = false;
} }
StyleCodeHighlight(_buf+blockmark, __row, mincol+blockmark, false, selected ? attr : C_READA); StyleCodeHighlight(_buf+blockmark, __row, mincol+blockmark, false, selected ? attr : C_READA);
CFG->usestylies = oldusestylies; AA->adat->usestylies = oldusestylies;
CFG->highlighturls = oldhighlighturls; CFG->highlighturls = oldhighlighturls;
} }
else { else {
bool oldusestylies = CFG->usestylies; bool oldusestylies = AA->adat->usestylies;
bool oldhighlighturls = CFG->highlighturls; bool oldhighlighturls = CFG->highlighturls;
if(selected) { if(selected) {
CFG->usestylies = false; AA->adat->usestylies = false;
CFG->highlighturls = false; CFG->highlighturls = false;
} }
StyleCodeHighlight(_buf, __row, mincol, false, selected ? C_READA : attr); StyleCodeHighlight(_buf, __row, mincol, false, selected ? C_READA : attr);
CFG->usestylies = oldusestylies; AA->adat->usestylies = oldusestylies;
CFG->highlighturls = oldhighlighturls; CFG->highlighturls = oldhighlighturls;
} }
} }

View File

@ -140,6 +140,8 @@ void Area::InitData() {
adat->edithardterm = EDIT->HardTerm(); adat->edithardterm = EDIT->HardTerm();
adat->editmixcase = EDIT->MixCase(); adat->editmixcase = EDIT->MixCase();
adat->forcetemplate = CFG->forcetemplate; adat->forcetemplate = CFG->forcetemplate;
adat->hidestylies = CFG->hidestylies;
adat->usestylies = CFG->usestylies;
strcpy(adat->inputfile, CFG->inputfile); strcpy(adat->inputfile, CFG->inputfile);
strcpy(adat->internetaddress, CFG->internetaddress); strcpy(adat->internetaddress, CFG->internetaddress);
memcpy(&adat->internetgate, &CFG->internetgate, sizeof(Node)); memcpy(&adat->internetgate, &CFG->internetgate, sizeof(Node));
@ -292,6 +294,8 @@ void Area::RandomizeData(int mode) {
CFG->grp.GetItm(GRP_EDITMIXCASE, adat->editmixcase); CFG->grp.GetItm(GRP_EDITMIXCASE, adat->editmixcase);
CFG->grp.GetItm(GRP_EDITREPLYRE, adat->replyre); CFG->grp.GetItm(GRP_EDITREPLYRE, adat->replyre);
CFG->grp.GetItm(GRP_FORCETEMPLATE, adat->forcetemplate); CFG->grp.GetItm(GRP_FORCETEMPLATE, adat->forcetemplate);
CFG->grp.GetItm(GRP_HIDESTYLIES, adat->hidestylies);
CFG->grp.GetItm(GRP_USESTYLIES, adat->usestylies);
CFG->grp.GetItm(GRP_INPUTFILE, adat->inputfile, sizeof(adat->inputfile)); CFG->grp.GetItm(GRP_INPUTFILE, adat->inputfile, sizeof(adat->inputfile));
CFG->grp.GetItm(GRP_INTERNETADDRESS, adat->internetaddress, sizeof(adat->internetaddress)); CFG->grp.GetItm(GRP_INTERNETADDRESS, adat->internetaddress, sizeof(adat->internetaddress));
CFG->grp.GetItm(GRP_INTERNETGATE, &adat->internetgate, sizeof(Node)); CFG->grp.GetItm(GRP_INTERNETGATE, &adat->internetgate, sizeof(Node));

View File

@ -491,24 +491,24 @@ void Reader() {
break; break;
case KK_ReadStylesNone: case KK_ReadStylesNone:
if(CFG->usestylies or CFG->hidestylies) if (AA->adat->usestylies or AA->adat->hidestylies)
CFG->usestylies = CFG->hidestylies = false; AA->adat->usestylies = AA->adat->hidestylies = false;
else else
reader_keyok = true; reader_keyok = true;
break; break;
case KK_ReadStylesShow: case KK_ReadStylesShow:
if(not CFG->usestylies or CFG->hidestylies) { if (not AA->adat->usestylies or AA->adat->hidestylies) {
CFG->usestylies = true; AA->adat->usestylies = true;
CFG->hidestylies = false; AA->adat->hidestylies = false;
} }
else else
reader_keyok = true; reader_keyok = true;
break; break;
case KK_ReadStylesStrip: case KK_ReadStylesStrip:
if(not CFG->usestylies or not CFG->hidestylies) if (not AA->adat->usestylies or not AA->adat->hidestylies)
CFG->usestylies = CFG->hidestylies = true; AA->adat->usestylies = AA->adat->hidestylies = true;
else else
reader_keyok = true; reader_keyok = true;
break; break;

View File

@ -253,7 +253,7 @@ void ToggleTwits() {
void ToggleStyles() { void ToggleStyles() {
gkey k; gkey k;
int setting = CFG->usestylies + CFG->hidestylies*2; int setting = AA->adat->usestylies + AA->adat->hidestylies*2;
do { do {
switch(setting) { switch(setting) {
@ -267,8 +267,8 @@ void ToggleStyles() {
w_info(NULL); w_info(NULL);
if(k != Key_Esc) { if(k != Key_Esc) {
CFG->usestylies = (setting & 1) ? true : false; AA->adat->usestylies = (setting & 1) ? true : false;
CFG->hidestylies = (setting & 2) ? true : false; AA->adat->hidestylies = (setting & 2) ? true : false;
} }
} }

View File

@ -464,10 +464,10 @@ void GMsgBodyView::PaintLine(int row, Line *line) {
if(not SearchHighlight(line, vrow, visible_width, highlight_color)) { if(not SearchHighlight(line, vrow, visible_width, highlight_color)) {
if(line->type & GLINE_ORIG and strneql(line->txt.c_str(), " * Origin: ", 11)) { if(line->type & GLINE_ORIG and strneql(line->txt.c_str(), " * Origin: ", 11)) {
vputs(vrow, 0, color, " * Origin: "); vputs(vrow, 0, color, " * Origin: ");
StyleCodeHighlight(line->txt.c_str()+11, vrow, 11, not AA->attr().hex() and CFG->hidestylies, color); StyleCodeHighlight(line->txt.c_str()+11, vrow, 11, not AA->attr().hex() and AA->adat->hidestylies, color);
} }
else else
StyleCodeHighlight(line->txt.c_str(), vrow, 0, not AA->attr().hex() and CFG->hidestylies, color); StyleCodeHighlight(line->txt.c_str(), vrow, 0, not AA->attr().hex() and AA->adat->hidestylies, color);
int tlen = strlen(line->txt.c_str()); int tlen = strlen(line->txt.c_str());
vputns(vrow, tlen, color, "", visible_width-tlen); vputns(vrow, tlen, color, "", visible_width-tlen);
} }

View File

@ -278,6 +278,8 @@ struct AreaData {
bool edithardterm; bool edithardterm;
bool editmixcase; bool editmixcase;
bool forcetemplate; bool forcetemplate;
bool hidestylies;
bool usestylies;
IAdr internetaddress; IAdr internetaddress;
Node internetgate; Node internetgate;
bool internetmsgid; bool internetmsgid;

View File

@ -61,6 +61,8 @@ enum {
GRP_EDITMIXCASE, GRP_EDITMIXCASE,
GRP_EDITREPLYRE, GRP_EDITREPLYRE,
GRP_FORCETEMPLATE, GRP_FORCETEMPLATE,
GRP_HIDESTYLIES,
GRP_USESTYLIES,
GRP_INPUTFILE, GRP_INPUTFILE,
GRP_INTERNETADDRESS, GRP_INTERNETADDRESS,
GRP_INTERNETGATE, GRP_INTERNETGATE,
@ -128,7 +130,7 @@ private:
TYPE_INT, TYPE_INT,
TYPE_STRING, TYPE_STRING,
TYPE_OBJECT TYPE_OBJECT
}; };
int type; int type;
union { union {