Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12077/src/gui

Modified Files:
        wxMenuDefs.cpp wxMsgCmdProc.cpp 
Log Message:
added "Mark answered" command


Index: wxMenuDefs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMenuDefs.cpp,v
retrieving revision 1.228
retrieving revision 1.229
diff -b -u -2 -r1.228 -r1.229
--- wxMenuDefs.cpp      5 Jul 2005 12:36:01 -0000       1.228
+++ wxMenuDefs.cpp      24 Sep 2005 16:21:51 -0000      1.229
@@ -335,10 +335,11 @@
    // msg
 
-   // no more available accelerators for this menu!
+   // the available accelerators for this menu:
+   // FGH
 
    { WXMENU_MSG_OPEN,      gettext_noop("&Open"),             
gettext_noop("View selected message in a separate window")    , wxITEM_NORMAL },
-   { WXMENU_MSG_EDIT,      gettext_noop("Ed&it in composer\tCtrl-E"), 
gettext_noop("Edit selected message in composer")    , wxITEM_NORMAL },
+   { WXMENU_MSG_EDIT,      gettext_noop("&Edit in composer\tCtrl-E"), 
gettext_noop("Edit selected message in composer")    , wxITEM_NORMAL },
    { WXMENU_MSG_PRINT,     gettext_noop("&Print\tCtrl-P"),    
gettext_noop("Print this message")       , wxITEM_NORMAL },
-   { WXMENU_MSG_PRINT_PREVIEW, gettext_noop("Print 
Previe&w"),gettext_noop("Preview a printout of this message")       , 
wxITEM_NORMAL },
+   { WXMENU_MSG_PRINT_PREVIEW, gettext_noop("Print 
Pre&view"),gettext_noop("Preview a printout of this message")       , 
wxITEM_NORMAL },
 #ifdef USE_PS_PRINTING
    { WXMENU_MSG_PRINT_PS,     gettext_noop("PS-Prin&t"),      
gettext_noop("Print this message as PostScript")       , wxITEM_NORMAL },
@@ -417,5 +418,5 @@
    { WXMENU_SUBMENU,       wxEmptyString, wxEmptyString, wxITEM_NORMAL },
    { WXMENU_MSG_BOUNCE,    gettext_noop("&Bounce..."), gettext_noop("Redirect 
the selected messages to another recipient"), wxITEM_NORMAL },
-   { WXMENU_MSG_RESEND,    gettext_noop("R&esend..."), gettext_noop("Send the 
selected messages again."), wxITEM_NORMAL },
+   { WXMENU_MSG_RESEND,    gettext_noop("Rese&nd..."), gettext_noop("Send the 
selected messages again."), wxITEM_NORMAL },
    { WXMENU_SEPARATOR,     wxEmptyString,                  wxEmptyString       
                  , wxITEM_NORMAL },
    { WXMENU_MSG_FILTER,    gettext_noop("Appl&y filter rules..."), 
gettext_noop("Apply filter rules to selected messages")     , wxITEM_NORMAL },
@@ -433,5 +434,6 @@
    { WXMENU_MSG_NEXT_FLAGGED,   gettext_noop("Nex&t flagged"), 
gettext_noop("Select next flagged message")     , wxITEM_NORMAL },
    { WXMENU_SEPARATOR,     wxEmptyString,                  wxEmptyString       
                  , wxITEM_NORMAL },
-   { WXMENU_MSG_FLAG,      gettext_noop("Fla&g\tCtrl-I"), gettext_noop("Mark 
message as flagged/unflagged")         , wxITEM_NORMAL },
+   { WXMENU_MSG_FLAG,      gettext_noop("Flag as &important\tCtrl-I"), 
gettext_noop("Mark message as flagged/unflagged")         , wxITEM_NORMAL },
+   { WXMENU_MSG_MARK_ANSWERED, gettext_noop("Mark ans&wered"), 
gettext_noop("Mark message as answered/not answered")         , wxITEM_NORMAL },
    { WXMENU_MSG_MARK_READ,   gettext_noop("Mark &read"), gettext_noop("Mark 
message as read"), wxITEM_NORMAL },
    { WXMENU_MSG_MARK_UNREAD,   gettext_noop("Mar&k unread\tShift-Ctrl-U"), 
gettext_noop("Mark message as unread"), wxITEM_NORMAL },

Index: wxMsgCmdProc.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMsgCmdProc.cpp,v
retrieving revision 1.66
retrieving revision 1.67
diff -b -u -2 -r1.66 -r1.67
--- wxMsgCmdProc.cpp    19 Sep 2004 10:58:58 -0000      1.66
+++ wxMsgCmdProc.cpp    24 Sep 2005 16:21:51 -0000      1.67
@@ -175,5 +175,5 @@
    bool DeleteAndExpungeMessages(const UIdArray& selections);
    void UndeleteMessages(const UIdArray& selections);
-   void ToggleMessages(const UIdArray& messages);
+   void ToggleMessagesFlag(const UIdArray& messages, MailFolder::MessageStatus 
f);
    void MarkRead(const UIdArray& messages, bool read);
 
@@ -688,5 +688,8 @@
 
       case WXMENU_MSG_FLAG:
-         ToggleMessages(messages);
+      case WXMENU_MSG_MARK_ANSWERED:
+         ToggleMessagesFlag(messages, cmd == WXMENU_MSG_FLAG
+                                       ? MailFolder::MSG_STAT_FLAGGED
+                                       : MailFolder::MSG_STAT_ANSWERED);
          break;
 
@@ -1172,11 +1175,12 @@
 
 void
-MsgCmdProcImpl::ToggleMessages(const UIdArray& messages)
+MsgCmdProcImpl::ToggleMessagesFlag(const UIdArray& messages,
+                                   MailFolder::MessageStatus flag)
 {
    MailFolder_obj mf(GetMailFolder());
-   CHECK_RET( mf, _T("no folder in MsgCmdProcImpl::ToggleMessages") );
+   CHECK_RET( mf, _T("no folder in MsgCmdProcImpl::ToggleMessagesFlag") );
 
    HeaderInfoList_obj hil(mf->GetHeaders());
-   CHECK_RET( hil, _T("can't toggle messages without folder listing") );
+   CHECK_RET( hil, _T("can't toggle messages flag without folder listing") );
 
    size_t count = messages.GetCount();
@@ -1202,8 +1206,8 @@
 
       // is the message currently flagged?
-      bool flagged = (hi->GetStatus() & MailFolder::MSG_STAT_FLAGGED) != 0;
+      const bool flagged = (hi->GetStatus() & flag) != 0;
 
       // invert the flag
-      m_asmf->SetMessageFlag(uid, MailFolder::MSG_STAT_FLAGGED, !flagged);
+      m_asmf->SetMessageFlag(uid, flag, !flagged);
    }
 }



-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP.  Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Mahogany-cvsupdates mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to