summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/MainDialog.cpp359
-rw-r--r--ui/MainDialog.h5
-rw-r--r--ui/SmallDialogs.cpp37
-rw-r--r--ui/SmallDialogs.h7
-rw-r--r--ui/SyncDialog.cpp104
-rw-r--r--ui/SyncDialog.h3
-rw-r--r--ui/guiGenerated.cpp77
-rw-r--r--ui/guiGenerated.h12
8 files changed, 398 insertions, 206 deletions
diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp
index e1681d13..7b7a5c37 100644
--- a/ui/MainDialog.cpp
+++ b/ui/MainDialog.cpp
@@ -10,7 +10,7 @@
#include "mainDialog.h"
#include <wx/filename.h>
#include "../library/globalFunctions.h"
-#include <fstream>
+#include <wx/wfstream.h>
#include <wx/clipbrd.h>
#include <wx/file.h>
#include "../library/customGrid.h"
@@ -182,7 +182,9 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale
case wxLANGUAGE_GERMAN:
m_menuItemGerman->Check();
break;
-
+ case wxLANGUAGE_FRENCH:
+ m_menuItemFrench->Check();
+ break;
default:
m_menuItemEnglish->Check();
}
@@ -260,7 +262,7 @@ MainDialog::~MainDialog()
writeConfigurationToHD(FreeFileSync::FfsLastConfigFile); //don't trow exceptions in destructors
- if (restartOnExit)
+ if (restartOnExit) //needed so that restart is scheduled AFTER configuration was written!
{ //create new dialog
MainDialog* frame = new MainDialog(0L, FreeFileSync::FfsLastConfigFile, programLanguage);
frame->SetIcon(*GlobalResources::programIcon); //set application icon
@@ -635,7 +637,7 @@ public:
void updateStatusText(const wxString& text) {}
void initNewProcess(int objectsTotal, double dataTotal, int processID) {}
void updateProcessedData(int objectsProcessed, double dataProcessed) {}
- void triggerUI_Refresh() {}
+ void triggerUI_Refresh(bool asyncProcessActive) {}
private:
bool continueOnError;
@@ -1236,119 +1238,116 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS
{
char bigBuffer[10000];
- ifstream config(filename.c_str());
- if (!config)
- {
- if (programStartup)
- loadDefaultConfiguration();
- else
- wxMessageBox(wxString(_("Could not read configuration file ")) + wxT("\"") + filename + wxT("\""), _("An exception occured!"), wxOK | wxICON_ERROR);
-
- return;
- }
-
- //read FFS identifier
- config.get(bigBuffer, FreeFileSync::FfsConfigFileID.size() + 1);
-
- if (string(bigBuffer) != FreeFileSync::FfsConfigFileID)
+ if (wxFileExists(filename))
{
- wxMessageBox(_("The selected file does not contain a valid configuration!"), _("Warning"), wxOK);
- config.close();
- return;
- }
-
-
- //put filename on list of last used config files
- addCfgFileToHistory(filename);
-
+ wxFFileInputStream config(filename);
+ if (config.IsOk())
+ {
- //read sync configuration
- cfg.syncConfiguration.exLeftSideOnly = SyncDirection(config.get());
- cfg.syncConfiguration.exRightSideOnly = SyncDirection(config.get());
- cfg.syncConfiguration.leftNewer = SyncDirection(config.get());
- cfg.syncConfiguration.rightNewer = SyncDirection(config.get());
- cfg.syncConfiguration.different = SyncDirection(config.get());
+ //read FFS identifier
+ config.Read(bigBuffer, FreeFileSync::FfsConfigFileID.size());
+ bigBuffer[FreeFileSync::FfsConfigFileID.size()] = 0;
- //read compare algorithm
- cfg.compareVar = CompareVariant(config.get());
- updateCompareButtons();
+ if (string(bigBuffer) != FreeFileSync::FfsConfigFileID)
+ {
+ wxMessageBox(_("The selected file does not contain a valid configuration!"), _("Warning"), wxOK);
+ return;
+ }
- //read column sizes
- for (int i = 0; i < m_grid1->GetNumberCols(); ++i)
- {
- config.getline(bigBuffer, 100, char(0));
- m_grid1->SetColSize(i, atoi(bigBuffer));
- }
- for (int i = 0; i < m_grid2->GetNumberCols(); ++i)
- {
- config.getline(bigBuffer, 100, char(0));
- m_grid2->SetColSize(i, atoi(bigBuffer));
- }
+ //put filename on list of last used config files
+ addCfgFileToHistory(filename);
- //read application window size and position
- bool startWindowMaximized = bool(config.get());
+ //read sync configuration
+ cfg.syncConfiguration.exLeftSideOnly = SyncDirection(config.GetC());
+ cfg.syncConfiguration.exRightSideOnly = SyncDirection(config.GetC());
+ cfg.syncConfiguration.leftNewer = SyncDirection(config.GetC());
+ cfg.syncConfiguration.rightNewer = SyncDirection(config.GetC());
+ cfg.syncConfiguration.different = SyncDirection(config.GetC());
- config.getline(bigBuffer, 100, char(0));
- int widthTmp = atoi(bigBuffer);
- config.getline(bigBuffer, 100, char(0));
- int heighthTmp = atoi(bigBuffer);
+ //read compare algorithm
+ cfg.compareVar = CompareVariant(config.GetC());
+ updateCompareButtons();
- config.getline(bigBuffer, 100, char(0));
- int posX_Tmp = atoi(bigBuffer);
- config.getline(bigBuffer, 100, char(0));
- int posY_Tmp = atoi(bigBuffer);
+ //read column sizes
+ for (int i = 0; i < m_grid1->GetNumberCols(); ++i)
+ m_grid1->SetColSize(i, globalFunctions::readInt(config));
- //apply window size and position at program startup ONLY
- if (programStartup)
- {
- widthNotMaximized = widthTmp;
- heightNotMaximized = heighthTmp;
- posXNotMaximized = posX_Tmp;
- posYNotMaximized = posY_Tmp;
+ for (int i = 0; i < m_grid2->GetNumberCols(); ++i)
+ m_grid2->SetColSize(i, globalFunctions::readInt(config));
- //apply window size and position
- SetSize(posXNotMaximized, posYNotMaximized, widthNotMaximized, heightNotMaximized);
- Maximize(startWindowMaximized);
- }
+ //read application window size and position
+ bool startWindowMaximized = bool(config.GetC());
- //read last directory selection
- config.getline(bigBuffer, 10000, char(0));
- m_directoryPanel1->SetValue(bigBuffer);
- if (wxDirExists(bigBuffer))
- m_dirPicker1->SetPath(bigBuffer);
+ int widthTmp = globalFunctions::readInt(config);
+ int heighthTmp = globalFunctions::readInt(config);
+ int posX_Tmp = globalFunctions::readInt(config);
+ int posY_Tmp = globalFunctions::readInt(config);
- config.getline(bigBuffer, 10000, char(0));
- m_directoryPanel2->SetValue(bigBuffer);
- if (wxDirExists(bigBuffer))
- m_dirPicker2->SetPath(bigBuffer);
+ //apply window size and position at program startup ONLY
+ if (programStartup)
+ {
+ widthNotMaximized = widthTmp;
+ heightNotMaximized = heighthTmp;
+ posXNotMaximized = posX_Tmp;
+ posYNotMaximized = posY_Tmp;
+
+ //apply window size and position
+ SetSize(posXNotMaximized, posYNotMaximized, widthNotMaximized, heightNotMaximized);
+ Maximize(startWindowMaximized);
+ }
- //read filter settings:
- cfg.hideFiltered = bool(config.get());
- m_checkBoxHideFilt->SetValue(cfg.hideFiltered);
+ //read last directory selection
+ int byteCount = globalFunctions::readInt(config);
+ config.Read(bigBuffer, byteCount);
+ wxString leftDir = wxString::FromUTF8(bigBuffer, byteCount);
+ m_directoryPanel1->SetValue(leftDir);
+ if (wxDirExists(leftDir))
+ m_dirPicker1->SetPath(leftDir);
+
+ byteCount = globalFunctions::readInt(config);
+ config.Read(bigBuffer, byteCount);
+ wxString rightDir = wxString::FromUTF8(bigBuffer, byteCount);
+ m_directoryPanel2->SetValue(rightDir);
+ if (wxDirExists(rightDir))
+ m_dirPicker2->SetPath(rightDir);
+
+ //read filter settings:
+ cfg.hideFiltered = bool(config.GetC());
+ m_checkBoxHideFilt->SetValue(cfg.hideFiltered);
+
+ cfg.filterIsActive = bool(config.GetC());
+ updateFilterButton(m_bpButtonFilter, cfg.filterIsActive);
- cfg.filterIsActive = bool(config.get());
- updateFilterButton(m_bpButtonFilter, cfg.filterIsActive);
+ //include
+ byteCount = globalFunctions::readInt(config);
+ config.Read(bigBuffer, byteCount);
+ cfg.includeFilter = wxString::FromUTF8(bigBuffer, byteCount);
- //include
- config.getline(bigBuffer, 10000, char(0));
- cfg.includeFilter = bigBuffer;
+ //exclude
+ byteCount = globalFunctions::readInt(config);
+ config.Read(bigBuffer, byteCount);
+ cfg.excludeFilter = wxString::FromUTF8(bigBuffer, byteCount);
- //exclude
- config.getline(bigBuffer, 10000, char(0));
- cfg.excludeFilter = bigBuffer;
+ cfg.useRecycleBin = bool(config.GetC());
- cfg.useRecycleBin = bool(config.get());
+ cfg.continueOnError = bool(config.GetC());
- cfg.continueOnError = bool(config.get());
+ return;
+ }
+ }
- config.close();
+ //handle error situation:
+ if (programStartup)
+ loadDefaultConfiguration();
+ else
+ wxMessageBox(wxString(_("Could not read configuration file ")) + wxT("\"") + filename + wxT("\""), _("An exception occured!"), wxOK | wxICON_ERROR);
}
void MainDialog::writeConfigurationToHD(const wxString& filename)
{
- ofstream config(filename.c_str());
- if (!config)
+ wxFFileOutputStream config(filename);
+ if (!config.IsOk())
{
wxMessageBox(wxString(_("Could not write to ")) + wxT("\"") + filename + wxT("\""), _("An exception occured!"), wxOK | wxICON_ERROR);
return;
@@ -1358,51 +1357,64 @@ void MainDialog::writeConfigurationToHD(const wxString& filename)
addCfgFileToHistory(filename);
//write FFS identifier
- config<<FreeFileSync::FfsConfigFileID.c_str();
+ config.Write(FreeFileSync::FfsConfigFileID.c_str(), FreeFileSync::FfsConfigFileID.size());
//write sync configuration
- config<<char(cfg.syncConfiguration.exLeftSideOnly)
- <<char(cfg.syncConfiguration.exRightSideOnly)
- <<char(cfg.syncConfiguration.leftNewer)
- <<char(cfg.syncConfiguration.rightNewer)
- <<char(cfg.syncConfiguration.different);
+ config.PutC(char(cfg.syncConfiguration.exLeftSideOnly));
+ config.PutC(char(cfg.syncConfiguration.exRightSideOnly));
+ config.PutC(char(cfg.syncConfiguration.leftNewer));
+ config.PutC(char(cfg.syncConfiguration.rightNewer));
+ config.PutC(char(cfg.syncConfiguration.different));
//write compare algorithm
- config<<char(cfg.compareVar);
+ config.PutC(char(cfg.compareVar));
//write column sizes
for (int i = 0; i < m_grid1->GetNumberCols(); ++i)
- config<<m_grid1->GetColSize(i)<<char(0);
+ globalFunctions::writeInt(config, m_grid1->GetColSize(i));
+
for (int i = 0; i < m_grid2->GetNumberCols(); ++i)
- config<<m_grid2->GetColSize(i)<<char(0);
+ globalFunctions::writeInt(config, m_grid2->GetColSize(i));
//write application window size and position
- config<<char(IsMaximized());
+ config.PutC(char(IsMaximized()));
//window size
- config<<widthNotMaximized<<char(0);
- config<<heightNotMaximized<<char(0);
+ globalFunctions::writeInt(config, widthNotMaximized);
+ globalFunctions::writeInt(config, heightNotMaximized);
//window position
- config<<posXNotMaximized<<char(0);
- config<<posYNotMaximized<<char(0);
+ globalFunctions::writeInt(config, posXNotMaximized);
+ globalFunctions::writeInt(config, posYNotMaximized);
//write last directory selection
- config<<m_directoryPanel1->GetValue().c_str()<<char(0)
- <<m_directoryPanel2->GetValue().c_str()<<char(0);
+ wxCharBuffer buffer = (m_directoryPanel1->GetValue()).ToUTF8();
+ int byteCount = strlen(buffer);
+ globalFunctions::writeInt(config, byteCount);
+ config.Write(buffer, byteCount);
+
+ buffer = (m_directoryPanel2->GetValue()).ToUTF8();
+ byteCount = strlen(buffer);
+ globalFunctions::writeInt(config, byteCount);
+ config.Write(buffer, byteCount);
//write filter settings
- config<<char(cfg.hideFiltered);
- config<<char(cfg.filterIsActive);
+ config.PutC(char(cfg.hideFiltered));
+ config.PutC(char(cfg.filterIsActive));
- config<<cfg.includeFilter.c_str()<<char(0)
- <<cfg.excludeFilter.c_str()<<char(0);
+ buffer = (cfg.includeFilter).ToUTF8();
+ byteCount = strlen(buffer);
+ globalFunctions::writeInt(config, byteCount);
+ config.Write(buffer, byteCount);
- config<<char(cfg.useRecycleBin);
+ buffer = (cfg.excludeFilter).ToUTF8();
+ byteCount = strlen(buffer);
+ globalFunctions::writeInt(config, byteCount);
+ config.Write(buffer, byteCount);
- config<<char(cfg.continueOnError);
+ config.PutC(char(cfg.useRecycleBin));
- config.close();
+ config.PutC(char(cfg.continueOnError));
}
@@ -2009,8 +2021,10 @@ void MainDialog::updateStatusInformation(const GridView& visibleGrid)
while (stackObjects.size() > 0)
stackObjects.pop();
- unsigned int objectsOnLeftView = 0;
- unsigned int objectsOnRightView = 0;
+ unsigned int filesOnLeftView = 0;
+ unsigned int foldersOnLeftView = 0;
+ unsigned int filesOnRightView = 0;
+ unsigned int foldersOnRightView = 0;
wxULongLong filesizeLeftView;
wxULongLong filesizeRightView;
@@ -2022,27 +2036,55 @@ void MainDialog::updateStatusInformation(const GridView& visibleGrid)
{
const FileCompareLine& refLine = currentGridData[*i];
- //calculate total number of bytes for each sied
- if (refLine.fileDescrLeft.objType != TYPE_NOTHING)
+ //calculate total number of bytes for each side
+ if (refLine.fileDescrLeft.objType == TYPE_FILE)
{
filesizeLeftView+= refLine.fileDescrLeft.fileSize;
- ++objectsOnLeftView;
+ ++filesOnLeftView;
}
+ else if (refLine.fileDescrLeft.objType == TYPE_DIRECTORY)
+ ++foldersOnLeftView;
- if (refLine.fileDescrRight.objType != TYPE_NOTHING)
+ if (refLine.fileDescrRight.objType == TYPE_FILE)
{
filesizeRightView+= refLine.fileDescrRight.fileSize;
- ++objectsOnRightView;
+ ++filesOnRightView;
}
+ else if (refLine.fileDescrRight.objType == TYPE_DIRECTORY)
+ ++foldersOnRightView;
}
+//#################################################
+// format numbers to text
- //show status information on "root" level. This cannot be accomplished in writeGrid since filesizes are already formatted for display there
- wxString objectsViewLeft = numberToWxString(objectsOnLeftView);
- globalFunctions::includeNumberSeparator(objectsViewLeft);
- if (objectsOnLeftView == 1)
- statusLeftNew = wxString(_("1 item on left, ")) + FreeFileSync::formatFilesizeToShortString(filesizeLeftView);
- else
- statusLeftNew = objectsViewLeft + _(" items on left, ") + FreeFileSync::formatFilesizeToShortString(filesizeLeftView);
+//show status information on "root" level. This cannot be accomplished in writeGrid since filesizes are already formatted for display there
+ if (foldersOnLeftView)
+ {
+ wxString folderCount = numberToWxString(foldersOnLeftView);
+ globalFunctions::includeNumberSeparator(folderCount);
+
+ statusLeftNew+= folderCount;
+ if (foldersOnLeftView == 1)
+ statusLeftNew+= _(" directory");
+ else
+ statusLeftNew+= _(" directories");
+
+ if (filesOnLeftView)
+ statusLeftNew+= wxT(", ");
+ }
+
+ if (filesOnLeftView)
+ {
+ wxString fileCount = numberToWxString(filesOnLeftView);
+ globalFunctions::includeNumberSeparator(fileCount);
+
+ statusLeftNew+= fileCount;
+ if (filesOnLeftView == 1)
+ statusLeftNew+= _(" file, ");
+ else
+ statusLeftNew+= _(" files, ");
+
+ statusLeftNew+= FreeFileSync::formatFilesizeToShortString(filesizeLeftView);
+ }
wxString objectsTotal = numberToWxString(currentGridData.size());
globalFunctions::includeNumberSeparator(objectsTotal);
@@ -2054,12 +2096,35 @@ void MainDialog::updateStatusInformation(const GridView& visibleGrid)
statusMiddleNew = objectsView + _(" of ") + objectsTotal + _(" rows in view");
- wxString objectsViewRight = numberToWxString(objectsOnRightView);
- globalFunctions::includeNumberSeparator(objectsViewRight);
- if (objectsOnRightView == 1)
- statusRightNew = wxString(_("1 item on right, ")) + FreeFileSync::formatFilesizeToShortString(filesizeRightView);
- else
- statusRightNew = objectsViewRight + _(" items on right, ") + FreeFileSync::formatFilesizeToShortString(filesizeRightView);
+ if (foldersOnRightView)
+ {
+ wxString folderCount = numberToWxString(foldersOnRightView);
+ globalFunctions::includeNumberSeparator(folderCount);
+
+ statusRightNew+= folderCount;
+ if (foldersOnRightView == 1)
+ statusRightNew+= _(" directory");
+ else
+ statusRightNew+= _(" directories");
+
+ if (filesOnRightView)
+ statusRightNew+= wxT(", ");
+ }
+
+ if (filesOnRightView)
+ {
+ wxString fileCount = numberToWxString(filesOnRightView);
+ globalFunctions::includeNumberSeparator(fileCount);
+
+ statusRightNew+= fileCount;
+ if (filesOnRightView == 1)
+ statusRightNew+= _(" file, ");
+ else
+ statusRightNew+= _(" files, ");
+
+ statusRightNew+= FreeFileSync::formatFilesizeToShortString(filesizeRightView);
+ }
+
//avoid screen flicker
if (m_staticTextStatusLeft->GetLabel() != statusLeftNew)
@@ -2288,7 +2353,7 @@ inline
void CompareStatusUpdater::updateProcessedData(int objectsProcessed, double dataProcessed)
{
if (currentProcess == FreeFileSync::scanningFilesProcess)
- statusPanel->incScannedFiles_NoUpdate(objectsProcessed);
+ statusPanel->incScannedObjects_NoUpdate(objectsProcessed);
else if (currentProcess == FreeFileSync::compareFileContentProcess)
statusPanel->incProcessedCmpData_NoUpdate(objectsProcessed, dataProcessed);
else assert(false);
@@ -2329,9 +2394,10 @@ int CompareStatusUpdater::reportError(const wxString& text)
inline
-void CompareStatusUpdater::triggerUI_Refresh()
+void CompareStatusUpdater::triggerUI_Refresh(bool asyncProcessActive)
{
- if (abortionRequested) throw AbortThisProcess(); //abort can be triggered by syncStatusFrame
+ if (abortionRequested && !asyncProcessActive)
+ throw AbortThisProcess(); //abort can be triggered by syncStatusFrame
if (updateUI_IsAllowed()) //test if specific time span between ui updates is over
statusPanel->updateStatusPanelNow();
@@ -2441,9 +2507,9 @@ int SyncStatusUpdater::reportError(const wxString& text)
}
-void SyncStatusUpdater::triggerUI_Refresh()
+void SyncStatusUpdater::triggerUI_Refresh(bool asyncProcessActive)
{
- if (abortionRequested)
+ if (abortionRequested && !asyncProcessActive)
throw AbortThisProcess(); //abort can be triggered by syncStatusFrame
if (updateUI_IsAllowed()) //test if specific time span between ui updates is over
@@ -2560,3 +2626,12 @@ void MainDialog::OnMenuLangGerman(wxCommandEvent& event)
event.Skip();
}
+
+void MainDialog::OnMenuLangFrench(wxCommandEvent& event)
+{
+ programLanguage->loadLanguageFile(wxLANGUAGE_FRENCH); //language is a global attribute
+ restartOnExit = true;
+ Destroy();
+ event.Skip();
+}
+
diff --git a/ui/MainDialog.h b/ui/MainDialog.h
index 3bc4c590..3ef7dbf5 100644
--- a/ui/MainDialog.h
+++ b/ui/MainDialog.h
@@ -136,6 +136,7 @@ private:
void OnMenuQuit( wxCommandEvent& event);
void OnMenuLangEnglish( wxCommandEvent& event);
void OnMenuLangGerman( wxCommandEvent& event);
+ void OnMenuLangFrench( wxCommandEvent& event);
void enableSynchronization(bool value);
@@ -227,7 +228,7 @@ public:
void updateProcessedData(int objectsProcessed, double dataProcessed);
int reportError(const wxString& text);
- void triggerUI_Refresh();
+ void triggerUI_Refresh(bool asyncProcessActive);
private:
MainDialog* mainDialog;
@@ -248,7 +249,7 @@ public:
void updateProcessedData(int objectsProcessed, double dataProcessed);
int reportError(const wxString& text);
- void triggerUI_Refresh();
+ void triggerUI_Refresh(bool asyncProcessActive);
private:
SyncStatus* syncStatusFrame;
diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp
index 3961e28a..7965a5c9 100644
--- a/ui/SmallDialogs.cpp
+++ b/ui/SmallDialogs.cpp
@@ -14,7 +14,7 @@ AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window)
m_bitmap13->SetBitmap(*GlobalResources::bitmapGPL);
//build information
- wxString build = wxString(_("(Build: ")) + __TDATE__;
+ wxString build = wxString(wxT("(")) + _("Build: ") + __TDATE__;
#if wxUSE_UNICODE
build+= wxT(" - Unicode");
#else
@@ -109,8 +109,8 @@ void FilterDlg::OnCancel(wxCommandEvent& event)
void FilterDlg::OnDefault(wxCommandEvent& event)
{
- m_textCtrlInclude->SetValue("*");
- m_textCtrlExclude->SetValue("");
+ m_textCtrlInclude->SetValue(wxT("*"));
+ m_textCtrlExclude->SetValue(wxEmptyString);
//changes to mainDialog are only committed when the OK button is pressed
event.Skip();
@@ -304,6 +304,8 @@ SyncStatus::SyncStatus(StatusUpdater* updater, wxWindow* parentWindow) :
if (windowToDis) //disable (main) window while this status dialog is shown
windowToDis->Disable();
+
+ timeElapsed.Start(); //measure total time
}
@@ -362,8 +364,12 @@ void SyncStatus::updateStatusDialogNow()
const wxString remainingBytes = FreeFileSync::formatFilesizeToShortString(totalData - currentData);
m_staticTextDataRemaining->SetLabel(remainingBytes);
+ //time elapsed
+ m_staticTextTimeElapsed->SetLabel((wxTimeSpan::Milliseconds(timeElapsed.Time())).Format());
+
//do the ui update
bSizer28->Layout();
+ bSizer31->Layout();
updateUI_Now();
//support for pause button
@@ -431,7 +437,6 @@ void SyncStatus::processHasFinished(SyncStatusID id) //essential to call this in
m_buttonOK->SetFocus();
m_animationControl1->Stop();
-
//m_animationControl1->SetInactiveBitmap(*GlobalResources::bitmapFinished);
m_animationControl1->Hide();
@@ -453,13 +458,14 @@ void SyncStatus::OnPause(wxCommandEvent& event)
processPaused = false;
m_buttonPause->SetLabel(_("Pause"));
m_animationControl1->Play();
-
+ timeElapsed.Resume();
}
else
{
processPaused = true;
m_buttonPause->SetLabel(_("Continue"));
m_animationControl1->Stop();
+ timeElapsed.Pause();
}
}
@@ -467,7 +473,18 @@ void SyncStatus::OnPause(wxCommandEvent& event)
void SyncStatus::OnAbort(wxCommandEvent& event)
{
processPaused = false;
- if (currentProcessIsRunning) currentStatusUpdater->requestAbortion();
+ if (currentProcessIsRunning)
+ {
+ m_buttonAbort->Disable();
+ m_buttonAbort->Hide();
+ m_buttonPause->Disable();
+ m_buttonPause->Hide();
+
+ setStatusText_NoUpdate(_("Abort requested: Waiting for current operation to finish..."));
+ //no Layout() or UI-update here to avoid cascaded Yield()-call
+
+ currentStatusUpdater->requestAbortion();
+ }
}
@@ -483,7 +500,7 @@ void SyncStatus::OnClose(wxCloseEvent& event)
CompareStatus::CompareStatus(wxWindow* parentWindow) :
CompareStatusGenerated(parentWindow),
- scannedFiles(0),
+ scannedObjects(0),
totalCmpData(0),
processedCmpData(0),
scalingFactorCmp(0),
@@ -526,9 +543,9 @@ void CompareStatus::resetCmpGauge(int totalCmpObjectsToProcess, double totalCmpD
}
-void CompareStatus::incScannedFiles_NoUpdate(int number)
+void CompareStatus::incScannedObjects_NoUpdate(int number)
{
- scannedFiles+= number;
+ scannedObjects+= number;
}
@@ -553,7 +570,7 @@ void CompareStatus::updateStatusPanelNow()
//status texts
m_textCtrlFilename->SetValue(currentStatusText);
- m_staticTextScanned->SetLabel(numberToWxString(scannedFiles));
+ m_staticTextScanned->SetLabel(numberToWxString(scannedObjects));
//progress indicator for "compare file content"
m_gauge2->SetValue(int(processedCmpData * scalingFactorCmp));
diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h
index 127947f6..e97362d5 100644
--- a/ui/SmallDialogs.h
+++ b/ui/SmallDialogs.h
@@ -3,6 +3,7 @@
#include "../FreeFileSync.h"
#include "guiGenerated.h"
+#include <wx/stopwatch.h>
class AboutDlg : public AboutDlgGenerated
{
@@ -114,6 +115,8 @@ private:
void OnAbort(wxCommandEvent& event);
void OnClose(wxCloseEvent& event);
+ wxStopWatch timeElapsed;
+
StatusUpdater* currentStatusUpdater;
wxWindow* windowToDis;
bool currentProcessIsRunning;
@@ -162,14 +165,14 @@ public:
~CompareStatus();
void resetCmpGauge(int totalCmpObjectsToProcess, double totalCmpDataToProcess);
- void incScannedFiles_NoUpdate(int number);
+ void incScannedObjects_NoUpdate(int number);
void incProcessedCmpData_NoUpdate(int objectsProcessed, double dataProcessed);
void setStatusText_NoUpdate(const wxString& text);
void updateStatusPanelNow();
private:
//status variables
- unsigned int scannedFiles;
+ unsigned int scannedObjects;
wxString currentStatusText;
//gauge variables
diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp
index efe85553..3fa8619c 100644
--- a/ui/SyncDialog.cpp
+++ b/ui/SyncDialog.cpp
@@ -3,7 +3,7 @@
#include "../library/resources.h"
#include <wx/msgdlg.h>
#include <wx/stdpaths.h>
-#include <fstream>
+#include <wx/ffile.h>
using namespace std;
@@ -61,6 +61,9 @@ SyncDialog::SyncDialog(wxWindow* window,
m_radioBtn3->SetValue(true); //other
m_bpButton18->SetLabel(_("&Start"));
+
+ //set tooltip for ambivalent category "different"
+ adjustToolTips(m_bitmap17, config.compareVar);
}
//#################################################################################################################
@@ -157,6 +160,22 @@ void SyncDialog::updateConfigIcons(wxBitmapButton* button1,
}
+void SyncDialog::adjustToolTips(wxStaticBitmap* bitmap, const CompareVariant var)
+{
+ //set tooltip for ambivalent category "different"
+ if (var == CMP_BY_TIME_SIZE)
+ {
+ bitmap->SetToolTip(_("Files that exist on both sides, have same date but different filesizes"));
+ }
+ else if (var == CMP_BY_CONTENT)
+ {
+ bitmap->SetToolTip(_("Files that exist on both sides and have different content"));
+ }
+ else
+ assert(false);
+}
+
+
void SyncDialog::calculatePreview()
{
//update preview of bytes to be transferred:
@@ -349,6 +368,8 @@ BatchDialog::BatchDialog(wxWindow* window,
default:
assert (false);
}
+ //adjust toolTip
+ SyncDialog::adjustToolTips(m_bitmap17, config.compareVar);
filterIsActive = config.filterIsActive;
updateFilterButton();
@@ -447,6 +468,24 @@ void BatchDialog::OnSelectRecycleBin(wxCommandEvent& event)
}
+void BatchDialog::OnChangeCompareVar(wxCommandEvent& event)
+{
+ CompareVariant var;
+ if (m_radioBtnSizeDate->GetValue())
+ var = CMP_BY_TIME_SIZE;
+ else if (m_radioBtnContent->GetValue())
+ var = CMP_BY_CONTENT;
+ else
+ {
+ assert(false);
+ var = CMP_BY_TIME_SIZE;
+ }
+
+ //set tooltip for ambivalent category "different"
+ SyncDialog::adjustToolTips(m_bitmap17, var);
+}
+
+
void BatchDialog::OnClose(wxCloseEvent& event)
{
EndModal(0);
@@ -479,7 +518,6 @@ void BatchDialog::OnCreateJob(wxCommandEvent& event)
return;
}
-
//get a filename
#ifdef FFS_WIN
wxString fileName = wxT("SyncJob.cmd"); //proposal
@@ -499,43 +537,49 @@ void BatchDialog::OnCreateJob(wxCommandEvent& event)
wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString(wxT("\"")) + fileName + wxT("\"") + _(" already exists. Overwrite?"), _("Warning") , wxOK | wxCANCEL);
if (messageDlg->ShowModal() != wxID_OK)
- {
- event.Skip();
return;
- }
}
//assemble command line parameters
- wxString outputString = parseConfiguration();
+ wxString outputString;
+ try
+ {
+ outputString+= parseConfiguration();
+ }
+ catch (const FileError& error)
+ {
+ wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR);
+ return;
+ }
//write export file
- ofstream output(fileName.c_str());
- if (output)
+ wxFFile output(fileName, wxT("w"));
+ if (output.IsOpened())
{
- output<<outputString.c_str();
- EndModal(batchFileCreated);
- }
- else
- wxMessageBox(wxString(_("Could not write to ")) + wxT("\"") + fileName + wxT("\""), _("An exception occured!"), wxOK | wxICON_ERROR);
- }
+ output.Write(outputString);
#ifdef FFS_LINUX
- //for linux the batch file needs the executable flag
- wxExecute(wxString(wxT("chmod +x ")) + fileName);
+ //for linux the batch file needs the executable flag
+ output.Close();
+ wxExecute(wxString(wxT("chmod +x ")) + fileName);
#endif // FFS_LINUX
- event.Skip();
+ EndModal(batchFileCreated);
+ }
+ else
+ wxMessageBox(wxString(_("Could not write to ")) + wxT("\"") + fileName + wxT("\""), _("Error"), wxOK | wxICON_ERROR);
+ }
}
wxString getFormattedSyncDirection(const SyncDirection direction)
{
if (direction == SYNC_DIR_RIGHT)
- return 'R';
+ return wxChar('R');
else if (direction == SYNC_DIR_LEFT)
- return 'L';
+ return wxChar('L');
else if (direction == SYNC_DIR_NONE)
- return 'N';
+ return wxChar('N');
else
{
assert (false);
@@ -587,8 +631,28 @@ wxString BatchDialog::parseConfiguration()
if (m_checkBoxSilent->GetValue())
output+= wxString(wxT(" -")) + GlobalResources::paramSilent;
+#ifdef FFS_WIN
+ //retrieve 8.3 directory names to handle unicode names in batch file correctly
+ wxChar buffer[MAX_PATH];
+ if (GetShortPathName(
+ (m_directoryPanel1->GetValue()).c_str(), // points to a null-terminated path string
+ buffer, // points to a buffer to receive the null-terminated short form of the path
+ MAX_PATH // specifies the size of the buffer pointed to by lpszShortPath
+ ) == 0)
+ throw FileError(wxString(_("Could not retrieve the 8.3 directory name of ")) + wxT("\"") + m_directoryPanel1->GetValue() + wxT("\""));
+ output+= wxString(wxT(" ")) + buffer;
+
+ if (GetShortPathName(
+ (m_directoryPanel2->GetValue()).c_str(), // points to a null-terminated path string
+ buffer, // points to a buffer to receive the null-terminated short form of the path
+ MAX_PATH // specifies the size of the buffer pointed to by lpszShortPath
+ ) == 0)
+ throw FileError(wxString(_("Could not retrieve the 8.3 directory name of ")) + wxT("\"") + m_directoryPanel2->GetValue() + wxT("\""));
+ output+= wxString(wxT(" ")) + buffer;
+#else
output+= wxString(wxT(" ")) + wxT("\"") + wxDir(m_directoryPanel1->GetValue()).GetName() + wxT("\""); //directory WITHOUT trailing path separator
output+= wxString(wxT(" ")) + wxT("\"") + wxDir(m_directoryPanel2->GetValue()).GetName() + wxT("\""); //needed since e.g. "C:\" isn't parsed correctly by commandline
+#endif // FFS_WIN
output+= wxT("\n");
diff --git a/ui/SyncDialog.h b/ui/SyncDialog.h
index 9e79c7d2..3eee6400 100644
--- a/ui/SyncDialog.h
+++ b/ui/SyncDialog.h
@@ -23,6 +23,8 @@ public:
wxBitmapButton* button5,
const SyncConfiguration& syncConfig);
+ static void adjustToolTips(wxStaticBitmap* bitmap, const CompareVariant var);
+
private:
void calculatePreview();
@@ -70,6 +72,7 @@ private:
void OnFilterButton( wxCommandEvent& event);
void OnSelectRecycleBin(wxCommandEvent& event);
+ void OnChangeCompareVar(wxCommandEvent& event);
void OnClose( wxCloseEvent& event);
void OnCancel( wxCommandEvent& event);
diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp
index be1db069..b851d4b4 100644
--- a/ui/guiGenerated.cpp
+++ b/ui/guiGenerated.cpp
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 16 2008)
+// C++ code generated with wxFormBuilder (version Oct 18 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -45,6 +45,9 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
m_menuItemGerman = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Deutsch") ) , wxEmptyString, wxITEM_RADIO );
m_menu31->Append( m_menuItemGerman );
+ m_menuItemFrench = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Français") ) , wxEmptyString, wxITEM_RADIO );
+ m_menu31->Append( m_menuItemFrench );
+
m_menu3->Append( -1, _("&Language"), m_menu31 );
m_menu3->AppendSeparator();
@@ -459,7 +462,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 );
- m_staticTextStatusLeft = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextStatusLeft = new wxStaticText( m_panel7, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextStatusLeft->Wrap( -1 );
bSizer53->Add( m_staticTextStatusLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
@@ -474,7 +477,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
bSizer451->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 );
- m_staticTextStatusMiddle = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextStatusMiddle = new wxStaticText( m_panel7, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextStatusMiddle->Wrap( -1 );
bSizer451->Add( m_staticTextStatusMiddle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
@@ -490,7 +493,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
bSizer52->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 );
- m_staticTextStatusRight = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextStatusRight = new wxStaticText( m_panel7, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextStatusRight->Wrap( -1 );
bSizer52->Add( m_staticTextStatusRight, 0, wxALIGN_CENTER_VERTICAL, 5 );
@@ -521,6 +524,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuExportFileList ) );
this->Connect( m_menuItemEnglish->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangEnglish ) );
this->Connect( m_menuItemGerman->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangGerman ) );
+ this->Connect( m_menuItemFrench->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangFrench ) );
this->Connect( m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuBatchJob ) );
this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuAbout ) );
m_bpButtonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnCompare ), NULL, this );
@@ -564,6 +568,7 @@ GuiGenerated::~GuiGenerated()
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuExportFileList ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangEnglish ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangGerman ) );
+ this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangFrench ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuBatchJob ) );
this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuAbout ) );
m_bpButtonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnCompare ), NULL, this );
@@ -609,13 +614,13 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id,
wxStaticBoxSizer* sbSizer10;
sbSizer10 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxHORIZONTAL );
- m_staticText321 = new wxStaticText( this, wxID_ANY, _("Files scanned:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText321 = new wxStaticText( this, wxID_ANY, _("Files/folders scanned:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText321->Wrap( -1 );
m_staticText321->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
sbSizer10->Add( m_staticText321, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 );
- m_staticTextScanned = new wxStaticText( this, wxID_ANY, _("123456"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextScanned = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextScanned->Wrap( -1 );
m_staticTextScanned->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
@@ -634,7 +639,7 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id,
sbSizer13->Add( m_staticText46, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
- m_staticTextFilesToCompare = new wxStaticText( this, wxID_ANY, _("123456"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextFilesToCompare = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextFilesToCompare->Wrap( -1 );
m_staticTextFilesToCompare->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
@@ -653,7 +658,7 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id,
sbSizer11->Add( m_staticText32, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 );
- m_staticTextDataToCompare = new wxStaticText( this, wxID_ANY, _("123456"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextDataToCompare = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDataToCompare->Wrap( -1 );
m_staticTextDataToCompare->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
@@ -852,7 +857,7 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr
m_staticText37 = new wxStaticText( this, wxID_ANY, _("Create:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText37->Wrap( -1 );
m_staticText37->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
- m_staticText37->SetToolTip( _("Number of files or directories that will be created") );
+ m_staticText37->SetToolTip( _("Number of files and directories that will be created") );
fgSizer5->Add( m_staticText37, 0, wxALIGN_CENTER_VERTICAL, 5 );
@@ -866,7 +871,7 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr
m_staticText14 = new wxStaticText( this, wxID_ANY, _("Delete:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
m_staticText14->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
- m_staticText14->SetToolTip( _("Number of files or directories that will be deleted") );
+ m_staticText14->SetToolTip( _("Number of files and directories that will be deleted") );
fgSizer5->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL, 5 );
@@ -982,7 +987,7 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr
gSizer1->Add( m_bpButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_bitmap17 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 );
- m_bitmap17->SetToolTip( _("Files that exist on both sides and are different") );
+ m_bitmap17->SetToolTip( _("dummy") );
gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
@@ -1094,7 +1099,6 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id,
bSizer27->Add( bSizer42, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
- wxBoxSizer* bSizer31;
bSizer31 = new wxBoxSizer( wxHORIZONTAL );
m_staticText21 = new wxStaticText( this, wxID_ANY, _("Current operation:"), wxDefaultPosition, wxDefaultSize, 0 );
@@ -1106,6 +1110,18 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id,
bSizer31->Add( 0, 0, 1, wxEXPAND, 5 );
+ m_staticText55 = new wxStaticText( this, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText55->Wrap( -1 );
+ m_staticText55->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
+
+ bSizer31->Add( m_staticText55, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 );
+
+ m_staticTextTimeElapsed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextTimeElapsed->Wrap( -1 );
+ m_staticTextTimeElapsed->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
+
+ bSizer31->Add( m_staticTextTimeElapsed, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
bSizer27->Add( bSizer31, 0, wxEXPAND, 5 );
m_textCtrlInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
@@ -1127,7 +1143,7 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id,
bSizer32->Add( m_staticText26, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
- m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("--,- MB"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextDataRemaining->Wrap( -1 );
m_staticTextDataRemaining->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
@@ -1161,13 +1177,13 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id,
wxBoxSizer* bSizer33;
bSizer33 = new wxBoxSizer( wxHORIZONTAL );
- m_staticText25 = new wxStaticText( this, wxID_ANY, _("Files remaining:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText25 = new wxStaticText( this, wxID_ANY, _("Files/folders remaining:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText25->Wrap( -1 );
m_staticText25->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
- bSizer33->Add( m_staticText25, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
+ bSizer33->Add( m_staticText25, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
- m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("0000000"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+ m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
m_staticTextRemainingObj->Wrap( -1 );
m_staticTextRemainingObj->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
@@ -1235,7 +1251,7 @@ HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr
bSizer20->Add( 0, 5, 0, wxEXPAND, 5 );
- m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, _("Compare by \"File size and date\"\n----------------------------------------\nThis variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. (Notice that the file time may deviate up to 2 seconds.)\n\nWhen \"Compare\" is triggered with this option set the following decision tree is processed:\n\n -----------------\n |Decision tree|\n -----------------\n ________|___________\n | |\n file exists on both sides on one side only\n _____|______ __|___\n | | | |\nequal different left right\n _________|_____________\n | | |\n left newer right newer different (but same date)\n\nAs a result 6 different status can be returned to categorize all files:\n\n- exists left only\n- exists right only\n- left newer\n- right newer\n- different (but same date)\n- equal\n\n\nCompare by \"File content\"\n----------------------------------------\nAs the name suggests, two files which share the same name are marked as equal if and only if they have the same content. This option is useful for consistency checks rather than backup operations. Therefore the file times are not taken into account at all.\n\nWith this option enabled the decision tree is smaller:\n\n -----------------\n |Decision tree|\n -----------------\n ________|___________\n | |\n file exists on both sides on one side only\n _____|______ __|___\n | | | |\nequal different left right\n\nAs a result the files are separated into the following categories:\n\n- exists left only\n- exists right only\n- different\n- equal"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
+ m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, _("Compare by \"File size and date\"\n----------------------------------------\nThis variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. Notice that the file time is allowed to deviate by up to 2 seconds. This ensures synchronization with the lower-precision file system FAT32 works correctly.\n\nWhen \"Compare\" is triggered with this option set the following decision tree is processed:\n\n -----------------\n |Decision tree|\n -----------------\n ________|___________\n | |\n file exists on both sides on one side only\n _____|______ __|___\n | | | |\nequal different left right\n _________|__________\n | | |\n left newer right newer same date\n\nAs a result 6 different status can be returned to categorize all files:\n\n- exists left only\n- exists right only\n- left newer\n- right newer\n- different filesize (but same date)\n- equal\n\n\nCompare by \"File content\"\n----------------------------------------\nAs the name suggests, two files which share the same name are marked as equal if and only if they have the same content. This option is useful for consistency checks rather than backup operations. Therefore the file times are not taken into account at all.\n\nWith this option enabled the decision tree is smaller:\n\n -----------------\n |Decision tree|\n -----------------\n ________|___________\n | |\n file exists on both sides on one side only\n _____|______ __|___\n | | | |\nequal different left right\n\nAs a result the files are separated into the following categories:\n\n- exists left only\n- exists right only\n- different\n- equal"), wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY );
m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
bSizer20->Add( m_textCtrl8, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
@@ -1291,7 +1307,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS
bSizer31->Add( m_staticText15, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
- m_build = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ m_build = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_build->Wrap( -1 );
m_build->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) );
@@ -1307,12 +1323,18 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS
m_textCtrl3 = new wxTextCtrl( this, wxID_ANY, _("Source code written completely in C++ utilizing:\n\n MinGW \t\t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE\n\n by ZenJu"), wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY|wxDOUBLE_BORDER );
m_textCtrl3->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
- bSizer53->Add( m_textCtrl3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
+ bSizer53->Add( m_textCtrl3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 5 );
- bSizer31->Add( bSizer53, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 30 );
+ m_staticText54 = new wxStaticText( this, wxID_ANY, _("Thanks to Jean-François Hartmann for doing the French translation!"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText54->Wrap( -1 );
+ m_staticText54->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) );
+ bSizer53->Add( m_staticText54, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL, 5 );
- bSizer31->Add( 0, 7, 0, 0, 5 );
+ bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 30 );
+
+ m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
+ bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
wxStaticBoxSizer* sbSizer7;
sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL );
@@ -1323,10 +1345,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS
sbSizer7->Add( m_staticText131, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
- bSizer31->Add( sbSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 );
-
- m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
- bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 );
+ bSizer31->Add( sbSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 );
wxFlexGridSizer* fgSizer2;
fgSizer2 = new wxFlexGridSizer( 3, 3, 0, 0 );
@@ -1513,7 +1532,7 @@ DeleteDlgGenerated::DeleteDlgGenerated( wxWindow* parent, wxWindowID id, const w
m_bitmap12 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 );
bSizer41->Add( m_bitmap12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
- m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextHeader->Wrap( -1 );
m_staticTextHeader->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
@@ -1966,7 +1985,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS
gSizer1->Add( m_bpButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
m_bitmap17 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 );
- m_bitmap17->SetToolTip( _("Files that exist on both sides and are different") );
+ m_bitmap17->SetToolTip( _("dummy") );
gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
@@ -2010,6 +2029,8 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS
this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) );
m_directoryPanel1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterLeftDir ), NULL, this );
m_directoryPanel2->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterRightDir ), NULL, this );
+ m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this );
+ m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this );
m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this );
m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnFilterButton ), NULL, this );
m_bpButton5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this );
@@ -2027,6 +2048,8 @@ BatchDlgGenerated::~BatchDlgGenerated()
this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) );
m_directoryPanel1->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterLeftDir ), NULL, this );
m_directoryPanel2->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterRightDir ), NULL, this );
+ m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this );
+ m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeCompareVar ), NULL, this );
m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this );
m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnFilterButton ), NULL, this );
m_bpButton5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this );
diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h
index d46d2959..c2665539 100644
--- a/ui/guiGenerated.h
+++ b/ui/guiGenerated.h
@@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
-// C++ code generated with wxFormBuilder (version Apr 16 2008)
+// C++ code generated with wxFormBuilder (version Oct 18 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
@@ -58,6 +58,7 @@ class GuiGenerated : public wxFrame
wxMenu* m_menu31;
wxMenuItem* m_menuItemEnglish;
wxMenuItem* m_menuItemGerman;
+ wxMenuItem* m_menuItemFrench;
wxMenu* m_menu2;
wxBoxSizer* bSizer1;
wxPanel* m_panel71;
@@ -122,6 +123,7 @@ class GuiGenerated : public wxFrame
virtual void OnMenuExportFileList( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuLangEnglish( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuLangGerman( wxCommandEvent& event ){ event.Skip(); }
+ virtual void OnMenuLangFrench( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuBatchJob( wxCommandEvent& event ){ event.Skip(); }
virtual void OnMenuAbout( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCompare( wxCommandEvent& event ){ event.Skip(); }
@@ -281,8 +283,11 @@ class SyncStatusDlgGenerated : public wxDialog
wxStaticBitmap* m_bitmapStatus;
wxStaticText* m_staticTextStatus;
+ wxBoxSizer* bSizer31;
wxStaticText* m_staticText21;
+ wxStaticText* m_staticText55;
+ wxStaticText* m_staticTextTimeElapsed;
wxTextCtrl* m_textCtrlInfo;
wxBoxSizer* bSizer28;
wxStaticText* m_staticText26;
@@ -352,9 +357,9 @@ class AboutDlgGenerated : public wxDialog
wxStaticText* m_staticText15;
wxStaticText* m_build;
-
- wxStaticText* m_staticText131;
+ wxStaticText* m_staticText54;
wxStaticLine* m_staticline3;
+ wxStaticText* m_staticText131;
wxStaticBitmap* m_bitmap9;
wxStaticText* m_staticText11;
wxHyperlinkCtrl* m_hyperlink1;
@@ -540,6 +545,7 @@ class BatchDlgGenerated : public wxDialog
virtual void OnClose( wxCloseEvent& event ){ event.Skip(); }
virtual void OnEnterLeftDir( wxCommandEvent& event ){ event.Skip(); }
virtual void OnEnterRightDir( wxCommandEvent& event ){ event.Skip(); }
+ virtual void OnChangeCompareVar( wxCommandEvent& event ){ event.Skip(); }
virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); }
virtual void OnFilterButton( wxCommandEvent& event ){ event.Skip(); }
virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); }
bgstack15