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

Modified Files:
        wxMenuDefs.cpp wxComposeView.cpp 
Log Message:
added 'Send now' command to the composer

Index: wxMenuDefs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMenuDefs.cpp,v
retrieving revision 1.221
retrieving revision 1.222
diff -b -u -2 -r1.221 -r1.222
--- wxMenuDefs.cpp      11 Jul 2004 22:51:49 -0000      1.221
+++ wxMenuDefs.cpp      16 Jul 2004 22:42:00 -0000      1.222
@@ -462,11 +462,14 @@
 
    // the available accelerators for this menu:
-   // ABFGJMOQRUXYZ
+   // ABFGJMQRUXYZ
    { WXMENU_COMPOSE_INSERTFILE,     gettext_noop("&Insert file...\tCtrl-I"),
                                     gettext_noop("Attach a file to the message")      
      , wxITEM_NORMAL },
    { WXMENU_COMPOSE_LOADTEXT,       gettext_noop("I&nsert text...\tCtrl-T"),
                                     gettext_noop("Insert text file")         , 
wxITEM_NORMAL },
+   { WXMENU_SEPARATOR,     wxEmptyString,                  wxEmptyString              
           , wxITEM_NORMAL },
    { WXMENU_COMPOSE_SEND,           gettext_noop("&Send\tShift-Ctrl-X"),
-                                    gettext_noop("Send the message now")     , 
wxITEM_NORMAL },
+                                    gettext_noop("Send the message (either now or 
later depending on the options)")     , wxITEM_NORMAL },
+   { WXMENU_COMPOSE_SEND_NOW,       gettext_noop("Send right n&ow"),
+                                    gettext_noop("Send the message immediately")     
, wxITEM_NORMAL },
    { WXMENU_COMPOSE_SAVE_AS_DRAFT,  gettext_noop("Close and save as &draft"),
                                     gettext_noop("Close the window and save the 
message in the drafts folder")     , wxITEM_NORMAL },
@@ -475,6 +478,6 @@
    { WXMENU_COMPOSE_SEND_KEEP_OPEN, gettext_noop("Send and &keep\tShift-Ctrl-K"),
                                     gettext_noop("Send the message now and keep the 
editor open")     , wxITEM_NORMAL },
-   { WXMENU_COMPOSE_PRINT,          gettext_noop("&Print\tCtrl-P"),            
gettext_noop("Print the message")        , wxITEM_NORMAL },
    { WXMENU_SEPARATOR,     wxEmptyString,                  wxEmptyString              
           , wxITEM_NORMAL },
+   { WXMENU_COMPOSE_PRINT,          gettext_noop("&Print\tCtrl-P"),            
gettext_noop("Print the message")        , wxITEM_NORMAL },
    { WXMENU_COMPOSE_PREVIEW, gettext_noop("Previe&w..."),   gettext_noop("View the 
message as it would be sent"), wxITEM_NORMAL },
    { WXMENU_COMPOSE_SAVETEXT,gettext_noop("Save &text..."),   gettext_noop("Save 
(append) message text to file"), wxITEM_NORMAL },

Index: wxComposeView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxComposeView.cpp,v
retrieving revision 1.367
retrieving revision 1.368
diff -b -u -2 -r1.367 -r1.368
--- wxComposeView.cpp   15 Jul 2004 22:47:44 -0000      1.367
+++ wxComposeView.cpp   16 Jul 2004 22:42:00 -0000      1.368
@@ -3048,8 +3048,18 @@
 
       case WXMENU_COMPOSE_SEND:
+      case WXMENU_COMPOSE_SEND_NOW:
       case WXMENU_COMPOSE_SEND_KEEP_OPEN:
       case WXMENU_COMPOSE_SEND_LATER:
          if ( IsReadyToSend() )
-            if ( Send( (id == WXMENU_COMPOSE_SEND_LATER) ) )
+         {
+            SendMode mode;
+            if ( id == WXMENU_COMPOSE_SEND_LATER )
+               mode = SendMode_Later;
+            else if ( id == WXMENU_COMPOSE_SEND_NOW )
+               mode = SendMode_Now;
+            else
+               mode = SendMode_Default;
+
+            if ( Send(mode) )
             {
                if ( id != WXMENU_COMPOSE_SEND_KEEP_OPEN )
@@ -3057,4 +3067,6 @@
                   Close();
                }
+               //else: sending failed, don't close the window
+            }
             }
          break;
@@ -4070,5 +4082,5 @@
 
 bool
-wxComposeView::Send(bool schedule)
+wxComposeView::Send(SendMode mode)
 {
    CHECK( !m_sending, false, _T("wxComposeView::Send() reentered") );
@@ -4091,5 +4103,5 @@
    // and now do send the message
    bool success;
-   if ( schedule )
+   if ( mode == SendMode_Later )
    {
       MModule_Calendar *calmod =
@@ -4110,5 +4122,9 @@
    else
    {
-      success = msg->SendOrQueue();
+      int flags = 0;
+      if ( mode == SendMode_Now )
+         flags |= SendMessage::NeverQueue;
+
+      success = msg->SendOrQueue(flags);
    }
 



-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates

Reply via email to