diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:14 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:19:14 +0200 |
commit | 01eb8253196672c969a39587e90b49321a182428 (patch) | |
tree | 4a3b71d7913de519744466c9227fda6461c4f0b5 /ui | |
parent | 5.0 (diff) | |
download | FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.gz FreeFileSync-01eb8253196672c969a39587e90b49321a182428.tar.bz2 FreeFileSync-01eb8253196672c969a39587e90b49321a182428.zip |
5.1
Diffstat (limited to 'ui')
36 files changed, 1265 insertions, 1279 deletions
diff --git a/ui/Taskbar_Seven/taskbar.cpp b/ui/Taskbar_Seven/taskbar.cpp index be662242..6c1365a4 100644 --- a/ui/Taskbar_Seven/taskbar.cpp +++ b/ui/Taskbar_Seven/taskbar.cpp @@ -27,7 +27,7 @@ ComPtr<ITaskbarList3> getInstance() ComPtr<ITaskbarList3> taskbarlist; HRESULT hr = ::CoCreateInstance(CLSID_TaskbarList, - NULL, + nullptr, CLSCTX_ALL, IID_PPV_ARGS(taskbarlist.init())); if (FAILED(hr)) diff --git a/ui/batch_config.cpp b/ui/batch_config.cpp index dac14637..0ed13399 100644 --- a/ui/batch_config.cpp +++ b/ui/batch_config.cpp @@ -14,7 +14,7 @@ #include <zen/file_handling.h> #include "msg_popup.h" #include "gui_generated.h" -#include <wx/dnd.h> +//#include <wx/dnd.h> #include <wx/msgdlg.h> #include <wx+/button.h> #include <wx+/choice_enum.h> @@ -28,7 +28,7 @@ class DirectoryPairBatch; class BatchDialog: public BatchDlgGenerated { - friend class BatchFileDropEvent; + // friend class BatchFileDropEvent; template <class GuiPanel> friend class FolderPairCallback; @@ -52,8 +52,8 @@ private: void OnGlobalFilterContext(wxCommandEvent& event); virtual void OnCheckSaveLog( wxCommandEvent& event); virtual void OnChangeMaxLogCountTxt(wxCommandEvent& event); - virtual void OnClose( wxCloseEvent& event); - virtual void OnCancel( wxCommandEvent& event); + virtual void OnClose( wxCloseEvent& event) { EndModal(0); } + virtual void OnCancel( wxCommandEvent& event) { EndModal(0); } virtual void OnSaveBatchJob( wxCommandEvent& event); virtual void OnLoadBatchJob( wxCommandEvent& event); virtual void OnAddFolderPair( wxCommandEvent& event); @@ -151,7 +151,6 @@ private: batchDlg.updateGui(); } - virtual void removeAltSyncCfg() { FolderPairPanelBasic<GuiPanel>::removeAltSyncCfg(); @@ -160,7 +159,6 @@ private: virtual void OnLocalFilterCfgChange() {} - BatchDialog& batchDlg; }; @@ -267,13 +265,13 @@ BatchDialog::BatchDialog(wxWindow* window, //init handling of first folder pair firstFolderPair.reset(new DirectoryPairBatchFirst(*this)); - m_bpButtonCmpConfig ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnCompSettingsContext), NULL, this); - m_bpButtonSyncConfig->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnSyncSettingsContext), NULL, this); - m_bpButtonFilter ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnGlobalFilterContext), NULL, this); + m_bpButtonCmpConfig ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnCompSettingsContext), nullptr, this); + m_bpButtonSyncConfig->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnSyncSettingsContext), nullptr, this); + m_bpButtonFilter ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnGlobalFilterContext), nullptr, this); //prepare drag & drop for loading of *.ffs_batch files setupFileDrop(*this); - Connect(EVENT_DROP_FILE, FileDropEventHandler(BatchDialog::OnFilesDropped), NULL, this); + Connect(EVENT_DROP_FILE, FileDropEventHandler(BatchDialog::OnFilesDropped), nullptr, this); logfileDir.reset(new DirectoryName<FolderHistoryBox>(*m_panelBatchSettings, *m_dirPickerLogfileDir, *m_comboBoxLogfileDir)); @@ -335,7 +333,7 @@ void BatchDialog::OnSyncSettings(wxCommandEvent& event) if (showSyncConfigDlg(localBatchCfg.mainCfg.cmpConfig.compareVar, localBatchCfg.mainCfg.syncCfg, - NULL, + nullptr, &ewfCfg) == ReturnSyncConfig::BUTTON_OKAY) //optional input parameter { updateGui(); @@ -434,7 +432,7 @@ void BatchDialog::OnGlobalFilterContext(wxCommandEvent& event) localBatchCfg.mainCfg.globalFilter = FilterConfig(); updateGui(); }; - menu.addItem( _("Clear filter settings"), clearFilter, NULL, !isNullFilter(localBatchCfg.mainCfg.globalFilter)); + menu.addItem( _("Clear filter settings"), clearFilter, nullptr, !isNullFilter(localBatchCfg.mainCfg.globalFilter)); menu.popup(*this); } @@ -516,40 +514,28 @@ void BatchDialog::showNotebookpage(wxWindow* page, const wxString& pageName, boo } */ -void BatchDialog::OnClose(wxCloseEvent& event) -{ - EndModal(ReturnBatchConfig::BUTTON_CANCEL); -} - - -void BatchDialog::OnCancel(wxCommandEvent& event) -{ - EndModal(ReturnBatchConfig::BUTTON_CANCEL); -} - - void BatchDialog::OnSaveBatchJob(wxCommandEvent& event) { //get a filename wxString defaultFileName = proposedBatchFileName.empty() ? wxT("SyncJob.ffs_batch") : proposedBatchFileName; //attention: proposedBatchFileName may be an imported *.ffs_gui file! We don't want to overwrite it with a BATCH config! - if (defaultFileName.EndsWith(wxT(".ffs_gui"))) - defaultFileName.Replace(wxT(".ffs_gui"), wxT(".ffs_batch"), false); + if (endsWith(defaultFileName, L".ffs_gui")) + replace(defaultFileName, L".ffs_gui", L".ffs_batch"); wxFileDialog filePicker(this, wxEmptyString, wxEmptyString, defaultFileName, - wxString(_("FreeFileSync batch file")) + wxT(" (*.ffs_batch)|*.ffs_batch"), + wxString(_("FreeFileSync batch file")) + L" (*.ffs_batch)|*.ffs_batch", wxFD_SAVE /*| wxFD_OVERWRITE_PROMPT*/); //creating this on freestore leads to memleak! if (filePicker.ShowModal() == wxID_OK) { const wxString newFileName = filePicker.GetPath(); - //create batch file - if (saveBatchFile(newFileName)) - EndModal(ReturnBatchConfig::BATCH_FILE_SAVED); + saveBatchFile(newFileName); + //if () + // EndModal(ReturnBatchConfig::BATCH_FILE_SAVED); } } @@ -782,8 +768,8 @@ void BatchDialog::updateGuiForFolderPair() //adapt local filter and sync cfg for first folder pair if (additionalFolderPairs.empty() && - firstFolderPair->getAltCompConfig().get() == NULL && - firstFolderPair->getAltSyncConfig().get() == NULL && + firstFolderPair->getAltCompConfig().get() == nullptr && + firstFolderPair->getAltSyncConfig().get() == nullptr && isNullFilter(firstFolderPair->getAltFilterConfig())) { m_bpButtonAltCompCfg ->Hide(); @@ -830,7 +816,7 @@ void BatchDialog::addFolderPair(const std::vector<zen::FolderPairEnh>& newPairs, //add folder pairs for (std::vector<zen::FolderPairEnh>::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) { - DirectoryPairBatch* newPair = new DirectoryPairBatch(m_scrolledWindow6, *this); + DirectoryPairBatch* newPair = new DirectoryPairBatch(m_scrolledWindow6, *this); //owned by m_scrolledWindow6! //init dropdown history newPair->m_directoryLeft ->init(folderHistLeft_); @@ -848,7 +834,7 @@ void BatchDialog::addFolderPair(const std::vector<zen::FolderPairEnh>& newPairs, } //register events - newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BatchDialog::OnRemoveFolderPair), NULL, this ); + newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BatchDialog::OnRemoveFolderPair), nullptr, this ); //set alternate configuration newPair->setValues(toWx(i->leftDirectory), @@ -913,10 +899,10 @@ bool BatchDialog::createBatchFile(const wxString& filename) { //create shell link (instead of batch file) for full Unicode support HRESULT hResult = E_FAIL; - IShellLink* pShellLink = NULL; + IShellLink* pShellLink = nullptr; if (FAILED(CoCreateInstance(CLSID_ShellLink, //class identifier - NULL, //object isn't part of an aggregate + nullptr, //object isn't part of an aggregate CLSCTX_INPROC_SERVER, //context for running executable code IID_IShellLink, //interface identifier (void**)&pShellLink))) //pointer to storage of interface pointer @@ -936,7 +922,7 @@ bool BatchDialog::createBatchFile(const wxString& filename) if (FAILED(pShellLink->SetDescription(_("FreeFileSync Batch Job")))) return false; - IPersistFile* pPersistFile = NULL; + IPersistFile* pPersistFile = nullptr; if (FAILED(pShellLink->QueryInterface(IID_IPersistFile, (void**)&pPersistFile))) return false; CleanUp<IPersistFile> cleanOnExit2(pPersistFile); @@ -959,13 +945,13 @@ bool BatchDialog::createBatchFile(const wxString& filename) */ -ReturnBatchConfig::ButtonPressed zen::showSyncBatchDlg(const wxString& referenceFile, - const xmlAccess::XmlBatchConfig& batchCfg, - const std::shared_ptr<FolderHistory>& folderHistLeft, - const std::shared_ptr<FolderHistory>& folderHistRight, - std::vector<std::wstring>& execFinishedhistory, - size_t execFinishedhistoryMax) +void zen::showSyncBatchDlg(const wxString& referenceFile, + const xmlAccess::XmlBatchConfig& batchCfg, + const std::shared_ptr<FolderHistory>& folderHistLeft, + const std::shared_ptr<FolderHistory>& folderHistRight, + std::vector<std::wstring>& execFinishedhistory, + size_t execFinishedhistoryMax) { - BatchDialog batchDlg(NULL, referenceFile, batchCfg, folderHistLeft, folderHistRight, execFinishedhistory, execFinishedhistoryMax); - return static_cast<ReturnBatchConfig::ButtonPressed>(batchDlg.ShowModal()); + BatchDialog batchDlg(nullptr, referenceFile, batchCfg, folderHistLeft, folderHistRight, execFinishedhistory, execFinishedhistoryMax); + batchDlg.ShowModal(); } diff --git a/ui/batch_config.h b/ui/batch_config.h index 5d47f64d..472f21bf 100644 --- a/ui/batch_config.h +++ b/ui/batch_config.h @@ -12,21 +12,12 @@ namespace zen { -struct ReturnBatchConfig -{ - enum ButtonPressed - { - BUTTON_CANCEL, - BATCH_FILE_SAVED = 1 - }; -}; - -ReturnBatchConfig::ButtonPressed showSyncBatchDlg(const wxString& referenceFile, - const xmlAccess::XmlBatchConfig& batchCfg, - const std::shared_ptr<FolderHistory>& folderHistLeft, - const std::shared_ptr<FolderHistory>& folderHistRight, - std::vector<std::wstring>& execFinishedhistory, - size_t execFinishedhistoryMax); +void showSyncBatchDlg(const wxString& referenceFile, + const xmlAccess::XmlBatchConfig& batchCfg, + const std::shared_ptr<FolderHistory>& folderHistLeft, + const std::shared_ptr<FolderHistory>& folderHistRight, + std::vector<std::wstring>& execFinishedhistory, + size_t execFinishedhistoryMax); } diff --git a/ui/batch_status_handler.cpp b/ui/batch_status_handler.cpp index 6308842f..0c45db3f 100644 --- a/ui/batch_status_handler.cpp +++ b/ui/batch_status_handler.cpp @@ -17,6 +17,7 @@ #include <zen/time.h> #include "exec_finished_box.h" #include <wx+/shell_execute.h> +#include "../lib/status_handler_impl.h" using namespace zen; @@ -36,7 +37,7 @@ public: } virtual std::shared_ptr<TraverseCallback> - onDir (const Zchar* shortName, const Zstring& fullName) { return nullptr; } //DON'T traverse into subdirs + onDir (const Zchar* shortName, const Zstring& fullName) { return nullptr; } //DON'T traverse into subdirs virtual void onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) {} virtual HandleError onError (const std::wstring& errorText) { return TRAV_ERROR_IGNORE; } //errors are not really critical in this context @@ -54,7 +55,7 @@ public: jobName_(jobName), //throw FileError logfileName(findUniqueLogname(logfileDirectory, jobName)) { - logFile.Open(toWx(logfileName), wxT("w")); + logFile.Open(toWx(logfileName), L"w"); if (!logFile.IsOpened()) throw FileError(_("Unable to create log file!") + L"\"" + logfileName + L"\""); @@ -62,33 +63,39 @@ public: wxString headerLine = wxString(L"FreeFileSync - ") + _("Batch execution") + L" - " + formatTime<wxString>(FORMAT_DATE); logFile.Write(headerLine + wxChar('\n')); - logFile.Write(wxString().Pad(headerLine.Len(), wxChar('-')) + wxChar('\n') + wxChar('\n')); + logFile.Write(wxString().Pad(headerLine.Len(), L'=') + L'\n'); logItemStart = formatTime<wxString>(L"[%X] ") + _("Start"); totalTime.Start(); //measure total time } - void writeLog(const ErrorLogging& log, const wxString& finalStatus) + void writeLog(const ErrorLog& log, const std::wstring& finalStatus) { - logFile.Write(finalStatus + L"\n\n"); //highlight result by placing at beginning of file + const size_t sepLineLen = finalStatus.size(); + + //result + statistics + logFile.Write(wxString().Pad(sepLineLen, L'_') + L'\n'); + logFile.Write(L"\n" + finalStatus + L"\n"); + logFile.Write(wxString().Pad(sepLineLen, L'_') + L"\n\n"); logFile.Write(logItemStart + L"\n\n"); //write actual logfile - const std::vector<wxString>& messages = log.getFormattedMessages(); - for (std::vector<wxString>::const_iterator i = messages.begin(); i != messages.end(); ++i) - logFile.Write(*i + L'\n'); + const auto& entries = log.getEntries(); + for (auto iter = entries.begin(); iter != entries.end(); ++iter) + { + const std::string& msg = utf8CvrtTo<std::string>(formatMessage(*iter)); + logFile.Write(msg.c_str(), msg.size()); //better do UTF8 conversion ourselves rather than to rely on wxWidgets + logFile.Write(L'\n'); + } - //write ending + //write footer logFile.Write(L'\n'); - - const long time = totalTime.Time(); //retrieve total time - - logFile.Write(wxString(L"[") + formatTime<wxString>(FORMAT_TIME) + L"] " + _("Stop") + L" (" + _("Total time:") + L" " + wxTimeSpan::Milliseconds(time).Format() + L")\n"); + logFile.Write(formatTime<wxString>(L"[%X] ") + _("Stop") + L" (" + _("Total time:") + L" " + wxTimeSpan::Milliseconds(totalTime.Time()).Format() + L")\n"); } - void limitLogfileCount(size_t maxCount) const + void limitLogfileCount(size_t maxCount) const //throw() { std::vector<Zstring> logFiles; FindLogfiles traverseCallback(toZ(jobName_), logFiles); @@ -101,7 +108,7 @@ public: return; //delete oldest logfiles - std::sort(logFiles.begin(), logFiles.end()); //take advantage of logfile naming convention to sort by age + std::nth_element(logFiles.begin(), logFiles.end() - maxCount, logFiles.end()); //take advantage of logfile naming convention to find oldest files std::for_each(logFiles.begin(), logFiles.end() - maxCount, [](const Zstring& filename) { try { zen::removeFile(filename); } catch (FileError&) {} }); @@ -130,7 +137,7 @@ private: Zstring output = logfileName + Zstr(".log"); for (int i = 1; zen::somethingExists(output); ++i) - output = logfileName + Zstr('_') + zen::toString<Zstring>(i) + Zstr(".log"); + output = logfileName + Zstr('_') + zen::numberTo<Zstring>(i) + Zstr(".log"); return output; } @@ -158,34 +165,31 @@ BatchStatusHandler::BatchStatusHandler(bool showProgress, handleError_(handleError), currentProcess(StatusHandler::PROCESS_NONE), returnValue(returnVal), - syncStatusFrame(*this, NULL, SyncStatus::SCANNING, showProgress, jobName, execWhenFinished, execFinishedHistory) + syncStatusFrame(*this, nullptr, SyncStatus::SCANNING, showProgress, jobName, execWhenFinished, execFinishedHistory) { if (logFileCountMax > 0) { - try - { - logFile = std::make_shared<LogFile>(toZ(logfileDirectory), jobName); //throw FileError - logFile->limitLogfileCount(logFileCountMax); //throw FileError - } - catch (zen::FileError& error) + if (!tryReportingError([&] + { + logFile = std::make_shared<LogFile>(toZ(logfileDirectory), jobName); //throw FileError + logFile->limitLogfileCount(logFileCountMax); //throw() + }, *this)) { - if (handleError_ == xmlAccess::ON_ERROR_POPUP) - wxMessageBox(error.toString(), _("Error"), wxOK | wxICON_ERROR); returnValue = -7; throw BatchAbortProcess(); } - - //::wxSetEnv(L"logfile", logFile->getLogfileName()); } + + //::wxSetEnv(L"logfile", logFile->getLogfileName()); } BatchStatusHandler::~BatchStatusHandler() { - const int totalErrors = errorLog.typeCount(TYPE_ERROR | TYPE_FATAL_ERROR); //evaluate before finalizing log + const int totalErrors = errorLog.getItemCount(TYPE_ERROR | TYPE_FATAL_ERROR); //evaluate before finalizing log //finalize error log - wxString finalStatus; + std::wstring finalStatus; if (abortIsRequested()) { returnValue = -4; @@ -345,7 +349,7 @@ void BatchStatusHandler::reportWarning(const std::wstring& warningMessage, bool& break; case ReturnWarningDlg::BUTTON_SWITCH: - errorLog.logMsg(_("Switching to FreeFileSync GUI mode..."), TYPE_WARNING); + errorLog.logMsg(_("Switching to FreeFileSync GUI mode..."), TYPE_INFO); switchToGuiRequested = true; abortThisProcess(); break; diff --git a/ui/batch_status_handler.h b/ui/batch_status_handler.h index d5a18322..0657e881 100644 --- a/ui/batch_status_handler.h +++ b/ui/batch_status_handler.h @@ -7,9 +7,9 @@ #ifndef BATCHSTATUSHANDLER_H_INCLUDED #define BATCHSTATUSHANDLER_H_INCLUDED +#include <zen/error_log.h> #include "../lib/status_handler.h" #include "../lib/process_xml.h" -#include "../lib/error_log.h" #include "progress_indicator.h" #include "switch_to_gui.h" @@ -52,7 +52,7 @@ private: bool showFinalResults; bool switchToGuiRequested; xmlAccess::OnError handleError_; - zen::ErrorLogging errorLog; //list of non-resolved errors and warnings + zen::ErrorLog errorLog; //list of non-resolved errors and warnings Process currentProcess; int& returnValue; diff --git a/ui/check_version.cpp b/ui/check_version.cpp index 61af5b48..ba922f97 100644 --- a/ui/check_version.cpp +++ b/ui/check_version.cpp @@ -63,7 +63,7 @@ std::vector<size_t> parseVersion(const wxString& version) while (tkz.HasMoreTokens()) { const wxString& token = tkz.GetNextToken(); - output.push_back(zen::toNumber<size_t>(token)); + output.push_back(zen::stringTo<size_t>(token)); } return output; } @@ -114,7 +114,7 @@ void zen::checkForUpdatePeriodically(long& lastUpdateCheck) if (lastUpdateCheck == 0) { const bool checkRegularly = showQuestionDlg(ReturnQuestionDlg::BUTTON_YES | ReturnQuestionDlg::BUTTON_NO, - wxString(_("Do you want FreeFileSync to automatically check for updates every week?")) + wxT("\n") + + _("Do you want FreeFileSync to automatically check for updates every week?") + L"\n" + _("(Requires an Internet connection!)")) == ReturnQuestionDlg::BUTTON_YES; if (checkRegularly) { diff --git a/ui/column_attr.h b/ui/column_attr.h index 275c9dd7..517961f4 100644 --- a/ui/column_attr.h +++ b/ui/column_attr.h @@ -110,7 +110,7 @@ std::vector<ColumnAttributeNavi> getDefaultColumnAttributesNavi() newEntry.type_ = COL_TYPE_NAVI_BYTES; newEntry.visible_ = true; - newEntry.width_ = 55; + newEntry.width_ = 60; //GTK needs a few pixels more attr.push_back(newEntry); return attr; diff --git a/ui/custom_grid.cpp b/ui/custom_grid.cpp index df1e9145..465a1b6f 100644 --- a/ui/custom_grid.cpp +++ b/ui/custom_grid.cpp @@ -29,10 +29,10 @@ const wxColour COLOR_ORANGE (238, 201, 0); const wxColour COLOR_GREY (212, 208, 200); const wxColour COLOR_YELLOW (247, 252, 62); const wxColour COLOR_YELLOW_LIGHT(253, 252, 169); -const wxColour COLOR_CMP_RED (249, 163, 165); -const wxColour COLOR_SYNC_BLUE (201, 203, 247); -const wxColour COLOR_SYNC_GREEN (197, 248, 190); -const wxColour COLOR_NOT_ACTIVE(228, 228, 228); //light grey +const wxColour COLOR_CMP_RED (255, 185, 187); +const wxColour COLOR_SYNC_BLUE (185, 188, 255); +const wxColour COLOR_SYNC_GREEN (196, 255, 185); +const wxColour COLOR_NOT_ACTIVE (228, 228, 228); //light grey const Zstring ICON_FILE_FOLDER = Zstr("folder"); @@ -40,7 +40,7 @@ const Zstring ICON_FILE_FOLDER = Zstr("folder"); const int CHECK_BOX_IMAGE = 12; //width of checkbox image const int CHECK_BOX_WIDTH = CHECK_BOX_IMAGE + 2; //width of first block -const size_t MIN_ROW_COUNT = 10; +const size_t ROW_COUNT_NO_DATA = 10; /* class hierarchy: @@ -57,7 +57,7 @@ class hierarchy: -void refreshCell(Grid& grid, int row, ColumnType colType, size_t compPos) +void refreshCell(Grid& grid, size_t row, ColumnType colType, size_t compPos) { wxRect cellArea = grid.getCellArea(row, colType, compPos); //returns empty rect if column not found; absolute coordinates! if (cellArea.height > 0) @@ -68,7 +68,7 @@ void refreshCell(Grid& grid, int row, ColumnType colType, size_t compPos) } -std::pair<int, int> getVisibleRows(Grid& grid) //returns range [from, to) +std::pair<ptrdiff_t, ptrdiff_t> getVisibleRows(Grid& grid) //returns range [from, to) { const wxSize clientSize = grid.getMainWin().GetClientSize(); if (clientSize.GetHeight() > 0) @@ -76,10 +76,10 @@ std::pair<int, int> getVisibleRows(Grid& grid) //returns range [from, to) wxPoint topLeft = grid.CalcUnscrolledPosition(wxPoint(0, 0)); wxPoint bottom = grid.CalcUnscrolledPosition(wxPoint(0, clientSize.GetHeight() - 1)); - int rowFrom = grid.getRowAtPos(topLeft.y); //returns < 0 if column not found; absolute coordinates! + ptrdiff_t rowFrom = grid.getRowAtPos(topLeft.y); //returns < 0 if column not found; absolute coordinates! if (rowFrom >= 0) { - int rowEnd = grid.getRowAtPos(bottom.y); //returns < 0 if column not found; absolute coordinates! + ptrdiff_t rowEnd = grid.getRowAtPos(bottom.y); //returns < 0 if column not found; absolute coordinates! if (rowEnd < 0) rowEnd = grid.getRowCount(); else @@ -137,18 +137,18 @@ public: //don't check too often! give worker thread some time to fetch data if (iconMgr_) { - const std::pair<int, int>& rowsOnScreen = getVisibleRows(refGrid()); + const auto& rowsOnScreen = getVisibleRows(refGrid()); //loop over all visible rows - const int firstRow = rowsOnScreen.first; - const int rowCount = rowsOnScreen.second - firstRow; + const ptrdiff_t firstRow = rowsOnScreen.first; + const ptrdiff_t rowCount = rowsOnScreen.second - firstRow; - for (int i = 0; i < rowCount; ++i) + for (ptrdiff_t i = 0; i < rowCount; ++i) { //alternate when adding rows: first, last, first + 1, last - 1 ... -> Icon buffer will then load reversely, i.e. from inside out - const int currentRow = firstRow + (i % 2 == 0 ? - i / 2 : - rowCount - 1 - (i - 1) / 2); + const ptrdiff_t currentRow = firstRow + (i % 2 == 0 ? + i / 2 : + rowCount - 1 - (i - 1) / 2); if (isFailedLoad(currentRow)) //find failed attempts to load icon { @@ -182,7 +182,7 @@ public: bool isFailedLoad(size_t row) const { return row < failedLoads.size() ? failedLoads[row] != 0 : false; } protected: - virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, int row, bool enabled, bool selected, bool hasFocus) + virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, size_t row, bool enabled, bool selected, bool hasFocus) { if (enabled) { @@ -196,7 +196,7 @@ protected: clearArea(dc, rect, wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); } - wxColor getBackGroundColor(int row) const + wxColor getBackGroundColor(size_t row) const { wxColor backGroundCol = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); @@ -230,12 +230,24 @@ protected: return backGroundCol; } - const FileSystemObject* getRawData(int row) const { return gridDataView_ ? gridDataView_->getObject(row) : NULL; } + const FileSystemObject* getRawData(size_t row) const { return gridDataView_ ? gridDataView_->getObject(row) : nullptr; } private: - virtual size_t getRowCount() const { return std::max(MIN_ROW_COUNT, gridDataView_ ? gridDataView_->rowsOnView() : 0); } + virtual size_t getRowCount() const + { + if (gridDataView_) + { + if (gridDataView_->rowsTotal() == 0) + return ROW_COUNT_NO_DATA; + return gridDataView_->rowsOnView(); + } + else + return ROW_COUNT_NO_DATA; + + //return std::max(MIN_ROW_COUNT, gridDataView_ ? gridDataView_->rowsOnView() : 0); + } - virtual wxString getValue(int row, ColumnType colType) const + virtual wxString getValue(size_t row, ColumnType colType) const { if (const FileSystemObject* fsObj = getRawData(row)) { @@ -346,7 +358,7 @@ private: static const int CELL_BORDER = 2; - virtual void renderCell(Grid& grid, wxDC& dc, const wxRect& rect, int row, ColumnType colType) + virtual void renderCell(Grid& grid, wxDC& dc, const wxRect& rect, size_t row, ColumnType colType) { wxRect rectTmp = drawCellBorder(dc, rect); @@ -358,93 +370,82 @@ private: }(); //draw file icon - if (static_cast<ColumnTypeRim>(colType) == COL_TYPE_FILENAME) + if (static_cast<ColumnTypeRim>(colType) == COL_TYPE_FILENAME && + iconMgr_) { - if (iconMgr_) + rectTmp.x += CELL_BORDER; + rectTmp.width -= CELL_BORDER; + + const int iconSize = iconMgr_->iconBuffer.getSize(); + if (rectTmp.GetWidth() >= iconSize) { - rectTmp.x += CELL_BORDER; - rectTmp.width -= CELL_BORDER; + // Partitioning: + // _______________________________ + // | border | icon | border | text | + // ------------------------------- - const int iconSize = iconMgr_->iconBuffer.getSize(); - if (rectTmp.GetWidth() >= iconSize) + const Zstring fileName = getIconFile(row); + if (!fileName.empty()) { - // Partitioning: - // _______________________________ - // | border | icon | border | text | - // ------------------------------- + wxIcon icon; - const Zstring fileName = getIconFile(row); - if (!fileName.empty()) + //first check if it is a directory icon: + if (fileName == ICON_FILE_FOLDER) + icon = iconMgr_->iconBuffer.genericDirIcon(); + else //retrieve file icon { - wxIcon icon; - - //first check if it is a directory icon: - if (fileName == ICON_FILE_FOLDER) - icon = iconMgr_->iconBuffer.genericDirIcon(); - else //retrieve file icon + if (!iconMgr_->iconBuffer.requestFileIcon(fileName, &icon)) //returns false if icon is not in buffer { - if (!iconMgr_->iconBuffer.requestFileIcon(fileName, &icon)) //returns false if icon is not in buffer - { - icon = iconMgr_->iconBuffer.genericFileIcon(); //better than nothing - setFailedLoad(row, true); //save status of failed icon load -> used for async. icon loading - //falsify only! we want to avoid writing incorrect success values when only partially updating the DC, e.g. when scrolling, - //see repaint behavior of ::ScrollWindow() function! - } + icon = iconMgr_->iconBuffer.genericFileIcon(); //better than nothing + setFailedLoad(row, true); //save status of failed icon load -> used for async. icon loading + //falsify only! we want to avoid writing incorrect success values when only partially updating the DC, e.g. when scrolling, + //see repaint behavior of ::ScrollWindow() function! } + } - if (icon.IsOk()) - { - //center icon if it is too small - const int posX = rectTmp.GetX() + std::max(0, (iconSize - icon.GetWidth()) / 2); - const int posY = rectTmp.GetY() + std::max(0, (rectTmp.GetHeight() - icon.GetHeight()) / 2); + if (icon.IsOk()) + { + //center icon if it is too small + const int posX = rectTmp.GetX() + std::max(0, (iconSize - icon.GetWidth()) / 2); + const int posY = rectTmp.GetY() + std::max(0, (rectTmp.GetHeight() - icon.GetHeight()) / 2); - drawIconRtlNoMirror(dc, icon, wxPoint(posX, posY), buffer); + drawIconRtlNoMirror(dc, icon, wxPoint(posX, posY), buffer); - //convert icon to greyscale if row is not active - if (!isActive) - { - wxBitmap bmp(icon.GetWidth(), icon.GetHeight()); - wxMemoryDC memDc(bmp); - memDc.Blit(0, 0, icon.GetWidth(), icon.GetHeight(), &dc, posX, posY); //blit in + //convert icon to greyscale if row is not active + if (!isActive) + { + wxBitmap bmp(icon.GetWidth(), icon.GetHeight()); + wxMemoryDC memDc(bmp); + memDc.Blit(0, 0, icon.GetWidth(), icon.GetHeight(), &dc, posX, posY); //blit in - bmp = wxBitmap(bmp.ConvertToImage().ConvertToGreyscale(1.0/3, 1.0/3, 1.0/3)); //treat all channels equally! - memDc.SelectObject(bmp); + bmp = wxBitmap(bmp.ConvertToImage().ConvertToGreyscale(1.0/3, 1.0/3, 1.0/3)); //treat all channels equally! + memDc.SelectObject(bmp); - dc.Blit(posX, posY, icon.GetWidth(), icon.GetHeight(), &memDc, 0, 0); //blit out - } + dc.Blit(posX, posY, icon.GetWidth(), icon.GetHeight(), &memDc, 0, 0); //blit out } } } - rectTmp.x += iconSize; - rectTmp.width -= iconSize; } + rectTmp.x += iconSize; + rectTmp.width -= iconSize; + } - rectTmp.x += CELL_BORDER; + //draw text + if (static_cast<ColumnTypeRim>(colType) == COL_TYPE_SIZE && grid.GetLayoutDirection() != wxLayout_RightToLeft) + { + //have file size right-justified (but don't change for RTL languages) rectTmp.width -= CELL_BORDER; - - drawCellText(dc, rectTmp, getValue(row, colType), isActive, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); + drawCellText(dc, rectTmp, getValue(row, colType), isActive, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL); } else { - int alignment = wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL; - - //have file size right-justified (but don't change for RTL languages) - if (static_cast<ColumnTypeRim>(colType) == COL_TYPE_SIZE && grid.GetLayoutDirection() != wxLayout_RightToLeft) - { - rectTmp.width -= CELL_BORDER; - alignment = wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL; - } - else - { - rectTmp.x += CELL_BORDER; - rectTmp.width -= CELL_BORDER; - } - - drawCellText(dc, rectTmp, getValue(row, colType), isActive, alignment); + rectTmp.x += CELL_BORDER; + rectTmp.width -= CELL_BORDER; + drawCellText(dc, rectTmp, getValue(row, colType), isActive, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL); } } - virtual size_t getBestSize(wxDC& dc, int row, ColumnType colType) + virtual size_t getBestSize(wxDC& dc, size_t row, ColumnType colType) { // Partitioning: // ________________________________________ @@ -523,12 +524,12 @@ private: virtual void visit(const SymLinkMapping& linkObj) { iconName = linkObj.getLinkType<side>() == LinkDescriptor::TYPE_DIR ? - Zstr("folder") : + ICON_FILE_FOLDER : linkObj.getFullName<side>(); } virtual void visit(const DirMapping& dirObj) { - iconName = Zstr("folder"); + iconName = ICON_FILE_FOLDER; } Zstring iconName; @@ -539,7 +540,7 @@ private: return Zstring(); } - virtual wxString getToolTip(int row, ColumnType colType) const + virtual wxString getToolTip(size_t row, ColumnType colType) const { wxString toolTip; const FileSystemObject* fsObj = getRawData(row); @@ -575,7 +576,7 @@ private: } std::shared_ptr<const zen::GridView> gridDataView_; - std::shared_ptr<IconManager> iconMgr_; + std::shared_ptr<IconManager> iconMgr_; //optional std::vector<char> failedLoads; //effectively a vector<bool> of size "number of rows" const size_t compPos_; std::unique_ptr<wxBitmap> buffer; //avoid costs of recreating this temporal variable @@ -595,7 +596,7 @@ public: } private: - virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, int row, bool enabled, bool selected, bool hasFocus) + virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, size_t row, bool enabled, bool selected, bool hasFocus) { GridDataRim<LEFT_SIDE>::renderRowBackgound(dc, rect, row, enabled, selected, hasFocus); @@ -675,27 +676,24 @@ public: gridDataView_(gridDataView), syncPreviewActive(true) {} - void onSelectBegin(const wxPoint& clientPos, int row, ColumnType colType) + void onSelectBegin(const wxPoint& clientPos, size_t row, ColumnType colType) { if (static_cast<ColumnTypeMiddle>(colType) == COL_TYPE_MIDDLE_VALUE) { refGrid().clearSelection(gridview::COMP_MIDDLE); - dragSelection.reset(new std::pair<int, BlockPosition>(row, mousePosToBlock(clientPos, row))); + dragSelection.reset(new std::pair<size_t, BlockPosition>(row, mousePosToBlock(clientPos, row))); } } - void onSelectEnd(int row) + void onSelectEnd(size_t rowFrom, size_t rowTo) //we cannot reuse row from "onSelectBegin": rowFrom and rowTo may be different if user is holding shift { refGrid().clearSelection(gridview::COMP_MIDDLE); //issue custom event if (dragSelection) { - const int rowFrom = dragSelection->first; - const int rowTo = row; - - if (0 <= rowFrom && rowFrom < static_cast<int>(refGrid().getRowCount()) && - 0 <= rowTo && rowTo < static_cast<int>(refGrid().getRowCount())) //row is -1 on capture lost! + if (rowFrom < refGrid().getRowCount() && + rowTo < refGrid().getRowCount()) //row is -1 on capture lost! { if (wxEvtHandler* evtHandler = refGrid().GetEventHandler()) switch (dragSelection->second) @@ -733,7 +731,7 @@ public: } } - void onMouseMovement(const wxPoint& clientPos, int row, ColumnType colType, size_t compPos) + void onMouseMovement(const wxPoint& clientPos, size_t row, ColumnType colType, size_t compPos) { //manage block highlighting and custom tooltip if (dragSelection) @@ -747,7 +745,7 @@ public: if (highlight) //refresh old highlight refreshCell(refGrid(), highlight->first, static_cast<ColumnType>(COL_TYPE_MIDDLE_VALUE), gridview::COMP_MIDDLE); - highlight.reset(new std::pair<int, BlockPosition>(row, mousePosToBlock(clientPos, row))); + highlight.reset(new std::pair<size_t, BlockPosition>(row, mousePosToBlock(clientPos, row))); refreshCell(refGrid(), highlight->first, static_cast<ColumnType>(COL_TYPE_MIDDLE_VALUE), gridview::COMP_MIDDLE); //show custom tooltip @@ -772,26 +770,25 @@ public: void setSyncPreviewActive(bool value) { syncPreviewActive = value; } private: - virtual size_t getRowCount() const { return std::max(MIN_ROW_COUNT, gridDataView_ ? gridDataView_->rowsOnView() : 0); } + virtual size_t getRowCount() const { return 0; /*if there are multiple grid components, only the first one will be polled for row count!*/ } - virtual wxString getValue(int row, ColumnType colType) const + virtual wxString getValue(size_t row, ColumnType colType) const { if (static_cast<ColumnTypeMiddle>(colType) == COL_TYPE_MIDDLE_VALUE) { - const FileSystemObject* fsObj = getRawData(row); - if (fsObj) + if (const FileSystemObject* fsObj = getRawData(row)) return syncPreviewActive ? getSymbol(fsObj->getSyncOperation()) : getSymbol(fsObj->getCategory()); } return wxEmptyString; } - virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, int row, bool enabled, bool selected, bool hasFocus) + virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, size_t row, bool enabled, bool selected, bool hasFocus) { drawCellBackground(dc, rect, enabled, selected, hasFocus, getBackGroundColor(row)); } - virtual void renderCell(Grid& grid, wxDC& dc, const wxRect& rect, int row, ColumnType colType) + virtual void renderCell(Grid& grid, wxDC& dc, const wxRect& rect, size_t row, ColumnType colType) { switch (static_cast<ColumnTypeMiddle>(colType)) { @@ -799,15 +796,14 @@ private: { wxRect rectInside = drawCellBorder(dc, rect); - const FileSystemObject* fsObj = getRawData(row); - if (fsObj) + if (const FileSystemObject* fsObj = getRawData(row)) { //draw checkbox wxRect checkBoxArea = rectInside; checkBoxArea.SetWidth(CHECK_BOX_WIDTH); - const bool rowHighlighted = dragSelection ? row == dragSelection->first : highlight ? row == highlight->first : false; - const BlockPosition highlightBlock = dragSelection ? dragSelection->second : highlight ? highlight->second : BLOCKPOS_CHECK_BOX; + const bool rowHighlighted = dragSelection ? row == dragSelection->first : highlight ? row == highlight->first : false; + const BlockPosition highlightBlock = dragSelection ? dragSelection->second : highlight ? highlight->second : BLOCKPOS_CHECK_BOX; if (rowHighlighted && highlightBlock == BLOCKPOS_CHECK_BOX) drawBitmapRtlMirror(dc, GlobalResources::getImage(fsObj->isActive() ? L"checkboxTrueFocus" : L"checkboxFalseFocus"), checkBoxArea, wxALIGN_CENTER, buffer); @@ -826,13 +822,13 @@ private: case BLOCKPOS_CHECK_BOX: break; case BLOCKPOS_LEFT: - drawBitmapRtlMirror(dc, getSyncOpImage(fsObj->testSyncOperation(SYNC_DIR_LEFT, true)), rectInside, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, buffer); + drawBitmapRtlMirror(dc, getSyncOpImage(fsObj->testSyncOperation(SYNC_DIR_LEFT)), rectInside, wxALIGN_LEFT | wxALIGN_CENTER_VERTICAL, buffer); break; case BLOCKPOS_MIDDLE: - drawBitmapRtlMirror(dc, getSyncOpImage(fsObj->testSyncOperation(SYNC_DIR_NONE, true)), rectInside, wxALIGN_CENTER, buffer); + drawBitmapRtlMirror(dc, getSyncOpImage(fsObj->testSyncOperation(SYNC_DIR_NONE)), rectInside, wxALIGN_CENTER, buffer); break; case BLOCKPOS_RIGHT: - drawBitmapRtlMirror(dc, getSyncOpImage(fsObj->testSyncOperation(SYNC_DIR_RIGHT, true)), rectInside, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, buffer); + drawBitmapRtlMirror(dc, getSyncOpImage(fsObj->testSyncOperation(SYNC_DIR_RIGHT)), rectInside, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, buffer); break; } else //default @@ -856,13 +852,16 @@ private: switch (static_cast<ColumnTypeMiddle>(colType)) { case COL_TYPE_MIDDLE_VALUE: - drawColumnLabelBackground(dc, rect, highlighted); + { + wxRect rectInside = drawColumnLabelBorder(dc, rect); + drawColumnLabelBackground(dc, rectInside, highlighted); if (syncPreviewActive) - dc.DrawLabel(wxEmptyString, GlobalResources::getImage(wxT("syncViewSmall")), rect, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL); + dc.DrawLabel(wxEmptyString, GlobalResources::getImage(L"syncSmall"), rectInside, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL); else - dc.DrawLabel(wxEmptyString, GlobalResources::getImage(wxT("cmpViewSmall")), rect, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL); - break; + dc.DrawLabel(wxEmptyString, GlobalResources::getImage(L"compareSmall"), rectInside, wxALIGN_CENTER_HORIZONTAL | wxALIGN_CENTER_VERTICAL); + } + break; case COL_TYPE_BORDER: drawCellBackground(dc, rect, true, false, true, wxSystemSettings::GetColour(wxSYS_COLOUR_3DSHADOW)); @@ -870,12 +869,11 @@ private: } } - const FileSystemObject* getRawData(int row) const { return gridDataView_ ? gridDataView_->getObject(row) : NULL; } + const FileSystemObject* getRawData(size_t row) const { return gridDataView_ ? gridDataView_->getObject(row) : nullptr; } - wxColor getBackGroundColor(int row) const + wxColor getBackGroundColor(size_t row) const { - const FileSystemObject* fsObj = getRawData(row); - if (fsObj) + if (const FileSystemObject* fsObj = getRawData(row)) { if (!fsObj->isActive()) return COLOR_NOT_ACTIVE; @@ -920,6 +918,7 @@ private: case FILE_RIGHT_SIDE_ONLY: case FILE_RIGHT_NEWER: return COLOR_SYNC_GREEN; //COLOR_CMP_GREEN; + case FILE_DIFFERENT: return COLOR_CMP_RED; case FILE_EQUAL: @@ -944,7 +943,7 @@ private: }; //determine blockposition within cell - BlockPosition mousePosToBlock(const wxPoint& clientPos, int row) const + BlockPosition mousePosToBlock(const wxPoint& clientPos, size_t row) const { const int absX = refGrid().CalcUnscrolledPosition(clientPos).x; @@ -976,10 +975,9 @@ private: return BLOCKPOS_CHECK_BOX; } - void showToolTip(int row, wxPoint posScreen) + void showToolTip(size_t row, wxPoint posScreen) { - const FileSystemObject* fsObj = getRawData(row); - if (fsObj) + if (const FileSystemObject* fsObj = getRawData(row)) { if (syncPreviewActive) //synchronization preview { @@ -1064,8 +1062,8 @@ private: std::shared_ptr<const zen::GridView> gridDataView_; bool syncPreviewActive; - std::unique_ptr<std::pair<int, BlockPosition>> highlight; //(row, block) current mouse highlight - std::unique_ptr<std::pair<int, BlockPosition>> dragSelection; //(row, block) + std::unique_ptr<std::pair<size_t, BlockPosition>> highlight; //(row, block) current mouse highlight + std::unique_ptr<std::pair<size_t, BlockPosition>> dragSelection; //(row, block) std::unique_ptr<wxBitmap> buffer; //avoid costs of recreating this temporal variable zen::Tooltip toolTip; }; @@ -1080,23 +1078,22 @@ public: GridDataMiddle& provMiddle, GridDataRight& provRight) : grid_(grid), provLeft_(provLeft), provMiddle_(provMiddle), provRight_(provRight) { - grid_.Connect(EVENT_GRID_COL_RESIZE, GridColumnResizeEventHandler(GridEventManager::onResizeColumn), NULL, this); + grid_.Connect(EVENT_GRID_COL_RESIZE, GridColumnResizeEventHandler(GridEventManager::onResizeColumn), nullptr, this); - grid_.getMainWin().Connect(wxEVT_MOTION, wxMouseEventHandler(GridEventManager::onMouseMovement), NULL, this); - grid_.getMainWin().Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(GridEventManager::onMouseLeave ), NULL, this); - grid_.getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler (GridEventManager::onKeyDown ), NULL, this); + grid_.getMainWin().Connect(wxEVT_MOTION, wxMouseEventHandler(GridEventManager::onMouseMovement), nullptr, this); + grid_.getMainWin().Connect(wxEVT_LEAVE_WINDOW, wxMouseEventHandler(GridEventManager::onMouseLeave ), nullptr, this); + grid_.getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler (GridEventManager::onKeyDown ), nullptr, this); - grid_.Connect(EVENT_GRID_MOUSE_LEFT_DOWN, GridClickEventHandler (GridEventManager::onSelectBegin), NULL, this); - grid_.Connect(EVENT_GRID_SELECT_RANGE, GridRangeSelectEventHandler(GridEventManager::onSelectEnd ), NULL, this); + grid_.Connect(EVENT_GRID_MOUSE_LEFT_DOWN, GridClickEventHandler (GridEventManager::onSelectBegin), nullptr, this); + grid_.Connect(EVENT_GRID_SELECT_RANGE, GridRangeSelectEventHandler(GridEventManager::onSelectEnd ), nullptr, this); } private: void onMouseMovement(wxMouseEvent& event) { const wxPoint& topLeftAbs = grid_.CalcUnscrolledPosition(event.GetPosition()); - const Opt<std::pair<ColumnType, size_t>> colInfo = grid_.getColumnAtPos(topLeftAbs.x); const int row = grid_.getRowAtPos(topLeftAbs.y); //returns < 0 if column not found; absolute coordinates! - if (colInfo) + if (auto colInfo = grid_.getColumnAtPos(topLeftAbs.x)) //(column type, component position) { //redirect mouse movement to middle grid component provMiddle_.onMouseMovement(event.GetPosition(), row, colInfo->first, colInfo->second); @@ -1120,7 +1117,7 @@ private: void onSelectEnd(GridRangeSelectEvent& event) { if (event.compPos_ == gridview::COMP_MIDDLE) - provMiddle_.onSelectEnd(event.rowTo_); + provMiddle_.onSelectEnd(event.rowFrom_, event.rowTo_); event.Skip(); } @@ -1141,9 +1138,7 @@ private: //skip middle component when navigating via keyboard - int row = grid_.getGridCursor().first; - if (row < 0) - row = 0; + const auto row = grid_.getGridCursor().first; if (event.ShiftDown()) ; @@ -1282,7 +1277,7 @@ class IconUpdater : private wxEvtHandler //update file icons periodically: use S public: IconUpdater(GridDataLeft& provLeft, GridDataRight& provRight, IconBuffer& iconBuffer) : provLeft_(provLeft), provRight_(provRight), iconBuffer_(iconBuffer) { - timer.Connect(wxEVT_TIMER, wxEventHandler(IconUpdater::loadIconsAsynchronously), NULL, this); + timer.Connect(wxEVT_TIMER, wxEventHandler(IconUpdater::loadIconsAsynchronously), nullptr, this); timer.Start(50); //timer interval in ms } @@ -1302,20 +1297,28 @@ private: }; } - -void gridview::setIconSize(Grid& grid, IconBuffer::IconSize sz) +void gridview::setupIcons(Grid& grid, bool show, IconBuffer::IconSize sz) { auto* provLeft = dynamic_cast<GridDataLeft*>(grid.getDataProvider(gridview::COMP_LEFT)); auto* provRight = dynamic_cast<GridDataRight*>(grid.getDataProvider(gridview::COMP_RIGHT)); if (provLeft && provRight) { - std::shared_ptr<IconManager> iconMgr = std::make_shared<IconManager>(sz); - iconMgr->iconUpdater.reset(new IconUpdater(*provLeft, *provRight, iconMgr->iconBuffer)); + if (show) + { + auto iconMgr = std::make_shared<IconManager>(sz); + iconMgr->iconUpdater.reset(new IconUpdater(*provLeft, *provRight, iconMgr->iconBuffer)); - provLeft ->setIconManager(iconMgr); - provRight->setIconManager(iconMgr); - grid.setRowHeight(iconMgr->iconBuffer.getSize() + 1); //+ 1 for line between rows + provLeft ->setIconManager(iconMgr); + provRight->setIconManager(iconMgr); + grid.setRowHeight(iconMgr->iconBuffer.getSize() + 1); //+ 1 for line between rows + } + else + { + provLeft ->setIconManager(nullptr); + provRight->setIconManager(nullptr); + grid.setRowHeight(IconBuffer(IconBuffer::SIZE_SMALL).getSize() + 1); //+ 1 for line between rows + } grid.Refresh(); } else diff --git a/ui/custom_grid.h b/ui/custom_grid.h index 4c07c150..8993777b 100644 --- a/ui/custom_grid.h +++ b/ui/custom_grid.h @@ -28,7 +28,7 @@ std::vector<ColumnAttributeRim> convertConfig(const std::vector<Grid::ColumnA void setSyncPreviewActive(Grid& grid, bool value); -void setIconSize(Grid& grid, IconBuffer::IconSize sz); +void setupIcons(Grid& grid, bool show, IconBuffer::IconSize sz); void clearSelection(Grid& grid); //clear all components @@ -51,22 +51,22 @@ extern const wxEventType EVENT_GRID_SYNC_DIRECTION; struct CheckRowsEvent : public wxCommandEvent { - CheckRowsEvent(int rowFrom, int rowTo, bool setIncluded) : wxCommandEvent(EVENT_GRID_CHECK_ROWS), rowFrom_(rowFrom), rowTo_(rowTo), setIncluded_(setIncluded) {} + CheckRowsEvent(ptrdiff_t rowFrom, ptrdiff_t rowTo, bool setIncluded) : wxCommandEvent(EVENT_GRID_CHECK_ROWS), rowFrom_(rowFrom), rowTo_(rowTo), setIncluded_(setIncluded) {} virtual wxEvent* Clone() const { return new CheckRowsEvent(*this); } - const int rowFrom_; - const int rowTo_; + const ptrdiff_t rowFrom_; + const ptrdiff_t rowTo_; const bool setIncluded_; }; struct SyncDirectionEvent : public wxCommandEvent { - SyncDirectionEvent(int rowFrom, int rowTo, SyncDirection direction) : wxCommandEvent(EVENT_GRID_SYNC_DIRECTION), rowFrom_(rowFrom), rowTo_(rowTo), direction_(direction) {} + SyncDirectionEvent(ptrdiff_t rowFrom, ptrdiff_t rowTo, SyncDirection direction) : wxCommandEvent(EVENT_GRID_SYNC_DIRECTION), rowFrom_(rowFrom), rowTo_(rowTo), direction_(direction) {} virtual wxEvent* Clone() const { return new SyncDirectionEvent(*this); } - const int rowFrom_; - const int rowTo_; + const ptrdiff_t rowFrom_; + const ptrdiff_t rowTo_; const SyncDirection direction_; }; diff --git a/ui/dir_name.cpp b/ui/dir_name.cpp index 84670356..cf43accf 100644 --- a/ui/dir_name.cpp +++ b/ui/dir_name.cpp @@ -24,7 +24,8 @@ void setDirectoryNameImpl(const wxString& dirname, wxDirPickerCtrl* dirPicker, w { const wxString dirFormatted = toWx(getFormattedDirectoryName(toZ(dirname))); - tooltipWnd.SetToolTip(dirFormatted); //wxComboBox bug: the edit control is not updated... http://trac.wxwidgets.org/ticket/12659 + tooltipWnd.SetToolTip(nullptr); //workaround wxComboBox bug http://trac.wxwidgets.org/ticket/10512 / http://trac.wxwidgets.org/ticket/12659 + tooltipWnd.SetToolTip(dirFormatted); //only lord knows when the real bugfix reaches mere mortals via an official release if (staticText) { @@ -89,25 +90,25 @@ DirectoryName<NameControl>::DirectoryName(wxWindow& dropWindow, { //prepare drag & drop setupFileDrop(dropWindow); - dropWindow.Connect(EVENT_DROP_FILE, FileDropEventHandler(DirectoryName::OnFilesDropped), NULL, this); + dropWindow.Connect(EVENT_DROP_FILE, FileDropEventHandler(DirectoryName::OnFilesDropped), nullptr, this); if (dropWindow2) { setupFileDrop(*dropWindow2); - dropWindow2->Connect(EVENT_DROP_FILE, FileDropEventHandler(DirectoryName::OnFilesDropped), NULL, this); + dropWindow2->Connect(EVENT_DROP_FILE, FileDropEventHandler(DirectoryName::OnFilesDropped), nullptr, this); } //keep dirPicker and dirName synchronous - dirName_ .Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DirectoryName::OnWriteDirManually), NULL, this); - dirPicker_.Connect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(DirectoryName::OnDirSelected ), NULL, this); + dirName_ .Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DirectoryName::OnWriteDirManually), nullptr, this); + dirPicker_.Connect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(DirectoryName::OnDirSelected ), nullptr, this); } template <class NameControl> DirectoryName<NameControl>::~DirectoryName() { - dirName_ .Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DirectoryName::OnWriteDirManually), NULL, this); - dirPicker_.Disconnect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(DirectoryName::OnDirSelected ), NULL, this); + dirName_ .Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( DirectoryName::OnWriteDirManually), nullptr, this); + dirPicker_.Disconnect(wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler(DirectoryName::OnDirSelected ), nullptr, this); } @@ -144,7 +145,7 @@ void DirectoryName<NameControl>::OnFilesDropped(FileDropEvent& event) template <class NameControl> void DirectoryName<NameControl>::OnWriteDirManually(wxCommandEvent& event) { - setDirectoryName(event.GetString(), static_cast<NameControl*>(NULL), &dirPicker_, dirName_, staticText_, 100); //potentially slow network access: wait 100 ms at most + setDirectoryName(event.GetString(), static_cast<NameControl*>(nullptr), &dirPicker_, dirName_, staticText_, 100); //potentially slow network access: wait 100 ms at most event.Skip(); } @@ -153,7 +154,7 @@ template <class NameControl> void DirectoryName<NameControl>::OnDirSelected(wxFileDirPickerEvent& event) { const wxString newPath = event.GetPath(); - setDirectoryName(newPath, &dirName_, NULL, dirName_, staticText_); + setDirectoryName(newPath, &dirName_, nullptr, dirName_, staticText_); event.Skip(); } diff --git a/ui/dir_name.h b/ui/dir_name.h index d491cacc..e49b9302 100644 --- a/ui/dir_name.h +++ b/ui/dir_name.h @@ -25,8 +25,8 @@ public: DirectoryName(wxWindow& dropWindow, wxDirPickerCtrl& dirPicker, NameControl& dirName, - wxStaticText* staticText = NULL, - wxWindow* dropWindow2 = NULL); //optional + wxStaticText* staticText = nullptr, + wxWindow* dropWindow2 = nullptr); //optional ~DirectoryName(); diff --git a/ui/exec_finished_box.cpp b/ui/exec_finished_box.cpp index 06fad778..a8ee9f4a 100644 --- a/ui/exec_finished_box.cpp +++ b/ui/exec_finished_box.cpp @@ -108,19 +108,19 @@ ExecFinishedBox::ExecFinishedBox(wxWindow* parent, const wxValidator& validator, const wxString& name) : wxComboBox(parent, id, value, pos, size, n, choices, style, validator, name), - history_(NULL), + history_(nullptr), defaultCommands(getDefaultCommands()) { //##################################### /*##*/ SetMinSize(wxSize(150, -1)); //## workaround yet another wxWidgets bug: default minimum size is much too large for a wxComboBox //##################################### - Connect(wxEVT_KEY_DOWN, wxKeyEventHandler (ExecFinishedBox::OnKeyEvent ), NULL, this); - Connect(wxEVT_LEFT_DOWN, wxEventHandler (ExecFinishedBox::OnUpdateList), NULL, this); - Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(ExecFinishedBox::OnSelection ), NULL, this); - Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler (ExecFinishedBox::OnMouseWheel), NULL, this); + Connect(wxEVT_KEY_DOWN, wxKeyEventHandler (ExecFinishedBox::OnKeyEvent ), nullptr, this); + Connect(wxEVT_LEFT_DOWN, wxEventHandler (ExecFinishedBox::OnUpdateList), nullptr, this); + Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(ExecFinishedBox::OnSelection ), nullptr, this); + Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler (ExecFinishedBox::OnMouseWheel), nullptr, this); - Connect(wxEVT_REPLACE_BUILT_IN_COMMANDS, wxCommandEventHandler(ExecFinishedBox::OnReplaceBuiltInCmds), NULL, this); + Connect(wxEVT_REPLACE_BUILT_IN_COMMANDS, wxCommandEventHandler(ExecFinishedBox::OnReplaceBuiltInCmds), nullptr, this); } diff --git a/ui/exec_finished_box.h b/ui/exec_finished_box.h index 87108a7d..7578acc6 100644 --- a/ui/exec_finished_box.h +++ b/ui/exec_finished_box.h @@ -31,7 +31,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, - const wxString choices[] = NULL, + const wxString choices[] = nullptr, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); diff --git a/ui/folder_history_box.cpp b/ui/folder_history_box.cpp index 7f7b08ef..76ed785e 100644 --- a/ui/folder_history_box.cpp +++ b/ui/folder_history_box.cpp @@ -31,14 +31,14 @@ FolderHistoryBox::FolderHistoryBox(wxWindow* parent, /*##*/ SetMinSize(wxSize(150, -1)); //## workaround yet another wxWidgets bug: default minimum size is much too large for a wxComboBox //##################################### - Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(FolderHistoryBox::OnKeyEvent ), NULL, this); - Connect(wxEVT_LEFT_DOWN, wxEventHandler(FolderHistoryBox::OnUpdateList), NULL, this); - Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(FolderHistoryBox::OnSelection ), NULL, this); - Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(FolderHistoryBox::OnMouseWheel), NULL, this); + Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(FolderHistoryBox::OnKeyEvent ), nullptr, this); + Connect(wxEVT_LEFT_DOWN, wxEventHandler(FolderHistoryBox::OnUpdateList), nullptr, this); + Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, wxCommandEventHandler(FolderHistoryBox::OnSelection ), nullptr, this); + Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler(FolderHistoryBox::OnMouseWheel), nullptr, this); #if wxCHECK_VERSION(2, 9, 1) - Connect(wxEVT_COMMAND_COMBOBOX_DROPDOWN, wxCommandEventHandler(FolderHistoryBox::OnShowDropDown), NULL, this); - Connect(wxEVT_COMMAND_COMBOBOX_CLOSEUP, wxCommandEventHandler(FolderHistoryBox::OnHideDropDown), NULL, this); + Connect(wxEVT_COMMAND_COMBOBOX_DROPDOWN, wxCommandEventHandler(FolderHistoryBox::OnShowDropDown), nullptr, this); + Connect(wxEVT_COMMAND_COMBOBOX_CLOSEUP, wxCommandEventHandler(FolderHistoryBox::OnHideDropDown), nullptr, this); #endif } @@ -152,7 +152,7 @@ void FolderHistoryBox::OnMouseWheel(wxMouseEvent& event) if (!wnd) break; - if (dynamic_cast<wxScrolledWindow*>(wnd) != NULL) + if (dynamic_cast<wxScrolledWindow*>(wnd) != nullptr) { wnd->GetEventHandler()->AddPendingEvent(event); break; diff --git a/ui/folder_history_box.h b/ui/folder_history_box.h index d28f3c72..24ff1725 100644 --- a/ui/folder_history_box.h +++ b/ui/folder_history_box.h @@ -71,7 +71,7 @@ public: const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, - const wxString choices[] = NULL, + const wxString choices[] = nullptr, long style = 0, const wxValidator& validator = wxDefaultValidator, const wxString& name = wxComboBoxNameStr); diff --git a/ui/folder_pair.h b/ui/folder_pair.h index 010d6162..7b1e7643 100644 --- a/ui/folder_pair.h +++ b/ui/folder_pair.h @@ -71,12 +71,12 @@ public: //test for Null-filter if (isNullFilter(localFilter)) { - setImage(*basicPanel_.m_bpButtonLocalFilter, GlobalResources::getImage(wxT("filterSmallGrey"))); + setImage(*basicPanel_.m_bpButtonLocalFilter, GlobalResources::getImage(L"filterOffSmall")); basicPanel_.m_bpButtonLocalFilter->SetToolTip(_("No filter selected")); } else { - setImage(*basicPanel_.m_bpButtonLocalFilter, GlobalResources::getImage(wxT("filterSmall"))); + setImage(*basicPanel_.m_bpButtonLocalFilter, GlobalResources::getImage(L"filterOnSmall")); basicPanel_.m_bpButtonLocalFilter->SetToolTip(_("Filter is active")); } } @@ -86,13 +86,13 @@ protected: basicPanel_(basicPanel) { //register events for removal of alternate configuration - basicPanel_.m_bpButtonAltCompCfg ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnAltCompCfgContext ), NULL, this); - basicPanel_.m_bpButtonAltSyncCfg ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfgContext ), NULL, this); - basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfgContext), NULL, this); + basicPanel_.m_bpButtonAltCompCfg ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnAltCompCfgContext ), nullptr, this); + basicPanel_.m_bpButtonAltSyncCfg ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfgContext ), nullptr, this); + basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfgContext), nullptr, this); - basicPanel_.m_bpButtonAltCompCfg-> Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnAltCompCfg ), NULL, this); - basicPanel_.m_bpButtonAltSyncCfg-> Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfg ), NULL, this); - basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfg), NULL, this); + basicPanel_.m_bpButtonAltCompCfg-> Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnAltCompCfg ), nullptr, this); + basicPanel_.m_bpButtonAltSyncCfg-> Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfg ), nullptr, this); + basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfg), nullptr, this); basicPanel_.m_bpButtonRemovePair->SetBitmapLabel(GlobalResources::getImage(L"removeFolderPair")); } @@ -119,21 +119,21 @@ private: void OnAltCompCfgContext(wxCommandEvent& event) { ContextMenu menu; - menu.addItem(_("Remove alternate settings"), [this] { this->removeAltCompCfg(); }, NULL, altCompConfig.get() != NULL); + menu.addItem(_("Remove alternate settings"), [this] { this->removeAltCompCfg(); }, nullptr, altCompConfig.get() != nullptr); menu.popup(basicPanel_); } void OnAltSyncCfgContext(wxCommandEvent& event) { ContextMenu menu; - menu.addItem(_("Remove alternate settings"), [this] { this->removeAltSyncCfg(); }, NULL, altSyncConfig.get() != NULL); + menu.addItem(_("Remove alternate settings"), [this] { this->removeAltSyncCfg(); }, nullptr, altSyncConfig.get() != nullptr); menu.popup(basicPanel_); } void OnLocalFilterCfgContext(wxCommandEvent& event) { ContextMenu menu; - menu.addItem(_("Clear filter settings"), [this] { this->removeLocalFilterCfg(); }, NULL, !isNullFilter(localFilter)); + menu.addItem(_("Clear filter settings"), [this] { this->removeLocalFilterCfg(); }, nullptr, !isNullFilter(localFilter)); menu.popup(basicPanel_); } @@ -169,8 +169,8 @@ private: if (showSyncConfigDlg(cmpCfg.compareVar, syncCfg, - NULL, - NULL) == ReturnSyncConfig::BUTTON_OKAY) //optional input parameter + nullptr, + nullptr) == ReturnSyncConfig::BUTTON_OKAY) //optional input parameter { altSyncConfig = std::make_shared<SyncConfig>(syncCfg); refreshButtons(); @@ -196,7 +196,7 @@ private: GuiPanel& basicPanel_; //panel to be enhanced by this template //alternate configuration attached to it - AltCompCfgPtr altCompConfig; //optional: present if non-NULL + AltCompCfgPtr altCompConfig; //optional AltSyncCfgPtr altSyncConfig; // FilterConfig localFilter; }; diff --git a/ui/grid_view.cpp b/ui/grid_view.cpp index 8460b238..2a3e84e3 100644 --- a/ui/grid_view.cpp +++ b/ui/grid_view.cpp @@ -94,13 +94,13 @@ void GridView::updateView(Predicate pred) } -int GridView::findRowDirect(FileSystemObject::ObjectIdConst objId) const +ptrdiff_t GridView::findRowDirect(FileSystemObject::ObjectIdConst objId) const { auto iter = rowPositions.find(objId); return iter != rowPositions.end() ? iter->second : -1; } -int GridView::findRowFirstChild(const HierarchyObject* hierObj) const +ptrdiff_t GridView::findRowFirstChild(const HierarchyObject* hierObj) const { auto iter = rowPositionsFirstChild.find(hierObj); return iter != rowPositionsFirstChild.end() ? iter->second : -1; @@ -289,7 +289,7 @@ void GridView::removeInvalidRows() rowPositionsFirstChild.clear(); //remove rows that have been deleted meanwhile - vector_remove_if(sortedRef, [&](const RefIndex& refIdx) { return FileSystemObject::retrieve(refIdx.objId) == NULL; }); + vector_remove_if(sortedRef, [&](const RefIndex& refIdx) { return FileSystemObject::retrieve(refIdx.objId) == nullptr; }); } @@ -356,9 +356,9 @@ public: const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessRelativeName<ascending>(*fsObjA, *fsObjB); @@ -374,9 +374,9 @@ public: { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessShortFileName<ascending, side>(*fsObjA, *fsObjB); @@ -392,9 +392,9 @@ public: { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessFilesize<ascending, side>(*fsObjA, *fsObjB); @@ -410,9 +410,9 @@ public: { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessFiletime<ascending, side>(*fsObjA, *fsObjB); @@ -428,9 +428,9 @@ public: { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessExtension<ascending, side>(*fsObjA, *fsObjB); @@ -446,9 +446,9 @@ public: { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessCmpResult<ascending>(*fsObjA, *fsObjB); @@ -464,9 +464,9 @@ public: { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); - if (fsObjA == NULL) //invalid rows shall appear at the end + if (!fsObjA) //invalid rows shall appear at the end return false; - else if (fsObjB == NULL) + else if (!fsObjB) return true; return lessSyncDirection<ascending>(*fsObjA, *fsObjB); diff --git a/ui/grid_view.h b/ui/grid_view.h index 8623f11f..fc828f91 100644 --- a/ui/grid_view.h +++ b/ui/grid_view.h @@ -19,13 +19,13 @@ class GridView { public: //direct data access via row number - const FileSystemObject* getObject(size_t row) const; //returns NULL if object is not found; complexity: constant! + const FileSystemObject* getObject(size_t row) const; //returns nullptr if object is not found; complexity: constant! /**/ FileSystemObject* getObject(size_t row); // size_t rowsOnView() const { return viewRef .size(); } //only visible elements size_t rowsTotal () const { return sortedRef.size(); } //total rows available - //get references to FileSystemObject: no NULL-check needed! Everything's bound. + //get references to FileSystemObject: no nullptr-check needed! Everything's bound. void getAllFileRef(const std::set<size_t>& rows, std::vector<FileSystemObject*>& output); struct StatusCmpResult @@ -109,17 +109,17 @@ public: bool onLeft_; bool ascending_; }; - const SortInfo* getSortInfo() const { return currentSort.get(); } //return NULL if currently not sorted + const SortInfo* getSortInfo() const { return currentSort.get(); } //return nullptr if currently not sorted - int findRowDirect(FileSystemObject::ObjectIdConst objId) const; // find an object's row position on view list directly, return < 0 if not found - int findRowFirstChild(const HierarchyObject* hierObj) const; // find first child of DirMapping or BaseDirMapping *on sorted sub view* + ptrdiff_t findRowDirect(FileSystemObject::ObjectIdConst objId) const; // find an object's row position on view list directly, return < 0 if not found + ptrdiff_t findRowFirstChild(const HierarchyObject* hierObj) const; // find first child of DirMapping or BaseDirMapping *on sorted sub view* //"hierObj" may be invalid, it is NOT dereferenced, return < 0 if not found private: struct RefIndex { - RefIndex(unsigned int folderInd, FileSystemObject::ObjectId id) : - folderIndex(folderInd), + RefIndex(size_t folderInd, FileSystemObject::ObjectId id) : + folderIndex(static_cast<unsigned int>(folderInd)), objId(id) {} unsigned int folderIndex; FileSystemObject::ObjectId objId; @@ -184,10 +184,8 @@ private: inline const FileSystemObject* GridView::getObject(size_t row) const { - if (row < rowsOnView()) - return FileSystemObject::retrieve(viewRef[row]); - else - return NULL; + return row < rowsOnView() ? + FileSystemObject::retrieve(viewRef[row]) : nullptr; } inline diff --git a/ui/gui_generated.cpp b/ui/gui_generated.cpp index 124354e6..9caa466a 100644 --- a/ui/gui_generated.cpp +++ b/ui/gui_generated.cpp @@ -1,19 +1,10 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 2 2011) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "../wx+/button.h" -#include "../wx+/dir_picker.h" -#include "../wx+/graph.h" -#include "../wx+/grid.h" -#include "../wx+/toggle_button.h" -#include "exec_finished_box.h" -#include "folder_history_box.h" -#include "wx_form_build_hide_warnings.h" - #include "gui_generated.h" /////////////////////////////////////////////////////////////////////////// @@ -40,8 +31,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const #endif m_menuFile->Append( m_menuItem11 ); - wxMenuItem* m_separator1; - m_separator1 = m_menuFile->AppendSeparator(); + m_menuFile->AppendSeparator(); m_menuItemNew = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&New") ) + wxT('\t') + wxT("Ctrl+N"), wxEmptyString, wxITEM_NORMAL ); #ifdef __WXMSW__ @@ -57,8 +47,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_menuItemLoad = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&Load configuration...") ) + wxT('\t') + wxT("Ctrl+O"), wxEmptyString, wxITEM_NORMAL ); m_menuFile->Append( m_menuItemLoad ); - wxMenuItem* m_separator3; - m_separator3 = m_menuFile->AppendSeparator(); + m_menuFile->AppendSeparator(); wxMenuItem* m_menuItem4; m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("Ctrl+Q"), wxEmptyString, wxITEM_NORMAL ); @@ -70,10 +59,9 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_menuLanguages = new wxMenu(); m_menuAdvanced->Append( -1, _("&Language"), m_menuLanguages ); - wxMenuItem* m_separator4; - m_separator4 = m_menuAdvanced->AppendSeparator(); + m_menuAdvanced->AppendSeparator(); - m_menuItemGlobSett = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Global settings...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuItemGlobSett = new wxMenuItem( m_menuAdvanced, wxID_PREFERENCES, wxString( _("&Global settings...") ) , wxEmptyString, wxITEM_NORMAL ); m_menuAdvanced->Append( m_menuItemGlobSett ); m_menuItem7 = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Create batch job...") ) , wxEmptyString, wxITEM_NORMAL ); @@ -86,15 +74,13 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_menubar1->Append( m_menuAdvanced, _("&Advanced") ); m_menuHelp = new wxMenu(); - wxMenuItem* m_menuItemReadme; - m_menuItemReadme = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Content") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); - m_menuHelp->Append( m_menuItemReadme ); + m_menuItemManual = new wxMenuItem( m_menuHelp, wxID_HELP, wxString( _("&Content") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemManual ); m_menuItemCheckVer = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Check for new version") ) , wxEmptyString, wxITEM_NORMAL ); m_menuHelp->Append( m_menuItemCheckVer ); - wxMenuItem* m_separator5; - m_separator5 = m_menuHelp->AppendSeparator(); + m_menuHelp->AppendSeparator(); m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("Shift+F1"), wxEmptyString, wxITEM_NORMAL ); m_menuHelp->Append( m_menuItemAbout ); @@ -146,6 +132,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer121->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_bpButtonCmpConfig = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); @@ -153,8 +140,10 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer121->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); + bSizer155->Add( fgSizer121, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + bSizerTopButtons->Add( bSizer155, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -189,13 +178,16 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer12->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer1551->Add( fgSizer12, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); bSizer1551->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerTopButtons->Add( bSizer1551, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelTopButtons->SetSizer( bSizerTopButtons ); m_panelTopButtons->Layout(); bSizerTopButtons->Fit( m_panelTopButtons ); @@ -224,6 +216,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextFinalPathLeft->Wrap( -1 ); bSizer181->Add( m_staticTextFinalPathLeft, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 2 ); + bSizer180->Add( bSizer181, 0, 0, 5 ); wxBoxSizer* bSizer182; @@ -247,8 +240,10 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer182->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer180->Add( bSizer182, 0, wxEXPAND, 5 ); + m_panelTopLeft->SetSizer( bSizer180 ); m_panelTopLeft->Layout(); bSizer180->Fit( m_panelTopLeft ); @@ -284,8 +279,10 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer160->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer93->Add( bSizer160, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_panelTopMiddle->SetSizer( bSizer93 ); m_panelTopMiddle->Layout(); bSizer93->Fit( m_panelTopMiddle ); @@ -307,6 +304,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextFinalPathRight->Wrap( -1 ); bSizer184->Add( m_staticTextFinalPathRight, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_VERTICAL, 2 ); + bSizer183->Add( bSizer184, 0, 0, 5 ); wxBoxSizer* bSizer179; @@ -320,13 +318,16 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer179->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer183->Add( bSizer179, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + m_panelTopRight->SetSizer( bSizer183 ); m_panelTopRight->Layout(); bSizer183->Fit( m_panelTopRight ); bSizer91->Add( m_panelTopRight, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxEXPAND, 5 ); + bSizer1601->Add( bSizer91, 0, wxEXPAND, 5 ); m_scrolledWindowFolderPairs = new wxScrolledWindow( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); @@ -335,11 +336,13 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); + m_scrolledWindowFolderPairs->SetSizer( bSizerAddFolderPairs ); m_scrolledWindowFolderPairs->Layout(); bSizerAddFolderPairs->Fit( m_scrolledWindowFolderPairs ); bSizer1601->Add( m_scrolledWindowFolderPairs, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + m_panelDirectoryPairs->SetSizer( bSizer1601 ); m_panelDirectoryPairs->Layout(); bSizer1601->Fit( m_panelDirectoryPairs ); @@ -369,6 +372,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer151->Add( m_bpButtonLoad, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerConfig->Add( bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_listBoxHistory = new wxListBox( m_panelConfig, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_EXTENDED|wxLB_NEEDED_SB|wxLB_SORT ); @@ -377,6 +381,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizerConfig->Add( m_listBoxHistory, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + m_panelConfig->SetSizer( bSizerConfig ); m_panelConfig->Layout(); bSizerConfig->Fit( m_panelConfig ); @@ -394,6 +399,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizer171->Add( m_checkBoxHideFilt, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelFilter->SetSizer( bSizer171 ); m_panelFilter->Layout(); bSizer171->Fit( m_panelFilter ); @@ -416,7 +422,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_textCtrlCreate = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlCreate->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlCreate->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlCreate->SetToolTip( _("Number of files and directories that will be created") ); fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -427,11 +433,12 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer5->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_textCtrlUpdate = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlUpdate->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlUpdate->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlUpdate->SetToolTip( _("Number of files that will be overwritten") ); fgSizer5->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerStatistics->Add( fgSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); wxFlexGridSizer* fgSizer6; @@ -445,7 +452,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer6->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlDelete = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlDelete->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlDelete->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlDelete->SetToolTip( _("Number of files and directories that will be deleted") ); fgSizer6->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -456,16 +463,18 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer6->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_textCtrlData = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlData->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlData->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerStatistics->Add( fgSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); bSizerStatistics->Add( 0, 0, 1, wxEXPAND, 5 ); + m_panelStatistics->SetSizer( bSizerStatistics ); m_panelStatistics->Layout(); bSizerStatistics->Fit( m_panelStatistics ); @@ -522,6 +531,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); + m_panelViewFilter->SetSizer( bSizerViewFilter ); m_panelViewFilter->Layout(); bSizerViewFilter->Fit( m_panelViewFilter ); @@ -550,6 +560,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextStatusLeftDirs->Wrap( -1 ); bSizerStatusLeftDirectories->Add( m_staticTextStatusLeftDirs, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer53->Add( bSizerStatusLeftDirectories, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizerStatusLeftFiles = new wxBoxSizer( wxHORIZONTAL ); @@ -574,11 +585,13 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextStatusLeftBytes->Wrap( -1 ); bSizerStatusLeftFiles->Add( m_staticTextStatusLeftBytes, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer53->Add( bSizerStatusLeftFiles, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer451->Add( bSizer53, 1, wxALIGN_BOTTOM|wxEXPAND, 5 ); m_staticline9 = new wxStaticLine( m_panelStatusBar, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); @@ -589,7 +602,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextStatusMiddle = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextStatusMiddle->Wrap( -1 ); - m_staticTextStatusMiddle->SetFont( wxFont( 8, 74, 90, 92, false, wxT("MS Shell Dlg 2") ) ); + m_staticTextStatusMiddle->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); bSizer451->Add( m_staticTextStatusMiddle, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -617,6 +630,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextStatusRightDirs->Wrap( -1 ); bSizerStatusRightDirectories->Add( m_staticTextStatusRightDirs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer52->Add( bSizerStatusRightDirectories, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizerStatusRightFiles = new wxBoxSizer( wxHORIZONTAL ); @@ -641,6 +655,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_staticTextStatusRightBytes->Wrap( -1 ); bSizerStatusRightFiles->Add( m_staticTextStatusRightBytes, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer52->Add( bSizerStatusRightFiles, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer50; @@ -652,15 +667,19 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_bitmapResizeCorner = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 10,10 ), 0 ); bSizer50->Add( m_bitmapResizeCorner, 0, wxALIGN_BOTTOM, 5 ); + bSizer52->Add( bSizer50, 1, wxALIGN_BOTTOM, 5 ); + bSizer451->Add( bSizer52, 1, wxALIGN_BOTTOM|wxEXPAND, 5 ); + m_panelStatusBar->SetSizer( bSizer451 ); m_panelStatusBar->Layout(); bSizer451->Fit( m_panelStatusBar ); bSizerPanelHolder->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + this->SetSizer( bSizerPanelHolder ); this->Layout(); @@ -675,7 +694,7 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const 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_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); - this->Connect( m_menuItemReadme->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); + this->Connect( m_menuItemManual->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); this->Connect( m_menuItemCheckVer->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); @@ -719,10 +738,10 @@ MainDialogGenerated::~MainDialogGenerated() this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); this->Disconnect( wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); + this->Disconnect( wxID_PREFERENCES, 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::OnMenuExportFileList ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); + this->Disconnect( wxID_HELP, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); this->Disconnect( wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); m_buttonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); @@ -781,6 +800,7 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer134->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelLeft->SetSizer( bSizer134 ); m_panelLeft->Layout(); bSizer134->Fit( m_panelLeft ); @@ -805,6 +825,7 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); + m_panel20->SetSizer( bSizer95 ); m_panel20->Layout(); bSizer95->Fit( m_panel20 ); @@ -824,11 +845,13 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const bSizer135->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelRight->SetSizer( bSizer135 ); m_panelRight->Layout(); bSizer135->Fit( m_panelRight ); bSizer74->Add( m_panelRight, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxEXPAND, 5 ); + this->SetSizer( bSizer74 ); this->Layout(); bSizer74->Fit( this ); @@ -856,10 +879,11 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, bSizer48->Add( m_staticText30, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlStatus = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); - m_textCtrlStatus->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlStatus->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer48->Add( m_textCtrlStatus, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer40->Add( bSizer48, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); @@ -880,10 +904,11 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, m_staticTextScanned = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextScanned->Wrap( -1 ); - m_staticTextScanned->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextScanned->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); bSizerFilesFound->Add( m_staticTextScanned, 0, wxALIGN_BOTTOM|wxLEFT, 5 ); + bSizer157->Add( bSizerFilesFound, 0, 0, 5 ); bSizerFilesRemaining = new wxBoxSizer( wxHORIZONTAL ); @@ -899,32 +924,35 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, m_staticTextFilesRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextFilesRemaining->Wrap( -1 ); - m_staticTextFilesRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextFilesRemaining->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); bSizer154->Add( m_staticTextFilesRemaining, 0, wxALIGN_BOTTOM, 5 ); m_staticText117 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText117->Wrap( -1 ); - m_staticText117->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + m_staticText117->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); bSizer154->Add( m_staticText117, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDataRemaining->Wrap( -1 ); - m_staticTextDataRemaining->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + m_staticTextDataRemaining->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); bSizer154->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); m_staticText118 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText118->Wrap( -1 ); - m_staticText118->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + m_staticText118->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); bSizer154->Add( m_staticText118, 0, wxALIGN_BOTTOM, 5 ); + bSizerFilesRemaining->Add( bSizer154, 0, wxALIGN_BOTTOM|wxLEFT, 5 ); + bSizer157->Add( bSizerFilesRemaining, 0, 0, 5 ); + bSizer42->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -940,10 +968,11 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextSpeed->Wrap( -1 ); - m_staticTextSpeed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextSpeed->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); sSizerSpeed->Add( m_staticTextSpeed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + bSizer42->Add( sSizerSpeed, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -951,7 +980,7 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, sSizerTimeRemaining = new wxBoxSizer( wxHORIZONTAL ); - m_staticTextTimeRemFixed = new wxStaticText( this, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeRemFixed = new wxStaticText( this, wxID_ANY, _("Remaining time:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTimeRemFixed->Wrap( -1 ); m_staticTextTimeRemFixed->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); @@ -959,10 +988,11 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, m_staticTextRemTime = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRemTime->Wrap( -1 ); - m_staticTextRemTime->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextRemTime->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); sSizerTimeRemaining->Add( m_staticTextRemTime, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + bSizer42->Add( sSizerTimeRemaining, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -971,7 +1001,7 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, sSizerTimeElapsed = new wxBoxSizer( wxHORIZONTAL ); wxStaticText* m_staticText37; - m_staticText37 = new wxStaticText( this, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText37 = new wxStaticText( this, wxID_ANY, _("Elapsed time:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText37->Wrap( -1 ); m_staticText37->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); @@ -979,17 +1009,20 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, m_staticTextTimeElapsed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTimeElapsed->Wrap( -1 ); - m_staticTextTimeElapsed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextTimeElapsed->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); sSizerTimeElapsed->Add( m_staticTextTimeElapsed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + bSizer42->Add( sSizerTimeElapsed, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer40->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); bSizer40->Add( 0, 0, 1, wxEXPAND, 5 ); + this->SetSizer( bSizer40 ); this->Layout(); bSizer40->Fit( this ); @@ -1001,7 +1034,7 @@ CompareStatusGenerated::~CompareStatusGenerated() BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxSize( 560,320 ), wxDefaultSize ); + this->SetSizeHints( wxSize( 560,300 ), wxDefaultSize ); wxBoxSizer* bSizer54; bSizer54 = new wxBoxSizer( wxVERTICAL ); @@ -1010,7 +1043,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer87 = new wxBoxSizer( wxHORIZONTAL ); m_bitmap27 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer87->Add( m_bitmap27, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + bSizer87->Add( m_bitmap27, 0, 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 ) ); @@ -1020,36 +1053,30 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Batch job"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText56->Wrap( -1 ); - m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + m_staticText56->SetFont( wxFont( 14, 70, 90, 92, false, wxEmptyString ) ); bSizer72->Add( m_staticText56, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_panel8->SetSizer( bSizer72 ); m_panel8->Layout(); bSizer72->Fit( m_panel8 ); - bSizer87->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer87->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer70; - bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + bSizer87->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - m_staticText44 = new wxStaticText( this, wxID_ANY, _("Create a batch file for automated synchronization. To start in batch mode simply double-click the file or execute via command line: FreeFileSync.exe <ffs_batch file>. This can also be scheduled in your operating system's task planner."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText44->Wrap( 460 ); - bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Create a batch file and automate synchronization. To start in batch mode simply double-click this file or run command: FreeFileSync.exe SyncJob.ffs_batch. This can also be scheduled in your system's task planner."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText44->Wrap( 480 ); + bSizer87->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); m_bpButtonHelp->SetToolTip( _("Help") ); - bSizer70->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer87->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer87->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer54->Add( bSizer87, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bSizer54->Add( bSizer87, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - m_listbook1 = new wxListbook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLB_DEFAULT ); - m_panelOverview = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelOverview = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer67; bSizer67 = new wxBoxSizer( wxHORIZONTAL ); @@ -1080,8 +1107,10 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer241->Add( m_staticTextCmpVariant, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer1701->Add( sbSizer241, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer175->Add( bSizer1701, 1, wxALIGN_CENTER_VERTICAL, 5 ); wxStaticBoxSizer* sbSizer26; @@ -1090,6 +1119,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_bpButtonFilter = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); sbSizer26->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 15 ); + bSizer175->Add( sbSizer26, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer171; @@ -1113,10 +1143,13 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer252->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL, 3 ); + bSizer171->Add( sbSizer252, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT, 5 ); + bSizer175->Add( bSizer171, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer120->Add( bSizer175, 0, wxEXPAND, 5 ); @@ -1146,6 +1179,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer1361->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer147->Add( bSizer1361, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer143; @@ -1160,6 +1194,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer145->Add( m_staticText532, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer143->Add( bSizer145, 1, 0, 5 ); wxBoxSizer* bSizer146; @@ -1171,10 +1206,13 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer146->Add( m_staticText5411, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer143->Add( bSizer146, 1, 0, 5 ); + bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + m_panelMainPair->SetSizer( bSizer147 ); m_panelMainPair->Layout(); bSizer147->Fit( m_panelMainPair ); @@ -1195,6 +1233,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer1141->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelLeft->SetSizer( bSizer1141 ); m_panelLeft->Layout(); bSizer1141->Fit( m_panelLeft ); @@ -1212,11 +1251,13 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelRight->SetSizer( bSizer115 ); m_panelRight->Layout(); bSizer115->Fit( m_panelRight ); bSizer158->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizerMainPair->Add( bSizer158, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); wxBoxSizer* bSizer177; @@ -1231,14 +1272,18 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_bpButtonAltSyncCfg = new wxBitmapButton( m_scrolledWindow6, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); bSizer177->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizerMainPair->Add( bSizer177, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer141->Add( sbSizerMainPair, 0, wxEXPAND, 5 ); bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); + bSizer141->Add( bSizerAddFolderPairs, 1, wxEXPAND, 5 ); + m_scrolledWindow6->SetSizer( bSizer141 ); m_scrolledWindow6->Layout(); bSizer141->Fit( m_scrolledWindow6 ); @@ -1247,13 +1292,15 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer120->Add( 0, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer67->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 10 ); + m_panelOverview->SetSizer( bSizer67 ); m_panelOverview->Layout(); bSizer67->Fit( m_panelOverview ); - m_listbook1->AddPage( m_panelOverview, _("Overview"), true ); - m_panelBatchSettings = new wxPanel( m_listbook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_notebook1->AddPage( m_panelOverview, _("Synchronization settings"), true ); + m_panelBatchSettings = new wxPanel( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer117; bSizer117 = new wxBoxSizer( wxVERTICAL ); @@ -1269,6 +1316,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_checkBoxShowProgress = new wxCheckBox( m_panelBatchSettings, wxID_ANY, _("Show progress dialog"), wxDefaultPosition, wxDefaultSize, 0 ); sbSizer24->Add( m_checkBoxShowProgress, 0, wxALL|wxEXPAND, 5 ); + bSizer1722->Add( sbSizer24, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); @@ -1282,8 +1330,10 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_choiceHandleError->SetSelection( 0 ); sbSizer25->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer1722->Add( sbSizer25, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer172->Add( bSizer1722, 0, wxEXPAND, 5 ); @@ -1304,6 +1354,7 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_spinCtrlLogCountMax = new wxSpinCtrl( m_panelBatchSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); bSizer152->Add( m_spinCtrlLogCountMax, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizerLogfileDir->Add( bSizer152, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_panelLogfile = new wxPanel( m_panelBatchSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); @@ -1325,29 +1376,28 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer170->Add( m_dirPickerLogfileDir, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer1721->Add( bSizer170, 0, wxEXPAND, 5 ); + m_panelLogfile->SetSizer( bSizer1721 ); m_panelLogfile->Layout(); bSizer1721->Fit( m_panelLogfile ); sbSizerLogfileDir->Add( m_panelLogfile, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer172->Add( sbSizerLogfileDir, 0, wxEXPAND, 5 ); + bSizer117->Add( bSizer172, 1, wxEXPAND|wxALL, 10 ); + m_panelBatchSettings->SetSizer( bSizer117 ); m_panelBatchSettings->Layout(); bSizer117->Fit( m_panelBatchSettings ); - m_listbook1->AddPage( m_panelBatchSettings, _("Batch settings"), false ); -#ifndef __WXGTK__ // Small icon style not supported in GTK - wxListView* m_listbook1ListView = m_listbook1->GetListView(); - long m_listbook1Flags = m_listbook1ListView->GetWindowStyleFlag(); - m_listbook1Flags = ( m_listbook1Flags & ~wxLC_ICON ) | wxLC_SMALL_ICON; - m_listbook1ListView->SetWindowStyleFlag( m_listbook1Flags ); -#endif + m_notebook1->AddPage( m_panelBatchSettings, _("Batch settings"), false ); - bSizer54->Add( m_listbook1, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bSizer54->Add( m_notebook1, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer68; bSizer68 = new wxBoxSizer( wxHORIZONTAL ); @@ -1368,7 +1418,9 @@ BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer68->Add( m_button6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer54->Add( bSizer68, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + bSizer54->Add( bSizer68, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + this->SetSizer( bSizer54 ); this->Layout(); @@ -1429,6 +1481,7 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID bSizer136->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer147->Add( bSizer136, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer143; @@ -1443,6 +1496,7 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID bSizer145->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer143->Add( bSizer145, 1, 0, 5 ); wxBoxSizer* bSizer146; @@ -1454,10 +1508,13 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID bSizer146->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer143->Add( bSizer146, 1, 0, 5 ); + bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + m_panel32->SetSizer( bSizer147 ); m_panel32->Layout(); bSizer147->Fit( m_panel32 ); @@ -1478,6 +1535,7 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID bSizer114->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelLeft->SetSizer( bSizer114 ); m_panelLeft->Layout(); bSizer114->Fit( m_panelLeft ); @@ -1495,11 +1553,13 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelRight->SetSizer( bSizer115 ); m_panelRight->Layout(); bSizer115->Fit( m_panelRight ); bSizer144->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer140->Add( bSizer144, 1, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer176; @@ -1514,13 +1574,16 @@ BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID m_bpButtonAltSyncCfg = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); bSizer176->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer140->Add( bSizer176, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer142->Add( bSizer140, 0, wxEXPAND, 5 ); bSizer142->Add( 0, 5, 0, 0, 5 ); + this->SetSizer( bSizer142 ); this->Layout(); bSizer142->Fit( this ); @@ -1608,8 +1671,10 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_staticText9->Wrap( 410 ); fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + sbSizer7->Add( fgSizer1, 0, 0, 5 ); + bSizer29->Add( sbSizer7, 0, wxEXPAND, 5 ); @@ -1632,11 +1697,13 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_dirPickerCustomDelFolder = new zen::DirPickerCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer1151->Add( m_dirPickerCustomDelFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panelCustomDeletionDir->SetSizer( bSizer1151 ); m_panelCustomDeletionDir->Layout(); bSizer1151->Fit( m_panelCustomDeletionDir ); sbSizerCustDelDir->Add( m_panelCustomDeletionDir, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer29->Add( sbSizerCustDelDir, 0, wxEXPAND, 5 ); bSizer201 = new wxBoxSizer( wxHORIZONTAL ); @@ -1648,6 +1715,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_choiceHandleError->SetSelection( 0 ); sbSizerErrorHandling->Add( m_choiceHandleError, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201->Add( sbSizerErrorHandling, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 10 ); sbSizerExecFinished = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("On completion:") ), wxHORIZONTAL ); @@ -1655,10 +1723,13 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_comboBoxExecFinished = new ExecFinishedBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); sbSizerExecFinished->Add( m_comboBoxExecFinished, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201->Add( sbSizerExecFinished, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer29->Add( bSizer201, 0, wxEXPAND|wxTOP, 5 ); + bSizer181->Add( bSizer29, 0, wxEXPAND, 5 ); @@ -1690,6 +1761,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const gSizer3->Add( m_staticText31, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + sbSizerSyncDirections->Add( gSizer3, 0, wxBOTTOM|wxEXPAND, 5 ); wxBoxSizer* bSizer121; @@ -1708,6 +1780,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonLeftOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); bSizerLeftOnly->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizerLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerRightOnly = new wxBoxSizer( wxHORIZONTAL ); @@ -1723,6 +1796,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonRightOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); bSizerRightOnly->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizerRightOnly, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerLeftNewer = new wxBoxSizer( wxHORIZONTAL ); @@ -1738,6 +1812,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonLeftNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); bSizerLeftNewer->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizerLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerRightNewer = new wxBoxSizer( wxHORIZONTAL ); @@ -1753,6 +1828,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonRightNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); bSizerRightNewer->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizerRightNewer, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerDifferent = new wxBoxSizer( wxHORIZONTAL ); @@ -1768,6 +1844,7 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonDifferent = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); bSizerDifferent->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizerDifferent, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizerConflict = new wxBoxSizer( wxHORIZONTAL ); @@ -1783,17 +1860,22 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonConflict = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); bSizerConflict->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer121->Add( bSizerConflict, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + sbSizerSyncDirections->Add( bSizer121, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + sbSizer2453245->Add( sbSizerSyncDirections, 0, wxEXPAND, 5 ); sbSizer2453245->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer181->Add( sbSizer2453245, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer7->Add( bSizer181, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer291; @@ -1810,8 +1892,10 @@ SyncCfgDlgGenerated::SyncCfgDlgGenerated( wxWindow* parent, wxWindowID id, const bSizer291->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer7->Add( bSizer291, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); + this->SetSizer( bSizer7 ); this->Layout(); bSizer7->Fit( this ); @@ -1924,8 +2008,10 @@ CmpCfgDlgGenerated::CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id, const w fgSizer16->Add( m_buttonContent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + sbSizer6->Add( fgSizer16, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 ); @@ -1942,6 +2028,7 @@ CmpCfgDlgGenerated::CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id, const w m_choiceHandleSymlinks->SetSelection( -1 ); sbSizer25->Add( m_choiceHandleSymlinks, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer177->Add( sbSizer25, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); @@ -1949,6 +2036,7 @@ CmpCfgDlgGenerated::CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer177->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer55->Add( bSizer177, 0, wxEXPAND, 5 ); wxBoxSizer* bSizer22; @@ -1965,10 +2053,13 @@ CmpCfgDlgGenerated::CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer22->Add( m_button6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer55->Add( bSizer22, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer136->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + this->SetSizer( bSizer136 ); this->Layout(); bSizer136->Fit( this ); @@ -2006,7 +2097,7 @@ CmpCfgDlgGenerated::~CmpCfgDlgGenerated() SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxSize( 470,200 ), wxDefaultSize ); + this->SetSizeHints( wxSize( 470,260 ), wxDefaultSize ); wxBoxSizer* bSizer172; bSizer172 = new wxBoxSizer( wxVERTICAL ); @@ -2018,37 +2109,42 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, bSizer42 = new wxBoxSizer( wxHORIZONTAL ); m_bitmapStatus = new wxStaticBitmap( m_panelBackground, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 28,28 ), 0 ); - bSizer42->Add( m_bitmapStatus, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); + bSizer42->Add( m_bitmapStatus, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_staticTextStatus = new wxStaticText( m_panelBackground, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextStatus->Wrap( -1 ); m_staticTextStatus->SetFont( wxFont( 14, 70, 90, 92, false, wxEmptyString ) ); - bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); m_animationControl1 = new wxAnimationCtrl( m_panelBackground, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxDefaultSize, wxAC_DEFAULT_STYLE ); m_animationControl1->SetMinSize( wxSize( 45,45 ) ); bSizer42->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - bSizerTop->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizerTop->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); bSizerCurrentOperation = new wxBoxSizer( wxHORIZONTAL ); m_staticText2511 = new wxStaticText( m_panelBackground, wxID_ANY, _("Operation:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2511->Wrap( -1 ); - m_staticText2511->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + m_staticText2511->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); bSizerCurrentOperation->Add( m_staticText2511, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlInfo = new wxTextCtrl( m_panelBackground, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); - m_textCtrlInfo->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlInfo->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizerCurrentOperation->Add( m_textCtrlInfo, 1, wxALIGN_CENTER_VERTICAL, 5 ); - bSizerTop->Add( bSizerCurrentOperation, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + bSizerTop->Add( bSizerCurrentOperation, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); m_panelProgress = new wxPanel( m_panelBackground, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer173; + bSizer173 = new wxBoxSizer( wxVERTICAL ); + bSizer171 = new wxBoxSizer( wxHORIZONTAL ); bSizerProgressStat = new wxStaticBoxSizer( new wxStaticBox( m_panelProgress, wxID_ANY, wxEmptyString ), wxHORIZONTAL ); @@ -2058,112 +2154,116 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, fgSizer10->SetFlexibleDirection( wxBOTH ); fgSizer10->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticTextItemsRem = new wxStaticText( m_panelProgress, wxID_ANY, _("Items remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextItemsRem->Wrap( -1 ); - m_staticTextItemsRem->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - fgSizer10->Add( m_staticTextItemsRem, 0, wxALIGN_BOTTOM, 5 ); - - bSizerItemsRem = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextRemainingObj = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextRemainingObj->Wrap( -1 ); - m_staticTextRemainingObj->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizerItemsRem->Add( m_staticTextRemainingObj, 0, wxALIGN_BOTTOM, 5 ); - - m_staticText96 = new wxStaticText( m_panelProgress, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText96->Wrap( -1 ); - m_staticText96->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerItemsRem->Add( m_staticText96, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - m_staticTextDataRemaining = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataRemaining->Wrap( -1 ); - m_staticTextDataRemaining->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerItemsRem->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); - - m_staticText97 = new wxStaticText( m_panelProgress, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText97->Wrap( -1 ); - m_staticText97->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerItemsRem->Add( m_staticText97, 0, wxALIGN_BOTTOM, 5 ); - - fgSizer10->Add( bSizerItemsRem, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextItemsProc = new wxStaticText( m_panelProgress, wxID_ANY, _("Items processed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextItemsProc->Wrap( -1 ); - m_staticTextItemsProc->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + m_staticTextLabelItemsProc = new wxStaticText( m_panelProgress, wxID_ANY, _("Items processed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLabelItemsProc->Wrap( -1 ); + m_staticTextLabelItemsProc->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - fgSizer10->Add( m_staticTextItemsProc, 0, wxALIGN_BOTTOM, 5 ); + fgSizer10->Add( m_staticTextLabelItemsProc, 0, wxALIGN_BOTTOM, 5 ); bSizerItemsProc = new wxBoxSizer( wxHORIZONTAL ); m_staticTextProcessedObj = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_staticTextProcessedObj->Wrap( -1 ); - m_staticTextProcessedObj->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextProcessedObj->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); bSizerItemsProc->Add( m_staticTextProcessedObj, 0, wxALIGN_BOTTOM, 5 ); m_staticText98 = new wxStaticText( m_panelProgress, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText98->Wrap( -1 ); - m_staticText98->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + m_staticText98->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); bSizerItemsProc->Add( m_staticText98, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); m_staticTextDataProcessed = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextDataProcessed->Wrap( -1 ); - m_staticTextDataProcessed->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + m_staticTextDataProcessed->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); bSizerItemsProc->Add( m_staticTextDataProcessed, 0, wxALIGN_BOTTOM, 5 ); m_staticText99 = new wxStaticText( m_panelProgress, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText99->Wrap( -1 ); - m_staticText99->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + m_staticText99->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); bSizerItemsProc->Add( m_staticText99, 0, wxALIGN_BOTTOM, 5 ); + fgSizer10->Add( bSizerItemsProc, 0, wxALIGN_BOTTOM, 5 ); - m_staticTextSpeedDescr = new wxStaticText( m_panelProgress, wxID_ANY, _("Speed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSpeedDescr->Wrap( -1 ); - m_staticTextSpeedDescr->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + m_staticTextLabelItemsRem = new wxStaticText( m_panelProgress, wxID_ANY, _("Items remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLabelItemsRem->Wrap( -1 ); + m_staticTextLabelItemsRem->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - fgSizer10->Add( m_staticTextSpeedDescr, 0, wxALIGN_BOTTOM, 5 ); + fgSizer10->Add( m_staticTextLabelItemsRem, 0, wxALIGN_BOTTOM, 5 ); - m_staticTextSpeed = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSpeed->Wrap( -1 ); - m_staticTextSpeed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + bSizerItemsRem = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextRemainingObj = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextRemainingObj->Wrap( -1 ); + m_staticTextRemainingObj->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); + + bSizerItemsRem->Add( m_staticTextRemainingObj, 0, wxALIGN_BOTTOM, 5 ); + + m_staticText96 = new wxStaticText( m_panelProgress, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText96->Wrap( -1 ); + m_staticText96->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); + + bSizerItemsRem->Add( m_staticText96, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + m_staticTextDataRemaining = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataRemaining->Wrap( -1 ); + m_staticTextDataRemaining->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); + + bSizerItemsRem->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); + + m_staticText97 = new wxStaticText( m_panelProgress, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText97->Wrap( -1 ); + m_staticText97->SetFont( wxFont( 9, 70, 90, 90, false, wxEmptyString ) ); + + bSizerItemsRem->Add( m_staticText97, 0, wxALIGN_BOTTOM, 5 ); - fgSizer10->Add( m_staticTextSpeed, 0, wxALIGN_BOTTOM, 5 ); - m_staticText55 = new wxStaticText( m_panelProgress, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText55->Wrap( -1 ); - m_staticText55->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + fgSizer10->Add( bSizerItemsRem, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextLabelElapsedTime = new wxStaticText( m_panelProgress, wxID_ANY, _("Elapsed time:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLabelElapsedTime->Wrap( -1 ); + m_staticTextLabelElapsedTime->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - fgSizer10->Add( m_staticText55, 0, wxALIGN_BOTTOM, 5 ); + fgSizer10->Add( m_staticTextLabelElapsedTime, 0, wxALIGN_BOTTOM, 5 ); m_staticTextTimeElapsed = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextTimeElapsed->Wrap( -1 ); - m_staticTextTimeElapsed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextTimeElapsed->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); fgSizer10->Add( m_staticTextTimeElapsed, 0, wxALIGN_BOTTOM, 5 ); - m_staticTextRemTimeDescr = new wxStaticText( m_panelProgress, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextRemTimeDescr->Wrap( -1 ); - m_staticTextRemTimeDescr->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + m_staticTextLabelRemTime = new wxStaticText( m_panelProgress, wxID_ANY, _("Remaining time:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextLabelRemTime->Wrap( -1 ); + m_staticTextLabelRemTime->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - fgSizer10->Add( m_staticTextRemTimeDescr, 0, wxALIGN_BOTTOM, 5 ); + fgSizer10->Add( m_staticTextLabelRemTime, 0, wxALIGN_BOTTOM, 5 ); m_staticTextRemTime = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextRemTime->Wrap( -1 ); - m_staticTextRemTime->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + m_staticTextRemTime->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); fgSizer10->Add( m_staticTextRemTime, 0, wxALIGN_BOTTOM, 5 ); + m_staticText84 = new wxStaticText( m_panelProgress, wxID_ANY, _("Speed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText84->Wrap( -1 ); + m_staticText84->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + fgSizer10->Add( m_staticText84, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextSpeed = new wxStaticText( m_panelProgress, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSpeed->Wrap( -1 ); + m_staticTextSpeed->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer10->Add( m_staticTextSpeed, 0, wxALIGN_BOTTOM, 5 ); + + bSizerProgressStat->Add( fgSizer10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer171->Add( bSizerProgressStat, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -2174,9 +2274,16 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, bSizer171->Add( m_panelGraph, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - m_panelProgress->SetSizer( bSizer171 ); + + bSizer173->Add( bSizer171, 1, wxEXPAND, 5 ); + + m_gauge1 = new wxGauge( m_panelProgress, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL ); + bSizer173->Add( m_gauge1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + m_panelProgress->SetSizer( bSizer173 ); m_panelProgress->Layout(); - bSizer171->Fit( m_panelProgress ); + bSizer173->Fit( m_panelProgress ); bSizerTop->Add( m_panelProgress, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerFinalStat = new wxBoxSizer( wxVERTICAL ); @@ -2191,22 +2298,21 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, bSizerFinalStat->Add( m_listbookResult, 1, wxEXPAND, 5 ); - bSizerTop->Add( bSizerFinalStat, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - m_gauge1 = new wxGauge( m_panelBackground, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL ); - bSizerTop->Add( m_gauge1, 0, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizerTop->Add( bSizerFinalStat, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); bSizerExecFinished = new wxBoxSizer( wxHORIZONTAL ); m_staticText87 = new wxStaticText( m_panelBackground, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText87->Wrap( -1 ); - m_staticText87->SetFont( wxFont( 8, 74, 90, 90, false, wxT("MS Shell Dlg 2") ) ); + m_staticText87->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) ); bSizerExecFinished->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_comboBoxExecFinished = new ExecFinishedBox( m_panelBackground, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); bSizerExecFinished->Add( m_comboBoxExecFinished, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerTop->Add( bSizerExecFinished, 0, wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); bSizer28 = new wxBoxSizer( wxHORIZONTAL ); @@ -2233,13 +2339,16 @@ SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, bSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizerTop->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_panelBackground->SetSizer( bSizerTop ); m_panelBackground->Layout(); bSizerTop->Fit( m_panelBackground ); bSizer172->Add( m_panelBackground, 1, wxEXPAND, 5 ); + this->SetSizer( bSizer172 ); this->Layout(); @@ -2281,13 +2390,15 @@ LogControlGenerated::LogControlGenerated( wxWindow* parent, wxWindowID id, const m_bpButtonInfo = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), wxBU_AUTODRAW ); bSizer154->Add( m_bpButtonInfo, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer153->Add( bSizer154, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_textCtrlInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrlInfo->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlInfo->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer153->Add( m_textCtrlInfo, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + this->SetSizer( bSizer153 ); this->Layout(); bSizer153->Fit( this ); @@ -2326,6 +2437,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 404,55 ), 0 ); bSizer36->Add( m_bitmap11, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_panel5->SetSizer( bSizer36 ); m_panel5->Layout(); bSizer36->Fit( m_panel5 ); @@ -2342,7 +2454,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer53 = new wxBoxSizer( wxVERTICAL ); m_panel33 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER|wxTAB_TRAVERSAL ); - m_panel33->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_panel33->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizerCodeInfo = new wxBoxSizer( wxVERTICAL ); @@ -2359,76 +2471,80 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer171 = new wxBoxSizer( wxHORIZONTAL ); m_hyperlink9 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("MinGW"), wxT("http://www.mingw.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink9->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink9->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer171->Add( m_hyperlink9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink11 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("MS Visual C++"), wxT("http://msdn.microsoft.com/library/60k1461a.aspx"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink11->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink11->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer171->Add( m_hyperlink11, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink10 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("Code::Blocks"), wxT("http://www.codeblocks.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink10->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink10->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer171->Add( m_hyperlink10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink13 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("Boost"), wxT("http://www.boost.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink13->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink13->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer171->Add( m_hyperlink13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink7 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("wxWidgets"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink7->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink7->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer171->Add( m_hyperlink7, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink16 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("Artistic Style"), wxT("http://astyle.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink16->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink16->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer171->Add( m_hyperlink16, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + bSizer167->Add( bSizer171, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); wxBoxSizer* bSizer172; bSizer172 = new wxBoxSizer( wxHORIZONTAL ); m_hyperlink8 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("Loki"), wxT("http://loki-lib.sourceforge.net/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink8->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink8->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer172->Add( m_hyperlink8, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink15 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("zenXML"), wxT("http://zenxml.sourceforge.net/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink15->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink15->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer172->Add( m_hyperlink15, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink12 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("Google Test"), wxT("http://code.google.com/p/googletest"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink12->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink12->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer172->Add( m_hyperlink12, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink18 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("Unicode NSIS"), wxT("http://www.scratchpaper.com"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink18->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink18->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer172->Add( m_hyperlink18, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_hyperlink14 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("wxFormBuilder"), wxT("http://wxformbuilder.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink14->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink14->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer172->Add( m_hyperlink14, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + bSizer167->Add( bSizer172, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizerCodeInfo->Add( bSizer167, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); m_hyperlink21 = new wxHyperlinkCtrl( m_panel33, wxID_ANY, _("- ZenJu -"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlink21->SetFont( wxFont( 10, 74, 93, 92, false, wxT("Segoe Print") ) ); - m_hyperlink21->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_hyperlink21->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_hyperlink21->SetToolTip( _("zhnmju123@gmx.de") ); bSizerCodeInfo->Add( m_hyperlink21, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_panel33->SetSizer( bSizerCodeInfo ); m_panel33->Layout(); bSizerCodeInfo->Fit( m_panel33 ); @@ -2457,6 +2573,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer170->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer29->Add( bSizer170, 1, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer1711; @@ -2479,20 +2596,22 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer1711->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer29->Add( bSizer1711, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer53->Add( sbSizer29, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); m_scrolledWindowTranslators = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); m_scrolledWindowTranslators->SetScrollRate( 5, 5 ); - m_scrolledWindowTranslators->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_scrolledWindowTranslators->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_scrolledWindowTranslators->SetMinSize( wxSize( -1,180 ) ); bSizerTranslators = new wxBoxSizer( wxVERTICAL ); m_staticText54 = new wxStaticText( m_scrolledWindowTranslators, wxID_ANY, _("Big thanks for localizing FreeFileSync goes out to:"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText54->Wrap( -1 ); - m_staticText54->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + m_staticText54->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); bSizerTranslators->Add( m_staticText54, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); @@ -2503,8 +2622,10 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS fgSizerTranslators->SetFlexibleDirection( wxBOTH ); fgSizerTranslators->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + bSizerTranslators->Add( fgSizerTranslators, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_scrolledWindowTranslators->SetSizer( bSizerTranslators ); m_scrolledWindowTranslators->Layout(); bSizerTranslators->Fit( m_scrolledWindowTranslators ); @@ -2517,7 +2638,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); m_hyperlink3 = new wxHyperlinkCtrl( this, wxID_ANY, _("Donate with PayPal"), wxT("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123@gmx.de&lc=US¤cy_code=EUR"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink3->SetFont( wxFont( 10, 74, 90, 92, true, wxT("MS Shell Dlg 2") ) ); + m_hyperlink3->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); m_hyperlink3->SetToolTip( _("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123@gmx.de&lc=US¤cy_code=EUR") ); sbSizer28->Add( m_hyperlink3, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); @@ -2530,8 +2651,10 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer53->Add( sbSizer28, 0, wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 25 ); wxStaticBoxSizer* sbSizer14; @@ -2549,6 +2672,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer31->Add( sbSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_buttonOkay = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,30 ), 0 ); @@ -2557,6 +2681,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31->Add( m_buttonOkay, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + this->SetSizer( bSizer31 ); this->Layout(); bSizer31->Fit( this ); @@ -2578,7 +2703,7 @@ AboutDlgGenerated::~AboutDlgGenerated() ErrorDlgGenerated::ErrorDlgGenerated( 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 ); + this->SetSizeHints( wxSize( 300,160 ), wxDefaultSize ); wxBoxSizer* bSizer24; bSizer24 = new wxBoxSizer( wxVERTICAL ); @@ -2593,13 +2718,14 @@ ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrl8->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrl8->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore subsequent errors"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore further errors"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxIgnoreErrors->SetToolTip( _("Hide further error messages during the current process") ); bSizer24->Add( m_checkBoxIgnoreErrors, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); @@ -2611,23 +2737,22 @@ ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_buttonIgnore->SetDefault(); m_buttonIgnore->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer25->Add( m_buttonIgnore, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizer25->Add( m_buttonIgnore, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonRetry->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer25->Add( m_buttonRetry, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizer25->Add( m_buttonRetry, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer25->Add( m_buttonAbort, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - + bSizer25->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + this->SetSizer( bSizer24 ); this->Layout(); @@ -2650,7 +2775,7 @@ ErrorDlgGenerated::~ErrorDlgGenerated() WarningDlgGenerated::WarningDlgGenerated( 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 ); + this->SetSizeHints( wxSize( 300,160 ), wxDefaultSize ); wxBoxSizer* bSizer24; bSizer24 = new wxBoxSizer( wxVERTICAL ); @@ -2665,10 +2790,11 @@ WarningDlgGenerated::WarningDlgGenerated( wxWindow* parent, wxWindowID id, const bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrl8->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrl8->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -2694,10 +2820,9 @@ WarningDlgGenerated::WarningDlgGenerated( wxWindow* parent, wxWindowID id, const bSizer25->Add( m_buttonAbort, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + this->SetSizer( bSizer24 ); this->Layout(); @@ -2720,7 +2845,7 @@ WarningDlgGenerated::~WarningDlgGenerated() QuestionDlgGenerated::QuestionDlgGenerated( 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 ); + this->SetSizeHints( wxSize( 300,160 ), wxDefaultSize ); wxBoxSizer* bSizer24; bSizer24 = new wxBoxSizer( wxVERTICAL ); @@ -2735,14 +2860,15 @@ QuestionDlgGenerated::QuestionDlgGenerated( wxWindow* parent, wxWindowID id, con bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrl8->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrl8->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - m_checkBoxDontAskAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer24->Add( m_checkBoxDontAskAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); + m_checkBox = new wxCheckBox( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer24->Add( m_checkBox, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); wxBoxSizer* bSizer25; bSizer25 = new wxBoxSizer( wxHORIZONTAL ); @@ -2751,29 +2877,27 @@ QuestionDlgGenerated::QuestionDlgGenerated( wxWindow* parent, wxWindowID id, con m_buttonYes->SetDefault(); m_buttonYes->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer25->Add( m_buttonYes, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizer25->Add( m_buttonYes, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_buttonNo = new wxButton( this, wxID_NO, _("&No"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonNo->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer25->Add( m_buttonNo, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizer25->Add( m_buttonNo, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonCancel->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer25->Add( m_buttonCancel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizer25->Add( m_buttonCancel, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + this->SetSizer( bSizer24 ); this->Layout(); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( QuestionDlgGenerated::OnClose ) ); - m_checkBoxDontAskAgain->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCheckBoxDontShowAgain ), NULL, this ); m_buttonYes->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnYes ), NULL, this ); m_buttonNo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnNo ), NULL, this ); m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCancel ), NULL, this ); @@ -2783,7 +2907,6 @@ QuestionDlgGenerated::~QuestionDlgGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( QuestionDlgGenerated::OnClose ) ); - m_checkBoxDontAskAgain->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCheckBoxDontShowAgain ), NULL, this ); m_buttonYes->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnYes ), NULL, this ); m_buttonNo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnNo ), NULL, this ); m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCancel ), NULL, this ); @@ -2792,49 +2915,50 @@ QuestionDlgGenerated::~QuestionDlgGenerated() DeleteDlgGenerated::DeleteDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetSizeHints( wxSize( 400,220 ), wxDefaultSize ); wxBoxSizer* bSizer24; bSizer24 = new wxBoxSizer( wxVERTICAL ); - - bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer41; bSizer41 = new wxBoxSizer( wxHORIZONTAL ); m_bitmap12 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer41->Add( m_bitmap12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer41->Add( m_bitmap12, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextHeader->Wrap( -1 ); m_staticTextHeader->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer41->Add( m_staticTextHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer41->Add( m_staticTextHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer24->Add( bSizer41, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer24->Add( bSizer41, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_textCtrlMessage = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrlMessage->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlMessage->SetBackgroundColour( wxColour( 224, 224, 224 ) ); bSizer24->Add( m_textCtrlMessage, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + wxBoxSizer* bSizer179; + bSizer179 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer99; - bSizer99 = new wxBoxSizer( wxHORIZONTAL ); + bSizer99 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer99->Add( m_checkBoxUseRecycler, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); m_checkBoxDeleteBothSides = new wxCheckBox( this, wxID_ANY, _("Delete on both sides"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxDeleteBothSides->SetToolTip( _("Delete on both sides even if the file is selected on one side only") ); - bSizer99->Add( m_checkBoxDeleteBothSides, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer99->Add( m_checkBoxDeleteBothSides, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer99->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer179->Add( bSizer99, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxUseRecycler->SetValue(true); - bSizer99->Add( m_checkBoxUseRecycler, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - bSizer24->Add( bSizer99, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer179->Add( 0, 0, 1, wxEXPAND, 5 ); wxBoxSizer* bSizer25; bSizer25 = new wxBoxSizer( wxHORIZONTAL ); @@ -2850,15 +2974,20 @@ DeleteDlgGenerated::DeleteDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer25->Add( m_buttonCancel, 0, wxALL, 5 ); - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer179->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer24->Add( bSizer179, 0, wxEXPAND, 5 ); + this->SetSizer( bSizer24 ); this->Layout(); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); - m_checkBoxDeleteBothSides->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), NULL, this ); + m_checkBoxDeleteBothSides->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); } @@ -2867,8 +2996,8 @@ DeleteDlgGenerated::~DeleteDlgGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); - m_checkBoxDeleteBothSides->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), NULL, this ); + m_checkBoxDeleteBothSides->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); @@ -2876,16 +3005,20 @@ DeleteDlgGenerated::~DeleteDlgGenerated() FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { - this->SetSizeHints( wxSize( 370,380 ), wxDefaultSize ); + this->SetSizeHints( wxSize( 500,380 ), wxDefaultSize ); wxBoxSizer* bSizer21; bSizer21 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer86; - bSizer86 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer70; + bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + + bSizer70->SetMinSize( wxSize( 550,-1 ) ); + + bSizer70->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap26 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer86->Add( m_bitmap26, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + bSizer70->Add( m_bitmap26, 0, 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 ) ); @@ -2895,50 +3028,37 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_staticTexHeader = new wxStaticText( m_panel8, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTexHeader->Wrap( -1 ); - m_staticTexHeader->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + m_staticTexHeader->SetFont( wxFont( 14, 70, 90, 92, false, wxEmptyString ) ); bSizer72->Add( m_staticTexHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + m_panel8->SetSizer( bSizer72 ); m_panel8->Layout(); bSizer72->Fit( m_panel8 ); - bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer21->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer70; - bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + bSizer70->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - bSizer70->SetMinSize( wxSize( 550,-1 ) ); - - bSizer70->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that match all filter settings will be selected for synchronization.\nNote: The name filter must be specified relative(!) to main synchronization directories."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticText44->Wrap( 550 ); + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files that match all filter settings will be synchronized.\nNote: File names must be relative to base directories!"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticText44->Wrap( -1 ); bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer70->Add( 0, 0, 1, wxEXPAND, 5 ); - m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); m_bpButtonHelp->SetToolTip( _("Help") ); bSizer70->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - bSizer21->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 10 ); + + bSizer70->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer21->Add( 0, 5, 0, 0, 5 ); + bSizer21->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_panel13 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer69; bSizer69 = new wxBoxSizer( wxVERTICAL ); m_staticline10 = new wxStaticLine( m_panel13, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer69->Add( m_staticline10, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizer69->Add( m_staticline10, 0, wxEXPAND, 5 ); wxBoxSizer* bSizer52; bSizer52 = new wxBoxSizer( wxVERTICAL ); @@ -2961,35 +3081,30 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_staticText85->Wrap( -1 ); bSizer52->Add( m_staticText85, 0, 0, 5 ); - bSizer69->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); - wxStaticBoxSizer* sbSizer21; - sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( m_panel13, wxID_ANY, _("Example") ), wxVERTICAL ); + bSizer69->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); - wxBoxSizer* bSizer66; - bSizer66 = new wxBoxSizer( wxHORIZONTAL ); + wxStaticBoxSizer* sbSizer21; + sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( m_panel13, wxID_ANY, _("Example") ), wxHORIZONTAL ); m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: \\stuff\\temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText181->Wrap( -1 ); - bSizer66->Add( m_staticText181, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer21->Add( m_staticText181, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); m_staticText1811 = new wxStaticText( m_panel13, wxID_ANY, _("Synchronize all .doc, .zip and .exe files except everything in subfolder \"temp\"."), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1811->Wrap( 250 ); m_staticText1811->SetFont( wxFont( 8, 70, 93, 90, false, wxEmptyString ) ); - bSizer66->Add( m_staticText1811, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + sbSizer21->Add( m_staticText1811, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + - sbSizer21->Add( bSizer66, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bSizer69->Add( sbSizer21, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); - bSizer69->Add( sbSizer21, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); m_panel13->SetSizer( bSizer69 ); m_panel13->Layout(); bSizer69->Fit( m_panel13 ); - bSizer21->Add( m_panel13, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxEXPAND, 5 ); - - - bSizer21->Add( 0, 0, 0, 0, 5 ); + bSizer21->Add( m_panel13, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer159; bSizer159 = new wxBoxSizer( wxHORIZONTAL ); @@ -3006,6 +3121,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_textCtrlInclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); sbSizer8->Add( m_textCtrlInclude, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer166->Add( sbSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer26; @@ -3017,8 +3133,10 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_textCtrlExclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); sbSizer26->Add( m_textCtrlExclude, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer166->Add( sbSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer159->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); @@ -3028,7 +3146,7 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer160 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer25; - sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Date") ), wxHORIZONTAL ); + sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Time span") ), wxHORIZONTAL ); wxBoxSizer* bSizer169; bSizer169 = new wxBoxSizer( wxHORIZONTAL ); @@ -3039,33 +3157,31 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer165; bSizer165 = new wxBoxSizer( wxVERTICAL ); - m_staticText103 = new wxStaticText( this, wxID_ANY, _("Select time span"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText103->Wrap( -1 ); - bSizer165->Add( m_staticText103, 0, 0, 5 ); - wxBoxSizer* bSizer164; bSizer164 = new wxBoxSizer( wxVERTICAL ); + m_spinCtrlTimespan = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); + bSizer164->Add( m_spinCtrlTimespan, 0, wxALIGN_CENTER_VERTICAL, 5 ); + wxArrayString m_choiceUnitTimespanChoices; m_choiceUnitTimespan = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitTimespanChoices, 0 ); m_choiceUnitTimespan->SetSelection( 0 ); bSizer164->Add( m_choiceUnitTimespan, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_spinCtrlTimespan = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); - m_spinCtrlTimespan->Hide(); - - bSizer164->Add( m_spinCtrlTimespan, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer165->Add( bSizer164, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer169->Add( bSizer165, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer25->Add( bSizer169, 0, 0, 5 ); + bSizer160->Add( sbSizer25, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); wxStaticBoxSizer* sbSizer81; - sbSizer81 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Size") ), wxHORIZONTAL ); + sbSizer81 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("File size") ), wxHORIZONTAL ); wxBoxSizer* bSizer170; bSizer170 = new wxBoxSizer( wxHORIZONTAL ); @@ -3076,13 +3192,13 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer158; bSizer158 = new wxBoxSizer( wxVERTICAL ); - m_staticText101 = new wxStaticText( this, wxID_ANY, _("Minimum file size"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText101->Wrap( -1 ); - bSizer158->Add( m_staticText101, 0, 0, 5 ); - wxBoxSizer* bSizer162; bSizer162 = new wxBoxSizer( wxVERTICAL ); + m_staticText101 = new wxStaticText( this, wxID_ANY, _("Minimum"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText101->Wrap( -1 ); + bSizer162->Add( m_staticText101, 0, wxBOTTOM, 2 ); + m_spinCtrlMinSize = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); bSizer162->Add( m_spinCtrlMinSize, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -3091,15 +3207,16 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_choiceUnitMinSize->SetSelection( 0 ); bSizer162->Add( m_choiceUnitMinSize, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer158->Add( bSizer162, 0, wxBOTTOM, 5 ); - m_staticText102 = new wxStaticText( this, wxID_ANY, _("Maximum file size"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText102->Wrap( -1 ); - bSizer158->Add( m_staticText102, 0, 0, 5 ); + bSizer158->Add( bSizer162, 0, wxBOTTOM, 5 ); wxBoxSizer* bSizer163; bSizer163 = new wxBoxSizer( wxVERTICAL ); + m_staticText102 = new wxStaticText( this, wxID_ANY, _("Maximum"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText102->Wrap( -1 ); + bSizer163->Add( m_staticText102, 0, wxBOTTOM, 2 ); + m_spinCtrlMaxSize = new wxSpinCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); bSizer163->Add( m_spinCtrlMaxSize, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -3108,17 +3225,23 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w m_choiceUnitMaxSize->SetSelection( 0 ); bSizer163->Add( m_choiceUnitMaxSize, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer158->Add( bSizer163, 0, wxTOP, 5 ); + + bSizer158->Add( bSizer163, 0, 0, 5 ); + bSizer170->Add( bSizer158, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer81->Add( bSizer170, 0, 0, 5 ); + bSizer160->Add( sbSizer81, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer159->Add( bSizer160, 0, wxEXPAND, 5 ); - bSizer21->Add( bSizer159, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + bSizer21->Add( bSizer159, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer22; bSizer22 = new wxBoxSizer( wxHORIZONTAL ); @@ -3142,8 +3265,10 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer22->Add( m_button17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer21->Add( bSizer22, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxEXPAND, 5 ); + this->SetSizer( bSizer21 ); this->Layout(); bSizer21->Fit( this ); @@ -3179,86 +3304,6 @@ FilterDlgGenerated::~FilterDlgGenerated() } -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* 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") ); - - 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") ); - - 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_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button9, 0, wxALL, 5 ); - - - bSizer97->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_button28 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button28->SetDefault(); - m_button28->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer97->Add( m_button28, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button29, 0, wxALL, 5 ); - - bSizer96->Add( bSizer97, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - 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_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); - m_button28->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), 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_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); - m_button28->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), 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( wxSize( 280,230 ), wxDefaultSize ); @@ -3270,10 +3315,7 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind bSizer86 = new wxBoxSizer( wxHORIZONTAL ); m_bitmapSettings = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer86->Add( m_bitmapSettings, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer86->Add( m_bitmapSettings, 0, 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 ) ); @@ -3283,19 +3325,18 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Global settings"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText56->Wrap( -1 ); - m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + m_staticText56->SetFont( wxFont( 14, 70, 90, 92, false, wxEmptyString ) ); bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + m_panel8->SetSizer( bSizer72 ); m_panel8->Layout(); bSizer72->Fit( m_panel8 ); - bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bSizer95->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer95->Add( 0, 5, 0, 0, 5 ); + bSizer95->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbSizer23; sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -3327,30 +3368,13 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind sbSizer23->Add( m_staticText8211, 0, wxLEFT|wxEXPAND, 20 ); - bSizer95->Add( sbSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizer261; - sbSizer261 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + bSizer95->Add( sbSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizer101; - bSizer101 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText100 = new wxStaticText( this, wxID_ANY, _("Hidden dialogs:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText100->Wrap( -1 ); - bSizer101->Add( m_staticText100, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer101->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_buttonResetDialogs = new zen::BitmapButton( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxSize( 80,-1 ), 0 ); + m_buttonResetDialogs = new zen::BitmapButton( this, wxID_ANY, _("Restore hidden dialogs"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_buttonResetDialogs->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - m_buttonResetDialogs->SetToolTip( _("Show hidden dialogs") ); - - bSizer101->Add( m_buttonResetDialogs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - sbSizer261->Add( bSizer101, 0, wxEXPAND, 5 ); - bSizer95->Add( sbSizer261, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + bSizer95->Add( m_buttonResetDialogs, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); wxStaticBoxSizer* sbSizer26; sbSizer26 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("External applications") ), wxHORIZONTAL ); @@ -3379,8 +3403,8 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind // Rows m_gridCustomCommand->EnableDragRowSize( false ); - m_gridCustomCommand->SetRowLabelSize( 0 ); - m_gridCustomCommand->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + m_gridCustomCommand->SetRowLabelSize( 1 ); + m_gridCustomCommand->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); // Label Appearance @@ -3397,12 +3421,14 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind m_bpButtonRemoveRow = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); bSizer157->Add( m_bpButtonRemoveRow, 0, 0, 5 ); + sbSizer26->Add( bSizer157, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); sbSizer26->Add( 5, 0, 0, 0, 5 ); - bSizer95->Add( sbSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + bSizer95->Add( sbSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer97; bSizer97 = new wxBoxSizer( wxHORIZONTAL ); @@ -3410,7 +3436,7 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer97->Add( m_button9, 0, wxALL, 5 ); + bSizer97->Add( m_button9, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); bSizer97->Add( 0, 0, 1, 0, 5 ); @@ -3419,15 +3445,17 @@ GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWind m_buttonOkay->SetDefault(); m_buttonOkay->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - bSizer97->Add( m_buttonOkay, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + bSizer97->Add( m_buttonOkay, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer97->Add( m_button29, 0, wxALL, 5 ); + bSizer97->Add( m_button29, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer95->Add( bSizer97, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + this->SetSizer( bSizer95 ); this->Layout(); bSizer95->Fit( this ); @@ -3467,10 +3495,10 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i m_buttonStartSync = new zen::BitmapButton( this, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); m_buttonStartSync->SetDefault(); - m_buttonStartSync->SetFont( wxFont( 14, 70, 90, 92, false, wxT("Arial Black") ) ); + m_buttonStartSync->SetFont( wxFont( 14, 70, 90, 92, false, wxEmptyString ) ); m_buttonStartSync->SetToolTip( _("Start synchronization") ); - bSizer158->Add( m_buttonStartSync, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer158->Add( m_buttonStartSync, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_staticline16 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); bSizer158->Add( m_staticline16, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); @@ -3480,12 +3508,14 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i m_staticTextVariant = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticTextVariant->Wrap( -1 ); - m_staticTextVariant->SetFont( wxFont( 10, 70, 90, 92, false, wxT("Arial Black") ) ); + m_staticTextVariant->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); sbSizer28->Add( m_staticTextVariant, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer158->Add( sbSizer28, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer134->Add( bSizer158, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); @@ -3520,7 +3550,7 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_textCtrlCreateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlCreateL->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlCreateL->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlCreateL->SetToolTip( _("Number of files and directories that will be created") ); fgSizer5->Add( m_textCtrlCreateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -3531,7 +3561,7 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i fgSizer5->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_textCtrlUpdateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlUpdateL->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlUpdateL->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlUpdateL->SetToolTip( _("Number of files that will be overwritten") ); fgSizer5->Add( m_textCtrlUpdateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -3542,11 +3572,12 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlDeleteL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlDeleteL->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlDeleteL->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlDeleteL->SetToolTip( _("Number of files and directories that will be deleted") ); fgSizer5->Add( m_textCtrlDeleteL, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer157->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); wxFlexGridSizer* fgSizer51; @@ -3561,25 +3592,27 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i fgSizer51->Add( m_staticText95, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlCreateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlCreateR->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlCreateR->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlCreateR->SetToolTip( _("Number of files and directories that will be created") ); fgSizer51->Add( m_textCtrlCreateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlUpdateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlUpdateR->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlUpdateR->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlUpdateR->SetToolTip( _("Number of files that will be overwritten") ); fgSizer51->Add( m_textCtrlUpdateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_textCtrlDeleteR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY|wxTE_RIGHT ); - m_textCtrlDeleteR->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlDeleteR->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlDeleteR->SetToolTip( _("Number of files and directories that will be deleted") ); fgSizer51->Add( m_textCtrlDeleteR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer157->Add( fgSizer51, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer161->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); @@ -3597,7 +3630,7 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); m_textCtrlData = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_CENTRE|wxTE_READONLY ); - m_textCtrlData->SetBackgroundColour( wxColour( 208, 208, 208 ) ); + m_textCtrlData->SetBackgroundColour( wxColour( 224, 224, 224 ) ); m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); bSizer156->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -3605,20 +3638,23 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer161->Add( bSizer156, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bSizer141->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + bSizer134->Add( bSizer141, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + bSizer134->Add( m_staticline12, 0, wxEXPAND|wxTOP, 5 ); wxBoxSizer* bSizer142; bSizer142 = new wxBoxSizer( wxHORIZONTAL ); m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer142->Add( m_checkBoxDontShowAgain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer142->Add( m_checkBoxDontShowAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); bSizer142->Add( 10, 0, 1, 0, 5 ); @@ -3626,10 +3662,12 @@ SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID i m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button16->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - bSizer142->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer142->Add( m_button16, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + bSizer134->Add( bSizer142, 0, wxEXPAND, 5 ); + this->SetSizer( bSizer134 ); this->Layout(); bSizer134->Fit( this ); @@ -3663,6 +3701,7 @@ PopupFrameGenerated1::PopupFrameGenerated1( wxWindow* parent, wxWindowID id, con m_staticTextMain->Wrap( 600 ); bSizer158->Add( m_staticTextMain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + this->SetSizer( bSizer158 ); this->Layout(); bSizer158->Fit( this ); @@ -3692,6 +3731,7 @@ SearchDialogGenerated::SearchDialogGenerated( wxWindow* parent, wxWindowID id, c m_textCtrlSearchTxt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 220,-1 ), 0 ); bSizer162->Add( m_textCtrlSearchTxt, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer166->Add( bSizer162, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); @@ -3700,6 +3740,7 @@ SearchDialogGenerated::SearchDialogGenerated( wxWindow* parent, wxWindowID id, c m_checkBoxMatchCase = new wxCheckBox( this, wxID_ANY, _("Match case"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer166->Add( m_checkBoxMatchCase, 0, wxALL, 5 ); + bSizer161->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxBoxSizer* bSizer97; @@ -3716,8 +3757,10 @@ SearchDialogGenerated::SearchDialogGenerated( wxWindow* parent, wxWindowID id, c bSizer97->Add( m_button29, 0, wxEXPAND|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bSizer161->Add( bSizer97, 0, wxALIGN_CENTER_VERTICAL, 5 ); + this->SetSizer( bSizer161 ); this->Layout(); bSizer161->Fit( this ); @@ -3755,6 +3798,7 @@ SelectTimespanDlgGenerated::SelectTimespanDlgGenerated( wxWindow* parent, wxWind m_calendarTo = new wxCalendarCtrl( this, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS ); bSizer98->Add( m_calendarTo, 0, wxALL, 5 ); + bSizer96->Add( bSizer98, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer97; @@ -3777,8 +3821,10 @@ SelectTimespanDlgGenerated::SelectTimespanDlgGenerated( wxWindow* parent, wxWind bSizer97->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer96->Add( bSizer97, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + this->SetSizer( bSizer96 ); this->Layout(); bSizer96->Fit( this ); diff --git a/ui/gui_generated.h b/ui/gui_generated.h index 4cc32873..8176dbf9 100644 --- a/ui/gui_generated.h +++ b/ui/gui_generated.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Dec 2 2011) +// C++ code generated with wxFormBuilder (version Mar 17 2012) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -11,15 +11,14 @@ #include <wx/artprov.h> #include <wx/xrc/xmlres.h> #include <wx/intl.h> -class ExecFinishedBox; -class FolderHistoryBox; -class ToggleButton; -class wxStaticText; -namespace zen { class BitmapButton; } -namespace zen { class DirPickerCtrl; } -namespace zen { class Graph2D; } -namespace zen { class Grid; } - +#include "wx_form_build_hide_warnings.h" +#include "../wx+/button.h" +#include "folder_history_box.h" +#include "../wx+/dir_picker.h" +#include "../wx+/grid.h" +#include "../wx+/toggle_button.h" +#include "exec_finished_box.h" +#include "../wx+/graph.h" #include <wx/string.h> #include <wx/bitmap.h> #include <wx/image.h> @@ -47,14 +46,14 @@ namespace zen { class Grid; } #include <wx/statbox.h> #include <wx/choice.h> #include <wx/spinctrl.h> -#include <wx/listbook.h> -#include <wx/listctrl.h> +#include <wx/notebook.h> #include <wx/dialog.h> #include <wx/radiobut.h> #include <wx/animate.h> +#include <wx/listbook.h> +#include <wx/listctrl.h> #include <wx/imaglist.h> #include <wx/hyperlink.h> -#include <wx/checklst.h> #include <wx/grid.h> #include <wx/calctrl.h> @@ -83,6 +82,7 @@ protected: wxMenuItem* m_menuItemGlobSett; wxMenuItem* m_menuItem7; wxMenu* m_menuHelp; + wxMenuItem* m_menuItemManual; wxMenuItem* m_menuItemCheckVer; wxMenuItem* m_menuItemAbout; wxBoxSizer* bSizerPanelHolder; @@ -294,7 +294,7 @@ protected: wxStaticText* m_staticText56; wxStaticText* m_staticText44; wxBitmapButton* m_bpButtonHelp; - wxListbook* m_listbook1; + wxNotebook* m_notebook1; wxPanel* m_panelOverview; wxBitmapButton* m_bpButtonCmpConfig; wxStaticText* m_staticTextCmpVariant; @@ -349,7 +349,7 @@ public: wxBitmapButton* m_bpButtonAltSyncCfg; FolderHistoryBox* m_comboBoxLogfileDir; - 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|wxRESIZE_BORDER ); + 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|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); ~BatchDlgGenerated(); }; @@ -524,24 +524,24 @@ protected: wxPanel* m_panelProgress; wxBoxSizer* bSizer171; wxStaticBoxSizer* bSizerProgressStat; - wxStaticText* m_staticTextItemsRem; - wxBoxSizer* bSizerItemsRem; - wxStaticText* m_staticTextRemainingObj; - wxStaticText* m_staticText96; - wxStaticText* m_staticTextDataRemaining; - wxStaticText* m_staticText97; - wxStaticText* m_staticTextItemsProc; + wxStaticText* m_staticTextLabelItemsProc; wxBoxSizer* bSizerItemsProc; wxStaticText* m_staticTextProcessedObj; wxStaticText* m_staticText98; wxStaticText* m_staticTextDataProcessed; wxStaticText* m_staticText99; - wxStaticText* m_staticTextSpeedDescr; - wxStaticText* m_staticTextSpeed; - wxStaticText* m_staticText55; + wxStaticText* m_staticTextLabelItemsRem; + wxBoxSizer* bSizerItemsRem; + wxStaticText* m_staticTextRemainingObj; + wxStaticText* m_staticText96; + wxStaticText* m_staticTextDataRemaining; + wxStaticText* m_staticText97; + wxStaticText* m_staticTextLabelElapsedTime; wxStaticText* m_staticTextTimeElapsed; - wxStaticText* m_staticTextRemTimeDescr; + wxStaticText* m_staticTextLabelRemTime; wxStaticText* m_staticTextRemTime; + wxStaticText* m_staticText84; + wxStaticText* m_staticTextSpeed; zen::Graph2D* m_panelGraph; wxBoxSizer* bSizerFinalStat; wxListbook* m_listbookResult; @@ -716,14 +716,13 @@ private: protected: wxStaticBitmap* m_bitmap10; wxTextCtrl* m_textCtrl8; - wxCheckBox* m_checkBoxDontAskAgain; + wxCheckBox* m_checkBox; wxButton* m_buttonYes; wxButton* m_buttonNo; wxButton* m_buttonCancel; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnCheckBoxDontShowAgain( wxCommandEvent& event ) { event.Skip(); } virtual void OnYes( wxCommandEvent& event ) { event.Skip(); } virtual void OnNo( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } @@ -747,22 +746,22 @@ protected: wxStaticBitmap* m_bitmap12; wxStaticText* m_staticTextHeader; wxTextCtrl* m_textCtrlMessage; - wxCheckBox* m_checkBoxDeleteBothSides; wxCheckBox* m_checkBoxUseRecycler; + wxCheckBox* m_checkBoxDeleteBothSides; wxButton* m_buttonOK; wxButton* m_buttonCancel; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnDelOnBothSides( wxCommandEvent& event ) { event.Skip(); } virtual void OnUseRecycler( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDelOnBothSides( wxCommandEvent& event ) { event.Skip(); } virtual void OnOK( wxCommandEvent& event ) { event.Skip(); } virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } public: - DeleteDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); + DeleteDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 560,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxMINIMIZE_BOX|wxRESIZE_BORDER ); ~DeleteDlgGenerated(); }; @@ -793,9 +792,8 @@ protected: wxStaticBitmap* m_bitmapExclude; wxTextCtrl* m_textCtrlExclude; wxStaticBitmap* m_bitmapFilterDate; - wxStaticText* m_staticText103; - wxChoice* m_choiceUnitTimespan; wxSpinCtrl* m_spinCtrlTimespan; + wxChoice* m_choiceUnitTimespan; wxStaticBitmap* m_bitmapFilterSize; wxStaticText* m_staticText101; wxSpinCtrl* m_spinCtrlMinSize; @@ -825,37 +823,6 @@ public: }; /////////////////////////////////////////////////////////////////////////////// -/// Class CustomizeColsDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class CustomizeColsDlgGenerated : public wxDialog -{ -private: - -protected: - wxCheckListBox* m_checkListColumns; - wxBitmapButton* m_bpButton29; - wxBitmapButton* m_bpButton30; - wxButton* m_button9; - wxButton* m_button28; - 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 OnDefault( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkay( 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 @@ -872,7 +839,6 @@ protected: wxStaticText* m_staticTextCopyLocked; wxCheckBox* m_checkBoxCopyPermissions; wxStaticText* m_staticText8211; - wxStaticText* m_staticText100; zen::BitmapButton* m_buttonResetDialogs; wxGrid* m_gridCustomCommand; wxBitmapButton* m_bpButtonAddRow; diff --git a/ui/gui_status_handler.cpp b/ui/gui_status_handler.cpp index 42c50671..6e3c08a0 100644 --- a/ui/gui_status_handler.cpp +++ b/ui/gui_status_handler.cpp @@ -31,11 +31,12 @@ CompareStatusHandler::CompareStatusHandler(MainDialog& dlg) : //display status panel during compare mainDlg.auiMgr.GetPane(mainDlg.compareStatus->getAsWindow()).Show(); mainDlg.auiMgr.Update(); + mainDlg.compareStatus->updateStatusPanelNow(); //clear gui flicker: window must be visible to make this work! //register abort button - mainDlg.m_buttonAbort->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompareStatusHandler::OnAbortCompare), NULL, this); + mainDlg.m_buttonAbort->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompareStatusHandler::OnAbortCompare), nullptr, this); //register key event - mainDlg.Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), NULL, this); + mainDlg.Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), nullptr, this); } @@ -54,8 +55,8 @@ CompareStatusHandler::~CompareStatusHandler() mainDlg.pushStatusInformation(_("Operation aborted!")); //de-register keys - mainDlg.Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), NULL, this); - mainDlg.m_buttonAbort->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompareStatusHandler::OnAbortCompare), NULL, this); + mainDlg.Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), nullptr, this); + mainDlg.m_buttonAbort->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompareStatusHandler::OnAbortCompare), nullptr, this); } @@ -169,7 +170,7 @@ void CompareStatusHandler::reportFatalError(const std::wstring& errorMessage) forceUiRefresh(); showErrorDlg(ReturnErrorDlg::BUTTON_ABORT, - errorMessage, NULL); + errorMessage, nullptr); } @@ -233,7 +234,7 @@ SyncStatusHandler::SyncStatusHandler(MainDialog* parentDlg, SyncStatusHandler::~SyncStatusHandler() { - const int totalErrors = errorLog.typeCount(TYPE_ERROR | TYPE_FATAL_ERROR); //evaluate before finalizing log + const int totalErrors = errorLog.getItemCount(TYPE_ERROR | TYPE_FATAL_ERROR); //evaluate before finalizing log //finalize error log if (abortIsRequested()) diff --git a/ui/gui_status_handler.h b/ui/gui_status_handler.h index 1977e265..4e289648 100644 --- a/ui/gui_status_handler.h +++ b/ui/gui_status_handler.h @@ -7,10 +7,10 @@ #ifndef GUISTATUSHANDLER_H_INCLUDED #define GUISTATUSHANDLER_H_INCLUDED -#include "../lib/status_handler.h" #include <wx/event.h> -#include "../lib/error_log.h" +#include <zen/error_log.h> #include "progress_indicator.h" +#include "../lib/status_handler.h" #include "../lib/process_xml.h" #include "main_dlg.h" @@ -76,7 +76,7 @@ private: MainDialog* parentDlg_; SyncStatus syncStatusFrame; //the window managed by SyncStatus has longer lifetime than this handler! xmlAccess::OnGuiError handleError_; - zen::ErrorLogging errorLog; + zen::ErrorLog errorLog; }; diff --git a/ui/main_dlg.cpp b/ui/main_dlg.cpp index 24f1b06e..85f9a580 100644 --- a/ui/main_dlg.cpp +++ b/ui/main_dlg.cpp @@ -56,7 +56,6 @@ #include <wx+/no_flicker.h> #include <wx+/grid.h> - using namespace zen; using namespace std::rel_ops; @@ -69,8 +68,24 @@ struct wxClientDataString : public wxClientData //we need a wxClientData derived wxString name_; }; + +IconBuffer::IconSize convert(xmlAccess::FileIconSize isize) +{ + using namespace xmlAccess; + switch (isize) + { + case ICON_SIZE_SMALL: + return IconBuffer::SIZE_SMALL; + case ICON_SIZE_MEDIUM: + return IconBuffer::SIZE_MEDIUM; + case ICON_SIZE_LARGE: + return IconBuffer::SIZE_LARGE; + } + return IconBuffer::SIZE_SMALL; +} } + class DirectoryNameMainImpl : public DirectoryName<FolderHistoryBox> { public: @@ -159,20 +174,9 @@ private: return &mainDlg; } - virtual MainConfiguration getMainConfig() const - { - return mainDlg.getConfig().mainCfg; - } - - virtual void OnAltCompCfgChange() - { - mainDlg.applyCompareConfig(false); //false: do not change preview status - } - - virtual void OnAltSyncCfgChange() - { - mainDlg.applySyncConfig(); - } + virtual MainConfiguration getMainConfig() const { return mainDlg.getConfig().mainCfg; } + virtual void OnAltCompCfgChange() { mainDlg.applyCompareConfig(false); } //false: do not change preview status + virtual void OnAltSyncCfgChange() { mainDlg.applySyncConfig(); } virtual void removeAltCompCfg() { @@ -181,16 +185,12 @@ private: } virtual void removeAltSyncCfg() - { FolderPairPanelBasic<GuiPanel>::removeAltSyncCfg(); mainDlg.applySyncConfig(); } - virtual void OnLocalFilterCfgChange() - { - mainDlg.applyFilterConfig(); //re-apply filter - } + virtual void OnLocalFilterCfgChange() { mainDlg.applyFilterConfig(); } //re-apply filter virtual void removeLocalFilterCfg() { @@ -350,7 +350,7 @@ private: //################################################################################################################################## MainDialog::MainDialog(const std::vector<wxString>& cfgFileNames, xmlAccess::XmlGlobalSettings& settings) : - MainDialogGenerated(NULL) + MainDialogGenerated(nullptr) { xmlAccess::XmlGuiConfig guiCfg; //structure to receive gui settings, already defaulted!! @@ -376,7 +376,7 @@ MainDialog::MainDialog(const std::vector<wxString>& cfgFileNames, xmlAccess::Xml //------------------------------------------------------------------------------------------ //check if one of the files is not existing (this shall not be an error!) - const bool allFilesExist = std::find_if(fileEx.begin(), fileEx.end(), [](boost::unique_future<bool>& ft) { return !ft.is_ready() || !ft.get(); }) == fileEx.end(); + const bool allFilesExist = std::all_of(fileEx.begin(), fileEx.end(), [](boost::unique_future<bool>& ft) { return ft.is_ready() && ft.get(); }); if (!allFilesExist) filenames.clear(); @@ -417,7 +417,7 @@ MainDialog::MainDialog(const std::vector<wxString>& referenceFiles, const xmlAccess::XmlGuiConfig& guiCfg, xmlAccess::XmlGlobalSettings& settings, bool startComparison) : - MainDialogGenerated(NULL) + MainDialogGenerated(nullptr) { init(guiCfg, settings, @@ -429,6 +429,8 @@ MainDialog::MainDialog(const std::vector<wxString>& referenceFiles, MainDialog::~MainDialog() { + wxWindowUpdateLocker dummy(this); + writeGlobalSettings(); //set before saving last used config since "activeConfigFiles" will be replaced //save "LastRun.ffs_gui" configuration @@ -442,8 +444,8 @@ MainDialog::~MainDialog() catch (const xmlAccess::FfsXmlError&) {} //important! event source wxTheApp is NOT dependent on this instance -> disconnect! - wxTheApp->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), NULL, this); - wxTheApp->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), NULL, this); + wxTheApp->Disconnect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), nullptr, this); + wxTheApp->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), nullptr, this); //no need for wxEventHandler::Disconnect() here; event sources are components of this window and are destroyed, too @@ -509,7 +511,7 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig& guiCfg, wxAuiPaneInfo().Name(wxT("Panel3")).CenterPane().PaneBorder(false)); auiMgr.AddPane(m_gridNavi, - wxAuiPaneInfo().Name(L"Panel10").Left().Layer(3).Caption(_("Compressed view")).MinSize(350, m_gridNavi->GetSize().GetHeight())); //MinSize(): just default size, see comment below + wxAuiPaneInfo().Name(L"Panel10").Left().Layer(3).Caption(_("Overview")).MinSize(350, m_gridNavi->GetSize().GetHeight())); //MinSize(): just default size, see comment below auiMgr.AddPane(m_panelConfig, wxAuiPaneInfo().Name(wxT("Panel4")).Layer(4).Bottom().Row(1).Position(0).Caption(_("Configuration")).MinSize(m_listBoxHistory->GetSize().GetWidth(), m_panelConfig->GetSize().GetHeight())); @@ -534,31 +536,30 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig& guiCfg, defaultPerspective = auiMgr.SavePerspective(); //---------------------------------------------------------------------------------- //register view layout context menu - m_panelTopButtons->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); - m_panelConfig ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); - m_panelFilter ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); - m_panelViewFilter->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); - m_panelStatistics->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); - m_panelStatusBar ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); + m_panelTopButtons->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), nullptr, this); + m_panelConfig ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), nullptr, this); + m_panelFilter ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), nullptr, this); + m_panelViewFilter->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), nullptr, this); + m_panelStatistics->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), nullptr, this); + m_panelStatusBar ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), nullptr, this); //---------------------------------------------------------------------------------- //register context: quick variant selection - m_bpButtonCmpConfig ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnCompSettingsContext), NULL, this); - m_bpButtonSyncConfig->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnSyncSettingsContext), NULL, this); - m_bpButtonFilter ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(MainDialog::OnGlobalFilterContext), NULL, this); + m_bpButtonCmpConfig ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnCompSettingsContext), nullptr, this); + m_bpButtonSyncConfig->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnSyncSettingsContext), nullptr, this); + m_bpButtonFilter ->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(MainDialog::OnGlobalFilterContext), nullptr, this); //sort grids - m_gridMain->Connect(EVENT_GRID_COL_LABEL_MOUSE_LEFT, GridClickEventHandler(MainDialog::onGridLabelLeftClick ), NULL, this ); - m_gridMain->Connect(EVENT_GRID_COL_LABEL_MOUSE_RIGHT, GridClickEventHandler(MainDialog::onGridLabelContext), NULL, this ); + m_gridMain->Connect(EVENT_GRID_COL_LABEL_MOUSE_LEFT, GridClickEventHandler(MainDialog::onGridLabelLeftClick ), nullptr, this ); + m_gridMain->Connect(EVENT_GRID_COL_LABEL_MOUSE_RIGHT, GridClickEventHandler(MainDialog::onGridLabelContext), nullptr, this ); //grid context menu - m_gridMain->Connect(EVENT_GRID_MOUSE_RIGHT_UP, GridClickEventHandler(MainDialog::onMainGridContext), NULL, this); - m_gridNavi->Connect(EVENT_GRID_MOUSE_RIGHT_UP, GridClickEventHandler(MainDialog::onNaviGridContext), NULL, this); - - m_gridMain->Connect(EVENT_GRID_MOUSE_LEFT_DOUBLE, GridClickEventHandler(MainDialog::onGridDoubleClick), NULL, this ); + m_gridMain->Connect(EVENT_GRID_MOUSE_RIGHT_UP, GridClickEventHandler(MainDialog::onMainGridContext), nullptr, this); + m_gridNavi->Connect(EVENT_GRID_MOUSE_RIGHT_UP, GridClickEventHandler(MainDialog::onNaviGridContext), nullptr, this); - m_gridNavi->Connect(EVENT_GRID_SELECT_RANGE, GridRangeSelectEventHandler(MainDialog::onNaviSelection), NULL, this); + m_gridMain->Connect(EVENT_GRID_MOUSE_LEFT_DOUBLE, GridClickEventHandler(MainDialog::onGridDoubleClick), nullptr, this ); + m_gridNavi->Connect(EVENT_GRID_SELECT_RANGE, GridRangeSelectEventHandler(MainDialog::onNaviSelection), nullptr, this); globalSettings = &settings; gridDataView.reset(new zen::GridView); @@ -619,20 +620,20 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig& guiCfg, MenuItemUpdater updateMenuFile(*m_menuFile); updateMenuFile.markForUpdate(m_menuItem10, GlobalResources::getImage(wxT("compareSmall"))); updateMenuFile.markForUpdate(m_menuItem11, GlobalResources::getImage(wxT("syncSmall"))); - updateMenuFile.markForUpdate(m_menuItemNew, GlobalResources::getImage(wxT("newSmall"))); + //updateMenuFile.markForUpdate(m_menuItemNew, GlobalResources::getImage(wxT("newSmall"))); updateMenuFile.markForUpdate(m_menuItemSave, GlobalResources::getImage(wxT("saveSmall"))); updateMenuFile.markForUpdate(m_menuItemLoad, GlobalResources::getImage(wxT("loadSmall"))); MenuItemUpdater updateMenuAdv(*m_menuAdvanced); - updateMenuAdv.markForUpdate(m_menuItemGlobSett, GlobalResources::getImage(wxT("settingsSmall"))); - updateMenuAdv.markForUpdate(m_menuItem7, GlobalResources::getImage(wxT("batchSmall"))); + updateMenuAdv.markForUpdate(m_menuItemGlobSett, GlobalResources::getImage(L"settingsSmall")); + updateMenuAdv.markForUpdate(m_menuItem7, GlobalResources::getImage(L"batchSmall")); MenuItemUpdater updateMenuHelp(*m_menuHelp); - updateMenuHelp.markForUpdate(m_menuItemAbout, GlobalResources::getImage(wxT("aboutSmall"))); + updateMenuHelp.markForUpdate(m_menuItemManual, GlobalResources::getImage(L"helpSmall")); + updateMenuHelp.markForUpdate(m_menuItemAbout, GlobalResources::getImage(L"aboutSmall")); #ifdef FFS_LINUX - if (!zen::isPortableVersion()) //disable update check for Linux installer-based version -> handled by .deb - m_menuItemCheckVer->Enable(false); + m_menuItemCheckVer->Enable(zen::isPortableVersion()); //disable update check for Linux installer-based version -> handled by .deb #endif //create language selection menu @@ -651,46 +652,46 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig& guiCfg, }); //support for CTRL + C and DEL on grids - m_gridMain->getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridButtonEvent), NULL, this); - m_gridNavi->getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onTreeButtonEvent), NULL, this); + m_gridMain->getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridButtonEvent), nullptr, this); + m_gridNavi->getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onTreeButtonEvent), nullptr, this); //register global hotkeys (without explicit menu entry) - wxTheApp->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), NULL, this); - wxTheApp->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), NULL, this); //capture direction keys + wxTheApp->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), nullptr, this); + wxTheApp->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), nullptr, this); //capture direction keys //drag & drop on navi panel setupFileDrop(*m_gridNavi); - m_gridNavi->Connect(EVENT_DROP_FILE, FileDropEventHandler(MainDialog::onNaviPanelFilesDropped), NULL, this); + m_gridNavi->Connect(EVENT_DROP_FILE, FileDropEventHandler(MainDialog::onNaviPanelFilesDropped), nullptr, this); - Connect(wxEVT_IDLE, wxEventHandler(MainDialog::OnIdleEvent), NULL, this); + Connect(wxEVT_IDLE, wxEventHandler(MainDialog::OnIdleEvent), nullptr, this); - Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); - Connect(wxEVT_MOVE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); + //Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResize), nullptr, this); + //Connect(wxEVT_MOVE, wxSizeEventHandler(MainDialog::OnResize), nullptr, this); //calculate witdh of folder pair manually (if scrollbars are visible) - m_panelTopLeft->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeFolderPairs), NULL, this); + m_panelTopLeft->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeFolderPairs), nullptr, this); //dynamically change sizer direction depending on size - m_panelConfig ->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeConfigPanel), NULL, this); - m_panelViewFilter->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeViewPanel), NULL, this); - m_panelStatistics->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeStatisticsPanel), NULL, this); + m_panelConfig ->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeConfigPanel), nullptr, this); + m_panelViewFilter->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeViewPanel), nullptr, this); + m_panelStatistics->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeStatisticsPanel), nullptr, this); wxSizeEvent dummy3; OnResizeConfigPanel (dummy3); //call once on window creation OnResizeViewPanel (dummy3); // OnResizeStatisticsPanel(dummy3); // //event handler for manual (un-)checking of rows and setting of sync direction - m_gridMain->Connect(EVENT_GRID_CHECK_ROWS, CheckRowsEventHandler (MainDialog::onCheckRows), NULL, this); - m_gridMain->Connect(EVENT_GRID_SYNC_DIRECTION, SyncDirectionEventHandler(MainDialog::onSetSyncDirection), NULL, this); + m_gridMain->Connect(EVENT_GRID_CHECK_ROWS, CheckRowsEventHandler (MainDialog::onCheckRows), nullptr, this); + m_gridMain->Connect(EVENT_GRID_SYNC_DIRECTION, SyncDirectionEventHandler(MainDialog::onSetSyncDirection), nullptr, this); //mainly to update row label sizes... updateGui(); //register regular check for update on next idle event - Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), NULL, this); + Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), nullptr, this); //asynchronous call to wxWindow::Layout(): fix superfluous frame on right and bottom when FFS is started in fullscreen mode - Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); + Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), nullptr, this); wxCommandEvent evtDummy; //call once before OnLayoutWindowAsync() OnResizeFolderPairs(evtDummy); // @@ -723,8 +724,7 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig& guiCfg, wait_for_all_timed(dirEx.begin(), dirEx.end(), boost::posix_time::milliseconds(500)); //------------------------------------------------------------------------------------------ - const bool allFoldersExist = std::find_if(dirEx.begin(), dirEx.end(), [](boost::unique_future<bool>& ft) { return !ft.is_ready() || !ft.get(); }) == dirEx.end(); - + const bool allFoldersExist = std::all_of(dirEx.begin(), dirEx.end(), [](boost::unique_future<bool>& ft) { return ft.is_ready() && ft.get(); }); if (allFoldersExist) { wxCommandEvent dummy2(wxEVT_COMMAND_BUTTON_CLICKED); @@ -738,13 +738,13 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig& guiCfg, void MainDialog::readGlobalSettings() { - //apply window size and position at program startup ONLY - //apply window size and position - if (globalSettings->gui.dlgSize.GetWidth () != wxDefaultCoord && - globalSettings->gui.dlgSize.GetHeight() != wxDefaultCoord && - globalSettings->gui.dlgPos.x != wxDefaultCoord && - globalSettings->gui.dlgPos.y != wxDefaultCoord && - wxDisplay::GetFromPoint(globalSettings->gui.dlgPos) != wxNOT_FOUND) //make sure upper left corner is in visible view + //set dialog size and position: test ALL parameters at once, since width/height are invalid if the window is minimized (eg x,y == -32000; height = 28, width = 160) + //note: negative values for x and y are possible when using multiple monitors! + if (globalSettings->gui.dlgSize.GetWidth () > 0 && + globalSettings->gui.dlgSize.GetHeight() > 0 && + globalSettings->gui.dlgPos.x >= -3360 && + globalSettings->gui.dlgPos.y >= -200) + //wxDisplay::GetFromPoint(globalSettings->gui.dlgPos) != wxNOT_FOUND) //make sure upper left corner is in visible view -> not required SetSize(wxRect(globalSettings->gui.dlgPos, globalSettings->gui.dlgSize)); else Centre(); @@ -770,20 +770,7 @@ void MainDialog::readGlobalSettings() *folderHistoryRight = FolderHistory(globalSettings->gui.folderHistoryRight, globalSettings->gui.folderHistMax); //show/hide file icons - const IconBuffer::IconSize sz = [&]() -> IconBuffer::IconSize - { - switch (globalSettings->gui.iconSize) - { - case xmlAccess::ICON_SIZE_SMALL: - return IconBuffer::SIZE_SMALL; - case xmlAccess::ICON_SIZE_MEDIUM: - return IconBuffer::SIZE_MEDIUM; - case xmlAccess::ICON_SIZE_LARGE: - return IconBuffer::SIZE_LARGE; - } - return IconBuffer::SIZE_SMALL; - }(); - gridview::setIconSize(*m_gridMain, sz); + gridview::setupIcons(*m_gridMain, globalSettings->gui.showIcons, convert(globalSettings->gui.iconSize)); //------------------------------------------------------------------------------------------------ //wxAuiManager erroneously loads panel captions, we don't want that @@ -805,7 +792,16 @@ void MainDialog::readGlobalSettings() void MainDialog::writeGlobalSettings() { //write global settings to (global) variable stored in application instance - globalSettings->gui.isMaximized = IsMaximized(); + if (IsIconized()) //we need to (reliably) retrieve non-iconized, non-maximized size and position + Iconize(false); + + globalSettings->gui.isMaximized = IsMaximized(); //evaluate AFTER uniconizing! + + if (IsMaximized()) + Maximize(false); + + globalSettings->gui.dlgSize = GetSize(); + globalSettings->gui.dlgPos = GetPosition(); //retrieve column attributes globalSettings->gui.columnAttribLeft = gridview::convertConfig(m_gridMain->getColumnConfig(gridview::COMP_LEFT)); @@ -909,9 +905,9 @@ void MainDialog::copySelectionToClipboard() vector_remove_if(colAttr, [](const Grid::ColumnAttribute& ca) { return !ca.visible_; }); if (!colAttr.empty()) { - const std::vector<int> selection = m_gridMain->getSelectedRows(compPos); + const std::vector<size_t> selection = m_gridMain->getSelectedRows(compPos); std::for_each(selection.begin(), selection.end(), - [&](int row) + [&](size_t row) { std::for_each(colAttr.begin(), colAttr.end() - 1, [&](const Grid::ColumnAttribute& ca) @@ -945,7 +941,7 @@ std::vector<FileSystemObject*> MainDialog::getGridSelection(bool fromLeft, bool auto addSelection = [&](size_t compPos) { - const std::vector<int>& sel = m_gridMain->getSelectedRows(compPos); + const std::vector<size_t>& sel = m_gridMain->getSelectedRows(compPos); selectedRows.insert(sel.begin(), sel.end()); }; @@ -963,11 +959,11 @@ std::vector<FileSystemObject*> MainDialog::getGridSelection(bool fromLeft, bool std::vector<FileSystemObject*> MainDialog::getTreeSelection() const { - const std::vector<int>& sel = m_gridNavi->getSelectedRows(); + const std::vector<size_t>& sel = m_gridNavi->getSelectedRows(); std::vector<FileSystemObject*> output; std::for_each(sel.begin(), sel.end(), - [&](int row) + [&](size_t row) { if (std::unique_ptr<TreeView::Node> node = treeDataView->getLine(row)) { @@ -1004,15 +1000,15 @@ public: mainDlg->clearStatusBar(); //register abort button - mainDlg->m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortDeletion), NULL, this ); - mainDlg->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(ManualDeletionHandler::OnKeyPressed), NULL, this); + mainDlg->m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortDeletion), nullptr, this ); + mainDlg->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(ManualDeletionHandler::OnKeyPressed), nullptr, this); } ~ManualDeletionHandler() { //de-register abort button - mainDlg->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(ManualDeletionHandler::OnKeyPressed), NULL, this); - mainDlg->m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortDeletion ), NULL, this ); + mainDlg->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(ManualDeletionHandler::OnKeyPressed), nullptr, this); + mainDlg->m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortDeletion ), nullptr, this ); mainDlg->enableAllElements(); } @@ -1096,7 +1092,7 @@ void MainDialog::deleteSelectedFiles(const std::vector<FileSystemObject*>& selec if (!selectionLeft.empty() || !selectionRight.empty()) { wxWindow* oldFocus = wxWindow::FindFocus(); - ZEN_ON_BLOCK_EXIT( if (oldFocus) oldFocus->SetFocus(); ) + ZEN_ON_SCOPE_EXIT( if (oldFocus) oldFocus->SetFocus(); ) if (zen::showDeleteDialog(selectionLeft, selectionRight, @@ -1307,27 +1303,6 @@ void MainDialog::enableAllElements() } -void MainDialog::OnResize(wxSizeEvent& event) -{ - if (!IsMaximized()) - { - wxSize sz = GetSize(); - wxPoint ps = GetPosition(); - - //test ALL parameters at once, since width/height are invalid if the window is minimized (eg x,y == -32000; height = 28, width = 160) - //note: negative values for x and y are possible when using multiple monitors! - if (sz.GetWidth() > 0 && sz.GetHeight() > 0 && ps.x >= -3360 && ps.y >= -200 && - wxDisplay::GetFromPoint(ps) != wxNOT_FOUND) //make sure upper left corner is in visible view - { - globalSettings->gui.dlgSize = sz; - globalSettings->gui.dlgPos = ps; - } - } - - event.Skip(); -} - - namespace { void updateSizerOrientation(wxBoxSizer& sizer, wxWindow& window) @@ -1515,7 +1490,7 @@ void MainDialog::onGridButtonEvent(wxKeyEvent& event) { const wxString commandline = globalSettings->gui.externelApplications[0].second; //open with first external application auto cursorPos = m_gridMain->getGridCursor(); - const int row = cursorPos.first; + const size_t row = cursorPos.first; const size_t compPos = cursorPos.second; openExternalApplication(gridDataView->getObject(row), compPos == gridview::COMP_LEFT, commandline); } @@ -1528,8 +1503,8 @@ void MainDialog::onGridButtonEvent(wxKeyEvent& event) bool isPartOf(const wxWindow* child, const wxWindow* top) { - for (const wxWindow* i = child; i != NULL; i = i->GetParent()) - if (i == top) + for (const wxWindow* wnd = child; wnd != nullptr; wnd = wnd->GetParent()) + if (wnd == top) return true; return false; } @@ -1550,7 +1525,7 @@ void MainDialog::OnGlobalKeyEvent(wxKeyEvent& event) //process key events withou } processingGlobalKeyEvent = true; - ZEN_ON_BLOCK_EXIT(processingGlobalKeyEvent = false;) + ZEN_ON_SCOPE_EXIT(processingGlobalKeyEvent = false;) //---------------------------------------------------- const int keyCode = event.GetKeyCode(); @@ -1571,6 +1546,10 @@ void MainDialog::OnGlobalKeyEvent(wxKeyEvent& event) //process key events withou zen::findNext(*this, *m_gridMain, gridview::COMP_LEFT, gridview::COMP_RIGHT, globalSettings->gui.textSearchRespectCase); return; //-> swallow event! + case WXK_F8: //F8 + enablePreview(!syncPreviewEnabled); + return; //-> swallow event! + //redirect certain (unhandled) keys directly to grid! case WXK_UP: case WXK_DOWN: @@ -1636,9 +1615,9 @@ void MainDialog::onNaviSelection(GridRangeSelectEvent& event) std::vector<const HierarchyObject*> markedFiles; //mark files/symlinks directly within a container std::vector<const HierarchyObject*> markedContainer; //mark full container including child-objects - const std::vector<int>& selection = m_gridNavi->getSelectedRows(); + const std::vector<size_t>& selection = m_gridNavi->getSelectedRows(); std::for_each(selection.begin(), selection.end(), - [&](int row) + [&](size_t row) { if (std::unique_ptr<TreeView::Node> node = treeDataView->getLine(row)) { @@ -1665,12 +1644,12 @@ void MainDialog::onNaviGridContext(GridClickEvent& event) //---------------------------------------------------------------------------------------------------- if (syncPreviewEnabled && !selection.empty()) - //std::find_if(selection.begin(), selection.end(), [](const FileSystemObject* fsObj){ return fsObj->getSyncOperation() != SO_EQUAL; }) != selection.end()) -> doesn't consider directories + //std::any_of(selection.begin(), selection.end(), [](const FileSystemObject* fsObj){ return fsObj->getSyncOperation() != SO_EQUAL; })) -> doesn't consider directories { auto getImage = [&](SyncDirection dir, SyncOperation soDefault) { return mirrorIfRtl(getSyncOpImage(selection[0]->getSyncOperation() != SO_EQUAL ? - selection[0]->testSyncOperation(dir, true) : soDefault)); + selection[0]->testSyncOperation(dir) : soDefault)); }; const wxBitmap opRight = getImage(SYNC_DIR_RIGHT, SO_OVERWRITE_RIGHT); const wxBitmap opNone = getImage(SYNC_DIR_NONE, SO_DO_NOTHING ); @@ -1697,23 +1676,23 @@ void MainDialog::onNaviGridContext(GridClickEvent& event) menu.addItem(_("Include temporarily") + L"\tSpace", [this, &selection] { setManualFilter(selection, true); }, &GlobalResources::getImage(L"checkboxTrue")); } else - menu.addItem(_("Exclude temporarily") + L"\tSpace", [] {}, NULL, false); + menu.addItem(_("Exclude temporarily") + L"\tSpace", [] {}, nullptr, false); //---------------------------------------------------------------------------------------------------- //CONTEXT_EXCLUDE_OBJ if (selection.size() == 1) menu.addItem(_("Exclude via filter:") + L" " + afterLast(selection[0]->getObjRelativeName(), FILE_NAME_SEPARATOR), [this, &selection] { excludeItems(selection); }, - &GlobalResources::getImage(L"filterSmall")); + &GlobalResources::getImage(L"filterOnSmall")); else if (selection.size() > 1) menu.addItem(_("Exclude via filter:") + L" " + _("<multiple selection>"), [this, &selection] { excludeItems(selection); }, - &GlobalResources::getImage(L"filterSmall")); + &GlobalResources::getImage(L"filterOnSmall")); //---------------------------------------------------------------------------------------------------- //CONTEXT_DELETE_FILES menu.addSeparator(); - menu.addItem(_("Delete") + L"\tDel", [&] { deleteSelectedFiles(selection, selection); }, NULL, !selection.empty()); + menu.addItem(_("Delete") + L"\tDel", [&] { deleteSelectedFiles(selection, selection); }, nullptr, !selection.empty()); menu.popup(*this); } @@ -1734,7 +1713,7 @@ void MainDialog::onMainGridContext(GridClickEvent& event) auto getImage = [&](SyncDirection dir, SyncOperation soDefault) { return mirrorIfRtl(getSyncOpImage(selection[0]->getSyncOperation() != SO_EQUAL ? - selection[0]->testSyncOperation(dir, true) : soDefault)); + selection[0]->testSyncOperation(dir) : soDefault)); }; const wxBitmap opRight = getImage(SYNC_DIR_RIGHT, SO_OVERWRITE_RIGHT); const wxBitmap opNone = getImage(SYNC_DIR_NONE, SO_DO_NOTHING ); @@ -1761,12 +1740,12 @@ void MainDialog::onMainGridContext(GridClickEvent& event) menu.addItem(_("Include temporarily") + L"\tSpace", [this, &selection] { setManualFilter(selection, true); }, &GlobalResources::getImage(L"checkboxTrue")); } else - menu.addItem(_("Exclude temporarily") + L"\tSpace", [] {}, NULL, false); + menu.addItem(_("Exclude temporarily") + L"\tSpace", [] {}, nullptr, false); //---------------------------------------------------------------------------------------------------- //CONTEXT_EXCLUDE_EXT if (!selection.empty() && - dynamic_cast<const DirMapping*>(selection[0]) == NULL) //non empty && no directory + dynamic_cast<const DirMapping*>(selection[0]) == nullptr) //non empty && no directory { const Zstring filename = afterLast(selection[0]->getObjRelativeName(), FILE_NAME_SEPARATOR); if (filename.find(Zchar('.')) != Zstring::npos) //be careful: AfterLast would return the whole string if '.' were not found! @@ -1775,7 +1754,7 @@ void MainDialog::onMainGridContext(GridClickEvent& event) menu.addItem(_("Exclude via filter:") + L" *." + extension, [this, extension] { excludeExtension(extension); }, - &GlobalResources::getImage(L"filterSmall")); + &GlobalResources::getImage(L"filterOnSmall")); } } //---------------------------------------------------------------------------------------------------- @@ -1783,11 +1762,11 @@ void MainDialog::onMainGridContext(GridClickEvent& event) if (selection.size() == 1) menu.addItem(_("Exclude via filter:") + L" " + afterLast(selection[0]->getObjRelativeName(), FILE_NAME_SEPARATOR), [this, &selection] { excludeItems(selection); }, - &GlobalResources::getImage(L"filterSmall")); + &GlobalResources::getImage(L"filterOnSmall")); else if (selection.size() > 1) menu.addItem(_("Exclude via filter:") + L" " + _("<multiple selection>"), [this, &selection] { excludeItems(selection); }, - &GlobalResources::getImage(L"filterSmall")); + &GlobalResources::getImage(L"filterOnSmall")); //---------------------------------------------------------------------------------------------------- //CONTEXT_EXTERNAL_APP @@ -1806,12 +1785,12 @@ void MainDialog::onMainGridContext(GridClickEvent& event) const wxString command = iter->second; - auto openApp = [this, &selection, command, event] { openExternalApplication(selection.empty() ? NULL : selection[0], event.compPos_ == gridview::COMP_LEFT, command); }; + auto openApp = [this, &selection, command, event] { openExternalApplication(selection.empty() ? nullptr : selection[0], event.compPos_ == gridview::COMP_LEFT, command); }; if (iter == globalSettings->gui.externelApplications.begin()) menu.addItem(description + L"\tEnter", openApp); else - menu.addItem(description, openApp, NULL, !selection.empty()); + menu.addItem(description, openApp, nullptr, !selection.empty()); } } //---------------------------------------------------------------------------------------------------- @@ -1823,7 +1802,7 @@ void MainDialog::onMainGridContext(GridClickEvent& event) deleteSelectedFiles( getGridSelection(true, false), getGridSelection(false, true)); - }, NULL, !selection.empty()); + }, nullptr, !selection.empty()); } else if (event.compPos_ == gridview::COMP_MIDDLE) @@ -1832,13 +1811,13 @@ void MainDialog::onMainGridContext(GridClickEvent& event) { zen::setActiveStatus(true, folderCmp); updateGui(); - }, NULL, gridDataView->rowsTotal() > 0); + }, nullptr, gridDataView->rowsTotal() > 0); menu.addItem(_("Exclude all"), [&] { zen::setActiveStatus(false, folderCmp); updateGuiAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true - }, NULL, gridDataView->rowsTotal() > 0); + }, nullptr, gridDataView->rowsTotal() > 0); } menu.popup(*this); } @@ -1873,12 +1852,14 @@ void MainDialog::excludeItems(const std::vector<FileSystemObject*>& selection) for (auto iter = selection.begin(); iter != selection.end(); ++iter) { FileSystemObject* fsObj = *iter; - const bool isDir = dynamic_cast<const DirMapping*>(fsObj) != NULL; if (iter != selection.begin()) newExclude += Zstr("\n"); + //#pragma warning(suppress: 6011) -> fsObj cannot be NULL here! newExclude += FILE_NAME_SEPARATOR + fsObj->getObjRelativeName(); + + const bool isDir = dynamic_cast<const DirMapping*>(fsObj) != nullptr; if (isDir) newExclude += FILE_NAME_SEPARATOR; } @@ -1944,22 +1925,27 @@ void MainDialog::onGridLabelContext(GridClickEvent& event) }; menu.addItem(_("&Default"), setDefault); //'&' -> reuse text from "default" buttons elsewhere //---------------------------------------------------------------------------------------------- - auto setIconSize = [&](xmlAccess::FileIconSize sz, IconBuffer::IconSize szAlias) + menu.addSeparator(); + menu.addCheckBox(_("Show icons:"), [&] + { + globalSettings->gui.showIcons = !globalSettings->gui.showIcons; + gridview::setupIcons(*m_gridMain, globalSettings->gui.showIcons, convert(globalSettings->gui.iconSize)); + + }, globalSettings->gui.showIcons); + + auto setIconSize = [&](xmlAccess::FileIconSize sz) { globalSettings->gui.iconSize = sz; - gridview::setIconSize(*m_gridMain, szAlias); + gridview::setupIcons(*m_gridMain, globalSettings->gui.showIcons, convert(sz)); }; - menu.addSeparator(); - menu.addItem(_("Icon size:"), [] {}, NULL, false); - - auto addSizeEntry = [&](const wxString& label, xmlAccess::FileIconSize sz, IconBuffer::IconSize szAlias) + auto addSizeEntry = [&](const wxString& label, xmlAccess::FileIconSize sz) { auto setIconSize2 = setIconSize; //bring into scope - menu.addRadio(label, [sz, szAlias, setIconSize2] { setIconSize2(sz, szAlias); }, globalSettings->gui.iconSize == sz); + menu.addRadio(label, [sz, setIconSize2] { setIconSize2(sz); }, globalSettings->gui.iconSize == sz, globalSettings->gui.showIcons); }; - addSizeEntry(_("Small" ), xmlAccess::ICON_SIZE_SMALL , IconBuffer::SIZE_SMALL); - addSizeEntry(_("Medium"), xmlAccess::ICON_SIZE_MEDIUM, IconBuffer::SIZE_MEDIUM); - addSizeEntry(_("Large" ), xmlAccess::ICON_SIZE_LARGE , IconBuffer::SIZE_LARGE); + addSizeEntry(L" " + _("Small" ), xmlAccess::ICON_SIZE_SMALL ); + addSizeEntry(L" " + _("Medium"), xmlAccess::ICON_SIZE_MEDIUM); + addSizeEntry(L" " + _("Large" ), xmlAccess::ICON_SIZE_LARGE ); //---------------------------------------------------------------------------------------------- if (static_cast<ColumnTypeRim>(event.colType_) == COL_TYPE_DATE) { @@ -1979,8 +1965,8 @@ void MainDialog::onGridLabelContext(GridClickEvent& event) else if (event.compPos_ == gridview::COMP_MIDDLE) { - menu.addItem(_("Synchronization Preview"), [&] { enablePreview(true ); }, syncPreviewEnabled ? &GlobalResources::getImage(L"syncViewSmall") : NULL); - menu.addItem(_("Comparison Result"), [&] { enablePreview(false); }, syncPreviewEnabled ? NULL : &GlobalResources::getImage(L"cmpViewSmall")); + menu.addItem(_("Synchronization Preview") + L"\tF8", [&] { enablePreview(true ); }, syncPreviewEnabled ? &GlobalResources::getImage(L"syncSmall") : nullptr); + menu.addItem(_("Comparison Result"), [&] { enablePreview(false); }, syncPreviewEnabled ? nullptr : &GlobalResources::getImage(L"compareSmall")); } menu.popup(*this); } @@ -2182,7 +2168,7 @@ void MainDialog::addFileToCfgHistory(const std::vector<wxString>& filenames) void MainDialog::OnSaveConfig(wxCommandEvent& event) { - trySaveConfig(NULL); + trySaveConfig(nullptr); } @@ -2297,20 +2283,22 @@ bool MainDialog::saveOldConfig() //return false on user abort { const wxString filename = activeConfigFiles[0]; - bool dontShowAgain = !globalSettings->optDialogs.popupOnConfigChange; + bool neverSave = !globalSettings->optDialogs.popupOnConfigChange; + CheckBox cb(_("Never save changes"), neverSave); switch (showQuestionDlg(ReturnQuestionDlg::BUTTON_YES | ReturnQuestionDlg::BUTTON_NO | ReturnQuestionDlg::BUTTON_CANCEL, - _("Save changes to current configuration?"), - &dontShowAgain)) + _("Save changes to current configuration?"), &cb)) { case ReturnQuestionDlg::BUTTON_YES: - return trySaveConfig(endsWith(filename, L".ffs_gui") ? &filename : NULL); //don't overwrite .ffs_batch! + return trySaveConfig(endsWith(filename, L".ffs_gui") ? &filename : nullptr); //don't overwrite .ffs_batch! + case ReturnQuestionDlg::BUTTON_NO: - globalSettings->optDialogs.popupOnConfigChange = !dontShowAgain; + globalSettings->optDialogs.popupOnConfigChange = !neverSave; //by choosing "no" user actively discards current config selection //this ensures next app start will load <last session> instead of the original non-modified config selection setLastUsedConfig(std::vector<wxString>(), getConfig()); break; + case ReturnQuestionDlg::BUTTON_CANCEL: return false; } @@ -2623,7 +2611,7 @@ void MainDialog::OnGlobalFilterContext(wxCommandEvent& event) updateFilterButtons(); //refresh global filter icon applyFilterConfig(); //re-apply filter }; - menu.addItem( _("Clear filter settings"), clearFilter, NULL, !isNullFilter(currentCfg.mainCfg.globalFilter)); + menu.addItem( _("Clear filter settings"), clearFilter, nullptr, !isNullFilter(currentCfg.mainCfg.globalFilter)); menu.popup(*this); } @@ -2875,8 +2863,11 @@ void MainDialog::OnCompare(wxCommandEvent& event) wxBusyCursor dummy; //show hourglass cursor - clearGrid(false); //-> don't resize grid to keep scroll position! - //prevent temporary memory peak by clearing old result list + int scrollPosX = 0; + int scrollPosY = 0; + m_gridMain->GetViewStart(&scrollPosX, &scrollPosY); //preserve current scroll position + + clearGrid(false); //avoid memory peak by clearing old data try { @@ -2916,8 +2907,9 @@ void MainDialog::OnCompare(wxCommandEvent& event) } gridDataView->setData(folderCmp); //update view on data - treeDataView->setData(folderCmp); // + treeDataView->setData(folderCmp); // updateGui(); + m_gridMain->Scroll(scrollPosX, scrollPosY); //restore updateSyncEnabledStatus(); //enable the sync button if (m_buttonStartSync->IsShownOnScreen()) @@ -2976,12 +2968,6 @@ void MainDialog::updateStatistics() } -//void MainDialog::OnSwitchView(wxCommandEvent& event) -//{ -// enablePreview(!syncPreviewEnabled); -//} - - void MainDialog::OnSyncSettings(wxCommandEvent& event) { ExecWhenFinishedCfg ewfCfg = { ¤tCfg.mainCfg.onCompletion, @@ -3502,8 +3488,8 @@ void MainDialog::updateGuiForFolderPair() //adapt local filter and sync cfg for first folder pair if (additionalFolderPairs.empty() && - firstFolderPair->getAltCompConfig().get() == NULL && - firstFolderPair->getAltSyncConfig().get() == NULL && + firstFolderPair->getAltCompConfig().get() == nullptr && + firstFolderPair->getAltSyncConfig().get() == nullptr && isNullFilter(firstFolderPair->getAltFilterConfig())) { m_bpButtonAltCompCfg ->Hide(); @@ -3592,7 +3578,7 @@ void MainDialog::addFolderPair(const std::vector<FolderPairEnh>& newPairs, bool newEntries.push_back(newPair); //register events - newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolderPair), NULL, this); + newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolderPair), nullptr, this); }); //wxComboBox screws up miserably if width/height is smaller than the magic number 4! Problem occurs when trying to set tooltip @@ -3819,12 +3805,11 @@ void MainDialog::OnMenuBatchJob(wxCommandEvent& event) const xmlAccess::XmlBatchConfig batchCfg = convertGuiToBatch(currCfg, referenceFile); - if (showSyncBatchDlg(referenceFile, batchCfg, - folderHistoryLeft, - folderHistoryRight, - globalSettings->gui.onCompletionHistory, - globalSettings->gui.onCompletionHistoryMax) == ReturnBatchConfig::BATCH_FILE_SAVED) - pushStatusInformation(_("Batch file created successfully!")); + showSyncBatchDlg(referenceFile, batchCfg, + folderHistoryLeft, + folderHistoryRight, + globalSettings->gui.onCompletionHistory, + globalSettings->gui.onCompletionHistoryMax); } @@ -3837,7 +3822,7 @@ void MainDialog::OnMenuCheckVersion(wxCommandEvent& event) void MainDialog::OnRegularUpdateCheck(wxIdleEvent& event) { //execute just once per startup! - Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), NULL, this); + Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), nullptr, this); zen::checkForUpdatePeriodically(globalSettings->gui.lastUpdateCheck); } @@ -3846,7 +3831,7 @@ void MainDialog::OnRegularUpdateCheck(wxIdleEvent& event) void MainDialog::OnLayoutWindowAsync(wxIdleEvent& event) { //execute just once per startup! - Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); + Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), nullptr, this); wxWindowUpdateLocker dummy(this); //avoid display distortion diff --git a/ui/main_dlg.h b/ui/main_dlg.h index c13887ed..228cef4a 100644 --- a/ui/main_dlg.h +++ b/ui/main_dlg.h @@ -168,7 +168,6 @@ private: void OnRegularUpdateCheck( wxIdleEvent& event); void OnLayoutWindowAsync( wxIdleEvent& event); - void OnResize( wxSizeEvent& event); void OnResizeFolderPairs( wxEvent& event); void OnResizeConfigPanel( wxEvent& event); void OnResizeViewPanel( wxEvent& event); diff --git a/ui/msg_popup.cpp b/ui/msg_popup.cpp index e86b6cf2..1ed892f8 100644 --- a/ui/msg_popup.cpp +++ b/ui/msg_popup.cpp @@ -98,7 +98,7 @@ void ErrorDlg::OnAbort(wxCommandEvent& event) ReturnErrorDlg::ButtonPressed zen::showErrorDlg(int activeButtons, const wxString& messageText, bool* ignoreNextErrors) { - ErrorDlg errorDlg(NULL, activeButtons, messageText, ignoreNextErrors); + ErrorDlg errorDlg(nullptr, activeButtons, messageText, ignoreNextErrors); errorDlg.Raise(); return static_cast<ReturnErrorDlg::ButtonPressed>(errorDlg.ShowModal()); } @@ -180,7 +180,7 @@ void WarningDlg::OnAbort(wxCommandEvent& event) ReturnWarningDlg::ButtonPressed zen::showWarningDlg(int activeButtons, const wxString& messageText, bool& dontShowAgain) { - WarningDlg warningDlg(NULL, activeButtons, messageText, dontShowAgain); + WarningDlg warningDlg(nullptr, activeButtons, messageText, dontShowAgain); warningDlg.Raise(); return static_cast<ReturnWarningDlg::ButtonPressed>(warningDlg.ShowModal()); } @@ -190,42 +190,42 @@ ReturnWarningDlg::ButtonPressed zen::showWarningDlg(int activeButtons, const wxS class QuestionDlg : public QuestionDlgGenerated { public: - QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString& messageText, bool* dontShowAgain = NULL); + QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString& messageText, CheckBox* checkbox); private: - void OnClose(wxCloseEvent& event); - void OnCancel(wxCommandEvent& event); + void OnClose (wxCloseEvent& event) { EndModal(ReturnQuestionDlg::BUTTON_CANCEL); } + void OnCancel(wxCommandEvent& event) { EndModal(ReturnQuestionDlg::BUTTON_CANCEL); } void OnYes(wxCommandEvent& event); - void OnNo(wxCommandEvent& event); - void OnCheckBoxDontShowAgain(wxCommandEvent& event); + void OnNo (wxCommandEvent& event); - bool* dontShowAgain; //optional + CheckBox* checkbox_; //optional }; -QuestionDlg::QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString& messageText, bool* dontShowDlgAgain) : +QuestionDlg::QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString& messageText, CheckBox* checkbox) : QuestionDlgGenerated(parentWindow), - dontShowAgain(dontShowDlgAgain) + checkbox_(checkbox) { #ifdef FFS_WIN new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" #endif - m_bitmap10->SetBitmap(GlobalResources::getImage(wxT("question"))); + m_bitmap10->SetBitmap(GlobalResources::getImage(L"question")); m_textCtrl8->SetValue(messageText); - if (dontShowAgain) - m_checkBoxDontAskAgain->SetValue(*dontShowAgain); + + if (checkbox_) + { + m_checkBox->SetValue(checkbox_->value_); + m_checkBox->SetLabel(checkbox_->label_); + } else - m_checkBoxDontAskAgain->Hide(); + m_checkBox->Hide(); if (~activeButtons & ReturnQuestionDlg::BUTTON_YES) m_buttonYes->Hide(); if (~activeButtons & ReturnQuestionDlg::BUTTON_NO) - { m_buttonNo->Hide(); - m_checkBoxDontAskAgain->Hide(); - } if (~activeButtons & ReturnQuestionDlg::BUTTON_CANCEL) m_buttonCancel->Hide(); @@ -239,42 +239,23 @@ QuestionDlg::QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxStri m_buttonNo->SetFocus(); } - -void QuestionDlg::OnClose(wxCloseEvent& event) -{ - EndModal(ReturnQuestionDlg::BUTTON_CANCEL); -} - - -void QuestionDlg::OnCancel(wxCommandEvent& event) -{ - EndModal(ReturnQuestionDlg::BUTTON_CANCEL); -} - - void QuestionDlg::OnYes(wxCommandEvent& event) { - if (dontShowAgain) - *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); + if (checkbox_) + checkbox_->value_ = m_checkBox->GetValue(); EndModal(ReturnQuestionDlg::BUTTON_YES); } void QuestionDlg::OnNo(wxCommandEvent& event) { - if (dontShowAgain) - *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); + if (checkbox_) + checkbox_->value_ = m_checkBox->GetValue(); EndModal(ReturnQuestionDlg::BUTTON_NO); } -void QuestionDlg::OnCheckBoxDontShowAgain(wxCommandEvent& event) -{ - event.Skip(); -} - - -ReturnQuestionDlg::ButtonPressed zen::showQuestionDlg(int activeButtons, const wxString& messageText, bool* dontShowAgain) +ReturnQuestionDlg::ButtonPressed zen::showQuestionDlg(int activeButtons, const wxString& messageText, CheckBox* checkbox) { - QuestionDlg qtnDlg(NULL, activeButtons, messageText, dontShowAgain); + QuestionDlg qtnDlg(nullptr, activeButtons, messageText, checkbox); qtnDlg.Raise(); return static_cast<ReturnQuestionDlg::ButtonPressed>(qtnDlg.ShowModal()); } diff --git a/ui/msg_popup.h b/ui/msg_popup.h index 29606a41..ccdf09e4 100644 --- a/ui/msg_popup.h +++ b/ui/msg_popup.h @@ -20,7 +20,7 @@ struct ReturnErrorDlg BUTTON_ABORT = 4 }; }; -ReturnErrorDlg::ButtonPressed showErrorDlg(int activeButtons, const wxString& messageText, bool* ignoreNextErrors); //ignoreNextErrors may be NULL +ReturnErrorDlg::ButtonPressed showErrorDlg(int activeButtons, const wxString& messageText, bool* ignoreNextErrors); //ignoreNextErrors may be nullptr struct ReturnWarningDlg @@ -44,7 +44,16 @@ struct ReturnQuestionDlg BUTTON_CANCEL = 4 }; }; -ReturnQuestionDlg::ButtonPressed showQuestionDlg(int activeButtons, const wxString& messageText, bool* dontShowAgain = NULL); + +struct CheckBox +{ + CheckBox(const wxString& label, bool& value) : label_(label), value_(value) {} + + wxString label_; //in + bool& value_; //in/out +}; + +ReturnQuestionDlg::ButtonPressed showQuestionDlg(int activeButtons, const wxString& messageText, CheckBox* checkbox = nullptr); } diff --git a/ui/progress_indicator.cpp b/ui/progress_indicator.cpp index ee24b28b..1e4be39a 100644 --- a/ui/progress_indicator.cpp +++ b/ui/progress_indicator.cpp @@ -19,7 +19,6 @@ #include <wx+/no_flicker.h> #include "gui_generated.h" #include "../lib/resources.h" -#include "../lib/error_log.h" #include "../lib/statistics.h" #include "tray_icon.h" #include "taskbar.h" @@ -394,11 +393,11 @@ wxBitmap buttonReleased(const std::string& name) class LogControl : public LogControlGenerated { public: - LogControl(wxWindow* parent, const ErrorLogging& log) : LogControlGenerated(parent), log_(log) + LogControl(wxWindow* parent, const ErrorLog& log) : LogControlGenerated(parent), log_(log) { - const int errorCount = log_.typeCount(TYPE_ERROR | TYPE_FATAL_ERROR); - const int warningCount = log_.typeCount(TYPE_WARNING); - const int infoCount = log_.typeCount(TYPE_INFO); + const int errorCount = log_.getItemCount(TYPE_ERROR | TYPE_FATAL_ERROR); + const int warningCount = log_.getItemCount(TYPE_WARNING); + const int infoCount = log_.getItemCount(TYPE_INFO); m_bpButtonErrors->init(buttonPressed ("error"), wxString(_("Error")) + wxString::Format(wxT(" (%d)"), errorCount), buttonReleased("error"), wxString(_("Error")) + wxString::Format(wxT(" (%d)"), errorCount)); @@ -419,7 +418,7 @@ public: updateLogText(); - m_textCtrlInfo->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(LogControl::onKeyEvent), NULL, this); + m_textCtrlInfo->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(LogControl::onKeyEvent), nullptr, this); } virtual void OnErrors(wxCommandEvent& event) @@ -467,32 +466,28 @@ private: if (m_bpButtonInfo->isActive()) includedTypes |= TYPE_INFO; - const std::vector<wxString>& messages = log_.getFormattedMessages(includedTypes); - //fast replacement for wxString modelling exponential growth typedef Zbase<wchar_t> zxString; + zxString logText; - zxString newLogText; //perf: wxString doesn't model exponential growth and so is out - - if (!messages.empty()) - for (std::vector<wxString>::const_iterator i = messages.begin(); i != messages.end(); ++i) + const auto& entries = log_.getEntries(); + for (auto iter = entries.begin(); iter != entries.end(); ++iter) + if (iter->type & includedTypes) { - newLogText += copyStringTo<zxString>(*i); - newLogText += wxT("\n"); + logText += copyStringTo<zxString>(formatMessage(*iter)); + logText += L'\n'; } - else //if no messages match selected view filter, show final status message at least - { - const std::vector<wxString>& allMessages = log_.getFormattedMessages(); - if (!allMessages.empty()) - newLogText = copyStringTo<zxString>(allMessages.back()); - } + + if (logText.empty()) //if no messages match selected view filter, show final status message at least + if (!entries.empty()) + logText = copyStringTo<zxString>(formatMessage(entries.back())); wxWindowUpdateLocker dummy(m_textCtrlInfo); - m_textCtrlInfo->ChangeValue(copyStringTo<wxString>(newLogText)); + m_textCtrlInfo->ChangeValue(copyStringTo<wxString>(logText)); m_textCtrlInfo->ShowPosition(m_textCtrlInfo->GetLastPosition()); } - const ErrorLogging log_; + const ErrorLog log_; }; @@ -589,15 +584,20 @@ struct LabelFormatterTimeElapsed : public LabelFormatter { if (secProposed <= 10) return 10; //minimum block size - if (secProposed <= 20) //avoid flicker between 10<->15<->20 sec blocks return bestFit(secProposed, 10, 20); + if (secProposed <= 30) + return bestFit(secProposed, 20, 30); + if (secProposed <= 60) + return bestFit(secProposed, 30, 60); - //for seconds and minutes: nice numbers are 1, 5, 10, 15, 20, 30 + //for minutes: nice numbers are 1, 2, 5, 10, 15, 20, 30 auto calcBlock = [](double val) -> double { + if (val <= 2) + return bestFit(val, 1, 2); // if (val <= 5) - return bestFit(val, 1, 5); // + return bestFit(val, 2, 5); // if (val <= 10) return bestFit(val, 5, 10); // a good candidate for a variadic template! if (val <= 15) @@ -608,15 +608,13 @@ struct LabelFormatterTimeElapsed : public LabelFormatter return bestFit(val, 20, 30); return bestFit(val, 30, 60); }; - - if (secProposed <= 60) - return calcBlock(secProposed); - else if (secProposed <= 3600) + if (secProposed <= 3600) return calcBlock(secProposed / 60) * 60; - else if (secProposed <= 3600 * 24) + + if (secProposed <= 3600 * 24) return nextNiceNumber(secProposed / 3600) * 3600; - else - return nextNiceNumber(secProposed / (24 * 3600)) * 24 * 3600; //round up to full days + + return nextNiceNumber(secProposed / (24 * 3600)) * 24 * 3600; //round up to full days } virtual wxString formatText(double timeElapsed, double optimalBlockSize) const @@ -662,7 +660,7 @@ public: void setStatusText_NoUpdate(const wxString& text); void updateStatusDialogNow(bool allowYield = true); - void processHasFinished(SyncStatus::SyncStatusID id, const ErrorLogging& log); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater + void processHasFinished(SyncStatus::SyncStatusID id, const ErrorLog& log); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater std::wstring getExecWhenFinishedCommand() const; @@ -776,20 +774,20 @@ SyncStatus::SyncStatusImpl::SyncStatusImpl(AbortCallback& abortCb, try //try to get access to Windows 7/Ubuntu taskbar { - taskbar_.reset(new Taskbar(mainDialog != NULL ? *static_cast<wxTopLevelWindow*>(mainDialog) : *this)); + taskbar_.reset(new Taskbar(mainDialog ? *static_cast<wxTopLevelWindow*>(mainDialog) : *this)); } catch (const TaskbarNotAvailable&) {} //hide "processed" statistics until end of process - bSizerFinalStat ->Show(false); - m_buttonOK ->Show(false); - m_staticTextItemsProc->Show(false); - bSizerItemsProc ->Show(false); + bSizerFinalStat ->Show(false); + m_buttonOK ->Show(false); + m_staticTextLabelItemsProc->Show(false); + bSizerItemsProc ->Show(false); SetIcon(GlobalResources::instance().programIcon); //set application icon //register key event - Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(SyncStatusImpl::OnKeyPressed), NULL, this); + Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(SyncStatusImpl::OnKeyPressed), nullptr, this); setCurrentStatus(startStatus); //first state: will be shown while waiting for dir locks (if at all) @@ -919,7 +917,7 @@ void SyncStatus::SyncStatusImpl::showProgressExternally(const wxString& progress { //write status information to systray, if window is minimized if (trayIcon.get()) - trayIcon->setToolTip2(progressText, fraction); + trayIcon->setToolTip(progressText, fraction); wxString progressTextFmt = progressText; progressTextFmt.Replace(wxT("\n"), wxT(" - ")); @@ -1123,7 +1121,6 @@ void SyncStatus::SyncStatusImpl::updateStatusDialogNow(bool allowYield) if (evaluateZorder(*this, *mainDialog) == ZORDER_WRONG) { HWND hProgress = static_cast<HWND>(GetHWND()); - if (::IsWindowVisible(hProgress)) { ::ShowWindow(hProgress, SW_HIDE); //make Windows recalculate z-order @@ -1148,12 +1145,14 @@ void SyncStatus::SyncStatusImpl::updateStatusDialogNow(bool allowYield) */ updateUiNow(); } + else + Update(); //don't wait until next idle event (who knows what blocking process comes next?) } bool SyncStatus::SyncStatusImpl::currentProcessIsRunning() { - return abortCb_ != NULL; + return abortCb_ != nullptr; } @@ -1209,14 +1208,14 @@ void SyncStatus::SyncStatusImpl::setCurrentStatus(SyncStatus::SyncStatusID id) } -void SyncStatus::SyncStatusImpl::processHasFinished(SyncStatus::SyncStatusID id, const ErrorLogging& log) //essential to call this in StatusHandler derived class destructor +void SyncStatus::SyncStatusImpl::processHasFinished(SyncStatus::SyncStatusID id, const ErrorLog& log) //essential to call this in StatusHandler derived class destructor { //at the LATEST(!) to prevent access to currentStatusHandler //enable okay and close events; may be set in this method ONLY wxWindowUpdateLocker dummy(this); //badly needed - abortCb_ = NULL; //avoid callback to (maybe) deleted parent process + abortCb_ = nullptr; //avoid callback to (maybe) deleted parent process setCurrentStatus(id); @@ -1248,16 +1247,18 @@ void SyncStatus::SyncStatusImpl::processHasFinished(SyncStatus::SyncStatusID id, if (totalObjects == currentObjects && //if everything was processed successfully totalData == currentData) { - m_staticTextItemsRem->Show(false); - bSizerItemsRem ->Show(false); + m_staticTextLabelItemsRem->Show(false); + bSizerItemsRem ->Show(false); } - m_staticTextItemsProc->Show(true); - bSizerItemsProc ->Show(true); + m_staticTextLabelItemsProc->Show(true); + bSizerItemsProc ->Show(true); m_staticTextProcessedObj ->SetLabel(toStringSep(currentObjects)); m_staticTextDataProcessed->SetLabel(zen::filesizeToShortString(currentData)); - m_staticTextRemTimeDescr->Show(false); + m_staticTextLabelElapsedTime->SetLabel(_("Total time:")); //it's not "elapsed time" anymore + + m_staticTextLabelRemTime->Show(false); m_staticTextRemTime ->Show(false); updateStatusDialogNow(false); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed @@ -1285,8 +1286,8 @@ void SyncStatus::SyncStatusImpl::processHasFinished(SyncStatus::SyncStatusID id, m_listbookResult->AddPage(logControl, _("Logging"), false); //bSizerHoldStretch->Insert(0, logControl, 1, wxEXPAND); - //show log instead of graph if fatal errors occured! (not required for ignored warnings or errors!) - if (log.typeCount(TYPE_FATAL_ERROR) > 0) + //show log instead of graph if errors occured! (not required for ignored warnings) + if (log.getItemCount(TYPE_ERROR | TYPE_FATAL_ERROR) > 0) m_listbookResult->ChangeSelection(posLog); m_panelBackground->Layout(); //we use a dummy panel as actual background: replaces simple "Layout()" call @@ -1394,11 +1395,11 @@ void SyncStatus::SyncStatusImpl::minimizeToTray() if (!trayIcon.get()) { trayIcon.reset(new FfsTrayIcon); - trayIcon->Connect(FFS_REQUEST_RESUME_TRAY_EVENT, wxCommandEventHandler(SyncStatus::SyncStatusImpl::OnResumeFromTray), NULL, this); + trayIcon->Connect(FFS_REQUEST_RESUME_TRAY_EVENT, wxCommandEventHandler(SyncStatus::SyncStatusImpl::OnResumeFromTray), nullptr, this); //tray icon has shorter lifetime than this => no need to disconnect event later } - updateStatusDialogNow(false); //set tooltip: in pause mode there is no statistics update, so this is the only chance + updateStatusDialogNow(false); //set tooltip: e.g. in pause mode there was no GUI update, so this is the last chance Hide(); if (mainDialog) @@ -1444,8 +1445,7 @@ SyncStatus::SyncStatus(AbortCallback& abortCb, if (showProgress) { pimpl->Show(); - pimpl->updateStatusDialogNow(false); //update visual statistics to get rid of "dummy" texts - pimpl->Update(); //don't wait until next idle event (who knows what blocking process comes next?) + pimpl->updateStatusDialogNow(false); //clear gui flicker: window must be visible to make this work! } else pimpl->minimizeToTray(); @@ -1506,7 +1506,7 @@ void SyncStatus::resumeTimer() return pimpl->resumeTimer(); } -void SyncStatus::processHasFinished(SyncStatusID id, const ErrorLogging& log) +void SyncStatus::processHasFinished(SyncStatusID id, const ErrorLog& log) { pimpl->processHasFinished(id, log); } diff --git a/ui/progress_indicator.h b/ui/progress_indicator.h index 3fa3f8f9..858f6ce9 100644 --- a/ui/progress_indicator.h +++ b/ui/progress_indicator.h @@ -7,16 +7,12 @@ #ifndef PROGRESSINDICATOR_H_INCLUDED #define PROGRESSINDICATOR_H_INCLUDED +#include <zen/error_log.h> #include <zen/zstring.h> #include <wx/toplevel.h> #include "../lib/status_handler.h" #include "main_dlg.h" -namespace zen -{ -class ErrorLogging; -} - class CompareStatus { @@ -57,7 +53,7 @@ public: }; SyncStatus(AbortCallback& abortCb, - MainDialog* parentWindow, //may be NULL + MainDialog* parentWindow, //may be nullptr SyncStatusID startStatus, bool showProgress, const wxString& jobName, @@ -82,7 +78,7 @@ public: //essential to call one of these two methods in StatusUpdater derived class destructor at the LATEST(!) //to prevent access to callback to updater (e.g. request abort) - void processHasFinished(SyncStatusID id, const zen::ErrorLogging& log); + void processHasFinished(SyncStatusID id, const zen::ErrorLog& log); void closeWindowDirectly(); //don't wait for user private: diff --git a/ui/search.cpp b/ui/search.cpp index 8112db6c..af62686b 100644 --- a/ui/search.cpp +++ b/ui/search.cpp @@ -106,11 +106,11 @@ private: template <bool respectCase> -int findRow(const Grid& grid, //return -1 if no matching row found - size_t compPos, - const wxString& searchString, - int rowFirst, //specify area to search: - int rowLast) // [rowFirst, rowLast) +ptrdiff_t findRow(const Grid& grid, //return -1 if no matching row found + size_t compPos, + const wxString& searchString, + size_t rowFirst, //specify area to search: + size_t rowLast) // [rowFirst, rowLast) { auto prov = grid.getDataProvider(compPos); std::vector<Grid::ColumnAttribute> colAttr = grid.getColumnConfig(compPos); @@ -119,7 +119,7 @@ int findRow(const Grid& grid, //return -1 if no matching row found { const FindInText<respectCase> searchTxt(searchString); - for (int row = rowFirst; row < rowLast; ++row) + for (size_t row = rowFirst; row < rowLast; ++row) for (auto iterCol = colAttr.begin(); iterCol != colAttr.end(); ++iterCol) if (searchTxt.found(prov->getValue(row, iterCol->type_))) return row; @@ -129,12 +129,12 @@ int findRow(const Grid& grid, //return -1 if no matching row found //syntactic sugar... -int findRow(const Grid& grid, - size_t compPos, - bool respectCase, - const wxString& searchString, - int rowFirst, //specify area to search: - int rowLast) // [rowFirst, rowLast) +ptrdiff_t findRow(const Grid& grid, + size_t compPos, + bool respectCase, + const wxString& searchString, + size_t rowFirst, //specify area to search: + size_t rowLast) // [rowFirst, rowLast) { return respectCase ? findRow<true>( grid, compPos, searchString, rowFirst, rowLast) : @@ -162,11 +162,11 @@ void executeSearch(bool forceShowDialog, searchDialogWasShown = true; } - const int rowCount = grid.getRowCount(); + const size_t rowCount = grid.getRowCount(); auto cursorPos = grid.getGridCursor(); //(row, component pos) - int cursorRow = cursorPos.first; - if (cursorRow < 0 || cursorRow >= rowCount) + size_t cursorRow = cursorPos.first; + if (cursorRow >= rowCount) cursorRow = 0; if (cursorPos.second == compPosRight) @@ -177,9 +177,9 @@ void executeSearch(bool forceShowDialog, { wxBusyCursor showHourGlass; - auto finishSearch = [&](size_t compPos, int rowFirst, int rowLast) -> bool + auto finishSearch = [&](size_t compPos, size_t rowFirst, size_t rowLast) -> bool { - const int targetRow = findRow(grid, compPos, respectCase, lastSearchString, rowFirst, rowLast); + const ptrdiff_t targetRow = findRow(grid, compPos, respectCase, lastSearchString, rowFirst, rowLast); if (targetRow >= 0) { grid.setGridCursor(targetRow, compPos); diff --git a/ui/small_dlgs.cpp b/ui/small_dlgs.cpp index 55a7021a..20e5da4e 100644 --- a/ui/small_dlgs.cpp +++ b/ui/small_dlgs.cpp @@ -34,8 +34,8 @@ public: AboutDlg(wxWindow* parent); private: - void OnClose(wxCloseEvent& event); - void OnOK(wxCommandEvent& event); + void OnClose(wxCloseEvent& event) { EndModal(0); } + void OnOK (wxCommandEvent& event) { EndModal(0); } }; @@ -101,21 +101,9 @@ AboutDlg::AboutDlg(wxWindow* parent) : AboutDlgGenerated(parent) } -void AboutDlg::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void AboutDlg::OnOK(wxCommandEvent& event) -{ - EndModal(0); -} - - void zen::showAboutDialog() { - AboutDlg aboutDlg(NULL); + AboutDlg aboutDlg(nullptr); aboutDlg.ShowModal(); } //######################################################################################## @@ -130,17 +118,18 @@ public: ~FilterDlg() {} private: - void OnClose (wxCloseEvent& event); + void OnClose ( wxCloseEvent& event) { EndModal(0); } + void OnCancel (wxCommandEvent& event) { EndModal(0); } void OnHelp (wxCommandEvent& event); void OnDefault (wxCommandEvent& event); void OnApply (wxCommandEvent& event); - void OnCancel (wxCommandEvent& event); void OnUpdateChoice(wxCommandEvent& event) { updateGui(); } void OnUpdateNameFilter(wxCommandEvent& event) { updateGui(); } void updateGui(); void setFilter(const FilterConfig& filter); FilterConfig getFilter() const; + void onKeyEvent(wxKeyEvent& event); const bool isGlobalFilter_; FilterConfig& outputRef; @@ -161,12 +150,19 @@ FilterDlg::FilterDlg(wxWindow* parent, new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" #endif + m_textCtrlInclude->SetMaxLength(0); //allow large filter entries! + m_textCtrlExclude->SetMaxLength(0); // + + m_textCtrlInclude->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(FilterDlg::onKeyEvent), nullptr, this); + m_textCtrlExclude->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(FilterDlg::onKeyEvent), nullptr, this); + enumTimeDescr. - add(UTIME_NONE, _("Inactive")). - add(UTIME_TODAY, _("Today")). - add(UTIME_THIS_WEEK, _("This week")). - add(UTIME_THIS_MONTH, _("This month")). - add(UTIME_THIS_YEAR, _("This year")); + add(UTIME_NONE, _("Inactive")). + add(UTIME_TODAY, _("Today")). + // add(UTIME_THIS_WEEK, _("This week")). + add(UTIME_THIS_MONTH, _("This month")). + add(UTIME_THIS_YEAR, _("This year")). + add(UTIME_LAST_X_DAYS, _("Last x days")); enumSizeDescr. add(USIZE_NONE, _("Inactive")). @@ -174,8 +170,8 @@ FilterDlg::FilterDlg(wxWindow* parent, add(USIZE_KB, _("KB")). add(USIZE_MB, _("MB")); - m_bitmap26->SetBitmap(GlobalResources::getImage(wxT("filterOn"))); - m_bpButtonHelp->SetBitmapLabel(GlobalResources::getImage(wxT("help"))); + m_bitmap26->SetBitmap(GlobalResources::getImage(L"filterOn")); + m_bpButtonHelp->SetBitmapLabel(GlobalResources::getImage(L"help")); setFilter(filter); @@ -183,41 +179,61 @@ FilterDlg::FilterDlg(wxWindow* parent, m_button10->SetFocus(); //adapt header for global/local dialog - if (isGlobalFilter_) - m_staticTexHeader->SetLabel(_("Filter: All pairs")); - else - m_staticTexHeader->SetLabel(_("Filter: Single pair")); + // if (isGlobalFilter_) + // m_staticTexHeader->SetLabel("Filter all folder pairs")); + // else + // m_staticTexHeader->SetLabel("Filter single folder pair")); + // + m_staticTexHeader->SetLabel(_("Filter")); Fit(); } +void FilterDlg::onKeyEvent(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + + if (event.ControlDown()) + switch (keyCode) + { + case 'A': //CTRL + A + { + if (auto textCtrl = dynamic_cast<wxTextCtrl*>(event.GetEventObject())) + textCtrl->SetSelection(-1, -1); //select all + return; + } + } + event.Skip(); +} + + void FilterDlg::updateGui() { FilterConfig activeCfg = getFilter(); m_bitmapInclude->SetBitmap( - !NameFilter(activeCfg.includeFilter, FilterConfig().excludeFilter).isNull() ? - GlobalResources::getImage(wxT("include")) : - greyScale(GlobalResources::getImage(wxT("include")))); + !NameFilter::isNull(activeCfg.includeFilter, FilterConfig().excludeFilter) ? + GlobalResources::getImage(L"include") : + greyScale(GlobalResources::getImage(L"include"))); m_bitmapExclude->SetBitmap( - !NameFilter(FilterConfig().includeFilter, activeCfg.excludeFilter).isNull() ? - GlobalResources::getImage(wxT("exclude")) : - greyScale(GlobalResources::getImage(wxT("exclude")))); + !NameFilter::isNull(FilterConfig().includeFilter, activeCfg.excludeFilter) ? + GlobalResources::getImage(L"exclude") : + greyScale(GlobalResources::getImage(L"exclude"))); m_bitmapFilterDate->SetBitmap( activeCfg.unitTimeSpan != UTIME_NONE ? - GlobalResources::getImage(wxT("clock")) : - greyScale(GlobalResources::getImage(wxT("clock")))); + GlobalResources::getImage(L"clock") : + greyScale(GlobalResources::getImage(L"clock"))); m_bitmapFilterSize->SetBitmap( activeCfg.unitSizeMin != USIZE_NONE || activeCfg.unitSizeMax != USIZE_NONE ? - GlobalResources::getImage(wxT("size")) : - greyScale(GlobalResources::getImage(wxT("size")))); + GlobalResources::getImage(L"size") : + greyScale(GlobalResources::getImage(L"size"))); - //m_spinCtrlTimespan->Enable(activeCfg.unitTimeSpan == UTIME_LAST_X_HOURS); + m_spinCtrlTimespan->Enable(activeCfg.unitTimeSpan == UTIME_LAST_X_DAYS); m_spinCtrlMinSize ->Enable(activeCfg.unitSizeMin != USIZE_NONE); m_spinCtrlMaxSize ->Enable(activeCfg.unitSizeMax != USIZE_NONE); } @@ -286,22 +302,9 @@ void FilterDlg::OnApply(wxCommandEvent& event) } -void FilterDlg::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void FilterDlg::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - - ReturnSmallDlg::ButtonPressed zen::showFilterDialog(bool isGlobalFilter, FilterConfig& filter) { - FilterDlg filterDlg(NULL, + FilterDlg filterDlg(nullptr, isGlobalFilter, //is main filter dialog filter); return static_cast<ReturnSmallDlg::ButtonPressed>(filterDlg.ShowModal()); @@ -320,8 +323,8 @@ public: private: void OnOK(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); + void OnCancel(wxCommandEvent& event) { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } + void OnClose (wxCloseEvent& event) { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } void OnDelOnBothSides(wxCommandEvent& event); void OnUseRecycler(wxCommandEvent& event); @@ -403,16 +406,6 @@ void DeleteDialog::OnOK(wxCommandEvent& event) EndModal(ReturnSmallDlg::BUTTON_OKAY); } -void DeleteDialog::OnCancel(wxCommandEvent& event) -{ - EndModal(ReturnSmallDlg::BUTTON_CANCEL); -} - -void DeleteDialog::OnClose(wxCloseEvent& event) -{ - EndModal(ReturnSmallDlg::BUTTON_CANCEL); -} - void DeleteDialog::OnDelOnBothSides(wxCommandEvent& event) { updateGui(); @@ -429,7 +422,7 @@ ReturnSmallDlg::ButtonPressed zen::showDeleteDialog(const std::vector<zen::FileS bool& deleteOnBothSides, bool& useRecycleBin) { - DeleteDialog confirmDeletion(NULL, + DeleteDialog confirmDeletion(nullptr, rowsOnLeft, rowsOnRight, deleteOnBothSides, @@ -518,7 +511,7 @@ ReturnSmallDlg::ButtonPressed zen::showSyncPreviewDlg( const zen::SyncStatistics& statistics, bool& dontShowAgain) { - SyncPreviewDlg preview(NULL, + SyncPreviewDlg preview(nullptr, variantName, statistics, dontShowAgain); @@ -641,7 +634,7 @@ void CompareCfgDialog::OnShowHelp(wxCommandEvent& event) ReturnSmallDlg::ButtonPressed zen::showCompareCfgDialog(CompConfig& cmpConfig) { - CompareCfgDialog syncDlg(NULL, cmpConfig); + CompareCfgDialog syncDlg(nullptr, cmpConfig); return static_cast<ReturnSmallDlg::ButtonPressed>(syncDlg.ShowModal()); } @@ -710,7 +703,7 @@ GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* parent, xmlAccess::XmlGlobalSetti Fit(); //automatically fit column width to match totl grid width - Connect(wxEVT_SIZE, wxSizeEventHandler(GlobalSettingsDlg::OnResize), NULL, this); + Connect(wxEVT_SIZE, wxSizeEventHandler(GlobalSettingsDlg::OnResize), nullptr, this); wxSizeEvent dummy; OnResize(dummy); } @@ -749,7 +742,7 @@ void GlobalSettingsDlg::OnOkay(wxCommandEvent& event) void GlobalSettingsDlg::OnResetDialogs(wxCommandEvent& event) { if (showQuestionDlg(ReturnQuestionDlg::BUTTON_YES | ReturnQuestionDlg::BUTTON_CANCEL, - _("Restore all hidden dialogs?")) == ReturnQuestionDlg::BUTTON_YES) + _("Make hidden dialogs and warning messages visible again?")) == ReturnQuestionDlg::BUTTON_YES) settings.optDialogs.resetDialogs(); } @@ -844,7 +837,7 @@ void GlobalSettingsDlg::OnRemoveRow(wxCommandEvent& event) ReturnSmallDlg::ButtonPressed zen::showGlobalSettingsDlg(xmlAccess::XmlGlobalSettings& globalSettings) { - GlobalSettingsDlg settingsDlg(NULL, globalSettings); + GlobalSettingsDlg settingsDlg(nullptr, globalSettings); return static_cast<ReturnSmallDlg::ButtonPressed>(settingsDlg.ShowModal()); } //######################################################################################## @@ -897,7 +890,7 @@ SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& t new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" #endif - long style = wxCAL_SHOW_HOLIDAYS; + long style = wxCAL_SHOW_HOLIDAYS | wxCAL_SHOW_SURROUNDING_WEEKS; #ifdef FFS_WIN DWORD firstDayOfWeek = 0; @@ -925,6 +918,13 @@ SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& t m_calendarTo ->SetDate(utcToLocalDateTime(to<time_t>(timeTo_))); m_buttonOkay->SetFocus(); + + //wxDatePickerCtrl::BestSize() does not respect year field and trims it, both wxMSW/wxGTK - why isn't there anybody testing this wxWidgets stuff??? + wxSize minSz = m_calendarFrom->GetBestSize(); + minSz.x += 30; + m_calendarFrom->SetMinSize(minSz); + m_calendarTo ->SetMinSize(minSz); + Fit(); } @@ -962,6 +962,6 @@ void SelectTimespanDlg::OnOkay(wxCommandEvent& event) ReturnSmallDlg::ButtonPressed zen::showSelectTimespanDlg(Int64& timeFrom, Int64& timeTo) { - SelectTimespanDlg timeSpanDlg(NULL, timeFrom, timeTo); + SelectTimespanDlg timeSpanDlg(nullptr, timeFrom, timeTo); return static_cast<ReturnSmallDlg::ButtonPressed>(timeSpanDlg.ShowModal()); } diff --git a/ui/sorting.h b/ui/sorting.h index 15e04a62..807a9ce3 100644 --- a/ui/sorting.h +++ b/ui/sorting.h @@ -19,16 +19,16 @@ namespace { struct CompileTimeReminder : public FSObjectVisitor { - virtual void visit(const FileMapping& fileObj ) {} + virtual void visit(const FileMapping& fileObj) {} virtual void visit(const SymLinkMapping& linkObj) {} - virtual void visit(const DirMapping& dirObj ) {} + virtual void visit(const DirMapping& dirObj ) {} } checkDymanicCasts; //just a compile-time reminder to check dynamic casts in this file } inline bool isDirectoryMapping(const FileSystemObject& fsObj) { - return dynamic_cast<const DirMapping*>(&fsObj) != NULL; + return dynamic_cast<const DirMapping*>(&fsObj) != nullptr; } @@ -97,8 +97,8 @@ bool lessFilesize(const FileSystemObject& a, const FileSystemObject& b) else if (b.isEmpty<side>()) return true; - const bool isDirA = dynamic_cast<const DirMapping*>(&a) != NULL; - const bool isDirB = dynamic_cast<const DirMapping*>(&b) != NULL; + const bool isDirA = dynamic_cast<const DirMapping*>(&a) != nullptr; + const bool isDirB = dynamic_cast<const DirMapping*>(&b) != nullptr; //directories second last if (isDirA) @@ -110,9 +110,9 @@ bool lessFilesize(const FileSystemObject& a, const FileSystemObject& b) const FileMapping* fileObjB = dynamic_cast<const FileMapping*>(&b); //then symlinks - if (fileObjA == NULL) + if (!fileObjA) return false; - else if (fileObjB == NULL) + else if (!fileObjB) return true; //return list beginning with largest files first @@ -160,9 +160,9 @@ bool lessExtension(const FileSystemObject& a, const FileSystemObject& b) const FileMapping* fileObjA = dynamic_cast<const FileMapping*>(&a); const FileMapping* fileObjB = dynamic_cast<const FileMapping*>(&b); - if (fileObjA == NULL) + if (!fileObjA) return false; //directories last - else if (fileObjB == NULL) + else if (!fileObjB) return true; //directories last return makeSortDirection(LessFilename(), Int2Type<ascending>())(fileObjA->getExtension<side>(), fileObjB->getExtension<side>()); diff --git a/ui/sync_cfg.cpp b/ui/sync_cfg.cpp index 4da98b8e..4f6df013 100644 --- a/ui/sync_cfg.cpp +++ b/ui/sync_cfg.cpp @@ -534,7 +534,7 @@ ReturnSyncConfig::ButtonPressed zen::showSyncConfigDlg(CompareVariant compareVar xmlAccess::OnGuiError* handleError, // ExecWhenFinishedCfg* execWhenFinished) //optional input parameter { - SyncCfgDialog syncDlg(NULL, + SyncCfgDialog syncDlg(nullptr, compareVar, syncCfg, handleError, diff --git a/ui/tray_icon.cpp b/ui/tray_icon.cpp index 26556742..51441e36 100644 --- a/ui/tray_icon.cpp +++ b/ui/tray_icon.cpp @@ -162,20 +162,20 @@ class FfsTrayIcon::TaskBarImpl : public wxTaskBarIcon public: TaskBarImpl(FfsTrayIcon& parent) : parent_(&parent) {} - void parentHasDied() { parent_ = NULL; } + void parentHasDied() { parent_ = nullptr; } private: virtual wxMenu* CreatePopupMenu() { if (!parent_) - return NULL; + return nullptr; wxMenu* contextMenu = new wxMenu; contextMenu->Append(CONTEXT_ABOUT, _("&About...")); contextMenu->AppendSeparator(); contextMenu->Append(CONTEXT_RESTORE, _("&Restore")); //event handling - contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FfsTrayIcon::OnContextMenuSelection), NULL, parent_); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FfsTrayIcon::OnContextMenuSelection), nullptr, parent_); return contextMenu; //ownership transferred to caller } @@ -188,14 +188,14 @@ FfsTrayIcon::FfsTrayIcon() : trayIcon(new TaskBarImpl(*this)) { trayIcon->SetIcon(generateIcon(0), wxT("FreeFileSync")); - trayIcon->Connect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(FfsTrayIcon::OnDoubleClick), NULL, this); //register double-click + trayIcon->Connect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(FfsTrayIcon::OnDoubleClick), nullptr, this); //register double-click } FfsTrayIcon::~FfsTrayIcon() { trayIcon->RemoveIcon(); //hide icon until final deletion takes place - trayIcon->Disconnect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(FfsTrayIcon::OnDoubleClick), NULL, this); + trayIcon->Disconnect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(FfsTrayIcon::OnDoubleClick), nullptr, this); trayIcon->parentHasDied(); //TaskBarImpl (potentially) has longer lifetime than FfsTrayIcon: avoid callback! //use wxWidgets delayed destruction: delete during next idle loop iteration (handle late window messages, e.g. when double-clicking) @@ -204,7 +204,7 @@ FfsTrayIcon::~FfsTrayIcon() } -void FfsTrayIcon::setToolTip2(const wxString& toolTipText, double fraction) +void FfsTrayIcon::setToolTip(const wxString& toolTipText, double fraction) { trayIcon->SetIcon(generateIcon(fraction), toolTipText); } diff --git a/ui/tray_icon.h b/ui/tray_icon.h index e9778d1e..d1522602 100644 --- a/ui/tray_icon.h +++ b/ui/tray_icon.h @@ -19,7 +19,7 @@ public: FfsTrayIcon(); ~FfsTrayIcon(); - void setToolTip2(const wxString& toolTipText, double fraction = 0); //number between [0, 1], for small progress indicator + void setToolTip(const wxString& toolTipText, double fraction = 0); //number between [0, 1], for small progress indicator private: FfsTrayIcon(const FfsTrayIcon&); diff --git a/ui/tree_view.cpp b/ui/tree_view.cpp index cd29938e..49548142 100644 --- a/ui/tree_view.cpp +++ b/ui/tree_view.cpp @@ -19,6 +19,21 @@ using namespace zen; +inline +void TreeView::compressNode(Container& cont) //remove single-element sub-trees -> gain clarity + usability (call *after* inclusion check!!!) +{ + if (cont.subDirs.empty() || //single files node or... + (cont.firstFile == nullptr && //single dir node... + cont.subDirs.size() == 1 && // + cont.subDirs[0].firstFile == nullptr && //...that is empty + cont.subDirs[0].subDirs.empty())) // + { + cont.subDirs.clear(); + cont.firstFile = nullptr; + } +} + + template <class Function> //(const FileSystemObject&) -> bool void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in TreeView::Container& cont, //out @@ -41,7 +56,7 @@ void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in }; - cont.firstFile = NULL; + cont.firstFile = nullptr; std::for_each(hierObj.refSubFiles().begin(), hierObj.refSubFiles().end(), [&](FileMapping& fileObj) { @@ -80,15 +95,7 @@ void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in if (pred(subDirObj) || subDirView.firstFile || !subDirView.subDirs.empty()) { subDirView.objId = subDirObj.getId(); - - //------------------- small hack -------------------------------------------- - //remove single-element sub-trees (*after* inclusion check!!!) - if (subDirView.subDirs.empty() || - (subDirView.firstFile == NULL && subDirView.subDirs.size() == 1 && subDirView.subDirs[0].subDirs.empty() && subDirView.subDirs[0].firstFile == NULL)) - { - subDirView.subDirs.clear(); - subDirView.firstFile = NULL; - } + compressNode(subDirView); } else cont.subDirs.pop_back(); @@ -98,16 +105,15 @@ void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in namespace { -//generate nice percentage numbers which sum up to 100 +//generate nice percentage numbers which precisely sum up to 100 void calcPercentage(std::vector<std::pair<UInt64, int*>>& workList) { const UInt64 total = std::accumulate(workList.begin(), workList.end(), UInt64(), - [](UInt64 val, const std::pair<UInt64, int*>& pair) { return val + pair.first; }); + [](UInt64 sum, const std::pair<UInt64, int*>& pair) { return sum + pair.first; }); if (total == 0U) //this case doesn't work with the error minimizing algorithm below { - std::for_each(workList.begin(), workList.end(), - [&](std::pair<UInt64, int*>& pair) { *pair.second = 0; }); + std::for_each(workList.begin(), workList.end(), [](std::pair<UInt64, int*>& pair) { *pair.second = 0; }); return; } @@ -119,18 +125,20 @@ void calcPercentage(std::vector<std::pair<UInt64, int*>>& workList) remainingPercent -= *pair.second; }); - //sort descending by absolute error - std::sort(workList.begin(), workList.end(), - [&](const std::pair<UInt64, int*>& lhs, const std::pair<UInt64, int*>& rhs) + //find #remainingPercent items with largest absolute error + remainingPercent = std::min(remainingPercent, static_cast<int>(workList.size())); + if (remainingPercent > 0) { - //return std::abs(*lhs.second - to<double>(lhs.first) * 100 / total) > std::abs(*rhs.second - to<double>(rhs.first) * 100 / total); - return (to<double>(lhs.first) - to<double>(rhs.first)) * 100 / to<double>(total) > *lhs.second - *rhs.second; - }); + std::nth_element(workList.begin(), workList.begin() + remainingPercent - 1, workList.end(), + [total](const std::pair<UInt64, int*>& lhs, const std::pair<UInt64, int*>& rhs) + { + //return std::abs(*lhs.second - to<double>(lhs.first) * 100 / total) > std::abs(*rhs.second - to<double>(rhs.first) * 100 / total); + return (to<double>(lhs.first) - to<double>(rhs.first)) * 100 / to<double>(total) > *lhs.second - *rhs.second; + }); - //distribute remaining percent so that overall error is minimized as much as possible - remainingPercent = std::min(std::max(0, remainingPercent), static_cast<int>(workList.size())); - std::for_each(workList.begin(), workList.begin() + remainingPercent, - [&](std::pair<UInt64, int*>& pair) { ++*pair.second; }); + //distribute remaining percent so that overall error is minimized as much as possible + std::for_each(workList.begin(), workList.begin() + remainingPercent, [&](std::pair<UInt64, int*>& pair) { ++*pair.second; }); + } } } @@ -253,7 +261,7 @@ void TreeView::applySubView(std::vector<RootNodeImpl>&& newView) case TreeView::TYPE_FILES: break; //none!!! } - return NULL; + return nullptr; }; zen::hash_set<const HierarchyObject*> expandedNodes; @@ -272,8 +280,11 @@ void TreeView::applySubView(std::vector<RootNodeImpl>&& newView) //set default flat tree flatTree.clear(); - if (folderCmpView.size() == 1) - getChildren(folderCmpView[0], 0, flatTree); //do not show root + if (folderCmp.size() == 1) //single folder pair case (empty pairs were already removed!) do NOT use folderCmpView for this check! + { + if (!folderCmpView.empty()) //it may really be! + getChildren(folderCmpView[0], 0, flatTree); //do not show root + } else { std::vector<std::pair<UInt64, int*>> workList; @@ -316,13 +327,19 @@ void TreeView::updateView(Predicate pred) std::for_each(folderCmp.begin(), folderCmp.end(), [&](const std::shared_ptr<BaseDirMapping>& baseObj) { - if (!baseObj->getBaseDirPf<LEFT_SIDE>().empty() || !baseObj->getBaseDirPf<RIGHT_SIDE>().empty()) + newView.push_back(TreeView::RootNodeImpl()); + RootNodeImpl& root = newView.back(); + this->extractVisibleSubtree(*baseObj, root, pred); //"this->" is bogus for a static method, but GCC screws this one up + + //warning: the following lines are almost 1:1 copy from extractVisibleSubtree: + //however we *cannot* reuse code here; this were only possible if we could replace "std::vector<RootNodeImpl>" by "Container"! + if (root.firstFile || !root.subDirs.empty()) { - newView.push_back(TreeView::RootNodeImpl()); - RootNodeImpl& root = newView.back(); root.baseMap = baseObj; - this->extractVisibleSubtree(*baseObj, root, pred); //"this->" is bogus for a static method, but GCC screws this one up + compressNode(root); } + else + newView.pop_back(); }); applySubView(std::move(newView)); @@ -419,15 +436,15 @@ void TreeView::reduceNode(size_t row) } -int TreeView::getParent(size_t row) const +ptrdiff_t TreeView::getParent(size_t row) const { if (row < flatTree.size()) { const size_t level = flatTree[row].level_; - for (; row > 0; --row) - if (flatTree[row - 1].level_ < level) - return row - 1; + while (row-- > 0) + if (flatTree[row].level_ < level) + return row; } return -1; } @@ -525,6 +542,13 @@ void TreeView::setData(FolderComparison& newData) std::vector<TreeLine >().swap(flatTree); //free mem std::vector<RootNodeImpl>().swap(folderCmpView); // folderCmp = newData; + + //remove truly empty folder pairs as early as this: we want to distinguish single/multiple folder pair cases by looking at "folderCmp" + vector_remove_if(folderCmp, [](const std::shared_ptr<BaseDirMapping>& baseObj) + { + return baseObj->getBaseDirPf<LEFT_SIDE >().empty() && + baseObj->getBaseDirPf<RIGHT_SIDE>().empty(); + }); } @@ -561,7 +585,7 @@ std::unique_ptr<TreeView::Node> TreeView::getLine(size_t row) const break; } } - return NULL; + return nullptr; } //########################################################################################################## @@ -606,11 +630,11 @@ public: grid_(grid), showPercentBar(true) { - grid.getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(GridDataNavi::onKeyDown), NULL, this); - grid.Connect(EVENT_GRID_MOUSE_LEFT_DOWN, GridClickEventHandler(GridDataNavi::onMouseLeft ), NULL, this); - grid.Connect(EVENT_GRID_MOUSE_LEFT_DOUBLE, GridClickEventHandler(GridDataNavi::onMouseLeftDouble ), NULL, this); - grid.Connect(EVENT_GRID_COL_LABEL_MOUSE_RIGHT, GridClickEventHandler(GridDataNavi::onGridLabelContext), NULL, this ); - grid.Connect(EVENT_GRID_COL_LABEL_MOUSE_LEFT, GridClickEventHandler(GridDataNavi::onGridLabelLeftClick ), NULL, this ); + grid.getMainWin().Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(GridDataNavi::onKeyDown), nullptr, this); + grid.Connect(EVENT_GRID_MOUSE_LEFT_DOWN, GridClickEventHandler(GridDataNavi::onMouseLeft ), nullptr, this); + grid.Connect(EVENT_GRID_MOUSE_LEFT_DOUBLE, GridClickEventHandler(GridDataNavi::onMouseLeftDouble ), nullptr, this); + grid.Connect(EVENT_GRID_COL_LABEL_MOUSE_RIGHT, GridClickEventHandler(GridDataNavi::onGridLabelContext), nullptr, this ); + grid.Connect(EVENT_GRID_COL_LABEL_MOUSE_LEFT, GridClickEventHandler(GridDataNavi::onGridLabelLeftClick ), nullptr, this ); } void setShowPercentage(bool value) { showPercentBar = value; grid_.Refresh(); } @@ -619,7 +643,7 @@ public: private: virtual size_t getRowCount() const { return treeDataView_ ? treeDataView_->linesTotal() : 0; } - virtual wxString getValue(int row, ColumnType colType) const + virtual wxString getValue(size_t row, ColumnType colType) const { if (treeDataView_) { @@ -677,7 +701,7 @@ private: static const int CELL_BORDER = 2; - virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, int row, bool enabled, bool selected, bool hasFocus) + virtual void renderRowBackgound(wxDC& dc, const wxRect& rect, size_t row, bool enabled, bool selected, bool hasFocus) { if (enabled) { @@ -691,7 +715,7 @@ private: clearArea(dc, rect, wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE)); } - virtual void renderCell(Grid& grid, wxDC& dc, const wxRect& rect, int row, ColumnType colType) + virtual void renderCell(Grid& grid, wxDC& dc, const wxRect& rect, size_t row, ColumnType colType) { //wxRect rectTmp= drawCellBorder(dc, rect); wxRect rectTmp = rect; @@ -714,8 +738,8 @@ private: // rect.height)), wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); //consume space - rectTmp.x += node->level_ * widthLevelStep; - rectTmp.width -= node->level_ * widthLevelStep; + rectTmp.x += static_cast<int>(node->level_) * widthLevelStep; + rectTmp.width -= static_cast<int>(node->level_) * widthLevelStep; rectTmp.x += CELL_BORDER; rectTmp.width -= CELL_BORDER; @@ -777,7 +801,7 @@ private: dc.SetBrush(*wxTRANSPARENT_BRUSH); dc.DrawRectangle(areaPerc); } - dc.DrawLabel(toString<wxString>(node->percent_) + L"%", areaPerc, wxALIGN_CENTER); + dc.DrawLabel(numberTo<wxString>(node->percent_) + L"%", areaPerc, wxALIGN_CENTER); rectTmp.x += widthPercentBar + 2 * CELL_BORDER; rectTmp.width -= widthPercentBar + 2 * CELL_BORDER; @@ -867,7 +891,7 @@ private: } } - virtual size_t getBestSize(wxDC& dc, int row, ColumnType colType) + virtual size_t getBestSize(wxDC& dc, size_t row, ColumnType colType) { // -> synchronize renderCell() <-> getBestSize() <-> onMouseLeft() @@ -910,7 +934,7 @@ private: if (cellArea.width > 0 && cellArea.height > 0) { const int tolerance = 1; - const int xNodeStatusFirst = -tolerance + cellArea.x + node->level_ * widthLevelStep + CELL_BORDER + (showPercentBar ? widthPercentBar + 2 * CELL_BORDER : 0); + const int xNodeStatusFirst = -tolerance + cellArea.x + static_cast<int>(node->level_) * widthLevelStep + CELL_BORDER + (showPercentBar ? widthPercentBar + 2 * CELL_BORDER : 0); const int xNodeStatusLast = xNodeStatusFirst + widthNodeStatus + 2 * tolerance; // -> synchronize renderCell() <-> getBestSize() <-> onMouseLeft() @@ -964,54 +988,49 @@ private: keyCode = WXK_NUMPAD_LEFT; } - int row = grid_.getGridCursor().first; - if (row < 0) - { - row = 0; - grid_.setGridCursor(0); - } + const size_t rowCount = grid_.getRowCount(); + if (rowCount == 0) return; + + size_t row = grid_.getGridCursor().first; + if (event.ShiftDown()) + ; + else if (event.ControlDown()) + ; else - { - if (event.ShiftDown()) - ; - else if (event.ControlDown()) - ; - else - switch (keyCode) - { - case WXK_LEFT: - case WXK_NUMPAD_LEFT: - if (treeDataView_) - switch (treeDataView_->getStatus(row)) - { - case TreeView::STATUS_EXPANDED: - return reduceNode(row); - case TreeView::STATUS_REDUCED: - case TreeView::STATUS_EMPTY: - - const int parentRow = treeDataView_->getParent(row); - if (parentRow >= 0) - grid_.setGridCursor(parentRow); - break; - } - return; //swallow event + switch (keyCode) + { + case WXK_LEFT: + case WXK_NUMPAD_LEFT: + if (treeDataView_) + switch (treeDataView_->getStatus(row)) + { + case TreeView::STATUS_EXPANDED: + return reduceNode(row); + case TreeView::STATUS_REDUCED: + case TreeView::STATUS_EMPTY: - case WXK_RIGHT: - case WXK_NUMPAD_RIGHT: - if (treeDataView_) - switch (treeDataView_->getStatus(row)) - { - case TreeView::STATUS_EXPANDED: - grid_.setGridCursor(std::min(static_cast<int>(grid_.getRowCount()) - 1, row + 1)); - break; - case TreeView::STATUS_REDUCED: - return expandNode(row); - case TreeView::STATUS_EMPTY: - break; - } - return; //swallow event - } - } + const int parentRow = treeDataView_->getParent(row); + if (parentRow >= 0) + grid_.setGridCursor(parentRow); + break; + } + return; //swallow event + + case WXK_RIGHT: + case WXK_NUMPAD_RIGHT: + if (treeDataView_) + switch (treeDataView_->getStatus(row)) + { + case TreeView::STATUS_EXPANDED: + grid_.setGridCursor(std::min(rowCount - 1, row + 1)); + break; + case TreeView::STATUS_REDUCED: + return expandNode(row); + case TreeView::STATUS_EMPTY: + break; + } + return; //swallow event + } event.Skip(); } @@ -1076,7 +1095,7 @@ private: } } - void expandNode(int row) + void expandNode(size_t row) { treeDataView_->expandNode(row); grid_.Refresh(); //this one clears selection (changed row count) @@ -1084,7 +1103,7 @@ private: //grid_.autoSizeColumns(); -> doesn't look as good as expected } - void reduceNode(int row) + void reduceNode(size_t row) { treeDataView_->reduceNode(row); grid_.Refresh(); //this one clears selection (changed row count) diff --git a/ui/tree_view.h b/ui/tree_view.h index 9f8cb526..3bb741e6 100644 --- a/ui/tree_view.h +++ b/ui/tree_view.h @@ -84,13 +84,13 @@ public: BaseDirMapping& baseMap_; }; - std::unique_ptr<Node> getLine(size_t row) const; //return NULL on error + std::unique_ptr<Node> getLine(size_t row) const; //return nullptr on error size_t linesTotal() const { return flatTree.size(); } void expandNode(size_t row); void reduceNode(size_t row); NodeStatus getStatus(size_t row) const; - int getParent(size_t row) const; //return < 0 if none + ptrdiff_t getParent(size_t row) const; //return < 0 if none void setSortDirection(ColumnTypeNavi colType, bool ascending); //apply permanently! std::pair<ColumnTypeNavi, bool> getSortDirection() { return std::make_pair(sortColumn, sortAscending); } @@ -101,7 +101,7 @@ private: struct Container { - Container() : firstFile(NULL) {} + Container() : firstFile(nullptr) {} UInt64 bytesGross; UInt64 bytesNet; //files in this directory only std::vector<DirNodeImpl> subDirs; @@ -110,7 +110,7 @@ private: struct DirNodeImpl : public Container { - DirNodeImpl() : objId(NULL) {} + DirNodeImpl() : objId(nullptr) {} FileSystemObject::ObjectId objId; //weak pointer to DirMapping }; @@ -129,14 +129,15 @@ private: struct TreeLine { - TreeLine(unsigned int level, int percent, const Container* node, enum NodeType type) : level_(level), percent_(percent), node_(node), type_(type) {} + TreeLine(size_t level, int percent, const Container* node, enum NodeType type) : level_(level), percent_(percent), node_(node), type_(type) {} - unsigned int level_; + size_t level_; int percent_; //[0, 100] const Container* node_; // NodeType type_; //we choose to increase size of "flatTree" rather than "folderCmpView" by not using dynamic polymorphism! }; + static void compressNode(Container& cont); template <class Function> static void extractVisibleSubtree(HierarchyObject& hierObj, Container& cont, Function includeObject); void getChildren(const Container& cont, size_t level, std::vector<TreeLine>& output); |