summaryrefslogtreecommitdiff
path: root/library/statusHandler.cpp
diff options
context:
space:
mode:
authorDaniel Wilhelm <daniel@wili.li>2014-04-18 16:55:48 +0200
committerDaniel Wilhelm <daniel@wili.li>2014-04-18 16:55:48 +0200
commitdaea231de0ae28fc8343f29f09d0457cc0591461 (patch)
treea1d572442d2c903e40741a859ad47c8b0d740969 /library/statusHandler.cpp
parent1.13 (diff)
downloadFreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.tar.gz
FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.tar.bz2
FreeFileSync-daea231de0ae28fc8343f29f09d0457cc0591461.zip
1.14
Diffstat (limited to 'library/statusHandler.cpp')
-rw-r--r--library/statusHandler.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/library/statusHandler.cpp b/library/statusHandler.cpp
new file mode 100644
index 00000000..e19c9904
--- /dev/null
+++ b/library/statusHandler.cpp
@@ -0,0 +1,28 @@
+#include "statusHandler.h"
+#include <wx/app.h>
+#include <wx/timer.h>
+
+
+void updateUiNow()
+{
+ //process UI events and prevent application from "not responding" -> NO performance issue!
+ wxTheApp->Yield();
+
+ // while (wxTheApp->Pending())
+ // wxTheApp->Dispatch();
+}
+
+
+bool updateUiIsAllowed()
+{
+ static wxLongLong lastExec = 0;
+
+ wxLongLong newExec = wxGetLocalTimeMillis();
+
+ if (newExec - lastExec >= UI_UPDATE_INTERVAL) //perform ui updates not more often than necessary
+ {
+ lastExec = newExec;
+ return true;
+ }
+ return false;
+}
bgstack15