From 460091fb0b2ff114cc741372f15bb43b702ea3b1 Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:24:35 +0200 Subject: 5.16 --- RealtimeSync/main_dlg.h | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'RealtimeSync/main_dlg.h') diff --git a/RealtimeSync/main_dlg.h b/RealtimeSync/main_dlg.h index f5fed970..5a028f3a 100644 --- a/RealtimeSync/main_dlg.h +++ b/RealtimeSync/main_dlg.h @@ -12,6 +12,7 @@ #include #include #include "../ui/dir_name.h" +#include namespace xmlAccess { @@ -50,7 +51,7 @@ private: void addFolder(const wxString& dirname, bool addFront = false); void addFolder(const std::vector& newFolders, bool addFront = false); - void removeAddFolder(int pos); //keep it an int, allow negative values! + void removeAddFolder(size_t pos); void clearAddFolders(); static const wxString& lastConfigFileName(); @@ -59,6 +60,17 @@ private: std::vector dirNamesExtra; //additional pairs to the standard pair wxString currentConfigFileName; + + void onProcessAsyncTasks(wxEvent& event); + + template + void processAsync(Fun doAsync, Fun2 evalOnGui) { asyncTasks.add(doAsync, evalOnGui); timerForAsyncTasks.Start(50); /*timer interval in [ms] */ } + template + void processAsync2(Fun doAsync, Fun2 evalOnGui) { asyncTasks.add2(doAsync, evalOnGui); timerForAsyncTasks.Start(50); /*timer interval in [ms] */ } + + //schedule and run long-running tasks asynchronously, but process results on GUI queue + zen::AsyncTasks asyncTasks; + wxTimer timerForAsyncTasks; //don't use wxWidgets idle handling => repeated idle requests/consumption hogs 100% cpu! }; #endif // REALTIMESYNCMAIN_H -- cgit