diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/MainDialog.cpp | 814 | ||||
-rw-r--r-- | ui/MainDialog.h | 75 | ||||
-rw-r--r-- | ui/SmallDialogs.cpp | 31 | ||||
-rw-r--r-- | ui/SmallDialogs.h | 5 | ||||
-rw-r--r-- | ui/SyncDialog.cpp | 415 | ||||
-rw-r--r-- | ui/SyncDialog.h | 37 | ||||
-rw-r--r-- | ui/batchStatusHandler.cpp | 68 | ||||
-rw-r--r-- | ui/dragAndDrop.cpp | 2 | ||||
-rw-r--r-- | ui/gridView.cpp | 168 | ||||
-rw-r--r-- | ui/gridView.h | 49 | ||||
-rw-r--r-- | ui/guiGenerated.cpp | 640 | ||||
-rw-r--r-- | ui/guiGenerated.h | 121 | ||||
-rw-r--r-- | ui/guiStatusHandler.cpp | 62 | ||||
-rw-r--r-- | ui/sorting.h | 12 |
14 files changed, 1538 insertions, 961 deletions
diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp index e8006600..32a1e124 100644 --- a/ui/MainDialog.cpp +++ b/ui/MainDialog.cpp @@ -57,8 +57,7 @@ public: //test if ffs config file has been dropped if (fileType == xmlAccess::XML_GUI_CONFIG) { - if (mainDlg_->readConfigurationFromXml(dropName)) - mainDlg_->pushStatusInformation(_("Configuration loaded!")); + mainDlg_->loadConfiguration(dropName); return false; } //...or a ffs batch file @@ -71,7 +70,7 @@ public: } //disable the sync button - mainDlg_->enableSynchronization(false); + mainDlg_->syncPreview->enableSynchronization(false); //clear grids mainDlg_->currentGridData.clear(); @@ -133,13 +132,11 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale gridDataView(currentGridData), contextMenu(new wxMenu), //initialize right-click context menu; will be dynamically re-created on each R-mouse-click programLanguage(language), - filteringInitialized(false), - filteringPending(false), - synchronizationEnabled(false), cmpStatusHandlerTmp(0), cleanedUp(false), lastSortColumn(-1), - lastSortGrid(NULL) + lastSortGrid(NULL), + syncPreview(new SyncPreview(this)) { //initialize and load configuration readGlobalSettings(); @@ -148,14 +145,17 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale //set icons for this dialog m_bpButton10->SetBitmapLabel(*globalResource.bitmapExit); m_buttonCompare->setBitmapFront(*globalResource.bitmapCompare); - m_buttonSync->setBitmapFront(*globalResource.bitmapSync); - m_bpButtonSwap->SetBitmapLabel(*globalResource.bitmapSwap); + m_bpButtonSyncConfig->SetBitmapLabel(*globalResource.bitmapSyncCfg); m_bpButton14->SetBitmapLabel(*globalResource.bitmapHelp); m_bpButtonSave->SetBitmapLabel(*globalResource.bitmapSave); m_bpButtonLoad->SetBitmapLabel(*globalResource.bitmapLoad); m_bpButtonAddPair->SetBitmapLabel(*globalResource.bitmapAddFolderPair); m_bitmap15->SetBitmap(*globalResource.bitmapStatusEdge); m_bitmapShift->SetBitmap(*globalResource.bitmapShift); + m_bitmapCreate->SetBitmap(*globalResource.bitmapCreate); + m_bitmapUpdate->SetBitmap(*globalResource.bitmapUpdate); + m_bitmapDelete->SetBitmap(*globalResource.bitmapDelete); + m_bitmapData->SetBitmap(*globalResource.bitmapData); bSizer6->Layout(); //wxButtonWithImage size might have changed @@ -163,6 +163,7 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale MenuItemUpdater updateMenuFile(m_menuFile); updateMenuFile.addForUpdate(m_menuItem10, *globalResource.bitmapCompareSmall); updateMenuFile.addForUpdate(m_menuItem11, *globalResource.bitmapSyncSmall); + updateMenuFile.addForUpdate(m_menuItemSwitchView, *globalResource.bitmapSwitchViewSmall); MenuItemUpdater updateMenuAdv(m_menuAdvanced); updateMenuAdv.addForUpdate(m_menuItemGlobSett, *globalResource.bitmapSettingsSmall); @@ -208,12 +209,13 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale m_gridMiddle->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridMiddleButtonEvent), NULL, this); Connect(wxEVT_IDLE, wxEventHandler(MainDialog::OnIdleEvent), NULL, this); - m_gridMiddle->GetGridWindow()->Connect(wxEVT_LEFT_UP, wxEventHandler(MainDialog::OnGrid3LeftMouseUp), NULL, this); - m_gridMiddle->GetGridWindow()->Connect(wxEVT_LEFT_DOWN, wxEventHandler(MainDialog::OnGrid3LeftMouseDown), NULL, this); - Connect(wxEVT_SIZE, wxEventHandler(MainDialog::onResizeMainWindow), NULL, this); Connect(wxEVT_MOVE, wxEventHandler(MainDialog::onResizeMainWindow), NULL, this); + //event handler for manual (un-)checking of rows and setting of sync direction + m_gridMiddle->Connect(FFS_CHECK_ROWS_EVENT, FFSCheckRowsEventHandler(MainDialog::OnCheckRows), NULL, this); + m_gridMiddle->Connect(FFS_SYNC_DIRECTION_EVENT, FFSSyncDirectionEventHandler(MainDialog::OnSetSyncDirection), NULL, this); + //init grid settings m_gridLeft->initSettings( globalSettings.gui.showFileIcons, m_gridLeft, @@ -233,13 +235,11 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale &gridDataView); //disable sync button as long as "compare" hasn't been triggered. - enableSynchronization(false); + syncPreview->enableSynchronization(false); //mainly to update row label sizes... updateGuiGrid(); - enableSynchronization(false); - //create the compare status panel in hidden state compareStatus = new CompareStatus(this); bSizer1->Insert(1, compareStatus, 0, wxEXPAND | wxBOTTOM, 5 ); @@ -347,31 +347,13 @@ void MainDialog::writeGlobalSettings() } -void MainDialog::enableSynchronization(bool value) -{ - if (value) - { - synchronizationEnabled = true; - m_buttonSync->SetForegroundColour(*wxBLACK); - m_buttonSync->setBitmapFront(*globalResource.bitmapSync); - } - else - { - synchronizationEnabled = false; - m_buttonSync->SetForegroundColour(wxColor(94, 94, 94)); //grey - m_buttonSync->setBitmapFront(*globalResource.bitmapSyncDisabled); - } -} - - -void MainDialog::filterRangeManually(const std::set<int>& rowsToFilterOnUiTable) +void MainDialog::filterRangeManually(const std::set<int>& rowsToFilterOnUiTable, const int leadingRow) { if (rowsToFilterOnUiTable.size() > 0) { bool newSelection = false; //default: deselect range //leadingRow determines de-/selection of all other rows - const int leadingRow = *rowsToFilterOnUiTable.begin(); if (0 <= leadingRow && leadingRow < int(gridDataView.elementsOnView())) newSelection = !gridDataView[leadingRow].selectedForSynchronization; @@ -414,67 +396,15 @@ void MainDialog::filterRangeManually(const std::set<int>& rowsToFilterOnUiTable) m_gridLeft->ClearSelection(); m_gridRight->ClearSelection(); - m_gridMiddle->ClearSelection(); } else - { //this second call to ForceRefresh() looks strange, but it actually fixes occasional graphical artifacts on bottom right of the grid - m_gridLeft->ForceRefresh(); - m_gridMiddle->ForceRefresh(); - m_gridRight->ForceRefresh(); - - m_gridMiddle->ClearSelection(); - } + updateGuiGrid(); } } -/*grid event choreography: -1. UI-Mouse-Down => OnGridSelectCell -2. UI-Mouse-Up => SelectRangeEvent (if at least two rows are marked) - -=> the decision if a range or a single cell is selected can be made only after Mouse-UP. But SelectRangeEvent unfortunately is not always -executed (e.g. if single cell selected) - -=> new choreography: -1. UI-Mouse-Down => OnGrid3LeftMouseDown (notify that filtering was initialized: this is needed since under some circumstances it might happen that the program - receives a mouse-up without a preceding mouse-down (double-clicks) -2. UI-Mouse-Up => OnGrid3LeftMouseUp (notify that filtering shall be started on next idle event -3. UI-Mouse-Up => SelectRangeEvent, possibly -4. Idle event => OnIdleEvent -*/ - - -void MainDialog::OnGrid3LeftMouseDown(wxEvent& event) -{ - filteringInitialized = true; - event.Skip(); -} - - -void MainDialog::OnGrid3LeftMouseUp(wxEvent& event) -{ - filteringPending = true; - event.Skip(); -} - void MainDialog::OnIdleEvent(wxEvent& event) { - //process manually filtered rows - if (filteringPending) - { - filteringPending = false; - - if (filteringInitialized) //filteringInitialized is being reset after each selection, since strangely it might happen, that the grid receives - { //a mouse up event, but no mouse down! (e.g. when window is maximized and cursor is on grid3) - filteringInitialized = false; - - if (m_gridMiddle) - filterRangeManually(getSelectedRows(m_gridMiddle)); - } - } - - //------------------------------------------------------------------------------ - //small routine to restore status information after some time if (stackObjects.size() > 0 ) //check if there is some work to do { @@ -538,54 +468,9 @@ void removeInvalidRows(std::set<int>& rows, const int currentUiTableSize) } -std::set<int> MainDialog::getSelectedRows(const CustomGrid* grid) +std::set<int> MainDialog::getSelectedRows(const CustomGrid* grid) const { - std::set<int> output; - int rowTop, rowBottom; //coords of selection - - wxArrayInt selectedRows = grid->GetSelectedRows(); - if (!selectedRows.IsEmpty()) - { - for (unsigned int i = 0; i < selectedRows.GetCount(); ++i) - output.insert(selectedRows[i]); - } - - if (!grid->GetSelectedCols().IsEmpty()) //if a column is selected this is means all rows are marked for deletion - { - for (int k = 0; k < const_cast<CustomGrid*>(grid)->GetNumberRows(); ++k) //messy wxGrid implementation... - output.insert(k); - } - - wxGridCellCoordsArray singlySelected = grid->GetSelectedCells(); - if (!singlySelected.IsEmpty()) - { - for (unsigned int k = 0; k < singlySelected.GetCount(); ++k) - output.insert(singlySelected[k].GetRow()); - } - - wxGridCellCoordsArray tmpArrayTop = grid->GetSelectionBlockTopLeft(); - if (!tmpArrayTop.IsEmpty()) - { - wxGridCellCoordsArray tmpArrayBottom = grid->GetSelectionBlockBottomRight(); - - unsigned int arrayCount = tmpArrayTop.GetCount(); - - if (arrayCount == tmpArrayBottom.GetCount()) - { - for (unsigned int i = 0; i < arrayCount; ++i) - { - rowTop = tmpArrayTop[i].GetRow(); - rowBottom = tmpArrayBottom[i].GetRow(); - - for (int k = rowTop; k <= rowBottom; ++k) - output.insert(k); - } - } - } - - //some exception: also add current cursor row to selection if there are no others... hopefully improving usability - if (output.empty() && grid->isLeadGrid()) - output.insert(const_cast<CustomGrid*>(grid)->GetCursorRow()); //messy wxGrid implementation... + std::set<int> output = grid->getAllSelectedRows(); removeInvalidRows(output, gridDataView.elementsOnView()); @@ -685,6 +570,7 @@ void MainDialog::deleteSelectedFiles() rowsToDeleteOnRight, globalSettings.gui.deleteOnBothSides, globalSettings.gui.useRecyclerForManualDeletion, + cfg.syncConfiguration, &errorHandler); } @@ -706,46 +592,76 @@ void MainDialog::openWithFileManager(const int rowNumber, const bool leftSide) { wxString command; - wxString defaultFolder; - if (0 <= rowNumber && rowNumber < int(gridDataView.elementsOnView())) - defaultFolder = leftSide ? - gridDataView.getFolderPair(rowNumber).leftDirectory.c_str() : - gridDataView.getFolderPair(rowNumber).rightDirectory.c_str(); - else - defaultFolder = leftSide ? - FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue().c_str()).c_str() : - FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue().c_str()).c_str(); - -#ifdef FFS_WIN - command = wxString(wxT("explorer ")) + defaultFolder; //default -#elif defined FFS_LINUX - command = globalSettings.gui.commandLineFileManager; - command.Replace(wxT("%name"), defaultFolder); - command.Replace(wxT("%path"), defaultFolder); -#endif - if (0 <= rowNumber && rowNumber < int(gridDataView.elementsOnView())) { const FileDescrLine* fileDescr = leftSide ? &gridDataView[rowNumber].fileDescrLeft : &gridDataView[rowNumber].fileDescrRight; - if (fileDescr->objType == FileDescrLine::TYPE_FILE) + switch (fileDescr->objType) { + case FileDescrLine::TYPE_FILE: command = globalSettings.gui.commandLineFileManager; command.Replace(wxT("%name"), fileDescr->fullName.c_str()); command.Replace(wxT("%path"), wxString(fileDescr->fullName.c_str()).BeforeLast(GlobalResources::FILE_NAME_SEPARATOR)); - } - else if (fileDescr->objType == FileDescrLine::TYPE_DIRECTORY) - { + break; + case FileDescrLine::TYPE_DIRECTORY: command = globalSettings.gui.commandLineFileManager; command.Replace(wxT("%name"), fileDescr->fullName.c_str()); command.Replace(wxT("%path"), fileDescr->fullName.c_str()); - } - else if (fileDescr->objType == FileDescrLine::TYPE_NOTHING) + break; + case FileDescrLine::TYPE_NOTHING: { + //use path from other side + const FileDescrLine* fileDescrOther = leftSide ? + &gridDataView[rowNumber].fileDescrRight : + &gridDataView[rowNumber].fileDescrLeft; + + const wxString syncFolder = leftSide ? + gridDataView.getFolderPair(rowNumber).leftDirectory.c_str() : + gridDataView.getFolderPair(rowNumber).rightDirectory.c_str(); + + wxString alternateFolder; + switch (fileDescrOther->objType) + { + case FileDescrLine::TYPE_FILE: + alternateFolder = syncFolder + wxString(fileDescrOther->relativeName.c_str()).BeforeLast(GlobalResources::FILE_NAME_SEPARATOR); + break; + case FileDescrLine::TYPE_DIRECTORY: + alternateFolder = syncFolder + wxString(fileDescrOther->relativeName.c_str()); + break; + case FileDescrLine::TYPE_NOTHING: + assert(false); + break; + } + + if (!wxDirExists(alternateFolder)) + alternateFolder = syncFolder; + +#ifdef FFS_WIN + command = wxString(wxT("explorer ")) + alternateFolder; //default +#elif defined FFS_LINUX + command = globalSettings.gui.commandLineFileManager; + command.Replace(wxT("%name"), alternateFolder); + command.Replace(wxT("%path"), alternateFolder); +#endif + } + break; } } + else + { //fallback + const wxString defaultFolder = leftSide ? + FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue().c_str()).c_str() : + FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue().c_str()).c_str(); +#ifdef FFS_WIN + command = wxString(wxT("explorer ")) + defaultFolder; //default +#elif defined FFS_LINUX + command = globalSettings.gui.commandLineFileManager; + command.Replace(wxT("%name"), defaultFolder); + command.Replace(wxT("%path"), defaultFolder); +#endif + } if (!command.empty()) wxExecute(command.c_str()); @@ -957,7 +873,6 @@ void MainDialog::OnContextMenu(wxGridEvent& event) //show context menu PopupMenu(contextMenu.get()); - event.Skip(); } @@ -972,7 +887,8 @@ void MainDialog::OnContextMenuSelection(wxCommandEvent& event) for (std::set<int>::const_iterator i = additional.begin(); i != additional.end(); ++i) selection.insert(*i); - filterRangeManually(selection); + if (selection.size() > 0) + filterRangeManually(selection, *selection.begin()); } else if (eventId == CONTEXT_EXCLUDE_EXT) @@ -987,7 +903,8 @@ void MainDialog::OnContextMenuSelection(wxCommandEvent& event) cfg.filterIsActive = true; updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); - FreeFileSync::filterGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); + FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + filterInstance.filterGridData(currentGridData); updateGuiGrid(); if (hideFilteredElements) @@ -1009,17 +926,17 @@ void MainDialog::OnContextMenuSelection(wxCommandEvent& event) cfg.excludeFilter+= wxT("\n"); if (i->type == FileDescrLine::TYPE_FILE) - cfg.excludeFilter+= wxString(wxT("*")) + GlobalResources::FILE_NAME_SEPARATOR + i->relativeName; + cfg.excludeFilter+= wxString(GlobalResources::FILE_NAME_SEPARATOR) + i->relativeName; else if (i->type == FileDescrLine::TYPE_DIRECTORY) - cfg.excludeFilter+= wxString(wxT("*")) + GlobalResources::FILE_NAME_SEPARATOR + i->relativeName + GlobalResources::FILE_NAME_SEPARATOR + wxT("*"); - + cfg.excludeFilter+= wxString(GlobalResources::FILE_NAME_SEPARATOR) + i->relativeName + GlobalResources::FILE_NAME_SEPARATOR + wxT("*"); else assert(false); } cfg.filterIsActive = true; updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); - FreeFileSync::filterGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); + FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + filterInstance.filterGridData(currentGridData); updateGuiGrid(); if (hideFilteredElements) @@ -1068,10 +985,12 @@ void MainDialog::OnContextMenuSelection(wxCommandEvent& event) void MainDialog::OnContextMenuMiddle(wxGridEvent& event) { contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(CONTEXT_SWAP_SIDES, _("Swap sides")); + contextMenu->AppendSeparator(); contextMenu->Append(CONTEXT_CHECK_ALL, _("Check all")); contextMenu->Append(CONTEXT_UNCHECK_ALL, _("Uncheck all")); - if (gridDataView.elementsTotal() == 0) + if (gridDataView.refGridIsEmpty()) { contextMenu->Enable(CONTEXT_CHECK_ALL, false); contextMenu->Enable(CONTEXT_UNCHECK_ALL, false); @@ -1079,22 +998,25 @@ void MainDialog::OnContextMenuMiddle(wxGridEvent& event) contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextMenuMiddleSelection), NULL, this); PopupMenu(contextMenu.get()); //show context menu - - event.Skip(); } void MainDialog::OnContextMenuMiddleSelection(wxCommandEvent& event) { int eventId = event.GetId(); - if (eventId == CONTEXT_CHECK_ALL) + if (eventId == CONTEXT_SWAP_SIDES) + { + wxCommandEvent dummy; + MainDialog::OnSwapSides(dummy); + } + else if (eventId == CONTEXT_CHECK_ALL) { - FreeFileSync::includeAllRowsOnGrid(currentGridData); + FreeFileSync::FilterProcess::includeAllRowsOnGrid(currentGridData); updateGuiGrid(); } else if (eventId == CONTEXT_UNCHECK_ALL) { - FreeFileSync::excludeAllRowsOnGrid(currentGridData); + FreeFileSync::FilterProcess::excludeAllRowsOnGrid(currentGridData); updateGuiGrid(); } } @@ -1128,10 +1050,12 @@ void MainDialog::OnContextColumnSelection(wxCommandEvent& event) if (eventId == CONTEXT_CUSTOMIZE_COLUMN_LEFT) { xmlAccess::ColumnAttributes colAttr = m_gridLeft->getColumnAttributes(); - CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(this, colAttr); + CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(this, colAttr, globalSettings.gui.showFileIcons); if (customizeDlg->ShowModal() == CustomizeColsDlg::BUTTON_OKAY) { m_gridLeft->setColumnAttributes(colAttr); + m_gridLeft->enableFileIcons(globalSettings.gui.showFileIcons); + m_gridRight->enableFileIcons(globalSettings.gui.showFileIcons); m_gridLeft->setSortMarker(-1); //hide sort direction indicator on GUI grids m_gridMiddle->setSortMarker(-1); @@ -1141,10 +1065,13 @@ void MainDialog::OnContextColumnSelection(wxCommandEvent& event) else if (eventId == CONTEXT_CUSTOMIZE_COLUMN_RIGHT) { xmlAccess::ColumnAttributes colAttr = m_gridRight->getColumnAttributes(); - CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(this, colAttr); + CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(this, colAttr, globalSettings.gui.showFileIcons); if (customizeDlg->ShowModal() == CustomizeColsDlg::BUTTON_OKAY) { m_gridRight->setColumnAttributes(colAttr); + m_gridLeft->enableFileIcons(globalSettings.gui.showFileIcons); + m_gridRight->enableFileIcons(globalSettings.gui.showFileIcons); + m_gridLeft->setSortMarker(-1); //hide sort direction indicator on GUI grids m_gridMiddle->setSortMarker(-1); m_gridRight->setSortMarker(-1); @@ -1158,7 +1085,7 @@ void MainDialog::OnDirSelected(wxFileDirPickerEvent& event) //left and right directory text-control and dirpicker are synchronized by MainFolderDragDrop automatically //disable the sync button - enableSynchronization(false); + syncPreview->enableSynchronization(false); //clear grids currentGridData.clear(); @@ -1294,7 +1221,13 @@ void MainDialog::addRightFolderToHistory(const wxString& rightFolder) void MainDialog::OnSaveConfig(wxCommandEvent& event) { - const wxString defaultFileName = proposedConfigFileName.empty() ? wxT("SyncSettings.ffs_gui") : proposedConfigFileName; + trySaveConfig(); +} + + +bool MainDialog::trySaveConfig() //return true if saved successfully +{ + const wxString defaultFileName = currentConfigFileName.empty() ? wxT("SyncSettings.ffs_gui") : currentConfigFileName; wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("FreeFileSync configuration")) + wxT(" (*.ffs_gui)|*.ffs_gui"), wxFD_SAVE); if (filePicker->ShowModal() == wxID_OK) @@ -1306,14 +1239,17 @@ void MainDialog::OnSaveConfig(wxCommandEvent& event) wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\""), _("Warning") , wxOK | wxCANCEL); if (messageDlg->ShowModal() != wxID_OK) - { - OnSaveConfig(event); //retry - return; - } + return trySaveConfig(); //retry } + if (writeConfigurationToXml(newFileName)) + { pushStatusInformation(_("Configuration saved!")); + return true; + } } + + return false; } @@ -1347,6 +1283,34 @@ void MainDialog::OnMenuLoadConfig(wxCommandEvent& event) void MainDialog::loadConfiguration(const wxString& filename) { + //notify user about changed settings + if (globalSettings.gui.popupOnConfigChange && !currentConfigFileName.empty()) //only if check is active and non-default config file loaded + { + if (lastConfigurationSaved != getCurrentConfiguration()) + { + bool dontShowAgain = !globalSettings.gui.popupOnConfigChange; + + QuestionDlg* notifyChangeDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_NO | QuestionDlg::BUTTON_CANCEL, + _("Save changes to current configuration?"), + dontShowAgain); + + switch (notifyChangeDlg->ShowModal()) + { + case QuestionDlg::BUTTON_YES: + if (!trySaveConfig()) + return; + break; + case QuestionDlg::BUTTON_NO: + globalSettings.gui.popupOnConfigChange = !dontShowAgain; + break; + case QuestionDlg::BUTTON_CANCEL: + return; + } + } + } + //------------------------------------------------------------------------------------ + if (!filename.IsEmpty()) { //clear grids currentGridData.clear(); @@ -1442,36 +1406,71 @@ void MainDialog::OnQuit(wxCommandEvent &event) void MainDialog::requestShutdown() { - /* - if (globalSettings.gui.popupOnConfigChange) + //notify user about changed settings + if (globalSettings.gui.popupOnConfigChange && !currentConfigFileName.empty()) //only if check is active and non-default config file loaded { if (lastConfigurationSaved != getCurrentConfiguration()) { - ... -wxID_OK - OnSaveConfig(wxCommandEvent& event) + bool dontShowAgain = !globalSettings.gui.popupOnConfigChange; + + QuestionDlg* notifyChangeDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_NO | QuestionDlg::BUTTON_CANCEL, + _("Save changes to current configuration?"), + dontShowAgain); - ; - wxMessageBox(wxT("ji")); + switch (notifyChangeDlg->ShowModal()) + { + case QuestionDlg::BUTTON_YES: + if (!trySaveConfig()) + return; + break; + case QuestionDlg::BUTTON_NO: + globalSettings.gui.popupOnConfigChange = !dontShowAgain; + break; + case QuestionDlg::BUTTON_CANCEL: + return; + } } } - */ Destroy(); } -bool MainDialog::readConfigurationFromXml(const wxString& filename, bool programStartup) +void MainDialog::OnCheckRows(FFSCheckRowsEvent& event) { - leftOnlyFilesActive = true; - leftNewerFilesActive = true; - differentFilesActive = true; - rightNewerFilesActive = true; //do not save/load these bool values from harddisk! - rightOnlyFilesActive = true; //it's more convenient to have them defaulted at startup - equalFilesActive = false; - updateViewFilterButtons(); + const int lowerBound = std::min(event.rowFrom, event.rowTo); + const int upperBound = std::max(event.rowFrom, event.rowTo); + if (0 <= lowerBound) + { + std::set<int> selectedRowsOnView; + + for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView.elementsOnView()) - 1); ++i) + selectedRowsOnView.insert(i); + + filterRangeManually(selectedRowsOnView, event.rowFrom); + } +} + +void MainDialog::OnSetSyncDirection(FFSSyncDirectionEvent& event) +{ + const int lowerBound = std::min(event.rowFrom, event.rowTo); + const int upperBound = std::max(event.rowFrom, event.rowTo); + + if (0 <= lowerBound) + { + for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView.elementsOnView()) - 1); ++i) + gridDataView[i].direction = event.direction; + + updateGuiGrid(); + } +} + + +bool MainDialog::readConfigurationFromXml(const wxString& filename, bool programStartup) +{ //load XML xmlAccess::XmlGuiConfig guiCfg; //structure to receive gui settings, already defaulted!! try @@ -1494,11 +1493,29 @@ bool MainDialog::readConfigurationFromXml(const wxString& filename, bool program } } + //(re-)set view filter buttons + gridDataView.leftOnlyFilesActive = true; + gridDataView.leftNewerFilesActive = true; + gridDataView.differentFilesActive = true; + gridDataView.rightNewerFilesActive = true; //do not save/load these bool values from harddisk! + gridDataView.rightOnlyFilesActive = true; //it's more convenient to have them defaulted at startup + gridDataView.equalFilesActive = false; + + gridDataView.conflictFilesActive = true; + + gridDataView.syncDirLeftActive = true; + gridDataView.syncDirRightActive = true; + gridDataView.syncDirNoneActive = true; + + updateViewFilterButtons(); + + //load main configuration into instance cfg = guiCfg.mainCfg; //update visible config on main window updateCompareButtons(); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); //read folder pairs: @@ -1542,6 +1559,8 @@ bool MainDialog::readConfigurationFromXml(const wxString& filename, bool program ignoreErrors = guiCfg.ignoreErrors; + syncPreview->enablePreview(guiCfg.syncPreviewEnabled); + //########################################################### addFileToCfgHistory(filename); //put filename on list of last used config files @@ -1550,12 +1569,12 @@ bool MainDialog::readConfigurationFromXml(const wxString& filename, bool program if (filename == xmlAccess::LAST_CONFIG_FILE) //set title { SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); - proposedConfigFileName.clear(); + currentConfigFileName.clear(); } else { SetTitle(wxString(wxT("FreeFileSync - ")) + filename); - proposedConfigFileName = filename; + currentConfigFileName = filename; } return true; @@ -1585,12 +1604,12 @@ bool MainDialog::writeConfigurationToXml(const wxString& filename) if (filename == xmlAccess::LAST_CONFIG_FILE) //set title { SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); - proposedConfigFileName.clear(); + currentConfigFileName.clear(); } else { SetTitle(wxString(wxT("FreeFileSync - ")) + filename); - proposedConfigFileName = filename; + currentConfigFileName = filename; } return true; @@ -1610,6 +1629,8 @@ xmlAccess::XmlGuiConfig MainDialog::getCurrentConfiguration() const guiCfg.ignoreErrors = ignoreErrors; + guiCfg.syncPreviewEnabled = syncPreview->previewIsEnabled(); + return guiCfg; } @@ -1628,9 +1649,12 @@ void MainDialog::OnFilterButton(wxCommandEvent &event) updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); if (cfg.filterIsActive) - FreeFileSync::filterGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); + { + FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + filterInstance.filterGridData(currentGridData); + } else - FreeFileSync::includeAllRowsOnGrid(currentGridData); + FreeFileSync::FilterProcess::includeAllRowsOnGrid(currentGridData); updateGuiGrid(); } @@ -1653,24 +1677,26 @@ void MainDialog::OnHideFilteredButton(wxCommandEvent &event) void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) { - wxString beforeImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; + const wxString beforeImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; FilterDlg* filterDlg = new FilterDlg(this, cfg.includeFilter, cfg.excludeFilter); if (filterDlg->ShowModal() == FilterDlg::BUTTON_OKAY) { - wxString afterImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; + const wxString afterImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; if (beforeImage != afterImage) //if filter settings are changed: set filtering to "on" { if (afterImage == (wxString(wxT("*")) + wxChar(1))) //default { cfg.filterIsActive = false; - FreeFileSync::includeAllRowsOnGrid(currentGridData); + FreeFileSync::FilterProcess::includeAllRowsOnGrid(currentGridData); } else { cfg.filterIsActive = true; - FreeFileSync::filterGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); + + FreeFileSync::FilterProcess filterInstance(cfg.includeFilter, cfg.excludeFilter); + filterInstance.filterGridData(currentGridData); } updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); @@ -1684,42 +1710,75 @@ void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) void MainDialog::OnLeftOnlyFiles(wxCommandEvent& event) { - leftOnlyFilesActive = !leftOnlyFilesActive; + gridDataView.leftOnlyFilesActive = !gridDataView.leftOnlyFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) { - leftNewerFilesActive = !leftNewerFilesActive; + gridDataView.leftNewerFilesActive = !gridDataView.leftNewerFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnDifferentFiles(wxCommandEvent& event) { - differentFilesActive = !differentFilesActive; + gridDataView.differentFilesActive = !gridDataView.differentFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnRightNewerFiles(wxCommandEvent& event) { - rightNewerFilesActive = !rightNewerFilesActive; + gridDataView.rightNewerFilesActive = !gridDataView.rightNewerFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) { - rightOnlyFilesActive = !rightOnlyFilesActive; + gridDataView.rightOnlyFilesActive = !gridDataView.rightOnlyFilesActive; updateViewFilterButtons(); updateGuiGrid(); }; + void MainDialog::OnEqualFiles(wxCommandEvent& event) { - equalFilesActive = !equalFilesActive; + gridDataView.equalFilesActive = !gridDataView.equalFilesActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnConflictFiles(wxCommandEvent& event) +{ + gridDataView.conflictFilesActive = !gridDataView.conflictFilesActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncDirLeft(wxCommandEvent& event) +{ + gridDataView.syncDirLeftActive = !gridDataView.syncDirLeftActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncDirRight(wxCommandEvent& event) +{ + gridDataView.syncDirRightActive = !gridDataView.syncDirRightActive; + updateViewFilterButtons(); + updateGuiGrid(); +}; + + +void MainDialog::OnSyncDirNone(wxCommandEvent& event) +{ + gridDataView.syncDirNoneActive = !gridDataView.syncDirNoneActive; updateViewFilterButtons(); updateGuiGrid(); }; @@ -1727,7 +1786,8 @@ void MainDialog::OnEqualFiles(wxCommandEvent& event) void MainDialog::updateViewFilterButtons() { - if (leftOnlyFilesActive) + //compare result buttons + if (gridDataView.leftOnlyFilesActive) { m_bpButtonLeftOnly->SetBitmapLabel(*globalResource.bitmapLeftOnlyAct); m_bpButtonLeftOnly->SetToolTip(_("Hide files that exist on left side only")); @@ -1738,7 +1798,18 @@ void MainDialog::updateViewFilterButtons() m_bpButtonLeftOnly->SetToolTip(_("Show files that exist on left side only")); } - if (leftNewerFilesActive) + if (gridDataView.rightOnlyFilesActive) + { + m_bpButtonRightOnly->SetBitmapLabel(*globalResource.bitmapRightOnlyAct); + m_bpButtonRightOnly->SetToolTip(_("Hide files that exist on right side only")); + } + else + { + m_bpButtonRightOnly->SetBitmapLabel(*globalResource.bitmapRightOnlyDeact); + m_bpButtonRightOnly->SetToolTip(_("Show files that exist on right side only")); + } + + if (gridDataView.leftNewerFilesActive) { m_bpButtonLeftNewer->SetBitmapLabel(*globalResource.bitmapLeftNewerAct); m_bpButtonLeftNewer->SetToolTip(_("Hide files that are newer on left")); @@ -1749,7 +1820,18 @@ void MainDialog::updateViewFilterButtons() m_bpButtonLeftNewer->SetToolTip(_("Show files that are newer on left")); } - if (equalFilesActive) + if (gridDataView.rightNewerFilesActive) + { + m_bpButtonRightNewer->SetBitmapLabel(*globalResource.bitmapRightNewerAct); + m_bpButtonRightNewer->SetToolTip(_("Hide files that are newer on right")); + } + else + { + m_bpButtonRightNewer->SetBitmapLabel(*globalResource.bitmapRightNewerDeact); + m_bpButtonRightNewer->SetToolTip(_("Show files that are newer on right")); + } + + if (gridDataView.equalFilesActive) { m_bpButtonEqual->SetBitmapLabel(*globalResource.bitmapEqualAct); m_bpButtonEqual->SetToolTip(_("Hide files that are equal")); @@ -1760,7 +1842,7 @@ void MainDialog::updateViewFilterButtons() m_bpButtonEqual->SetToolTip(_("Show files that are equal")); } - if (differentFilesActive) + if (gridDataView.differentFilesActive) { m_bpButtonDifferent->SetBitmapLabel(*globalResource.bitmapDifferentAct); m_bpButtonDifferent->SetToolTip(_("Hide files that are different")); @@ -1771,26 +1853,49 @@ void MainDialog::updateViewFilterButtons() m_bpButtonDifferent->SetToolTip(_("Show files that are different")); } - if (rightNewerFilesActive) + if (gridDataView.conflictFilesActive) { - m_bpButtonRightNewer->SetBitmapLabel(*globalResource.bitmapRightNewerAct); - m_bpButtonRightNewer->SetToolTip(_("Hide files that are newer on right")); + m_bpButtonConflict->SetBitmapLabel(*globalResource.bitmapConflictAct); + m_bpButtonConflict->SetToolTip(_("Hide conflicts")); } else { - m_bpButtonRightNewer->SetBitmapLabel(*globalResource.bitmapRightNewerDeact); - m_bpButtonRightNewer->SetToolTip(_("Show files that are newer on right")); + m_bpButtonConflict->SetBitmapLabel(*globalResource.bitmapConflictDeact); + m_bpButtonConflict->SetToolTip(_("Show conflicts")); } - if (rightOnlyFilesActive) + //sync preview buttons + if (gridDataView.syncDirLeftActive) { - m_bpButtonRightOnly->SetBitmapLabel(*globalResource.bitmapRightOnlyAct); - m_bpButtonRightOnly->SetToolTip(_("Hide files that exist on right side only")); + m_bpButtonSyncDirLeft->SetBitmapLabel(*globalResource.bitmapSyncDirLeftAct); + m_bpButtonSyncDirLeft->SetToolTip(_("Hide files that will be copied to the left side")); } else { - m_bpButtonRightOnly->SetBitmapLabel(*globalResource.bitmapRightOnlyDeact); - m_bpButtonRightOnly->SetToolTip(_("Show files that exist on right side only")); + m_bpButtonSyncDirLeft->SetBitmapLabel(*globalResource.bitmapSyncDirLeftDeact); + m_bpButtonSyncDirLeft->SetToolTip(_("Show files that will be copied to the left side")); + } + + if (gridDataView.syncDirRightActive) + { + m_bpButtonSyncDirRight->SetBitmapLabel(*globalResource.bitmapSyncDirRightAct); + m_bpButtonSyncDirRight->SetToolTip(_("Hide files that will be copied to the right side")); + } + else + { + m_bpButtonSyncDirRight->SetBitmapLabel(*globalResource.bitmapSyncDirRightDeact); + m_bpButtonSyncDirRight->SetToolTip(_("Show files that will be copied to the right side")); + } + + if (gridDataView.syncDirNoneActive) + { + m_bpButtonSyncDirNone->SetBitmapLabel(*globalResource.bitmapSyncDirNoneAct); + m_bpButtonSyncDirNone->SetToolTip(_("Hide files that won't be copied")); + } + else + { + m_bpButtonSyncDirNone->SetBitmapLabel(*globalResource.bitmapSyncDirNoneDeact); + m_bpButtonSyncDirNone->SetToolTip(_("Show files that won't be copied")); } } @@ -1825,7 +1930,7 @@ void MainDialog::updateCompareButtons() } //disable the sync button - enableSynchronization(false); + syncPreview->enableSynchronization(false); //clear grids currentGridData.clear(); @@ -1867,13 +1972,22 @@ void MainDialog::OnCompare(wxCommandEvent &event) CompareStatusHandler statusHandler(this); cmpStatusHandlerTmp = &statusHandler; + //prepare filter + std::auto_ptr<FreeFileSync::FilterProcess> filterInstance(NULL); + if (cfg.filterIsActive) + filterInstance.reset(new FreeFileSync::FilterProcess(cfg.includeFilter, cfg.excludeFilter)); + + //begin comparison FreeFileSync::CompareProcess comparison(globalSettings.shared.traverseDirectorySymlinks, globalSettings.shared.fileTimeTolerance, + globalSettings.shared.ignoreOneHourDiff, globalSettings.shared.warningDependentFolders, + filterInstance.get(), &statusHandler); comparison.startCompareProcess(getFolderPairs(), cfg.compareVar, + cfg.syncConfiguration, currentGridData); //if (output.size < 50000) @@ -1881,26 +1995,22 @@ void MainDialog::OnCompare(wxCommandEvent &event) statusHandler.forceUiRefresh(); //keep total number of scanned files up to date gridDataView.sortView(GridView::SORT_BY_DIRECTORY, true, true); - - //filter currentGridData if option is set - if (cfg.filterIsActive) - FreeFileSync::filterGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); } catch (AbortThisProcess& theException) { aborted = true; } - cmpStatusHandlerTmp = 0; + cmpStatusHandlerTmp = NULL; if (aborted) { //disable the sync button - enableSynchronization(false); + syncPreview->enableSynchronization(false); m_buttonCompare->SetFocus(); } else { //once compare is finished enable the sync button - enableSynchronization(true); - m_buttonSync->SetFocus(); + syncPreview->enableSynchronization(true); + m_buttonStartSync->SetFocus(); //hide sort direction indicator on GUI grids m_gridLeft->setSortMarker(-1); @@ -1961,25 +2071,44 @@ void MainDialog::updateGuiGrid() m_gridRight->SetRowLabelSize(nrOfDigits * digitWidth + 4); } + //update sync preview statistics + calculatePreview(); + m_gridLeft->EndBatch(); m_gridMiddle->EndBatch(); m_gridRight->EndBatch(); } -void MainDialog::OnSync(wxCommandEvent& event) +void MainDialog::OnSwitchView(wxCommandEvent& event) +{ + //toggle view + syncPreview->enablePreview(!syncPreview->previewIsEnabled()); +} + + +void MainDialog::OnSyncSettings(wxCommandEvent& event) +{ + SyncDialog* syncDlg = new SyncDialog(this, currentGridData, cfg, ignoreErrors); + if (syncDlg->ShowModal() == SyncDialog::BUTTON_OKAY) + { + redetermineSyncDirection(cfg.syncConfiguration, currentGridData); + updateGuiGrid(); + } +} + + +void MainDialog::OnStartSync(wxCommandEvent& event) { - SyncDialog* syncDlg = new SyncDialog(this, currentGridData, cfg, ignoreErrors, synchronizationEnabled); - if (syncDlg->ShowModal() == SyncDialog::BUTTON_START) + if (syncPreview->synchronizationIsEnabled()) { //check if there are files/folders to be sync'ed at all - if (!synchronizationNeeded(currentGridData, cfg.syncConfiguration)) + if (!synchronizationNeeded(currentGridData)) { wxMessageBox(_("Nothing to synchronize according to configuration!"), _("Information"), wxICON_WARNING); return; } - wxBusyCursor dummy; //show hourglass cursor clearStatusBar(); @@ -1988,6 +2117,15 @@ void MainDialog::OnSync(wxCommandEvent& event) //class handling status updates and error messages SyncStatusHandler statusHandler(this, ignoreErrors); +// //small reminder that synchronization will be starting immediately +// if (globalSettings.shared.warningSynchronizationStarting) //test if check should be executed +// { +// bool dontShowAgain = false; +// statusHandler.reportWarning(_(""), +// dontShowAgain); +// globalSettings.shared.warningSynchronizationStarting = !dontShowAgain; +// } + //start synchronization and return elements that were not sync'ed in currentGridData FreeFileSync::SyncProcess synchronization( cfg.useRecycleBin, @@ -1995,9 +2133,10 @@ void MainDialog::OnSync(wxCommandEvent& event) globalSettings.shared.traverseDirectorySymlinks, globalSettings.shared.warningSignificantDifference, globalSettings.shared.warningNotEnoughDiskSpace, + globalSettings.shared.warningUnresolvedConflicts, &statusHandler); - synchronization.startSynchronizationProcess(currentGridData, cfg.syncConfiguration); + synchronization.startSynchronizationProcess(currentGridData); } catch (AbortThisProcess& theException) { //do NOT disable the sync button: user might want to try to sync the REMAINING rows @@ -2012,17 +2151,16 @@ void MainDialog::OnSync(wxCommandEvent& event) m_gridMiddle->ClearSelection(); m_gridRight->ClearSelection(); - if (gridDataView.elementsTotal() > 0) - pushStatusInformation(_("Not all items were synchronized! Have a look at the list.")); + if (!gridDataView.refGridIsEmpty()) + pushStatusInformation(_("Not all items have been synchronized! Have a look at the list.")); else { pushStatusInformation(_("All items have been synchronized!")); - enableSynchronization(false); + syncPreview->enableSynchronization(false); } } } - void MainDialog::OnLeftGridDoubleClick(wxGridEvent& event) { openWithFileManager(event.GetRow(), true); @@ -2056,7 +2194,7 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) const xmlAccess::ColumnTypes columnType = m_gridLeft->getTypeAtPos(currentSortColumn); switch (columnType) { - case xmlAccess::FULL_NAME: + case xmlAccess::FULL_PATH: gridDataView.sortView(GridView::SORT_BY_DIRECTORY, true, sortAscending); break; case xmlAccess::FILENAME: @@ -2134,7 +2272,7 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) const xmlAccess::ColumnTypes columnType = m_gridRight->getTypeAtPos(currentSortColumn); switch (columnType) { - case xmlAccess::FULL_NAME: + case xmlAccess::FULL_PATH: gridDataView.sortView(GridView::SORT_BY_DIRECTORY, false, sortAscending); break; case xmlAccess::FILENAME: @@ -2167,7 +2305,7 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) } -void MainDialog::OnSwapDirs( wxCommandEvent& event ) +void MainDialog::OnSwapSides(wxCommandEvent& event) { //swap directory names: main pair const wxString leftDir = m_directoryLeft->GetValue(); @@ -2189,8 +2327,10 @@ void MainDialog::OnSwapDirs( wxCommandEvent& event ) } //swap view filter - std::swap(leftOnlyFilesActive, rightOnlyFilesActive); - std::swap(leftNewerFilesActive, rightNewerFilesActive); + std::swap(gridDataView.leftOnlyFilesActive, gridDataView.rightOnlyFilesActive); + std::swap(gridDataView.leftNewerFilesActive, gridDataView.rightNewerFilesActive); + std::swap(gridDataView.syncDirLeftActive, gridDataView.syncDirRightActive); + updateViewFilterButtons(); //swap grid information @@ -2202,16 +2342,11 @@ void MainDialog::OnSwapDirs( wxCommandEvent& event ) void MainDialog::updateGridViewData() { - const GridView::StatusInfo result = gridDataView.update( - leftOnlyFilesActive, - rightOnlyFilesActive, - leftNewerFilesActive, - rightNewerFilesActive, - differentFilesActive, - equalFilesActive, - hideFilteredElements); + const GridView::StatusInfo result = gridDataView.update(hideFilteredElements, syncPreview->previewIsEnabled()); //hide or enable view filter buttons + + //comparison result view buttons if (result.existsLeftOnly) m_bpButtonLeftOnly->Show(); else @@ -2242,12 +2377,38 @@ void MainDialog::updateGridViewData() else m_bpButtonEqual->Hide(); - if ( result.existsLeftOnly || - result.existsRightOnly || - result.existsLeftNewer || - result.existsRightNewer || - result.existsDifferent || - result.existsEqual) + if (result.existsConflict) + m_bpButtonConflict->Show(); + else + m_bpButtonConflict->Hide(); + + //sync preview buttons + if (result.existsSyncDirLeft) + m_bpButtonSyncDirLeft->Show(); + else + m_bpButtonSyncDirLeft->Hide(); + + if (result.existsSyncDirRight) + m_bpButtonSyncDirRight->Show(); + else + m_bpButtonSyncDirRight->Hide(); + + if (result.existsSyncDirNone) + m_bpButtonSyncDirNone->Show(); + else + m_bpButtonSyncDirNone->Hide(); + + + if ( result.existsLeftOnly || + result.existsRightOnly || + result.existsLeftNewer || + result.existsRightNewer || + result.existsDifferent || + result.existsEqual || + result.existsConflict || + result.existsSyncDirLeft || + result.existsSyncDirRight || + result.existsSyncDirNone) { m_panel112->Show(); m_panel112->Layout(); @@ -2304,8 +2465,7 @@ void MainDialog::updateGridViewData() } const wxString objectsView = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(gridDataView.elementsOnView())); - const unsigned int objCount = gridDataView.elementsTotal(); - if (objCount == 1) + if (result.objectsTotal == 1) { wxString outputString = _("%x of 1 row in view"); outputString.Replace(wxT("%x"), objectsView, false); @@ -2313,7 +2473,7 @@ void MainDialog::updateGridViewData() } else { - const wxString objectsTotal = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objCount)); + const wxString objectsTotal = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(result.objectsTotal)); wxString outputString = _("%x of %y rows in view"); outputString.Replace(wxT("%x"), objectsView, false); @@ -2373,7 +2533,7 @@ void MainDialog::OnAddFolderPair(wxCommandEvent& event) addFolderPair(wxEmptyString, wxEmptyString); //disable the sync button - enableSynchronization(false); + syncPreview->enableSynchronization(false); //clear grids currentGridData.clear(); @@ -2392,7 +2552,7 @@ void MainDialog::OnRemoveFolderPair(wxCommandEvent& event) removeFolderPair(i - additionalFolderPairs.begin()); //disable the sync button - enableSynchronization(false); + syncPreview->enableSynchronization(false); //clear grids currentGridData.clear(); @@ -2403,6 +2563,33 @@ void MainDialog::OnRemoveFolderPair(wxCommandEvent& event) } +void MainDialog::calculatePreview() +{ + //update preview of bytes to be transferred: + int objectsToCreate = 0; + int objectsToOverwrite = 0; + int objectsToDelete = 0; + int conflictsDummy = 0; + wxULongLong dataToProcess; + FreeFileSync::calcTotalBytesToSync(currentGridData, + objectsToCreate, + objectsToOverwrite, + objectsToDelete, + conflictsDummy, + dataToProcess); + + const wxString toCreate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToCreate)); + const wxString toUpdate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToOverwrite)); + const wxString toDelete = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToDelete)); + const wxString data = FreeFileSync::formatFilesizeToShortString(dataToProcess); + + m_textCtrlCreate->SetValue(toCreate); + m_textCtrlUpdate->SetValue(toUpdate); + m_textCtrlDelete->SetValue(toDelete); + m_textCtrlData->SetValue(data); +} + + void MainDialog::addFolderPair(const Zstring& leftDir, const Zstring& rightDir) { std::vector<FolderPair> newPairs; @@ -2469,7 +2656,7 @@ void MainDialog::addFolderPair(const std::vector<FolderPair>& newPairs) m_scrolledWindowFolderPairs->Layout(); bSizer1->Layout(); - m_bpButtonSwap->Refresh(); + m_bpButtonSwitchView->Refresh(); } @@ -2637,10 +2824,9 @@ void MainDialog::OnMenuQuit(wxCommandEvent& event) requestShutdown(); } - //######################################################################################################### -//language selection +//language selection void MainDialog::switchProgramLanguage(const int langID) { programLanguage->setLanguage(langID); //language is a global attribute @@ -2734,4 +2920,90 @@ void MainDialog::OnMenuLangSpanish(wxCommandEvent& event) switchProgramLanguage(wxLANGUAGE_SPANISH); } +//######################################################################################################### + + +SyncPreview::SyncPreview(MainDialog* mainDlg) : + mainDlg_(mainDlg), + syncPreviewEnabled(false), + synchronizationEnabled(false) {} + + +bool SyncPreview::previewIsEnabled() +{ + return syncPreviewEnabled; +} + +void SyncPreview::enablePreview(bool value) +{ + if (value) + { + syncPreviewEnabled = true; + + mainDlg_->m_bpButtonSwitchView->SetBitmapLabel(*globalResource.bitmapSyncView); + mainDlg_->m_bpButtonSwitchView->SetToolTip(_("Synchronization Preview")); + + /*mainDlg_->m_bpButtonSyncConfig->Show(); + mainDlg_->m_bpButtonSyncConfig->Enable(); + + mainDlg_->m_buttonStartSync->Show(); + mainDlg_->m_buttonStartSync->Enable();*/ + + mainDlg_->m_panelSyncPreview->Show(); + + mainDlg_->bSizer6->Layout(); + + //toggle display of sync preview in middle grid + mainDlg_->m_gridMiddle->enableSyncPreview(true); + + mainDlg_->Refresh(); + } + else + { + syncPreviewEnabled = false; + + mainDlg_->m_bpButtonSwitchView->SetBitmapLabel(*globalResource.bitmapCmpView); + mainDlg_->m_bpButtonSwitchView->SetToolTip(_("Comparison Result")); + + /*mainDlg_->m_bpButtonSyncConfig->Disable(); + mainDlg_->m_bpButtonSyncConfig->Hide(); + + mainDlg_->m_buttonStartSync->Disable(); + mainDlg_->m_buttonStartSync->Hide();*/ + + mainDlg_->m_panelSyncPreview->Hide(); + + mainDlg_->bSizer6->Layout(); + + //toggle display of sync preview in middle grid + mainDlg_->m_gridMiddle->enableSyncPreview(false); + + mainDlg_->Refresh(); + } + + mainDlg_->updateGuiGrid(); +} + + +void SyncPreview::enableSynchronization(bool value) +{ + if (value) + { + synchronizationEnabled = true; + mainDlg_->m_buttonStartSync->SetForegroundColour(*wxBLACK); + mainDlg_->m_buttonStartSync->setBitmapFront(*globalResource.bitmapSync); + } + else + { + synchronizationEnabled = false; + mainDlg_->m_buttonStartSync->SetForegroundColour(wxColor(94, 94, 94)); //grey + mainDlg_->m_buttonStartSync->setBitmapFront(*globalResource.bitmapSyncDisabled); + } +} + + +bool SyncPreview::synchronizationIsEnabled() +{ + return synchronizationEnabled; +} diff --git a/ui/MainDialog.h b/ui/MainDialog.h index 49d5ceee..671da7ee 100644 --- a/ui/MainDialog.h +++ b/ui/MainDialog.h @@ -20,12 +20,16 @@ class CustomLocale; class MainFolderDragDrop; class FolderPairPanel; class CustomGrid; +class FFSCheckRowsEvent; +class FFSSyncDirectionEvent; +class SyncPreview; class MainDialog : public MainDialogGenerated { friend class CompareStatusHandler; friend class MainFolderDragDrop; + friend class SyncPreview; //IDs for context menu items enum //context menu for left and right grids @@ -36,6 +40,7 @@ class MainDialog : public MainDialogGenerated CONTEXT_CLIPBOARD, CONTEXT_EXPLORER, CONTEXT_DELETE_FILES, + CONTEXT_SWAP_SIDES }; enum //context menu for middle grid @@ -69,7 +74,7 @@ private: void writeGlobalSettings(); void updateViewFilterButtons(); - void updateFilterButton(wxBitmapButton* filterButton, bool isActive); + static void updateFilterButton(wxBitmapButton* filterButton, bool isActive); void updateCompareButtons(); void addFileToCfgHistory(const wxString& filename); @@ -87,8 +92,8 @@ private: void updateGridViewData(); //context menu functions - std::set<int> getSelectedRows(const CustomGrid* grid); - void filterRangeManually(const std::set<int>& rowsToFilterOnUiTable); + std::set<int> getSelectedRows(const CustomGrid* grid) const; + void filterRangeManually(const std::set<int>& rowsToFilterOnUiTable, const int leadingRow); void copySelectionToClipboard(const CustomGrid* selectedGrid); void openWithFileManager(const int rowNumber, const bool leftSide); void deleteSelectedFiles(); @@ -116,10 +121,8 @@ private: void requestShutdown(); //try to exit application - //manual filtering of rows: - void OnGridSelectCell(wxGridEvent& event); - void OnGrid3LeftMouseUp(wxEvent& event); - void OnGrid3LeftMouseDown(wxEvent& event); + void OnCheckRows(FFSCheckRowsEvent& event); + void OnSetSyncDirection(FFSSyncDirectionEvent& event); void OnLeftGridDoubleClick( wxGridEvent& event); void OnRightGridDoubleClick(wxGridEvent& event); @@ -128,15 +131,22 @@ private: void OnSortRightGrid( wxGridEvent& event); void OnLeftOnlyFiles( wxCommandEvent& event); + void OnRightOnlyFiles( wxCommandEvent& event); void OnLeftNewerFiles( wxCommandEvent& event); - void OnDifferentFiles( wxCommandEvent& event); void OnRightNewerFiles( wxCommandEvent& event); - void OnRightOnlyFiles( wxCommandEvent& event); void OnEqualFiles( wxCommandEvent& event); + void OnDifferentFiles( wxCommandEvent& event); + void OnConflictFiles( wxCommandEvent& event); + + void OnSyncDirLeft( wxCommandEvent& event); + void OnSyncDirRight( wxCommandEvent& event); + void OnSyncDirNone( wxCommandEvent& event); void OnSaveConfig( wxCommandEvent& event); void OnLoadConfig( wxCommandEvent& event); void OnLoadFromHistory( wxCommandEvent& event); + bool trySaveConfig(); //return true if saved successfully + void loadConfiguration(const wxString& filename); void OnCfgHistoryKeyEvent( wxKeyEvent& event); void OnFolderHistoryKeyEvent(wxKeyEvent& event); @@ -148,17 +158,21 @@ private: void OnHideFilteredButton( wxCommandEvent& event); void OnConfigureFilter( wxHyperlinkEvent& event); void OnShowHelpDialog( wxCommandEvent& event); - void OnSwapDirs( wxCommandEvent& event); + void OnSwapSides( wxCommandEvent& event); void OnCompareByTimeSize( wxCommandEvent& event); void OnCompareByContent( wxCommandEvent& event); void OnCompare( wxCommandEvent& event); - void OnSync( wxCommandEvent& event); + void OnSwitchView( wxCommandEvent& event); + void OnSyncSettings( wxCommandEvent& event); + void OnStartSync( wxCommandEvent& event); void OnClose( wxCloseEvent& event); void OnQuit( wxCommandEvent& event); void OnAddFolderPair( wxCommandEvent& event); void OnRemoveFolderPair( wxCommandEvent& event); + void calculatePreview(); + //menu events void OnMenuSaveConfig( wxCommandEvent& event); void OnMenuLoadConfig( wxCommandEvent& event); @@ -183,7 +197,6 @@ private: void OnMenuLangSpanish( wxCommandEvent& event); void switchProgramLanguage(const int langID); - void enableSynchronization(bool value); //*********************************************** //application variables are stored here: @@ -217,13 +230,6 @@ private: //convenience method to get all folder pairs (unformatted) std::vector<FreeFileSync::FolderPair> getFolderPairs() const; - //UI View Filter settings - bool leftOnlyFilesActive; - bool leftNewerFilesActive; - bool differentFilesActive; - bool equalFilesActive; - bool rightNewerFilesActive; - bool rightOnlyFilesActive; //*********************************************** std::auto_ptr<wxMenu> contextMenu; @@ -241,11 +247,7 @@ private: std::vector<wxString> cfgFileNames; //used when saving configuration - wxString proposedConfigFileName; - - //variables for filtering of m_grid3 - bool filteringInitialized; - bool filteringPending; + wxString currentConfigFileName; //temporal variables used by exclude via context menu wxString exFilterCandidateExtension; @@ -256,8 +258,6 @@ private: }; std::vector<FilterObject> exFilterCandidateObj; - bool synchronizationEnabled; //determines whether synchronization should be allowed - CompareStatusHandler* cmpStatusHandlerTmp; //used only by the abort button when comparing bool cleanedUp; //determines if destructor code was already executed @@ -269,6 +269,29 @@ private: //support for drag and drop std::auto_ptr<MainFolderDragDrop> dragDropOnLeft; std::auto_ptr<MainFolderDragDrop> dragDropOnRight; + + //encapsulation of handling of sync preview + std::auto_ptr<SyncPreview> syncPreview; +}; + + +class SyncPreview //encapsulates MainDialog functionality for synchronization preview (friend class) +{ + friend class MainDialog; + +public: + void enablePreview(bool value); + bool previewIsEnabled(); + + void enableSynchronization(bool value); + bool synchronizationIsEnabled(); + +private: + SyncPreview(MainDialog* mainDlg); + + MainDialog* mainDlg_; + bool syncPreviewEnabled; //toggle to display configuration preview instead of comparison result + bool synchronizationEnabled; //determines whether synchronization should be allowed }; #endif // MAINDIALOG_H diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp index b553dff7..9ab09e88 100644 --- a/ui/SmallDialogs.cpp +++ b/ui/SmallDialogs.cpp @@ -80,7 +80,7 @@ HelpDlg::HelpDlg(wxWindow* window) : HelpDlgGenerated(window) m_treeCtrl1->AppendItem(treeDifferent, _("- left newer")); m_treeCtrl1->AppendItem(treeDifferent, _("- right newer")); - m_treeCtrl1->AppendItem(treeDifferent, _("- same date (different size)")); + m_treeCtrl1->AppendItem(treeDifferent, _("- conflict (same date, different size)")); m_treeCtrl1->ExpandAll(); @@ -451,9 +451,10 @@ void QuestionDlg::OnNo(wxCommandEvent& event) //######################################################################################## -CustomizeColsDlg::CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr) : +CustomizeColsDlg::CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr, bool& showFileIcons) : CustomizeColsDlgGenerated(window), - output(attr) + output(attr), + m_showFileIcons(showFileIcons) { m_bpButton29->SetBitmapLabel(*globalResource.bitmapMoveUp); m_bpButton30->SetBitmapLabel(*globalResource.bitmapMoveDown); @@ -468,6 +469,12 @@ CustomizeColsDlg::CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes m_checkListColumns->Check(i - columnSettings.begin(), i->visible); } +#ifdef FFS_LINUX //file icons currently supported on Windows only + m_checkBoxShowFileIcons->Hide(); +#endif + + m_checkBoxShowFileIcons->SetValue(m_showFileIcons); + m_checkListColumns->SetSelection(0); Fit(); } @@ -489,6 +496,8 @@ void CustomizeColsDlg::OnOkay(wxCommandEvent& event) } } + m_showFileIcons = m_checkBoxShowFileIcons->GetValue(); + EndModal(BUTTON_OKAY); } @@ -503,6 +512,8 @@ void CustomizeColsDlg::OnDefault(wxCommandEvent& event) m_checkListColumns->Append(CustomGridRim::getTypeName(i->type)); m_checkListColumns->Check(i - defaultColumnAttr.begin(), i->visible); } + + m_checkBoxShowFileIcons->SetValue(true); } @@ -560,6 +571,8 @@ GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSetti m_buttonResetWarnings->setBitmapFront(*globalResource.bitmapWarningSmall, 5); m_spinCtrlFileTimeTolerance->SetValue(globalSettings.shared.fileTimeTolerance); + m_checkBoxIgnoreOneHour->SetValue(globalSettings.shared.ignoreOneHourDiff); + m_textCtrlFileManager->SetValue(globalSettings.gui.commandLineFileManager); Fit(); @@ -569,8 +582,9 @@ GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSetti void GlobalSettingsDlg::OnOkay(wxCommandEvent& event) { //write global settings only when okay-button is pressed! - settings.shared.fileTimeTolerance = m_spinCtrlFileTimeTolerance->GetValue(); + settings.shared.ignoreOneHourDiff = m_checkBoxIgnoreOneHour->GetValue(); + settings.gui.commandLineFileManager = m_textCtrlFileManager->GetValue(); EndModal(BUTTON_OKAY); @@ -588,6 +602,7 @@ void GlobalSettingsDlg::OnResetWarnings(wxCommandEvent& event) void GlobalSettingsDlg::OnDefault(wxCommandEvent& event) { m_spinCtrlFileTimeTolerance->SetValue(2); + m_checkBoxIgnoreOneHour->SetValue(true); #ifdef FFS_WIN m_textCtrlFileManager->SetValue(wxT("explorer /select, %name")); #elif defined FFS_LINUX @@ -948,13 +963,13 @@ void SyncStatus::setCurrentStatus(SyncStatusID id) break; case SCANNING: - m_bitmapStatus->SetBitmap(*globalResource.bitmapStatusComparing); + m_bitmapStatus->SetBitmap(*globalResource.bitmapStatusScanning); m_staticTextStatus->SetLabel(_("Scanning...")); break; - case COMPARING: - m_bitmapStatus->SetBitmap(*globalResource.bitmapStatusComparing); - m_staticTextStatus->SetLabel(_("Comparing...")); + case COMPARING_CONTENT: + m_bitmapStatus->SetBitmap(*globalResource.bitmapStatusBinCompare); + m_staticTextStatus->SetLabel(_("Comparing content...")); break; case SYNCHRONIZING: diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h index a2d2c752..2c3e89d2 100644 --- a/ui/SmallDialogs.h +++ b/ui/SmallDialogs.h @@ -165,7 +165,7 @@ private: class CustomizeColsDlg : public CustomizeColsDlgGenerated { public: - CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr); + CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr, bool& showFileIcons); ~CustomizeColsDlg() {} enum @@ -183,6 +183,7 @@ private: void OnMoveDown(wxCommandEvent& event); xmlAccess::ColumnAttributes& output; + bool& m_showFileIcons; }; @@ -255,7 +256,7 @@ public: FINISHED_WITH_ERROR, PAUSE, SCANNING, - COMPARING, + COMPARING_CONTENT, SYNCHRONIZING }; diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp index 3c684700..2004a06c 100644 --- a/ui/SyncDialog.cpp +++ b/ui/SyncDialog.cpp @@ -16,8 +16,7 @@ using namespace FreeFileSync; SyncDialog::SyncDialog(wxWindow* window, const FolderComparison& folderCmpRef, MainConfiguration& config, - bool& ignoreErrors, - bool synchronizationEnabled) : + bool& ignoreErrors) : SyncDlgGenerated(window), folderCmp(folderCmpRef), cfg(config), @@ -29,61 +28,43 @@ SyncDialog::SyncDialog(wxWindow* window, m_checkBoxIgnoreErrors->SetValue(m_ignoreErrors); //set sync config icons - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - //update preview - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //set icons for this dialog - m_bitmap13->SetBitmap(*globalResource.bitmapLeftOnly); - m_bitmap14->SetBitmap(*globalResource.bitmapRightOnly); - m_bitmap15->SetBitmap(*globalResource.bitmapLeftNewer); - m_bitmap16->SetBitmap(*globalResource.bitmapRightNewer); - m_bitmap17->SetBitmap(*globalResource.bitmapDifferent); - - if (synchronizationEnabled) - { - m_button18->SetForegroundColour(*wxBLACK); - m_button18->setBitmapFront(*globalResource.bitmapStartSync); - m_button18->Enable(); - } - else - { - m_button18->SetForegroundColour(wxColor(94, 94, 94)); //grey - m_button18->setBitmapFront(*globalResource.bitmapStartSyncDis); - m_button18->Disable(); - m_button6->SetFocus(); - } + m_bitmapLeftOnly->SetBitmap(*globalResource.bitmapLeftOnly); + m_bitmapRightOnly->SetBitmap(*globalResource.bitmapRightOnly); + m_bitmapLeftNewer->SetBitmap(*globalResource.bitmapLeftNewer); + m_bitmapRightNewer->SetBitmap(*globalResource.bitmapRightNewer); + m_bitmapDifferent->SetBitmap(*globalResource.bitmapDifferent); bSizer201->Layout(); //wxButtonWithImage size might have changed - //set radiobutton - if ( localSyncConfiguration.exLeftSideOnly == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.exRightSideOnly == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.leftNewer == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.rightNewer == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.different == SyncConfiguration::SYNC_DIR_RIGHT) + if ( localSyncConfiguration.exLeftSideOnly == SYNC_DIR_RIGHT && + localSyncConfiguration.exRightSideOnly == SYNC_DIR_RIGHT && + localSyncConfiguration.leftNewer == SYNC_DIR_RIGHT && + localSyncConfiguration.rightNewer == SYNC_DIR_RIGHT && + localSyncConfiguration.different == SYNC_DIR_RIGHT) m_radioBtn1->SetValue(true); //one way -> - else if (localSyncConfiguration.exLeftSideOnly == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.exRightSideOnly == SyncConfiguration::SYNC_DIR_NONE && - localSyncConfiguration.leftNewer == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.rightNewer == SyncConfiguration::SYNC_DIR_NONE && - localSyncConfiguration.different == SyncConfiguration::SYNC_DIR_NONE) + else if (localSyncConfiguration.exLeftSideOnly == SYNC_DIR_RIGHT && + localSyncConfiguration.exRightSideOnly == SYNC_DIR_NONE && + localSyncConfiguration.leftNewer == SYNC_DIR_RIGHT && + localSyncConfiguration.rightNewer == SYNC_DIR_NONE && + localSyncConfiguration.different == SYNC_DIR_NONE) m_radioBtnUpdate->SetValue(true); //Update -> - else if (localSyncConfiguration.exLeftSideOnly == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.exRightSideOnly == SyncConfiguration::SYNC_DIR_LEFT && - localSyncConfiguration.leftNewer == SyncConfiguration::SYNC_DIR_RIGHT && - localSyncConfiguration.rightNewer == SyncConfiguration::SYNC_DIR_LEFT && - localSyncConfiguration.different == SyncConfiguration::SYNC_DIR_NONE) + else if (localSyncConfiguration.exLeftSideOnly == SYNC_DIR_RIGHT && + localSyncConfiguration.exRightSideOnly == SYNC_DIR_LEFT && + localSyncConfiguration.leftNewer == SYNC_DIR_RIGHT && + localSyncConfiguration.rightNewer == SYNC_DIR_LEFT && + localSyncConfiguration.different == SYNC_DIR_NONE) m_radioBtn2->SetValue(true); //two way <-> else m_radioBtn3->SetValue(true); //other - //set tooltip for ambivalent category "different" - adjustToolTips(m_bitmap17, config.compareVar); + Fit(); } //################################################################################################################# @@ -91,136 +72,151 @@ SyncDialog::SyncDialog(wxWindow* window, SyncDialog::~SyncDialog() {} -void SyncDialog::updateConfigIcons(wxBitmapButton* button1, - wxBitmapButton* button2, - wxBitmapButton* button3, - wxBitmapButton* button4, - wxBitmapButton* button5, - const SyncConfiguration& syncConfig) +void SyncDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig) +{ + updateConfigIcons(cmpVar, + syncConfig, + m_bpButtonLeftOnly, + m_bpButtonRightOnly, + m_bpButtonLeftNewer, + m_bpButtonRightNewer, + m_bpButtonDifferent, + m_bitmapLeftOnly, + m_bitmapRightOnly, + m_bitmapLeftNewer, + m_bitmapRightNewer, + m_bitmapDifferent); +} + + +void SyncDialog::updateConfigIcons(const CompareVariant compareVar, + const SyncConfiguration& syncConfig, + wxBitmapButton* buttonLeftOnly, + wxBitmapButton* buttonRightOnly, + wxBitmapButton* buttonLeftNewer, + wxBitmapButton* buttonRightNewer, + wxBitmapButton* buttonDifferent, + wxStaticBitmap* bitmapLeftOnly, + wxStaticBitmap* bitmapRightOnly, + wxStaticBitmap* bitmapLeftNewer, + wxStaticBitmap* bitmapRightNewer, + wxStaticBitmap* bitmapDifferent) { - if (syncConfig.exLeftSideOnly == SyncConfiguration::SYNC_DIR_RIGHT) + //display only relevant sync options + switch (compareVar) { - button1->SetBitmapLabel(*globalResource.bitmapArrowRightCr); - button1->SetToolTip(_("Copy from left to right")); + case CMP_BY_TIME_SIZE: + buttonLeftOnly->Show(); + buttonRightOnly->Show(); + buttonLeftNewer->Show(); + buttonRightNewer->Show(); + buttonDifferent->Hide(); + + bitmapLeftOnly->Show(); + bitmapRightOnly->Show(); + bitmapLeftNewer->Show(); + bitmapRightNewer->Show(); + bitmapDifferent->Hide(); + break; + + case CMP_BY_CONTENT: + buttonLeftOnly->Show(); + buttonRightOnly->Show(); + buttonLeftNewer->Hide(); + buttonRightNewer->Hide(); + buttonDifferent->Show(); + + bitmapLeftOnly->Show(); + bitmapRightOnly->Show(); + bitmapLeftNewer->Hide(); + bitmapRightNewer->Hide(); + bitmapDifferent->Show(); + break; } - else if (syncConfig.exLeftSideOnly == SyncConfiguration::SYNC_DIR_LEFT) + + + if (syncConfig.exLeftSideOnly == SYNC_DIR_RIGHT) + { + buttonLeftOnly->SetBitmapLabel(*globalResource.bitmapArrowRightCr); + buttonLeftOnly->SetToolTip(_("Copy from left to right")); + } + else if (syncConfig.exLeftSideOnly == SYNC_DIR_LEFT) { - button1->SetBitmapLabel(*globalResource.bitmapDeleteLeft); - button1->SetToolTip(_("Delete files/folders existing on left side only")); + buttonLeftOnly->SetBitmapLabel(*globalResource.bitmapDeleteLeft); + buttonLeftOnly->SetToolTip(_("Delete files/folders existing on left side only")); } - else if (syncConfig.exLeftSideOnly == SyncConfiguration::SYNC_DIR_NONE) + else if (syncConfig.exLeftSideOnly == SYNC_DIR_NONE) { - button1->SetBitmapLabel(*globalResource.bitmapArrowNone); - button1->SetToolTip(_("Do nothing")); + buttonLeftOnly->SetBitmapLabel(*globalResource.bitmapArrowNone); + buttonLeftOnly->SetToolTip(_("Do nothing")); } - if (syncConfig.exRightSideOnly == SyncConfiguration::SYNC_DIR_RIGHT) + if (syncConfig.exRightSideOnly == SYNC_DIR_RIGHT) { - button2->SetBitmapLabel(*globalResource.bitmapDeleteRight); - button2->SetToolTip(_("Delete files/folders existing on right side only")); + buttonRightOnly->SetBitmapLabel(*globalResource.bitmapDeleteRight); + buttonRightOnly->SetToolTip(_("Delete files/folders existing on right side only")); } - else if (syncConfig.exRightSideOnly == SyncConfiguration::SYNC_DIR_LEFT) + else if (syncConfig.exRightSideOnly == SYNC_DIR_LEFT) { - button2->SetBitmapLabel(*globalResource.bitmapArrowLeftCr); - button2->SetToolTip(_("Copy from right to left")); + buttonRightOnly->SetBitmapLabel(*globalResource.bitmapArrowLeftCr); + buttonRightOnly->SetToolTip(_("Copy from right to left")); } - else if (syncConfig.exRightSideOnly == SyncConfiguration::SYNC_DIR_NONE) + else if (syncConfig.exRightSideOnly == SYNC_DIR_NONE) { - button2->SetBitmapLabel(*globalResource.bitmapArrowNone); - button2->SetToolTip(_("Do nothing")); + buttonRightOnly->SetBitmapLabel(*globalResource.bitmapArrowNone); + buttonRightOnly->SetToolTip(_("Do nothing")); } - if (syncConfig.leftNewer == SyncConfiguration::SYNC_DIR_RIGHT) + if (syncConfig.leftNewer == SYNC_DIR_RIGHT) { - button3->SetBitmapLabel(*globalResource.bitmapArrowRight); - button3->SetToolTip(_("Copy from left to right overwriting")); + buttonLeftNewer->SetBitmapLabel(*globalResource.bitmapArrowRight); + buttonLeftNewer->SetToolTip(_("Copy from left to right overwriting")); } - else if (syncConfig.leftNewer == SyncConfiguration::SYNC_DIR_LEFT) + else if (syncConfig.leftNewer == SYNC_DIR_LEFT) { - button3->SetBitmapLabel(*globalResource.bitmapArrowLeft); - button3->SetToolTip(_("Copy from right to left overwriting")); + buttonLeftNewer->SetBitmapLabel(*globalResource.bitmapArrowLeft); + buttonLeftNewer->SetToolTip(_("Copy from right to left overwriting")); } - else if (syncConfig.leftNewer == SyncConfiguration::SYNC_DIR_NONE) + else if (syncConfig.leftNewer == SYNC_DIR_NONE) { - button3->SetBitmapLabel(*globalResource.bitmapArrowNone); - button3->SetToolTip(_("Do nothing")); + buttonLeftNewer->SetBitmapLabel(*globalResource.bitmapArrowNone); + buttonLeftNewer->SetToolTip(_("Do nothing")); } - if (syncConfig.rightNewer == SyncConfiguration::SYNC_DIR_RIGHT) + if (syncConfig.rightNewer == SYNC_DIR_RIGHT) { - button4->SetBitmapLabel(*globalResource.bitmapArrowRight); - button4->SetToolTip(_("Copy from left to right overwriting")); + buttonRightNewer->SetBitmapLabel(*globalResource.bitmapArrowRight); + buttonRightNewer->SetToolTip(_("Copy from left to right overwriting")); } - else if (syncConfig.rightNewer == SyncConfiguration::SYNC_DIR_LEFT) + else if (syncConfig.rightNewer == SYNC_DIR_LEFT) { - button4->SetBitmapLabel(*globalResource.bitmapArrowLeft); - button4->SetToolTip(_("Copy from right to left overwriting")); + buttonRightNewer->SetBitmapLabel(*globalResource.bitmapArrowLeft); + buttonRightNewer->SetToolTip(_("Copy from right to left overwriting")); } - else if (syncConfig.rightNewer == SyncConfiguration::SYNC_DIR_NONE) + else if (syncConfig.rightNewer == SYNC_DIR_NONE) { - button4->SetBitmapLabel(*globalResource.bitmapArrowNone); - button4->SetToolTip(_("Do nothing")); + buttonRightNewer->SetBitmapLabel(*globalResource.bitmapArrowNone); + buttonRightNewer->SetToolTip(_("Do nothing")); } - if (syncConfig.different == SyncConfiguration::SYNC_DIR_RIGHT) + if (syncConfig.different == SYNC_DIR_RIGHT) { - button5->SetBitmapLabel(*globalResource.bitmapArrowRight); - button5->SetToolTip(_("Copy from left to right overwriting")); + buttonDifferent->SetBitmapLabel(*globalResource.bitmapArrowRight); + buttonDifferent->SetToolTip(_("Copy from left to right overwriting")); } - else if (syncConfig.different == SyncConfiguration::SYNC_DIR_LEFT) + else if (syncConfig.different == SYNC_DIR_LEFT) { - button5->SetBitmapLabel(*globalResource.bitmapArrowLeft); - button5->SetToolTip(_("Copy from right to left overwriting")); + buttonDifferent->SetBitmapLabel(*globalResource.bitmapArrowLeft); + buttonDifferent->SetToolTip(_("Copy from right to left overwriting")); } - else if (syncConfig.different == SyncConfiguration::SYNC_DIR_NONE) + else if (syncConfig.different == SYNC_DIR_NONE) { - button5->SetBitmapLabel(*globalResource.bitmapArrowNone); - button5->SetToolTip(_("Do nothing")); + buttonDifferent->SetBitmapLabel(*globalResource.bitmapArrowNone); + buttonDifferent->SetToolTip(_("Do nothing")); } } -void SyncDialog::adjustToolTips(wxStaticBitmap* bitmap, const CompareVariant var) -{ - //set tooltip for ambivalent category "different" - switch (var) - { - case CMP_BY_TIME_SIZE: - bitmap->SetToolTip(_("Files that exist on both sides, have same date but different filesizes")); - break; - case CMP_BY_CONTENT: - bitmap->SetToolTip(_("Files that exist on both sides and have different content")); - break; - } -} - - -void SyncDialog::calculatePreview() -{ - //update preview of bytes to be transferred: - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - wxULongLong dataToProcess; - FreeFileSync::calcTotalBytesToSync(folderCmp, - localSyncConfiguration, - objectsToCreate, - objectsToOverwrite, - objectsToDelete, - dataToProcess); - - const wxString toCreate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToCreate)); - const wxString toUpdate = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToOverwrite)); - const wxString toDelete = globalFunctions::includeNumberSeparator(globalFunctions::numberToWxString(objectsToDelete)); - const wxString data = FreeFileSync::formatFilesizeToShortString(dataToProcess); - - m_textCtrlCreate->SetValue(toCreate); - m_textCtrlUpdate->SetValue(toUpdate); - m_textCtrlDelete->SetValue(toDelete); - m_textCtrlData->SetValue(data); -} - - void SyncDialog::OnClose(wxCloseEvent& event) { EndModal(0); @@ -233,24 +229,14 @@ void SyncDialog::OnCancel(wxCommandEvent& event) } -void SyncDialog::OnBack(wxCommandEvent& event) -{ - //write configuration to main dialog - cfg.syncConfiguration = localSyncConfiguration; - cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); - m_ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); - - EndModal(0); -} - -void SyncDialog::OnStartSync(wxCommandEvent& event) +void SyncDialog::OnApply(wxCommandEvent& event) { //write configuration to main dialog cfg.syncConfiguration = localSyncConfiguration; cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); m_ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); - EndModal(BUTTON_START); + EndModal(BUTTON_OKAY); } @@ -269,14 +255,13 @@ void SyncDialog::OnSelectRecycleBin(wxCommandEvent& event) void SyncDialog::OnSyncLeftToRight(wxCommandEvent& event) { - localSyncConfiguration.exLeftSideOnly = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.exRightSideOnly = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.leftNewer = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.rightNewer = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.different = SyncConfiguration::SYNC_DIR_RIGHT; + localSyncConfiguration.exLeftSideOnly = SYNC_DIR_RIGHT; + localSyncConfiguration.exRightSideOnly = SYNC_DIR_RIGHT; + localSyncConfiguration.leftNewer = SYNC_DIR_RIGHT; + localSyncConfiguration.rightNewer = SYNC_DIR_RIGHT; + localSyncConfiguration.different = SYNC_DIR_RIGHT; - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //if event is triggered by button m_radioBtn1->SetValue(true); @@ -285,14 +270,13 @@ void SyncDialog::OnSyncLeftToRight(wxCommandEvent& event) void SyncDialog::OnSyncUpdate(wxCommandEvent& event) { - localSyncConfiguration.exLeftSideOnly = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.exRightSideOnly = SyncConfiguration::SYNC_DIR_NONE; - localSyncConfiguration.leftNewer = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.rightNewer = SyncConfiguration::SYNC_DIR_NONE; - localSyncConfiguration.different = SyncConfiguration::SYNC_DIR_NONE; + localSyncConfiguration.exLeftSideOnly = SYNC_DIR_RIGHT; + localSyncConfiguration.exRightSideOnly = SYNC_DIR_NONE; + localSyncConfiguration.leftNewer = SYNC_DIR_RIGHT; + localSyncConfiguration.rightNewer = SYNC_DIR_NONE; + localSyncConfiguration.different = SYNC_DIR_NONE; - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //if event is triggered by button m_radioBtnUpdate->SetValue(true); @@ -301,28 +285,27 @@ void SyncDialog::OnSyncUpdate(wxCommandEvent& event) void SyncDialog::OnSyncBothSides(wxCommandEvent& event) { - localSyncConfiguration.exLeftSideOnly = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.exRightSideOnly = SyncConfiguration::SYNC_DIR_LEFT; - localSyncConfiguration.leftNewer = SyncConfiguration::SYNC_DIR_RIGHT; - localSyncConfiguration.rightNewer = SyncConfiguration::SYNC_DIR_LEFT; - localSyncConfiguration.different = SyncConfiguration::SYNC_DIR_NONE; + localSyncConfiguration.exLeftSideOnly = SYNC_DIR_RIGHT; + localSyncConfiguration.exRightSideOnly = SYNC_DIR_LEFT; + localSyncConfiguration.leftNewer = SYNC_DIR_RIGHT; + localSyncConfiguration.rightNewer = SYNC_DIR_LEFT; + localSyncConfiguration.different = SYNC_DIR_NONE; - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //if event is triggered by button m_radioBtn2->SetValue(true); } -void toggleSyncDirection(SyncConfiguration::Direction& current) +void toggleSyncDirection(SyncDirection& current) { - if (current == SyncConfiguration::SYNC_DIR_RIGHT) - current = SyncConfiguration::SYNC_DIR_LEFT; - else if (current == SyncConfiguration::SYNC_DIR_LEFT) - current = SyncConfiguration::SYNC_DIR_NONE; - else if (current== SyncConfiguration::SYNC_DIR_NONE) - current = SyncConfiguration::SYNC_DIR_RIGHT; + if (current == SYNC_DIR_RIGHT) + current = SYNC_DIR_LEFT; + else if (current == SYNC_DIR_LEFT) + current = SYNC_DIR_NONE; + else if (current== SYNC_DIR_NONE) + current = SYNC_DIR_RIGHT; else assert (false); } @@ -331,8 +314,7 @@ void toggleSyncDirection(SyncConfiguration::Direction& current) void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //set custom config button m_radioBtn3->SetValue(true); } @@ -341,8 +323,7 @@ void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exRightSideOnly); - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //set custom config button m_radioBtn3->SetValue(true); } @@ -351,8 +332,7 @@ void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) void SyncDialog::OnLeftNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.leftNewer); - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //set custom config button m_radioBtn3->SetValue(true); } @@ -361,8 +341,7 @@ void SyncDialog::OnLeftNewer( wxCommandEvent& event ) void SyncDialog::OnRightNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.rightNewer); - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //set custom config button m_radioBtn3->SetValue(true); } @@ -371,8 +350,7 @@ void SyncDialog::OnRightNewer( wxCommandEvent& event ) void SyncDialog::OnDifferent( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.different); - updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); - calculatePreview(); + updateConfigIcons(cfg.compareVar, localSyncConfiguration); //set custom config button m_radioBtn3->SetValue(true); } @@ -452,11 +430,11 @@ void BatchDialog::init() dragDropOnLogfileDir.reset(new DragDropOnDlg(m_panelLogging, m_dirPickerLogfileDir, m_textCtrlLogfileDir)); //set icons for this dialog - m_bitmap13->SetBitmap(*globalResource.bitmapLeftOnly); - m_bitmap14->SetBitmap(*globalResource.bitmapRightOnly); - m_bitmap15->SetBitmap(*globalResource.bitmapLeftNewer); - m_bitmap16->SetBitmap(*globalResource.bitmapRightNewer); - m_bitmap17->SetBitmap(*globalResource.bitmapDifferent); + m_bitmapLeftOnly->SetBitmap(*globalResource.bitmapLeftOnly); + m_bitmapRightOnly->SetBitmap(*globalResource.bitmapRightOnly); + m_bitmapLeftNewer->SetBitmap(*globalResource.bitmapLeftNewer); + m_bitmapRightNewer->SetBitmap(*globalResource.bitmapRightNewer); + m_bitmapDifferent->SetBitmap(*globalResource.bitmapDifferent); m_bitmap8->SetBitmap(*globalResource.bitmapInclude); m_bitmap9->SetBitmap(*globalResource.bitmapExclude); m_bitmap27->SetBitmap(*globalResource.bitmapBatch); @@ -536,35 +514,35 @@ void BatchDialog::OnChangeErrorHandling(wxCommandEvent& event) void BatchDialog::OnExLeftSideOnly(wxCommandEvent& event) { toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); - SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); } void BatchDialog::OnExRightSideOnly(wxCommandEvent& event) { toggleSyncDirection(localSyncConfiguration.exRightSideOnly); - SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); } void BatchDialog::OnLeftNewer(wxCommandEvent& event) { toggleSyncDirection(localSyncConfiguration.leftNewer); - SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); } void BatchDialog::OnRightNewer(wxCommandEvent& event) { toggleSyncDirection(localSyncConfiguration.rightNewer); - SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); } void BatchDialog::OnDifferent(wxCommandEvent& event) { toggleSyncDirection(localSyncConfiguration.different); - SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); } @@ -630,21 +608,41 @@ void BatchDialog::OnSelectRecycleBin(wxCommandEvent& event) } -void BatchDialog::OnChangeCompareVar(wxCommandEvent& event) +CompareVariant BatchDialog::getCurrentCompareVar() { - CompareVariant var; if (m_radioBtnSizeDate->GetValue()) - var = CMP_BY_TIME_SIZE; + return CMP_BY_TIME_SIZE; else if (m_radioBtnContent->GetValue()) - var = CMP_BY_CONTENT; + return CMP_BY_CONTENT; else { assert(false); - var = CMP_BY_TIME_SIZE; + return CMP_BY_TIME_SIZE; } +} - //set tooltip for ambivalent category "different" - SyncDialog::adjustToolTips(m_bitmap17, var); + +void BatchDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig) +{ + SyncDialog::updateConfigIcons(cmpVar, + syncConfig, + m_bpButtonLeftOnly, + m_bpButtonRightOnly, + m_bpButtonLeftNewer, + m_bpButtonRightNewer, + m_bpButtonDifferent, + m_bitmapLeftOnly, + m_bitmapRightOnly, + m_bitmapLeftNewer, + m_bitmapRightNewer, + m_bitmapDifferent); +} + + +void BatchDialog::OnChangeCompareVar(wxCommandEvent& event) +{ + updateConfigIcons(getCurrentCompareVar(), localSyncConfiguration); + Fit(); } @@ -700,13 +698,7 @@ bool BatchDialog::saveBatchFile(const wxString& filename) xmlAccess::XmlBatchConfig batchCfg; //load structure with basic settings "mainCfg" - if (m_radioBtnSizeDate->GetValue()) - batchCfg.mainCfg.compareVar = CMP_BY_TIME_SIZE; - else if (m_radioBtnContent->GetValue()) - batchCfg.mainCfg.compareVar = CMP_BY_CONTENT; - else - return false; - + batchCfg.mainCfg.compareVar = getCurrentCompareVar(); batchCfg.mainCfg.syncConfiguration = localSyncConfiguration; batchCfg.mainCfg.filterIsActive = m_checkBoxFilter->GetValue(); batchCfg.mainCfg.includeFilter = m_textCtrlInclude->GetValue(); @@ -770,7 +762,6 @@ void BatchDialog::loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg) { //make working copy of mainDialog.cfg.syncConfiguration and recycler setting localSyncConfiguration = batchCfg.mainCfg.syncConfiguration; - SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); m_checkBoxUseRecycler->SetValue(batchCfg.mainCfg.useRecycleBin); setSelectionHandleError(batchCfg.handleError); @@ -783,11 +774,9 @@ void BatchDialog::loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg) case CMP_BY_CONTENT: m_radioBtnContent->SetValue(true); break; - default: - assert (false); } - //adjust toolTip - SyncDialog::adjustToolTips(m_bitmap17, batchCfg.mainCfg.compareVar); + + updateConfigIcons(batchCfg.mainCfg.compareVar, batchCfg.mainCfg.syncConfiguration); m_checkBoxFilter->SetValue(batchCfg.mainCfg.filterIsActive); m_textCtrlInclude->SetValue(batchCfg.mainCfg.includeFilter); diff --git a/ui/SyncDialog.h b/ui/SyncDialog.h index 2c705122..940efac7 100644 --- a/ui/SyncDialog.h +++ b/ui/SyncDialog.h @@ -21,28 +21,31 @@ public: SyncDialog(wxWindow* window, const FreeFileSync::FolderComparison& folderCmpRef, FreeFileSync::MainConfiguration& config, - bool& ignoreErrors, - bool synchronizationEnabled); + bool& ignoreErrors); ~SyncDialog(); enum { - BUTTON_START = 15 + BUTTON_OKAY = 10 }; - static void updateConfigIcons(wxBitmapButton* button1, - wxBitmapButton* button2, - wxBitmapButton* button3, - wxBitmapButton* button4, - wxBitmapButton* button5, - const FreeFileSync::SyncConfiguration& syncConfig); - - static void adjustToolTips(wxStaticBitmap* bitmap, const FreeFileSync::CompareVariant var); + static void updateConfigIcons(const FreeFileSync::CompareVariant compareVar, + const FreeFileSync::SyncConfiguration& syncConfig, + wxBitmapButton* buttonLeftOnly, + wxBitmapButton* buttonRightOnly, + wxBitmapButton* buttonLeftNewer, + wxBitmapButton* buttonRightNewer, + wxBitmapButton* buttonDifferent, + wxStaticBitmap* bitmapLeftOnly, + wxStaticBitmap* bitmapRightOnly, + wxStaticBitmap* bitmapLeftNewer, + wxStaticBitmap* bitmapRightNewer, + wxStaticBitmap* bitmapDifferent); + //some syntax relaxation + void updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig); private: - void calculatePreview(); - void OnSyncLeftToRight( wxCommandEvent& event); void OnSyncUpdate( wxCommandEvent& event); void OnSyncBothSides( wxCommandEvent& event); @@ -53,10 +56,9 @@ private: 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 OnApply( wxCommandEvent& event); void OnSelectRecycleBin(wxCommandEvent& event); @@ -98,6 +100,11 @@ private: void OnSelectRecycleBin(wxCommandEvent& event); void OnChangeCompareVar(wxCommandEvent& event); + FreeFileSync::CompareVariant getCurrentCompareVar(); + + void updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig); + + void updateVisibleTabs(); void showNotebookpage(wxWindow* page, const wxString& pageName, bool show); diff --git a/ui/batchStatusHandler.cpp b/ui/batchStatusHandler.cpp index 462b1921..716dccd5 100644 --- a/ui/batchStatusHandler.cpp +++ b/ui/batchStatusHandler.cpp @@ -209,7 +209,7 @@ BatchStatusHandlerSilent::~BatchStatusHandlerSilent() unsigned int failedItems = unhandledErrors.GetCount(); //write result - if (abortRequested) + if (abortIsRequested()) { returnValue = -4; m_log->write(_("Synchronization aborted!"), _("Error")); @@ -227,8 +227,18 @@ BatchStatusHandlerSilent::~BatchStatusHandlerSilent() inline void BatchStatusHandlerSilent::updateStatusText(const Zstring& text) { - if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING) + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + case StatusHandler::PROCESS_COMPARING_CONTENT: + break; + case StatusHandler::PROCESS_SYNCHRONIZING: m_log->write(text.c_str(), _("Info")); + break; + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } } @@ -360,7 +370,7 @@ void BatchStatusHandlerSilent::reportWarning(const Zstring& warningMessage, bool void BatchStatusHandlerSilent::addFinalInfo(const Zstring& infoMessage) { - m_log->write(infoMessage.c_str(), _("Info")); + m_log->write(infoMessage.c_str(), _("Info")); } @@ -372,7 +382,7 @@ void BatchStatusHandlerSilent::forceUiRefresh() void BatchStatusHandlerSilent::abortThisProcess() //used by sys-tray menu { - abortRequested = true; + requestAbortion(); throw FreeFileSync::AbortThisProcess(); } @@ -416,7 +426,7 @@ BatchStatusHandlerGui::~BatchStatusHandlerGui() finalMessage += finalInfo + wxT("\n\n"); //notify to syncStatusFrame that current process has ended - if (abortRequested) + if (abortIsRequested()) { returnValue = -4; finalMessage += _("Synchronization aborted!"); @@ -450,41 +460,49 @@ void BatchStatusHandlerGui::initNewProcess(int objectsTotal, wxLongLong dataTota { currentProcess = processID; - if (currentProcess == StatusHandler::PROCESS_SCANNING) - syncStatusFrame->setCurrentStatus(SyncStatus::SCANNING); - - else if (currentProcess == StatusHandler::PROCESS_COMPARING_CONTENT) + switch (currentProcess) { + case StatusHandler::PROCESS_SCANNING: + syncStatusFrame->resetGauge(0, 0); //dummy call to initialize some gui elements (remaining time, speed) + syncStatusFrame->setCurrentStatus(SyncStatus::SCANNING); + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: syncStatusFrame->resetGauge(objectsTotal, dataTotal); - syncStatusFrame->setCurrentStatus(SyncStatus::COMPARING); - } - - else if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING) - { + syncStatusFrame->setCurrentStatus(SyncStatus::COMPARING_CONTENT); + break; + case StatusHandler::PROCESS_SYNCHRONIZING: syncStatusFrame->resetGauge(objectsTotal, dataTotal); syncStatusFrame->setCurrentStatus(SyncStatus::SYNCHRONIZING); + break; + case StatusHandler::PROCESS_NONE: + assert(false); + break; } - else assert(false); } inline void BatchStatusHandlerGui::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) { - if (currentProcess == StatusHandler::PROCESS_SCANNING) - ; - else if (currentProcess == StatusHandler::PROCESS_COMPARING_CONTENT) - syncStatusFrame->incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); - else if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING) + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: + case StatusHandler::PROCESS_SYNCHRONIZING: syncStatusFrame->incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); - else assert(false); + break; + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } } ErrorHandler::Response BatchStatusHandlerGui::reportError(const Zstring& errorMessage) { //add current time before error message - wxString errorWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + errorMessage.c_str(); + const wxString errorWithTime = wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + errorMessage.c_str(); switch (m_handleError) { @@ -545,6 +563,8 @@ void BatchStatusHandlerGui::reportWarning(const Zstring& warningMessage, bool& d case xmlAccess::ON_ERROR_POPUP: case xmlAccess::ON_ERROR_EXIT: //show popup in this case also { + syncStatusFrame->updateStatusDialogNow(); + //show popup and ask user how to handle warning bool dontWarnAgain = false; WarningDlg* warningDlg = new WarningDlg(NULL, @@ -585,12 +605,12 @@ void BatchStatusHandlerGui::forceUiRefresh() void BatchStatusHandlerGui::abortThisProcess() { - abortRequested = true; + requestAbortion(); throw FreeFileSync::AbortThisProcess(); //abort can be triggered by syncStatusFrame } void BatchStatusHandlerGui::addFinalInfo(const Zstring& infoMessage) { - finalInfo = infoMessage.c_str(); + finalInfo = infoMessage.c_str(); } diff --git a/ui/dragAndDrop.cpp b/ui/dragAndDrop.cpp index c7aea906..2989e544 100644 --- a/ui/dragAndDrop.cpp +++ b/ui/dragAndDrop.cpp @@ -50,7 +50,7 @@ public: //create a custom event on drop window: execute event after file dropping is completed! (e.g. after mouse is released) FFSFileDropEvent evt(droppedFileName, dropWindow_); - dropWindow_->GetEventHandler()->AddPendingEvent(evt); + dropWindow_->AddPendingEvent(evt); } return false; } diff --git a/ui/gridView.cpp b/ui/gridView.cpp index ed950c15..aa309970 100644 --- a/ui/gridView.cpp +++ b/ui/gridView.cpp @@ -4,27 +4,43 @@ using FreeFileSync::GridView; -GridView::StatusInfo GridView::update( - const bool includeLeftOnly, - const bool includeRightOnly, - const bool includeLeftNewer, - const bool includeRightNewer, - const bool includeDifferent, - const bool includeEqual, - const bool hideFiltered) +GridView::GridView(FolderComparison& results) : + leftOnlyFilesActive(false), + rightOnlyFilesActive(false), + leftNewerFilesActive(false), + rightNewerFilesActive(false), + differentFilesActive(false), + equalFilesActive(false), + conflictFilesActive(false), + syncDirLeftActive(false), + syncDirRightActive(false), + syncDirNoneActive(false), + folderCmp(results) {} + + +GridView::StatusInfo::StatusInfo() : + existsLeftOnly(false), + existsRightOnly(false), + existsLeftNewer(false), + existsRightNewer(false), + existsDifferent(false), + existsEqual(false), + existsConflict(false), + + existsSyncDirLeft(false), + existsSyncDirRight(false), + existsSyncDirNone(false), + + filesOnLeftView(0), + foldersOnLeftView(0), + filesOnRightView(0), + foldersOnRightView(0), + objectsTotal(0) {} + +template <bool syncPreviewActive> +GridView::StatusInfo GridView::update_sub(const bool hideFiltered) { StatusInfo output; - output.existsLeftOnly = false; - output.existsRightOnly = false; - output.existsLeftNewer = false; - output.existsRightNewer = false; - output.existsDifferent = false; - output.existsEqual = false; - - output.filesOnLeftView = 0; - output.foldersOnLeftView = 0; - output.filesOnRightView = 0; - output.foldersOnRightView = 0; refView.clear(); @@ -32,6 +48,8 @@ GridView::StatusInfo GridView::update( { const FileComparison& fileCmp = j->fileCmp; + output.objectsTotal += j->fileCmp.size(); + RefIndex newEntry; newEntry.folderIndex = j - folderCmp.begin(); @@ -42,34 +60,68 @@ GridView::StatusInfo GridView::update( continue; //process UI filter settings - switch (i->cmpResult) + if (syncPreviewActive) //synchronization preview + { + //exclude result "==" + if (i->cmpResult == FILE_EQUAL) //note: consider elementsTotal()! + { + --output.objectsTotal; + continue; + } + + switch (i->direction) + { + case SYNC_DIR_LEFT: + output.existsSyncDirLeft = true; + if (!syncDirLeftActive) continue; + break; + case SYNC_DIR_RIGHT: + output.existsSyncDirRight = true; + if (!syncDirRightActive) continue; + break; + case SYNC_DIR_NONE: + output.existsSyncDirNone = true; + if (!syncDirNoneActive) continue; + break; + case SYNC_UNRESOLVED_CONFLICT: + output.existsConflict = true; + if (!conflictFilesActive) continue; + break; + } + } + else //comparison results view { - case FILE_LEFT_SIDE_ONLY: - output.existsLeftOnly = true; - if (!includeLeftOnly) continue; - break; - case FILE_RIGHT_SIDE_ONLY: - output.existsRightOnly = true; - if (!includeRightOnly) continue; - break; - case FILE_LEFT_NEWER: - output.existsLeftNewer = true; - if (!includeLeftNewer) continue; - break; - case FILE_RIGHT_NEWER: - output.existsRightNewer = true; - if (!includeRightNewer) continue; - break; - case FILE_DIFFERENT: - output.existsDifferent = true; - if (!includeDifferent) continue; - break; - case FILE_EQUAL: - output.existsEqual = true; - if (!includeEqual) continue; - break; - default: - assert (false); + switch (i->cmpResult) + { + case FILE_LEFT_SIDE_ONLY: + output.existsLeftOnly = true; + if (!leftOnlyFilesActive) continue; + break; + case FILE_RIGHT_SIDE_ONLY: + output.existsRightOnly = true; + if (!rightOnlyFilesActive) continue; + break; + case FILE_LEFT_NEWER: + output.existsLeftNewer = true; + if (!leftNewerFilesActive) continue; + break; + case FILE_RIGHT_NEWER: + output.existsRightNewer = true; + if (!rightNewerFilesActive) continue; + break; + case FILE_DIFFERENT: + output.existsDifferent = true; + if (!differentFilesActive) continue; + break; + case FILE_EQUAL: + output.existsEqual = true; + if (!equalFilesActive) continue; + break; + case FILE_CONFLICT: + output.existsConflict = true; + if (!conflictFilesActive) continue; + break; + } } //calculate total number of bytes for each side @@ -89,7 +141,6 @@ GridView::StatusInfo GridView::update( else if (i->fileDescrRight.objType == FileDescrLine::TYPE_DIRECTORY) ++output.foldersOnRightView; - newEntry.rowIndex = i - fileCmp.begin(); refView.push_back(newEntry); } @@ -105,6 +156,14 @@ GridView::StatusInfo GridView::update( } +GridView::StatusInfo GridView::update(const bool hideFiltered, const bool syncPreviewActive) +{ + return syncPreviewActive ? + update_sub<true>(hideFiltered) : + update_sub<false>(hideFiltered); +} + + void GridView::viewRefToFolderRef(const std::set<int>& viewRef, FolderCompRef& output) { output.clear(); @@ -121,13 +180,12 @@ void GridView::viewRefToFolderRef(const std::set<int>& viewRef, FolderCompRef& o } -unsigned int GridView::elementsTotal() const +bool GridView::refGridIsEmpty() const { - unsigned int total = 0; for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) - total += j->fileCmp.size(); + if (!j->fileCmp.empty()) return false; - return total; + return true; } @@ -140,9 +198,7 @@ void bubbleSort(FreeFileSync::FolderComparison& folderCmp, CompareFct compare) for (int j = 0; j <= i; ++j) if (compare(folderCmp[j + 1], folderCmp[j])) { - std::swap(folderCmp[j + 1].syncPair, folderCmp[j].syncPair); - folderCmp[j + 1].fileCmp.swap(folderCmp[j].fileCmp); - + folderCmp[j + 1].swap(folderCmp[j]); swapped = true; } @@ -158,8 +214,8 @@ void GridView::sortView(const SortType type, const bool onLeft, const bool ascen if (type == SORT_BY_DIRECTORY) { - //specialization: use own sorting function based on vector<FileCompareLine>::swap() - //bubble sort is no performance issue since number of folder pairs should be "small" + //specialization: use custom sorting function based on FolderComparison::swap() + //bubble sort is no performance issue since number of folder pairs should be "very small" if (ascending && onLeft) bubbleSort(folderCmp, sortByDirectory<ASCENDING, SORT_ON_LEFT>); else if (ascending && !onLeft) bubbleSort(folderCmp, sortByDirectory<ASCENDING, SORT_ON_RIGHT>); else if (!ascending && onLeft) bubbleSort(folderCmp, sortByDirectory<DESCENDING, SORT_ON_LEFT>); diff --git a/ui/gridView.h b/ui/gridView.h index b4101da7..2a4d4e29 100644 --- a/ui/gridView.h +++ b/ui/gridView.h @@ -10,15 +10,16 @@ namespace FreeFileSync class GridView { public: - GridView(FolderComparison& results) : folderCmp(results) {} + GridView(FolderComparison& results); const FileCompareLine& operator[] (unsigned row) const; + FileCompareLine& operator[] (unsigned row); //unsigned getResultsIndex(const unsigned viewIndex); //convert index on GridView to index on FolderComparison - unsigned int elementsOnView() const; + unsigned int elementsOnView() const; //only the currently visible elements - unsigned int elementsTotal() const; + bool refGridIsEmpty() const; //convert view references to FolderCompRef void viewRefToFolderRef(const std::set<int>& viewRef, FolderCompRef& output); @@ -27,29 +28,47 @@ namespace FreeFileSync struct StatusInfo { + StatusInfo(); + bool existsLeftOnly; bool existsRightOnly; bool existsLeftNewer; bool existsRightNewer; bool existsDifferent; bool existsEqual; + bool existsConflict; + + bool existsSyncDirLeft; + bool existsSyncDirRight; + bool existsSyncDirNone; unsigned int filesOnLeftView; unsigned int foldersOnLeftView; unsigned int filesOnRightView; unsigned int foldersOnRightView; + unsigned int objectsTotal; + wxULongLong filesizeLeftView; wxULongLong filesizeRightView; }; - StatusInfo update(const bool includeLeftOnly, - const bool includeRightOnly, - const bool includeLeftNewer, - const bool includeRightNewer, - const bool includeDifferent, - const bool includeEqual, - const bool hideFiltered); + StatusInfo update(const bool hideFiltered, const bool syncPreviewActive); + + //UI View Filter settings + //compare result + bool leftOnlyFilesActive; + bool rightOnlyFilesActive; + bool leftNewerFilesActive; + bool rightNewerFilesActive; + bool differentFilesActive; + bool equalFilesActive; + bool conflictFilesActive; + //sync preview + bool syncDirLeftActive; + bool syncDirRightActive; + bool syncDirNoneActive; + //sorting... enum SortType @@ -65,6 +84,9 @@ namespace FreeFileSync void sortView(const SortType type, const bool onLeft, const bool ascending); private: + template <bool syncPreviewActive> + StatusInfo update_sub(const bool hideFiltered); + struct RefIndex { unsigned int folderIndex; @@ -87,6 +109,13 @@ namespace FreeFileSync return folderCmp[folderInd].fileCmp[rowInd]; } + inline + FileCompareLine& GridView::operator[] (unsigned row) + { + //code re-use of const method: see Meyers Effective C++ + return const_cast<FileCompareLine&>(static_cast<const GridView&>(*this).operator[](row)); + } + inline unsigned int GridView::elementsOnView() const diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp index c56fafbb..4819f9e6 100644 --- a/ui/guiGenerated.cpp +++ b/ui/guiGenerated.cpp @@ -26,6 +26,11 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_menuFile->AppendSeparator(); + m_menuItemSwitchView = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&witch view") ) + wxT('\t') + wxT("ALT-W"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSwitchView ); + + m_menuFile->AppendSeparator(); + wxMenuItem* m_menuItem14; m_menuItem14 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&ave configuration") ) + wxT('\t') + wxT("CTRL-S"), wxEmptyString, wxITEM_NORMAL ); m_menuFile->Append( m_menuItem14 ); @@ -124,14 +129,14 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer30; bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("&Compare"), wxDefaultPosition, wxSize( 180,37 ), 0 ); + m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("Compare"), wxDefaultPosition, wxSize( 180,40 ), 0 ); m_buttonCompare->SetDefault(); m_buttonCompare->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); m_buttonCompare->SetToolTip( _("Compare both sides") ); bSizer30->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 180,37 ), 0 ); + m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 180,40 ), 0 ); m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Tahoma") ) ); m_buttonAbort->Enable( false ); m_buttonAbort->Hide(); @@ -149,7 +154,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer45; bSizer45 = new wxBoxSizer( wxVERTICAL ); - m_radioBtnSizeDate = new wxRadioButton( m_panel71, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnSizeDate = new wxRadioButton( m_panel71, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_radioBtnSizeDate->SetValue( true ); m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same.") ); @@ -177,7 +182,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer6->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer6->Add( 0, 0, 1, 0, 5 ); wxBoxSizer* bSizer56; bSizer56 = new wxBoxSizer( wxVERTICAL ); @@ -212,14 +217,24 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer6->Add( bSizer56, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonSync = new wxButtonWithImage( m_panel71, wxID_ANY, _("&Synchronize..."), wxDefaultPosition, wxSize( 180,37 ), 0 ); - m_buttonSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); - m_buttonSync->SetToolTip( _("Open synchronization dialog") ); - bSizer6->Add( m_buttonSync, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer6->Add( 20, 0, 0, 0, 5 ); + + m_bpButtonSyncConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,40 ), wxBU_AUTODRAW ); + m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); + + m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); + + bSizer6->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); + + m_buttonStartSync = new wxButtonWithImage( m_panel71, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonStartSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_buttonStartSync->SetToolTip( _("Start synchronization") ); + bSizer6->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( 15, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_panel71->SetSizer( bSizer6 ); m_panel71->Layout(); @@ -259,12 +274,8 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizerMiddle = new wxBoxSizer( wxHORIZONTAL ); - m_bpButtonSwap = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - m_bpButtonSwap->SetToolTip( _("Swap sides") ); - - m_bpButtonSwap->SetToolTip( _("Swap sides") ); - - bSizerMiddle->Add( m_bpButtonSwap, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSwitchView = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 44,44 ), wxBU_AUTODRAW ); + bSizerMiddle->Add( m_bpButtonSwitchView, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); bSizer93->Add( bSizerMiddle, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); @@ -393,7 +404,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_gridMiddle->SetMargins( 0, 0 ); // Columns - m_gridMiddle->SetColSize( 0, 45 ); + m_gridMiddle->SetColSize( 0, 60 ); m_gridMiddle->EnableDragColMove( false ); m_gridMiddle->EnableDragColSize( false ); m_gridMiddle->SetColLabelSize( 20 ); @@ -457,7 +468,8 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); bSizer3 = new wxBoxSizer( wxHORIZONTAL ); - bSizer58 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer120; + bSizer120 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer16; sbSizer16 = new wxStaticBoxSizer( new wxStaticBox( m_panel4, wxID_ANY, _("Configuration") ), wxHORIZONTAL ); @@ -467,7 +479,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonSave->SetToolTip( _("Save current configuration to file") ); - sbSizer16->Add( m_bpButtonSave, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + sbSizer16->Add( m_bpButtonSave, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_bpButtonLoad = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); m_bpButtonLoad->SetToolTip( _("Load configuration from file") ); @@ -481,14 +493,11 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_choiceHistory->SetSelection( 0 ); m_choiceHistory->SetToolTip( _("Load configuration history (press DEL to delete items)") ); - sbSizer16->Add( m_choiceHistory, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer58->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - + sbSizer16->Add( m_choiceHistory, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer58->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer120->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer3->Add( bSizer58, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer3->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); m_panel112 = new wxPanel( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer64; @@ -519,6 +528,18 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonRightOnly = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); sbSizer31->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDirLeft = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDirLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDirNone = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDirNone, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDirRight = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDirRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonConflict = new wxBitmapButton( m_panel112, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + sbSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -527,19 +548,98 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_panel112->SetSizer( bSizer64 ); m_panel112->Layout(); bSizer64->Fit( m_panel112 ); - bSizer3->Add( m_panel112, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 4 ); + bSizer3->Add( m_panel112, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer66; - bSizer66 = new wxBoxSizer( wxVERTICAL ); + bSizer66 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer66->Add( 0, 0, 1, 0, 5 ); + + m_panelSyncPreview = new wxPanel( m_panel4, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer121; + bSizer121 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer161; + sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( m_panelSyncPreview, wxID_ANY, _("Preview") ), wxHORIZONTAL ); + + wxFlexGridSizer* fgSizer5; + fgSizer5 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapCreate = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreate->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlCreate = new wxTextCtrl( m_panelSyncPreview, 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") ); + + fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapDelete = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDelete->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlDelete = new wxTextCtrl( m_panelSyncPreview, 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") ); + + fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer161->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + wxFlexGridSizer* fgSizer6; + fgSizer6 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer6->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapUpdate = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer6->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlUpdate = new wxTextCtrl( m_panelSyncPreview, 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") ); + + fgSizer6->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapData = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapData->SetToolTip( _("Total amount of data that will be transferred") ); + + fgSizer6->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlData = new wxTextCtrl( m_panelSyncPreview, 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") ); + + fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer161->Add( fgSizer6, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + bSizer121->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelSyncPreview->SetSizer( bSizer121 ); + m_panelSyncPreview->Layout(); + bSizer121->Fit( m_panelSyncPreview ); + bSizer66->Add( m_panelSyncPreview, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_bpButton10 = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); m_bpButton10->SetToolTip( _("Quit") ); m_bpButton10->SetToolTip( _("Quit") ); - bSizer66->Add( m_bpButton10, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxALL, 5 ); + bSizer66->Add( m_bpButton10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); - bSizer3->Add( bSizer66, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer3->Add( bSizer66, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); m_panel4->SetSizer( bSizer3 ); m_panel4->Layout(); @@ -622,7 +722,8 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); this->Connect( m_menuItem10->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); - this->Connect( m_menuItem11->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSync ) ); + this->Connect( m_menuItem11->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); + this->Connect( m_menuItemSwitchView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); this->Connect( m_menuItem14->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuSaveConfig ) ); this->Connect( m_menuItem13->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLoadConfig ) ); this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); @@ -652,10 +753,11 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnFilterButton ), NULL, this ); m_hyperlinkCfgFilter->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); m_checkBoxHideFilt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideFilteredButton ), NULL, this ); - m_buttonSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSync ), NULL, this ); + m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); + m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); m_directoryLeft->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( MainDialogGenerated::OnFolderHistoryKeyEvent ), NULL, this ); m_dirPickerLeft->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); - m_bpButtonSwap->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapDirs ), NULL, this ); + m_bpButtonSwitchView->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ), NULL, this ); m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); m_directoryRight->Connect( wxEVT_KEY_DOWN, wxKeyEventHandler( MainDialogGenerated::OnFolderHistoryKeyEvent ), NULL, this ); m_dirPickerRight->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); @@ -679,6 +781,10 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); + m_bpButtonSyncDirLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); + m_bpButtonSyncDirNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); + m_bpButtonSyncDirRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); + m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); m_bpButton10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); } @@ -687,7 +793,8 @@ MainDialogGenerated::~MainDialogGenerated() // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSync ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuSaveConfig ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLoadConfig ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); @@ -717,10 +824,11 @@ MainDialogGenerated::~MainDialogGenerated() m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnFilterButton ), NULL, this ); m_hyperlinkCfgFilter->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); m_checkBoxHideFilt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideFilteredButton ), NULL, this ); - m_buttonSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSync ), NULL, this ); + m_bpButtonSyncConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); + m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); m_directoryLeft->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( MainDialogGenerated::OnFolderHistoryKeyEvent ), NULL, this ); m_dirPickerLeft->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); - m_bpButtonSwap->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapDirs ), NULL, this ); + m_bpButtonSwitchView->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ), NULL, this ); m_bpButtonAddPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); m_directoryRight->Disconnect( wxEVT_KEY_DOWN, wxKeyEventHandler( MainDialogGenerated::OnFolderHistoryKeyEvent ), NULL, this ); m_dirPickerRight->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); @@ -744,6 +852,10 @@ MainDialogGenerated::~MainDialogGenerated() m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); + m_bpButtonSyncDirLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); + m_bpButtonSyncDirNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); + m_bpButtonSyncDirRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); + m_bpButtonConflict->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); m_bpButton10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); } @@ -784,15 +896,15 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer96->Add( 0, 15, 0, 0, 5 ); - m_bitmap23 = new wxStaticBitmap( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,17 ), 0 ); + m_bitmap23 = new wxStaticBitmap( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 44,17 ), 0 ); m_bitmap23->SetToolTip( _("Folder pair") ); - bSizer96->Add( m_bitmap23, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer96->Add( m_bitmap23, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 8 ); m_panel21->SetSizer( bSizer96 ); m_panel21->Layout(); bSizer96->Fit( m_panel21 ); - bSizer95->Add( m_panel21, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bSizer95->Add( m_panel21, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_panel20->SetSizer( bSizer95 ); m_panel20->Layout(); @@ -1079,69 +1191,109 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxGridSizer* gSizer3; gSizer3 = new wxGridSizer( 1, 2, 0, 5 ); - m_staticText211 = new wxStaticText( m_panelOverview, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText211->Wrap( -1 ); - m_staticText211->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + m_staticText21 = new wxStaticText( m_panelOverview, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - gSizer3->Add( m_staticText211, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + gSizer3->Add( m_staticText21, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_staticText311 = new wxStaticText( m_panelOverview, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText311->Wrap( -1 ); - m_staticText311->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + m_staticText31 = new wxStaticText( m_panelOverview, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText31->Wrap( -1 ); + m_staticText31->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - gSizer3->Add( m_staticText311, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + gSizer3->Add( m_staticText31, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); sbSizer61->Add( gSizer3, 0, wxEXPAND, 5 ); m_staticline3 = new wxStaticLine( m_panelOverview, 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 ); + wxBoxSizer* bSizer121; + bSizer121 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer122; + bSizer122 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeftOnly = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapLeftOnly->SetToolTip( _("Files/folders that exist on left side only") ); + + bSizer122->Add( m_bitmapLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer122->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftOnly = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer122->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_bitmap13 = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap13->SetToolTip( _("Files/folders that exist on left side only") ); + bSizer121->Add( bSizer122, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - gSizer1->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + wxBoxSizer* bSizer123; + bSizer123 = new wxBoxSizer( wxHORIZONTAL ); - m_bpButton5 = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - gSizer1->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_bitmapRightOnly = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapRightOnly->SetToolTip( _("Files/folders that exist on right side only") ); - m_bitmap14 = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap14->SetToolTip( _("Files/folders that exist on right side only") ); + bSizer123->Add( m_bitmapRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - gSizer1->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButton6 = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - gSizer1->Add( m_bpButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer123->Add( 5, 0, 0, 0, 5 ); - m_bitmap15 = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap15->SetToolTip( _("Files that exist on both sides, left one is newer") ); + m_bpButtonRightOnly = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer123->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - gSizer1->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizer123, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bpButton7 = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - gSizer1->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + wxBoxSizer* bSizer124; + bSizer124 = new wxBoxSizer( wxHORIZONTAL ); - m_bitmap16 = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap16->SetToolTip( _("Files that exist on both sides, right one is newer") ); + m_bitmapLeftNewer = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapLeftNewer->SetToolTip( _("Files that exist on both sides, left one is newer") ); - gSizer1->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer124->Add( m_bitmapLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButton8 = new wxBitmapButton( m_panelOverview, 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( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap17->SetToolTip( _("dummy") ); + bSizer124->Add( 5, 0, 0, 0, 5 ); - gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonLeftNewer = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer124->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButton9 = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - gSizer1->Add( m_bpButton9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizer124, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - sbSizer61->Add( gSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + wxBoxSizer* bSizer125; + bSizer125 = new wxBoxSizer( wxHORIZONTAL ); - bSizer120->Add( sbSizer61, 0, 0, 5 ); + m_bitmapRightNewer = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapRightNewer->SetToolTip( _("Files that exist on both sides, right one is newer") ); + + bSizer125->Add( m_bitmapRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer125->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonRightNewer = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer125->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer125, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer126; + bSizer126 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapDifferent = new wxStaticBitmap( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapDifferent->SetToolTip( _("Files that exist on both sides and have different content") ); + + bSizer126->Add( m_bitmapDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer126->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonDifferent = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer126->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer126, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + sbSizer61->Add( bSizer121, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer120->Add( sbSizer61, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer67->Add( bSizer120, 1, wxALL, 10 ); @@ -1180,7 +1332,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_textCtrlInclude = new wxTextCtrl( m_panelFilter, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); fgSizer3->Add( m_textCtrlInclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - sbSizer8->Add( fgSizer3, 0, wxEXPAND, 5 ); + sbSizer8->Add( fgSizer3, 1, wxEXPAND, 5 ); wxFlexGridSizer* fgSizer4; fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 ); @@ -1206,7 +1358,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_textCtrlExclude = new wxTextCtrl( m_panelFilter, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); fgSizer4->Add( m_textCtrlExclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - sbSizer8->Add( fgSizer4, 0, wxEXPAND, 5 ); + sbSizer8->Add( fgSizer4, 1, wxEXPAND, 5 ); bSizer114->Add( sbSizer8, 1, wxALL|wxEXPAND, 10 ); @@ -1284,11 +1436,11 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this ); m_checkBoxFilter->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckFilter ), NULL, this ); m_checkBoxSilent->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckLogging ), 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_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnDifferent ), NULL, this ); m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLoadBatchJob ), NULL, this ); m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); @@ -1304,11 +1456,11 @@ BatchDlgGenerated::~BatchDlgGenerated() m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this ); m_checkBoxFilter->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckFilter ), NULL, this ); m_checkBoxSilent->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckLogging ), 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_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnDifferent ), NULL, this ); m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLoadBatchJob ), NULL, this ); m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); @@ -1473,40 +1625,6 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr wxBoxSizer* bSizer29; bSizer29 = new wxBoxSizer( wxVERTICAL ); - bSizer201 = new wxBoxSizer( wxHORIZONTAL ); - - m_button18 = new wxButtonWithImage( this, wxID_OK, _("&Start"), wxDefaultPosition, wxSize( 140,58 ), 0 ); - m_button18->SetDefault(); - m_button18->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Arial Black") ) ); - m_button18->SetToolTip( _("Start synchronization") ); - - bSizer201->Add( m_button18, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer201->Add( 18, 0, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer38; - bSizer38 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); - - bSizer38->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore errors"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxIgnoreErrors->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); - - bSizer38->Add( m_checkBoxIgnoreErrors, 0, wxALL, 5 ); - - bSizer201->Add( bSizer38, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer29->Add( bSizer201, 1, 0, 5 ); - - - bSizer29->Add( 0, 5, 0, 0, 5 ); - wxStaticBoxSizer* sbSizer7; sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -1595,100 +1713,47 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr bSizer29->Add( sbSizer7, 0, wxEXPAND, 5 ); - bSizer29->Add( 0, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer291; - bSizer291 = new wxBoxSizer( wxHORIZONTAL ); - - m_button6 = new wxButton( this, wxID_APPLY, _("&Apply"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_button6->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - - bSizer291->Add( m_button6, 0, wxALIGN_BOTTOM, 5 ); - - m_button16 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); - bSizer291->Add( m_button16, 0, wxALIGN_BOTTOM, 5 ); - - - bSizer291->Add( 20, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - wxStaticBoxSizer* sbSizer16; - sbSizer16 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Preview") ), wxHORIZONTAL ); - - wxFlexGridSizer* fgSizer5; - fgSizer5 = new wxFlexGridSizer( 2, 2, 0, 5 ); - fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - 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 and directories that will be created") ); + bSizer29->Add( 0, 5, 1, 0, 5 ); - fgSizer5->Add( m_staticText37, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201 = new wxBoxSizer( wxHORIZONTAL ); - 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_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); - 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 and directories that will be deleted") ); + bSizer201->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - fgSizer5->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore errors"), wxDefaultPosition, wxDefaultSize, 0 ); - 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") ); + m_checkBoxIgnoreErrors->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); - fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201->Add( m_checkBoxIgnoreErrors, 0, wxALL, 5 ); - sbSizer16->Add( fgSizer5, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer29->Add( bSizer201, 0, 0, 5 ); - wxFlexGridSizer* fgSizer6; - fgSizer6 = new wxFlexGridSizer( 2, 2, 0, 5 ); - fgSizer6->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - 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") ); + bSizer29->Add( 0, 5, 1, 0, 5 ); - fgSizer6->Add( m_staticText42, 0, wxALIGN_CENTER_VERTICAL, 5 ); + wxBoxSizer* bSizer291; + bSizer291 = 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_button6 = new wxButton( this, wxID_OK, _("&Apply"), wxDefaultPosition, wxSize( 120,35 ), 0 ); + m_button6->SetDefault(); + m_button6->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer6->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer291->Add( m_button6, 0, wxTOP|wxBOTTOM|wxLEFT|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") ); + m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button16->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - fgSizer6->Add( m_staticText43, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer291->Add( m_button16, 0, wxALL|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") ); - fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizer16->Add( fgSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bSizer291->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer291->Add( 20, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); bSizer29->Add( bSizer291, 0, wxEXPAND, 5 ); - bSizer181->Add( bSizer29, 0, 0, 5 ); + bSizer181->Add( bSizer29, 0, wxEXPAND, 5 ); bSizer181->Add( 10, 0, 0, 0, 5 ); @@ -1716,50 +1781,90 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr 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 ); + wxBoxSizer* bSizer121; + bSizer121 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer122; + bSizer122 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeftOnly = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapLeftOnly->SetToolTip( _("Files/folders that exist on left side only") ); + + bSizer122->Add( m_bitmapLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer122->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer122->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer122, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer123; + bSizer123 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapRightOnly = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapRightOnly->SetToolTip( _("Files/folders that exist on right side only") ); + + bSizer123->Add( m_bitmapRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 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") ); + bSizer123->Add( 5, 0, 0, 0, 5 ); - gSizer1->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonRightOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer123->Add( m_bpButtonRightOnly, 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 ); + bSizer121->Add( bSizer123, 0, wxALIGN_CENTER_HORIZONTAL, 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") ); + wxBoxSizer* bSizer124; + bSizer124 = new wxBoxSizer( wxHORIZONTAL ); - gSizer1->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_bitmapLeftNewer = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapLeftNewer->SetToolTip( _("Files that exist on both sides, left one is newer") ); - 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 ); + bSizer124->Add( m_bitmapLeftNewer, 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 ); + bSizer124->Add( 5, 0, 0, 0, 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_bpButtonLeftNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer124->Add( m_bpButtonLeftNewer, 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") ); + bSizer121->Add( bSizer124, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - gSizer1->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + wxBoxSizer* bSizer125; + bSizer125 = new wxBoxSizer( wxHORIZONTAL ); - 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_bitmapRightNewer = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapRightNewer->SetToolTip( _("Files that exist on both sides, right one is newer") ); - m_bitmap17 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap17->SetToolTip( _("dummy") ); + bSizer125->Add( m_bitmapRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - 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 ); + bSizer125->Add( 5, 0, 0, 0, 5 ); - sbSizer6->Add( gSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_bpButtonRightNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer125->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer125, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer126; + bSizer126 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapDifferent = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmapDifferent->SetToolTip( _("Files that exist on both sides and have different content") ); + + bSizer126->Add( m_bitmapDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer126->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonDifferent = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer126->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer126, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + sbSizer6->Add( bSizer121, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizer181->Add( sbSizer6, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); @@ -1773,8 +1878,6 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); - m_button18->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_radioBtnUpdate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncUpdate ), NULL, this ); @@ -1782,21 +1885,20 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr 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_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnApply ), 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 ); + m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); } SyncDlgGenerated::~SyncDlgGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); - m_button18->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_radioBtnUpdate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncUpdate ), NULL, this ); @@ -1804,13 +1906,14 @@ SyncDlgGenerated::~SyncDlgGenerated() 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_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnApply ), 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 ); + m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->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 ) @@ -2112,10 +2215,6 @@ HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr m_staticText77->Wrap( -1 ); bSizer70->Add( m_staticText77, 0, wxRIGHT|wxLEFT, 5 ); - m_staticText78 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- different (same date, different size)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText78->Wrap( -1 ); - bSizer70->Add( m_staticText78, 0, wxRIGHT|wxLEFT, 5 ); - m_staticText79 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- exists left only"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText79->Wrap( -1 ); bSizer70->Add( m_staticText79, 0, wxRIGHT|wxLEFT, 5 ); @@ -2124,6 +2223,13 @@ HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr m_staticText80->Wrap( -1 ); bSizer70->Add( m_staticText80, 0, wxRIGHT|wxLEFT, 5 ); + + bSizer70->Add( 0, 10, 0, 0, 5 ); + + m_staticText78 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- conflict"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText78->Wrap( -1 ); + bSizer70->Add( m_staticText78, 0, wxRIGHT|wxLEFT, 5 ); + m_scrolledWindow1->SetSizer( bSizer70 ); m_scrolledWindow1->Layout(); bSizer70->Fit( m_scrolledWindow1 ); @@ -2878,7 +2984,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer70; bSizer70 = new wxBoxSizer( wxHORIZONTAL ); - m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the full name including path prefix."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the synchronization directories."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText44->Wrap( 400 ); bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -2910,7 +3016,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer52->Add( m_staticText45, 0, wxBOTTOM, 5 ); - m_staticText83 = new wxStaticText( m_panel13, wxID_ANY, _("1. Enter full file or directory names separated by ';' or a new line."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText83 = new wxStaticText( m_panel13, wxID_ANY, _("1. Enter relative file or directory names separated by ';' or a new line."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText83->Wrap( -1 ); bSizer52->Add( m_staticText83, 0, 0, 5 ); @@ -2922,10 +3028,6 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_staticText85->Wrap( -1 ); bSizer52->Add( m_staticText85, 0, 0, 5 ); - m_staticText86 = new wxStaticText( m_panel13, wxID_ANY, _("4. Keep the number of (different) entries small for best performance."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText86->Wrap( -1 ); - bSizer52->Add( m_staticText86, 0, wxBOTTOM, 5 ); - bSizer69->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); wxStaticBoxSizer* sbSizer21; @@ -2934,11 +3036,11 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer66; bSizer66 = new wxBoxSizer( wxHORIZONTAL ); - m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: *\\temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: \\temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText181->Wrap( -1 ); bSizer66->Add( m_staticText181, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - m_staticText1811 = new wxStaticText( m_panel13, wxID_ANY, _("Synchronize all .doc, .zip and .exe files except everything from folder \"temp\"."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1811 = new wxStaticText( m_panel13, wxID_ANY, _("Synchronize all .doc, .zip and .exe files except everything in subfolder \"temp\"."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1811->Wrap( 250 ); m_staticText1811->SetFont( wxFont( 8, 74, 93, 90, false, wxT("Tahoma") ) ); @@ -2978,7 +3080,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_textCtrlInclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); fgSizer3->Add( m_textCtrlInclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - sbSizer8->Add( fgSizer3, 0, wxEXPAND, 5 ); + sbSizer8->Add( fgSizer3, 1, wxEXPAND, 5 ); wxFlexGridSizer* fgSizer4; fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 ); @@ -3002,7 +3104,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_textCtrlExclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); fgSizer4->Add( m_textCtrlExclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - sbSizer8->Add( fgSizer4, 0, wxEXPAND, 5 ); + sbSizer8->Add( fgSizer4, 1, wxEXPAND, 5 ); bSizer21->Add( sbSizer8, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); @@ -3090,6 +3192,10 @@ CustomizeColsDlgGenerated::CustomizeColsDlgGenerated( wxWindow* parent, wxWindow bSizer96->Add( bSizer99, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_checkBoxShowFileIcons = new wxCheckBox( this, wxID_ANY, _("Show file icons"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer96->Add( m_checkBoxShowFileIcons, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); + wxBoxSizer* bSizer97; bSizer97 = new wxBoxSizer( wxHORIZONTAL ); @@ -3111,9 +3217,6 @@ CustomizeColsDlgGenerated::CustomizeColsDlgGenerated( wxWindow* parent, wxWindow bSizer96->Add( bSizer97, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bSizer96->Add( 0, 0, 0, wxALIGN_CENTER_HORIZONTAL, 20 ); - this->SetSizer( bSizer96 ); this->Layout(); bSizer96->Fit( this ); @@ -3184,20 +3287,39 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind m_staticText99 = new wxStaticText( this, wxID_ANY, _("File Time tolerance (seconds):"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText99->Wrap( -1 ); + m_staticText99->Hide(); m_staticText99->SetToolTip( _("File times that differ by up to the specified number of seconds are still handled as having same time.") ); bSizer100->Add( m_staticText99, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer100->Add( 0, 0, 1, wxEXPAND, 5 ); - m_spinCtrlFileTimeTolerance = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS|wxSP_WRAP, 0, 2000000000, 0 ); + m_spinCtrlFileTimeTolerance->Hide(); m_spinCtrlFileTimeTolerance->SetToolTip( _("File times that differ by up to the specified number of seconds are still handled as having same time.") ); bSizer100->Add( m_spinCtrlFileTimeTolerance, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); sbSizer23->Add( bSizer100, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer120; + bSizer120 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText114 = new wxStaticText( this, wxID_ANY, _("Ignore 1-hour file time difference"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText114->Wrap( -1 ); + m_staticText114->SetToolTip( _("Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes.") ); + + bSizer120->Add( m_staticText114, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer120->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_checkBoxIgnoreOneHour = new wxCheckBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxIgnoreOneHour->SetToolTip( _("Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes.") ); + + bSizer120->Add( m_checkBoxIgnoreOneHour, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer23->Add( bSizer120, 1, wxEXPAND, 5 ); + m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); sbSizer23->Add( m_staticline10, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); @@ -3232,7 +3354,7 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind m_buttonResetWarnings = new wxButtonWithImage( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxSize( 80,-1 ), 0 ); m_buttonResetWarnings->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - m_buttonResetWarnings->SetToolTip( _("Resets all warning messages") ); + m_buttonResetWarnings->SetToolTip( _("Reset all warning messages") ); bSizer101->Add( m_buttonResetWarnings, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h index 4bf190e1..37d41205 100644 --- a/ui/guiGenerated.h +++ b/ui/guiGenerated.h @@ -38,10 +38,10 @@ class wxButtonWithImage; #include <wx/scrolwin.h> #include <wx/grid.h> #include <wx/choice.h> +#include <wx/textctrl.h> #include <wx/stattext.h> #include <wx/statline.h> #include <wx/frame.h> -#include <wx/textctrl.h> #include <wx/notebook.h> #include <wx/dialog.h> #include <wx/gauge.h> @@ -65,6 +65,7 @@ class MainDialogGenerated : public wxFrame wxMenu* m_menuFile; wxMenuItem* m_menuItem10; wxMenuItem* m_menuItem11; + wxMenuItem* m_menuItemSwitchView; wxMenu* m_menuAdvanced; wxMenu* m_menuLanguages; wxMenuItem* m_menuItemGerman; @@ -99,7 +100,9 @@ class MainDialogGenerated : public wxFrame wxHyperlinkCtrl* m_hyperlinkCfgFilter; wxCheckBox* m_checkBoxHideFilt; - wxButtonWithImage* m_buttonSync; + + wxBitmapButton* m_bpButtonSyncConfig; + wxButtonWithImage* m_buttonStartSync; wxPanel* m_panelTopLeft; wxStaticBoxSizer* sbSizer2; @@ -108,7 +111,7 @@ class MainDialogGenerated : public wxFrame wxPanel* m_panelTopMiddle; wxBoxSizer* bSizerMiddle; - wxBitmapButton* m_bpButtonSwap; + wxBitmapButton* m_bpButtonSwitchView; wxPanel* m_panelTopRight; @@ -126,11 +129,9 @@ class MainDialogGenerated : public wxFrame wxPanel* m_panelRight; CustomGridRight* m_gridRight; wxBoxSizer* bSizer3; - wxBoxSizer* bSizer58; wxBitmapButton* m_bpButtonSave; wxBitmapButton* m_bpButtonLoad; wxChoice* m_choiceHistory; - wxPanel* m_panel112; wxBitmapButton* m_bpButtonLeftOnly; @@ -139,7 +140,21 @@ class MainDialogGenerated : public wxFrame wxBitmapButton* m_bpButtonDifferent; wxBitmapButton* m_bpButtonRightNewer; wxBitmapButton* m_bpButtonRightOnly; + wxBitmapButton* m_bpButtonSyncDirLeft; + wxBitmapButton* m_bpButtonSyncDirNone; + wxBitmapButton* m_bpButtonSyncDirRight; + wxBitmapButton* m_bpButtonConflict; + + wxPanel* m_panelSyncPreview; + wxStaticBitmap* m_bitmapCreate; + wxTextCtrl* m_textCtrlCreate; + wxStaticBitmap* m_bitmapDelete; + wxTextCtrl* m_textCtrlDelete; + wxStaticBitmap* m_bitmapUpdate; + wxTextCtrl* m_textCtrlUpdate; + wxStaticBitmap* m_bitmapData; + wxTextCtrl* m_textCtrlData; wxBitmapButton* m_bpButton10; wxPanel* m_panel7; @@ -158,7 +173,8 @@ class MainDialogGenerated : public wxFrame // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } virtual void OnCompare( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSync( wxCommandEvent& event ){ event.Skip(); } + virtual void OnStartSync( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSwitchView( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuSaveConfig( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuLoadConfig( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuQuit( wxCommandEvent& event ){ event.Skip(); } @@ -187,9 +203,9 @@ class MainDialogGenerated : public wxFrame virtual void OnFilterButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnConfigureFilter( wxHyperlinkEvent& event ){ event.Skip(); } virtual void OnHideFilteredButton( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncSettings( wxCommandEvent& event ){ event.Skip(); } virtual void OnFolderHistoryKeyEvent( wxKeyEvent& event ){ event.Skip(); } virtual void OnDirSelected( wxFileDirPickerEvent& event ){ event.Skip(); } - virtual void OnSwapDirs( wxCommandEvent& event ){ event.Skip(); } virtual void OnAddFolderPair( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftGridDoubleClick( wxGridEvent& event ){ event.Skip(); } virtual void OnContextMenu( wxGridEvent& event ){ event.Skip(); } @@ -210,6 +226,10 @@ class MainDialogGenerated : public wxFrame virtual void OnDifferentFiles( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightNewerFiles( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightOnlyFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDirLeft( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDirNone( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDirRight( wxCommandEvent& event ){ event.Skip(); } + virtual void OnConflictFiles( wxCommandEvent& event ){ event.Skip(); } virtual void OnQuit( wxCommandEvent& event ){ event.Skip(); } @@ -304,19 +324,24 @@ class BatchDlgGenerated : public wxDialog - wxStaticText* m_staticText211; - wxStaticText* m_staticText311; + wxStaticText* m_staticText21; + wxStaticText* m_staticText31; 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; + wxStaticBitmap* m_bitmapLeftOnly; + + wxBitmapButton* m_bpButtonLeftOnly; + wxStaticBitmap* m_bitmapRightOnly; + + wxBitmapButton* m_bpButtonRightOnly; + wxStaticBitmap* m_bitmapLeftNewer; + + wxBitmapButton* m_bpButtonLeftNewer; + wxStaticBitmap* m_bitmapRightNewer; + + wxBitmapButton* m_bpButtonRightNewer; + wxStaticBitmap* m_bitmapDifferent; + + wxBitmapButton* m_bpButtonDifferent; wxPanel* m_panelFilter; wxStaticText* m_staticText15; @@ -399,12 +424,6 @@ class SyncDlgGenerated : public wxDialog private: protected: - wxBoxSizer* bSizer201; - wxButtonWithImage* m_button18; - - wxCheckBox* m_checkBoxUseRecycler; - wxCheckBox* m_checkBoxIgnoreErrors; - wxStaticText* m_staticText1; wxRadioButton* m_radioBtn1; wxButton* m_buttonOneWay; @@ -421,41 +440,41 @@ class SyncDlgGenerated : public wxDialog wxStaticText* m_staticText9; + wxBoxSizer* bSizer201; + wxCheckBox* m_checkBoxUseRecycler; + wxCheckBox* m_checkBoxIgnoreErrors; + wxButton* m_button6; wxButton* m_button16; - 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_staticText21; wxStaticText* m_staticText31; 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; + wxStaticBitmap* m_bitmapLeftOnly; + + wxBitmapButton* m_bpButtonLeftOnly; + wxStaticBitmap* m_bitmapRightOnly; + + wxBitmapButton* m_bpButtonRightOnly; + wxStaticBitmap* m_bitmapLeftNewer; + + wxBitmapButton* m_bpButtonLeftNewer; + wxStaticBitmap* m_bitmapRightNewer; + + wxBitmapButton* m_bpButtonRightNewer; + wxStaticBitmap* m_bitmapDifferent; + + wxBitmapButton* m_bpButtonDifferent; // 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 OnSyncUpdate( 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 OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } + virtual void OnApply( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnExRightSideOnly( wxCommandEvent& event ){ event.Skip(); } @@ -549,9 +568,10 @@ class HelpDlgGenerated : public wxDialog wxStaticText* m_staticText75; wxStaticText* m_staticText76; wxStaticText* m_staticText77; - wxStaticText* m_staticText78; wxStaticText* m_staticText79; wxStaticText* m_staticText80; + + wxStaticText* m_staticText78; wxScrolledWindow* m_scrolledWindow5; wxStaticText* m_staticText65; wxStaticText* m_staticText66; @@ -804,7 +824,6 @@ class FilterDlgGenerated : public wxDialog wxStaticText* m_staticText83; wxStaticText* m_staticText84; wxStaticText* m_staticText85; - wxStaticText* m_staticText86; wxStaticText* m_staticText181; wxStaticText* m_staticText1811; @@ -846,11 +865,11 @@ class CustomizeColsDlgGenerated : public wxDialog wxCheckListBox* m_checkListColumns; wxBitmapButton* m_bpButton29; wxBitmapButton* m_bpButton30; + wxCheckBox* m_checkBoxShowFileIcons; wxButton* m_button28; wxButton* m_button9; wxButton* m_button29; - // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } virtual void OnMoveUp( wxCommandEvent& event ){ event.Skip(); } @@ -880,8 +899,10 @@ class GlobalSettingsDlgGenerated : public wxDialog wxStaticText* m_staticText99; - wxSpinCtrl* m_spinCtrlFileTimeTolerance; + wxStaticText* m_staticText114; + + wxCheckBox* m_checkBoxIgnoreOneHour; wxStaticLine* m_staticline10; wxStaticText* m_staticText97; wxTextCtrl* m_textCtrlFileManager; diff --git a/ui/guiStatusHandler.cpp b/ui/guiStatusHandler.cpp index 74205dba..c2f27fac 100644 --- a/ui/guiStatusHandler.cpp +++ b/ui/guiStatusHandler.cpp @@ -17,10 +17,11 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : mainDialog->m_bpButtonFilter->Disable(); mainDialog->m_hyperlinkCfgFilter->Disable(); mainDialog->m_checkBoxHideFilt->Disable(); - mainDialog->m_buttonSync->Disable(); + mainDialog->m_bpButtonSyncConfig->Disable(); + mainDialog->m_buttonStartSync->Disable(); mainDialog->m_dirPickerLeft->Disable(); mainDialog->m_dirPickerRight->Disable(); - mainDialog->m_bpButtonSwap->Disable(); + mainDialog->m_bpButtonSwitchView->Disable(); mainDialog->m_bpButtonLeftOnly->Disable(); mainDialog->m_bpButtonLeftNewer->Disable(); mainDialog->m_bpButtonEqual->Disable(); @@ -70,10 +71,11 @@ CompareStatusHandler::~CompareStatusHandler() mainDialog->m_bpButtonFilter->Enable(); mainDialog->m_hyperlinkCfgFilter->Enable(); mainDialog->m_checkBoxHideFilt->Enable(); - mainDialog->m_buttonSync->Enable(); + mainDialog->m_bpButtonSyncConfig->Enable(); + mainDialog->m_buttonStartSync->Enable(); mainDialog->m_dirPickerLeft->Enable(); mainDialog->m_dirPickerRight->Enable(); - mainDialog->m_bpButtonSwap->Enable(); + mainDialog->m_bpButtonSwitchView->Enable(); mainDialog->m_bpButtonLeftOnly->Enable(); mainDialog->m_bpButtonLeftNewer->Enable(); mainDialog->m_bpButtonEqual->Enable(); @@ -96,7 +98,7 @@ CompareStatusHandler::~CompareStatusHandler() mainDialog->m_menubar1->EnableTop(1, true); mainDialog->m_menubar1->EnableTop(2, true); - if (abortRequested) + if (abortIsRequested()) mainDialog->pushStatusInformation(_("Operation aborted!")); mainDialog->m_buttonAbort->Disable(); @@ -125,26 +127,38 @@ void CompareStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal { currentProcess = processID; - if (currentProcess == StatusHandler::PROCESS_SCANNING) - ; - else if (currentProcess == StatusHandler::PROCESS_COMPARING_CONTENT) + switch (currentProcess) { + case StatusHandler::PROCESS_SCANNING: + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: mainDialog->compareStatus->switchToCompareBytewise(objectsTotal, dataTotal); mainDialog->Layout(); + break; + case StatusHandler::PROCESS_SYNCHRONIZING: + case StatusHandler::PROCESS_NONE: + assert(false); + break; } - - else assert(false); } inline void CompareStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) { - if (currentProcess == StatusHandler::PROCESS_SCANNING) + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: mainDialog->compareStatus->incScannedObjects_NoUpdate(objectsProcessed); - else if (currentProcess == StatusHandler::PROCESS_COMPARING_CONTENT) + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: mainDialog->compareStatus->incProcessedCmpData_NoUpdate(objectsProcessed, dataProcessed); - else assert(false); + break; + case StatusHandler::PROCESS_SYNCHRONIZING: + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } } @@ -228,7 +242,7 @@ void CompareStatusHandler::forceUiRefresh() void CompareStatusHandler::abortThisProcess() { - abortRequested = true; + requestAbortion(); throw FreeFileSync::AbortThisProcess(); //abort can be triggered by syncStatusFrame } //######################################################################################################## @@ -266,7 +280,7 @@ SyncStatusHandler::~SyncStatusHandler() } //notify to syncStatusFrame that current process has ended - if (abortRequested) + if (abortIsRequested()) { result+= wxString(_("Synchronization aborted!")) + wxT(" ") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!"); syncStatusFrame->setStatusText_NoUpdate(result.c_str()); @@ -296,10 +310,18 @@ void SyncStatusHandler::updateStatusText(const Zstring& text) void SyncStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID) { - assert (processID == StatusHandler::PROCESS_SYNCHRONIZING); - - syncStatusFrame->resetGauge(objectsTotal, dataTotal); - syncStatusFrame->setCurrentStatus(SyncStatus::SYNCHRONIZING); + switch (processID) + { + case StatusHandler::PROCESS_SYNCHRONIZING: + syncStatusFrame->resetGauge(objectsTotal, dataTotal); + syncStatusFrame->setCurrentStatus(SyncStatus::SYNCHRONIZING); + break; + case StatusHandler::PROCESS_SCANNING: + case StatusHandler::PROCESS_COMPARING_CONTENT: + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } } @@ -397,6 +419,6 @@ void SyncStatusHandler::forceUiRefresh() void SyncStatusHandler::abortThisProcess() { - abortRequested = true; + requestAbortion(); throw FreeFileSync::AbortThisProcess(); //abort can be triggered by syncStatusFrame } diff --git a/ui/sorting.h b/ui/sorting.h index 22b9c39b..f7879a8b 100644 --- a/ui/sorting.h +++ b/ui/sorting.h @@ -291,13 +291,13 @@ namespace FreeFileSync const Zstring* const dirNameB = side == SORT_ON_LEFT ? &b.syncPair.leftDirectory : &b.syncPair.rightDirectory; #ifdef FFS_WIN //case-insensitive comparison! - return sortAscending == ASCENDING ? - FreeFileSync::compareStringsWin32(dirNameA->c_str(), dirNameB->c_str()) < 0 : //way faster than wxString::CmpNoCase() in windows build!!! - FreeFileSync::compareStringsWin32(dirNameA->c_str(), dirNameB->c_str()) > 0; + return sortAscending == ASCENDING ? + FreeFileSync::compareStringsWin32(dirNameA->c_str(), dirNameB->c_str()) < 0 : //way faster than wxString::CmpNoCase() in windows build!!! + FreeFileSync::compareStringsWin32(dirNameA->c_str(), dirNameB->c_str()) > 0; #elif defined FFS_LINUX - return sortAscending == ASCENDING ? - dirNameA->Cmp(*dirNameB) < 0 : - dirNameA->Cmp(*dirNameB) > 0; + return sortAscending == ASCENDING ? + dirNameA->Cmp(*dirNameB) < 0 : + dirNameA->Cmp(*dirNameB) > 0; #endif } } |