From f15607a27ebdc7888517989bd8c51ed6a4403296 Mon Sep 17 00:00:00 2001 From: Ianos Gnatiuc Date: Sun, 30 Oct 2005 02:16:01 +0000 Subject: [PATCH] New config file token AreaRecycleBin --- cfgs/config/advanced.cfg | 4 +++ cfgs/config/advanced.rus | 4 +++ docs/notework.txt | 3 ++ golded3/gccfgg.cpp | 1 + golded3/gccfgg.h | 1 + golded3/gccfgg0.cpp | 1 + golded3/gccfgg1.cpp | 7 ++++ golded3/gcprot.h | 1 + golded3/gecfgg.h | 1 + golded3/gecmfd.cpp | 70 ++++++++++++++++++++++++++++++---------- golded3/geprot.h | 4 +-- 11 files changed, 78 insertions(+), 19 deletions(-) diff --git a/cfgs/config/advanced.cfg b/cfgs/config/advanced.cfg index c8b8718..4e8d9ee 100644 --- a/cfgs/config/advanced.cfg +++ b/cfgs/config/advanced.cfg @@ -432,6 +432,10 @@ AREAREPLYTO E-MAIL // ;AREAYOUWROTETO MY_MAILS +// AreaRecycleBin +// If enabled, GoldEd will move deleted messages to . +;AreaRecycleBin RECYCLE.BIN + ---------------------------------------------------------------------- -- STATUSLINE diff --git a/cfgs/config/advanced.rus b/cfgs/config/advanced.rus index b1849bb..d067388 100644 --- a/cfgs/config/advanced.rus +++ b/cfgs/config/advanced.rus @@ -433,6 +433,10 @@ AreaCopyTo ZZZ.MY.ARCHIVE // В группах этот параметр работает с версии 3.00.a5. AreaCopyAddId No +// AreaRecycleBin +// Установка области, куда GoldEd переместит письма при удалении. +;AreaRecycleBin RECYCLE.BIN + ---------------------------------------------------------------------- -- СТРОКА СОСТОЯНИЯ diff --git a/docs/notework.txt b/docs/notework.txt index 25fd7ee..2a7b915 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -10,6 +10,9 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ ++ New config file token AreaRecycleBin . GoldEd will move deleted + messages to , if this token is defined. + + New config file token: ColorName . This is used to define special color for some names and/or addresses. Color must be an integer. diff --git a/golded3/gccfgg.cpp b/golded3/gccfgg.cpp index 0d0e11b..472f330 100644 --- a/golded3/gccfgg.cpp +++ b/golded3/gccfgg.cpp @@ -642,6 +642,7 @@ CfgGed::CfgGed() { *areacfmreplyto = 0; *areacopyto = 0; *areafreqto = 0; + *arearecyclebin = 0; *areareplyto = 0; *areastart = 0; *areayouwroteto = 0; diff --git a/golded3/gccfgg.h b/golded3/gccfgg.h index 18e2038..d37dfc5 100644 --- a/golded3/gccfgg.h +++ b/golded3/gccfgg.h @@ -75,6 +75,7 @@ const word CRC_AREAPMSCAN = 0xE19D; const word CRC_AREAPMSCANEXCL = 0xA2BE; const word CRC_AREAPMSCANINCL = 0x9524; const word CRC_AREAREADONLY = 0xE4F3; +const word CRC_AREARECYCLEBIN = 0xDCB4; const word CRC_AREARENAME = 0xFC32; const word CRC_AREAREPLYDIRECT = 0x7570; const word CRC_AREAREPLYTO = 0x7157; diff --git a/golded3/gccfgg0.cpp b/golded3/gccfgg0.cpp index ce41747..2457a8e 100644 --- a/golded3/gccfgg0.cpp +++ b/golded3/gccfgg0.cpp @@ -218,6 +218,7 @@ SwitchA: case CRC_AREAPMSCANEXCL : CfgAreapmscanexcl (); break; case CRC_AREAPMSCANINCL : CfgAreapmscanincl (); break; case CRC_AREAREADONLY : CfgAreareadonly (); break; + case CRC_AREARECYCLEBIN : CfgArearecyclebin (); break; case CRC_AREARENAME : CfgArearename (); break; case CRC_AREAREPLYDIRECT : CfgAreareplydirect (); break; case CRC_AREAREPLYTO : CfgAreareplyto (); break; diff --git a/golded3/gccfgg1.cpp b/golded3/gccfgg1.cpp index e203e28..6019353 100644 --- a/golded3/gccfgg1.cpp +++ b/golded3/gccfgg1.cpp @@ -422,6 +422,13 @@ void CfgAreareadonly() { // ------------------------------------------------------------------ +void CfgArearecyclebin() +{ + strupr(strxcpy(CFG->arearecyclebin, val, sizeof(Echo))); +} + +// ------------------------------------------------------------------ + void CfgArearename() { char* key; diff --git a/golded3/gcprot.h b/golded3/gcprot.h index e424a87..fe9ab10 100644 --- a/golded3/gcprot.h +++ b/golded3/gcprot.h @@ -76,6 +76,7 @@ void CfgAreapmscan (); void CfgAreapmscanexcl (); void CfgAreapmscanincl (); void CfgAreareadonly (); +void CfgArearecyclebin (); void CfgArearename (); void CfgAreareplydirect (); void CfgAreareplyto (); diff --git a/golded3/gecfgg.h b/golded3/gecfgg.h index e8fb557..d39009b 100644 --- a/golded3/gecfgg.h +++ b/golded3/gecfgg.h @@ -165,6 +165,7 @@ public: gstrarray areapmscanexcl; gstrarray areapmscanincl; int areareadonly; + Echo arearecyclebin; std::vector arearename; bool areareplydirect; Echo areareplyto; diff --git a/golded3/gecmfd.cpp b/golded3/gecmfd.cpp index 44715eb..8d540a6 100644 --- a/golded3/gecmfd.cpp +++ b/golded3/gecmfd.cpp @@ -149,6 +149,15 @@ void Area::DelMsgs(GMsg* msg) { GFTRK("DelMsgs"); + int areano = AL.AreaEchoToNo(CFG->arearecyclebin); + int currno = AL.AreaIdToNo(CurrArea); + if ((areano != currno) && (areano >= 0)) + { + CopyMoveForward(true); + GFTRK(NULL); + return; + } + uint n, x; int topline=0; bool delask=true, dellocked=false; @@ -272,14 +281,20 @@ void Area::DelMsg() { // ------------------------------------------------------------------ -void CmfMsgs(GMsg* msg) { - +void CmfMsgs(GMsg* msg, bool torecycle) +{ // Select action - GMenuCMF MenuCMF; - int cmf = MenuCMF.Run(); - if(cmf == -1) - return; - + int cmf; + + if (torecycle) cmf = MODE_MOVE; + else + { + GMenuCMF MenuCMF; + cmf = MenuCMF.Run(); + if(cmf == -1) + return; + } + // Set language strings char* pickstr = NULL; char* markstr = NULL; @@ -301,11 +316,24 @@ void CmfMsgs(GMsg* msg) { if(not MenuReadonly.Run()) return; } - GFTRK("MoveMsgs"); - pickstr = LNG->MoveArea; - markstr = LNG->Move; - progstr = LNG->Moving; - statstr = LNG->MovingMsg; + + if (torecycle) + { + GFTRK("DeleteMsgs"); + pickstr = ">>Delete To Area: "; + markstr = " Delete "; + progstr = " Deleting "; + statstr = "Deleting Msg %u of %u to %s"; + } + else + { + GFTRK("MoveMsgs"); + pickstr = LNG->MoveArea; + markstr = LNG->Move; + progstr = LNG->Moving; + statstr = LNG->MovingMsg; + } + loadmode |= GMSG_MOVE; break; case MODE_FORWARD: @@ -379,14 +407,22 @@ void CmfMsgs(GMsg* msg) { // Pick the destination area int destarea = CurrArea; - const char* cmfptr = cmf == MODE_FORWARD ? AA->Areareplyto() : AA->Areacopyto(); + const char* cmfptr; + + if (torecycle) + cmfptr = CFG->arearecyclebin; + else + cmfptr = cmf == MODE_FORWARD ? AA->Areareplyto() : AA->Areacopyto(); + if(*cmfptr) { int a = AL.AreaEchoToNo(cmfptr); if(a != -1) destarea = AL.AreaNoToId(a); } - if(cmf == MODE_FORWARD ? not AA->Areaforwarddirect() : not AA->Areacopydirect()) + + if (torecycle || (cmf == MODE_FORWARD ? not AA->Areaforwarddirect() : not AA->Areacopydirect())) destarea = AreaPick(pickstr, 6, &destarea); + if(destarea == -1) { GFTRK(NULL); return; @@ -637,15 +673,15 @@ void CmfMsgs(GMsg* msg) { // ------------------------------------------------------------------ -void CopyMoveForward() { - +void CopyMoveForward(bool torecycle) +{ uint lastread = reader_msg->msgno; AA->set_lastread(AA->Msgn.ToReln(lastread, AA->lastread())); AA->attr().hex0(); if(AA->Msgn.Count()) - CmfMsgs(reader_msg); + CmfMsgs(reader_msg, torecycle); AA->set_lastread(AA->Msgn.ToReln(lastread, AA->lastread())); } diff --git a/golded3/geprot.h b/golded3/geprot.h index b2231c4..b152a8d 100644 --- a/golded3/geprot.h +++ b/golded3/geprot.h @@ -109,7 +109,7 @@ char* mime_header_encode(char* dest, const char* source, GMsg* msg); // ------------------------------------------------------------------ // GEDOIT prototypes -void CmfMsgs(GMsg* msg); +void CmfMsgs(GMsg* msg, bool torecycle); void LoadText(GMsg* msg, const char* textfile); void SaveLines(int mode, const char* savefile, GMsg* msg, int margin, bool clip=false); @@ -303,7 +303,7 @@ void ChangeAttributes(); void ChangeMsg(); void CommentMsg(); void ConfirmMsg(); -void CopyMoveForward(); +void CopyMoveForward(bool torecycle = false); void DecMargin(); void DosShell(); void ExitAsk();