summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/SmallDialogs.cpp15
-rw-r--r--ui/SmallDialogs.h2
-rw-r--r--ui/checkVersion.cpp32
-rw-r--r--ui/guiStatusHandler.cpp5
4 files changed, 40 insertions, 14 deletions
diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp
index db20e526..4565e16b 100644
--- a/ui/SmallDialogs.cpp
+++ b/ui/SmallDialogs.cpp
@@ -924,7 +924,7 @@ void SyncStatus::setStatusText_NoUpdate(const Zstring& text)
}
-void SyncStatus::updateStatusDialogNow()
+void SyncStatus::updateStatusDialogNow(bool flushWindowMessages)
{
//static RetrieveStatistics statistic;
@@ -988,13 +988,15 @@ void SyncStatus::updateStatusDialogNow()
bSizer28->Layout();
bSizer31->Layout();
}
- updateUiNow();
+ if (flushWindowMessages)
+ updateUiNow();
//support for pause button
while (processPaused && currentProcessIsRunning)
{
wxMilliSleep(UI_UPDATE_INTERVAL);
- updateUiNow();
+ if (flushWindowMessages)
+ updateUiNow();
}
}
@@ -1063,8 +1065,11 @@ void SyncStatus::processHasFinished(SyncStatusID id) //essential to call this in
bSizerSpeed->Show(false);
bSizerRemTime->Show(false);
- updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed
- Layout(); //
+ //ATTENTION don't call wxAPP->Yield()! at this point in time there is a mismatch between
+ //gridDataView and currentGridData!! avoid grid repaint at all costs!!
+
+ updateStatusDialogNow(false); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed
+ Layout(); //
}
diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h
index e9156665..da627e82 100644
--- a/ui/SmallDialogs.h
+++ b/ui/SmallDialogs.h
@@ -287,7 +287,7 @@ public:
void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess);
void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed);
void setStatusText_NoUpdate(const Zstring& text);
- void updateStatusDialogNow();
+ void updateStatusDialogNow(bool flushWindowMessages = true);
void setCurrentStatus(SyncStatusID id);
void processHasFinished(SyncStatusID id); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater
diff --git a/ui/checkVersion.cpp b/ui/checkVersion.cpp
index 914e5e09..16d37036 100644
--- a/ui/checkVersion.cpp
+++ b/ui/checkVersion.cpp
@@ -64,16 +64,34 @@ bool getOnlineVersion(wxString& version)
bool newerVersionExists(const wxString& onlineVersion)
{
- const wxString currentMajor = FreeFileSync::currentVersion.BeforeLast(wxT('.'));
- const wxString onlineMajor = onlineVersion.BeforeLast(wxT('.'));
+ wxString currentVersionCpy = FreeFileSync::currentVersion;
+ wxString onlineVersionCpy = onlineVersion;
- if (currentMajor != onlineMajor)
- return globalFunctions::wxStringToInt(currentMajor) < globalFunctions::wxStringToInt(onlineMajor);
+ const wxChar VERSION_SEP = wxT('.');
- const wxString currentMinor = FreeFileSync::currentVersion.AfterLast(wxT('.'));
- const wxString onlineMinor = onlineVersion.AfterLast(wxT('.'));
+ while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND &&
+ onlineVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND)
+ {
+ const wxString currentMajor = currentVersionCpy.BeforeFirst(VERSION_SEP);
+ const wxString onlineMajor = onlineVersionCpy.BeforeFirst(VERSION_SEP);
+
+ if (currentMajor != onlineMajor)
+ return globalFunctions::wxStringToInt(currentMajor) < globalFunctions::wxStringToInt(onlineMajor);
+
+ currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP);
+ onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP);
+ }
+
+ const wxString currentMinor = currentVersionCpy.BeforeFirst(VERSION_SEP); //Returns the whole string if VERSION_SEP is not found.
+ const wxString onlineMinor = onlineVersionCpy.BeforeFirst(VERSION_SEP); //Returns the whole string if VERSION_SEP is not found.
+
+ if (currentMinor != onlineMinor)
+ return globalFunctions::wxStringToInt(currentMinor) < globalFunctions::wxStringToInt(onlineMinor);
+
+ currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found.
+ onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found.
- return globalFunctions::wxStringToInt(currentMinor) < globalFunctions::wxStringToInt(onlineMinor);
+ return globalFunctions::wxStringToInt(currentVersionCpy) < globalFunctions::wxStringToInt(onlineVersionCpy);
}
diff --git a/ui/guiStatusHandler.cpp b/ui/guiStatusHandler.cpp
index 51714ed8..7929c122 100644
--- a/ui/guiStatusHandler.cpp
+++ b/ui/guiStatusHandler.cpp
@@ -64,7 +64,10 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) :
CompareStatusHandler::~CompareStatusHandler()
{
- updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks
+ //ATTENTION don't call wxAPP->Yield()! at this point in time there is a mismatch between
+ //gridDataView and currentGridData!! avoid grid repaint at all costs!!
+
+ //just DON'T: updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks
//reenable complete main dialog
mainDialog->m_notebookBottomLeft->Enable();
bgstack15