X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;f=source%2Factmgr%2FfrmActivityMgr.cpp;h=63755f848029ea1bd4a13f74b17198219c93718c;hb=57b0514feb18c2ed89f5c6f4b49d6c6513cac9f1;hp=b08b7b5d36e180fa353edcfee77d671027d71e1b;hpb=94c04b615244d29ad969f73885f9a55453f908c0;p=xestiaab%2F.git diff --git a/source/actmgr/frmActivityMgr.cpp b/source/actmgr/frmActivityMgr.cpp index b08b7b5..63755f8 100644 --- a/source/actmgr/frmActivityMgr.cpp +++ b/source/actmgr/frmActivityMgr.cpp @@ -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::iterator TypeIter; std::map::iterator StringIter; std::map::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); @@ -614,7 +628,7 @@ void frmActivityMgr::ProcessTasksThread() SSLInvalidCertNotifObj SSLICNProcData; - SSLCertCollection certcol = ConnHandle.GetCertificateData(); + SSLCertCollection certcol = ConnHandle.GetSSLVerifyResults(); bool *PauseMode = new bool; QRNotif qrn; @@ -643,14 +657,14 @@ void frmActivityMgr::ProcessTasksThread() // Accept the certificate. Write the certificate into the account // directory (as server.crt) - will overwrite old certificate. - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateData()); - WriteServerCertificate(AccountDir, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetSSLVerifyResults()); + WriteServerCertificate(AccountDir, ConnHandle.GetSSLVerifyResults()); } else if (SSLResult == 2){ // Reject the certificate, abort the task and mark as failed. - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnHandle.GetSSLVerifyResults()); iter->second = 2; break; @@ -692,7 +706,7 @@ void frmActivityMgr::ProcessTasksThread() #else - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetSSLVerifyResults()); #endif @@ -954,14 +968,14 @@ void frmActivityMgr::ProcessTasksThread() // Accept the certificate. Write the certificate into the account // directory (as server.crt) - will overwrite old certificate. - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateData()); - WriteServerCertificate(AccountDir, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetSSLVerifyResults()); + WriteServerCertificate(AccountDir, ConnHandle.GetSSLVerifyResults()); } else if (SSLResult == 2){ // Reject the certificate, abort the task and mark as failed. - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnHandle.GetSSLVerifyResults()); iter->second = 2; break; @@ -1003,7 +1017,7 @@ void frmActivityMgr::ProcessTasksThread() #else - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetSSLVerifyResults()); #endif @@ -1226,14 +1240,14 @@ void frmActivityMgr::ProcessTasksThread() // Accept the certificate. Write the certificate into the account // directory (as server.crt) - will overwrite old certificate. - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateData()); - WriteServerCertificate(AccountDir, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetSSLVerifyResults()); + WriteServerCertificate(AccountDir, ConnHandle.GetSSLVerifyResults()); } else if (SSLResult == 2){ // Reject the certificate, abort the task and mark as failed. - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 1, ConnHandle.GetSSLVerifyResults()); iter->second = 2; break; @@ -1275,7 +1289,7 @@ void frmActivityMgr::ProcessTasksThread() #else - frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetCertificateData()); + frmMainPtrGet->UpdateSSLAccountStatus(AccountID, 0, ConnHandle.GetSSLVerifyResults()); #endif @@ -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();