From beaff94ac6dde1946f420d47e1909e932a86917e Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Tue, 8 Nov 2005 23:50:34 +0000 Subject: [PATCH] DispHdrLocation settings changed --- cfgs/config/advanced.cfg | 7 ++++--- cfgs/config/advanced.rus | 7 ++++--- docs/notework.txt | 4 ++++ golded3/gccfgg2.cpp | 18 ++++++++++++------ golded3/gemlst.cpp | 18 ++++++++++++++++-- golded3/geview.cpp | 2 +- 6 files changed, 41 insertions(+), 15 deletions(-) diff --git a/cfgs/config/advanced.cfg b/cfgs/config/advanced.cfg index 4ae7f59..43fd23f 100644 --- a/cfgs/config/advanced.cfg +++ b/cfgs/config/advanced.cfg @@ -243,12 +243,13 @@ DISPAREANO YES ; Only shows it if available. ;DispPmFirst No DispPmFirst Yes +// DISPHDRLOCATION (no right) // Display originator's city in delimiter line between header and message body. // Nodelist is required for this feature. If some nodelist is omitted then // Golded+ will display warning at reading each message. -// (Default:No) -;DispHdrLocation No/Yes/Right/Center -DispHdrLocation Yes +DispHdrLocation No +;DispHdrLocation Yes +;DispHdrLocation Always Center // This separate sity names in netmail areas ;LocationDelimiter " | " diff --git a/cfgs/config/advanced.rus b/cfgs/config/advanced.rus index 7a72afe..65f5140 100644 --- a/cfgs/config/advanced.rus +++ b/cfgs/config/advanced.rus @@ -214,14 +214,15 @@ DispAreaNo Yes ; ;DispPmFirst No DispPmFirst Yes +// DISPHDRLOCATION (no right) // Вывод в полоске под хедером имени города из нод- и пойнтлистов. // Если поинтовый адрес не найден, будет использован адрес ноды. // Действует только при наличии нодлиста, если один из указанных в настройке // нодлистов/пойнтлистов отсутствует, Golded+ будет при просмотре каждого // сообщения выводить информацию об отсутсвии нодлиста. -// (Значение по умолчанию: No) -;DispHdrLocation No/Yes/Right/Center -DispHdrLocation Yes +DispHdrLocation No +;DispHdrLocation Yes +;DispHdrLocation Always Center // Этим можно задать разделитель между городами отправителя и получателя // в нетмейл областях. diff --git a/docs/notework.txt b/docs/notework.txt index dbe318f..e72c90c 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,10 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +! DispHdrLocation settings changed to . + When MsgListHeader is on, location will be shown in lists only if + DispHdrLocation is 'Always'. + + Improved ColorName matching. Case insensitive wildcard matching will be used for ColorName names. Also, search will be stopped on first matched name or address. diff --git a/golded3/gccfgg2.cpp b/golded3/gccfgg2.cpp index 02d6f9e..a4ea985 100644 --- a/golded3/gccfgg2.cpp +++ b/golded3/gccfgg2.cpp @@ -487,12 +487,18 @@ void CfgDisphdrdateset() { void CfgDisphdrlocation() { - if (strieql("RIGHT", val)) - CFG->disphdrlocation = TRIGHT; - else if (strieql("CENTER", val)) - CFG->disphdrlocation = TCENTER; - else - CFG->disphdrlocation = GetYesno(val) ? TRIGHT : NO; + char* key; + getkeyval(&key, &val); + + CFG->disphdrlocation = GetYesno(key); + + if (CFG->disphdrlocation != NO) + { + if (strieql("CENTER", val)) + CFG->disphdrlocation = CFG->disphdrlocation + (TCENTER << 16); + else + CFG->disphdrlocation = CFG->disphdrlocation + (TRIGHT << 16); + } } // ------------------------------------------------------------------ diff --git a/golded3/gemlst.cpp b/golded3/gemlst.cpp index 0040407..31bc460 100644 --- a/golded3/gemlst.cpp +++ b/golded3/gemlst.cpp @@ -219,7 +219,12 @@ void GMsgList::ReadMlst(int n) { void GMsgList::do_delayed() { // Update header and statusline - if(AA->Msglistheader()) { + if(AA->Msglistheader()) + { + int disphdrlocation = CFG->disphdrlocation; + if ((CFG->disphdrlocation & 0xFFFF) == YES) + CFG->disphdrlocation = NO; + ReadMlst(index); AA->LoadMsg(&msg, mlst[index]->msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); mlst[index]->goldmark = goldmark; @@ -231,6 +236,8 @@ void GMsgList::do_delayed() { HeaderView->Use(AA, &msg); HeaderView->Paint(); wactiv_(mlstwh); + + CFG->disphdrlocation = disphdrlocation; } if(CFG->switches.get(msglistviewsubj)) { @@ -750,7 +757,12 @@ void GThreadlist::update_title() { void GThreadlist::do_delayed() { // Update header and statusline - if(AA->Msglistheader()) { + if(AA->Msglistheader()) + { + int disphdrlocation = CFG->disphdrlocation; + if ((CFG->disphdrlocation & 0xFFFF) == YES) + CFG->disphdrlocation = NO; + AA->LoadMsg(&msg, list[index].msgno, CFG->dispmargin-(int)CFG->switches.get(disppagebar)); for(std::vector::iterator x = CFG->username.begin(); x != CFG->username.end(); x++) { if(strieql(msg.By(), x->name)) { @@ -767,6 +779,8 @@ void GThreadlist::do_delayed() { HeaderView->Use(AA, &msg); HeaderView->Paint(); wactiv_(mlstwh); + + CFG->disphdrlocation = disphdrlocation; } if(CFG->switches.get(msglistviewsubj)) { diff --git a/golded3/geview.cpp b/golded3/geview.cpp index 27141d7..d96dbea 100644 --- a/golded3/geview.cpp +++ b/golded3/geview.cpp @@ -350,7 +350,7 @@ void GMsgHeaderView::Paint() { { loc += " "; int pos = window.width() - loc.length(); - pos = (CFG->disphdrlocation == TCENTER) ? pos/2 : pos-1; + pos = ((CFG->disphdrlocation >> 16) == TCENTER) ? pos/2 : pos-1; window.prints(5, pos, location_color, loc.c_str()); } }