summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
Diffstat (limited to 'ui')
-rw-r--r--ui/MainDialog.cpp587
-rw-r--r--ui/MainDialog.h43
-rw-r--r--ui/Resources.cpp27
-rw-r--r--ui/Resources.h10
-rw-r--r--ui/SmallDialogs.cpp152
-rw-r--r--ui/SmallDialogs.h53
-rw-r--r--ui/SyncDialog.cpp96
-rw-r--r--ui/guiGenerated.cpp238
-rw-r--r--ui/guiGenerated.h49
9 files changed, 822 insertions, 433 deletions
diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp
index f063dfcb..1528f0c8 100644
--- a/ui/MainDialog.cpp
+++ b/ui/MainDialog.cpp
@@ -17,7 +17,7 @@
#include <cmath>
#include <wx/msgdlg.h>
-using namespace GlobalFunctions;
+using namespace globalFunctions;
int leadingPanel = 0;
@@ -35,6 +35,14 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) :
//initialize sync configuration
readConfigurationFromHD(cfgFileName, true);
+ leftOnlyFilesActive = true;
+ leftNewerFilesActive = true;
+ differentFilesActive = true;
+ rightNewerFilesActive = true; //do not put these bool values into config.dat!
+ rightOnlyFilesActive = true; //it's more convenient to have them defaulted at startup
+ equalFilesActive = false;
+ updateViewFilterButtons();
+
//set icons for this dialog
m_bpButton11->SetBitmapLabel(*GlobalResources::bitmapAbout);
m_bpButton10->SetBitmapLabel(*GlobalResources::bitmapExit);
@@ -112,8 +120,6 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) :
m_grid2->setGridDataTable(&currentUI_View);
m_grid3->setGridDataTable(&currentUI_View);
- updateViewFilterButtons();
-
//disable sync button as long as "compare" hasn't been triggered.
m_bpButtonSync->Disable();
@@ -129,11 +135,6 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) :
//as the name says: disable them
m_grid3->deactivateScrollbars();
- //set status of filter button
- updateFilterButton();
- //set status of "hide filtered items" checkbox
- m_checkBoxHideFilt->SetValue(hideFiltered);
-
//mainly to update row label sizes...
writeGrid(currentGridData);
@@ -216,14 +217,7 @@ MainDialog::~MainDialog()
}
delete cfgFileHistory;
- try
- {
- writeConfigurationToHD(FreeFileSync::FFS_LastConfigFile); //don't trow exceptions in destructors
- }
- catch (std::runtime_error& theException)
- {
- wxMessageBox(_(theException.what()), _("An exception occured!"), wxOK | wxICON_ERROR);
- }
+ writeConfigurationToHD(FreeFileSync::FFS_LastConfigFile); //don't trow exceptions in destructors
}
@@ -265,15 +259,11 @@ void MainDialog::onGrid3access(wxEvent& event)
}
-void MainDialog::filterRangeManual(int begin, int end, int leadingRow)
+void MainDialog::filterRangeManual(const set<int>& rowsToFilterOnUI_View, int leadingRow)
{
- int currentUI_Size = currentUI_View.size();
-
- int topRow = max(begin, 0);
- int bottomRow = min(end, currentUI_Size - 1);
-
- if (topRow <= bottomRow) // bottomRow might be -1 ?
+ if (rowsToFilterOnUI_View.size() > 0)
{
+ int currentUI_Size = currentUI_View.size();
bool newSelection = false; //default: deselect range
@@ -287,12 +277,17 @@ void MainDialog::filterRangeManual(int begin, int end, int leadingRow)
//get all lines that need to be filtered (e.g. if a folder is marked, then its subelements should be marked as well)
set<int> rowsToFilterOnGridData; //rows to filter in backend
- for (int i = topRow; i <= bottomRow; ++i)
+
+
+ for (set<int>::iterator i = rowsToFilterOnUI_View.begin(); i != rowsToFilterOnUI_View.end(); ++i)
{
- unsigned int gridDataLine = currentUI_View[i].linkToCurrentGridData;
+ if (0 <= *i && *i < currentUI_Size)
+ {
+ unsigned int gridIndex = currentUI_View[*i].linkToCurrentGridData;
- rowsToFilterOnGridData.insert(gridDataLine);
- FreeFileSync::addSubElements(rowsToFilterOnGridData, currentGridData, currentGridData[gridDataLine]);
+ rowsToFilterOnGridData.insert(gridIndex);
+ FreeFileSync::addSubElements(rowsToFilterOnGridData, currentGridData, currentGridData[gridIndex]);
+ }
}
@@ -327,37 +322,7 @@ void MainDialog::filterRangeManual(int begin, int end, int leadingRow)
wxMilliSleep(400);
//delete rows, that are filtered out:
-
- //for (set<int>::reverse_iterator i = filteredOutRowsOnUI.rbegin(); i != filteredOutRowsOnUI.rend(); ++i)
- // currentUI_View.erase(currentUI_View.begin() + *i);
-
- //Note: the following lines are a performance optimization for deleting elements from a vector. It is incredibly faster to create a new
- //vector and leave specific elements out than to delete row by row and force recopying of most elements for each single deletion (linear vs quadratic runtime)
-
- //Note: This is the most time consuming part in this whole method!
-
- UI_Grid temp;
- int rowNr = 0;
- int rowToSkip = -1;
-
- set<int>::iterator rowToSkipIndex = filteredOutRowsOnUI.begin();
-
- if (rowToSkipIndex != filteredOutRowsOnUI.end())
- rowToSkip = *rowToSkipIndex;
-
- for (UI_Grid::iterator i = currentUI_View.begin(); i != currentUI_View.end(); ++i, ++rowNr)
- {
- if (rowNr != rowToSkip)
- temp.push_back(*i);
- else
- {
- rowToSkipIndex++;
- if (rowToSkipIndex != filteredOutRowsOnUI.end())
- rowToSkip = *rowToSkipIndex;
- }
- }
- currentUI_View.swap(temp);
-
+ removeRowsFromVector(currentUI_View, filteredOutRowsOnUI);
//redraw grid necessary to update new dimensions
writeGrid(currentGridData, true); //use UI buffer, no mapping from currentGridData to UI model again, just a re-dimensioning of grids
@@ -429,7 +394,11 @@ void MainDialog::OnIdleEvent(wxEvent& event)
{ //a mouse up event, but no mouse down! (e.g. when window is maximized and cursor is on grid3)
filteringInitialized = false;
- filterRangeManual(selectedRange3Begin, selectedRange3End, selectionLead);
+ set<int> filteredRows;
+ for (int i = selectedRange3Begin; i <= selectedRange3End; ++i)
+ filteredRows.insert(i);
+
+ filterRangeManual(filteredRows, selectionLead);
}
}
@@ -608,7 +577,7 @@ public:
if (suppressUI_Errormessages)
{
unsolvedErrors = true;
- return StatusUpdater::Continue;
+ return StatusUpdater::continueNext;
}
wxString errorMessage = text + _("\n\nInformation: If you skip the error and continue or abort a re-compare will be necessary!");
@@ -620,12 +589,12 @@ public:
switch (rv)
{
- case ErrorDlg::ContinueButtonPressed:
+ case ErrorDlg::continueButtonPressed:
unsolvedErrors = true;
- return StatusUpdater::Continue;
- case ErrorDlg::RetryButtonPressed:
- return StatusUpdater::Retry;
- case ErrorDlg::AbortButtonPressed:
+ return StatusUpdater::continueNext;
+ case ErrorDlg::retryButtonPressed:
+ return StatusUpdater::retry;
+ case ErrorDlg::abortButtonPressed:
{
unsolvedErrors = true;
throw AbortThisProcess();
@@ -634,10 +603,11 @@ public:
assert (false);
}
- return StatusUpdater::Continue; //dummy return value
+ return StatusUpdater::continueNext; //dummy return value
}
- void updateStatus(const wxString& text) {}
- void updateProgressIndicator(double number) {}
+ void updateStatusText(const wxString& text) {}
+ void initNewProcess(int objectsTotal, double dataTotal, int processID) {}
+ void updateProcessedData(int objectsProcessed, double dataProcessed) {}
private:
@@ -675,10 +645,10 @@ void MainDialog::deleteFilesOnGrid(wxGrid* grid)
{
const FileCompareLine& currentCmpLine = currentGridData[*i];
- if (currentCmpLine.fileDescrLeft.objType != IsNothing)
+ if (currentCmpLine.fileDescrLeft.objType != isNothing)
filesToDelete+= currentCmpLine.fileDescrLeft.filename + "\n";
- if (currentCmpLine.fileDescrRight.objType != IsNothing)
+ if (currentCmpLine.fileDescrRight.objType != isNothing)
filesToDelete+= currentCmpLine.fileDescrRight.filename + "\n";
filesToDelete+= "\n";
@@ -688,7 +658,7 @@ void MainDialog::deleteFilesOnGrid(wxGrid* grid)
switch (confirmDeletion->ShowModal())
{
- case DeleteDialog::OkayButtonPressed:
+ case DeleteDialog::okayButtonPressed:
{
bool unsolvedErrorOccured = false; //if an error is skipped a re-compare will be necessary!
@@ -709,10 +679,12 @@ void MainDialog::deleteFilesOnGrid(wxGrid* grid)
//redraw grid neccessary to update new dimensions and for UI-Backend data linkage
writeGrid(currentGridData); //do NOT use UI buffer here
+
+ grid->ClearSelection(); //clear selection on grid
}
break;
- case DeleteDialog::CancelButtonPressed:
+ case DeleteDialog::cancelButtonPressed:
default:
break;
@@ -837,27 +809,6 @@ void MainDialog::OnDirChangedPanel2(wxFileDirPickerEvent& event)
}
-void onFilesDropped(const wxString& elementName, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker)
-{
- wxString fileName = elementName;
-
- if (wxDirExists(fileName))
- {
- txtCtrl->SetValue(fileName);
- dirPicker->SetPath(fileName);
- }
- else
- {
- fileName = wxFileName(fileName).GetPath();
- if (wxDirExists(fileName))
- {
- txtCtrl->SetValue(fileName);
- dirPicker->SetPath(fileName);
- }
- }
-}
-
-
void MainDialog::clearStatusBar()
{
stackObjects = 0; //prevent old stack objects from popping up
@@ -884,10 +835,10 @@ bool sameFileSpecified(const wxString& file1, const wxString& file2)
wxString file2Full = file2;
if (wxFileName(file1).GetPath() == wxEmptyString)
- file1Full = wxFileName::GetCwd() + FileNameSeparator + file1;
+ file1Full = wxFileName::GetCwd() + GlobalResources::fileNameSeparator + file1;
if (wxFileName(file2).GetPath() == wxEmptyString)
- file2Full = wxFileName::GetCwd() + FileNameSeparator + file2;
+ file2Full = wxFileName::GetCwd() + GlobalResources::fileNameSeparator + file2;
return (file1Full == file2Full);
}
@@ -932,6 +883,27 @@ void MainDialog::addCfgFileToHistory(const wxString& filename)
}
+void onFilesDropped(const wxString& elementName, wxTextCtrl* txtCtrl, wxDirPickerCtrl* dirPicker)
+{
+ wxString fileName = elementName;
+
+ if (wxDirExists(fileName))
+ {
+ txtCtrl->SetValue(fileName);
+ dirPicker->SetPath(fileName);
+ }
+ else
+ {
+ fileName = wxFileName(fileName).GetPath();
+ if (wxDirExists(fileName))
+ {
+ txtCtrl->SetValue(fileName);
+ dirPicker->SetPath(fileName);
+ }
+ }
+}
+
+
bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames)
{
if (filenames.IsEmpty())
@@ -1033,14 +1005,16 @@ void MainDialog::OnLoadConfiguration(wxCommandEvent& event)
if (!newCfgFile.IsEmpty())
{
- if (wxFileExists(newCfgFile) && FreeFileSync::isFFS_ConfigFile(newCfgFile))
+ if (!wxFileExists(newCfgFile))
+ wxMessageBox(_("The selected file does not exist anymore!"), _("Warning"), wxOK);
+ else if (!FreeFileSync::isFFS_ConfigFile(newCfgFile))
+ wxMessageBox(_("The selected file does not contain a valid configuration!"), _("Warning"), wxOK);
+ else
{
readConfigurationFromHD(newCfgFile);
pushStatusInformation(_("Configuration loaded!"));
}
- else
- wxMessageBox(_("The selected file does not contain a valid configuration!"), _("Warning"), wxOK);
}
}
event.Skip();
@@ -1087,47 +1061,67 @@ void MainDialog::OnQuit(wxCommandEvent &event)
}
-void MainDialog::readConfigurationFromHD(const wxString& filename, bool programStartup)
+void MainDialog::loadDefaultConfiguration()
{
//default values
- syncConfiguration.exLeftSideOnly = SyncDirRight;
- syncConfiguration.exRightSideOnly = SyncDirRight;
- syncConfiguration.leftNewer = SyncDirRight;
- syncConfiguration.rightNewer = SyncDirRight;
- syncConfiguration.different = SyncDirRight;
+ syncConfiguration.exLeftSideOnly = syncDirRight;
+ syncConfiguration.exRightSideOnly = syncDirRight;
+ syncConfiguration.leftNewer = syncDirRight;
+ syncConfiguration.rightNewer = syncDirRight;
+ syncConfiguration.different = syncDirRight;
- leftOnlyFilesActive = true;
- leftNewerFilesActive = true;
- differentFilesActive = true;
- rightNewerFilesActive = true; //do not put these bool values into config.dat!
- rightOnlyFilesActive = true; //it's more convenient to have them defaulted for each execution
- equalFilesActive = false;
+ m_radioBtnSizeDate->SetValue(true); //compare algorithm
includeFilter = "*"; //include all files/folders
excludeFilter = ""; //exlude nothing
- hideFiltered = false; //show filtered items
+
+ //set status of filter button
filterIsActive = false; //do not filter by default
+ updateFilterButton();
+
+ //set status of "hide filtered items" checkbox
+ hideFiltered = false; //show filtered items
+ m_checkBoxHideFilt->SetValue(hideFiltered);
useRecycleBin = false; //do not use: in case OS doesn't support this, user will have to activate first and then get the error message
+ hideErrorMessages = false;
widthNotMaximized = wxDefaultCoord;
heightNotMaximized = wxDefaultCoord;
posXNotMaximized = wxDefaultCoord;
posYNotMaximized = wxDefaultCoord;
-//#####################################################
+}
+
+
+void MainDialog::readConfigurationFromHD(const wxString& filename, bool programStartup)
+{
+ char bigBuffer[10000];
ifstream config(filename.c_str());
if (!config)
+ {
+ if (programStartup)
+ loadDefaultConfiguration();
+ else
+ wxMessageBox(wxString(_("Could not read configuration file ")) + "\"" + filename + "\"", _("An exception occured!"), wxOK | wxICON_ERROR);
+
+ return;
+ }
+
+ //read FFS identifier
+ config.get(bigBuffer, FreeFileSync::FFS_ConfigFileID.Len() + 1);
+
+ if (wxString(bigBuffer) != FreeFileSync::FFS_ConfigFileID)
+ {
+ 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);
- char bigBuffer[10000];
-
-
- //read FFS identifier
- config.get(bigBuffer, FreeFileSync::FFS_ConfigFileID.Len() + 1);
//read sync configuration
syncConfiguration.exLeftSideOnly = SyncDirection(config.get());
@@ -1136,13 +1130,13 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS
syncConfiguration.rightNewer = SyncDirection(config.get());
syncConfiguration.different = SyncDirection(config.get());
- //read find method
+ //read compare algorithm
switch (int(config.get()))
{
- case CompareByTimeAndSize:
+ case compareByTimeAndSize:
m_radioBtnSizeDate->SetValue(true);
break;
- case CompareByMD5:
+ case compareByMD5:
m_radioBtnContent->SetValue(true);
break;
default:
@@ -1200,7 +1194,10 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS
//read filter settings:
hideFiltered = bool(config.get());
+ m_checkBoxHideFilt->SetValue(hideFiltered);
+
filterIsActive = bool(config.get());
+ updateFilterButton();
//include
config.getline(bigBuffer, 10000, char(0));
@@ -1212,14 +1209,20 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS
useRecycleBin = bool(config.get());
+ hideErrorMessages = bool(config.get());
+
config.close();
}
+
void MainDialog::writeConfigurationToHD(const wxString& filename)
{
ofstream config(filename.c_str());
if (!config)
- throw runtime_error(string(_("Could not write to ")) + filename.c_str());
+ {
+ wxMessageBox(wxString(_("Could not write to ")) + "\"" + filename + "\"", _("An exception occured!"), wxOK | wxICON_ERROR);
+ return;
+ }
//put filename on list of last used config files
addCfgFileToHistory(filename);
@@ -1236,9 +1239,9 @@ void MainDialog::writeConfigurationToHD(const wxString& filename)
//write find method
if (m_radioBtnSizeDate->GetValue())
- config<<char(CompareByTimeAndSize);
+ config<<char(compareByTimeAndSize);
else if (m_radioBtnContent->GetValue())
- config<<char(CompareByMD5);
+ config<<char(compareByMD5);
else assert (false);
@@ -1272,34 +1275,39 @@ void MainDialog::writeConfigurationToHD(const wxString& filename)
config<<char(useRecycleBin);
+ config<<char(hideErrorMessages);
+
config.close();
}
+
void MainDialog::OnAbout(wxCommandEvent &event)
{
AboutDlg* aboutDlg = new AboutDlg(this);
aboutDlg->ShowModal();
}
+
void MainDialog::OnShowHelpDialog(wxCommandEvent &event)
{
HelpDlg* helpDlg = new HelpDlg(this);
helpDlg->ShowModal();
}
+
void MainDialog::OnFilterButton(wxCommandEvent &event)
{ //toggle filter on/off
filterIsActive = !filterIsActive;
+ //make sure, button-appearance and "filterIsActive" are in sync.
+ updateFilterButton();
+
if (filterIsActive)
FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter);
else
FreeFileSync::removeFilterOnCurrentGridData(currentGridData);
writeGrid(currentGridData);
-
- //make sure, button-appearance and "filterIsActive" are in sync.
- updateFilterButton();
}
@@ -1316,11 +1324,18 @@ void MainDialog::OnHideFilteredButton(wxCommandEvent &event)
void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event)
{
+ wxString beforeImage = includeFilter + wxChar(0) + excludeFilter;
+
FilterDlg* filterDlg = new FilterDlg(this);
- if (filterDlg->ShowModal() == FilterDlg::OkayButtonPressed)
+ if (filterDlg->ShowModal() == FilterDlg::okayButtonPressed)
{
- if (filterIsActive)
+ wxString afterImage = includeFilter + wxChar(0) + excludeFilter;
+
+ if (beforeImage != afterImage) //if filter settings are changed: set filtering to "on"
{
+ filterIsActive = true;
+ updateFilterButton();
+
FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter);
writeGrid(currentGridData);
@@ -1444,25 +1459,25 @@ void MainDialog::OnCompare(wxCommandEvent &event)
wxBeginBusyCursor();
- CompareVariant cmpVar = CompareByTimeAndSize; //assign a value to suppress compiler warning
+ CompareVariant cmpVar = compareByTimeAndSize; //assign a value to suppress compiler warning
if (m_radioBtnSizeDate->GetValue())
- cmpVar = CompareByTimeAndSize;
+ cmpVar = compareByTimeAndSize;
else if (m_radioBtnContent->GetValue())
- cmpVar = CompareByMD5;
+ cmpVar = compareByMD5;
else assert (false);
try
{ //class handling status display and error messages
- CompareStatusUpdater statusUpdater(this, m_statusBar1);
+ CompareStatusUpdater statusUpdater(this);
cmpStatusUpdaterTmp = &statusUpdater;
stackObjects = 0;
//unsigned int startTime3 = GetTickCount();
- FreeFileSync::getModelDiff(currentGridData,
- FreeFileSync::getFormattedDirectoryName(m_directoryPanel1->GetValue()),
- FreeFileSync::getFormattedDirectoryName(m_directoryPanel2->GetValue()),
- cmpVar,
- &statusUpdater);
+ FreeFileSync::startCompareProcess(currentGridData,
+ FreeFileSync::getFormattedDirectoryName(m_directoryPanel1->GetValue()),
+ FreeFileSync::getFormattedDirectoryName(m_directoryPanel2->GetValue()),
+ cmpVar,
+ &statusUpdater);
//wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime3));
@@ -1470,12 +1485,12 @@ void MainDialog::OnCompare(wxCommandEvent &event)
if (filterIsActive)
FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter);
- writeGrid(currentGridData);
-
//once compare is finished enable the sync button
- m_bpButtonSync->Enable(true);
+ m_bpButtonSync->Enable();
m_bpButtonSync->SetFocus();
+ writeGrid(currentGridData); //keep it in try/catch to not overwrite status information if compare is abortet
+
cmpStatusUpdaterTmp = 0;
}
catch (AbortThisProcess& theException)
@@ -1501,38 +1516,38 @@ wxString MainDialog::evaluateCmpResult(const CompareFilesResult result, const bo
if (selectedForSynchronization)
switch (result)
{
- case FileOnLeftSideOnly:
+ case fileOnLeftSideOnly:
return "<|";
break;
- case FileOnRightSideOnly:
+ case fileOnRightSideOnly:
return "|>";
break;
- case RightFileNewer:
+ case rightFileNewer:
return ">>";
break;
- case LeftFileNewer:
+ case leftFileNewer:
return "<<";
break;
- case FilesDifferent:
+ case filesDifferent:
return "!=";
break;
- case FilesEqual:
+ case filesEqual:
return "==";
break;
default:
assert (false);
}
- else return ConstFilteredOut;
+ else return constFilteredOut;
}
void MainDialog::writeGrid(const FileCompareResult& gridData, bool useUI_GridCache)
{
- //unsigned int startTime = GetTickCount();
-
if (!useUI_GridCache)
{
+ //unsigned int startTime = GetTickCount();
mapFileModelToUI(currentUI_View, gridData); //update currentUI_View
+ //wxMessageBox(wxString("Benchmark: ") + numberToWxString(unsigned(GetTickCount()) - startTime) + " ms");
updateStatusInformation(currentUI_View); //write status information for currentUI_View
}
@@ -1563,8 +1578,6 @@ void MainDialog::writeGrid(const FileCompareResult& gridData, bool useUI_GridCac
m_grid1->EndBatch();
m_grid2->EndBatch();
m_grid3->EndBatch();
-
- //wxMessageBox(wxString("Benchmark: ") + numberToWxString(unsigned(GetTickCount()) - startTime) + " ms");
}
@@ -1573,7 +1586,7 @@ void MainDialog::OnSync( wxCommandEvent& event )
//check if there are files/folders that can be synced
bool nothingToSync = true;
for (FileCompareResult::const_iterator i = currentGridData.begin(); i != currentGridData.end(); ++i)
- if (i->cmpResult != FilesEqual)
+ if (i->cmpResult != filesEqual)
{
nothingToSync = false;
break;
@@ -1592,9 +1605,33 @@ void MainDialog::OnSync( wxCommandEvent& event )
clearStatusBar();
- //unsigned int startTime = GetTickCount();
- synchronizeFolders(currentGridData, syncConfiguration);
- //wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime));
+ try
+ {
+ //class handling status updates and error messages
+ SyncStatusUpdater statusUpdater(this, hideErrorMessages);
+
+ //start synchronization and return elements that were not sync'ed in currentGridData
+
+ //unsigned int startTime3 = GetTickCount();
+ FreeFileSync::startSynchronizationProcess(currentGridData, syncConfiguration, &statusUpdater, useRecycleBin);
+ //wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime3));
+ }
+ catch (AbortThisProcess& theException)
+ { //do NOT disable the sync button: user might want to try to sync the REMAINING rows
+ } //m_bpButtonSync->Disable();
+
+
+ //display files that were not processed
+ writeGrid(currentGridData);
+
+ if (currentGridData.size() > 0)
+ pushStatusInformation(_("Not all items were synchronized! Have a look at the list."));
+ else
+ {
+ pushStatusInformation(_("All items have been synchronized!"));
+ m_bpButtonSync->Disable();
+ }
+
wxEndBusyCursor();
}
@@ -1649,26 +1686,12 @@ bool cmpString(const wxString& a, const wxString& b)
}
inline
-bool cmpLargeInt(const wxString& a, const wxString& b)
+bool cmpLargeInt(const wxULongLong& a, const wxULongLong& b)
{
- //if a and b not empty:
- bool result = true;
- wxString tmpString;
- mpz_t largeTempIntegerA;
- mpz_t largeTempIntegerB;
- mpz_init(largeTempIntegerA);
- mpz_init(largeTempIntegerB);
- mpz_set_str(largeTempIntegerA, a.c_str(), 10);
- //return value should be checked: if function fails, largeTempIntegerA is not changed: no issue here
- mpz_set_str(largeTempIntegerB, b.c_str(), 10);
- //return value should be checked: if function fails, largeTempIntegerA is not changed: no issue here
if (sortAscending)
- result = (mpz_cmp(largeTempIntegerA, largeTempIntegerB) < 0); // true if A < B
- else
- result = (mpz_cmp(largeTempIntegerA, largeTempIntegerB) > 0); // true if A > B
- mpz_clear(largeTempIntegerA);
- mpz_clear(largeTempIntegerB);
- return result;
+ return (a < b);
+
+ return (a > b);
}
@@ -1687,13 +1710,13 @@ bool sortGridLeft(const UI_GridLine& a, const UI_GridLine& b)
ObjectType typeB = (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrLeft.objType;
//presort types: first files, then directories then empty rows
- if (typeA == IsNothing)
+ if (typeA == isNothing)
return false; //empty rows always last
- else if (typeB == IsNothing)
+ else if (typeB == isNothing)
return true; //empty rows always last
- else if (typeA == IsDirectory)
+ else if (typeA == isDirectory)
return false;
- else if (typeB == IsDirectory)
+ else if (typeB == isDirectory)
return true;
else //use unformatted filesizes and sort by size
return cmpLargeInt((*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrLeft.fileSize, (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrLeft.fileSize);
@@ -1723,13 +1746,13 @@ bool sortGridRight(const UI_GridLine& a, const UI_GridLine& b)
ObjectType typeB = (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrRight.objType;
//presort types: first files, then directories then empty rows
- if (typeA == IsNothing)
+ if (typeA == isNothing)
return false; //empty rows always last
- else if (typeB == IsNothing)
+ else if (typeB == isNothing)
return true; //empty rows always last
- else if (typeA == IsDirectory)
+ else if (typeA == isDirectory)
return false;
- else if (typeB == IsDirectory)
+ else if (typeB == isDirectory)
return true;
else //use unformatted filesizes and sort by size
return cmpLargeInt((*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrRight.fileSize, (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrRight.fileSize);
@@ -1802,29 +1825,6 @@ void MainDialog::OnSwapDirs( wxCommandEvent& event )
}
-void MainDialog::synchronizeFolders(FileCompareResult& grid, const SyncConfiguration config)
-{
- try
- { //class handling status updates and error messages
- SyncStatusUpdater statusUpdater(this, FreeFileSync::calcTotalBytesToTransfer(grid, config).get_d());
-
- //start synchronization and return elements that were errorneous in "grid"
-
- //unsigned int startTime3 = GetTickCount();
- FreeFileSync::startSynchronizationProcess(grid, config, &statusUpdater, useRecycleBin);
- //wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime3));
-
-
- //display files that couldn't be processed
- writeGrid(grid);
- }
- catch (AbortThisProcess& theException)
- {
- //disable the sync button
- m_bpButtonSync->Enable(false);
- }
-}
-
//this sorting method is currently NOT used
bool cmpGridSmallerThan(const UI_GridLine& a, const UI_GridLine& b)
{
@@ -1868,7 +1868,8 @@ bool cmpGridSmallerThan(const UI_GridLine& a, const UI_GridLine& b)
void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid)
{
- stackObjects = 0;
+ clearStatusBar();
+
unsigned int objectsOnLeftView = 0;
unsigned int objectsOnRightView = 0;
mpz_t filesizeLeftView, filesizeRightView, tmpInt;
@@ -1876,29 +1877,24 @@ void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid)
mpz_init(filesizeRightView);
mpz_init(tmpInt);
- int returnValue = 0;
-
for (UI_Grid::const_iterator i = visibleGrid.begin(); i != visibleGrid.end(); i++)
{
const FileCompareLine& refLine = currentGridData[i->linkToCurrentGridData];
//calculate total number of bytes for each sied
- if (refLine.fileDescrLeft.objType != IsNothing)
+ if (refLine.fileDescrLeft.objType != isNothing)
{
- mpz_set_ui(tmpInt, 0);
- returnValue = mpz_set_str(tmpInt, refLine.fileDescrLeft.fileSize.c_str(), 10);
+ FreeFileSync::wxULongLongToMpz(tmpInt, refLine.fileDescrLeft.fileSize);
mpz_add(filesizeLeftView, filesizeLeftView, tmpInt);
- assert (returnValue == 0);
objectsOnLeftView++;
}
- if (refLine.fileDescrRight.objType != IsNothing)
+ if (refLine.fileDescrRight.objType != isNothing)
{
- mpz_set_ui(tmpInt, 0);
- returnValue = mpz_set_str(tmpInt, refLine.fileDescrRight.fileSize.c_str(), 10);
+
+ FreeFileSync::wxULongLongToMpz(tmpInt, refLine.fileDescrRight.fileSize);
mpz_add(filesizeRightView, filesizeRightView, tmpInt);
- assert (returnValue == 0);
objectsOnRightView++;
}
@@ -1906,7 +1902,7 @@ void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid)
//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);
+ globalFunctions::includeNumberSeparator(objectsViewLeft);
if (objectsOnLeftView == 1)
m_statusBar1->SetStatusText(wxString(_("1 item on left, ")) + FreeFileSync::formatFilesizeToShortString(mpz_class(filesizeLeftView)), 0);
else
@@ -1914,9 +1910,9 @@ void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid)
wxString objectsTotal = numberToWxString(currentGridData.size());
- GlobalFunctions::includeNumberSeparator(objectsTotal);
+ globalFunctions::includeNumberSeparator(objectsTotal);
wxString objectsView = numberToWxString(visibleGrid.size());
- GlobalFunctions::includeNumberSeparator(objectsView);
+ globalFunctions::includeNumberSeparator(objectsView);
if (currentGridData.size() == 1)
m_statusBar1->SetStatusText(objectsView + _(" of ") + objectsTotal + _(" row in view"), 1);
else
@@ -1924,7 +1920,7 @@ void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid)
wxString objectsViewRight = numberToWxString(objectsOnRightView);
- GlobalFunctions::includeNumberSeparator(objectsViewRight);
+ globalFunctions::includeNumberSeparator(objectsViewRight);
if (objectsOnRightView == 1)
m_statusBar1->SetStatusText(wxString(_("1 item on right, ")) + FreeFileSync::formatFilesizeToShortString(mpz_class(filesizeRightView)), 2);
else
@@ -1949,22 +1945,22 @@ void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& file
//process UI filter settings
switch (i->cmpResult)
{
- case FileOnLeftSideOnly:
+ case fileOnLeftSideOnly:
if (!leftOnlyFilesActive) continue;
break;
- case FileOnRightSideOnly:
+ case fileOnRightSideOnly:
if (!rightOnlyFilesActive) continue;
break;
- case RightFileNewer:
+ case rightFileNewer:
if (!rightNewerFilesActive) continue;
break;
- case LeftFileNewer:
+ case leftFileNewer:
if (!leftNewerFilesActive) continue;
break;
- case FilesDifferent:
+ case filesDifferent:
if (!differentFilesActive) continue;
break;
- case FilesEqual:
+ case filesEqual:
if (!equalFilesActive) continue;
break;
default:
@@ -1975,7 +1971,7 @@ void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& file
if (hideFiltered && !i->selectedForSynchronization)
continue;
- if (i->fileDescrLeft.objType == IsDirectory)
+ if (i->fileDescrLeft.objType == isDirectory)
{
gridline.leftFilename = wxEmptyString;
gridline.leftRelativePath = i->fileDescrLeft.relFilename;
@@ -1983,16 +1979,19 @@ void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& file
}
else
{
- gridline.leftFilename = i->fileDescrLeft.relFilename.AfterLast(FileNameSeparator);
- gridline.leftRelativePath = i->fileDescrLeft.relFilename.BeforeLast(FileNameSeparator);
- gridline.leftSize = GlobalFunctions::includeNumberSeparator(fileSize = i->fileDescrLeft.fileSize);
+ gridline.leftFilename = i->fileDescrLeft.relFilename.AfterLast(GlobalResources::fileNameSeparator);
+ gridline.leftRelativePath = i->fileDescrLeft.relFilename.BeforeLast(GlobalResources::fileNameSeparator);
+ if (i->fileDescrLeft.fileSize != 0)
+ gridline.leftSize = globalFunctions::includeNumberSeparator(fileSize = i->fileDescrLeft.fileSize.ToString());
+ else
+ gridline.leftSize = "";
}
- gridline.leftDate = i->fileDescrLeft.lastWriteTime;
+ gridline.leftDate = i->fileDescrLeft.lastWriteTime;
- gridline.cmpResult = evaluateCmpResult(i->cmpResult, i->selectedForSynchronization);
+ gridline.cmpResult = evaluateCmpResult(i->cmpResult, i->selectedForSynchronization);
gridline.linkToCurrentGridData = currentRow;
- if (i->fileDescrRight.objType == IsDirectory)
+ if (i->fileDescrRight.objType == isDirectory)
{
gridline.rightFilename = wxEmptyString;
gridline.rightRelativePath = i->fileDescrRight.relFilename;
@@ -2000,11 +1999,14 @@ void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& file
}
else
{
- gridline.rightFilename = i->fileDescrRight.relFilename.AfterLast(FileNameSeparator);
- gridline.rightRelativePath = i->fileDescrRight.relFilename.BeforeLast(FileNameSeparator);
- gridline.rightSize = GlobalFunctions::includeNumberSeparator(fileSize = i->fileDescrRight.fileSize);
+ gridline.rightFilename = i->fileDescrRight.relFilename.AfterLast(GlobalResources::fileNameSeparator);
+ gridline.rightRelativePath = i->fileDescrRight.relFilename.BeforeLast(GlobalResources::fileNameSeparator);
+ if (i->fileDescrRight.fileSize != 0)
+ gridline.rightSize = globalFunctions::includeNumberSeparator(fileSize = i->fileDescrRight.fileSize.ToString());
+ else
+ gridline.rightSize = "";
}
- gridline.rightDate = i->fileDescrRight.lastWriteTime;
+ gridline.rightDate = i->fileDescrRight.lastWriteTime;
output.push_back(gridline);
}
@@ -2020,7 +2022,6 @@ void updateUI_Now()
//process UI events and prevent application from "not responding" -> NO performance issue!
wxTheApp->Yield();
-
// while (wxTheApp->Pending())
// wxTheApp->Dispatch();
}
@@ -2032,7 +2033,7 @@ bool updateUI_IsAllowed()
wxLongLong newExec = wxGetLocalTimeMillis();
- if (newExec - lastExec >= 100) //perform ui updates not more often than necessary, 100 seems to be a good value with only a minimal performance loss
+ if (newExec - lastExec >= uiUpdateInterval) //perform ui updates not more often than necessary
{
lastExec = newExec;
return true;
@@ -2043,11 +2044,10 @@ bool updateUI_IsAllowed()
//########################################################################################################
-CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg, wxStatusBar* mainWindowBar) :
+CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg) :
mainDialog(dlg),
- statusBar(mainWindowBar),
suppressUI_Errormessages(false),
- numberOfScannedObjects(0)
+ currentProcess(-1)
{
//prevent user input during "compare", do not disable maindialog since abort-button would also be disabled
//it's not nice, but works - even has the advantage that certain actions are still possible: exit, about..
@@ -2071,13 +2071,19 @@ CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg, wxStatusBar* mainWin
mainDialog->m_panel3->Disable();
mainDialog->m_bpButton201->Disable();
mainDialog->m_choiceLoad->Disable();
+ mainDialog->m_bpButton10->Disable();
//show abort button
mainDialog->m_buttonAbort->Show();
mainDialog->m_bpButtonCompare->Hide();
+ mainDialog->m_buttonAbort->SetFocus();
+
+ //display status panel during compare
+ statusPanel = new CompareStatus(mainDialog);
+ mainDialog->bSizer1->Insert(1, statusPanel, 0, wxEXPAND | wxALL, 5 );
+ updateUI_Now();
mainDialog->Layout();
mainDialog->Refresh();
- mainDialog->m_buttonAbort->SetFocus();
}
CompareStatusUpdater::~CompareStatusUpdater()
@@ -2103,31 +2109,56 @@ CompareStatusUpdater::~CompareStatusUpdater()
mainDialog->m_panel3->Enable();
mainDialog->m_bpButton201->Enable();
mainDialog->m_choiceLoad->Enable();
+ mainDialog->m_bpButton10->Enable();
if (abortionRequested)
mainDialog->pushStatusInformation(_("Operation aborted!"));
mainDialog->m_buttonAbort->Hide();
mainDialog->m_bpButtonCompare->Show();
+
+ //remove status panel from main window
+ mainDialog->bSizer1->Detach(statusPanel);
+ statusPanel->Destroy();
+ updateUI_Now();
mainDialog->Layout();
mainDialog->Refresh();
}
-void CompareStatusUpdater::updateStatus(const wxString& text)
+inline
+void CompareStatusUpdater::updateStatusText(const wxString& text)
+{
+ statusPanel->setStatusText_NoUpdate(text);
+}
+
+
+void CompareStatusUpdater::initNewProcess(int objectsTotal, double dataTotal, int processID)
{
- //not relevant for "compare"; it's sufficient to display the number of scanned files/folders
+ currentProcess = processID;
+
+ if (currentProcess == FreeFileSync::scanningFilesProcess)
+ ;
+ else if (currentProcess == FreeFileSync::calcMD5Process)
+ statusPanel->resetMD5Gauge(objectsTotal, dataTotal);
+ else assert(false);
}
+
inline
-void CompareStatusUpdater::updateProgressIndicator(double number)
+void CompareStatusUpdater::updateProcessedData(int objectsProcessed, double dataProcessed)
{
- numberOfScannedObjects+= int(number); //conversion is harmless, since number == 1 in case of "compare"
+ if (currentProcess == FreeFileSync::scanningFilesProcess)
+ statusPanel->incScannedFiles_NoUpdate(objectsProcessed);
+ else if (currentProcess == FreeFileSync::calcMD5Process)
+ statusPanel->incProcessedMD5Data_NoUpdate(objectsProcessed, dataProcessed);
+ else assert(false);
}
+
int CompareStatusUpdater::reportError(const wxString& text)
{
if (suppressUI_Errormessages)
- return StatusUpdater::Continue;
+ return StatusUpdater::continueNext;
wxString errorMessage = text + _("\n\nContinue with next object, retry or abort comparison?");
@@ -2138,11 +2169,11 @@ int CompareStatusUpdater::reportError(const wxString& text)
switch (rv)
{
- case ErrorDlg::ContinueButtonPressed:
- return StatusUpdater::Continue;
- case ErrorDlg::RetryButtonPressed:
- return StatusUpdater::Retry;
- case ErrorDlg::AbortButtonPressed:
+ case ErrorDlg::continueButtonPressed:
+ return StatusUpdater::continueNext;
+ case ErrorDlg::retryButtonPressed:
+ return StatusUpdater::retry;
+ case ErrorDlg::abortButtonPressed:
{
abortionRequested = true;
throw AbortThisProcess();
@@ -2151,7 +2182,7 @@ int CompareStatusUpdater::reportError(const wxString& text)
assert (false);
}
- return StatusUpdater::Continue; //dummy return value
+ return StatusUpdater::continueNext; //dummy return value
}
@@ -2161,22 +2192,20 @@ void CompareStatusUpdater::triggerUI_Refresh()
if (abortionRequested) throw AbortThisProcess(); //abort can be triggered by syncStatusFrame
if (updateUI_IsAllowed()) //test if specific time span between ui updates is over
- {
- statusBar->SetStatusText(wxString(_("Scanning files/folders: ")) + numberToWxString(numberOfScannedObjects), 1);
- updateUI_Now();
- }
+ statusPanel->updateStatusPanelNow();
}
//########################################################################################################
-SyncStatusUpdater::SyncStatusUpdater(wxWindow* dlg, double gaugeTotalElements) :
- suppressUI_Errormessages(false)
+SyncStatusUpdater::SyncStatusUpdater(wxWindow* dlg, bool hideErrorMessages) :
+ suppressUI_Errormessages(hideErrorMessages)
{
- syncStatusFrame = new SyncStatus(this, gaugeTotalElements, dlg);
+ syncStatusFrame = new SyncStatus(this, dlg);
syncStatusFrame->Show();
updateUI_Now();
}
+
SyncStatusUpdater::~SyncStatusUpdater()
{
if (abortionRequested)
@@ -2192,23 +2221,38 @@ SyncStatusUpdater::~SyncStatusUpdater()
result = wxString(_("Warning: Synchronization failed for ")) + numberToWxString(failedItems) + _(" item(s):\n\n");
for (unsigned int j = 0; j < failedItems; ++j)
result+= unhandledErrors[j] + "\n";
+ result+= "\n";
}
+
+ if (failedItems)
+ result+= _("Not all items have been synchronized! You may try to synchronize the remaining items again (WITHOUT having to re-compare)!");
+ else if (abortionRequested)
+ result+= _("Synchronization aborted: You may try to synchronize remaining items again (WITHOUT having to re-compare)!");
+
syncStatusFrame->setStatusText_NoUpdate(result);
syncStatusFrame->updateStatusDialogNow();
}
inline
-void SyncStatusUpdater::updateStatus(const wxString& text)
+void SyncStatusUpdater::updateStatusText(const wxString& text)
{
syncStatusFrame->setStatusText_NoUpdate(text);
}
+void SyncStatusUpdater::initNewProcess(int objectsTotal, double dataTotal, int processID)
+{
+ assert (processID == FreeFileSync::synchronizeFilesProcess);
+
+ syncStatusFrame->resetGauge(objectsTotal, dataTotal);
+}
+
+
inline
-void SyncStatusUpdater::updateProgressIndicator(double number)
+void SyncStatusUpdater::updateProcessedData(int objectsProcessed, double dataProcessed)
{
- syncStatusFrame->incProgressIndicator_NoUpdate(number);
+ syncStatusFrame->incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed);
}
@@ -2217,7 +2261,7 @@ int SyncStatusUpdater::reportError(const wxString& text)
if (suppressUI_Errormessages)
{
unhandledErrors.Add(text);
- return StatusUpdater::Continue;
+ return StatusUpdater::continueNext;
}
wxString errorMessage = text + _("\n\nContinue with next object, retry or abort synchronization?");
@@ -2229,12 +2273,12 @@ int SyncStatusUpdater::reportError(const wxString& text)
switch (rv)
{
- case ErrorDlg::ContinueButtonPressed:
+ case ErrorDlg::continueButtonPressed:
unhandledErrors.Add(text);
- return StatusUpdater::Continue;
- case ErrorDlg::RetryButtonPressed:
- return StatusUpdater::Retry;
- case ErrorDlg::AbortButtonPressed:
+ return StatusUpdater::continueNext;
+ case ErrorDlg::retryButtonPressed:
+ return StatusUpdater::retry;
+ case ErrorDlg::abortButtonPressed:
{
unhandledErrors.Add(text);
abortionRequested = true;
@@ -2244,7 +2288,7 @@ int SyncStatusUpdater::reportError(const wxString& text)
assert (false);
}
- return StatusUpdater::Continue; //dummy return value
+ return StatusUpdater::continueNext; //dummy return value
}
@@ -2254,9 +2298,8 @@ void SyncStatusUpdater::triggerUI_Refresh()
throw AbortThisProcess(); //abort can be triggered by syncStatusFrame
if (updateUI_IsAllowed()) //test if specific time span between ui updates is over
- {
syncStatusFrame->updateStatusDialogNow();
- }
}
+
diff --git a/ui/MainDialog.h b/ui/MainDialog.h
index 7803cfd6..1f014502 100644
--- a/ui/MainDialog.h
+++ b/ui/MainDialog.h
@@ -22,7 +22,7 @@
using namespace std;
-const wxString ConstFilteredOut = "(-)";
+const wxString constFilteredOut = "(-)";
struct UI_GridLine
{
@@ -42,9 +42,8 @@ struct UI_GridLine
};
typedef vector<UI_GridLine> UI_Grid;
-bool updateUI_IsAllowed(); //test if a specific amount of time is over
-void updateUI_Now(); //do the updating
-
+bool updateUI_IsAllowed(); //test if a specific amount of time is over
+void updateUI_Now(); //do the updating
extern int leadingPanel;
@@ -66,17 +65,13 @@ private:
void readConfigurationFromHD(const wxString& filename, bool programStartup = false);
void writeConfigurationToHD(const wxString& filename);
-
- void loadResourceFiles();
- void unloadResourceFiles();
+ void loadDefaultConfiguration();
void updateViewFilterButtons();
void updateFilterButton();
void addCfgFileToHistory(const wxString& filename);
- void synchronizeFolders(FileCompareResult& grid, const SyncConfiguration config);
-
static wxString evaluateCmpResult(const CompareFilesResult result, const bool selectedForSynchronization);
//main method for putting gridData on UI: maps data respecting current view settings
@@ -84,7 +79,8 @@ private:
void mapFileModelToUI(UI_Grid& output, const FileCompareResult& fileCmpResult);
void updateStatusInformation(const UI_Grid& output);
- void filterRangeManual(int begin, int end, int leadingRow);
+ void filterRangeManual(const set<int>& rowsToFilterOnUI_View, int leadingRow);
+
void deleteFilesOnGrid(wxGrid* grid);
//work to be done in idle time
@@ -131,7 +127,7 @@ private:
void OnLoadConfiguration( wxCommandEvent& event);
void OnChoiceKeyEvent( wxKeyEvent& event );
-void onResizeMainWindow(wxEvent& event);
+ void onResizeMainWindow(wxEvent& event);
void OnAbortCompare( wxCommandEvent& event);
void OnFilterButton( wxCommandEvent& event);
void OnHideFilteredButton( wxCommandEvent& event);
@@ -178,7 +174,8 @@ void onResizeMainWindow(wxEvent& event);
int posYNotMaximized;
//other options
- bool useRecycleBin; //use Recycle bin when deleting or overwriting files while synchronizing
+ bool useRecycleBin; //use Recycle bin when deleting or overwriting files while synchronizing
+ bool hideErrorMessages; //hides error messages during synchronization
//***********************************************
@@ -229,37 +226,39 @@ private:
//######################################################################################
//classes handling sync and compare error as well as status information
+class CompareStatus;
+class SyncStatus;
class CompareStatusUpdater : public StatusUpdater
{
public:
- CompareStatusUpdater(MainDialog* dlg, wxStatusBar* mainWindowBar);
+ CompareStatusUpdater(MainDialog* dlg);
~CompareStatusUpdater();
- void updateStatus(const wxString& text);
- void updateProgressIndicator(double number);
+ void updateStatusText(const wxString& text);
+ void initNewProcess(int objectsTotal, double dataTotal, int processID);
+ void updateProcessedData(int objectsProcessed, double dataProcessed);
int reportError(const wxString& text);
void triggerUI_Refresh();
private:
MainDialog* mainDialog;
- wxStatusBar* statusBar;
bool suppressUI_Errormessages;
-
- unsigned int numberOfScannedObjects;
+ CompareStatus* statusPanel;
+ int currentProcess;
};
-class SyncStatus;
class SyncStatusUpdater : public StatusUpdater
{
public:
- SyncStatusUpdater(wxWindow* dlg, double gaugeTotalElements);
+ SyncStatusUpdater(wxWindow* dlg, bool hideErrorMessages);
~SyncStatusUpdater();
- void updateStatus(const wxString& text);
- void updateProgressIndicator(double number);
+ void updateStatusText(const wxString& text);
+ void initNewProcess(int objectsTotal, double dataTotal, int processID);
+ void updateProcessedData(int objectsProcessed, double dataProcessed);
int reportError(const wxString& text);
void triggerUI_Refresh();
diff --git a/ui/Resources.cpp b/ui/Resources.cpp
index a92c73f7..3bbd1523 100644
--- a/ui/Resources.cpp
+++ b/ui/Resources.cpp
@@ -4,6 +4,18 @@
#include <wx/image.h>
#include <stdexcept> //for std::runtime_error
+#ifdef FFS_WIN
+wxChar GlobalResources::fileNameSeparator = '\\';
+#endif // FFS_WIN
+
+#ifdef FFS_LINUX
+wxChar GlobalResources::fileNameSeparator = '/';
+#endif // FFS_LINUX
+
+const wxChar* GlobalResources::floatingPointSeparator = "";
+const wxChar* GlobalResources::numberSeparator = "";
+
+
map<wxString, wxBitmap*> GlobalResources::bitmapResource;
wxBitmap* GlobalResources::bitmapLeftArrow = 0;
@@ -38,13 +50,21 @@ wxBitmap* GlobalResources::bitmapFilterOff = 0;
wxBitmap* GlobalResources::bitmapWarning = 0;
wxBitmap* GlobalResources::bitmapSmallUp = 0;
wxBitmap* GlobalResources::bitmapSmallDown = 0;
-wxBitmap* GlobalResources::bitmapSave = 0;
+wxBitmap* GlobalResources::bitmapSave = 0;
+wxBitmap* GlobalResources::bitmapFFS = 0;
+wxBitmap* GlobalResources::bitmapDeleteFile = 0;
wxAnimation* GlobalResources::animationMoney = 0;
+wxAnimation* GlobalResources::animationSync = 0;
void GlobalResources::loadResourceFiles()
{
+
+ floatingPointSeparator = _(".");
+ numberSeparator = _(",");
+
+
//map, allocate and initialize pictures
bitmapResource["left arrow.png"] = (bitmapLeftArrow = new wxBitmap(wxNullBitmap));
bitmapResource["start sync.png"] = (bitmapStartSync = new wxBitmap(wxNullBitmap));
@@ -79,8 +99,11 @@ void GlobalResources::loadResourceFiles()
bitmapResource["small arrow up.png"] = (bitmapSmallUp = new wxBitmap(wxNullBitmap));
bitmapResource["small arrow down.png"] = (bitmapSmallDown = new wxBitmap(wxNullBitmap));
bitmapResource["save.png"] = (bitmapSave = new wxBitmap(wxNullBitmap));
+ bitmapResource["FFS.png"] = (bitmapFFS = new wxBitmap(wxNullBitmap));
+ bitmapResource["deleteFile.png"] = (bitmapDeleteFile = new wxBitmap(wxNullBitmap));
animationMoney = new wxAnimation(wxNullAnimation);
+ animationSync = new wxAnimation(wxNullAnimation);
wxFileInputStream input("Resources.dat");
if (!input.IsOk()) throw runtime_error(_("Unable to load Resources.dat!"));
@@ -99,6 +122,7 @@ void GlobalResources::loadResourceFiles()
}
animationMoney->LoadFile("Resources.a01");
+ animationSync->LoadFile("Resources.a02");
}
@@ -110,4 +134,5 @@ void GlobalResources::unloadResourceFiles()
//free other resources
delete animationMoney;
+ delete animationSync;
}
diff --git a/ui/Resources.h b/ui/Resources.h
index fa7eaf29..e2ae1303 100644
--- a/ui/Resources.h
+++ b/ui/Resources.h
@@ -11,10 +11,15 @@ using namespace std;
class GlobalResources
{
public:
-
static void loadResourceFiles();
static void unloadResourceFiles();
+ //language dependent global variables: need to be initialized by CustomLocale on program startup
+ static wxChar fileNameSeparator;
+ static const wxChar* floatingPointSeparator;
+ static const wxChar* numberSeparator;
+
+ //image resource objects
static wxBitmap* bitmapLeftArrow;
static wxBitmap* bitmapStartSync;
static wxBitmap* bitmapRightArrow;
@@ -48,8 +53,11 @@ public:
static wxBitmap* bitmapSmallUp;
static wxBitmap* bitmapSmallDown;
static wxBitmap* bitmapSave;
+ static wxBitmap* bitmapFFS;
+ static wxBitmap* bitmapDeleteFile;
static wxAnimation* animationMoney;
+ static wxAnimation* animationSync;
private:
//resource mapping
diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp
index cf21bc22..77fc8a59 100644
--- a/ui/SmallDialogs.cpp
+++ b/ui/SmallDialogs.cpp
@@ -1,10 +1,13 @@
#include "smallDialogs.h"
#include "../library/globalFunctions.h"
+using namespace globalFunctions;
+
AboutDlg::AboutDlg(MainDialog* window) : AboutDlgGenerated(window)
{
m_bitmap9->SetBitmap(*GlobalResources::bitmapWebsite);
m_bitmap10->SetBitmap(*GlobalResources::bitmapEmail);
+ m_bitmap11->SetBitmap(*GlobalResources::bitmapFFS);
m_animationControl1->SetAnimation(*GlobalResources::animationMoney);
m_animationControl1->Play();
@@ -79,7 +82,7 @@ void FilterDlg::OnOK(wxCommandEvent& event)
mainDialog->excludeFilter = m_textCtrlExclude->GetValue();
//when leaving dialog: filter and redraw grid, if filter is active
- EndModal(OkayButtonPressed);
+ EndModal(okayButtonPressed);
}
@@ -104,6 +107,7 @@ DeleteDialog::DeleteDialog(const wxString& headerText, const wxString& messageTe
{
m_staticTextHeader->SetLabel(headerText);
m_textCtrlMessage->SetValue(messageText);
+ m_bitmap12->SetBitmap(*GlobalResources::bitmapDeleteFile);
m_buttonOK->SetFocus();
}
@@ -113,17 +117,17 @@ DeleteDialog::~DeleteDialog() {}
void DeleteDialog::OnOK(wxCommandEvent& event)
{
- EndModal(OkayButtonPressed);
+ EndModal(okayButtonPressed);
}
void DeleteDialog::OnCancel(wxCommandEvent& event)
{
- EndModal(CancelButtonPressed);
+ EndModal(cancelButtonPressed);
}
void DeleteDialog::OnClose(wxCloseEvent& event)
{
- EndModal(CancelButtonPressed);
+ EndModal(cancelButtonPressed);
}
//########################################################################################
@@ -140,49 +144,58 @@ ErrorDlg::ErrorDlg(const wxString messageText, bool& suppressErrormessages) :
ErrorDlg::~ErrorDlg() {}
+
void ErrorDlg::OnClose(wxCloseEvent& event)
{
//suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here
- EndModal(AbortButtonPressed);
+ EndModal(abortButtonPressed);
}
+
void ErrorDlg::OnContinue(wxCommandEvent& event)
{
suppressErrors = m_checkBoxSuppress->GetValue();
- EndModal(ContinueButtonPressed);
+ EndModal(continueButtonPressed);
}
+
void ErrorDlg::OnRetry(wxCommandEvent& event)
{
//suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here
- EndModal(RetryButtonPressed);
+ EndModal(retryButtonPressed);
}
+
void ErrorDlg::OnAbort(wxCommandEvent& event)
{
//suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here
- EndModal(AbortButtonPressed);
+ EndModal(abortButtonPressed);
}
//########################################################################################
-SyncStatus::SyncStatus(StatusUpdater* updater, double gaugeTotalElements, wxWindow* parentWindow) :
+SyncStatus::SyncStatus(StatusUpdater* updater, wxWindow* parentWindow) :
SyncStatusGenerated(parentWindow),
currentStatusUpdater(updater),
windowToDis(parentWindow),
currentProcessIsRunning(true),
- numberOfProcessedObjects(0)
+ totalData(0),
+ currentData(0),
+ scalingFactor(0),
+ currentObjects(0),
+ totalObjects(0)
{
+ m_animationControl1->SetAnimation(*GlobalResources::animationSync);
+ m_animationControl1->Play();
+
//initialize gauge
m_gauge1->SetRange(50000);
m_gauge1->SetValue(0);
- resetGauge(gaugeTotalElements);
-
m_buttonAbort->SetFocus();
if (windowToDis) //disable (main) window while this status dialog is shown
- windowToDis->Enable(false);
+ windowToDis->Disable();
}
@@ -190,28 +203,31 @@ SyncStatus::~SyncStatus()
{
if (windowToDis)
{
- windowToDis->Enable(true);
+ windowToDis->Enable();
windowToDis->Raise();
}
}
-void SyncStatus::resetGauge(double totalNrOfElements)
+void SyncStatus::resetGauge(int totalObjectsToProcess, double totalDataToProcess)
{
- currentElements = 0;
- totalElements = totalNrOfElements;
+ currentData = 0;
+ totalData = totalDataToProcess;
+
+ currentObjects = 0;
+ totalObjects = totalObjectsToProcess;
- if (totalElements != 0)
- scalingFactor = 50000 / totalElements; //let's normalize to 50000
+ if (totalData != 0)
+ scalingFactor = 50000 / totalData; //let's normalize to 50000
else
scalingFactor = 0;
}
-void SyncStatus::incProgressIndicator_NoUpdate(double number)
+void SyncStatus::incProgressIndicator_NoUpdate(int objectsProcessed, double dataProcessed)
{
- currentElements+= number;
- numberOfProcessedObjects++;
+ currentData+= dataProcessed;
+ currentObjects+= objectsProcessed;
}
@@ -224,19 +240,17 @@ void SyncStatus::setStatusText_NoUpdate(const wxString& text)
void SyncStatus::updateStatusDialogNow()
{
//progress indicator
- m_gauge1->SetValue(int(currentElements * scalingFactor));
+ m_gauge1->SetValue(int(currentData * scalingFactor));
//status text
m_textCtrlInfo->SetValue(currentStatusText);
- //processed objects
- m_staticTextProcessedObj->SetLabel(GlobalFunctions::numberToWxString(numberOfProcessedObjects));
+ //remaining objects
+ m_staticTextRemainingObj->SetLabel(numberToWxString(totalObjects - currentObjects));
//remaining bytes left for copy
- const wxString remainingBytes =
- FreeFileSync::formatFilesizeToShortString(mpz_class(currentElements)) + "/" +
- FreeFileSync::formatFilesizeToShortString(mpz_class(totalElements));
- m_staticTextBytesCopied->SetLabel(remainingBytes);
+ const wxString remainingBytes = FreeFileSync::formatFilesizeToShortString(mpz_class(totalData - currentData));
+ m_staticTextDataRemaining->SetLabel(remainingBytes);
//do the ui update
updateUI_Now();
@@ -252,6 +266,8 @@ void SyncStatus::processHasFinished(const wxString& finalStatusText) //essential
m_buttonOK->Show();
m_buttonOK->SetFocus();
+ m_animationControl1->Stop();
+
updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed
Layout(); //
}
@@ -271,6 +287,82 @@ void SyncStatus::OnAbort(wxCommandEvent& event)
void SyncStatus::OnClose(wxCloseEvent& event)
{
- if (!currentProcessIsRunning) Destroy();
+ if (currentProcessIsRunning) currentStatusUpdater->requestAbortion();
+ else
+ Destroy();
}
+//########################################################################################
+
+
+CompareStatus::CompareStatus(wxWindow* parentWindow) :
+ CompareStatusGenerated(parentWindow),
+ scannedFiles(0),
+ totalMD5Data(0),
+ currentMD5Data(0),
+ scalingFactorMD5(0),
+ currentMD5Objects(0),
+ totalMD5Objects(0)
+{
+ //initialize gauge
+ m_gauge2->SetRange(50000);
+ m_gauge2->SetValue(0);
+}
+
+CompareStatus::~CompareStatus() {}
+
+
+void CompareStatus::resetMD5Gauge(int totalMD5ObjectsToProcess, double totalMD5DataToProcess)
+{
+ currentMD5Data = 0;
+ totalMD5Data = totalMD5DataToProcess;
+
+ currentMD5Objects = 0;
+ totalMD5Objects = totalMD5ObjectsToProcess;
+
+ if (totalMD5Data != 0)
+ scalingFactorMD5 = 50000 / totalMD5Data; //let's normalize to 50000
+ else
+ scalingFactorMD5 = 0;
+}
+
+
+void CompareStatus::incScannedFiles_NoUpdate(int number)
+{
+ scannedFiles+= number;
+}
+
+
+void CompareStatus::incProcessedMD5Data_NoUpdate(int objectsProcessed, double dataProcessed)
+{
+ currentMD5Data+= dataProcessed;
+ currentMD5Objects+= objectsProcessed;
+}
+
+
+void CompareStatus::setStatusText_NoUpdate(const wxString& text)
+{
+ currentStatusText = text;
+}
+
+
+void CompareStatus::updateStatusPanelNow()
+{
+ //status texts
+ m_textCtrlFilename->SetValue(currentStatusText);
+
+ m_staticTextScanned->SetLabel(numberToWxString(scannedFiles));
+
+ //progress indicator for MD5
+ m_gauge2->SetValue(int(currentMD5Data * scalingFactorMD5));
+
+ //remaining MD5 objects
+ m_staticTextFilesToCompare->SetLabel(numberToWxString(totalMD5Objects - currentMD5Objects));
+
+ //remaining bytes left for MD5 calculation
+ const wxString remainingBytes = FreeFileSync::formatFilesizeToShortString(mpz_class(totalMD5Data - currentMD5Data));
+ m_staticTextDataToCompare->SetLabel(remainingBytes);
+
+ //do the ui update
+ updateUI_Now();
+}
diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h
index c41ca2b8..9ae3ae88 100644
--- a/ui/SmallDialogs.h
+++ b/ui/SmallDialogs.h
@@ -35,7 +35,7 @@ public:
FilterDlg(MainDialog* window);
~FilterDlg();
- static const int OkayButtonPressed = 25;
+ static const int okayButtonPressed = 25;
private:
void OnDefault(wxCommandEvent& event);
@@ -53,8 +53,8 @@ public:
DeleteDialog(const wxString& headerText, const wxString& messageText, wxWindow* main);
~DeleteDialog();
- static const int OkayButtonPressed = 35;
- static const int CancelButtonPressed = 45;
+ static const int okayButtonPressed = 35;
+ static const int cancelButtonPressed = 45;
private:
void OnOK(wxCommandEvent& event);
@@ -69,9 +69,9 @@ public:
ErrorDlg(const wxString messageText, bool& suppressErrormessages);
~ErrorDlg();
- static const int ContinueButtonPressed = 35;
- static const int RetryButtonPressed = 45;
- static const int AbortButtonPressed = 55;
+ static const int continueButtonPressed = 35;
+ static const int retryButtonPressed = 45;
+ static const int abortButtonPressed = 55;
private:
void OnClose(wxCloseEvent& event);
@@ -86,11 +86,11 @@ private:
class SyncStatus : public SyncStatusGenerated
{
public:
- SyncStatus(StatusUpdater* updater, double gaugeTotalElements, wxWindow* parentWindow = 0);
+ SyncStatus(StatusUpdater* updater, wxWindow* parentWindow = 0);
~SyncStatus();
- void resetGauge(double totalNrOfElements);
- void incProgressIndicator_NoUpdate(double number);
+ void resetGauge(int totalObjectsToProcess, double totalDataToProcess);
+ void incProgressIndicator_NoUpdate(int objectsProcessed, double dataProcessed);
void setStatusText_NoUpdate(const wxString& text);
void updateStatusDialogNow();
@@ -106,12 +106,39 @@ private:
bool currentProcessIsRunning;
//gauge variables
- double totalElements; //each element represents one byte for proper progress indicator scaling
- double currentElements;
- double scalingFactor; //nr of elements has to be normalized to smaller nr. because of range of int limitation
+ double totalData; //each data element represents one byte for proper progress indicator scaling
+ double currentData;
+ double scalingFactor; //nr of elements has to be normalized to smaller nr. because of range of int limitation
+ int currentObjects; //each object represents a file or directory processed
+ int totalObjects;
wxString currentStatusText;
- unsigned int numberOfProcessedObjects;
+};
+
+
+class CompareStatus : public CompareStatusGenerated
+{
+public:
+ CompareStatus(wxWindow* parentWindow);
+ ~CompareStatus();
+
+ void resetMD5Gauge(int totalMD5ObjectsToProcess, double totalMD5DataToProcess);
+ void incScannedFiles_NoUpdate(int number);
+ void incProcessedMD5Data_NoUpdate(int objectsProcessed, double dataProcessed);
+ void setStatusText_NoUpdate(const wxString& text);
+ void updateStatusPanelNow();
+
+private:
+ //status variables
+ unsigned int scannedFiles;
+ wxString currentStatusText;
+
+ //gauge variables
+ double totalMD5Data; //each data element represents one byte for proper progress indicator scaling
+ double currentMD5Data;
+ double scalingFactorMD5; //nr of elements has to be normalized to smaller nr. because of range of int limitation
+ int currentMD5Objects; //each object represents a file or directory processed
+ int totalMD5Objects;
};
diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp
index 1f2804ae..a40da108 100644
--- a/ui/SyncDialog.cpp
+++ b/ui/SyncDialog.cpp
@@ -8,6 +8,7 @@ SyncDialog::SyncDialog(MainDialog* window)
localSyncConfiguration = mainDialog->syncConfiguration;
m_checkBoxUseRecycler->SetValue(mainDialog->useRecycleBin);
+ m_checkBoxHideErrors->SetValue(mainDialog->hideErrorMessages);
//set icons for this dialog
m_bpButton18->SetBitmapLabel(*GlobalResources::bitmapStartSync);
@@ -21,18 +22,18 @@ SyncDialog::SyncDialog(MainDialog* window)
updateConfigIcons();
//set radiobutton
- if (localSyncConfiguration.exLeftSideOnly == SyncDirRight &&
- localSyncConfiguration.exRightSideOnly == SyncDirRight &&
- localSyncConfiguration.leftNewer == SyncDirRight &&
- localSyncConfiguration.rightNewer == SyncDirRight &&
- localSyncConfiguration.different == SyncDirRight)
+ if (localSyncConfiguration.exLeftSideOnly == syncDirRight &&
+ localSyncConfiguration.exRightSideOnly == syncDirRight &&
+ localSyncConfiguration.leftNewer == syncDirRight &&
+ localSyncConfiguration.rightNewer == syncDirRight &&
+ localSyncConfiguration.different == syncDirRight)
m_radioBtn1->SetValue(true); //one way ->
- else if (localSyncConfiguration.exLeftSideOnly == SyncDirRight &&
- localSyncConfiguration.exRightSideOnly == SyncDirLeft &&
- localSyncConfiguration.leftNewer == SyncDirRight &&
- localSyncConfiguration.rightNewer == SyncDirLeft &&
- localSyncConfiguration.different == SyncDirNone)
+ else if (localSyncConfiguration.exLeftSideOnly == syncDirRight &&
+ localSyncConfiguration.exRightSideOnly == syncDirLeft &&
+ localSyncConfiguration.leftNewer == syncDirRight &&
+ localSyncConfiguration.rightNewer == syncDirLeft &&
+ localSyncConfiguration.different == syncDirNone)
m_radioBtn2->SetValue(true); //two way <->
else
@@ -46,88 +47,97 @@ SyncDialog::~SyncDialog() {}
void SyncDialog::updateConfigIcons()
{
- if (localSyncConfiguration.exLeftSideOnly == SyncDirRight)
+ if (localSyncConfiguration.exLeftSideOnly == syncDirRight)
{
m_bpButton5->SetBitmapLabel(*GlobalResources::bitmapRightArrow);
m_bpButton5->SetToolTip(_("Copy from left to right"));
}
- else if (localSyncConfiguration.exLeftSideOnly == SyncDirLeft)
+ else if (localSyncConfiguration.exLeftSideOnly == syncDirLeft)
{
m_bpButton5->SetBitmapLabel(*GlobalResources::bitmapDelete);
m_bpButton5->SetToolTip(_("Delete files existing on left side only"));
}
- else if (localSyncConfiguration.exLeftSideOnly == SyncDirNone)
+ else if (localSyncConfiguration.exLeftSideOnly == syncDirNone)
{
m_bpButton5->SetBitmapLabel(wxNullBitmap);
m_bpButton5->SetToolTip(_("Do nothing"));
}
- if (localSyncConfiguration.exRightSideOnly == SyncDirRight)
+ if (localSyncConfiguration.exRightSideOnly == syncDirRight)
{
m_bpButton6->SetBitmapLabel(*GlobalResources::bitmapDelete);
m_bpButton6->SetToolTip(_("Delete files existing on right side only"));
}
- else if (localSyncConfiguration.exRightSideOnly == SyncDirLeft)
+ else if (localSyncConfiguration.exRightSideOnly == syncDirLeft)
{
m_bpButton6->SetBitmapLabel(*GlobalResources::bitmapLeftArrow);
m_bpButton6->SetToolTip(_("Copy from right to left"));
}
- else if (localSyncConfiguration.exRightSideOnly == SyncDirNone)
+ else if (localSyncConfiguration.exRightSideOnly == syncDirNone)
{
m_bpButton6->SetBitmapLabel(wxNullBitmap);
m_bpButton6->SetToolTip(_("Do nothing"));
}
- if (localSyncConfiguration.leftNewer == SyncDirRight)
+ if (localSyncConfiguration.leftNewer == syncDirRight)
{
m_bpButton7->SetBitmapLabel(*GlobalResources::bitmapRightArrow);
m_bpButton7->SetToolTip(_("Copy from left to right overwriting"));
}
- else if (localSyncConfiguration.leftNewer == SyncDirLeft)
+ else if (localSyncConfiguration.leftNewer == syncDirLeft)
{
m_bpButton7->SetBitmapLabel(*GlobalResources::bitmapLeftArrow);
m_bpButton7->SetToolTip(_("Copy from right to left overwriting"));
}
- else if (localSyncConfiguration.leftNewer == SyncDirNone)
+ else if (localSyncConfiguration.leftNewer == syncDirNone)
{
m_bpButton7->SetBitmapLabel(wxNullBitmap);
m_bpButton7->SetToolTip(_("Do nothing"));
}
- if (localSyncConfiguration.rightNewer == SyncDirRight)
+ if (localSyncConfiguration.rightNewer == syncDirRight)
{
m_bpButton8->SetBitmapLabel(*GlobalResources::bitmapRightArrow);
m_bpButton8->SetToolTip(_("Copy from left to right overwriting"));
}
- else if (localSyncConfiguration.rightNewer == SyncDirLeft)
+ else if (localSyncConfiguration.rightNewer == syncDirLeft)
{
m_bpButton8->SetBitmapLabel(*GlobalResources::bitmapLeftArrow);
m_bpButton8->SetToolTip(_("Copy from right to left overwriting"));
}
- else if (localSyncConfiguration.rightNewer == SyncDirNone)
+ else if (localSyncConfiguration.rightNewer == syncDirNone)
{
m_bpButton8->SetBitmapLabel(wxNullBitmap);
m_bpButton8->SetToolTip(_("Do nothing"));
}
- if (localSyncConfiguration.different == SyncDirRight)
+ if (localSyncConfiguration.different == syncDirRight)
{
m_bpButton9->SetBitmapLabel(*GlobalResources::bitmapRightArrow);
m_bpButton9->SetToolTip(_("Copy from left to right overwriting"));
}
- else if (localSyncConfiguration.different == SyncDirLeft)
+ else if (localSyncConfiguration.different == syncDirLeft)
{
m_bpButton9->SetBitmapLabel(*GlobalResources::bitmapLeftArrow);
m_bpButton9->SetToolTip(_("Copy from right to left overwriting"));
}
- else if (localSyncConfiguration.different == SyncDirNone)
+ else if (localSyncConfiguration.different == syncDirNone)
{
m_bpButton9->SetBitmapLabel(wxNullBitmap);
m_bpButton9->SetToolTip(_("Do nothing"));
}
//update preview of bytes to be transferred:
- m_textCtrl5->SetValue(FreeFileSync::formatFilesizeToShortString(FreeFileSync::calcTotalBytesToTransfer(mainDialog->currentGridData, localSyncConfiguration)));
+ int objectsTotal = 0;
+ double dataTotal = 0;
+ FreeFileSync::calcTotalBytesToSync(objectsTotal, dataTotal, mainDialog->currentGridData, localSyncConfiguration);
+
+ wxString objects = globalFunctions::numberToWxString(objectsTotal);
+ globalFunctions::includeNumberSeparator(objects);
+ wxString data = FreeFileSync::formatFilesizeToShortString(dataTotal);
+
+ m_textCtrl12->SetValue(objects);
+ m_textCtrl5->SetValue(data);
}
@@ -148,6 +158,7 @@ void SyncDialog::OnBack(wxCommandEvent& event)
//write configuration to main dialog
mainDialog->syncConfiguration = localSyncConfiguration;
mainDialog->useRecycleBin = m_checkBoxUseRecycler->GetValue();
+ mainDialog->hideErrorMessages = m_checkBoxHideErrors->GetValue();
EndModal(0);
}
@@ -157,6 +168,7 @@ void SyncDialog::OnStartSync(wxCommandEvent& event)
//write configuration to main dialog
mainDialog->syncConfiguration = localSyncConfiguration;
mainDialog->useRecycleBin = m_checkBoxUseRecycler->GetValue();
+ mainDialog->hideErrorMessages = m_checkBoxHideErrors->GetValue();
EndModal(StartSynchronizationProcess);
}
@@ -177,11 +189,11 @@ void SyncDialog::OnSelectRecycleBin(wxCommandEvent& event)
void SyncDialog::OnSyncLeftToRight( wxCommandEvent& event )
{
- localSyncConfiguration.exLeftSideOnly = SyncDirRight;
- localSyncConfiguration.exRightSideOnly = SyncDirRight;
- localSyncConfiguration.leftNewer = SyncDirRight;
- localSyncConfiguration.rightNewer = SyncDirRight;
- localSyncConfiguration.different = SyncDirRight;
+ localSyncConfiguration.exLeftSideOnly = syncDirRight;
+ localSyncConfiguration.exRightSideOnly = syncDirRight;
+ localSyncConfiguration.leftNewer = syncDirRight;
+ localSyncConfiguration.rightNewer = syncDirRight;
+ localSyncConfiguration.different = syncDirRight;
updateConfigIcons();
@@ -192,11 +204,11 @@ void SyncDialog::OnSyncLeftToRight( wxCommandEvent& event )
void SyncDialog::OnSyncBothSides( wxCommandEvent& event )
{
- localSyncConfiguration.exLeftSideOnly = SyncDirRight;
- localSyncConfiguration.exRightSideOnly = SyncDirLeft;
- localSyncConfiguration.leftNewer = SyncDirRight;
- localSyncConfiguration.rightNewer = SyncDirLeft;
- localSyncConfiguration.different = SyncDirNone;
+ localSyncConfiguration.exLeftSideOnly = syncDirRight;
+ localSyncConfiguration.exRightSideOnly = syncDirLeft;
+ localSyncConfiguration.leftNewer = syncDirRight;
+ localSyncConfiguration.rightNewer = syncDirLeft;
+ localSyncConfiguration.different = syncDirNone;
updateConfigIcons();
//if event is triggered by button
@@ -206,12 +218,12 @@ void SyncDialog::OnSyncBothSides( wxCommandEvent& event )
void toggleSyncDirection(SyncDirection& current)
{
- if (current == SyncDirRight)
- current = SyncDirLeft;
- else if (current == SyncDirLeft)
- current = SyncDirNone;
- else if (current== SyncDirNone)
- current = SyncDirRight;
+ if (current == syncDirRight)
+ current = syncDirLeft;
+ else if (current == syncDirLeft)
+ current = syncDirNone;
+ else if (current== syncDirNone)
+ current = syncDirRight;
else
assert (false);
}
diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp
index 4308804e..1d51a28f 100644
--- a/ui/guiGenerated.cpp
+++ b/ui/guiGenerated.cpp
@@ -111,7 +111,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
bSizer6->Add( 40, 0, 0, wxEXPAND, 5 );
- bSizer1->Add( bSizer6, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
+ bSizer1->Add( bSizer6, 0, wxEXPAND, 5 );
wxBoxSizer* bSizer2;
bSizer2 = new wxBoxSizer( wxHORIZONTAL );
@@ -354,7 +354,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
- bSizer3->Add( 190, 0, 0, wxEXPAND, 5 );
+ bSizer3->Add( 190, 0, 0, wxALL, 5 );
bSizer3->Add( 0, 0, 1, wxEXPAND, 5 );
@@ -451,6 +451,101 @@ GuiGenerated::~GuiGenerated()
m_bpButton10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnQuit ), NULL, this );
}
+CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style )
+{
+ wxBoxSizer* bSizer40;
+ bSizer40 = new wxBoxSizer( wxVERTICAL );
+
+ wxBoxSizer* bSizer42;
+ bSizer42 = new wxBoxSizer( wxHORIZONTAL );
+
+ 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->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->Wrap( -1 );
+ m_staticTextScanned->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
+
+ sbSizer10->Add( m_staticTextScanned, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizer42->Add( sbSizer10, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ bSizer42->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ wxStaticBoxSizer* sbSizer13;
+ sbSizer13 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxHORIZONTAL );
+
+ m_staticText46 = new wxStaticText( this, wxID_ANY, _("Files to compare:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText46->Wrap( -1 );
+ m_staticText46->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
+
+ sbSizer13->Add( m_staticText46, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 );
+
+ m_staticTextFilesToCompare = new wxStaticText( this, wxID_ANY, _("123456"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextFilesToCompare->Wrap( -1 );
+ m_staticTextFilesToCompare->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
+
+ sbSizer13->Add( m_staticTextFilesToCompare, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
+
+ bSizer42->Add( sbSizer13, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ bSizer42->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ wxStaticBoxSizer* sbSizer11;
+ sbSizer11 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxHORIZONTAL );
+
+ m_staticText32 = new wxStaticText( this, wxID_ANY, _("Data to compare:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText32->Wrap( -1 );
+ m_staticText32->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
+
+ 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->Wrap( -1 );
+ m_staticTextDataToCompare->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
+
+ sbSizer11->Add( m_staticTextDataToCompare, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizer42->Add( sbSizer11, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizer40->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 );
+
+ wxBoxSizer* bSizer48;
+ bSizer48 = new wxBoxSizer( wxHORIZONTAL );
+
+ m_staticText30 = new wxStaticText( this, wxID_ANY, _("Operation:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText30->Wrap( -1 );
+ m_staticText30->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
+
+ bSizer48->Add( m_staticText30, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_textCtrlFilename = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
+ m_textCtrlFilename->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
+
+ bSizer48->Add( m_textCtrlFilename, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizer40->Add( bSizer48, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
+
+ m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL );
+ bSizer40->Add( m_gauge2, 0, wxALL|wxEXPAND, 5 );
+
+ this->SetSizer( bSizer40 );
+ this->Layout();
+ bSizer40->Fit( this );
+}
+
+CompareStatusGenerated::~CompareStatusGenerated()
+{
+}
+
SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
@@ -475,27 +570,42 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const
m_bpButton18 = new wxBitmapButton( this, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 140,58 ), wxBU_AUTODRAW );
m_bpButton18->SetDefault();
- m_bpButton18->SetToolTip( _("Start synchronizing files") );
+ m_bpButton18->SetToolTip( _("Start synchronization") );
+
+ m_bpButton18->SetToolTip( _("Start synchronization") );
+
+ bSizer201->Add( m_bpButton18, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ bSizer201->Add( 10, 0, 0, wxEXPAND, 5 );
- m_bpButton18->SetToolTip( _("Start synchronizing files") );
+ wxGridSizer* gSizer1;
+ gSizer1 = new wxGridSizer( 2, 2, 0, 0 );
- bSizer201->Add( m_bpButton18, 0, wxRIGHT, 5 );
+ m_staticText37 = new wxStaticText( this, wxID_ANY, _("Objects to process:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText37->Wrap( -1 );
+ m_staticText37->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
- wxBoxSizer* bSizer211;
- bSizer211 = new wxBoxSizer( wxHORIZONTAL );
+ gSizer1->Add( m_staticText37, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
- m_staticText14 = new wxStaticText( this, wxID_ANY, _("Data to be transferred:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_textCtrl12 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
+ m_textCtrl12->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) );
+ m_textCtrl12->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
+
+ gSizer1->Add( m_textCtrl12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_staticText14 = new wxStaticText( this, wxID_ANY, _("Data to transfer:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
m_staticText14->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
- bSizer211->Add( m_staticText14, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+ gSizer1->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_textCtrl5 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 55,-1 ), wxTE_READONLY );
m_textCtrl5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
- bSizer211->Add( m_textCtrl5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
+ gSizer1->Add( m_textCtrl5, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
- bSizer201->Add( bSizer211, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 );
+ bSizer201->Add( gSizer1, 0, wxALIGN_CENTER_VERTICAL, 5 );
bSizer29->Add( bSizer201, 0, wxEXPAND, 5 );
@@ -583,19 +693,30 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const
bSizer291->Add( m_button6, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 );
- m_button16 = new wxButton( this, wxID_CANCEL, _("dummyButton"), wxDefaultPosition, wxSize( 0,-1 ), 0 );
- bSizer291->Add( m_button16, 0, wxALL, 5 );
+ m_button16 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,-1 ), 0 );
+ bSizer291->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
bSizer291->Add( 82, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 );
+ wxBoxSizer* bSizer38;
+ bSizer38 = new wxBoxSizer( wxVERTICAL );
+
m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 );
m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") );
- bSizer291->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+ bSizer38->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_checkBoxHideErrors = new wxCheckBox( this, wxID_ANY, _("Hide error messages"), wxDefaultPosition, wxDefaultSize, 0 );
+
+ m_checkBoxHideErrors->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") );
- bSizer29->Add( bSizer291, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 );
+ bSizer38->Add( m_checkBoxHideErrors, 0, wxALL, 5 );
+
+ bSizer291->Add( bSizer38, 0, wxALIGN_BOTTOM, 5 );
+
+ bSizer29->Add( bSizer291, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
bSizer181->Add( bSizer29, 1, wxEXPAND, 5 );
@@ -809,11 +930,22 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS
bSizer31->Add( 0, 10, 0, wxEXPAND, 5 );
- m_staticText14 = new wxStaticText( this, wxID_ANY, _("FreeFileSync v1.3"), wxDefaultPosition, wxDefaultSize, 0 );
+ wxBoxSizer* bSizer36;
+ bSizer36 = new wxBoxSizer( wxHORIZONTAL );
+
+ m_bitmap11 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 );
+ bSizer36->Add( m_bitmap11, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ m_staticText14 = new wxStaticText( this, wxID_ANY, _("FreeFileSync v1.4"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText14->Wrap( -1 );
m_staticText14->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) );
- bSizer31->Add( m_staticText14, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ bSizer36->Add( m_staticText14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 );
+
+
+ bSizer36->Add( 40, 0, 0, wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizer31->Add( bSizer36, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
m_staticText15 = new wxStaticText( this, wxID_ANY, _("-Open-Source file synchronization-"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText15->Wrap( -1 );
@@ -996,11 +1128,25 @@ DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, c
bSizer24->Add( 0, 10, 0, wxEXPAND, 5 );
+ wxBoxSizer* bSizer41;
+ bSizer41 = new wxBoxSizer( wxHORIZONTAL );
+
+
+ bSizer41->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ 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->Wrap( -1 );
m_staticTextHeader->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
- bSizer24->Add( m_staticTextHeader, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ bSizer41->Add( m_staticTextHeader, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
+
+
+ bSizer41->Add( 0, 0, 1, wxEXPAND, 5 );
+
+ bSizer24->Add( bSizer41, 0, wxEXPAND, 5 );
m_textCtrlMessage = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY );
m_textCtrlMessage->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) );
@@ -1123,7 +1269,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w
bSizer22->Add( 0, 0, 1, wxEXPAND, 5 );
- m_button17 = new wxButton( this, wxID_CANCEL, _("dummyButton"), wxDefaultPosition, wxSize( 0,-1 ), 0 );
+ m_button17 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,-1 ), 0 );
bSizer22->Add( m_button17, 0, wxALL, 5 );
m_button10 = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( 80,30 ), 0 );
@@ -1163,13 +1309,21 @@ SyncStatusGenerated::SyncStatusGenerated( wxWindow* parent, wxWindowID id, const
bSizer27->Add( 0, 15, 0, wxEXPAND, 5 );
+ wxBoxSizer* bSizer37;
+ bSizer37 = new wxBoxSizer( wxHORIZONTAL );
+
+ m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 ));
+ bSizer37->Add( m_animationControl1, 0, wxALL, 5 );
+
m_staticText20 = new wxStaticText( this, wxID_ANY, _("Synchronization status"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText20->Wrap( -1 );
m_staticText20->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) );
- bSizer27->Add( m_staticText20, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 );
+ bSizer37->Add( m_staticText20, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 );
+
+ bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 );
- m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("Running..."), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 );
m_staticTextStatus->Wrap( -1 );
m_staticTextStatus->SetFont( wxFont( 14, 74, 93, 90, false, wxT("Tahoma") ) );
@@ -1187,18 +1341,6 @@ SyncStatusGenerated::SyncStatusGenerated( wxWindow* parent, wxWindowID id, const
bSizer31->Add( 0, 0, 1, wxEXPAND, 5 );
- m_staticText25 = new wxStaticText( this, wxID_ANY, _("Items completed:"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText25->Wrap( -1 );
- m_staticText25->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
-
- bSizer31->Add( m_staticText25, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 );
-
- m_staticTextProcessedObj = new wxStaticText( this, wxID_ANY, _("1000000"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
- m_staticTextProcessedObj->Wrap( -1 );
- m_staticTextProcessedObj->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
-
- bSizer31->Add( m_staticTextProcessedObj, 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 );
@@ -1215,19 +1357,19 @@ SyncStatusGenerated::SyncStatusGenerated( wxWindow* parent, wxWindowID id, const
wxBoxSizer* bSizer32;
bSizer32 = new wxBoxSizer( wxHORIZONTAL );
- m_staticText26 = new wxStaticText( this, wxID_ANY, _("Data copied:"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticText26 = new wxStaticText( this, wxID_ANY, _("Data remaining:"), wxDefaultPosition, wxDefaultSize, 0 );
m_staticText26->Wrap( -1 );
m_staticText26->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) );
bSizer32->Add( m_staticText26, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
- m_staticTextBytesCopied = new wxStaticText( this, wxID_ANY, _("--,- MB"), wxDefaultPosition, wxDefaultSize, 0 );
- m_staticTextBytesCopied->Wrap( -1 );
- m_staticTextBytesCopied->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
+ m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("--,- MB"), wxDefaultPosition, wxDefaultSize, 0 );
+ m_staticTextDataRemaining->Wrap( -1 );
+ m_staticTextDataRemaining->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
- bSizer32->Add( m_staticTextBytesCopied, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 );
+ bSizer32->Add( m_staticTextDataRemaining, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 );
- bSizer28->Add( bSizer32, 1, wxALIGN_CENTER_VERTICAL, 5 );
+ bSizer28->Add( bSizer32, 0, wxALIGN_CENTER_VERTICAL, 5 );
bSizer28->Add( 0, 0, 1, wxEXPAND, 5 );
@@ -1248,15 +1390,21 @@ SyncStatusGenerated::SyncStatusGenerated( wxWindow* parent, wxWindowID id, const
bSizer28->Add( 0, 0, 1, wxEXPAND, 5 );
wxBoxSizer* bSizer33;
- bSizer33 = new wxBoxSizer( wxVERTICAL );
+ bSizer33 = new wxBoxSizer( wxHORIZONTAL );
- m_staticText32 = new wxStaticText( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
- m_staticText32->Wrap( -1 );
- m_staticText32->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) );
+ m_staticText25 = new wxStaticText( this, wxID_ANY, _("Files 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 );
+
+ m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("1000000"), wxDefaultPosition, wxSize( -1,-1 ), 0 );
+ m_staticTextRemainingObj->Wrap( -1 );
+ m_staticTextRemainingObj->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) );
- bSizer33->Add( m_staticText32, 0, wxALL, 5 );
+ bSizer33->Add( m_staticTextRemainingObj, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 );
- bSizer28->Add( bSizer33, 1, wxEXPAND, 5 );
+ bSizer28->Add( bSizer33, 0, wxALIGN_CENTER_VERTICAL, 5 );
bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 );
diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h
index fe685d9c..2b6f5b6d 100644
--- a/ui/guiGenerated.h
+++ b/ui/guiGenerated.h
@@ -35,11 +35,11 @@ class CustomGrid;
#include <wx/statusbr.h>
#include <wx/frame.h>
#include <wx/stattext.h>
+#include <wx/gauge.h>
#include <wx/statline.h>
#include <wx/statbmp.h>
#include <wx/dialog.h>
#include <wx/animate.h>
-#include <wx/gauge.h>
///////////////////////////////////////////////////////////////////////////
@@ -129,12 +129,38 @@ class GuiGenerated : public wxFrame
public:
- GuiGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeFileSync - Folder Synchronization"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 930,603 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
+ GuiGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeFileSync - Folder Synchronization"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 933,612 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL );
~GuiGenerated();
};
///////////////////////////////////////////////////////////////////////////////
+/// Class CompareStatusGenerated
+///////////////////////////////////////////////////////////////////////////////
+class CompareStatusGenerated : public wxPanel
+{
+ private:
+
+ protected:
+ wxStaticText* m_staticText321;
+ wxStaticText* m_staticTextScanned;
+
+ wxStaticText* m_staticText46;
+ wxStaticText* m_staticTextFilesToCompare;
+
+ wxStaticText* m_staticText32;
+ wxStaticText* m_staticTextDataToCompare;
+ wxStaticText* m_staticText30;
+ wxTextCtrl* m_textCtrlFilename;
+ wxGauge* m_gauge2;
+
+ public:
+ CompareStatusGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL );
+ ~CompareStatusGenerated();
+
+};
+
+///////////////////////////////////////////////////////////////////////////////
/// Class SyncDialogGenerated
///////////////////////////////////////////////////////////////////////////////
class SyncDialogGenerated : public wxDialog
@@ -145,6 +171,9 @@ class SyncDialogGenerated : public wxDialog
wxBitmapButton* m_bpButton18;
+
+ wxStaticText* m_staticText37;
+ wxTextCtrl* m_textCtrl12;
wxStaticText* m_staticText14;
wxTextCtrl* m_textCtrl5;
@@ -164,6 +193,7 @@ class SyncDialogGenerated : public wxDialog
wxButton* m_button16;
wxCheckBox* m_checkBoxUseRecycler;
+ wxCheckBox* m_checkBoxHideErrors;
wxStaticText* m_staticText2;
@@ -204,7 +234,7 @@ class SyncDialogGenerated : public wxDialog
public:
- SyncDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 533,349 ), long style = wxDEFAULT_DIALOG_STYLE );
+ SyncDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 525,356 ), long style = wxDEFAULT_DIALOG_STYLE );
~SyncDialogGenerated();
};
@@ -243,7 +273,9 @@ class AboutDlgGenerated : public wxDialog
protected:
+ wxStaticBitmap* m_bitmap11;
wxStaticText* m_staticText14;
+
wxStaticText* m_staticText15;
wxStaticText* m_build;
@@ -312,7 +344,10 @@ class DeleteDialogGenerated : public wxDialog
protected:
+
+ wxStaticBitmap* m_bitmap12;
wxStaticText* m_staticTextHeader;
+
wxTextCtrl* m_textCtrlMessage;
wxButton* m_buttonOK;
wxButton* m_buttonCancel;
@@ -376,16 +411,16 @@ class SyncStatusGenerated : public wxDialog
protected:
+ wxAnimationCtrl* m_animationControl1;
wxStaticText* m_staticText20;
wxStaticText* m_staticText21;
- wxStaticText* m_staticText25;
- wxStaticText* m_staticTextProcessedObj;
wxStaticText* m_staticText26;
- wxStaticText* m_staticTextBytesCopied;
+ wxStaticText* m_staticTextDataRemaining;
- wxStaticText* m_staticText32;
+ wxStaticText* m_staticText25;
+ wxStaticText* m_staticTextRemainingObj;
// Virtual event handlers, overide them in your derived class
bgstack15