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$
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// Menus.
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <golded.h>
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
GMsg* MenuMsgPtr;
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
void DispHeadAttrs(GMsg* msg) {
|
|
|
|
|
|
|
|
char atrs[200];
|
2001-03-03 13:16:14 +00:00
|
|
|
MakeAttrStr(atrs, sizeof(atrs), &msg->attr);
|
2000-02-25 11:04:07 +00:00
|
|
|
strsetsz(atrs, MAXCOL-CFG->disphdrnodeset.pos);
|
|
|
|
|
|
|
|
HeaderView->window.prints(1, CFG->disphdrnodeset.pos, HeaderView->window_color, atrs);
|
|
|
|
HeaderView->window.prints(4, 0, HeaderView->window_color, (msg->attr.att() or msg->attr.frq() or msg->attr.urq()) ? LNG->File : LNG->Subj);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DispHeadAttrs() {
|
|
|
|
|
|
|
|
DispHeadAttrs(MenuMsgPtr);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_pvt() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.pvtX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_received() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.rcvX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_crash() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.craX();
|
|
|
|
if(MenuMsgPtr->attr.cra())
|
|
|
|
MenuMsgPtr->attr.hld0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_hold() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.hldX();
|
|
|
|
if(MenuMsgPtr->attr.hld()) {
|
|
|
|
MenuMsgPtr->attr.cra0();
|
|
|
|
MenuMsgPtr->attr.imm0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_file() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.attX();
|
|
|
|
if(MenuMsgPtr->attr.att()) {
|
|
|
|
AttrAdd(&MenuMsgPtr->attr, &CFG->attribsattach);
|
|
|
|
MenuMsgPtr->attr.urq0();
|
|
|
|
MenuMsgPtr->attr.frq0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_freq() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.frqX();
|
|
|
|
if(MenuMsgPtr->attr.frq()) {
|
|
|
|
MenuMsgPtr->attr.att0();
|
|
|
|
MenuMsgPtr->attr.urq0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_updreq() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.urqX();
|
|
|
|
if(MenuMsgPtr->attr.urq()) {
|
|
|
|
MenuMsgPtr->attr.att0();
|
|
|
|
MenuMsgPtr->attr.frq0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_kill() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.k_sX();
|
|
|
|
if(MenuMsgPtr->attr.k_s())
|
|
|
|
MenuMsgPtr->attr.a_s0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_sent() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.sntX();
|
|
|
|
if(MenuMsgPtr->attr.snt()) {
|
|
|
|
MenuMsgPtr->attr.uns0();
|
|
|
|
MenuMsgPtr->attr.scn1();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
MenuMsgPtr->attr.uns1();
|
|
|
|
MenuMsgPtr->attr.scn0();
|
|
|
|
MenuMsgPtr->attr.loc1();
|
|
|
|
}
|
|
|
|
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_trunc() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.tfsX();
|
|
|
|
if(MenuMsgPtr->attr.tfs())
|
|
|
|
MenuMsgPtr->attr.kfs0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_delsent() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.kfsX();
|
|
|
|
if(MenuMsgPtr->attr.kfs())
|
|
|
|
MenuMsgPtr->attr.tfs0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_direct() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.dirX();
|
|
|
|
if(MenuMsgPtr->attr.dir()) {
|
|
|
|
MenuMsgPtr->attr.zon0();
|
|
|
|
MenuMsgPtr->attr.hub0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_imm() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.immX();
|
|
|
|
if(MenuMsgPtr->attr.imm())
|
|
|
|
MenuMsgPtr->attr.hld0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_locked() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.lokX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_reserved() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.rsvX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_groupmsg() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.grpX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_arcsent() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.a_sX();
|
|
|
|
if(MenuMsgPtr->attr.a_s())
|
|
|
|
MenuMsgPtr->attr.k_s0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_zonegate() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.zonX();
|
|
|
|
if(MenuMsgPtr->attr.zon()) {
|
|
|
|
MenuMsgPtr->attr.dir0();
|
|
|
|
MenuMsgPtr->attr.hub0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_transit() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.trsX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_retrecreq() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.rrqX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_retrec() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.rrcX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_orphan() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.orpX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_audit() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.arqX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_hubhost() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.hubX();
|
|
|
|
if(MenuMsgPtr->attr.hub()) {
|
|
|
|
MenuMsgPtr->attr.dir0();
|
|
|
|
MenuMsgPtr->attr.zon0();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_local() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.locX();
|
|
|
|
if(MenuMsgPtr->attr.loc())
|
|
|
|
MenuMsgPtr->attr.trs0();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_xmail() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.xmaX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_cfmrecreq() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.cfmX();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_scanned() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.scnX();
|
|
|
|
if(MenuMsgPtr->attr.scn()) {
|
|
|
|
MenuMsgPtr->attr.snt1();
|
|
|
|
MenuMsgPtr->attr.uns0();
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
MenuMsgPtr->attr.snt0();
|
|
|
|
MenuMsgPtr->attr.uns1();
|
|
|
|
MenuMsgPtr->attr.loc1();
|
|
|
|
}
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void clear_attrib() {
|
|
|
|
|
|
|
|
MenuMsgPtr->attr.reset();
|
|
|
|
DispHeadAttrs();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void DispAttrWindow(int show=-1) {
|
|
|
|
|
|
|
|
static int wh_background = -1;
|
|
|
|
static int wh_attributes = -1;
|
|
|
|
|
|
|
|
if(show == -1)
|
|
|
|
show = wh_attributes == -1;
|
|
|
|
|
|
|
|
if(show) {
|
|
|
|
wh_background = whandle();
|
2007-01-08 09:48:18 +00:00
|
|
|
size_t wide = MaxV(strlen(LNG->AttrTitle)+2, strlen(LNG->AttrPvt)+2);
|
2000-02-25 11:04:07 +00:00
|
|
|
wide = MinV(wide, MAXCOL-4);
|
|
|
|
wh_attributes = wopen_(6, 0, 17, wide, W_BMENU, C_MENUB, C_MENUW);
|
|
|
|
set_title(LNG->AttrTitle, TCENTER, C_MENUT);
|
|
|
|
if(*LNG->AttrTurnOff)
|
|
|
|
wtitle(LNG->AttrTurnOff, TCENTER|TBOTTOM, C_MENUT);
|
|
|
|
title_shadow();
|
|
|
|
int n = 0;
|
|
|
|
wide -= 2;
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrPvt, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrRcv, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrSnt, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrCrs, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrHld, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrFil, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrFrq, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrUpd, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrKS , wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrKfs, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrTfs, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrDir, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrImm, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrLok, wide, ' ', C_MENUW);
|
|
|
|
wprintns(n++, 0, C_MENUW, LNG->AttrZap, wide, ' ', C_MENUW);
|
|
|
|
wactiv_(wh_background);
|
|
|
|
}
|
|
|
|
else if(wh_attributes != -1) {
|
|
|
|
wactiv_(wh_attributes);
|
|
|
|
wclose();
|
|
|
|
wactiv_(wh_background);
|
|
|
|
wh_attributes = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
static void toggle_dispattrwindow() {
|
|
|
|
|
|
|
|
DispAttrWindow();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2001-03-17 21:17:57 +00:00
|
|
|
bool ProcessAttrs(gkey &key) {
|
|
|
|
|
|
|
|
switch(key) {
|
|
|
|
case KK_HeaderToggleScanned:
|
|
|
|
toggle_scanned();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleGroupmsg:
|
|
|
|
toggle_groupmsg();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleZonegate:
|
|
|
|
toggle_zonegate();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleHubhost:
|
|
|
|
toggle_hubhost();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleRetrecreq:
|
|
|
|
toggle_retrecreq();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleCrash:
|
|
|
|
toggle_crash();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleLocked:
|
|
|
|
toggle_locked();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleReceived:
|
|
|
|
toggle_received();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleLocal:
|
|
|
|
toggle_local();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleRetrec:
|
|
|
|
toggle_retrec();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleFreq:
|
|
|
|
toggle_freq();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleImm:
|
|
|
|
toggle_imm();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleAttrWin:
|
|
|
|
toggle_dispattrwindow();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleArcsent:
|
|
|
|
toggle_arcsent();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleHold:
|
|
|
|
toggle_hold();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleAudit:
|
|
|
|
toggle_audit();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleXmail:
|
|
|
|
toggle_xmail();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleTrunc:
|
|
|
|
toggle_trunc();
|
|
|
|
return true;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2001-03-17 21:17:57 +00:00
|
|
|
case KK_HeaderToggleUpdreq:
|
|
|
|
toggle_updreq();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderClearAttrib:
|
|
|
|
clear_attrib();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleKill:
|
|
|
|
toggle_kill();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleTransit:
|
|
|
|
toggle_transit();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleCfmrecreq:
|
|
|
|
toggle_cfmrecreq();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleOrphan:
|
|
|
|
toggle_orphan();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleFile:
|
|
|
|
toggle_file();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleDelsent:
|
|
|
|
toggle_delsent();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleDirect:
|
|
|
|
toggle_direct();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleReserved:
|
|
|
|
toggle_reserved();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderTogglePvt:
|
|
|
|
toggle_pvt();
|
|
|
|
return true;
|
|
|
|
|
|
|
|
case KK_HeaderToggleSent:
|
|
|
|
toggle_sent();
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
void ChgAttrs(int mode, GMsg* __msg) {
|
2000-02-25 11:04:07 +00:00
|
|
|
|
|
|
|
if(mode) {
|
|
|
|
MenuMsgPtr = __msg;
|
|
|
|
|
|
|
|
if(EDIT->HeaderAttrs() or (mode == ALWAYS))
|
|
|
|
DispAttrWindow(true);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
DispAttrWindow(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
void AskAttributes(GMsg* __msg) {
|
|
|
|
|
|
|
|
ChgAttrs(ALWAYS, __msg);
|
|
|
|
update_statusline(LNG->ChangeAttrs);
|
|
|
|
whelppcat(H_Attributes);
|
2001-03-17 21:17:57 +00:00
|
|
|
|
|
|
|
gkey key;
|
|
|
|
do {
|
|
|
|
gkey kk;
|
|
|
|
|
|
|
|
key = getxch();
|
|
|
|
if(key < KK_Commands) {
|
|
|
|
key = key_tolower(key);
|
|
|
|
kk = SearchKey(key, HeaderKey, HeaderKeys);
|
|
|
|
if(kk)
|
|
|
|
key = kk;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
while(ProcessAttrs(key) == true);
|
|
|
|
|
2000-02-25 11:04:07 +00:00
|
|
|
whelpop();
|
2001-03-17 21:17:57 +00:00
|
|
|
ChgAttrs(NO, __msg);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2006-04-26 17:06:23 +00:00
|
|
|
int SelectFromFile(const char* file, char* selection, const char* title, const char* nolines)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
char buf[256];
|
|
|
|
bool retval=false;
|
|
|
|
int lines = 0;
|
|
|
|
|
2006-04-26 17:06:23 +00:00
|
|
|
gfile fp(AddPath(CFG->goldpath, file), "rt", CFG->sharemode);
|
|
|
|
if (fp.isopen())
|
|
|
|
{
|
|
|
|
while (fp.Fgets(buf, sizeof(buf)))
|
2000-02-25 11:04:07 +00:00
|
|
|
lines++;
|
|
|
|
}
|
|
|
|
|
2006-04-26 17:06:23 +00:00
|
|
|
if (lines)
|
|
|
|
{
|
2007-01-08 09:48:18 +00:00
|
|
|
gstrarray Listi;
|
2006-04-26 17:06:23 +00:00
|
|
|
fp.Rewind();
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n;
|
2006-04-26 17:06:23 +00:00
|
|
|
for (n = 0; n < lines; n++)
|
|
|
|
{
|
|
|
|
fp.Fgets(buf, sizeof(buf)-2);
|
2000-02-25 11:04:07 +00:00
|
|
|
strtrim(buf);
|
|
|
|
strins(" ", buf, 0);
|
|
|
|
strcat(buf, " ");
|
|
|
|
if(strlen(buf) > MAXCOL-2-2)
|
|
|
|
buf[MAXCOL-2-2] = NUL;
|
2007-01-09 00:01:38 +00:00
|
|
|
Listi.push_back(buf);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
2000-02-25 11:04:07 +00:00
|
|
|
n = MinV(n, (MAXROW-10));
|
|
|
|
set_title(title, TCENTER, C_ASKT);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, 0, title_shadow);
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n != -1)
|
|
|
|
{
|
|
|
|
strcpy(selection, Listi[n].c_str());
|
2000-11-27 06:15:29 +00:00
|
|
|
strtrim(selection);
|
2000-12-10 08:29:00 +00:00
|
|
|
strltrim(selection);
|
2000-02-25 11:04:07 +00:00
|
|
|
retval = true;
|
|
|
|
}
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
w_info(nolines);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
|
|
|
|
|
|
|
return retval;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
int ChangeTagline()
|
|
|
|
{
|
|
|
|
bool retval = false;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
if (not CFG->tagline.empty())
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
gstrarray Listi;
|
|
|
|
|
|
|
|
gstrarray::iterator it = CFG->tagline.begin();
|
|
|
|
gstrarray::iterator end = CFG->tagline.end();
|
|
|
|
|
|
|
|
for (; it != end; it++)
|
|
|
|
{
|
|
|
|
if((*it)[0] == '@')
|
|
|
|
strxmerge(buf, MAXCOL-2-2, " [", CleanFilename(it->c_str() + 1), "] ", NULL);
|
2000-02-25 11:04:07 +00:00
|
|
|
else
|
2007-01-08 09:48:18 +00:00
|
|
|
strxmerge(buf, MAXCOL-2-2, " ", it->c_str(), " ", NULL);
|
|
|
|
|
|
|
|
Listi.push_back(buf);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n = MinV(Listi.size(), (MAXROW-10));
|
2000-02-25 11:04:07 +00:00
|
|
|
set_title(LNG->Taglines, TCENTER, C_ASKT);
|
|
|
|
update_statusline(LNG->ChangeTagline);
|
|
|
|
whelppcat(H_ChangeTagline);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, CFG->taglineno, title_shadow);
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n != -1)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
const char *tagl = CFG->tagline[n].c_str();
|
|
|
|
if(tagl[0] == '@') {
|
|
|
|
strxmerge(buf, MAXCOL-2-2, LNG->Taglines, " [", CleanFilename(tagl+1), "] ", NULL);
|
|
|
|
if(SelectFromFile(tagl+1, buf, LNG->Taglines, LNG->NoTagline)) {
|
|
|
|
AA->SetTagline(buf);
|
|
|
|
retval = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
CFG->taglineno = n;
|
|
|
|
AA->SetTagline(CFG->tagline[n].c_str());
|
|
|
|
retval = true;
|
|
|
|
}
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
2000-02-25 11:04:07 +00:00
|
|
|
whelpop();
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
w_info(LNG->NoTagline);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
return retval;
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
int ChangeOrigin()
|
|
|
|
{
|
|
|
|
bool retval = false;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
if (not CFG->origin.empty())
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
gstrarray Listi;
|
|
|
|
|
|
|
|
gstrarray::iterator it = CFG->origin.begin();
|
|
|
|
gstrarray::iterator end = CFG->origin.end();
|
|
|
|
|
|
|
|
for (; it !=end; it++)
|
|
|
|
{
|
|
|
|
if ((*it)[0] == '@')
|
|
|
|
strxmerge(buf, MAXCOL-2-2, " [", CleanFilename(it->c_str() + 1), "] ", NULL);
|
2000-02-25 11:04:07 +00:00
|
|
|
else
|
2007-01-08 09:48:18 +00:00
|
|
|
strxmerge(buf, MAXCOL-2-2, " ", it->c_str(), " ", NULL);
|
|
|
|
|
|
|
|
Listi.push_back(buf);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n = MinV(Listi.size(), (MAXROW-10));
|
2000-02-25 11:04:07 +00:00
|
|
|
set_title(LNG->Origins, TCENTER, C_ASKT);
|
|
|
|
update_statusline(LNG->ChangeOrigin);
|
|
|
|
whelppcat(H_ChangeOrigin);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, CFG->originno, title_shadow);
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n != -1)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
const char *orig = CFG->origin[n].c_str();
|
|
|
|
if(orig[0] == '@') {
|
|
|
|
strxmerge(buf, MAXCOL-2-2, LNG->Origins, " [", CleanFilename(orig+1), "] ", NULL);
|
|
|
|
if(SelectFromFile(orig+1, buf, LNG->Origins, LNG->NoOrigDefined)) {
|
|
|
|
AA->SetOrigin(buf);
|
|
|
|
retval = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
CFG->originno = n;
|
|
|
|
AA->SetOrigin(orig);
|
|
|
|
retval = true;
|
|
|
|
}
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
2000-02-25 11:04:07 +00:00
|
|
|
whelpop();
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
w_info(LNG->NoOrigDefined);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
return retval;
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
int ChangeUsername()
|
|
|
|
{
|
|
|
|
if(not CFG->username.empty())
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
char adrs[40];
|
|
|
|
gstrarray Listi;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
std::vector<Node>::iterator it = CFG->username.begin();
|
|
|
|
std::vector<Node>::iterator end = CFG->username.end();
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
for (; it != end; it++)
|
2006-05-14 17:17:32 +00:00
|
|
|
{
|
2007-01-08 09:48:18 +00:00
|
|
|
it->addr.make_string(adrs);
|
|
|
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %-35s %s ", it->name, adrs);
|
|
|
|
Listi.push_back(buf);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n = MinV(Listi.size(), (MAXROW-10));
|
2000-02-25 11:04:07 +00:00
|
|
|
set_title(LNG->Usernames, TCENTER, C_ASKT);
|
|
|
|
update_statusline(LNG->ChangeUsername);
|
|
|
|
whelppcat(H_ChangeUsername);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, CFG->usernameno, title_shadow);
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n != -1)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
CFG->usernameno = n;
|
|
|
|
AA->SetUsername(CFG->username[n]);
|
2001-07-16 20:35:42 +00:00
|
|
|
for(std::vector<gaka>::iterator a = CFG->aka.begin(); a != CFG->aka.end(); a++) {
|
2000-02-25 11:04:07 +00:00
|
|
|
if(AA->Username().addr.match(a->addr)) {
|
|
|
|
AA->SetAka(a->addr);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
2000-02-25 11:04:07 +00:00
|
|
|
whelpop();
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
w_info(LNG->NoUserDefined);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
return YES;
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
int ChangeTemplate()
|
|
|
|
{
|
|
|
|
if (not CFG->tpl.empty())
|
|
|
|
{
|
|
|
|
char buf[256];
|
|
|
|
char adrs[40];
|
|
|
|
gstrarray Listi;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
std::vector<Tpl>::iterator it = CFG->tpl.begin();
|
|
|
|
std::vector<Tpl>::iterator end = CFG->tpl.end();
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
for (; it != end; it++)
|
2006-05-14 17:17:32 +00:00
|
|
|
{
|
2007-01-08 09:48:18 +00:00
|
|
|
it->match.make_string(adrs);
|
|
|
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %-45s %s ", it->name, adrs);
|
|
|
|
Listi.push_back(buf);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n = MinV(Listi.size(), (MAXROW-10));
|
2000-02-25 11:04:07 +00:00
|
|
|
set_title(LNG->Templates, TCENTER, C_ASKT);
|
|
|
|
update_statusline(LNG->ChangeTemplate);
|
|
|
|
whelppcat(H_ChangeTemplate);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, CFG->tplno, title_shadow);
|
|
|
|
whelpop();
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n != -1)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
AA->SetTpl(CFG->tpl[n].file);
|
|
|
|
CFG->tplno = n;
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
return n;
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
else {
|
|
|
|
w_info(LNG->NoTplDefined);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
return -1;
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
int ChangeAka()
|
|
|
|
{
|
|
|
|
if (CFG->aka.size() > 1)
|
|
|
|
{
|
|
|
|
size_t startat = 0;
|
|
|
|
char addr[100];
|
|
|
|
char buf[100];
|
|
|
|
gstrarray Listi;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
std::vector<gaka>::iterator it = CFG->aka.begin();
|
|
|
|
std::vector<gaka>::iterator end = CFG->aka.end();
|
|
|
|
|
|
|
|
for (; it != end; it++)
|
2006-05-14 17:17:32 +00:00
|
|
|
{
|
2007-01-08 09:48:18 +00:00
|
|
|
it->addr.make_string(addr, it->domain);
|
2006-05-14 17:17:32 +00:00
|
|
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %s ", addr);
|
2007-01-08 09:48:18 +00:00
|
|
|
Listi.push_back(buf);
|
|
|
|
|
|
|
|
if (AA->Aka().addr.equals(it->addr))
|
|
|
|
startat = Listi.size() - 1;
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n = MinV(Listi.size(), (MAXROW-10));
|
2000-02-25 11:04:07 +00:00
|
|
|
set_title(LNG->Akas, TCENTER, C_ASKT);
|
|
|
|
update_statusline(LNG->ChangeAka);
|
|
|
|
whelppcat(H_ChangeAka);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, startat, title_shadow);
|
|
|
|
whelpop();
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n != -1)
|
2000-02-25 11:04:07 +00:00
|
|
|
AA->SetAka(CFG->aka[n].addr);
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
w_info(LNG->NoAkaDefined);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
|
|
|
return(YES);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
int ChangeXlatImport()
|
|
|
|
{
|
|
|
|
if (not CFG->xlatcharset.empty())
|
|
|
|
{
|
|
|
|
size_t startat = 0;
|
|
|
|
int maximport = 0;
|
|
|
|
int maxexport = 0;
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
char buf[100];
|
|
|
|
gstrarray Listi;
|
|
|
|
|
|
|
|
std::vector<Map>::iterator xlt = CFG->xlatcharset.begin();
|
|
|
|
std::vector<Map>::iterator end = CFG->xlatcharset.end();
|
2000-02-25 11:04:07 +00:00
|
|
|
|
2007-01-08 09:48:18 +00:00
|
|
|
for (size_t xlatimports = 1; xlt != end; xlt++)
|
|
|
|
{
|
|
|
|
if (strieql(xlt->exp, CFG->xlatlocalset))
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
maximport = MaxV(maximport, (int)strlen(xlt->imp));
|
|
|
|
maxexport = MaxV(maxexport, (int)strlen(xlt->exp));
|
2007-01-08 09:48:18 +00:00
|
|
|
if ((CFG->ignorecharset == true) and strieql(xlt->imp, AA->Xlatimport()))
|
2000-02-25 11:04:07 +00:00
|
|
|
startat = xlatimports;
|
|
|
|
xlatimports++;
|
|
|
|
}
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
Listi.push_back(LNG->CharsetAuto);
|
|
|
|
|
|
|
|
for (xlt = CFG->xlatcharset.begin(); xlt != end; xlt++)
|
2006-05-14 17:17:32 +00:00
|
|
|
{
|
|
|
|
if (strieql(xlt->exp, CFG->xlatlocalset))
|
|
|
|
{
|
|
|
|
gsprintf(PRINTF_DECLARE_BUFFER(buf), " %*.*s -> %-*.*s ",
|
|
|
|
maximport, maximport, xlt->imp, maxexport, maxexport, xlt->exp);
|
2007-01-08 09:48:18 +00:00
|
|
|
Listi.push_back(buf);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
size_t n = MinV(Listi.size(), (MAXROW-10));
|
2000-02-25 11:04:07 +00:00
|
|
|
set_title(LNG->Charsets, TCENTER, C_ASKT);
|
|
|
|
update_statusline(LNG->ChangeXlatImp);
|
|
|
|
whelppcat(H_ChangeXlatImport);
|
|
|
|
n = wpickstr(6, 0, 6+n+1, -1, W_BASK, C_ASKB, C_ASKW, C_ASKS, Listi, startat, title_shadow);
|
|
|
|
whelpop();
|
2007-01-08 09:48:18 +00:00
|
|
|
|
|
|
|
if (n == 0)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
CFG->ignorecharset = false;
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else if (n != -1)
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
CFG->ignorecharset = true;
|
2007-01-08 09:48:18 +00:00
|
|
|
std::string xlatImport = Listi[n].substr(0, Listi[n].find(" "));
|
|
|
|
AA->SetXlatimport(xlatImport.c_str());
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
2000-11-06 14:26:34 +00:00
|
|
|
LoadCharset(AA->Xlatimport(), CFG->xlatlocalset);
|
2000-02-25 11:04:07 +00:00
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
else
|
|
|
|
{
|
2000-02-25 11:04:07 +00:00
|
|
|
w_info(LNG->NoXlatImport);
|
|
|
|
waitkeyt(10000);
|
|
|
|
w_info(NULL);
|
|
|
|
}
|
2007-01-08 09:48:18 +00:00
|
|
|
|
2000-02-25 11:04:07 +00:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|