X-Git-Url: http://Server1/repobrowser/?a=blobdiff_plain;ds=sidebyside;f=source%2Fcommon%2Ftimers.cpp;h=bf334bf8a0453ebc89fb566e5df62329bbcb57a2;hb=0a1c59d74f2ed87b2d374d266cd237a250f726c7;hp=d4ec0ebf0294ba78543440102ba5acdd6b360795;hpb=969329975a0af9d346c76dc34e9ff9cd54cc61ee;p=xestiaab%2F.git
diff --git a/source/common/timers.cpp b/source/common/timers.cpp
index d4ec0eb..bf334bf 100644
--- a/source/common/timers.cpp
+++ b/source/common/timers.cpp
@@ -1,4 +1,22 @@
-#include "../frmActivityMgr.h"
+// timers.cpp - Timers subroutines.
+//
+// (c) 2012-2015 Xestia Software Development.
+//
+// This file is part of Xestia Address Book.
+//
+// Xestia Address Book is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by the
+// Free Software Foundation, version 3 of the license.
+//
+// Xestia Address Book is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
+//
+// You should have received a copy of the GNU General Public License along
+// with Xestia Address Book. If not, see
+
+#include "../actmgr/frmActivityMgr.h"
#include "../frmContact.h"
#include "../frmMain.h"
#include
@@ -216,12 +234,7 @@ void wxActListProcTimer::Notify(){
for (std::map::iterator iter = ActListPtr->begin();
iter != ActListPtr->end(); ++iter){
- // Check for any queued tasks and start one.
-
- if (iter->second > 4){
- continue;
- }
-
+ // Check for any queued tasks and start one.
// 0 = Queued.
// 1 = Processing.
@@ -234,30 +247,62 @@ void wxActListProcTimer::Notify(){
// 8 = Completed. (UI Updated).
std::map::iterator LongIter = ActListUIPtr->find(iter->first);
+
+ if (iter->second > 4){
+
+ continue;
+ }
+
std::map::iterator DetailIter = ActListDetailPtr->find(iter->first);
-
+
+ wxCommandEvent uevent(ACTMGR_UPDATESTATUSLABEL);
+ ActivityMgrLabelUpdate *ueventdata = new ActivityMgrLabelUpdate;
+ uevent.SetClientData(ueventdata);
+
if (iter->second == 1){
- lstActivityPtr->SetItem(LongIter->second, 2, _("Processing..."));
+ ueventdata->ItemIndex = LongIter->second;
+ ueventdata->ItemLabel = _("Processing...");
+ //ueventdata->ItemDes = _("Adding Contact '") + DetailIter->second + _("'...");
+
+ wxPostEvent(static_cast(ActMgrPtr), uevent);
+
+ /*lstActivityPtr->SetItem(LongIter->second, 2, _("Processing..."));
if (ActListDetailPtr->find(iter->first) != ActListDetailPtr->end()){
lblDetailsPtr->SetLabel(_("Adding Contact '") + DetailIter->second + _("'..."));
- }
- //CardDAVIter->second.
+ }*/
} else if (iter->second == 2){
- lstActivityPtr->SetItem(LongIter->second, 2, _("Failed"));
- iter->second = 5;
-
+ ueventdata->ItemIndex = LongIter->second;
+ ueventdata->ItemLabel = _("Failed");
+
+ wxPostEvent(static_cast(ActMgrPtr), uevent);
+ iter->second = 5;
+
+ //lstActivityPtr->SetItem(LongIter->second, 2, _("Failed"));
+
} else if (iter->second == 3){
+
+ ueventdata->ItemIndex = LongIter->second;
+ ueventdata->ItemLabel = _("Stopped");
+
+ wxPostEvent(static_cast(ActMgrPtr), uevent);
+ iter->second = 5;
- lstActivityPtr->SetItem(LongIter->second, 2, _("Stopped"));
- iter->second = 6;
+ //lstActivityPtr->SetItem(LongIter->second, 2, _("Stopped"));
+ //iter->second = 6;
} else if (iter->second == 4){
- lstActivityPtr->SetItem(LongIter->second, 2, _("Completed"));
- iter->second = 8;
+ ueventdata->ItemIndex = LongIter->second;
+ ueventdata->ItemLabel = _("Completed");
+
+ wxPostEvent(static_cast(ActMgrPtr), uevent);
+ iter->second = 8;
+
+ //lstActivityPtr->SetItem(LongIter->second, 2, _("Completed"));
+ //iter->second = 8;
}
@@ -268,6 +313,12 @@ void wxActListProcTimer::Notify(){
ActListFinDTPtr->insert(std::make_pair(iter->first, adt));
+ // Delete the connection object.
+
+ std::map::iterator ConnObject = ActListConnPtr->find(iter->first);
+ delete ConnObject->second;
+ ConnObject->second = NULL;
+
}
if (ClearupProcessed == TRUE){
@@ -297,7 +348,7 @@ void wxActListProcTimer::SetupPointers(std::map *ActList, std::map *ActListDetail, bool *TasksActive,
wxListCtrl *lstActivity, wxStaticText *lblDetails, wxGauge *GauProgress,
void *ActMgr, wxActTimer *ActTimer, wxActProcessTimer *ActProcessTimer,
- std::map *ActListFinDT){
+ std::map *ActListFinDT, std::map *ActListConn){
ActListPtr = ActList;
ActListUIPtr = ActListUI;
@@ -310,6 +361,7 @@ void wxActListProcTimer::SetupPointers(std::map *ActList, std::map