Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Implemented support to take XAB online or offline.
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 7 Jul 2016 23:47:54 +0000 (00:47 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Thu, 7 Jul 2016 23:47:54 +0000 (00:47 +0100)
source/AppXestiaAddrBk.cpp
source/AppXestiaAddrBk.h
source/actmgr/frmActivityMgr-tasks.cpp
source/actmgr/frmActivityMgr.cpp
source/actmgr/frmActivityMgr.h

index 0f8be13..f66b81c 100644 (file)
@@ -4090,7 +4090,6 @@ frmActivityMgrADT::frmActivityMgrADT( wxWindow* parent, wxWindowID id, const wxS
        
        mnuWindow->AppendSeparator();
        
-       wxMenuItem* mnuSleepMode;
        mnuSleepMode = new wxMenuItem( mnuWindow, wxID_ANY, wxString( wxT("Sleep Mode") ) , wxEmptyString, wxITEM_CHECK );
        mnuWindow->Append( mnuSleepMode );
        
index c7a7d2b..6bd643d 100644 (file)
@@ -973,6 +973,7 @@ class frmActivityMgrADT : public wxFrame
        protected:
                wxMenuBar* mnuMenuBar;
                wxMenu* mnuWindow;
+               wxMenuItem* mnuSleepMode;
                wxPanel* m_panel43;
                wxStaticBitmap* bmpActivity;
                wxPanel* m_panel46;
index 8aa7d1e..cdcdfc7 100644 (file)
@@ -31,7 +31,11 @@ int frmActivityMgr::AddTask(int TaskType, wxString TaskDetail, wxString TaskAcco
        coldata.SetId(ActivityTaskID);
        coldata.SetData(ActivityTaskID);
 
-       AnimationTimer.StartAnimation();
+       if (ApplicationSleepMode == FALSE){
+               
+               AnimationTimer.StartAnimation();
+               
+       }
 
        // Get the preferences file.
        
@@ -193,7 +197,7 @@ int frmActivityMgr::AddTask(int TaskType, wxString TaskDetail, wxString TaskAcco
        
        ProcessTasksData = TRUE;
        
-       if (!ActProcessTimer.IsRunning()) {
+       if (!ActProcessTimer.IsRunning() && ApplicationSleepMode == FALSE) {
        
                wxCommandEvent event(ACTMGR_STARTTIMER);
                wxPostEvent(this, event);
index 9c1e2a4..63755f8 100644 (file)
@@ -45,6 +45,7 @@ DEFINE_EVENT_TYPE(ACTMGR_STOPTIMER);
 DEFINE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER);
 DEFINE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER);
 DEFINE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL);
+DEFINE_EVENT_TYPE(ACTMGR_STARTANIMATIONTIMER);
 
 BEGIN_EVENT_TABLE(frmActivityMgr, wxWindow)
   EVT_COMMAND(wxID_ANY, ACTMGR_RESUMEPROC, frmActivityMgr::ResumeProcessing)
@@ -54,6 +55,7 @@ BEGIN_EVENT_TABLE(frmActivityMgr, wxWindow)
   EVT_COMMAND(wxID_ANY, ACTMGR_STARTPROCESSTIMER, frmActivityMgr::StartProcessTimer)
   EVT_COMMAND(wxID_ANY, ACTMGR_STOPPROCESSTIMER, frmActivityMgr::StopProcessTimer)
   EVT_COMMAND(wxID_ANY, ACTMGR_UPDATESTATUSLABEL, frmActivityMgr::UpdateStatusLabel)
+  EVT_COMMAND(wxID_ANY, ACTMGR_STARTANIMATIONTIMER, frmActivityMgr::StartAnimationTimer)
 END_EVENT_TABLE()
 
 frmActivityMgr::frmActivityMgr( wxWindow* parent )
@@ -194,6 +196,12 @@ void frmActivityMgr::ProcessTasksThread()
        
        }
        
+       if (ApplicationSleepMode == TRUE){
+               
+               return;
+               
+       }
+       
        std::map<int,int>::iterator TypeIter;
        std::map<int,wxString>::iterator StringIter;
        std::map<int,wxString>::iterator StringDataIter;
@@ -220,6 +228,12 @@ void frmActivityMgr::ProcessTasksThread()
                        continue;
                }
                
+               wxCommandEvent StartAnimationEvent(ACTMGR_STARTANIMATIONTIMER);
+               
+               wxPostEvent(this, StartAnimationEvent);
+               
+               // Start the animation timer if it hasn't started.
+               
                CardDAVIter = ActivityListConn.find(iter->first);
                TypeIter = ActivityListType.find(iter->first);
                StringETagIter = ActivityListETag.find(iter->first);
@@ -2109,7 +2123,7 @@ void frmActivityMgr::ProcessTasksThread()
                //ActListProcTimer.Start();
        
        }
