diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:56:14 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 16:56:14 +0200 |
commit | 1046c195a9bbac24678c06310a4dd56b10347244 (patch) | |
tree | 89ad9f6fe3e538d65ef973b628ed9284b6c99e9f /ui | |
parent | 1.14 (diff) | |
download | FreeFileSync-1046c195a9bbac24678c06310a4dd56b10347244.tar.gz FreeFileSync-1046c195a9bbac24678c06310a4dd56b10347244.tar.bz2 FreeFileSync-1046c195a9bbac24678c06310a4dd56b10347244.zip |
1.15
Diffstat (limited to 'ui')
-rw-r--r-- | ui/MainDialog.cpp | 688 | ||||
-rw-r--r-- | ui/MainDialog.h | 48 | ||||
-rw-r--r-- | ui/SmallDialogs.cpp | 203 | ||||
-rw-r--r-- | ui/SmallDialogs.h | 47 | ||||
-rw-r--r-- | ui/SyncDialog.cpp | 47 | ||||
-rw-r--r-- | ui/SyncDialog.h | 8 | ||||
-rw-r--r-- | ui/guiGenerated.cpp | 345 | ||||
-rw-r--r-- | ui/guiGenerated.h | 105 |
8 files changed, 836 insertions, 655 deletions
diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp index 7c74454f..ead2084f 100644 --- a/ui/MainDialog.cpp +++ b/ui/MainDialog.cpp @@ -14,6 +14,7 @@ #include <wx/clipbrd.h> #include <wx/ffile.h> #include "../library/customGrid.h" +#include "../library/customButton.h" #include <algorithm> #include "../library/sorting.h" #include <wx/msgdlg.h> @@ -37,37 +38,22 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale restartOnExit(false), cmpStatusHandlerTmp(0) { - m_bpButtonCompare->SetLabel(_("&Compare")); - m_bpButtonSync->SetLabel(_("&Synchronize")); - - //load list of last used configuration files - cfgFileHistory = new wxConfig(wxT("FreeFileSync")); - for (int i = CfgHistroyLength - 1; i >= 0; --i) //put files in reverse order to history - { - const wxString key = wxString(wxT("Selection")) + numberToWxString(i); - - wxString value; - if (cfgFileHistory->Read(key, &value)) - addCfgFileToHistory(value); - } - m_choiceLoad->SetSelection(0); - //initialize and load configuration - readConfigurationFromXml(cfgFileName, true); readGlobalSettings(); + readConfigurationFromXml(cfgFileName, true); leftOnlyFilesActive = true; leftNewerFilesActive = true; differentFilesActive = true; - rightNewerFilesActive = true; //do not put these bool values into config.dat! + 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(); //set icons for this dialog m_bpButton10->SetBitmapLabel(*globalResource.bitmapExit); - m_bpButtonCompare->SetBitmapLabel(*globalResource.bitmapCompare); - m_bpButtonSync->SetBitmapLabel(*globalResource.bitmapSync); + m_buttonCompare->setBitmapFront(*globalResource.bitmapCompare); + m_buttonSync->setBitmapFront(*globalResource.bitmapSync); m_bpButtonSwap->SetBitmapLabel(*globalResource.bitmapSwap); m_bpButton14->SetBitmapLabel(*globalResource.bitmapHelp); m_bpButton201->SetBitmapLabel(*globalResource.bitmapSave); @@ -76,11 +62,13 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale m_bpButtonRemovePair->SetBitmapDisabled(*globalResource.bitmapRemoveFolderPairD); m_bitmap15->SetBitmap(*globalResource.bitmapStatusEdge); + bSizer6->Layout(); //wxButtonWithImage size might have changed + //menu icons m_menuItem10->SetBitmap(*globalResource.bitmapCompareSmall); m_menuItem11->SetBitmap(*globalResource.bitmapSyncSmall); m_menuItem7->SetBitmap(*globalResource.bitmapBatchSmall); - m_menuItemAdjustTimes->SetBitmap(*globalResource.bitmapClockSmall); + m_menuItemGlobSett->SetBitmap(*globalResource.bitmapSettingsSmall); //Workaround for wxWidgets: small hack to update menu items: actually this is a wxWidgets bug (affects Windows- and Linux-build) m_menu1->Remove(m_menuItem10); @@ -88,13 +76,9 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale m_menu1->Insert(0, m_menuItem10); m_menu1->Insert(1, m_menuItem11); m_menu3->Remove(m_menuItem7); - m_menu3->Remove(m_menuItemAdjustTimes); + m_menu3->Remove(m_menuItemGlobSett); m_menu3->Insert(2, m_menuItem7); - m_menu3->Insert(3, m_menuItemAdjustTimes); - -#ifdef FFS_LINUX //file time adjustment not needed for Linux build - m_menu3->Remove(m_menuItemAdjustTimes); -#endif + m_menu3->Insert(3, m_menuItemGlobSett); //prepare drag & drop m_panel1->SetDropTarget(new FileDropEvent(this, m_panel1)); @@ -156,71 +140,48 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale _("<< left file is newer\n") + _(">> right file is newer\n") + _("!= files are different\n") + - _("== files are equal\n\n") + - _("(-) filtered out from sync-process\n"); + _("== files are equal\n\n"); m_gridMiddle->GetGridWindow()->SetToolTip(toolTip); - //enable parallel scrolling - m_gridLeft->setScrollFriends(m_gridLeft, m_gridRight, m_gridMiddle); - m_gridRight->setScrollFriends(m_gridLeft, m_gridRight, m_gridMiddle); - m_gridMiddle->setScrollFriends(m_gridLeft, m_gridRight, m_gridMiddle); - - //share data with GUI grids - m_gridLeft->setGridDataTable(&gridRefUI, ¤tGridData); - m_gridRight->setGridDataTable(&gridRefUI, ¤tGridData); - m_gridMiddle->setGridDataTable(&gridRefUI, ¤tGridData); + //init grid settings + m_gridLeft->initSettings( true, m_gridLeft, m_gridRight, m_gridMiddle, &gridRefUI, ¤tGridData); + m_gridMiddle->initSettings(false, m_gridLeft, m_gridRight, m_gridMiddle, &gridRefUI, ¤tGridData); + m_gridRight->initSettings( true, m_gridLeft, m_gridRight, m_gridMiddle, &gridRefUI, ¤tGridData); //disable sync button as long as "compare" hasn't been triggered. enableSynchronization(false); - //make filesize right justified on grids - wxGridCellAttr* cellAttributes = m_gridLeft->GetOrCreateCellAttr(0, 2); - cellAttributes->SetAlignment(wxALIGN_RIGHT,wxALIGN_CENTRE); - m_gridLeft->SetColAttr(2, cellAttributes); - - cellAttributes = m_gridRight->GetOrCreateCellAttr(0, 2); //leave these two rows, might be necessary 'cause wxGridCellAttr is ref-counting - cellAttributes->SetAlignment(wxALIGN_RIGHT,wxALIGN_CENTRE); //and SetColAttr takes ownership (means: it will call DecRef()) - m_gridRight->SetColAttr(2, cellAttributes); - - //as the name says: disable them - m_gridMiddle->deactivateScrollbars(); - //mainly to update row label sizes... writeGrid(currentGridData); - //select rows only - m_gridLeft->SetSelectionMode(wxGrid::wxGridSelectRows); - m_gridRight->SetSelectionMode(wxGrid::wxGridSelectRows); - m_gridMiddle->SetSelectionMode(wxGrid::wxGridSelectRows); - - //set color of selections - wxColour darkBlue(40, 35, 140); - m_gridLeft->SetSelectionBackground(darkBlue); - m_gridRight->SetSelectionBackground(darkBlue); - m_gridMiddle->SetSelectionBackground(darkBlue); - m_gridLeft->SetSelectionForeground(*wxWHITE); - m_gridRight->SetSelectionForeground(*wxWHITE); - m_gridMiddle->SetSelectionForeground(*wxWHITE); - enableSynchronization(false); //initialize language selection switch (programLanguage->getLanguage()) { - case wxLANGUAGE_GERMAN: - m_menuItemGerman->Check(); + case wxLANGUAGE_CHINESE_SIMPLIFIED: + m_menuItemChineseSimple->Check(); + break; + case wxLANGUAGE_DUTCH: + m_menuItemDutch->Check(); break; case wxLANGUAGE_FRENCH: m_menuItemFrench->Check(); break; + case wxLANGUAGE_GERMAN: + m_menuItemGerman->Check(); + break; + case wxLANGUAGE_ITALIAN: + m_menuItemItalian->Check(); + break; case wxLANGUAGE_JAPANESE: m_menuItemJapanese->Check(); break; - case wxLANGUAGE_DUTCH: - m_menuItemDutch->Check(); + case wxLANGUAGE_POLISH: + m_menuItemPolish->Check(); break; - case wxLANGUAGE_CHINESE_SIMPLIFIED: - m_menuItemChineseSimple->Check(); + case wxLANGUAGE_PORTUGUESE: + m_menuItemPortuguese->Check(); break; default: m_menuItemEnglish->Check(); @@ -232,21 +193,27 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale Layout(); //avoid screen flicker when panel is shown later compareStatus->Hide(); - //correct width of middle grid + //correct width of swap button above middle grid wxSize source = m_gridMiddle->GetSize(); wxSize target = bSizerMiddle->GetSize(); int spaceToAdd = source.GetX() - target.GetX(); bSizerMiddle->Insert(1, spaceToAdd / 2, 0, 0); bSizerMiddle->Insert(0, spaceToAdd - (spaceToAdd / 2), 0, 0); + + { //set minimum width for choice load + wxSize old; + if ((old = m_choiceLoad->GetSize()).x < 140) + { + old.x = 140; + m_choiceLoad->SetMinSize(old); + bSizer58->Layout(); + } + } } MainDialog::~MainDialog() { - m_gridLeft->setGridDataTable(0, 0); - m_gridRight->setGridDataTable(0, 0); - m_gridMiddle->setGridDataTable(0, 0); - m_gridLeft->setSortMarker(-1); m_gridRight->setSortMarker(-1); @@ -254,22 +221,6 @@ MainDialog::~MainDialog() delete contextMenu; - //write list of last used configuration files - int vectorSize = cfgFileNames.size(); - for (int i = 0; i < CfgHistroyLength; ++i) - { - const wxString key = wxString(wxT("Selection")) + numberToWxString(i); - - if (i < vectorSize) - cfgFileHistory->Write(key, cfgFileNames[i]); - else - { - if (cfgFileHistory->Exists(key)) - cfgFileHistory->DeleteEntry(key, false); - } - } - delete cfgFileHistory; - //save configuration writeConfigurationToXml(FreeFileSync::LAST_CONFIG_FILE); //don't trow exceptions in destructors writeGlobalSettings(); @@ -292,36 +243,25 @@ void MainDialog::readGlobalSettings() posYNotMaximized = globalSettings.gui.posYNotMaximized; //apply window size and position - if ( widthNotMaximized != wxDefaultCoord && + if ( widthNotMaximized != wxDefaultCoord && heightNotMaximized != wxDefaultCoord && - posXNotMaximized != wxDefaultCoord && - posYNotMaximized != wxDefaultCoord) + posXNotMaximized != wxDefaultCoord && + posYNotMaximized != wxDefaultCoord) SetSize(posXNotMaximized, posYNotMaximized, widthNotMaximized, heightNotMaximized); Maximize(globalSettings.gui.isMaximized); - //read column widths - for (int i = 0; i < m_gridLeft->GetNumberCols() && i < int(globalSettings.gui.columnWidthLeft.size()); ++i) - m_gridLeft->SetColSize(i, globalSettings.gui.columnWidthLeft[i]); - - for (int i = 0; i < m_gridRight->GetNumberCols() && i < int(globalSettings.gui.columnWidthRight.size()); ++i) - m_gridRight->SetColSize(i, globalSettings.gui.columnWidthRight[i]); + //set column attributes + m_gridLeft->setColumnAttributes(globalSettings.gui.columnAttribLeft); + m_gridRight->setColumnAttributes(globalSettings.gui.columnAttribRight); -/* //read column positions - for (int i = 0; i < m_gridLeft->GetNumberCols() && i < int(globalSettings.gui.columnPositionsLeft.size()); ++i) - { - const int newPosition = globalSettings.gui.columnPositionsLeft[i]; - if (0 <= newPosition && newPosition < m_gridLeft->GetNumberCols()) - m_gridLeft->SetColPos(i, newPosition); - } + //load list of last used configuration files (in reverse order) + for (std::vector<wxString>::reverse_iterator i = globalSettings.gui.cfgFileHistory.rbegin(); + i != globalSettings.gui.cfgFileHistory.rend(); + ++i) + addCfgFileToHistory(*i); + m_choiceLoad->SetSelection(0); - for (int i = 0; i < m_gridRight->GetNumberCols() && i < int(globalSettings.gui.columnPositionsRight.size()); ++i) - { - const int newPosition = globalSettings.gui.columnPositionsRight[i]; - if (0 <= newPosition && newPosition < m_gridRight->GetNumberCols()) - m_gridRight->SetColPos(i, newPosition); - } - */ } @@ -334,24 +274,12 @@ void MainDialog::writeGlobalSettings() globalSettings.gui.posYNotMaximized = posYNotMaximized; globalSettings.gui.isMaximized = IsMaximized(); - //write column widths - globalSettings.gui.columnWidthLeft.clear(); - for (int i = 0; i < m_gridLeft->GetNumberCols(); ++i) - globalSettings.gui.columnWidthLeft.push_back(m_gridLeft->GetColSize(i)); - - globalSettings.gui.columnWidthRight.clear(); - for (int i = 0; i < m_gridRight->GetNumberCols(); ++i) - globalSettings.gui.columnWidthRight.push_back(m_gridRight->GetColSize(i)); + //retrieve column attributes + globalSettings.gui.columnAttribLeft = m_gridLeft->getColumnAttributes(); + globalSettings.gui.columnAttribRight = m_gridRight->getColumnAttributes(); -/* - //write column positions - globalSettings.gui.columnPositionsLeft.clear(); - for (int i = 0; i < m_gridLeft->GetNumberCols(); ++i) - globalSettings.gui.columnPositionsLeft.push_back(m_gridLeft->GetColPos(i)); - - globalSettings.gui.columnPositionsRight.clear(); - for (int i = 0; i < m_gridRight->GetNumberCols(); ++i) - globalSettings.gui.columnPositionsRight.push_back(m_gridRight->GetColPos(i));*/ + //write list of last used configuration files + globalSettings.gui.cfgFileHistory = cfgFileNames; } @@ -398,26 +326,28 @@ void MainDialog::enableSynchronization(bool value) if (value) { synchronizationEnabled = true; - m_bpButtonSync->SetBitmapLabel(*globalResource.bitmapSync); + m_buttonSync->SetForegroundColour(*wxBLACK); + m_buttonSync->setBitmapFront(*globalResource.bitmapSync); } else { synchronizationEnabled = false; - m_bpButtonSync->SetBitmapLabel(*globalResource.bitmapSyncDisabled); + m_buttonSync->SetForegroundColour(wxColor(94, 94, 94)); //grey + m_buttonSync->setBitmapFront(*globalResource.bitmapSyncDisabled); } } -void MainDialog::filterRangeTemp(const set<int>& rowsToFilterOnUI_View) +void MainDialog::filterRangeManually(const std::set<int>& rowsToFilterOnUiTable) { - if (rowsToFilterOnUI_View.size() > 0) + if (rowsToFilterOnUiTable.size() > 0) { int gridSizeUI = gridRefUI.size(); bool newSelection = false; //default: deselect range //leadingRow determines de-/selection of all other rows - int leadingRow = *rowsToFilterOnUI_View.begin(); + int leadingRow = *rowsToFilterOnUiTable.begin(); if (0 <= leadingRow && leadingRow < gridSizeUI) newSelection = !currentGridData[gridRefUI[leadingRow]].selectedForSynchronization; @@ -426,9 +356,9 @@ void MainDialog::filterRangeTemp(const set<int>& rowsToFilterOnUI_View) //get all lines that need to be filtered (e.g. if a folder is marked, then its subelements should be marked as well) - set<int> rowsToFilterOnGridData; //rows to filter in backend + std::set<int> rowsToFilterOnGridData; //rows to filter in backend - for (set<int>::iterator i = rowsToFilterOnUI_View.begin(); i != rowsToFilterOnUI_View.end(); ++i) + for (std::set<int>::iterator i = rowsToFilterOnUiTable.begin(); i != rowsToFilterOnUiTable.end(); ++i) { if (0 <= *i && *i < gridSizeUI) { @@ -440,7 +370,7 @@ void MainDialog::filterRangeTemp(const set<int>& rowsToFilterOnUI_View) } //toggle selection of filtered rows - for (set<int>::iterator i = rowsToFilterOnGridData.begin(); i != rowsToFilterOnGridData.end(); ++i) + for (std::set<int>::iterator i = rowsToFilterOnGridData.begin(); i != rowsToFilterOnGridData.end(); ++i) currentGridData[*i].selectedForSynchronization = newSelection; //signal UI that grids need to be refreshed on next Update() @@ -508,7 +438,7 @@ void MainDialog::OnIdleEvent(wxEvent& event) filteringInitialized = false; if (leadGrid) - filterRangeTemp(getSelectedRows(leadGrid)); + filterRangeManually(getSelectedRows(leadGrid)); } } @@ -534,12 +464,12 @@ void MainDialog::OnIdleEvent(wxEvent& event) void MainDialog::copySelectionToClipboard(const wxGrid* selectedGrid) { - const set<int> selectedRows = getSelectedRows(selectedGrid); + const std::set<int> selectedRows = getSelectedRows(selectedGrid); if (selectedRows.size() > 0) { wxString clipboardString; - for (set<int>::iterator i = selectedRows.begin(); i != selectedRows.end(); ++i) + for (std::set<int>::iterator i = selectedRows.begin(); i != selectedRows.end(); ++i) { for (int k = 0; k < const_cast<wxGrid*>(selectedGrid)->GetNumberCols(); ++k) { @@ -563,23 +493,23 @@ void MainDialog::copySelectionToClipboard(const wxGrid* selectedGrid) } -void removeInvalidRows(set<int>& rows, const int currentUI_Size) +void removeInvalidRows(std::set<int>& rows, const int currentUiTableSize) { - set<int> validRows; //temporal table IS needed here - for (set<int>::iterator i = rows.begin(); i != rows.end(); ++i) + std::set<int> validRows; //temporal table IS needed here + for (std::set<int>::iterator i = rows.begin(); i != rows.end(); ++i) if (0 <= *i) { - if (*i >= currentUI_Size) //set is sorted, so no need to continue here + if (*i >= currentUiTableSize) //set is sorted, so no need to continue here break; validRows.insert(*i); } - rows = validRows; + rows.swap(validRows); } -set<int> MainDialog::getSelectedRows(const wxGrid* grid) +std::set<int> MainDialog::getSelectedRows(const wxGrid* grid) { - set<int> output; + std::set<int> output; int rowTop, rowBottom; //coords of selection wxArrayInt selectedRows = grid->GetSelectedRows(); @@ -637,7 +567,7 @@ public: unsolvedErrors(unsolvedErrorOccured) {} ~DeleteErrorHandler() {} - Response reportError(const wxString& text) + Response reportError(const Zstring& text) { if (ignoreErrors) { @@ -646,7 +576,7 @@ public: } bool ignoreNextErrors = false; - wxString errorMessage = text + wxT("\n\n") + _("Information: If you ignore the error or abort a re-compare will be necessary!"); + wxString errorMessage = wxString(text.c_str()) + wxT("\n\n") + _("Information: If you ignore the error or abort a re-compare will be necessary!"); ErrorDlg* errorDlg = new ErrorDlg(parent, errorMessage, ignoreNextErrors); int rv = errorDlg->ShowModal(); @@ -677,13 +607,13 @@ private: }; -void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) +void MainDialog::deleteFilesOnGrid(const std::set<int>& rowsToDeleteOnUI) { if (rowsToDeleteOnUI.size()) { //map grid lines from UI to grid lines in backend (gridData) - set<int> rowsToDeleteOnGrid; - for (set<int>::iterator i = rowsToDeleteOnUI.begin(); i != rowsToDeleteOnUI.end(); ++i) + std::set<int> rowsToDeleteOnGrid; + for (std::set<int>::iterator i = rowsToDeleteOnUI.begin(); i != rowsToDeleteOnUI.end(); ++i) rowsToDeleteOnGrid.insert(gridRefUI[*i]); wxString headerText; @@ -694,7 +624,7 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) else headerText = _("Do you really want to delete the following objects(s)?"); - for (set<int>::iterator i = rowsToDeleteOnGrid.begin(); i != rowsToDeleteOnGrid.end(); ++i) + for (std::set<int>::iterator i = rowsToDeleteOnGrid.begin(); i != rowsToDeleteOnGrid.end(); ++i) { const FileCompareLine& currentCmpLine = currentGridData[*i]; @@ -745,34 +675,41 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) } -void MainDialog::openWithFileBrowser(int rowNumber, const wxGrid* grid) +void MainDialog::openWithFileManager(int rowNumber, const wxGrid* grid) { -#ifdef FFS_WIN + wxString command; + const FileDescrLine* fileDescr = NULL; if (grid == m_gridLeft) { - wxString command = wxString(wxT("explorer ")) + FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue()).c_str(); //default - if (0 <= rowNumber && rowNumber < int(gridRefUI.size())) - { - const FileDescrLine& fileDescr = currentGridData[gridRefUI[rowNumber]].fileDescrLeft; - if (fileDescr.objType != FileDescrLine::TYPE_NOTHING) - command = wxString(wxT("explorer /select,")) + fileDescr.fullName.c_str(); - } - wxExecute(command); + fileDescr = ¤tGridData[gridRefUI[rowNumber]].fileDescrLeft; +#ifdef FFS_WIN + command = wxString(wxT("explorer ")) + FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue().c_str()).c_str(); //default +#endif // FFS_WIN } else if (grid == m_gridRight) { - wxString command = wxString(wxT("explorer ")) + FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue()).c_str(); //default - if (0 <= rowNumber && rowNumber < int(gridRefUI.size())) - { - const FileDescrLine& fileDescr = currentGridData[gridRefUI[rowNumber]].fileDescrRight; - if (fileDescr.objType != FileDescrLine::TYPE_NOTHING) - command = wxString(wxT("explorer /select,")) + fileDescr.fullName.c_str(); - } - wxExecute(command); - } + fileDescr = ¤tGridData[gridRefUI[rowNumber]].fileDescrRight; +#ifdef FFS_WIN + command = wxString(wxT("explorer ")) + FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue().c_str()).c_str(); //default #endif // FFS_WIN + } + else + { + assert(false); + return; + } + + if (fileDescr && fileDescr->objType != FileDescrLine::TYPE_NOTHING) + { + command = globalSettings.gui.commandLineFileManager; + command.Replace(wxT("%x"), fileDescr->fullName.c_str()); + command.Replace(wxT("%path"), wxFileName(fileDescr->fullName.c_str()).GetPath()); + } + + if (!command.empty()) + wxExecute(command.c_str()); } @@ -867,7 +804,7 @@ void MainDialog::onGridMiddleButtonEvent(wxKeyEvent& event) void MainDialog::OnOpenContextMenu(wxGridEvent& event) { - set<int> selection; + std::set<int> selection; if (leadGrid) selection = getSelectedRows(leadGrid); @@ -893,7 +830,7 @@ void MainDialog::OnOpenContextMenu(wxGridEvent& event) //get list of relative file/dir-names into vectors FilterObject newFilterEntry; if (leadGrid == m_gridLeft) - for (set<int>::iterator i = selection.begin(); i != selection.end(); ++i) + for (std::set<int>::iterator i = selection.begin(); i != selection.end(); ++i) { const FileCompareLine& line = currentGridData[gridRefUI[*i]]; newFilterEntry.relativeName = line.fileDescrLeft.relativeName.c_str(); @@ -902,7 +839,7 @@ void MainDialog::OnOpenContextMenu(wxGridEvent& event) exFilterCandidateObj.push_back(newFilterEntry); } else if (leadGrid == m_gridRight) - for (set<int>::iterator i = selection.begin(); i != selection.end(); ++i) + for (std::set<int>::iterator i = selection.begin(); i != selection.end(); ++i) { const FileCompareLine& line = currentGridData[gridRefUI[*i]]; newFilterEntry.relativeName = line.fileDescrRight.relativeName.c_str(); @@ -918,23 +855,23 @@ void MainDialog::OnOpenContextMenu(wxGridEvent& event) if (filename.Find(wxChar('.')) != wxNOT_FOUND) //be careful: AfterLast will return the whole string if '.' is not found! { exFilterCandidateExtension = filename.AfterLast(wxChar('.')); - contextMenu->Append(CONTEXT_EXCLUDE_EXT, wxString(_("Add to exclude filter:")) + wxT(" ") + wxT("*.") + exFilterCandidateExtension); + contextMenu->Append(CONTEXT_EXCLUDE_EXT, wxString(_("Exclude via filter:")) + wxT(" ") + wxT("*.") + exFilterCandidateExtension); } } if (exFilterCandidateObj.size() == 1) - contextMenu->Append(CONTEXT_EXCLUDE_OBJ, wxString(_("Add to exclude filter:")) + wxT(" ") + exFilterCandidateObj[0].relativeName.AfterLast(GlobalResources::FILE_NAME_SEPARATOR)); + contextMenu->Append(CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + exFilterCandidateObj[0].relativeName.AfterLast(GlobalResources::FILE_NAME_SEPARATOR)); else if (exFilterCandidateObj.size() > 1) - contextMenu->Append(CONTEXT_EXCLUDE_OBJ, wxString(_("Add to exclude filter:")) + wxT(" ") + _("<multiple selection>")); + contextMenu->Append(CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + _("<multiple selection>")); } else contextMenu->Append(CONTEXT_FILTER_TEMP, _("Exclude temporarily")); //this element should always be visible contextMenu->AppendSeparator(); contextMenu->Append(CONTEXT_CLIPBOARD, _("Copy to clipboard\tCTRL+C")); -#ifdef FFS_WIN - contextMenu->Append(CONTEXT_EXPLORER, _("Open with Explorer\tD-Click")); -#endif + + contextMenu->Append(CONTEXT_EXPLORER, _("Open with File Manager\tD-Click")); + contextMenu->AppendSeparator(); contextMenu->Append(CONTEXT_DELETE_FILES, _("Delete files\tDEL")); @@ -955,12 +892,10 @@ void MainDialog::OnOpenContextMenu(wxGridEvent& event) contextMenu->Enable(CONTEXT_DELETE_FILES, false); } -#ifdef FFS_WIN if ((leadGrid == m_gridLeft || leadGrid == m_gridRight) && selection.size() <= 1) contextMenu->Enable(CONTEXT_EXPLORER, true); else contextMenu->Enable(CONTEXT_EXPLORER, false); -#endif //show context menu PopupMenu(contextMenu); @@ -975,8 +910,8 @@ void MainDialog::onContextMenuSelection(wxCommandEvent& event) { if (leadGrid) { - set<int> selection = getSelectedRows(leadGrid); - filterRangeTemp(selection); + std::set<int> selection = getSelectedRows(leadGrid); + filterRangeManually(selection); } } else if (eventId == CONTEXT_EXCLUDE_EXT) @@ -1006,7 +941,7 @@ void MainDialog::onContextMenuSelection(wxCommandEvent& event) { if (exFilterCandidateObj.size() > 0) //check needed to determine if filtering is needed { - for (vector<FilterObject>::const_iterator i = exFilterCandidateObj.begin(); i != exFilterCandidateObj.end(); ++i) + for (std::vector<FilterObject>::const_iterator i = exFilterCandidateObj.begin(); i != exFilterCandidateObj.end(); ++i) { if (!cfg.excludeFilter.IsEmpty() && !cfg.excludeFilter.EndsWith(wxT("\n"))) cfg.excludeFilter+= wxT("\n"); @@ -1046,22 +981,40 @@ void MainDialog::onContextMenuSelection(wxCommandEvent& event) { if (leadGrid == m_gridLeft || leadGrid == m_gridRight) { - set<int> selection = getSelectedRows(leadGrid); + std::set<int> selection = getSelectedRows(leadGrid); if (selection.size() == 1) - openWithFileBrowser(*selection.begin(), leadGrid); + openWithFileManager(*selection.begin(), leadGrid); else if (selection.size() == 0) - openWithFileBrowser(-1, leadGrid); + openWithFileManager(-1, leadGrid); } } else if (eventId == CONTEXT_DELETE_FILES) { if (leadGrid) { - set<int> selection = getSelectedRows(leadGrid); + std::set<int> selection = getSelectedRows(leadGrid); deleteFilesOnGrid(selection); } } + else if (eventId == CONTEXT_CUSTOMIZE_COLUMN_LEFT) + { + XmlGlobalSettings::ColumnAttributes colAttr = m_gridLeft->getColumnAttributes(); + CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(this, colAttr); + if (customizeDlg->ShowModal() == CustomizeColsDlg::BUTTON_OKAY) + { + m_gridLeft->setColumnAttributes(colAttr); + } + } + else if (eventId == CONTEXT_CUSTOMIZE_COLUMN_RIGHT) + { + XmlGlobalSettings::ColumnAttributes colAttr = m_gridRight->getColumnAttributes(); + CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(this, colAttr); + if (customizeDlg->ShowModal() == CustomizeColsDlg::BUTTON_OKAY) + { + m_gridRight->setColumnAttributes(colAttr); + } + } event.Skip(); } @@ -1069,19 +1022,31 @@ void MainDialog::onContextMenuSelection(wxCommandEvent& event) void MainDialog::OnColumnMenuLeft(wxGridEvent& event) { + delete contextMenu; + contextMenu = new wxMenu; //re-create context menu + contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_LEFT, _("Customize columns")); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::onContextMenuSelection), NULL, this); + PopupMenu(contextMenu); //show context menu + event.Skip(); } void MainDialog::OnColumnMenuRight(wxGridEvent& event) { + delete contextMenu; + contextMenu = new wxMenu; //re-create context menu + contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, _("Customize columns")); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::onContextMenuSelection), NULL, this); + PopupMenu(contextMenu); //show context menu + event.Skip(); } void MainDialog::OnWriteDirManually(wxCommandEvent& event) { - wxString newDir = FreeFileSync::getFormattedDirectoryName(event.GetString()); + wxString newDir = FreeFileSync::getFormattedDirectoryName(event.GetString().c_str()).c_str(); if (wxDirExists(newDir)) { wxObject* eventObj = event.GetEventObject(); @@ -1094,7 +1059,7 @@ void MainDialog::OnWriteDirManually(wxCommandEvent& event) else { //check if event comes from additional pairs - for (vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + for (std::vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) { FolderPairGenerated* dirPair = *i; if (eventObj == (wxObject*)(dirPair->m_directoryLeft)) @@ -1126,7 +1091,7 @@ void MainDialog::OnDirSelected(wxFileDirPickerEvent& event) m_directoryRight->SetValue(newPath); else //check if event comes from additional pairs { - for (vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + for (std::vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) { FolderPairGenerated* dirPair = *i; if (eventObj == (wxObject*)(dirPair->m_dirPickerLeft)) @@ -1163,6 +1128,7 @@ wxString getFormattedHistoryElement(const wxString& filename) //tests if the same filenames are specified, even if they are relative to the current working directory +inline bool sameFileSpecified(const wxString& file1, const wxString& file2) { wxString file1Full = file1; @@ -1178,9 +1144,24 @@ bool sameFileSpecified(const wxString& file1, const wxString& file2) } +class FindDuplicates +{ +public: + FindDuplicates(const wxString& name) : m_name(name) {} + + bool operator()(const wxString& other) const + { + return sameFileSpecified(m_name, other); + } + +private: + const wxString& m_name; +}; + + void MainDialog::addCfgFileToHistory(const wxString& filename) { - //the default configFile should not be in the history + //the default config file should not be in the history if (sameFileSpecified(FreeFileSync::LAST_CONFIG_FILE, filename)) return; @@ -1188,19 +1169,11 @@ void MainDialog::addCfgFileToHistory(const wxString& filename) if (!wxFileExists(filename)) return; - bool duplicateEntry = false; - unsigned int duplicatePos = 0; - for (unsigned int i = 0; i < cfgFileNames.size(); ++i) - if (sameFileSpecified(cfgFileNames[i], filename)) - { - duplicateEntry = true; - duplicatePos = i; - break; - } - if (duplicateEntry) //if entry is in the list, then jump to element - { - m_choiceLoad->SetSelection(duplicatePos + 1); + std::vector<wxString>::const_iterator i; + if ((i = find_if(cfgFileNames.begin(), cfgFileNames.end(), FindDuplicates(filename))) != cfgFileNames.end()) + { //if entry is in the list, then jump to element + m_choiceLoad->SetSelection(i - cfgFileNames.begin() + 1); } else { @@ -1210,11 +1183,11 @@ void MainDialog::addCfgFileToHistory(const wxString& filename) } //keep maximal size of history list - if (cfgFileNames.size() > unsigned(CfgHistroyLength)) + if (cfgFileNames.size() > CFG_HISTORY_LENGTH) { //delete last rows - cfgFileNames.erase(cfgFileNames.end() - 1); - m_choiceLoad->Delete(CfgHistroyLength); //don't forget: m_choiceLoad has (cfgHistroyLength + 1) elements + cfgFileNames.pop_back(); + m_choiceLoad->Delete(CFG_HISTORY_LENGTH); //don't forget: m_choiceLoad has (CFG_HISTORY_LENGTH + 1) elements } } @@ -1269,7 +1242,7 @@ bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen else //test if additional folder pairs are drop targets { - for (vector<FolderPairGenerated*>::const_iterator i = mainDlg->additionalFolderPairs.begin(); i != mainDlg->additionalFolderPairs.end(); ++i) + for (std::vector<FolderPairGenerated*>::const_iterator i = mainDlg->additionalFolderPairs.begin(); i != mainDlg->additionalFolderPairs.end(); ++i) { FolderPairGenerated* dirPair = *i; if (dropTarget == (dirPair->m_panelLeft)) @@ -1440,15 +1413,18 @@ bool MainDialog::readConfigurationFromXml(const wxString& filename, bool program } catch (const FileError& error) { - if (programStartup && filename == FreeFileSync::LAST_CONFIG_FILE && !wxFileExists(filename)) //do not show error in this case - ; - else if (!programStartup) + if (programStartup) + { + if (filename == FreeFileSync::LAST_CONFIG_FILE && !wxFileExists(filename)) //do not show error in this case + ; + else //program startup: show error message and load defaults + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); + } + else { - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); return false; } - else //program startup: show error message and load defaults - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); } //load main configuration into instance @@ -1471,21 +1447,21 @@ bool MainDialog::readConfigurationFromXml(const wxString& filename, bool program const unsigned int folderPairCount = guiCfg.directoryPairs.size(); if (folderPairCount > 0) { - vector<FolderPair>::const_iterator i = guiCfg.directoryPairs.begin(); + std::vector<FolderPair>::const_iterator i = guiCfg.directoryPairs.begin(); - m_directoryLeft->SetValue(i->leftDirectory); - wxString leftDirFormatted = FreeFileSync::getFormattedDirectoryName(i->leftDirectory); + m_directoryLeft->SetValue(i->leftDirectory.c_str()); + wxString leftDirFormatted = FreeFileSync::getFormattedDirectoryName(i->leftDirectory).c_str(); if (wxDirExists(leftDirFormatted)) m_dirPickerLeft->SetPath(leftDirFormatted); - m_directoryRight->SetValue(i->rightDirectory); - wxString rightDirFormatted = FreeFileSync::getFormattedDirectoryName(i->rightDirectory); + m_directoryRight->SetValue(i->rightDirectory.c_str()); + wxString rightDirFormatted = FreeFileSync::getFormattedDirectoryName(i->rightDirectory).c_str(); if (wxDirExists(rightDirFormatted)) m_dirPickerRight->SetPath(rightDirFormatted); //set additional pairs - for (vector<FolderPair>::const_iterator i = guiCfg.directoryPairs.begin() + 1; i != guiCfg.directoryPairs.end(); ++i) - addFolderPair(i->leftDirectory, i->rightDirectory); + for (std::vector<FolderPair>::const_iterator i = guiCfg.directoryPairs.begin() + 1; i != guiCfg.directoryPairs.end(); ++i) + addFolderPair(i->leftDirectory.c_str(), i->rightDirectory.c_str()); //adjust folder pair buttons const int additionalFolderCount = folderPairCount - 1; @@ -1522,7 +1498,7 @@ bool MainDialog::writeConfigurationToXml(const wxString& filename) } catch (const FileError& error) { - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); return false; } @@ -1755,7 +1731,7 @@ void MainDialog::updateCompareButtons() } -void MainDialog::getFolderPairs(vector<FolderPair>& output, bool formatted) +void MainDialog::getFolderPairs(std::vector<FolderPair>& output, bool formatted) { output.clear(); @@ -1763,8 +1739,8 @@ void MainDialog::getFolderPairs(vector<FolderPair>& output, bool formatted) FolderPair newPair; if (formatted) { - newPair.leftDirectory = FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue()).c_str(); - newPair.rightDirectory = FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue()).c_str(); + newPair.leftDirectory = FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue().c_str()); + newPair.rightDirectory = FreeFileSync::getFormattedDirectoryName(m_directoryRight->GetValue().c_str()); } else { @@ -1774,13 +1750,13 @@ void MainDialog::getFolderPairs(vector<FolderPair>& output, bool formatted) output.push_back(newPair); //add additional pairs - for (vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + for (std::vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) { FolderPairGenerated* dirPair = *i; if (formatted) { - newPair.leftDirectory = FreeFileSync::getFormattedDirectoryName(dirPair->m_directoryLeft->GetValue()); - newPair.rightDirectory = FreeFileSync::getFormattedDirectoryName(dirPair->m_directoryRight->GetValue()); + newPair.leftDirectory = FreeFileSync::getFormattedDirectoryName(dirPair->m_directoryLeft->GetValue().c_str()); + newPair.rightDirectory = FreeFileSync::getFormattedDirectoryName(dirPair->m_directoryRight->GetValue().c_str()); } else { @@ -1796,7 +1772,7 @@ void MainDialog::getFolderPairs(vector<FolderPair>& output, bool formatted) void MainDialog::OnCompare(wxCommandEvent &event) { //assemble vector of formatted folder pairs - vector<FolderPair> directoryPairsFormatted; + std::vector<FolderPair> directoryPairsFormatted; getFolderPairs(directoryPairsFormatted, true); //check if folders are valid @@ -1837,46 +1813,25 @@ void MainDialog::OnCompare(wxCommandEvent &event) CompareStatusHandler statusHandler(this); cmpStatusHandlerTmp = &statusHandler; - FreeFileSync::CompareProcess comparison(false, &statusHandler); +#ifdef FFS_WIN + FreeFileSync::CompareProcess comparison(false, globalSettings.global.handleDstOnFat32, &statusHandler); +#elif defined FFS_LINUX + FreeFileSync::CompareProcess comparison(false, false, &statusHandler); +#endif comparison.startCompareProcess(directoryPairsFormatted, cfg.compareVar, currentGridData); + //if (output.size < 50000) + statusHandler.updateStatusText(_("Sorting file list...")); + statusHandler.forceUiRefresh(); //keep total number of scanned files up to date + sort(currentGridData.begin(), currentGridData.end(), sortByRelativeName<true, SORT_ON_LEFT>); + //filter currentGridData if option is set if (cfg.filterIsActive) FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); writeGrid(currentGridData); //keep it in try/catch to not overwrite status information if compare is aborted - -#ifdef FFS_WIN - //check if DST time correction needs to be applied - if (globalSettings.global.dstCheckActive) - { - int timeShift = 0; - wxString driveName; - FreeFileSync::checkForDSTChange(currentGridData, directoryPairsFormatted, timeShift, driveName); - if (timeShift) - { - bool hideThisDialog = false; - wxString errorMessage = wxString(_("A file time shift due to a daylight saving time change was detected for a FAT/FAT32 drive.")) + wxT("\n") - + _("You can adjust the file times accordingly to resolve the issue:"); - errorMessage+= wxString(wxT("\n\n")) + _("Drive:") + wxT(" ") + driveName + wxT("\n") - + _("Time shift:") + wxT(" ") + globalFunctions::numberToWxString(timeShift); - - //show popup and ask user how to handle the DST change - WarningDlg* warningDlg = new WarningDlg(this, WarningDlg::BUTTON_RESOLVE | WarningDlg::BUTTON_IGNORE, errorMessage, hideThisDialog); - warningDlg->m_bitmap10->SetBitmap(*globalResource.bitmapClock); - if (warningDlg->ShowModal() == WarningDlg::BUTTON_RESOLVE) - { - ModifyFilesDlg* modifyDlg = new ModifyFilesDlg(this, driveName, timeShift); - if (modifyDlg->ShowModal() == ModifyFilesDlg::BUTTON_APPLY) - throw AbortThisProcess(); - } - else - globalSettings.global.dstCheckActive = !hideThisDialog; - } - } -#endif //FFS_WIN } catch (AbortThisProcess& theException) { @@ -1887,12 +1842,12 @@ void MainDialog::OnCompare(wxCommandEvent &event) if (aborted) { //disable the sync button enableSynchronization(false); - m_bpButtonCompare->SetFocus(); + m_buttonCompare->SetFocus(); } else { //once compare is finished enable the sync button enableSynchronization(true); - m_bpButtonSync->SetFocus(); + m_buttonSync->SetFocus(); //hide sort direction indicator on GUI grids m_gridLeft->setSortMarker(-1); @@ -1914,8 +1869,8 @@ void MainDialog::OnAbortCompare(wxCommandEvent& event) void MainDialog::writeGrid(const FileCompareResult& gridData) { m_gridLeft->BeginBatch(); - m_gridRight->BeginBatch(); m_gridMiddle->BeginBatch(); + m_gridRight->BeginBatch(); mapGridDataToUI(gridRefUI, gridData); //update gridRefUI updateStatusInformation(gridRefUI); //write status information for gridRefUI @@ -1923,8 +1878,8 @@ void MainDialog::writeGrid(const FileCompareResult& gridData) //all three grids retrieve their data directly via gridRefUI!!! //the only thing left to do is notify the grids to update their sizes (nr of rows), since this has to be communicated by the grids via messages m_gridLeft->updateGridSizes(); - m_gridRight->updateGridSizes(); m_gridMiddle->updateGridSizes(); + m_gridRight->updateGridSizes(); //enlarge label width to display row numbers correctly int nrOfRows = m_gridLeft->GetNumberRows(); @@ -1936,8 +1891,8 @@ void MainDialog::writeGrid(const FileCompareResult& gridData) } m_gridLeft->EndBatch(); - m_gridRight->EndBatch(); m_gridMiddle->EndBatch(); + m_gridRight->EndBatch(); } @@ -1947,17 +1902,7 @@ void MainDialog::OnSync(wxCommandEvent& event) if (syncDlg->ShowModal() == SyncDialog::BUTTON_START) { //check if there are files/folders to be sync'ed at all - int objectsToCreate = 0; - int objectsToOverwrite = 0; - int objectsToDelete = 0; - double dataToProcess = 0; - FreeFileSync::calcTotalBytesToSync(objectsToCreate, - objectsToOverwrite, - objectsToDelete, - dataToProcess, - currentGridData, - cfg.syncConfiguration); - if (objectsToCreate + objectsToOverwrite + objectsToDelete == 0) + if (!synchronizationNeeded(currentGridData, cfg.syncConfiguration)) { wxMessageBox(_("Nothing to synchronize according to configuration!"), _("Information"), wxICON_WARNING); return; @@ -1998,43 +1943,44 @@ void MainDialog::OnSync(wxCommandEvent& event) void MainDialog::OnLeftGridDoubleClick(wxGridEvent& event) { - openWithFileBrowser(event.GetRow(), m_gridLeft); + openWithFileManager(event.GetRow(), m_gridLeft); event.Skip(); } void MainDialog::OnRightGridDoubleClick(wxGridEvent& event) { - openWithFileBrowser(event.GetRow(), m_gridRight); + openWithFileManager(event.GetRow(), m_gridRight); event.Skip(); } void MainDialog::OnSortLeftGrid(wxGridEvent& event) { - static bool columnSortAscending[4] = {true, true, false, true}; + static bool columnSortAscending[CustomGrid::COLUMN_TYPE_COUNT] = {true, true, false, true}; int currentSortColumn = event.GetCol(); - if (0 <= currentSortColumn && currentSortColumn <= 3) + if (0 <= currentSortColumn < CustomGrid::COLUMN_TYPE_COUNT) { bool& sortAscending = columnSortAscending[currentSortColumn]; + XmlGlobalSettings::ColumnTypes columnType = m_gridLeft->getTypeAtPos(currentSortColumn); - if (currentSortColumn == 0) + if (columnType == XmlGlobalSettings::FILENAME) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByFileName<true, SORT_ON_LEFT>); else sort(currentGridData.begin(), currentGridData.end(), sortByFileName<false, SORT_ON_LEFT>); } - else if (currentSortColumn == 1) + else if (columnType == XmlGlobalSettings::REL_PATH) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByRelativeName<true, SORT_ON_LEFT>); else sort(currentGridData.begin(), currentGridData.end(), sortByRelativeName<false, SORT_ON_LEFT>); } - else if (currentSortColumn == 2) + else if (columnType == XmlGlobalSettings::SIZE) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByFileSize<true, SORT_ON_LEFT>); else sort(currentGridData.begin(), currentGridData.end(), sortByFileSize<false, SORT_ON_LEFT>); } - else if (currentSortColumn == 3) + else if (columnType == XmlGlobalSettings::DATE) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByDate<true, SORT_ON_LEFT>); else sort(currentGridData.begin(), currentGridData.end(), sortByDate<false, SORT_ON_LEFT>); @@ -2043,11 +1989,12 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) writeGrid(currentGridData); //needed to refresh gridRefUI references //set sort direction indicator on UI + m_gridMiddle->setSortMarker(-1); + m_gridRight->setSortMarker(-1); if (sortAscending) m_gridLeft->setSortMarker(currentSortColumn, globalResource.bitmapSmallUp); else m_gridLeft->setSortMarker(currentSortColumn, globalResource.bitmapSmallDown); - m_gridRight->setSortMarker(-1); sortAscending = !sortAscending; } @@ -2057,29 +2004,30 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) void MainDialog::OnSortRightGrid(wxGridEvent& event) { - static bool columnSortAscending[4] = {true, true, false, true}; + static bool columnSortAscending[CustomGrid::COLUMN_TYPE_COUNT] = {true, true, false, true}; int currentSortColumn = event.GetCol(); - if (0 <= currentSortColumn && currentSortColumn <= 3) + if (0 <= currentSortColumn < CustomGrid::COLUMN_TYPE_COUNT) { bool& sortAscending = columnSortAscending[currentSortColumn]; + XmlGlobalSettings::ColumnTypes columnType = m_gridRight->getTypeAtPos(currentSortColumn); - if (currentSortColumn == 0) + if (columnType == XmlGlobalSettings::FILENAME) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByFileName<true, SORT_ON_RIGHT>); else sort(currentGridData.begin(), currentGridData.end(), sortByFileName<false, SORT_ON_RIGHT>); } - else if (currentSortColumn == 1) + else if (columnType == XmlGlobalSettings::REL_PATH) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByRelativeName<true, SORT_ON_RIGHT>); else sort(currentGridData.begin(), currentGridData.end(), sortByRelativeName<false, SORT_ON_RIGHT>); } - else if (currentSortColumn == 2) + else if (columnType == XmlGlobalSettings::SIZE) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByFileSize<true, SORT_ON_RIGHT>); else sort(currentGridData.begin(), currentGridData.end(), sortByFileSize<false, SORT_ON_RIGHT>); } - else if (currentSortColumn == 3) + else if (columnType == XmlGlobalSettings::DATE) { if (sortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByDate<true, SORT_ON_RIGHT>); else sort(currentGridData.begin(), currentGridData.end(), sortByDate<false, SORT_ON_RIGHT>); @@ -2089,6 +2037,7 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) //set sort direction indicator on UI m_gridLeft->setSortMarker(-1); + m_gridMiddle->setSortMarker(-1); if (sortAscending) m_gridRight->setSortMarker(currentSortColumn, globalResource.bitmapSmallUp); else @@ -2100,6 +2049,29 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) } +void MainDialog::OnSortMiddleGrid(wxGridEvent& event) +{ + static bool columnSortAscending = true; + + if (columnSortAscending) sort(currentGridData.begin(), currentGridData.end(), sortByCmpResult<true>); + else sort(currentGridData.begin(), currentGridData.end(), sortByCmpResult<false>); + + writeGrid(currentGridData); //needed to refresh gridRefUI references + + //set sort direction indicator on UI + m_gridLeft->setSortMarker(-1); + m_gridRight->setSortMarker(-1); + if (columnSortAscending) + m_gridMiddle->setSortMarker(0, globalResource.bitmapSmallUp); + else + m_gridMiddle->setSortMarker(0, globalResource.bitmapSmallDown); + + columnSortAscending = !columnSortAscending; + + event.Skip(); +} + + void MainDialog::OnSwapDirs( wxCommandEvent& event ) { //swap directory names : main pair @@ -2108,7 +2080,7 @@ void MainDialog::OnSwapDirs( wxCommandEvent& event ) m_directoryRight->SetValue(tmp); //additional pairs - for (vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + for (std::vector<FolderPairGenerated*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) { FolderPairGenerated* dirPair = *i; tmp = dirPair->m_directoryLeft->GetValue(); @@ -2410,12 +2382,12 @@ void MainDialog::addFolderPair(const wxString& leftDir, const wxString& rightDir //insert directory names if provided newPair->m_directoryLeft->SetValue(leftDir); - wxString leftDirFormatted = FreeFileSync::getFormattedDirectoryName(leftDir); + wxString leftDirFormatted = FreeFileSync::getFormattedDirectoryName(leftDir.c_str()).c_str(); if (wxDirExists(leftDirFormatted)) newPair->m_dirPickerLeft->SetPath(leftDirFormatted); newPair->m_directoryRight->SetValue(rightDir); - wxString rightDirFormatted = FreeFileSync::getFormattedDirectoryName(rightDir); + wxString rightDirFormatted = FreeFileSync::getFormattedDirectoryName(rightDir.c_str()).c_str(); if (wxDirExists(rightDirFormatted)) newPair->m_dirPickerRight->SetPath(rightDirFormatted); } @@ -2468,7 +2440,7 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : mainDialog->m_bpButtonFilter->Disable(); mainDialog->m_hyperlinkCfgFilter->Disable(); mainDialog->m_checkBoxHideFilt->Disable(); - mainDialog->m_bpButtonSync->Disable(); + mainDialog->m_buttonSync->Disable(); mainDialog->m_dirPickerLeft->Disable(); mainDialog->m_dirPickerRight->Disable(); mainDialog->m_bpButtonSwap->Disable(); @@ -2500,8 +2472,8 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : //show abort button mainDialog->m_buttonAbort->Enable(); mainDialog->m_buttonAbort->Show(); - mainDialog->m_bpButtonCompare->Disable(); - mainDialog->m_bpButtonCompare->Hide(); + mainDialog->m_buttonCompare->Disable(); + mainDialog->m_buttonCompare->Hide(); mainDialog->m_buttonAbort->SetFocus(); //updateUiNow(); @@ -2521,7 +2493,7 @@ CompareStatusHandler::~CompareStatusHandler() mainDialog->m_bpButtonFilter->Enable(); mainDialog->m_hyperlinkCfgFilter->Enable(); mainDialog->m_checkBoxHideFilt->Enable(); - mainDialog->m_bpButtonSync->Enable(); + mainDialog->m_buttonSync->Enable(); mainDialog->m_dirPickerLeft->Enable(); mainDialog->m_dirPickerRight->Enable(); mainDialog->m_bpButtonSwap->Enable(); @@ -2552,8 +2524,8 @@ CompareStatusHandler::~CompareStatusHandler() mainDialog->m_buttonAbort->Disable(); mainDialog->m_buttonAbort->Hide(); - mainDialog->m_bpButtonCompare->Enable(); //enable compare button - mainDialog->m_bpButtonCompare->Show(); + mainDialog->m_buttonCompare->Enable(); //enable compare button + mainDialog->m_buttonCompare->Show(); //hide status panel from main window mainDialog->compareStatus->Hide(); @@ -2564,7 +2536,7 @@ CompareStatusHandler::~CompareStatusHandler() inline -void CompareStatusHandler::updateStatusText(const wxString& text) +void CompareStatusHandler::updateStatusText(const Zstring& text) { mainDialog->compareStatus->setStatusText_NoUpdate(text); } @@ -2597,7 +2569,7 @@ void CompareStatusHandler::updateProcessedData(int objectsProcessed, double data } -ErrorHandler::Response CompareStatusHandler::reportError(const wxString& text) +ErrorHandler::Response CompareStatusHandler::reportError(const Zstring& text) { if (ignoreErrors) return ErrorHandler::IGNORE_ERROR; @@ -2605,7 +2577,7 @@ ErrorHandler::Response CompareStatusHandler::reportError(const wxString& text) mainDialog->compareStatus->updateStatusPanelNow(); bool ignoreNextErrors = false; - wxString errorMessage = text + wxT("\n\n") + _("Ignore this error, retry or abort?"); + wxString errorMessage = wxString(text.c_str()) + wxT("\n\n") + _("Ignore this error, retry or abort?"); ErrorDlg* errorDlg = new ErrorDlg(mainDialog, errorMessage, ignoreNextErrors); int rv = errorDlg->ShowModal(); @@ -2671,26 +2643,26 @@ SyncStatusHandler::~SyncStatusHandler() if (abortRequested) { result+= wxString(_("Synchronization aborted!")) + wxT(" ") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!"); - syncStatusFrame->setStatusText_NoUpdate(result); + syncStatusFrame->setStatusText_NoUpdate(result.c_str()); syncStatusFrame->processHasFinished(SyncStatus::ABORTED); //enable okay and close events } else if (failedItems) { result+= wxString(_("Synchronization completed with errors!")) + wxT(" ") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!"); - syncStatusFrame->setStatusText_NoUpdate(result); + syncStatusFrame->setStatusText_NoUpdate(result.c_str()); syncStatusFrame->processHasFinished(SyncStatus::FINISHED_WITH_ERROR); } else { - result+= _("Synchronization completed successfully."); - syncStatusFrame->setStatusText_NoUpdate(result); + result+= _("Synchronization completed successfully!"); + syncStatusFrame->setStatusText_NoUpdate(result.c_str()); syncStatusFrame->processHasFinished(SyncStatus::FINISHED_WITH_SUCCESS); } } inline -void SyncStatusHandler::updateStatusText(const wxString& text) +void SyncStatusHandler::updateStatusText(const Zstring& text) { syncStatusFrame->setStatusText_NoUpdate(text); } @@ -2712,18 +2684,18 @@ void SyncStatusHandler::updateProcessedData(int objectsProcessed, double dataPro } -ErrorHandler::Response SyncStatusHandler::reportError(const wxString& text) +ErrorHandler::Response SyncStatusHandler::reportError(const Zstring& text) { if (ignoreErrors) { - unhandledErrors.Add(text); + unhandledErrors.Add(text.c_str()); return ErrorHandler::IGNORE_ERROR; } syncStatusFrame->updateStatusDialogNow(); bool ignoreNextErrors = false; - wxString errorMessage = text + wxT("\n\n") + _("Ignore this error, retry or abort synchronization?"); + wxString errorMessage = wxString(text.c_str()) + wxT("\n\n") + _("Ignore this error, retry or abort synchronization?"); ErrorDlg* errorDlg = new ErrorDlg(syncStatusFrame, errorMessage, ignoreNextErrors); int rv = errorDlg->ShowModal(); @@ -2731,13 +2703,13 @@ ErrorHandler::Response SyncStatusHandler::reportError(const wxString& text) { case ErrorDlg::BUTTON_IGNORE: ignoreErrors = ignoreNextErrors; - unhandledErrors.Add(text); + unhandledErrors.Add(text.c_str()); return ErrorHandler::IGNORE_ERROR; case ErrorDlg::BUTTON_RETRY: return ErrorHandler::RETRY; case ErrorDlg::BUTTON_ABORT: { - unhandledErrors.Add(text); + unhandledErrors.Add(text.c_str()); abortRequested = true; throw AbortThisProcess(); } @@ -2762,6 +2734,15 @@ void SyncStatusHandler::abortThisProcess() //menu events +void MainDialog::OnMenuGlobalSettings(wxCommandEvent& event) +{ + wxDialog* settingsDlg = new GlobalSettingsDlg(this, globalSettings); + settingsDlg->ShowModal(); + + event.Skip(); +} + + void MainDialog::OnMenuExportFileList(wxCommandEvent& event) { //get a filename @@ -2825,22 +2806,9 @@ void MainDialog::OnMenuExportFileList(wxCommandEvent& event) } -void MainDialog::OnMenuAdjustFileTimes(wxCommandEvent& event) -{ - ModifyFilesDlg* modifyDlg = new ModifyFilesDlg(this, FreeFileSync::getFormattedDirectoryName(m_directoryLeft->GetValue()), 0); - if (modifyDlg->ShowModal() == ModifyFilesDlg::BUTTON_APPLY) - { //disable the sync button - enableSynchronization(false); - m_bpButtonCompare->SetFocus(); - } - - event.Skip(); -} - - void MainDialog::OnMenuBatchJob(wxCommandEvent& event) { - vector<FolderPair> folderPairs; + std::vector<FolderPair> folderPairs; getFolderPairs(folderPairs); BatchDialog* batchDlg = new BatchDialog(this, cfg, folderPairs); @@ -2866,56 +2834,76 @@ void MainDialog::OnMenuQuit(wxCommandEvent& event) } -void MainDialog::OnMenuLangEnglish(wxCommandEvent& event) +//######################################################################################################### +//language selection + +void MainDialog::changeProgramLanguage(const int langID) { - programLanguage->setLanguage(wxLANGUAGE_ENGLISH); //language is a global attribute + programLanguage->setLanguage(langID); //language is a global attribute restartOnExit = true; Destroy(); +} + + +void MainDialog::OnMenuLangChineseSimp(wxCommandEvent& event) +{ + changeProgramLanguage(wxLANGUAGE_CHINESE_SIMPLIFIED); event.Skip(); } -void MainDialog::OnMenuLangGerman(wxCommandEvent& event) +void MainDialog::OnMenuLangDutch(wxCommandEvent& event) { - programLanguage->setLanguage(wxLANGUAGE_GERMAN); //language is a global attribute - restartOnExit = true; - Destroy(); + changeProgramLanguage(wxLANGUAGE_DUTCH); + event.Skip(); +} + + +void MainDialog::OnMenuLangEnglish(wxCommandEvent& event) +{ + changeProgramLanguage(wxLANGUAGE_ENGLISH); event.Skip(); } void MainDialog::OnMenuLangFrench(wxCommandEvent& event) { - programLanguage->setLanguage(wxLANGUAGE_FRENCH); //language is a global attribute - restartOnExit = true; - Destroy(); + changeProgramLanguage(wxLANGUAGE_FRENCH); + event.Skip(); +} + + +void MainDialog::OnMenuLangGerman(wxCommandEvent& event) +{ + changeProgramLanguage(wxLANGUAGE_GERMAN); + event.Skip(); +} + + +void MainDialog::OnMenuLangItalian(wxCommandEvent& event) +{ + changeProgramLanguage(wxLANGUAGE_ITALIAN); event.Skip(); } void MainDialog::OnMenuLangJapanese(wxCommandEvent& event) { - programLanguage->setLanguage(wxLANGUAGE_JAPANESE); //language is a global attribute - restartOnExit = true; - Destroy(); + changeProgramLanguage(wxLANGUAGE_JAPANESE); event.Skip(); } -void MainDialog::OnMenuLangDutch(wxCommandEvent& event) +void MainDialog::OnMenuLangPolish(wxCommandEvent& event) { - programLanguage->setLanguage(wxLANGUAGE_DUTCH); //language is a global attribute - restartOnExit = true; - Destroy(); + changeProgramLanguage(wxLANGUAGE_POLISH); event.Skip(); } -void MainDialog::OnMenuLangChineseSimp(wxCommandEvent& event) +void MainDialog::OnMenuLangPortuguese(wxCommandEvent& event) { - programLanguage->setLanguage(wxLANGUAGE_CHINESE_SIMPLIFIED); //language is a global attribute - restartOnExit = true; - Destroy(); + changeProgramLanguage(wxLANGUAGE_PORTUGUESE); event.Skip(); } diff --git a/ui/MainDialog.h b/ui/MainDialog.h index 31214fe4..6c594b14 100644 --- a/ui/MainDialog.h +++ b/ui/MainDialog.h @@ -16,11 +16,9 @@ #include "../library/resources.h" #include "../library/misc.h" #include <wx/dnd.h> -#include <wx/config.h> #include <stack> #include "../library/processXml.h" -using namespace std; //IDs for context menu items enum ContextItem @@ -31,8 +29,8 @@ enum ContextItem CONTEXT_CLIPBOARD, CONTEXT_EXPLORER, CONTEXT_DELETE_FILES, - CONTEXT_HIDE_COLUMN, - CONTEXT_SHOW_ALL_COLUMNS + CONTEXT_CUSTOMIZE_COLUMN_LEFT, + CONTEXT_CUSTOMIZE_COLUMN_RIGHT }; extern const wxGrid* leadGrid; //point to grid that is in focus @@ -72,11 +70,11 @@ private: void updateStatusInformation(const GridView& output); //context menu functions - set<int> getSelectedRows(const wxGrid* grid); - void filterRangeTemp(const set<int>& rowsToFilterOnUI_View); + std::set<int> getSelectedRows(const wxGrid* grid); + void filterRangeManually(const std::set<int>& rowsToFilterOnUiTable); void copySelectionToClipboard(const wxGrid* selectedGrid); - void openWithFileBrowser(int rowNumber, const wxGrid* grid); - void deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI); + void openWithFileManager(int rowNumber, const wxGrid* grid); + void deleteFilesOnGrid(const std::set<int>& rowsToDeleteOnUI); //work to be done in idle time void OnIdleEvent(wxEvent& event); @@ -111,6 +109,7 @@ private: void OnRightGridDoubleClick(wxGridEvent& event); void OnSortLeftGrid( wxGridEvent& event); void OnSortRightGrid( wxGridEvent& event); + void OnSortMiddleGrid( wxGridEvent& event); void OnLeftOnlyFiles( wxCommandEvent& event); void OnLeftNewerFiles( wxCommandEvent& event); @@ -144,18 +143,22 @@ private: //menu events void OnMenuSaveConfig( wxCommandEvent& event); void OnMenuLoadConfig( wxCommandEvent& event); + void OnMenuGlobalSettings( wxCommandEvent& event); void OnMenuExportFileList( wxCommandEvent& event); - void OnMenuAdjustFileTimes( wxCommandEvent& event); void OnMenuBatchJob( wxCommandEvent& event); void OnMenuAbout( wxCommandEvent& event); void OnMenuQuit( wxCommandEvent& event); + void OnMenuLangChineseSimp( wxCommandEvent& event); + void OnMenuLangDutch( wxCommandEvent& event); void OnMenuLangEnglish( wxCommandEvent& event); - void OnMenuLangGerman( wxCommandEvent& event); void OnMenuLangFrench( wxCommandEvent& event); + void OnMenuLangGerman( wxCommandEvent& event); + void OnMenuLangItalian( wxCommandEvent& event); void OnMenuLangJapanese( wxCommandEvent& event); - void OnMenuLangDutch( wxCommandEvent& event); - void OnMenuLangChineseSimp( wxCommandEvent& event); + void OnMenuLangPolish( wxCommandEvent& event); + void OnMenuLangPortuguese( wxCommandEvent& event); + void changeProgramLanguage(const int langID); void enableSynchronization(bool value); //*********************************************** @@ -176,7 +179,7 @@ private: //folder pairs: //m_directoryLeft, m_directoryRight - vector<FolderPairGenerated*> additionalFolderPairs; //additional pairs to the standard pair + std::vector<FolderPairGenerated*> additionalFolderPairs; //additional pairs to the standard pair //gui settings int widthNotMaximized; @@ -187,7 +190,7 @@ private: //------------------------------------- //convenience method to get all folder pairs (unformatted) - void getFolderPairs(vector<FolderPair>& output, bool formatted = false); + void getFolderPairs(std::vector<FolderPair>& output, bool formatted = false); //UI View Filter settings bool leftOnlyFilesActive; @@ -204,15 +207,14 @@ private: //status information wxLongLong lastStatusChange; - stack<wxString> stackObjects; + std::stack<wxString> stackObjects; //compare status panel (hidden on start, shown when comparing) CompareStatus* compareStatus; //save the last used config filenames - wxConfig* cfgFileHistory; - vector<wxString> cfgFileNames; - static const int CfgHistroyLength = 10; + std::vector<wxString> cfgFileNames; + static const unsigned int CFG_HISTORY_LENGTH = 10; //variables for filtering of m_grid3 bool filteringInitialized; @@ -225,7 +227,7 @@ private: wxString relativeName; FileDescrLine::ObjectType type; }; - vector<FilterObject> exFilterCandidateObj; + std::vector<FilterObject> exFilterCandidateObj; bool synchronizationEnabled; //determines whether synchronization should be allowed @@ -265,10 +267,10 @@ public: CompareStatusHandler(MainDialog* dlg); ~CompareStatusHandler(); - void updateStatusText(const wxString& text); + void updateStatusText(const Zstring& text); void initNewProcess(int objectsTotal, double dataTotal, Process processID); void updateProcessedData(int objectsProcessed, double dataProcessed); - ErrorHandler::Response reportError(const wxString& text); + ErrorHandler::Response reportError(const Zstring& text); void forceUiRefresh(); @@ -287,10 +289,10 @@ public: SyncStatusHandler(wxWindow* dlg, bool ignoreAllErrors); ~SyncStatusHandler(); - void updateStatusText(const wxString& text); + void updateStatusText(const Zstring& text); void initNewProcess(int objectsTotal, double dataTotal, Process processID); void updateProcessedData(int objectsProcessed, double dataProcessed); - ErrorHandler::Response reportError(const wxString& text); + ErrorHandler::Response reportError(const Zstring& text); void forceUiRefresh(); diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp index 4c6d0d7b..f451c1fd 100644 --- a/ui/SmallDialogs.cpp +++ b/ui/SmallDialogs.cpp @@ -3,6 +3,7 @@ #include "../library/resources.h" #include "../algorithm.h" #include <wx/msgdlg.h> +#include "../library/customGrid.h" using namespace FreeFileSync; @@ -300,138 +301,158 @@ void WarningDlg::OnOkay(wxCommandEvent& event) dontShowAgain = m_checkBoxDontShowAgain->GetValue(); EndModal(BUTTON_OKAY); } -//######################################################################################## -ModifyFilesDlg::ModifyFilesDlg(wxWindow* window, const wxString& parentDirectory, const int timeShift) : - ModifyFilesDlgGenerated(window) +//######################################################################################## +CustomizeColsDlg::CustomizeColsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings::ColumnAttributes& attr) : + CustomizeColsDlgGenerated(window), + output(attr) { - if (wxDirExists(parentDirectory)) - m_dirPicker->SetPath(parentDirectory); - m_textCtrlDirectory->SetValue(parentDirectory); - m_spinCtrlTimeShift->SetValue(timeShift); - - m_bitmap24->SetBitmap(*globalResource.bitmapClock); - m_buttonApply->SetFocus(); -} + m_bpButton29->SetBitmapLabel(*globalResource.bitmapMoveUp); + m_bpButton30->SetBitmapLabel(*globalResource.bitmapMoveDown); + xmlAccess::XmlGlobalSettings::ColumnAttributes columnSettings = attr; -ModifyFilesDlg::~ModifyFilesDlg() {} + sort(columnSettings.begin(), columnSettings.end(), xmlAccess::sortByPositionOnly); + for (xmlAccess::XmlGlobalSettings::ColumnAttributes::const_iterator i = columnSettings.begin(); i != columnSettings.end(); ++i) //love these iterators! + { + m_checkListColumns->Append(CustomGrid::getTypeName(i->type)); + m_checkListColumns->Check(i - columnSettings.begin(), i->visible); + } -class ModifyErrorHandler : public ErrorHandler -{ -public: - ModifyErrorHandler(wxWindow* parentWindow, bool& unsolvedErrorOccured) : - parent(parentWindow), - ignoreErrors(false), - unsolvedErrors(unsolvedErrorOccured) {} + m_checkListColumns->SetSelection(0); +} - ~ModifyErrorHandler() {} - Response reportError(const wxString& text) +void CustomizeColsDlg::OnOkay(wxCommandEvent& event) +{ + for (int i = 0; i < int(m_checkListColumns->GetCount()); ++i) { - if (ignoreErrors) + const wxString label = m_checkListColumns->GetString(i); + for (xmlAccess::XmlGlobalSettings::ColumnAttributes::iterator j = output.begin(); j != output.end(); ++j) { - unsolvedErrors = true; - return ErrorHandler::IGNORE_ERROR; + if (CustomGrid::getTypeName(j->type) == label) //not nice but short and no performance issue + { + j->position = i; + j->visible = m_checkListColumns->IsChecked(i);; + break; + } } + } + + EndModal(BUTTON_OKAY); +} - bool ignoreNextErrors = false; - ErrorDlg* errorDlg = new ErrorDlg(parent, text, ignoreNextErrors); - int rv = errorDlg->ShowModal(); - switch (rv) - { - case ErrorDlg::BUTTON_IGNORE: - ignoreErrors = ignoreNextErrors; - unsolvedErrors = true; - return ErrorHandler::IGNORE_ERROR; - case ErrorDlg::BUTTON_RETRY: - return ErrorHandler::RETRY; - case ErrorDlg::BUTTON_ABORT: - { - unsolvedErrors = true; - throw AbortThisProcess(); - } - default: - assert (false); - return ErrorHandler::IGNORE_ERROR; //dummy return value - } +void CustomizeColsDlg::OnDefault(wxCommandEvent& event) +{ + for (unsigned i = 0; i < m_checkListColumns->GetCount(); ++i) + { + m_checkListColumns->SetString(i, CustomGrid::getTypeName(xmlAccess::XmlGlobalSettings::ColumnTypes(i))); + m_checkListColumns->Check(i, true); } +} + -private: - wxWindow* parent; - bool ignoreErrors; - bool& unsolvedErrors; -}; +void CustomizeColsDlg::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} -void ModifyFilesDlg::OnApply(wxCommandEvent& event) +void CustomizeColsDlg::OnClose(wxCloseEvent& event) { - const int timeToShift = m_spinCtrlTimeShift->GetValue(); - const wxString parentDir = m_textCtrlDirectory->GetValue(); + EndModal(0); +} - if (!wxDirExists(parentDir)) + +void CustomizeColsDlg::OnMoveUp(wxCommandEvent& event) +{ + const int pos = m_checkListColumns->GetSelection(); + if (1 <= pos && pos < int(m_checkListColumns->GetCount())) { - wxMessageBox(wxString(_("Directory does not exist:")) + wxT(" \"") + parentDir + wxT("\""), _("Error"), wxOK | wxICON_ERROR); - return; + const bool checked = m_checkListColumns->IsChecked(pos); + const wxString label = m_checkListColumns->GetString(pos); + + m_checkListColumns->SetString(pos, m_checkListColumns->GetString(pos - 1)); + m_checkListColumns->Check(pos, m_checkListColumns->IsChecked(pos - 1)); + m_checkListColumns->SetString(pos - 1, label); + m_checkListColumns->Check(pos - 1, checked); + m_checkListColumns->Select(pos - 1); } + event.Skip(); +} - bool unsolvedErrorOccured = false; //if an error is skipped a re-compare will be necessary! - try - { - wxBusyCursor dummy; //show hourglass cursor - ModifyErrorHandler errorHandler(this, unsolvedErrorOccured); - FreeFileSync::adjustModificationTimes(parentDir, timeToShift, &errorHandler); - } - catch (const AbortThisProcess& theException) +void CustomizeColsDlg::OnMoveDown(wxCommandEvent& event) +{ + const int pos = m_checkListColumns->GetSelection(); + if (0 <= pos && pos < int(m_checkListColumns->GetCount()) - 1) { - EndModal(BUTTON_APPLY); + const bool checked = m_checkListColumns->IsChecked(pos); + const wxString label = m_checkListColumns->GetString(pos); + + m_checkListColumns->SetString(pos, m_checkListColumns->GetString(pos + 1)); + m_checkListColumns->Check(pos, m_checkListColumns->IsChecked(pos + 1)); + m_checkListColumns->SetString(pos + 1, label); + m_checkListColumns->Check(pos + 1, checked); + m_checkListColumns->Select(pos + 1); } + event.Skip(); +} - if (unsolvedErrorOccured) - wxMessageBox(_("Unresolved errors occured during operation!"), _("Information"), wxOK); - else - wxMessageBox(_("All file times have been adjusted successfully!"), _("Information"), wxOK); +//######################################################################################## +GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings) : + GlobalSettingsDlgGenerated(window), + settings(globalSettings) +{ + m_bitmapSettings->SetBitmap(*globalResource.bitmapSettings); - EndModal(BUTTON_APPLY); +#ifdef FFS_WIN + m_checkBoxHandleDstFat->SetValue(globalSettings.global.handleDstOnFat32); +#else + m_checkBoxHandleDstFat->Hide(); +#endif + m_textCtrlFileManager->SetValue(globalSettings.gui.commandLineFileManager); } -void ModifyFilesDlg::OnCancel(wxCommandEvent& event) +void GlobalSettingsDlg::OnOkay(wxCommandEvent& event) { - EndModal(0); + //write global settings only when okay-button is pressed! +#ifdef FFS_WIN + settings.global.handleDstOnFat32 = m_checkBoxHandleDstFat->GetValue(); +#endif + settings.gui.commandLineFileManager = m_textCtrlFileManager->GetValue(); + + EndModal(BUTTON_OKAY); } -void ModifyFilesDlg::OnClose(wxCloseEvent& event) +void GlobalSettingsDlg::OnDefault(wxCommandEvent& event) { - EndModal(0); + m_checkBoxHandleDstFat->SetValue(true); +#ifdef FFS_WIN + m_textCtrlFileManager->SetValue(wxT("explorer /select, %x")); +#elif defined FFS_LINUX + m_textCtrlFileManager->SetValue(wxT("konqueror \"%path\"")); +#endif } -void ModifyFilesDlg::OnWriteDirManually(wxCommandEvent& event) +void GlobalSettingsDlg::OnCancel(wxCommandEvent& event) { - wxString newDir = FreeFileSync::getFormattedDirectoryName(event.GetString()); - if (wxDirExists(newDir)) - m_dirPicker->SetPath(newDir); - - event.Skip(); + EndModal(0); } -void ModifyFilesDlg::OnDirSelected(wxFileDirPickerEvent& event) +void GlobalSettingsDlg::OnClose(wxCloseEvent& event) { - const wxString newPath = event.GetPath(); - m_textCtrlDirectory->SetValue(newPath); - - event.Skip(); + EndModal(0); } - //######################################################################################## /* class for calculation of remaining time: @@ -587,7 +608,7 @@ void SyncStatus::incProgressIndicator_NoUpdate(int objectsProcessed, double data } -void SyncStatus::setStatusText_NoUpdate(const wxString& text) +void SyncStatus::setStatusText_NoUpdate(const Zstring& text) { currentStatusText = text; } @@ -601,8 +622,8 @@ void SyncStatus::updateStatusDialogNow() m_gauge1->SetValue(int(currentData * scalingFactor)); //status text - if (m_textCtrlInfo->GetValue() != currentStatusText && (screenChanged = true)) //avoid screen flicker - m_textCtrlInfo->SetValue(currentStatusText); + if (m_textCtrlInfo->GetValue() != wxString(currentStatusText.c_str()) && (screenChanged = true)) //avoid screen flicker + m_textCtrlInfo->SetValue(currentStatusText.c_str()); //remaining objects const wxString remainingObjTmp = globalFunctions::numberToWxString(totalObjects - currentObjects); @@ -833,7 +854,7 @@ void CompareStatus::incProcessedCmpData_NoUpdate(int objectsProcessed, double da } -void CompareStatus::setStatusText_NoUpdate(const wxString& text) +void CompareStatus::setStatusText_NoUpdate(const Zstring& text) { currentStatusText = text; } @@ -844,8 +865,8 @@ void CompareStatus::updateStatusPanelNow() bool screenChanged = false; //avoid screen flicker by calling layout() only if necessary //status texts - if (m_textCtrlFilename->GetValue() != currentStatusText && (screenChanged = true)) //avoid screen flicker - m_textCtrlFilename->SetValue(currentStatusText); + if (m_textCtrlFilename->GetValue() != wxString(currentStatusText.c_str()) && (screenChanged = true)) //avoid screen flicker + m_textCtrlFilename->SetValue(currentStatusText.c_str()); //nr of scanned objects const wxString scannedObjTmp = globalFunctions::numberToWxString(scannedObjects); diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h index 06e6c407..5be461d2 100644 --- a/ui/SmallDialogs.h +++ b/ui/SmallDialogs.h @@ -3,6 +3,7 @@ #include "../FreeFileSync.h" #include "../library/statusHandler.h" +#include "../library/processXml.h" #include "guiGenerated.h" #include <wx/stopwatch.h> @@ -120,24 +121,48 @@ private: }; -class ModifyFilesDlg : public ModifyFilesDlgGenerated +class CustomizeColsDlg : public CustomizeColsDlgGenerated { public: - ModifyFilesDlg(wxWindow* window, const wxString& parentDirectory, const int timeShift); - ~ModifyFilesDlg(); + CustomizeColsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings::ColumnAttributes& attr); + ~CustomizeColsDlg() {} enum { - BUTTON_APPLY = 10 + BUTTON_OKAY = 10 }; private: - void OnApply(wxCommandEvent& event); + void OnOkay(wxCommandEvent& event); + void OnDefault(wxCommandEvent& event); + void OnCancel(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + + void OnMoveUp(wxCommandEvent& event); + void OnMoveDown(wxCommandEvent& event); + + xmlAccess::XmlGlobalSettings::ColumnAttributes& output; +}; + + +class GlobalSettingsDlg : public GlobalSettingsDlgGenerated +{ +public: + GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings); + ~GlobalSettingsDlg() {} + + enum + { + BUTTON_OKAY = 10 + }; + +private: + void OnOkay(wxCommandEvent& event); + void OnDefault(wxCommandEvent& event); void OnCancel(wxCommandEvent& event); void OnClose(wxCloseEvent& event); - void OnWriteDirManually(wxCommandEvent& event); - void OnDirSelected(wxFileDirPickerEvent& event); + xmlAccess::XmlGlobalSettings& settings; }; @@ -160,7 +185,7 @@ public: void resetGauge(int totalObjectsToProcess, double totalDataToProcess); void incProgressIndicator_NoUpdate(int objectsProcessed, double dataProcessed); - void setStatusText_NoUpdate(const wxString& text); + void setStatusText_NoUpdate(const Zstring& text); void updateStatusDialogNow(); void setCurrentStatus(SyncStatusID id); @@ -185,7 +210,7 @@ private: int currentObjects; //each object represents a file or directory processed int totalObjects; - wxString currentStatusText; + Zstring currentStatusText; bool processPaused; }; @@ -226,13 +251,13 @@ public: void switchToCompareBytewise(int totalCmpObjectsToProcess, double totalCmpDataToProcess); void incScannedObjects_NoUpdate(int number); void incProcessedCmpData_NoUpdate(int objectsProcessed, double dataProcessed); - void setStatusText_NoUpdate(const wxString& text); + void setStatusText_NoUpdate(const Zstring& text); void updateStatusPanelNow(); private: //status variables unsigned int scannedObjects; - wxString currentStatusText; + Zstring currentStatusText; wxStopWatch timeElapsed; diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp index 67ec27dc..f630abc3 100644 --- a/ui/SyncDialog.cpp +++ b/ui/SyncDialog.cpp @@ -5,10 +5,11 @@ #include <wx/msgdlg.h> #include <wx/stdpaths.h> #include <wx/ffile.h> +#include "../library/customButton.h" #include "../synchronization.h" #include "../algorithm.h" -using namespace std; + using namespace xmlAccess; @@ -31,8 +32,6 @@ SyncDialog::SyncDialog(wxWindow* window, calculatePreview(); //set icons for this dialog - m_bpButton18->SetBitmapLabel(*globalResource.bitmapStartSync); - m_bpButton18->SetBitmapDisabled(*globalResource.bitmapStartSyncDis); m_bitmap13->SetBitmap(*globalResource.bitmapLeftOnly); m_bitmap14->SetBitmap(*globalResource.bitmapRightOnly); m_bitmap15->SetBitmap(*globalResource.bitmapLeftNewer); @@ -40,13 +39,22 @@ SyncDialog::SyncDialog(wxWindow* window, m_bitmap17->SetBitmap(*globalResource.bitmapDifferent); if (synchronizationEnabled) - m_bpButton18->Enable(); + { + m_button18->SetForegroundColour(*wxBLACK); + m_button18->setBitmapFront(*globalResource.bitmapStartSync); + m_button18->Enable(); + } else { - m_bpButton18->Disable(); + m_button18->SetForegroundColour(wxColor(94, 94, 94)); //grey + m_button18->setBitmapFront(*globalResource.bitmapStartSyncDis); + m_button18->Disable(); m_button6->SetFocus(); } + bSizer201->Layout(); //wxButtonWithImage size might have changed + + //set radiobutton if ( localSyncConfiguration.exLeftSideOnly == SyncConfiguration::SYNC_DIR_RIGHT && localSyncConfiguration.exRightSideOnly == SyncConfiguration::SYNC_DIR_RIGHT && @@ -72,8 +80,6 @@ SyncDialog::SyncDialog(wxWindow* window, else m_radioBtn3->SetValue(true); //other - m_bpButton18->SetLabel(_("&Start")); - //set tooltip for ambivalent category "different" adjustToolTips(m_bitmap17, config.compareVar); } @@ -195,12 +201,12 @@ void SyncDialog::calculatePreview() int objectsToOverwrite = 0; int objectsToDelete = 0; double dataToProcess = 0; - FreeFileSync::calcTotalBytesToSync(objectsToCreate, + FreeFileSync::calcTotalBytesToSync(gridData, + localSyncConfiguration, + objectsToCreate, objectsToOverwrite, objectsToDelete, - dataToProcess, - gridData, - localSyncConfiguration); + dataToProcess); wxString toCreate = globalFunctions::numberToWxString(objectsToCreate); wxString toUpdate = globalFunctions::numberToWxString(objectsToOverwrite); @@ -378,7 +384,7 @@ void SyncDialog::OnDifferent( wxCommandEvent& event ) BatchDialog::BatchDialog(wxWindow* window, const MainConfiguration& config, - const vector<FolderPair>& folderPairs) : + const std::vector<FolderPair>& folderPairs) : BatchDlgGenerated(window) { //make working copy of mainDialog.cfg.syncConfiguration and recycler setting @@ -411,11 +417,11 @@ BatchDialog::BatchDialog(wxWindow* window, //add folder pairs int scrWindowHeight = 0; - for (vector<FolderPair>::const_iterator i = folderPairs.begin(); i != folderPairs.end(); ++i) + for (std::vector<FolderPair>::const_iterator i = folderPairs.begin(); i != folderPairs.end(); ++i) { BatchFolderPairGenerated* newPair = new BatchFolderPairGenerated(m_scrolledWindow6); - newPair->m_directoryLeft->SetValue(i->leftDirectory); - newPair->m_directoryRight->SetValue(i->rightDirectory); + newPair->m_directoryLeft->SetValue(i->leftDirectory.c_str()); + newPair->m_directoryRight->SetValue(i->rightDirectory.c_str()); bSizerFolderPairs->Add( newPair, 0, wxEXPAND, 5); localFolderPairs.push_back(newPair); @@ -424,7 +430,7 @@ BatchDialog::BatchDialog(wxWindow* window, scrWindowHeight = newPair->GetSize().GetHeight(); } //set size of scrolled window - int pairCount = min(localFolderPairs.size(), size_t(3)); //up to 3 additional pairs shall be shown + int pairCount = std::min(localFolderPairs.size(), size_t(3)); //up to 3 additional pairs shall be shown m_scrolledWindow6->SetMinSize(wxSize( -1, scrWindowHeight * pairCount)); m_scrolledWindow6->Fit(); @@ -553,7 +559,7 @@ void BatchDialog::OnCancel(wxCommandEvent& event) } -void BatchDialog::OnCreateBatchJob(wxCommandEvent& event) +void BatchDialog::OnSaveBatchJob(wxCommandEvent& event) { //get a filename wxString fileName = _("SyncJob.ffs_batch"); //proposal @@ -571,13 +577,13 @@ void BatchDialog::OnCreateBatchJob(wxCommandEvent& event) } //create batch file - if (createBatchFile(fileName)) + if (saveBatchFile(fileName)) EndModal(batchFileCreated); } } -bool BatchDialog::createBatchFile(const wxString& filename) +bool BatchDialog::saveBatchFile(const wxString& filename) { XmlBatchConfig batchCfg; @@ -615,7 +621,7 @@ bool BatchDialog::createBatchFile(const wxString& filename) } catch (const FileError& error) { - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); + wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); return false; } return true; @@ -644,7 +650,6 @@ struct CleanUp bool BatchDialog::createBatchFile(const wxString& filename) { -#ifdef FFS_WIN //create shell link (instead of batch file) for full Unicode support HRESULT hResult = E_FAIL; IShellLink* pShellLink = NULL; diff --git a/ui/SyncDialog.h b/ui/SyncDialog.h index 10f449c8..2f6c5a53 100644 --- a/ui/SyncDialog.h +++ b/ui/SyncDialog.h @@ -63,7 +63,7 @@ class BatchDialog: public BatchDlgGenerated public: BatchDialog(wxWindow* window, const MainConfiguration& config, - const vector<FolderPair>& folderPairs); + const std::vector<FolderPair>& folderPairs); ~BatchDialog(); @@ -82,14 +82,14 @@ private: void OnClose( wxCloseEvent& event); void OnCancel( wxCommandEvent& event); - void OnCreateBatchJob( wxCommandEvent& event); + void OnSaveBatchJob( wxCommandEvent& event); void updateFilterButton(); - bool createBatchFile(const wxString& filename); + bool saveBatchFile(const wxString& filename); SyncConfiguration localSyncConfiguration; - vector<BatchFolderPairGenerated*> localFolderPairs; + std::vector<BatchFolderPairGenerated*> localFolderPairs; bool filterIsActive; }; diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp index b55b50ed..e1f76b38 100644 --- a/ui/guiGenerated.cpp +++ b/ui/guiGenerated.cpp @@ -5,6 +5,7 @@ // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// +#include "../library/customButton.h" #include "../library/customGrid.h" #include "guiGenerated.h" @@ -52,9 +53,18 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_menuItemFrench = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Français") ) , wxEmptyString, wxITEM_RADIO ); m_menu31->Append( m_menuItemFrench ); + m_menuItemItalian = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Italiano") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemItalian ); + + m_menuItemPolish = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Język Polski") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemPolish ); + m_menuItemDutch = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Nederlands") ) , wxEmptyString, wxITEM_RADIO ); m_menu31->Append( m_menuItemDutch ); + m_menuItemPortuguese = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Português") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemPortuguese ); + m_menuItemJapanese = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("日本語") ) , wxEmptyString, wxITEM_RADIO ); m_menu31->Append( m_menuItemJapanese ); @@ -65,12 +75,12 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_menu3->AppendSeparator(); + m_menuItemGlobSett = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Global settings") ) , wxEmptyString, wxITEM_NORMAL ); + m_menu3->Append( m_menuItemGlobSett ); + m_menuItem7 = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Create batch job") ) , wxEmptyString, wxITEM_NORMAL ); m_menu3->Append( m_menuItem7 ); - m_menuItemAdjustTimes = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Adjust file times") ) , wxEmptyString, wxITEM_NORMAL ); - m_menu3->Append( m_menuItemAdjustTimes ); - wxMenuItem* m_menuItem5; m_menuItem5 = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Export file list") ) , wxEmptyString, wxITEM_NORMAL ); m_menu3->Append( m_menuItem5 ); @@ -97,13 +107,12 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer30; bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - m_bpButtonCompare = new wxBitmapButton( m_panel71, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - m_bpButtonCompare->SetDefault(); - m_bpButtonCompare->SetToolTip( _("Compare both sides") ); + m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("&Compare"), wxDefaultPosition, wxSize( 180,37 ), 0 ); + m_buttonCompare->SetDefault(); + m_buttonCompare->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_buttonCompare->SetToolTip( _("Compare both sides") ); - m_bpButtonCompare->SetToolTip( _("Compare both sides") ); - - bSizer30->Add( m_bpButtonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer30->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("Abort"), wxDefaultPosition, wxSize( 190,37 ), 0 ); m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Tahoma") ) ); @@ -186,12 +195,11 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer6->Add( bSizer56, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButtonSync = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - m_bpButtonSync->SetToolTip( _("Open synchronization dialog") ); - - m_bpButtonSync->SetToolTip( _("Open synchronization dialog") ); + 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_bpButtonSync, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer6->Add( m_buttonSync, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); bSizer6->Add( 15, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); @@ -316,7 +324,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxVERTICAL ); - m_gridLeft = new CustomGrid( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_gridLeft = new CustomGridLeft( m_panel1, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_gridLeft->CreateGrid( 15, 4 ); @@ -326,17 +334,9 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_gridLeft->SetMargins( 0, 0 ); // Columns - m_gridLeft->SetColSize( 0, 138 ); - m_gridLeft->SetColSize( 1, 118 ); - m_gridLeft->SetColSize( 2, 67 ); - m_gridLeft->SetColSize( 3, 113 ); - m_gridLeft->EnableDragColMove( true ); + m_gridLeft->EnableDragColMove( false ); m_gridLeft->EnableDragColSize( true ); m_gridLeft->SetColLabelSize( 20 ); - m_gridLeft->SetColLabelValue( 0, _("Filename") ); - m_gridLeft->SetColLabelValue( 1, _("Relative path") ); - m_gridLeft->SetColLabelValue( 2, _("Size") ); - m_gridLeft->SetColLabelValue( 3, _("Date") ); m_gridLeft->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); // Rows @@ -359,7 +359,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer18; bSizer18 = new wxBoxSizer( wxVERTICAL ); - m_gridMiddle = new CustomGrid( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_gridMiddle = new CustomGridMiddle( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_gridMiddle->CreateGrid( 15, 1 ); @@ -397,7 +397,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer10; bSizer10 = new wxBoxSizer( wxVERTICAL ); - m_gridRight = new CustomGrid( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_gridRight = new CustomGridRight( m_panel2, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_gridRight->CreateGrid( 15, 4 ); @@ -407,17 +407,9 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_gridRight->SetMargins( 0, 0 ); // Columns - m_gridRight->SetColSize( 0, 138 ); - m_gridRight->SetColSize( 1, 118 ); - m_gridRight->SetColSize( 2, 67 ); - m_gridRight->SetColSize( 3, 113 ); - m_gridRight->EnableDragColMove( true ); + m_gridRight->EnableDragColMove( false ); m_gridRight->EnableDragColSize( true ); m_gridRight->SetColLabelSize( 20 ); - m_gridRight->SetColLabelValue( 0, _("Filename") ); - m_gridRight->SetColLabelValue( 1, _("Relative path") ); - m_gridRight->SetColLabelValue( 2, _("Size") ); - m_gridRight->SetColLabelValue( 3, _("Date") ); m_gridRight->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); // Rows @@ -442,7 +434,6 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); bSizer3 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer58; bSizer58 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer16; @@ -457,11 +448,11 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxString m_choiceLoadChoices[] = { _("Load from file...") }; int m_choiceLoadNChoices = sizeof( m_choiceLoadChoices ) / sizeof( wxString ); - m_choiceLoad = new wxChoice( m_panel4, wxID_ANY, wxDefaultPosition, wxSize( 140,-1 ), m_choiceLoadNChoices, m_choiceLoadChoices, 0 ); + m_choiceLoad = new wxChoice( m_panel4, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), m_choiceLoadNChoices, m_choiceLoadChoices, 0 ); m_choiceLoad->SetSelection( 0 ); m_choiceLoad->SetToolTip( _("Load configuration via...\n - this list (press DEL to delete items)\n - drag & drop to this window\n - startup parameter") ); - sbSizer16->Add( m_choiceLoad, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( m_choiceLoad, 1, wxALIGN_CENTER_VERTICAL, 5 ); bSizer58->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); @@ -603,14 +594,17 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const this->Connect( m_menuItemGerman->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangGerman ) ); this->Connect( m_menuItemEnglish->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangEnglish ) ); this->Connect( m_menuItemFrench->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangFrench ) ); + this->Connect( m_menuItemItalian->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangItalian ) ); + this->Connect( m_menuItemPolish->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangPolish ) ); this->Connect( m_menuItemDutch->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangDutch ) ); + this->Connect( m_menuItemPortuguese->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangPortuguese ) ); this->Connect( m_menuItemJapanese->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangJapanese ) ); this->Connect( m_menuItemChineseSimple->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangChineseSimp ) ); + this->Connect( m_menuItemGlobSett->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); this->Connect( m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); - this->Connect( m_menuItemAdjustTimes->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAdjustFileTimes ) ); this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); - m_bpButtonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); + m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAbortCompare ), NULL, this ); m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByTimeSize ), NULL, this ); m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByContent ), NULL, this ); @@ -618,7 +612,7 @@ 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_bpButtonSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSync ), NULL, this ); + m_buttonSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSync ), NULL, this ); m_directoryLeft->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MainDialogGenerated::OnWriteDirManually ), 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 ); @@ -631,6 +625,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_gridLeft->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortLeftGrid ), NULL, this ); m_gridLeft->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnColumnMenuLeft ), NULL, this ); m_gridMiddle->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnOpenContextMenu ), NULL, this ); + m_gridMiddle->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortMiddleGrid ), NULL, this ); m_gridRight->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnRightGridDoubleClick ), NULL, this ); m_gridRight->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnOpenContextMenu ), NULL, this ); m_gridRight->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortRightGrid ), NULL, this ); @@ -659,14 +654,17 @@ MainDialogGenerated::~MainDialogGenerated() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangGerman ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangEnglish ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangFrench ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangItalian ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangPolish ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangDutch ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangPortuguese ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangJapanese ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuLangChineseSimp ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAdjustFileTimes ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); - m_bpButtonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); + m_buttonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAbortCompare ), NULL, this ); m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByTimeSize ), NULL, this ); m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompareByContent ), NULL, this ); @@ -674,7 +672,7 @@ 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_bpButtonSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSync ), NULL, this ); + m_buttonSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSync ), NULL, this ); m_directoryLeft->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( MainDialogGenerated::OnWriteDirManually ), 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 ); @@ -687,6 +685,7 @@ MainDialogGenerated::~MainDialogGenerated() m_gridLeft->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortLeftGrid ), NULL, this ); m_gridLeft->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnColumnMenuLeft ), NULL, this ); m_gridMiddle->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnOpenContextMenu ), NULL, this ); + m_gridMiddle->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortMiddleGrid ), NULL, this ); m_gridRight->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnRightGridDoubleClick ), NULL, this ); m_gridRight->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnOpenContextMenu ), NULL, this ); m_gridRight->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortRightGrid ), NULL, this ); @@ -804,7 +803,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer72; bSizer72 = new wxBoxSizer( wxVERTICAL ); - m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Create a batch job"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Batch job"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText56->Wrap( -1 ); m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); @@ -1052,7 +1051,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer68; bSizer68 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonCreate = new wxButton( this, wxID_ANY, _("&Create"), wxDefaultPosition, wxSize( 120,35 ), 0 ); + m_buttonCreate = new wxButton( this, wxID_ANY, _("&Save"), wxDefaultPosition, wxSize( 120,35 ), 0 ); m_buttonCreate->SetDefault(); m_buttonCreate->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); @@ -1084,7 +1083,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS 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_buttonCreate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCreateBatchJob ), NULL, this ); + m_buttonCreate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); } @@ -1101,7 +1100,7 @@ BatchDlgGenerated::~BatchDlgGenerated() 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_buttonCreate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCreateBatchJob ), NULL, this ); + m_buttonCreate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); } @@ -1277,16 +1276,14 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr wxBoxSizer* bSizer29; bSizer29 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer201; bSizer201 = new wxBoxSizer( wxHORIZONTAL ); - m_bpButton18 = new wxBitmapButton( this, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 140,58 ), wxBU_AUTODRAW ); - m_bpButton18->SetDefault(); - m_bpButton18->SetToolTip( _("Start synchronization") ); + 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") ); - m_bpButton18->SetToolTip( _("Start synchronization") ); - - bSizer201->Add( m_bpButton18, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201->Add( m_button18, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer201->Add( 18, 0, 0, wxEXPAND, 5 ); @@ -1579,7 +1576,7 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); - m_bpButton18->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnStartSync ), NULL, this ); + 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 ); @@ -1601,7 +1598,7 @@ SyncDlgGenerated::~SyncDlgGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); - m_bpButton18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnStartSync ), NULL, this ); + m_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 ); @@ -2022,7 +2019,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_staticText73 = new wxStaticText( m_scrolledWindow4, wxID_ANY, _(" MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText73->Wrap( -1 ); - bSizer73->Add( m_staticText73, 0, wxALL|wxEXPAND, 5 ); + bSizer73->Add( m_staticText73, 0, wxEXPAND|wxALL, 5 ); m_staticText74 = new wxStaticText( m_scrolledWindow4, wxID_ANY, _("- ZenJu -"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText74->Wrap( -1 ); @@ -2051,7 +2048,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer72->Add( m_staticText54, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); wxFlexGridSizer* fgSizer9; - fgSizer9 = new wxFlexGridSizer( 4, 2, 5, 20 ); + fgSizer9 = new wxFlexGridSizer( 1, 2, 5, 20 ); fgSizer9->SetFlexibleDirection( wxBOTH ); fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); @@ -2087,6 +2084,30 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_staticText92->Wrap( -1 ); fgSizer9->Add( m_staticText92, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText911 = new wxStaticText( m_scrolledWindow3, wxID_ANY, _("Wojtek Pietruszewski"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText911->Wrap( -1 ); + fgSizer9->Add( m_staticText911, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText921 = new wxStaticText( m_scrolledWindow3, wxID_ANY, _("Język Polski"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText921->Wrap( -1 ); + fgSizer9->Add( m_staticText921, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText9211 = new wxStaticText( m_scrolledWindow3, wxID_ANY, _("QuestMark"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9211->Wrap( -1 ); + fgSizer9->Add( m_staticText9211, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText9212 = new wxStaticText( m_scrolledWindow3, wxID_ANY, _("Português"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9212->Wrap( -1 ); + fgSizer9->Add( m_staticText9212, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText92121 = new wxStaticText( m_scrolledWindow3, wxID_ANY, _("Emmo"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText92121->Wrap( -1 ); + fgSizer9->Add( m_staticText92121, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText92122 = new wxStaticText( m_scrolledWindow3, wxID_ANY, _("Italiano"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText92122->Wrap( -1 ); + fgSizer9->Add( m_staticText92122, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer72->Add( fgSizer9, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); m_scrolledWindow3->SetSizer( bSizer72 ); @@ -2094,7 +2115,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer72->Fit( m_scrolledWindow3 ); bSizer53->Add( m_scrolledWindow3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 30 ); + bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 25 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); @@ -2450,7 +2471,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer72; bSizer72 = new wxBoxSizer( wxVERTICAL ); - m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Set filter for synchronization"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Synchronization filter"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText56->Wrap( -1 ); m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); @@ -2619,7 +2640,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_button17 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); bSizer22->Add( m_button17, 0, wxALIGN_BOTTOM, 5 ); - bSizer21->Add( bSizer22, 0, wxEXPAND|wxTOP, 5 ); + bSizer21->Add( bSizer22, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); this->SetSizer( bSizer21 ); this->Layout(); @@ -2645,18 +2666,101 @@ FilterDlgGenerated::~FilterDlgGenerated() m_button17->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnCancel ), NULL, this ); } -ModifyFilesDlgGenerated::ModifyFilesDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +CustomizeColsDlgGenerated::CustomizeColsDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - wxBoxSizer* bSizer80; - bSizer80 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer96; + bSizer96 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer99; + bSizer99 = new wxBoxSizer( wxHORIZONTAL ); + + wxArrayString m_checkListColumnsChoices; + m_checkListColumns = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkListColumnsChoices, 0 ); + bSizer99->Add( m_checkListColumns, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer98; + bSizer98 = new wxBoxSizer( wxVERTICAL ); + + m_bpButton29 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButton29->SetToolTip( _("Move column up") ); + + m_bpButton29->SetToolTip( _("Move column up") ); + + bSizer98->Add( m_bpButton29, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_bpButton30 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButton30->SetToolTip( _("Move column down") ); + + m_bpButton30->SetToolTip( _("Move column down") ); + + bSizer98->Add( m_bpButton30, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizer99->Add( bSizer98, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer96->Add( bSizer99, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer97; + bSizer97 = new wxBoxSizer( wxHORIZONTAL ); + + m_button28 = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button28->SetDefault(); + m_button28->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer97->Add( m_button28, 0, wxALL, 5 ); + + m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button9->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - wxBoxSizer* bSizer841; - bSizer841 = new wxBoxSizer( wxHORIZONTAL ); + bSizer97->Add( m_button9, 0, wxALL, 5 ); - m_bitmap24 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer841->Add( m_bitmap24, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + m_button29 = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button29->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer97->Add( m_button29, 0, wxALL, 5 ); + + 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 ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CustomizeColsDlgGenerated::OnClose ) ); + m_bpButton29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveUp ), NULL, this ); + m_bpButton30->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveDown ), NULL, this ); + m_button28->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), NULL, this ); + m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); + m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnCancel ), NULL, this ); +} + +CustomizeColsDlgGenerated::~CustomizeColsDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CustomizeColsDlgGenerated::OnClose ) ); + m_bpButton29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveUp ), NULL, this ); + m_bpButton30->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveDown ), NULL, this ); + m_button28->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), NULL, this ); + m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); + m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnCancel ), NULL, this ); +} + +GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer95; + bSizer95 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer86; + bSizer86 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapSettings = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); + bSizer86->Add( m_bitmapSettings, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); @@ -2664,101 +2768,92 @@ ModifyFilesDlgGenerated::ModifyFilesDlgGenerated( wxWindow* parent, wxWindowID i wxBoxSizer* bSizer72; bSizer72 = new wxBoxSizer( wxVERTICAL ); - m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Adjust file times"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Global settings"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText56->Wrap( -1 ); m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); m_panel8->SetSizer( bSizer72 ); m_panel8->Layout(); bSizer72->Fit( m_panel8 ); - bSizer841->Add( m_panel8, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer841->Add( 0, 0, 1, 0, 5 ); - - bSizer80->Add( bSizer841, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); + bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - bSizer80->Add( 0, 5, 0, wxEXPAND, 5 ); + bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer84; - bSizer84 = new wxBoxSizer( wxHORIZONTAL ); + bSizer95->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer84->Add( 10, 0, 0, wxEXPAND, 5 ); + bSizer95->Add( 0, 10, 0, 0, 5 ); - m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Adjust modification times of all files contained in the specified folder and its subfolders. This manual adaption might become necessary if you are synchronizing against a FAT32 drive and the daylight saving time is switched. For an overview about the issue see this article:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextHeader->Wrap( 400 ); - m_staticTextHeader->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + wxStaticBoxSizer* sbSizer23; + sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); - bSizer84->Add( m_staticTextHeader, 0, wxALL, 5 ); + m_checkBoxHandleDstFat = new wxCheckBox( this, wxID_ANY, _("FAT32: Handle Daylight Saving Time"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxHandleDstFat->SetToolTip( _("Active for FAT/FAT32 drives only: When comparing filetimes treat files that differ by less or equal than 1 hour as equal. This ensures daylight saving time switches are handled properly.") ); - bSizer84->Add( 10, 0, 0, wxEXPAND, 5 ); + sbSizer23->Add( m_checkBoxHandleDstFat, 0, wxALL, 5 ); - bSizer80->Add( bSizer84, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + wxBoxSizer* bSizer104; + bSizer104 = new wxBoxSizer( wxHORIZONTAL ); - m_hyperlink6 = new wxHyperlinkCtrl( this, wxID_ANY, _("http://www.codeproject.com/KB/datetime/dstbugs.aspx"), wxT("http://www.codeproject.com/KB/datetime/dstbugs.aspx"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer80->Add( m_hyperlink6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_staticText97 = new wxStaticText( this, wxID_ANY, _("File Manager integration:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText97->Wrap( -1 ); + m_staticText97->SetToolTip( _("This commandline will be executed each time you doubleclick on a filename. %x serves as a placeholder for the selected file.") ); + bSizer104->Add( m_staticText97, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer80->Add( 0, 5, 0, wxEXPAND, 5 ); + m_textCtrlFileManager = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 150,-1 ), 0 ); + m_textCtrlFileManager->SetToolTip( _("This commandline will be executed each time you doubleclick on a filename. %x serves as a placeholder for the selected file.") ); - wxStaticBoxSizer* sbSizer24; - sbSizer24 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Select a folder") ), wxHORIZONTAL ); + bSizer104->Add( m_textCtrlFileManager, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_textCtrlDirectory = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer24->Add( m_textCtrlDirectory, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + sbSizer23->Add( bSizer104, 1, wxEXPAND, 5 ); - m_dirPicker = new wxDirPickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); - sbSizer24->Add( m_dirPicker, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + bSizer95->Add( sbSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); - bSizer80->Add( sbSizer24, 0, wxEXPAND|wxALL, 5 ); - wxStaticBoxSizer* sbSizer23; - sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Time shift in seconds") ), wxVERTICAL ); + bSizer95->Add( 0, 10, 0, 0, 5 ); - m_spinCtrlTimeShift = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, -2100000000, 2100000000, 0 ); - sbSizer23->Add( m_spinCtrlTimeShift, 0, wxRIGHT|wxLEFT, 5 ); + wxBoxSizer* bSizer97; + bSizer97 = new wxBoxSizer( wxHORIZONTAL ); - bSizer80->Add( sbSizer23, 0, wxALL|wxEXPAND, 5 ); + m_button28 = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button28->SetDefault(); + m_button28->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); - wxBoxSizer* bSizer83; - bSizer83 = new wxBoxSizer( wxHORIZONTAL ); + bSizer97->Add( m_button28, 0, wxALL, 5 ); - m_buttonApply = new wxButton( this, wxID_APPLY, _("Apply"), wxDefaultPosition, wxSize( -1,35 ), 0 ); - m_buttonApply->SetDefault(); - m_buttonApply->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button9->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer83->Add( m_buttonApply, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer97->Add( m_button9, 0, wxALL, 5 ); - m_button21 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button21->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_button29 = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button29->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer83->Add( m_button21, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer97->Add( m_button29, 0, wxALL, 5 ); - bSizer80->Add( bSizer83, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer95->Add( bSizer97, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - this->SetSizer( bSizer80 ); + this->SetSizer( bSizer95 ); this->Layout(); - bSizer80->Fit( this ); + bSizer95->Fit( this ); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ModifyFilesDlgGenerated::OnClose ) ); - m_textCtrlDirectory->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ModifyFilesDlgGenerated::OnWriteDirManually ), NULL, this ); - m_dirPicker->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( ModifyFilesDlgGenerated::OnDirSelected ), NULL, this ); - m_buttonApply->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ModifyFilesDlgGenerated::OnApply ), NULL, this ); - m_button21->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ModifyFilesDlgGenerated::OnCancel ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); + m_button28->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); + m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); + m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); } -ModifyFilesDlgGenerated::~ModifyFilesDlgGenerated() +GlobalSettingsDlgGenerated::~GlobalSettingsDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ModifyFilesDlgGenerated::OnClose ) ); - m_textCtrlDirectory->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ModifyFilesDlgGenerated::OnWriteDirManually ), NULL, this ); - m_dirPicker->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( ModifyFilesDlgGenerated::OnDirSelected ), NULL, this ); - m_buttonApply->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ModifyFilesDlgGenerated::OnApply ), NULL, this ); - m_button21->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ModifyFilesDlgGenerated::OnCancel ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); + m_button28->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); + m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); + m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); } diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h index d2c64166..75f0fb28 100644 --- a/ui/guiGenerated.h +++ b/ui/guiGenerated.h @@ -10,7 +10,10 @@ #include <wx/intl.h> -class CustomGrid; +class CustomGridLeft; +class CustomGridMiddle; +class CustomGridRight; +class wxButtonWithImage; #include <wx/string.h> #include <wx/bitmap.h> @@ -21,10 +24,10 @@ class CustomGrid; #include <wx/font.h> #include <wx/colour.h> #include <wx/settings.h> -#include <wx/bmpbuttn.h> #include <wx/button.h> #include <wx/sizer.h> #include <wx/radiobut.h> +#include <wx/bmpbuttn.h> #include <wx/statbox.h> #include <wx/hyperlink.h> #include <wx/checkbox.h> @@ -43,7 +46,7 @@ class CustomGrid; #include <wx/animate.h> #include <wx/treectrl.h> #include <wx/notebook.h> -#include <wx/spinctrl.h> +#include <wx/checklst.h> /////////////////////////////////////////////////////////////////////////// @@ -65,17 +68,20 @@ class MainDialogGenerated : public wxFrame wxMenuItem* m_menuItemGerman; wxMenuItem* m_menuItemEnglish; wxMenuItem* m_menuItemFrench; + wxMenuItem* m_menuItemItalian; + wxMenuItem* m_menuItemPolish; wxMenuItem* m_menuItemDutch; + wxMenuItem* m_menuItemPortuguese; wxMenuItem* m_menuItemJapanese; wxMenuItem* m_menuItemChineseSimple; + wxMenuItem* m_menuItemGlobSett; wxMenuItem* m_menuItem7; - wxMenuItem* m_menuItemAdjustTimes; wxMenu* m_menu2; wxBoxSizer* bSizer1; wxPanel* m_panel71; wxBoxSizer* bSizer6; - wxBitmapButton* m_bpButtonCompare; + wxButtonWithImage* m_buttonCompare; wxButton* m_buttonAbort; wxRadioButton* m_radioBtnSizeDate; wxRadioButton* m_radioBtnContent; @@ -86,7 +92,7 @@ class MainDialogGenerated : public wxFrame wxHyperlinkCtrl* m_hyperlinkCfgFilter; wxCheckBox* m_checkBoxHideFilt; - wxBitmapButton* m_bpButtonSync; + wxButtonWithImage* m_buttonSync; wxPanel* m_panel11; wxStaticBoxSizer* sbSizer2; @@ -106,12 +112,13 @@ class MainDialogGenerated : public wxFrame wxScrolledWindow* m_scrolledWindowFolderPairs; wxBoxSizer* bSizerFolderPairs; wxPanel* m_panel1; - CustomGrid* m_gridLeft; + CustomGridLeft* m_gridLeft; wxPanel* m_panel3; - CustomGrid* m_gridMiddle; + CustomGridMiddle* m_gridMiddle; wxPanel* m_panel2; - CustomGrid* m_gridRight; + CustomGridRight* m_gridRight; wxBoxSizer* bSizer3; + wxBoxSizer* bSizer58; wxBitmapButton* m_bpButton201; wxChoice* m_choiceLoad; @@ -149,11 +156,14 @@ class MainDialogGenerated : public wxFrame virtual void OnMenuLangGerman( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuLangEnglish( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuLangFrench( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangItalian( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangPolish( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuLangDutch( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangPortuguese( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuLangJapanese( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuLangChineseSimp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuGlobalSettings( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuBatchJob( wxCommandEvent& event ){ event.Skip(); } - virtual void OnMenuAdjustFileTimes( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuExportFileList( wxCommandEvent& event ){ event.Skip(); } virtual void OnMenuAbout( wxCommandEvent& event ){ event.Skip(); } virtual void OnAbortCompare( wxCommandEvent& event ){ event.Skip(); } @@ -172,6 +182,7 @@ class MainDialogGenerated : public wxFrame virtual void OnOpenContextMenu( wxGridEvent& event ){ event.Skip(); } virtual void OnSortLeftGrid( wxGridEvent& event ){ event.Skip(); } virtual void OnColumnMenuLeft( wxGridEvent& event ){ event.Skip(); } + virtual void OnSortMiddleGrid( wxGridEvent& event ){ event.Skip(); } virtual void OnRightGridDoubleClick( wxGridEvent& event ){ event.Skip(); } virtual void OnSortRightGrid( wxGridEvent& event ){ event.Skip(); } virtual void OnColumnMenuRight( wxGridEvent& event ){ event.Skip(); } @@ -284,12 +295,12 @@ class BatchDlgGenerated : public wxDialog virtual void OnLeftNewer( wxCommandEvent& event ){ event.Skip(); } virtual void OnRightNewer( wxCommandEvent& event ){ event.Skip(); } virtual void OnDifferent( wxCommandEvent& event ){ event.Skip(); } - virtual void OnCreateBatchJob( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSaveBatchJob( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } public: - BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Create a batch job"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~BatchDlgGenerated(); }; @@ -356,7 +367,8 @@ class SyncDlgGenerated : public wxDialog private: protected: - wxBitmapButton* m_bpButton18; + wxBoxSizer* bSizer201; + wxButtonWithImage* m_button18; wxCheckBox* m_checkBoxUseRecycler; wxCheckBox* m_checkBoxIgnoreErrors; @@ -552,6 +564,12 @@ class AboutDlgGenerated : public wxDialog wxStaticText* m_staticText712; wxStaticText* m_staticText91; wxStaticText* m_staticText92; + wxStaticText* m_staticText911; + wxStaticText* m_staticText921; + wxStaticText* m_staticText9211; + wxStaticText* m_staticText9212; + wxStaticText* m_staticText92121; + wxStaticText* m_staticText92122; wxStaticLine* m_staticline3; wxStaticText* m_staticText131; wxStaticBitmap* m_bitmap9; @@ -730,40 +748,67 @@ class FilterDlgGenerated : public wxDialog }; /////////////////////////////////////////////////////////////////////////////// -/// Class ModifyFilesDlgGenerated +/// Class CustomizeColsDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class ModifyFilesDlgGenerated : public wxDialog +class CustomizeColsDlgGenerated : public wxDialog { private: protected: - wxStaticBitmap* m_bitmap24; - wxPanel* m_panel8; - wxStaticText* m_staticText56; + wxCheckListBox* m_checkListColumns; + wxBitmapButton* m_bpButton29; + wxBitmapButton* m_bpButton30; + 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(); } + virtual void OnMoveDown( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDefault( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + CustomizeColsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Customize columns"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~CustomizeColsDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class GlobalSettingsDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class GlobalSettingsDlgGenerated : public wxDialog +{ + private: + + protected: + wxStaticBitmap* m_bitmapSettings; + wxPanel* m_panel8; + wxStaticText* m_staticText56; - wxStaticText* m_staticTextHeader; - wxHyperlinkCtrl* m_hyperlink6; + wxCheckBox* m_checkBoxHandleDstFat; + wxStaticText* m_staticText97; + wxTextCtrl* m_textCtrlFileManager; - wxTextCtrl* m_textCtrlDirectory; - wxDirPickerCtrl* m_dirPicker; - wxSpinCtrl* m_spinCtrlTimeShift; - wxButton* m_buttonApply; - wxButton* m_button21; + 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 OnWriteDirManually( wxCommandEvent& event ){ event.Skip(); } - virtual void OnDirSelected( wxFileDirPickerEvent& event ){ event.Skip(); } - virtual void OnApply( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDefault( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } public: - ModifyFilesDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~ModifyFilesDlgGenerated(); + GlobalSettingsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~GlobalSettingsDlgGenerated(); }; |