New menu item toggle_sent added to action menu

This commit is contained in:
Ianos Gnatiuc 2005-10-27 20:14:44 +00:00
parent 909439d45f
commit cec5394f24
7 changed files with 64 additions and 5 deletions

View File

@ -304,6 +304,7 @@ WT_SELECTACTION " Action "
MI_FORWARDMESSAGE "F Forward Msg "
MI_MOVEMESSAGE "M Move Msg "
MI_COPYMESSAGE "C Copy Msg "
MI_TOGGLESENT "T Toggle sent "
MI_QUITCMF "Q Quit / ESC "
ST_ARE "messages are"
ST_IS "message is"

View File

@ -10,6 +10,12 @@ ______________________________________________________________________
Notes for GoldED+ 1.1.5, /snapshot/
______________________________________________________________________
+ New menu item "Toggle sent" added to "Action" menu that will toggle
sent/unsent state for current or marked messages.
+ Added new keyword for the language configuration file
MI_TOGGLESENT "T Toggle sent "
! New locations of config file for unix-like OS: ~/.golded/, ~/ and
/usr/local/etc/.

View File

@ -284,6 +284,7 @@ static LangCrc LangCrcs[] = {
{ CRC_MI_FORWARDMESSAGE , NULL , "F Forward Msg " },
{ CRC_MI_MOVEMESSAGE , NULL , "M Move Msg " },
{ CRC_MI_COPYMESSAGE , NULL , "C Copy Msg " },
{ CRC_MI_TOGGLESENT , NULL , "T Toggle sent " },
{ CRC_MI_QUITCMF , NULL , "Q Quit / ESC " },
{ CRC_ST_ARE , NULL , "messages are" },
{ CRC_ST_IS , NULL , "message is" },

View File

@ -282,6 +282,7 @@ const word CRC_WT_SELECTACTION = 0xF7C0;
const word CRC_MI_FORWARDMESSAGE = 0x644C;
const word CRC_MI_MOVEMESSAGE = 0xAB24;
const word CRC_MI_COPYMESSAGE = 0x6811;
const word CRC_MI_TOGGLESENT = 0;
const word CRC_MI_QUITCMF = 0xE1B8;
const word CRC_ST_ARE = 0x78C8;
const word CRC_ST_IS = 0x27AC;

View File

@ -312,6 +312,10 @@ void CmfMsgs(GMsg* msg) {
GFTRK("ForwardMsgs");
pickstr = LNG->ForwardArea;
break;
case MODE_UPDATE:
GFTRK("ToggleSent");
loadmode |= GMSG_UPDATE;
break;
}
// Do with current or marked msgs?
@ -327,6 +331,49 @@ void CmfMsgs(GMsg* msg) {
}
}
if (cmf == MODE_UPDATE)
{
w_info(LNG->Wait);
uint32_t loadmsgno = msg->msgno;
uint32_t mrks = AA->Mark.Count();
uint32_t *mrkp = AA->Mark.tag;
uint32_t mrk = 0;
do
{
if (do_mode == MODE_MARKED)
loadmsgno = mrkp[mrk];
mrk++;
if (AA->LoadHdr(msg, loadmsgno, false))
{
msg->attr.sntX();
if (msg->attr.snt())
{
msg->attr.uns0();
msg->attr.scn1();
}
else
{
msg->attr.uns1();
msg->attr.scn0();
msg->attr.loc1();
}
AA->SaveHdr(GMSG_UPDATE, msg);
}
}
while (mrk < mrks);
AA->Mark.ResetAll();
w_info(NULL);
GFTRK(NULL);
return;
}
// Pick the destination area
int destarea = CurrArea;
const char* cmfptr = cmf == MODE_FORWARD ? AA->Areareplyto() : AA->Areacopyto();

View File

@ -271,6 +271,7 @@ struct LangGed {
char* ForwardMessage; // MI_FORWARDMESSAGE
char* MoveMessage; // MI_MOVEMESSAGE
char* CopyMessage; // MI_COPYMESSAGE
char* ToggleSent; // MI_TOGGLESENT
char* QuitCMF; // MI_QUITCMF
char* are; // ST_ARE
char* is; // ST_IS

View File

@ -258,7 +258,7 @@ int GMenuNewarea::Run() {
int GMenuCMF::Run() {
enum { TAG_COPY=100, TAG_MOVE, TAG_FORWARD, TAG_QUIT };
enum { TAG_COPY=100, TAG_MOVE, TAG_FORWARD, TAG_TOGGLESENT, TAG_QUIT };
static int _prevtag = TAG_FORWARD;
@ -270,6 +270,7 @@ int GMenuCMF::Run() {
Item(TAG_FORWARD, LNG->ForwardMessage);
Item(TAG_MOVE, LNG->MoveMessage);
Item(TAG_COPY, LNG->CopyMessage);
Item(TAG_TOGGLESENT, LNG->ToggleSent);
Item(TAG_QUIT, LNG->QuitCMF);
SetTag(_prevtag);
End();
@ -281,6 +282,7 @@ int GMenuCMF::Run() {
case TAG_FORWARD: return MODE_FORWARD;
case TAG_MOVE: return MODE_MOVE;
case TAG_COPY: return MODE_COPY;
case TAG_TOGGLESENT:return MODE_UPDATE;
}
_prevtag = TAG_FORWARD;
return -1;