diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/MainDialog.cpp | 990 | ||||
-rw-r--r-- | ui/MainDialog.h | 99 | ||||
-rw-r--r-- | ui/Resources.cpp | 157 | ||||
-rw-r--r-- | ui/Resources.h | 78 | ||||
-rw-r--r-- | ui/SmallDialogs.cpp | 101 | ||||
-rw-r--r-- | ui/SmallDialogs.h | 50 | ||||
-rw-r--r-- | ui/SyncDialog.cpp | 466 | ||||
-rw-r--r-- | ui/SyncDialog.h | 82 | ||||
-rw-r--r-- | ui/guiGenerated.cpp | 1255 | ||||
-rw-r--r-- | ui/guiGenerated.h | 249 |
10 files changed, 2236 insertions, 1291 deletions
diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp index ec83f302..1c31fa2a 100644 --- a/ui/MainDialog.cpp +++ b/ui/MainDialog.cpp @@ -12,23 +12,24 @@ #include "../library/globalFunctions.h" #include <fstream> #include <wx/clipbrd.h> +#include <wx/file.h> #include "../library/customGrid.h" using namespace globalFunctions; int leadingPanel = 0; -MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : +MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale* language) : GuiGenerated(frame), - parent(frame), - stackObjects(0), + programLanguage(language), filteringInitialized(false), filteringPending(false), + synchronizationEnabled(false), + restartOnExit(false), cmpStatusUpdaterTmp(0) { m_bpButtonCompare->SetLabel(_("&Compare")); m_bpButtonSync->SetLabel(_("&Synchronize")); - m_bpButtonFilter->SetLabel(_("&Filter")); //initialize sync configuration readConfigurationFromHD(cfgFileName, true); @@ -46,10 +47,10 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : m_bpButton10->SetBitmapLabel(*GlobalResources::bitmapExit); m_bpButtonCompare->SetBitmapLabel(*GlobalResources::bitmapCompare); m_bpButtonSync->SetBitmapLabel(*GlobalResources::bitmapSync); - m_bpButtonSync->SetBitmapDisabled(*GlobalResources::bitmapSyncDisabled); m_bpButtonSwap->SetBitmapLabel(*GlobalResources::bitmapSwap); m_bpButton14->SetBitmapLabel(*GlobalResources::bitmapHelp); m_bpButton201->SetBitmapLabel(*GlobalResources::bitmapSave); + m_bitmap15->SetBitmap(*GlobalResources::bitmapStatusEdge); //prepare drag & drop m_panel1->SetDropTarget(new FileDropEvent(this, 1)); @@ -126,12 +127,12 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : m_grid3->setScrollFriends(m_grid1, m_grid2, m_grid3); //share UI grid data with grids - m_grid1->setGridDataTable(¤tUI_View); - m_grid2->setGridDataTable(¤tUI_View); - m_grid3->setGridDataTable(¤tUI_View); + m_grid1->setGridDataTable(&gridRefUI, ¤tGridData); + m_grid2->setGridDataTable(&gridRefUI, ¤tGridData); + m_grid3->setGridDataTable(&gridRefUI, ¤tGridData); //disable sync button as long as "compare" hasn't been triggered. - m_bpButtonSync->Disable(); + enableSynchronization(false); //make filesize right justified on grids wxGridCellAttr* cellAttributes = m_grid1->GetOrCreateCellAttr(0, 2); @@ -170,14 +171,30 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : m_grid1->SetSelectionBackground(darkBlue); m_grid2->SetSelectionBackground(darkBlue); m_grid3->SetSelectionBackground(darkBlue); + m_grid1->SetSelectionForeground(*wxWHITE); + m_grid2->SetSelectionForeground(*wxWHITE); + m_grid3->SetSelectionForeground(*wxWHITE); + + enableSynchronization(false); + + //initialize language selection + switch (programLanguage->getLanguage()) + { + case wxLANGUAGE_GERMAN: + m_menuItemGerman->Check(); + break; + + default: + m_menuItemEnglish->Check(); + } } MainDialog::~MainDialog() { - m_grid1->setGridDataTable(0); - m_grid2->setGridDataTable(0); - m_grid3->setGridDataTable(0); + m_grid1->setGridDataTable(0, 0); + m_grid2->setGridDataTable(0, 0); + m_grid3->setGridDataTable(0, 0); m_grid1->setSortMarker(-1); m_grid2->setSortMarker(-1); @@ -243,6 +260,13 @@ MainDialog::~MainDialog() delete cfgFileHistory; writeConfigurationToHD(FreeFileSync::FFS_LastConfigFile); //don't trow exceptions in destructors + + if (restartOnExit) + { //create new dialog + MainDialog* frame = new MainDialog(0L, FreeFileSync::FFS_LastConfigFile, programLanguage); + frame->SetIcon(*GlobalResources::programIcon); //set application icon + frame->Show(); + } } @@ -284,32 +308,46 @@ void MainDialog::onGrid3access(wxEvent& event) } +void MainDialog::enableSynchronization(bool value) +{ + if (value) + { + synchronizationEnabled = true; + m_bpButtonSync->SetBitmapLabel(*GlobalResources::bitmapSync); + } + else + { + synchronizationEnabled = false; + m_bpButtonSync->SetBitmapLabel(*GlobalResources::bitmapSyncDisabled); + } +} + + void MainDialog::filterRangeManual(const set<int>& rowsToFilterOnUI_View) { if (rowsToFilterOnUI_View.size() > 0) { - int currentUI_Size = currentUI_View.size(); + int gridSizeUI = gridRefUI.size(); bool newSelection = false; //default: deselect range //leadingRow determines de-/selection of all other rows int leadingRow = *rowsToFilterOnUI_View.begin(); - if (0 <= leadingRow && leadingRow < currentUI_Size) - newSelection = !currentGridData[currentUI_View[leadingRow].linkToCurrentGridData].selectedForSynchronization; + if (0 <= leadingRow && leadingRow < gridSizeUI) + newSelection = !currentGridData[gridRefUI[leadingRow]].selectedForSynchronization; - if (hideFiltered) + if (cfg.hideFiltered) assert (!newSelection); //if hidefiltered is active, there should be no filtered elements on screen => current element was filtered out //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 (set<int>::iterator i = rowsToFilterOnUI_View.begin(); i != rowsToFilterOnUI_View.end(); ++i) { - if (0 <= *i && *i < currentUI_Size) + if (0 <= *i && *i < gridSizeUI) { - unsigned int gridIndex = currentUI_View[*i].linkToCurrentGridData; + unsigned int gridIndex = gridRefUI[*i]; rowsToFilterOnGridData.insert(gridIndex); FreeFileSync::addSubElements(rowsToFilterOnGridData, currentGridData, currentGridData[gridIndex]); @@ -320,41 +358,42 @@ void MainDialog::filterRangeManual(const set<int>& rowsToFilterOnUI_View) for (set<int>::iterator i = rowsToFilterOnGridData.begin(); i != rowsToFilterOnGridData.end(); ++i) currentGridData[*i].selectedForSynchronization = newSelection; - - set<int> filteredOutRowsOnUI; //determine rows that are currently filtered out on current UI view - - //update currentUI_View - for (UI_Grid::iterator i = currentUI_View.begin(); i != currentUI_View.end(); ++i) - { - const FileCompareLine& gridLine = currentGridData[i->linkToCurrentGridData]; - - i->cmpResult = evaluateCmpResult(gridLine.cmpResult, gridLine.selectedForSynchronization); - - if (!gridLine.selectedForSynchronization) - filteredOutRowsOnUI.insert(i - currentUI_View.begin()); - } - //signal UI that grids need to be refreshed on next Update() m_grid1->ForceRefresh(); m_grid2->ForceRefresh(); m_grid3->ForceRefresh(); - if (hideFiltered) + if (cfg.hideFiltered) { - //some delay to show user the rows he has filtered out before they are removed Update(); //show changes resulting from ForceRefresh() - wxMilliSleep(400); + + wxLongLong waitBegin = wxGetLocalTimeMillis(); + + //determine rows that are currently filtered out on current UI view (and need to be removed) + set<int> filteredOutRowsOnUI; + for (GridView::iterator i = gridRefUI.begin(); i != gridRefUI.end(); ++i) + { + const FileCompareLine& gridLine = currentGridData[*i]; + + if (!gridLine.selectedForSynchronization) + filteredOutRowsOnUI.insert(i - gridRefUI.begin()); + } + + //some delay to show user the rows he has filtered out before they are removed + unsigned long waitRemaining = max(400 - (wxGetLocalTimeMillis() - waitBegin).GetLo(), unsigned(0)); + wxMilliSleep(waitRemaining); //400 ms delay before rows are removed from UI //delete rows, that are filtered out: - removeRowsFromVector(currentUI_View, filteredOutRowsOnUI); + removeRowsFromVector(gridRefUI, 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 - updateStatusInformation(currentUI_View); //status information has to be recalculated! + writeGrid(currentGridData, true); //use UI buffer, just a re-dimensioning of grids + updateStatusInformation(gridRefUI); //status information has to be recalculated! } } + //clear selection on grids - if (hideFiltered) + if (cfg.hideFiltered) { m_grid1->ClearSelection(); m_grid2->ClearSelection(); @@ -410,15 +449,16 @@ void MainDialog::OnIdleEvent(wxEvent& event) //------------------------------------------------------------------------------ //small routine to restore status information after some time - if (stackObjects > 0 ) //check if there is some work to do + if (stackObjects.size() > 0 ) //check if there is some work to do { wxLongLong currentTime = wxGetLocalTimeMillis(); - if (currentTime - lastStatusChange > 3000) //restore stackObject after three seconds + if (currentTime - lastStatusChange > 2000) //restore stackObject after two seconds { lastStatusChange = currentTime; - stackObjects--; - m_statusBar1->PopStatusText(1); + m_staticTextStatusMiddle->SetLabel(stackObjects.top()); + stackObjects.pop(); + m_panel7->Layout(); } } @@ -548,7 +588,7 @@ set<int> MainDialog::getSelectedRows() } } - removeInvalidRows(output, currentUI_View.size()); + removeInvalidRows(output, gridRefUI.size()); return output; } @@ -557,12 +597,12 @@ set<int> MainDialog::getSelectedRows() class DeleteStatusUpdater : public StatusUpdater { public: - DeleteStatusUpdater(bool& unsolvedErrorOccured) : suppressUI_Errormessages(false), unsolvedErrors(unsolvedErrorOccured) {} + DeleteStatusUpdater(bool& unsolvedErrorOccured) : continueOnError(false), unsolvedErrors(unsolvedErrorOccured) {} ~DeleteStatusUpdater() {} int reportError(const wxString& text) { - if (suppressUI_Errormessages) + if (continueOnError) { unsolvedErrors = true; return StatusUpdater::continueNext; @@ -570,7 +610,7 @@ public: wxString errorMessage = text + _("\n\nInformation: If you skip the error and continue or abort a re-compare will be necessary!"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, suppressUI_Errormessages); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueOnError); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -599,7 +639,7 @@ public: void triggerUI_Refresh() {} private: - bool suppressUI_Errormessages; + bool continueOnError; bool& unsolvedErrors; }; @@ -608,15 +648,15 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) { if (rowsToDeleteOnUI.size()) { - //map grid lines from UI to grid lines in backend + //map grid lines from UI to grid lines in backend (gridData) set<int> rowsToDeleteOnGrid; for (set<int>::iterator i = rowsToDeleteOnUI.begin(); i != rowsToDeleteOnUI.end(); ++i) - rowsToDeleteOnGrid.insert(currentUI_View[*i].linkToCurrentGridData); + rowsToDeleteOnGrid.insert(gridRefUI[*i]); wxString headerText; wxString filesToDelete; - if (useRecycleBin) + if (cfg.useRecycleBin) headerText = _("Do you really want to move the following objects(s) to the recycle bin?"); else headerText = _("Do you really want to delete the following objects(s)?"); @@ -634,7 +674,7 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) filesToDelete+= "\n"; } - DeleteDialog* confirmDeletion = new DeleteDialog(headerText, filesToDelete, this); //no destruction needed; attached to main window + DeleteDialog* confirmDeletion = new DeleteDialog(headerText, filesToDelete, this); //no destruction needed; attached to main window switch (confirmDeletion->ShowModal()) { @@ -646,7 +686,7 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) { //class errors when deleting files/folders DeleteStatusUpdater deleteStatusUpdater(unsolvedErrorOccured); - FreeFileSync::deleteOnGridAndHD(currentGridData, rowsToDeleteOnGrid, &deleteStatusUpdater, useRecycleBin); + FreeFileSync::deleteOnGridAndHD(currentGridData, rowsToDeleteOnGrid, &deleteStatusUpdater, cfg.useRecycleBin); } catch (AbortThisProcess& theException) {} @@ -654,11 +694,11 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) //disable the sync button if errors occured during deletion if (unsolvedErrorOccured) - m_bpButtonSync->Disable(); + enableSynchronization(false); //redraw grid neccessary to update new dimensions and for UI-Backend data linkage - writeGrid(currentGridData); //do NOT use UI buffer here + writeGrid(currentGridData); //do NOT use UI buffer here m_grid1->ClearSelection(); //clear selection on grid m_grid2->ClearSelection(); //clear selection on grid @@ -682,9 +722,9 @@ void MainDialog::openWithFileBrowser(int rowNumber, int gridNr) { wxString command = "explorer " + FreeFileSync::getFormattedDirectoryName(m_directoryPanel1->GetValue()); //default - if (0 <= rowNumber && rowNumber < int(currentUI_View.size())) + if (0 <= rowNumber && rowNumber < int(gridRefUI.size())) { - wxString filename = currentGridData[currentUI_View[rowNumber].linkToCurrentGridData].fileDescrLeft.filename; + wxString filename = currentGridData[gridRefUI[rowNumber]].fileDescrLeft.filename; if (!filename.IsEmpty()) command = "explorer /select," + filename; @@ -695,9 +735,9 @@ void MainDialog::openWithFileBrowser(int rowNumber, int gridNr) { wxString command = "explorer " + FreeFileSync::getFormattedDirectoryName(m_directoryPanel2->GetValue()); //default - if (0 <= rowNumber && rowNumber < int(currentUI_View.size())) + if (0 <= rowNumber && rowNumber < int(gridRefUI.size())) { - wxString filename = currentGridData[currentUI_View[rowNumber].linkToCurrentGridData].fileDescrRight.filename; + wxString filename = currentGridData[gridRefUI[rowNumber]].fileDescrRight.filename; if (!filename.IsEmpty()) command = "explorer /select," + filename; @@ -711,15 +751,22 @@ void MainDialog::openWithFileBrowser(int rowNumber, int gridNr) void MainDialog::pushStatusInformation(const wxString& text) { lastStatusChange = wxGetLocalTimeMillis(); - ++stackObjects; - m_statusBar1->PushStatusText(text, 1); + + stackObjects.push(m_staticTextStatusMiddle->GetLabel()); + m_staticTextStatusMiddle->SetLabel(text); + + m_panel7->Layout(); } -void MainDialog::writeStatusInformation(const wxString& text) +void MainDialog::clearStatusBar() { - stackObjects = 0; - m_statusBar1->SetStatusText(text, 1); + while (stackObjects.size() > 0) + stackObjects.pop(); + + m_staticTextStatusLeft->SetLabel(wxEmptyString); + m_staticTextStatusMiddle->SetLabel(wxEmptyString); + m_staticTextStatusRight->SetLabel(wxEmptyString); } @@ -884,7 +931,7 @@ void MainDialog::OnDirChangedPanel1(wxFileDirPickerEvent& event) m_directoryPanel1->SetValue(newPath); //disable the sync button - m_bpButtonSync->Enable(false); + enableSynchronization(false); //clear grids currentGridData.clear(); @@ -901,7 +948,8 @@ void MainDialog::OnDirChangedPanel2(wxFileDirPickerEvent& event) m_directoryPanel2->SetValue(newPath); //disable the sync button - m_bpButtonSync->Enable(false); + enableSynchronization(false); + //clear grids currentGridData.clear(); writeGrid(currentGridData); @@ -910,20 +958,10 @@ void MainDialog::OnDirChangedPanel2(wxFileDirPickerEvent& event) } -void MainDialog::clearStatusBar() -{ - stackObjects = 0; //prevent old stack objects from popping up - - m_statusBar1->SetStatusText(""); - m_statusBar1->SetStatusText("", 1); - m_statusBar1->SetStatusText("", 2); -} - - wxString getFormattedHistoryElement(const wxString& filename) { wxString output = wxFileName(filename).GetFullName(); - if (output.EndsWith(".FFS")) + if (output.EndsWith(".ffs")) output = output.BeforeLast('.'); return output; } @@ -1012,14 +1050,12 @@ bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen else { //disable the sync button - mainDlg->m_bpButtonSync->Disable(); + mainDlg->enableSynchronization(false); //clear grids mainDlg->currentGridData.clear(); mainDlg->writeGrid(mainDlg->currentGridData); - mainDlg->clearStatusBar(); - const wxString droppedFileName = filenames[0]; //test if ffs config file has been dropped @@ -1042,7 +1078,7 @@ bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen void MainDialog::OnSaveConfig(wxCommandEvent& event) { - wxString defaultFileName = "SyncSettings.FFS"; + wxString defaultFileName = "SyncSettings.ffs"; //try to use last selected configuration file as default int selectedItem; @@ -1052,13 +1088,11 @@ void MainDialog::OnSaveConfig(wxCommandEvent& event) defaultFileName = cfgFileNames[selectedItem - 1]; - clearStatusBar(); - - wxFileDialog* filePicker = new wxFileDialog(this, "", "", defaultFileName, wxString(_("FreeFileSync configuration")) + " (*.FFS)|*.FFS", wxFD_SAVE); + wxFileDialog* filePicker = new wxFileDialog(this, "", "", defaultFileName, wxString(_("FreeFileSync configuration")) + " (*.ffs)|*.ffs", wxFD_SAVE); if (filePicker->ShowModal() == wxID_OK) { - wxString newFileName = filePicker->GetFilename(); + wxString newFileName = filePicker->GetPath(); if (wxFileExists(newFileName)) { @@ -1082,14 +1116,17 @@ void MainDialog::OnLoadConfiguration(wxCommandEvent& event) int selectedItem; if ((selectedItem = m_choiceLoad->GetSelection()) != wxNOT_FOUND) { - wxString newCfgFile; + //clear grids + currentGridData.clear(); + writeGrid(currentGridData); - clearStatusBar(); + wxString newCfgFile; + wxFileDialog* filePicker = NULL; switch (selectedItem) { case 0: //load config from file - wxFileDialog* filePicker = new wxFileDialog(this, "", "", "", wxString(_("FreeFileSync configuration")) + " (*.FFS)|*.FFS", wxFD_OPEN); + filePicker = new wxFileDialog(this, "", "", "", wxString(_("FreeFileSync configuration")) + " (*.ffs)|*.ffs", wxFD_OPEN); if (filePicker->ShowModal() == wxID_OK) newCfgFile = filePicker->GetFilename(); @@ -1140,13 +1177,17 @@ void MainDialog::OnChoiceKeyEvent(wxKeyEvent& event) } -void MainDialog::OnChangeCompareVariant(wxCommandEvent& event) +void MainDialog::OnCompareByTimeSize(wxCommandEvent& event) { - //disable the sync button - m_bpButtonSync->Enable(false); - //clear grids - currentGridData.clear(); - writeGrid(currentGridData); + cfg.compareVar = compareByTimeAndSize; + updateCompareButtons(); +} + + +void MainDialog::OnCompareByContent(wxCommandEvent& event) +{ + cfg.compareVar = compareByContent; + updateCompareButtons(); } @@ -1165,27 +1206,28 @@ void MainDialog::OnQuit(wxCommandEvent &event) void MainDialog::loadDefaultConfiguration() { //default values - syncConfiguration.exLeftSideOnly = syncDirRight; - syncConfiguration.exRightSideOnly = syncDirRight; - syncConfiguration.leftNewer = syncDirRight; - syncConfiguration.rightNewer = syncDirRight; - syncConfiguration.different = syncDirRight; + cfg.syncConfiguration.exLeftSideOnly = syncDirRight; + cfg.syncConfiguration.exRightSideOnly = syncDirRight; + cfg.syncConfiguration.leftNewer = syncDirRight; + cfg.syncConfiguration.rightNewer = syncDirRight; + cfg.syncConfiguration.different = syncDirRight; - m_radioBtnSizeDate->SetValue(true); //compare algorithm + cfg.compareVar = compareByTimeAndSize; //compare algorithm + updateCompareButtons(); - includeFilter = "*"; //include all files/folders - excludeFilter = ""; //exlude nothing + cfg.includeFilter = "*"; //include all files/folders + cfg.excludeFilter = ""; //exlude nothing //set status of filter button - filterIsActive = false; //do not filter by default - updateFilterButton(); + cfg.filterIsActive = false; //do not filter by default + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); //set status of "hide filtered items" checkbox - hideFiltered = false; //show filtered items - m_checkBoxHideFilt->SetValue(hideFiltered); + cfg.hideFiltered = false; //show filtered items + m_checkBoxHideFilt->SetValue(cfg.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; + cfg.useRecycleBin = false; //do not use: in case OS doesn't support this, user will have to activate first and then get the error message + cfg.continueOnError = false; widthNotMaximized = wxDefaultCoord; heightNotMaximized = wxDefaultCoord; @@ -1225,24 +1267,15 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS //read sync configuration - syncConfiguration.exLeftSideOnly = SyncDirection(config.get()); - syncConfiguration.exRightSideOnly = SyncDirection(config.get()); - syncConfiguration.leftNewer = SyncDirection(config.get()); - syncConfiguration.rightNewer = SyncDirection(config.get()); - syncConfiguration.different = SyncDirection(config.get()); + 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 compare algorithm - switch (int(config.get())) - { - case compareByTimeAndSize: - m_radioBtnSizeDate->SetValue(true); - break; - case compareByContent: - m_radioBtnContent->SetValue(true); - break; - default: - assert (false); - } + cfg.compareVar = CompareVariant(config.get()); + updateCompareButtons(); //read column sizes for (int i = 0; i < m_grid1->GetNumberCols(); ++i) @@ -1294,23 +1327,23 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS m_dirPicker2->SetPath(bigBuffer); //read filter settings: - hideFiltered = bool(config.get()); - m_checkBoxHideFilt->SetValue(hideFiltered); + cfg.hideFiltered = bool(config.get()); + m_checkBoxHideFilt->SetValue(cfg.hideFiltered); - filterIsActive = bool(config.get()); - updateFilterButton(); + cfg.filterIsActive = bool(config.get()); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); //include config.getline(bigBuffer, 10000, char(0)); - includeFilter = bigBuffer; + cfg.includeFilter = bigBuffer; //exclude config.getline(bigBuffer, 10000, char(0)); - excludeFilter = bigBuffer; + cfg.excludeFilter = bigBuffer; - useRecycleBin = bool(config.get()); + cfg.useRecycleBin = bool(config.get()); - hideErrorMessages = bool(config.get()); + cfg.continueOnError = bool(config.get()); config.close(); } @@ -1332,19 +1365,14 @@ void MainDialog::writeConfigurationToHD(const wxString& filename) config<<FreeFileSync::FFS_ConfigFileID.c_str(); //write sync configuration - config<<char(syncConfiguration.exLeftSideOnly) - <<char(syncConfiguration.exRightSideOnly) - <<char(syncConfiguration.leftNewer) - <<char(syncConfiguration.rightNewer) - <<char(syncConfiguration.different); - - //write find method - if (m_radioBtnSizeDate->GetValue()) - config<<char(compareByTimeAndSize); - else if (m_radioBtnContent->GetValue()) - config<<char(compareByContent); - else assert (false); + config<<char(cfg.syncConfiguration.exLeftSideOnly) + <<char(cfg.syncConfiguration.exRightSideOnly) + <<char(cfg.syncConfiguration.leftNewer) + <<char(cfg.syncConfiguration.rightNewer) + <<char(cfg.syncConfiguration.different); + //write compare algorithm + config<<char(cfg.compareVar); //write column sizes for (int i = 0; i < m_grid1->GetNumberCols(); ++i) @@ -1368,15 +1396,15 @@ void MainDialog::writeConfigurationToHD(const wxString& filename) <<m_directoryPanel2->GetValue().c_str()<<char(0); //write filter settings - config<<char(hideFiltered); - config<<char(filterIsActive); + config<<char(cfg.hideFiltered); + config<<char(cfg.filterIsActive); - config<<includeFilter.c_str()<<char(0) - <<excludeFilter.c_str()<<char(0); + config<<cfg.includeFilter.c_str()<<char(0) + <<cfg.excludeFilter.c_str()<<char(0); - config<<char(useRecycleBin); + config<<char(cfg.useRecycleBin); - config<<char(hideErrorMessages); + config<<char(cfg.continueOnError); config.close(); } @@ -1386,6 +1414,7 @@ void MainDialog::OnAbout(wxCommandEvent &event) { AboutDlg* aboutDlg = new AboutDlg(this); aboutDlg->ShowModal(); + event.Skip(); } @@ -1393,51 +1422,61 @@ void MainDialog::OnShowHelpDialog(wxCommandEvent &event) { HelpDlg* helpDlg = new HelpDlg(this); helpDlg->ShowModal(); + event.Skip(); } void MainDialog::OnFilterButton(wxCommandEvent &event) { //toggle filter on/off - filterIsActive = !filterIsActive; - + cfg.filterIsActive = !cfg.filterIsActive; //make sure, button-appearance and "filterIsActive" are in sync. - updateFilterButton(); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); - if (filterIsActive) - FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter); + if (cfg.filterIsActive) + FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); else FreeFileSync::removeFilterOnCurrentGridData(currentGridData); writeGrid(currentGridData); + event.Skip(); } void MainDialog::OnHideFilteredButton(wxCommandEvent &event) { //toggle showing filtered rows - hideFiltered = !hideFiltered; + cfg.hideFiltered = !cfg.hideFiltered; writeGrid(currentGridData); //make sure, checkbox and "hideFiltered" are in sync - m_checkBoxHideFilt->SetValue(hideFiltered); + m_checkBoxHideFilt->SetValue(cfg.hideFiltered); + event.Skip(); } void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) { - wxString beforeImage = includeFilter + wxChar(0) + excludeFilter; + wxString beforeImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; - FilterDlg* filterDlg = new FilterDlg(this, includeFilter, excludeFilter); + FilterDlg* filterDlg = new FilterDlg(this, cfg.includeFilter, cfg.excludeFilter); if (filterDlg->ShowModal() == FilterDlg::okayButtonPressed) { - wxString afterImage = includeFilter + wxChar(0) + excludeFilter; + wxString afterImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; if (beforeImage != afterImage) //if filter settings are changed: set filtering to "on" { - filterIsActive = true; - updateFilterButton(); + if (afterImage == (wxString("*") + wxChar(1))) //default + { + cfg.filterIsActive = false; + FreeFileSync::removeFilterOnCurrentGridData(currentGridData); + } + else + { + cfg.filterIsActive = true; + FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); + } - FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); writeGrid(currentGridData); } @@ -1445,11 +1484,13 @@ void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) //no event.Skip() here, to not start browser } + void MainDialog::OnLeftOnlyFiles(wxCommandEvent& event) { leftOnlyFilesActive = !leftOnlyFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) @@ -1457,6 +1498,7 @@ void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) leftNewerFilesActive = !leftNewerFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnDifferentFiles(wxCommandEvent& event) @@ -1464,6 +1506,7 @@ void MainDialog::OnDifferentFiles(wxCommandEvent& event) differentFilesActive = !differentFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnRightNewerFiles(wxCommandEvent& event) @@ -1471,6 +1514,7 @@ void MainDialog::OnRightNewerFiles(wxCommandEvent& event) rightNewerFilesActive = !rightNewerFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) @@ -1478,6 +1522,7 @@ void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) rightOnlyFilesActive = !rightOnlyFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnEqualFiles(wxCommandEvent& event) @@ -1485,6 +1530,7 @@ void MainDialog::OnEqualFiles(wxCommandEvent& event) equalFilesActive = !equalFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::updateViewFilterButtons() @@ -1521,21 +1567,52 @@ void MainDialog::updateViewFilterButtons() } -void MainDialog::updateFilterButton() +void MainDialog::updateFilterButton(wxBitmapButton* filterButton, bool isActive) { - if (filterIsActive) + if (isActive) { - m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOn); - m_bpButtonFilter->SetToolTip(_("Filter active: Press again to deactivate")); + filterButton->SetBitmapLabel(*GlobalResources::bitmapFilterOn); + filterButton->SetToolTip(_("Filter active: Press again to deactivate")); } else { - m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOff); - m_bpButtonFilter->SetToolTip(_("Press button to activate filter")); + filterButton->SetBitmapLabel(*GlobalResources::bitmapFilterOff); + filterButton->SetToolTip(_("Press button to activate filter")); } } +void MainDialog::updateCompareButtons() +{ + switch (cfg.compareVar) + { + case compareByTimeAndSize: + m_radioBtnSizeDate->SetValue(true); + + m_bpButton21->Show(); //show or hide filter buttons depending on selected compare variant + m_bpButton23->Show(); + bSizer59->Layout(); + break; + case compareByContent: + m_radioBtnContent->SetValue(true); + + m_bpButton21->Hide(); + m_bpButton23->Hide(); + bSizer59->Layout(); + break; + default: + assert (false); + } + + //disable the sync button + enableSynchronization(false); + + //clear grids + currentGridData.clear(); + writeGrid(currentGridData); +} + + void MainDialog::OnCompare(wxCommandEvent &event) { if (m_directoryPanel1->GetValue().IsEmpty() || m_directoryPanel2->GetValue().IsEmpty()) @@ -1560,47 +1637,49 @@ void MainDialog::OnCompare(wxCommandEvent &event) wxBeginBusyCursor(); - CompareVariant cmpVar = compareByTimeAndSize; //assign a value to suppress compiler warning - if (m_radioBtnSizeDate->GetValue()) - cmpVar = compareByTimeAndSize; - else if (m_radioBtnContent->GetValue()) - cmpVar = compareByContent; - else assert (false); - + bool aborted = false; try { //class handling status display and error messages CompareStatusUpdater statusUpdater(this); cmpStatusUpdaterTmp = &statusUpdater; - stackObjects = 0; //unsigned int startTime3 = GetTickCount(); FreeFileSync::startCompareProcess(currentGridData, FreeFileSync::getFormattedDirectoryName(m_directoryPanel1->GetValue()), FreeFileSync::getFormattedDirectoryName(m_directoryPanel2->GetValue()), - cmpVar, + cfg.compareVar, &statusUpdater); //wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime3)); //filter currentGridData if option is set - if (filterIsActive) - FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter); + if (cfg.filterIsActive) + FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); - //once compare is finished enable the sync button - m_bpButtonSync->Enable(); - m_bpButtonSync->SetFocus(); - - writeGrid(currentGridData); //keep it in try/catch to not overwrite status information if compare is abortet + writeGrid(currentGridData); //keep it in try/catch to not overwrite status information if compare is aborted cmpStatusUpdaterTmp = 0; } catch (AbortThisProcess& theException) { - //disable the sync button - m_bpButtonSync->Disable(); + aborted = true; + } + + if (aborted) + { //disable the sync button + enableSynchronization(false); + + m_bpButtonCompare->SetFocus(); + } + else + { //once compare is finished enable the sync button + enableSynchronization(true); + + m_bpButtonSync->SetFocus(); } wxEndBusyCursor(); + event.Skip(); } @@ -1608,55 +1687,26 @@ void MainDialog::OnAbortCompare(wxCommandEvent& event) { if (cmpStatusUpdaterTmp) cmpStatusUpdaterTmp->requestAbortion(); -} - - -inline -wxString MainDialog::evaluateCmpResult(const CompareFilesResult result, const bool selectedForSynchronization) -{ - if (selectedForSynchronization) - switch (result) - { - case fileOnLeftSideOnly: - return "<|"; - break; - case fileOnRightSideOnly: - return "|>"; - break; - case rightFileNewer: - return ">>"; - break; - case leftFileNewer: - return "<<"; - break; - case filesDifferent: - return "!="; - break; - case filesEqual: - return "=="; - break; - default: - assert (false); - } - else return constFilteredOut; + event.Skip(); } void MainDialog::writeGrid(const FileCompareResult& gridData, bool useUI_GridCache) { + m_grid1->BeginBatch(); + m_grid2->BeginBatch(); + m_grid3->BeginBatch(); + if (!useUI_GridCache) { //unsigned int startTime = GetTickCount(); - mapFileModelToUI(currentUI_View, gridData); //update currentUI_View + mapGridDataToUI(gridRefUI, gridData); //update gridRefUI //wxMessageBox(wxString("Benchmark: ") + numberToWxString(unsigned(GetTickCount()) - startTime) + " ms"); - updateStatusInformation(currentUI_View); //write status information for currentUI_View - } - m_grid1->BeginBatch(); - m_grid2->BeginBatch(); - m_grid3->BeginBatch(); + updateStatusInformation(gridRefUI); //write status information for gridRefUI + } - //all three grids retrieve their data directly from currentUI_View via a pointer!!! + //all three grids retrieve their data directly from currentGridData!!! //the only thing left to do is notify the grids to update their sizes (nr of rows), since this has to be communicated via messages by the grids m_grid1->updateGridSizes(); m_grid2->updateGridSizes(); @@ -1682,26 +1732,26 @@ void MainDialog::writeGrid(const FileCompareResult& gridData, bool useUI_GridCac } -void MainDialog::OnSync( wxCommandEvent& event ) +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) + SyncDialog* syncDlg = new SyncDialog(this, currentGridData, cfg, synchronizationEnabled); + if (syncDlg->ShowModal() == SyncDialog::StartSynchronizationProcess) + { + //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) + { + nothingToSync = false; + break; + } + + if (nothingToSync) { - nothingToSync = false; - break; + wxMessageBox(_("Nothing to synchronize. Both directories seem to contain the same data!"), _("Information"), wxICON_WARNING); + return; } - if (nothingToSync) - { - wxMessageBox(_("Nothing to synchronize. Both directories seem to contain the same data!"), _("Information"), wxICON_WARNING); - return; - } - - SyncDialog* syncDlg = new SyncDialog(this); - if (syncDlg->ShowModal() == SyncDialog::StartSynchronizationProcess) - { wxBeginBusyCursor(); clearStatusBar(); @@ -1709,17 +1759,17 @@ void MainDialog::OnSync( wxCommandEvent& event ) try { //class handling status updates and error messages - SyncStatusUpdater statusUpdater(this, hideErrorMessages); + SyncStatusUpdater statusUpdater(this, cfg.continueOnError); //start synchronization and return elements that were not sync'ed in currentGridData //unsigned int startTime3 = GetTickCount(); - FreeFileSync::startSynchronizationProcess(currentGridData, syncConfiguration, &statusUpdater, useRecycleBin); + FreeFileSync::startSynchronizationProcess(currentGridData, cfg.syncConfiguration, &statusUpdater, cfg.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(); + } //enableSynchronization(false); //display files that were not processed @@ -1730,12 +1780,13 @@ void MainDialog::OnSync( wxCommandEvent& event ) else { pushStatusInformation(_("All items have been synchronized!")); - m_bpButtonSync->Disable(); + enableSynchronization(false); } wxEndBusyCursor(); } + event.Skip(); } @@ -1762,7 +1813,7 @@ inline bool cmpString(const wxString& a, const wxString& b) { if (a.IsEmpty()) - return false; // if a and b are empty: false, if a empty, b not empty: also false, since empty rows should be put below on grid + return false; // if a and b are empty: false, if a empty, b not empty: also false, since empty rows should appear at the end else if (b.IsEmpty()) return true; // empty rows after filled rows: return true @@ -1772,6 +1823,7 @@ bool cmpString(const wxString& a, const wxString& b) else return (a > b); } + inline bool cmpLargeInt(const wxULongLong& a, const wxULongLong& b) { @@ -1782,78 +1834,125 @@ bool cmpLargeInt(const wxULongLong& a, const wxULongLong& b) } -bool sortGridLeft(const UI_GridLine& a, const UI_GridLine& b) +bool sortGridLeft(const GridViewLine a, const GridViewLine b) { + const FileDescrLine& gridDataLineA = (*currentGridDataPtr)[a].fileDescrLeft; + const FileDescrLine& gridDataLineB = (*currentGridDataPtr)[b].fileDescrLeft; + + wxString stringA; + wxString stringB; + switch (currentSortColumn) { case 0: - return cmpString(a.leftFilename, b.leftFilename); - break; + //presort types: first files, then directories then empty rows + if (gridDataLineA.objType == isNothing) + return false; //empty rows always last + else if (gridDataLineB.objType == isNothing) + return true; //empty rows always last + else if (gridDataLineA.objType == isDirectory) + return false; + else if (gridDataLineB.objType == isDirectory) + return true; + else + return cmpString(gridDataLineA.relFilename.AfterLast(GlobalResources::fileNameSeparator), + gridDataLineB.relFilename.AfterLast(GlobalResources::fileNameSeparator)); case 1: - return cmpString(a.leftRelativePath, b.leftRelativePath); - break; - case 2: - ObjectType typeA = (*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrLeft.objType; - ObjectType typeB = (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrLeft.objType; + if (gridDataLineA.objType == isDirectory) + stringA = gridDataLineA.relFilename; + else + stringA = gridDataLineA.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + + if (gridDataLineB.objType == isDirectory) + stringB = gridDataLineB.relFilename; + else + stringB = gridDataLineB.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + + return cmpString(stringA, stringB); + case 2: //presort types: first files, then directories then empty rows - if (typeA == isNothing) + if (gridDataLineA.objType == isNothing) return false; //empty rows always last - else if (typeB == isNothing) + else if (gridDataLineB.objType == isNothing) return true; //empty rows always last - else if (typeA == isDirectory) + else if (gridDataLineA.objType == isDirectory) return false; - else if (typeB == isDirectory) + else if (gridDataLineB.objType == isDirectory) return true; else //use unformatted filesizes and sort by size - return cmpLargeInt((*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrLeft.fileSize, (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrLeft.fileSize); + return cmpLargeInt(gridDataLineA.fileSize, gridDataLineB.fileSize); - break; case 3: - return cmpString(a.leftDate, b.leftDate); - break; + return cmpString(gridDataLineA.lastWriteTime, gridDataLineB.lastWriteTime); + default: assert(false); + return true; //dummy command } - return true; //dummy command } -bool sortGridRight(const UI_GridLine& a, const UI_GridLine& b) + +bool sortGridRight(const GridViewLine a, const GridViewLine b) { + const FileDescrLine& gridDataLineA = (*currentGridDataPtr)[a].fileDescrRight; + const FileDescrLine& gridDataLineB = (*currentGridDataPtr)[b].fileDescrRight; + + wxString stringA; + wxString stringB; + switch (currentSortColumn) { case 0: - return cmpString(a.rightFilename, b.rightFilename); - break; + //presort types: first files, then directories then empty rows + if (gridDataLineA.objType == isNothing) + return false; //empty rows always last + else if (gridDataLineB.objType == isNothing) + return true; //empty rows always last + else if (gridDataLineA.objType == isDirectory) + return false; + else if (gridDataLineB.objType == isDirectory) + return true; + else + return cmpString(gridDataLineA.relFilename.AfterLast(GlobalResources::fileNameSeparator), + gridDataLineB.relFilename.AfterLast(GlobalResources::fileNameSeparator)); + case 1: - return cmpString(a.rightRelativePath, b.rightRelativePath); - break; - case 2: - ObjectType typeA = (*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrRight.objType; - ObjectType typeB = (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrRight.objType; + if (gridDataLineA.objType == isDirectory) + stringA = gridDataLineA.relFilename; + else + stringA = gridDataLineA.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + + if (gridDataLineB.objType == isDirectory) + stringB = gridDataLineB.relFilename; + else + stringB = gridDataLineB.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + return cmpString(stringA, stringB); + + case 2: //presort types: first files, then directories then empty rows - if (typeA == isNothing) + if (gridDataLineA.objType == isNothing) return false; //empty rows always last - else if (typeB == isNothing) + else if (gridDataLineB.objType == isNothing) return true; //empty rows always last - else if (typeA == isDirectory) + else if (gridDataLineA.objType == isDirectory) return false; - else if (typeB == isDirectory) + else if (gridDataLineB.objType == isDirectory) return true; else //use unformatted filesizes and sort by size - return cmpLargeInt((*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrRight.fileSize, (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrRight.fileSize); + return cmpLargeInt(gridDataLineA.fileSize, gridDataLineB.fileSize); - break; case 3: - return cmpString(a.rightDate, b.rightDate); - break; + return cmpString(gridDataLineA.lastWriteTime, gridDataLineB.lastWriteTime); + default: assert(false); + return true; //dummy command } - return true; //dummy command } + void MainDialog::OnSortLeftGrid(wxGridEvent& event) { static bool columnSortAscending[4] = {true, true, false, true}; @@ -1864,8 +1963,12 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) { sortAscending = columnSortAscending[currentSortColumn]; columnSortAscending[currentSortColumn] = !columnSortAscending[currentSortColumn]; - sort(currentUI_View.begin(), currentUI_View.end(), sortGridLeft); - writeGrid(currentGridData, true); //use UI buffer, no mapping from currentGridData to UI model again + sort(gridRefUI.begin(), gridRefUI.end(), sortGridLeft); + + m_grid1->ForceRefresh(); + m_grid2->ForceRefresh(); + m_grid3->ForceRefresh(); + //set sort direction indicator on UI if (sortAscending) m_grid1->setSortMarker(currentSortColumn, GlobalResources::bitmapSmallUp); @@ -1876,6 +1979,7 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) event.Skip(); } + void MainDialog::OnSortRightGrid(wxGridEvent& event) { static bool columnSortAscending[4] = {true, true, false, true}; @@ -1886,8 +1990,12 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) { sortAscending = columnSortAscending[currentSortColumn]; columnSortAscending[currentSortColumn] = !columnSortAscending[currentSortColumn]; - sort(currentUI_View.begin(), currentUI_View.end(), sortGridRight); - writeGrid(currentGridData, true); + sort(gridRefUI.begin(), gridRefUI.end(), sortGridRight); + + m_grid1->ForceRefresh(); + m_grid2->ForceRefresh(); + m_grid3->ForceRefresh(); + //set sort direction indicator on UI m_grid1->setSortMarker(-1); if (sortAscending) @@ -1909,62 +2017,27 @@ void MainDialog::OnSwapDirs( wxCommandEvent& event ) //swap grid information FreeFileSync::swapGrids(currentGridData); writeGrid(currentGridData); + event.Skip(); } -//this sorting method is currently NOT used -bool cmpGridSmallerThan(const UI_GridLine& a, const UI_GridLine& b) -{ - wxString cmpStringA; - wxString cmpStringB; - - for (int i = 0; i < 4; ++i) - { - switch (i) - { - case 0: - cmpStringA = a.leftRelativePath; - cmpStringB = b.leftRelativePath; - break; - case 1: - cmpStringA = a.leftFilename; - cmpStringB = b.leftFilename; - break; - case 2: - cmpStringA = a.rightRelativePath; - cmpStringB = b.rightRelativePath; - break; - case 3: - cmpStringA = a.rightFilename; - cmpStringB = b.rightFilename; - break; - default: - assert (false); - } - if (cmpStringA.IsEmpty()) - cmpStringA = '\255'; - if (cmpStringB.IsEmpty()) - cmpStringB = '\255'; - - if (cmpStringA != cmpStringB) - return (cmpStringA < cmpStringB); - } - return (false); -} - - -void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid) +void MainDialog::updateStatusInformation(const GridView& visibleGrid) { - clearStatusBar(); + while (stackObjects.size() > 0) + stackObjects.pop(); unsigned int objectsOnLeftView = 0; unsigned int objectsOnRightView = 0; wxULongLong filesizeLeftView; wxULongLong filesizeRightView; - for (UI_Grid::const_iterator i = visibleGrid.begin(); i != visibleGrid.end(); ++i) + wxString statusLeftNew; + wxString statusMiddleNew; + wxString statusRightNew; + + for (GridView::const_iterator i = visibleGrid.begin(); i != visibleGrid.end(); ++i) { - const FileCompareLine& refLine = currentGridData[i->linkToCurrentGridData]; + const FileCompareLine& refLine = currentGridData[*i]; //calculate total number of bytes for each sied if (refLine.fileDescrLeft.objType != isNothing) @@ -1984,36 +2057,44 @@ void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid) wxString objectsViewLeft = numberToWxString(objectsOnLeftView); globalFunctions::includeNumberSeparator(objectsViewLeft); if (objectsOnLeftView == 1) - m_statusBar1->SetStatusText(wxString(_("1 item on left, ")) + FreeFileSync::formatFilesizeToShortString(filesizeLeftView), 0); + statusLeftNew = wxString(_("1 item on left, ")) + FreeFileSync::formatFilesizeToShortString(filesizeLeftView); else - m_statusBar1->SetStatusText(objectsViewLeft + _(" items on left, ") + FreeFileSync::formatFilesizeToShortString(filesizeLeftView), 0); + statusLeftNew = objectsViewLeft + _(" items on left, ") + FreeFileSync::formatFilesizeToShortString(filesizeLeftView); wxString objectsTotal = numberToWxString(currentGridData.size()); globalFunctions::includeNumberSeparator(objectsTotal); wxString objectsView = numberToWxString(visibleGrid.size()); globalFunctions::includeNumberSeparator(objectsView); if (currentGridData.size() == 1) - m_statusBar1->SetStatusText(objectsView + _(" of ") + objectsTotal + _(" row in view"), 1); + statusMiddleNew = objectsView + _(" of ") + objectsTotal + _(" row in view"); else - m_statusBar1->SetStatusText(objectsView + _(" of ") + objectsTotal + _(" rows in view"), 1); + statusMiddleNew = objectsView + _(" of ") + objectsTotal + _(" rows in view"); wxString objectsViewRight = numberToWxString(objectsOnRightView); globalFunctions::includeNumberSeparator(objectsViewRight); if (objectsOnRightView == 1) - m_statusBar1->SetStatusText(wxString(_("1 item on right, ")) + FreeFileSync::formatFilesizeToShortString(filesizeRightView), 2); + statusRightNew = wxString(_("1 item on right, ")) + FreeFileSync::formatFilesizeToShortString(filesizeRightView); else - m_statusBar1->SetStatusText(objectsViewRight + _(" items on right, ") + FreeFileSync::formatFilesizeToShortString(filesizeRightView), 2); + statusRightNew = objectsViewRight + _(" items on right, ") + FreeFileSync::formatFilesizeToShortString(filesizeRightView); + + //avoid screen flicker + if (m_staticTextStatusLeft->GetLabel() != statusLeftNew) + m_staticTextStatusLeft->SetLabel(statusLeftNew); + if (m_staticTextStatusMiddle->GetLabel() != statusMiddleNew) + m_staticTextStatusMiddle->SetLabel(statusMiddleNew); + if (m_staticTextStatusRight->GetLabel() != statusRightNew) + m_staticTextStatusRight->SetLabel(statusRightNew); + + m_panel7->Layout(); } -void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& fileCmpResult) +void MainDialog::mapGridDataToUI(GridView& output, const FileCompareResult& fileCmpResult) { output.clear(); - UI_GridLine gridline; unsigned int currentRow = 0; - wxString fileSize; //tmp string for (FileCompareResult::const_iterator i = fileCmpResult.begin(); i != fileCmpResult.end(); ++i, ++currentRow) { //process UI filter settings @@ -2042,85 +2123,20 @@ void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& file } //hide filtered row, if corresponding option is set - if (hideFiltered && !i->selectedForSynchronization) + if (cfg.hideFiltered && !i->selectedForSynchronization) continue; - if (i->fileDescrLeft.objType == isDirectory) - { - gridline.leftFilename = wxEmptyString; - gridline.leftRelativePath = i->fileDescrLeft.relFilename; - gridline.leftSize = _("<Directory>"); - } - else - { - 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.cmpResult = evaluateCmpResult(i->cmpResult, i->selectedForSynchronization); - gridline.linkToCurrentGridData = currentRow; - - if (i->fileDescrRight.objType == isDirectory) - { - gridline.rightFilename = wxEmptyString; - gridline.rightRelativePath = i->fileDescrRight.relFilename; - gridline.rightSize = _("<Directory>"); - } - else - { - 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; - - output.push_back(gridline); + output.push_back(currentRow); } - //sorting is expensive: ca. 50% bigger runtime for large grids; unsorted doesn't look too bad, so it's disabled - // sort(output.begin(), output.end(), cmpGridSmallerThan); -} -//######################################################################################################## - - -void updateUI_Now() -{ - //process UI events and prevent application from "not responding" -> NO performance issue! - wxTheApp->Yield(); - -// while (wxTheApp->Pending()) -// wxTheApp->Dispatch(); -} - - -bool updateUI_IsAllowed() -{ - static wxLongLong lastExec = 0; - - wxLongLong newExec = wxGetLocalTimeMillis(); - - if (newExec - lastExec >= uiUpdateInterval) //perform ui updates not more often than necessary - { - lastExec = newExec; - return true; - } - return false; + //sorting is expensive: do performance measurements before implementing here! } - //######################################################################################################## CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg) : mainDialog(dlg), - suppressUI_Errormessages(false), + continueOnError(false), currentProcess(-1) { //prevent user input during "compare", do not disable maindialog since abort-button would also be disabled @@ -2147,20 +2163,28 @@ CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg) : mainDialog->m_choiceLoad->Disable(); mainDialog->m_bpButton10->Disable(); mainDialog->m_bpButton14->Disable(); + mainDialog->m_menubar1->EnableTop(0, false); + mainDialog->m_menubar1->EnableTop(1, false); + mainDialog->m_menubar1->EnableTop(2, false); + + //display status panel during compare + statusPanel = new CompareStatus(mainDialog); + mainDialog->bSizer1->Insert(1, statusPanel, 0, wxEXPAND | wxALL, 5 ); + //show abort button + mainDialog->m_buttonAbort->Enable(); mainDialog->m_buttonAbort->Show(); + mainDialog->m_bpButtonCompare->Disable(); 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(); + //updateUI_Now(); + mainDialog->bSizer1->Layout(); //both sizers need to recalculate! + mainDialog->bSizer6->Layout(); } + CompareStatusUpdater::~CompareStatusUpdater() { //reenable complete main dialog @@ -2169,7 +2193,7 @@ CompareStatusUpdater::~CompareStatusUpdater() mainDialog->m_bpButtonFilter->Enable(); mainDialog->m_hyperlinkCfgFilter->Enable(); mainDialog->m_checkBoxHideFilt->Enable(); - //mainDialog->m_bpButtonSync->Enable(); don't enable this one, this is up to OnCompare to handle its status + mainDialog->m_bpButtonSync->Enable(); mainDialog->m_dirPicker1->Enable(); mainDialog->m_dirPicker2->Enable(); mainDialog->m_bpButtonSwap->Enable(); @@ -2186,11 +2210,16 @@ CompareStatusUpdater::~CompareStatusUpdater() mainDialog->m_choiceLoad->Enable(); mainDialog->m_bpButton10->Enable(); mainDialog->m_bpButton14->Enable(); + mainDialog->m_menubar1->EnableTop(0, true); + mainDialog->m_menubar1->EnableTop(1, true); + mainDialog->m_menubar1->EnableTop(2, true); if (abortionRequested) mainDialog->pushStatusInformation(_("Operation aborted!")); + mainDialog->m_buttonAbort->Disable(); mainDialog->m_buttonAbort->Hide(); + mainDialog->m_bpButtonCompare->Enable(); mainDialog->m_bpButtonCompare->Show(); //remove status panel from main window @@ -2201,6 +2230,7 @@ CompareStatusUpdater::~CompareStatusUpdater() mainDialog->Refresh(); } + inline void CompareStatusUpdater::updateStatusText(const wxString& text) { @@ -2233,14 +2263,14 @@ void CompareStatusUpdater::updateProcessedData(int objectsProcessed, double data int CompareStatusUpdater::reportError(const wxString& text) { - if (suppressUI_Errormessages) + if (continueOnError) return StatusUpdater::continueNext; statusPanel->updateStatusPanelNow(); wxString errorMessage = text + _("\n\nContinue with next object, retry or abort comparison?"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, suppressUI_Errormessages); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueOnError); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -2275,8 +2305,8 @@ void CompareStatusUpdater::triggerUI_Refresh() //######################################################################################################## -SyncStatusUpdater::SyncStatusUpdater(wxWindow* dlg, bool hideErrorMessages) : - suppressUI_Errormessages(hideErrorMessages) +SyncStatusUpdater::SyncStatusUpdater(wxWindow* dlg, bool continueOnError) : + continueError(continueOnError) { syncStatusFrame = new SyncStatus(this, dlg); syncStatusFrame->Show(); @@ -2306,11 +2336,11 @@ SyncStatusUpdater::~SyncStatusUpdater() //notify to syncStatusFrame that current process has ended if (abortionRequested) - syncStatusFrame->processHasFinished(statusAborted); //enable okay and close events + syncStatusFrame->processHasFinished(SyncStatus::statusAborted); //enable okay and close events else if (failedItems) - syncStatusFrame->processHasFinished(statusCompletedWithErrors); + syncStatusFrame->processHasFinished(SyncStatus::statusCompletedWithErrors); else - syncStatusFrame->processHasFinished(statusCompletedWithSuccess); + syncStatusFrame->processHasFinished(SyncStatus::statusCompletedWithSuccess); } @@ -2326,7 +2356,7 @@ void SyncStatusUpdater::initNewProcess(int objectsTotal, double dataTotal, int p assert (processID == FreeFileSync::synchronizeFilesProcess); syncStatusFrame->resetGauge(objectsTotal, dataTotal); - syncStatusFrame->setCurrentStatus(statusSynchronizing); + syncStatusFrame->setCurrentStatus(SyncStatus::statusSynchronizing); } @@ -2339,7 +2369,7 @@ void SyncStatusUpdater::updateProcessedData(int objectsProcessed, double dataPro int SyncStatusUpdater::reportError(const wxString& text) { - if (suppressUI_Errormessages) + if (continueError) { unhandledErrors.Add(text); return StatusUpdater::continueNext; @@ -2349,7 +2379,7 @@ int SyncStatusUpdater::reportError(const wxString& text) wxString errorMessage = text + _("\n\nContinue with next object, retry or abort synchronization?"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, suppressUI_Errormessages); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueError); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -2384,3 +2414,113 @@ void SyncStatusUpdater::triggerUI_Refresh() syncStatusFrame->updateStatusDialogNow(); } +//######################################################################################################## + + +//menu events +void MainDialog::OnMenuExportFileList(wxCommandEvent& event) +{ + //get a filename + wxString fileName = "FileList.csv"; //proposal + wxFileDialog* filePicker = new wxFileDialog(this, "", "", fileName, wxString(_("Comma separated list")) + " (*.csv)|*.csv", wxFD_SAVE); + + if (filePicker->ShowModal() == wxID_OK) + { + fileName = filePicker->GetPath(); + if (wxFileExists(fileName)) + { + wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString("\"") + fileName + "\"" + _(" already exists. Overwrite?"), _("Warning") , wxOK | wxCANCEL); + + if (messageDlg->ShowModal() != wxID_OK) + { + pushStatusInformation(_("Saved aborted!")); + event.Skip(); + return; + } + } + + //begin work + wxString exportString; + for (unsigned int i = 0; i < gridRefUI.size(); ++i) + { + for (int k = 0; k < m_grid1->GetNumberCols(); ++k) + { + exportString+= m_grid1->GetCellValue(i, k); + exportString+= '\t'; + } + + for (int k = 0; k < m_grid3->GetNumberCols(); ++k) + { + exportString+= m_grid3->GetCellValue(i, k); + exportString+= '\t'; + } + + for (int k = 0; k < m_grid2->GetNumberCols(); ++k) + { + exportString+= m_grid2->GetCellValue(i, k); + if (k != m_grid2->GetNumberCols() - 1) + exportString+= '\t'; + } + exportString+= '\n'; + } + + //write export file + wxFile output(fileName, wxFile::write); + + if (output.IsOpened()) + { + output.Write(exportString); + pushStatusInformation(_("File list exported!")); + } + else + { + wxMessageBox(wxString(_("Could not write to ")) + "\"" + fileName + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + } + } + + event.Skip(); +} + + +void MainDialog::OnMenuBatchJob(wxCommandEvent& event) +{ + BatchDialog* batchDlg = new BatchDialog(this, cfg, m_directoryPanel1->GetValue(), m_directoryPanel2->GetValue()); + if (batchDlg->ShowModal() == BatchDialog::batchFileCreated) + pushStatusInformation(_("Batch file created successfully!")); + + event.Skip(); +} + + +void MainDialog::OnMenuAbout(wxCommandEvent& event) +{ + AboutDlg* aboutDlg = new AboutDlg(this); + aboutDlg->ShowModal(); + event.Skip(); +} + + +void MainDialog::OnMenuQuit(wxCommandEvent& event) +{ + Destroy(); + event.Skip(); +} + + +void MainDialog::OnMenuLangEnglish(wxCommandEvent& event) +{ + programLanguage->loadLanguageFile(wxLANGUAGE_ENGLISH); //language is a global attribute + restartOnExit = true; + Destroy(); + event.Skip(); +} + + +void MainDialog::OnMenuLangGerman(wxCommandEvent& event) +{ + programLanguage->loadLanguageFile(wxLANGUAGE_GERMAN); //language is a global attribute + restartOnExit = true; + Destroy(); + event.Skip(); +} + diff --git a/ui/MainDialog.h b/ui/MainDialog.h index 3ac612fc..d60c489d 100644 --- a/ui/MainDialog.h +++ b/ui/MainDialog.h @@ -13,38 +13,16 @@ #include "../library/wxWidgets.h" #include "guiGenerated.h" #include "../FreeFileSync.h" - #include "syncDialog.h" #include "smallDialogs.h" -#include "resources.h" +#include "../library/resources.h" +#include "../library/misc.h" #include <wx/dnd.h> #include <wx/config.h> +#include <stack> using namespace std; -const wxString constFilteredOut = "(-)"; - -struct UI_GridLine -{ - wxString leftFilename; - wxString leftRelativePath; - wxString leftSize; - wxString leftDate; - - wxString cmpResult; - - wxString rightFilename; - wxString rightRelativePath; - wxString rightSize; - wxString rightDate; - - unsigned int linkToCurrentGridData; //rownumber of corresponding row in currentGridData -}; -typedef vector<UI_GridLine> UI_Grid; - -bool updateUI_IsAllowed(); //test if a specific amount of time is over -void updateUI_Now(); //do the updating - //IDs for context menu items enum ContextItem { @@ -61,32 +39,28 @@ class FileDropEvent; class MainDialog : public GuiGenerated { + friend class CompareStatusUpdater; + friend class FileDropEvent; + public: - MainDialog(wxFrame* frame, const wxString& cfgFileName); + MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale* language); ~MainDialog(); private: - friend class SyncDialog; - friend class FilterDlg; - friend class CompareStatusUpdater; - friend class SyncStatusUpdater; - friend class FileDropEvent; - void readConfigurationFromHD(const wxString& filename, bool programStartup = false); void writeConfigurationToHD(const wxString& filename); void loadDefaultConfiguration(); void updateViewFilterButtons(); - void updateFilterButton(); + void updateFilterButton(wxBitmapButton* filterButton, bool isActive); + void updateCompareButtons(); void addCfgFileToHistory(const wxString& filename); - static wxString evaluateCmpResult(const CompareFilesResult result, const bool selectedForSynchronization); - //main method for putting gridData on UI: maps data respecting current view settings void writeGrid(const FileCompareResult& gridData, bool useUI_GridCache = false); - void mapFileModelToUI(UI_Grid& output, const FileCompareResult& fileCmpResult); - void updateStatusInformation(const UI_Grid& output); + void mapGridDataToUI(GridView& output, const FileCompareResult& fileCmpResult); + void updateStatusInformation(const GridView& output); //context menu functions set<int> getSelectedRows(); @@ -100,7 +74,6 @@ private: //delayed status information restore void pushStatusInformation(const wxString& text); - void writeStatusInformation(const wxString& text); void clearStatusBar(); //events @@ -137,24 +110,36 @@ private: void OnRightOnlyFiles( wxCommandEvent& event); void OnEqualFiles( wxCommandEvent& event); + void OnBatchJob( wxCommandEvent& event); void OnSaveConfig( wxCommandEvent& event); 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); void OnConfigureFilter( wxHyperlinkEvent& event); void OnShowHelpDialog( wxCommandEvent& event); void OnSwapDirs( wxCommandEvent& event); - void OnChangeCompareVariant(wxCommandEvent& event); + void OnCompareByTimeSize( wxCommandEvent& event); + void OnCompareByContent( wxCommandEvent& event); void OnCompare( wxCommandEvent& event); void OnSync( wxCommandEvent& event); void OnClose( wxCloseEvent& event); void OnQuit( wxCommandEvent& event); void OnAbout( wxCommandEvent& event); + //menu events + void OnMenuExportFileList( wxCommandEvent& event); + void OnMenuBatchJob( wxCommandEvent& event); + void OnMenuAbout( wxCommandEvent& event); + void OnMenuQuit( wxCommandEvent& event); + void OnMenuLangEnglish( wxCommandEvent& event); + void OnMenuLangGerman( wxCommandEvent& event); + + void enableSynchronization(bool value); + //*********************************************** //global application variables are stored here: @@ -162,16 +147,9 @@ private: FileCompareResult currentGridData; //UI view of currentGridData - UI_Grid currentUI_View; - - //Synchronisation settings - SyncConfiguration syncConfiguration; + GridView gridRefUI; - //Filter setting - wxString includeFilter; - wxString excludeFilter; - bool hideFiltered; - bool filterIsActive; + Configuration cfg; //UI View Filter settings bool leftOnlyFilesActive; @@ -187,19 +165,14 @@ private: int posXNotMaximized; int posYNotMaximized; - //other options - bool useRecycleBin; //use Recycle bin when deleting or overwriting files while synchronizing - bool hideErrorMessages; //hides error messages during synchronization - //*********************************************** - - wxFrame* parent; - wxMenu* contextMenu; + CustomLocale* programLanguage; + //status information wxLongLong lastStatusChange; - int stackObjects; + stack<wxString> stackObjects; //save the last used config filenames wxConfig* cfgFileHistory; @@ -210,6 +183,10 @@ private: bool filteringInitialized; bool filteringPending; + bool synchronizationEnabled; //determines whether synchronization should be allowed + + bool restartOnExit; //restart dialog on exit (currently used, when language is changed) + CompareStatusUpdater* cmpStatusUpdaterTmp; //used only by the abort button when comparing }; @@ -239,8 +216,6 @@ private: //###################################################################################### //classes handling sync and compare error as well as status information -class CompareStatus; -class SyncStatus; class CompareStatusUpdater : public StatusUpdater { @@ -257,8 +232,8 @@ public: private: MainDialog* mainDialog; - bool suppressUI_Errormessages; CompareStatus* statusPanel; + bool continueOnError; int currentProcess; }; @@ -266,7 +241,7 @@ private: class SyncStatusUpdater : public StatusUpdater { public: - SyncStatusUpdater(wxWindow* dlg, bool hideErrorMessages); + SyncStatusUpdater(wxWindow* dlg, bool continueOnError); ~SyncStatusUpdater(); void updateStatusText(const wxString& text); @@ -279,7 +254,7 @@ public: private: SyncStatus* syncStatusFrame; - bool suppressUI_Errormessages; + bool continueError; wxArrayString unhandledErrors; //list of non-resolved errors }; diff --git a/ui/Resources.cpp b/ui/Resources.cpp deleted file mode 100644 index 207ff7c1..00000000 --- a/ui/Resources.cpp +++ /dev/null @@ -1,157 +0,0 @@ -#include "resources.h" -#include <wx/wfstream.h> -#include <wx/zipstrm.h> -#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; -wxBitmap* GlobalResources::bitmapStartSync = 0; -wxBitmap* GlobalResources::bitmapRightArrow = 0; -wxBitmap* GlobalResources::bitmapDelete = 0; -wxBitmap* GlobalResources::bitmapEmail = 0; -wxBitmap* GlobalResources::bitmapAbout = 0; -wxBitmap* GlobalResources::bitmapWebsite = 0; -wxBitmap* GlobalResources::bitmapExit = 0; -wxBitmap* GlobalResources::bitmapSync = 0; -wxBitmap* GlobalResources::bitmapCompare = 0; -wxBitmap* GlobalResources::bitmapSyncDisabled = 0; -wxBitmap* GlobalResources::bitmapSwap = 0; -wxBitmap* GlobalResources::bitmapHelp = 0; -wxBitmap* GlobalResources::bitmapLeftOnly = 0; -wxBitmap* GlobalResources::bitmapLeftNewer = 0; -wxBitmap* GlobalResources::bitmapDifferent = 0; -wxBitmap* GlobalResources::bitmapRightNewer = 0; -wxBitmap* GlobalResources::bitmapRightOnly = 0; -wxBitmap* GlobalResources::bitmapLeftOnlyDeact = 0; -wxBitmap* GlobalResources::bitmapLeftNewerDeact = 0; -wxBitmap* GlobalResources::bitmapDifferentDeact = 0; -wxBitmap* GlobalResources::bitmapRightNewerDeact = 0; -wxBitmap* GlobalResources::bitmapRightOnlyDeact = 0; -wxBitmap* GlobalResources::bitmapEqual = 0; -wxBitmap* GlobalResources::bitmapEqualDeact = 0; -wxBitmap* GlobalResources::bitmapInclude = 0; -wxBitmap* GlobalResources::bitmapExclude = 0; -wxBitmap* GlobalResources::bitmapFilterOn = 0; -wxBitmap* GlobalResources::bitmapFilterOff = 0; -wxBitmap* GlobalResources::bitmapWarning = 0; -wxBitmap* GlobalResources::bitmapSmallUp = 0; -wxBitmap* GlobalResources::bitmapSmallDown = 0; -wxBitmap* GlobalResources::bitmapSave = 0; -wxBitmap* GlobalResources::bitmapFFS = 0; -wxBitmap* GlobalResources::bitmapDeleteFile = 0; -wxBitmap* GlobalResources::bitmapGPL = 0; -wxBitmap* GlobalResources::bitmapStatusPause = 0; -wxBitmap* GlobalResources::bitmapStatusError = 0; -wxBitmap* GlobalResources::bitmapStatusSuccess = 0; -wxBitmap* GlobalResources::bitmapStatusWarning = 0; -wxBitmap* GlobalResources::bitmapStatusScanning = 0; -wxBitmap* GlobalResources::bitmapStatusComparing = 0; -wxBitmap* GlobalResources::bitmapStatusSyncing = 0; -wxBitmap* GlobalResources::bitmapLogo = 0; -wxBitmap* GlobalResources::bitmapFinished = 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)); - bitmapResource["right arrow.png"] = (bitmapRightArrow = new wxBitmap(wxNullBitmap)); - bitmapResource["delete.png"] = (bitmapDelete = new wxBitmap(wxNullBitmap)); - bitmapResource["email.png"] = (bitmapEmail = new wxBitmap(wxNullBitmap)); - bitmapResource["about.png"] = (bitmapAbout = new wxBitmap(wxNullBitmap)); - bitmapResource["website.png"] = (bitmapWebsite = new wxBitmap(wxNullBitmap)); - bitmapResource["exit.png"] = (bitmapExit = new wxBitmap(wxNullBitmap)); - bitmapResource["sync.png"] = (bitmapSync = new wxBitmap(wxNullBitmap)); - bitmapResource["compare.png"] = (bitmapCompare = new wxBitmap(wxNullBitmap)); - bitmapResource["sync disabled.png"] = (bitmapSyncDisabled = new wxBitmap(wxNullBitmap)); - bitmapResource["swap.png"] = (bitmapSwap = new wxBitmap(wxNullBitmap)); - bitmapResource["help.png"] = (bitmapHelp = new wxBitmap(wxNullBitmap)); - bitmapResource["leftOnly.png"] = (bitmapLeftOnly = new wxBitmap(wxNullBitmap)); - bitmapResource["leftNewer.png"] = (bitmapLeftNewer = new wxBitmap(wxNullBitmap)); - bitmapResource["different.png"] = (bitmapDifferent = new wxBitmap(wxNullBitmap)); - bitmapResource["rightNewer.png"] = (bitmapRightNewer = new wxBitmap(wxNullBitmap)); - bitmapResource["rightOnly.png"] = (bitmapRightOnly = new wxBitmap(wxNullBitmap)); - bitmapResource["leftOnlyDeact.png"] = (bitmapLeftOnlyDeact = new wxBitmap(wxNullBitmap)); - bitmapResource["leftNewerDeact.png"] = (bitmapLeftNewerDeact = new wxBitmap(wxNullBitmap)); - bitmapResource["differentDeact.png"] = (bitmapDifferentDeact = new wxBitmap(wxNullBitmap)); - bitmapResource["rightNewerDeact.png"] = (bitmapRightNewerDeact = new wxBitmap(wxNullBitmap)); - bitmapResource["rightOnlyDeact.png"] = (bitmapRightOnlyDeact = new wxBitmap(wxNullBitmap)); - bitmapResource["equal.png"] = (bitmapEqual = new wxBitmap(wxNullBitmap)); - bitmapResource["equalDeact.png"] = (bitmapEqualDeact = new wxBitmap(wxNullBitmap)); - bitmapResource["include.png"] = (bitmapInclude = new wxBitmap(wxNullBitmap)); - bitmapResource["exclude.png"] = (bitmapExclude = new wxBitmap(wxNullBitmap)); - bitmapResource["filter active.png"] = (bitmapFilterOn = new wxBitmap(wxNullBitmap)); - bitmapResource["filter not active.png"] = (bitmapFilterOff = new wxBitmap(wxNullBitmap)); - bitmapResource["warning.png"] = (bitmapWarning = new wxBitmap(wxNullBitmap)); - 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)); - bitmapResource["gpl.png"] = (bitmapGPL = new wxBitmap(wxNullBitmap)); - bitmapResource["statusPause.png"] = (bitmapStatusPause = new wxBitmap(wxNullBitmap)); - bitmapResource["statusError.png"] = (bitmapStatusError = new wxBitmap(wxNullBitmap)); - bitmapResource["statusSuccess.png"] = (bitmapStatusSuccess = new wxBitmap(wxNullBitmap)); - bitmapResource["statusWarning.png"] = (bitmapStatusWarning = new wxBitmap(wxNullBitmap)); - bitmapResource["statusScanning.png"] = (bitmapStatusScanning = new wxBitmap(wxNullBitmap)); - bitmapResource["statusComparing.png"] = (bitmapStatusComparing = new wxBitmap(wxNullBitmap)); - bitmapResource["statusSyncing.png"] = (bitmapStatusSyncing = new wxBitmap(wxNullBitmap)); - bitmapResource["logo.png"] = (bitmapLogo = new wxBitmap(wxNullBitmap)); - bitmapResource["finished.png"] = (bitmapFinished = 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!")); - - wxZipInputStream resourceFile(input); - - wxZipEntry* entry; - map<wxString, wxBitmap*>::iterator bmp; - while (entry = resourceFile.GetNextEntry()) - { - wxString name = entry->GetName(); - - //just to be sure: search if entry is available in map - if ((bmp = bitmapResource.find(name)) != bitmapResource.end()) - *(bmp->second) = wxBitmap(wxImage(resourceFile, wxBITMAP_TYPE_PNG)); - } - - animationMoney->LoadFile("Resources.a01"); - animationSync->LoadFile("Resources.a02"); -} - - -void GlobalResources::unloadResourceFiles() -{ - //free bitmap resources - for (map<wxString, wxBitmap*>::iterator i = bitmapResource.begin(); i != bitmapResource.end(); ++i) - delete i->second; - - //free other resources - delete animationMoney; - delete animationSync; -} diff --git a/ui/Resources.h b/ui/Resources.h deleted file mode 100644 index bfd2a8bc..00000000 --- a/ui/Resources.h +++ /dev/null @@ -1,78 +0,0 @@ -#ifndef RESOURCES_H_INCLUDED -#define RESOURCES_H_INCLUDED - -#include <wx/bitmap.h> -#include <wx/animate.h> -#include <wx/string.h> -#include <map> - -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; - static wxBitmap* bitmapDelete; - static wxBitmap* bitmapEmail; - static wxBitmap* bitmapAbout; - static wxBitmap* bitmapWebsite; - static wxBitmap* bitmapExit; - static wxBitmap* bitmapSync; - static wxBitmap* bitmapCompare; - static wxBitmap* bitmapSyncDisabled; - static wxBitmap* bitmapSwap; - static wxBitmap* bitmapHelp; - static wxBitmap* bitmapLeftOnly; - static wxBitmap* bitmapLeftNewer; - static wxBitmap* bitmapDifferent; - static wxBitmap* bitmapRightNewer; - static wxBitmap* bitmapRightOnly; - static wxBitmap* bitmapLeftOnlyDeact; - static wxBitmap* bitmapLeftNewerDeact; - static wxBitmap* bitmapDifferentDeact; - static wxBitmap* bitmapRightNewerDeact; - static wxBitmap* bitmapRightOnlyDeact; - static wxBitmap* bitmapEqual; - static wxBitmap* bitmapEqualDeact; - static wxBitmap* bitmapInclude; - static wxBitmap* bitmapExclude; - static wxBitmap* bitmapFilterOn; - static wxBitmap* bitmapFilterOff; - static wxBitmap* bitmapWarning; - static wxBitmap* bitmapSmallUp; - static wxBitmap* bitmapSmallDown; - static wxBitmap* bitmapSave; - static wxBitmap* bitmapFFS; - static wxBitmap* bitmapDeleteFile; - static wxBitmap* bitmapGPL; - static wxBitmap* bitmapStatusPause; - static wxBitmap* bitmapStatusError; - static wxBitmap* bitmapStatusSuccess; - static wxBitmap* bitmapStatusWarning; - static wxBitmap* bitmapStatusScanning; - static wxBitmap* bitmapStatusComparing; - static wxBitmap* bitmapStatusSyncing; - static wxBitmap* bitmapLogo; - static wxBitmap* bitmapFinished; - - static wxAnimation* animationMoney; - static wxAnimation* animationSync; - -private: - //resource mapping - static map<wxString, wxBitmap*> bitmapResource; -}; - - -#endif // RESOURCES_H_INCLUDED diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp index 4e1cc148..36c5cae4 100644 --- a/ui/SmallDialogs.cpp +++ b/ui/SmallDialogs.cpp @@ -1,9 +1,11 @@ #include "smallDialogs.h" #include "../library/globalFunctions.h" -#include <fstream> +//#include <fstream> +#include "../library/resources.h" using namespace globalFunctions; + AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) { m_bitmap9->SetBitmap(*GlobalResources::bitmapWebsite); @@ -11,23 +13,27 @@ AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) m_bitmap11->SetBitmap(*GlobalResources::bitmapLogo); m_bitmap13->SetBitmap(*GlobalResources::bitmapGPL); - m_animationControl1->SetAnimation(*GlobalResources::animationMoney); - m_animationControl1->Play(); - //build wxString build = wxString(_("(Build: ")) + __TDATE__ + ")"; m_build->SetLabel(build); + m_animationControl1->SetAnimation(*GlobalResources::animationMoney); + m_animationControl1->Play(); //Note: The animation is created hidden(!) to not disturb constraint based window creation; + m_animationControl1->Show(); //an empty animation consumes a lot of space that later is NOT removed anymore. + m_button8->SetFocus(); } + AboutDlg::~AboutDlg() {} + void AboutDlg::OnClose(wxCloseEvent& event) { Destroy(); } + void AboutDlg::OnOK(wxCommandEvent& event) { Destroy(); @@ -106,7 +112,7 @@ void FilterDlg::OnDefault(wxCommandEvent& event) //######################################################################################## DeleteDialog::DeleteDialog(const wxString& headerText, const wxString& messageText, wxWindow* main) : - DeleteDialogGenerated(main) + DeleteDlgGenerated(main) { m_staticTextHeader->SetLabel(headerText); m_textCtrlMessage->SetValue(messageText); @@ -135,9 +141,9 @@ void DeleteDialog::OnClose(wxCloseEvent& event) //######################################################################################## -ErrorDlg::ErrorDlg(const wxString messageText, bool& suppressErrormessages) : +ErrorDlg::ErrorDlg(const wxString messageText, bool& continueError) : ErrorDlgGenerated(0), - suppressErrors(suppressErrormessages) + continueOnError(continueError) { m_bitmap10->SetBitmap(*GlobalResources::bitmapWarning); m_textCtrl8->SetValue(messageText); @@ -150,28 +156,28 @@ ErrorDlg::~ErrorDlg() {} void ErrorDlg::OnClose(wxCloseEvent& event) { - //suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here + //continueOnError = m_checkBoxContinueError->GetValue(); -> not needed here EndModal(abortButtonPressed); } void ErrorDlg::OnContinue(wxCommandEvent& event) { - suppressErrors = m_checkBoxSuppress->GetValue(); + continueOnError = m_checkBoxContinueError->GetValue(); EndModal(continueButtonPressed); } void ErrorDlg::OnRetry(wxCommandEvent& event) { - //suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here + //continueOnError = m_checkBoxContinueError->GetValue(); -> not needed here EndModal(retryButtonPressed); } void ErrorDlg::OnAbort(wxCommandEvent& event) { - //suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here + //continueOnError = m_checkBoxContinueError->GetValue(); -> not needed here EndModal(abortButtonPressed); } //######################################################################################## @@ -270,7 +276,7 @@ wxLongLong RemainingTime::getRemainingTime(double processedDataSinceLastCall, in //######################################################################################## SyncStatus::SyncStatus(StatusUpdater* updater, wxWindow* parentWindow) : - SyncStatusGenerated(parentWindow), + SyncStatusDlgGenerated(parentWindow), currentStatusUpdater(updater), windowToDis(parentWindow), currentProcessIsRunning(true), @@ -278,10 +284,10 @@ SyncStatus::SyncStatus(StatusUpdater* updater, wxWindow* parentWindow) : currentData(0), scalingFactor(0), currentObjects(0), - totalObjects(0) + totalObjects(0), + processPaused(false) { m_animationControl1->SetAnimation(*GlobalResources::animationSync); - m_animationControl1->SetInactiveBitmap(*GlobalResources::bitmapFinished); m_animationControl1->Play(); //initialize gauge @@ -351,7 +357,15 @@ void SyncStatus::updateStatusDialogNow() m_staticTextDataRemaining->SetLabel(remainingBytes); //do the ui update + bSizer28->Layout(); updateUI_Now(); + + //support for pause button + while (processPaused && currentProcessIsRunning) + { + wxMilliSleep(uiUpdateInterval); + updateUI_Now(); + } } @@ -399,16 +413,22 @@ void SyncStatus::setCurrentStatus(SyncStatusID id) void SyncStatus::processHasFinished(SyncStatusID id) //essential to call this in StatusUpdater derived class destructor { //at the LATEST(!) to prevent access to currentStatusUpdater - currentProcessIsRunning = false; //enable okay and close events + currentProcessIsRunning = false; //enable okay and close events; may be set ONLY in this method setCurrentStatus(id); + m_buttonAbort->Disable(); m_buttonAbort->Hide(); + m_buttonPause->Disable(); + m_buttonPause->Hide(); m_buttonOK->Show(); m_buttonOK->SetFocus(); m_animationControl1->Stop(); + //m_animationControl1->SetInactiveBitmap(*GlobalResources::bitmapFinished); + m_animationControl1->Hide(); + updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed Layout(); // } @@ -420,14 +440,34 @@ void SyncStatus::OnOkay(wxCommandEvent& event) } +void SyncStatus::OnPause(wxCommandEvent& event) +{ + if (processPaused) + { + processPaused = false; + m_buttonPause->SetLabel(_("Pause")); + m_animationControl1->Play(); + + } + else + { + processPaused = true; + m_buttonPause->SetLabel(_("Continue")); + m_animationControl1->Stop(); + } +} + + void SyncStatus::OnAbort(wxCommandEvent& event) { + processPaused = false; if (currentProcessIsRunning) currentStatusUpdater->requestAbortion(); } void SyncStatus::OnClose(wxCloseEvent& event) { + processPaused = false; if (currentProcessIsRunning) currentStatusUpdater->requestAbortion(); else Destroy(); @@ -449,6 +489,11 @@ CompareStatus::CompareStatus(wxWindow* parentWindow) : { //initialize gauge m_gauge2->SetRange(50000); m_gauge2->SetValue(0); + + //initially hide status that's relevant for comparing bytewise only + bSizer42->Hide(sbSizer13); + bSizer42->Hide(sbSizer11); + bSizer42->Layout(); } @@ -467,6 +512,11 @@ void CompareStatus::resetCmpGauge(int totalCmpObjectsToProcess, double totalCmpD scalingFactorCmp = 50000 / totalCmpData; //let's normalize to 50000 else scalingFactorCmp = 0; + + //show status for comparing bytewise + bSizer42->Show(sbSizer13); + bSizer42->Show(sbSizer11); + bSizer42->Layout(); } @@ -481,8 +531,8 @@ void CompareStatus::incProcessedCmpData_NoUpdate(int objectsProcessed, double da processedCmpData+= dataProcessed; processedCmpObjects+= objectsProcessed; -/* timeRemaining = calcTimeLeft.getRemainingTime(dataProcessed, totalCmpObjects - processedCmpObjects, totalCmpData - processedCmpData); - timeRemainingTimeStamp = wxGetLocalTimeMillis();*/ + /* timeRemaining = calcTimeLeft.getRemainingTime(dataProcessed, totalCmpObjects - processedCmpObjects, totalCmpData - processedCmpData); + timeRemainingTimeStamp = wxGetLocalTimeMillis();*/ } @@ -508,14 +558,15 @@ void CompareStatus::updateStatusPanelNow() //remaining bytes left for file comparison const wxString remainingBytes = FreeFileSync::formatFilesizeToShortString(totalCmpData - processedCmpData); m_staticTextDataToCompare->SetLabel(remainingBytes); -/* - //remaining time in seconds - if (timeRemaining != 0) - { - int time = ((timeRemaining - (wxGetLocalTimeMillis() - timeRemainingTimeStamp)) / 1000).GetLo(); - m_staticTextRemainingTime->SetLabel(numberToWxString(time) + " s"); - } -*/ + /* + //remaining time in seconds + if (timeRemaining != 0) + { + int time = ((timeRemaining - (wxGetLocalTimeMillis() - timeRemainingTimeStamp)) / 1000).GetLo(); + m_staticTextRemainingTime->SetLabel(numberToWxString(time) + " s"); + } + */ //do the ui update + bSizer42->Layout(); updateUI_Now(); } diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h index 0eb22395..c6495c83 100644 --- a/ui/SmallDialogs.h +++ b/ui/SmallDialogs.h @@ -1,9 +1,8 @@ #ifndef SMALLDIALOGS_H_INCLUDED #define SMALLDIALOGS_H_INCLUDED -#include "mainDialog.h" - -class MainDialog; +#include "../FreeFileSync.h" +#include "guiGenerated.h" class AboutDlg : public AboutDlgGenerated { @@ -48,7 +47,7 @@ private: }; -class DeleteDialog : public DeleteDialogGenerated +class DeleteDialog : public DeleteDlgGenerated { public: DeleteDialog(const wxString& headerText, const wxString& messageText, wxWindow* main); @@ -67,7 +66,7 @@ private: class ErrorDlg : public ErrorDlgGenerated { public: - ErrorDlg(const wxString messageText, bool& suppressErrormessages); + ErrorDlg(const wxString messageText, bool& continueError); ~ErrorDlg(); static const int continueButtonPressed = 35; @@ -80,28 +79,27 @@ private: void OnRetry(wxCommandEvent& event); void OnAbort(wxCommandEvent& event); - bool& suppressErrors; -}; - - -enum SyncStatusID -{ - statusAborted, - statusCompletedWithSuccess, - statusCompletedWithErrors, - statusPause, - statusScanning, - statusComparing, - statusSynchronizing + bool& continueOnError; }; -class SyncStatus : public SyncStatusGenerated +class SyncStatus : public SyncStatusDlgGenerated { public: SyncStatus(StatusUpdater* updater, wxWindow* parentWindow = 0); ~SyncStatus(); + enum SyncStatusID + { + statusAborted, + statusCompletedWithSuccess, + statusCompletedWithErrors, + statusPause, + statusScanning, + statusComparing, + statusSynchronizing + }; + void resetGauge(int totalObjectsToProcess, double totalDataToProcess); void incProgressIndicator_NoUpdate(int objectsProcessed, double dataProcessed); void setStatusText_NoUpdate(const wxString& text); @@ -112,6 +110,7 @@ public: private: void OnOkay(wxCommandEvent& event); + void OnPause(wxCommandEvent& event); void OnAbort(wxCommandEvent& event); void OnClose(wxCloseEvent& event); @@ -127,6 +126,7 @@ private: int totalObjects; wxString currentStatusText; + bool processPaused; }; /* @@ -178,12 +178,12 @@ private: double scalingFactorCmp; //nr of elements has to be normalized to smaller nr. because of range of int limitation int processedCmpObjects; //each object represents a file or directory processed int totalCmpObjects; -/* - //remaining time - RemainingTime calcTimeLeft; - wxLongLong timeRemaining; //time in milliseconds - wxLongLong timeRemainingTimeStamp; //time in milliseconds -*/ + /* + //remaining time + RemainingTime calcTimeLeft; + wxLongLong timeRemaining; //time in milliseconds + wxLongLong timeRemainingTimeStamp; //time in milliseconds + */ }; diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp index b97badf8..c138544e 100644 --- a/ui/SyncDialog.cpp +++ b/ui/SyncDialog.cpp @@ -1,25 +1,44 @@ #include "syncDialog.h" #include "../library/globalFunctions.h" - -SyncDialog::SyncDialog(MainDialog* window) - : SyncDialogGenerated(window), mainDialog(window) +#include "../library/resources.h" +#include <wx/msgdlg.h> +#include <wx/file.h> +#include <wx/stdpaths.h> + +SyncDialog::SyncDialog(wxWindow* window, + const FileCompareResult& gridDataRef, + Configuration& config, + bool synchronizationEnabled) : + SyncDlgGenerated(window), + gridData(gridDataRef), + cfg(config) { - //make working copy of mainDialog->syncConfiguration and recycler setting - localSyncConfiguration = mainDialog->syncConfiguration; + //make working copy of mainDialog.cfg.syncConfiguration and recycler setting + localSyncConfiguration = config.syncConfiguration; + m_checkBoxUseRecycler->SetValue(cfg.useRecycleBin); + m_checkBoxContinueError->SetValue(cfg.continueOnError); - m_checkBoxUseRecycler->SetValue(mainDialog->useRecycleBin); - m_checkBoxHideErrors->SetValue(mainDialog->hideErrorMessages); + //set sync config icons + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + //update preview + calculatePreview(); //set icons for this dialog m_bpButton18->SetBitmapLabel(*GlobalResources::bitmapStartSync); + m_bpButton18->SetBitmapDisabled(*GlobalResources::bitmapStartSyncDis); m_bitmap13->SetBitmap(*GlobalResources::bitmapLeftOnlyDeact); m_bitmap14->SetBitmap(*GlobalResources::bitmapRightOnlyDeact); m_bitmap15->SetBitmap(*GlobalResources::bitmapLeftNewerDeact); m_bitmap16->SetBitmap(*GlobalResources::bitmapRightNewerDeact); m_bitmap17->SetBitmap(*GlobalResources::bitmapDifferentDeact); - //set sync config icons - updateConfigIcons(); + if (synchronizationEnabled) + m_bpButton18->Enable(); + else + { + m_bpButton18->Disable(); + m_button6->SetFocus(); + } //set radiobutton if (localSyncConfiguration.exLeftSideOnly == syncDirRight && @@ -47,99 +66,122 @@ SyncDialog::SyncDialog(MainDialog* window) SyncDialog::~SyncDialog() {} -void SyncDialog::updateConfigIcons() +void SyncDialog::updateConfigIcons(wxBitmapButton* button1, + wxBitmapButton* button2, + wxBitmapButton* button3, + wxBitmapButton* button4, + wxBitmapButton* button5, + const SyncConfiguration& syncConfig) { - if (localSyncConfiguration.exLeftSideOnly == syncDirRight) + if (syncConfig.exLeftSideOnly == syncDirRight) { - m_bpButton5->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton5->SetToolTip(_("Copy from left to right")); + button1->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button1->SetToolTip(_("Copy from left to right")); } - else if (localSyncConfiguration.exLeftSideOnly == syncDirLeft) + else if (syncConfig.exLeftSideOnly == syncDirLeft) { - m_bpButton5->SetBitmapLabel(*GlobalResources::bitmapDelete); - m_bpButton5->SetToolTip(_("Delete files existing on left side only")); + button1->SetBitmapLabel(*GlobalResources::bitmapDelete); + button1->SetToolTip(_("Delete files/folders existing on left side only")); } - else if (localSyncConfiguration.exLeftSideOnly == syncDirNone) + else if (syncConfig.exLeftSideOnly == syncDirNone) { - m_bpButton5->SetBitmapLabel(wxNullBitmap); - m_bpButton5->SetToolTip(_("Do nothing")); + button1->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button1->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.exRightSideOnly == syncDirRight) + if (syncConfig.exRightSideOnly == syncDirRight) { - m_bpButton6->SetBitmapLabel(*GlobalResources::bitmapDelete); - m_bpButton6->SetToolTip(_("Delete files existing on right side only")); + button2->SetBitmapLabel(*GlobalResources::bitmapDelete); + button2->SetToolTip(_("Delete files/folders existing on right side only")); } - else if (localSyncConfiguration.exRightSideOnly == syncDirLeft) + else if (syncConfig.exRightSideOnly == syncDirLeft) { - m_bpButton6->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton6->SetToolTip(_("Copy from right to left")); + button2->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button2->SetToolTip(_("Copy from right to left")); } - else if (localSyncConfiguration.exRightSideOnly == syncDirNone) + else if (syncConfig.exRightSideOnly == syncDirNone) { - m_bpButton6->SetBitmapLabel(wxNullBitmap); - m_bpButton6->SetToolTip(_("Do nothing")); + button2->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button2->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.leftNewer == syncDirRight) + if (syncConfig.leftNewer == syncDirRight) { - m_bpButton7->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton7->SetToolTip(_("Copy from left to right overwriting")); + button3->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button3->SetToolTip(_("Copy from left to right overwriting")); } - else if (localSyncConfiguration.leftNewer == syncDirLeft) + else if (syncConfig.leftNewer == syncDirLeft) { - m_bpButton7->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton7->SetToolTip(_("Copy from right to left overwriting")); + button3->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button3->SetToolTip(_("Copy from right to left overwriting")); } - else if (localSyncConfiguration.leftNewer == syncDirNone) + else if (syncConfig.leftNewer == syncDirNone) { - m_bpButton7->SetBitmapLabel(wxNullBitmap); - m_bpButton7->SetToolTip(_("Do nothing")); + button3->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button3->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.rightNewer == syncDirRight) + if (syncConfig.rightNewer == syncDirRight) { - m_bpButton8->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton8->SetToolTip(_("Copy from left to right overwriting")); + button4->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button4->SetToolTip(_("Copy from left to right overwriting")); } - else if (localSyncConfiguration.rightNewer == syncDirLeft) + else if (syncConfig.rightNewer == syncDirLeft) { - m_bpButton8->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton8->SetToolTip(_("Copy from right to left overwriting")); + button4->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button4->SetToolTip(_("Copy from right to left overwriting")); } - else if (localSyncConfiguration.rightNewer == syncDirNone) + else if (syncConfig.rightNewer == syncDirNone) { - m_bpButton8->SetBitmapLabel(wxNullBitmap); - m_bpButton8->SetToolTip(_("Do nothing")); + button4->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button4->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.different == syncDirRight) + if (syncConfig.different == syncDirRight) { - m_bpButton9->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton9->SetToolTip(_("Copy from left to right overwriting")); + button5->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button5->SetToolTip(_("Copy from left to right overwriting")); } - else if (localSyncConfiguration.different == syncDirLeft) + else if (syncConfig.different == syncDirLeft) { - m_bpButton9->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton9->SetToolTip(_("Copy from right to left overwriting")); + button5->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button5->SetToolTip(_("Copy from right to left overwriting")); } - else if (localSyncConfiguration.different == syncDirNone) + else if (syncConfig.different == syncDirNone) { - m_bpButton9->SetBitmapLabel(wxNullBitmap); - m_bpButton9->SetToolTip(_("Do nothing")); + button5->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button5->SetToolTip(_("Do nothing")); } +} - //update preview of bytes to be transferred: - 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); +void SyncDialog::calculatePreview() +{ + //update preview of bytes to be transferred: + int objectsToCreate = 0; + int objectsToOverwrite = 0; + int objectsToDelete = 0; + double dataToProcess = 0; + FreeFileSync::calcTotalBytesToSync(objectsToCreate, + objectsToOverwrite, + objectsToDelete, + dataToProcess, + gridData, + localSyncConfiguration); + + wxString toCreate = globalFunctions::numberToWxString(objectsToCreate); + wxString toUpdate = globalFunctions::numberToWxString(objectsToOverwrite); + wxString toDelete = globalFunctions::numberToWxString(objectsToDelete); + wxString data = FreeFileSync::formatFilesizeToShortString(dataToProcess); + + globalFunctions::includeNumberSeparator(toCreate); + globalFunctions::includeNumberSeparator(toUpdate); + globalFunctions::includeNumberSeparator(toDelete); + + m_textCtrlCreate->SetValue(toCreate); + m_textCtrlUpdate->SetValue(toUpdate); + m_textCtrlDelete->SetValue(toDelete); + m_textCtrlData->SetValue(data); } @@ -158,9 +200,9 @@ void SyncDialog::OnCancel(wxCommandEvent& event) void SyncDialog::OnBack(wxCommandEvent& event) { //write configuration to main dialog - mainDialog->syncConfiguration = localSyncConfiguration; - mainDialog->useRecycleBin = m_checkBoxUseRecycler->GetValue(); - mainDialog->hideErrorMessages = m_checkBoxHideErrors->GetValue(); + cfg.syncConfiguration = localSyncConfiguration; + cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); + cfg.continueOnError = m_checkBoxContinueError->GetValue(); EndModal(0); } @@ -168,9 +210,9 @@ void SyncDialog::OnBack(wxCommandEvent& event) void SyncDialog::OnStartSync(wxCommandEvent& event) { //write configuration to main dialog - mainDialog->syncConfiguration = localSyncConfiguration; - mainDialog->useRecycleBin = m_checkBoxUseRecycler->GetValue(); - mainDialog->hideErrorMessages = m_checkBoxHideErrors->GetValue(); + cfg.syncConfiguration = localSyncConfiguration; + cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); + cfg.continueOnError = m_checkBoxContinueError->GetValue(); EndModal(StartSynchronizationProcess); } @@ -189,7 +231,7 @@ void SyncDialog::OnSelectRecycleBin(wxCommandEvent& event) } -void SyncDialog::OnSyncLeftToRight( wxCommandEvent& event ) +void SyncDialog::OnSyncLeftToRight(wxCommandEvent& event) { localSyncConfiguration.exLeftSideOnly = syncDirRight; localSyncConfiguration.exRightSideOnly = syncDirRight; @@ -197,14 +239,15 @@ void SyncDialog::OnSyncLeftToRight( wxCommandEvent& event ) localSyncConfiguration.rightNewer = syncDirRight; localSyncConfiguration.different = syncDirRight; - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //if event is triggered by button m_radioBtn1->SetValue(true); } -void SyncDialog::OnSyncBothSides( wxCommandEvent& event ) +void SyncDialog::OnSyncBothSides(wxCommandEvent& event) { localSyncConfiguration.exLeftSideOnly = syncDirRight; localSyncConfiguration.exRightSideOnly = syncDirLeft; @@ -212,7 +255,9 @@ void SyncDialog::OnSyncBothSides( wxCommandEvent& event ) localSyncConfiguration.rightNewer = syncDirLeft; localSyncConfiguration.different = syncDirNone; - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); + //if event is triggered by button m_radioBtn2->SetValue(true); } @@ -233,7 +278,8 @@ void toggleSyncDirection(SyncDirection& current) void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -241,7 +287,8 @@ void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exRightSideOnly); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -249,7 +296,8 @@ void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) void SyncDialog::OnLeftNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.leftNewer); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -257,7 +305,8 @@ void SyncDialog::OnLeftNewer( wxCommandEvent& event ) void SyncDialog::OnRightNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.rightNewer); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -265,7 +314,264 @@ void SyncDialog::OnRightNewer( wxCommandEvent& event ) void SyncDialog::OnDifferent( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.different); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } + +//################################################################################################################################### + + +BatchDialog::BatchDialog(wxWindow* window, + const Configuration& config, + const wxString& leftDir, + const wxString& rightDir) : + BatchDlgGenerated(window) +{ + //make working copy of mainDialog.cfg.syncConfiguration and recycler setting + localSyncConfiguration = config.syncConfiguration; + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + + m_checkBoxUseRecycler->SetValue(config.useRecycleBin); + m_checkBoxContinueError->SetValue(config.continueOnError); + + switch (config.compareVar) + { + case compareByTimeAndSize: + m_radioBtnSizeDate->SetValue(true); + break; + case compareByContent: + m_radioBtnContent->SetValue(true); + break; + default: + assert (false); + } + + filterIsActive = config.filterIsActive; + updateFilterButton(); + + m_textCtrlInclude->SetValue(config.includeFilter); + m_textCtrlExclude->SetValue(config.excludeFilter); + + m_directoryPanel1->SetValue(leftDir); + m_directoryPanel2->SetValue(rightDir); + + //set icons for this dialog + m_bitmap13->SetBitmap(*GlobalResources::bitmapLeftOnlyDeact); + m_bitmap14->SetBitmap(*GlobalResources::bitmapRightOnlyDeact); + m_bitmap15->SetBitmap(*GlobalResources::bitmapLeftNewerDeact); + m_bitmap16->SetBitmap(*GlobalResources::bitmapRightNewerDeact); + m_bitmap17->SetBitmap(*GlobalResources::bitmapDifferentDeact); + m_bitmap8->SetBitmap(*GlobalResources::bitmapInclude); + m_bitmap9->SetBitmap(*GlobalResources::bitmapExclude); + + m_buttonCreate->SetFocus(); +} + +BatchDialog::~BatchDialog() +{} + + +void BatchDialog::updateFilterButton() +{ + if (filterIsActive) + { + m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOn); + m_bpButtonFilter->SetToolTip(_("Filter active: Press again to deactivate")); + + m_textCtrlInclude->Enable(); + m_textCtrlExclude->Enable(); + } + else + { + m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOff); + m_bpButtonFilter->SetToolTip(_("Press button to activate filter")); + + m_textCtrlInclude->Disable(); + m_textCtrlExclude->Disable(); + } +} + + +void BatchDialog::OnExLeftSideOnly(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnExRightSideOnly(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.exRightSideOnly); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnLeftNewer(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.leftNewer); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnRightNewer(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.rightNewer); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnDifferent(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.different); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + + +void BatchDialog::OnFilterButton(wxCommandEvent& event) +{ + filterIsActive = !filterIsActive; + updateFilterButton(); +} + + +void BatchDialog::OnSelectRecycleBin(wxCommandEvent& event) +{ + if (event.IsChecked()) + { + if (!FreeFileSync::recycleBinExists()) + { + wxMessageBox(_("It was not possible to gain access to Recycle Bin!\n\nIt's likely that you are not using Windows XP. (Probably Vista)\nIf you want this feature included, please contact the author. :)"), _("Error") , wxOK | wxICON_ERROR); + m_checkBoxUseRecycler->SetValue(false); + } + } +} + + +void BatchDialog::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void BatchDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void BatchDialog::OnCreateJob(wxCommandEvent& event) +{ + //get a filename +#ifdef FFS_WIN + wxString fileName = "SyncJob.cmd"; //proposal + wxFileDialog* filePicker = new wxFileDialog(this, "", "", fileName, wxString(_("Command file")) + " (*.cmd)|*.cmd", wxFD_SAVE); +#elif defined FFS_LINUX + wxString fileName = "SyncJob.sh"; //proposal + wxFileDialog* filePicker = new wxFileDialog(this, "", "", fileName, wxString(_("Shell script")) + " (*.sh)|*.sh", wxFD_SAVE); +#else + assert(false); +#endif + + if (filePicker->ShowModal() == wxID_OK) + { + fileName = filePicker->GetPath(); + if (wxFileExists(fileName)) + { + wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString("\"") + fileName + "\"" + _(" already exists. Overwrite?"), _("Warning") , wxOK | wxCANCEL); + + if (messageDlg->ShowModal() != wxID_OK) + { + event.Skip(); + return; + } + } + + //assemble command line parameters + wxString outputString = parseConfiguration(); + + //write export file + wxFile output(fileName, wxFile::write); + if (output.IsOpened()) + { + output.Write(outputString); + EndModal(batchFileCreated); + } + else + wxMessageBox(wxString(_("Could not write to ")) + "\"" + fileName + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + } + +#ifdef FFS_LINUX + //for linux the batch file needs the executable flag + wxExecute(wxString("chmod +x ") + fileName); +#endif // FFS_LINUX + + event.Skip(); +} + + +wxString getFormattedSyncDirection(const SyncDirection direction) +{ + if (direction == syncDirRight) + return 'R'; + else if (direction == syncDirLeft) + return 'L'; + else if (direction == syncDirNone) + return 'N'; + else + { + assert (false); + return wxEmptyString; + } +} + + +wxString BatchDialog::parseConfiguration() +{ + wxString output; + +#ifdef FFS_LINUX + //shell script identifier + output+= "#!/bin/bash\n"; +#endif + + output+= "\"" + wxStandardPaths::Get().GetExecutablePath() + "\""; + + output+= wxString(" -") + GlobalResources::paramCompare + " "; + if (m_radioBtnSizeDate->GetValue()) + output+= GlobalResources::valueSizeDate; + else if (m_radioBtnContent->GetValue()) + output+= GlobalResources::valueContent; + else + assert(false); + + output+= wxString(" -") + GlobalResources::paramCfg + " " + + getFormattedSyncDirection(localSyncConfiguration.exLeftSideOnly) + + getFormattedSyncDirection(localSyncConfiguration.exRightSideOnly) + + getFormattedSyncDirection(localSyncConfiguration.leftNewer) + + getFormattedSyncDirection(localSyncConfiguration.rightNewer) + + getFormattedSyncDirection(localSyncConfiguration.different); + + if (filterIsActive) + { + output+= wxString(" -") + GlobalResources::paramInclude + " " + + "\"" + m_textCtrlInclude->GetValue() + "\""; + + output+= wxString(" -") + GlobalResources::paramExclude + " " + + "\"" + m_textCtrlExclude->GetValue() + "\""; + } + + if (m_checkBoxUseRecycler->GetValue()) + output+= wxString(" -") + GlobalResources::paramRecycler; + + if (m_checkBoxContinueError->GetValue()) + output+= wxString(" -") + GlobalResources::paramContinueError; + + if (m_checkBoxSilent->GetValue()) + output+= wxString(" -") + GlobalResources::paramSilent; + + output+= wxString(" ") + "\"" + m_directoryPanel1->GetValue() + "\""; + output+= wxString(" ") + "\"" + m_directoryPanel2->GetValue() + "\""; + + output+= "\n"; + + return output; +} + diff --git a/ui/SyncDialog.h b/ui/SyncDialog.h index 23d8ce5b..9e79c7d2 100644 --- a/ui/SyncDialog.h +++ b/ui/SyncDialog.h @@ -1,41 +1,85 @@ #ifndef SYNCDIALOG_H_INCLUDED #define SYNCDIALOG_H_INCLUDED -#include "mainDialog.h" +#include "../FreeFileSync.h" +#include "guiGenerated.h" -class MainDialog; - -class SyncDialog: public SyncDialogGenerated +class SyncDialog: public SyncDlgGenerated { public: - SyncDialog(MainDialog* window); + SyncDialog(wxWindow* window, + const FileCompareResult& gridDataRef, + Configuration& config, + bool synchronizationEnabled); + ~SyncDialog(); static const int StartSynchronizationProcess = 15; + static void updateConfigIcons(wxBitmapButton* button1, + wxBitmapButton* button2, + wxBitmapButton* button3, + wxBitmapButton* button4, + wxBitmapButton* button5, + const SyncConfiguration& syncConfig); + private: - //temporal copy of maindialog->syncConfiguration + void calculatePreview(); + + void OnSyncLeftToRight( wxCommandEvent& event); + void OnSyncBothSides( wxCommandEvent& event); + + void OnExLeftSideOnly( wxCommandEvent& event); + void OnExRightSideOnly( wxCommandEvent& event); + void OnLeftNewer( wxCommandEvent& event); + void OnRightNewer( wxCommandEvent& event); + void OnDifferent( wxCommandEvent& event); + + void OnStartSync( wxCommandEvent& event); + void OnClose( wxCloseEvent& event); + void OnBack( wxCommandEvent& event); + void OnCancel( wxCommandEvent& event); + + void OnSelectRecycleBin(wxCommandEvent& event); + + //temporal copy of maindialog.cfg.syncConfiguration SyncConfiguration localSyncConfiguration; + const FileCompareResult& gridData; + Configuration& cfg; +}; + - void updateConfigIcons(); +class BatchDialog: public BatchDlgGenerated +{ +public: + BatchDialog(wxWindow* window, + const Configuration& config, + const wxString& leftDir, + const wxString& rightDir); - void OnSyncLeftToRight( wxCommandEvent& event ); - void OnSyncBothSides( wxCommandEvent& event ); + ~BatchDialog(); - void OnExLeftSideOnly( wxCommandEvent& event ); - void OnExRightSideOnly( wxCommandEvent& event ); - void OnLeftNewer( wxCommandEvent& event ); - void OnRightNewer( wxCommandEvent& event ); - void OnDifferent( wxCommandEvent& event ); + static const int batchFileCreated = 15; - void OnStartSync(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - void OnBack(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); +private: + void OnExLeftSideOnly( wxCommandEvent& event); + void OnExRightSideOnly( wxCommandEvent& event); + void OnLeftNewer( wxCommandEvent& event); + void OnRightNewer( wxCommandEvent& event); + void OnDifferent( wxCommandEvent& event); + void OnFilterButton( wxCommandEvent& event); void OnSelectRecycleBin(wxCommandEvent& event); - MainDialog* mainDialog; + void OnClose( wxCloseEvent& event); + void OnCancel( wxCommandEvent& event); + void OnCreateJob( wxCommandEvent& event); + + void updateFilterButton(); + wxString parseConfiguration(); + + SyncConfiguration localSyncConfiguration; + bool filterIsActive; }; #endif // SYNCDIALOG_H_INCLUDED diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp index a6ad9e6c..56feba35 100644 --- a/ui/guiGenerated.cpp +++ b/ui/guiGenerated.cpp @@ -15,7 +15,7 @@ #include <wx/wx.h> #endif //WX_PRECOMP -#include "..\library\customGrid.h" +#include "../library/customGrid.h" #include "guiGenerated.h" @@ -25,93 +25,159 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + m_menubar1 = new wxMenuBar( 0 ); + m_menu1 = new wxMenu(); + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_menu1, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("CTRL-Q"), wxEmptyString, wxITEM_NORMAL ); + m_menu1->Append( m_menuItem4 ); + + m_menubar1->Append( m_menu1, _("&File") ); + + m_menu3 = new wxMenu(); + wxMenuItem* m_menuItem5; + m_menuItem5 = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Export file list") ) , wxEmptyString, wxITEM_NORMAL ); + m_menu3->Append( m_menuItem5 ); + + m_menu31 = new wxMenu(); + m_menuItemEnglish = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("English") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemEnglish ); + + m_menuItemGerman = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Deutsch") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemGerman ); + + m_menu3->Append( -1, _("&Language"), m_menu31 ); + + m_menu3->AppendSeparator(); + + wxMenuItem* m_menuItem7; + m_menuItem7 = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Create batch job") ) , wxEmptyString, wxITEM_NORMAL ); + m_menu3->Append( m_menuItem7 ); + + m_menubar1->Append( m_menu3, _("&Advanced") ); + + m_menu2 = new wxMenu(); + wxMenuItem* m_menuItem3; + m_menuItem3 = new wxMenuItem( m_menu2, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); + m_menu2->Append( m_menuItem3 ); + + m_menubar1->Append( m_menu2, _("&Help") ); + + this->SetMenuBar( m_menubar1 ); + bSizer1 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer6; + m_panel71 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel71->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); + bSizer6 = new wxBoxSizer( wxHORIZONTAL ); - bSizer6->Add( 40, 0, 0, wxEXPAND, 5 ); + bSizer6->Add( 40, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer30; - bSizer30 = new wxBoxSizer( wxVERTICAL ); + bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - m_bpButtonCompare = new wxBitmapButton( this, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + m_bpButtonCompare = new wxBitmapButton( m_panel71, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); m_bpButtonCompare->SetDefault(); m_bpButtonCompare->SetToolTip( _("Compare both sides") ); m_bpButtonCompare->SetToolTip( _("Compare both sides") ); - bSizer30->Add( m_bpButtonCompare, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bSizer30->Add( m_bpButtonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("Abort"), wxDefaultPosition, wxSize( 186,33 ), 0 ); + m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("Abort"), wxDefaultPosition, wxSize( 190,37 ), 0 ); m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Tahoma") ) ); + m_buttonAbort->Enable( false ); m_buttonAbort->Hide(); - bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); bSizer6->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); + wxBoxSizer* bSizer55; + bSizer55 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by") ), wxVERTICAL ); + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( m_panel71, wxID_ANY, _("Compare by...") ), wxHORIZONTAL ); - m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); + wxBoxSizer* bSizer45; + bSizer45 = new wxBoxSizer( wxVERTICAL ); + + m_radioBtnSizeDate = new wxRadioButton( m_panel71, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtnSizeDate->SetValue( true ); m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time (UTC) and date\nare the same.") ); - sbSizer6->Add( m_radioBtnSizeDate, 0, wxRIGHT|wxLEFT, 5 ); + bSizer45->Add( m_radioBtnSizeDate, 0, 0, 5 ); - m_radioBtnContent = new wxRadioButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnContent = new wxRadioButton( m_panel71, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); - sbSizer6->Add( m_radioBtnContent, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer45->Add( m_radioBtnContent, 0, wxTOP, 5 ); + + sbSizer6->Add( bSizer45, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton14 = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer6->Add( m_bpButton14, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL, 2 ); + - bSizer6->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 ); + bSizer55->Add( 0, 4, 0, 0, 5 ); - m_bpButton14 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - bSizer6->Add( m_bpButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer6->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer6->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer56; + bSizer56 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer9; - sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Filter files") ), wxHORIZONTAL ); + sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( m_panel71, wxID_ANY, _("Filter files") ), wxHORIZONTAL ); - m_bpButtonFilter = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - sbSizer9->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + m_bpButtonFilter = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + sbSizer9->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); wxBoxSizer* bSizer23; bSizer23 = new wxBoxSizer( wxVERTICAL ); - m_hyperlinkCfgFilter = new wxHyperlinkCtrl( this, wxID_ANY, _("Configure Filter..."), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlinkCfgFilter = new wxHyperlinkCtrl( m_panel71, wxID_ANY, _("Configure filter..."), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlinkCfgFilter->SetNormalColour( wxColour( 0, 0, 255 ) ); m_hyperlinkCfgFilter->SetVisitedColour( wxColour( 0, 0, 255 ) ); - m_hyperlinkCfgFilter->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); + m_hyperlinkCfgFilter->SetBackgroundColour( wxColour( 128, 128, 150 ) ); bSizer23->Add( m_hyperlinkCfgFilter, 0, wxALL, 5 ); - m_checkBoxHideFilt = new wxCheckBox( this, wxID_ANY, _("Hide filtered items"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxHideFilt = new wxCheckBox( m_panel71, wxID_ANY, _("Hide filtered items"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxHideFilt->SetToolTip( _("Choose to hide filtered files/directories from list") ); bSizer23->Add( m_checkBoxHideFilt, 0, 0, 5 ); - sbSizer9->Add( bSizer23, 1, wxEXPAND, 5 ); + sbSizer9->Add( bSizer23, 0, 0, 5 ); + + bSizer56->Add( sbSizer9, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( sbSizer9, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButtonSync = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + bSizer56->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer6->Add( bSizer56, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSync = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); m_bpButtonSync->SetToolTip( _("Open synchronization dialog") ); m_bpButtonSync->SetToolTip( _("Open synchronization dialog") ); - bSizer6->Add( m_bpButtonSync, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer6->Add( m_bpButtonSync, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - bSizer6->Add( 40, 0, 0, wxEXPAND, 5 ); + bSizer6->Add( 40, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer1->Add( bSizer6, 0, wxEXPAND, 5 ); + m_panel71->SetSizer( bSizer6 ); + m_panel71->Layout(); + bSizer6->Fit( m_panel71 ); + bSizer1->Add( m_panel71, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); @@ -124,10 +190,10 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_panel1, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); m_directoryPanel1 = new wxTextCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer2->Add( m_directoryPanel1, 1, wxALIGN_BOTTOM, 5 ); + sbSizer2->Add( m_directoryPanel1, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_dirPicker1 = new wxDirPickerCtrl( m_panel1, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); - sbSizer2->Add( m_dirPicker1, 0, wxALIGN_BOTTOM, 5 ); + sbSizer2->Add( m_dirPicker1, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer7->Add( sbSizer2, 0, wxEXPAND, 5 ); @@ -179,16 +245,16 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit m_bpButtonSwap->SetToolTip( _("Swap sides") ); - bSizer18->Add( m_bpButtonSwap, 0, wxTOP|wxALIGN_CENTER_HORIZONTAL, 3 ); + bSizer18->Add( m_bpButtonSwap, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 3 ); - m_grid3 = new CustomGrid( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER ); + m_grid3 = new CustomGrid( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_grid3->CreateGrid( 15, 1 ); m_grid3->EnableEditing( false ); m_grid3->EnableGridLines( true ); m_grid3->EnableDragGridSize( false ); - m_grid3->SetMargins( 0, 50 ); + m_grid3->SetMargins( 0, 0 ); // Columns m_grid3->SetColSize( 0, 45 ); @@ -208,7 +274,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit // Cell Defaults m_grid3->SetDefaultCellFont( wxFont( 12, 74, 90, 92, false, wxT("Arial") ) ); m_grid3->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - bSizer18->Add( m_grid3, 1, wxBOTTOM|wxTOP|wxALIGN_CENTER_HORIZONTAL, 3 ); + bSizer18->Add( m_grid3, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); m_panel3->SetSizer( bSizer18 ); m_panel3->Layout(); @@ -223,10 +289,10 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panel2, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); m_directoryPanel2 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer3->Add( m_directoryPanel2, 1, wxALIGN_BOTTOM, 5 ); + sbSizer3->Add( m_directoryPanel2, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_dirPicker2 = new wxDirPickerCtrl( m_panel2, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); - sbSizer3->Add( m_dirPicker2, 0, wxALIGN_BOTTOM, 5 ); + sbSizer3->Add( m_dirPicker2, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer10->Add( sbSizer3, 0, wxEXPAND, 5 ); @@ -262,7 +328,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit // Cell Defaults m_grid2->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - bSizer10->Add( m_grid2, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer10->Add( m_grid2, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); m_panel2->SetSizer( bSizer10 ); m_panel2->Layout(); @@ -272,7 +338,6 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit bSizer1->Add( bSizer2, 1, wxEXPAND, 5 ); m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxHORIZONTAL ); m_bpButton11 = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); @@ -285,12 +350,18 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer58; + bSizer58 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer16; + sbSizer16 = new wxStaticBoxSizer( new wxStaticBox( m_panel4, wxID_ANY, _("Configuration") ), wxHORIZONTAL ); + m_bpButton201 = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); m_bpButton201->SetToolTip( _("Save current configuration to file") ); m_bpButton201->SetToolTip( _("Save current configuration to file") ); - bSizer3->Add( m_bpButton201, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( m_bpButton201, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); wxString m_choiceLoadChoices[] = { _("Load configuration...") }; int m_choiceLoadNChoices = sizeof( m_choiceLoadChoices ) / sizeof( wxString ); @@ -298,11 +369,20 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit m_choiceLoad->SetSelection( 0 ); m_choiceLoad->SetToolTip( _("Load configuration from file:\n - use this choice box\n - drag & drop config file to this window\n - specify config file as first commandline parameter") ); - bSizer3->Add( m_choiceLoad, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( m_choiceLoad, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer58->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer58->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer3->Add( bSizer58, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer59 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer31; sbSizer31 = new wxStaticBoxSizer( new wxStaticBox( m_panel4, wxID_ANY, _("Filter view") ), wxHORIZONTAL ); @@ -348,13 +428,18 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer31->Add( m_bpButton24, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer3->Add( sbSizer31, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer59->Add( sbSizer31, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer59->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer3->Add( bSizer59, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer3->Add( 190, 0, 0, wxALL, 5 ); + bSizer3->Add( 185, 0, 0, wxALL, 5 ); bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -371,16 +456,85 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit bSizer3->Fit( m_panel4 ); bSizer1->Add( m_panel4, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_panel7 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer451; + bSizer451 = new wxBoxSizer( wxHORIZONTAL ); + + bSizer451->SetMinSize( wxSize( -1,22 ) ); + wxBoxSizer* bSizer53; + bSizer53 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextStatusLeft = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusLeft->Wrap( -1 ); + bSizer53->Add( m_staticTextStatusLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer451->Add( bSizer53, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticline9 = new wxStaticLine( m_panel7, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer451->Add( m_staticline9, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxEXPAND, 2 ); + + + bSizer451->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextStatusMiddle = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusMiddle->Wrap( -1 ); + bSizer451->Add( m_staticTextStatusMiddle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer451->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline10 = new wxStaticLine( m_panel7, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer451->Add( m_staticline10, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP, 2 ); + + wxBoxSizer* bSizer52; + bSizer52 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer52->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextStatusRight = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusRight->Wrap( -1 ); + bSizer52->Add( m_staticTextStatusRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer50; + bSizer50 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer50->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap15 = new wxStaticBitmap( m_panel7, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 10,10 ), 0 ); + bSizer50->Add( m_bitmap15, 0, wxALIGN_BOTTOM, 2 ); + + bSizer52->Add( bSizer50, 1, wxALIGN_BOTTOM|wxEXPAND, 5 ); + + bSizer451->Add( bSizer52, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel7->SetSizer( bSizer451 ); + m_panel7->Layout(); + bSizer451->Fit( m_panel7 ); + bSizer1->Add( m_panel7, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + this->SetSizer( bSizer1 ); this->Layout(); - m_statusBar1 = this->CreateStatusBar( 3, wxST_SIZEGRIP, wxID_ANY ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GuiGenerated::OnClose ) ); + this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuQuit ) ); + 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_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 ); m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnAbortCompare ), NULL, this ); - m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); - m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); + m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByTimeSize ), NULL, this ); + m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByContent ), NULL, this ); m_bpButton14->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnShowHelpDialog ), NULL, this ); m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnFilterButton ), NULL, this ); m_hyperlinkCfgFilter->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( GuiGenerated::OnConfigureFilter ), NULL, this ); @@ -415,10 +569,16 @@ GuiGenerated::~GuiGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GuiGenerated::OnClose ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuQuit ) ); + 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::OnMenuBatchJob ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuAbout ) ); m_bpButtonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnCompare ), NULL, this ); m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnAbortCompare ), NULL, this ); - m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); - m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); + m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByTimeSize ), NULL, this ); + m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByContent ), NULL, this ); m_bpButton14->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnShowHelpDialog ), NULL, this ); m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnFilterButton ), NULL, this ); m_hyperlinkCfgFilter->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( GuiGenerated::OnConfigureFilter ), NULL, this ); @@ -454,7 +614,6 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, wxBoxSizer* bSizer40; bSizer40 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer42; bSizer42 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizer10; @@ -477,7 +636,6 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, 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 ); @@ -497,7 +655,6 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, 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 ); @@ -566,7 +723,7 @@ 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 ) +SyncDlgGenerated::SyncDlgGenerated( 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 ); @@ -576,15 +733,9 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer181; bSizer181 = new wxBoxSizer( wxHORIZONTAL ); - - bSizer181->Add( 5, 0, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer29; bSizer29 = new wxBoxSizer( wxVERTICAL ); - - bSizer29->Add( 0, 5, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer201; bSizer201 = new wxBoxSizer( wxHORIZONTAL ); @@ -594,48 +745,32 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButton18->SetToolTip( _("Start synchronization") ); - bSizer201->Add( m_bpButton18, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201->Add( m_bpButton18, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer201->Add( 10, 0, 0, wxEXPAND, 5 ); + bSizer201->Add( 18, 0, 0, wxEXPAND, 5 ); - wxGridSizer* gSizer1; - gSizer1 = new wxGridSizer( 2, 2, 0, 0 ); - - 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") ) ); - m_staticText37->SetToolTip( _("Number of files and directories that will be copied or deleted") ); - - gSizer1->Add( m_staticText37, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrl12 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 85,-1 ), wxTE_READONLY ); - m_textCtrl12->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) ); - m_textCtrl12->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + wxBoxSizer* bSizer38; + bSizer38 = new wxBoxSizer( wxVERTICAL ); - gSizer1->Add( m_textCtrl12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - 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") ) ); - m_staticText14->SetToolTip( _("Total amount of data that will be copied") ); + m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); - gSizer1->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer38->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_textCtrl5 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 55,-1 ), wxTE_READONLY ); - m_textCtrl5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_checkBoxContinueError = new wxCheckBox( this, wxID_ANY, _("Continue on error"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_textCtrl5, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_checkBoxContinueError->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); - bSizer201->Add( gSizer1, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer38->Add( m_checkBoxContinueError, 0, wxALL, 5 ); - bSizer29->Add( bSizer201, 0, wxEXPAND, 5 ); + bSizer201->Add( bSizer38, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer29->Add( bSizer201, 1, 0, 5 ); - bSizer29->Add( 0, 3, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer23; - bSizer23 = new wxBoxSizer( wxHORIZONTAL ); + bSizer29->Add( 0, 5, 0, 0, 5 ); wxStaticBoxSizer* sbSizer7; sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -647,65 +782,60 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const sbSizer7->Add( m_staticText1, 0, wxALL, 5 ); wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 3, 3, 0, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); + fgSizer1 = new wxFlexGridSizer( 3, 3, 8, 5 ); + fgSizer1->SetFlexibleDirection( wxHORIZONTAL ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_radioBtn1 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn1->SetValue( true ); m_radioBtn1->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_radioBtn1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_radioBtn1, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_buttonOneWay = new wxButton( this, wxID_ANY, _("One way ->"), wxDefaultPosition, wxSize( 130,-1 ), 0 ); m_buttonOneWay->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticText8 = new wxStaticText( this, wxID_ANY, _("Mirror backup of left folder: Right folder will be overwritten and exactly match left folder after synchronization."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText8->Wrap( 200 ); - fgSizer1->Add( m_staticText8, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText8->Wrap( 260 ); + fgSizer1->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_radioBtn2 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn2->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_radioBtn2, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_buttonTwoWay = new wxButton( this, wxID_ANY, _("Two way <->"), wxDefaultPosition, wxSize( 130,-1 ), 0 ); m_buttonTwoWay->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_buttonTwoWay, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_buttonTwoWay, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticText10 = new wxStaticText( this, wxID_ANY, _("Synchronize both sides simultaneously: Copy new or updated files in both directions."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText10->Wrap( 200 ); - fgSizer1->Add( m_staticText10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText10->Wrap( 250 ); + fgSizer1->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_radioBtn3 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn3->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_radioBtn3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_radioBtn3, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticText23 = new wxStaticText( this, wxID_ANY, _("Custom"), wxDefaultPosition, wxSize( 130,-1 ), wxALIGN_CENTRE|wxSTATIC_BORDER ); m_staticText23->Wrap( -1 ); m_staticText23->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_staticText9 = new wxStaticText( this, wxID_ANY, _("Configure your own synchronization rules."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( 200 ); - fgSizer1->Add( m_staticText9, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText9->Wrap( 250 ); + fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - sbSizer7->Add( fgSizer1, 1, wxEXPAND, 5 ); + sbSizer7->Add( fgSizer1, 0, 0, 5 ); - bSizer23->Add( sbSizer7, 0, wxEXPAND, 5 ); + bSizer29->Add( sbSizer7, 0, wxEXPAND, 5 ); - bSizer23->Add( 0, 0, 1, wxEXPAND, 5 ); - - bSizer29->Add( bSizer23, 0, wxEXPAND, 5 ); - - - bSizer29->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer29->Add( 0, 5, 0, 0, 5 ); wxBoxSizer* bSizer291; bSizer291 = new wxBoxSizer( wxHORIZONTAL ); @@ -713,188 +843,370 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const m_button6 = new wxButton( this, wxID_ANY, _("&Back"), wxDefaultPosition, wxSize( 100,32 ), 0 ); m_button6->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer291->Add( m_button6, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer291->Add( m_button6, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_button16 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,-1 ), 0 ); - bSizer291->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_button16 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); + bSizer291->Add( m_button16, 0, wxALIGN_BOTTOM, 5 ); - bSizer291->Add( 82, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer291->Add( 20, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer38; - bSizer38 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer16; + sbSizer16 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Preview") ), wxHORIZONTAL ); - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); + wxFlexGridSizer* fgSizer5; + fgSizer5 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); + 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") ); - bSizer38->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer5->Add( m_staticText37, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_checkBoxHideErrors = new wxCheckBox( this, wxID_ANY, _("Hide error messages"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlCreate = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreate->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlCreate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreate->SetToolTip( _("Number of files and directories that will be created") ); - m_checkBoxHideErrors->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); + fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer38->Add( m_checkBoxHideErrors, 0, wxALL, 5 ); + 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") ); - bSizer291->Add( bSizer38, 0, wxALIGN_BOTTOM|wxBOTTOM, 5 ); + fgSizer5->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer29->Add( bSizer291, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_textCtrlDelete = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDelete->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlDelete->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDelete->SetToolTip( _("Number of files and directories that will be deleted") ); - bSizer181->Add( bSizer29, 1, wxEXPAND, 5 ); + fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer30; - bSizer30 = new wxBoxSizer( wxVERTICAL ); + sbSizer16->Add( fgSizer5, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + wxFlexGridSizer* fgSizer6; + fgSizer6 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer6->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - bSizer30->Add( 0, 0, 1, wxEXPAND, 5 ); + m_staticText42 = new wxStaticText( this, wxID_ANY, _("Update:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText42->Wrap( -1 ); + m_staticText42->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_staticText42->SetToolTip( _("Number of files that will be overwritten") ); - wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration") ), wxVERTICAL ); + fgSizer6->Add( m_staticText42, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer21; - bSizer21 = new wxBoxSizer( wxHORIZONTAL ); + m_textCtrlUpdate = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdate->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlUpdate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdate->SetToolTip( _("Number of files that will be overwritten") ); - m_staticText2 = new wxStaticText( this, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText2->Wrap( -1 ); - m_staticText2->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + fgSizer6->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer21->Add( m_staticText2, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText43 = new wxStaticText( this, wxID_ANY, _("Data:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText43->Wrap( -1 ); + m_staticText43->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_staticText43->SetToolTip( _("Total amount of data that will be transferred") ); + fgSizer6->Add( m_staticText43, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer21->Add( 15, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + m_textCtrlData = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlData->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); - m_staticText3 = new wxStaticText( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText3->Wrap( -1 ); - m_staticText3->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer21->Add( m_staticText3, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( fgSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - sbSizer6->Add( bSizer21, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer291->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - sbSizer6->Add( m_staticline3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer29->Add( bSizer291, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer9; - bSizer9 = new wxBoxSizer( wxHORIZONTAL ); + bSizer181->Add( bSizer29, 0, 0, 5 ); - wxBoxSizer* bSizer20; - bSizer20 = new wxBoxSizer( wxVERTICAL ); + + bSizer181->Add( 10, 0, 0, 0, 5 ); + + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration") ), wxVERTICAL ); + + wxGridSizer* gSizer3; + gSizer3 = new wxGridSizer( 1, 2, 0, 5 ); + + m_staticText21 = new wxStaticText( this, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText21, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText31 = new wxStaticText( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText31->Wrap( -1 ); + m_staticText31->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText31, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer6->Add( gSizer3, 0, wxEXPAND, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizer6->Add( m_staticline3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 5, 2, 0, 5 ); m_bitmap13 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap13->SetToolTip( _("Folders/files that exist on left side only") ); + m_bitmap13->SetToolTip( _("Files/folders that exist on left side only") ); - bSizer20->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton5 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap14 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap14->SetToolTip( _("Folders/files that exist on right side only") ); + m_bitmap14->SetToolTip( _("Files/folders that exist on right side only") ); - bSizer20->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton6 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap15 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap15->SetToolTip( _("Files that exist on both sides, left one is newer") ); - bSizer20->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton7 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap16 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap16->SetToolTip( _("Files that exist on both sides, right one is newer") ); - bSizer20->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton8 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + 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") ); - bSizer20->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer9->Add( bSizer20, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButton9 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer6->Add( gSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - bSizer9->Add( 5, 0, 0, wxEXPAND, 5 ); + bSizer181->Add( sbSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 ); - wxBoxSizer* bSizer19; - bSizer19 = new wxBoxSizer( wxVERTICAL ); + bSizer7->Add( bSizer181, 0, wxALL, 5 ); - m_bpButton5 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + this->SetSizer( bSizer7 ); + this->Layout(); + bSizer7->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); + m_bpButton18->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnStartSync ), NULL, this ); + m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_radioBtn1->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtn2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_buttonTwoWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncCostum ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnBack ), NULL, this ); + m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnCancel ), NULL, this ); + m_bpButton5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButton6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); +} + +SyncDlgGenerated::~SyncDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); + m_bpButton18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnStartSync ), NULL, this ); + m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_radioBtn1->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtn2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_buttonTwoWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncCostum ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnBack ), NULL, this ); + m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnCancel ), NULL, this ); + m_bpButton5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButton6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); +} + +SyncStatusDlgGenerated::SyncStatusDlgGenerated( 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 ); + wxBoxSizer* bSizer27; + bSizer27 = new wxBoxSizer( wxVERTICAL ); - bSizer19->Add( 0, 5, 0, wxEXPAND, 5 ); - m_bpButton6 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton6, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer27->Add( 0, 15, 0, wxEXPAND, 5 ); + wxBoxSizer* bSizer37; + bSizer37 = new wxBoxSizer( wxHORIZONTAL ); - bSizer19->Add( 0, 5, 1, wxEXPAND, 5 ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); - m_bpButton7 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Synchronization status"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer19->Add( 0, 5, 1, wxEXPAND, 5 ); + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - m_bpButton8 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton8, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer37->Add( m_panel8, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 )); + bSizer37->Add( m_animationControl1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer19->Add( 0, 5, 1, wxEXPAND, 5 ); + bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bpButton9 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton9, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + wxBoxSizer* bSizer42; + bSizer42 = new wxBoxSizer( wxHORIZONTAL ); - bSizer9->Add( bSizer19, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer9->Add( 5, 0, 0, wxEXPAND, 5 ); + m_bitmapStatus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 28,28 ), 0 ); + bSizer42->Add( m_bitmapStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - sbSizer6->Add( bSizer9, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + 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") ) ); - bSizer30->Add( sbSizer6, 0, wxALIGN_RIGHT|wxBOTTOM, 5 ); + bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - bSizer181->Add( bSizer30, 0, wxEXPAND|wxALIGN_BOTTOM, 5 ); + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer181->Add( 5, 0, 0, wxEXPAND, 5 ); + bSizer27->Add( bSizer42, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer7->Add( bSizer181, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer31; + bSizer31 = new wxBoxSizer( wxHORIZONTAL ); - this->SetSizer( bSizer7 ); + m_staticText21 = new wxStaticText( this, wxID_ANY, _("Current operation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer31->Add( m_staticText21, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + + bSizer27->Add( bSizer31, 0, wxEXPAND, 5 ); + + m_textCtrlInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); + m_textCtrlInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer27->Add( m_textCtrlInfo, 3, wxALL|wxEXPAND, 5 ); + + m_gauge1 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); + bSizer27->Add( m_gauge1, 0, wxALL|wxEXPAND, 5 ); + + bSizer28 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer32; + bSizer32 = new wxBoxSizer( wxHORIZONTAL ); + + 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_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_staticTextDataRemaining, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer28->Add( bSizer32, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer28->Add( 0, 0, 1, 0, 5 ); + + m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonOK->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_buttonOK->Hide(); + + bSizer28->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonPause = new wxButton( this, wxID_ANY, _("&Pause"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonPause->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer28->Add( m_buttonPause, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonAbort->SetDefault(); + m_buttonAbort->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer28->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer28->Add( 0, 0, 1, 0, 5 ); + + wxBoxSizer* bSizer33; + bSizer33 = new wxBoxSizer( wxHORIZONTAL ); + + 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, _("0000000"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextRemainingObj->Wrap( -1 ); + m_staticTextRemainingObj->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer33->Add( m_staticTextRemainingObj, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer28->Add( bSizer33, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + + bSizer27->Add( 0, 5, 0, wxEXPAND, 5 ); + + this->SetSizer( bSizer27 ); this->Layout(); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDialogGenerated::OnClose ) ); - m_bpButton18->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnStartSync ), NULL, this ); - m_radioBtn1->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtn2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_buttonTwoWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncCostum ), NULL, this ); - m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnBack ), NULL, this ); - m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnCancel ), NULL, this ); - m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSelectRecycleBin ), NULL, this ); - m_bpButton5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButton6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButton7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnLeftNewer ), NULL, this ); - m_bpButton8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnRightNewer ), NULL, this ); - m_bpButton9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnDifferent ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnOkay ), NULL, this ); + m_buttonPause->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnPause ), NULL, this ); + m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnAbort ), NULL, this ); } -SyncDialogGenerated::~SyncDialogGenerated() +SyncStatusDlgGenerated::~SyncStatusDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDialogGenerated::OnClose ) ); - m_bpButton18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnStartSync ), NULL, this ); - m_radioBtn1->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtn2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_buttonTwoWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncCostum ), NULL, this ); - m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnBack ), NULL, this ); - m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnCancel ), NULL, this ); - m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSelectRecycleBin ), NULL, this ); - m_bpButton5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButton6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButton7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnLeftNewer ), NULL, this ); - m_bpButton8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnRightNewer ), NULL, this ); - m_bpButton9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnDifferent ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnOkay ), NULL, this ); + m_buttonPause->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnPause ), NULL, this ); + m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnAbort ), NULL, this ); } HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -907,11 +1219,28 @@ HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr bSizer20->Add( 0, 10, 0, wxEXPAND, 5 ); - m_staticText12 = new wxStaticText( this, wxID_ANY, _("Help"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText12->Wrap( -1 ); - m_staticText12->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer72->Add( 20, 0, 0, 0, 5 ); + + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - bSizer20->Add( m_staticText12, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + bSizer72->Add( 20, 0, 0, 0, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer20->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizer20->Add( 0, 5, 0, wxEXPAND, 5 ); @@ -950,7 +1279,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31 = new wxBoxSizer( wxVERTICAL ); - bSizer31->Add( 0, 10, 0, wxEXPAND, 5 ); + bSizer31->Add( 0, 5, 0, 0, 5 ); m_panel5 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); m_panel5->SetBackgroundColour( wxColour( 255, 255, 255 ) ); @@ -958,25 +1287,13 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer36; bSizer36 = new wxBoxSizer( wxHORIZONTAL ); - m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 277,55 ), 0 ); + m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 404,55 ), 0 ); bSizer36->Add( m_bitmap11, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer36->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText39 = new wxStaticText( m_panel5, wxID_ANY, _("FreeFileSync v1.5"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText39->Wrap( -1 ); - m_staticText39->SetFont( wxFont( 18, 74, 90, 92, false, wxT("Tahoma") ) ); - - bSizer36->Add( m_staticText39, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer36->Add( 50, 0, 0, wxEXPAND, 5 ); - m_panel5->SetSizer( bSizer36 ); m_panel5->Layout(); bSizer36->Fit( m_panel5 ); - bSizer31->Add( m_panel5, 0, wxALL|wxEXPAND, 5 ); + bSizer31->Add( m_panel5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticText15 = new wxStaticText( this, wxID_ANY, _("-Open-Source file synchronization-"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText15->Wrap( -1 ); @@ -988,15 +1305,24 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_build->Wrap( -1 ); m_build->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer31->Add( m_build, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer31->Add( m_build, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer31->Add( 0, 10, 0, 0, 5 ); - bSizer31->Add( 0, 10, 0, wxEXPAND, 5 ); + wxBoxSizer* bSizer53; + bSizer53 = new wxBoxSizer( wxVERTICAL ); - 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( 350,-1 ), wxTE_MULTILINE|wxTE_NO_VSCROLL|wxTE_READONLY|wxDOUBLE_BORDER ); + wxTextCtrl* m_textCtrl3; + 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 ) ); - bSizer31->Add( m_textCtrl3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 0 ); + bSizer53->Add( m_textCtrl3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + bSizer31->Add( bSizer53, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 30 ); + + + bSizer31->Add( 0, 7, 0, 0, 5 ); wxStaticBoxSizer* sbSizer7; sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -1010,11 +1336,11 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS 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, wxALL|wxEXPAND, 5 ); + bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxFlexGridSizer* fgSizer2; fgSizer2 = new wxFlexGridSizer( 3, 3, 0, 0 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetFlexibleDirection( wxHORIZONTAL ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); @@ -1043,7 +1369,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_hyperlink2 = new wxHyperlinkCtrl( this, wxID_ANY, _("zhnmju123@gmx.de"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); fgSizer2->Add( m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 48,48 )); + m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation); + m_animationControl1->Hide(); + fgSizer2->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_staticText151 = new wxStaticText( this, wxID_ANY, _("If you like FFS:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -1058,13 +1386,13 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31->Add( fgSizer2, 0, wxLEFT|wxEXPAND, 10 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer31->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); + bSizer31->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxStaticBoxSizer* sbSizer14; sbSizer14 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Published under the GNU General Public License:") ), wxHORIZONTAL ); - sbSizer14->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap13 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 88,31 ), 0 ); sbSizer14->Add( m_bitmap13, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -1073,9 +1401,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer14->Add( m_hyperlink5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - sbSizer14->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer31->Add( sbSizer14, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer31->Add( sbSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_button8 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); m_button8->SetDefault(); @@ -1085,6 +1413,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS this->SetSizer( bSizer31 ); this->Layout(); + bSizer31->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); @@ -1124,9 +1455,11 @@ ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - m_checkBoxSuppress = new wxCheckBox( this, wxID_ANY, _("Hide further messages during current process"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxContinueError = new wxCheckBox( this, wxID_ANY, _("Continue on next errors"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer24->Add( m_checkBoxSuppress, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_checkBoxContinueError->SetToolTip( _("Hide further error messages during the current process and continue") ); + + bSizer24->Add( m_checkBoxContinueError, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); @@ -1134,18 +1467,18 @@ ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer25; bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonContinue = new wxButton( this, wxID_OK, _("&Continue"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonContinue = new wxButton( this, wxID_OK, _("&Continue"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonContinue->SetDefault(); m_buttonContinue->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonContinue, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonRetry->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonRetry, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonAbort->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonAbort, 0, wxALL, 5 ); @@ -1171,7 +1504,7 @@ ErrorDlgGenerated::~ErrorDlgGenerated() m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnAbort ), NULL, this ); } -DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DeleteDlgGenerated::DeleteDlgGenerated( 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 ); @@ -1209,13 +1542,13 @@ DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, c wxBoxSizer* bSizer25; bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonOK->SetDefault(); - m_buttonOK->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_buttonOK->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonOK, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonCancel->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonCancel, 0, wxALL, 5 ); @@ -1226,17 +1559,17 @@ DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, c this->Layout(); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDialogGenerated::OnClose ) ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnOK ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnCancel ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); } -DeleteDialogGenerated::~DeleteDialogGenerated() +DeleteDlgGenerated::~DeleteDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDialogGenerated::OnClose ) ); - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnOK ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnCancel ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); + m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); } FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -1246,18 +1579,44 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer21; bSizer21 = new wxBoxSizer( wxVERTICAL ); - m_staticText17 = new wxStaticText( this, wxID_ANY, _("Set filter for synchronization"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText17->Wrap( -1 ); - m_staticText17->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); + + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Set filter for synchronization"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer21->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10 ); + + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be selected for synchronization."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText44->Wrap( -1 ); + bSizer21->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer21->Add( m_staticText17, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 ); + bSizer21->Add( 0, 10, 0, 0, 5 ); - bSizer21->Add( 0, 0, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer52; + bSizer52 = new wxBoxSizer( wxVERTICAL ); - m_staticText18 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be relevant for synchronization.\n\n1. Enter full file or directory names separated by ';'.\n2. Wildcard characters '*' and '?' are supported.\n3. Case sensitive expressions!\n\nExample: *.tmp;C:\\data\\dummy.log;*filename*;*directory*"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText45 = new wxStaticText( this, wxID_ANY, _("Hints:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText45->Wrap( -1 ); + m_staticText45->SetFont( wxFont( 10, 74, 90, 92, true, wxT("Tahoma") ) ); + + bSizer52->Add( m_staticText45, 0, wxBOTTOM, 5 ); + + m_staticText18 = new wxStaticText( this, wxID_ANY, _("1. Enter full file or directory names separated by ';'.\n2. Wildcard characters '*' and '?' are supported.\n3. Case sensitive expressions!\n\nExample: *.tmp;*\\filename.dat;*\\directory\\*"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText18->Wrap( -1 ); - bSizer21->Add( m_staticText18, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer52->Add( m_staticText18, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer21->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); wxStaticBoxSizer* sbSizer8; sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -1309,12 +1668,12 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer21->Add( sbSizer8, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer21->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer21->Add( 0, 0, 0, 0, 5 ); wxBoxSizer* bSizer22; bSizer22 = new wxBoxSizer( wxHORIZONTAL ); - m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button9->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer22->Add( m_button9, 0, wxALL, 5 ); @@ -1322,12 +1681,12 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer22->Add( 0, 0, 1, wxEXPAND, 5 ); - m_button17 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,-1 ), 0 ); - bSizer22->Add( m_button17, 0, wxALL, 5 ); + m_button17 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); + bSizer22->Add( m_button17, 0, wxALIGN_BOTTOM, 5 ); - m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button10->SetDefault(); - m_button10->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_button10->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); bSizer22->Add( m_button10, 0, wxALL, 5 ); @@ -1335,6 +1694,9 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w this->SetSizer( bSizer21 ); this->Layout(); + bSizer21->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( FilterDlgGenerated::OnClose ) ); @@ -1352,145 +1714,336 @@ FilterDlgGenerated::~FilterDlgGenerated() m_button10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnOK ), NULL, this ); } -SyncStatusGenerated::SyncStatusGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +BatchDlgGenerated::BatchDlgGenerated( 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 ); - wxBoxSizer* bSizer27; - bSizer27 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer54; + bSizer54 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer69; + bSizer69 = new wxBoxSizer( wxVERTICAL ); - bSizer27->Add( 0, 15, 0, wxEXPAND, 5 ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); - wxBoxSizer* bSizer37; - bSizer37 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); - m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 )); - bSizer37->Add( m_animationControl1, 0, wxALL, 5 ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Create a batch job"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); - 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") ) ); + bSizer72->Add( m_staticText56, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer37->Add( m_staticText20, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer69->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - wxBoxSizer* bSizer42; - bSizer42 = new wxBoxSizer( wxHORIZONTAL ); + bSizer69->Add( 0, 5, 0, 0, 5 ); + m_staticText54 = new wxStaticText( this, wxID_ANY, _("Assemble a batch file with the following settings. To start synchronization in batch mode simply execute this file or schedule it in your operating system's task planner."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText54->Wrap( 380 ); + m_staticText54->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Tahoma") ) ); - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer69->Add( m_staticText54, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bitmapStatus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 28,28 ), 0 ); - bSizer42->Add( m_bitmapStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - 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") ) ); + bSizer69->Add( 0, 5, 0, 0, 5 ); - bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer69->Add( m_staticline10, 0, wxEXPAND|wxTOP, 5 ); + m_staticText531 = new wxStaticText( this, wxID_ANY, _("Configuration overview:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText531->Wrap( -1 ); + m_staticText531->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Arial Black") ) ); - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer69->Add( m_staticText531, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer27->Add( bSizer42, 0, wxEXPAND, 5 ); + wxStaticBoxSizer* sbSizer20; + sbSizer20 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); - wxBoxSizer* bSizer31; - bSizer31 = new wxBoxSizer( wxHORIZONTAL ); + wxFlexGridSizer* fgSizer9; + fgSizer9 = new wxFlexGridSizer( 2, 2, 5, 5 ); + fgSizer9->AddGrowableCol( 1 ); + fgSizer9->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticText21 = new wxStaticText( this, wxID_ANY, _("Current operation:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText21->Wrap( -1 ); - m_staticText21->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_staticText53 = new wxStaticText( this, wxID_ANY, _("Left folder:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText53->Wrap( -1 ); + m_staticText53->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer31->Add( m_staticText21, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer9->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_directoryPanel1 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer9->Add( m_directoryPanel1, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + m_staticText541 = new wxStaticText( this, wxID_ANY, _("Right folder:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText541->Wrap( -1 ); + m_staticText541->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer27->Add( bSizer31, 0, wxEXPAND, 5 ); + fgSizer9->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_textCtrlInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrlInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_directoryPanel2 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer9->Add( m_directoryPanel2, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer27->Add( m_textCtrlInfo, 3, wxALL|wxEXPAND, 5 ); + sbSizer20->Add( fgSizer9, 0, wxEXPAND, 5 ); - m_gauge1 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); - bSizer27->Add( m_gauge1, 0, wxALL|wxEXPAND, 5 ); + bSizer69->Add( sbSizer20, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizer28; - bSizer28 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer67; + bSizer67 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer32; - bSizer32 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer57; + bSizer57 = new wxBoxSizer( wxVERTICAL ); - 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") ) ); + wxBoxSizer* bSizer71; + bSizer71 = new wxBoxSizer( wxHORIZONTAL ); - bSizer32->Add( m_staticText26, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + wxBoxSizer* bSizer721; + bSizer721 = new wxBoxSizer( wxVERTICAL ); - 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") ) ); + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by...") ), wxVERTICAL ); - bSizer32->Add( m_staticTextDataRemaining, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnSizeDate->SetValue( true ); + m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time (UTC) and date\nare the same.") ); - bSizer28->Add( bSizer32, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer6->Add( m_radioBtnSizeDate, 0, 0, 5 ); + m_radioBtnContent = new wxRadioButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); - bSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer6->Add( m_radioBtnContent, 0, wxTOP, 5 ); - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonOK->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - m_buttonOK->Hide(); + bSizer721->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer28->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonAbort->SetDefault(); - m_buttonAbort->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + bSizer721->Add( 0, 10, 1, 0, 5 ); + + wxBoxSizer* bSizer38; + bSizer38 = new wxBoxSizer( wxVERTICAL ); - bSizer28->Add( m_buttonAbort, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + 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") ); - bSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer38->Add( m_checkBoxUseRecycler, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - wxBoxSizer* bSizer33; - bSizer33 = new wxBoxSizer( wxHORIZONTAL ); + m_checkBoxContinueError = new wxCheckBox( this, wxID_ANY, _("Continue on error"), wxDefaultPosition, wxDefaultSize, 0 ); - 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") ) ); + m_checkBoxContinueError->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); - bSizer33->Add( m_staticText25, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer38->Add( m_checkBoxContinueError, 0, wxALL, 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") ) ); + m_checkBoxSilent = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer33->Add( m_staticTextRemainingObj, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxSilent->SetToolTip( _("Do not show graphical status and error messages but write to a logfile instead") ); - bSizer28->Add( bSizer33, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer38->Add( m_checkBoxSilent, 0, wxALL, 5 ); - bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer721->Add( bSizer38, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer27->Add( 0, 5, 0, wxEXPAND, 5 ); + bSizer721->Add( 0, 10, 1, 0, 5 ); - this->SetSizer( bSizer27 ); + bSizer71->Add( bSizer721, 0, wxEXPAND, 5 ); + + + bSizer71->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonFilter = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + bSizer71->Add( m_bpButtonFilter, 0, wxALIGN_BOTTOM|wxRIGHT, 5 ); + + bSizer57->Add( bSizer71, 0, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer8; + sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + + wxBoxSizer* bSizer671; + bSizer671 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer681; + bSizer681 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap8 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + bSizer681->Add( m_bitmap8, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText15 = new wxStaticText( this, wxID_ANY, _("Include"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText15->Wrap( -1 ); + m_staticText15->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer681->Add( m_staticText15, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer671->Add( bSizer681, 1, wxEXPAND, 5 ); + + m_textCtrlInclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 250,-1 ), 0 ); + bSizer671->Add( m_textCtrlInclude, 0, wxALL, 5 ); + + sbSizer8->Add( bSizer671, 0, 0, 5 ); + + + sbSizer8->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer691; + bSizer691 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer70; + bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + bSizer70->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText16 = new wxStaticText( this, wxID_ANY, _("Exclude"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText16->Wrap( -1 ); + m_staticText16->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer70->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer691->Add( bSizer70, 1, wxEXPAND, 5 ); + + m_textCtrlExclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 250,-1 ), 0 ); + bSizer691->Add( m_textCtrlExclude, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer8->Add( bSizer691, 0, 0, 5 ); + + bSizer57->Add( sbSizer8, 0, 0, 5 ); + + bSizer67->Add( bSizer57, 0, 0, 5 ); + + + bSizer67->Add( 10, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxStaticBoxSizer* sbSizer61; + sbSizer61 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration") ), wxVERTICAL ); + + wxGridSizer* gSizer3; + gSizer3 = new wxGridSizer( 1, 2, 0, 5 ); + + m_staticText211 = new wxStaticText( this, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText211->Wrap( -1 ); + m_staticText211->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText211, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText311 = new wxStaticText( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText311->Wrap( -1 ); + m_staticText311->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText311, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer61->Add( gSizer3, 0, wxEXPAND, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizer61->Add( m_staticline3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 5, 2, 0, 5 ); + + m_bitmap13 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap13->SetToolTip( _("Files/folders that exist on left side only") ); + + gSizer1->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton5 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap14 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap14->SetToolTip( _("Files/folders that exist on right side only") ); + + gSizer1->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton6 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap15 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap15->SetToolTip( _("Files that exist on both sides, left one is newer") ); + + gSizer1->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton7 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap16 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap16->SetToolTip( _("Files that exist on both sides, right one is newer") ); + + gSizer1->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton8 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + 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") ); + + gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton9 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer61->Add( gSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + bSizer67->Add( sbSizer61, 0, 0, 5 ); + + bSizer69->Add( bSizer67, 0, wxALL, 5 ); + + m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer69->Add( m_staticline9, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer68; + bSizer68 = new wxBoxSizer( wxHORIZONTAL ); + + m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button6->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer68->Add( m_button6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonCreate = new wxButton( this, wxID_ANY, _("&Create"), wxDefaultPosition, wxSize( 120,35 ), 0 ); + m_buttonCreate->SetDefault(); + m_buttonCreate->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer68->Add( m_buttonCreate, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer69->Add( bSizer68, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer54->Add( bSizer69, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer54 ); this->Layout(); + bSizer54->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusGenerated::OnClose ) ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnOkay ), NULL, this ); - m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnAbort ), NULL, this ); + 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_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 ); + m_bpButton6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnDifferent ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); + m_buttonCreate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCreateJob ), NULL, this ); } -SyncStatusGenerated::~SyncStatusGenerated() +BatchDlgGenerated::~BatchDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusGenerated::OnClose ) ); - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnOkay ), NULL, this ); - m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnAbort ), NULL, this ); + 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_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 ); + m_bpButton6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnDifferent ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); + m_buttonCreate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCreateJob ), NULL, this ); } diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h index 30376834..de725c92 100644 --- a/ui/guiGenerated.h +++ b/ui/guiGenerated.h @@ -12,32 +12,32 @@ class CustomGrid; +#include <wx/string.h> #include <wx/bitmap.h> #include <wx/image.h> #include <wx/icon.h> -#include <wx/bmpbuttn.h> +#include <wx/menu.h> #include <wx/gdicmn.h> #include <wx/font.h> #include <wx/colour.h> #include <wx/settings.h> -#include <wx/string.h> +#include <wx/bmpbuttn.h> #include <wx/button.h> #include <wx/sizer.h> #include <wx/radiobut.h> #include <wx/statbox.h> #include <wx/hyperlink.h> #include <wx/checkbox.h> +#include <wx/panel.h> #include <wx/textctrl.h> #include <wx/filepicker.h> #include <wx/grid.h> -#include <wx/panel.h> #include <wx/choice.h> -#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/frame.h> +#include <wx/gauge.h> #include <wx/dialog.h> #include <wx/animate.h> @@ -52,7 +52,16 @@ class GuiGenerated : public wxFrame private: protected: + wxMenuBar* m_menubar1; + wxMenu* m_menu1; + wxMenu* m_menu3; + wxMenu* m_menu31; + wxMenuItem* m_menuItemEnglish; + wxMenuItem* m_menuItemGerman; + wxMenu* m_menu2; wxBoxSizer* bSizer1; + wxPanel* m_panel71; + wxBoxSizer* bSizer6; wxBitmapButton* m_bpButtonCompare; wxButton* m_buttonAbort; @@ -60,9 +69,11 @@ class GuiGenerated : public wxFrame wxRadioButton* m_radioBtnContent; wxBitmapButton* m_bpButton14; + wxBitmapButton* m_bpButtonFilter; wxHyperlinkCtrl* m_hyperlinkCfgFilter; wxCheckBox* m_checkBoxHideFilt; + wxBitmapButton* m_bpButtonSync; wxPanel* m_panel1; @@ -77,11 +88,14 @@ class GuiGenerated : public wxFrame wxDirPickerCtrl* m_dirPicker2; CustomGrid* m_grid2; wxPanel* m_panel4; + wxBoxSizer* bSizer3; wxBitmapButton* m_bpButton11; wxBitmapButton* m_bpButton201; wxChoice* m_choiceLoad; + + wxBoxSizer* bSizer59; wxBitmapButton* m_bpButton20; wxBitmapButton* m_bpButton21; wxBitmapButton* m_bpButton25; @@ -91,14 +105,34 @@ class GuiGenerated : public wxFrame + wxBitmapButton* m_bpButton10; - wxStatusBar* m_statusBar1; + wxPanel* m_panel7; + + wxStaticText* m_staticTextStatusLeft; + + wxStaticLine* m_staticline9; + + wxStaticText* m_staticTextStatusMiddle; + + wxStaticLine* m_staticline10; + + wxStaticText* m_staticTextStatusRight; + + wxStaticBitmap* m_bitmap15; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnMenuQuit( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuExportFileList( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangEnglish( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangGerman( 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(); } virtual void OnAbortCompare( wxCommandEvent& event ){ event.Skip(); } - virtual void OnChangeCompareVariant( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCompareByTimeSize( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCompareByContent( wxCommandEvent& event ){ event.Skip(); } virtual void OnShowHelpDialog( wxCommandEvent& event ){ event.Skip(); } virtual void OnFilterButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnConfigureFilter( wxHyperlinkEvent& event ){ event.Skip(); } @@ -141,12 +175,15 @@ class CompareStatusGenerated : public wxPanel private: protected: + wxBoxSizer* bSizer42; wxStaticText* m_staticText321; wxStaticText* m_staticTextScanned; + wxStaticBoxSizer* sbSizer13; wxStaticText* m_staticText46; wxStaticText* m_staticTextFilesToCompare; + wxStaticBoxSizer* sbSizer11; wxStaticText* m_staticText32; wxStaticText* m_staticTextDataToCompare; @@ -163,21 +200,17 @@ class CompareStatusGenerated : public wxPanel }; /////////////////////////////////////////////////////////////////////////////// -/// Class SyncDialogGenerated +/// Class SyncDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncDialogGenerated : public wxDialog +class SyncDlgGenerated : public wxDialog { private: protected: - - wxBitmapButton* m_bpButton18; - wxStaticText* m_staticText37; - wxTextCtrl* m_textCtrl12; - wxStaticText* m_staticText14; - wxTextCtrl* m_textCtrl5; + wxCheckBox* m_checkBoxUseRecycler; + wxCheckBox* m_checkBoxContinueError; wxStaticText* m_staticText1; wxRadioButton* m_radioBtn1; @@ -190,44 +223,41 @@ class SyncDialogGenerated : public wxDialog wxStaticText* m_staticText23; wxStaticText* m_staticText9; - wxButton* m_button6; wxButton* m_button16; - wxCheckBox* m_checkBoxUseRecycler; - wxCheckBox* m_checkBoxHideErrors; - - wxStaticText* m_staticText2; + wxStaticText* m_staticText37; + wxTextCtrl* m_textCtrlCreate; + wxStaticText* m_staticText14; + wxTextCtrl* m_textCtrlDelete; + wxStaticText* m_staticText42; + wxTextCtrl* m_textCtrlUpdate; + wxStaticText* m_staticText43; + wxTextCtrl* m_textCtrlData; - wxStaticText* m_staticText3; + wxStaticText* m_staticText21; + wxStaticText* m_staticText31; wxStaticLine* m_staticline3; wxStaticBitmap* m_bitmap13; - wxStaticBitmap* m_bitmap14; - wxStaticBitmap* m_bitmap15; - wxStaticBitmap* m_bitmap16; - wxStaticBitmap* m_bitmap17; - wxBitmapButton* m_bpButton5; - + wxStaticBitmap* m_bitmap14; wxBitmapButton* m_bpButton6; - + wxStaticBitmap* m_bitmap15; wxBitmapButton* m_bpButton7; - + wxStaticBitmap* m_bitmap16; wxBitmapButton* m_bpButton8; - + wxStaticBitmap* m_bitmap17; wxBitmapButton* m_bpButton9; - - // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } virtual void OnStartSync( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncLeftToRight( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncBothSides( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncCostum( wxCommandEvent& event ){ event.Skip(); } virtual void OnBack( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnExRightSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftNewer( wxCommandEvent& event ){ event.Skip(); } @@ -236,8 +266,53 @@ 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( 523,356 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~SyncDialogGenerated(); + SyncDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~SyncDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SyncStatusDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class SyncStatusDlgGenerated : public wxDialog +{ + private: + + protected: + + wxPanel* m_panel8; + wxStaticText* m_staticText56; + wxAnimationCtrl* m_animationControl1; + + wxStaticBitmap* m_bitmapStatus; + wxStaticText* m_staticTextStatus; + + wxStaticText* m_staticText21; + + wxTextCtrl* m_textCtrlInfo; + wxBoxSizer* bSizer28; + wxStaticText* m_staticText26; + wxStaticText* m_staticTextDataRemaining; + + wxButton* m_buttonOK; + wxButton* m_buttonPause; + wxButton* m_buttonAbort; + + wxStaticText* m_staticText25; + wxStaticText* m_staticTextRemainingObj; + + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnPause( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAbort( wxCommandEvent& event ){ event.Skip(); } + + + public: + wxGauge* m_gauge1; + SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 614,371 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~SyncStatusDlgGenerated(); }; @@ -250,7 +325,10 @@ class HelpDlgGenerated : public wxDialog protected: - wxStaticText* m_staticText12; + wxPanel* m_panel8; + + wxStaticText* m_staticText56; + wxTextCtrl* m_textCtrl8; wxButton* m_button8; @@ -277,13 +355,10 @@ class AboutDlgGenerated : public wxDialog wxPanel* m_panel5; wxStaticBitmap* m_bitmap11; - - wxStaticText* m_staticText39; - wxStaticText* m_staticText15; wxStaticText* m_build; - wxTextCtrl* m_textCtrl3; + wxStaticText* m_staticText131; wxStaticLine* m_staticline3; wxStaticBitmap* m_bitmap9; @@ -308,7 +383,7 @@ class AboutDlgGenerated : public wxDialog public: - AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 422,603 ), long style = wxDEFAULT_DIALOG_STYLE ); + AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~AboutDlgGenerated(); }; @@ -325,7 +400,7 @@ class ErrorDlgGenerated : public wxDialog wxStaticBitmap* m_bitmap10; wxTextCtrl* m_textCtrl8; - wxCheckBox* m_checkBoxSuppress; + wxCheckBox* m_checkBoxContinueError; wxButton* m_buttonContinue; wxButton* m_buttonRetry; @@ -339,15 +414,15 @@ class ErrorDlgGenerated : public wxDialog public: - ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("An error occured"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 411,266 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("An error occured"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 445,293 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~ErrorDlgGenerated(); }; /////////////////////////////////////////////////////////////////////////////// -/// Class DeleteDialogGenerated +/// Class DeleteDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class DeleteDialogGenerated : public wxDialog +class DeleteDlgGenerated : public wxDialog { private: @@ -368,8 +443,8 @@ class DeleteDialogGenerated : public wxDialog public: - DeleteDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DeleteDialogGenerated(); + DeleteDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DeleteDlgGenerated(); }; @@ -381,8 +456,11 @@ class FilterDlgGenerated : public wxDialog private: protected: - wxStaticText* m_staticText17; + wxPanel* m_panel8; + wxStaticText* m_staticText56; + wxStaticText* m_staticText44; + wxStaticText* m_staticText45; wxStaticText* m_staticText18; wxStaticText* m_staticText15; @@ -406,49 +484,82 @@ class FilterDlgGenerated : public wxDialog public: - FilterDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure filter settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 472,367 ), long style = wxDEFAULT_DIALOG_STYLE ); + FilterDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure filter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~FilterDlgGenerated(); }; /////////////////////////////////////////////////////////////////////////////// -/// Class SyncStatusGenerated +/// Class BatchDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncStatusGenerated : public wxDialog +class BatchDlgGenerated : public wxDialog { private: protected: + wxPanel* m_panel8; + wxStaticText* m_staticText56; - wxAnimationCtrl* m_animationControl1; - wxStaticText* m_staticText20; + wxStaticText* m_staticText54; - wxStaticBitmap* m_bitmapStatus; - wxStaticText* m_staticTextStatus; + wxStaticLine* m_staticline10; + wxStaticText* m_staticText531; + wxStaticText* m_staticText53; + wxTextCtrl* m_directoryPanel1; + wxStaticText* m_staticText541; + wxTextCtrl* m_directoryPanel2; + wxRadioButton* m_radioBtnSizeDate; + wxRadioButton* m_radioBtnContent; - wxStaticText* m_staticText21; + wxCheckBox* m_checkBoxUseRecycler; + wxCheckBox* m_checkBoxContinueError; + wxCheckBox* m_checkBoxSilent; - wxTextCtrl* m_textCtrlInfo; - wxStaticText* m_staticText26; - wxStaticText* m_staticTextDataRemaining; + wxBitmapButton* m_bpButtonFilter; + wxStaticBitmap* m_bitmap8; + wxStaticText* m_staticText15; + wxTextCtrl* m_textCtrlInclude; - wxStaticText* m_staticText25; - wxStaticText* m_staticTextRemainingObj; + wxStaticBitmap* m_bitmap9; + wxStaticText* m_staticText16; + wxTextCtrl* m_textCtrlExclude; + wxStaticText* m_staticText211; + wxStaticText* m_staticText311; + wxStaticLine* m_staticline3; + wxStaticBitmap* m_bitmap13; + wxBitmapButton* m_bpButton5; + wxStaticBitmap* m_bitmap14; + wxBitmapButton* m_bpButton6; + wxStaticBitmap* m_bitmap15; + wxBitmapButton* m_bpButton7; + wxStaticBitmap* m_bitmap16; + wxBitmapButton* m_bpButton8; + wxStaticBitmap* m_bitmap17; + wxBitmapButton* m_bpButton9; + wxStaticLine* m_staticline9; + wxButton* m_button6; + wxButton* m_buttonCreate; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } - virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } - virtual void OnAbort( wxCommandEvent& event ){ event.Skip(); } + virtual void OnEnterLeftDir( wxCommandEvent& event ){ event.Skip(); } + virtual void OnEnterRightDir( 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(); } + virtual void OnExRightSideOnly( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLeftNewer( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRightNewer( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDifferent( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCreateJob( wxCommandEvent& event ){ event.Skip(); } public: - wxGauge* m_gauge1; - wxButton* m_buttonOK; - wxButton* m_buttonAbort; - SyncStatusGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 614,371 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~SyncStatusGenerated(); + BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~BatchDlgGenerated(); }; |