Home | News | Projects | Releases
Bugs | RFE | Repositories | Help
Improved syncronisation (stop conflict resolution screen appearing everytime after...
authorSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Sep 2015 12:25:06 +0000 (13:25 +0100)
committerSteve Brokenshire <sbrokenshire@xestia.co.uk>
Sun, 20 Sep 2015 12:25:06 +0000 (13:25 +0100)
source/frmActivityMgr.cpp
source/frmActivityMgr.h

index 5638c70..f7b2f95 100644 (file)
@@ -30,6 +30,7 @@ DEFINE_EVENT_TYPE(ACTMGR_STARTTIMER);
 DEFINE_EVENT_TYPE(ACTMGR_STOPTIMER);
 DEFINE_EVENT_TYPE(ACTMGR_STARTPROCESSTIMER);
 DEFINE_EVENT_TYPE(ACTMGR_STOPPROCESSTIMER);
+DEFINE_EVENT_TYPE(ACTMGR_UPDATESTATUSLABEL);
 
 BEGIN_EVENT_TABLE(frmActivityMgr, wxWindow)
   EVT_COMMAND(wxID_ANY, ACTMGR_RESUMEPROC, frmActivityMgr::ResumeProcessing)
@@ -38,6 +39,7 @@ BEGIN_EVENT_TABLE(frmActivityMgr, wxWindow)
   EVT_COMMAND(wxID_ANY, ACTMGR_STOPTIMER, frmActivityMgr::StopTimer)
   EVT_COMMAND(wxID_ANY, ACTMGR_STARTPROCESSTIMER, frmActivityMgr::StartProcessTimer)
   EVT_COMMAND(wxID_ANY, ACTMGR_STOPPROCESSTIMER, frmActivityMgr::StopProcessTimer)
+  EVT_COMMAND(wxID_ANY, ACTMGR_UPDATESTATUSLABEL, frmActivityMgr::UpdateStatusLabel)
 END_EVENT_TABLE()
 
 frmActivityMgr::frmActivityMgr( wxWindow* parent )
@@ -454,6 +456,12 @@ void frmActivityMgr::CloseWindow( wxCommandEvent& event )
        this->Hide();
 }
 
+void frmActivityMgr::CloseWindow( wxCloseEvent& event )
+{
+       WindowOpen = FALSE;
+       this->Hide();
+}
+
 void frmActivityMgr::ProcessTasksThread()
 {
        
@@ -879,6 +887,7 @@ void frmActivityMgr::ProcessTasksThread()
                                        
                                                //ServerContactList = CardDAVInstance.GetContactList(SyncTokenLoad.ToUTF8());
                                                ServerContactList = CardDAVIter->second.GetContactList(SyncTokenLoad.ToUTF8());
+                                               SSLCertCollection certcol = CardDAVIter->second.GetCertificateData();
                                
                                                // Create a pointer for the std::map<wxString,FileSyncData>.
                                
@@ -911,7 +920,7 @@ void frmActivityMgr::ProcessTasksThread()
                                                                qrn.QResponse = &SSLResult;
                                                                qrn.PausePtr = PauseMode;
                                                                
-                                                               SSLICNProcData.CertCollection = CardDAVIter->second.GetCertificateData();
+                                                               SSLICNProcData.CertCollection = certcol;
                                                                SSLICNProcData.QRNotifData = &qrn;
                                                                SSLICNProcData.AccountName = AccountNameFriendly;
                                                        
@@ -1326,14 +1335,19 @@ void frmActivityMgr::ProcessTasksThread()
                                                ETagDB *ETagDBPtr = ETagTmrPtr->GetPointer(AccountDir);
                                                ETag = ETagDBPtr->GetETag(vCardAdd[vi]);
                                                ETagOriginal = ETagDBPtr->GetETagOriginal(vCardAdd[vi]);
+                                               
                                                ContactFilename = vCardAdd[vi];
                                                FullFilename = CreateFilenamePath(AccountDirFinal, vCardAdd[vi]);
 
                                                ContactFilename.Trim();
                        
-                                               if (ETag == ETagOriginal){
+                                               if (ETag == ETagOriginal && ETagDBPtr->ETagExists(vCardAdd[vi])){
                        
                                                        // Compare the ETag with the Server ETag.
+                                               
+                                                       CardDAVIter->second.SetServerFilename(vCardAdd[vi]);
+                                                       CardDAVIter->second.GetServerETagValueThread();
+                                                       ETagServer = CardDAVIter->second.ETagValueResult();
                                
                                                        if (ETagOriginal != ETagServer){
                                
@@ -1876,4 +1890,27 @@ void frmActivityMgr::StopProcessTimer(wxCommandEvent& event){
 
 }
 
+void frmActivityMgr::UpdateStatusLabel(wxCommandEvent& event){
+
+       ActivityMgrLabelUpdate *actmgrudata = (ActivityMgrLabelUpdate*)event.GetClientData();
+       
+       if (actmgrudata != NULL){
+       
+       wxPuts(wxT("ItemIndex:") + actmgrudata->ItemIndex);
+       wxPuts(wxT("ItemLabel:") + actmgrudata->ItemLabel);
+       wxPuts(wxT("ItemDes:  ") + actmgrudata->ItemDes);
+       
+       lstActivity->SetItem(actmgrudata->ItemIndex, 2, actmgrudata->ItemLabel);
+       
+       /*if (!actmgrudata->ItemDes.IsEmpty()){
+               lstActivity->SetItem(actmgrudata->ItemIndex, 0, actmgrudata->ItemDes);
+       }*/
+       
+       delete actmgrudata;
+       actmgrudata = NULL;
+       
+       }
+
+}
+
 #endif
\ No newline at end of file
index d434056..857eb32 100644 (file)
@@ -10,6 +10,7 @@ Subclass of frmActivityMgrADT, which is generated by wxFormBuilder.
 #include "carddav/carddav.h"
 #include <map>
 #include <wx/timer.h>
+
 #include "common/timers.h"
 #include "common/etag.h"
 
@@ -21,12 +22,19 @@ DECLARE_EVENT_TYPE(ACTMGR_STARTTIMER, wxID_ANY)
 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)
 
 struct vCardDownloadDataFileClass{
        unsigned int DataType = 0;
        wxString FileData;
 };
 
+struct ActivityMgrLabelUpdate{
+       long ItemIndex;
+       wxString ItemLabel;
+       wxString ItemDes;
+};
+
 /** Implementing frmActivityMgrADT */
 class frmActivityMgr : public frmActivityMgrADT
 {
@@ -63,6 +71,7 @@ class frmActivityMgr : public frmActivityMgrADT
        protected:
                // Handlers for frmActivityMgrADT events.
                void CloseWindow( wxCommandEvent& event );
+               void CloseWindow( wxCloseEvent& event );
                void StopTask( wxCommandEvent& event );
                void StopAllTasks( wxCommandEvent& event );
                void RetryTask( wxCommandEvent& event );
@@ -75,6 +84,7 @@ class frmActivityMgr : public frmActivityMgrADT
                void ProcessTasksThread();
                void ToggleConnectionStatus( wxCommandEvent& event );
                void WriteServerCertificate(wxString AccountName, SSLCertCollection SSLCertInc);
+               void UpdateStatusLabel( wxCommandEvent& event );
        public:
                /** Constructor */
                frmActivityMgr( wxWindow* parent );
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