-
+       
        wxCommandEvent event(ACTMGR_STARTPROCESSTIMER);
        wxPostEvent(this, event);
 
@@ -2119,7 +2133,7 @@ void frmActivityMgr::ProcessTasksThread()
 
 void frmActivityMgr::ProcessTasks()
 {
-
+       
        std::thread ProcessThread(&frmActivityMgr::ProcessTasksThread, this);
        ProcessThread.detach();
 
@@ -2150,15 +2164,23 @@ void frmActivityMgr::ToggleConnectionStatus( wxCommandEvent &event ){
 
        wxCommandEvent connevent(CONNSTAT_UPDATE);
        
-       if (SleepMode == FALSE){
+       if (ApplicationSleepMode == FALSE){
        
                connevent.SetInt(1);
-               SleepMode = TRUE;
+               ApplicationSleepMode = TRUE;
+               mnuSleepMode->Check(true);
        
        } else {
        
                connevent.SetInt(0);
-               SleepMode = FALSE;
+               ApplicationSleepMode = FALSE;
+               mnuSleepMode->Check(false);
+               
+               wxCommandEvent event(ACTMGR_STARTTIMER);
+               wxPostEvent(this, event);
+
+               wxCommandEvent eventp(ACTMGR_STARTPROCESSTIMER);
+               wxPostEvent(this, eventp);
        
        }
 
@@ -2166,6 +2188,14 @@ void frmActivityMgr::ToggleConnectionStatus( wxCommandEvent &event ){
 
 }
 
+void frmActivityMgr::SleepMode( wxCommandEvent &event ){
+       
+       wxCommandEvent connevent(ACTMGR_TOGGLECONN);
+       
+       wxPostEvent(this, connevent);
+       
+}
+
 void frmActivityMgr::WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc){
 
        wxString ServerCertFinal;
@@ -2210,6 +2240,12 @@ void frmActivityMgr::StopProcessTimer(wxCommandEvent& event){
 
 }
 
+void frmActivityMgr::StartAnimationTimer(wxCommandEvent& event){
+       
+       AnimationTimer.StartAnimation();
+       
+}
+
 void frmActivityMgr::UpdateStatusLabel(wxCommandEvent& event){
 
        ActivityMgrLabelUpdate *actmgrudata = (ActivityMgrLabelUpdate*)event.GetClientData();
index fec4778..d6dc31a 100644 (file)
@@ -53,6 +53,7 @@ DECLARE_EVENT_TYPE(ACTMGR_STOPTIMER, wxID_ANY)
 DECLARE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER, wxID_ANY)
 DECLARE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER, wxID_ANY)
 DECLARE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL, wxID_ANY)
+DECLARE_EVENT_TYPE(ACTMGR_STARTANIMATIONTIMER, wxID_ANY)
 
 struct vCardDownloadDataFileClass{
        unsigned int DataType = 0;
@@ -114,7 +115,7 @@ class frmActivityMgr : public frmActivityMgrADT
                std::map<int,wxArrayString> ActivityListLog;
                bool WindowOpen = FALSE;
                bool TasksActive = FALSE;
-               bool SleepMode = FALSE;
+               bool ApplicationSleepMode = FALSE;
                bool ProcessTasksData = FALSE;
                //int ConflictResult = 0;
                wxETagProcessTimer *ETagTmrPtr;
@@ -134,10 +135,12 @@ class frmActivityMgr : public frmActivityMgrADT
                void StopTimer( wxCommandEvent& event );
                void StartProcessTimer( wxCommandEvent& event );
                void StopProcessTimer( wxCommandEvent& event );
+               void StartAnimationTimer(wxCommandEvent& event);
                void FlushAllTasks();
                void RemoveTask();
                void ProcessTasksThread();
                void ToggleConnectionStatus( wxCommandEvent& event );
+               void SleepMode( wxCommandEvent &event );
                void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
                void UpdateStatusLabel( wxCommandEvent& event );
        public:
Xestia Software Development
Yn Maystri
© 2006 - 2019 Xestia Software Development
Software

Xestia Address Book
Xestia Calendar
Development

Xestia Gelforn
Everything else

About
News
Privacy Policy