diff options
129 files changed, 6491 insertions, 6450 deletions
diff --git a/FreeFileSync/Build/Changelog.txt b/FreeFileSync/Build/Changelog.txt index d1676331..bfb1b000 100644 --- a/FreeFileSync/Build/Changelog.txt +++ b/FreeFileSync/Build/Changelog.txt @@ -1,16 +1,30 @@ +FreeFileSync 6.8 [2014-08-01] +----------------------------- +New comparison option to ignore file time shift in hours +Tentatively disabled DST hack affecting FAT file creation times +New menu option to reset gui layout +File sizes ignore sync direction in overview panel +Sort by file name also sorts folder names +Main grid column "full path" includes file name +Always position comparison progress below main buttons +Fixed high-precision tick count calculations +Fully restart directory traversal on errors +Updated help file with steps to schedule a batch job (OS X) + + FreeFileSync 6.7 [2014-07-01] ----------------------------- Redesigned comparison progress statistics Fixed crash when loading incompatible config file -Added <new> button to config panel +Added "new" button to config panel Avoid sync progress dialog repositioning Resolved crash when loading sync settings for Arabic locale Restored cancel button width -Help window not forced to float over main dialog +Help window not forced to float over main dialog (Windows) Fixed overwriting old-format batch files Harmonized view category sequence Merged similar translation items -Fixed crash when scrolling help file without focus +Fixed crash when scrolling help window without focus FreeFileSync 6.6 [2014-06-01] diff --git a/FreeFileSync/Build/Help/html/Comparison Settings.html b/FreeFileSync/Build/Help/html/Comparison Settings.html index 08d3b44b..49e137a2 100644 --- a/FreeFileSync/Build/Help/html/Comparison Settings.html +++ b/FreeFileSync/Build/Help/html/Comparison Settings.html @@ -9,7 +9,7 @@ <H2>Comparison Settings</H2> -<P><IMG SRC="../img/CmpSettings.png"> +<P><IMG SRC="../img/comparison_settings.png"> <br> </P> @@ -23,7 +23,7 @@ <LI><B>Direct:</B> Evaluate the symbolic link object - directly. Symbolic links will be shown as a separate entity on grid. + directly. Symbolic links will be shown as separate entities. Links pointing to directories are not traversed and the link object is copied directly during synchronization.<BR> diff --git a/FreeFileSync/Build/Help/html/Daylight Saving Time.html b/FreeFileSync/Build/Help/html/Daylight Saving Time.html index 8d51498e..9709111c 100644 --- a/FreeFileSync/Build/Help/html/Daylight Saving Time.html +++ b/FreeFileSync/Build/Help/html/Daylight Saving Time.html @@ -12,7 +12,7 @@ <P>A common problem synchronization software has to handle are +-1 hour file time shifts after a Daylight Saving Time (DST) switch has occurred. This can be observed for example when a FAT-formatted -volume is compared against an NTFS volume as is the case when synchronizing a local disk against a +volume is compared against an NTFS volume, like when synchronizing a local disk against a USB memory stick. Files that previously appeared to be in sync are now shown with an one hour modification time offset, although they have not been modified by the user or the operating system.</P> @@ -25,10 +25,10 @@ local time.</P> has to be converted into the other first. In either way Windows uses the current DST status as well as the current time zone for its calculations. Consequently the result of this comparison is -dependent from current system settings and in particular file times -that used to be the same can show up as different after a DST switch or when the time zone is changed.</P> +dependent from current system settings with the effect that file times +that used to be the same show up as different after a DST switch or when the time zone has changed.</P> -<P>For a detailed discussion about this issue refer to: +<P>For a detailed discussion about this issue see: <A HREF="http://www.codeproject.com/KB/datetime/dstbugs.aspx">http://www.codeproject.com/KB/datetime/dstbugs.aspx</A> </P> @@ -36,27 +36,12 @@ that used to be the same can show up as different after a DST switch or when the <h3>Solution:</h3> -<P>FreeFileSync automatically handles this problem by adding the missing time information. Each file on a -FAT volume automatically gets additional meta data encoded in its -creation date that enables a correct file time calculation. This not -only solves all DST issues but also time shifts that occur due to -travel between different time zones.</P> - -<BR> +<P>In FreeFileSync's comparison settings you can enter a full-hour time shift to ignore during comparison: +If you need to handle differences due to daylight saving time enter a one hour shift. If the differences are caused by changing the time zone +enter a larger shift as needed. +</P> -<div class="bluebox"> - <div class="bluebox_inner"> - <B>Note</B> - <ul STYLE="margin: 0"> - <LI>In order for FreeFileSync to start handling DST and timezone differences, an initial full synchronization - is required. Subsequent syncs will then never show a time difference again for unchanged files. - - <LI>If a FAT volume is scanned the first time by FreeFileSync this will take longer than usual - since additional meta data is written for each file. - </ul> - </div> -</div> -<BR CLEAR=LEFT> +<IMG SRC="../img/time_shift.png"><BR> </BODY> </HTML>
\ No newline at end of file diff --git a/FreeFileSync/Build/Help/html/RealtimeSync.html b/FreeFileSync/Build/Help/html/RealtimeSync.html index dfb46b7b..ca6b764b 100644 --- a/FreeFileSync/Build/Help/html/RealtimeSync.html +++ b/FreeFileSync/Build/Help/html/RealtimeSync.html @@ -23,7 +23,7 @@ a FreeFileSync batch job. <P> Start RealtimeSync.exe located in FreeFileSync's installation directory and enter all folders you want to monitor. Instead of doing this manually you can import a ffs_batch -file via <B>Menu → Program → Open</B>. This not only extracts all directories relevant for synchronization +file via <B>Menu → File → Open</B>. This not only extracts all directories relevant for synchronization but also sets up the command line to execute the ffs_batch file each time changes are detected. Now press <B>Start</B> to begin monitoring. </P> diff --git a/FreeFileSync/Build/Help/html/Schedule a Batch Job.html b/FreeFileSync/Build/Help/html/Schedule a Batch Job.html index eb746127..a1263ef3 100644 --- a/FreeFileSync/Build/Help/html/Schedule a Batch Job.html +++ b/FreeFileSync/Build/Help/html/Schedule a Batch Job.html @@ -10,31 +10,40 @@ <H2>Schedule a Batch Job</H2> <OL> - <LI>Create a new batch job via FreeFileSync's main dialog: <B>Menu → Program → Save as batch job...</B><BR> + <LI>Create a new batch job via FreeFileSync's main dialog: <B>Menu → File → Save as batch job...</B><BR> + + <LI>By default FreeFileSync will show a progress dialog during synchronization and wait while the results dialog is shown. + If the progress dialog is not needed enable checkbox <B>Run minimized</B>. This will also skip the results dialog at the end. + <br><br> + Alternatively if you want to see the progress, but not pause at the results, it's sufficient to only select the <i>On completion</i> action <B>Close progress dialog</B>. + <br><br> - <LI>If the batch job shall run without user interaction or as part of an - unattended batch script, make sure that no popup dialog stops the progress:<BR>Enable checkbox <B>Run minimized</B> to avoid blocking while showing - the result after synchronization. Alternatively you can leave this option checked and select the <i>On completion</i> action <B>Close progress dialog</B> - located in synchronization settings. FreeFileSync will then show a progress dialog but close it automatically when it is finished.<BR> - <br> - <B>Note:</B> Even if the progress dialog is not shown at the beginning, you can make it - visible <B>during</B> synchronization by double-clicking the FreeFileSync notification area icon.<BR> - <BR> <IMG SRC="../img/SetupBatch.png"> <br><br> - <LI>In order to prevent error or warning popup messages from stopping progress, set <B>Handle errors</B> to either <B>Ignore</B> or <B>Stop</B>. + <div class="bluebox"> + <div class="bluebox_inner"> + <B>Note</B><BR> + Even if the progress dialog is not shown at the beginning, you can make it visible at any time <B>during</B> + synchronization by double-clicking the FreeFileSync notification area icon. + </div> + </div> + <BR CLEAR=LEFT> + <BR> + + <LI>If you don't want error or warning messages to pause synchronization, set <B>Handle errors</B> to either <B>Ignore</B> or <B>Stop</B>. <br> - <LI>Setup your operating system's scheduler + <LI>Setup the FreeFileSync batch job in your operating system's scheduler: <BR> <OL TYPE=A> - <LI><B>Windows 7 Task Scheduler:</B> + <hr/> + <LI><h3>Windows 7 Task Scheduler:</h3> <UL> - <LI>Go to Start and run <FONT FACE="Courier New, monospace"><B>taskschd.msc</B></FONT>. + <LI>Click on Start and run <FONT FACE="Courier New, monospace"><B>taskschd.msc</B></FONT>. - <LI>Create a new basic task and follow the wizard. + <LI>Create a new <b>basic task</b> and follow the wizard. <LI>Make <B>Program/script</B> point to the location of FreeFileSync.exe and insert the ffs_batch file into <B>Add arguments</B>. @@ -48,16 +57,40 @@ <div class="bluebox"> <div class="bluebox_inner"> <B>Note</B><BR> - Beginning with Windows Vista the <i>Program/script</i> always needs point to an executable file like FreeFileSync.exe even - if ffs_batch file association is set. If a ffs_batch file is entered instead the task will return with + Beginning with Windows Vista the <i>Program/script</i> always needs to point to an executable file like FreeFileSync.exe even + if ffs_batch file associations are setup. If a ffs_batch file were entered instead the task would return with error code 0xC1, "%1 is not a valid Win32 application". </div> </div> <BR CLEAR=LEFT> - + <BR> + <BR> + + <hr/> + <LI><h3>OS X Automator and Calendar:</h3> + <UL> + <LI VALUE=1>Open Launchpad and run <B>Automator</B>.<BR> + <IMG SRC="../img/launch_automator.png"><BR> + + <LI>Create a new <B>Calendar Alarm</B>.<BR> + <IMG SRC="../img/new_calendar_alarm.png"><BR> + + <LI>Drag and drop the ffs_batch file on the workflow panel.<BR> + <IMG SRC="../img/automator_file_dropped.png"><BR> + + <LI>Drag and drop action <i>Files & Folders/Open Finder Items</i> and add it to the workflow.<BR> + <IMG SRC="../img/open_finder_items.png"><BR> + + <LI>Go to <B>File → Save...</B> and save the Automator job.<BR> + <IMG SRC="../img/save_automator.png"><BR> + + <LI>The Calendar app will start automatically with the Automator job scheduled to the current day. You can now select a different time for synchronization or make it a recurring task.<BR> + <IMG SRC="../img/calendar_job_added.png"><BR> + </UL> <BR> - <LI><B>Windows XP Scheduled Tasks:</B> + <hr/> + <LI><h3>Windows XP Scheduled Tasks:</h3> <UL> <LI VALUE=1>Go to <B>Start → Control Panel → Scheduled Tasks</B> and select <B>Add Scheduled Task</B>. @@ -67,11 +100,13 @@ <FONT FACE="Courier New, monospace"><FreeFileSync installation folder>\FreeFileSync.exe <job name>.ffs_batch</FONT><BR> <BR> <IMG SRC="../img/ScheduleBatch.png"><BR> - </UL> - - <LI><B>Ubuntu Linux Gnome-schedule:</B> + </UL> + <BR> + + <hr/> + <LI><h3>Ubuntu Linux Gnome-schedule:</h3> <UL> - <LI>Install Gnome-schedule, if necessary: <FONT FACE="Courier New, monospace">sudo apt-get install gnome-schedule</FONT> + <LI>Install Gnome-schedule if necessary: <FONT FACE="Courier New, monospace">sudo apt-get install gnome-schedule</FONT> <LI>Go to <B>System → Preferences → Scheduled tasks</B> @@ -83,7 +118,6 @@ </OL> - </OL> </BODY> diff --git a/FreeFileSync/Build/Help/img/CmpSettings.png b/FreeFileSync/Build/Help/img/CmpSettings.png Binary files differdeleted file mode 100644 index 250f4f2d..00000000 --- a/FreeFileSync/Build/Help/img/CmpSettings.png +++ /dev/null diff --git a/FreeFileSync/Build/Help/img/SetupBatch.png b/FreeFileSync/Build/Help/img/SetupBatch.png Binary files differindex 88cb3e53..36ceb078 100644 --- a/FreeFileSync/Build/Help/img/SetupBatch.png +++ b/FreeFileSync/Build/Help/img/SetupBatch.png diff --git a/FreeFileSync/Build/Help/img/automator_file_dropped.png b/FreeFileSync/Build/Help/img/automator_file_dropped.png Binary files differnew file mode 100644 index 00000000..74059cd7 --- /dev/null +++ b/FreeFileSync/Build/Help/img/automator_file_dropped.png diff --git a/FreeFileSync/Build/Help/img/calendar_job_added.png b/FreeFileSync/Build/Help/img/calendar_job_added.png Binary files differnew file mode 100644 index 00000000..b570e435 --- /dev/null +++ b/FreeFileSync/Build/Help/img/calendar_job_added.png diff --git a/FreeFileSync/Build/Help/img/comparison_settings.png b/FreeFileSync/Build/Help/img/comparison_settings.png Binary files differnew file mode 100644 index 00000000..06fd2f91 --- /dev/null +++ b/FreeFileSync/Build/Help/img/comparison_settings.png diff --git a/FreeFileSync/Build/Help/img/launch_automator.png b/FreeFileSync/Build/Help/img/launch_automator.png Binary files differnew file mode 100644 index 00000000..90292bac --- /dev/null +++ b/FreeFileSync/Build/Help/img/launch_automator.png diff --git a/FreeFileSync/Build/Help/img/new_calendar_alarm.png b/FreeFileSync/Build/Help/img/new_calendar_alarm.png Binary files differnew file mode 100644 index 00000000..4ac71ae5 --- /dev/null +++ b/FreeFileSync/Build/Help/img/new_calendar_alarm.png diff --git a/FreeFileSync/Build/Help/img/open_finder_items.png b/FreeFileSync/Build/Help/img/open_finder_items.png Binary files differnew file mode 100644 index 00000000..936315bc --- /dev/null +++ b/FreeFileSync/Build/Help/img/open_finder_items.png diff --git a/FreeFileSync/Build/Help/img/save_automator.png b/FreeFileSync/Build/Help/img/save_automator.png Binary files differnew file mode 100644 index 00000000..875377b5 --- /dev/null +++ b/FreeFileSync/Build/Help/img/save_automator.png diff --git a/FreeFileSync/Build/Help/img/time_shift.png b/FreeFileSync/Build/Help/img/time_shift.png Binary files differnew file mode 100644 index 00000000..1f5ec846 --- /dev/null +++ b/FreeFileSync/Build/Help/img/time_shift.png diff --git a/FreeFileSync/Build/Help/img/win7scheduler.png b/FreeFileSync/Build/Help/img/win7scheduler.png Binary files differindex eabf331f..17f1dc2d 100644 --- a/FreeFileSync/Build/Help/img/win7scheduler.png +++ b/FreeFileSync/Build/Help/img/win7scheduler.png diff --git a/FreeFileSync/Build/Languages/german.lng b/FreeFileSync/Build/Languages/german.lng index ee084b96..1043a29e 100644 --- a/FreeFileSync/Build/Languages/german.lng +++ b/FreeFileSync/Build/Languages/german.lng @@ -7,9 +7,6 @@ <plural_definition>n == 1 ? 0 : 1</plural_definition> </header> -<source>Reset layout</source> -<target></target> - <source>Both sides have changed since last synchronization.</source> <target>Beide Seiten wurden seit der letzten Synchronisation verändert.</target> @@ -714,6 +711,9 @@ Die Befehlszeile wird ausgelöst, wenn: <source>&Find...</source> <target>S&uchen...</target> +<source>&Reset layout</source> +<target>Oberfläche &zurücksetzen</target> + <source>&Export file list...</source> <target>Dateiliste e&xportieren...</target> @@ -804,6 +804,15 @@ Die Befehlszeile wird ausgelöst, wenn: <source>Identify equal files by comparing the file content.</source> <target>Erkenne gleiche Dateien durch Vergleich des Dateiinhaltes.</target> +<source>Ignore time shift (in hours)</source> +<target>Zeitversatz ignorieren (in Stunden)</target> + +<source>Consider file times with specified offset as equal</source> +<target>Dateizeiten mit angegebenem Versatz als gleich ansehen</target> + +<source>Handle daylight saving time</source> +<target>Sommerzeit berücksichtigen</target> + <source>Symbolic links:</source> <target>Symbolische Links:</target> diff --git a/FreeFileSync/Source/RealtimeSync/application.cpp b/FreeFileSync/Source/RealtimeSync/application.cpp index 04530e3a..1ab5c688 100644 --- a/FreeFileSync/Source/RealtimeSync/application.cpp +++ b/FreeFileSync/Source/RealtimeSync/application.cpp @@ -119,25 +119,25 @@ void Application::onEnterEventLoop(wxEvent& event) //continue! } - //try to set config/batch-filename set by %1 parameter + //try to set config/batch- filepath set by %1 parameter std::vector<Zstring> commandArgs; for (int i = 1; i < argc; ++i) { - Zstring filename = toZ(argv[i]); + Zstring filepath = toZ(argv[i]); - if (!fileExists(filename)) //be a little tolerant + if (!fileExists(filepath)) //be a little tolerant { - if (fileExists(filename + Zstr(".ffs_real"))) - filename += Zstr(".ffs_real"); - else if (fileExists(filename + Zstr(".ffs_batch"))) - filename += Zstr(".ffs_batch"); + if (fileExists(filepath + Zstr(".ffs_real"))) + filepath += Zstr(".ffs_real"); + else if (fileExists(filepath + Zstr(".ffs_batch"))) + filepath += Zstr(".ffs_batch"); else { - showNotificationDialog(nullptr, DialogInfoType::ERROR2, PopupDialogCfg().setMainInstructions(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filename)))); + showNotificationDialog(nullptr, DialogInfoType::ERROR2, PopupDialogCfg().setMainInstructions(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filepath)))); return; } } - commandArgs.push_back(filename); + commandArgs.push_back(filepath); } Zstring cfgFilename; diff --git a/FreeFileSync/Source/RealtimeSync/main_dlg.cpp b/FreeFileSync/Source/RealtimeSync/main_dlg.cpp index 23cb4c66..934e9215 100644 --- a/FreeFileSync/Source/RealtimeSync/main_dlg.cpp +++ b/FreeFileSync/Source/RealtimeSync/main_dlg.cpp @@ -40,7 +40,7 @@ class DirectoryPanel : public FolderGenerated public: DirectoryPanel(wxWindow* parent) : FolderGenerated(parent), - dirName(*this, *m_buttonSelectDir, *m_txtCtrlDirectory) + dirpath_(*this, *m_buttonSelectDir, *m_txtCtrlDirectory) { #ifdef ZEN_LINUX //file drag and drop directly into the text control unhelpfully inserts in format "file://..<cr><nl>"; see folder_history_box.cpp @@ -49,11 +49,11 @@ public: #endif } - void setName(const wxString& dirname) { dirName.setName(dirname); } - wxString getName() const { return dirName.getName(); } + void setPath(const wxString& dirpath) { dirpath_.setPath(dirpath); } + wxString getPath() const { return dirpath_.getPath(); } private: - zen::DirectoryName<wxTextCtrl> dirName; + zen::DirectoryName<wxTextCtrl> dirpath_; }; @@ -93,7 +93,7 @@ MainDialog::MainDialog(wxDialog* dlg, const Zstring& cfgFileName) Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnKeyPressed), nullptr, this); //prepare drag & drop - dirNameFirst.reset(new DirectoryName<wxTextCtrl>(*m_panelMainFolder, *m_buttonSelectDirMain, *m_txtCtrlDirectoryMain, m_staticTextFinalPath)); + dirpathFirst.reset(new DirectoryName<wxTextCtrl>(*m_panelMainFolder, *m_buttonSelectDirMain, *m_txtCtrlDirectoryMain, m_staticTextFinalPath)); //--------------------------- load config values ------------------------------------ xmlAccess::XmlRealConfig newConfig; @@ -287,14 +287,14 @@ void MainDialog::OnConfigSave(wxCommandEvent& event) } -void MainDialog::loadConfig(const Zstring& filename) +void MainDialog::loadConfig(const Zstring& filepath) { xmlAccess::XmlRealConfig newConfig; try { std::wstring warningMsg; - xmlAccess::readRealOrBatchConfig(filename, newConfig, warningMsg); //throw FileError + xmlAccess::readRealOrBatchConfig(filepath, newConfig, warningMsg); //throw FileError if (!warningMsg.empty()) showNotificationDialog(this, DialogInfoType::WARNING, PopupDialogCfg().setDetailInstructions(warningMsg)); @@ -306,22 +306,22 @@ void MainDialog::loadConfig(const Zstring& filename) } setConfiguration(newConfig); - setLastUsedConfig(filename); + setLastUsedConfig(filepath); } -void MainDialog::setLastUsedConfig(const Zstring& filename) +void MainDialog::setLastUsedConfig(const Zstring& filepath) { //set title - if (filename == lastConfigFileName()) + if (filepath == lastConfigFileName()) { SetTitle(L"RealtimeSync - " + _("Automated Synchronization")); currentConfigFileName.clear(); } else { - SetTitle(utfCvrtTo<wxString>(filename)); - currentConfigFileName = filename; + SetTitle(utfCvrtTo<wxString>(filepath)); + currentConfigFileName = filepath; } } @@ -350,13 +350,13 @@ void MainDialog::onFilesDropped(FileDropEvent& event) void MainDialog::setConfiguration(const xmlAccess::XmlRealConfig& cfg) { //clear existing folders - dirNameFirst->setName(wxString()); + dirpathFirst->setPath(wxString()); clearAddFolders(); if (!cfg.directories.empty()) { //fill top folder - dirNameFirst->setName(utfCvrtTo<wxString>(*cfg.directories.begin())); + dirpathFirst->setPath(utfCvrtTo<wxString>(*cfg.directories.begin())); //fill additional folders addFolder(std::vector<Zstring>(cfg.directories.begin() + 1, cfg.directories.end())); @@ -374,9 +374,9 @@ xmlAccess::XmlRealConfig MainDialog::getConfiguration() { xmlAccess::XmlRealConfig output; - output.directories.push_back(utfCvrtTo<Zstring>(dirNameFirst->getName())); - for (const DirectoryPanel* dne : dirNamesExtra) - output.directories.push_back(utfCvrtTo<Zstring>(dne->getName())); + output.directories.push_back(utfCvrtTo<Zstring>(dirpathFirst->getPath())); + for (const DirectoryPanel* dne : dirpathsExtra) + output.directories.push_back(utfCvrtTo<Zstring>(dne->getPath())); output.commandline = utfCvrtTo<Zstring>(m_textCtrlCommand->GetValue()); output.delay = m_spinCtrlDelay->GetValue(); @@ -387,10 +387,10 @@ xmlAccess::XmlRealConfig MainDialog::getConfiguration() void MainDialog::OnAddFolder(wxCommandEvent& event) { - const Zstring topFolder = utfCvrtTo<Zstring>(dirNameFirst->getName()); + const Zstring topFolder = utfCvrtTo<Zstring>(dirpathFirst->getPath()); //clear existing top folder first - dirNameFirst->setName(wxString()); + dirpathFirst->setPath(wxString()); std::vector<Zstring> newFolders; newFolders.push_back(topFolder); @@ -403,10 +403,10 @@ void MainDialog::OnRemoveFolder(wxCommandEvent& event) { //find folder pair originating the event const wxObject* const eventObj = event.GetEventObject(); - for (auto it = dirNamesExtra.begin(); it != dirNamesExtra.end(); ++it) + for (auto it = dirpathsExtra.begin(); it != dirpathsExtra.end(); ++it) if (eventObj == static_cast<wxObject*>((*it)->m_bpButtonRemoveFolder)) { - removeAddFolder(it - dirNamesExtra.begin()); + removeAddFolder(it - dirpathsExtra.begin()); return; } } @@ -414,9 +414,9 @@ void MainDialog::OnRemoveFolder(wxCommandEvent& event) void MainDialog::OnRemoveTopFolder(wxCommandEvent& event) { - if (dirNamesExtra.size() > 0) + if (dirpathsExtra.size() > 0) { - dirNameFirst->setName(dirNamesExtra[0]->getName()); + dirpathFirst->setPath(dirpathsExtra[0]->getPath()); removeAddFolder(0); //remove first of additional folders } } @@ -439,7 +439,7 @@ void MainDialog::addFolder(const std::vector<Zstring>& newFolders, bool addFront #endif int folderHeight = 0; - for (const Zstring& dirname : newFolders) + for (const Zstring& dirpath : newFolders) { //add new folder pair DirectoryPanel* newFolder = new DirectoryPanel(m_scrolledWinFolders); @@ -451,23 +451,23 @@ void MainDialog::addFolder(const std::vector<Zstring>& newFolders, bool addFront if (addFront) { bSizerFolders->Insert(0, newFolder, 0, wxEXPAND, 5); - dirNamesExtra.insert(dirNamesExtra.begin(), newFolder); + dirpathsExtra.insert(dirpathsExtra.begin(), newFolder); } else { bSizerFolders->Add(newFolder, 0, wxEXPAND, 5); - dirNamesExtra.push_back(newFolder); + dirpathsExtra.push_back(newFolder); } //register events newFolder->m_bpButtonRemoveFolder->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolder), nullptr, this ); //insert directory name - newFolder->setName(utfCvrtTo<wxString>(dirname)); + newFolder->setPath(utfCvrtTo<wxString>(dirpath)); } //set size of scrolled window - const size_t additionalRows = std::min(dirNamesExtra.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown + const size_t additionalRows = std::min(dirpathsExtra.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown m_scrolledWinFolders->SetMinSize(wxSize( -1, folderHeight * static_cast<int>(additionalRows))); //adapt delete top folder pair button @@ -485,14 +485,14 @@ void MainDialog::removeAddFolder(size_t pos) wxWindowUpdateLocker dummy(this); //leads to GUI corruption problems on Linux/OS X! #endif - if (pos < dirNamesExtra.size()) + if (pos < dirpathsExtra.size()) { //remove folder pairs from window - DirectoryPanel* pairToDelete = dirNamesExtra[pos]; + DirectoryPanel* pairToDelete = dirpathsExtra[pos]; const int folderHeight = pairToDelete->GetSize().GetHeight(); bSizerFolders->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually - dirNamesExtra.erase(dirNamesExtra.begin() + pos); //remove last element in vector + dirpathsExtra.erase(dirpathsExtra.begin() + pos); //remove last element in vector //more (non-portable) wxWidgets bullshit: on OS X wxWindow::Destroy() screws up and calls "operator delete" directly rather than //the deferred deletion it is expected to do (and which is implemented correctly on Windows and Linux) //http://bb10.com/python-wxpython-devel/2012-09/msg00004.html @@ -500,11 +500,11 @@ void MainDialog::removeAddFolder(size_t pos) processAsync2([] {}, [pairToDelete] { pairToDelete->Destroy(); }); //set size of scrolled window - const size_t additionalRows = std::min(dirNamesExtra.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown + const size_t additionalRows = std::min(dirpathsExtra.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown m_scrolledWinFolders->SetMinSize(wxSize( -1, folderHeight * static_cast<int>(additionalRows))); //adapt delete top folder pair button - if (dirNamesExtra.size() == 0) + if (dirpathsExtra.size() == 0) { m_bpButtonRemoveTopFolder->Hide(); m_panelMainFolder->Layout(); @@ -524,7 +524,7 @@ void MainDialog::clearAddFolders() #endif bSizerFolders->Clear(true); - dirNamesExtra.clear(); + dirpathsExtra.clear(); m_scrolledWinFolders->SetMinSize(wxSize(-1, 0)); diff --git a/FreeFileSync/Source/RealtimeSync/main_dlg.h b/FreeFileSync/Source/RealtimeSync/main_dlg.h index 4e6f71b7..d70aac27 100644 --- a/FreeFileSync/Source/RealtimeSync/main_dlg.h +++ b/FreeFileSync/Source/RealtimeSync/main_dlg.h @@ -34,7 +34,7 @@ private: MainDialog(wxDialog* dlg, const Zstring& cfgFileName); ~MainDialog(); - void loadConfig(const Zstring& filename); + void loadConfig(const Zstring& filepath); virtual void OnClose (wxCloseEvent& event) { Destroy(); } virtual void OnShowHelp (wxCommandEvent& event); @@ -51,19 +51,19 @@ private: void setConfiguration(const xmlAccess::XmlRealConfig& cfg); xmlAccess::XmlRealConfig getConfiguration(); - void setLastUsedConfig(const Zstring& filename); + void setLastUsedConfig(const Zstring& filepath); void layoutAsync(); //call Layout() asynchronously - //void addFolder(const Zstring& dirname, bool addFront = false); + //void addFolder(const Zstring& dirpath, bool addFront = false); void addFolder(const std::vector<Zstring>& newFolders, bool addFront = false); void removeAddFolder(size_t pos); void clearAddFolders(); static const Zstring& lastConfigFileName(); - std::unique_ptr<zen::DirectoryName<wxTextCtrl>> dirNameFirst; - std::vector<DirectoryPanel*> dirNamesExtra; //additional pairs to the standard pair + std::unique_ptr<zen::DirectoryName<wxTextCtrl>> dirpathFirst; + std::vector<DirectoryPanel*> dirpathsExtra; //additional pairs to the standard pair Zstring currentConfigFileName; diff --git a/FreeFileSync/Source/RealtimeSync/monitor.cpp b/FreeFileSync/Source/RealtimeSync/monitor.cpp index 9f629310..b8cd57e8 100644 --- a/FreeFileSync/Source/RealtimeSync/monitor.cpp +++ b/FreeFileSync/Source/RealtimeSync/monitor.cpp @@ -24,14 +24,14 @@ namespace const int CHECK_DIR_INTERVAL = 1; //unit: [s] -std::vector<Zstring> getFormattedDirs(const std::vector<Zstring>& dirnamePhrases) //throw FileError +std::vector<Zstring> getFormattedDirs(const std::vector<Zstring>& dirpathPhrases) //throw FileError { - std::set<Zstring, LessFilename> dirnames; //make unique - for (const Zstring& phrase : std::set<Zstring, LessFilename>(dirnamePhrases.begin(), dirnamePhrases.end())) + std::set<Zstring, LessFilename> dirpaths; //make unique + for (const Zstring& phrase : std::set<Zstring, LessFilename>(dirpathPhrases.begin(), dirpathPhrases.end())) //make unique: no need to resolve duplicate phrases more than once! (consider "[volume name]" syntax) -> shouldn't this be already buffered by OS? - dirnames.insert(getFormattedDirectoryName(phrase)); + dirpaths.insert(getFormattedDirectoryPath(phrase)); - return std::vector<Zstring>(dirnames.begin(), dirnames.end()); + return std::vector<Zstring>(dirpaths.begin(), dirpaths.end()); } @@ -45,42 +45,42 @@ struct WaitResult }; WaitResult(const zen::DirWatcher::Entry& changedItem) : type(CHANGE_DETECTED), changedItem_(changedItem) {} - WaitResult(const Zstring& dirname) : type(CHANGE_DIR_MISSING), dirname_(dirname) {} + WaitResult(const Zstring& dirpath) : type(CHANGE_DIR_MISSING), dirpath_(dirpath) {} ChangeType type; zen::DirWatcher::Entry changedItem_; //for type == CHANGE_DETECTED: file or directory - Zstring dirname_; //for type == CHANGE_DIR_MISSING + Zstring dirpath_; //for type == CHANGE_DIR_MISSING }; -WaitResult waitForChanges(const std::vector<Zstring>& dirnamePhrases, //throw FileError +WaitResult waitForChanges(const std::vector<Zstring>& dirpathPhrases, //throw FileError const std::function<void(bool readyForSync)>& onRefreshGui) { - const std::vector<Zstring> dirNamesFmt = getFormattedDirs(dirnamePhrases); //throw FileError - if (dirNamesFmt.empty()) //pathological case, but we have to check else this function will wait endlessly + const std::vector<Zstring> dirpathsFmt = getFormattedDirs(dirpathPhrases); //throw FileError + if (dirpathsFmt.empty()) //pathological case, but we have to check else this function will wait endlessly throw zen::FileError(_("A folder input field is empty.")); //should have been checked by caller! //detect when volumes are removed/are not available anymore std::vector<std::pair<Zstring, std::shared_ptr<DirWatcher>>> watches; - for (const Zstring& dirnameFmt : dirNamesFmt) + for (const Zstring& dirpathFmt : dirpathsFmt) { try { //a non-existent network path may block, so check existence asynchronously! - auto ftDirExists = async([=] { return zen::dirExists(dirnameFmt); }); + auto ftDirExists = async([=] { return zen::dirExists(dirpathFmt); }); //we need to check dirExists(), not somethingExists(): it's not clear if DirWatcher detects a type clash (file instead of directory!) while (!ftDirExists.timed_wait(boost::posix_time::milliseconds(rts::UI_UPDATE_INTERVAL / 2))) onRefreshGui(false); //may throw! if (!ftDirExists.get()) - return WaitResult(dirnameFmt); + return WaitResult(dirpathFmt); - watches.push_back(std::make_pair(dirnameFmt, std::make_shared<DirWatcher>(dirnameFmt))); //throw FileError + watches.push_back(std::make_pair(dirpathFmt, std::make_shared<DirWatcher>(dirpathFmt))); //throw FileError } catch (FileError&) { - if (!somethingExists(dirnameFmt)) //a benign(?) race condition with FileError - return WaitResult(dirnameFmt); + if (!somethingExists(dirpathFmt)) //a benign(?) race condition with FileError + return WaitResult(dirpathFmt); throw; } } @@ -103,13 +103,13 @@ WaitResult waitForChanges(const std::vector<Zstring>& dirnamePhrases, //throw Fi for (auto it = watches.begin(); it != watches.end(); ++it) { - const Zstring& dirname = it->first; + const Zstring& dirpath = it->first; DirWatcher& watcher = *(it->second); //IMPORTANT CHECK: dirwatcher has problems detecting removal of top watched directories! if (checkDirExistNow) - if (!dirExists(dirname)) //catch errors related to directory removal, e.g. ERROR_NETNAME_DELETED -> somethingExists() is NOT sufficient here! - return WaitResult(dirname); + if (!dirExists(dirpath)) //catch errors related to directory removal, e.g. ERROR_NETNAME_DELETED -> somethingExists() is NOT sufficient here! + return WaitResult(dirpath); try { std::vector<DirWatcher::Entry> changedItems = watcher.getChanges([&] { onRefreshGui(false); /*may throw!*/ }); //throw FileError @@ -119,11 +119,11 @@ WaitResult waitForChanges(const std::vector<Zstring>& dirnamePhrases, //throw Fi { return #ifdef ZEN_MAC - endsWith(e.filename_, Zstr("/.DS_Store")) || + endsWith(e.filepath_, Zstr("/.DS_Store")) || #endif - endsWith(e.filename_, TEMP_FILE_ENDING) || - endsWith(e.filename_, Zstr(".ffs_lock")) || //sync.ffs_lock, sync.Del.ffs_lock - endsWith(e.filename_, Zstr(".ffs_db")); //sync.ffs_db, .sync.tmp.ffs_db + endsWith(e.filepath_, TEMP_FILE_ENDING) || + endsWith(e.filepath_, Zstr(".ffs_lock")) || //sync.ffs_lock, sync.Del.ffs_lock + endsWith(e.filepath_, Zstr(".ffs_db")); //sync.ffs_db, .sync.tmp.ffs_db //no need to ignore temporal recycle bin directory: this must be caused by a file deletion anyway }); @@ -132,8 +132,8 @@ WaitResult waitForChanges(const std::vector<Zstring>& dirnamePhrases, //throw Fi } catch (FileError&) { - if (!somethingExists(dirname)) //a benign(?) race condition with FileError - return WaitResult(dirname); + if (!somethingExists(dirpath)) //a benign(?) race condition with FileError + return WaitResult(dirpath); throw; } } @@ -145,26 +145,26 @@ WaitResult waitForChanges(const std::vector<Zstring>& dirnamePhrases, //throw Fi //wait until all directories become available (again) + logs in network share -void waitForMissingDirs(const std::vector<Zstring>& dirnamePhrases, //throw FileError - const std::function<void(const Zstring& dirname)>& onRefreshGui) +void waitForMissingDirs(const std::vector<Zstring>& dirpathPhrases, //throw FileError + const std::function<void(const Zstring& dirpath)>& onRefreshGui) { while (true) { bool allExisting = true; - //support specifying volume by name => call getFormattedDirectoryName() repeatedly - for (const Zstring& dirnameFmt : getFormattedDirs(dirnamePhrases)) //throw FileError + //support specifying volume by name => call getFormattedDirectoryPath() repeatedly + for (const Zstring& dirpathFmt : getFormattedDirs(dirpathPhrases)) //throw FileError { auto ftDirExisting = async([=]() -> bool { #ifdef ZEN_WIN //1. login to network share, if necessary -> we probably do NOT want multiple concurrent runs: GUI!? - loginNetworkShare(dirnameFmt, false); //login networks shares, no PW prompt -> is this really RTS's job? + loginNetworkShare(dirpathFmt, false); //login networks shares, no PW prompt -> is this really RTS's job? #endif //2. check dir existence - return zen::dirExists(dirnameFmt); + return zen::dirExists(dirpathFmt); }); while (!ftDirExisting.timed_wait(boost::posix_time::milliseconds(rts::UI_UPDATE_INTERVAL / 2))) - onRefreshGui(dirnameFmt); //may throw! + onRefreshGui(dirpathFmt); //may throw! if (!ftDirExisting.get()) { @@ -174,7 +174,7 @@ void waitForMissingDirs(const std::vector<Zstring>& dirnamePhrases, //throw File assert_static(CHECK_DIR_INTERVAL * 1000 % refreshInterval == 0); for (int i = 0; i < CHECK_DIR_INTERVAL * 1000 / refreshInterval; ++i) { - onRefreshGui(dirnameFmt); //may throw! + onRefreshGui(dirpathFmt); //may throw! boost::this_thread::sleep(boost::posix_time::milliseconds(refreshInterval)); } break; @@ -205,9 +205,9 @@ struct ExecCommandNowException {}; } -void rts::monitorDirectories(const std::vector<Zstring>& dirnamePhrases, unsigned int delay, rts::MonitorCallback& callback) +void rts::monitorDirectories(const std::vector<Zstring>& dirpathPhrases, unsigned int delay, rts::MonitorCallback& callback) { - if (dirnamePhrases.empty()) + if (dirpathPhrases.empty()) { assert(false); return; @@ -216,7 +216,7 @@ void rts::monitorDirectories(const std::vector<Zstring>& dirnamePhrases, unsigne auto execMonitoring = [&] //throw FileError { callback.setPhase(MonitorCallback::MONITOR_PHASE_WAITING); - waitForMissingDirs(dirnamePhrases, [&](const Zstring& dirname) { callback.requestUiRefresh(); }); //throw FileError + waitForMissingDirs(dirpathPhrases, [&](const Zstring& dirpath) { callback.requestUiRefresh(); }); //throw FileError callback.setPhase(MonitorCallback::MONITOR_PHASE_ACTIVE); //schedule initial execution (*after* all directories have arrived, which could take some time which we don't want to include) @@ -230,7 +230,7 @@ void rts::monitorDirectories(const std::vector<Zstring>& dirnamePhrases, unsigne while (true) //loop over detected changes { //wait for changes (and for all directories to become available) - WaitResult res = waitForChanges(dirnamePhrases, [&](bool readyForSync) //throw FileError, ExecCommandNowException + WaitResult res = waitForChanges(dirpathPhrases, [&](bool readyForSync) //throw FileError, ExecCommandNowException { if (readyForSync) if (nextExecDate <= std::time(nullptr)) @@ -241,7 +241,7 @@ void rts::monitorDirectories(const std::vector<Zstring>& dirnamePhrases, unsigne { case WaitResult::CHANGE_DIR_MISSING: //don't execute the command before all directories are available! callback.setPhase(MonitorCallback::MONITOR_PHASE_WAITING); - waitForMissingDirs(dirnamePhrases, [&](const Zstring& dirname) { callback.requestUiRefresh(); }); //throw FileError + waitForMissingDirs(dirpathPhrases, [&](const Zstring& dirpath) { callback.requestUiRefresh(); }); //throw FileError callback.setPhase(MonitorCallback::MONITOR_PHASE_ACTIVE); break; @@ -254,7 +254,7 @@ void rts::monitorDirectories(const std::vector<Zstring>& dirnamePhrases, unsigne } catch (ExecCommandNowException&) {} - ::wxSetEnv(L"change_path", utfCvrtTo<wxString>(lastChangeDetected.filename_)); //some way to output what file changed to the user + ::wxSetEnv(L"change_path", utfCvrtTo<wxString>(lastChangeDetected.filepath_)); //some way to output what file changed to the user ::wxSetEnv(L"change_action", toString(lastChangeDetected.action_)); // //execute command diff --git a/FreeFileSync/Source/RealtimeSync/monitor.h b/FreeFileSync/Source/RealtimeSync/monitor.h index 81569239..5fd8fb4b 100644 --- a/FreeFileSync/Source/RealtimeSync/monitor.h +++ b/FreeFileSync/Source/RealtimeSync/monitor.h @@ -29,7 +29,7 @@ struct MonitorCallback virtual void requestUiRefresh() = 0; virtual void reportError(const std::wstring& msg) = 0; //automatically retries after return! }; -void monitorDirectories(const std::vector<Zstring>& dirnamePhrases, +void monitorDirectories(const std::vector<Zstring>& dirpathPhrases, //non-formatted dirnames that yet require call to getFormattedDirectoryName(); empty directories must be checked by caller! unsigned int delay, MonitorCallback& callback); diff --git a/FreeFileSync/Source/RealtimeSync/xml_proc.cpp b/FreeFileSync/Source/RealtimeSync/xml_proc.cpp index 4ea4f20d..3457f8f2 100644 --- a/FreeFileSync/Source/RealtimeSync/xml_proc.cpp +++ b/FreeFileSync/Source/RealtimeSync/xml_proc.cpp @@ -38,19 +38,19 @@ bool isXmlTypeRTS(const XmlDoc& doc) //throw() } -void xmlAccess::readConfig(const Zstring& filename, XmlRealConfig& config, std::wstring& warningMsg) //throw FileError +void xmlAccess::readConfig(const Zstring& filepath, XmlRealConfig& config, std::wstring& warningMsg) //throw FileError { - XmlDoc doc = loadXmlDocument(filename); //throw FileError + XmlDoc doc = loadXmlDocument(filepath); //throw FileError if (!isXmlTypeRTS(doc)) - throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filename))); + throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filepath))); XmlIn in(doc); ::readConfig(in, config); try { - checkForMappingErrors(in, filename); //throw FileError + checkForMappingErrors(in, filepath); //throw FileError } catch (const FileError& e) { @@ -70,7 +70,7 @@ void writeConfig(const XmlRealConfig& config, XmlOut& out) } -void xmlAccess::writeConfig(const XmlRealConfig& config, const Zstring& filename) //throw FileError +void xmlAccess::writeConfig(const XmlRealConfig& config, const Zstring& filepath) //throw FileError { XmlDoc doc("FreeFileSync"); doc.root().setAttribute("XmlType", "REAL"); @@ -78,50 +78,50 @@ void xmlAccess::writeConfig(const XmlRealConfig& config, const Zstring& filename XmlOut out(doc); ::writeConfig(config, out); - saveXmlDocument(doc, filename); //throw FileError + saveXmlDocument(doc, filepath); //throw FileError } namespace { -xmlAccess::XmlRealConfig convertBatchToReal(const xmlAccess::XmlBatchConfig& batchCfg, const Zstring& filename) +xmlAccess::XmlRealConfig convertBatchToReal(const xmlAccess::XmlBatchConfig& batchCfg, const Zstring& filepath) { std::set<Zstring, LessFilename> uniqueFolders; //add main folders - uniqueFolders.insert(batchCfg.mainCfg.firstPair.dirnamePhraseLeft); - uniqueFolders.insert(batchCfg.mainCfg.firstPair.dirnamePhraseRight); + uniqueFolders.insert(batchCfg.mainCfg.firstPair.dirpathPhraseLeft); + uniqueFolders.insert(batchCfg.mainCfg.firstPair.dirpathPhraseRight); //additional folders for (const FolderPairEnh& fp : batchCfg.mainCfg.additionalPairs) { - uniqueFolders.insert(fp.dirnamePhraseLeft); - uniqueFolders.insert(fp.dirnamePhraseRight); + uniqueFolders.insert(fp.dirpathPhraseLeft); + uniqueFolders.insert(fp.dirpathPhraseRight); } uniqueFolders.erase(Zstring()); xmlAccess::XmlRealConfig output; output.directories.assign(uniqueFolders.begin(), uniqueFolders.end()); - output.commandline = Zstr("\"") + zen::getFreeFileSyncLauncher() + Zstr("\" \"") + filename + Zstr("\""); + output.commandline = Zstr("\"") + zen::getFreeFileSyncLauncher() + Zstr("\" \"") + filepath + Zstr("\""); return output; } } -void xmlAccess::readRealOrBatchConfig(const Zstring& filename, xmlAccess::XmlRealConfig& config, std::wstring& warningMsg) //throw FileError +void xmlAccess::readRealOrBatchConfig(const Zstring& filepath, xmlAccess::XmlRealConfig& config, std::wstring& warningMsg) //throw FileError { using namespace xmlAccess; - if (getXmlType(filename) != XML_TYPE_BATCH) //throw FileError - return readConfig(filename, config, warningMsg); //throw FileError + if (getXmlType(filepath) != XML_TYPE_BATCH) //throw FileError + return readConfig(filepath, config, warningMsg); //throw FileError //convert batch config to RealtimeSync config XmlBatchConfig batchCfg; - readConfig(filename, batchCfg, warningMsg); //throw FileError + readConfig(filepath, batchCfg, warningMsg); //throw FileError //<- redirect batch config warnings - config = convertBatchToReal(batchCfg, filename); + config = convertBatchToReal(batchCfg, filepath); } diff --git a/FreeFileSync/Source/RealtimeSync/xml_proc.h b/FreeFileSync/Source/RealtimeSync/xml_proc.h index b996b8ce..9fe4e620 100644 --- a/FreeFileSync/Source/RealtimeSync/xml_proc.h +++ b/FreeFileSync/Source/RealtimeSync/xml_proc.h @@ -21,12 +21,12 @@ struct XmlRealConfig unsigned int delay; }; -void readConfig(const Zstring& filename, XmlRealConfig& config, std::wstring& warningMsg); //throw FileError -void writeConfig(const XmlRealConfig& config, const Zstring& filename); //throw FileError +void readConfig(const Zstring& filepath, XmlRealConfig& config, std::wstring& warningMsg); //throw FileError +void writeConfig(const XmlRealConfig& config, const Zstring& filepath); //throw FileError //reuse (some of) FreeFileSync's xml files -void readRealOrBatchConfig(const Zstring& filename, xmlAccess::XmlRealConfig& config, std::wstring& warningMsg); //throw FileError +void readRealOrBatchConfig(const Zstring& filepath, xmlAccess::XmlRealConfig& config, std::wstring& warningMsg); //throw FileError int getProgramLanguage(); } diff --git a/FreeFileSync/Source/algorithm.cpp b/FreeFileSync/Source/algorithm.cpp index fbb64070..b5791f90 100644 --- a/FreeFileSync/Source/algorithm.cpp +++ b/FreeFileSync/Source/algorithm.cpp @@ -11,13 +11,11 @@ #include <zen/recycler.h> #include <zen/stl_tools.h> #include <zen/scope_guard.h> -//#include <zen/thread.h> #include <wx+/image_resources.h> #include "lib/norm_filter.h" #include "lib/db_file.h" #include "lib/cmp_filetime.h" #include "lib/norm_filter.h" -//#include "process_callback.h" //for UI_UPDATE_INTERVAL using namespace zen; using namespace std::rel_ops; @@ -56,9 +54,9 @@ private: const CompareFilesResult cat = fileObj.getCategory(); //##################### schedule old temporary files for deletion #################### - if (cat == FILE_LEFT_SIDE_ONLY && endsWith(fileObj.getShortName<LEFT_SIDE>(), TEMP_FILE_ENDING)) + if (cat == FILE_LEFT_SIDE_ONLY && endsWith(fileObj.getItemName<LEFT_SIDE>(), TEMP_FILE_ENDING)) return fileObj.setSyncDir(SyncDirection::LEFT); - else if (cat == FILE_RIGHT_SIDE_ONLY && endsWith(fileObj.getShortName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) + else if (cat == FILE_RIGHT_SIDE_ONLY && endsWith(fileObj.getItemName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) return fileObj.setSyncDir(SyncDirection::RIGHT); //#################################################################################### @@ -129,9 +127,9 @@ private: const CompareDirResult cat = dirObj.getDirCategory(); //########### schedule abandoned temporary recycle bin directory for deletion ########## - if (cat == DIR_LEFT_SIDE_ONLY && endsWith(dirObj.getShortName<LEFT_SIDE>(), TEMP_FILE_ENDING)) + if (cat == DIR_LEFT_SIDE_ONLY && endsWith(dirObj.getItemName<LEFT_SIDE>(), TEMP_FILE_ENDING)) return setSyncDirectionRec(SyncDirection::LEFT, dirObj); // - else if (cat == DIR_RIGHT_SIDE_ONLY && endsWith(dirObj.getShortName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) + else if (cat == DIR_RIGHT_SIDE_ONLY && endsWith(dirObj.getItemName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) return setSyncDirectionRec(SyncDirection::RIGHT, dirObj); //don't recurse below! //####################################################################################### @@ -195,9 +193,8 @@ template <> inline const InSyncDescrFile& getDescriptor<RIGHT_SIDE>(const InSyncFile& dbFile) { return dbFile.right; } -//check whether database entry and current item match: *irrespective* of current comparison settings template <SelectedSide side> inline -bool isEqual(const FilePair& fileObj, const InSyncDir::FileList::value_type* dbFile) +bool matchesDbEntry(const FilePair& fileObj, const InSyncDir::FileList::value_type* dbFile, unsigned int optTimeShiftHours) { if (fileObj.isEmpty<side>()) return !dbFile; @@ -207,9 +204,10 @@ bool isEqual(const FilePair& fileObj, const InSyncDir::FileList::value_type* dbF const Zstring& shortNameDb = dbFile->first; const InSyncDescrFile& descrDb = getDescriptor<side>(dbFile->second); - return fileObj.getShortName<side>() == shortNameDb && //detect changes in case (windows) + return fileObj.getItemName<side>() == shortNameDb && //detect changes in case (windows) //respect 2 second FAT/FAT32 precision! copying a file to a FAT32 drive changes it's modification date by up to 2 seconds - sameFileTime(fileObj.getLastWriteTime<side>(), descrDb.lastWriteTimeRaw, 2) && + //we're not interested in "fileTimeTolerance" here! + sameFileTime(fileObj.getLastWriteTime<side>(), descrDb.lastWriteTimeRaw, 2, optTimeShiftHours) && fileObj.getFileSize<side>() == dbFile->second.fileSize; //note: we do *not* consider FileId here, but are only interested in *visual* changes. Consider user moving data to some other medium, this is not a change! } @@ -217,7 +215,7 @@ bool isEqual(const FilePair& fileObj, const InSyncDir::FileList::value_type* dbF //check whether database entry is in sync considering *current* comparison settings inline -bool stillInSync(const InSyncFile& dbFile, CompareVariant compareVar, int fileTimeTolerance) +bool stillInSync(const InSyncFile& dbFile, CompareVariant compareVar, int fileTimeTolerance, unsigned int optTimeShiftHours) { switch (compareVar) { @@ -225,8 +223,7 @@ bool stillInSync(const InSyncFile& dbFile, CompareVariant compareVar, int fileTi if (dbFile.cmpVar == CMP_BY_CONTENT) return true; //special rule: this is already "good enough" for CMP_BY_TIME_SIZE! return //case-sensitive short name match is a database invariant! - sameFileTime(dbFile.left.lastWriteTimeRaw, dbFile.right.lastWriteTimeRaw, fileTimeTolerance); - //dbFile.left.fileSize == dbFile.right.fileSize; + sameFileTime(dbFile.left.lastWriteTimeRaw, dbFile.right.lastWriteTimeRaw, fileTimeTolerance, optTimeShiftHours); case CMP_BY_CONTENT: //case-sensitive short name match is a database invariant! @@ -248,7 +245,7 @@ const InSyncDescrLink& getDescriptor<RIGHT_SIDE>(const InSyncSymlink& dbLink) { //check whether database entry and current item match: *irrespective* of current comparison settings template <SelectedSide side> inline -bool isEqual(const SymlinkPair& linkObj, const InSyncDir::LinkList::value_type* dbLink) +bool matchesDbEntry(const SymlinkPair& linkObj, const InSyncDir::LinkList::value_type* dbLink, unsigned int optTimeShiftHours) { if (linkObj.isEmpty<side>()) return !dbLink; @@ -258,15 +255,15 @@ bool isEqual(const SymlinkPair& linkObj, const InSyncDir::LinkList::value_type* const Zstring& shortNameDb = dbLink->first; const InSyncDescrLink& descrDb = getDescriptor<side>(dbLink->second); - return linkObj.getShortName<side>() == shortNameDb && + return linkObj.getItemName<side>() == shortNameDb && //respect 2 second FAT/FAT32 precision! copying a file to a FAT32 drive changes its modification date by up to 2 seconds - sameFileTime(linkObj.getLastWriteTime<side>(), descrDb.lastWriteTimeRaw, 2); + sameFileTime(linkObj.getLastWriteTime<side>(), descrDb.lastWriteTimeRaw, 2, optTimeShiftHours); } //check whether database entry is in sync considering *current* comparison settings inline -bool stillInSync(const InSyncSymlink& dbLink, CompareVariant compareVar, int fileTimeTolerance) +bool stillInSync(const InSyncSymlink& dbLink, CompareVariant compareVar, int fileTimeTolerance, unsigned int optTimeShiftHours) { switch (compareVar) { @@ -274,7 +271,7 @@ bool stillInSync(const InSyncSymlink& dbLink, CompareVariant compareVar, int fil if (dbLink.cmpVar == CMP_BY_CONTENT) return true; //special rule: this is already "good enough" for CMP_BY_TIME_SIZE! return //case-sensitive short name match is a database invariant! - sameFileTime(dbLink.left.lastWriteTimeRaw, dbLink.right.lastWriteTimeRaw, fileTimeTolerance); + sameFileTime(dbLink.left.lastWriteTimeRaw, dbLink.right.lastWriteTimeRaw, fileTimeTolerance, optTimeShiftHours); case CMP_BY_CONTENT: //case-sensitive short name match is a database invariant! @@ -289,7 +286,7 @@ bool stillInSync(const InSyncSymlink& dbLink, CompareVariant compareVar, int fil //check whether database entry and current item match: *irrespective* of current comparison settings template <SelectedSide side> inline -bool isEqual(const DirPair& dirObj, const InSyncDir::DirList::value_type* dbDir) +bool matchesDbEntry(const DirPair& dirObj, const InSyncDir::DirList::value_type* dbDir) { if (dirObj.isEmpty<side>()) return !dbDir || dbDir->second.status == InSyncDir::DIR_STATUS_STRAW_MAN; @@ -298,7 +295,7 @@ bool isEqual(const DirPair& dirObj, const InSyncDir::DirList::value_type* dbDir) const Zstring& shortNameDb = dbDir->first; - return dirObj.getShortName<side>() == shortNameDb; + return dirObj.getItemName<side>() == shortNameDb; } @@ -319,8 +316,9 @@ public: private: DetectMovedFiles(BaseDirPair& baseDirectory, const InSyncDir& dbContainer) : - cmpVar(baseDirectory.getCompVariant()), - fileTimeTolerance(baseDirectory.getFileTimeTolerance()) + cmpVar (baseDirectory.getCompVariant()), + fileTimeTolerance(baseDirectory.getFileTimeTolerance()), + optTimeShiftHours(baseDirectory.getTimeShift()) { recurse(baseDirectory); @@ -371,14 +369,18 @@ private: static bool sameSizeAndDateLeft(const FilePair& fsObj, const InSyncFile& dbEntry) { return fsObj.getFileSize<LEFT_SIDE>() == dbEntry.fileSize && - sameFileTime(fsObj.getLastWriteTime<LEFT_SIDE>(), dbEntry.left.lastWriteTimeRaw, 2); //respect 2 second FAT/FAT32 precision! + sameFileTime(fsObj.getLastWriteTime<LEFT_SIDE>(), dbEntry.left.lastWriteTimeRaw, 2, 0); + //- respect 2 second FAT/FAT32 precision! + //- a "optTimeShiftHours" != 0 may lead to false positive move detections => let's be conservative and not allow it + // (time shift is only ever required during FAT DST switches) + //PS: *never* allow 2 sec tolerance as container predicate!! // => no strict weak ordering relation! reason: no transitivity of equivalence! } static bool sameSizeAndDateRight(const FilePair& fsObj, const InSyncFile& dbEntry) { return fsObj.getFileSize<RIGHT_SIDE>() == dbEntry.fileSize && - sameFileTime(fsObj.getLastWriteTime<RIGHT_SIDE>(), dbEntry.right.lastWriteTimeRaw, 2); + sameFileTime(fsObj.getLastWriteTime<RIGHT_SIDE>(), dbEntry.right.lastWriteTimeRaw, 2, 0); } void findAndSetMovePair(const InSyncFile& dbEntry) const @@ -388,7 +390,7 @@ private: if (idLeft != FileId() && idRight != FileId() && - stillInSync(dbEntry, cmpVar, fileTimeTolerance)) + stillInSync(dbEntry, cmpVar, fileTimeTolerance, optTimeShiftHours)) { auto itL = exLeftOnly.find(idLeft); if (itL != exLeftOnly.end()) @@ -411,6 +413,7 @@ private: const CompareVariant cmpVar; const int fileTimeTolerance; + const unsigned int optTimeShiftHours; std::map<FileId, FilePair*> exLeftOnly; //FilePair* == nullptr for duplicate ids! => consider aliasing through symlinks! std::map<FileId, FilePair*> exRightOnly; //=> avoid ambiguity for mixtures of files/symlinks on one side and allow 1-1 mapping only! @@ -456,8 +459,9 @@ private: txtBothSidesChanged(_("Both sides have changed since last synchronization.")), txtNoSideChanged(_("Cannot determine sync-direction:") + L" \n" + _("No change since last synchronization.")), txtDbNotInSync(_("Cannot determine sync-direction:") + L" \n" + _("The database entry is not in sync considering current settings.")), - cmpVar(baseDirectory.getCompVariant()), - fileTimeTolerance(baseDirectory.getFileTimeTolerance()) + cmpVar (baseDirectory.getCompVariant()), + fileTimeTolerance(baseDirectory.getFileTimeTolerance()), + optTimeShiftHours(baseDirectory.getTimeShift()) { //-> considering filter not relevant: //if narrowing filter: all ok; if widening filter (if file ex on both sides -> conflict, fine; if file ex. on one side: copy to other side: fine) @@ -482,9 +486,9 @@ private: return; //##################### schedule old temporary files for deletion #################### - if (cat == FILE_LEFT_SIDE_ONLY && endsWith(fileObj.getShortName<LEFT_SIDE>(), TEMP_FILE_ENDING)) + if (cat == FILE_LEFT_SIDE_ONLY && endsWith(fileObj.getItemName<LEFT_SIDE>(), TEMP_FILE_ENDING)) return fileObj.setSyncDir(SyncDirection::LEFT); - else if (cat == FILE_RIGHT_SIDE_ONLY && endsWith(fileObj.getShortName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) + else if (cat == FILE_RIGHT_SIDE_ONLY && endsWith(fileObj.getItemName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) return fileObj.setSyncDir(SyncDirection::RIGHT); //#################################################################################### @@ -492,19 +496,19 @@ private: const InSyncDir::FileList::value_type* dbEntry = nullptr; if (dbContainer) { - auto it = dbContainer->files.find(fileObj.getObjShortName()); + auto it = dbContainer->files.find(fileObj.getPairShortName()); if (it != dbContainer->files.end()) dbEntry = &*it; } //evaluation - const bool changeOnLeft = !isEqual<LEFT_SIDE >(fileObj, dbEntry); - const bool changeOnRight = !isEqual<RIGHT_SIDE>(fileObj, dbEntry); + const bool changeOnLeft = !matchesDbEntry<LEFT_SIDE >(fileObj, dbEntry, optTimeShiftHours); + const bool changeOnRight = !matchesDbEntry<RIGHT_SIDE>(fileObj, dbEntry, optTimeShiftHours); if (changeOnLeft != changeOnRight) { //if database entry not in sync according to current settings! -> do not set direction based on async status! - if (dbEntry && !stillInSync(dbEntry->second, cmpVar, fileTimeTolerance)) + if (dbEntry && !stillInSync(dbEntry->second, cmpVar, fileTimeTolerance, optTimeShiftHours)) fileObj.setSyncDirConflict(txtDbNotInSync); else fileObj.setSyncDir(changeOnLeft ? SyncDirection::RIGHT : SyncDirection::LEFT); @@ -528,19 +532,19 @@ private: const InSyncDir::LinkList::value_type* dbEntry = nullptr; if (dbContainer) { - auto it = dbContainer->symlinks.find(linkObj.getObjShortName()); + auto it = dbContainer->symlinks.find(linkObj.getPairShortName()); if (it != dbContainer->symlinks.end()) dbEntry = &*it; } //evaluation - const bool changeOnLeft = !isEqual<LEFT_SIDE >(linkObj, dbEntry); - const bool changeOnRight = !isEqual<RIGHT_SIDE>(linkObj, dbEntry); + const bool changeOnLeft = !matchesDbEntry<LEFT_SIDE >(linkObj, dbEntry, optTimeShiftHours); + const bool changeOnRight = !matchesDbEntry<RIGHT_SIDE>(linkObj, dbEntry, optTimeShiftHours); if (changeOnLeft != changeOnRight) { //if database entry not in sync according to current settings! -> do not set direction based on async status! - if (dbEntry && !stillInSync(dbEntry->second, cmpVar, fileTimeTolerance)) + if (dbEntry && !stillInSync(dbEntry->second, cmpVar, fileTimeTolerance, optTimeShiftHours)) linkObj.setSyncDirConflict(txtDbNotInSync); else linkObj.setSyncDir(changeOnLeft ? SyncDirection::RIGHT : SyncDirection::LEFT); @@ -559,9 +563,9 @@ private: const CompareDirResult cat = dirObj.getDirCategory(); //########### schedule abandoned temporary recycle bin directory for deletion ########## - if (cat == DIR_LEFT_SIDE_ONLY && endsWith(dirObj.getShortName<LEFT_SIDE>(), TEMP_FILE_ENDING)) + if (cat == DIR_LEFT_SIDE_ONLY && endsWith(dirObj.getItemName<LEFT_SIDE>(), TEMP_FILE_ENDING)) return setSyncDirectionRec(SyncDirection::LEFT, dirObj); // - else if (cat == DIR_RIGHT_SIDE_ONLY && endsWith(dirObj.getShortName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) + else if (cat == DIR_RIGHT_SIDE_ONLY && endsWith(dirObj.getItemName<RIGHT_SIDE>(), TEMP_FILE_ENDING)) return setSyncDirectionRec(SyncDirection::RIGHT, dirObj); //don't recurse below! //####################################################################################### @@ -569,7 +573,7 @@ private: const InSyncDir::DirList::value_type* dbEntry = nullptr; if (dbContainer) { - auto it = dbContainer->dirs.find(dirObj.getObjShortName()); + auto it = dbContainer->dirs.find(dirObj.getPairShortName()); if (it != dbContainer->dirs.end()) dbEntry = &*it; } @@ -577,8 +581,8 @@ private: if (cat != DIR_EQUAL) { //evaluation - const bool changeOnLeft = !isEqual<LEFT_SIDE >(dirObj, dbEntry); - const bool changeOnRight = !isEqual<RIGHT_SIDE>(dirObj, dbEntry); + const bool changeOnLeft = !matchesDbEntry<LEFT_SIDE >(dirObj, dbEntry); + const bool changeOnRight = !matchesDbEntry<RIGHT_SIDE>(dirObj, dbEntry); if (changeOnLeft != changeOnRight) { @@ -606,6 +610,7 @@ private: const CompareVariant cmpVar; const int fileTimeTolerance; + const unsigned int optTimeShiftHours; }; } @@ -848,19 +853,19 @@ private: void processFile(FilePair& fileObj) const { if (Eval<strategy>().process(fileObj)) - fileObj.setActive(filterProc.passFileFilter(fileObj.getObjRelativeName())); + fileObj.setActive(filterProc.passFileFilter(fileObj.getPairRelativePath())); } void processLink(SymlinkPair& linkObj) const { if (Eval<strategy>().process(linkObj)) - linkObj.setActive(filterProc.passFileFilter(linkObj.getObjRelativeName())); + linkObj.setActive(filterProc.passFileFilter(linkObj.getPairRelativePath())); } void processDir(DirPair& dirObj) const { bool subObjMightMatch = true; - const bool filterPassed = filterProc.passDirFilter(dirObj.getObjRelativeName(), &subObjMightMatch); + const bool filterPassed = filterProc.passDirFilter(dirObj.getPairRelativePath(), &subObjMightMatch); if (Eval<strategy>().process(dirObj)) dirObj.setActive(filterPassed); @@ -1019,12 +1024,12 @@ void zen::applyFiltering(FolderComparison& folderCmp, const MainConfiguration& m class FilterByTimeSpan { public: - static void execute(HierarchyObject& hierObj, const Int64& timeFrom, const Int64& timeTo) { FilterByTimeSpan(hierObj, timeFrom, timeTo); } + static void execute(HierarchyObject& hierObj, std::int64_t timeFrom, std::int64_t timeTo) { FilterByTimeSpan(hierObj, timeFrom, timeTo); } private: FilterByTimeSpan(HierarchyObject& hierObj, - const Int64& timeFrom, - const Int64& timeTo) : + std::int64_t timeFrom, + std::int64_t timeTo) : timeFrom_(timeFrom), timeTo_(timeTo) { recurse(hierObj); } @@ -1073,12 +1078,12 @@ private: obj.template getLastWriteTime<side>() <= timeTo_; } - const Int64 timeFrom_; - const Int64 timeTo_; + const std::int64_t timeFrom_; + const std::int64_t timeTo_; }; -void zen::applyTimeSpanFilter(FolderComparison& folderCmp, const Int64& timeFrom, const Int64& timeTo) +void zen::applyTimeSpanFilter(FolderComparison& folderCmp, std::int64_t timeFrom, std::int64_t timeTo) { std::for_each(begin(folderCmp), end(folderCmp), [&](BaseDirPair& baseDirObj) { FilterByTimeSpan::execute(baseDirObj, timeFrom, timeTo); }); } @@ -1095,14 +1100,14 @@ std::pair<Zstring, int> zen::deleteFromGridAndHDPreview(const std::vector<FileSy for (const FileSystemObject* fsObj : selectionLeft) if (!fsObj->isEmpty<LEFT_SIDE>()) { - fileList += fsObj->getFullName<LEFT_SIDE>() + Zstr('\n'); + fileList += fsObj->getFullPath<LEFT_SIDE>() + Zstr('\n'); ++totalDelCount; } for (const FileSystemObject* fsObj : selectionRight) if (!fsObj->isEmpty<RIGHT_SIDE>()) { - fileList += fsObj->getFullName<RIGHT_SIDE>() + Zstr('\n'); + fileList += fsObj->getFullPath<RIGHT_SIDE>() + Zstr('\n'); ++totalDelCount; } @@ -1200,41 +1205,41 @@ struct ItemDeleter : public FSObjectVisitor //throw FileError, but nothrow cons virtual void visit(const FilePair& fileObj) { - notifyFileDeletion(fileObj.getFullName<side>()); + notifyFileDeletion(fileObj.getFullPath<side>()); if (useRecycleBin_) - zen::recycleOrDelete(fileObj.getFullName<side>()); //throw FileError + zen::recycleOrDelete(fileObj.getFullPath<side>()); //throw FileError else - zen::removeFile(fileObj.getFullName<side>()); //throw FileError + zen::removeFile(fileObj.getFullPath<side>()); //throw FileError } virtual void visit(const SymlinkPair& linkObj) { - notifySymlinkDeletion(linkObj.getFullName<side>()); + notifySymlinkDeletion(linkObj.getFullPath<side>()); if (useRecycleBin_) - zen::recycleOrDelete(linkObj.getFullName<side>()); //throw FileError + zen::recycleOrDelete(linkObj.getFullPath<side>()); //throw FileError else { - if (dirExists(linkObj.getFullName<side>())) //dir symlink - zen::removeDirectory(linkObj.getFullName<side>()); //throw FileError + if (dirExists(linkObj.getFullPath<side>())) //dir symlink + zen::removeDirectory(linkObj.getFullPath<side>()); //throw FileError else //file symlink, broken symlink - zen::removeFile(linkObj.getFullName<side>()); //throw FileError + zen::removeFile(linkObj.getFullPath<side>()); //throw FileError } } virtual void visit(const DirPair& dirObj) { - notifyDirectoryDeletion(dirObj.getFullName<side>()); //notfied twice; see below -> no big deal + notifyDirectoryDeletion(dirObj.getFullPath<side>()); //notfied twice; see below -> no big deal if (useRecycleBin_) - zen::recycleOrDelete(dirObj.getFullName<side>()); //throw FileError + zen::recycleOrDelete(dirObj.getFullPath<side>()); //throw FileError else { - auto onBeforeFileDeletion = [&](const Zstring& filename) { this->notifyFileDeletion (filename); }; //without "this->" GCC 4.7.2 runtime crash on Debian - auto onBeforeDirDeletion = [&](const Zstring& dirname ) { this->notifyDirectoryDeletion(dirname ); }; + auto onBeforeFileDeletion = [&](const Zstring& filepath) { this->notifyFileDeletion (filepath); }; //without "this->" GCC 4.7.2 runtime crash on Debian + auto onBeforeDirDeletion = [&](const Zstring& dirpath ) { this->notifyDirectoryDeletion(dirpath ); }; - zen::removeDirectory(dirObj.getFullName<side>(), onBeforeFileDeletion, onBeforeDirDeletion); //throw FileError + zen::removeDirectory(dirObj.getFullPath<side>(), onBeforeFileDeletion, onBeforeDirDeletion); //throw FileError } } diff --git a/FreeFileSync/Source/algorithm.h b/FreeFileSync/Source/algorithm.h index ad2189d0..64d10160 100644 --- a/FreeFileSync/Source/algorithm.h +++ b/FreeFileSync/Source/algorithm.h @@ -29,7 +29,7 @@ void applyFiltering (FolderComparison& folderCmp, const MainConfiguration& main void addHardFiltering(BaseDirPair& baseDirObj, const Zstring& excludeFilter); //exclude additional entries only void addSoftFiltering(BaseDirPair& baseDirObj, const SoftFilter& timeSizeFilter); //exclude additional entries only -void applyTimeSpanFilter(FolderComparison& folderCmp, const Int64& timeFrom, const Int64& timeTo); //overwrite current active/inactive settings +void applyTimeSpanFilter(FolderComparison& folderCmp, std::int64_t timeFrom, std::int64_t timeTo); //overwrite current active/inactive settings void setActiveStatus(bool newStatus, FolderComparison& folderCmp); //activate or deactivate all rows void setActiveStatus(bool newStatus, FileSystemObject& fsObj); //activate or deactivate row: (not recursively anymore) diff --git a/FreeFileSync/Source/application.cpp b/FreeFileSync/Source/application.cpp index ec03a184..d611943e 100644 --- a/FreeFileSync/Source/application.cpp +++ b/FreeFileSync/Source/application.cpp @@ -18,7 +18,6 @@ #include "algorithm.h" #include "synchronization.h" #include "ui/batch_status_handler.h" -//#include "ui/check_version.h" #include "ui/main_dlg.h" #include "ui/switch_to_gui.h" #include "lib/process_xml.h" @@ -141,6 +140,7 @@ const wxEventType EVENT_ENTER_EVENT_LOOP = wxNewEventType(); //################################################################################################################## + bool Application::OnInit() { //-> this seems rather useless: @@ -332,37 +332,37 @@ void Application::launch(const std::vector<Zstring>& commandArgs) } else { - Zstring filename = *it; - if (!fileExists(filename)) //...be a little tolerant + Zstring filepath = *it; + if (!fileExists(filepath)) //...be a little tolerant { - if (fileExists(filename + Zstr(".ffs_batch"))) - filename += Zstr(".ffs_batch"); - else if (fileExists(filename + Zstr(".ffs_gui"))) - filename += Zstr(".ffs_gui"); - else if (fileExists(filename + Zstr(".xml"))) - filename += Zstr(".xml"); + if (fileExists(filepath + Zstr(".ffs_batch"))) + filepath += Zstr(".ffs_batch"); + else if (fileExists(filepath + Zstr(".ffs_gui"))) + filepath += Zstr(".ffs_gui"); + else if (fileExists(filepath + Zstr(".xml"))) + filepath += Zstr(".xml"); else { - notifyError(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filename)), std::wstring()); + notifyError(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filepath)), std::wstring()); return; } } try { - switch (getXmlType(filename)) //throw FileError + switch (getXmlType(filepath)) //throw FileError { case XML_TYPE_GUI: - configFiles.push_back(std::make_pair(filename, XML_TYPE_GUI)); + configFiles.push_back(std::make_pair(filepath, XML_TYPE_GUI)); break; case XML_TYPE_BATCH: - configFiles.push_back(std::make_pair(filename, XML_TYPE_BATCH)); + configFiles.push_back(std::make_pair(filepath, XML_TYPE_BATCH)); break; case XML_TYPE_GLOBAL: - globalConfigFile = filename; + globalConfigFile = filepath; break; case XML_TYPE_OTHER: - notifyError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filename)), std::wstring()); + notifyError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filepath)), std::wstring()); return; } } @@ -382,8 +382,8 @@ void Application::launch(const std::vector<Zstring>& commandArgs) auto hasNonDefaultConfig = [](const FolderPairEnh& fp) { - return !(fp == FolderPairEnh(fp.dirnamePhraseLeft, - fp.dirnamePhraseRight, + return !(fp == FolderPairEnh(fp.dirpathPhraseLeft, + fp.dirpathPhraseRight, nullptr, nullptr, FilterConfig())); }; @@ -402,8 +402,8 @@ void Application::launch(const std::vector<Zstring>& commandArgs) for (size_t i = 0; i < leftDirs.size(); ++i) if (i == 0) { - mainCfg.firstPair.dirnamePhraseLeft = leftDirs [0]; - mainCfg.firstPair.dirnamePhraseRight = rightDirs[0]; + mainCfg.firstPair.dirpathPhraseLeft = leftDirs [0]; + mainCfg.firstPair.dirpathPhraseRight = rightDirs[0]; } else mainCfg.additionalPairs.push_back(FolderPairEnh(leftDirs [i], @@ -435,7 +435,7 @@ void Application::launch(const std::vector<Zstring>& commandArgs) } else if (configFiles.size() == 1) { - const Zstring filename = configFiles[0].first; + const Zstring filepath = configFiles[0].first; //batch mode if (configFiles[0].second == XML_TYPE_BATCH) @@ -444,7 +444,7 @@ void Application::launch(const std::vector<Zstring>& commandArgs) try { std::wstring warningMsg; - readConfig(filename, batchCfg, warningMsg); //throw FileError + readConfig(filepath, batchCfg, warningMsg); //throw FileError if (!warningMsg.empty()) throw FileError(warningMsg); //batch mode: break on errors AND even warnings! @@ -456,7 +456,7 @@ void Application::launch(const std::vector<Zstring>& commandArgs) } if (!replaceDirectories(batchCfg.mainCfg)) return; - runBatchMode(globalConfigFilePath, batchCfg, filename, returnCode); + runBatchMode(globalConfigFilePath, batchCfg, filepath, returnCode); } //GUI mode: single config else @@ -465,7 +465,7 @@ void Application::launch(const std::vector<Zstring>& commandArgs) try { std::wstring warningMsg; - readConfig(filename, guiCfg, warningMsg); //throw FileError + readConfig(filepath, guiCfg, warningMsg); //throw FileError if (!warningMsg.empty()) showNotificationDialog(nullptr, DialogInfoType::WARNING, PopupDialogCfg().setDetailInstructions(warningMsg)); @@ -481,7 +481,7 @@ void Application::launch(const std::vector<Zstring>& commandArgs) //what about simulating changed config due to directory replacement? //-> propably fine to not show as changed on GUI and not ask user to save on exit! - runGuiMode(globalConfigFilePath, guiCfg, { filename }); //caveat: guiCfg and filename do not match if directories were set/replaced via command line! + runGuiMode(globalConfigFilePath, guiCfg, { filepath }); //caveat: guiCfg and filepath do not match if directories were set/replaced via command line! } } //gui mode: merged configs @@ -493,15 +493,15 @@ void Application::launch(const std::vector<Zstring>& commandArgs) return; } - std::vector<Zstring> filenames; + std::vector<Zstring> filepaths; for (const auto& item : configFiles) - filenames.push_back(item.first); + filepaths.push_back(item.first); XmlGuiConfig guiCfg; //structure to receive gui settings with default values try { std::wstring warningMsg; - readAnyConfig(filenames, guiCfg, warningMsg); //throw FileError + readAnyConfig(filepaths, guiCfg, warningMsg); //throw FileError if (!warningMsg.empty()) showNotificationDialog(nullptr, DialogInfoType::WARNING, PopupDialogCfg().setDetailInstructions(warningMsg)); @@ -512,7 +512,7 @@ void Application::launch(const std::vector<Zstring>& commandArgs) notifyError(e.toString(), std::wstring()); return; } - runGuiMode(globalConfigFilePath, guiCfg, filenames); + runGuiMode(globalConfigFilePath, guiCfg, filepaths); } } @@ -614,7 +614,7 @@ void runBatchMode(const Zstring& globalConfigFile, const XmlBatchConfig& batchCf batchCfg.mainCfg.onCompletion, globalCfg.gui.onCompletionHistory); - const std::vector<FolderPairCfg> cmpConfig = extractCompareCfg(batchCfg.mainCfg); + const std::vector<FolderPairCfg> cmpConfig = extractCompareCfg(batchCfg.mainCfg, globalCfg.fileTimeTolerance); bool allowPwPrompt = false; switch (batchCfg.handleError) @@ -632,8 +632,7 @@ void runBatchMode(const Zstring& globalConfigFile, const XmlBatchConfig& batchCf //COMPARE DIRECTORIES FolderComparison folderCmp; - compare(globalCfg.fileTimeTolerance, - globalCfg.optDialogs, + compare(globalCfg.optDialogs, allowPwPrompt, globalCfg.runWithBackgroundPriority, globalCfg.createLockFile, diff --git a/FreeFileSync/Source/comparison.cpp b/FreeFileSync/Source/comparison.cpp index 2d869845..e4495802 100644 --- a/FreeFileSync/Source/comparison.cpp +++ b/FreeFileSync/Source/comparison.cpp @@ -24,7 +24,7 @@ using namespace zen; -std::vector<FolderPairCfg> zen::extractCompareCfg(const MainConfiguration& mainCfg) +std::vector<FolderPairCfg> zen::extractCompareCfg(const MainConfiguration& mainCfg, int fileTimeTolerance) { //merge first and additional pairs std::vector<FolderPairEnh> allPairs; @@ -37,9 +37,11 @@ std::vector<FolderPairCfg> zen::extractCompareCfg(const MainConfiguration& mainC std::transform(allPairs.begin(), allPairs.end(), std::back_inserter(output), [&](const FolderPairEnh& enhPair) -> FolderPairCfg { - return FolderPairCfg(enhPair.dirnamePhraseLeft, enhPair.dirnamePhraseRight, - enhPair.altCmpConfig.get() ? enhPair.altCmpConfig->compareVar : mainCfg.cmpConfig.compareVar, - enhPair.altCmpConfig.get() ? enhPair.altCmpConfig->handleSymlinks : mainCfg.cmpConfig.handleSymlinks, + return FolderPairCfg(enhPair.dirpathPhraseLeft, enhPair.dirpathPhraseRight, + enhPair.altCmpConfig.get() ? enhPair.altCmpConfig->compareVar : mainCfg.cmpConfig.compareVar, + enhPair.altCmpConfig.get() ? enhPair.altCmpConfig->handleSymlinks : mainCfg.cmpConfig.handleSymlinks, + fileTimeTolerance, + enhPair.altCmpConfig.get() ? enhPair.altCmpConfig->optTimeShiftHours : mainCfg.cmpConfig.optTimeShiftHours, normalizeFilters(mainCfg.globalFilter, enhPair.localFilter), @@ -54,11 +56,11 @@ namespace struct ResolvedFolderPair { ResolvedFolderPair(const Zstring& left, const Zstring& right) : - dirnameLeft(left), - dirnameRight(right) {} + dirpathLeft(left), + dirpathRight(right) {} - Zstring dirnameLeft; //resolved directory names - Zstring dirnameRight; // + Zstring dirpathLeft; //resolved directory names + Zstring dirpathRight; // }; @@ -68,9 +70,9 @@ std::vector<ResolvedFolderPair> resolveDirectoryNames(const std::vector<FolderPa for (const FolderPairCfg& fpCfg : cfgList) output.push_back(ResolvedFolderPair( - getFormattedDirectoryName(fpCfg.dirnamePhraseLeft), - getFormattedDirectoryName(fpCfg.dirnamePhraseRight))); - warn_static("get volume by name for idle HDD! => call async getFormattedDirectoryName, but currently not thread-safe") + getFormattedDirectoryPath(fpCfg.dirpathPhraseLeft), + getFormattedDirectoryPath(fpCfg.dirpathPhraseRight))); + warn_static("get volume by name for idle HDD! => call async getFormattedDirectoryPath, but currently not thread-safe") return output; } @@ -94,21 +96,21 @@ ResolutionInfo resolveFolderPairs(const std::vector<FolderPairCfg>& cfgList, output.resolvedPairs = resolveDirectoryNames(cfgList); assert(output.resolvedPairs.size() == cfgList.size()); //postcondition! - std::set<Zstring, LessFilename> dirnames; + std::set<Zstring, LessFilename> dirpaths; for (const ResolvedFolderPair& fp : output.resolvedPairs) { - dirnames.insert(fp.dirnameLeft); - dirnames.insert(fp.dirnameRight); + dirpaths.insert(fp.dirpathLeft); + dirpaths.insert(fp.dirpathRight); } - const DirectoryStatus dirStatus = getExistingDirsUpdating(dirnames, allowUserInteraction, callback); //check *all* directories on each try! + const DirectoryStatus dirStatus = getExistingDirsUpdating(dirpaths, allowUserInteraction, callback); //check *all* directories on each try! output.existingDirs = dirStatus.existing; if (!dirStatus.missing.empty()) { std::wstring msg = _("Cannot find the following folders:") + L"\n"; - for (const Zstring& dirname : dirStatus.missing) - msg += std::wstring(L"\n") + dirname; + for (const Zstring& dirpath : dirStatus.missing) + msg += std::wstring(L"\n") + dirpath; throw FileError(msg, _("You can ignore this error to consider each folder as empty. The folders then will be created automatically during synchronization.")); } }, callback); @@ -123,9 +125,9 @@ void checkForIncompleteInput(const std::vector<ResolvedFolderPair>& folderPairs, bool haveFullPair = false; for (const ResolvedFolderPair& fp : folderPairs) - if (fp.dirnameLeft.empty() != fp.dirnameRight.empty()) + if (fp.dirpathLeft.empty() != fp.dirpathRight.empty()) havePartialPair = true; - else if (!fp.dirnameLeft.empty()) + else if (!fp.dirpathLeft.empty()) haveFullPair = true; if (havePartialPair == haveFullPair) //error if: all empty or exist both full and partial pairs -> support single-dir scenario @@ -147,10 +149,10 @@ void checkFolderDependency(const std::vector<ResolvedFolderPair>& folderPairs, b }; for (const ResolvedFolderPair& fp : folderPairs) - if (!fp.dirnameLeft.empty() && !fp.dirnameRight.empty()) //empty folders names may be accepted by user + if (!fp.dirpathLeft.empty() && !fp.dirpathRight.empty()) //empty folders names may be accepted by user { - if (areDependent(fp.dirnameLeft, fp.dirnameRight)) //test wheter leftDirectory begins with rightDirectory or the other way round - dependentDirs.push_back(std::make_pair(fp.dirnameLeft, fp.dirnameRight)); + if (areDependent(fp.dirpathLeft, fp.dirpathRight)) //test wheter leftDirectory begins with rightDirectory or the other way round + dependentDirs.push_back(std::make_pair(fp.dirpathLeft, fp.dirpathRight)); } if (!dependentDirs.empty()) @@ -170,15 +172,15 @@ void checkFolderDependency(const std::vector<ResolvedFolderPair>& folderPairs, b class ComparisonBuffer { public: - ComparisonBuffer(const std::set<DirectoryKey>& keysToRead, int fileTimeTol, ProcessCallback& callback); + ComparisonBuffer(const std::set<DirectoryKey>& keysToRead, ProcessCallback& callback); //create comparison result table and fill category except for files existing on both sides: undefinedFiles and undefinedLinks are appended! std::shared_ptr<BaseDirPair> compareByTimeSize(const ResolvedFolderPair& fp, const FolderPairCfg& fpConfig) const; std::list<std::shared_ptr<BaseDirPair>> compareByContent(const std::vector<std::pair<ResolvedFolderPair, FolderPairCfg>>& workLoad) const; private: - ComparisonBuffer(const ComparisonBuffer&); //=delete - ComparisonBuffer& operator=(const ComparisonBuffer&); //=delete + ComparisonBuffer (const ComparisonBuffer&) = delete; + ComparisonBuffer& operator=(const ComparisonBuffer&) = delete; std::shared_ptr<BaseDirPair> performComparison(const ResolvedFolderPair& fp, const FolderPairCfg& fpCfg, @@ -186,16 +188,11 @@ private: std::vector<SymlinkPair*>& undefinedLinks) const; std::map<DirectoryKey, DirectoryValue> directoryBuffer; //contains only *existing* directories - const int fileTimeTolerance; ProcessCallback& callback_; }; -ComparisonBuffer::ComparisonBuffer(const std::set<DirectoryKey>& keysToRead, - int fileTimeTol, - ProcessCallback& callback) : - fileTimeTolerance(fileTimeTol), - callback_(callback) +ComparisonBuffer::ComparisonBuffer(const std::set<DirectoryKey>& keysToRead, ProcessCallback& callback) : callback_(callback) { class CbImpl : public FillBufferCallback { @@ -249,7 +246,7 @@ const wchar_t arrowRight[] = L"-->"; //check for very old dates or dates in the future -std::wstring getConflictInvalidDate(const Zstring& fileNameFull, Int64 utcTime) +std::wstring getConflictInvalidDate(const Zstring& fileNameFull, std::int64_t utcTime) { return replaceCpy(_("File %x has an invalid date."), L"%x", fmtFileName(fileNameFull)) + L"\n" + _("Date:") + L" " + utcToLocalTimeString(utcTime); @@ -259,7 +256,7 @@ std::wstring getConflictInvalidDate(const Zstring& fileNameFull, Int64 utcTime) //check for changed files with same modification date std::wstring getConflictSameDateDiffSize(const FilePair& fileObj) { - return replaceCpy(_("Files %x have the same date but a different size."), L"%x", fmtFileName(fileObj.getObjRelativeName())) + L"\n" + + return replaceCpy(_("Files %x have the same date but a different size."), L"%x", fmtFileName(fileObj.getPairRelativePath())) + L"\n" + L" " + arrowLeft + L" " + _("Date:") + L" " + utcToLocalTimeString(fileObj.getLastWriteTime<LEFT_SIDE >()) + L" " + _("Size:") + L" " + toGuiString(fileObj.getFileSize<LEFT_SIDE>()) + L"\n" + L" " + arrowRight + L" " + _("Date:") + L" " + utcToLocalTimeString(fileObj.getLastWriteTime<RIGHT_SIDE>()) + L" " + _("Size:") + L" " + toGuiString(fileObj.getFileSize<RIGHT_SIDE>()); } @@ -267,15 +264,15 @@ std::wstring getConflictSameDateDiffSize(const FilePair& fileObj) std::wstring getConflictSkippedBinaryComparison(const FilePair& fileObj) { - return replaceCpy(_("Content comparison was skipped for excluded files %x."), L"%x", fmtFileName(fileObj.getObjRelativeName())); + return replaceCpy(_("Content comparison was skipped for excluded files %x."), L"%x", fmtFileName(fileObj.getPairRelativePath())); } std::wstring getDescrDiffMetaShortnameCase(const FileSystemObject& fsObj) { return _("Items differ in attributes only") + L"\n" + - L" " + arrowLeft + L" " + fmtFileName(fsObj.getShortName<LEFT_SIDE >()) + L"\n" + - L" " + arrowRight + L" " + fmtFileName(fsObj.getShortName<RIGHT_SIDE>()); + L" " + arrowLeft + L" " + fmtFileName(fsObj.getItemName<LEFT_SIDE >()) + L"\n" + + L" " + arrowRight + L" " + fmtFileName(fsObj.getItemName<RIGHT_SIDE>()); } @@ -289,37 +286,37 @@ std::wstring getDescrDiffMetaDate(const FileOrLinkPair& fileObj) //----------------------------------------------------------------------------- -void categorizeSymlinkByTime(SymlinkPair& linkObj, int fileTimeTolerance) +void categorizeSymlinkByTime(SymlinkPair& linkObj, int fileTimeTolerance, unsigned int optTimeShiftHours) { //categorize symlinks that exist on both sides - switch (CmpFileTime::getResult(linkObj.getLastWriteTime<LEFT_SIDE>(), - linkObj.getLastWriteTime<RIGHT_SIDE>(), fileTimeTolerance)) + switch (compareFileTime(linkObj.getLastWriteTime<LEFT_SIDE>(), + linkObj.getLastWriteTime<RIGHT_SIDE>(), fileTimeTolerance, optTimeShiftHours)) { - case CmpFileTime::TIME_EQUAL: + case TimeResult::EQUAL: //Caveat: //1. SYMLINK_EQUAL may only be set if short names match in case: InSyncDir's mapping tables use short name as a key! see db_file.cpp //2. harmonize with "bool stillInSync()" in algorithm.cpp - if (linkObj.getShortName<LEFT_SIDE>() == linkObj.getShortName<RIGHT_SIDE>()) + if (linkObj.getItemName<LEFT_SIDE>() == linkObj.getItemName<RIGHT_SIDE>()) linkObj.setCategory<FILE_EQUAL>(); else linkObj.setCategoryDiffMetadata(getDescrDiffMetaShortnameCase(linkObj)); break; - case CmpFileTime::TIME_LEFT_NEWER: + case TimeResult::LEFT_NEWER: linkObj.setCategory<FILE_LEFT_NEWER>(); break; - case CmpFileTime::TIME_RIGHT_NEWER: + case TimeResult::RIGHT_NEWER: linkObj.setCategory<FILE_RIGHT_NEWER>(); break; - case CmpFileTime::TIME_LEFT_INVALID: - linkObj.setCategoryConflict(getConflictInvalidDate(linkObj.getFullName<LEFT_SIDE>(), linkObj.getLastWriteTime<LEFT_SIDE>())); + case TimeResult::LEFT_INVALID: + linkObj.setCategoryConflict(getConflictInvalidDate(linkObj.getFullPath<LEFT_SIDE>(), linkObj.getLastWriteTime<LEFT_SIDE>())); break; - case CmpFileTime::TIME_RIGHT_INVALID: - linkObj.setCategoryConflict(getConflictInvalidDate(linkObj.getFullName<RIGHT_SIDE>(), linkObj.getLastWriteTime<RIGHT_SIDE>())); + case TimeResult::RIGHT_INVALID: + linkObj.setCategoryConflict(getConflictInvalidDate(linkObj.getFullPath<RIGHT_SIDE>(), linkObj.getLastWriteTime<RIGHT_SIDE>())); break; } } @@ -334,22 +331,22 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::compareByTimeSize(const ResolvedF //finish symlink categorization for (SymlinkPair* linkObj : uncategorizedLinks) - categorizeSymlinkByTime(*linkObj, fileTimeTolerance); + categorizeSymlinkByTime(*linkObj, fpConfig.fileTimeTolerance, fpConfig.optTimeShiftHours); //categorize files that exist on both sides for (FilePair* fileObj : uncategorizedFiles) { - switch (CmpFileTime::getResult(fileObj->getLastWriteTime<LEFT_SIDE>(), - fileObj->getLastWriteTime<RIGHT_SIDE>(), fileTimeTolerance)) + switch (compareFileTime(fileObj->getLastWriteTime<LEFT_SIDE>(), + fileObj->getLastWriteTime<RIGHT_SIDE>(), fpConfig.fileTimeTolerance, fpConfig.optTimeShiftHours)) { - case CmpFileTime::TIME_EQUAL: + case TimeResult::EQUAL: //Caveat: //1. FILE_EQUAL may only be set if short names match in case: InSyncDir's mapping tables use short name as a key! see db_file.cpp //2. FILE_EQUAL is expected to mean identical file sizes! See InSyncFile //3. harmonize with "bool stillInSync()" in algorithm.cpp, FilePair::syncTo() in file_hierarchy.cpp if (fileObj->getFileSize<LEFT_SIDE>() == fileObj->getFileSize<RIGHT_SIDE>()) { - if (fileObj->getShortName<LEFT_SIDE>() == fileObj->getShortName<RIGHT_SIDE>()) + if (fileObj->getItemName<LEFT_SIDE>() == fileObj->getItemName<RIGHT_SIDE>()) fileObj->setCategory<FILE_EQUAL>(); else fileObj->setCategoryDiffMetadata(getDescrDiffMetaShortnameCase(*fileObj)); @@ -358,20 +355,20 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::compareByTimeSize(const ResolvedF fileObj->setCategoryConflict(getConflictSameDateDiffSize(*fileObj)); //same date, different filesize break; - case CmpFileTime::TIME_LEFT_NEWER: + case TimeResult::LEFT_NEWER: fileObj->setCategory<FILE_LEFT_NEWER>(); break; - case CmpFileTime::TIME_RIGHT_NEWER: + case TimeResult::RIGHT_NEWER: fileObj->setCategory<FILE_RIGHT_NEWER>(); break; - case CmpFileTime::TIME_LEFT_INVALID: - fileObj->setCategoryConflict(getConflictInvalidDate(fileObj->getFullName<LEFT_SIDE>(), fileObj->getLastWriteTime<LEFT_SIDE>())); + case TimeResult::LEFT_INVALID: + fileObj->setCategoryConflict(getConflictInvalidDate(fileObj->getFullPath<LEFT_SIDE>(), fileObj->getLastWriteTime<LEFT_SIDE>())); break; - case CmpFileTime::TIME_RIGHT_INVALID: - fileObj->setCategoryConflict(getConflictInvalidDate(fileObj->getFullName<RIGHT_SIDE>(), fileObj->getLastWriteTime<RIGHT_SIDE>())); + case TimeResult::RIGHT_INVALID: + fileObj->setCategoryConflict(getConflictInvalidDate(fileObj->getFullPath<RIGHT_SIDE>(), fileObj->getLastWriteTime<RIGHT_SIDE>())); break; } } @@ -379,18 +376,18 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::compareByTimeSize(const ResolvedF } -void categorizeSymlinkByContent(SymlinkPair& linkObj, int fileTimeTolerance, ProcessCallback& callback) +void categorizeSymlinkByContent(SymlinkPair& linkObj, int fileTimeTolerance, unsigned int optTimeShiftHours, ProcessCallback& callback) { //categorize symlinks that exist on both sides Zstring targetPathRawL; Zstring targetPathRawR; Opt<std::wstring> errMsg = tryReportingError([&] { - callback.reportStatus(replaceCpy(_("Resolving symbolic link %x"), L"%x", fmtFileName(linkObj.getFullName<LEFT_SIDE>()))); - targetPathRawL = getSymlinkTargetRaw(linkObj.getFullName<LEFT_SIDE>()); //throw FileError + callback.reportStatus(replaceCpy(_("Resolving symbolic link %x"), L"%x", fmtFileName(linkObj.getFullPath<LEFT_SIDE>()))); + targetPathRawL = getSymlinkTargetRaw(linkObj.getFullPath<LEFT_SIDE>()); //throw FileError - callback.reportStatus(replaceCpy(_("Resolving symbolic link %x"), L"%x", fmtFileName(linkObj.getFullName<RIGHT_SIDE>()))); - targetPathRawR = getSymlinkTargetRaw(linkObj.getFullName<RIGHT_SIDE>()); //throw FileError + callback.reportStatus(replaceCpy(_("Resolving symbolic link %x"), L"%x", fmtFileName(linkObj.getFullPath<RIGHT_SIDE>()))); + targetPathRawR = getSymlinkTargetRaw(linkObj.getFullPath<RIGHT_SIDE>()); //throw FileError }, callback); if (errMsg) @@ -400,8 +397,8 @@ void categorizeSymlinkByContent(SymlinkPair& linkObj, int fileTimeTolerance, Pro if (targetPathRawL == targetPathRawR #ifdef ZEN_WIN //type of symbolic link is relevant for Windows only && - dirExists(linkObj.getFullName<LEFT_SIDE >()) == //check if dir-symlink - dirExists(linkObj.getFullName<RIGHT_SIDE>()) // + dirExists(linkObj.getFullPath<LEFT_SIDE >()) == //check if dir-symlink + dirExists(linkObj.getFullPath<RIGHT_SIDE>()) // #endif ) { @@ -410,10 +407,10 @@ void categorizeSymlinkByContent(SymlinkPair& linkObj, int fileTimeTolerance, Pro //2. harmonize with "bool stillInSync()" in algorithm.cpp, FilePair::syncTo() in file_hierarchy.cpp //symlinks have same "content" - if (linkObj.getShortName<LEFT_SIDE>() != linkObj.getShortName<RIGHT_SIDE>()) + if (linkObj.getItemName<LEFT_SIDE>() != linkObj.getItemName<RIGHT_SIDE>()) linkObj.setCategoryDiffMetadata(getDescrDiffMetaShortnameCase(linkObj)); else if (!sameFileTime(linkObj.getLastWriteTime<LEFT_SIDE>(), - linkObj.getLastWriteTime<RIGHT_SIDE>(), fileTimeTolerance)) + linkObj.getLastWriteTime<RIGHT_SIDE>(), fileTimeTolerance, optTimeShiftHours)) linkObj.setCategoryDiffMetadata(getDescrDiffMetaDate(linkObj)); else linkObj.setCategory<FILE_EQUAL>(); @@ -431,48 +428,47 @@ std::list<std::shared_ptr<BaseDirPair>> ComparisonBuffer::compareByContent(const return output; //PERF_START; - std::vector<FilePair*> undefinedFiles; + std::vector<FilePair*> filesToCompareBytewise; //process folder pairs one after another for (const auto& w : workLoad) { + std::vector<FilePair*> undefinedFiles; std::vector<SymlinkPair*> uncategorizedLinks; //do basis scan and retrieve candidates for binary comparison (files existing on both sides) output.push_back(performComparison(w.first, w.second, undefinedFiles, uncategorizedLinks)); + //content comparison of file content happens AFTER finding corresponding files and AFTER filtering + //in order to separate into two processes (scanning and comparing) + for (FilePair* fileObj : undefinedFiles) + //pre-check: files have different content if they have a different filesize (must not be FILE_EQUAL: see InSyncFile) + if (fileObj->getFileSize<LEFT_SIDE>() != fileObj->getFileSize<RIGHT_SIDE>()) + fileObj->setCategory<FILE_DIFFERENT>(); + else + { + //perf: skip binary comparison for excluded rows (e.g. via time span and size filter)! + //both soft and hard filter were already applied in ComparisonBuffer::performComparison()! + if (!fileObj->isActive()) + fileObj->setCategoryConflict(getConflictSkippedBinaryComparison(*fileObj)); + else + filesToCompareBytewise.push_back(fileObj); + } + //finish symlink categorization for (SymlinkPair* linkObj : uncategorizedLinks) - categorizeSymlinkByContent(*linkObj, fileTimeTolerance, callback_); + categorizeSymlinkByContent(*linkObj, w.second.fileTimeTolerance, w.second.optTimeShiftHours, callback_); } //finish categorization... - std::vector<FilePair*> filesToCompareBytewise; - - //content comparison of file content happens AFTER finding corresponding files and AFTER filtering - //in order to separate into two processes (scanning and comparing) - for (FilePair* fileObj : undefinedFiles) - //pre-check: files have different content if they have a different filesize (must not be FILE_EQUAL: see InSyncFile) - if (fileObj->getFileSize<LEFT_SIDE>() != fileObj->getFileSize<RIGHT_SIDE>()) - fileObj->setCategory<FILE_DIFFERENT>(); - else - { - //perf: skip binary comparison for excluded rows (e.g. via time span and size filter)! - //both soft and hard filter were already applied in ComparisonBuffer::performComparison()! - if (!fileObj->isActive()) - fileObj->setCategoryConflict(getConflictSkippedBinaryComparison(*fileObj)); - else - filesToCompareBytewise.push_back(fileObj); - } - const size_t objectsTotal = filesToCompareBytewise.size(); - UInt64 bytesTotal; //left and right filesizes are equal + std::uint64_t bytesTotal = 0; //left and right filesizes are equal for (FilePair* fileObj : filesToCompareBytewise) bytesTotal += fileObj->getFileSize<LEFT_SIDE>(); callback_.initNewPhase(static_cast<int>(objectsTotal), //may throw - to<Int64>(bytesTotal), + bytesTotal, ProcessCallback::PHASE_COMPARING_CONTENT); const std::wstring txtComparingContentOfFiles = _("Comparing content of files %x"); @@ -480,19 +476,19 @@ std::list<std::shared_ptr<BaseDirPair>> ComparisonBuffer::compareByContent(const //compare files (that have same size) bytewise... for (FilePair* fileObj : filesToCompareBytewise) { - callback_.reportStatus(replaceCpy(txtComparingContentOfFiles, L"%x", fmtFileName(fileObj->getObjRelativeName()), false)); + callback_.reportStatus(replaceCpy(txtComparingContentOfFiles, L"%x", fmtFileName(fileObj->getPairRelativePath()), false)); //check files that exist in left and right model but have different content bool haveSameContent = false; Opt<std::wstring> errMsg = tryReportingError([&] { - StatisticsReporter statReporter(1, to<Int64>(fileObj->getFileSize<LEFT_SIDE>()), callback_); + StatisticsReporter statReporter(1, fileObj->getFileSize<LEFT_SIDE>(), callback_); - auto onUpdateStatus = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onUpdateStatus = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; - haveSameContent = filesHaveSameContent(fileObj->getFullName<LEFT_SIDE>(), - fileObj->getFullName<RIGHT_SIDE>(), onUpdateStatus); //throw FileError + haveSameContent = filesHaveSameContent(fileObj->getFullPath<LEFT_SIDE>(), + fileObj->getFullPath<RIGHT_SIDE>(), onUpdateStatus); //throw FileError statReporter.reportDelta(1, 0); statReporter.reportFinished(); @@ -508,10 +504,10 @@ std::list<std::shared_ptr<BaseDirPair>> ComparisonBuffer::compareByContent(const //1. FILE_EQUAL may only be set if short names match in case: InSyncDir's mapping tables use short name as a key! see db_file.cpp //2. FILE_EQUAL is expected to mean identical file sizes! See InSyncFile //3. harmonize with "bool stillInSync()" in algorithm.cpp, FilePair::syncTo() in file_hierarchy.cpp - if (fileObj->getShortName<LEFT_SIDE>() != fileObj->getShortName<RIGHT_SIDE>()) + if (fileObj->getItemName<LEFT_SIDE>() != fileObj->getItemName<RIGHT_SIDE>()) fileObj->setCategoryDiffMetadata(getDescrDiffMetaShortnameCase(*fileObj)); else if (!sameFileTime(fileObj->getLastWriteTime<LEFT_SIDE>(), - fileObj->getLastWriteTime<RIGHT_SIDE>(), fileTimeTolerance)) + fileObj->getLastWriteTime<RIGHT_SIDE>(), fileObj->root().getFileTimeTolerance(), fileObj->root().getTimeShift())) fileObj->setCategoryDiffMetadata(getDescrDiffMetaDate(*fileObj)); else fileObj->setCategory<FILE_EQUAL>(); @@ -667,7 +663,7 @@ void stripExcludedDirectories(HierarchyObject& hierObj, const HardFilter& filter //process subdirs recursively for (DirPair& dirObj : hierObj.refSubDirs()) { - dirObj.setActive(filterProc.passDirFilter(dirObj.getObjRelativeName(), nullptr)); //subObjMightMatch is always true in this context! + dirObj.setActive(filterProc.passDirFilter(dirObj.getPairRelativePath(), nullptr)); //subObjMightMatch is always true in this context! stripExcludedDirectories(dirObj, filterProc); } @@ -692,14 +688,14 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::performComparison(const ResolvedF callback_.reportStatus(_("Generating file list...")); callback_.forceUiRefresh(); - auto getDirValue = [&](const Zstring& dirnameFmt) -> const DirectoryValue* + auto getDirValue = [&](const Zstring& dirpathFmt) -> const DirectoryValue* { - auto it = directoryBuffer.find(DirectoryKey(dirnameFmt, fpCfg.filter.nameFilter, fpCfg.handleSymlinks)); + auto it = directoryBuffer.find(DirectoryKey(dirpathFmt, fpCfg.filter.nameFilter, fpCfg.handleSymlinks)); return it != directoryBuffer.end() ? &it->second : nullptr; }; - const DirectoryValue* bufValueLeft = getDirValue(fp.dirnameLeft); - const DirectoryValue* bufValueRight = getDirValue(fp.dirnameRight); + const DirectoryValue* bufValueLeft = getDirValue(fp.dirpathLeft); + const DirectoryValue* bufValueRight = getDirValue(fp.dirpathRight); Zstring filterFailedRead; auto filterAddFailedDirReads = [&filterFailedRead](const std::set<Zstring>& failedDirReads) //exclude directory child items only! @@ -721,13 +717,14 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::performComparison(const ResolvedF if (bufValueLeft ) filterAddFailedItemReads(bufValueLeft ->failedItemReads); if (bufValueRight) filterAddFailedItemReads(bufValueRight->failedItemReads); - std::shared_ptr<BaseDirPair> output = std::make_shared<BaseDirPair>(fp.dirnameLeft, + std::shared_ptr<BaseDirPair> output = std::make_shared<BaseDirPair>(fp.dirpathLeft, bufValueLeft != nullptr, //dir existence must be checked only once: available iff buffer entry exists! - fp.dirnameRight, + fp.dirpathRight, bufValueRight != nullptr, fpCfg.filter.nameFilter, fpCfg.compareVar, - fileTimeTolerance); + fpCfg.fileTimeTolerance, + fpCfg.optTimeShiftHours); //PERF_START; MergeSides(undefinedFiles, undefinedLinks).execute(bufValueLeft ? bufValueLeft ->dirCont : DirContainer(), bufValueRight ? bufValueRight->dirCont : DirContainer(), *output); @@ -753,8 +750,7 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::performComparison(const ResolvedF } -void zen::compare(int fileTimeTolerance, - xmlAccess::OptionalDialogs& warnings, +void zen::compare(xmlAccess::OptionalDialogs& warnings, bool allowUserInteraction, bool runWithBackgroundPriority, bool createDirLocks, @@ -808,7 +804,7 @@ void zen::compare(int fileTimeTolerance, //-------------------end of basic checks------------------------------------------ - auto dirAvailable = [&](const Zstring& dirnameFmt) { return resInfo.existingDirs.find(dirnameFmt) != resInfo.existingDirs.end(); }; + auto dirAvailable = [&](const Zstring& dirpathFmt) { return resInfo.existingDirs.find(dirpathFmt) != resInfo.existingDirs.end(); }; std::vector<std::pair<ResolvedFolderPair, FolderPairCfg>> totalWorkLoad; for (size_t i = 0; i < cfgList.size(); ++i) @@ -825,10 +821,10 @@ void zen::compare(int fileTimeTolerance, for (const auto& w : totalWorkLoad) { - if (dirAvailable(w.first.dirnameLeft)) //only traverse *currently existing* directories: at this point user is aware that non-ex + empty string are seen as empty folder! - dirsToRead.insert(DirectoryKey(w.first.dirnameLeft, w.second.filter.nameFilter, w.second.handleSymlinks)); - if (dirAvailable(w.first.dirnameRight)) - dirsToRead.insert(DirectoryKey(w.first.dirnameRight, w.second.filter.nameFilter, w.second.handleSymlinks)); + if (dirAvailable(w.first.dirpathLeft)) //only traverse *currently existing* directories: at this point user is aware that non-ex + empty string are seen as empty folder! + dirsToRead.insert(DirectoryKey(w.first.dirpathLeft, w.second.filter.nameFilter, w.second.handleSymlinks)); + if (dirAvailable(w.first.dirpathRight)) + dirsToRead.insert(DirectoryKey(w.first.dirpathRight, w.second.filter.nameFilter, w.second.handleSymlinks)); } FolderComparison outputTmp; //write to output as a transaction! @@ -836,7 +832,7 @@ void zen::compare(int fileTimeTolerance, //reduce peak memory by restricting lifetime of ComparisonBuffer to have ended when loading potentially huge InSyncDir instance in redetermineSyncDirection() { //------------ traverse/read folders ----------------------------------------------------- - ComparisonBuffer cmpBuff(dirsToRead, fileTimeTolerance, callback); + ComparisonBuffer cmpBuff(dirsToRead, callback); //process binary comparison as one junk std::vector<std::pair<ResolvedFolderPair, FolderPairCfg>> workLoadByContent; diff --git a/FreeFileSync/Source/comparison.h b/FreeFileSync/Source/comparison.h index b69eaa51..6fcd3c29 100644 --- a/FreeFileSync/Source/comparison.h +++ b/FreeFileSync/Source/comparison.h @@ -22,31 +22,36 @@ struct FolderPairCfg const Zstring& dirPhraseRight, CompareVariant cmpVar, SymLinkHandling handleSymlinksIn, + int fileTimeToleranceIn, + unsigned int optTimeShiftHoursIn, const NormalizedFilter& filterIn, const DirectionConfig& directCfg) : - dirnamePhraseLeft(dirPhraseLeft), - dirnamePhraseRight(dirPhraseRight), + dirpathPhraseLeft(dirPhraseLeft), + dirpathPhraseRight(dirPhraseRight), compareVar(cmpVar), handleSymlinks(handleSymlinksIn), + fileTimeTolerance(fileTimeToleranceIn), + optTimeShiftHours(optTimeShiftHoursIn), filter(filterIn), directionCfg(directCfg) {} - Zstring dirnamePhraseLeft; //unresolved directory names as entered by user! - Zstring dirnamePhraseRight; // + Zstring dirpathPhraseLeft; //unresolved directory names as entered by user! + Zstring dirpathPhraseRight; // CompareVariant compareVar; SymLinkHandling handleSymlinks; + int fileTimeTolerance; + unsigned int optTimeShiftHours; NormalizedFilter filter; DirectionConfig directionCfg; }; -std::vector<FolderPairCfg> extractCompareCfg(const MainConfiguration& mainCfg); //fill FolderPairCfg and resolve folder pairs +std::vector<FolderPairCfg> extractCompareCfg(const MainConfiguration& mainCfg, int fileTimeTolerance); //fill FolderPairCfg and resolve folder pairs //FFS core routine: -void compare(int fileTimeTolerance, //max allowed file time deviation - xmlAccess::OptionalDialogs& warnings, +void compare(xmlAccess::OptionalDialogs& warnings, bool allowUserInteraction, bool runWithBackgroundPriority, bool createDirLocks, diff --git a/FreeFileSync/Source/file_hierarchy.cpp b/FreeFileSync/Source/file_hierarchy.cpp index 2d5891c1..0fd50191 100644 --- a/FreeFileSync/Source/file_hierarchy.cpp +++ b/FreeFileSync/Source/file_hierarchy.cpp @@ -357,8 +357,8 @@ std::wstring zen::getSyncOpDescription(const FileSystemObject& fsObj) case SO_COPY_METADATA_TO_RIGHT: //harmonize with synchronization.cpp::SynchronizeFolderPair::synchronizeFileInt, ect!! { - Zstring shortNameOld = fsObj.getShortName<RIGHT_SIDE>(); - Zstring shortNameNew = fsObj.getShortName<LEFT_SIDE >(); + Zstring shortNameOld = fsObj.getItemName<RIGHT_SIDE>(); + Zstring shortNameNew = fsObj.getItemName<LEFT_SIDE >(); if (op == SO_COPY_METADATA_TO_LEFT) std::swap(shortNameOld, shortNameNew); @@ -383,7 +383,7 @@ std::wstring zen::getSyncOpDescription(const FileSystemObject& fsObj) if (!isSource) std::swap(sourceFile, targetFile); - auto getRelName = [&](const FileSystemObject& fso, bool leftSide) { return leftSide ? fso.getRelativeName<LEFT_SIDE>() : fso.getRelativeName<RIGHT_SIDE>(); }; + auto getRelName = [&](const FileSystemObject& fso, bool leftSide) { return leftSide ? fso.getRelativePath<LEFT_SIDE>() : fso.getRelativePath<RIGHT_SIDE>(); }; const Zstring relSource = getRelName(*sourceFile, onLeft); const Zstring relTarget = getRelName(*targetFile, !onLeft); diff --git a/FreeFileSync/Source/file_hierarchy.h b/FreeFileSync/Source/file_hierarchy.h index 2b8ee006..d4e92cde 100644 --- a/FreeFileSync/Source/file_hierarchy.h +++ b/FreeFileSync/Source/file_hierarchy.h @@ -16,7 +16,6 @@ #include <zen/fixed_list.h> #include <zen/stl_tools.h> #include "structures.h" -#include <zen/int64.h> #include <zen/file_id_def.h> #include "structures.h" #include "lib/hard_filter.h" @@ -25,9 +24,9 @@ namespace zen { struct FileDescriptor { - FileDescriptor() : fileIdx(), devId(), isFollowedSymlink() {} - FileDescriptor(const Int64& lastWriteTimeRawIn, - const UInt64& fileSizeIn, + FileDescriptor() : lastWriteTimeRaw(), fileSize(), fileIdx(), devId(), isFollowedSymlink() {} + FileDescriptor(std::int64_t lastWriteTimeRawIn, + std::uint64_t fileSizeIn, const FileId& idIn, bool isSymlink) : lastWriteTimeRaw(lastWriteTimeRawIn), @@ -36,8 +35,8 @@ struct FileDescriptor devId(idIn.first), isFollowedSymlink(isSymlink) {} - Int64 lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC, same semantics like time_t (== signed long) - UInt64 fileSize; + std::int64_t lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC, same semantics like time_t (== signed long) + std::uint64_t fileSize; FileIndex fileIdx; // == file id: optional! (however, always set on Linux, and *generally* available on Windows) DeviceId devId; //split into file id into components to avoid padding overhead of a std::pair! bool isFollowedSymlink; @@ -48,10 +47,10 @@ FileId getFileId(const FileDescriptor& fd) { return FileId(fd.devId, fd.fileIdx) struct LinkDescriptor { - LinkDescriptor() {} - explicit LinkDescriptor(const Int64& lastWriteTimeRawIn) : lastWriteTimeRaw(lastWriteTimeRawIn) {} + LinkDescriptor() : lastWriteTimeRaw() {} + explicit LinkDescriptor(std::int64_t lastWriteTimeRawIn) : lastWriteTimeRaw(lastWriteTimeRawIn) {} - Int64 lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC, same semantics like time_t (== signed long) + std::int64_t lastWriteTimeRaw; //number of seconds since Jan. 1st 1970 UTC, same semantics like time_t (== signed long) }; @@ -155,9 +154,9 @@ class HierarchyObject friend class FileSystemObject; public: - typedef zen::FixedList<FilePair> SubFileVec; //MergeSides::execute() requires a structure that doesn't invalidate pointers after push_back() - typedef zen::FixedList<SymlinkPair> SubLinkVec; //Note: deque<> has circular dependency in VCPP! - typedef zen::FixedList<DirPair> SubDirVec; + typedef FixedList<FilePair> SubFileVec; //MergeSides::execute() requires a structure that doesn't invalidate pointers after push_back() + typedef FixedList<SymlinkPair> SubLinkVec; //Note: deque<> has circular dependency in VCPP! + typedef FixedList<DirPair> SubDirVec; DirPair& addSubDir(const Zstring& shortNameLeft, const Zstring& shortNameRight, @@ -198,12 +197,12 @@ public: BaseDirPair& getRoot() { return root_; } - const Zstring& getObjRelativeNamePf() const { return objRelNamePf; } //postfixed or empty! + const Zstring& getPairRelativePathPf() const { return pairRelPathPf; } //postfixed or empty! protected: - HierarchyObject(const Zstring& relativeNamePf, + HierarchyObject(const Zstring& relPathPf, BaseDirPair& baseDirObj) : - objRelNamePf(relativeNamePf), + pairRelPathPf(relPathPf), root_(baseDirObj) {} ~HierarchyObject() {} //don't need polymorphic deletion @@ -215,14 +214,14 @@ protected: private: virtual void notifySyncCfgChanged() {} - HierarchyObject(const HierarchyObject&); //this class is referenced by it's child elements => make it non-copyable/movable! - HierarchyObject& operator=(const HierarchyObject&); // + HierarchyObject (const HierarchyObject&) = delete; //this class is referenced by it's child elements => make it non-copyable/movable! + HierarchyObject& operator=(const HierarchyObject&) = delete; SubFileVec subFiles; //contained file maps SubLinkVec subLinks; //contained symbolic link maps SubDirVec subDirs; //contained directory maps - Zstring objRelNamePf; //postfixed or empty + Zstring pairRelPathPf; //postfixed or empty BaseDirPair& root_; }; @@ -237,7 +236,8 @@ public: bool dirExistsRight, const HardFilter::FilterRef& filter, CompareVariant cmpVar, - int fileTimeTolerance) : + int fileTimeTolerance, + unsigned int optTimeShiftHours) : #ifdef _MSC_VER #pragma warning(push) #pragma warning(disable : 4355) //"The this pointer is valid only within nonstatic member functions. It cannot be used in the initializer list for a base class." @@ -246,7 +246,7 @@ public: #ifdef _MSC_VER #pragma warning(pop) #endif - filter_(filter), cmpVar_(cmpVar), fileTimeTolerance_(fileTimeTolerance), + filter_(filter), cmpVar_(cmpVar), fileTimeTolerance_(fileTimeTolerance), optTimeShiftHours_(optTimeShiftHours), baseDirPfL (dirPostfixedLeft ), baseDirPfR (dirPostfixedRight), dirExistsLeft_ (dirExistsLeft ), @@ -262,16 +262,18 @@ public: const HardFilter& getFilter() const { return *filter_; } CompareVariant getCompVariant() const { return cmpVar_; } int getFileTimeTolerance() const { return fileTimeTolerance_; } + unsigned int getTimeShift() const { return optTimeShiftHours_; } virtual void flip(); private: - BaseDirPair(const BaseDirPair&); //this class is referenced by HierarchyObject => make it non-copyable/movable! - BaseDirPair& operator=(const BaseDirPair&); // + BaseDirPair (const BaseDirPair&) = delete; //this class is referenced by HierarchyObject => make it non-copyable/movable! + BaseDirPair& operator=(const BaseDirPair&) = delete; - HardFilter::FilterRef filter_; //filter used while scanning directory: represents sub-view of actual files! - CompareVariant cmpVar_; - int fileTimeTolerance_; + const HardFilter::FilterRef filter_; //filter used while scanning directory: represents sub-view of actual files! + const CompareVariant cmpVar_; + const int fileTimeTolerance_; + const unsigned int optTimeShiftHours_; Zstring baseDirPfL; //base sync dir postfixed Zstring baseDirPfR; // @@ -352,10 +354,10 @@ protected: ~ObjectMgr() { activeObjects().erase (this); } private: - ObjectMgr(const ObjectMgr& rhs); //= delete - ObjectMgr& operator=(const ObjectMgr& rhs); //it's not well-defined what copying an objects means regarding object-identity in this context + ObjectMgr (const ObjectMgr& rhs) = delete; + ObjectMgr& operator=(const ObjectMgr& rhs) = delete; //it's not well-defined what copying an objects means regarding object-identity in this context - static zen::hash_set<const ObjectMgr*>& activeObjects() { static zen::hash_set<const ObjectMgr*> inst; return inst; } //external linkage (even in header file!) + static hash_set<const ObjectMgr*>& activeObjects() { static hash_set<const ObjectMgr*> inst; return inst; } //external linkage (even in header file!) }; //------------------------------------------------------------------ @@ -365,13 +367,13 @@ class FileSystemObject : public ObjectMgr<FileSystemObject> public: virtual void accept(FSObjectVisitor& visitor) const = 0; - Zstring getObjShortName () const; //same as getShortName() but also returns value if either side is empty - Zstring getObjRelativeName() const; //same as getRelativeName() but also returns value if either side is empty + Zstring getPairShortName () const; //like getItemName() but also returns value if either side is empty + Zstring getPairRelativePath() const; //like getRelativePath() but also returns value if either side is empty template <SelectedSide side> bool isEmpty() const; - template <SelectedSide side> const Zstring& getShortName() const; //case sensitive! - template <SelectedSide side> Zstring getRelativeName() const; //get name relative to base sync dir without FILE_NAME_SEPARATOR prefix + template <SelectedSide side> const Zstring& getItemName() const; //case sensitive! + template <SelectedSide side> Zstring getRelativePath() const; //get name relative to base sync dir without FILE_NAME_SEPARATOR prefix template <SelectedSide side> const Zstring& getBaseDirPf() const; //base sync directory postfixed with FILE_NAME_SEPARATOR - template <SelectedSide side> Zstring getFullName() const; //getFullName() == getBaseDirPf() + getRelativeName() + template <SelectedSide side> Zstring getFullPath() const; //getFullPath() == getBaseDirPf() + getRelativePath() //comparison result CompareFilesResult getCategory() const { return cmpResult; } @@ -444,7 +446,7 @@ private: //Note: we model *four* states with last two variables => "syncDirConflict is empty or syncDir == NONE" is a class invariant!!! - Zstring shortNameLeft_; //slightly redundant under linux, but on windows the "same" filenames can differ in case + Zstring shortNameLeft_; //slightly redundant under linux, but on windows the "same" filepaths can differ in case Zstring shortNameRight_; //use as indicator: an empty name means: not existing! HierarchyObject& parent_; @@ -466,7 +468,7 @@ public: HierarchyObject& parentObj, CompareDirResult defaultCmpResult) : FileSystemObject(shortNameLeft, shortNameRight, parentObj, static_cast<CompareFilesResult>(defaultCmpResult)), - HierarchyObject(getObjRelativeName() + FILE_NAME_SEPARATOR, parentObj.getRoot()), + HierarchyObject(getPairRelativePath() + FILE_NAME_SEPARATOR, parentObj.getRoot()), syncOpBuffered(SO_DO_NOTHING), syncOpUpToDate(false) {} @@ -504,8 +506,8 @@ public: dataRight(right), moveFileRef(nullptr) {} - template <SelectedSide side> Int64 getLastWriteTime () const; - template <SelectedSide side> UInt64 getFileSize () const; + template <SelectedSide side> std::int64_t getLastWriteTime () const; + template <SelectedSide side> std::uint64_t getFileSize() const; template <SelectedSide side> FileId getFileId () const; template <SelectedSide side> bool isFollowedSymlink() const; @@ -519,9 +521,9 @@ public: template <SelectedSide sideTrg> void setSyncedTo(const Zstring& shortName, //call after sync, sets FILE_EQUAL - const UInt64& fileSize, - const Int64& lastWriteTimeTrg, - const Int64& lastWriteTimeSrc, + std::uint64_t fileSize, + std::int64_t lastWriteTimeTrg, + std::int64_t lastWriteTimeSrc, const FileId& fileIdTrg, const FileId& fileIdSrc, bool isSymlinkTrg, @@ -549,7 +551,7 @@ class SymlinkPair : public FileSystemObject //this class models a TRUE symbolic public: virtual void accept(FSObjectVisitor& visitor) const; - template <SelectedSide side> zen::Int64 getLastWriteTime() const; //write time of the link, NOT target! + template <SelectedSide side> std::int64_t getLastWriteTime() const; //write time of the link, NOT target! CompareSymlinkResult getLinkCategory() const; //returns actually used subset of CompareFilesResult @@ -565,8 +567,8 @@ public: template <SelectedSide sideTrg> void setSyncedTo(const Zstring& shortName, //call after sync, sets SYMLINK_EQUAL - const Int64& lastWriteTimeTrg, - const Int64& lastWriteTimeSrc); + std::int64_t lastWriteTimeTrg, + std::int64_t lastWriteTimeSrc); private: virtual void flip(); @@ -705,37 +707,37 @@ bool FileSystemObject::isEmpty() const template <SelectedSide side> inline -const Zstring& FileSystemObject::getShortName() const +const Zstring& FileSystemObject::getItemName() const { return SelectParam<side>::get(shortNameLeft_, shortNameRight_); //empty if not existing } template <SelectedSide side> inline -Zstring FileSystemObject::getRelativeName() const +Zstring FileSystemObject::getRelativePath() const { - return isEmpty<side>() ? Zstring() : parent_.getObjRelativeNamePf() + getShortName<side>(); + return isEmpty<side>() ? Zstring() : parent_.getPairRelativePathPf() + getItemName<side>(); } inline -Zstring FileSystemObject::getObjRelativeName() const +Zstring FileSystemObject::getPairRelativePath() const { - return parent_.getObjRelativeNamePf() + getObjShortName(); + return parent_.getPairRelativePathPf() + getPairShortName(); } inline -Zstring FileSystemObject::getObjShortName() const +Zstring FileSystemObject::getPairShortName() const { - return isEmpty<LEFT_SIDE>() ? getShortName<RIGHT_SIDE>() : getShortName<LEFT_SIDE>(); + return isEmpty<LEFT_SIDE>() ? getItemName<RIGHT_SIDE>() : getItemName<LEFT_SIDE>(); } template <SelectedSide side> inline -Zstring FileSystemObject::getFullName() const +Zstring FileSystemObject::getFullPath() const { - return isEmpty<side>() ? Zstring() : getBaseDirPf<side>() + parent_.getObjRelativeNamePf() + getShortName<side>(); + return isEmpty<side>() ? Zstring() : getBaseDirPf<side>() + parent_.getPairRelativePathPf() + getItemName<side>(); } @@ -1005,14 +1007,14 @@ void FilePair::removeObjectR() template <SelectedSide side> inline -zen::Int64 FilePair::getLastWriteTime() const +std::int64_t FilePair::getLastWriteTime() const { return SelectParam<side>::get(dataLeft, dataRight).lastWriteTimeRaw; } template <SelectedSide side> inline -zen::UInt64 FilePair::getFileSize() const +std::uint64_t FilePair::getFileSize() const { return SelectParam<side>::get(dataLeft, dataRight).fileSize; } @@ -1035,9 +1037,9 @@ bool FilePair::isFollowedSymlink() const template <SelectedSide sideTrg> inline void FilePair::setSyncedTo(const Zstring& shortName, - const UInt64& fileSize, - const Int64& lastWriteTimeTrg, - const Int64& lastWriteTimeSrc, + std::uint64_t fileSize, + std::int64_t lastWriteTimeTrg, + std::int64_t lastWriteTimeSrc, const FileId& fileIdTrg, const FileId& fileIdSrc, bool isSymlinkTrg, @@ -1056,8 +1058,8 @@ void FilePair::setSyncedTo(const Zstring& shortName, template <SelectedSide sideTrg> inline void SymlinkPair::setSyncedTo(const Zstring& shortName, - const Int64& lastWriteTimeTrg, - const Int64& lastWriteTimeSrc) + std::int64_t lastWriteTimeTrg, + std::int64_t lastWriteTimeSrc) { static const SelectedSide sideSrc = OtherSide<sideTrg>::result; @@ -1076,7 +1078,7 @@ void DirPair::setSyncedTo(const Zstring& shortName) template <SelectedSide side> inline -zen::Int64 SymlinkPair::getLastWriteTime() const +std::int64_t SymlinkPair::getLastWriteTime() const { return SelectParam<side>::get(dataLeft, dataRight).lastWriteTimeRaw; } diff --git a/FreeFileSync/Source/lib/binary.cpp b/FreeFileSync/Source/lib/binary.cpp index 0d62f0ec..5fb1d176 100644 --- a/FreeFileSync/Source/lib/binary.cpp +++ b/FreeFileSync/Source/lib/binary.cpp @@ -8,7 +8,6 @@ #include <zen/tick_count.h> #include <vector> #include <zen/file_io.h> -#include <zen/int64.h> #include <boost/thread/tss.hpp> using namespace zen; @@ -69,7 +68,7 @@ const std::int64_t TICKS_PER_SEC = ticksPerSec(); } -bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename2, const std::function<void(Int64 bytesDelta)>& onUpdateStatus) +bool zen::filesHaveSameContent(const Zstring& filepath1, const Zstring& filepath2, const std::function<void(std::int64_t bytesDelta)>& onUpdateStatus) { static boost::thread_specific_ptr<std::vector<char>> cpyBuf1; static boost::thread_specific_ptr<std::vector<char>> cpyBuf2; @@ -81,8 +80,8 @@ bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename std::vector<char>& memory1 = *cpyBuf1; std::vector<char>& memory2 = *cpyBuf2; - FileInput file1(filename1); //throw FileError - FileInput file2(filename2); // + FileInput file1(filepath1); //throw FileError + FileInput file2(filepath2); // BufferSize bufferSize; @@ -99,7 +98,7 @@ bool zen::filesHaveSameContent(const Zstring& filename1, const Zstring& filename const size_t length2 = file2.read(&memory2[0], bufferSize); //returns actual number of bytes read //send progress updates immediately after reading to reliably allow speed calculations for our clients! if (onUpdateStatus) - onUpdateStatus(to<Int64>(std::max(length1, length2))); + onUpdateStatus(std::max(length1, length2)); if (length1 != length2 || ::memcmp(&memory1[0], &memory2[0], length1) != 0) return false; diff --git a/FreeFileSync/Source/lib/binary.h b/FreeFileSync/Source/lib/binary.h index a105c622..c9c479ac 100644 --- a/FreeFileSync/Source/lib/binary.h +++ b/FreeFileSync/Source/lib/binary.h @@ -10,13 +10,12 @@ #include <functional> #include <zen/zstring.h> #include <zen/file_error.h> -#include <zen/int64.h> namespace zen { -bool filesHaveSameContent(const Zstring& filename1, //throw FileError - const Zstring& filename2, - const std::function<void(Int64 bytesDelta)>& onUpdateStatus); //may be nullptr +bool filesHaveSameContent(const Zstring& filepath1, //throw FileError + const Zstring& filepath2, + const std::function<void(std::int64_t bytesDelta)>& onUpdateStatus); //may be nullptr } #endif // BINARY_H_INCLUDED diff --git a/FreeFileSync/Source/lib/cmp_filetime.h b/FreeFileSync/Source/lib/cmp_filetime.h index fab011ee..088537ac 100644 --- a/FreeFileSync/Source/lib/cmp_filetime.h +++ b/FreeFileSync/Source/lib/cmp_filetime.h @@ -2,59 +2,73 @@ #define CMP_FILETIME_H_INCLUDED #include <ctime> -#include <zen/int64.h> +#include <algorithm> namespace zen { //--------------------------------------------------------------------------------------------------------------- inline -bool sameFileTime(const Int64& lhs, const Int64& rhs, int tolerance) +bool sameFileTime(std::int64_t lhs, std::int64_t rhs, int tolerance, unsigned int optTimeShiftHours) { if (tolerance < 0) //= unlimited tolerance by convention! return true; if (lhs < rhs) - return rhs - lhs <= tolerance; - else - return lhs - rhs <= tolerance; + std::swap(lhs, rhs); + + if (lhs - rhs <= tolerance) + return true; + + if (optTimeShiftHours > 0) + { + const int shiftSec = static_cast<int>(optTimeShiftHours) * 3600; + if (rhs <= std::numeric_limits<std::int64_t>::max() - shiftSec) //protect against integer overflow! + { + const std::int64_t low = std::min(rhs + shiftSec, lhs); + const std::int64_t high = std::max(rhs + shiftSec, lhs); + + if (high - low <= tolerance) + return true; + } + } + + return false; } //--------------------------------------------------------------------------------------------------------------- //number of seconds since Jan 1st 1970 + 1 year (needn't be too precise) -static const Int64 oneYearFromNow = std::time(nullptr) + 365 * 24 * 3600; //init at program startup in *each* compilation untit -> avoid MT issues +const std::int64_t oneYearFromNow = std::time(nullptr) + 365 * 24 * 3600; //init at program startup in *each* compilation unit -> avoid MT issues //refactor when C++11 thread-safe static initialization is availalbe in VS (already in GCC) -class CmpFileTime +enum class TimeResult { -public: - enum Result - { - TIME_EQUAL, - TIME_LEFT_NEWER, - TIME_RIGHT_NEWER, - TIME_LEFT_INVALID, - TIME_RIGHT_INVALID - }; - - static Result getResult(const Int64& lhs, const Int64& rhs, int tolerance) - { - if (sameFileTime(lhs, rhs, tolerance)) //last write time may differ by up to 2 seconds (NTFS vs FAT32) - return TIME_EQUAL; + EQUAL, + LEFT_NEWER, + RIGHT_NEWER, + LEFT_INVALID, + RIGHT_INVALID +}; - //check for erroneous dates - if (lhs < 0 || lhs > oneYearFromNow) //earlier than Jan 1st 1970 or more than one year in future - return TIME_LEFT_INVALID; - if (rhs < 0 || rhs > oneYearFromNow) - return TIME_RIGHT_INVALID; +inline +TimeResult compareFileTime(std::int64_t lhs, std::int64_t rhs, int tolerance, unsigned int optTimeShiftHours) +{ + if (sameFileTime(lhs, rhs, tolerance, optTimeShiftHours)) //last write time may differ by up to 2 seconds (NTFS vs FAT32) + return TimeResult::EQUAL; - //regular time comparison - if (lhs < rhs) - return TIME_RIGHT_NEWER; - else - return TIME_LEFT_NEWER; - } -}; + //check for erroneous dates + if (lhs < 0 || lhs > oneYearFromNow) //earlier than Jan 1st 1970 or more than one year in future + return TimeResult::LEFT_INVALID; + + if (rhs < 0 || rhs > oneYearFromNow) + return TimeResult::RIGHT_INVALID; + + //regular time comparison + if (lhs < rhs) + return TimeResult::RIGHT_NEWER; + else + return TimeResult::LEFT_NEWER; +} } #endif // CMP_FILETIME_H_INCLUDED diff --git a/FreeFileSync/Source/lib/db_file.cpp b/FreeFileSync/Source/lib/db_file.cpp index 24798fcf..b1f0098e 100644 --- a/FreeFileSync/Source/lib/db_file.cpp +++ b/FreeFileSync/Source/lib/db_file.cpp @@ -36,7 +36,7 @@ typedef std::map<UniqueId, BinaryStream> DbStreams; //list of streams ordered by //----------------------------------------------------------------------------------- template <SelectedSide side> inline -Zstring getDBFilename(const BaseDirPair& baseDirObj, bool tempfile = false) +Zstring getDatabaseFilePath(const BaseDirPair& baseDirObj, bool tempfile = false) { //Linux and Windows builds are binary incompatible: different file id?, problem with case sensitivity? are UTC file times really compatible? //what about endianess!? @@ -54,7 +54,7 @@ Zstring getDBFilename(const BaseDirPair& baseDirObj, bool tempfile = false) //####################################################################################################################################### -void saveStreams(const DbStreams& streamList, const Zstring& filename) //throw FileError +void saveStreams(const DbStreams& streamList, const Zstring& filepath) //throw FileError { BinStreamOut streamOut; @@ -73,32 +73,32 @@ void saveStreams(const DbStreams& streamList, const Zstring& filename) //throw F writeContainer<BinaryStream>(streamOut, stream.second); } - assert(!somethingExists(filename)); //orphan tmp files should be cleaned up already at this point! - saveBinStream(filename, streamOut.get()); //throw FileError + assert(!somethingExists(filepath)); //orphan tmp files should be cleaned up already at this point! + saveBinStream(filepath, streamOut.get()); //throw FileError #ifdef ZEN_WIN //be careful to avoid CreateFile() + CREATE_ALWAYS on a hidden file -> see file_io.cpp - ::SetFileAttributes(applyLongPathPrefix(filename).c_str(), FILE_ATTRIBUTE_HIDDEN); //(try to) hide database file + ::SetFileAttributes(applyLongPathPrefix(filepath).c_str(), FILE_ATTRIBUTE_HIDDEN); //(try to) hide database file #endif } -DbStreams loadStreams(const Zstring& filename) //throw FileError, FileErrorDatabaseNotExisting +DbStreams loadStreams(const Zstring& filepath) //throw FileError, FileErrorDatabaseNotExisting { try { - BinStreamIn streamIn = loadBinStream<BinaryStream>(filename); //throw FileError + BinStreamIn streamIn = loadBinStream<BinaryStream>(filepath); //throw FileError //read FreeFileSync file identifier char formatDescr[sizeof(FILE_FORMAT_DESCR)] = {}; readArray(streamIn, formatDescr, sizeof(formatDescr)); //throw UnexpectedEndOfStreamError if (!std::equal(FILE_FORMAT_DESCR, FILE_FORMAT_DESCR + sizeof(FILE_FORMAT_DESCR), formatDescr)) - throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filename))); + throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filepath))); const int version = readNumber<std::int32_t>(streamIn); //throw UnexpectedEndOfStreamError if (version != DB_FORMAT_CONTAINER) //read file format version number - throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filename))); + throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filepath))); DbStreams output; @@ -116,18 +116,18 @@ DbStreams loadStreams(const Zstring& filename) //throw FileError, FileErrorDatab } catch (FileError&) { - if (!somethingExists(filename)) //a benign(?) race condition with FileError + if (!somethingExists(filepath)) //a benign(?) race condition with FileError throw FileErrorDatabaseNotExisting(_("Initial synchronization:") + L" \n" + - replaceCpy(_("Database file %x does not yet exist."), L"%x", fmtFileName(filename))); + replaceCpy(_("Database file %x does not yet exist."), L"%x", fmtFileName(filepath))); throw; } catch (UnexpectedEndOfStreamError&) { - throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filename)); + throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filepath)); } catch (const std::bad_alloc& e) //still required? { - throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filename), + throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filepath), _("Out of memory.") + L" " + utfCvrtTo<std::wstring>(e.what())); } } @@ -138,8 +138,8 @@ class StreamGenerator //for db-file back-wards compatibility we stick with two o { public: static void execute(const InSyncDir& dir, //throw FileError - const Zstring& filenameL, //used for diagnostics only - const Zstring& filenameR, + const Zstring& filepathL, //used for diagnostics only + const Zstring& filepathR, BinaryStream& streamL, BinaryStream& streamR) { @@ -149,7 +149,7 @@ public: generator.recurse(dir); //PERF_STOP - auto compStream = [](const BinaryStream& stream, const Zstring& filename) -> BinaryStream //throw FileError + auto compStream = [](const BinaryStream& stream, const Zstring& filepath) -> BinaryStream //throw FileError { try { @@ -169,13 +169,13 @@ public: } catch (ZlibInternalError&) { - throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(filename)), L"zlib internal error"); + throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(filepath)), L"zlib internal error"); } }; - const BinaryStream tmpL = compStream(generator.outputLeft .get(), filenameL); - const BinaryStream tmpR = compStream(generator.outputRight.get(), filenameR); - const BinaryStream tmpB = compStream(generator.outputBoth .get(), filenameL + Zstr("/") + filenameR); + const BinaryStream tmpL = compStream(generator.outputLeft .get(), filepathL); + const BinaryStream tmpR = compStream(generator.outputRight.get(), filepathR); + const BinaryStream tmpB = compStream(generator.outputBoth .get(), filepathL + Zstr("/") + filepathR); BinStreamOut outL; BinStreamOut outR; @@ -211,8 +211,8 @@ private: for (const auto& dbFile : container.files) { writeUtf8(outputBoth, dbFile.first); - writeNumber<std::int32_t>(outputBoth, dbFile.second.cmpVar); - writeNumber<std::uint64_t>(outputBoth, to<std::uint64_t>(dbFile.second.fileSize)); + writeNumber<std::int32_t >(outputBoth, dbFile.second.cmpVar); + writeNumber<std::uint64_t>(outputBoth, dbFile.second.fileSize); writeFile(outputLeft, dbFile.second.left); writeFile(outputRight, dbFile.second.right); @@ -242,7 +242,7 @@ private: static void writeFile(BinStreamOut& output, const InSyncDescrFile& descr) { - writeNumber<std:: int64_t>(output, to<std:: int64_t>(descr.lastWriteTimeRaw)); + writeNumber<std:: int64_t>(output, descr.lastWriteTimeRaw); writeNumber<std::uint64_t>(output, descr.fileId.first); writeNumber<std::uint64_t>(output, descr.fileId.second); assert_static(sizeof(descr.fileId.first ) <= sizeof(std::uint64_t)); @@ -251,7 +251,7 @@ private: static void writeLink(BinStreamOut& output, const InSyncDescrLink& descr) { - writeNumber<std::int64_t>(output, to<std:: int64_t>(descr.lastWriteTimeRaw)); + writeNumber<std::int64_t>(output, descr.lastWriteTimeRaw); } BinStreamOut outputLeft; //data related to one side only @@ -265,10 +265,10 @@ class StreamParser public: static std::shared_ptr<InSyncDir> execute(const BinaryStream& streamL, //throw FileError const BinaryStream& streamR, - const Zstring& filenameL, //used for diagnostics only - const Zstring& filenameR) + const Zstring& filepathL, //used for diagnostics only + const Zstring& filepathR) { - auto decompStream = [](const BinaryStream& stream, const Zstring& filename) -> BinaryStream //throw FileError + auto decompStream = [](const BinaryStream& stream, const Zstring& filepath) -> BinaryStream //throw FileError { try { @@ -276,7 +276,7 @@ public: } catch (ZlibInternalError&) { - throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(filename)), L"zlib internal error"); + throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(filepath)), L"zlib internal error"); } }; @@ -289,15 +289,15 @@ public: const int streamVersionR = readNumber<std::int32_t>(inR); // if (streamVersionL != DB_FORMAT_STREAM) - throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filenameL)), L"unknown stream format"); + throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filepathL)), L"unknown stream format"); if (streamVersionR != DB_FORMAT_STREAM) - throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filenameR)), L"unknown stream format"); + throw FileError(replaceCpy(_("Database file %x is incompatible."), L"%x", fmtFileName(filepathR)), L"unknown stream format"); const bool has1stPartL = readNumber<std::int8_t>(inL) != 0; //throw UnexpectedEndOfStreamError const bool has1stPartR = readNumber<std::int8_t>(inR) != 0; // if (has1stPartL == has1stPartR) - throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filenameL) + L"\n" + fmtFileName(filenameR), L"second part missing"); + throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filepathL) + L"\n" + fmtFileName(filepathR), L"second part missing"); BinStreamIn& in1stPart = has1stPartL ? inL : inR; BinStreamIn& in2ndPart = has1stPartL ? inR : inL; @@ -314,19 +314,19 @@ public: const BinaryStream tmpR = readContainer<BinaryStream>(inR); auto output = std::make_shared<InSyncDir>(InSyncDir::DIR_STATUS_IN_SYNC); - StreamParser parser(decompStream(tmpL, filenameL), - decompStream(tmpR, filenameR), - decompStream(tmpB, filenameL + Zstr("/") + filenameR)); + StreamParser parser(decompStream(tmpL, filepathL), + decompStream(tmpR, filepathR), + decompStream(tmpB, filepathL + Zstr("/") + filepathR)); parser.recurse(*output); //throw UnexpectedEndOfStreamError return output; } catch (const UnexpectedEndOfStreamError&) { - throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filenameL) + L"\n" + fmtFileName(filenameR)); + throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filepathL) + L"\n" + fmtFileName(filepathR)); } catch (const std::bad_alloc& e) { - throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filenameL) + L"\n" + fmtFileName(filenameR), + throw FileError(_("Database file is corrupt:") + L"\n" + fmtFileName(filepathL) + L"\n" + fmtFileName(filepathR), _("Out of memory.") + L" " + utfCvrtTo<std::wstring>(e.what())); } } @@ -346,7 +346,7 @@ private: { const Zstring shortName = readUtf8(inputBoth); const auto cmpVar = static_cast<CompareVariant>(readNumber<std::int32_t>(inputBoth)); - const UInt64 fileSize = readNumber<std::uint64_t>(inputBoth); + const std::uint64_t fileSize = readNumber<std::uint64_t>(inputBoth); const InSyncDescrFile dataL = readFile(inputLeft); const InSyncDescrFile dataR = readFile(inputRight); container.addFile(shortName, dataL, dataR, cmpVar, fileSize); @@ -419,9 +419,9 @@ private: void recurse(const HierarchyObject& hierObj, InSyncDir& dir) { - process(hierObj.refSubFiles(), hierObj.getObjRelativeNamePf(), dir.files); - process(hierObj.refSubLinks(), hierObj.getObjRelativeNamePf(), dir.symlinks); - process(hierObj.refSubDirs (), hierObj.getObjRelativeNamePf(), dir.dirs); + process(hierObj.refSubFiles(), hierObj.getPairRelativePathPf(), dir.files); + process(hierObj.refSubLinks(), hierObj.getPairRelativePathPf(), dir.symlinks); + process(hierObj.refSubDirs (), hierObj.getPairRelativePathPf(), dir.dirs); } template <class M, class V> @@ -475,12 +475,12 @@ private: { //Caveat: If FILE_EQUAL, we *implicitly* assume equal left and right short names matching case: InSyncDir's mapping tables use short name as a key! //This makes us silently dependent from code in algorithm.h!!! - assert(fileObj.getShortName<LEFT_SIDE>() == fileObj.getShortName<RIGHT_SIDE>()); + assert(fileObj.getItemName<LEFT_SIDE>() == fileObj.getItemName<RIGHT_SIDE>()); //this should be taken for granted: assert(fileObj.getFileSize<LEFT_SIDE>() == fileObj.getFileSize<RIGHT_SIDE>()); //create or update new "in-sync" state - InSyncFile& file = updateItem(dbFiles, fileObj.getObjShortName(), + InSyncFile& file = updateItem(dbFiles, fileObj.getPairShortName(), InSyncFile(InSyncDescrFile(fileObj.getLastWriteTime<LEFT_SIDE >(), fileObj.getFileId <LEFT_SIDE >()), InSyncDescrFile(fileObj.getLastWriteTime<RIGHT_SIDE>(), @@ -491,7 +491,7 @@ private: } else //not in sync: preserve last synchronous state { - auto it = dbFiles.find(fileObj.getObjShortName()); + auto it = dbFiles.find(fileObj.getPairShortName()); if (it != dbFiles.end()) toPreserve.insert(&it->second); } @@ -517,10 +517,10 @@ private: { if (linkObj.getLinkCategory() == SYMLINK_EQUAL) //data in sync: write current state { - assert(linkObj.getShortName<LEFT_SIDE>() == linkObj.getShortName<RIGHT_SIDE>()); + assert(linkObj.getItemName<LEFT_SIDE>() == linkObj.getItemName<RIGHT_SIDE>()); //create or update new "in-sync" state - InSyncSymlink& link = updateItem(dbLinks, linkObj.getObjShortName(), + InSyncSymlink& link = updateItem(dbLinks, linkObj.getPairShortName(), InSyncSymlink(InSyncDescrLink(linkObj.getLastWriteTime<LEFT_SIDE>()), InSyncDescrLink(linkObj.getLastWriteTime<RIGHT_SIDE>()), activeCmpVar_)); @@ -528,7 +528,7 @@ private: } else //not in sync: preserve last synchronous state { - auto it = dbLinks.find(linkObj.getObjShortName()); + auto it = dbLinks.find(linkObj.getPairShortName()); if (it != dbLinks.end()) toPreserve.insert(&it->second); } @@ -554,10 +554,10 @@ private: { case DIR_EQUAL: { - assert(dirObj.getShortName<LEFT_SIDE>() == dirObj.getShortName<RIGHT_SIDE>()); + assert(dirObj.getItemName<LEFT_SIDE>() == dirObj.getItemName<RIGHT_SIDE>()); //update directory entry only (shallow), but do *not touch* exising child elements!!! - const Zstring& key = dirObj.getObjShortName(); + const Zstring& key = dirObj.getPairShortName(); auto insertResult = dbDirs.insert(std::make_pair(key, InSyncDir(InSyncDir::DIR_STATUS_IN_SYNC))); //get or create auto it = insertResult.first; @@ -578,12 +578,12 @@ private: break; case DIR_DIFFERENT_METADATA: - //if DIR_DIFFERENT_METADATA and no old database entry yet: we have to insert a new (bogus) database entry: + //if DIR_DIFFERENT_METADATA and no old database entry yet: we have to insert a placeholder database entry: //we cannot simply skip the whole directory, since sub-items might be in sync! //Example: directories on left and right differ in case while sub-files are equal { - //reuse last "in-sync" if available or insert strawman entry (do not try to update thereby removing child elements!!!) - InSyncDir& dir = dbDirs.insert(std::make_pair(dirObj.getObjShortName(), InSyncDir(InSyncDir::DIR_STATUS_STRAW_MAN))).first->second; + //reuse last "in-sync" if available or insert strawman entry (do not try to update and thereby remove child elements!!!) + InSyncDir& dir = dbDirs.insert(std::make_pair(dirObj.getPairShortName(), InSyncDir(InSyncDir::DIR_STATUS_STRAW_MAN))).first->second; toPreserve.insert(&dir); recurse(dirObj, dir); } @@ -593,7 +593,7 @@ private: case DIR_LEFT_SIDE_ONLY: case DIR_RIGHT_SIDE_ONLY: { - auto it = dbDirs.find(dirObj.getObjShortName()); + auto it = dbDirs.find(dirObj.getPairShortName()); if (it != dbDirs.end()) { toPreserve.insert(&it->second); @@ -626,22 +626,22 @@ private: std::shared_ptr<InSyncDir> zen::loadLastSynchronousState(const BaseDirPair& baseDirObj) //throw FileError, FileErrorDatabaseNotExisting -> return value always bound! { - const Zstring fileNameLeft = getDBFilename<LEFT_SIDE >(baseDirObj); - const Zstring fileNameRight = getDBFilename<RIGHT_SIDE>(baseDirObj); + const Zstring filepathLeft = getDatabaseFilePath<LEFT_SIDE >(baseDirObj); + const Zstring filepathRight = getDatabaseFilePath<RIGHT_SIDE>(baseDirObj); if (!baseDirObj.isExisting<LEFT_SIDE >() || !baseDirObj.isExisting<RIGHT_SIDE>()) { //avoid race condition with directory existence check: reading sync.ffs_db may succeed although first dir check had failed => conflicts! //https://sourceforge.net/tracker/?func=detail&atid=1093080&aid=3531351&group_id=234430 - const Zstring filename = !baseDirObj.isExisting<LEFT_SIDE>() ? fileNameLeft : fileNameRight; + const Zstring filepath = !baseDirObj.isExisting<LEFT_SIDE>() ? filepathLeft : filepathRight; throw FileErrorDatabaseNotExisting(_("Initial synchronization:") + L" \n" + //it could be due to a to-be-created target directory not yet existing => FileErrorDatabaseNotExisting - replaceCpy(_("Database file %x does not yet exist."), L"%x", fmtFileName(filename))); + replaceCpy(_("Database file %x does not yet exist."), L"%x", fmtFileName(filepath))); } //read file data: list of session ID + DirInfo-stream - const DbStreams streamsLeft = ::loadStreams(fileNameLeft); //throw FileError, FileErrorDatabaseNotExisting - const DbStreams streamsRight = ::loadStreams(fileNameRight); // + const DbStreams streamsLeft = ::loadStreams(filepathLeft); //throw FileError, FileErrorDatabaseNotExisting + const DbStreams streamsRight = ::loadStreams(filepathRight); // //find associated session: there can be at most one session within intersection of left and right ids for (const auto& streamLeft : streamsLeft) @@ -651,8 +651,8 @@ std::shared_ptr<InSyncDir> zen::loadLastSynchronousState(const BaseDirPair& base { return StreamParser::execute(streamLeft.second, //throw FileError itRight->second, - fileNameLeft, - fileNameRight); + filepathLeft, + filepathRight); } } throw FileErrorDatabaseNotExisting(_("Initial synchronization:") + L" \n" + @@ -663,11 +663,11 @@ std::shared_ptr<InSyncDir> zen::loadLastSynchronousState(const BaseDirPair& base void zen::saveLastSynchronousState(const BaseDirPair& baseDirObj) //throw FileError { //transactional behaviour! write to tmp files first - const Zstring dbNameLeftTmp = getDBFilename<LEFT_SIDE >(baseDirObj, true); - const Zstring dbNameRightTmp = getDBFilename<RIGHT_SIDE>(baseDirObj, true); + const Zstring dbNameLeftTmp = getDatabaseFilePath<LEFT_SIDE >(baseDirObj, true); + const Zstring dbNameRightTmp = getDatabaseFilePath<RIGHT_SIDE>(baseDirObj, true); - const Zstring dbNameLeft = getDBFilename<LEFT_SIDE >(baseDirObj); - const Zstring dbNameRight = getDBFilename<RIGHT_SIDE>(baseDirObj); + const Zstring dbNameLeft = getDatabaseFilePath<LEFT_SIDE >(baseDirObj); + const Zstring dbNameRight = getDatabaseFilePath<RIGHT_SIDE>(baseDirObj); //delete old tmp file, if necessary -> throws if deletion fails! removeFile(dbNameLeftTmp); // diff --git a/FreeFileSync/Source/lib/db_file.h b/FreeFileSync/Source/lib/db_file.h index 4b499ea5..ffaa0e62 100644 --- a/FreeFileSync/Source/lib/db_file.h +++ b/FreeFileSync/Source/lib/db_file.h @@ -16,30 +16,30 @@ const Zchar SYNC_DB_FILE_ENDING[] = Zstr(".ffs_db"); //don't use Zstring as glob struct InSyncDescrFile //subset of FileDescriptor { - InSyncDescrFile(const Int64& lastWriteTimeRawIn, - const FileId& idIn) : + InSyncDescrFile(std::int64_t lastWriteTimeRawIn, const FileId& idIn) : lastWriteTimeRaw(lastWriteTimeRawIn), fileId(idIn) {} - Int64 lastWriteTimeRaw; + std::int64_t lastWriteTimeRaw; FileId fileId; // == file id: optional! (however, always set on Linux, and *generally* available on Windows) }; struct InSyncDescrLink { - explicit InSyncDescrLink(const Int64& lastWriteTimeRawIn) : lastWriteTimeRaw(lastWriteTimeRawIn) {} - Int64 lastWriteTimeRaw; + explicit InSyncDescrLink(std::int64_t lastWriteTimeRawIn) : lastWriteTimeRaw(lastWriteTimeRawIn) {} + + std::int64_t lastWriteTimeRaw; }; //artificial hierarchy of last synchronous state: struct InSyncFile { - InSyncFile(const InSyncDescrFile& l, const InSyncDescrFile& r, CompareVariant cv, const UInt64& fileSizeIn) : left(l), right(r), cmpVar(cv), fileSize(fileSizeIn) {} + InSyncFile(const InSyncDescrFile& l, const InSyncDescrFile& r, CompareVariant cv, std::uint64_t fileSizeIn) : left(l), right(r), cmpVar(cv), fileSize(fileSizeIn) {} InSyncDescrFile left; InSyncDescrFile right; CompareVariant cmpVar; //the one active while finding "file in sync" - UInt64 fileSize; //file size must be identical on both sides! + std::uint64_t fileSize; //file size must be identical on both sides! }; struct InSyncSymlink @@ -80,7 +80,7 @@ struct InSyncDir return dirs.insert(std::make_pair(shortName, InSyncDir(st))).first->second; } - void addFile(const Zstring& shortName, const InSyncDescrFile& dataL, const InSyncDescrFile& dataR, CompareVariant cmpVar, const UInt64& fileSize) + void addFile(const Zstring& shortName, const InSyncDescrFile& dataL, const InSyncDescrFile& dataR, CompareVariant cmpVar, std::uint64_t fileSize) { files.insert(std::make_pair(shortName, InSyncFile(dataL, dataR, cmpVar, fileSize))); } diff --git a/FreeFileSync/Source/lib/dir_exist_async.h b/FreeFileSync/Source/lib/dir_exist_async.h index 4c8efe22..4d73f699 100644 --- a/FreeFileSync/Source/lib/dir_exist_async.h +++ b/FreeFileSync/Source/lib/dir_exist_async.h @@ -28,7 +28,7 @@ struct DirectoryStatus }; -DirectoryStatus getExistingDirsUpdating(const std::set<Zstring, LessFilename>& dirnames, +DirectoryStatus getExistingDirsUpdating(const std::set<Zstring, LessFilename>& dirpaths, bool allowUserInteraction, ProcessCallback& procCallback) { @@ -37,16 +37,16 @@ DirectoryStatus getExistingDirsUpdating(const std::set<Zstring, LessFilename>& d DirectoryStatus output; std::list<std::pair<Zstring, boost::unique_future<bool>>> futureInfo; - for (const Zstring& dirname : dirnames) - if (!dirname.empty()) //skip empty dirs - futureInfo.push_back(std::make_pair(dirname, async2<bool>([=]() -> bool + for (const Zstring& dirpath : dirpaths) + if (!dirpath.empty()) //skip empty dirs + futureInfo.push_back(std::make_pair(dirpath, async2<bool>([=]() -> bool { #ifdef ZEN_WIN //1. login to network share, if necessary - loginNetworkShare(dirname, allowUserInteraction); + loginNetworkShare(dirpath, allowUserInteraction); #endif //2. check dir existence - return dirExists(dirname); + return dirExists(dirpath); }))); //don't wait (almost) endlessly like win32 would on not existing network shares: @@ -70,12 +70,12 @@ DirectoryStatus getExistingDirsUpdating(const std::set<Zstring, LessFilename>& d } inline //also silences Clang "unused function" for compilation units depending from getExistingDirsUpdating() only -bool dirExistsUpdating(const Zstring& dirname, bool allowUserInteraction, ProcessCallback& procCallback) +bool dirExistsUpdating(const Zstring& dirpath, bool allowUserInteraction, ProcessCallback& procCallback) { - if (dirname.empty()) return false; - const DirectoryStatus dirStatus = getExistingDirsUpdating({ dirname }, allowUserInteraction, procCallback); + if (dirpath.empty()) return false; + const DirectoryStatus dirStatus = getExistingDirsUpdating({ dirpath }, allowUserInteraction, procCallback); assert(dirStatus.existing.empty() != dirStatus.missing.empty()); - return dirStatus.existing.find(dirname) != dirStatus.existing.end(); + return dirStatus.existing.find(dirpath) != dirStatus.existing.end(); } } diff --git a/FreeFileSync/Source/lib/dir_lock.cpp b/FreeFileSync/Source/lib/dir_lock.cpp index c11c2136..87e5d070 100644 --- a/FreeFileSync/Source/lib/dir_lock.cpp +++ b/FreeFileSync/Source/lib/dir_lock.cpp @@ -51,8 +51,8 @@ const int LOCK_FORMAT_VER = 2; //lock file format version class LifeSigns { public: - LifeSigns(const Zstring& lockfilename) : //throw()!!! siehe SharedDirLock() - lockfilename_(lockfilename) {} //thread safety: make deep copy! + LifeSigns(const Zstring& lockfilepath) : //throw()!!! siehe SharedDirLock() + lockfilepath_(lockfilepath) {} //thread safety: make deep copy! void operator()() const //thread entry { @@ -79,7 +79,7 @@ public: //ATTENTION: setting file pointer IS required! => use CreateFile/GENERIC_WRITE + SetFilePointerEx! //although CreateFile/FILE_APPEND_DATA without SetFilePointerEx works locally, it MAY NOT work on some network shares creating a 4 gig file!!! - const HANDLE fileHandle = ::CreateFile(applyLongPathPrefix(lockfilename_).c_str(), //_In_ LPCTSTR lpFileName, + const HANDLE fileHandle = ::CreateFile(applyLongPathPrefix(lockfilepath_).c_str(), //_In_ LPCTSTR lpFileName, //use both when writing over network, see comment in file_io.cpp GENERIC_READ | GENERIC_WRITE, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ, //_In_ DWORD dwShareMode, @@ -107,7 +107,7 @@ public: return; #elif defined ZEN_LINUX || defined ZEN_MAC - const int fileHandle = ::open(lockfilename_.c_str(), O_WRONLY | O_APPEND); + const int fileHandle = ::open(lockfilepath_.c_str(), O_WRONLY | O_APPEND); if (fileHandle == -1) return; ZEN_ON_SCOPE_EXIT(::close(fileHandle)); @@ -118,40 +118,40 @@ public: } private: - const Zstring lockfilename_; //thread local! atomic ref-count => binary value-type semantics! + const Zstring lockfilepath_; //thread local! atomic ref-count => binary value-type semantics! }; namespace { -UInt64 getLockFileSize(const Zstring& filename) //throw FileError +std::uint64_t getLockFileSize(const Zstring& filepath) //throw FileError { #ifdef ZEN_WIN WIN32_FIND_DATA fileInfo = {}; - const HANDLE searchHandle = ::FindFirstFile(applyLongPathPrefix(filename).c_str(), &fileInfo); + const HANDLE searchHandle = ::FindFirstFile(applyLongPathPrefix(filepath).c_str(), &fileInfo); if (searchHandle == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"FindFirstFile", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"FindFirstFile", getLastError()); ::FindClose(searchHandle); - return UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); + return get64BitUInt(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat fileInfo = {}; - if (::stat(filename.c_str(), &fileInfo) != 0) //follow symbolic links - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"stat", getLastError()); + if (::stat(filepath.c_str(), &fileInfo) != 0) //follow symbolic links + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"stat", getLastError()); - return UInt64(fileInfo.st_size); + return fileInfo.st_size; #endif } -Zstring deleteAbandonedLockName(const Zstring& lockfilename) //make sure to NOT change file ending! +Zstring deleteAbandonedLockName(const Zstring& lockfilepath) //make sure to NOT change file ending! { - const size_t pos = lockfilename.rfind(FILE_NAME_SEPARATOR); //search from end - return pos == Zstring::npos ? Zstr("Del.") + lockfilename : - Zstring(lockfilename.c_str(), pos + 1) + //include path separator + const size_t pos = lockfilepath.rfind(FILE_NAME_SEPARATOR); //search from end + return pos == Zstring::npos ? Zstr("Del.") + lockfilepath : + Zstring(lockfilepath.c_str(), pos + 1) + //include path separator Zstr("Del.") + - afterLast(lockfilename, FILE_NAME_SEPARATOR); //returns the whole string if ch not found + afterLast(lockfilepath, FILE_NAME_SEPARATOR); //returns the whole string if ch not found } @@ -354,24 +354,24 @@ struct LockInformation //throw FileError //wxGetFullHostName() is a performance killer for some users, so don't touch! -LockInformation retrieveLockInfo(const Zstring& lockfilename) //throw FileError +LockInformation retrieveLockInfo(const Zstring& lockfilepath) //throw FileError { - BinStreamIn streamIn = loadBinStream<BinaryStream>(lockfilename); //throw FileError + BinStreamIn streamIn = loadBinStream<BinaryStream>(lockfilepath); //throw FileError try { return LockInformation(streamIn); //throw UnexpectedEndOfStreamError } catch (UnexpectedEndOfStreamError&) { - throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(lockfilename)), L"unexpected end of stream"); + throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(lockfilepath)), L"unexpected end of stream"); } } inline -std::string retrieveLockId(const Zstring& lockfilename) //throw FileError +std::string retrieveLockId(const Zstring& lockfilepath) //throw FileError { - return retrieveLockInfo(lockfilename).lockId; //throw FileError + return retrieveLockInfo(lockfilepath).lockId; //throw FileError } @@ -404,9 +404,9 @@ ProcessStatus getProcessStatus(const LockInformation& lockInfo) //throw FileErro const std::int64_t TICKS_PER_SEC = ticksPerSec(); //= 0 on error -void waitOnDirLock(const Zstring& lockfilename, DirLockCallback* callback) //throw FileError +void waitOnDirLock(const Zstring& lockfilepath, DirLockCallback* callback) //throw FileError { - std::wstring infoMsg = _("Waiting while directory is locked:") + L' ' + fmtFileName(lockfilename); + std::wstring infoMsg = _("Waiting while directory is locked:") + L' ' + fmtFileName(lockfilepath); if (callback) callback->reportStatus(infoMsg); @@ -418,7 +418,7 @@ void waitOnDirLock(const Zstring& lockfilename, DirLockCallback* callback) //thr std::string originalLockId; //empty if it cannot be retrieved try { - const LockInformation& lockInfo = retrieveLockInfo(lockfilename); //throw FileError + const LockInformation& lockInfo = retrieveLockInfo(lockfilepath); //throw FileError //enhance status message and show which user is holding the lock: infoMsg += L" | " + _("Lock owner:") + L' ' + utfCvrtTo<std::wstring>(lockInfo.userId); @@ -436,13 +436,13 @@ void waitOnDirLock(const Zstring& lockfilename, DirLockCallback* callback) //thr } catch (FileError&) {} //logfile may be only partly written -> this is no error! - UInt64 fileSizeOld; + std::uint64_t fileSizeOld = 0; TickVal lastLifeSign = getTicks(); while (true) { const TickVal now = getTicks(); - const UInt64 fileSizeNew = ::getLockFileSize(lockfilename); //throw FileError + const std::uint64_t fileSizeNew = ::getLockFileSize(lockfilepath); //throw FileError if (TICKS_PER_SEC <= 0 || !lastLifeSign.isValid() || !now.isValid()) throw FileError(L"System timer failed."); //no i18n: "should" never throw ;) @@ -456,18 +456,18 @@ void waitOnDirLock(const Zstring& lockfilename, DirLockCallback* callback) //thr if (lockOwnderDead || //no need to wait any longer... dist(lastLifeSign, now) / TICKS_PER_SEC > DETECT_ABANDONED_INTERVAL) { - DirLock dummy(deleteAbandonedLockName(lockfilename), callback); //throw FileError + DirLock dummy(deleteAbandonedLockName(lockfilepath), callback); //throw FileError //now that the lock is in place check existence again: meanwhile another process may have deleted and created a new lock! if (!originalLockId.empty()) - if (retrieveLockId(lockfilename) != originalLockId) //throw FileError -> since originalLockId is filled, we are not expecting errors! + if (retrieveLockId(lockfilepath) != originalLockId) //throw FileError -> since originalLockId is filled, we are not expecting errors! return; //another process has placed a new lock, leave scope: the wait for the old lock is technically over... - if (::getLockFileSize(lockfilename) != fileSizeOld) //throw FileError + if (::getLockFileSize(lockfilepath) != fileSizeOld) //throw FileError continue; //late life sign - removeFile(lockfilename); //throw FileError + removeFile(lockfilepath); //throw FileError return; } @@ -495,27 +495,27 @@ void waitOnDirLock(const Zstring& lockfilename, DirLockCallback* callback) //thr } catch (FileError&) { - if (!somethingExists(lockfilename)) //a benign(?) race condition with FileError + if (!somethingExists(lockfilepath)) //a benign(?) race condition with FileError return; //what we are waiting for... throw; } } -void releaseLock(const Zstring& lockfilename) //throw () +void releaseLock(const Zstring& lockfilepath) //throw () { try { - removeFile(lockfilename); //throw FileError + removeFile(lockfilepath); //throw FileError } catch (FileError&) {} } -bool tryLock(const Zstring& lockfilename) //throw FileError +bool tryLock(const Zstring& lockfilepath) //throw FileError { #ifdef ZEN_WIN - const HANDLE fileHandle = ::CreateFile(applyLongPathPrefix(lockfilename).c_str(), //_In_ LPCTSTR lpFileName, + const HANDLE fileHandle = ::CreateFile(applyLongPathPrefix(lockfilepath).c_str(), //_In_ LPCTSTR lpFileName, //use both when writing over network, see comment in file_io.cpp GENERIC_READ | GENERIC_WRITE, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, @@ -530,27 +530,27 @@ bool tryLock(const Zstring& lockfilename) //throw FileError lastError == ERROR_ALREADY_EXISTS) //comment on msdn claims, this one is used on Windows Mobile 6 return false; else - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(lockfilename)), L"CreateFile", lastError); + throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(lockfilepath)), L"CreateFile", lastError); } - ScopeGuard guardLockFile = zen::makeGuard([&] { removeFile(lockfilename); }); - FileOutput fileOut(fileHandle, lockfilename); //pass handle ownership + ScopeGuard guardLockFile = zen::makeGuard([&] { removeFile(lockfilepath); }); + FileOutput fileOut(fileHandle, lockfilepath); //pass handle ownership //be careful to avoid CreateFile() + CREATE_ALWAYS on a hidden file -> see file_io.cpp - //=> we don't need it that badly //::SetFileAttributes(applyLongPathPrefix(lockfilename).c_str(), FILE_ATTRIBUTE_HIDDEN); //(try to) hide it + //=> we don't need it that badly //::SetFileAttributes(applyLongPathPrefix(lockfilepath).c_str(), FILE_ATTRIBUTE_HIDDEN); //(try to) hide it #elif defined ZEN_LINUX || defined ZEN_MAC ::umask(0); //important! -> why? //O_EXCL contains a race condition on NFS file systems: http://linux.die.net/man/2/open - const int fileHandle = ::open(lockfilename.c_str(), O_CREAT | O_WRONLY | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); + const int fileHandle = ::open(lockfilepath.c_str(), O_CREAT | O_WRONLY | O_EXCL, S_IRWXU | S_IRWXG | S_IRWXO); if (fileHandle == -1) { if (errno == EEXIST) return false; else - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(lockfilename)), L"open", getLastError()); + throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(lockfilepath)), L"open", getLastError()); } - ScopeGuard guardLockFile = zen::makeGuard([&] { removeFile(lockfilename); }); - FileOutputUnbuffered fileOut(fileHandle, lockfilename); //pass handle ownership + ScopeGuard guardLockFile = zen::makeGuard([&] { removeFile(lockfilepath); }); + FileOutputUnbuffered fileOut(fileHandle, lockfilepath); //pass handle ownership #endif //write housekeeping info: user, process info, lock GUID @@ -572,13 +572,13 @@ bool tryLock(const Zstring& lockfilename) //throw FileError class DirLock::SharedDirLock { public: - SharedDirLock(const Zstring& lockfilename, DirLockCallback* callback) : //throw FileError - lockfilename_(lockfilename) + SharedDirLock(const Zstring& lockfilepath, DirLockCallback* callback) : //throw FileError + lockfilepath_(lockfilepath) { - while (!::tryLock(lockfilename)) //throw FileError - ::waitOnDirLock(lockfilename, callback); // + while (!::tryLock(lockfilepath)) //throw FileError + ::waitOnDirLock(lockfilepath, callback); // - threadObj = boost::thread(LifeSigns(lockfilename)); + threadObj = boost::thread(LifeSigns(lockfilepath)); } ~SharedDirLock() @@ -586,14 +586,14 @@ public: threadObj.interrupt(); //thread lifetime is subset of this instances's life threadObj.join(); //we assert precondition "threadObj.joinable()"!!! - ::releaseLock(lockfilename_); //throw () + ::releaseLock(lockfilepath_); //throw () } private: - SharedDirLock(const DirLock&); - SharedDirLock& operator=(const DirLock&); + SharedDirLock (const DirLock&) = delete; + SharedDirLock& operator=(const DirLock&) = delete; - const Zstring lockfilename_; + const Zstring lockfilepath_; boost::thread threadObj; }; @@ -608,33 +608,33 @@ public: } //create or retrieve a SharedDirLock - std::shared_ptr<SharedDirLock> retrieve(const Zstring& lockfilename, DirLockCallback* callback) //throw FileError + std::shared_ptr<SharedDirLock> retrieve(const Zstring& lockfilepath, DirLockCallback* callback) //throw FileError { tidyUp(); //optimization: check if we already own a lock for this path - auto iterGuid = fileToGuid.find(lockfilename); + auto iterGuid = fileToGuid.find(lockfilepath); if (iterGuid != fileToGuid.end()) if (const std::shared_ptr<SharedDirLock>& activeLock = getActiveLock(iterGuid->second)) //returns null-lock if not found return activeLock; //SharedDirLock is still active -> enlarge circle of shared ownership - try //check based on lock GUID, deadlock prevention: "lockfilename" may be an alternative name for a lock already owned by this process + try //check based on lock GUID, deadlock prevention: "lockfilepath" may be an alternative name for a lock already owned by this process { - const std::string lockId = retrieveLockId(lockfilename); //throw FileError + const std::string lockId = retrieveLockId(lockfilepath); //throw FileError if (const std::shared_ptr<SharedDirLock>& activeLock = getActiveLock(lockId)) //returns null-lock if not found { - fileToGuid[lockfilename] = lockId; //found an alias for one of our active locks + fileToGuid[lockfilepath] = lockId; //found an alias for one of our active locks return activeLock; } } catch (FileError&) {} //catch everything, let SharedDirLock constructor deal with errors, e.g. 0-sized/corrupted lock files //lock not owned by us => create a new one - auto newLock = std::make_shared<SharedDirLock>(lockfilename, callback); //throw FileError - const std::string& newLockGuid = retrieveLockId(lockfilename); //throw FileError + auto newLock = std::make_shared<SharedDirLock>(lockfilepath, callback); //throw FileError + const std::string& newLockGuid = retrieveLockId(lockfilepath); //throw FileError //update registry - fileToGuid[lockfilename] = newLockGuid; //throw() + fileToGuid[lockfilepath] = newLockGuid; //throw() guidToLock[newLockGuid] = newLock; // return newLock; @@ -642,8 +642,8 @@ public: private: LockAdmin() {} - LockAdmin(const LockAdmin&); //=delete - LockAdmin& operator=(const LockAdmin&); //=delete + LockAdmin (const LockAdmin&) = delete; + LockAdmin& operator=(const LockAdmin&) = delete; typedef std::string UniqueId; typedef std::map<Zstring, UniqueId, LessFilename> FileToGuidMap; //n:1 handle uppper/lower case correctly @@ -661,20 +661,20 @@ private: map_remove_if(fileToGuid, [&](const FileToGuidMap::value_type& v) { return guidToLock.find(v.second) == guidToLock.end(); }); } - FileToGuidMap fileToGuid; //lockname |-> GUID; locks can be referenced by a lockfilename or alternatively a GUID + FileToGuidMap fileToGuid; //lockname |-> GUID; locks can be referenced by a lockfilepath or alternatively a GUID GuidToLockMap guidToLock; //GUID |-> "shared lock ownership" }; -DirLock::DirLock(const Zstring& lockfilename, DirLockCallback* callback) //throw FileError +DirLock::DirLock(const Zstring& lockfilepath, DirLockCallback* callback) //throw FileError { if (callback) - callback->reportStatus(replaceCpy(_("Creating file %x"), L"%x", fmtFileName(lockfilename))); + callback->reportStatus(replaceCpy(_("Creating file %x"), L"%x", fmtFileName(lockfilepath))); #ifdef ZEN_WIN const DWORD bufferSize = 10000; std::vector<wchar_t> volName(bufferSize); - if (::GetVolumePathName(lockfilename.c_str(), //__in LPCTSTR lpszFileName, + if (::GetVolumePathName(lockfilepath.c_str(), //__in LPCTSTR lpszFileName, &volName[0], //__out LPTSTR lpszVolumePathName, bufferSize)) //__in DWORD cchBufferLength { @@ -684,5 +684,5 @@ DirLock::DirLock(const Zstring& lockfilename, DirLockCallback* callback) //throw } #endif - sharedLock = LockAdmin::instance().retrieve(lockfilename, callback); //throw FileError + sharedLock = LockAdmin::instance().retrieve(lockfilepath, callback); //throw FileError } diff --git a/FreeFileSync/Source/lib/dir_lock.h b/FreeFileSync/Source/lib/dir_lock.h index ec2a431a..2eacc6af 100644 --- a/FreeFileSync/Source/lib/dir_lock.h +++ b/FreeFileSync/Source/lib/dir_lock.h @@ -26,14 +26,14 @@ RAII structure to place a directory lock against other FFS processes: - ownership shared between all object instances refering to a specific lock location(= GUID) - can be copied safely and efficiently! (ref-counting) - detects and resolves abandoned locks (instantly if lock is associated with local pc, else after 30 seconds) - - temporary locks created during abandoned lock resolution keep "lockfilename"'s extension + - temporary locks created during abandoned lock resolution keep "lockfilepath"'s extension - race-free (Windows, almost on Linux(NFS)) - NOT thread-safe! (1. static LockAdmin 2. directory name aliases must be resolved sequentially!) */ class DirLock { public: - DirLock(const Zstring& lockfilename, DirLockCallback* callback = nullptr); //throw FileError, callback only used during construction + DirLock(const Zstring& lockfilepath, DirLockCallback* callback = nullptr); //throw FileError, callback only used during construction private: class LockAdmin; diff --git a/FreeFileSync/Source/lib/ffs_paths.cpp b/FreeFileSync/Source/lib/ffs_paths.cpp index 5c775d3e..d5ef3e48 100644 --- a/FreeFileSync/Source/lib/ffs_paths.cpp +++ b/FreeFileSync/Source/lib/ffs_paths.cpp @@ -14,7 +14,7 @@ #include <vector> #include <zen/scope_guard.h> #include <zen/osx_string.h> -//keep in .cpp file to not pollute global namespace! e.g. with UInt64: +//keep in .cpp file to not pollute global namespace! #include <ApplicationServices/ApplicationServices.h> //LSFindApplicationForInfo #endif diff --git a/FreeFileSync/Source/lib/generate_logfile.h b/FreeFileSync/Source/lib/generate_logfile.h index 95392e74..41f6c945 100644 --- a/FreeFileSync/Source/lib/generate_logfile.h +++ b/FreeFileSync/Source/lib/generate_logfile.h @@ -21,9 +21,9 @@ struct SummaryInfo std::wstring jobName; //may be empty std::wstring finalStatus; int itemsSynced; - Int64 dataSynced; + std::int64_t dataSynced; int itemsTotal; - Int64 dataTotal; + std::int64_t dataTotal; int64_t totalTime; //unit: [sec] }; @@ -121,7 +121,7 @@ void saveToLastSyncsLog(const SummaryInfo& summary, //throw FileError const ErrorLog& log, size_t maxBytesToWrite) //log may be *huge*, e.g. 1 million items; LastSyncs.log *must not* create performance problems! { - const Zstring filename = getConfigDir() + Zstr("LastSyncs.log"); + const Zstring filepath = getConfigDir() + Zstr("LastSyncs.log"); Utf8String newStream = utfCvrtTo<Utf8String>(generateLogHeader(summary)); replace(newStream, '\n', LINE_BREAK); //don't replace line break any earlier @@ -147,7 +147,7 @@ void saveToLastSyncsLog(const SummaryInfo& summary, //throw FileError Utf8String oldStream; try { - oldStream = loadBinStream<Utf8String>(filename); //throw FileError + oldStream = loadBinStream<Utf8String>(filepath); //throw FileError } catch (FileError&) {} @@ -174,7 +174,7 @@ void saveToLastSyncsLog(const SummaryInfo& summary, //throw FileError } } - saveBinStream(filename, newStream); //throw FileError + saveBinStream(filepath, newStream); //throw FileError } } diff --git a/FreeFileSync/Source/lib/hard_filter.cpp b/FreeFileSync/Source/lib/hard_filter.cpp index c3ccb42e..28ba1b40 100644 --- a/FreeFileSync/Source/lib/hard_filter.cpp +++ b/FreeFileSync/Source/lib/hard_filter.cpp @@ -10,7 +10,6 @@ #include <vector> #include <typeinfo> #include <iterator> -//#include "../structures.h" using namespace zen; diff --git a/FreeFileSync/Source/lib/hard_filter.h b/FreeFileSync/Source/lib/hard_filter.h index e721fe4f..e747c626 100644 --- a/FreeFileSync/Source/lib/hard_filter.h +++ b/FreeFileSync/Source/lib/hard_filter.h @@ -10,7 +10,6 @@ #include <vector> #include <memory> #include <zen/zstring.h> -//#include <wx+/serialize.h> namespace zen { @@ -81,7 +80,7 @@ private: }; -class NameFilter : public HardFilter //standard filter by filename +class NameFilter : public HardFilter //standard filter by filepath { public: NameFilter(const Zstring& includeFilter, const Zstring& excludeFilter); diff --git a/FreeFileSync/Source/lib/icon_buffer.cpp b/FreeFileSync/Source/lib/icon_buffer.cpp index e93e23ca..2da7d83d 100644 --- a/FreeFileSync/Source/lib/icon_buffer.cpp +++ b/FreeFileSync/Source/lib/icon_buffer.cpp @@ -133,12 +133,12 @@ public: #if defined ZEN_WIN || defined ZEN_LINUX -Zstring getFileExtension(const Zstring& filename) +Zstring getFileExtension(const Zstring& filepath) { - const Zstring shortName = afterLast(filename, Zchar('\\')); //warning: using windows file name separator! + const Zstring shortName = afterLast(filepath, Zchar('\\')); //warning: using windows file name separator! return contains(shortName, Zchar('.')) ? - afterLast(filename, Zchar('.')) : + afterLast(filepath, Zchar('.')) : Zstring(); } #endif @@ -233,13 +233,13 @@ bool isStandardIconExtension(const Zstring& extension) #endif } -bool zen::hasLinkExtension(const Zstring& filename) +bool zen::hasLinkExtension(const Zstring& filepath) { #ifdef ZEN_WIN - const Zstring& extension = getFileExtension(filename); + const Zstring& extension = getFileExtension(filepath); return linkExt.find(extension) != linkExt.end(); #elif defined ZEN_LINUX - const Zstring& extension = getFileExtension(filename); + const Zstring& extension = getFileExtension(filepath); return extension == "desktop"; #elif defined ZEN_MAC return false; //alias files already get their arrow icon via "NSWorkspace::iconForFile" @@ -248,16 +248,16 @@ bool zen::hasLinkExtension(const Zstring& filename) //################################################################################################################################################ -IconHolder getThumbnailImage(const Zstring& filename, int requestedSize) //return 0 on failure +IconHolder getThumbnailImage(const Zstring& filepath, int requestedSize) //return 0 on failure { #ifdef ZEN_WIN if (getThumbnail && releaseImageData) - return IconHolder(getThumbnail(filename.c_str(), requestedSize)); + return IconHolder(getThumbnail(filepath.c_str(), requestedSize)); #elif defined ZEN_LINUX gint width = 0; gint height = 0; - if (GdkPixbufFormat* fmt = ::gdk_pixbuf_get_file_info(filename.c_str(), &width, &height)) + if (GdkPixbufFormat* fmt = ::gdk_pixbuf_get_file_info(filepath.c_str(), &width, &height)) { (void)fmt; if (width > 0 && height > 0 && requestedSize > 0) @@ -271,7 +271,7 @@ IconHolder getThumbnailImage(const Zstring& filename, int requestedSize) //retur trgWidth = width * requestedSize / maxExtent; trgHeight = height * requestedSize / maxExtent; } - if (GdkPixbuf* pixBuf = ::gdk_pixbuf_new_from_file_at_size(filename.c_str(), trgWidth, trgHeight, nullptr)) + if (GdkPixbuf* pixBuf = ::gdk_pixbuf_new_from_file_at_size(filepath.c_str(), trgWidth, trgHeight, nullptr)) return IconHolder(pixBuf); //pass ownership } } @@ -279,7 +279,7 @@ IconHolder getThumbnailImage(const Zstring& filename, int requestedSize) //retur #elif defined ZEN_MAC try { - return IconHolder(new osx::ImageData(osx::getThumbnail(filename.c_str(), requestedSize))); //throw SysError + return IconHolder(new osx::ImageData(osx::getThumbnail(filepath.c_str(), requestedSize))); //throw SysError } catch (zen::SysError&) {} #endif @@ -320,7 +320,7 @@ IconHolder getGenericFileIcon(IconBuffer::IconSize sz) } -IconHolder getAssociatedIcon(const Zstring& filename, IconBuffer::IconSize sz) +IconHolder getAssociatedIcon(const Zstring& filepath, IconBuffer::IconSize sz) { //1. try to load thumbnails switch (sz) @@ -329,7 +329,7 @@ IconHolder getAssociatedIcon(const Zstring& filename, IconBuffer::IconSize sz) break; case IconBuffer::SIZE_MEDIUM: case IconBuffer::SIZE_LARGE: - if (IconHolder ico = getThumbnailImage(filename, IconBuffer::getSize(sz))) + if (IconHolder ico = getThumbnailImage(filepath, IconBuffer::getSize(sz))) return ico; //else: fallback to non-thumbnail icon break; @@ -338,13 +338,13 @@ IconHolder getAssociatedIcon(const Zstring& filename, IconBuffer::IconSize sz) //2. retrieve file icons #ifdef ZEN_WIN //perf: optimize fallback case for SIZE_MEDIUM and SIZE_LARGE: - const Zstring& extension = getFileExtension(filename); + const Zstring& extension = getFileExtension(filepath); if (isStandardIconExtension(extension)) //"pricey" extensions are stored with fullnames and are read from disk, while cheap ones require just the extension return getAssociatedIconByExt(extension, sz); - //SIZE_MEDIUM or SIZE_LARGE: result will buffered under full filename, not extension; this is okay: failure to load thumbnail is independent from extension in general! + //SIZE_MEDIUM or SIZE_LARGE: result will buffered under full filepath, not extension; this is okay: failure to load thumbnail is independent from extension in general! SHFILEINFO fileInfo = {}; - if (DWORD_PTR imgList = ::SHGetFileInfo(filename.c_str(), //_In_ LPCTSTR pszPath, -> note: ::SHGetFileInfo() can't handle \\?\-prefix! + if (DWORD_PTR imgList = ::SHGetFileInfo(filepath.c_str(), //_In_ LPCTSTR pszPath, -> note: ::SHGetFileInfo() can't handle \\?\-prefix! 0, //DWORD dwFileAttributes, &fileInfo, //_Inout_ SHFILEINFO *psfi, sizeof(fileInfo), //UINT cbFileInfo, @@ -367,7 +367,7 @@ IconHolder getAssociatedIcon(const Zstring& filename, IconBuffer::IconSize sz) } #elif defined ZEN_LINUX - GFile* file = ::g_file_new_for_path(filename.c_str()); //documented to "never fail" + GFile* file = ::g_file_new_for_path(filepath.c_str()); //documented to "never fail" ZEN_ON_SCOPE_EXIT(::g_object_unref(file);) if (GFileInfo* fileInfo = ::g_file_query_info(file, G_FILE_ATTRIBUTE_STANDARD_ICON, G_FILE_QUERY_INFO_NONE, nullptr, nullptr)) @@ -381,7 +381,7 @@ IconHolder getAssociatedIcon(const Zstring& filename, IconBuffer::IconSize sz) #elif defined ZEN_MAC try { - return IconHolder(new osx::ImageData(osx::getFileIcon(filename.c_str(), IconBuffer::getSize(sz)))); //throw SysError + return IconHolder(new osx::ImageData(osx::getFileIcon(filepath.c_str(), IconBuffer::getSize(sz)))); //throw SysError } catch (zen::SysError&) { assert(false); } #endif @@ -402,9 +402,9 @@ public: while (filesToLoad.empty()) conditionNewFiles.timed_wait(dummy, boost::posix_time::milliseconds(100)); //interruption point! - Zstring fileName = filesToLoad.back(); + Zstring filepath = filesToLoad.back(); filesToLoad.pop_back(); - return fileName; + return filepath; } void setWorkload(const std::vector<Zstring>& newLoad) //context of main thread @@ -441,19 +441,19 @@ public: Buffer() : firstInsertPos(iconList.end()), lastInsertPos(iconList.end()) {} //called by main and worker thread: - bool hasIcon(const Zstring& fileName) const + bool hasIcon(const Zstring& filepath) const { boost::lock_guard<boost::mutex> dummy(lockIconList); - return iconList.find(fileName) != iconList.end(); + return iconList.find(filepath) != iconList.end(); } //must be called by main thread only! => wxBitmap is NOT thread-safe like an int (non-atomic ref-count!!!) - Opt<wxBitmap> retrieve(const Zstring& fileName) + Opt<wxBitmap> retrieve(const Zstring& filepath) { assert(boost::this_thread::get_id() == mainThreadId); boost::lock_guard<boost::mutex> dummy(lockIconList); - auto it = iconList.find(fileName); + auto it = iconList.find(filepath); if (it == iconList.end()) return NoValue(); @@ -634,10 +634,10 @@ void WorkerThread::operator()() //thread entry { boost::this_thread::interruption_point(); - const Zstring fileName = workload_->extractNextFile(); //start work: blocks until next icon to load is retrieved + const Zstring filepath = workload_->extractNextFile(); //start work: blocks until next icon to load is retrieved - if (!buffer_->hasIcon(fileName)) //perf: workload may contain duplicate entries? - buffer_->insert(fileName, getAssociatedIcon(fileName, iconSizeType)); + if (!buffer_->hasIcon(filepath)) //perf: workload may contain duplicate entries? + buffer_->insert(filepath, getAssociatedIcon(filepath, iconSizeType)); } } @@ -694,24 +694,24 @@ int IconBuffer::getSize(IconSize icoSize) } -bool IconBuffer::readyForRetrieval(const Zstring& filename) +bool IconBuffer::readyForRetrieval(const Zstring& filepath) { #ifdef ZEN_WIN if (iconSizeType == IconBuffer::SIZE_SMALL) - if (isStandardIconExtension(getFileExtension(filename))) + if (isStandardIconExtension(getFileExtension(filepath))) return true; #endif - return pimpl->buffer->hasIcon(filename); + return pimpl->buffer->hasIcon(filepath); } -Opt<wxBitmap> IconBuffer::retrieveFileIcon(const Zstring& filename) +Opt<wxBitmap> IconBuffer::retrieveFileIcon(const Zstring& filepath) { #ifdef ZEN_WIN //perf: let's read icons which don't need file access right away! No async delay justified! if (iconSizeType == IconBuffer::SIZE_SMALL) //non-thumbnail view, we need file type icons only! { - const Zstring& extension = getFileExtension(filename); + const Zstring& extension = getFileExtension(filepath); if (isStandardIconExtension(extension)) //"pricey" extensions are stored with fullnames and are read from disk, while cheap ones require just the extension { if (Opt<wxBitmap> ico = pimpl->buffer->retrieve(extension)) @@ -727,11 +727,11 @@ Opt<wxBitmap> IconBuffer::retrieveFileIcon(const Zstring& filename) } #endif - if (Opt<wxBitmap> ico = pimpl->buffer->retrieve(filename)) + if (Opt<wxBitmap> ico = pimpl->buffer->retrieve(filepath)) return ico; //since this icon seems important right now, we don't want to wait until next setWorkload() to start retrieving - pimpl->workload->addToWorkload(filename); + pimpl->workload->addToWorkload(filepath); pimpl->buffer->limitSize(); return NoValue(); } diff --git a/FreeFileSync/Source/lib/icon_buffer.h b/FreeFileSync/Source/lib/icon_buffer.h index 037f8622..3c313bf5 100644 --- a/FreeFileSync/Source/lib/icon_buffer.h +++ b/FreeFileSync/Source/lib/icon_buffer.h @@ -31,8 +31,8 @@ public: static int getSize(IconSize sz); //expected and *maximum* icon size in pixel int getSize() const { return getSize(iconSizeType); } // - bool readyForRetrieval(const Zstring& filename); - Opt<wxBitmap> retrieveFileIcon(const Zstring& filename); //... and mark as hot + bool readyForRetrieval(const Zstring& filepath); + Opt<wxBitmap> retrieveFileIcon(const Zstring& filepath); //... and mark as hot void setWorkload(const std::vector<Zstring>& load); //(re-)set new workload of icons to be retrieved; @@ -47,7 +47,7 @@ private: const IconSize iconSizeType; }; -bool hasLinkExtension(const Zstring& filename); +bool hasLinkExtension(const Zstring& filepath); } #endif // ICONBUFFER_H_INCLUDED diff --git a/FreeFileSync/Source/lib/localization.cpp b/FreeFileSync/Source/lib/localization.cpp index b13f433e..ab4b49d1 100644 --- a/FreeFileSync/Source/lib/localization.cpp +++ b/FreeFileSync/Source/lib/localization.cpp @@ -34,7 +34,7 @@ namespace class FFSTranslation : public TranslationHandler { public: - FFSTranslation(const Zstring& filename, wxLanguage languageId); //throw lngfile::ParsingError, parse_plural::ParsingError + FFSTranslation(const Zstring& filepath, wxLanguage languageId); //throw lngfile::ParsingError, parse_plural::ParsingError wxLanguage langId() const { return langId_; } @@ -70,12 +70,12 @@ private: }; -FFSTranslation::FFSTranslation(const Zstring& filename, wxLanguage languageId) : langId_(languageId) //throw lngfile::ParsingError, parse_plural::ParsingError +FFSTranslation::FFSTranslation(const Zstring& filepath, wxLanguage languageId) : langId_(languageId) //throw lngfile::ParsingError, parse_plural::ParsingError { std::string inputStream; try { - inputStream = loadBinStream<std::string>(filename); //throw FileError + inputStream = loadBinStream<std::string>(filepath); //throw FileError } catch (const FileError& e) { @@ -115,14 +115,14 @@ class FindLngfiles : public zen::TraverseCallback public: FindLngfiles(std::vector<Zstring>& lngFiles) : lngFiles_(lngFiles) {} - virtual void onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) + virtual void onFile(const Zchar* shortName, const Zstring& filepath, const FileInfo& details) { - if (endsWith(fullName, Zstr(".lng"))) - lngFiles_.push_back(fullName); + if (endsWith(filepath, Zstr(".lng"))) + lngFiles_.push_back(filepath); } - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) { return LINK_SKIP; } - virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& fullName) { return nullptr; } + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { return LINK_SKIP; } + virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& dirpath) { return nullptr; } virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber) { assert(false); return ON_ERROR_IGNORE; } //errors are not really critical in this context virtual HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) { assert(false); return ON_ERROR_IGNORE; } // @@ -193,11 +193,11 @@ ExistingTranslations::ExistingTranslations() traverseFolder(zen::getResourceDir() + Zstr("Languages"), //throw(); traverseCallback); - for (const Zstring& filename : lngFiles) + for (const Zstring& filepath : lngFiles) { try { - const std::string stream = loadBinStream<std::string>(filename); //throw FileError + const std::string stream = loadBinStream<std::string>(filepath); //throw FileError lngfile::TransHeader lngHeader; lngfile::parseHeader(stream, lngHeader); //throw ParsingError @@ -215,7 +215,7 @@ ExistingTranslations::ExistingTranslations() ExistingTranslations::Entry newEntry; newEntry.languageID = locInfo->Language; newEntry.languageName = utfCvrtTo<std::wstring>(lngHeader.languageName); - newEntry.languageFile = utfCvrtTo<std::wstring>(filename); + newEntry.languageFile = utfCvrtTo<std::wstring>(filepath); newEntry.translatorName = utfCvrtTo<std::wstring>(lngHeader.translatorName); newEntry.languageFlag = utfCvrtTo<std::wstring>(lngHeader.flagFile); locMapping.push_back(newEntry); diff --git a/FreeFileSync/Source/lib/localization.h b/FreeFileSync/Source/lib/localization.h index 2d871dd7..6cd61295 100644 --- a/FreeFileSync/Source/lib/localization.h +++ b/FreeFileSync/Source/lib/localization.h @@ -9,7 +9,6 @@ #include <vector> #include <zen/file_error.h> -//#include <wx/string.h> namespace zen { @@ -28,9 +27,8 @@ public: private: ExistingTranslations(); - ExistingTranslations(const ExistingTranslations&); - ExistingTranslations& operator=(const ExistingTranslations&); - + ExistingTranslations (const ExistingTranslations&) = delete; + ExistingTranslations& operator=(const ExistingTranslations&) = delete; std::vector<Entry> locMapping; }; diff --git a/FreeFileSync/Source/lib/lock_holder.h b/FreeFileSync/Source/lib/lock_holder.h index ea92ae9a..2d7b6ef1 100644 --- a/FreeFileSync/Source/lib/lock_holder.h +++ b/FreeFileSync/Source/lib/lock_holder.h @@ -6,7 +6,6 @@ #include <zen/stl_tools.h> #include "dir_lock.h" #include "status_handler.h" -//#include "dir_exist_async.h" namespace zen { @@ -18,13 +17,13 @@ const Zchar LOCK_FILE_ENDING[] = Zstr(".ffs_lock"); //don't use Zstring as glob class LockHolder { public: - LockHolder(const std::set<Zstring, LessFilename>& dirnamesExisting, //resolved dirname ending with path separator + LockHolder(const std::set<Zstring, LessFilename>& dirpathsExisting, //resolved dirpaths ending with path separator bool& warningDirectoryLockFailed, ProcessCallback& procCallback) { - for (const Zstring& dirnameFmt : dirnamesExisting) + for (const Zstring& dirpathFmt : dirpathsExisting) { - assert(endsWith(dirnameFmt, FILE_NAME_SEPARATOR)); //this is really the contract, formatting does other things as well, e.g. macro substitution + assert(endsWith(dirpathFmt, FILE_NAME_SEPARATOR)); //this is really the contract, formatting does other things as well, e.g. macro substitution class WaitOnLockHandler : public DirLockCallback { @@ -39,11 +38,11 @@ public: try { //lock file creation is synchronous and may block noticeably for very slow devices (usb sticks, mapped cloud storages) - lockHolder.push_back(DirLock(dirnameFmt + Zstr("sync") + LOCK_FILE_ENDING, &callback)); //throw FileError + lockHolder.push_back(DirLock(dirpathFmt + Zstr("sync") + LOCK_FILE_ENDING, &callback)); //throw FileError } catch (const FileError& e) { - const std::wstring msg = replaceCpy(_("Cannot set directory lock for %x."), L"%x", fmtFileName(dirnameFmt)) + L"\n\n" + e.toString(); + const std::wstring msg = replaceCpy(_("Cannot set directory lock for %x."), L"%x", fmtFileName(dirpathFmt)) + L"\n\n" + e.toString(); procCallback.reportWarning(msg, warningDirectoryLockFailed); //may throw! } } diff --git a/FreeFileSync/Source/lib/parallel_scan.cpp b/FreeFileSync/Source/lib/parallel_scan.cpp index 4a30c567..a80e4d91 100644 --- a/FreeFileSync/Source/lib/parallel_scan.cpp +++ b/FreeFileSync/Source/lib/parallel_scan.cpp @@ -142,7 +142,7 @@ std::vector<std::set<DirectoryKey>> separateByDistinctDisk(const std::set<Direct typedef std::map<DiskInfo, std::set<DirectoryKey>> DiskKeyMapping; DiskKeyMapping tmp; std::for_each(dirkeys.begin(), dirkeys.end(), - [&](const DirectoryKey& key) { tmp[retrieveDiskInfo(key.dirnameFull_)].insert(key); }); + [&](const DirectoryKey& key) { tmp[retrieveDiskInfo(key.dirpathFull_)].insert(key); }); std::vector<std::set<DirectoryKey>> buckets; std::transform(tmp.begin(), tmp.end(), std::back_inserter(buckets), @@ -201,12 +201,12 @@ public: void incrementNotifyingThreadId() { ++notifyingThreadID; } //context of main thread - void reportCurrentFile(const Zstring& filename, long threadID) //context of worker thread + void reportCurrentFile(const Zstring& filepath, long threadID) //context of worker thread { if (threadID != notifyingThreadID) return; //only one thread at a time may report status boost::lock_guard<boost::mutex> dummy(lockCurrentStatus); - currentFile = filename; + currentFile = filepath; currentStatus.clear(); } @@ -221,24 +221,24 @@ public: std::wstring getCurrentStatus() //context of main thread, call repreatedly { - Zstring filename; + Zstring filepath; std::wstring statusMsg; { boost::lock_guard<boost::mutex> dummy(lockCurrentStatus); if (!currentFile.empty()) - filename = currentFile; + filepath = currentFile; else if (!currentStatus.empty()) statusMsg = copyStringTo<std::wstring>(currentStatus); } - if (!filename.empty()) + if (!filepath.empty()) { std::wstring statusText = copyStringTo<std::wstring>(textScanning); const long activeCount = activeWorker; if (activeCount >= 2) statusText += L" [" + replaceCpy(_P("1 thread", "%x threads", activeCount), L"%x", numberTo<std::wstring>(activeCount)) + L"]"; - statusText += L" " + fmtFileName(filename); + statusText += L" " + fmtFileName(filepath); return statusText; } else @@ -313,9 +313,9 @@ public: relNameParentPf_(relNameParentPf), output_(output) {} - virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details); - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details); - virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& fullName); + virtual void onFile (const Zchar* shortName, const Zstring& filepath, const FileInfo& details); + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details); + virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& dirpath); virtual void releaseDirTraverser(TraverseCallback* trav); virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber); @@ -328,7 +328,7 @@ private: }; -void DirCallback::onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) +void DirCallback::onFile(const Zchar* shortName, const Zstring& filepath, const FileInfo& details) { boost::this_thread::interruption_point(); @@ -340,14 +340,14 @@ void DirCallback::onFile(const Zchar* shortName, const Zstring& fullName, const return; //update status information no matter whether object is excluded or not! - cfg.acb_.reportCurrentFile(fullName, cfg.threadID_); + cfg.acb_.reportCurrentFile(filepath, cfg.threadID_); //------------------------------------------------------------------------------------ //apply filter before processing (use relative name!) if (!cfg.filterInstance->passFileFilter(relNameParentPf_ + fileNameShort)) return; - // std::string fileId = details.fileSize >= 1024 * 1024U ? util::retrieveFileID(fullName) : std::string(); + // std::string fileId = details.fileSize >= 1024 * 1024U ? util::retrieveFileID(filepath) : std::string(); /* Perf test Windows 7, SSD, 350k files, 50k dirs, files > 1MB: 7000 regular: 6.9s @@ -364,12 +364,12 @@ void DirCallback::onFile(const Zchar* shortName, const Zstring& fullName, const } -DirCallback::HandleLink DirCallback::onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) +DirCallback::HandleLink DirCallback::onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { boost::this_thread::interruption_point(); //update status information no matter whether object is excluded or not! - cfg.acb_.reportCurrentFile(fullName, cfg.threadID_); + cfg.acb_.reportCurrentFile(linkpath, cfg.threadID_); switch (cfg.handleSymlinks_) { @@ -402,12 +402,12 @@ DirCallback::HandleLink DirCallback::onSymlink(const Zchar* shortName, const Zst } -TraverseCallback* DirCallback::onDir(const Zchar* shortName, const Zstring& fullName) +TraverseCallback* DirCallback::onDir(const Zchar* shortName, const Zstring& dirpath) { boost::this_thread::interruption_point(); //update status information no matter whether object is excluded or not! - cfg.acb_.reportCurrentFile(fullName, cfg.threadID_); + cfg.acb_.reportCurrentFile(dirpath, cfg.threadID_); //------------------------------------------------------------------------------------ const Zstring& relPath = relNameParentPf_ + shortName; @@ -478,11 +478,11 @@ public: textApplyingDstHack(replaceCpy(_("Encoding extended time information: %x"), L"%x", L"\n%x")) {} private: - virtual void requestUiRefresh(const Zstring& filename) //applying DST hack imposes significant one-time performance drawback => callback to inform user + virtual void requestUiRefresh(const Zstring& filepath) //applying DST hack imposes significant one-time performance drawback => callback to inform user { boost::this_thread::interruption_point(); - acb_.reportCurrentStatus(replaceCpy(textApplyingDstHack, L"%x", fmtFileName(filename)), threadID_); + acb_.reportCurrentStatus(replaceCpy(textApplyingDstHack, L"%x", fmtFileName(filepath)), threadID_); } AsyncCallback& acb_; @@ -510,7 +510,7 @@ public: acb_->incActiveWorker(); ZEN_ON_SCOPE_EXIT(acb_->decActiveWorker();); - acb_->reportCurrentFile(dirKey_.dirnameFull_, threadID_); //just in case first directory access is blocking + acb_->reportCurrentFile(dirKey_.dirpath_, threadID_); //just in case first directory access is blocking TraverserShared travCfg(threadID_, dirKey_.handleSymlinks_, //shared by all(!) instances of DirCallback while traversing a folder hierarchy @@ -530,7 +530,7 @@ public: #endif //get all files and folders from directoryPostfixed (and subdirectories) - traverseFolder(dirKey_.dirnameFull_, traverser, dstCallbackPtr); //exceptions may be thrown! + traverseFolder(dirKey_.dirpath_, traverser, dstCallbackPtr); //exceptions may be thrown! } private: diff --git a/FreeFileSync/Source/lib/parallel_scan.h b/FreeFileSync/Source/lib/parallel_scan.h index 408882bf..4b0e0748 100644 --- a/FreeFileSync/Source/lib/parallel_scan.h +++ b/FreeFileSync/Source/lib/parallel_scan.h @@ -17,14 +17,14 @@ namespace zen { struct DirectoryKey { - DirectoryKey(const Zstring& dirnameFull, + DirectoryKey(const Zstring& dirpath, const HardFilter::FilterRef& filter, SymLinkHandling handleSymlinks) : - dirnameFull_(dirnameFull), + dirpath_(dirpath), filter_(filter), handleSymlinks_(handleSymlinks) {} - Zstring dirnameFull_; + Zstring dirpath_; HardFilter::FilterRef filter_; //filter interface: always bound by design! SymLinkHandling handleSymlinks_; }; @@ -35,7 +35,7 @@ bool operator<(const DirectoryKey& lhs, const DirectoryKey& rhs) if (lhs.handleSymlinks_ != rhs.handleSymlinks_) return lhs.handleSymlinks_ < rhs.handleSymlinks_; - const int cmpName = cmpFileName(lhs.dirnameFull_, rhs.dirnameFull_); + const int cmpName = cmpFileName(lhs.dirpath_, rhs.dirpath_); if (cmpName != 0) return cmpName < 0; diff --git a/FreeFileSync/Source/lib/parse_lng.h b/FreeFileSync/Source/lib/parse_lng.h index ac4fdd0f..12e5290b 100644 --- a/FreeFileSync/Source/lib/parse_lng.h +++ b/FreeFileSync/Source/lib/parse_lng.h @@ -21,7 +21,6 @@ #include <zen/utf.h> #include <zen/string_tools.h> #include "parse_plural.h" -//#include <zen/perf.h> namespace lngfile { diff --git a/FreeFileSync/Source/lib/perf_check.cpp b/FreeFileSync/Source/lib/perf_check.cpp index 7e303041..251e6274 100644 --- a/FreeFileSync/Source/lib/perf_check.cpp +++ b/FreeFileSync/Source/lib/perf_check.cpp @@ -7,7 +7,6 @@ #include "perf_check.h" #include <limits> -//#include <wx/ffile.h> #include <zen/basic_math.h> #include <zen/i18n.h> #include <zen/format_unit.h> @@ -103,7 +102,7 @@ zen::Opt<std::wstring> PerfCheck::getBytesPerSecond() const const double dataDelta = itemBack.second.data_ - itemFront.second.data_; if (timeDeltaMs != 0) - return filesizeToShortString(Int64(dataDelta * 1000.0 / timeDeltaMs)) + _("/sec"); + return filesizeToShortString(static_cast<std::int64_t>(dataDelta * 1000.0 / timeDeltaMs)) + _("/sec"); } return NoValue(); } @@ -180,7 +179,7 @@ wxString Statistics::getRemainingTime(int objectsCurrent, double dataCurrent) const double X = dataCurrent - dataLast; dataLast = dataCurrent; - const zen::Int64 timeCurrent = wxGetLocalTimeMillis(); + const std::int64_t timeCurrent = wxGetLocalTimeMillis(); const double F = (timeCurrent - timeLast).ToDouble(); timeLast = timeCurrent; @@ -205,7 +204,7 @@ wxString Statistics::getRemainingTime(int objectsCurrent, double dataCurrent) const double X = dataCurrent - dataLast; //do not set dataLast, timeLast variables here, but write dummy record instead if (!isNull(X)) { - const zen::Int64 timeCurrent = wxGetLocalTimeMillis(); + const std::int64_t timeCurrent = wxGetLocalTimeMillis(); const double F = (timeCurrent - timeLast).ToDouble(); record modifyEntry; diff --git a/FreeFileSync/Source/lib/process_xml.cpp b/FreeFileSync/Source/lib/process_xml.cpp index 1d0e4076..98262882 100644 --- a/FreeFileSync/Source/lib/process_xml.cpp +++ b/FreeFileSync/Source/lib/process_xml.cpp @@ -20,12 +20,12 @@ namespace { //------------------------------------------------------------------------------------------------------------------------------- const int XML_FORMAT_VER_GLOBAL = 1; -const int XML_FORMAT_VER_FFS_GUI = 3; //for FFS 5.22 -const int XML_FORMAT_VER_FFS_BATCH = 3; // +const int XML_FORMAT_VER_FFS_GUI = 4; //for FFS 6.8 +const int XML_FORMAT_VER_FFS_BATCH = 4; // //------------------------------------------------------------------------------------------------------------------------------- } -XmlType getXmlTypeNoThrow(const zen::XmlDoc& doc) //throw() +XmlType getXmlTypeNoThrow(const XmlDoc& doc) //throw() { if (doc.root().getNameAs<std::string>() == "FreeFileSync") { @@ -44,10 +44,10 @@ XmlType getXmlTypeNoThrow(const zen::XmlDoc& doc) //throw() } -XmlType xmlAccess::getXmlType(const Zstring& filename) //throw FileError +XmlType xmlAccess::getXmlType(const Zstring& filepath) //throw FileError { //do NOT use zen::loadStream as it will needlessly load even huge files! - XmlDoc doc = loadXmlDocument(filename); //throw FileError; quick exit if file is not an FFS XML + XmlDoc doc = loadXmlDocument(filepath); //throw FileError; quick exit if file is not an FFS XML return ::getXmlTypeNoThrow(doc); } @@ -394,13 +394,13 @@ void writeText(const ColumnTypeRim& value, std::string& output) { switch (value) { - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: output = "Base"; break; case COL_TYPE_FULL_PATH: output = "Full"; break; - case COL_TYPE_REL_PATH: + case COL_TYPE_REL_FOLDER: output = "Rel"; break; case COL_TYPE_FILENAME: @@ -424,11 +424,11 @@ bool readText(const std::string& input, ColumnTypeRim& value) std::string tmp = input; zen::trim(tmp); if (tmp == "Base") - value = COL_TYPE_DIRECTORY; + value = COL_TYPE_BASE_DIRECTORY; else if (tmp == "Full") value = COL_TYPE_FULL_PATH; else if (tmp == "Rel") - value = COL_TYPE_REL_PATH; + value = COL_TYPE_REL_FOLDER; else if (tmp == "Name") value = COL_TYPE_FILENAME; else if (tmp == "Size") @@ -758,8 +758,11 @@ namespace { void readConfig(const XmlIn& in, CompConfig& cmpConfig) { - in["Variant" ](cmpConfig.compareVar); - in["Symlinks"](cmpConfig.handleSymlinks); + in["Variant" ](cmpConfig.compareVar); + warn_static("remove check after migration?") + if (in["TimeShift"]) //-> 27.2.2014 + in["TimeShift"](cmpConfig.optTimeShiftHours); + in["Symlinks" ](cmpConfig.handleSymlinks); } @@ -813,8 +816,8 @@ void readConfig(const XmlIn& in, FilterConfig& filter) void readConfig(const XmlIn& in, FolderPairEnh& enhPair) { //read folder pairs - in["Left" ](enhPair.dirnamePhraseLeft); - in["Right"](enhPair.dirnamePhraseRight); + in["Left" ](enhPair.dirpathPhraseLeft); + in["Right"](enhPair.dirpathPhraseRight); //########################################################### //alternate comp configuration (optional) @@ -1036,23 +1039,23 @@ bool needsMigration(const XmlDoc& doc, int currentXmlFormatVer) template <class ConfigType> -void readConfig(const Zstring& filename, XmlType type, ConfigType& cfg, int currentXmlFormatVer, std::wstring& warningMsg) //throw FileError +void readConfig(const Zstring& filepath, XmlType type, ConfigType& cfg, int currentXmlFormatVer, std::wstring& warningMsg) //throw FileError { - XmlDoc doc = loadXmlDocument(filename); //throw FileError + XmlDoc doc = loadXmlDocument(filepath); //throw FileError if (getXmlTypeNoThrow(doc) != type) //noexcept - throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filename))); + throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filepath))); XmlIn in(doc); ::readConfig(in, cfg); try { - checkForMappingErrors(in, filename); //throw FileError + checkForMappingErrors(in, filepath); //throw FileError //(try to) migrate old configuration if needed if (needsMigration(doc, currentXmlFormatVer)) - try { xmlAccess::writeConfig(cfg, filename); /*throw FileError*/ } + try { xmlAccess::writeConfig(cfg, filepath); /*throw FileError*/ } catch (FileError&) { assert(false); } //don't bother user! } catch (const FileError& e) @@ -1063,28 +1066,28 @@ void readConfig(const Zstring& filename, XmlType type, ConfigType& cfg, int curr } -void xmlAccess::readConfig(const Zstring& filename, xmlAccess::XmlGuiConfig& cfg, std::wstring& warningMsg) +void xmlAccess::readConfig(const Zstring& filepath, xmlAccess::XmlGuiConfig& cfg, std::wstring& warningMsg) { - ::readConfig(filename, XML_TYPE_GUI, cfg, XML_FORMAT_VER_FFS_GUI, warningMsg); //throw FileError + ::readConfig(filepath, XML_TYPE_GUI, cfg, XML_FORMAT_VER_FFS_GUI, warningMsg); //throw FileError } -void xmlAccess::readConfig(const Zstring& filename, xmlAccess::XmlBatchConfig& cfg, std::wstring& warningMsg) +void xmlAccess::readConfig(const Zstring& filepath, xmlAccess::XmlBatchConfig& cfg, std::wstring& warningMsg) { - ::readConfig(filename, XML_TYPE_BATCH, cfg, XML_FORMAT_VER_FFS_BATCH, warningMsg); //throw FileError + ::readConfig(filepath, XML_TYPE_BATCH, cfg, XML_FORMAT_VER_FFS_BATCH, warningMsg); //throw FileError } -void xmlAccess::readConfig(const Zstring& filename, xmlAccess::XmlGlobalSettings& cfg, std::wstring& warningMsg) +void xmlAccess::readConfig(const Zstring& filepath, xmlAccess::XmlGlobalSettings& cfg, std::wstring& warningMsg) { - ::readConfig(filename, XML_TYPE_GLOBAL, cfg, XML_FORMAT_VER_GLOBAL, warningMsg); //throw FileError + ::readConfig(filepath, XML_TYPE_GLOBAL, cfg, XML_FORMAT_VER_GLOBAL, warningMsg); //throw FileError } namespace { template <class XmlCfg> -XmlCfg parseConfig(const XmlDoc& doc, const Zstring& filename, int currentXmlFormatVer, std::wstring& warningMsg) //nothrow +XmlCfg parseConfig(const XmlDoc& doc, const Zstring& filepath, int currentXmlFormatVer, std::wstring& warningMsg) //nothrow { XmlIn in(doc); XmlCfg cfg; @@ -1092,11 +1095,11 @@ XmlCfg parseConfig(const XmlDoc& doc, const Zstring& filename, int currentXmlFor try { - checkForMappingErrors(in, filename); //throw FileError + checkForMappingErrors(in, filepath); //throw FileError //(try to) migrate old configuration if needed if (needsMigration(doc, currentXmlFormatVer)) - try { xmlAccess::writeConfig(cfg, filename); /*throw FileError*/ } + try { xmlAccess::writeConfig(cfg, filepath); /*throw FileError*/ } catch (FileError&) { assert(false); } //don't bother user! } catch (const FileError& e) @@ -1110,24 +1113,24 @@ XmlCfg parseConfig(const XmlDoc& doc, const Zstring& filename, int currentXmlFor } -void xmlAccess::readAnyConfig(const std::vector<Zstring>& filenames, XmlGuiConfig& config, std::wstring& warningMsg) //throw FileError +void xmlAccess::readAnyConfig(const std::vector<Zstring>& filepaths, XmlGuiConfig& config, std::wstring& warningMsg) //throw FileError { - assert(!filenames.empty()); + assert(!filepaths.empty()); std::vector<zen::MainConfiguration> mainCfgs; - for (auto it = filenames.begin(); it != filenames.end(); ++it) + for (auto it = filepaths.begin(); it != filepaths.end(); ++it) { - const Zstring& filename = *it; - const bool firstItem = it == filenames.begin(); //init all non-"mainCfg" settings with first config file + const Zstring& filepath = *it; + const bool firstItem = it == filepaths.begin(); //init all non-"mainCfg" settings with first config file - XmlDoc doc = loadXmlDocument(filename); //throw FileError + XmlDoc doc = loadXmlDocument(filepath); //throw FileError switch (getXmlTypeNoThrow(doc)) { case XML_TYPE_GUI: { - XmlGuiConfig guiCfg = parseConfig<XmlGuiConfig>(doc, filename, XML_FORMAT_VER_FFS_GUI, warningMsg); //nothrow + XmlGuiConfig guiCfg = parseConfig<XmlGuiConfig>(doc, filepath, XML_FORMAT_VER_FFS_GUI, warningMsg); //nothrow if (firstItem) config = guiCfg; mainCfgs.push_back(guiCfg.mainCfg); @@ -1136,7 +1139,7 @@ void xmlAccess::readAnyConfig(const std::vector<Zstring>& filenames, XmlGuiConfi case XML_TYPE_BATCH: { - XmlBatchConfig batchCfg = parseConfig<XmlBatchConfig>(doc, filename, XML_FORMAT_VER_FFS_BATCH, warningMsg); //nothrow + XmlBatchConfig batchCfg = parseConfig<XmlBatchConfig>(doc, filepath, XML_FORMAT_VER_FFS_BATCH, warningMsg); //nothrow if (firstItem) config = convertBatchToGui(batchCfg); mainCfgs.push_back(batchCfg.mainCfg); @@ -1145,7 +1148,7 @@ void xmlAccess::readAnyConfig(const std::vector<Zstring>& filenames, XmlGuiConfi case XML_TYPE_GLOBAL: case XML_TYPE_OTHER: - throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filename))); + throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filepath))); } } @@ -1158,8 +1161,9 @@ namespace { void writeConfig(const CompConfig& cmpConfig, XmlOut& out) { - out["Variant" ](cmpConfig.compareVar); - out["Symlinks"](cmpConfig.handleSymlinks); + out["Variant" ](cmpConfig.compareVar); + out["TimeShift"](cmpConfig.optTimeShiftHours); + out["Symlinks" ](cmpConfig.handleSymlinks); } @@ -1210,8 +1214,8 @@ void writeConfigFolderPair(const FolderPairEnh& enhPair, XmlOut& out) XmlOut outPair = out.ref().addChild("Pair"); //read folder pairs - outPair["Left" ](enhPair.dirnamePhraseLeft); - outPair["Right"](enhPair.dirnamePhraseRight); + outPair["Left" ](enhPair.dirpathPhraseLeft); + outPair["Right"](enhPair.dirpathPhraseRight); //########################################################### //alternate comp configuration (optional) @@ -1400,7 +1404,7 @@ void writeConfig(const XmlGlobalSettings& config, XmlOut& out) template <class ConfigType> -void writeConfig(const ConfigType& config, XmlType type, int xmlFormatVer, const Zstring& filename) +void writeConfig(const ConfigType& config, XmlType type, int xmlFormatVer, const Zstring& filepath) { XmlDoc doc("FreeFileSync"); setXmlType(doc, type); //throw() @@ -1410,25 +1414,25 @@ void writeConfig(const ConfigType& config, XmlType type, int xmlFormatVer, const XmlOut out(doc); writeConfig(config, out); - saveXmlDocument(doc, filename); //throw FileError + saveXmlDocument(doc, filepath); //throw FileError } } -void xmlAccess::writeConfig(const XmlGuiConfig& cfg, const Zstring& filename) +void xmlAccess::writeConfig(const XmlGuiConfig& cfg, const Zstring& filepath) { - ::writeConfig(cfg, XML_TYPE_GUI, XML_FORMAT_VER_FFS_GUI, filename); //throw FileError + ::writeConfig(cfg, XML_TYPE_GUI, XML_FORMAT_VER_FFS_GUI, filepath); //throw FileError } -void xmlAccess::writeConfig(const XmlBatchConfig& cfg, const Zstring& filename) +void xmlAccess::writeConfig(const XmlBatchConfig& cfg, const Zstring& filepath) { - ::writeConfig(cfg, XML_TYPE_BATCH, XML_FORMAT_VER_FFS_BATCH, filename); //throw FileError + ::writeConfig(cfg, XML_TYPE_BATCH, XML_FORMAT_VER_FFS_BATCH, filepath); //throw FileError } -void xmlAccess::writeConfig(const XmlGlobalSettings& cfg, const Zstring& filename) +void xmlAccess::writeConfig(const XmlGlobalSettings& cfg, const Zstring& filepath) { - ::writeConfig(cfg, XML_TYPE_GLOBAL, XML_FORMAT_VER_GLOBAL, filename); //throw FileError + ::writeConfig(cfg, XML_TYPE_GLOBAL, XML_FORMAT_VER_GLOBAL, filepath); //throw FileError } diff --git a/FreeFileSync/Source/lib/process_xml.h b/FreeFileSync/Source/lib/process_xml.h index 1a9257bd..394b3f65 100644 --- a/FreeFileSync/Source/lib/process_xml.h +++ b/FreeFileSync/Source/lib/process_xml.h @@ -13,7 +13,6 @@ #include "../structures.h" #include "../ui/column_attr.h" #include "../ui/folder_history_types.h" -//#include "ffs_paths.h" namespace xmlAccess { @@ -25,7 +24,7 @@ enum XmlType XML_TYPE_OTHER }; -XmlType getXmlType(const Zstring& filename); //throw FileError +XmlType getXmlType(const Zstring& filepath); //throw FileError enum OnError @@ -274,16 +273,16 @@ struct XmlGlobalSettings }; //read/write specific config types -void readConfig(const Zstring& filename, XmlGuiConfig& config, std::wstring& warningMsg); // -void readConfig(const Zstring& filename, XmlBatchConfig& config, std::wstring& warningMsg); //throw FileError -void readConfig(const Zstring& filename, XmlGlobalSettings& config, std::wstring& warningMsg); // +void readConfig(const Zstring& filepath, XmlGuiConfig& config, std::wstring& warningMsg); // +void readConfig(const Zstring& filepath, XmlBatchConfig& config, std::wstring& warningMsg); //throw FileError +void readConfig(const Zstring& filepath, XmlGlobalSettings& config, std::wstring& warningMsg); // -void writeConfig(const XmlGuiConfig& config, const Zstring& filename); // -void writeConfig(const XmlBatchConfig& config, const Zstring& filename); //throw FileError -void writeConfig(const XmlGlobalSettings& config, const Zstring& filename); // +void writeConfig(const XmlGuiConfig& config, const Zstring& filepath); // +void writeConfig(const XmlBatchConfig& config, const Zstring& filepath); //throw FileError +void writeConfig(const XmlGlobalSettings& config, const Zstring& filepath); // //convert (multiple) *.ffs_gui, *.ffs_batch files or combinations of both into target config structure: -void readAnyConfig(const std::vector<Zstring>& filenames, XmlGuiConfig& config, std::wstring& warningMsg); //throw FileError +void readAnyConfig(const std::vector<Zstring>& filepaths, XmlGuiConfig& config, std::wstring& warningMsg); //throw FileError //config conversion utilities XmlGuiConfig convertBatchToGui(const XmlBatchConfig& batchCfg); //noexcept @@ -292,5 +291,4 @@ XmlBatchConfig convertGuiToBatch(const XmlGuiConfig& guiCfg, const XmlBatchCon std::wstring extractJobName(const Zstring& configFilename); } - #endif // PROCESSXML_H_INCLUDED diff --git a/FreeFileSync/Source/lib/resolve_path.cpp b/FreeFileSync/Source/lib/resolve_path.cpp index b776e143..4688ccbd 100644 --- a/FreeFileSync/Source/lib/resolve_path.cpp +++ b/FreeFileSync/Source/lib/resolve_path.cpp @@ -29,28 +29,28 @@ using namespace zen; namespace { #ifdef ZEN_WIN -Zstring resolveRelativePath(const Zstring& relativeName) //note: ::GetFullPathName() is documented not threadsafe! +Zstring resolveRelativePath(const Zstring& relativePath) //note: ::GetFullPathName() is documented not threadsafe! { //don't use long path prefix! does not work with relative paths "." and ".." - const DWORD bufferSize = ::GetFullPathName(relativeName.c_str(), 0, nullptr, nullptr); + const DWORD bufferSize = ::GetFullPathName(relativePath.c_str(), 0, nullptr, nullptr); if (bufferSize > 0) { std::vector<wchar_t> buffer(bufferSize); - const DWORD charsWritten = ::GetFullPathName(relativeName.c_str(), //__in LPCTSTR lpFileName, + const DWORD charsWritten = ::GetFullPathName(relativePath.c_str(), //__in LPCTSTR lpFileName, bufferSize, //__in DWORD nBufferLength, &buffer[0], //__out LPTSTR lpBuffer, nullptr); //__out LPTSTR *lpFilePart if (0 < charsWritten && charsWritten < bufferSize) //theoretically, charsWritten can never be == "bufferSize" return Zstring(&buffer[0], charsWritten); } - return relativeName; //ERROR! Don't do anything + return relativePath; //ERROR! Don't do anything } #elif defined ZEN_LINUX || defined ZEN_MAC -Zstring resolveRelativePath(const Zstring& relativeName) +Zstring resolveRelativePath(const Zstring& relativePath) { //http://linux.die.net/man/2/path_resolution - if (!startsWith(relativeName, FILE_NAME_SEPARATOR)) //absolute names are exactly those starting with a '/' + if (!startsWith(relativePath, FILE_NAME_SEPARATOR)) //absolute names are exactly those starting with a '/' { /* basic support for '~': strictly speaking this is a shell-layer feature, so "realpath()" won't handle it @@ -60,15 +60,15 @@ Zstring resolveRelativePath(const Zstring& relativeName) should inspect the value of HOME (rather than the value getpwuid(getuid())->pw_dir) since this allows the user to modify their notion of "the home directory" during a login session. */ - if (startsWith(relativeName, "~/") || relativeName == "~") + if (startsWith(relativePath, "~/") || relativePath == "~") { const char* homeDir = ::getenv("HOME"); if (!homeDir) - return relativeName; //error! no further processing! + return relativePath; //error! no further processing! - if (startsWith(relativeName, "~/")) - return appendSeparator(homeDir) + afterFirst(relativeName, '/'); - else if (relativeName == "~") + if (startsWith(relativePath, "~/")) + return appendSeparator(homeDir) + afterFirst(relativePath, '/'); + else if (relativePath == "~") return homeDir; } @@ -76,10 +76,10 @@ Zstring resolveRelativePath(const Zstring& relativeName) if (char* dirpath = ::getcwd(nullptr, 0)) { ZEN_ON_SCOPE_EXIT(::free(dirpath)); - return appendSeparator(dirpath) + relativeName; + return appendSeparator(dirpath) + relativePath; } } - return relativeName; + return relativePath; } #endif @@ -110,9 +110,9 @@ private: 0 /* == SHGFP_TYPE_CURRENT*/, //__in DWORD dwFlags, buffer))) //__out LPTSTR pszPath { - Zstring dirname = buffer; - if (!dirname.empty()) - output.insert(std::make_pair(paramName, dirname)); + Zstring dirpath = buffer; + if (!dirpath.empty()) + output.insert(std::make_pair(paramName, dirpath)); } }; @@ -136,9 +136,9 @@ private: { ZEN_ON_SCOPE_EXIT(::CoTaskMemFree(path)); - Zstring dirname = path; - if (!dirname.empty()) - output.insert(std::make_pair(paramName, dirname)); + Zstring dirpath = path; + if (!dirpath.empty()) + output.insert(std::make_pair(paramName, dirpath)); } } }; @@ -441,23 +441,23 @@ Zstring expandVolumeName(const Zstring& text) // [volname]:\folder [volna } -void getDirectoryAliasesRecursive(const Zstring& dirname, std::set<Zstring, LessFilename>& output) +void getDirectoryAliasesRecursive(const Zstring& dirpath, std::set<Zstring, LessFilename>& output) { #ifdef ZEN_WIN - //1. replace volume path by volume name: c:\dirname -> [SYSTEM]\dirname - if (dirname.size() >= 3 && - std::iswalpha(dirname[0]) && - dirname[1] == L':' && - dirname[2] == L'\\') + //1. replace volume path by volume name: c:\dirpath -> [SYSTEM]\dirpath + if (dirpath.size() >= 3 && + std::iswalpha(dirpath[0]) && + dirpath[1] == L':' && + dirpath[2] == L'\\') { - if (Opt<Zstring> volname = getVolumeName(Zstring(dirname.c_str(), 3))) //should not block - output.insert(L"[" + *volname + L"]" + Zstring(dirname.c_str() + 2)); + if (Opt<Zstring> volname = getVolumeName(Zstring(dirpath.c_str(), 3))) //should not block + output.insert(L"[" + *volname + L"]" + Zstring(dirpath.c_str() + 2)); } - //2. replace volume name by volume path: [SYSTEM]\dirname -> c:\dirname + //2. replace volume name by volume path: [SYSTEM]\dirpath -> c:\dirpath { - Zstring testVolname = expandVolumeName(dirname); //should not block - if (testVolname != dirname) + Zstring testVolname = expandVolumeName(dirpath); //should not block + if (testVolname != dirpath) if (output.insert(testVolname).second) getDirectoryAliasesRecursive(testVolname, output); //recurse! } @@ -508,72 +508,72 @@ void getDirectoryAliasesRecursive(const Zstring& dirname, std::set<Zstring, Less #endif }; for (const auto& entry : envToDir) - if (pathStartsWith(dirname, entry.second)) - output.insert(MACRO_SEP + entry.first + MACRO_SEP + (dirname.c_str() + entry.second.size())); + if (pathStartsWith(dirpath, entry.second)) + output.insert(MACRO_SEP + entry.first + MACRO_SEP + (dirpath.c_str() + entry.second.size())); } //4. replace (all) macros: %USERPROFILE% -> C:\Users\<user> { - Zstring testMacros = expandMacros(dirname); - if (testMacros != dirname) + Zstring testMacros = expandMacros(dirpath); + if (testMacros != dirpath) if (output.insert(testMacros).second) getDirectoryAliasesRecursive(testMacros, output); //recurse! } } -std::vector<Zstring> zen::getDirectoryAliases(const Zstring& dirString) +std::vector<Zstring> zen::getDirectoryAliases(const Zstring& dirpathPhrase) { - Zstring dirname = dirString; - trim(dirname, true, false); - if (dirname.empty()) + Zstring dirpath = dirpathPhrase; + trim(dirpath, true, false); + if (dirpath.empty()) return std::vector<Zstring>(); std::set<Zstring, LessFilename> tmp; - getDirectoryAliasesRecursive(dirname, tmp); + getDirectoryAliasesRecursive(dirpath, tmp); - tmp.erase(dirname); + tmp.erase(dirpath); tmp.erase(Zstring()); return std::vector<Zstring>(tmp.begin(), tmp.end()); } -Zstring zen::getFormattedDirectoryName(const Zstring& dirString) // throw() +Zstring zen::getFormattedDirectoryPath(const Zstring& dirpassPhrase) // throw() { //formatting is needed since functions expect the directory to end with '\' to be able to split the relative names. - Zstring dirname = dirString; + Zstring dirpath = dirpassPhrase; //remove leading/trailing whitespace before allowing misinterpretation in applyLongPathPrefix() - trim(dirname, true, false); - while (endsWith(dirname, Zstr(' '))) //don't remove all whitespace from right, e.g. 0xa0 may be used as part of dir name - dirname.resize(dirname.size() - 1); + trim(dirpath, true, false); + while (endsWith(dirpath, Zstr(' '))) //don't remove all whitespace from right, e.g. 0xa0 may be used as part of dir name + dirpath.resize(dirpath.size() - 1); - if (dirname.empty()) //an empty string would later be resolved as "\"; this is not desired + if (dirpath.empty()) //an empty string would later be resolved as "\"; this is not desired return Zstring(); - dirname = expandMacros(dirname); - dirname = expandVolumeName(dirname); //may block for slow USB sticks! + dirpath = expandMacros(dirpath); + dirpath = expandVolumeName(dirpath); //may block for slow USB sticks! /* need to resolve relative paths: WINDOWS: - \\?\-prefix which needs absolute names - - Volume Shadow Copy: volume name needs to be part of each filename + - Volume Shadow Copy: volume name needs to be part of each filepath - file icon buffer (at least for extensions that are actually read from disk, like "exe") - ::SHFileOperation(): Using relative path names is not thread safe WINDOWS/LINUX: - detection of dependent directories, e.g. "\" and "C:\test" */ - dirname = resolveRelativePath(dirname); + dirpath = resolveRelativePath(dirpath); - return appendSeparator(dirname); + return appendSeparator(dirpath); } #ifdef ZEN_WIN -void zen::loginNetworkShare(const Zstring& dirnameOrig, bool allowUserInteraction) //throw() - user interaction: show OS password prompt +void zen::loginNetworkShare(const Zstring& dirpathOrig, bool allowUserInteraction) //throw() - user interaction: show OS password prompt { /* ATTENTION: it is not safe to retrieve UNC path via ::WNetGetConnection() for every type of network share: @@ -646,13 +646,13 @@ void zen::loginNetworkShare(const Zstring& dirnameOrig, bool allowUserInteractio }; - Zstring dirname = removeLongPathPrefix(dirnameOrig); - trim(dirname, true, false); + Zstring dirpath = removeLongPathPrefix(dirpathOrig); + trim(dirpath, true, false); //1. locally mapped network share - if (dirname.size() >= 2 && iswalpha(dirname[0]) && dirname[1] == L':') + if (dirpath.size() >= 2 && iswalpha(dirpath[0]) && dirpath[1] == L':') { - Zstring driveLetter(dirname.c_str(), 2); //e.g.: "Q:" + Zstring driveLetter(dirpath.c_str(), 2); //e.g.: "Q:" { DWORD bufferSize = 10000; std::vector<wchar_t> remoteNameBuffer(bufferSize); @@ -681,15 +681,15 @@ void zen::loginNetworkShare(const Zstring& dirnameOrig, bool allowUserInteractio } } //2. deviceless network connection - else if (startsWith(dirname, L"\\\\")) //UNC path + else if (startsWith(dirpath, L"\\\\")) //UNC path { const Zstring networkShare = [&]() -> Zstring //extract prefix "\\server\share" { - size_t pos = dirname.find('\\', 2); + size_t pos = dirpath.find('\\', 2); if (pos == Zstring::npos) return Zstring(); - pos = dirname.find('\\', pos + 1); - return pos == Zstring::npos ? dirname : Zstring(dirname.c_str(), pos); + pos = dirpath.find('\\', pos + 1); + return pos == Zstring::npos ? dirpath : Zstring(dirpath.c_str(), pos); }(); if (!networkShare.empty()) diff --git a/FreeFileSync/Source/lib/resolve_path.h b/FreeFileSync/Source/lib/resolve_path.h index d9ec28bc..9533cd9d 100644 --- a/FreeFileSync/Source/lib/resolve_path.h +++ b/FreeFileSync/Source/lib/resolve_path.h @@ -19,16 +19,16 @@ FULL directory format: - convert relative paths into absolute - trim whitespace and append file name separator */ -Zstring getFormattedDirectoryName(const Zstring& dirString); //noexcept; may still block for slow USB sticks! not thread-safe!!! see ::GetFullPathName() +Zstring getFormattedDirectoryPath(const Zstring& dirpathPhrase); //noexcept; may still block for slow USB sticks! not thread-safe!!! see ::GetFullPathName() //macro substitution only Zstring expandMacros(const Zstring& text); -std::vector<Zstring> getDirectoryAliases(const Zstring& dirString); //may block for slow USB sticks when resolving [<volume name>] +std::vector<Zstring> getDirectoryAliases(const Zstring& dirpassPhrase); //may block for slow USB sticks when resolving [<volume name>] #ifdef ZEN_WIN //*blocks* if network is not reachable or when showing login prompt dialog! -void loginNetworkShare(const Zstring& dirname, bool allowUserInteraction); //noexcept; user interaction: show OS password prompt +void loginNetworkShare(const Zstring& dirpath, bool allowUserInteraction); //noexcept; user interaction: show OS password prompt #endif } diff --git a/FreeFileSync/Source/lib/soft_filter.h b/FreeFileSync/Source/lib/soft_filter.h index 010a8913..db3f31ed 100644 --- a/FreeFileSync/Source/lib/soft_filter.h +++ b/FreeFileSync/Source/lib/soft_filter.h @@ -10,7 +10,6 @@ #include <algorithm> #include <limits> #include "../structures.h" -//#include <wx/stopwatch.h> namespace zen { @@ -28,8 +27,8 @@ public: size_t sizeMin, UnitSize unitSizeMin, size_t sizeMax, UnitSize unitSizeMax); - bool matchTime(Int64 writeTime) const { return timeFrom_ <= writeTime; } - bool matchSize(UInt64 fileSize) const { return sizeMin_ <= fileSize && fileSize <= sizeMax_; } + bool matchTime(std::int64_t writeTime) const { return timeFrom_ <= writeTime; } + bool matchSize(std::uint64_t fileSize) const { return sizeMin_ <= fileSize && fileSize <= sizeMax_; } bool matchFolder() const { return matchesFolder_; } bool isNull() const; //filter is equivalent to NullFilter, but may be technically slower @@ -37,15 +36,15 @@ public: friend SoftFilter combineFilters(const SoftFilter& first, const SoftFilter& second); private: - SoftFilter(const Int64& timeFrom, - const UInt64& sizeMin, - const UInt64& sizeMax, + SoftFilter(std::int64_t timeFrom, + std::uint64_t sizeMin, + std::uint64_t sizeMax, bool matchesFolder); - Int64 timeFrom_; //unit: UTC, seconds - UInt64 sizeMin_; //unit: bytes - UInt64 sizeMax_; //unit: bytes - bool matchesFolder_; + std::int64_t timeFrom_; //unit: UTC, seconds + std::uint64_t sizeMin_; //unit: bytes + std::uint64_t sizeMax_; //unit: bytes + const bool matchesFolder_; }; } @@ -68,6 +67,9 @@ inline SoftFilter::SoftFilter(size_t timeSpan, UnitTime unitTimeSpan, size_t sizeMin, UnitSize unitSizeMin, size_t sizeMax, UnitSize unitSizeMax) : + timeFrom_(), + sizeMin_ (), + sizeMax_ (), matchesFolder_(unitTimeSpan == UTIME_NONE&& unitSizeMin == USIZE_NONE&& unitSizeMax == USIZE_NONE) //exclude folders if size or date filter is active: avoids creating empty folders if not needed! @@ -81,9 +83,9 @@ SoftFilter::SoftFilter(size_t timeSpan, UnitTime unitTimeSpan, } inline -SoftFilter::SoftFilter(const Int64& timeFrom, - const UInt64& sizeMin, - const UInt64& sizeMax, +SoftFilter::SoftFilter(std::int64_t timeFrom, + std::uint64_t sizeMin, + std::uint64_t sizeMax, bool matchesFolder) : timeFrom_(timeFrom), sizeMin_ (sizeMin), @@ -102,9 +104,9 @@ SoftFilter combineFilters(const SoftFilter& lhs, const SoftFilter& rhs) inline bool SoftFilter::isNull() const //filter is equivalent to NullFilter, but may be technically slower { - return timeFrom_ == std::numeric_limits<Int64>::min() && + return timeFrom_ == std::numeric_limits<std::int64_t>::min() && sizeMin_ == 0U && - sizeMax_ == std::numeric_limits<UInt64>::max() && + sizeMax_ == std::numeric_limits<std::uint64_t>::max() && matchesFolder_ == true;; } } diff --git a/FreeFileSync/Source/lib/status_handler.cpp b/FreeFileSync/Source/lib/status_handler.cpp index 5fb80161..74872010 100644 --- a/FreeFileSync/Source/lib/status_handler.cpp +++ b/FreeFileSync/Source/lib/status_handler.cpp @@ -5,7 +5,6 @@ // ************************************************************************** #include "status_handler.h" -//#include <wx/app.h> #include <zen/tick_count.h> using namespace zen; diff --git a/FreeFileSync/Source/lib/status_handler.h b/FreeFileSync/Source/lib/status_handler.h index d775ee65..fd0c3cb6 100644 --- a/FreeFileSync/Source/lib/status_handler.h +++ b/FreeFileSync/Source/lib/status_handler.h @@ -10,7 +10,6 @@ #include "../process_callback.h" #include <vector> #include <string> -#include <zen/int64.h> #include <zen/i18n.h> namespace zen @@ -42,8 +41,8 @@ struct Statistics virtual int getObjectsCurrent(ProcessCallback::Phase phaseId) const = 0; virtual int getObjectsTotal (ProcessCallback::Phase phaseId) const = 0; - virtual Int64 getDataCurrent(ProcessCallback::Phase phaseId) const = 0; - virtual Int64 getDataTotal (ProcessCallback::Phase phaseId) const = 0; + virtual std::int64_t getDataCurrent(ProcessCallback::Phase phaseId) const = 0; + virtual std::int64_t getDataTotal (ProcessCallback::Phase phaseId) const = 0; virtual const std::wstring& currentStatusText() const = 0; }; @@ -60,14 +59,14 @@ public: protected: //implement parts of ProcessCallback - virtual void initNewPhase(int objectsTotal, Int64 dataTotal, Phase phaseId) //may throw + virtual void initNewPhase(int objectsTotal, std::int64_t dataTotal, Phase phaseId) //may throw { currentPhase_ = phaseId; refNumbers(numbersTotal_, currentPhase_) = std::make_pair(objectsTotal, dataTotal); } - virtual void updateProcessedData(int objectsDelta, Int64 dataDelta) { updateData(numbersCurrent_, objectsDelta, dataDelta); } //note: these methods MUST NOT throw in order - virtual void updateTotalData (int objectsDelta, Int64 dataDelta) { updateData(numbersTotal_ , objectsDelta, dataDelta); } //to properly allow undoing setting of statistics! + virtual void updateProcessedData(int objectsDelta, std::int64_t dataDelta) { updateData(numbersCurrent_, objectsDelta, dataDelta); } //note: these methods MUST NOT throw in order + virtual void updateTotalData (int objectsDelta, std::int64_t dataDelta) { updateData(numbersTotal_ , objectsDelta, dataDelta); } //to properly allow undoing setting of statistics! virtual void requestUiRefresh() //throw X { @@ -96,24 +95,24 @@ protected: virtual int getObjectsCurrent(Phase phaseId) const { return refNumbers(numbersCurrent_, phaseId).first; } virtual int getObjectsTotal (Phase phaseId) const { assert(phaseId != PHASE_SCANNING); return refNumbers(numbersTotal_ , phaseId).first; } - virtual Int64 getDataCurrent(Phase phaseId) const { assert(phaseId != PHASE_SCANNING); return refNumbers(numbersCurrent_, phaseId).second; } - virtual Int64 getDataTotal (Phase phaseId) const { assert(phaseId != PHASE_SCANNING); return refNumbers(numbersTotal_ , phaseId).second; } + virtual std::int64_t getDataCurrent(Phase phaseId) const { assert(phaseId != PHASE_SCANNING); return refNumbers(numbersCurrent_, phaseId).second; } + virtual std::int64_t getDataTotal (Phase phaseId) const { assert(phaseId != PHASE_SCANNING); return refNumbers(numbersTotal_ , phaseId).second; } virtual const std::wstring& currentStatusText() const { return statusText_; } bool abortIsRequested() const { return abortRequested; } private: - typedef std::vector<std::pair<int, Int64>> StatNumbers; + typedef std::vector<std::pair<int, std::int64_t>> StatNumbers; - void updateData(StatNumbers& num, int objectsDelta, Int64 dataDelta) + void updateData(StatNumbers& num, int objectsDelta, std::int64_t dataDelta) { auto& st = refNumbers(num, currentPhase_); st.first += objectsDelta; st.second += dataDelta; } - static const std::pair<int, Int64>& refNumbers(const StatNumbers& num, Phase phaseId) + static const std::pair<int, std::int64_t>& refNumbers(const StatNumbers& num, Phase phaseId) { switch (phaseId) { @@ -130,7 +129,7 @@ private: return num[3]; //dummy entry! } - static std::pair<int, Int64>& refNumbers(StatNumbers& num, Phase phaseId) { return const_cast<std::pair<int, Int64>&>(refNumbers(static_cast<const StatNumbers&>(num), phaseId)); } + static std::pair<int, std::int64_t>& refNumbers(StatNumbers& num, Phase phaseId) { return const_cast<std::pair<int, std::int64_t>&>(refNumbers(static_cast<const StatNumbers&>(num), phaseId)); } Phase currentPhase_; StatNumbers numbersCurrent_; diff --git a/FreeFileSync/Source/lib/status_handler_impl.h b/FreeFileSync/Source/lib/status_handler_impl.h index 280fe9ae..7ec491fb 100644 --- a/FreeFileSync/Source/lib/status_handler_impl.h +++ b/FreeFileSync/Source/lib/status_handler_impl.h @@ -39,9 +39,10 @@ zen::Opt<std::wstring> tryReportingError(Function cmd, ProcessCallback& handler) class StatisticsReporter { public: - StatisticsReporter(int itemsExpected, const Int64& bytesExpected, ProcessCallback& cb) : + StatisticsReporter(int itemsExpected, std::int64_t bytesExpected, ProcessCallback& cb) : taskCancelled(true), - itemsReported(0), + itemsReported(), + bytesReported(), itemsExpected_(itemsExpected), bytesExpected_(bytesExpected), cb_(cb) {} @@ -52,7 +53,7 @@ public: cb_.updateTotalData(itemsReported, bytesReported); //=> unexpected increase of total workload } - void reportDelta(int itemsDelta, const Int64& bytesDelta) //may throw! + void reportDelta(int itemsDelta, std::int64_t bytesDelta) //may throw! { cb_.updateProcessedData(itemsDelta, bytesDelta); //nothrow! -> ensure client and service provider are in sync! itemsReported += itemsDelta; @@ -85,9 +86,9 @@ public: private: bool taskCancelled; int itemsReported; - Int64 bytesReported; + std::int64_t bytesReported; const int itemsExpected_; - const Int64 bytesExpected_; + const std::int64_t bytesExpected_; ProcessCallback& cb_; }; } diff --git a/FreeFileSync/Source/lib/versioning.cpp b/FreeFileSync/Source/lib/versioning.cpp index bc24b8d4..9da6bdf0 100644 --- a/FreeFileSync/Source/lib/versioning.cpp +++ b/FreeFileSync/Source/lib/versioning.cpp @@ -10,12 +10,12 @@ using namespace zen; namespace { -Zstring getExtension(const Zstring& relativeName) //including "." if extension is existing, returns empty string otherwise +Zstring getExtension(const Zstring& relativePath) //including "." if extension is existing, returns empty string otherwise { - auto iterSep = find_last(relativeName.begin(), relativeName.end(), FILE_NAME_SEPARATOR); - auto iterName = iterSep != relativeName.end() ? iterSep + 1 : relativeName.begin(); //find beginning of short name - auto iterDot = find_last(iterName, relativeName.end(), Zstr('.')); //equal to relativeName.end() if file has no extension!! - return Zstring(&*iterDot, relativeName.end() - iterDot); + auto iterSep = find_last(relativePath.begin(), relativePath.end(), FILE_NAME_SEPARATOR); + auto iterName = iterSep != relativePath.end() ? iterSep + 1 : relativePath.begin(); //find beginning of short name + auto iterDot = find_last(iterName, relativePath.end(), Zstr('.')); //equal to relativePath.end() if file has no extension!! + return Zstring(&*iterDot, relativePath.end() - iterDot); }; } @@ -74,45 +74,45 @@ namespace - create target super directories if missing */ template <class Function> -void moveItemToVersioning(const Zstring& fullName, //throw FileError - const Zstring& relativeName, +void moveItemToVersioning(const Zstring& itempath, //throw FileError + const Zstring& relativePath, const Zstring& versioningDirectory, const Zstring& timestamp, VersioningStyle versioningStyle, Function moveObj) //move source -> target; may throw FileError { - assert(!startsWith(relativeName, FILE_NAME_SEPARATOR)); - assert(!endsWith (relativeName, FILE_NAME_SEPARATOR)); + assert(!startsWith(relativePath, FILE_NAME_SEPARATOR)); + assert(!endsWith (relativePath, FILE_NAME_SEPARATOR)); - Zstring targetName; + Zstring targetPath; switch (versioningStyle) { case VER_STYLE_REPLACE: - targetName = appendSeparator(versioningDirectory) + relativeName; + targetPath = appendSeparator(versioningDirectory) + relativePath; break; case VER_STYLE_ADD_TIMESTAMP: //assemble time-stamped version name - targetName = appendSeparator(versioningDirectory) + relativeName + Zstr(' ') + timestamp + getExtension(relativeName); - assert(impl::isMatchingVersion(afterLast(relativeName, FILE_NAME_SEPARATOR), afterLast(targetName, FILE_NAME_SEPARATOR))); //paranoid? no! + targetPath = appendSeparator(versioningDirectory) + relativePath + Zstr(' ') + timestamp + getExtension(relativePath); + assert(impl::isMatchingVersion(afterLast(relativePath, FILE_NAME_SEPARATOR), afterLast(targetPath, FILE_NAME_SEPARATOR))); //paranoid? no! break; } try { - moveObj(fullName, targetName); //throw FileError + moveObj(itempath, targetPath); //throw FileError } catch (FileError&) //expected to fail if target directory is not yet existing! { - if (!somethingExists(fullName)) //no source at all is not an error (however a directory as source when a file is expected, *is* an error!) + if (!somethingExists(itempath)) //no source at all is not an error (however a directory as source when a file is expected, *is* an error!) return; //object *not* processed //create intermediate directories if missing - const Zstring targetDir = beforeLast(targetName, FILE_NAME_SEPARATOR); + const Zstring targetDir = beforeLast(targetPath, FILE_NAME_SEPARATOR); if (!dirExists(targetDir)) //->(minor) file system race condition! { makeDirectory(targetDir); //throw FileError - moveObj(fullName, targetName); //throw FileError -> this should work now! + moveObj(itempath, targetPath); //throw FileError -> this should work now! } else throw; @@ -168,7 +168,7 @@ void moveObject(const Zstring& sourceFile, //throw FileError void moveFile(const Zstring& sourceFile, //throw FileError const Zstring& targetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus) //may be nullptr + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus) //may be nullptr { auto copyDelete = [&] { @@ -210,21 +210,21 @@ public: TraverseFilesOneLevel(std::vector<Zstring>& files, std::vector<Zstring>& dirs) : files_(files), dirs_(dirs) {} private: - virtual void onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) + virtual void onFile(const Zchar* shortName, const Zstring& filepath, const FileInfo& details) { files_.push_back(shortName); } - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { - if (dirExists(fullName)) //dir symlink + if (dirExists(linkpath)) //dir symlink dirs_.push_back(shortName); else //file symlink, broken symlink files_.push_back(shortName); return LINK_SKIP; } - virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& fullName) + virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& dirpath) { dirs_.push_back(shortName); return nullptr; //DON'T traverse into subdirs; moveDirectory works recursively! @@ -239,21 +239,21 @@ private: } -bool FileVersioner::revisionFile(const Zstring& fullName, const Zstring& relativeName, const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus) //throw FileError +bool FileVersioner::revisionFile(const Zstring& filepath, const Zstring& relativePath, const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus) //throw FileError { - return revisionFileImpl(fullName, relativeName, nullptr, onUpdateCopyStatus); //throw FileError + return revisionFileImpl(filepath, relativePath, nullptr, onUpdateCopyStatus); //throw FileError } -bool FileVersioner::revisionFileImpl(const Zstring& fullName, //throw FileError - const Zstring& relativeName, +bool FileVersioner::revisionFileImpl(const Zstring& filepath, //throw FileError + const Zstring& relativePath, const std::function<void(const Zstring& fileFrom, const Zstring& fileTo)>& onBeforeFileMove, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus) + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus) { bool moveSuccessful = false; - moveItemToVersioning(fullName, //throw FileError - relativeName, + moveItemToVersioning(filepath, //throw FileError + relativePath, versioningDirectory_, timeStamp_, versioningStyle_, @@ -270,30 +270,30 @@ bool FileVersioner::revisionFileImpl(const Zstring& fullName, //throw FileError } -void FileVersioner::revisionDir(const Zstring& fullName, const Zstring& relativeName, //throw FileError +void FileVersioner::revisionDir(const Zstring& dirpath, const Zstring& relativePath, //throw FileError const std::function<void(const Zstring& fileFrom, const Zstring& fileTo)>& onBeforeFileMove, const std::function<void(const Zstring& dirFrom, const Zstring& dirTo )>& onBeforeDirMove, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus) + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus) { //no error situation if directory is not existing! manual deletion relies on it! - if (!somethingExists(fullName)) + if (!somethingExists(dirpath)) return; //neither directory nor any other object (e.g. broken symlink) with that name existing - revisionDirImpl(fullName, relativeName, onBeforeFileMove, onBeforeDirMove, onUpdateCopyStatus); //throw FileError + revisionDirImpl(dirpath, relativePath, onBeforeFileMove, onBeforeDirMove, onUpdateCopyStatus); //throw FileError } -void FileVersioner::revisionDirImpl(const Zstring& fullName, const Zstring& relativeName, //throw FileError +void FileVersioner::revisionDirImpl(const Zstring& dirpath, const Zstring& relativePath, //throw FileError const std::function<void(const Zstring& fileFrom, const Zstring& fileTo)>& onBeforeFileMove, const std::function<void(const Zstring& dirFrom, const Zstring& dirTo )>& onBeforeDirMove, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus) + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus) { - assert(somethingExists(fullName)); //[!] + assert(somethingExists(dirpath)); //[!] //create target - if (symlinkExists(fullName)) //on Linux there is just one type of symlink, and since we do revision file symlinks, we should revision dir symlinks as well! + if (symlinkExists(dirpath)) //on Linux there is just one type of symlink, and since we do revision file symlinks, we should revision dir symlinks as well! { - moveItemToVersioning(fullName, //throw FileError - relativeName, + moveItemToVersioning(dirpath, //throw FileError + relativePath, versioningDirectory_, timeStamp_, versioningStyle_, @@ -306,9 +306,9 @@ void FileVersioner::revisionDirImpl(const Zstring& fullName, const Zstring& rela } else { - assert(!startsWith(relativeName, FILE_NAME_SEPARATOR)); - assert(endsWith(fullName, relativeName)); //usually, yes, but we might relax this in the future - const Zstring targetDir = appendSeparator(versioningDirectory_) + relativeName; + assert(!startsWith(relativePath, FILE_NAME_SEPARATOR)); + assert(endsWith(dirpath, relativePath)); //usually, yes, but we might relax this in the future + const Zstring targetDir = appendSeparator(versioningDirectory_) + relativePath; //makeDirectory(targetDir); //FileError -> create only when needed in moveFileToVersioning(); avoids empty directories @@ -317,28 +317,28 @@ void FileVersioner::revisionDirImpl(const Zstring& fullName, const Zstring& rela std::vector<Zstring> dirList; // { TraverseFilesOneLevel tol(fileList, dirList); //throw FileError - traverseFolder(fullName, tol); // + traverseFolder(dirpath, tol); // } - const Zstring fullNamePf = appendSeparator(fullName); - const Zstring relnamePf = appendSeparator(relativeName); + const Zstring dirpathPf = appendSeparator(dirpath); + const Zstring relpathPf = appendSeparator(relativePath); //move files for (const Zstring& shortname : fileList) - revisionFileImpl(fullNamePf + shortname, //throw FileError - relnamePf + shortname, + revisionFileImpl(dirpathPf + shortname, //throw FileError + relpathPf + shortname, onBeforeFileMove, onUpdateCopyStatus); //move items in subdirectories for (const Zstring& shortname : dirList) - revisionDirImpl(fullNamePf + shortname, //throw FileError - relnamePf + shortname, + revisionDirImpl(dirpathPf + shortname, //throw FileError + relpathPf + shortname, onBeforeFileMove, onBeforeDirMove, onUpdateCopyStatus); //delete source if (onBeforeDirMove) - onBeforeDirMove(fullName, targetDir); - removeDirectory(fullName); //throw FileError + onBeforeDirMove(dirpath, targetDir); + removeDirectory(dirpath); //throw FileError } } @@ -352,9 +352,9 @@ public: TraverseVersionsOneLevel(std::vector<Zstring>& files, std::function<void()> updateUI) : files_(files), updateUI_(updateUI) {} private: - virtual void onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) { files_.push_back(shortName); updateUI_(); } - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) { files_.push_back(shortName); updateUI_(); return LINK_SKIP; } - virtual std::shared_ptr<TraverseCallback> onDir(const Zchar* shortName, const Zstring& fullName) { updateUI_(); return nullptr; } //DON'T traverse into subdirs + virtual void onFile(const Zchar* shortName, const Zstring& filepath, const FileInfo& details) { files_.push_back(shortName); updateUI_(); } + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { files_.push_back(shortName); updateUI_(); return LINK_SKIP; } + virtual std::shared_ptr<TraverseCallback> onDir(const Zchar* shortName, const Zstring& dirpath) { updateUI_(); return nullptr; } //DON'T traverse into subdirs virtual HandleError reportDirError (const std::wstring& msg) { throw FileError(msg); } virtual HandleError reportItemError(const std::wstring& msg, const Zchar* shortName) { throw FileError(msg); } @@ -371,28 +371,28 @@ void FileVersioner::limitVersions(std::function<void()> updateUI) //throw FileEr //buffer map "directory |-> list of immediate child file and symlink short names" std::map<Zstring, std::vector<Zstring>, LessFilename> dirBuffer; - auto getVersionsBuffered = [&](const Zstring& dirname) -> const std::vector<Zstring>& + auto getVersionsBuffered = [&](const Zstring& dirpath) -> const std::vector<Zstring>& { - auto it = dirBuffer.find(dirname); + auto it = dirBuffer.find(dirpath); if (it != dirBuffer.end()) return it->second; std::vector<Zstring> fileShortNames; TraverseVersionsOneLevel tol(fileShortNames, updateUI); //throw FileError - traverseFolder(dirname, tol); + traverseFolder(dirpath, tol); - auto& newEntry = dirBuffer[dirname]; //transactional behavior!!! + auto& newEntry = dirBuffer[dirpath]; //transactional behavior!!! newEntry.swap(fileShortNames); //-> until C++11 emplace is available return newEntry; }; std::for_each(fileRelNames.begin(), fileRelNames.end(), - [&](const Zstring& relativeName) //e.g. "subdir\Sample.txt" + [&](const Zstring& relativePath) //e.g. "subdir\Sample.txt" { - const Zstring fullname = appendSeparator(versioningDirectory_) + relativeName; //e.g. "D:\Revisions\subdir\Sample.txt" - const Zstring parentDir = beforeLast(fullname, FILE_NAME_SEPARATOR); //e.g. "D:\Revisions\subdir" - const Zstring shortname = afterLast(relativeName, FILE_NAME_SEPARATOR); //e.g. "Sample.txt"; returns the whole string if seperator not found + const Zstring filepath = appendSeparator(versioningDirectory_) + relativePath; //e.g. "D:\Revisions\subdir\Sample.txt" + const Zstring parentDir = beforeLast(filepath, FILE_NAME_SEPARATOR); //e.g. "D:\Revisions\subdir" + const Zstring shortname = afterLast(relativePath, FILE_NAME_SEPARATOR); //e.g. "Sample.txt"; returns the whole string if seperator not found const std::vector<Zstring>& allVersions = getVersionsBuffered(parentDir); diff --git a/FreeFileSync/Source/lib/versioning.h b/FreeFileSync/Source/lib/versioning.h index bc406ff0..38bb6189 100644 --- a/FreeFileSync/Source/lib/versioning.h +++ b/FreeFileSync/Source/lib/versioning.h @@ -11,7 +11,6 @@ #include <functional> #include <zen/time.h> #include <zen/zstring.h> -#include <zen/int64.h> #include <zen/file_error.h> #include "../structures.h" @@ -26,7 +25,7 @@ namespace zen - handles symlinks - replaces already existing target files/dirs (supports retry) => (unlikely) risk of data loss for naming convention "versioning": - race-condition if two FFS instances start at the very same second OR multiple folder pairs process the same filename!! + race-condition if two FFS instances start at the very same second OR multiple folder pairs process the same filepath!! */ class FileVersioner @@ -43,31 +42,31 @@ public: throw FileError(_("Unable to create time stamp for versioning:") + L" \"" + timeStamp_ + L"\""); } - bool revisionFile(const Zstring& fullName, //throw FileError; return "false" if file is not existing - const Zstring& relativeName, + bool revisionFile(const Zstring& filepath, //throw FileError; return "false" if file is not existing + const Zstring& relativePath, //called frequently if move has to revert to copy + delete => see zen::copyFile for limitations when throwing exceptions! - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus); //may be nullptr + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus); //may be nullptr - void revisionDir (const Zstring& fullName, const Zstring& relativeName, //throw FileError + void revisionDir (const Zstring& dirpath, const Zstring& relativePath, //throw FileError //optional callbacks: may be nullptr const std::function<void(const Zstring& fileFrom, const Zstring& fileTo)>& onBeforeFileMove, //one call for each *existing* object! const std::function<void(const Zstring& dirFrom, const Zstring& dirTo )>& onBeforeDirMove, // //called frequently if move has to revert to copy + delete => see zen::copyFile for limitations when throwing exceptions! - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus); + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus); //void limitVersions(std::function<void()> updateUI); //throw FileError; call when done revisioning! private: - bool revisionFileImpl(const Zstring& fullName, const Zstring& relativeName, + bool revisionFileImpl(const Zstring& filepath, const Zstring& relativePath, const std::function<void(const Zstring& fileFrom, const Zstring& fileTo)>& onBeforeFileMove, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus); //throw FileError + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus); //throw FileError - void revisionDirImpl (const Zstring& fullName, const Zstring& relativeName, + void revisionDirImpl (const Zstring& filepath, const Zstring& relativePath, const std::function<void(const Zstring& fileFrom, const Zstring& fileTo)>& onBeforeFileMove, const std::function<void(const Zstring& dirFrom, const Zstring& dirTo )>& onBeforeDirMove, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus); //throw FileError + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus); //throw FileError const VersioningStyle versioningStyle_; const Zstring versioningDirectory_; diff --git a/FreeFileSync/Source/process_callback.h b/FreeFileSync/Source/process_callback.h index 909acf16..f75110ce 100644 --- a/FreeFileSync/Source/process_callback.h +++ b/FreeFileSync/Source/process_callback.h @@ -8,7 +8,7 @@ #define PROC_HEADER_48257827842345454545 #include <string> -#include <zen/int64.h> +#include <cstdint> //interface for comparison and synchronization process status updates (used by GUI or Batch mode) const int UI_UPDATE_INTERVAL = 100; //unit: [ms]; perform ui updates not more often than necessary, @@ -30,12 +30,12 @@ struct ProcessCallback PHASE_COMPARING_CONTENT, PHASE_SYNCHRONIZING }; - virtual void initNewPhase(int objectsTotal, zen::Int64 dataTotal, Phase phaseId) = 0; //throw ?; informs about the estimated amount of data that will be processed in this phase + virtual void initNewPhase(int objectsTotal, std::int64_t dataTotal, Phase phaseId) = 0; //throw ?; informs about the estimated amount of data that will be processed in this phase //note: this one must NOT throw in order to properly allow undoing setting of statistics! //it is in general paired with a call to requestUiRefresh() to compensate! - virtual void updateProcessedData(int objectsDelta, zen::Int64 dataDelta) = 0; //noexcept!! - virtual void updateTotalData (int objectsDelta, zen::Int64 dataDelta) = 0; // + virtual void updateProcessedData(int objectsDelta, std::int64_t dataDelta) = 0; //noexcept!! + virtual void updateTotalData (int objectsDelta, std::int64_t dataDelta) = 0; // /*the estimated and actual total workload may change *during* sync: 1. file cannot be moved -> fallback to copy + delete 2. file copy, actual size changed after comparison diff --git a/FreeFileSync/Source/structures.cpp b/FreeFileSync/Source/structures.cpp index b3bff7e8..fa9c8b16 100644 --- a/FreeFileSync/Source/structures.cpp +++ b/FreeFileSync/Source/structures.cpp @@ -219,9 +219,6 @@ std::wstring zen::getSymbol(SyncOperation op) namespace { -assert_static(std::numeric_limits<zen:: Int64>::is_specialized); -assert_static(std::numeric_limits<zen::UInt64>::is_specialized); - /* int daysSinceBeginOfWeek(int dayOfWeek) //0-6, 0=Monday, 6=Sunday { @@ -244,7 +241,7 @@ int daysSinceBeginOfWeek(int dayOfWeek) //0-6, 0=Monday, 6=Sunday */ -Int64 resolve(size_t value, UnitTime unit, Int64 defaultVal) +std::int64_t resolve(size_t value, UnitTime unit, std::int64_t defaultVal) { TimeComp locTimeStruc = zen::localTime(); @@ -269,7 +266,7 @@ Int64 resolve(size_t value, UnitTime unit, Int64 defaultVal) // int dayOfWeek = (localTimeFmt->tm_wday + 6) % 7; //tm_wday := days since Sunday 0-6 // // +6 == -1 in Z_7 - // return Int64(timeFrom) - daysSinceBeginOfWeek(dayOfWeek) * 24 * 3600; + // return std::int64_t(timeFrom) - daysSinceBeginOfWeek(dayOfWeek) * 24 * 3600; //} case UTIME_THIS_MONTH: @@ -291,7 +288,7 @@ Int64 resolve(size_t value, UnitTime unit, Int64 defaultVal) locTimeStruc.second = 0; //0-61 locTimeStruc.minute = 0; //0-59 locTimeStruc.hour = 0; //0-23 - return localToTimeT(locTimeStruc) - Int64(value) * 24 * 3600; + return localToTimeT(locTimeStruc) - std::int64_t(value) * 24 * 3600; } assert(false); @@ -299,9 +296,9 @@ Int64 resolve(size_t value, UnitTime unit, Int64 defaultVal) } -UInt64 resolve(size_t value, UnitSize unit, UInt64 defaultVal) +std::uint64_t resolve(size_t value, UnitSize unit, std::uint64_t defaultVal) { - const UInt64 maxVal =std::numeric_limits<zen::UInt64>::max(); + const std::uint64_t maxVal = std::numeric_limits<std::uint64_t>::max(); switch (unit) { @@ -324,13 +321,13 @@ UInt64 resolve(size_t value, UnitSize unit, UInt64 defaultVal) void zen::resolveUnits(size_t timeSpan, UnitTime unitTimeSpan, size_t sizeMin, UnitSize unitSizeMin, size_t sizeMax, UnitSize unitSizeMax, - zen::Int64& timeFrom, //unit: UTC time, seconds - zen::UInt64& sizeMinBy, //unit: bytes - zen::UInt64& sizeMaxBy) //unit: bytes + std::int64_t& timeFrom, //unit: UTC time, seconds + std::uint64_t& sizeMinBy, //unit: bytes + std::uint64_t& sizeMaxBy) //unit: bytes { - timeFrom = resolve(timeSpan, unitTimeSpan, std::numeric_limits<Int64>::min()); + timeFrom = resolve(timeSpan, unitTimeSpan, std::numeric_limits<std::int64_t>::min()); sizeMinBy = resolve(sizeMin, unitSizeMin, 0U); - sizeMaxBy = resolve(sizeMax, unitSizeMax, std::numeric_limits<UInt64>::max()); + sizeMaxBy = resolve(sizeMax, unitSizeMax, std::numeric_limits<std::uint64_t>::max()); } @@ -350,9 +347,9 @@ FilterConfig mergeFilterConfig(const FilterConfig& global, const FilterConfig& l trim(out.excludeFilter, true, false); //soft filter - Int64 loctimeFrom; - UInt64 locSizeMinBy; - UInt64 locSizeMaxBy; + std::int64_t loctimeFrom = 0; + std::uint64_t locSizeMinBy = 0; + std::uint64_t locSizeMaxBy = 0; resolveUnits(out.timeSpan, out.unitTimeSpan, out.sizeMin, out.unitSizeMin, out.sizeMax, out.unitSizeMax, @@ -361,9 +358,9 @@ FilterConfig mergeFilterConfig(const FilterConfig& global, const FilterConfig& l locSizeMaxBy); //unit: bytes //soft filter - Int64 glotimeFrom; - UInt64 gloSizeMinBy; - UInt64 gloSizeMaxBy; + std::int64_t glotimeFrom = 0; + std::uint64_t gloSizeMinBy = 0; + std::uint64_t gloSizeMaxBy = 0; resolveUnits(global.timeSpan, global.unitTimeSpan, global.sizeMin, global.unitSizeMin, global.sizeMax, global.unitSizeMax, @@ -393,12 +390,12 @@ FilterConfig mergeFilterConfig(const FilterConfig& global, const FilterConfig& l inline bool effectivelyEmpty(const FolderPairEnh& fp) { - auto isEmpty = [](Zstring dirname) + auto isEmpty = [](Zstring dirpath) { - trim(dirname); - return dirname.empty(); + trim(dirpath); + return dirpath.empty(); }; - return isEmpty(fp.dirnamePhraseLeft) && isEmpty(fp.dirnamePhraseRight); + return isEmpty(fp.dirpathPhraseLeft) && isEmpty(fp.dirpathPhraseRight); } } diff --git a/FreeFileSync/Source/structures.h b/FreeFileSync/Source/structures.h index 45e856a6..bf0f3baf 100644 --- a/FreeFileSync/Source/structures.h +++ b/FreeFileSync/Source/structures.h @@ -11,7 +11,6 @@ #include <memory> #include <zen/zstring.h> #include <zen/assert_static.h> -#include <zen/int64.h> namespace zen { @@ -178,17 +177,20 @@ struct CompConfig { CompConfig() : compareVar(CMP_BY_TIME_SIZE), - handleSymlinks(SYMLINK_EXCLUDE) {} + handleSymlinks(SYMLINK_EXCLUDE), + optTimeShiftHours(0) {} CompareVariant compareVar; SymLinkHandling handleSymlinks; + unsigned int optTimeShiftHours; //if != 0: treat modification times with this offset as equal }; inline bool operator==(const CompConfig& lhs, const CompConfig& rhs) { - return lhs.compareVar == rhs.compareVar && - lhs.handleSymlinks == rhs.handleSymlinks; + return lhs.compareVar == rhs.compareVar && + lhs.handleSymlinks == rhs.handleSymlinks && + lhs.optTimeShiftHours == rhs.optTimeShiftHours; } inline @@ -324,9 +326,9 @@ bool operator==(const FilterConfig& lhs, const FilterConfig& rhs) void resolveUnits(size_t timeSpan, UnitTime unitTimeSpan, size_t sizeMin, UnitSize unitSizeMin, size_t sizeMax, UnitSize unitSizeMax, - zen::Int64& timeFrom, //unit: UTC time, seconds - zen::UInt64& sizeMinBy, //unit: bytes - zen::UInt64& sizeMaxBy); //unit: bytes + std::int64_t& timeFrom, //unit: UTC time, seconds + std::uint64_t& sizeMinBy, //unit: bytes + std::uint64_t& sizeMaxBy); //unit: bytes struct FolderPairEnh //enhanced folder pairs with (optional) alternate configuration @@ -338,14 +340,14 @@ struct FolderPairEnh //enhanced folder pairs with (optional) alternate configura const std::shared_ptr<const CompConfig>& cmpConfig, const std::shared_ptr<const SyncConfig>& syncConfig, const FilterConfig& filter) : - dirnamePhraseLeft (phraseLeft), - dirnamePhraseRight(phraseRight), + dirpathPhraseLeft (phraseLeft), + dirpathPhraseRight(phraseRight), altCmpConfig(cmpConfig), altSyncConfig(syncConfig), localFilter(filter) {} - Zstring dirnamePhraseLeft; //unresolved directory names as entered by user! - Zstring dirnamePhraseRight; // + Zstring dirpathPhraseLeft; //unresolved directory names as entered by user! + Zstring dirpathPhraseRight; // std::shared_ptr<const CompConfig> altCmpConfig; //optional std::shared_ptr<const SyncConfig> altSyncConfig; // @@ -356,8 +358,8 @@ struct FolderPairEnh //enhanced folder pairs with (optional) alternate configura inline bool operator==(const FolderPairEnh& lhs, const FolderPairEnh& rhs) { - return lhs.dirnamePhraseLeft == rhs.dirnamePhraseLeft && - lhs.dirnamePhraseRight == rhs.dirnamePhraseRight && + return lhs.dirpathPhraseLeft == rhs.dirpathPhraseLeft && + lhs.dirpathPhraseRight == rhs.dirpathPhraseRight && (lhs.altCmpConfig.get() && rhs.altCmpConfig.get() ? *lhs.altCmpConfig == *rhs.altCmpConfig : diff --git a/FreeFileSync/Source/synchronization.cpp b/FreeFileSync/Source/synchronization.cpp index 150ec672..d2fa2cb5 100644 --- a/FreeFileSync/Source/synchronization.cpp +++ b/FreeFileSync/Source/synchronization.cpp @@ -53,6 +53,7 @@ void SyncStatistics::init() updateRight = 0; deleteLeft = 0; deleteRight = 0; + dataToProcess = 0; rowsTotal = 0; } @@ -102,12 +103,12 @@ void SyncStatistics::processFile(const FilePair& fileObj) { case SO_CREATE_NEW_LEFT: ++createLeft; - dataToProcess += to<Int64>(fileObj.getFileSize<RIGHT_SIDE>()); + dataToProcess += static_cast<std::int64_t>(fileObj.getFileSize<RIGHT_SIDE>()); break; case SO_CREATE_NEW_RIGHT: ++createRight; - dataToProcess += to<Int64>(fileObj.getFileSize<LEFT_SIDE>()); + dataToProcess += static_cast<std::int64_t>(fileObj.getFileSize<LEFT_SIDE>()); break; case SO_DELETE_LEFT: @@ -132,16 +133,16 @@ void SyncStatistics::processFile(const FilePair& fileObj) case SO_OVERWRITE_LEFT: ++updateLeft; - dataToProcess += to<Int64>(fileObj.getFileSize<RIGHT_SIDE>()); + dataToProcess += static_cast<std::int64_t>(fileObj.getFileSize<RIGHT_SIDE>()); break; case SO_OVERWRITE_RIGHT: ++updateRight; - dataToProcess += to<Int64>(fileObj.getFileSize<LEFT_SIDE>()); + dataToProcess += static_cast<std::int64_t>(fileObj.getFileSize<LEFT_SIDE>()); break; case SO_UNRESOLVED_CONFLICT: - conflictMsgs.push_back(std::make_pair(fileObj.getObjRelativeName(), fileObj.getSyncOpConflict())); + conflictMsgs.push_back(std::make_pair(fileObj.getPairRelativePath(), fileObj.getSyncOpConflict())); break; case SO_COPY_METADATA_TO_LEFT: @@ -191,7 +192,7 @@ void SyncStatistics::processLink(const SymlinkPair& linkObj) break; case SO_UNRESOLVED_CONFLICT: - conflictMsgs.push_back(std::make_pair(linkObj.getObjRelativeName(), linkObj.getSyncOpConflict())); + conflictMsgs.push_back(std::make_pair(linkObj.getPairRelativePath(), linkObj.getSyncOpConflict())); break; case SO_MOVE_LEFT_SOURCE: @@ -228,7 +229,7 @@ void SyncStatistics::processDir(const DirPair& dirObj) break; case SO_UNRESOLVED_CONFLICT: - conflictMsgs.push_back(std::make_pair(dirObj.getObjRelativeName(), dirObj.getSyncOpConflict())); + conflictMsgs.push_back(std::make_pair(dirObj.getPairRelativePath(), dirObj.getSyncOpConflict())); break; case SO_COPY_METADATA_TO_LEFT: @@ -276,7 +277,7 @@ std::vector<zen::FolderPairSyncCfg> zen::extractSyncCfg(const MainConfiguration& FolderPairSyncCfg(syncCfg.directionCfg.var == DirectionConfig::TWOWAY || detectMovedFilesEnabled(syncCfg.directionCfg), syncCfg.handleDeletion, syncCfg.versioningStyle, - getFormattedDirectoryName(syncCfg.versioningDirectory))); + getFormattedDirectoryPath(syncCfg.versioningDirectory))); } return output; } @@ -333,17 +334,17 @@ public: //clean-up temporary directory (recycle bin optimization) void tryCleanup(bool allowUserCallback = true); //throw FileError; throw X -> call this in non-exceptional coding, i.e. somewhere after sync! - template <class Function> void removeFileWithCallback (const Zstring& fullName, const Zstring& relativeName, Function onNotifyItemDeletion, const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy); // - template <class Function> void removeDirWithCallback (const Zstring& fullName, const Zstring& relativeName, Function onNotifyItemDeletion, const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy); //throw FileError - template <class Function> void removeLinkWithCallback (const Zstring& fullName, const Zstring& relativeName, Function onNotifyItemDeletion, const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy); // + template <class Function> void removeFileWithCallback (const Zstring& filepath, const Zstring& relativePath, Function onNotifyItemDeletion, const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy); // + template <class Function> void removeDirWithCallback (const Zstring& dirpath, const Zstring& relativePath, Function onNotifyItemDeletion, const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy); //throw FileError + template <class Function> void removeLinkWithCallback (const Zstring& linkpath, const Zstring& relativePath, Function onNotifyItemDeletion, const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy); // const std::wstring& getTxtRemovingFile () const { return txtRemovingFile; } // const std::wstring& getTxtRemovingSymLink() const { return txtRemovingSymlink; } //buffered status texts const std::wstring& getTxtRemovingDir () const { return txtRemovingDirectory; } // private: - DeletionHandling(const DeletionHandling&); - DeletionHandling& operator=(const DeletionHandling&); + DeletionHandling (const DeletionHandling&) = delete; + DeletionHandling& operator=(const DeletionHandling&) = delete; FileVersioner& getOrCreateVersioner() //throw FileError! => dont create in DeletionHandling()!!! { @@ -452,16 +453,16 @@ Zstring DeletionHandling::getOrCreateRecyclerTempDirPf() //throw FileError */ //ensure unique ownership: - Zstring dirname = baseDirPf_ + Zstr("RecycleBin") + TEMP_FILE_ENDING; + Zstring dirpath = baseDirPf_ + Zstr("RecycleBin") + TEMP_FILE_ENDING; for (int i = 1;; ++i) try { - makeDirectory(dirname, /*bool failIfExists*/ true); //throw FileError, ErrorTargetExisting - return dirname; + makeDirectory(dirpath, /*bool failIfExists*/ true); //throw FileError, ErrorTargetExisting + return dirpath; } catch (const ErrorTargetExisting&) { - dirname = baseDirPf_ + Zstr("RecycleBin") + Zchar('_') + numberTo<Zstring>(i) + TEMP_FILE_ENDING; + dirpath = baseDirPf_ + Zstr("RecycleBin") + Zchar('_') + numberTo<Zstring>(i) + TEMP_FILE_ENDING; } }(); } @@ -525,10 +526,10 @@ void DeletionHandling::tryCleanup(bool allowUserCallback) //throw FileError; thr template <class Function> -void DeletionHandling::removeDirWithCallback(const Zstring& fullName, - const Zstring& relativeName, +void DeletionHandling::removeDirWithCallback(const Zstring& dirpath, + const Zstring& relativePath, Function onNotifyItemDeletion, - const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy) //throw FileError + const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy) //throw FileError { switch (deletionPolicy_) { @@ -539,17 +540,17 @@ void DeletionHandling::removeDirWithCallback(const Zstring& fullName, onNotifyItemDeletion(); //it would be more correct to report *after* work was done! procCallback_.reportStatus(replaceCpy(statusText, L"%x", fmtFileName(objName))); }; - auto onBeforeFileDeletion = [&](const Zstring& filename) { notifyDeletion(txtRemovingFile, filename); }; - auto onBeforeDirDeletion = [&](const Zstring& dirname ) { notifyDeletion(txtRemovingDirectory, dirname ); }; + auto onBeforeFileDeletion = [&](const Zstring& filepath) { notifyDeletion(txtRemovingFile, filepath); }; + auto onBeforeDirDeletion = [&](const Zstring& dirpath2) { notifyDeletion(txtRemovingDirectory, dirpath2); }; - removeDirectory(fullName, onBeforeFileDeletion, onBeforeDirDeletion); + removeDirectory(dirpath, onBeforeFileDeletion, onBeforeDirDeletion); } break; case DELETE_TO_RECYCLER: { #ifdef ZEN_WIN - const Zstring targetDir = getOrCreateRecyclerTempDirPf() + relativeName; //throw FileError + const Zstring targetDir = getOrCreateRecyclerTempDirPf() + relativePath; //throw FileError bool deleted = false; auto moveToTempDir = [&] @@ -558,13 +559,13 @@ void DeletionHandling::removeDirWithCallback(const Zstring& fullName, { //performance optimization: Instead of moving each object into recycle bin separately, //we rename them one by one into a temporary directory and batch-recycle this directory after sync - renameFile(fullName, targetDir); //throw FileError, ErrorDifferentVolume + renameFile(dirpath, targetDir); //throw FileError, ErrorDifferentVolume this->toBeRecycled.push_back(targetDir); deleted = true; } catch (ErrorDifferentVolume&) //MoveFileEx() returns ERROR_PATH_NOT_FOUND *before* considering ERROR_NOT_SAME_DEVICE! => we have to create targetDir in any case! { - deleted = recycleOrDelete(fullName); //throw FileError + deleted = recycleOrDelete(dirpath); //throw FileError } }; @@ -574,7 +575,7 @@ void DeletionHandling::removeDirWithCallback(const Zstring& fullName, } catch (FileError&) { - if (somethingExists(fullName)) + if (somethingExists(dirpath)) { const Zstring targetSuperDir = beforeLast(targetDir, FILE_NAME_SEPARATOR); //what if C:\ ? if (!dirExists(targetSuperDir)) @@ -587,7 +588,7 @@ void DeletionHandling::removeDirWithCallback(const Zstring& fullName, } } #elif defined ZEN_LINUX || defined ZEN_MAC - const bool deleted = recycleOrDelete(fullName); //throw FileError + const bool deleted = recycleOrDelete(dirpath); //throw FileError #endif if (deleted) onNotifyItemDeletion(); //moving to recycler is ONE logical operation, irrespective of the number of child elements! @@ -605,7 +606,7 @@ void DeletionHandling::removeDirWithCallback(const Zstring& fullName, auto onBeforeFileMove = [&](const Zstring& fileFrom, const Zstring& fileTo) { notifyMove(txtMovingFile, fileFrom, fileTo); }; auto onBeforeDirMove = [&](const Zstring& dirFrom, const Zstring& dirTo ) { notifyMove(txtMovingFolder, dirFrom, dirTo); }; - getOrCreateVersioner().revisionDir(fullName, relativeName, onBeforeFileMove, onBeforeDirMove, onNotifyFileCopy); //throw FileError + getOrCreateVersioner().revisionDir(dirpath, relativePath, onBeforeFileMove, onBeforeDirMove, onNotifyFileCopy); //throw FileError } break; } @@ -613,26 +614,26 @@ void DeletionHandling::removeDirWithCallback(const Zstring& fullName, template <class Function> -void DeletionHandling::removeFileWithCallback(const Zstring& fullName, - const Zstring& relativeName, +void DeletionHandling::removeFileWithCallback(const Zstring& filepath, + const Zstring& relativePath, Function onNotifyItemDeletion, - const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy) //throw FileError + const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy) //throw FileError { bool deleted = false; - if (endsWith(relativeName, TEMP_FILE_ENDING)) //special rule for .ffs_tmp files: always delete permanently! - deleted = zen::removeFile(fullName); + if (endsWith(relativePath, TEMP_FILE_ENDING)) //special rule for .ffs_tmp files: always delete permanently! + deleted = zen::removeFile(filepath); else switch (deletionPolicy_) { case DELETE_PERMANENTLY: - deleted = zen::removeFile(fullName); //[!] scope specifier resolves nameclash! + deleted = zen::removeFile(filepath); //[!] scope specifier resolves nameclash! break; case DELETE_TO_RECYCLER: #ifdef ZEN_WIN { - const Zstring targetFile = getOrCreateRecyclerTempDirPf() + relativeName; //throw FileError + const Zstring targetFile = getOrCreateRecyclerTempDirPf() + relativePath; //throw FileError auto moveToTempDir = [&] { @@ -640,13 +641,13 @@ void DeletionHandling::removeFileWithCallback(const Zstring& fullName, { //performance optimization: Instead of moving each object into recycle bin separately, //we rename them one by one into a temporary directory and batch-recycle this directory after sync - renameFile(fullName, targetFile); //throw FileError, ErrorDifferentVolume + renameFile(filepath, targetFile); //throw FileError, ErrorDifferentVolume this->toBeRecycled.push_back(targetFile); deleted = true; } catch (ErrorDifferentVolume&) //MoveFileEx() returns ERROR_PATH_NOT_FOUND *before* considering ERROR_NOT_SAME_DEVICE! => we have to create targetDir in any case! { - deleted = recycleOrDelete(fullName); //throw FileError + deleted = recycleOrDelete(filepath); //throw FileError } }; @@ -656,7 +657,7 @@ void DeletionHandling::removeFileWithCallback(const Zstring& fullName, } catch (FileError&) { - if (somethingExists(fullName)) + if (somethingExists(filepath)) { const Zstring targetDir = beforeLast(targetFile, FILE_NAME_SEPARATOR); if (!dirExists(targetDir)) @@ -670,12 +671,12 @@ void DeletionHandling::removeFileWithCallback(const Zstring& fullName, } } #elif defined ZEN_LINUX || defined ZEN_MAC - deleted = recycleOrDelete(fullName); //throw FileError + deleted = recycleOrDelete(filepath); //throw FileError #endif break; case DELETE_TO_VERSIONING: - deleted = getOrCreateVersioner().revisionFile(fullName, relativeName, onNotifyFileCopy); //throw FileError + deleted = getOrCreateVersioner().revisionFile(filepath, relativePath, onNotifyFileCopy); //throw FileError break; } if (deleted) @@ -684,12 +685,12 @@ void DeletionHandling::removeFileWithCallback(const Zstring& fullName, template <class Function> inline -void DeletionHandling::removeLinkWithCallback(const Zstring& fullName, const Zstring& relativeName, Function onNotifyItemDeletion, const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy) //throw FileError +void DeletionHandling::removeLinkWithCallback(const Zstring& linkpath, const Zstring& relativePath, Function onNotifyItemDeletion, const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy) //throw FileError { - if (dirExists(fullName)) //dir symlink - return removeDirWithCallback(fullName, relativeName, onNotifyItemDeletion, onNotifyFileCopy); //throw FileError + if (dirExists(linkpath)) //dir symlink + return removeDirWithCallback(linkpath, relativePath, onNotifyItemDeletion, onNotifyFileCopy); //throw FileError else //file symlink, broken symlink - return removeFileWithCallback(fullName, relativeName, onNotifyItemDeletion, onNotifyFileCopy); //throw FileError + return removeFileWithCallback(linkpath, relativePath, onNotifyItemDeletion, onNotifyFileCopy); //throw FileError } //------------------------------------------------------------------------------------------------------------ @@ -706,7 +707,7 @@ void DeletionHandling::removeLinkWithCallback(const Zstring& fullName, const Zst class MinimumDiskSpaceNeeded { public: - static std::pair<Int64, Int64> calculate(const BaseDirPair& baseObj) + static std::pair<std::int64_t, std::int64_t> calculate(const BaseDirPair& baseObj) { MinimumDiskSpaceNeeded inst; inst.recurse(baseObj); @@ -714,7 +715,7 @@ public: } private: - MinimumDiskSpaceNeeded() {} + MinimumDiskSpaceNeeded() : spaceNeededLeft(), spaceNeededRight() {} void recurse(const HierarchyObject& hierObj) { @@ -725,33 +726,33 @@ private: switch (fileObj.getSyncOperation()) //evaluate comparison result and sync direction { case SO_CREATE_NEW_LEFT: - spaceNeededLeft += to<Int64>(fileObj.getFileSize<RIGHT_SIDE>()); + spaceNeededLeft += static_cast<std::int64_t>(fileObj.getFileSize<RIGHT_SIDE>()); break; case SO_CREATE_NEW_RIGHT: - spaceNeededRight += to<Int64>(fileObj.getFileSize<LEFT_SIDE>()); + spaceNeededRight += static_cast<std::int64_t>(fileObj.getFileSize<LEFT_SIDE>()); break; case SO_DELETE_LEFT: //if (freeSpaceDelLeft_) - spaceNeededLeft -= to<Int64>(fileObj.getFileSize<LEFT_SIDE>()); + spaceNeededLeft -= static_cast<std::int64_t>(fileObj.getFileSize<LEFT_SIDE>()); break; case SO_DELETE_RIGHT: //if (freeSpaceDelRight_) - spaceNeededRight -= to<Int64>(fileObj.getFileSize<RIGHT_SIDE>()); + spaceNeededRight -= static_cast<std::int64_t>(fileObj.getFileSize<RIGHT_SIDE>()); break; case SO_OVERWRITE_LEFT: //if (freeSpaceDelLeft_) - spaceNeededLeft -= to<Int64>(fileObj.getFileSize<LEFT_SIDE>()); - spaceNeededLeft += to<Int64>(fileObj.getFileSize<RIGHT_SIDE>()); + spaceNeededLeft -= static_cast<std::int64_t>(fileObj.getFileSize<LEFT_SIDE>()); + spaceNeededLeft += static_cast<std::int64_t>(fileObj.getFileSize<RIGHT_SIDE>()); break; case SO_OVERWRITE_RIGHT: //if (freeSpaceDelRight_) - spaceNeededRight -= to<Int64>(fileObj.getFileSize<RIGHT_SIDE>()); - spaceNeededRight += to<Int64>(fileObj.getFileSize<LEFT_SIDE>()); + spaceNeededRight -= static_cast<std::int64_t>(fileObj.getFileSize<RIGHT_SIDE>()); + spaceNeededRight += static_cast<std::int64_t>(fileObj.getFileSize<LEFT_SIDE>()); break; case SO_DO_NOTHING: @@ -774,8 +775,8 @@ private: recurse(subDir); } - Int64 spaceNeededLeft; - Int64 spaceNeededRight; + std::int64_t spaceNeededLeft; + std::int64_t spaceNeededRight; }; //---------------------------------------------------------------------------------------- @@ -861,7 +862,7 @@ private: InSyncAttributes copyFileWithCallback(const Zstring& sourceFile, const Zstring& targetFile, const std::function<void()>& onDeleteTargetFile, - const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy) const; //throw FileError + const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy) const; //throw FileError void verifyFileCopy(const Zstring& source, const Zstring& target) const; @@ -931,7 +932,7 @@ template <class List> inline bool haveNameClash(const Zstring& shortname, List& m) { return std::any_of(m.begin(), m.end(), - [&](const typename List::value_type& obj) { return EqualFilename()(obj.getObjShortName(), shortname); }); + [&](const typename List::value_type& obj) { return EqualFilename()(obj.getPairShortName(), shortname); }); } @@ -939,8 +940,8 @@ template <SelectedSide side> void SynchronizeFolderPair::prepare2StepMove(FilePair& sourceObj, FilePair& targetObj) //throw FileError { - const Zstring& source = sourceObj.getFullName<side>(); - Zstring tmpTarget = sourceObj.getBaseDirPf<side>() + sourceObj.getShortName<side>() + TEMP_FILE_ENDING; + const Zstring& source = sourceObj.getFullPath<side>(); + Zstring tmpTarget = sourceObj.getBaseDirPf<side>() + sourceObj.getItemName<side>() + TEMP_FILE_ENDING; //this could still lead to a name-clash in obscure cases, if some file exists on the other side with //the very same (.ffs_tmp) name and is copied before the second step of the move is executed //good news: even in this pathologic case, this may only prevent the copy of the other file, but not the move @@ -954,7 +955,7 @@ void SynchronizeFolderPair::prepare2StepMove(FilePair& sourceObj, } catch (const ErrorTargetExisting&) //repeat until unique name found: no file system race condition! { - tmpTarget = sourceObj.getBaseDirPf<side>() + sourceObj.getShortName<side>() + Zchar('_') + numberTo<Zstring>(i) + TEMP_FILE_ENDING; + tmpTarget = sourceObj.getBaseDirPf<side>() + sourceObj.getItemName<side>() + Zchar('_') + numberTo<Zstring>(i) + TEMP_FILE_ENDING; } warn_static("was wenn diff volume: symlink aliasing!") //throw FileError, ErrorDifferentVolume, ErrorTargetExisting @@ -989,7 +990,7 @@ bool SynchronizeFolderPair::createParentDir(FileSystemObject& fsObj) //throw Fil return false; //detect (and try to resolve) file type conflicts: 1. symlinks 2. files - const Zstring& shortname = parentDir->getObjShortName(); + const Zstring& shortname = parentDir->getPairShortName(); if (haveNameClash(shortname, parentDir->parent().refSubLinks()) || haveNameClash(shortname, parentDir->parent().refSubFiles())) return false; @@ -1042,8 +1043,8 @@ void SynchronizeFolderPair::manageFileMove(FilePair& sourceObj, auto haveNameClash = [](const FilePair& fileObj) { - return ::haveNameClash(fileObj.getObjShortName(), fileObj.parent().refSubLinks()) || - ::haveNameClash(fileObj.getObjShortName(), fileObj.parent().refSubDirs()); + return ::haveNameClash(fileObj.getPairShortName(), fileObj.parent().refSubLinks()) || + ::haveNameClash(fileObj.getPairShortName(), fileObj.parent().refSubDirs()); }; if (sourceWillBeDeleted || haveNameClash(sourceObj)) @@ -1090,7 +1091,7 @@ void SynchronizeFolderPair::runZeroPass(HierarchyObject& hierObj) //move operation has failed! We cannot allow to continue and have move source's parent directory deleted, messing up statistics! // => revert to ordinary "copy + delete" - auto getStats = [&]() -> std::pair<int, Int64> + auto getStats = [&]() -> std::pair<int, std::int64_t> { SyncStatistics statSrc(*sourceObj); SyncStatistics statTrg(*targetObj); @@ -1322,22 +1323,22 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation if (parentDir->isEmpty<sideTrg>()) //BaseDirPair OTOH is always non-empty and existing in this context => else: fatal error in zen::synchronize() return; //if parent directory creation failed, there's no reason to show more errors! - const Zstring& target = fileObj.getBaseDirPf<sideTrg>() + fileObj.getRelativeName<sideSrc>(); //can't use "getFullName" as target is not yet existing + const Zstring& target = fileObj.getBaseDirPf<sideTrg>() + fileObj.getRelativePath<sideSrc>(); //can't use "getFullPath" as target is not yet existing reportInfo(txtCreatingFile, target); - StatisticsReporter statReporter(1, to<zen::Int64>(fileObj.getFileSize<sideSrc>()), procCallback_); + StatisticsReporter statReporter(1, fileObj.getFileSize<sideSrc>(), procCallback_); try { - auto onNotifyFileCopy = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onNotifyFileCopy = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; - const InSyncAttributes newAttr = copyFileWithCallback(fileObj.getFullName<sideSrc>(), + const InSyncAttributes newAttr = copyFileWithCallback(fileObj.getFullPath<sideSrc>(), target, nullptr, //no target to delete onNotifyFileCopy); //throw FileError statReporter.reportDelta(1, 0); //update FilePair - fileObj.setSyncedTo<sideTrg>(fileObj.getShortName<sideSrc>(), newAttr.fileSize, + fileObj.setSyncedTo<sideTrg>(fileObj.getItemName<sideSrc>(), newAttr.fileSize, newAttr.modificationTime, //target time set from source newAttr.modificationTime, newAttr.targetFileId, @@ -1351,7 +1352,7 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation //if (!dirExists(basedir) || - if (!somethingExists(fileObj.getFullName<sideSrc>())) //do not check on type (symlink, file, folder) -> if there is a type change, FFS should error out! + if (!somethingExists(fileObj.getFullPath<sideSrc>())) //do not check on type (symlink, file, folder) -> if there is a type change, FFS should error out! { //source deleted meanwhile...nothing was done (logical point of view!) fileObj.removeObject<sideSrc>(); //remove only *after* evaluating "fileObj, sideSrc"! @@ -1365,14 +1366,14 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation case SO_DELETE_LEFT: case SO_DELETE_RIGHT: - reportInfo(getDelHandling<sideTrg>().getTxtRemovingFile(), fileObj.getFullName<sideTrg>()); + reportInfo(getDelHandling<sideTrg>().getTxtRemovingFile(), fileObj.getFullPath<sideTrg>()); { StatisticsReporter statReporter(1, 0, procCallback_); auto onNotifyItemDeletion = [&] { statReporter.reportDelta(1, 0); }; - auto onNotifyFileCopy = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onNotifyFileCopy = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; - getDelHandling<sideTrg>().removeFileWithCallback(fileObj.getFullName<sideTrg>(), fileObj.getObjRelativeName(), onNotifyItemDeletion, onNotifyFileCopy); //throw FileError + getDelHandling<sideTrg>().removeFileWithCallback(fileObj.getFullPath<sideTrg>(), fileObj.getPairRelativePath(), onNotifyItemDeletion, onNotifyFileCopy); //throw FileError fileObj.removeObject<sideTrg>(); //update FilePair @@ -1389,8 +1390,8 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation assert((moveSource->getSyncOperation() == SO_MOVE_LEFT_SOURCE && moveTarget->getSyncOperation() == SO_MOVE_LEFT_TARGET && sideTrg == LEFT_SIDE) || (moveSource->getSyncOperation() == SO_MOVE_RIGHT_SOURCE && moveTarget->getSyncOperation() == SO_MOVE_RIGHT_TARGET && sideTrg == RIGHT_SIDE)); - const Zstring& oldName = moveSource->getFullName<sideTrg>(); - const Zstring& newName = moveSource->getBaseDirPf<sideTrg>() + moveTarget->getRelativeName<sideSrc>(); + const Zstring& oldName = moveSource->getFullPath<sideTrg>(); + const Zstring& newName = moveSource->getBaseDirPf<sideTrg>() + moveTarget->getRelativePath<sideSrc>(); reportInfo(txtMovingFile, oldName, newName); warn_static("was wenn diff volume: symlink aliasing!") //throw FileError, ErrorDifferentVolume, ErrorTargetExisting @@ -1398,7 +1399,7 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation //update FilePair assert(moveSource->getFileSize<sideTrg>() == moveTarget->getFileSize<sideSrc>()); - moveTarget->setSyncedTo<sideTrg>(moveTarget->getShortName<sideSrc>(), moveTarget->getFileSize<sideSrc>(), + moveTarget->setSyncedTo<sideTrg>(moveTarget->getItemName<sideSrc>(), moveTarget->getFileSize<sideSrc>(), moveSource->getLastWriteTime<sideTrg>(), //awkward naming! moveSource is renamed on "sideTrg" side! moveTarget->getLastWriteTime<sideSrc>(), moveSource->getFileId<sideTrg>(), @@ -1416,25 +1417,25 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation case SO_OVERWRITE_RIGHT: { const Zstring targetFile = fileObj.isFollowedSymlink<sideTrg>() ? //follow link when updating file rather than delete it and replace with regular file!!! - zen::getResolvedFilePath(fileObj.getFullName<sideTrg>()) : //throw FileError - fileObj.getBaseDirPf<sideTrg>() + fileObj.getRelativeName<sideSrc>(); //respect differences in case of source object + zen::getResolvedFilePath(fileObj.getFullPath<sideTrg>()) : //throw FileError + fileObj.getBaseDirPf<sideTrg>() + fileObj.getRelativePath<sideSrc>(); //respect differences in case of source object reportInfo(txtOverwritingFile, targetFile); if (fileObj.isFollowedSymlink<sideTrg>()) //since we follow the link, we need to handle case sensitivity of the link manually! - if (fileObj.getShortName<sideTrg>() != fileObj.getShortName<sideSrc>()) //adapt difference in case (windows only) - renameFile(fileObj.getFullName<sideTrg>(), - beforeLast(fileObj.getFullName<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + fileObj.getShortName<sideSrc>()); //throw FileError + if (fileObj.getItemName<sideTrg>() != fileObj.getItemName<sideSrc>()) //adapt difference in case (windows only) + renameFile(fileObj.getFullPath<sideTrg>(), + beforeLast(fileObj.getFullPath<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + fileObj.getItemName<sideSrc>()); //throw FileError - StatisticsReporter statReporter(1, to<zen::Int64>(fileObj.getFileSize<sideSrc>()), procCallback_); + StatisticsReporter statReporter(1, fileObj.getFileSize<sideSrc>(), procCallback_); - auto onNotifyFileCopy = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onNotifyFileCopy = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; auto onDeleteTargetFile = [&] //delete target at appropriate time { reportStatus(this->getDelHandling<sideTrg>().getTxtRemovingFile(), targetFile); - this->getDelHandling<sideTrg>().removeFileWithCallback(targetFile, fileObj.getObjRelativeName(), [] {}, onNotifyFileCopy); //throw FileError; + this->getDelHandling<sideTrg>().removeFileWithCallback(targetFile, fileObj.getPairRelativePath(), [] {}, onNotifyFileCopy); //throw FileError; //no (logical) item count update desired - but total byte count may change, e.g. move(copy) deleted file to versioning dir //fileObj.removeObject<sideTrg>(); -> doesn't make sense for isFollowedSymlink(); "fileObj, sideTrg" evaluated below! @@ -1445,14 +1446,14 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation reportStatus(txtOverwritingFile, targetFile); //restore status text copy file }; - const InSyncAttributes newAttr = copyFileWithCallback(fileObj.getFullName<sideSrc>(), + const InSyncAttributes newAttr = copyFileWithCallback(fileObj.getFullPath<sideSrc>(), targetFile, onDeleteTargetFile, onNotifyFileCopy); //throw FileError statReporter.reportDelta(1, 0); //we model "delete + copy" as ONE logical operation //update FilePair - fileObj.setSyncedTo<sideTrg>(fileObj.getShortName<sideSrc>(), newAttr.fileSize, + fileObj.setSyncedTo<sideTrg>(fileObj.getItemName<sideSrc>(), newAttr.fileSize, newAttr.modificationTime, //target time set from source newAttr.modificationTime, newAttr.targetFileId, @@ -1468,19 +1469,20 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation case SO_COPY_METADATA_TO_RIGHT: //harmonize with file_hierarchy.cpp::getSyncOpDescription!! - reportInfo(txtWritingAttributes, fileObj.getFullName<sideTrg>()); + reportInfo(txtWritingAttributes, fileObj.getFullPath<sideTrg>()); - if (fileObj.getShortName<sideTrg>() != fileObj.getShortName<sideSrc>()) //adapt difference in case (windows only) - renameFile(fileObj.getFullName<sideTrg>(), - beforeLast(fileObj.getFullName<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + fileObj.getShortName<sideSrc>()); //throw FileError + if (fileObj.getItemName<sideTrg>() != fileObj.getItemName<sideSrc>()) //adapt difference in case (windows only) + renameFile(fileObj.getFullPath<sideTrg>(), + beforeLast(fileObj.getFullPath<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + fileObj.getItemName<sideSrc>()); //throw FileError - if (!sameFileTime(fileObj.getLastWriteTime<sideTrg>(), fileObj.getLastWriteTime<sideSrc>(), 2)) //respect 2 second FAT/FAT32 precision - setFileTime(fileObj.getFullName<sideTrg>(), fileObj.getLastWriteTime<sideSrc>(), ProcSymlink::FOLLOW); //throw FileError - //do NOT read *current* source file time, but use buffered value which corresponds to time of comparison! + if (fileObj.getLastWriteTime<sideTrg>() != fileObj.getLastWriteTime<sideSrc>()) + //- no need to call sameFileTime() or respect 2 second FAT/FAT32 precision in this comparison + //- do NOT read *current* source file time, but use buffered value which corresponds to time of comparison! + setFileTime(fileObj.getFullPath<sideTrg>(), fileObj.getLastWriteTime<sideSrc>(), ProcSymlink::FOLLOW); //throw FileError //-> both sides *should* be completely equal now... assert(fileObj.getFileSize<sideTrg>() == fileObj.getFileSize<sideSrc>()); - fileObj.setSyncedTo<sideTrg>(fileObj.getShortName<sideSrc>(), fileObj.getFileSize<sideSrc>(), + fileObj.setSyncedTo<sideTrg>(fileObj.getItemName<sideSrc>(), fileObj.getFileSize<sideSrc>(), fileObj.getLastWriteTime<sideSrc>(), //target time set from source fileObj.getLastWriteTime<sideSrc>(), fileObj.getFileId <sideTrg>(), @@ -1533,16 +1535,16 @@ void SynchronizeFolderPair::synchronizeLinkInt(SymlinkPair& linkObj, SyncOperati if (parentDir->isEmpty<sideTrg>()) //BaseDirPair OTOH is always non-empty and existing in this context => else: fatal error in zen::synchronize() return; //if parent directory creation failed, there's no reason to show more errors! - const Zstring& target = linkObj.getBaseDirPf<sideTrg>() + linkObj.getRelativeName<sideSrc>(); + const Zstring& target = linkObj.getBaseDirPf<sideTrg>() + linkObj.getRelativePath<sideSrc>(); reportInfo(txtCreatingLink, target); StatisticsReporter statReporter(1, 0, procCallback_); try { - zen::copySymlink(linkObj.getFullName<sideSrc>(), target, copyFilePermissions_); //throw FileError + zen::copySymlink(linkObj.getFullPath<sideSrc>(), target, copyFilePermissions_); //throw FileError //update SymlinkPair - linkObj.setSyncedTo<sideTrg>(linkObj.getShortName<sideSrc>(), + linkObj.setSyncedTo<sideTrg>(linkObj.getItemName<sideSrc>(), linkObj.getLastWriteTime<sideSrc>(), //target time set from source linkObj.getLastWriteTime<sideSrc>()); @@ -1552,7 +1554,7 @@ void SynchronizeFolderPair::synchronizeLinkInt(SymlinkPair& linkObj, SyncOperati { warn_static("still an error if base dir is missing!") - if (somethingExists(linkObj.getFullName<sideSrc>())) //do not check on type (symlink, file, folder) -> if there is a type change, FFS should not be quiet about it! + if (somethingExists(linkObj.getFullPath<sideSrc>())) //do not check on type (symlink, file, folder) -> if there is a type change, FFS should not be quiet about it! throw; //source deleted meanwhile...nothing was done (logical point of view!) linkObj.removeObject<sideSrc>(); @@ -1563,14 +1565,14 @@ void SynchronizeFolderPair::synchronizeLinkInt(SymlinkPair& linkObj, SyncOperati case SO_DELETE_LEFT: case SO_DELETE_RIGHT: - reportInfo(getDelHandling<sideTrg>().getTxtRemovingSymLink(), linkObj.getFullName<sideTrg>()); + reportInfo(getDelHandling<sideTrg>().getTxtRemovingSymLink(), linkObj.getFullPath<sideTrg>()); { StatisticsReporter statReporter(1, 0, procCallback_); auto onNotifyItemDeletion = [&] { statReporter.reportDelta(1, 0); }; - auto onNotifyFileCopy = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onNotifyFileCopy = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; - getDelHandling<sideTrg>().removeLinkWithCallback(linkObj.getFullName<sideTrg>(), linkObj.getObjRelativeName(), onNotifyItemDeletion, onNotifyFileCopy); //throw FileError + getDelHandling<sideTrg>().removeLinkWithCallback(linkObj.getFullPath<sideTrg>(), linkObj.getPairRelativePath(), onNotifyItemDeletion, onNotifyFileCopy); //throw FileError linkObj.removeObject<sideTrg>(); //update SymlinkPair @@ -1580,28 +1582,28 @@ void SynchronizeFolderPair::synchronizeLinkInt(SymlinkPair& linkObj, SyncOperati case SO_OVERWRITE_LEFT: case SO_OVERWRITE_RIGHT: - reportInfo(txtOverwritingLink, linkObj.getFullName<sideTrg>()); + reportInfo(txtOverwritingLink, linkObj.getFullPath<sideTrg>()); { StatisticsReporter statReporter(1, 0, procCallback_); - auto onNotifyFileCopy = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onNotifyFileCopy = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; - //reportStatus(getDelHandling<sideTrg>().getTxtRemovingSymLink(), linkObj.getFullName<sideTrg>()); - getDelHandling<sideTrg>().removeLinkWithCallback(linkObj.getFullName<sideTrg>(), linkObj.getObjRelativeName(), [] {}, onNotifyFileCopy); //throw FileError + //reportStatus(getDelHandling<sideTrg>().getTxtRemovingSymLink(), linkObj.getFullPath<sideTrg>()); + getDelHandling<sideTrg>().removeLinkWithCallback(linkObj.getFullPath<sideTrg>(), linkObj.getPairRelativePath(), [] {}, onNotifyFileCopy); //throw FileError //linkObj.removeObject<sideTrg>(); -> "linkObj, sideTrg" evaluated below! //=> don't risk reportStatus() throwing GuiAbortProcess() leaving the target deleted rather than updated: - //reportStatus(txtOverwritingLink, linkObj.getFullName<sideTrg>()); //restore status text + //reportStatus(txtOverwritingLink, linkObj.getFullPath<sideTrg>()); //restore status text - zen::copySymlink(linkObj.getFullName<sideSrc>(), - linkObj.getBaseDirPf<sideTrg>() + linkObj.getRelativeName<sideSrc>(), //respect differences in case of source object + zen::copySymlink(linkObj.getFullPath<sideSrc>(), + linkObj.getBaseDirPf<sideTrg>() + linkObj.getRelativePath<sideSrc>(), //respect differences in case of source object copyFilePermissions_); //throw FileError statReporter.reportDelta(1, 0); //we model "delete + copy" as ONE logical operation //update SymlinkPair - linkObj.setSyncedTo<sideTrg>(linkObj.getShortName<sideSrc>(), + linkObj.setSyncedTo<sideTrg>(linkObj.getItemName<sideSrc>(), linkObj.getLastWriteTime<sideSrc>(), //target time set from source linkObj.getLastWriteTime<sideSrc>()); @@ -1611,17 +1613,19 @@ void SynchronizeFolderPair::synchronizeLinkInt(SymlinkPair& linkObj, SyncOperati case SO_COPY_METADATA_TO_LEFT: case SO_COPY_METADATA_TO_RIGHT: - reportInfo(txtWritingAttributes, linkObj.getFullName<sideTrg>()); + reportInfo(txtWritingAttributes, linkObj.getFullPath<sideTrg>()); - if (linkObj.getShortName<sideTrg>() != linkObj.getShortName<sideSrc>()) //adapt difference in case (windows only) - renameFile(linkObj.getFullName<sideTrg>(), - beforeLast(linkObj.getFullName<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + linkObj.getShortName<sideSrc>()); //throw FileError + if (linkObj.getItemName<sideTrg>() != linkObj.getItemName<sideSrc>()) //adapt difference in case (windows only) + renameFile(linkObj.getFullPath<sideTrg>(), + beforeLast(linkObj.getFullPath<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + linkObj.getItemName<sideSrc>()); //throw FileError - if (!sameFileTime(linkObj.getLastWriteTime<sideTrg>(), linkObj.getLastWriteTime<sideSrc>(), 2)) //respect 2 second FAT/FAT32 precision - setFileTime(linkObj.getFullName<sideTrg>(), linkObj.getLastWriteTime<sideSrc>(), ProcSymlink::DIRECT); //throw FileError + if (linkObj.getLastWriteTime<sideTrg>() != linkObj.getLastWriteTime<sideSrc>()) + //- no need to call sameFileTime() or respect 2 second FAT/FAT32 precision in this comparison + //- do NOT read *current* source file time, but use buffered value which corresponds to time of comparison! + setFileTime(linkObj.getFullPath<sideTrg>(), linkObj.getLastWriteTime<sideSrc>(), ProcSymlink::DIRECT); //throw FileError //-> both sides *should* be completely equal now... - linkObj.setSyncedTo<sideTrg>(linkObj.getShortName<sideSrc>(), + linkObj.setSyncedTo<sideTrg>(linkObj.getItemName<sideSrc>(), linkObj.getLastWriteTime<sideSrc>(), //target time set from source linkObj.getLastWriteTime<sideSrc>()); @@ -1671,19 +1675,19 @@ void SynchronizeFolderPair::synchronizeFolderInt(DirPair& dirObj, SyncOperation if (parentDir->isEmpty<sideTrg>()) //BaseDirPair OTOH is always non-empty and existing in this context => else: fatal error in zen::synchronize() return; //if parent directory creation failed, there's no reason to show more errors! - if (somethingExists(dirObj.getFullName<sideSrc>())) //do not check on type (symlink, file, folder) -> if there is a type change, FFS should error out! + if (somethingExists(dirObj.getFullPath<sideSrc>())) //do not check on type (symlink, file, folder) -> if there is a type change, FFS should error out! { - const Zstring& target = dirObj.getBaseDirPf<sideTrg>() + dirObj.getRelativeName<sideSrc>(); + const Zstring& target = dirObj.getBaseDirPf<sideTrg>() + dirObj.getRelativePath<sideSrc>(); reportInfo(txtCreatingFolder, target); try { - makeDirectoryPlain(target, dirObj.getFullName<sideSrc>(), copyFilePermissions_); //throw FileError, ErrorTargetExisting, (ErrorTargetPathMissing) + makeDirectoryPlain(target, dirObj.getFullPath<sideSrc>(), copyFilePermissions_); //throw FileError, ErrorTargetExisting, (ErrorTargetPathMissing) } catch (const ErrorTargetExisting&) { if (!dirExists(target)) throw; } //detect clash with file (dir-symlink OTOH is okay) //update DirPair - dirObj.setSyncedTo(dirObj.getShortName<sideSrc>()); + dirObj.setSyncedTo(dirObj.getItemName<sideSrc>()); procCallback_.updateProcessedData(1, 0); } @@ -1704,16 +1708,16 @@ void SynchronizeFolderPair::synchronizeFolderInt(DirPair& dirObj, SyncOperation case SO_DELETE_LEFT: case SO_DELETE_RIGHT: - reportInfo(getDelHandling<sideTrg>().getTxtRemovingDir(), dirObj.getFullName<sideTrg>()); + reportInfo(getDelHandling<sideTrg>().getTxtRemovingDir(), dirObj.getFullPath<sideTrg>()); { const SyncStatistics subStats(dirObj); //counts sub-objects only! StatisticsReporter statReporter(1 + getCUD(subStats), subStats.getDataToProcess(), procCallback_); auto onNotifyItemDeletion = [&] { statReporter.reportDelta(1, 0); }; - auto onNotifyFileCopy = [&](Int64 bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; + auto onNotifyFileCopy = [&](std::int64_t bytesDelta) { statReporter.reportDelta(0, bytesDelta); }; - getDelHandling<sideTrg>().removeDirWithCallback(dirObj.getFullName<sideTrg>(), dirObj.getObjRelativeName(), onNotifyItemDeletion, onNotifyFileCopy); //throw FileError + getDelHandling<sideTrg>().removeDirWithCallback(dirObj.getFullPath<sideTrg>(), dirObj.getPairRelativePath(), onNotifyItemDeletion, onNotifyFileCopy); //throw FileError dirObj.refSubFiles().clear(); // dirObj.refSubLinks().clear(); //update DirPair @@ -1726,15 +1730,15 @@ void SynchronizeFolderPair::synchronizeFolderInt(DirPair& dirObj, SyncOperation case SO_COPY_METADATA_TO_LEFT: case SO_COPY_METADATA_TO_RIGHT: - reportInfo(txtWritingAttributes, dirObj.getFullName<sideTrg>()); + reportInfo(txtWritingAttributes, dirObj.getFullPath<sideTrg>()); - if (dirObj.getShortName<sideTrg>() != dirObj.getShortName<sideSrc>()) //adapt difference in case (windows only) - renameFile(dirObj.getFullName<sideTrg>(), - beforeLast(dirObj.getFullName<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + dirObj.getShortName<sideSrc>()); //throw FileError + if (dirObj.getItemName<sideTrg>() != dirObj.getItemName<sideSrc>()) //adapt difference in case (windows only) + renameFile(dirObj.getFullPath<sideTrg>(), + beforeLast(dirObj.getFullPath<sideTrg>(), FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + dirObj.getItemName<sideSrc>()); //throw FileError //copyFileTimes -> useless: modification time changes with each child-object creation/deletion //-> both sides *should* be completely equal now... - dirObj.setSyncedTo(dirObj.getShortName<sideSrc>()); + dirObj.setSyncedTo(dirObj.getItemName<sideSrc>()); procCallback_.updateProcessedData(1, 0); break; @@ -1761,11 +1765,11 @@ void SynchronizeFolderPair::synchronizeFolderInt(DirPair& dirObj, SyncOperation InSyncAttributes SynchronizeFolderPair::copyFileWithCallback(const Zstring& sourceFile, //throw FileError const Zstring& targetFile, const std::function<void()>& onDeleteTargetFile, - const std::function<void(Int64 bytesDelta)>& onNotifyFileCopy) const //returns current attributes of source file + const std::function<void(std::int64_t bytesDelta)>& onNotifyFileCopy) const //returns current attributes of source file { auto copyOperation = [this, &targetFile, &onDeleteTargetFile, &onNotifyFileCopy](const Zstring& sourceFileTmp) { - InSyncAttributes newAttr; + InSyncAttributes newAttr = {}; copyFile(sourceFileTmp, //type File implicitly means symlinks need to be dereferenced! targetFile, copyFilePermissions_, @@ -1835,7 +1839,7 @@ void verifyFiles(const Zstring& source, const Zstring& target, VerifyCallback& c #ifdef ZEN_WIN wxFile file1(applyLongPathPrefix(source).c_str(), wxFile::read); //don't use buffered file input for verification! #elif defined ZEN_LINUX || defined ZEN_MAC - wxFile file1(::open(source.c_str(), O_RDONLY)); //utilize UTF-8 filename + wxFile file1(::open(source.c_str(), O_RDONLY)); //utilize UTF-8 filepath #endif if (!file1.IsOpened()) throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(source)) + L" (open)"); @@ -1843,7 +1847,7 @@ void verifyFiles(const Zstring& source, const Zstring& target, VerifyCallback& c #ifdef ZEN_WIN wxFile file2(applyLongPathPrefix(target).c_str(), wxFile::read); //don't use buffered file input for verification! #elif defined ZEN_LINUX || defined ZEN_MAC - wxFile file2(::open(target.c_str(), O_RDONLY)); //utilize UTF-8 filename + wxFile file2(::open(target.c_str(), O_RDONLY)); //utilize UTF-8 filepath #endif if (!file2.IsOpened()) //NO cleanup necessary for (wxFile) file1 throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(target)) + L" (open)"); @@ -1908,8 +1912,8 @@ struct LessDependentDirectory : public std::binary_function<Zstring, Zstring, bo template <SelectedSide side> //create base directories first (if not yet existing) -> no symlink or attribute copying! bool createBaseDirectory(BaseDirPair& baseDirObj, ProcessCallback& callback) //nothrow; return false if fatal error occurred { - const Zstring dirname = beforeLast(baseDirObj.getBaseDirPf<side>(), FILE_NAME_SEPARATOR); //what about C:\ ??? - if (dirname.empty()) + const Zstring dirpath = beforeLast(baseDirObj.getBaseDirPf<side>(), FILE_NAME_SEPARATOR); //what about C:\ ??? + if (dirpath.empty()) return true; if (baseDirObj.isExisting<side>()) //atomicity: do NOT check directory existence again! @@ -1917,8 +1921,8 @@ bool createBaseDirectory(BaseDirPair& baseDirObj, ProcessCallback& callback) //n //just convenience: exit sync right here instead of showing tons of error messages during file copy zen::Opt<std::wstring> errMsg = tryReportingError([&] { - if (!dirExistsUpdating(dirname, false, callback)) - throw FileError(replaceCpy(_("Cannot find folder %x."), L"%x", fmtFileName(dirname))); //should be logged as a "fatal error" if ignored by the user... + if (!dirExistsUpdating(dirpath, false, callback)) + throw FileError(replaceCpy(_("Cannot find folder %x."), L"%x", fmtFileName(dirpath))); //should be logged as a "fatal error" if ignored by the user... }, callback); //may throw in error-callback! return !errMsg; @@ -1931,14 +1935,14 @@ bool createBaseDirectory(BaseDirPair& baseDirObj, ProcessCallback& callback) //n try { //a nice race-free check and set operation: - makeDirectory(dirname, /*bool failIfExists*/ true); //throw FileError, ErrorTargetExisting + makeDirectory(dirpath, /*bool failIfExists*/ true); //throw FileError, ErrorTargetExisting baseDirObj.setExisting<side>(true); //update our model! } catch (const ErrorTargetExisting&) { //TEMPORARY network drop: base directory not found during comparison, but reappears during synchronization //=> sync-directions are based on false assumptions! Abort. - callback.reportFatalError(replaceCpy(_("Target folder %x already existing."), L"%x", fmtFileName(dirname))); + callback.reportFatalError(replaceCpy(_("Target folder %x already existing."), L"%x", fmtFileName(dirpath))); temporaryNetworkDrop = true; //Is it possible we're catching a "false-positive" here, could FFS have created the directory indirectly after comparison? @@ -2030,7 +2034,7 @@ void zen::synchronize(const TimeComp& timeStamp, std::vector<std::pair<Zstring, Zstring>> significantDiffPairs; - std::vector<std::pair<Zstring, std::pair<Int64, Int64>>> diskSpaceMissing; //dirname / space required / space available + std::vector<std::pair<Zstring, std::pair<std::int64_t, std::int64_t>>> diskSpaceMissing; //dirpath / space required / space available #ifdef ZEN_WIN //status of base directories which are set to DELETE_TO_RECYCLER (and contain actual items to be deleted) @@ -2106,7 +2110,7 @@ void zen::synchronize(const TimeComp& timeStamp, folderPairCfg.handleDeletion == zen::DELETE_TO_VERSIONING) { //check if user-defined directory for deletion was specified - if (folderPairCfg.versioningFolder.empty()) //already trimmed by getFormattedDirectoryName() + if (folderPairCfg.versioningFolder.empty()) //already trimmed by getFormattedDirectoryPath() { //should never arrive here: already checked in SyncCfgDialog callback.reportFatalError(_("Please enter a target folder for versioning.")); @@ -2146,11 +2150,11 @@ void zen::synchronize(const TimeComp& timeStamp, significantDiffPairs.push_back(std::make_pair(j->getBaseDirPf<LEFT_SIDE>(), j->getBaseDirPf<RIGHT_SIDE>())); //check for sufficient free diskspace - auto checkSpace = [&](const Zstring& baseDirPf, const Int64& minSpaceNeeded) + auto checkSpace = [&](const Zstring& baseDirPf, std::int64_t minSpaceNeeded) { try { - const Int64 freeSpace = to<Int64>(getFreeDiskSpace(baseDirPf)); //throw FileError + const std::int64_t freeSpace = getFreeDiskSpace(baseDirPf); //throw FileError if (0 < freeSpace && //zero disk space probably means "request not supported" (e.g. see WebDav) freeSpace < minSpaceNeeded) @@ -2158,7 +2162,7 @@ void zen::synchronize(const TimeComp& timeStamp, } catch (FileError&) {} }; - const std::pair<Int64, Int64> spaceNeeded = MinimumDiskSpaceNeeded::calculate(*j); + const std::pair<std::int64_t, std::int64_t> spaceNeeded = MinimumDiskSpaceNeeded::calculate(*j); checkSpace(j->getBaseDirPf<LEFT_SIDE >(), spaceNeeded.first); checkSpace(j->getBaseDirPf<RIGHT_SIDE>(), spaceNeeded.second); @@ -2259,8 +2263,8 @@ void zen::synchronize(const TimeComp& timeStamp, if (!conflictDirs.empty()) { std::wstring msg = _("A folder will be modified that is part of multiple folder pairs. Please review synchronization settings.") + L"\n"; - for (const Zstring& dirname : conflictDirs) - msg += std::wstring(L"\n") + dirname; + for (const Zstring& dirpath : conflictDirs) + msg += std::wstring(L"\n") + dirpath; callback.reportWarning(msg, warnings.warningFolderPairRaceCondition); } diff --git a/FreeFileSync/Source/synchronization.h b/FreeFileSync/Source/synchronization.h index 91d2fe29..11f560be 100644 --- a/FreeFileSync/Source/synchronization.h +++ b/FreeFileSync/Source/synchronization.h @@ -34,11 +34,11 @@ public: int getConflict() const { return static_cast<int>(conflictMsgs.size()); } - typedef std::vector<std::pair<Zstring, std::wstring>> ConflictTexts; // Pair(filename/conflict text) + typedef std::vector<std::pair<Zstring, std::wstring>> ConflictTexts; // Pair(filepath/conflict text) const ConflictTexts& getConflictMessages() const { return conflictMsgs; } - Int64 getDataToProcess() const { return dataToProcess; } - size_t getRowCount() const { return rowsTotal; } + std::int64_t getDataToProcess() const { return dataToProcess; } + size_t getRowCount() const { return rowsTotal; } private: void init(); @@ -53,7 +53,7 @@ private: int updateLeft, updateRight; int deleteLeft, deleteRight; ConflictTexts conflictMsgs; //conflict texts to display as a warning message - Int64 dataToProcess; + std::int64_t dataToProcess; size_t rowsTotal; }; diff --git a/FreeFileSync/Source/ui/batch_config.cpp b/FreeFileSync/Source/ui/batch_config.cpp index 92494048..dc6a76c1 100644 --- a/FreeFileSync/Source/ui/batch_config.cpp +++ b/FreeFileSync/Source/ui/batch_config.cpp @@ -131,7 +131,7 @@ void BatchDialog::setConfig(const XmlBatchConfig& batchCfg) //transfer parameter ownership to GUI m_checkBoxRunMinimized->SetValue(batchCfg.runMinimized); - logfileDir->setName(utfCvrtTo<wxString>(batchCfg.logFileDirectory)); + logfileDir->setPath(utfCvrtTo<wxString>(batchCfg.logFileDirectory)); m_comboBoxOnCompletion->setValue(batchCfg.mainCfg.onCompletion); //map single parameter "logfiles limit" to all three checkboxs and spin ctrl: @@ -152,7 +152,7 @@ XmlBatchConfig BatchDialog::getConfig() const //load structure with batch settings "batchCfg" batchCfg.runMinimized = m_checkBoxRunMinimized->GetValue(); - batchCfg.logFileDirectory = utfCvrtTo<Zstring>(logfileDir->getName()); + batchCfg.logFileDirectory = utfCvrtTo<Zstring>(logfileDir->getPath()); batchCfg.mainCfg.onCompletion = m_comboBoxOnCompletion->getValue(); //get single parameter "logfiles limit" from all three checkboxes and spin ctrl: batchCfg.logfilesCountLimit = m_checkBoxGenerateLogfile->GetValue() ? (m_checkBoxLogfilesLimit->GetValue() ? m_spinCtrlLogfileLimit->GetValue() : -1) : 0; diff --git a/FreeFileSync/Source/ui/batch_status_handler.cpp b/FreeFileSync/Source/ui/batch_status_handler.cpp index 15f2af80..164ce302 100644 --- a/FreeFileSync/Source/ui/batch_status_handler.cpp +++ b/FreeFileSync/Source/ui/batch_status_handler.cpp @@ -23,16 +23,16 @@ namespace { //"Backup FreeFileSync 2013-09-15 015052.log" -> //"Backup FreeFileSync 2013-09-15 015052 (Error).log" -Zstring addStatusToLogfilename(const Zstring& logfilename, const std::wstring& status) +Zstring addStatusToLogfilename(const Zstring& logfilepath, const std::wstring& status) { //attention: do not interfere with naming convention required by limitLogfileCount()! - size_t pos = logfilename.rfind(Zstr('.')); + size_t pos = logfilepath.rfind(Zstr('.')); if (pos != Zstring::npos) - return Zstring(logfilename.begin(), logfilename.begin() + pos) + + return Zstring(logfilepath.begin(), logfilepath.begin() + pos) + utfCvrtTo<Zstring>(L" (" + status + L")") + - Zstring(logfilename.begin() + pos, logfilename.end()); + Zstring(logfilepath.begin() + pos, logfilepath.end()); assert(false); - return logfilename; + return logfilepath; } @@ -42,15 +42,15 @@ public: FindLogfiles(const Zstring& prefix, std::vector<Zstring>& logfiles) : prefix_(prefix), logfiles_(logfiles) {} private: - virtual void onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) + virtual void onFile(const Zchar* shortName, const Zstring& filepath, const FileInfo& details) { const Zstring fileName(shortName); if (startsWith(fileName, prefix_) && endsWith(fileName, Zstr(".log"))) - logfiles_.push_back(fullName); + logfiles_.push_back(filepath); } - virtual TraverseCallback* onDir (const Zchar* shortName, const Zstring& fullName) { return nullptr; } //DON'T traverse into subdirs - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) { return LINK_SKIP; } + virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& dirpath) { return nullptr; } //DON'T traverse into subdirs + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { return LINK_SKIP; } virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber) { assert(false); return ON_ERROR_IGNORE; } //errors are not really critical in this context virtual HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) { assert(false); return ON_ERROR_IGNORE; } // @@ -72,7 +72,7 @@ void limitLogfileCount(const Zstring& logdir, const std::wstring& jobname, size_ std::nth_element(logFiles.begin(), logFiles.end() - maxCount, logFiles.end(), LessFilename()); std::for_each(logFiles.begin(), logFiles.end() - maxCount, - [](const Zstring& filename) { try { removeFile(filename); } catch (FileError&) {} }); + [](const Zstring& filepath) { try { removeFile(filepath); } catch (FileError&) {} }); } @@ -82,7 +82,7 @@ std::unique_ptr<FileOutput> prepareNewLogfile(const Zstring& logfileDirectory, / { Zstring logfileDir = logfileDirectory.empty() ? getConfigDir() + Zstr("Logs") : - getFormattedDirectoryName(logfileDirectory); + getFormattedDirectoryPath(logfileDirectory); //create logfile directory if required makeDirectory(logfileDir); //throw FileError @@ -94,11 +94,11 @@ std::unique_ptr<FileOutput> prepareNewLogfile(const Zstring& logfileDirectory, / for (int i = 0;; ++i) try { - const Zstring& filename = i == 0 ? + const Zstring& filepath = i == 0 ? body + Zstr(".log") : body + Zstr('_') + numberTo<Zstring>(i) + Zstr(".log"); - return make_unique<FileOutput>(filename, FileOutput::ACC_CREATE_NEW); //throw FileError, ErrorTargetExisting + return make_unique<FileOutput>(filepath, FileOutput::ACC_CREATE_NEW); //throw FileError, ErrorTargetExisting //*no* file system race-condition! } catch (const ErrorTargetExisting&) {} @@ -250,13 +250,13 @@ BatchStatusHandler::~BatchStatusHandler() saveLogToFile(summary, errorLog, *logFile); //throw FileError //additionally notify errors by showing in log file name - const Zstring oldLogfilename = logFile->getFilename(); + const Zstring oldLogfilepath = logFile->getFilename(); logFile.reset(); if (abortIsRequested()) - renameFile(oldLogfilename, addStatusToLogfilename(oldLogfilename, _("Stopped"))); //throw FileError + renameFile(oldLogfilepath, addStatusToLogfilename(oldLogfilepath, _("Stopped"))); //throw FileError else if (totalErrors > 0) - renameFile(oldLogfilename, addStatusToLogfilename(oldLogfilename, _("Error"))); //throw FileError + renameFile(oldLogfilepath, addStatusToLogfilename(oldLogfilepath, _("Error"))); //throw FileError //status "warning" is not important enough to show up in log file name } catch (FileError&) {} @@ -299,7 +299,7 @@ BatchStatusHandler::~BatchStatusHandler() } -void BatchStatusHandler::initNewPhase(int objectsTotal, Int64 dataTotal, ProcessCallback::Phase phaseID) +void BatchStatusHandler::initNewPhase(int objectsTotal, std::int64_t dataTotal, ProcessCallback::Phase phaseID) { StatusHandler::initNewPhase(objectsTotal, dataTotal, phaseID); if (progressDlg) @@ -309,7 +309,7 @@ void BatchStatusHandler::initNewPhase(int objectsTotal, Int64 dataTotal, Process } -void BatchStatusHandler::updateProcessedData(int objectsDelta, Int64 dataDelta) +void BatchStatusHandler::updateProcessedData(int objectsDelta, std::int64_t dataDelta) { StatusHandler::updateProcessedData(objectsDelta, dataDelta); diff --git a/FreeFileSync/Source/ui/batch_status_handler.h b/FreeFileSync/Source/ui/batch_status_handler.h index 103eddc1..2fc64148 100644 --- a/FreeFileSync/Source/ui/batch_status_handler.h +++ b/FreeFileSync/Source/ui/batch_status_handler.h @@ -40,8 +40,8 @@ public: std::vector<Zstring>& onCompletionHistory); ~BatchStatusHandler(); - virtual void initNewPhase (int objectsTotal, zen::Int64 dataTotal, Phase phaseID); - virtual void updateProcessedData(int objectsDelta, zen::Int64 dataDelta); + virtual void initNewPhase (int objectsTotal, std::int64_t dataTotal, Phase phaseID); + virtual void updateProcessedData(int objectsDelta, std::int64_t dataDelta); virtual void reportInfo(const std::wstring& text); virtual void forceUiRefresh(); diff --git a/FreeFileSync/Source/ui/check_version.cpp b/FreeFileSync/Source/ui/check_version.cpp index 79fd2507..91ac2bf0 100644 --- a/FreeFileSync/Source/ui/check_version.cpp +++ b/FreeFileSync/Source/ui/check_version.cpp @@ -5,7 +5,6 @@ // ************************************************************************** #include "check_version.h" -//#include <memory> #include <zen/string_tools.h> #include <zen/i18n.h> #include <zen/utf.h> @@ -13,7 +12,6 @@ #include <wx/utils.h> #include <wx+/popup_dlg.h> #include "../version/version.h" -////#include "../lib/ffs_paths.h" #include <zen/scope_guard.h> #ifdef ZEN_WIN diff --git a/FreeFileSync/Source/ui/column_attr.h b/FreeFileSync/Source/ui/column_attr.h index bbc523b0..2bc2d8e4 100644 --- a/FreeFileSync/Source/ui/column_attr.h +++ b/FreeFileSync/Source/ui/column_attr.h @@ -13,9 +13,9 @@ namespace zen { enum ColumnTypeRim { - COL_TYPE_DIRECTORY, COL_TYPE_FULL_PATH, - COL_TYPE_REL_PATH, + COL_TYPE_BASE_DIRECTORY, + COL_TYPE_REL_FOLDER, COL_TYPE_FILENAME, COL_TYPE_SIZE, COL_TYPE_DATE, @@ -24,7 +24,7 @@ enum ColumnTypeRim struct ColumnAttributeRim { - ColumnAttributeRim() : type_(COL_TYPE_DIRECTORY), offset_(0), stretch_(0), visible_(false) {} + ColumnAttributeRim() : type_(COL_TYPE_BASE_DIRECTORY), offset_(0), stretch_(0), visible_(false) {} ColumnAttributeRim(ColumnTypeRim type, int offset, int stretch, bool visible) : type_(type), offset_(offset), stretch_(stretch), visible_(visible) {} ColumnTypeRim type_; @@ -38,9 +38,9 @@ inline std::vector<ColumnAttributeRim> getDefaultColumnAttributesLeft() { std::vector<ColumnAttributeRim> attr; - attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, 0, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_DIRECTORY, 200, 0, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_REL_PATH, -280, 1, true)); //stretch to full width and substract sum of fixed size widths! + attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_BASE_DIRECTORY, 200, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_REL_FOLDER, -280, 1, true)); //stretch to full width and substract sum of fixed size widths! attr.push_back(ColumnAttributeRim(COL_TYPE_FILENAME, 200, 0, true)); attr.push_back(ColumnAttributeRim(COL_TYPE_DATE, 112, 0, false)); attr.push_back(ColumnAttributeRim(COL_TYPE_SIZE, 80, 0, true)); @@ -52,9 +52,9 @@ inline std::vector<ColumnAttributeRim> getDefaultColumnAttributesRight() { std::vector<ColumnAttributeRim> attr; - attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, 0, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_DIRECTORY, 200, 0, false)); - attr.push_back(ColumnAttributeRim(COL_TYPE_REL_PATH, -280, 1, false)); //already shown on left side + attr.push_back(ColumnAttributeRim(COL_TYPE_FULL_PATH, 250, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_BASE_DIRECTORY, 200, 0, false)); + attr.push_back(ColumnAttributeRim(COL_TYPE_REL_FOLDER , -280, 1, false)); //already shown on left side attr.push_back(ColumnAttributeRim(COL_TYPE_FILENAME, 200, 0, true)); attr.push_back(ColumnAttributeRim(COL_TYPE_DATE, 112, 0, false)); attr.push_back(ColumnAttributeRim(COL_TYPE_SIZE, 80, 0, true)); diff --git a/FreeFileSync/Source/ui/custom_grid.cpp b/FreeFileSync/Source/ui/custom_grid.cpp index 06f1794c..3dc89a94 100644 --- a/FreeFileSync/Source/ui/custom_grid.cpp +++ b/FreeFileSync/Source/ui/custom_grid.cpp @@ -147,24 +147,24 @@ class GridDataRight; struct IconManager { IconManager(GridDataLeft& provLeft, GridDataRight& provRight, IconBuffer::IconSize sz) : - iconBuffer(sz), + iconBuffer(sz), fileIcon (IconBuffer::genericFileIcon(sz)), dirIcon (IconBuffer::genericDirIcon (sz)), - linkOverlayIcon(IconBuffer::linkOverlayIcon(sz)), + linkOverlayIcon(IconBuffer::linkOverlayIcon(sz)), iconUpdater(make_unique<IconUpdater>(provLeft, provRight, iconBuffer)) {} void startIconUpdater(); IconBuffer& refIconBuffer() { return iconBuffer; } - wxBitmap getGenericFileIcon() const { return fileIcon; } - wxBitmap getGenericDirIcon () const { return dirIcon; } - wxBitmap getLinkOverlayIcon() const { return linkOverlayIcon; } + wxBitmap getGenericFileIcon() const { return fileIcon; } + wxBitmap getGenericDirIcon () const { return dirIcon; } + wxBitmap getLinkOverlayIcon() const { return linkOverlayIcon; } private: IconBuffer iconBuffer; - const wxBitmap fileIcon; - const wxBitmap dirIcon; - const wxBitmap linkOverlayIcon; + const wxBitmap fileIcon; + const wxBitmap dirIcon; + const wxBitmap linkOverlayIcon; std::unique_ptr<IconUpdater> iconUpdater; //bind ownership to GridDataRim<>! }; @@ -221,7 +221,7 @@ public: GridDataRim(const std::shared_ptr<const zen::GridView>& gridDataView, Grid& grid) : GridDataBase(grid, gridDataView) {} void setIconManager(const std::shared_ptr<IconManager>& iconMgr) { iconMgr_ = iconMgr; } - + void updateNewAndGetUnbufferedIcons(std::vector<Zstring>& newLoad) //loads all not yet drawn icons { if (iconMgr_) @@ -255,7 +255,7 @@ public: } } - void getUnbufferedIconsForPreload(std::vector<std::pair<ptrdiff_t, Zstring>>& newLoad) //return (priority, filename) list + void getUnbufferedIconsForPreload(std::vector<std::pair<ptrdiff_t, Zstring>>& newLoad) //return (priority, filepath) list { if (iconMgr_) { @@ -404,18 +404,18 @@ private: switch (colType_) { case COL_TYPE_FULL_PATH: - value = toWx(appendSeparator(beforeLast(fileObj.getBaseDirPf<side>() + fileObj.getObjRelativeName(), FILE_NAME_SEPARATOR))); + value = toWx(fileObj.getFullPath<side>()); break; - case COL_TYPE_FILENAME: //filename - value = toWx(fileObj.getShortName<side>()); + case COL_TYPE_FILENAME: + value = toWx(fileObj.getItemName<side>()); break; - case COL_TYPE_REL_PATH: //relative path - value = toWx(beforeLast(fileObj.getObjRelativeName(), FILE_NAME_SEPARATOR)); //returns empty string if ch not found + case COL_TYPE_REL_FOLDER: + value = toWx(beforeLast(fileObj.getPairRelativePath(), FILE_NAME_SEPARATOR)); //returns empty string if ch not found break; - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: value = toWx(fileObj.getBaseDirPf<side>()); break; - case COL_TYPE_SIZE: //file size + case COL_TYPE_SIZE: if (!fsObj_.isEmpty<side>()) value = zen::toGuiString(fileObj.getFileSize<side>()); @@ -423,12 +423,12 @@ private: //if (!fsObj_.isEmpty<side>()) // value = toGuiString(fileObj.getFileId<side>().second) + L" " + toGuiString(fileObj.getFileId<side>().first); break; - case COL_TYPE_DATE: //date + case COL_TYPE_DATE: if (!fsObj_.isEmpty<side>()) value = zen::utcToLocalTimeString(fileObj.getLastWriteTime<side>()); break; - case COL_TYPE_EXTENSION: //file extension - value = toWx(getExtension(fileObj.getShortName<side>())); + case COL_TYPE_EXTENSION: + value = toWx(getExtension(fileObj.getItemName<side>())); break; } } @@ -438,27 +438,27 @@ private: switch (colType_) { case COL_TYPE_FULL_PATH: - value = toWx(appendSeparator(beforeLast(linkObj.getBaseDirPf<side>() + linkObj.getObjRelativeName(), FILE_NAME_SEPARATOR))); + value = toWx(linkObj.getFullPath<side>()); break; - case COL_TYPE_FILENAME: //filename - value = toWx(linkObj.getShortName<side>()); + case COL_TYPE_FILENAME: + value = toWx(linkObj.getItemName<side>()); break; - case COL_TYPE_REL_PATH: //relative path - value = toWx(beforeLast(linkObj.getObjRelativeName(), FILE_NAME_SEPARATOR)); //returns empty string if ch not found + case COL_TYPE_REL_FOLDER: + value = toWx(beforeLast(linkObj.getPairRelativePath(), FILE_NAME_SEPARATOR)); //returns empty string if ch not found break; - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: value = toWx(linkObj.getBaseDirPf<side>()); break; - case COL_TYPE_SIZE: //file size + case COL_TYPE_SIZE: if (!fsObj_.isEmpty<side>()) value = L"<" + _("Symlink") + L">"; break; - case COL_TYPE_DATE: //date + case COL_TYPE_DATE: if (!fsObj_.isEmpty<side>()) value = zen::utcToLocalTimeString(linkObj.getLastWriteTime<side>()); break; - case COL_TYPE_EXTENSION: //file extension - value = toWx(getExtension(linkObj.getShortName<side>())); + case COL_TYPE_EXTENSION: + value = toWx(getExtension(linkObj.getItemName<side>())); break; } } @@ -468,26 +468,26 @@ private: switch (colType_) { case COL_TYPE_FULL_PATH: - value = toWx(appendSeparator(beforeLast(dirObj.getBaseDirPf<side>() + dirObj.getObjRelativeName(), FILE_NAME_SEPARATOR))); + value = toWx(dirObj.getFullPath<side>()); break; case COL_TYPE_FILENAME: - value = toWx(dirObj.getShortName<side>()); + value = toWx(dirObj.getItemName<side>()); break; - case COL_TYPE_REL_PATH: - value = toWx(beforeLast(dirObj.getObjRelativeName(), FILE_NAME_SEPARATOR)); //returns empty string if ch not found + case COL_TYPE_REL_FOLDER: + value = toWx(beforeLast(dirObj.getPairRelativePath(), FILE_NAME_SEPARATOR)); //returns empty string if ch not found break; - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: value = toWx(dirObj.getBaseDirPf<side>()); break; - case COL_TYPE_SIZE: //file size + case COL_TYPE_SIZE: if (!fsObj_.isEmpty<side>()) value = L"<" + _("Folder") + L">"; break; - case COL_TYPE_DATE: //date + case COL_TYPE_DATE: if (!fsObj_.isEmpty<side>()) value = wxEmptyString; break; - case COL_TYPE_EXTENSION: //file extension + case COL_TYPE_EXTENSION: value = wxEmptyString; break; } @@ -623,9 +623,9 @@ private: return _("Full path"); case COL_TYPE_FILENAME: return _("Name"); //= short name - case COL_TYPE_REL_PATH: + case COL_TYPE_REL_FOLDER: return _("Relative path"); - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: return _("Base folder"); case COL_TYPE_SIZE: return _("Size"); @@ -682,12 +682,12 @@ private: virtual void visit(const FilePair& fileObj) { - ii_.iconPath = fileObj.getFullName<side>(); + ii_.iconPath = fileObj.getFullPath<side>(); ii_.drawAsLink = fileObj.isFollowedSymlink<side>() || hasLinkExtension(ii_.iconPath); } virtual void visit(const SymlinkPair& linkObj) { - ii_.iconPath = linkObj.getFullName<side>(); + ii_.iconPath = linkObj.getFullPath<side>(); ii_.drawAsLink = true; } virtual void visit(const DirPair& dirObj) @@ -711,8 +711,8 @@ private: if (fsObj && !fsObj->isEmpty<side>()) { toolTip = toWx(getGridDataView() && getGridDataView()->getFolderPairCount() > 1 ? - fsObj->getFullName<side>() : - fsObj->getRelativeName<side>()); + fsObj->getFullPath<side>() : + fsObj->getRelativePath<side>()); struct AssembleTooltip : public FSObjectVisitor { @@ -721,7 +721,7 @@ private: virtual void visit(const FilePair& fileObj) { tipMsg_ += L"\n" + - _("Size:") + L" " + zen::filesizeToShortString(to<Int64>(fileObj.getFileSize<side>())) + L"\n" + + _("Size:") + L" " + zen::filesizeToShortString(fileObj.getFileSize<side>()) + L"\n" + _("Date:") + L" " + zen::utcToLocalTimeString(fileObj.getLastWriteTime<side>()); } @@ -1731,7 +1731,7 @@ void IconManager::startIconUpdater() { if (iconUpdater) iconUpdater->start(); } void gridview::setupIcons(Grid& gridLeft, Grid& gridCenter, Grid& gridRight, bool show, IconBuffer::IconSize sz) { - auto* provLeft = dynamic_cast<GridDataLeft *>(gridLeft .getDataProvider()); + auto* provLeft = dynamic_cast<GridDataLeft*>(gridLeft .getDataProvider()); auto* provRight = dynamic_cast<GridDataRight*>(gridRight.getDataProvider()); if (provLeft && provRight) diff --git a/FreeFileSync/Source/ui/dir_name.cpp b/FreeFileSync/Source/ui/dir_name.cpp index 941fa58d..2b020383 100644 --- a/FreeFileSync/Source/ui/dir_name.cpp +++ b/FreeFileSync/Source/ui/dir_name.cpp @@ -32,9 +32,9 @@ const wxEventType zen::EVENT_ON_DIR_MANUAL_CORRECTION = wxNewEventType(); namespace { -void setDirectoryNameImpl(const wxString& dirname, wxWindow& tooltipWnd, wxStaticText* staticText) +void setDirectoryNameImpl(const wxString& dirpath, wxWindow& tooltipWnd, wxStaticText* staticText) { - const wxString dirFormatted = utfCvrtTo<wxString>(getFormattedDirectoryName(toZ(dirname))); //may block when resolving [<volume name>] + const wxString dirFormatted = utfCvrtTo<wxString>(getFormattedDirectoryPath(toZ(dirpath))); //may block when resolving [<volume name>] tooltipWnd.SetToolTip(nullptr); //workaround wxComboBox bug http://trac.wxwidgets.org/ticket/10512 / http://trac.wxwidgets.org/ticket/12659 tooltipWnd.SetToolTip(dirFormatted); //who knows when the real bugfix reaches mere mortals via an official release... @@ -42,7 +42,7 @@ void setDirectoryNameImpl(const wxString& dirname, wxWindow& tooltipWnd, wxStati if (staticText) { //change static box label only if there is a real difference to what is shown in wxTextCtrl anyway - wxString dirNormalized = dirname; + wxString dirNormalized = dirpath; trim(dirNormalized); if (!dirNormalized.empty()) if (!endsWith(dirNormalized, FILE_NAME_SEPARATOR)) @@ -53,25 +53,25 @@ void setDirectoryNameImpl(const wxString& dirname, wxWindow& tooltipWnd, wxStati } -void setDirectoryName(const wxString& dirname, +void setDirectoryName(const wxString& dirpath, wxTextCtrl* txtCtrl, wxWindow& tooltipWnd, wxStaticText* staticText) //pointers are optional { if (txtCtrl) - txtCtrl->ChangeValue(dirname); - setDirectoryNameImpl(dirname, tooltipWnd, staticText); + txtCtrl->ChangeValue(dirpath); + setDirectoryNameImpl(dirpath, tooltipWnd, staticText); } -void setDirectoryName(const wxString& dirname, +void setDirectoryName(const wxString& dirpath, FolderHistoryBox* comboBox, wxWindow& tooltipWnd, wxStaticText* staticText) //pointers are optional { if (comboBox) - comboBox->setValue(dirname); - setDirectoryNameImpl(dirname, tooltipWnd, staticText); + comboBox->setValue(dirpath); + setDirectoryNameImpl(dirpath, tooltipWnd, staticText); } } //############################################################################################################## @@ -79,13 +79,13 @@ void setDirectoryName(const wxString& dirname, template <class NameControl> DirectoryName<NameControl>::DirectoryName(wxWindow& dropWindow, wxButton& selectButton, - NameControl& dirName, + NameControl& dirpath, wxStaticText* staticText, wxWindow* dropWindow2) : dropWindow_(dropWindow), dropWindow2_(dropWindow2), selectButton_(selectButton), - dirName_(dirName), + dirpath_(dirpath), staticText_(staticText) { //prepare drag & drop @@ -98,9 +98,9 @@ DirectoryName<NameControl>::DirectoryName(wxWindow& dropWindow, dropWindow2_->Connect(EVENT_DROP_FILE, FileDropEventHandler(DirectoryName::onFilesDropped), nullptr, this); } - //keep dirPicker and dirName synchronous - dirName_ .Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler (DirectoryName::onMouseWheel ), nullptr, this); - dirName_ .Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(DirectoryName::onWriteDirManually), nullptr, this); + //keep dirPicker and dirpath synchronous + dirpath_ .Connect(wxEVT_MOUSEWHEEL, wxMouseEventHandler (DirectoryName::onMouseWheel ), nullptr, this); + dirpath_ .Connect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(DirectoryName::onWriteDirManually), nullptr, this); selectButton_.Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DirectoryName::onSelectDir ), nullptr, this); } @@ -112,8 +112,8 @@ DirectoryName<NameControl>::~DirectoryName() if (dropWindow2_) dropWindow2_->Disconnect(EVENT_DROP_FILE, FileDropEventHandler(DirectoryName::onFilesDropped), nullptr, this); - dirName_ .Disconnect(wxEVT_MOUSEWHEEL, wxMouseEventHandler (DirectoryName::onMouseWheel ), nullptr, this); - dirName_ .Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(DirectoryName::onWriteDirManually), nullptr, this); + dirpath_ .Disconnect(wxEVT_MOUSEWHEEL, wxMouseEventHandler (DirectoryName::onMouseWheel ), nullptr, this); + dirpath_ .Disconnect(wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler(DirectoryName::onWriteDirManually), nullptr, this); selectButton_.Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(DirectoryName::onSelectDir ), nullptr, this); } @@ -125,7 +125,7 @@ void DirectoryName<NameControl>::onMouseWheel(wxMouseEvent& event) //additionally this will delete manual entries, although all the users wanted is scroll the parent window! //redirect to parent scrolled window! - wxWindow* wnd = &dirName_; + wxWindow* wnd = &dirpath_; while ((wnd = wnd->GetParent()) != nullptr) //silence MSVC warning if (dynamic_cast<wxScrolledWindow*>(wnd) != nullptr) if (wxEvtHandler* evtHandler = wnd->GetEventHandler()) @@ -149,7 +149,7 @@ void DirectoryName<NameControl>::onFilesDropped(FileDropEvent& event) { const wxString fileName = event.getFiles()[0]; if (dirExists(toZ(fileName))) - setDirectoryName(fileName, &dirName_, dirName_, staticText_); + setDirectoryName(fileName, &dirpath_, dirpath_, staticText_); else { wxString parentName = beforeLast(fileName, utfCvrtTo<wxString>(FILE_NAME_SEPARATOR)); //returns empty string if ch not found @@ -158,9 +158,9 @@ void DirectoryName<NameControl>::onFilesDropped(FileDropEvent& event) parentName += FILE_NAME_SEPARATOR; #endif if (dirExists(toZ(parentName))) - setDirectoryName(parentName, &dirName_, dirName_, staticText_); + setDirectoryName(parentName, &dirpath_, dirpath_, staticText_); else //set original name unconditionally: usecase: inactive mapped network shares - setDirectoryName(fileName, &dirName_, dirName_, staticText_); + setDirectoryName(fileName, &dirpath_, dirpath_, staticText_); } //notify action invoked by user @@ -175,7 +175,7 @@ void DirectoryName<NameControl>::onFilesDropped(FileDropEvent& event) template <class NameControl> void DirectoryName<NameControl>::onWriteDirManually(wxCommandEvent& event) { - setDirectoryName(event.GetString(), static_cast<NameControl*>(nullptr), dirName_, staticText_); + setDirectoryName(event.GetString(), static_cast<NameControl*>(nullptr), dirpath_, staticText_); wxCommandEvent dummy(EVENT_ON_DIR_MANUAL_CORRECTION); ProcessEvent(dummy); @@ -186,16 +186,16 @@ void DirectoryName<NameControl>::onWriteDirManually(wxCommandEvent& event) template <class NameControl> void DirectoryName<NameControl>::onSelectDir(wxCommandEvent& event) { - wxString defaultDirname; //default selection for dir picker + wxString defaultdirpath; //default selection for dir picker { - const Zstring dirFmt = getFormattedDirectoryName(toZ(getName())); + const Zstring dirFmt = getFormattedDirectoryPath(toZ(getPath())); if (!dirFmt.empty()) { //convert to Zstring first: we don't want to pass wxString by value and risk MT issues! auto ft = async([=] { return zen::dirExists(dirFmt); }); if (ft.timed_wait(boost::posix_time::milliseconds(200)) && ft.get()) //potentially slow network access: wait 200ms at most - defaultDirname = utfCvrtTo<wxString>(dirFmt); + defaultdirpath = utfCvrtTo<wxString>(dirFmt); } } @@ -220,7 +220,7 @@ void DirectoryName<NameControl>::onSelectDir(wxCommandEvent& event) }; //some random GUID => have Windows save IFileDialog state separately from other file/dir pickers! showFolderPicker(static_cast<HWND>(selectButton_.GetHWND()), //in; ==HWND - defaultDirname.empty() ? static_cast<const wchar_t*>(nullptr) : defaultDirname.c_str(), //in, optional! + defaultdirpath.empty() ? static_cast<const wchar_t*>(nullptr) : defaultdirpath.c_str(), //in, optional! &guid, selectedFolder, //out: call freeString() after use! cancelled, //out @@ -238,13 +238,13 @@ void DirectoryName<NameControl>::onSelectDir(wxCommandEvent& event) #endif if (!newFolder.get()) { - wxDirDialog dirPicker(&selectButton_, _("Select a folder"), defaultDirname); //put modal wxWidgets dialogs on stack: creating on freestore leads to memleak! + wxDirDialog dirPicker(&selectButton_, _("Select a folder"), defaultdirpath); //put modal wxWidgets dialogs on stack: creating on freestore leads to memleak! if (dirPicker.ShowModal() != wxID_OK) return; newFolder = make_unique<wxString>(dirPicker.GetPath()); } - setDirectoryName(*newFolder, &dirName_, dirName_, staticText_); + setDirectoryName(*newFolder, &dirpath_, dirpath_, staticText_); //notify action invoked by user wxCommandEvent dummy(EVENT_ON_DIR_SELECTED); @@ -253,16 +253,16 @@ void DirectoryName<NameControl>::onSelectDir(wxCommandEvent& event) template <class NameControl> -wxString DirectoryName<NameControl>::getName() const +wxString DirectoryName<NameControl>::getPath() const { - return dirName_.GetValue(); + return dirpath_.GetValue(); } template <class NameControl> -void DirectoryName<NameControl>::setName(const wxString& dirname) +void DirectoryName<NameControl>::setPath(const wxString& dirpath) { - setDirectoryName(dirname, &dirName_, dirName_, staticText_); + setDirectoryName(dirpath, &dirpath_, dirpath_, staticText_); } diff --git a/FreeFileSync/Source/ui/dir_name.h b/FreeFileSync/Source/ui/dir_name.h index 21f2b574..a2f69698 100644 --- a/FreeFileSync/Source/ui/dir_name.h +++ b/FreeFileSync/Source/ui/dir_name.h @@ -35,14 +35,14 @@ class DirectoryName: public wxEvtHandler public: DirectoryName(wxWindow& dropWindow, wxButton& selectButton, - NameControl& dirName, + NameControl& dirpath, wxStaticText* staticText = nullptr, //optional wxWindow* dropWindow2 = nullptr); // ~DirectoryName(); - wxString getName() const; - void setName(const wxString& dirname); + wxString getPath() const; + void setPath(const wxString& dirpath); private: virtual bool acceptDrop(const std::vector<wxString>& droppedFiles, const wxPoint& clientPos, const wxWindow& wnd) { return true; }; //return true if drop should be processed @@ -55,7 +55,7 @@ private: wxWindow& dropWindow_; wxWindow* dropWindow2_; wxButton& selectButton_; - NameControl& dirName_; + NameControl& dirpath_; wxStaticText* staticText_; //optional }; } diff --git a/FreeFileSync/Source/ui/folder_history_box.cpp b/FreeFileSync/Source/ui/folder_history_box.cpp index a0737c23..511686c0 100644 --- a/FreeFileSync/Source/ui/folder_history_box.cpp +++ b/FreeFileSync/Source/ui/folder_history_box.cpp @@ -69,13 +69,13 @@ void FolderHistoryBox::OnRequireHistoryUpdate(wxEvent& event) } //set value and update list are technically entangled: see potential bug description below -void FolderHistoryBox::setValueAndUpdateList(const wxString& dirname) +void FolderHistoryBox::setValueAndUpdateList(const wxString& dirpath) { //populate selection list.... std::vector<wxString> dirList; { //add some aliases to allow user changing to volume name and back, if possible - std::vector<Zstring> aliases = getDirectoryAliases(toZ(dirname)); //may block when resolving [<volume name>] + std::vector<Zstring> aliases = getDirectoryAliases(toZ(dirpath)); //may block when resolving [<volume name>] std::transform(aliases.begin(), aliases.end(), std::back_inserter(dirList), [](const Zstring& str) { return utfCvrtTo<wxString>(str); }); } if (sharedHistory_.get()) @@ -94,8 +94,8 @@ void FolderHistoryBox::setValueAndUpdateList(const wxString& dirname) //attention: if the target value is not part of the dropdown list, SetValue() will look for a string that *starts with* this value: //e.g. if the dropdown list contains "222" SetValue("22") will erroneously set and select "222" instead, while "111" would be set correctly! // -> by design on Windows! - if (std::find(dirList.begin(), dirList.end(), dirname) == dirList.end()) - dirList.insert(dirList.begin(), dirname); + if (std::find(dirList.begin(), dirList.end(), dirpath) == dirList.end()) + dirList.insert(dirList.begin(), dirpath); //this->Clear(); -> NO! emits yet another wxEVT_COMMAND_TEXT_UPDATED!!! wxItemContainer::Clear(); //suffices to clear the selection items only! @@ -103,7 +103,7 @@ void FolderHistoryBox::setValueAndUpdateList(const wxString& dirname) for (const wxString& dir : dirList) this->Append(dir); //this->SetSelection(wxNOT_FOUND); //don't select anything - ChangeValue(dirname); //preserve main text! + ChangeValue(dirpath); //preserve main text! } diff --git a/FreeFileSync/Source/ui/folder_history_box.h b/FreeFileSync/Source/ui/folder_history_box.h index a20a47c5..e310044f 100644 --- a/FreeFileSync/Source/ui/folder_history_box.h +++ b/FreeFileSync/Source/ui/folder_history_box.h @@ -21,40 +21,40 @@ class FolderHistory public: FolderHistory() : maxSize_(0) {} - FolderHistory(const std::vector<Zstring>& dirnames, size_t maxSize) : + FolderHistory(const std::vector<Zstring>& dirpaths, size_t maxSize) : maxSize_(maxSize), - dirnames_(dirnames) + dirpaths_(dirpaths) { - if (dirnames_.size() > maxSize_) //keep maximal size of history list - dirnames_.resize(maxSize_); + if (dirpaths_.size() > maxSize_) //keep maximal size of history list + dirpaths_.resize(maxSize_); } - const std::vector<Zstring>& getList() const { return dirnames_; } + const std::vector<Zstring>& getList() const { return dirpaths_; } static const wxString separationLine() { return L"---------------------------------------------------------------------------------------------------------------"; } - void addItem(const Zstring& dirname) + void addItem(const Zstring& dirpath) { - if (dirname.empty() || dirname == zen::utfCvrtTo<Zstring>(separationLine())) + if (dirpath.empty() || dirpath == zen::utfCvrtTo<Zstring>(separationLine())) return; - Zstring nameTmp = dirname; + Zstring nameTmp = dirpath; zen::trim(nameTmp); //insert new folder or put it to the front if already existing - vector_remove_if(dirnames_, [&](const Zstring& item) { return ::EqualFilename()(item, nameTmp); }); + vector_remove_if(dirpaths_, [&](const Zstring& item) { return ::EqualFilename()(item, nameTmp); }); - dirnames_.insert(dirnames_.begin(), nameTmp); + dirpaths_.insert(dirpaths_.begin(), nameTmp); - if (dirnames_.size() > maxSize_) //keep maximal size of history list - dirnames_.resize(maxSize_); + if (dirpaths_.size() > maxSize_) //keep maximal size of history list + dirpaths_.resize(maxSize_); } - void delItem(const Zstring& dirname) { zen::vector_remove_if(dirnames_, [&](const Zstring& entry) { return ::EqualFilename()(entry, dirname); }); } + void delItem(const Zstring& dirpath) { zen::vector_remove_if(dirpaths_, [&](const Zstring& entry) { return ::EqualFilename()(entry, dirpath); }); } private: size_t maxSize_; - std::vector<Zstring> dirnames_; + std::vector<Zstring> dirpaths_; }; @@ -74,9 +74,9 @@ public: void init(const std::shared_ptr<FolderHistory>& sharedHistory) { sharedHistory_ = sharedHistory; } - void setValue(const wxString& dirname) + void setValue(const wxString& dirpath) { - setValueAndUpdateList(dirname); //required for setting value correctly; Linux: ensure the dropdown is shown as being populated + setValueAndUpdateList(dirpath); //required for setting value correctly; Linux: ensure the dropdown is shown as being populated } // GetValue @@ -84,7 +84,7 @@ public: private: void OnKeyEvent(wxKeyEvent& event); void OnRequireHistoryUpdate(wxEvent& event); - void setValueAndUpdateList(const wxString& dirname); + void setValueAndUpdateList(const wxString& dirpath); std::shared_ptr<FolderHistory> sharedHistory_; }; diff --git a/FreeFileSync/Source/ui/grid_view.cpp b/FreeFileSync/Source/ui/grid_view.cpp index 27b0d6ae..704a5306 100644 --- a/FreeFileSync/Source/ui/grid_view.cpp +++ b/FreeFileSync/Source/ui/grid_view.cpp @@ -8,7 +8,6 @@ #include "sorting.h" #include "../synchronization.h" #include <zen/stl_tools.h> -//#include <zen/perf.h> using namespace zen; @@ -120,7 +119,9 @@ GridView::StatusCmpResult::StatusCmpResult() : filesOnLeftView (0), foldersOnLeftView (0), filesOnRightView (0), - foldersOnRightView(0) {} + foldersOnRightView(0), + filesizeLeftView (0), + filesizeRightView (0) {} GridView::StatusCmpResult GridView::updateCmpResult(bool showExcluded, //maps sortedRef to viewRef @@ -198,7 +199,9 @@ GridView::StatusSyncPreview::StatusSyncPreview() : filesOnLeftView (0), foldersOnLeftView (0), filesOnRightView (0), - foldersOnRightView(0) {} + foldersOnRightView(0), + filesizeLeftView (0), + filesizeRightView (0) {} GridView::StatusSyncPreview GridView::updateSyncPreview(bool showExcluded, //maps sortedRef to viewRef @@ -352,18 +355,28 @@ void GridView::setData(FolderComparison& folderCmp) //------------------------------------ SORTING TEMPLATES ------------------------------------------------ -template <bool ascending> -class GridView::LessRelativeName : public std::binary_function<RefIndex, RefIndex, bool> +template <bool ascending, SelectedSide side> +struct GridView::LessFullPath { -public: bool operator()(const RefIndex a, const RefIndex b) const { - //presort by folder pair - if (a.folderIndex != b.folderIndex) - return ascending ? - a.folderIndex < b.folderIndex : - a.folderIndex > b.folderIndex; + const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); + const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); + if (!fsObjA) //invalid rows shall appear at the end + return false; + else if (!fsObjB) + return true; + + return lessFullPath<ascending, side>(*fsObjA, *fsObjB); + } +}; + +template <bool ascending> +struct GridView::LessRelativeFolder +{ + bool operator()(const RefIndex a, const RefIndex b) const + { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); const FileSystemObject* fsObjB = FileSystemObject::retrieve(b.objId); if (!fsObjA) //invalid rows shall appear at the end @@ -371,15 +384,20 @@ public: else if (!fsObjB) return true; - return lessRelativeName<ascending>(*fsObjA, *fsObjB); + //presort by folder pair + if (a.folderIndex != b.folderIndex) + return ascending ? + a.folderIndex < b.folderIndex : + a.folderIndex > b.folderIndex; + + return lessRelativeFolder<ascending>(*fsObjA, *fsObjB); } }; -template <bool ascending, zen::SelectedSide side> -class GridView::LessShortFileName : public std::binary_function<RefIndex, RefIndex, bool> +template <bool ascending, SelectedSide side> +struct GridView::LessShortFileName { -public: bool operator()(const RefIndex a, const RefIndex b) const { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); @@ -394,10 +412,9 @@ public: }; -template <bool ascending, zen::SelectedSide side> -class GridView::LessFilesize : public std::binary_function<RefIndex, RefIndex, bool> +template <bool ascending, SelectedSide side> +struct GridView::LessFilesize { -public: bool operator()(const RefIndex a, const RefIndex b) const { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); @@ -412,10 +429,9 @@ public: }; -template <bool ascending, zen::SelectedSide side> -class GridView::LessFiletime : public std::binary_function<RefIndex, RefIndex, bool> +template <bool ascending, SelectedSide side> +struct GridView::LessFiletime { -public: bool operator()(const RefIndex a, const RefIndex b) const { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); @@ -430,10 +446,9 @@ public: }; -template <bool ascending, zen::SelectedSide side> -class GridView::LessExtension : public std::binary_function<RefIndex, RefIndex, bool> +template <bool ascending, SelectedSide side> +struct GridView::LessExtension { -public: bool operator()(const RefIndex a, const RefIndex b) const { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); @@ -449,9 +464,8 @@ public: template <bool ascending> -class GridView::LessCmpResult : public std::binary_function<RefIndex, RefIndex, bool> +struct GridView::LessCmpResult { -public: bool operator()(const RefIndex a, const RefIndex b) const { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); @@ -467,9 +481,8 @@ public: template <bool ascending> -class GridView::LessSyncDirection : public std::binary_function<RefIndex, RefIndex, bool> +struct GridView::LessSyncDirection { -public: bool operator()(const RefIndex a, const RefIndex b) const { const FileSystemObject* fsObjA = FileSystemObject::retrieve(a.objId); @@ -492,9 +505,9 @@ bool GridView::getDefaultSortDirection(ColumnTypeRim type) //true: ascending; fa case COL_TYPE_DATE: return false; - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: case COL_TYPE_FULL_PATH: - case COL_TYPE_REL_PATH: + case COL_TYPE_REL_FOLDER: case COL_TYPE_FILENAME: case COL_TYPE_EXTENSION: return true; @@ -514,9 +527,14 @@ void GridView::sortView(ColumnTypeRim type, bool onLeft, bool ascending) switch (type) { case COL_TYPE_FULL_PATH: - case COL_TYPE_REL_PATH: - if ( ascending) std::sort(sortedRef.begin(), sortedRef.end(), LessRelativeName<true>()); - else if (!ascending) std::sort(sortedRef.begin(), sortedRef.end(), LessRelativeName<false>()); + if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), LessFullPath<true, LEFT_SIDE >()); + else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), LessFullPath<true, RIGHT_SIDE>()); + else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), LessFullPath<false, LEFT_SIDE >()); + else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), LessFullPath<false, RIGHT_SIDE>()); + break; + case COL_TYPE_REL_FOLDER: + if ( ascending) std::sort(sortedRef.begin(), sortedRef.end(), LessRelativeFolder<true>()); + else if (!ascending) std::sort(sortedRef.begin(), sortedRef.end(), LessRelativeFolder<false>()); break; case COL_TYPE_FILENAME: if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), LessShortFileName<true, LEFT_SIDE >()); @@ -550,7 +568,7 @@ void GridView::sortView(ColumnTypeRim type, bool onLeft, bool ascending) // if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), LessSyncDirection<true >()); // else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), LessSyncDirection<false>()); // break; - case COL_TYPE_DIRECTORY: + case COL_TYPE_BASE_DIRECTORY: if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), [](const RefIndex a, const RefIndex b) { return a.folderIndex < b.folderIndex; }); else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), [](const RefIndex a, const RefIndex b) { return a.folderIndex > b.folderIndex; }); break; diff --git a/FreeFileSync/Source/ui/grid_view.h b/FreeFileSync/Source/ui/grid_view.h index bf2a51ea..9c0dd32b 100644 --- a/FreeFileSync/Source/ui/grid_view.h +++ b/FreeFileSync/Source/ui/grid_view.h @@ -49,8 +49,8 @@ public: unsigned int filesOnRightView; unsigned int foldersOnRightView; - zen::UInt64 filesizeLeftView; - zen::UInt64 filesizeRightView; + std::uint64_t filesizeLeftView; + std::uint64_t filesizeRightView; }; //comparison results view @@ -84,8 +84,8 @@ public: unsigned int filesOnRightView; unsigned int foldersOnRightView; - zen::UInt64 filesizeLeftView; - zen::UInt64 filesizeRightView; + std::uint64_t filesizeLeftView; + std::uint64_t filesizeRightView; }; //synchronization preview @@ -155,26 +155,29 @@ private: class SerializeHierarchy; //sorting classes + template <bool ascending, SelectedSide side> + struct LessFullPath; + template <bool ascending> - class LessRelativeName; + struct LessRelativeFolder; template <bool ascending, SelectedSide side> - class LessShortFileName; + struct LessShortFileName; template <bool ascending, SelectedSide side> - class LessFilesize; + struct LessFilesize; template <bool ascending, SelectedSide side> - class LessFiletime; + struct LessFiletime; template <bool ascending, SelectedSide side> - class LessExtension; + struct LessExtension; template <bool ascending> - class LessCmpResult; + struct LessCmpResult; template <bool ascending> - class LessSyncDirection; + struct LessSyncDirection; std::unique_ptr<SortInfo> currentSort; }; diff --git a/FreeFileSync/Source/ui/gui_generated.cpp b/FreeFileSync/Source/ui/gui_generated.cpp index aa196dff..8ed5fe52 100644 --- a/FreeFileSync/Source/ui/gui_generated.cpp +++ b/FreeFileSync/Source/ui/gui_generated.cpp @@ -19,947 +19,952 @@ MainDialogGenerated::MainDialogGenerated( 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( 640,400 ), wxDefaultSize ); - - m_menubar1 = new wxMenuBar( 0 ); - m_menuFile = new wxMenu(); - m_menuItemNew = new wxMenuItem( m_menuFile, wxID_NEW, wxString( _("&New") ) + wxT('\t') + wxT("Ctrl+N"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemNew ); - - m_menuItemLoad = new wxMenuItem( m_menuFile, wxID_OPEN, wxString( _("&Open...") ) + wxT('\t') + wxT("Ctrl+O"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemLoad ); - - m_menuItemSave = new wxMenuItem( m_menuFile, wxID_SAVE, wxString( _("&Save") ) + wxT('\t') + wxT("Ctrl+S"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemSave ); - - m_menuItemSaveAs = new wxMenuItem( m_menuFile, wxID_SAVEAS, wxString( _("Save &as...") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemSaveAs ); - - m_menuItemSaveAsBatch = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("Save as &batch job...") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemSaveAsBatch ); - - m_menuFile->AppendSeparator(); - - m_menuItemCompare = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("Start &comparison") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemCompare ); - - m_menuItemSynchronize = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("Start synchronization") ) + wxT('\t') + wxT("F9"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemSynchronize ); - - m_menuFile->AppendSeparator(); - - wxMenuItem* m_menuItem4; - m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("&Quit") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItem4 ); - - m_menubar1->Append( m_menuFile, _("File") ); - - m_menuTools = new wxMenu(); - m_menuItemOptions = new wxMenuItem( m_menuTools, wxID_PREFERENCES, wxString( _("&Options") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuTools->Append( m_menuItemOptions ); - - m_menuTools->AppendSeparator(); - - m_menuLanguages = new wxMenu(); - wxMenuItem* m_menuLanguagesItem = new wxMenuItem( m_menuTools, wxID_ANY, _("&Language"), wxEmptyString, wxITEM_NORMAL, m_menuLanguages ); - m_menuTools->Append( m_menuLanguagesItem ); - - wxMenuItem* m_menuItem15; - m_menuItem15 = new wxMenuItem( m_menuTools, wxID_FIND, wxString( _("&Find...") ) + wxT('\t') + wxT("Ctrl+F"), wxEmptyString, wxITEM_NORMAL ); - m_menuTools->Append( m_menuItem15 ); - - wxMenuItem* m_menuItem5; - m_menuItem5 = new wxMenuItem( m_menuTools, wxID_ANY, wxString( _("&Export file list...") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuTools->Append( m_menuItem5 ); - - m_menubar1->Append( m_menuTools, _("&Tools") ); - - m_menuHelp = new wxMenu(); - m_menuItemHelp = new wxMenuItem( m_menuHelp, wxID_HELP, wxString( _("&View help") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); - m_menuHelp->Append( m_menuItemHelp ); - - m_menuCheckVersion = new wxMenu(); - wxMenuItem* m_menuCheckVersionItem = new wxMenuItem( m_menuHelp, wxID_ANY, _("&Check for new version"), wxEmptyString, wxITEM_NORMAL, m_menuCheckVersion ); - m_menuItemCheckVersionNow = new wxMenuItem( m_menuCheckVersion, wxID_ANY, wxString( _("&Check now") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuCheckVersion->Append( m_menuItemCheckVersionNow ); - - m_menuItemCheckVersionAuto = new wxMenuItem( m_menuCheckVersion, wxID_ANY, wxString( _("Check &automatically once a week") ) , wxEmptyString, wxITEM_CHECK ); - m_menuCheckVersion->Append( m_menuItemCheckVersionAuto ); - m_menuItemCheckVersionAuto->Check( true ); - - m_menuHelp->Append( m_menuCheckVersionItem ); - - 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 ); - - m_menubar1->Append( m_menuHelp, _("&Help") ); - - this->SetMenuBar( m_menubar1 ); - - bSizerPanelHolder = new wxBoxSizer( wxVERTICAL ); - - m_panelTopButtons = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1791; - bSizer1791 = new wxBoxSizer( wxVERTICAL ); - - bSizerTopButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonCancel = new zen::BitmapTextButton( m_panelTopButtons, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonCancel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - m_buttonCancel->Enable( false ); - m_buttonCancel->Hide(); - - bSizerTopButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_buttonCompare = new zen::BitmapTextButton( m_panelTopButtons, wxID_ANY, _("Compare"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonCompare->SetDefault(); - m_buttonCompare->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - m_buttonCompare->SetToolTip( _("dummy") ); - - bSizerTopButtons->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerTopButtons->Add( 3, 3, 0, 0, 5 ); - - m_bpButtonCmpConfig = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); - m_bpButtonCmpConfig->SetToolTip( _("dummy") ); - - bSizerTopButtons->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerTopButtons->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerTopButtons->Add( 5, 5, 0, 0, 5 ); - - m_bpButtonFilter = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 60,-1 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - bSizerTopButtons->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerTopButtons->Add( 5, 5, 0, 0, 5 ); - - - bSizerTopButtons->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncConfig = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); - m_bpButtonSyncConfig->SetToolTip( _("dummy") ); - - bSizerTopButtons->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerTopButtons->Add( 3, 3, 0, 0, 5 ); - - m_buttonSync = new zen::BitmapTextButton( m_panelTopButtons, wxID_ANY, _("Synchronize"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonSync->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - m_buttonSync->SetToolTip( _("dummy") ); - - bSizerTopButtons->Add( m_buttonSync, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer1791->Add( bSizerTopButtons, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - m_panelTopButtons->SetSizer( bSizer1791 ); - m_panelTopButtons->Layout(); - bSizer1791->Fit( m_panelTopButtons ); - bSizerPanelHolder->Add( m_panelTopButtons, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_panelDirectoryPairs = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1601; - bSizer1601 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer91; - bSizer91 = new wxBoxSizer( wxHORIZONTAL ); - - m_panelTopLeft = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelTopLeft->SetMinSize( wxSize( 1,-1 ) ); - - wxFlexGridSizer* fgSizer8; - fgSizer8 = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer8->AddGrowableCol( 1 ); - fgSizer8->SetFlexibleDirection( wxBOTH ); - fgSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); - - - fgSizer8->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextResolvedPathL = new wxStaticText( m_panelTopLeft, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextResolvedPathL->Wrap( -1 ); - fgSizer8->Add( m_staticTextResolvedPathL, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); - - wxBoxSizer* bSizer159; - bSizer159 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonAddPair = new wxBitmapButton( m_panelTopLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - - bSizer159->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonRemovePair = new wxBitmapButton( m_panelTopLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - bSizer159->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - fgSizer8->Add( bSizer159, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer182; - bSizer182 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryLeft = new FolderHistoryBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer182->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectDirLeft = new wxButton( m_panelTopLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectDirLeft->SetToolTip( _("Select a folder") ); - - bSizer182->Add( m_buttonSelectDirLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - fgSizer8->Add( bSizer182, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - m_panelTopLeft->SetSizer( fgSizer8 ); - m_panelTopLeft->Layout(); - fgSizer8->Fit( m_panelTopLeft ); - bSizer91->Add( m_panelTopLeft, 1, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelTopMiddle = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1771; - bSizer1771 = new wxBoxSizer( wxVERTICAL ); - - - bSizer1771->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bpButtonSwapSides = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); - m_bpButtonSwapSides->SetToolTip( _("Swap sides") ); - - bSizer1771->Add( m_bpButtonSwapSides, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer160; - bSizer160 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonAltCompCfg = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer160->Add( m_bpButtonAltCompCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLocalFilter = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer160->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 ); - - m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer160->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer1771->Add( bSizer160, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer1771->Add( 0, 0, 1, wxEXPAND, 5 ); - - - m_panelTopMiddle->SetSizer( bSizer1771 ); - m_panelTopMiddle->Layout(); - bSizer1771->Fit( m_panelTopMiddle ); - bSizer91->Add( m_panelTopMiddle, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_panelTopRight = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelTopRight->SetMinSize( wxSize( 1,-1 ) ); - - wxBoxSizer* bSizer183; - bSizer183 = new wxBoxSizer( wxVERTICAL ); - - m_staticTextResolvedPathR = new wxStaticText( m_panelTopRight, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextResolvedPathR->Wrap( -1 ); - bSizer183->Add( m_staticTextResolvedPathR, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); - - wxBoxSizer* bSizer179; - bSizer179 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryRight = new FolderHistoryBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer179->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectDirRight = new wxButton( m_panelTopRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectDirRight->SetToolTip( _("Select a folder") ); - - bSizer179->Add( m_buttonSelectDirRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer183->Add( bSizer179, 0, 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, 5 ); - - - bSizer1601->Add( bSizer91, 0, wxEXPAND, 5 ); - - m_scrolledWindowFolderPairs = new wxScrolledWindow( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); - m_scrolledWindowFolderPairs->SetScrollRate( 10, 10 ); - m_scrolledWindowFolderPairs->SetMinSize( wxSize( -1,0 ) ); - - 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 ); - bSizerPanelHolder->Add( m_panelDirectoryPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_gridNavi = new zen::Grid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - m_gridNavi->SetScrollRate( 5, 5 ); - bSizerPanelHolder->Add( m_gridNavi, 1, wxEXPAND, 5 ); - - m_panelCenter = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1711; - bSizer1711 = new wxBoxSizer( wxVERTICAL ); - - m_splitterMain = new zen::TripleSplitter( m_panelCenter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1781; - bSizer1781 = new wxBoxSizer( wxHORIZONTAL ); - - m_gridMainL = new zen::Grid( m_splitterMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - m_gridMainL->SetScrollRate( 5, 5 ); - bSizer1781->Add( m_gridMainL, 1, wxEXPAND, 5 ); - - m_gridMainC = new zen::Grid( m_splitterMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - m_gridMainC->SetScrollRate( 5, 5 ); - bSizer1781->Add( m_gridMainC, 0, wxEXPAND, 5 ); - - m_gridMainR = new zen::Grid( m_splitterMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - m_gridMainR->SetScrollRate( 5, 5 ); - bSizer1781->Add( m_gridMainR, 1, wxEXPAND, 5 ); - - - m_splitterMain->SetSizer( bSizer1781 ); - m_splitterMain->Layout(); - bSizer1781->Fit( m_splitterMain ); - bSizer1711->Add( m_splitterMain, 1, wxEXPAND, 5 ); - - m_panelStatusBar = new wxPanel( m_panelCenter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer451; - bSizer451 = new wxBoxSizer( wxHORIZONTAL ); - - bSizer451->SetMinSize( wxSize( -1,22 ) ); - bSizerFileStatus = new wxBoxSizer( wxHORIZONTAL ); - - bSizerStatusLeft = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer53; - bSizer53 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizerStatusLeftDirectories = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapSmallDirectoryLeft = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerStatusLeftDirectories->Add( m_bitmapSmallDirectoryLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusLeftDirectories->Add( 2, 0, 0, 0, 5 ); - - m_staticTextStatusLeftDirs = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - 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 ); - - - bSizerStatusLeftFiles->Add( 10, 0, 0, 0, 5 ); - - m_bitmapSmallFileLeft = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerStatusLeftFiles->Add( m_bitmapSmallFileLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusLeftFiles->Add( 2, 0, 0, 0, 5 ); - - m_staticTextStatusLeftFiles = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusLeftFiles->Wrap( -1 ); - bSizerStatusLeftFiles->Add( m_staticTextStatusLeftFiles, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusLeftFiles->Add( 4, 0, 0, 0, 5 ); - - m_staticTextStatusLeftBytes = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - 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 ); - - - bSizerStatusLeft->Add( bSizer53, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticline9 = new wxStaticLine( m_panelStatusBar, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizerStatusLeft->Add( m_staticline9, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 2 ); - - - bSizerFileStatus->Add( bSizerStatusLeft, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerFileStatus->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextStatusMiddle = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusMiddle->Wrap( -1 ); - bSizerFileStatus->Add( m_staticTextStatusMiddle, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerFileStatus->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizerStatusRight = new wxBoxSizer( wxHORIZONTAL ); - - m_staticline10 = new wxStaticLine( m_panelStatusBar, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizerStatusRight->Add( m_staticline10, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP, 2 ); - - wxBoxSizer* bSizer52; - bSizer52 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer52->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizerStatusRightDirectories = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapSmallDirectoryRight = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerStatusRightDirectories->Add( m_bitmapSmallDirectoryRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusRightDirectories->Add( 2, 0, 0, 0, 5 ); - - m_staticTextStatusRightDirs = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - 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 ); - - - bSizerStatusRightFiles->Add( 10, 0, 0, 0, 5 ); - - m_bitmapSmallFileRight = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizerStatusRightFiles->Add( m_bitmapSmallFileRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusRightFiles->Add( 2, 0, 0, 0, 5 ); - - m_staticTextStatusRightFiles = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusRightFiles->Wrap( -1 ); - bSizerStatusRightFiles->Add( m_staticTextStatusRightFiles, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusRightFiles->Add( 4, 0, 0, 0, 5 ); - - m_staticTextStatusRightBytes = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusRightBytes->Wrap( -1 ); - bSizerStatusRightFiles->Add( m_staticTextStatusRightBytes, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer52->Add( bSizerStatusRightFiles, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer52->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatusRight->Add( bSizer52, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerFileStatus->Add( bSizerStatusRight, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer451->Add( bSizerFileStatus, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticTextFullStatus = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextFullStatus->Wrap( -1 ); - m_staticTextFullStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer451->Add( m_staticTextFullStatus, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - m_panelStatusBar->SetSizer( bSizer451 ); - m_panelStatusBar->Layout(); - bSizer451->Fit( m_panelStatusBar ); - bSizer1711->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - - m_panelCenter->SetSizer( bSizer1711 ); - m_panelCenter->Layout(); - bSizer1711->Fit( m_panelCenter ); - bSizerPanelHolder->Add( m_panelCenter, 1, wxEXPAND, 5 ); - - m_panelSearch = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1713; - bSizer1713 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonHideSearch = new wxBitmapButton( m_panelSearch, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - m_bpButtonHideSearch->SetToolTip( _("Close search bar") ); - - bSizer1713->Add( m_bpButtonHideSearch, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_staticText101 = new wxStaticText( m_panelSearch, wxID_ANY, _("Find:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText101->Wrap( -1 ); - bSizer1713->Add( m_staticText101, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlSearchTxt = new wxTextCtrl( m_panelSearch, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 220,-1 ), 0|wxWANTS_CHARS ); - m_textCtrlSearchTxt->SetMaxLength( 0 ); - bSizer1713->Add( m_textCtrlSearchTxt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_checkBoxMatchCase = new wxCheckBox( m_panelSearch, wxID_ANY, _("Match case"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1713->Add( m_checkBoxMatchCase, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - m_panelSearch->SetSizer( bSizer1713 ); - m_panelSearch->Layout(); - bSizer1713->Fit( m_panelSearch ); - bSizerPanelHolder->Add( m_panelSearch, 0, 0, 5 ); - - m_panelConfig = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - bSizerConfig = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer151; - bSizer151 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer17611; - bSizer17611 = new wxBoxSizer( wxVERTICAL ); - - m_bpButtonNew = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - m_bpButtonNew->SetToolTip( _("dummy") ); - - bSizer17611->Add( m_bpButtonNew, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticText951 = new wxStaticText( m_panelConfig, wxID_ANY, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText951->Wrap( -1 ); - bSizer17611->Add( m_staticText951, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); - - - bSizer151->Add( bSizer17611, 0, 0, 5 ); - - wxBoxSizer* bSizer1761; - bSizer1761 = new wxBoxSizer( wxVERTICAL ); - - m_bpButtonOpen = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - m_bpButtonOpen->SetToolTip( _("dummy") ); - - bSizer1761->Add( m_bpButtonOpen, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticText95 = new wxStaticText( m_panelConfig, wxID_ANY, _("Open..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText95->Wrap( -1 ); - bSizer1761->Add( m_staticText95, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); - - - bSizer151->Add( bSizer1761, 0, 0, 5 ); - - wxBoxSizer* bSizer175; - bSizer175 = new wxBoxSizer( wxVERTICAL ); - - m_bpButtonSave = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - m_bpButtonSave->SetToolTip( _("dummy") ); - - bSizer175->Add( m_bpButtonSave, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticText961 = new wxStaticText( m_panelConfig, wxID_ANY, _("Save"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText961->Wrap( -1 ); - bSizer175->Add( m_staticText961, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); - - - bSizer151->Add( bSizer175, 0, 0, 5 ); - - wxBoxSizer* bSizer174; - bSizer174 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer1772; - bSizer1772 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonSaveAs = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - m_bpButtonSaveAs->SetToolTip( _("Save as GUI job") ); - - bSizer1772->Add( m_bpButtonSaveAs, 0, 0, 5 ); - - m_bpButtonSaveAsBatch = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - m_bpButtonSaveAsBatch->SetToolTip( _("Save as batch job") ); - - bSizer1772->Add( m_bpButtonSaveAsBatch, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer174->Add( bSizer1772, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticText97 = new wxStaticText( m_panelConfig, wxID_ANY, _("Save as..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText97->Wrap( -1 ); - bSizer174->Add( m_staticText97, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); - - - bSizer151->Add( bSizer174, 0, 0, 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 ); - m_listBoxHistory->SetMinSize( wxSize( -1,40 ) ); - - bSizerConfig->Add( m_listBoxHistory, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - m_panelConfig->SetSizer( bSizerConfig ); - m_panelConfig->Layout(); - bSizerConfig->Fit( m_panelConfig ); - bSizerPanelHolder->Add( m_panelConfig, 0, 0, 5 ); - - m_panelViewFilter = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - bSizerViewFilter = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextViewType = new wxStaticText( m_panelViewFilter, wxID_ANY, _("View type:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextViewType->Wrap( -1 ); - bSizerViewFilter->Add( m_staticTextViewType, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonViewTypeSyncAction = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 82,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonViewTypeSyncAction, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); - - m_bpButtonShowExcluded = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowExcluded, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextSelectView = new wxStaticText( m_panelViewFilter, wxID_ANY, _("Select view:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSelectView->Wrap( -1 ); - bSizerViewFilter->Add( m_staticTextSelectView, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowDeleteLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowDeleteLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowUpdateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowUpdateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowCreateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowLeftOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowLeftOnly, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowLeftNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowLeftNewer, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowEqual = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowEqual, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowDoNothing = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowDoNothing, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowDifferent = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowDifferent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowRightNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowRightNewer, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowRightOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowRightOnly, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowCreateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowUpdateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowUpdateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowDeleteRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowDeleteRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonShowConflict = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizerViewFilter->Add( m_bpButtonShowConflict, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText96 = new wxStaticText( m_panelViewFilter, wxID_ANY, _("Statistics:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText96->Wrap( -1 ); - bSizerViewFilter->Add( m_staticText96, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_panelStatistics = new wxPanel( m_panelViewFilter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); - m_panelStatistics->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizer1801 = new wxBoxSizer( wxVERTICAL ); - - bSizerStatistics = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer173; - bSizer173 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapDeleteLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); - - bSizer173->Add( m_bitmapDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer173->Add( 5, 2, 0, 0, 5 ); - - - bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextDeleteLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDeleteLeft->Wrap( -1 ); - m_staticTextDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); - - bSizer173->Add( m_staticTextDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatistics->Add( bSizer173, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerStatistics->Add( 5, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer172; - bSizer172 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapUpdateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); - - bSizer172->Add( m_bitmapUpdateLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer172->Add( 5, 2, 0, 0, 5 ); - - - bSizer172->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextUpdateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextUpdateLeft->Wrap( -1 ); - m_staticTextUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); - - bSizer172->Add( m_staticTextUpdateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerStatistics->Add( bSizer172, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerStatistics->Add( 5, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer1712; - bSizer1712 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapCreateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); - - bSizer1712->Add( m_bitmapCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer1712->Add( 5, 2, 0, 0, 5 ); - - - bSizer1712->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextCreateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCreateLeft->Wrap( -1 ); - m_staticTextCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); - - bSizer1712->Add( m_staticTextCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerStatistics->Add( bSizer1712, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerStatistics->Add( 5, 5, 0, 0, 5 ); - - bSizerData = new wxBoxSizer( wxVERTICAL ); - - m_bitmapData = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapData->SetToolTip( _("Total bytes to copy") ); - - bSizerData->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizerData->Add( 5, 2, 0, 0, 5 ); - - - bSizerData->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextData = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextData->Wrap( -1 ); - m_staticTextData->SetToolTip( _("Total bytes to copy") ); - - bSizerData->Add( m_staticTextData, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatistics->Add( bSizerData, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerStatistics->Add( 5, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer178; - bSizer178 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapCreateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapCreateRight->SetToolTip( _("Number of files and folders that will be created") ); - - bSizer178->Add( m_bitmapCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer178->Add( 5, 2, 0, 0, 5 ); - - - bSizer178->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextCreateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCreateRight->Wrap( -1 ); - m_staticTextCreateRight->SetToolTip( _("Number of files and folders that will be created") ); - - bSizer178->Add( m_staticTextCreateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatistics->Add( bSizer178, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerStatistics->Add( 5, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer177; - bSizer177 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapUpdateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); - - bSizer177->Add( m_bitmapUpdateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer177->Add( 5, 2, 0, 0, 5 ); - - - bSizer177->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextUpdateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextUpdateRight->Wrap( -1 ); - m_staticTextUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); - - bSizer177->Add( m_staticTextUpdateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatistics->Add( bSizer177, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizerStatistics->Add( 5, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer176; - bSizer176 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapDeleteRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); - - bSizer176->Add( m_bitmapDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer176->Add( 5, 2, 0, 0, 5 ); - - - bSizer176->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextDeleteRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDeleteRight->Wrap( -1 ); - m_staticTextDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); - - bSizer176->Add( m_staticTextDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStatistics->Add( bSizer176, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer1801->Add( bSizerStatistics, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4 ); - - - m_panelStatistics->SetSizer( bSizer1801 ); - m_panelStatistics->Layout(); - bSizer1801->Fit( m_panelStatistics ); - bSizerViewFilter->Add( m_panelStatistics, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - m_panelViewFilter->SetSizer( bSizerViewFilter ); - m_panelViewFilter->Layout(); - bSizerViewFilter->Fit( m_panelViewFilter ); - bSizerPanelHolder->Add( m_panelViewFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - this->SetSizer( bSizerPanelHolder ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); - this->Connect( m_menuItemNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigNew ) ); - this->Connect( m_menuItemLoad->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigLoad ) ); - this->Connect( m_menuItemSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigSave ) ); - this->Connect( m_menuItemSaveAs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigSaveAs ) ); - this->Connect( m_menuItemSaveAsBatch->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveAsBatchJob ) ); - this->Connect( m_menuItemCompare->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); - this->Connect( m_menuItemSynchronize->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); - this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); - this->Connect( m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuOptions ) ); - this->Connect( m_menuItem15->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuFindItem ) ); - this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); - this->Connect( m_menuItemHelp->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); - this->Connect( m_menuItemCheckVersionNow->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); - this->Connect( m_menuItemCheckVersionAuto->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersionAutomatically ) ); - this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); - m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); - m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); - m_bpButtonCmpConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnCompSettingsContext ), NULL, this ); - m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); - m_bpButtonFilter->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnGlobalFilterContext ), NULL, this ); - m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); - m_bpButtonSyncConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnSyncSettingsContext ), NULL, this ); - m_buttonSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); - m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); - m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRemoveTopFolderPair ), NULL, this ); - m_bpButtonSwapSides->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); - m_bpButtonHideSearch->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideSearchPanel ), NULL, this ); - m_textCtrlSearchTxt->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogGenerated::OnSearchGridEnter ), NULL, this ); - m_bpButtonNew->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigNew ), NULL, this ); - m_bpButtonOpen->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigLoad ), NULL, this ); - m_bpButtonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigSave ), NULL, this ); - m_bpButtonSaveAs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigSaveAs ), NULL, this ); - m_bpButtonSaveAsBatch->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSaveAsBatchJob ), NULL, this ); - m_listBoxHistory->Connect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); - m_listBoxHistory->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistory ), NULL, this ); - m_listBoxHistory->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistoryDoubleClick ), NULL, this ); - m_listBoxHistory->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnCfgHistoryRightClick ), NULL, this ); - m_bpButtonViewTypeSyncAction->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewType ), NULL, this ); - m_bpButtonShowExcluded->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowExcluded->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowDeleteLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowDeleteLeft->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowUpdateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowUpdateLeft->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowCreateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowCreateLeft->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowLeftOnly->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowLeftNewer->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowEqual->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowEqual->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowDoNothing->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowDoNothing->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowDifferent->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowRightNewer->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowRightOnly->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowCreateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowCreateRight->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowUpdateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowUpdateRight->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowDeleteRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowDeleteRight->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); - m_bpButtonShowConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); - m_bpButtonShowConflict->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + this->SetSizeHints( wxSize( 640,400 ), wxDefaultSize ); + + m_menubar1 = new wxMenuBar( 0 ); + m_menuFile = new wxMenu(); + m_menuItemNew = new wxMenuItem( m_menuFile, wxID_NEW, wxString( _("&New") ) + wxT('\t') + wxT("Ctrl+N"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemNew ); + + m_menuItemLoad = new wxMenuItem( m_menuFile, wxID_OPEN, wxString( _("&Open...") ) + wxT('\t') + wxT("Ctrl+O"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemLoad ); + + m_menuItemSave = new wxMenuItem( m_menuFile, wxID_SAVE, wxString( _("&Save") ) + wxT('\t') + wxT("Ctrl+S"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSave ); + + m_menuItemSaveAs = new wxMenuItem( m_menuFile, wxID_SAVEAS, wxString( _("Save &as...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSaveAs ); + + m_menuItemSaveAsBatch = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("Save as &batch job...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSaveAsBatch ); + + m_menuFile->AppendSeparator(); + + m_menuItemCompare = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("Start &comparison") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemCompare ); + + m_menuItemSynchronize = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("Start synchronization") ) + wxT('\t') + wxT("F9"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSynchronize ); + + m_menuFile->AppendSeparator(); + + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("&Quit") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem4 ); + + m_menubar1->Append( m_menuFile, _("File") ); + + m_menuTools = new wxMenu(); + m_menuItemOptions = new wxMenuItem( m_menuTools, wxID_PREFERENCES, wxString( _("&Options") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuTools->Append( m_menuItemOptions ); + + m_menuLanguages = new wxMenu(); + wxMenuItem* m_menuLanguagesItem = new wxMenuItem( m_menuTools, wxID_ANY, _("&Language"), wxEmptyString, wxITEM_NORMAL, m_menuLanguages ); + m_menuTools->Append( m_menuLanguagesItem ); + + m_menuTools->AppendSeparator(); + + wxMenuItem* m_menuItem15; + m_menuItem15 = new wxMenuItem( m_menuTools, wxID_FIND, wxString( _("&Find...") ) + wxT('\t') + wxT("Ctrl+F"), wxEmptyString, wxITEM_NORMAL ); + m_menuTools->Append( m_menuItem15 ); + + wxMenuItem* m_menuItem51; + m_menuItem51 = new wxMenuItem( m_menuTools, wxID_ANY, wxString( _("&Reset layout") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuTools->Append( m_menuItem51 ); + + wxMenuItem* m_menuItem5; + m_menuItem5 = new wxMenuItem( m_menuTools, wxID_ANY, wxString( _("&Export file list...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuTools->Append( m_menuItem5 ); + + m_menubar1->Append( m_menuTools, _("&Tools") ); + + m_menuHelp = new wxMenu(); + m_menuItemHelp = new wxMenuItem( m_menuHelp, wxID_HELP, wxString( _("&View help") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemHelp ); + + m_menuCheckVersion = new wxMenu(); + wxMenuItem* m_menuCheckVersionItem = new wxMenuItem( m_menuHelp, wxID_ANY, _("&Check for new version"), wxEmptyString, wxITEM_NORMAL, m_menuCheckVersion ); + m_menuItemCheckVersionNow = new wxMenuItem( m_menuCheckVersion, wxID_ANY, wxString( _("&Check now") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuCheckVersion->Append( m_menuItemCheckVersionNow ); + + m_menuItemCheckVersionAuto = new wxMenuItem( m_menuCheckVersion, wxID_ANY, wxString( _("Check &automatically once a week") ) , wxEmptyString, wxITEM_CHECK ); + m_menuCheckVersion->Append( m_menuItemCheckVersionAuto ); + m_menuItemCheckVersionAuto->Check( true ); + + m_menuHelp->Append( m_menuCheckVersionItem ); + + 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 ); + + m_menubar1->Append( m_menuHelp, _("&Help") ); + + this->SetMenuBar( m_menubar1 ); + + bSizerPanelHolder = new wxBoxSizer( wxVERTICAL ); + + m_panelTopButtons = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1791; + bSizer1791 = new wxBoxSizer( wxVERTICAL ); + + bSizerTopButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonCancel = new zen::BitmapTextButton( m_panelTopButtons, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonCancel->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + m_buttonCancel->Enable( false ); + m_buttonCancel->Hide(); + + bSizerTopButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_buttonCompare = new zen::BitmapTextButton( m_panelTopButtons, wxID_ANY, _("Compare"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonCompare->SetDefault(); + m_buttonCompare->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + m_buttonCompare->SetToolTip( _("dummy") ); + + bSizerTopButtons->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerTopButtons->Add( 3, 3, 0, 0, 5 ); + + m_bpButtonCmpConfig = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); + m_bpButtonCmpConfig->SetToolTip( _("dummy") ); + + bSizerTopButtons->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerTopButtons->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerTopButtons->Add( 5, 5, 0, 0, 5 ); + + m_bpButtonFilter = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 60,-1 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + bSizerTopButtons->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerTopButtons->Add( 5, 5, 0, 0, 5 ); + + + bSizerTopButtons->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncConfig = new wxBitmapButton( m_panelTopButtons, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); + m_bpButtonSyncConfig->SetToolTip( _("dummy") ); + + bSizerTopButtons->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerTopButtons->Add( 3, 3, 0, 0, 5 ); + + m_buttonSync = new zen::BitmapTextButton( m_panelTopButtons, wxID_ANY, _("Synchronize"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonSync->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + m_buttonSync->SetToolTip( _("dummy") ); + + bSizerTopButtons->Add( m_buttonSync, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer1791->Add( bSizerTopButtons, 1, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + m_panelTopButtons->SetSizer( bSizer1791 ); + m_panelTopButtons->Layout(); + bSizer1791->Fit( m_panelTopButtons ); + bSizerPanelHolder->Add( m_panelTopButtons, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_panelDirectoryPairs = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1601; + bSizer1601 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer91; + bSizer91 = new wxBoxSizer( wxHORIZONTAL ); + + m_panelTopLeft = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelTopLeft->SetMinSize( wxSize( 1,-1 ) ); + + wxFlexGridSizer* fgSizer8; + fgSizer8 = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizer8->AddGrowableCol( 1 ); + fgSizer8->SetFlexibleDirection( wxBOTH ); + fgSizer8->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_ALL ); + + + fgSizer8->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextResolvedPathL = new wxStaticText( m_panelTopLeft, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextResolvedPathL->Wrap( -1 ); + fgSizer8->Add( m_staticTextResolvedPathL, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); + + wxBoxSizer* bSizer159; + bSizer159 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonAddPair = new wxBitmapButton( m_panelTopLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); + + bSizer159->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panelTopLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + bSizer159->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + fgSizer8->Add( bSizer159, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer182; + bSizer182 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryLeft = new FolderHistoryBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer182->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectDirLeft = new wxButton( m_panelTopLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectDirLeft->SetToolTip( _("Select a folder") ); + + bSizer182->Add( m_buttonSelectDirLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + fgSizer8->Add( bSizer182, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + m_panelTopLeft->SetSizer( fgSizer8 ); + m_panelTopLeft->Layout(); + fgSizer8->Fit( m_panelTopLeft ); + bSizer91->Add( m_panelTopLeft, 1, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelTopMiddle = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1771; + bSizer1771 = new wxBoxSizer( wxVERTICAL ); + + + bSizer1771->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonSwapSides = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); + m_bpButtonSwapSides->SetToolTip( _("Swap sides") ); + + bSizer1771->Add( m_bpButtonSwapSides, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer160; + bSizer160 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonAltCompCfg = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer160->Add( m_bpButtonAltCompCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLocalFilter = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer160->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 ); + + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer160->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer1771->Add( bSizer160, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer1771->Add( 0, 0, 1, wxEXPAND, 5 ); + + + m_panelTopMiddle->SetSizer( bSizer1771 ); + m_panelTopMiddle->Layout(); + bSizer1771->Fit( m_panelTopMiddle ); + bSizer91->Add( m_panelTopMiddle, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelTopRight = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelTopRight->SetMinSize( wxSize( 1,-1 ) ); + + wxBoxSizer* bSizer183; + bSizer183 = new wxBoxSizer( wxVERTICAL ); + + m_staticTextResolvedPathR = new wxStaticText( m_panelTopRight, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextResolvedPathR->Wrap( -1 ); + bSizer183->Add( m_staticTextResolvedPathR, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); + + wxBoxSizer* bSizer179; + bSizer179 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryRight = new FolderHistoryBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer179->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectDirRight = new wxButton( m_panelTopRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectDirRight->SetToolTip( _("Select a folder") ); + + bSizer179->Add( m_buttonSelectDirRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer183->Add( bSizer179, 0, 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, 5 ); + + + bSizer1601->Add( bSizer91, 0, wxEXPAND, 5 ); + + m_scrolledWindowFolderPairs = new wxScrolledWindow( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); + m_scrolledWindowFolderPairs->SetScrollRate( 10, 10 ); + m_scrolledWindowFolderPairs->SetMinSize( wxSize( -1,0 ) ); + + 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 ); + bSizerPanelHolder->Add( m_panelDirectoryPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_gridNavi = new zen::Grid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_gridNavi->SetScrollRate( 5, 5 ); + bSizerPanelHolder->Add( m_gridNavi, 1, wxEXPAND, 5 ); + + m_panelCenter = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1711; + bSizer1711 = new wxBoxSizer( wxVERTICAL ); + + m_splitterMain = new zen::TripleSplitter( m_panelCenter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1781; + bSizer1781 = new wxBoxSizer( wxHORIZONTAL ); + + m_gridMainL = new zen::Grid( m_splitterMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_gridMainL->SetScrollRate( 5, 5 ); + bSizer1781->Add( m_gridMainL, 1, wxEXPAND, 5 ); + + m_gridMainC = new zen::Grid( m_splitterMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_gridMainC->SetScrollRate( 5, 5 ); + bSizer1781->Add( m_gridMainC, 0, wxEXPAND, 5 ); + + m_gridMainR = new zen::Grid( m_splitterMain, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_gridMainR->SetScrollRate( 5, 5 ); + bSizer1781->Add( m_gridMainR, 1, wxEXPAND, 5 ); + + + m_splitterMain->SetSizer( bSizer1781 ); + m_splitterMain->Layout(); + bSizer1781->Fit( m_splitterMain ); + bSizer1711->Add( m_splitterMain, 1, wxEXPAND, 5 ); + + m_panelStatusBar = new wxPanel( m_panelCenter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer451; + bSizer451 = new wxBoxSizer( wxHORIZONTAL ); + + bSizer451->SetMinSize( wxSize( -1,22 ) ); + bSizerFileStatus = new wxBoxSizer( wxHORIZONTAL ); + + bSizerStatusLeft = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer53; + bSizer53 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizerStatusLeftDirectories = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapSmallDirectoryLeft = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerStatusLeftDirectories->Add( m_bitmapSmallDirectoryLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusLeftDirectories->Add( 2, 0, 0, 0, 5 ); + + m_staticTextStatusLeftDirs = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); + + + bSizerStatusLeftFiles->Add( 10, 0, 0, 0, 5 ); + + m_bitmapSmallFileLeft = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerStatusLeftFiles->Add( m_bitmapSmallFileLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusLeftFiles->Add( 2, 0, 0, 0, 5 ); + + m_staticTextStatusLeftFiles = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusLeftFiles->Wrap( -1 ); + bSizerStatusLeftFiles->Add( m_staticTextStatusLeftFiles, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusLeftFiles->Add( 4, 0, 0, 0, 5 ); + + m_staticTextStatusLeftBytes = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); + + + bSizerStatusLeft->Add( bSizer53, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline9 = new wxStaticLine( m_panelStatusBar, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizerStatusLeft->Add( m_staticline9, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 2 ); + + + bSizerFileStatus->Add( bSizerStatusLeft, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerFileStatus->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextStatusMiddle = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusMiddle->Wrap( -1 ); + bSizerFileStatus->Add( m_staticTextStatusMiddle, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerFileStatus->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizerStatusRight = new wxBoxSizer( wxHORIZONTAL ); + + m_staticline10 = new wxStaticLine( m_panelStatusBar, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizerStatusRight->Add( m_staticline10, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL|wxTOP, 2 ); + + wxBoxSizer* bSizer52; + bSizer52 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer52->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizerStatusRightDirectories = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapSmallDirectoryRight = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerStatusRightDirectories->Add( m_bitmapSmallDirectoryRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusRightDirectories->Add( 2, 0, 0, 0, 5 ); + + m_staticTextStatusRightDirs = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); + + + bSizerStatusRightFiles->Add( 10, 0, 0, 0, 5 ); + + m_bitmapSmallFileRight = new wxStaticBitmap( m_panelStatusBar, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizerStatusRightFiles->Add( m_bitmapSmallFileRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusRightFiles->Add( 2, 0, 0, 0, 5 ); + + m_staticTextStatusRightFiles = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusRightFiles->Wrap( -1 ); + bSizerStatusRightFiles->Add( m_staticTextStatusRightFiles, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusRightFiles->Add( 4, 0, 0, 0, 5 ); + + m_staticTextStatusRightBytes = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusRightBytes->Wrap( -1 ); + bSizerStatusRightFiles->Add( m_staticTextStatusRightBytes, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer52->Add( bSizerStatusRightFiles, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer52->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatusRight->Add( bSizer52, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerFileStatus->Add( bSizerStatusRight, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer451->Add( bSizerFileStatus, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticTextFullStatus = new wxStaticText( m_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextFullStatus->Wrap( -1 ); + m_staticTextFullStatus->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer451->Add( m_staticTextFullStatus, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + m_panelStatusBar->SetSizer( bSizer451 ); + m_panelStatusBar->Layout(); + bSizer451->Fit( m_panelStatusBar ); + bSizer1711->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + + m_panelCenter->SetSizer( bSizer1711 ); + m_panelCenter->Layout(); + bSizer1711->Fit( m_panelCenter ); + bSizerPanelHolder->Add( m_panelCenter, 1, wxEXPAND, 5 ); + + m_panelSearch = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1713; + bSizer1713 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonHideSearch = new wxBitmapButton( m_panelSearch, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + m_bpButtonHideSearch->SetToolTip( _("Close search bar") ); + + bSizer1713->Add( m_bpButtonHideSearch, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText101 = new wxStaticText( m_panelSearch, wxID_ANY, _("Find:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText101->Wrap( -1 ); + bSizer1713->Add( m_staticText101, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlSearchTxt = new wxTextCtrl( m_panelSearch, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 220,-1 ), 0|wxWANTS_CHARS ); + m_textCtrlSearchTxt->SetMaxLength( 0 ); + bSizer1713->Add( m_textCtrlSearchTxt, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_checkBoxMatchCase = new wxCheckBox( m_panelSearch, wxID_ANY, _("Match case"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1713->Add( m_checkBoxMatchCase, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + m_panelSearch->SetSizer( bSizer1713 ); + m_panelSearch->Layout(); + bSizer1713->Fit( m_panelSearch ); + bSizerPanelHolder->Add( m_panelSearch, 0, 0, 5 ); + + m_panelConfig = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizerConfig = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer151; + bSizer151 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer17611; + bSizer17611 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonNew = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + m_bpButtonNew->SetToolTip( _("dummy") ); + + bSizer17611->Add( m_bpButtonNew, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText951 = new wxStaticText( m_panelConfig, wxID_ANY, _("&New"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText951->Wrap( -1 ); + bSizer17611->Add( m_staticText951, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); + + + bSizer151->Add( bSizer17611, 0, 0, 5 ); + + wxBoxSizer* bSizer1761; + bSizer1761 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonOpen = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + m_bpButtonOpen->SetToolTip( _("dummy") ); + + bSizer1761->Add( m_bpButtonOpen, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText95 = new wxStaticText( m_panelConfig, wxID_ANY, _("Open..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText95->Wrap( -1 ); + bSizer1761->Add( m_staticText95, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); + + + bSizer151->Add( bSizer1761, 0, 0, 5 ); + + wxBoxSizer* bSizer175; + bSizer175 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonSave = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + m_bpButtonSave->SetToolTip( _("dummy") ); + + bSizer175->Add( m_bpButtonSave, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText961 = new wxStaticText( m_panelConfig, wxID_ANY, _("Save"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText961->Wrap( -1 ); + bSizer175->Add( m_staticText961, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); + + + bSizer151->Add( bSizer175, 0, 0, 5 ); + + wxBoxSizer* bSizer174; + bSizer174 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer1772; + bSizer1772 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonSaveAs = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + m_bpButtonSaveAs->SetToolTip( _("Save as GUI job") ); + + bSizer1772->Add( m_bpButtonSaveAs, 0, 0, 5 ); + + m_bpButtonSaveAsBatch = new wxBitmapButton( m_panelConfig, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + m_bpButtonSaveAsBatch->SetToolTip( _("Save as batch job") ); + + bSizer1772->Add( m_bpButtonSaveAsBatch, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer174->Add( bSizer1772, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText97 = new wxStaticText( m_panelConfig, wxID_ANY, _("Save as..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText97->Wrap( -1 ); + bSizer174->Add( m_staticText97, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 2 ); + + + bSizer151->Add( bSizer174, 0, 0, 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 ); + m_listBoxHistory->SetMinSize( wxSize( -1,40 ) ); + + bSizerConfig->Add( m_listBoxHistory, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + m_panelConfig->SetSizer( bSizerConfig ); + m_panelConfig->Layout(); + bSizerConfig->Fit( m_panelConfig ); + bSizerPanelHolder->Add( m_panelConfig, 0, 0, 5 ); + + m_panelViewFilter = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizerViewFilter = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextViewType = new wxStaticText( m_panelViewFilter, wxID_ANY, _("View type:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextViewType->Wrap( -1 ); + bSizerViewFilter->Add( m_staticTextViewType, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonViewTypeSyncAction = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 82,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonViewTypeSyncAction, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); + + m_bpButtonShowExcluded = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowExcluded, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextSelectView = new wxStaticText( m_panelViewFilter, wxID_ANY, _("Select view:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSelectView->Wrap( -1 ); + bSizerViewFilter->Add( m_staticTextSelectView, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowDeleteLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowDeleteLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowUpdateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowUpdateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowCreateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowLeftOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowLeftOnly, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowLeftNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowLeftNewer, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowEqual = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowEqual, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowDoNothing = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowDoNothing, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowDifferent = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowDifferent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowRightNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowRightNewer, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowRightOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowRightOnly, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowCreateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowUpdateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowUpdateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowDeleteRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowDeleteRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonShowConflict = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonShowConflict, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText96 = new wxStaticText( m_panelViewFilter, wxID_ANY, _("Statistics:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText96->Wrap( -1 ); + bSizerViewFilter->Add( m_staticText96, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_panelStatistics = new wxPanel( m_panelViewFilter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL ); + m_panelStatistics->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizer1801 = new wxBoxSizer( wxVERTICAL ); + + bSizerStatistics = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer173; + bSizer173 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapDeleteLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); + + bSizer173->Add( m_bitmapDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer173->Add( 5, 2, 0, 0, 5 ); + + + bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextDeleteLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDeleteLeft->Wrap( -1 ); + m_staticTextDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); + + bSizer173->Add( m_staticTextDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatistics->Add( bSizer173, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerStatistics->Add( 5, 5, 0, 0, 5 ); + + wxBoxSizer* bSizer172; + bSizer172 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapUpdateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); + + bSizer172->Add( m_bitmapUpdateLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer172->Add( 5, 2, 0, 0, 5 ); + + + bSizer172->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextUpdateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextUpdateLeft->Wrap( -1 ); + m_staticTextUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); + + bSizer172->Add( m_staticTextUpdateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizerStatistics->Add( bSizer172, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerStatistics->Add( 5, 5, 0, 0, 5 ); + + wxBoxSizer* bSizer1712; + bSizer1712 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapCreateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); + + bSizer1712->Add( m_bitmapCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer1712->Add( 5, 2, 0, 0, 5 ); + + + bSizer1712->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextCreateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCreateLeft->Wrap( -1 ); + m_staticTextCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); + + bSizer1712->Add( m_staticTextCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizerStatistics->Add( bSizer1712, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerStatistics->Add( 5, 5, 0, 0, 5 ); + + bSizerData = new wxBoxSizer( wxVERTICAL ); + + m_bitmapData = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapData->SetToolTip( _("Total bytes to copy") ); + + bSizerData->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizerData->Add( 5, 2, 0, 0, 5 ); + + + bSizerData->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextData = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextData->Wrap( -1 ); + m_staticTextData->SetToolTip( _("Total bytes to copy") ); + + bSizerData->Add( m_staticTextData, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatistics->Add( bSizerData, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerStatistics->Add( 5, 5, 0, 0, 5 ); + + wxBoxSizer* bSizer178; + bSizer178 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapCreateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreateRight->SetToolTip( _("Number of files and folders that will be created") ); + + bSizer178->Add( m_bitmapCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer178->Add( 5, 2, 0, 0, 5 ); + + + bSizer178->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextCreateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCreateRight->Wrap( -1 ); + m_staticTextCreateRight->SetToolTip( _("Number of files and folders that will be created") ); + + bSizer178->Add( m_staticTextCreateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatistics->Add( bSizer178, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerStatistics->Add( 5, 5, 0, 0, 5 ); + + wxBoxSizer* bSizer177; + bSizer177 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapUpdateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); + + bSizer177->Add( m_bitmapUpdateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer177->Add( 5, 2, 0, 0, 5 ); + + + bSizer177->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextUpdateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextUpdateRight->Wrap( -1 ); + m_staticTextUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); + + bSizer177->Add( m_staticTextUpdateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatistics->Add( bSizer177, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizerStatistics->Add( 5, 5, 0, 0, 5 ); + + wxBoxSizer* bSizer176; + bSizer176 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapDeleteRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); + + bSizer176->Add( m_bitmapDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer176->Add( 5, 2, 0, 0, 5 ); + + + bSizer176->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextDeleteRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDeleteRight->Wrap( -1 ); + m_staticTextDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); + + bSizer176->Add( m_staticTextDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStatistics->Add( bSizer176, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer1801->Add( bSizerStatistics, 0, wxALIGN_CENTER_VERTICAL|wxALL, 4 ); + + + m_panelStatistics->SetSizer( bSizer1801 ); + m_panelStatistics->Layout(); + bSizer1801->Fit( m_panelStatistics ); + bSizerViewFilter->Add( m_panelStatistics, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + m_panelViewFilter->SetSizer( bSizerViewFilter ); + m_panelViewFilter->Layout(); + bSizerViewFilter->Fit( m_panelViewFilter ); + bSizerPanelHolder->Add( m_panelViewFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + this->SetSizer( bSizerPanelHolder ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); + this->Connect( m_menuItemNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigNew ) ); + this->Connect( m_menuItemLoad->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigLoad ) ); + this->Connect( m_menuItemSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigSave ) ); + this->Connect( m_menuItemSaveAs->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigSaveAs ) ); + this->Connect( m_menuItemSaveAsBatch->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveAsBatchJob ) ); + this->Connect( m_menuItemCompare->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); + this->Connect( m_menuItemSynchronize->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); + this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); + this->Connect( m_menuItemOptions->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuOptions ) ); + this->Connect( m_menuItem15->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuFindItem ) ); + this->Connect( m_menuItem51->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuResetLayout ) ); + this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); + this->Connect( m_menuItemHelp->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); + this->Connect( m_menuItemCheckVersionNow->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); + this->Connect( m_menuItemCheckVersionAuto->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersionAutomatically ) ); + this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); + m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnCompSettingsContext ), NULL, this ); + m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); + m_bpButtonFilter->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnGlobalFilterContext ), NULL, this ); + m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); + m_bpButtonSyncConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnSyncSettingsContext ), NULL, this ); + m_buttonSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); + m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRemoveTopFolderPair ), NULL, this ); + m_bpButtonSwapSides->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); + m_bpButtonHideSearch->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideSearchPanel ), NULL, this ); + m_textCtrlSearchTxt->Connect( wxEVT_COMMAND_TEXT_ENTER, wxCommandEventHandler( MainDialogGenerated::OnSearchGridEnter ), NULL, this ); + m_bpButtonNew->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigNew ), NULL, this ); + m_bpButtonOpen->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigLoad ), NULL, this ); + m_bpButtonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigSave ), NULL, this ); + m_bpButtonSaveAs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigSaveAs ), NULL, this ); + m_bpButtonSaveAsBatch->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSaveAsBatchJob ), NULL, this ); + m_listBoxHistory->Connect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); + m_listBoxHistory->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistory ), NULL, this ); + m_listBoxHistory->Connect( wxEVT_COMMAND_LISTBOX_DOUBLECLICKED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistoryDoubleClick ), NULL, this ); + m_listBoxHistory->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnCfgHistoryRightClick ), NULL, this ); + m_bpButtonViewTypeSyncAction->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewType ), NULL, this ); + m_bpButtonShowExcluded->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowExcluded->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowDeleteLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowDeleteLeft->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowUpdateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowUpdateLeft->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowCreateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowCreateLeft->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowLeftOnly->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowLeftNewer->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowEqual->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowEqual->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowDoNothing->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowDoNothing->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowDifferent->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowRightNewer->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowRightOnly->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowCreateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowCreateRight->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowUpdateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowUpdateRight->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowDeleteRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowDeleteRight->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); + m_bpButtonShowConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnToggleViewButton ), NULL, this ); + m_bpButtonShowConflict->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnViewButtonRightClick ), NULL, this ); } MainDialogGenerated::~MainDialogGenerated() @@ -968,769 +973,801 @@ MainDialogGenerated::~MainDialogGenerated() ConfigDlgGenerated::ConfigDlgGenerated( 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->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer7; - bSizer7 = new wxBoxSizer( wxVERTICAL ); - - m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelCompSettingsHolder = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelCompSettingsHolder->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer275; - bSizer275 = new wxBoxSizer( wxVERTICAL ); - - bSizerLocalCompSettings = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxUseLocalCmpOptions = new wxCheckBox( m_panelCompSettingsHolder, wxID_ANY, _("Use local settings:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxUseLocalCmpOptions->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizerLocalCompSettings->Add( m_checkBoxUseLocalCmpOptions, 0, wxALL|wxEXPAND, 10 ); - - m_staticline59 = new wxStaticLine( m_panelCompSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerLocalCompSettings->Add( m_staticline59, 0, wxEXPAND, 5 ); - - - bSizer275->Add( bSizerLocalCompSettings, 0, wxEXPAND, 5 ); - - m_panelComparisonSettings = new wxPanel( m_panelCompSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelComparisonSettings->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer159; - bSizer159 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer178; - bSizer178 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer182; - bSizer182 = new wxBoxSizer( wxVERTICAL ); - - m_staticText91 = new wxStaticText( m_panelComparisonSettings, wxID_ANY, _("Select a variant:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText91->Wrap( -1 ); - bSizer182->Add( m_staticText91, 0, wxALL, 5 ); - - wxFlexGridSizer* fgSizer16; - fgSizer16 = new wxFlexGridSizer( 2, 2, 5, 5 ); - fgSizer16->SetFlexibleDirection( wxBOTH ); - fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_bitmapByTime = new wxStaticBitmap( m_panelComparisonSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapByTime->SetToolTip( _("Identify equal files by comparing modification time and size.") ); - - fgSizer16->Add( m_bitmapByTime, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_toggleBtnTimeSize = new wxToggleButton( m_panelComparisonSettings, wxID_ANY, _("File time and size"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_toggleBtnTimeSize->SetValue( true ); - m_toggleBtnTimeSize->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - fgSizer16->Add( m_toggleBtnTimeSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_bitmapByContent = new wxStaticBitmap( m_panelComparisonSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapByContent->SetToolTip( _("Identify equal files by comparing the file content.") ); - - fgSizer16->Add( m_bitmapByContent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_toggleBtnContent = new wxToggleButton( m_panelComparisonSettings, wxID_ANY, _("File content"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_toggleBtnContent->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - fgSizer16->Add( m_toggleBtnContent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer182->Add( fgSizer16, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer178->Add( bSizer182, 0, wxALL, 5 ); - - m_staticline42 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer178->Add( m_staticline42, 0, wxEXPAND, 5 ); - - m_textCtrlCompVarDescription = new wxTextCtrl( m_panelComparisonSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxNO_BORDER ); - bSizer178->Add( m_textCtrlCompVarDescription, 1, wxEXPAND|wxLEFT, 5 ); - - - bSizer159->Add( bSizer178, 0, wxEXPAND, 5 ); - - m_staticline33 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer159->Add( m_staticline33, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer1721; - bSizer1721 = new wxBoxSizer( wxVERTICAL ); - - m_staticText92 = new wxStaticText( m_panelComparisonSettings, wxID_ANY, _("Symbolic links:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText92->Wrap( -1 ); - bSizer1721->Add( m_staticText92, 0, wxBOTTOM, 5 ); - - wxArrayString m_choiceHandleSymlinksChoices; - m_choiceHandleSymlinks = new wxChoice( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleSymlinksChoices, 0 ); - m_choiceHandleSymlinks->SetSelection( -1 ); - bSizer1721->Add( m_choiceHandleSymlinks, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_hyperlink24 = new wxHyperlinkCtrl( m_panelComparisonSettings, wxID_ANY, _("More information"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer1721->Add( m_hyperlink24, 0, wxTOP, 5 ); - - - bSizer159->Add( bSizer1721, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - m_staticline331 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer159->Add( m_staticline331, 0, wxEXPAND, 5 ); - - - m_panelComparisonSettings->SetSizer( bSizer159 ); - m_panelComparisonSettings->Layout(); - bSizer159->Fit( m_panelComparisonSettings ); - bSizer275->Add( m_panelComparisonSettings, 0, wxEXPAND, 5 ); - - - m_panelCompSettingsHolder->SetSizer( bSizer275 ); - m_panelCompSettingsHolder->Layout(); - bSizer275->Fit( m_panelCompSettingsHolder ); - m_notebook->AddPage( m_panelCompSettingsHolder, _("dummy"), false ); - m_panelFilterSettingsHolder = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelFilterSettingsHolder->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer278; - bSizer278 = new wxBoxSizer( wxVERTICAL ); - - bSizerLocalFilterSettings = new wxBoxSizer( wxVERTICAL ); - - m_staticText144 = new wxStaticText( m_panelFilterSettingsHolder, wxID_ANY, _("Local settings:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText144->Wrap( -1 ); - bSizerLocalFilterSettings->Add( m_staticText144, 0, wxALL, 10 ); - - m_staticline61 = new wxStaticLine( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerLocalFilterSettings->Add( m_staticline61, 0, wxEXPAND, 5 ); - - - bSizer278->Add( bSizerLocalFilterSettings, 0, wxEXPAND, 5 ); - - m_panelFilterSettings = new wxPanel( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelFilterSettings->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer1591; - bSizer1591 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer166; - bSizer166 = new wxBoxSizer( wxVERTICAL ); - - - bSizer166->Add( 0, 10, 0, 0, 5 ); - - wxBoxSizer* bSizer1661; - bSizer1661 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapInclude = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); - bSizer1661->Add( m_bitmapInclude, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - wxBoxSizer* bSizer1731; - bSizer1731 = new wxBoxSizer( wxVERTICAL ); - - m_staticText78 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Include:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText78->Wrap( -1 ); - bSizer1731->Add( m_staticText78, 0, 0, 5 ); - - m_textCtrlInclude = new wxTextCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); - m_textCtrlInclude->SetMinSize( wxSize( 280,-1 ) ); - - bSizer1731->Add( m_textCtrlInclude, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP, 5 ); - - - bSizer1661->Add( bSizer1731, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer166->Add( bSizer1661, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxLEFT, 5 ); - - m_staticline22 = new wxStaticLine( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer166->Add( m_staticline22, 0, wxEXPAND, 5 ); - - - bSizer166->Add( 0, 10, 0, 0, 5 ); - - wxBoxSizer* bSizer1651; - bSizer1651 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapExclude = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); - bSizer1651->Add( m_bitmapExclude, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxBoxSizer* bSizer1742; - bSizer1742 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer189; - bSizer189 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText77 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Exclude:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText77->Wrap( -1 ); - bSizer189->Add( m_staticText77, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer189->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_hyperlink171 = new wxHyperlinkCtrl( m_panelFilterSettings, wxID_ANY, _("Show examples"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer189->Add( m_hyperlink171, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - bSizer1742->Add( bSizer189, 0, wxEXPAND, 5 ); - - m_textCtrlExclude = new wxTextCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); - bSizer1742->Add( m_textCtrlExclude, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); - - - bSizer1651->Add( bSizer1742, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer166->Add( bSizer1651, 2, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxLEFT, 5 ); - - - bSizer1591->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticline24 = new wxStaticLine( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer1591->Add( m_staticline24, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer160; - bSizer160 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer167; - bSizer167 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapFilterDate = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 34,34 ), 0 ); - bSizer167->Add( m_bitmapFilterDate, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxBoxSizer* bSizer165; - bSizer165 = new wxBoxSizer( wxVERTICAL ); - - m_staticText79 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Time span:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText79->Wrap( -1 ); - bSizer165->Add( m_staticText79, 0, wxBOTTOM, 5 ); - - m_spinCtrlTimespan = new wxSpinCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); - bSizer165->Add( m_spinCtrlTimespan, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxArrayString m_choiceUnitTimespanChoices; - m_choiceUnitTimespan = new wxChoice( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitTimespanChoices, 0 ); - m_choiceUnitTimespan->SetSelection( 0 ); - bSizer165->Add( m_choiceUnitTimespan, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer167->Add( bSizer165, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer160->Add( bSizer167, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); - - m_staticline23 = new wxStaticLine( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer160->Add( m_staticline23, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer168; - bSizer168 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapFilterSize = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 32,32 ), 0 ); - bSizer168->Add( m_bitmapFilterSize, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - wxBoxSizer* bSizer158; - bSizer158 = new wxBoxSizer( wxVERTICAL ); - - m_staticText80 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("File size:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText80->Wrap( -1 ); - bSizer158->Add( m_staticText80, 0, wxBOTTOM, 5 ); - - wxBoxSizer* bSizer162; - bSizer162 = new wxBoxSizer( wxVERTICAL ); - - m_staticText101 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Minimum:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText101->Wrap( -1 ); - bSizer162->Add( m_staticText101, 0, wxBOTTOM, 2 ); - - m_spinCtrlMinSize = new wxSpinCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); - bSizer162->Add( m_spinCtrlMinSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxArrayString m_choiceUnitMinSizeChoices; - m_choiceUnitMinSize = new wxChoice( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitMinSizeChoices, 0 ); - m_choiceUnitMinSize->SetSelection( 0 ); - bSizer162->Add( m_choiceUnitMinSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer158->Add( bSizer162, 0, wxBOTTOM|wxEXPAND, 5 ); - - wxBoxSizer* bSizer163; - bSizer163 = new wxBoxSizer( wxVERTICAL ); - - m_staticText102 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Maximum:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText102->Wrap( -1 ); - bSizer163->Add( m_staticText102, 0, wxBOTTOM, 2 ); - - m_spinCtrlMaxSize = new wxSpinCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); - bSizer163->Add( m_spinCtrlMaxSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxArrayString m_choiceUnitMaxSizeChoices; - m_choiceUnitMaxSize = new wxChoice( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitMaxSizeChoices, 0 ); - m_choiceUnitMaxSize->SetSelection( 0 ); - bSizer163->Add( m_choiceUnitMaxSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer158->Add( bSizer163, 0, wxEXPAND, 5 ); - - - bSizer168->Add( bSizer158, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer160->Add( bSizer168, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); - - - bSizer1591->Add( bSizer160, 0, wxEXPAND, 5 ); - - - m_panelFilterSettings->SetSizer( bSizer1591 ); - m_panelFilterSettings->Layout(); - bSizer1591->Fit( m_panelFilterSettings ); - bSizer278->Add( m_panelFilterSettings, 1, wxEXPAND, 5 ); - - m_staticline62 = new wxStaticLine( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer278->Add( m_staticline62, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer280; - bSizer280 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonReset = new wxButton( m_panelFilterSettingsHolder, wxID_DEFAULT, _("&Reset"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer280->Add( m_buttonReset, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText44 = new wxStaticText( m_panelFilterSettingsHolder, wxID_ANY, _("Select filter rules to exclude certain files from synchronization. Enter file paths relative to their corresponding folder pair."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticText44->Wrap( 600 ); - bSizer280->Add( m_staticText44, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 ); - - - bSizer278->Add( bSizer280, 0, wxEXPAND, 5 ); - - - m_panelFilterSettingsHolder->SetSizer( bSizer278 ); - m_panelFilterSettingsHolder->Layout(); - bSizer278->Fit( m_panelFilterSettingsHolder ); - m_notebook->AddPage( m_panelFilterSettingsHolder, _("dummy"), false ); - m_panelSyncSettingsHolder = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelSyncSettingsHolder->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer276; - bSizer276 = new wxBoxSizer( wxVERTICAL ); - - bSizerLocalSyncSettings = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxUseLocalSyncOptions = new wxCheckBox( m_panelSyncSettingsHolder, wxID_ANY, _("Use local settings:"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizerLocalSyncSettings->Add( m_checkBoxUseLocalSyncOptions, 0, wxALL|wxEXPAND, 10 ); - - m_staticline60 = new wxStaticLine( m_panelSyncSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerLocalSyncSettings->Add( m_staticline60, 0, wxEXPAND, 5 ); - - - bSizer276->Add( bSizerLocalSyncSettings, 0, wxEXPAND, 5 ); - - m_panelSyncSettings = new wxPanel( m_panelSyncSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelSyncSettings->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer232; - bSizer232 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer237; - bSizer237 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer235; - bSizer235 = new wxBoxSizer( wxVERTICAL ); - - m_staticText86 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Select a variant:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText86->Wrap( -1 ); - bSizer235->Add( m_staticText86, 0, wxBOTTOM, 5 ); - - wxBoxSizer* bSizer236; - bSizer236 = new wxBoxSizer( wxVERTICAL ); - - m_toggleBtnTwoWay = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_toggleBtnTwoWay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer236->Add( m_toggleBtnTwoWay, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); - - m_toggleBtnMirror = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_toggleBtnMirror->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer236->Add( m_toggleBtnMirror, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); - - m_toggleBtnUpdate = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_toggleBtnUpdate->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer236->Add( m_toggleBtnUpdate, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); - - m_toggleBtnCustom = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_toggleBtnCustom->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer236->Add( m_toggleBtnCustom, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer235->Add( bSizer236, 0, 0, 5 ); - - m_checkBoxDetectMove = new wxCheckBox( m_panelSyncSettings, wxID_ANY, _("Detect moved files"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxDetectMove->SetValue(true); - m_checkBoxDetectMove->SetToolTip( _("- Requires and creates database files\n- Detection active after initial sync\n- Not supported by all file systems") ); - - bSizer235->Add( m_checkBoxDetectMove, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP, 5 ); - - - bSizer237->Add( bSizer235, 0, wxALL, 10 ); - - m_staticline53 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer237->Add( m_staticline53, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer238; - bSizer238 = new wxBoxSizer( wxVERTICAL ); - - m_textCtrlSyncVarDescription = new wxTextCtrl( m_panelSyncSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxNO_BORDER ); - bSizer238->Add( m_textCtrlSyncVarDescription, 1, wxEXPAND|wxLEFT, 5 ); - - m_staticline43 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer238->Add( m_staticline43, 0, wxEXPAND, 5 ); - - bSizerSyncConfig = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer173; - bSizer173 = new wxBoxSizer( wxVERTICAL ); - - - bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText119 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Category"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText119->Wrap( -1 ); - bSizer173->Add( m_staticText119, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText120 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText120->Wrap( -1 ); - bSizer173->Add( m_staticText120, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizerSyncConfig->Add( bSizer173, 0, wxEXPAND|wxRIGHT, 5 ); - - fgSizerSyncDirections = new wxFlexGridSizer( 2, 0, 5, 5 ); - fgSizerSyncDirections->SetFlexibleDirection( wxBOTH ); - fgSizerSyncDirections->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_bitmapLeftOnly = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapLeftOnly->SetToolTip( _("Item exists on left side only") ); - - fgSizerSyncDirections->Add( m_bitmapLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapLeftNewer = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapLeftNewer->SetToolTip( _("Left side is newer") ); - - fgSizerSyncDirections->Add( m_bitmapLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapDifferent = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapDifferent->SetToolTip( _("Items have different content") ); - - fgSizerSyncDirections->Add( m_bitmapDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapConflict = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapConflict->SetToolTip( _("Conflict/item cannot be categorized") ); - - fgSizerSyncDirections->Add( m_bitmapConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapRightNewer = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapRightNewer->SetToolTip( _("Right side is newer") ); - - fgSizerSyncDirections->Add( m_bitmapRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapRightOnly = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapRightOnly->SetToolTip( _("Item exists on right side only") ); - - fgSizerSyncDirections->Add( m_bitmapRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLeftOnly = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - fgSizerSyncDirections->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLeftNewer = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - fgSizerSyncDirections->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonDifferent = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - fgSizerSyncDirections->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonConflict = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - fgSizerSyncDirections->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonRightNewer = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - fgSizerSyncDirections->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonRightOnly = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - fgSizerSyncDirections->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerSyncConfig->Add( fgSizerSyncDirections, 0, 0, 5 ); - - m_bitmapDatabase = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_bitmapDatabase->SetToolTip( _("Detect synchronization directions with the help of database files") ); - - bSizerSyncConfig->Add( m_bitmapDatabase, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxALIGN_CENTER_VERTICAL, 10 ); - - wxBoxSizer* bSizerKeepVerticalHeightWhenSyncDirsNotShown; - bSizerKeepVerticalHeightWhenSyncDirsNotShown = new wxBoxSizer( wxVERTICAL ); - - - bSizerKeepVerticalHeightWhenSyncDirsNotShown->Add( 0, 45, 0, 0, 5 ); - - - bSizerKeepVerticalHeightWhenSyncDirsNotShown->Add( 0, 5, 1, 0, 5 ); - - - bSizerKeepVerticalHeightWhenSyncDirsNotShown->Add( 0, 46, 0, 0, 5 ); - - - bSizerSyncConfig->Add( bSizerKeepVerticalHeightWhenSyncDirsNotShown, 0, 0, 5 ); - - - bSizer238->Add( bSizerSyncConfig, 0, wxALL, 10 ); - - - bSizer237->Add( bSizer238, 1, wxEXPAND, 5 ); - - - bSizer232->Add( bSizer237, 0, wxEXPAND, 5 ); - - m_staticline54 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer232->Add( m_staticline54, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer184; - bSizer184 = new wxBoxSizer( wxVERTICAL ); - - m_staticText87 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Delete files:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText87->Wrap( -1 ); - bSizer184->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer180; - bSizer180 = new wxBoxSizer( wxHORIZONTAL ); - - m_toggleBtnPermanent = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("Permanent"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnPermanent->SetToolTip( _("Delete or overwrite files permanently") ); - - bSizer180->Add( m_toggleBtnPermanent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); - - m_toggleBtnRecycler = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("&Recycle bin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnRecycler->SetToolTip( _("Back up deleted and overwritten files in the recycle bin") ); - - bSizer180->Add( m_toggleBtnRecycler, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); - - m_toggleBtnVersioning = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("Versioning"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnVersioning->SetToolTip( _("Move files to a user-defined folder") ); - - bSizer180->Add( m_toggleBtnVersioning, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer184->Add( bSizer180, 0, 0, 5 ); - - bSizerVersioning = new wxBoxSizer( wxHORIZONTAL ); - - m_panelVersioning = new wxPanel( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelVersioning->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer191; - bSizer191 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer156; - bSizer156 = new wxBoxSizer( wxHORIZONTAL ); - - m_versioningFolder = new FolderHistoryBox( m_panelVersioning, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer156->Add( m_versioningFolder, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectDirVersioning = new wxButton( m_panelVersioning, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectDirVersioning->SetToolTip( _("Select a folder") ); - - bSizer156->Add( m_buttonSelectDirVersioning, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer191->Add( bSizer156, 0, wxEXPAND|wxBOTTOM, 5 ); - - bSizer192 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText93 = new wxStaticText( m_panelVersioning, wxID_ANY, _("Naming convention:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText93->Wrap( -1 ); - bSizer192->Add( m_staticText93, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - wxArrayString m_choiceVersioningStyleChoices; - m_choiceVersioningStyle = new wxChoice( m_panelVersioning, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVersioningStyleChoices, 0 ); - m_choiceVersioningStyle->SetSelection( 0 ); - bSizer192->Add( m_choiceVersioningStyle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_staticTextNamingCvtPart1 = new wxStaticText( m_panelVersioning, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextNamingCvtPart1->Wrap( -1 ); - m_staticTextNamingCvtPart1->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer192->Add( m_staticTextNamingCvtPart1, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextNamingCvtPart2Bold = new wxStaticText( m_panelVersioning, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextNamingCvtPart2Bold->Wrap( -1 ); - m_staticTextNamingCvtPart2Bold->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - m_staticTextNamingCvtPart2Bold->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer192->Add( m_staticTextNamingCvtPart2Bold, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextNamingCvtPart3 = new wxStaticText( m_panelVersioning, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextNamingCvtPart3->Wrap( -1 ); - m_staticTextNamingCvtPart3->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer192->Add( m_staticTextNamingCvtPart3, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer192->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_hyperlink17 = new wxHyperlinkCtrl( m_panelVersioning, wxID_ANY, _("Show examples"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer192->Add( m_hyperlink17, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - - bSizer191->Add( bSizer192, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - m_panelVersioning->SetSizer( bSizer191 ); - m_panelVersioning->Layout(); - bSizer191->Fit( m_panelVersioning ); - bSizerVersioning->Add( m_panelVersioning, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer184->Add( bSizerVersioning, 0, wxTOP|wxEXPAND, 5 ); - - - bSizer232->Add( bSizer184, 0, wxALL|wxEXPAND, 10 ); - - bSizerMiscConfig = new wxBoxSizer( wxVERTICAL ); - - m_staticline582 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerMiscConfig->Add( m_staticline582, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer1732; - bSizer1732 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer174; - bSizer174 = new wxBoxSizer( wxVERTICAL ); - - m_staticText88 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Handle errors:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText88->Wrap( -1 ); - bSizer174->Add( m_staticText88, 0, wxBOTTOM, 5 ); - - wxBoxSizer* bSizer175; - bSizer175 = new wxBoxSizer( wxHORIZONTAL ); - - m_toggleBtnErrorIgnore = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnErrorIgnore->SetToolTip( _("Hide all error and warning messages") ); - - bSizer175->Add( m_toggleBtnErrorIgnore, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_toggleBtnErrorPopup = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnErrorPopup->SetToolTip( _("Show pop-up on errors or warnings") ); - - bSizer175->Add( m_toggleBtnErrorPopup, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer174->Add( bSizer175, 0, 0, 5 ); - - - bSizer1732->Add( bSizer174, 0, wxALL, 10 ); - - m_staticline57 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer1732->Add( m_staticline57, 0, wxEXPAND, 5 ); - - bSizerOnCompletion = new wxBoxSizer( wxVERTICAL ); - - m_staticText89 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText89->Wrap( -1 ); - bSizerOnCompletion->Add( m_staticText89, 0, wxBOTTOM, 5 ); - - m_comboBoxOnCompletion = new OnCompletionBox( m_panelSyncSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizerOnCompletion->Add( m_comboBoxOnCompletion, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer1732->Add( bSizerOnCompletion, 1, wxALL, 10 ); - - - bSizerMiscConfig->Add( bSizer1732, 1, wxEXPAND, 5 ); - - - bSizer232->Add( bSizerMiscConfig, 1, wxEXPAND, 5 ); - - - m_panelSyncSettings->SetSizer( bSizer232 ); - m_panelSyncSettings->Layout(); - bSizer232->Fit( m_panelSyncSettings ); - bSizer276->Add( m_panelSyncSettings, 1, wxEXPAND, 5 ); - - - m_panelSyncSettingsHolder->SetSizer( bSizer276 ); - m_panelSyncSettingsHolder->Layout(); - bSizer276->Fit( m_panelSyncSettingsHolder ); - m_notebook->AddPage( m_panelSyncSettingsHolder, _("dummy"), true ); - - bSizer7->Add( m_notebook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonOkay->SetDefault(); - m_buttonOkay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerStdButtons->Add( m_buttonOkay, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer7->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); - - - this->SetSizer( bSizer7 ); - this->Layout(); - bSizer7->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ConfigDlgGenerated::OnClose ) ); - m_checkBoxUseLocalCmpOptions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleLocalCompSettings ), NULL, this ); - m_toggleBtnTimeSize->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnTimeSizeDouble ), NULL, this ); - m_toggleBtnTimeSize->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnTimeSize ), NULL, this ); - m_toggleBtnContent->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnContentDouble ), NULL, this ); - m_toggleBtnContent->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnContent ), NULL, this ); - m_choiceHandleSymlinks->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_hyperlink24->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpComparisonSettings ), NULL, this ); - m_textCtrlInclude->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); - m_hyperlink171->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpShowExamples ), NULL, this ); - m_textCtrlExclude->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); - m_choiceUnitTimespan->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); - m_choiceUnitMinSize->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); - m_choiceUnitMaxSize->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); - m_buttonReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnFilterReset ), NULL, this ); - m_checkBoxUseLocalSyncOptions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleLocalSyncSettings ), NULL, this ); - m_toggleBtnTwoWay->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncTwoWayDouble ), NULL, this ); - m_toggleBtnTwoWay->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncTwoWay ), NULL, this ); - m_toggleBtnMirror->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncMirrorDouble ), NULL, this ); - m_toggleBtnMirror->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncMirror ), NULL, this ); - m_toggleBtnUpdate->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncUpdateDouble ), NULL, this ); - m_toggleBtnUpdate->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncUpdate ), NULL, this ); - m_toggleBtnCustom->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncCustomDouble ), NULL, this ); - m_toggleBtnCustom->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncCustom ), NULL, this ); - m_checkBoxDetectMove->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleDetectMovedFiles ), NULL, this ); - m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnLeftNewer ), NULL, this ); - m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDifferent ), NULL, this ); - m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnConflict ), NULL, this ); - m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnRightNewer ), NULL, this ); - m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnExRightSideOnly ), NULL, this ); - m_toggleBtnPermanent->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionPermanent ), NULL, this ); - m_toggleBtnRecycler->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionRecycler ), NULL, this ); - m_toggleBtnVersioning->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionVersioning ), NULL, this ); - m_choiceVersioningStyle->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeSyncOption ), NULL, this ); - m_hyperlink17->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpVersioning ), NULL, this ); - m_toggleBtnErrorIgnore->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnErrorIgnore ), NULL, this ); - m_toggleBtnErrorPopup->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnErrorPopup ), NULL, this ); - m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnOkay ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnCancel ), NULL, this ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer7; + bSizer7 = new wxBoxSizer( wxVERTICAL ); + + m_notebook = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelCompSettingsHolder = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelCompSettingsHolder->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer275; + bSizer275 = new wxBoxSizer( wxVERTICAL ); + + bSizerLocalCompSettings = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxUseLocalCmpOptions = new wxCheckBox( m_panelCompSettingsHolder, wxID_ANY, _("Use local settings:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxUseLocalCmpOptions->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizerLocalCompSettings->Add( m_checkBoxUseLocalCmpOptions, 0, wxALL|wxEXPAND, 10 ); + + m_staticline59 = new wxStaticLine( m_panelCompSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerLocalCompSettings->Add( m_staticline59, 0, wxEXPAND, 5 ); + + + bSizer275->Add( bSizerLocalCompSettings, 0, wxEXPAND, 5 ); + + m_panelComparisonSettings = new wxPanel( m_panelCompSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelComparisonSettings->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer159; + bSizer159 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer178; + bSizer178 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer182; + bSizer182 = new wxBoxSizer( wxVERTICAL ); + + m_staticText91 = new wxStaticText( m_panelComparisonSettings, wxID_ANY, _("Select a variant:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText91->Wrap( -1 ); + bSizer182->Add( m_staticText91, 0, wxALL, 5 ); + + wxFlexGridSizer* fgSizer16; + fgSizer16 = new wxFlexGridSizer( 2, 2, 5, 5 ); + fgSizer16->SetFlexibleDirection( wxBOTH ); + fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapByTime = new wxStaticBitmap( m_panelComparisonSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapByTime->SetToolTip( _("Identify equal files by comparing modification time and size.") ); + + fgSizer16->Add( m_bitmapByTime, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_toggleBtnTimeSize = new wxToggleButton( m_panelComparisonSettings, wxID_ANY, _("File time and size"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_toggleBtnTimeSize->SetValue( true ); + m_toggleBtnTimeSize->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + fgSizer16->Add( m_toggleBtnTimeSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_bitmapByContent = new wxStaticBitmap( m_panelComparisonSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapByContent->SetToolTip( _("Identify equal files by comparing the file content.") ); + + fgSizer16->Add( m_bitmapByContent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_toggleBtnContent = new wxToggleButton( m_panelComparisonSettings, wxID_ANY, _("File content"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_toggleBtnContent->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + fgSizer16->Add( m_toggleBtnContent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer182->Add( fgSizer16, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer178->Add( bSizer182, 0, wxALL, 5 ); + + m_staticline42 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer178->Add( m_staticline42, 0, wxEXPAND, 5 ); + + m_textCtrlCompVarDescription = new wxTextCtrl( m_panelComparisonSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxNO_BORDER ); + bSizer178->Add( m_textCtrlCompVarDescription, 1, wxEXPAND|wxLEFT, 5 ); + + + bSizer159->Add( bSizer178, 0, wxEXPAND, 5 ); + + m_staticline33 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer159->Add( m_staticline33, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer1734; + bSizer1734 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer1733; + bSizer1733 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxTimeShift = new wxCheckBox( m_panelComparisonSettings, wxID_ANY, _("Ignore time shift (in hours)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxTimeShift->SetToolTip( _("Consider file times with specified offset as equal") ); + + bSizer1733->Add( m_checkBoxTimeShift, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_spinCtrlTimeShift = new wxSpinCtrl( m_panelComparisonSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 70,-1 ), wxSP_ARROW_KEYS|wxSP_WRAP, 1, 26, 0 ); + m_spinCtrlTimeShift->SetToolTip( _("Consider file times with specified offset as equal") ); + + bSizer1733->Add( m_spinCtrlTimeShift, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_hyperlink241 = new wxHyperlinkCtrl( m_panelComparisonSettings, wxID_ANY, _("Handle daylight saving time"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer1733->Add( m_hyperlink241, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer1734->Add( bSizer1733, 0, wxALL, 5 ); + + m_staticline44 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer1734->Add( m_staticline44, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer1721; + bSizer1721 = new wxBoxSizer( wxVERTICAL ); + + m_staticText92 = new wxStaticText( m_panelComparisonSettings, wxID_ANY, _("Symbolic links:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText92->Wrap( -1 ); + bSizer1721->Add( m_staticText92, 0, wxBOTTOM, 5 ); + + wxArrayString m_choiceHandleSymlinksChoices; + m_choiceHandleSymlinks = new wxChoice( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleSymlinksChoices, 0 ); + m_choiceHandleSymlinks->SetSelection( 0 ); + bSizer1721->Add( m_choiceHandleSymlinks, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_hyperlink24 = new wxHyperlinkCtrl( m_panelComparisonSettings, wxID_ANY, _("More information"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer1721->Add( m_hyperlink24, 0, wxTOP, 5 ); + + + bSizer1734->Add( bSizer1721, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + m_staticline441 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer1734->Add( m_staticline441, 0, wxEXPAND, 5 ); + + + bSizer159->Add( bSizer1734, 0, 0, 5 ); + + m_staticline331 = new wxStaticLine( m_panelComparisonSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer159->Add( m_staticline331, 0, wxEXPAND, 5 ); + + + m_panelComparisonSettings->SetSizer( bSizer159 ); + m_panelComparisonSettings->Layout(); + bSizer159->Fit( m_panelComparisonSettings ); + bSizer275->Add( m_panelComparisonSettings, 0, wxEXPAND, 5 ); + + + m_panelCompSettingsHolder->SetSizer( bSizer275 ); + m_panelCompSettingsHolder->Layout(); + bSizer275->Fit( m_panelCompSettingsHolder ); + m_notebook->AddPage( m_panelCompSettingsHolder, _("dummy"), true ); + m_panelFilterSettingsHolder = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelFilterSettingsHolder->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer278; + bSizer278 = new wxBoxSizer( wxVERTICAL ); + + bSizerLocalFilterSettings = new wxBoxSizer( wxVERTICAL ); + + m_staticText144 = new wxStaticText( m_panelFilterSettingsHolder, wxID_ANY, _("Local settings:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText144->Wrap( -1 ); + bSizerLocalFilterSettings->Add( m_staticText144, 0, wxALL, 10 ); + + m_staticline61 = new wxStaticLine( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerLocalFilterSettings->Add( m_staticline61, 0, wxEXPAND, 5 ); + + + bSizer278->Add( bSizerLocalFilterSettings, 0, wxEXPAND, 5 ); + + m_panelFilterSettings = new wxPanel( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelFilterSettings->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer1591; + bSizer1591 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer166; + bSizer166 = new wxBoxSizer( wxVERTICAL ); + + + bSizer166->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer1661; + bSizer1661 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapInclude = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + bSizer1661->Add( m_bitmapInclude, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + wxBoxSizer* bSizer1731; + bSizer1731 = new wxBoxSizer( wxVERTICAL ); + + m_staticText78 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Include:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText78->Wrap( -1 ); + bSizer1731->Add( m_staticText78, 0, 0, 5 ); + + m_textCtrlInclude = new wxTextCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); + m_textCtrlInclude->SetMinSize( wxSize( 280,-1 ) ); + + bSizer1731->Add( m_textCtrlInclude, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP, 5 ); + + + bSizer1661->Add( bSizer1731, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer166->Add( bSizer1661, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxLEFT, 5 ); + + m_staticline22 = new wxStaticLine( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer166->Add( m_staticline22, 0, wxEXPAND, 5 ); + + + bSizer166->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer1651; + bSizer1651 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapExclude = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + bSizer1651->Add( m_bitmapExclude, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxBoxSizer* bSizer1742; + bSizer1742 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer189; + bSizer189 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText77 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Exclude:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText77->Wrap( -1 ); + bSizer189->Add( m_staticText77, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer189->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_hyperlink171 = new wxHyperlinkCtrl( m_panelFilterSettings, wxID_ANY, _("Show examples"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer189->Add( m_hyperlink171, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + bSizer1742->Add( bSizer189, 0, wxEXPAND, 5 ); + + m_textCtrlExclude = new wxTextCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); + bSizer1742->Add( m_textCtrlExclude, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP, 5 ); + + + bSizer1651->Add( bSizer1742, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer166->Add( bSizer1651, 2, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxLEFT, 5 ); + + + bSizer1591->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticline24 = new wxStaticLine( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer1591->Add( m_staticline24, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer160; + bSizer160 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer167; + bSizer167 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapFilterDate = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 34,34 ), 0 ); + bSizer167->Add( m_bitmapFilterDate, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxBoxSizer* bSizer165; + bSizer165 = new wxBoxSizer( wxVERTICAL ); + + m_staticText79 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Time span:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText79->Wrap( -1 ); + bSizer165->Add( m_staticText79, 0, wxBOTTOM, 5 ); + + m_spinCtrlTimespan = new wxSpinCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); + bSizer165->Add( m_spinCtrlTimespan, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxArrayString m_choiceUnitTimespanChoices; + m_choiceUnitTimespan = new wxChoice( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitTimespanChoices, 0 ); + m_choiceUnitTimespan->SetSelection( 0 ); + bSizer165->Add( m_choiceUnitTimespan, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer167->Add( bSizer165, 1, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer160->Add( bSizer167, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); + + m_staticline23 = new wxStaticLine( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer160->Add( m_staticline23, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer168; + bSizer168 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapFilterSize = new wxStaticBitmap( m_panelFilterSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 32,32 ), 0 ); + bSizer168->Add( m_bitmapFilterSize, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxVERTICAL ); + + m_staticText80 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("File size:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText80->Wrap( -1 ); + bSizer158->Add( m_staticText80, 0, wxBOTTOM, 5 ); + + wxBoxSizer* bSizer162; + bSizer162 = new wxBoxSizer( wxVERTICAL ); + + m_staticText101 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Minimum:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText101->Wrap( -1 ); + bSizer162->Add( m_staticText101, 0, wxBOTTOM, 2 ); + + m_spinCtrlMinSize = new wxSpinCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); + bSizer162->Add( m_spinCtrlMinSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxArrayString m_choiceUnitMinSizeChoices; + m_choiceUnitMinSize = new wxChoice( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitMinSizeChoices, 0 ); + m_choiceUnitMinSize->SetSelection( 0 ); + bSizer162->Add( m_choiceUnitMinSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer158->Add( bSizer162, 0, wxBOTTOM|wxEXPAND, 5 ); + + wxBoxSizer* bSizer163; + bSizer163 = new wxBoxSizer( wxVERTICAL ); + + m_staticText102 = new wxStaticText( m_panelFilterSettings, wxID_ANY, _("Maximum:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText102->Wrap( -1 ); + bSizer163->Add( m_staticText102, 0, wxBOTTOM, 2 ); + + m_spinCtrlMaxSize = new wxSpinCtrl( m_panelFilterSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 0, 2000000000, 0 ); + bSizer163->Add( m_spinCtrlMaxSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxArrayString m_choiceUnitMaxSizeChoices; + m_choiceUnitMaxSize = new wxChoice( m_panelFilterSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceUnitMaxSizeChoices, 0 ); + m_choiceUnitMaxSize->SetSelection( 0 ); + bSizer163->Add( m_choiceUnitMaxSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer158->Add( bSizer163, 0, wxEXPAND, 5 ); + + + bSizer168->Add( bSizer158, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer160->Add( bSizer168, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); + + + bSizer1591->Add( bSizer160, 0, wxEXPAND, 5 ); + + + m_panelFilterSettings->SetSizer( bSizer1591 ); + m_panelFilterSettings->Layout(); + bSizer1591->Fit( m_panelFilterSettings ); + bSizer278->Add( m_panelFilterSettings, 1, wxEXPAND, 5 ); + + m_staticline62 = new wxStaticLine( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer278->Add( m_staticline62, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer280; + bSizer280 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonReset = new wxButton( m_panelFilterSettingsHolder, wxID_DEFAULT, _("&Reset"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer280->Add( m_buttonReset, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText44 = new wxStaticText( m_panelFilterSettingsHolder, wxID_ANY, _("Select filter rules to exclude certain files from synchronization. Enter file paths relative to their corresponding folder pair."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticText44->Wrap( 600 ); + bSizer280->Add( m_staticText44, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 10 ); + + + bSizer278->Add( bSizer280, 0, wxEXPAND, 5 ); + + + m_panelFilterSettingsHolder->SetSizer( bSizer278 ); + m_panelFilterSettingsHolder->Layout(); + bSizer278->Fit( m_panelFilterSettingsHolder ); + m_notebook->AddPage( m_panelFilterSettingsHolder, _("dummy"), false ); + m_panelSyncSettingsHolder = new wxPanel( m_notebook, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelSyncSettingsHolder->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer276; + bSizer276 = new wxBoxSizer( wxVERTICAL ); + + bSizerLocalSyncSettings = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxUseLocalSyncOptions = new wxCheckBox( m_panelSyncSettingsHolder, wxID_ANY, _("Use local settings:"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerLocalSyncSettings->Add( m_checkBoxUseLocalSyncOptions, 0, wxALL|wxEXPAND, 10 ); + + m_staticline60 = new wxStaticLine( m_panelSyncSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerLocalSyncSettings->Add( m_staticline60, 0, wxEXPAND, 5 ); + + + bSizer276->Add( bSizerLocalSyncSettings, 0, wxEXPAND, 5 ); + + m_panelSyncSettings = new wxPanel( m_panelSyncSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelSyncSettings->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer232; + bSizer232 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer237; + bSizer237 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer235; + bSizer235 = new wxBoxSizer( wxVERTICAL ); + + m_staticText86 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Select a variant:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText86->Wrap( -1 ); + bSizer235->Add( m_staticText86, 0, wxALL, 5 ); + + wxBoxSizer* bSizer236; + bSizer236 = new wxBoxSizer( wxVERTICAL ); + + m_toggleBtnTwoWay = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_toggleBtnTwoWay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer236->Add( m_toggleBtnTwoWay, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); + + m_toggleBtnMirror = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_toggleBtnMirror->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer236->Add( m_toggleBtnMirror, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); + + m_toggleBtnUpdate = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_toggleBtnUpdate->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer236->Add( m_toggleBtnUpdate, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); + + m_toggleBtnCustom = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_toggleBtnCustom->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer236->Add( m_toggleBtnCustom, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer235->Add( bSizer236, 0, wxRIGHT|wxLEFT, 5 ); + + m_checkBoxDetectMove = new wxCheckBox( m_panelSyncSettings, wxID_ANY, _("Detect moved files"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxDetectMove->SetValue(true); + m_checkBoxDetectMove->SetToolTip( _("- Requires and creates database files\n- Detection active after initial sync\n- Not supported by all file systems") ); + + bSizer235->Add( m_checkBoxDetectMove, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + + + bSizer237->Add( bSizer235, 0, wxALL, 5 ); + + m_staticline53 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer237->Add( m_staticline53, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer238; + bSizer238 = new wxBoxSizer( wxVERTICAL ); + + m_textCtrlSyncVarDescription = new wxTextCtrl( m_panelSyncSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY|wxNO_BORDER ); + bSizer238->Add( m_textCtrlSyncVarDescription, 1, wxEXPAND|wxLEFT, 5 ); + + m_staticline43 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer238->Add( m_staticline43, 0, wxEXPAND, 5 ); + + bSizerSyncConfig = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer173; + bSizer173 = new wxBoxSizer( wxVERTICAL ); + + + bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText119 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Category"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText119->Wrap( -1 ); + bSizer173->Add( m_staticText119, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); + + + bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText120 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText120->Wrap( -1 ); + bSizer173->Add( m_staticText120, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer173->Add( 0, 0, 1, wxEXPAND, 5 ); + + + bSizerSyncConfig->Add( bSizer173, 0, wxEXPAND|wxRIGHT, 5 ); + + fgSizerSyncDirections = new wxFlexGridSizer( 2, 0, 5, 5 ); + fgSizerSyncDirections->SetFlexibleDirection( wxBOTH ); + fgSizerSyncDirections->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapLeftOnly = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapLeftOnly->SetToolTip( _("Item exists on left side only") ); + + fgSizerSyncDirections->Add( m_bitmapLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapLeftNewer = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapLeftNewer->SetToolTip( _("Left side is newer") ); + + fgSizerSyncDirections->Add( m_bitmapLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapDifferent = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapDifferent->SetToolTip( _("Items have different content") ); + + fgSizerSyncDirections->Add( m_bitmapDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapConflict = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapConflict->SetToolTip( _("Conflict/item cannot be categorized") ); + + fgSizerSyncDirections->Add( m_bitmapConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapRightNewer = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapRightNewer->SetToolTip( _("Right side is newer") ); + + fgSizerSyncDirections->Add( m_bitmapRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapRightOnly = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapRightOnly->SetToolTip( _("Item exists on right side only") ); + + fgSizerSyncDirections->Add( m_bitmapRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftOnly = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + fgSizerSyncDirections->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftNewer = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + fgSizerSyncDirections->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonDifferent = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + fgSizerSyncDirections->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonConflict = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + fgSizerSyncDirections->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonRightNewer = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + fgSizerSyncDirections->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonRightOnly = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + fgSizerSyncDirections->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerSyncConfig->Add( fgSizerSyncDirections, 0, 0, 5 ); + + m_bitmapDatabase = new wxStaticBitmap( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_bitmapDatabase->SetToolTip( _("Detect synchronization directions with the help of database files") ); + + bSizerSyncConfig->Add( m_bitmapDatabase, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxALIGN_CENTER_VERTICAL, 10 ); + + wxBoxSizer* bSizerKeepVerticalHeightWhenSyncDirsNotShown; + bSizerKeepVerticalHeightWhenSyncDirsNotShown = new wxBoxSizer( wxVERTICAL ); + + + bSizerKeepVerticalHeightWhenSyncDirsNotShown->Add( 0, 45, 0, 0, 5 ); + + + bSizerKeepVerticalHeightWhenSyncDirsNotShown->Add( 0, 5, 1, 0, 5 ); + + + bSizerKeepVerticalHeightWhenSyncDirsNotShown->Add( 0, 46, 0, 0, 5 ); + + + bSizerSyncConfig->Add( bSizerKeepVerticalHeightWhenSyncDirsNotShown, 0, 0, 5 ); + + + bSizer238->Add( bSizerSyncConfig, 0, wxALL, 10 ); + + + bSizer237->Add( bSizer238, 1, wxEXPAND, 5 ); + + + bSizer232->Add( bSizer237, 0, wxEXPAND, 5 ); + + m_staticline54 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer232->Add( m_staticline54, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer184; + bSizer184 = new wxBoxSizer( wxVERTICAL ); + + m_staticText87 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Delete files:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText87->Wrap( -1 ); + bSizer184->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer180; + bSizer180 = new wxBoxSizer( wxHORIZONTAL ); + + m_toggleBtnPermanent = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("Permanent"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnPermanent->SetToolTip( _("Delete or overwrite files permanently") ); + + bSizer180->Add( m_toggleBtnPermanent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + + m_toggleBtnRecycler = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("&Recycle bin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnRecycler->SetToolTip( _("Back up deleted and overwritten files in the recycle bin") ); + + bSizer180->Add( m_toggleBtnRecycler, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 5 ); + + m_toggleBtnVersioning = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("Versioning"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnVersioning->SetToolTip( _("Move files to a user-defined folder") ); + + bSizer180->Add( m_toggleBtnVersioning, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer184->Add( bSizer180, 0, 0, 5 ); + + bSizerVersioning = new wxBoxSizer( wxHORIZONTAL ); + + m_panelVersioning = new wxPanel( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelVersioning->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer191; + bSizer191 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer156; + bSizer156 = new wxBoxSizer( wxHORIZONTAL ); + + m_versioningFolder = new FolderHistoryBox( m_panelVersioning, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer156->Add( m_versioningFolder, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectDirVersioning = new wxButton( m_panelVersioning, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectDirVersioning->SetToolTip( _("Select a folder") ); + + bSizer156->Add( m_buttonSelectDirVersioning, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer191->Add( bSizer156, 0, wxEXPAND|wxBOTTOM, 5 ); + + bSizer192 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText93 = new wxStaticText( m_panelVersioning, wxID_ANY, _("Naming convention:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText93->Wrap( -1 ); + bSizer192->Add( m_staticText93, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxArrayString m_choiceVersioningStyleChoices; + m_choiceVersioningStyle = new wxChoice( m_panelVersioning, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceVersioningStyleChoices, 0 ); + m_choiceVersioningStyle->SetSelection( 0 ); + bSizer192->Add( m_choiceVersioningStyle, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticTextNamingCvtPart1 = new wxStaticText( m_panelVersioning, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNamingCvtPart1->Wrap( -1 ); + m_staticTextNamingCvtPart1->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer192->Add( m_staticTextNamingCvtPart1, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextNamingCvtPart2Bold = new wxStaticText( m_panelVersioning, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNamingCvtPart2Bold->Wrap( -1 ); + m_staticTextNamingCvtPart2Bold->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + m_staticTextNamingCvtPart2Bold->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer192->Add( m_staticTextNamingCvtPart2Bold, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextNamingCvtPart3 = new wxStaticText( m_panelVersioning, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextNamingCvtPart3->Wrap( -1 ); + m_staticTextNamingCvtPart3->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer192->Add( m_staticTextNamingCvtPart3, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer192->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_hyperlink17 = new wxHyperlinkCtrl( m_panelVersioning, wxID_ANY, _("Show examples"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer192->Add( m_hyperlink17, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + + bSizer191->Add( bSizer192, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + m_panelVersioning->SetSizer( bSizer191 ); + m_panelVersioning->Layout(); + bSizer191->Fit( m_panelVersioning ); + bSizerVersioning->Add( m_panelVersioning, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer184->Add( bSizerVersioning, 0, wxTOP|wxEXPAND, 5 ); + + + bSizer232->Add( bSizer184, 0, wxALL|wxEXPAND, 10 ); + + bSizerMiscConfig = new wxBoxSizer( wxVERTICAL ); + + m_staticline582 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerMiscConfig->Add( m_staticline582, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer1732; + bSizer1732 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer174; + bSizer174 = new wxBoxSizer( wxVERTICAL ); + + m_staticText88 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Handle errors:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText88->Wrap( -1 ); + bSizer174->Add( m_staticText88, 0, wxBOTTOM, 5 ); + + wxBoxSizer* bSizer175; + bSizer175 = new wxBoxSizer( wxHORIZONTAL ); + + m_toggleBtnErrorIgnore = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnErrorIgnore->SetToolTip( _("Hide all error and warning messages") ); + + bSizer175->Add( m_toggleBtnErrorIgnore, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_toggleBtnErrorPopup = new wxToggleButton( m_panelSyncSettings, wxID_ANY, _("Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnErrorPopup->SetToolTip( _("Show pop-up on errors or warnings") ); + + bSizer175->Add( m_toggleBtnErrorPopup, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer174->Add( bSizer175, 0, 0, 5 ); + + + bSizer1732->Add( bSizer174, 0, wxALL, 10 ); + + m_staticline57 = new wxStaticLine( m_panelSyncSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer1732->Add( m_staticline57, 0, wxEXPAND, 5 ); + + bSizerOnCompletion = new wxBoxSizer( wxVERTICAL ); + + m_staticText89 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText89->Wrap( -1 ); + bSizerOnCompletion->Add( m_staticText89, 0, wxBOTTOM, 5 ); + + m_comboBoxOnCompletion = new OnCompletionBox( m_panelSyncSettings, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizerOnCompletion->Add( m_comboBoxOnCompletion, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer1732->Add( bSizerOnCompletion, 1, wxALL, 10 ); + + + bSizerMiscConfig->Add( bSizer1732, 1, wxEXPAND, 5 ); + + + bSizer232->Add( bSizerMiscConfig, 1, wxEXPAND, 5 ); + + + m_panelSyncSettings->SetSizer( bSizer232 ); + m_panelSyncSettings->Layout(); + bSizer232->Fit( m_panelSyncSettings ); + bSizer276->Add( m_panelSyncSettings, 1, wxEXPAND, 5 ); + + + m_panelSyncSettingsHolder->SetSizer( bSizer276 ); + m_panelSyncSettingsHolder->Layout(); + bSizer276->Fit( m_panelSyncSettingsHolder ); + m_notebook->AddPage( m_panelSyncSettingsHolder, _("dummy"), false ); + + bSizer7->Add( m_notebook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerStdButtons->Add( m_buttonOkay, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer7->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); + + + this->SetSizer( bSizer7 ); + this->Layout(); + bSizer7->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ConfigDlgGenerated::OnClose ) ); + m_checkBoxUseLocalCmpOptions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleLocalCompSettings ), NULL, this ); + m_toggleBtnTimeSize->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnTimeSizeDouble ), NULL, this ); + m_toggleBtnTimeSize->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnTimeSize ), NULL, this ); + m_toggleBtnContent->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnContentDouble ), NULL, this ); + m_toggleBtnContent->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnContent ), NULL, this ); + m_checkBoxTimeShift->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeCompOption ), NULL, this ); + m_hyperlink241->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpTimeShift ), NULL, this ); + m_hyperlink24->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpComparisonSettings ), NULL, this ); + m_textCtrlInclude->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); + m_hyperlink171->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpShowExamples ), NULL, this ); + m_textCtrlExclude->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); + m_choiceUnitTimespan->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); + m_choiceUnitMinSize->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); + m_choiceUnitMaxSize->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeFilterOption ), NULL, this ); + m_buttonReset->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnFilterReset ), NULL, this ); + m_checkBoxUseLocalSyncOptions->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleLocalSyncSettings ), NULL, this ); + m_toggleBtnTwoWay->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncTwoWayDouble ), NULL, this ); + m_toggleBtnTwoWay->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncTwoWay ), NULL, this ); + m_toggleBtnMirror->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncMirrorDouble ), NULL, this ); + m_toggleBtnMirror->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncMirror ), NULL, this ); + m_toggleBtnUpdate->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncUpdateDouble ), NULL, this ); + m_toggleBtnUpdate->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncUpdate ), NULL, this ); + m_toggleBtnCustom->Connect( wxEVT_LEFT_DCLICK, wxMouseEventHandler( ConfigDlgGenerated::OnSyncCustomDouble ), NULL, this ); + m_toggleBtnCustom->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnSyncCustom ), NULL, this ); + m_checkBoxDetectMove->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleDetectMovedFiles ), NULL, this ); + m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDifferent ), NULL, this ); + m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnConflict ), NULL, this ); + m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_toggleBtnPermanent->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionPermanent ), NULL, this ); + m_toggleBtnRecycler->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionRecycler ), NULL, this ); + m_toggleBtnVersioning->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionVersioning ), NULL, this ); + m_choiceVersioningStyle->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeSyncOption ), NULL, this ); + m_hyperlink17->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( ConfigDlgGenerated::OnHelpVersioning ), NULL, this ); + m_toggleBtnErrorIgnore->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnErrorIgnore ), NULL, this ); + m_toggleBtnErrorPopup->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnErrorPopup ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnOkay ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnCancel ), NULL, this ); } ConfigDlgGenerated::~ConfigDlgGenerated() @@ -1739,221 +1776,221 @@ ConfigDlgGenerated::~ConfigDlgGenerated() SyncConfirmationDlgGenerated::SyncConfirmationDlgGenerated( 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->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer134; - bSizer134 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer72; - bSizer72 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapSync = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer72->Add( m_bitmapSync, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Start synchronization now?"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextHeader->Wrap( -1 ); - bSizer72->Add( m_staticTextHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - - bSizer134->Add( bSizer72, 0, 0, 5 ); - - m_staticline371 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline371, 0, wxEXPAND, 5 ); - - m_panelStatistics = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelStatistics->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer185; - bSizer185 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer185->Add( 40, 0, 0, 0, 5 ); - - - bSizer185->Add( 0, 0, 1, 0, 5 ); - - m_staticline38 = new wxStaticLine( m_panelStatistics, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer185->Add( m_staticline38, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer162; - bSizer162 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer182; - bSizer182 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText84 = new wxStaticText( m_panelStatistics, wxID_ANY, _("Variant:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText84->Wrap( -1 ); - bSizer182->Add( m_staticText84, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - - bSizer182->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextVariant = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextVariant->Wrap( -1 ); - m_staticTextVariant->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer182->Add( m_staticTextVariant, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer182->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer162->Add( bSizer182, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); - - m_staticline14 = new wxStaticLine( m_panelStatistics, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer162->Add( m_staticline14, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer181; - bSizer181 = new wxBoxSizer( wxVERTICAL ); - - m_staticText83 = new wxStaticText( m_panelStatistics, wxID_ANY, _("Statistics:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText83->Wrap( -1 ); - bSizer181->Add( m_staticText83, 0, wxALL, 5 ); - - wxFlexGridSizer* fgSizer11; - fgSizer11 = new wxFlexGridSizer( 2, 7, 2, 5 ); - fgSizer11->SetFlexibleDirection( wxBOTH ); - fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_bitmapDeleteLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); - - fgSizer11->Add( m_bitmapDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapUpdateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer11->Add( m_bitmapUpdateLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapCreateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); - - fgSizer11->Add( m_bitmapCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bitmapData = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapData->SetToolTip( _("Total bytes to copy") ); - - fgSizer11->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bitmapCreateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapCreateRight->SetToolTip( _("Number of files and folders that will be created") ); - - fgSizer11->Add( m_bitmapCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bitmapUpdateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer11->Add( m_bitmapUpdateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bitmapDeleteRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); - - fgSizer11->Add( m_bitmapDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextDeleteLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDeleteLeft->Wrap( -1 ); - m_staticTextDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); - - fgSizer11->Add( m_staticTextDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextUpdateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextUpdateLeft->Wrap( -1 ); - m_staticTextUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer11->Add( m_staticTextUpdateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticTextCreateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCreateLeft->Wrap( -1 ); - m_staticTextCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); - - fgSizer11->Add( m_staticTextCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticTextData = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextData->Wrap( -1 ); - m_staticTextData->SetToolTip( _("Total bytes to copy") ); - - fgSizer11->Add( m_staticTextData, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextCreateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCreateRight->Wrap( -1 ); - m_staticTextCreateRight->SetToolTip( _("Number of files and folders that will be created") ); - - fgSizer11->Add( m_staticTextCreateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextUpdateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextUpdateRight->Wrap( -1 ); - m_staticTextUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer11->Add( m_staticTextUpdateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextDeleteRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDeleteRight->Wrap( -1 ); - m_staticTextDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); - - fgSizer11->Add( m_staticTextDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer181->Add( fgSizer11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer162->Add( bSizer181, 0, wxEXPAND|wxALL, 5 ); - - - bSizer185->Add( bSizer162, 0, 0, 5 ); - - m_staticline381 = new wxStaticLine( m_panelStatistics, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer185->Add( m_staticline381, 0, wxEXPAND, 5 ); - - - bSizer185->Add( 0, 0, 1, 0, 5 ); - - - bSizer185->Add( 40, 0, 0, 0, 5 ); - - - m_panelStatistics->SetSizer( bSizer185 ); - m_panelStatistics->Layout(); - bSizer185->Fit( m_panelStatistics ); - bSizer134->Add( m_panelStatistics, 0, wxEXPAND, 5 ); - - m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline12, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer164; - bSizer164 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("&Don't show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer164->Add( m_checkBoxDontShowAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonStartSync = new wxButton( this, wxID_OK, _("&Start"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonStartSync->SetDefault(); - m_buttonStartSync->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerStdButtons->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer164->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); - - - bSizer134->Add( bSizer164, 1, wxEXPAND, 5 ); - - - this->SetSizer( bSizer134 ); - this->Layout(); - bSizer134->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncConfirmationDlgGenerated::OnClose ) ); - m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncConfirmationDlgGenerated::OnStartSync ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncConfirmationDlgGenerated::OnCancel ), NULL, this ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer134; + bSizer134 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapSync = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer72->Add( m_bitmapSync, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Start synchronization now?"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextHeader->Wrap( -1 ); + bSizer72->Add( m_staticTextHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + + bSizer134->Add( bSizer72, 0, 0, 5 ); + + m_staticline371 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline371, 0, wxEXPAND, 5 ); + + m_panelStatistics = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelStatistics->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer185; + bSizer185 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer185->Add( 40, 0, 0, 0, 5 ); + + + bSizer185->Add( 0, 0, 1, 0, 5 ); + + m_staticline38 = new wxStaticLine( m_panelStatistics, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer185->Add( m_staticline38, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer162; + bSizer162 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer182; + bSizer182 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText84 = new wxStaticText( m_panelStatistics, wxID_ANY, _("Variant:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText84->Wrap( -1 ); + bSizer182->Add( m_staticText84, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + + bSizer182->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextVariant = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextVariant->Wrap( -1 ); + m_staticTextVariant->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer182->Add( m_staticTextVariant, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer182->Add( 0, 0, 1, wxEXPAND, 5 ); + + + bSizer162->Add( bSizer182, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); + + m_staticline14 = new wxStaticLine( m_panelStatistics, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer162->Add( m_staticline14, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer181; + bSizer181 = new wxBoxSizer( wxVERTICAL ); + + m_staticText83 = new wxStaticText( m_panelStatistics, wxID_ANY, _("Statistics:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText83->Wrap( -1 ); + bSizer181->Add( m_staticText83, 0, wxALL, 5 ); + + wxFlexGridSizer* fgSizer11; + fgSizer11 = new wxFlexGridSizer( 2, 7, 2, 5 ); + fgSizer11->SetFlexibleDirection( wxBOTH ); + fgSizer11->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapDeleteLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); + + fgSizer11->Add( m_bitmapDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapUpdateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer11->Add( m_bitmapUpdateLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapCreateLeft = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); + + fgSizer11->Add( m_bitmapCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bitmapData = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapData->SetToolTip( _("Total bytes to copy") ); + + fgSizer11->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bitmapCreateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreateRight->SetToolTip( _("Number of files and folders that will be created") ); + + fgSizer11->Add( m_bitmapCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bitmapUpdateRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer11->Add( m_bitmapUpdateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bitmapDeleteRight = new wxStaticBitmap( m_panelStatistics, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); + + fgSizer11->Add( m_bitmapDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextDeleteLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDeleteLeft->Wrap( -1 ); + m_staticTextDeleteLeft->SetToolTip( _("Number of files and folders that will be deleted") ); + + fgSizer11->Add( m_staticTextDeleteLeft, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextUpdateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextUpdateLeft->Wrap( -1 ); + m_staticTextUpdateLeft->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer11->Add( m_staticTextUpdateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticTextCreateLeft = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCreateLeft->Wrap( -1 ); + m_staticTextCreateLeft->SetToolTip( _("Number of files and folders that will be created") ); + + fgSizer11->Add( m_staticTextCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticTextData = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextData->Wrap( -1 ); + m_staticTextData->SetToolTip( _("Total bytes to copy") ); + + fgSizer11->Add( m_staticTextData, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextCreateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCreateRight->Wrap( -1 ); + m_staticTextCreateRight->SetToolTip( _("Number of files and folders that will be created") ); + + fgSizer11->Add( m_staticTextCreateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextUpdateRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextUpdateRight->Wrap( -1 ); + m_staticTextUpdateRight->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer11->Add( m_staticTextUpdateRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextDeleteRight = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDeleteRight->Wrap( -1 ); + m_staticTextDeleteRight->SetToolTip( _("Number of files and folders that will be deleted") ); + + fgSizer11->Add( m_staticTextDeleteRight, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer181->Add( fgSizer11, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer162->Add( bSizer181, 0, wxEXPAND|wxALL, 5 ); + + + bSizer185->Add( bSizer162, 0, 0, 5 ); + + m_staticline381 = new wxStaticLine( m_panelStatistics, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer185->Add( m_staticline381, 0, wxEXPAND, 5 ); + + + bSizer185->Add( 0, 0, 1, 0, 5 ); + + + bSizer185->Add( 40, 0, 0, 0, 5 ); + + + m_panelStatistics->SetSizer( bSizer185 ); + m_panelStatistics->Layout(); + bSizer185->Fit( m_panelStatistics ); + bSizer134->Add( m_panelStatistics, 0, wxEXPAND, 5 ); + + m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline12, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer164; + bSizer164 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("&Don't show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer164->Add( m_checkBoxDontShowAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonStartSync = new wxButton( this, wxID_OK, _("&Start"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonStartSync->SetDefault(); + m_buttonStartSync->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerStdButtons->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer164->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); + + + bSizer134->Add( bSizer164, 1, wxEXPAND, 5 ); + + + this->SetSizer( bSizer134 ); + this->Layout(); + bSizer134->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncConfirmationDlgGenerated::OnClose ) ); + m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncConfirmationDlgGenerated::OnStartSync ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncConfirmationDlgGenerated::OnCancel ), NULL, this ); } SyncConfirmationDlgGenerated::~SyncConfirmationDlgGenerated() @@ -1962,83 +1999,83 @@ SyncConfirmationDlgGenerated::~SyncConfirmationDlgGenerated() FolderPairPanelGenerated::FolderPairPanelGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - wxBoxSizer* bSizer74; - bSizer74 = new wxBoxSizer( wxHORIZONTAL ); - - m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelLeft->SetMinSize( wxSize( 1,-1 ) ); - - wxBoxSizer* bSizer134; - bSizer134 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonRemovePair = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - bSizer134->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_directoryLeft = new FolderHistoryBox( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer134->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectDirLeft = new wxButton( m_panelLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectDirLeft->SetToolTip( _("Select a folder") ); - - bSizer134->Add( m_buttonSelectDirLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - m_panelLeft->SetSizer( bSizer134 ); - m_panelLeft->Layout(); - bSizer134->Fit( m_panelLeft ); - bSizer74->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND, 5 ); - - m_panel20 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer95; - bSizer95 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bpButtonAltCompCfg = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer95->Add( m_bpButtonAltCompCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLocalFilter = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer95->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 ); - - m_bpButtonAltSyncCfg = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer95->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); - - - m_panel20->SetSizer( bSizer95 ); - m_panel20->Layout(); - bSizer95->Fit( m_panel20 ); - bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelRight->SetMinSize( wxSize( 1,-1 ) ); - - wxBoxSizer* bSizer135; - bSizer135 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryRight = new FolderHistoryBox( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer135->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectDirRight = new wxButton( m_panelRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectDirRight->SetToolTip( _("Select a folder") ); - - bSizer135->Add( m_buttonSelectDirRight, 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 ); + wxBoxSizer* bSizer74; + bSizer74 = new wxBoxSizer( wxHORIZONTAL ); + + m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelLeft->SetMinSize( wxSize( 1,-1 ) ); + + wxBoxSizer* bSizer134; + bSizer134 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + bSizer134->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_directoryLeft = new FolderHistoryBox( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer134->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectDirLeft = new wxButton( m_panelLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectDirLeft->SetToolTip( _("Select a folder") ); + + bSizer134->Add( m_buttonSelectDirLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + m_panelLeft->SetSizer( bSizer134 ); + m_panelLeft->Layout(); + bSizer134->Fit( m_panelLeft ); + bSizer74->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxEXPAND, 5 ); + + m_panel20 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer95; + bSizer95 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonAltCompCfg = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer95->Add( m_bpButtonAltCompCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLocalFilter = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer95->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 2 ); + + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer95->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); + + + m_panel20->SetSizer( bSizer95 ); + m_panel20->Layout(); + bSizer95->Fit( m_panel20 ); + bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelRight->SetMinSize( wxSize( 1,-1 ) ); + + wxBoxSizer* bSizer135; + bSizer135 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryRight = new FolderHistoryBox( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer135->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectDirRight = new wxButton( m_panelRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectDirRight->SetToolTip( _("Select a folder") ); + + bSizer135->Add( m_buttonSelectDirRight, 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 ); } FolderPairPanelGenerated::~FolderPairPanelGenerated() @@ -2047,110 +2084,110 @@ FolderPairPanelGenerated::~FolderPairPanelGenerated() CompareProgressDlgGenerated::CompareProgressDlgGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer40; - bSizer40 = new wxBoxSizer( wxHORIZONTAL ); - - m_panelStatistics = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelStatistics->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer187; - bSizer187 = new wxBoxSizer( wxVERTICAL ); - - - bSizer187->Add( 0, 5, 0, 0, 5 ); - - wxFlexGridSizer* fgSizer7; - fgSizer7 = new wxFlexGridSizer( 0, 2, 5, 5 ); - fgSizer7->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticTextItemsFoundLabel = new wxStaticText( m_panelStatistics, wxID_ANY, _("Items found:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextItemsFoundLabel->Wrap( -1 ); - fgSizer7->Add( m_staticTextItemsFoundLabel, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextItemsFound = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextItemsFound->Wrap( -1 ); - m_staticTextItemsFound->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - fgSizer7->Add( m_staticTextItemsFound, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextItemsRemainingLabel = new wxStaticText( m_panelStatistics, wxID_ANY, _("Items remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextItemsRemainingLabel->Wrap( -1 ); - fgSizer7->Add( m_staticTextItemsRemainingLabel, 0, wxALIGN_BOTTOM, 5 ); - - bSizerItemsRemaining = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextItemsRemaining = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextItemsRemaining->Wrap( -1 ); - m_staticTextItemsRemaining->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerItemsRemaining->Add( m_staticTextItemsRemaining, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextDataRemaining = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataRemaining->Wrap( -1 ); - bSizerItemsRemaining->Add( m_staticTextDataRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - - fgSizer7->Add( bSizerItemsRemaining, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextTimeRemainingLabel = new wxStaticText( m_panelStatistics, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeRemainingLabel->Wrap( -1 ); - fgSizer7->Add( m_staticTextTimeRemainingLabel, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextTimeRemaining = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeRemaining->Wrap( -1 ); - m_staticTextTimeRemaining->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - fgSizer7->Add( m_staticTextTimeRemaining, 0, wxALIGN_BOTTOM, 5 ); - - wxStaticText* m_staticText37; - m_staticText37 = new wxStaticText( m_panelStatistics, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText37->Wrap( -1 ); - fgSizer7->Add( m_staticText37, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextTimeElapsed = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeElapsed->Wrap( -1 ); - m_staticTextTimeElapsed->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - fgSizer7->Add( m_staticTextTimeElapsed, 0, wxALIGN_BOTTOM, 5 ); - - - bSizer187->Add( fgSizer7, 0, wxRIGHT|wxLEFT, 5 ); - - - bSizer187->Add( 0, 5, 0, 0, 5 ); - - - m_panelStatistics->SetSizer( bSizer187 ); - m_panelStatistics->Layout(); - bSizer187->Fit( m_panelStatistics ); - bSizer40->Add( m_panelStatistics, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - wxBoxSizer* bSizer181; - bSizer181 = new wxBoxSizer( wxVERTICAL ); - - m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatus->Wrap( -1 ); - bSizer181->Add( m_staticTextStatus, 0, 0, 5 ); - - m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); - bSizer181->Add( m_gauge2, 0, wxEXPAND|wxTOP, 5 ); - - m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSpeed->Wrap( -1 ); - m_staticTextSpeed->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer181->Add( m_staticTextSpeed, 0, wxALIGN_BOTTOM|wxTOP, 5 ); - - - bSizer40->Add( bSizer181, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - this->SetSizer( bSizer40 ); - this->Layout(); - bSizer40->Fit( this ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer40; + bSizer40 = new wxBoxSizer( wxHORIZONTAL ); + + m_panelStatistics = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelStatistics->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer187; + bSizer187 = new wxBoxSizer( wxVERTICAL ); + + + bSizer187->Add( 0, 5, 0, 0, 5 ); + + wxFlexGridSizer* fgSizer7; + fgSizer7 = new wxFlexGridSizer( 0, 2, 5, 5 ); + fgSizer7->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer7->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextItemsFoundLabel = new wxStaticText( m_panelStatistics, wxID_ANY, _("Items found:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextItemsFoundLabel->Wrap( -1 ); + fgSizer7->Add( m_staticTextItemsFoundLabel, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextItemsFound = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextItemsFound->Wrap( -1 ); + m_staticTextItemsFound->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + fgSizer7->Add( m_staticTextItemsFound, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextItemsRemainingLabel = new wxStaticText( m_panelStatistics, wxID_ANY, _("Items remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextItemsRemainingLabel->Wrap( -1 ); + fgSizer7->Add( m_staticTextItemsRemainingLabel, 0, wxALIGN_BOTTOM, 5 ); + + bSizerItemsRemaining = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextItemsRemaining = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextItemsRemaining->Wrap( -1 ); + m_staticTextItemsRemaining->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerItemsRemaining->Add( m_staticTextItemsRemaining, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextDataRemaining = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataRemaining->Wrap( -1 ); + bSizerItemsRemaining->Add( m_staticTextDataRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + + fgSizer7->Add( bSizerItemsRemaining, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextTimeRemainingLabel = new wxStaticText( m_panelStatistics, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeRemainingLabel->Wrap( -1 ); + fgSizer7->Add( m_staticTextTimeRemainingLabel, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextTimeRemaining = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeRemaining->Wrap( -1 ); + m_staticTextTimeRemaining->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + fgSizer7->Add( m_staticTextTimeRemaining, 0, wxALIGN_BOTTOM, 5 ); + + wxStaticText* m_staticText37; + m_staticText37 = new wxStaticText( m_panelStatistics, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText37->Wrap( -1 ); + fgSizer7->Add( m_staticText37, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextTimeElapsed = new wxStaticText( m_panelStatistics, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeElapsed->Wrap( -1 ); + m_staticTextTimeElapsed->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + fgSizer7->Add( m_staticTextTimeElapsed, 0, wxALIGN_BOTTOM, 5 ); + + + bSizer187->Add( fgSizer7, 0, wxRIGHT|wxLEFT, 5 ); + + + bSizer187->Add( 0, 5, 0, 0, 5 ); + + + m_panelStatistics->SetSizer( bSizer187 ); + m_panelStatistics->Layout(); + bSizer187->Fit( m_panelStatistics ); + bSizer40->Add( m_panelStatistics, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + wxBoxSizer* bSizer181; + bSizer181 = new wxBoxSizer( wxVERTICAL ); + + m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatus->Wrap( -1 ); + bSizer181->Add( m_staticTextStatus, 0, 0, 5 ); + + m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); + bSizer181->Add( m_gauge2, 0, wxEXPAND|wxTOP, 5 ); + + m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSpeed->Wrap( -1 ); + m_staticTextSpeed->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer181->Add( m_staticTextSpeed, 0, wxALIGN_BOTTOM|wxTOP, 5 ); + + + bSizer40->Add( bSizer181, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + this->SetSizer( bSizer40 ); + this->Layout(); + bSizer40->Fit( this ); } CompareProgressDlgGenerated::~CompareProgressDlgGenerated() @@ -2159,295 +2196,295 @@ CompareProgressDlgGenerated::~CompareProgressDlgGenerated() SyncProgressPanelGenerated::SyncProgressPanelGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - bSizerRoot = new wxBoxSizer( wxVERTICAL ); - - bSizer42 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer42->Add( 32, 0, 0, 0, 5 ); - - - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bitmapStatus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 32,32 ), 0 ); - bSizer42->Add( m_bitmapStatus, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); - - m_staticTextPhase = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextPhase->Wrap( -1 ); - m_staticTextPhase->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer42->Add( m_staticTextPhase, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - - m_animCtrlSyncing = new wxAnimationCtrl( this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 32,32 ), wxAC_DEFAULT_STYLE ); - bSizer42->Add( m_animCtrlSyncing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); - - - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bpButtonMinimizeToTray = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 32,32 ), wxBU_AUTODRAW ); - m_bpButtonMinimizeToTray->SetToolTip( _("Minimize to notification area") ); - - bSizer42->Add( m_bpButtonMinimizeToTray, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerRoot->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - bSizerStatusText = new wxBoxSizer( wxVERTICAL ); - - m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatus->Wrap( -1 ); - bSizerStatusText->Add( m_staticTextStatus, 0, wxEXPAND|wxLEFT, 10 ); - - - bSizerStatusText->Add( 0, 5, 0, 0, 5 ); - - - bSizerRoot->Add( bSizerStatusText, 0, wxEXPAND, 5 ); - - wxStaticLine* m_staticlineHeader; - m_staticlineHeader = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerRoot->Add( m_staticlineHeader, 0, wxEXPAND, 5 ); - - m_panelProgress = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelProgress->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer173; - bSizer173 = new wxBoxSizer( wxVERTICAL ); - - bSizer171 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer171->Add( 10, 0, 0, 0, 5 ); - - wxBoxSizer* bSizer164; - bSizer164 = new wxBoxSizer( wxVERTICAL ); - - m_panelItemsProcessed = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelItemsProcessed->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer165; - bSizer165 = new wxBoxSizer( wxVERTICAL ); - - - bSizer165->Add( 0, 5, 0, 0, 5 ); - - wxStaticText* m_staticText96; - m_staticText96 = new wxStaticText( m_panelItemsProcessed, wxID_ANY, _("Items processed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText96->Wrap( -1 ); - bSizer165->Add( m_staticText96, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizer169; - bSizer169 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextProcessedObj = new wxStaticText( m_panelItemsProcessed, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextProcessedObj->Wrap( -1 ); - m_staticTextProcessedObj->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer169->Add( m_staticTextProcessedObj, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextDataProcessed = new wxStaticText( m_panelItemsProcessed, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataProcessed->Wrap( -1 ); - bSizer169->Add( m_staticTextDataProcessed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - - bSizer165->Add( bSizer169, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer165->Add( 0, 5, 0, 0, 5 ); - - - m_panelItemsProcessed->SetSizer( bSizer165 ); - m_panelItemsProcessed->Layout(); - bSizer165->Fit( m_panelItemsProcessed ); - bSizer164->Add( m_panelItemsProcessed, 0, wxEXPAND|wxTOP, 7 ); - - m_panelItemsRemaining = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelItemsRemaining->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer166; - bSizer166 = new wxBoxSizer( wxVERTICAL ); - - - bSizer166->Add( 0, 5, 0, 0, 5 ); - - wxStaticText* m_staticText97; - m_staticText97 = new wxStaticText( m_panelItemsRemaining, wxID_ANY, _("Items remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText97->Wrap( -1 ); - bSizer166->Add( m_staticText97, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizer170; - bSizer170 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextRemainingObj = new wxStaticText( m_panelItemsRemaining, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextRemainingObj->Wrap( -1 ); - m_staticTextRemainingObj->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer170->Add( m_staticTextRemainingObj, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextDataRemaining = new wxStaticText( m_panelItemsRemaining, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataRemaining->Wrap( -1 ); - bSizer170->Add( m_staticTextDataRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - - bSizer166->Add( bSizer170, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer166->Add( 0, 5, 0, 0, 5 ); - - - m_panelItemsRemaining->SetSizer( bSizer166 ); - m_panelItemsRemaining->Layout(); - bSizer166->Fit( m_panelItemsRemaining ); - bSizer164->Add( m_panelItemsRemaining, 0, wxTOP|wxEXPAND, 7 ); - - m_panelTimeRemaining = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelTimeRemaining->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer167; - bSizer167 = new wxBoxSizer( wxVERTICAL ); - - - bSizer167->Add( 0, 5, 0, 0, 5 ); - - wxStaticText* m_staticText98; - m_staticText98 = new wxStaticText( m_panelTimeRemaining, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText98->Wrap( -1 ); - bSizer167->Add( m_staticText98, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_staticTextRemTime = new wxStaticText( m_panelTimeRemaining, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextRemTime->Wrap( -1 ); - m_staticTextRemTime->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer167->Add( m_staticTextRemTime, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer167->Add( 0, 5, 0, 0, 5 ); - - - m_panelTimeRemaining->SetSizer( bSizer167 ); - m_panelTimeRemaining->Layout(); - bSizer167->Fit( m_panelTimeRemaining ); - bSizer164->Add( m_panelTimeRemaining, 0, wxTOP|wxEXPAND, 7 ); - - wxPanel* m_panelTimeElapsed; - m_panelTimeElapsed = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelTimeElapsed->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer168; - bSizer168 = new wxBoxSizer( wxVERTICAL ); - - - bSizer168->Add( 0, 5, 0, 0, 5 ); - - wxStaticText* m_staticText961; - m_staticText961 = new wxStaticText( m_panelTimeElapsed, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText961->Wrap( -1 ); - bSizer168->Add( m_staticText961, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_staticTextTimeElapsed = new wxStaticText( m_panelTimeElapsed, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeElapsed->Wrap( -1 ); - m_staticTextTimeElapsed->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer168->Add( m_staticTextTimeElapsed, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer168->Add( 0, 5, 0, 0, 5 ); - - - m_panelTimeElapsed->SetSizer( bSizer168 ); - m_panelTimeElapsed->Layout(); - bSizer168->Fit( m_panelTimeElapsed ); - bSizer164->Add( m_panelTimeElapsed, 0, wxTOP|wxEXPAND, 7 ); - - - bSizer171->Add( bSizer164, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer171->Add( 10, 0, 0, 0, 5 ); - - wxBoxSizer* bSizer161; - bSizer161 = new wxBoxSizer( wxVERTICAL ); - - - bSizer161->Add( 0, 15, 0, 0, 5 ); - - m_panelGraphBytes = new zen::Graph2D( m_panelProgress, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_panelGraphBytes->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizer161->Add( m_panelGraphBytes, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 15 ); - - m_panelGraphItems = new zen::Graph2D( m_panelProgress, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_panelGraphItems->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizer161->Add( m_panelGraphItems, 1, wxEXPAND, 15 ); - - - bSizer161->Add( 450, 0, 0, 0, 5 ); - - - bSizer171->Add( bSizer161, 1, wxEXPAND, 5 ); - - - bSizer171->Add( 0, 280, 0, 0, 5 ); - - - bSizer173->Add( bSizer171, 1, wxEXPAND, 5 ); - - - m_panelProgress->SetSizer( bSizer173 ); - m_panelProgress->Layout(); - bSizer173->Fit( m_panelProgress ); - bSizerRoot->Add( m_panelProgress, 1, wxEXPAND, 5 ); - - m_notebookResult = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_FIXEDWIDTH ); - - bSizerRoot->Add( m_notebookResult, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_staticlineFooter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizerRoot->Add( m_staticlineFooter, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer160; - bSizer160 = new wxBoxSizer( wxHORIZONTAL ); - - bSizerOnCompletion = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText87 = new wxStaticText( this, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText87->Wrap( -1 ); - bSizerOnCompletion->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_comboBoxOnCompletion = new OnCompletionBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizerOnCompletion->Add( m_comboBoxOnCompletion, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer160->Add( bSizerOnCompletion, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer160->Add( 0, 0, 0, 0, 5 ); - - - bSizerStdButtons->Add( bSizer160, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_buttonClose = new wxButton( this, wxID_OK, _("Close"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonClose->SetDefault(); - m_buttonClose->Enable( false ); - - bSizerStdButtons->Add( m_buttonClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonPause = new wxButton( this, wxID_ANY, _("&Pause"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonPause, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - m_buttonStop = new wxButton( this, wxID_CANCEL, _("Stop"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonStop, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizerRoot->Add( bSizerStdButtons, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); - - - this->SetSizer( bSizerRoot ); - this->Layout(); - bSizerRoot->Fit( this ); + bSizerRoot = new wxBoxSizer( wxVERTICAL ); + + bSizer42 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer42->Add( 32, 0, 0, 0, 5 ); + + + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bitmapStatus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 32,32 ), 0 ); + bSizer42->Add( m_bitmapStatus, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); + + m_staticTextPhase = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextPhase->Wrap( -1 ); + m_staticTextPhase->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer42->Add( m_staticTextPhase, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); + + m_animCtrlSyncing = new wxAnimationCtrl( this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 32,32 ), wxAC_DEFAULT_STYLE ); + bSizer42->Add( m_animCtrlSyncing, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2 ); + + + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonMinimizeToTray = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 32,32 ), wxBU_AUTODRAW ); + m_bpButtonMinimizeToTray->SetToolTip( _("Minimize to notification area") ); + + bSizer42->Add( m_bpButtonMinimizeToTray, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerRoot->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + bSizerStatusText = new wxBoxSizer( wxVERTICAL ); + + m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatus->Wrap( -1 ); + bSizerStatusText->Add( m_staticTextStatus, 0, wxEXPAND|wxLEFT, 10 ); + + + bSizerStatusText->Add( 0, 5, 0, 0, 5 ); + + + bSizerRoot->Add( bSizerStatusText, 0, wxEXPAND, 5 ); + + wxStaticLine* m_staticlineHeader; + m_staticlineHeader = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerRoot->Add( m_staticlineHeader, 0, wxEXPAND, 5 ); + + m_panelProgress = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelProgress->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer173; + bSizer173 = new wxBoxSizer( wxVERTICAL ); + + bSizer171 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer171->Add( 10, 0, 0, 0, 5 ); + + wxBoxSizer* bSizer164; + bSizer164 = new wxBoxSizer( wxVERTICAL ); + + m_panelItemsProcessed = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelItemsProcessed->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer165; + bSizer165 = new wxBoxSizer( wxVERTICAL ); + + + bSizer165->Add( 0, 5, 0, 0, 5 ); + + wxStaticText* m_staticText96; + m_staticText96 = new wxStaticText( m_panelItemsProcessed, wxID_ANY, _("Items processed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText96->Wrap( -1 ); + bSizer165->Add( m_staticText96, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizer169; + bSizer169 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextProcessedObj = new wxStaticText( m_panelItemsProcessed, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextProcessedObj->Wrap( -1 ); + m_staticTextProcessedObj->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer169->Add( m_staticTextProcessedObj, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextDataProcessed = new wxStaticText( m_panelItemsProcessed, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataProcessed->Wrap( -1 ); + bSizer169->Add( m_staticTextDataProcessed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + + bSizer165->Add( bSizer169, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer165->Add( 0, 5, 0, 0, 5 ); + + + m_panelItemsProcessed->SetSizer( bSizer165 ); + m_panelItemsProcessed->Layout(); + bSizer165->Fit( m_panelItemsProcessed ); + bSizer164->Add( m_panelItemsProcessed, 0, wxEXPAND|wxTOP, 7 ); + + m_panelItemsRemaining = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelItemsRemaining->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer166; + bSizer166 = new wxBoxSizer( wxVERTICAL ); + + + bSizer166->Add( 0, 5, 0, 0, 5 ); + + wxStaticText* m_staticText97; + m_staticText97 = new wxStaticText( m_panelItemsRemaining, wxID_ANY, _("Items remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText97->Wrap( -1 ); + bSizer166->Add( m_staticText97, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizer170; + bSizer170 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextRemainingObj = new wxStaticText( m_panelItemsRemaining, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextRemainingObj->Wrap( -1 ); + m_staticTextRemainingObj->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer170->Add( m_staticTextRemainingObj, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextDataRemaining = new wxStaticText( m_panelItemsRemaining, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataRemaining->Wrap( -1 ); + bSizer170->Add( m_staticTextDataRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + + bSizer166->Add( bSizer170, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer166->Add( 0, 5, 0, 0, 5 ); + + + m_panelItemsRemaining->SetSizer( bSizer166 ); + m_panelItemsRemaining->Layout(); + bSizer166->Fit( m_panelItemsRemaining ); + bSizer164->Add( m_panelItemsRemaining, 0, wxTOP|wxEXPAND, 7 ); + + m_panelTimeRemaining = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelTimeRemaining->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer167; + bSizer167 = new wxBoxSizer( wxVERTICAL ); + + + bSizer167->Add( 0, 5, 0, 0, 5 ); + + wxStaticText* m_staticText98; + m_staticText98 = new wxStaticText( m_panelTimeRemaining, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText98->Wrap( -1 ); + bSizer167->Add( m_staticText98, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_staticTextRemTime = new wxStaticText( m_panelTimeRemaining, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextRemTime->Wrap( -1 ); + m_staticTextRemTime->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer167->Add( m_staticTextRemTime, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer167->Add( 0, 5, 0, 0, 5 ); + + + m_panelTimeRemaining->SetSizer( bSizer167 ); + m_panelTimeRemaining->Layout(); + bSizer167->Fit( m_panelTimeRemaining ); + bSizer164->Add( m_panelTimeRemaining, 0, wxTOP|wxEXPAND, 7 ); + + wxPanel* m_panelTimeElapsed; + m_panelTimeElapsed = new wxPanel( m_panelProgress, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelTimeElapsed->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer168; + bSizer168 = new wxBoxSizer( wxVERTICAL ); + + + bSizer168->Add( 0, 5, 0, 0, 5 ); + + wxStaticText* m_staticText961; + m_staticText961 = new wxStaticText( m_panelTimeElapsed, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText961->Wrap( -1 ); + bSizer168->Add( m_staticText961, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_staticTextTimeElapsed = new wxStaticText( m_panelTimeElapsed, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeElapsed->Wrap( -1 ); + m_staticTextTimeElapsed->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer168->Add( m_staticTextTimeElapsed, 0, wxALIGN_BOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer168->Add( 0, 5, 0, 0, 5 ); + + + m_panelTimeElapsed->SetSizer( bSizer168 ); + m_panelTimeElapsed->Layout(); + bSizer168->Fit( m_panelTimeElapsed ); + bSizer164->Add( m_panelTimeElapsed, 0, wxTOP|wxEXPAND, 7 ); + + + bSizer171->Add( bSizer164, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer171->Add( 10, 0, 0, 0, 5 ); + + wxBoxSizer* bSizer161; + bSizer161 = new wxBoxSizer( wxVERTICAL ); + + + bSizer161->Add( 0, 15, 0, 0, 5 ); + + m_panelGraphBytes = new zen::Graph2D( m_panelProgress, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_panelGraphBytes->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizer161->Add( m_panelGraphBytes, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 15 ); + + m_panelGraphItems = new zen::Graph2D( m_panelProgress, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_panelGraphItems->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizer161->Add( m_panelGraphItems, 1, wxEXPAND, 15 ); + + + bSizer161->Add( 450, 0, 0, 0, 5 ); + + + bSizer171->Add( bSizer161, 1, wxEXPAND, 5 ); + + + bSizer171->Add( 0, 280, 0, 0, 5 ); + + + bSizer173->Add( bSizer171, 1, wxEXPAND, 5 ); + + + m_panelProgress->SetSizer( bSizer173 ); + m_panelProgress->Layout(); + bSizer173->Fit( m_panelProgress ); + bSizerRoot->Add( m_panelProgress, 1, wxEXPAND, 5 ); + + m_notebookResult = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxNB_FIXEDWIDTH ); + + bSizerRoot->Add( m_notebookResult, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_staticlineFooter = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizerRoot->Add( m_staticlineFooter, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer160; + bSizer160 = new wxBoxSizer( wxHORIZONTAL ); + + bSizerOnCompletion = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText87 = new wxStaticText( this, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText87->Wrap( -1 ); + bSizerOnCompletion->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_comboBoxOnCompletion = new OnCompletionBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizerOnCompletion->Add( m_comboBoxOnCompletion, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer160->Add( bSizerOnCompletion, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer160->Add( 0, 0, 0, 0, 5 ); + + + bSizerStdButtons->Add( bSizer160, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_buttonClose = new wxButton( this, wxID_OK, _("Close"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonClose->SetDefault(); + m_buttonClose->Enable( false ); + + bSizerStdButtons->Add( m_buttonClose, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonPause = new wxButton( this, wxID_ANY, _("&Pause"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonPause, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + m_buttonStop = new wxButton( this, wxID_CANCEL, _("Stop"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonStop, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizerRoot->Add( bSizerStdButtons, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); + + + this->SetSizer( bSizerRoot ); + this->Layout(); + bSizerRoot->Fit( this ); } SyncProgressPanelGenerated::~SyncProgressPanelGenerated() @@ -2456,48 +2493,48 @@ SyncProgressPanelGenerated::~SyncProgressPanelGenerated() LogPanelGenerated::LogPanelGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) { - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer179; - bSizer179 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer153; - bSizer153 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer154; - bSizer154 = new wxBoxSizer( wxVERTICAL ); - - m_bpButtonErrors = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 49,49 ), wxBU_AUTODRAW ); - bSizer154->Add( m_bpButtonErrors, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonWarnings = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 49,49 ), wxBU_AUTODRAW ); - bSizer154->Add( m_bpButtonWarnings, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonInfo = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 49,49 ), wxBU_AUTODRAW ); - bSizer154->Add( m_bpButtonInfo, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer153->Add( bSizer154, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_staticline13 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer153->Add( m_staticline13, 0, wxEXPAND, 5 ); - - m_gridMessages = new zen::Grid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - m_gridMessages->SetScrollRate( 5, 5 ); - bSizer153->Add( m_gridMessages, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer179->Add( bSizer153, 1, wxEXPAND, 5 ); - - - this->SetSizer( bSizer179 ); - this->Layout(); - bSizer179->Fit( this ); - - // Connect Events - m_bpButtonErrors->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogPanelGenerated::OnErrors ), NULL, this ); - m_bpButtonWarnings->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogPanelGenerated::OnWarnings ), NULL, this ); - m_bpButtonInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogPanelGenerated::OnInfo ), NULL, this ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer179; + bSizer179 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer153; + bSizer153 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer154; + bSizer154 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonErrors = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 49,49 ), wxBU_AUTODRAW ); + bSizer154->Add( m_bpButtonErrors, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonWarnings = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 49,49 ), wxBU_AUTODRAW ); + bSizer154->Add( m_bpButtonWarnings, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonInfo = new ToggleButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 49,49 ), wxBU_AUTODRAW ); + bSizer154->Add( m_bpButtonInfo, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer153->Add( bSizer154, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_staticline13 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer153->Add( m_staticline13, 0, wxEXPAND, 5 ); + + m_gridMessages = new zen::Grid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_gridMessages->SetScrollRate( 5, 5 ); + bSizer153->Add( m_gridMessages, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer179->Add( bSizer153, 1, wxEXPAND, 5 ); + + + this->SetSizer( bSizer179 ); + this->Layout(); + bSizer179->Fit( this ); + + // Connect Events + m_bpButtonErrors->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogPanelGenerated::OnErrors ), NULL, this ); + m_bpButtonWarnings->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogPanelGenerated::OnWarnings ), NULL, this ); + m_bpButtonInfo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( LogPanelGenerated::OnInfo ), NULL, this ); } LogPanelGenerated::~LogPanelGenerated() @@ -2506,184 +2543,184 @@ LogPanelGenerated::~LogPanelGenerated() 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( -1,-1 ), wxDefaultSize ); - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer54; - bSizer54 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer72; - bSizer72 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapBatchJob = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer72->Add( m_bitmapBatchJob, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_staticTextDescr = new wxStaticText( this, wxID_ANY, _("Create a batch file for unattended synchronization. To start, double-click this file or schedule in a task planner: %x"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDescr->Wrap( 520 ); - bSizer72->Add( m_staticTextDescr, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - - bSizer54->Add( bSizer72, 0, 0, 5 ); - - m_staticline18 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer54->Add( m_staticline18, 0, wxEXPAND, 5 ); - - m_panel35 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel35->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer172; - bSizer172 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer180; - bSizer180 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer171; - bSizer171 = new wxBoxSizer( wxVERTICAL ); - - m_staticText82 = new wxStaticText( m_panel35, wxID_ANY, _("Handle errors:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText82->Wrap( -1 ); - bSizer171->Add( m_staticText82, 0, wxALL, 5 ); - - wxBoxSizer* bSizer169; - bSizer169 = new wxBoxSizer( wxHORIZONTAL ); - - m_toggleBtnErrorIgnore = new wxToggleButton( m_panel35, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnErrorIgnore->SetToolTip( _("Hide all error and warning messages") ); - - bSizer169->Add( m_toggleBtnErrorIgnore, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_toggleBtnErrorPopup = new wxToggleButton( m_panel35, wxID_ANY, _("Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnErrorPopup->SetToolTip( _("Show pop-up on errors or warnings") ); - - bSizer169->Add( m_toggleBtnErrorPopup, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_toggleBtnErrorStop = new wxToggleButton( m_panel35, wxID_ANY, _("Stop"), wxDefaultPosition, wxDefaultSize, 0 ); - m_toggleBtnErrorStop->SetToolTip( _("Stop synchronization at first error") ); - - bSizer169->Add( m_toggleBtnErrorStop, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer171->Add( bSizer169, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer180->Add( bSizer171, 0, wxALL, 5 ); - - m_staticline26 = new wxStaticLine( m_panel35, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer180->Add( m_staticline26, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer170; - bSizer170 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxRunMinimized = new wxCheckBox( m_panel35, wxID_ANY, _("Run minimized"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer170->Add( m_checkBoxRunMinimized, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); - - wxBoxSizer* bSizer179; - bSizer179 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText81 = new wxStaticText( m_panel35, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText81->Wrap( -1 ); - bSizer179->Add( m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_comboBoxOnCompletion = new OnCompletionBox( m_panel35, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer179->Add( m_comboBoxOnCompletion, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer170->Add( bSizer179, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer180->Add( bSizer170, 1, wxALL, 5 ); - - - bSizer172->Add( bSizer180, 0, wxEXPAND, 5 ); - - m_staticline25 = new wxStaticLine( m_panel35, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer172->Add( m_staticline25, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer191; - bSizer191 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxGenerateLogfile = new wxCheckBox( m_panel35, wxID_ANY, _("Save log:"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer191->Add( m_checkBoxGenerateLogfile, 0, wxEXPAND|wxBOTTOM, 5 ); - - m_panelLogfile = new wxPanel( m_panel35, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelLogfile->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer1721; - bSizer1721 = new wxBoxSizer( wxHORIZONTAL ); - - m_logfileDir = new FolderHistoryBox( m_panelLogfile, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer1721->Add( m_logfileDir, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectLogfileDir = new wxButton( m_panelLogfile, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectLogfileDir->SetToolTip( _("Select a folder") ); - - bSizer1721->Add( m_buttonSelectLogfileDir, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_checkBoxLogfilesLimit = new wxCheckBox( m_panelLogfile, wxID_ANY, _("Limit:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxLogfilesLimit->SetToolTip( _("Limit maximum number of log files") ); - - bSizer1721->Add( m_checkBoxLogfilesLimit, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_spinCtrlLogfileLimit = new wxSpinCtrl( m_panelLogfile, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 70,-1 ), wxSP_ARROW_KEYS, 1, 2000000000, 1 ); - m_spinCtrlLogfileLimit->SetToolTip( _("Limit maximum number of log files") ); - - bSizer1721->Add( m_spinCtrlLogfileLimit, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - m_panelLogfile->SetSizer( bSizer1721 ); - m_panelLogfile->Layout(); - bSizer1721->Fit( m_panelLogfile ); - bSizer191->Add( m_panelLogfile, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer172->Add( bSizer191, 0, wxEXPAND|wxALL, 10 ); - - m_hyperlink17 = new wxHyperlinkCtrl( m_panel35, wxID_ANY, _("How can I schedule a batch job?"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer172->Add( m_hyperlink17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - - m_panel35->SetSizer( bSizer172 ); - m_panel35->Layout(); - bSizer172->Fit( m_panel35 ); - bSizer54->Add( m_panel35, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_staticline13 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer54->Add( m_staticline13, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - - bSizerStdButtons->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_buttonSaveAs = new wxButton( this, wxID_SAVE, _("Save &as..."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonSaveAs->SetDefault(); - m_buttonSaveAs->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerStdButtons->Add( m_buttonSaveAs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer54->Add( bSizerStdButtons, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); - - - this->SetSizer( bSizer54 ); - this->Layout(); - bSizer54->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); - m_toggleBtnErrorIgnore->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnErrorIgnore ), NULL, this ); - m_toggleBtnErrorPopup->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnErrorPopup ), NULL, this ); - m_toggleBtnErrorStop->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnErrorStop ), NULL, this ); - m_checkBoxGenerateLogfile->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnToggleGenerateLogfile ), NULL, this ); - m_checkBoxLogfilesLimit->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnToggleLogfilesLimit ), NULL, this ); - m_hyperlink17->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( BatchDlgGenerated::OnHelpScheduleBatch ), NULL, this ); - m_buttonSaveAs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer54; + bSizer54 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapBatchJob = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer72->Add( m_bitmapBatchJob, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticTextDescr = new wxStaticText( this, wxID_ANY, _("Create a batch file for unattended synchronization. To start, double-click this file or schedule in a task planner: %x"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDescr->Wrap( 520 ); + bSizer72->Add( m_staticTextDescr, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + + bSizer54->Add( bSizer72, 0, 0, 5 ); + + m_staticline18 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer54->Add( m_staticline18, 0, wxEXPAND, 5 ); + + m_panel35 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel35->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer172; + bSizer172 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer180; + bSizer180 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer171; + bSizer171 = new wxBoxSizer( wxVERTICAL ); + + m_staticText82 = new wxStaticText( m_panel35, wxID_ANY, _("Handle errors:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText82->Wrap( -1 ); + bSizer171->Add( m_staticText82, 0, wxALL, 5 ); + + wxBoxSizer* bSizer169; + bSizer169 = new wxBoxSizer( wxHORIZONTAL ); + + m_toggleBtnErrorIgnore = new wxToggleButton( m_panel35, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnErrorIgnore->SetToolTip( _("Hide all error and warning messages") ); + + bSizer169->Add( m_toggleBtnErrorIgnore, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_toggleBtnErrorPopup = new wxToggleButton( m_panel35, wxID_ANY, _("Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnErrorPopup->SetToolTip( _("Show pop-up on errors or warnings") ); + + bSizer169->Add( m_toggleBtnErrorPopup, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_toggleBtnErrorStop = new wxToggleButton( m_panel35, wxID_ANY, _("Stop"), wxDefaultPosition, wxDefaultSize, 0 ); + m_toggleBtnErrorStop->SetToolTip( _("Stop synchronization at first error") ); + + bSizer169->Add( m_toggleBtnErrorStop, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer171->Add( bSizer169, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer180->Add( bSizer171, 0, wxALL, 5 ); + + m_staticline26 = new wxStaticLine( m_panel35, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer180->Add( m_staticline26, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer170; + bSizer170 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxRunMinimized = new wxCheckBox( m_panel35, wxID_ANY, _("Run minimized"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer170->Add( m_checkBoxRunMinimized, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + + wxBoxSizer* bSizer179; + bSizer179 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText81 = new wxStaticText( m_panel35, wxID_ANY, _("On completion:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText81->Wrap( -1 ); + bSizer179->Add( m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_comboBoxOnCompletion = new OnCompletionBox( m_panel35, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer179->Add( m_comboBoxOnCompletion, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer170->Add( bSizer179, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer180->Add( bSizer170, 1, wxALL, 5 ); + + + bSizer172->Add( bSizer180, 0, wxEXPAND, 5 ); + + m_staticline25 = new wxStaticLine( m_panel35, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer172->Add( m_staticline25, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer191; + bSizer191 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxGenerateLogfile = new wxCheckBox( m_panel35, wxID_ANY, _("Save log:"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer191->Add( m_checkBoxGenerateLogfile, 0, wxEXPAND|wxALL, 5 ); + + m_panelLogfile = new wxPanel( m_panel35, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelLogfile->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer1721; + bSizer1721 = new wxBoxSizer( wxHORIZONTAL ); + + m_logfileDir = new FolderHistoryBox( m_panelLogfile, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer1721->Add( m_logfileDir, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectLogfileDir = new wxButton( m_panelLogfile, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectLogfileDir->SetToolTip( _("Select a folder") ); + + bSizer1721->Add( m_buttonSelectLogfileDir, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_checkBoxLogfilesLimit = new wxCheckBox( m_panelLogfile, wxID_ANY, _("Limit:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxLogfilesLimit->SetToolTip( _("Limit maximum number of log files") ); + + bSizer1721->Add( m_checkBoxLogfilesLimit, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_spinCtrlLogfileLimit = new wxSpinCtrl( m_panelLogfile, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 70,-1 ), wxSP_ARROW_KEYS, 1, 2000000000, 1 ); + m_spinCtrlLogfileLimit->SetToolTip( _("Limit maximum number of log files") ); + + bSizer1721->Add( m_spinCtrlLogfileLimit, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + m_panelLogfile->SetSizer( bSizer1721 ); + m_panelLogfile->Layout(); + bSizer1721->Fit( m_panelLogfile ); + bSizer191->Add( m_panelLogfile, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer172->Add( bSizer191, 0, wxEXPAND|wxALL, 5 ); + + m_hyperlink17 = new wxHyperlinkCtrl( m_panel35, wxID_ANY, _("How can I schedule a batch job?"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer172->Add( m_hyperlink17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + + m_panel35->SetSizer( bSizer172 ); + m_panel35->Layout(); + bSizer172->Fit( m_panel35 ); + bSizer54->Add( m_panel35, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_staticline13 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer54->Add( m_staticline13, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + + bSizerStdButtons->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_buttonSaveAs = new wxButton( this, wxID_SAVE, _("Save &as..."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonSaveAs->SetDefault(); + m_buttonSaveAs->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerStdButtons->Add( m_buttonSaveAs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer54->Add( bSizerStdButtons, 0, wxALIGN_RIGHT|wxEXPAND, 5 ); + + + this->SetSizer( bSizer54 ); + this->Layout(); + bSizer54->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_toggleBtnErrorIgnore->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnErrorIgnore ), NULL, this ); + m_toggleBtnErrorPopup->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnErrorPopup ), NULL, this ); + m_toggleBtnErrorStop->Connect( wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnErrorStop ), NULL, this ); + m_checkBoxGenerateLogfile->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnToggleGenerateLogfile ), NULL, this ); + m_checkBoxLogfilesLimit->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnToggleLogfilesLimit ), NULL, this ); + m_hyperlink17->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( BatchDlgGenerated::OnHelpScheduleBatch ), NULL, this ); + m_buttonSaveAs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); } BatchDlgGenerated::~BatchDlgGenerated() @@ -2692,87 +2729,81 @@ BatchDlgGenerated::~BatchDlgGenerated() 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( wxSize( -1,-1 ), wxDefaultSize ); - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer24; - bSizer24 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer72; - bSizer72 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapDeleteType = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer72->Add( m_bitmapDeleteType, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER ); - m_staticTextHeader->Wrap( -1 ); - bSizer72->Add( m_staticTextHeader, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - - bSizer24->Add( bSizer72, 0, 0, 5 ); - - m_staticline91 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer24->Add( m_staticline91, 0, wxEXPAND, 5 ); - - m_panel31 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel31->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer185; - bSizer185 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer185->Add( 60, 0, 0, 0, 5 ); - - m_staticline42 = new wxStaticLine( m_panel31, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer185->Add( m_staticline42, 0, wxEXPAND, 5 ); - - m_textCtrlFileList = new wxTextCtrl( m_panel31, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 500,200 ), wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY|wxNO_BORDER ); - bSizer185->Add( m_textCtrlFileList, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - - m_panel31->SetSizer( bSizer185 ); - m_panel31->Layout(); - bSizer185->Fit( m_panel31 ); - bSizer24->Add( m_panel31, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer24->Add( m_staticline9, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer99; - bSizer99 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("&Recycle bin"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer99->Add( m_checkBoxUseRecycler, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - - bSizerStdButtons->Add( bSizer99, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonOK = new wxButton( this, wxID_OK, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonOK->SetDefault(); - m_buttonOK->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerStdButtons->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer24->Add( bSizerStdButtons, 0, wxEXPAND, 5 ); - - - this->SetSizer( bSizer24 ); - this->Layout(); - bSizer24->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); - m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), 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 ); + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer24; + bSizer24 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapDeleteType = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer72->Add( m_bitmapDeleteType, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER ); + m_staticTextHeader->Wrap( -1 ); + bSizer72->Add( m_staticTextHeader, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + + bSizer24->Add( bSizer72, 0, 0, 5 ); + + m_staticline91 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer24->Add( m_staticline91, 0, wxEXPAND, 5 ); + + m_panel31 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel31->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer185; + bSizer185 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer185->Add( 60, 0, 0, 0, 5 ); + + m_staticline42 = new wxStaticLine( m_panel31, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer185->Add( m_staticline42, 0, wxEXPAND, 5 ); + + m_textCtrlFileList = new wxTextCtrl( m_panel31, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 500,200 ), wxTE_DONTWRAP|wxTE_MULTILINE|wxTE_READONLY|wxNO_BORDER ); + bSizer185->Add( m_textCtrlFileList, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + + m_panel31->SetSizer( bSizer185 ); + m_panel31->Layout(); + bSizer185->Fit( m_panel31 ); + bSizer24->Add( m_panel31, 1, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer24->Add( m_staticline9, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("&Recycle bin"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizerStdButtons->Add( m_checkBoxUseRecycler, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonOK = new wxButton( this, wxID_OK, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonOK->SetDefault(); + m_buttonOK->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerStdButtons->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer24->Add( bSizerStdButtons, 0, wxEXPAND, 5 ); + + + this->SetSizer( bSizer24 ); + this->Layout(); + bSizer24->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), 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 ); } DeleteDlgGenerated::~DeleteDlgGenerated() @@ -2781,256 +2812,256 @@ DeleteDlgGenerated::~DeleteDlgGenerated() OptionsDlgGenerated::OptionsDlgGenerated( 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( -1,-1 ), wxDefaultSize ); - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer95; - bSizer95 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer72; - bSizer72 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapSettings = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer72->Add( m_bitmapSettings, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_staticText44 = new wxStaticText( this, wxID_ANY, _("The following settings are used for all synchronization jobs."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticText44->Wrap( 500 ); - bSizer72->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - - bSizer95->Add( bSizer72, 0, 0, 5 ); - - m_staticline20 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer95->Add( m_staticline20, 0, wxEXPAND, 5 ); - - m_panel39 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel39->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer166; - bSizer166 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer186; - bSizer186 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer160; - bSizer160 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer176; - bSizer176 = new wxBoxSizer( wxHORIZONTAL ); - - m_checkBoxFailSafe = new wxCheckBox( m_panel39, wxID_ANY, _("Fail-safe file copy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxFailSafe->SetValue(true); - m_checkBoxFailSafe->SetToolTip( _("Copy to a temporary file (*.ffs_tmp) before overwriting target.\nThis guarantees a consistent state even in case of a serious error.") ); - - bSizer176->Add( m_checkBoxFailSafe, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText91 = new wxStaticText( m_panel39, wxID_ANY, _("(recommended)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText91->Wrap( -1 ); - m_staticText91->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer176->Add( m_staticText91, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer160->Add( bSizer176, 0, wxEXPAND, 5 ); - - bSizerLockedFiles = new wxBoxSizer( wxHORIZONTAL ); - - m_checkBoxCopyLocked = new wxCheckBox( m_panel39, wxID_ANY, _("Copy locked files"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxCopyLocked->SetValue(true); - m_checkBoxCopyLocked->SetToolTip( _("Copy shared or locked files using the Volume Shadow Copy Service.") ); - - bSizerLockedFiles->Add( m_checkBoxCopyLocked, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText92 = new wxStaticText( m_panel39, wxID_ANY, _("(requires administrator rights)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText92->Wrap( -1 ); - m_staticText92->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizerLockedFiles->Add( m_staticText92, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer160->Add( bSizerLockedFiles, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer178; - bSizer178 = new wxBoxSizer( wxHORIZONTAL ); - - m_checkBoxCopyPermissions = new wxCheckBox( m_panel39, wxID_ANY, _("Copy file access permissions"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxCopyPermissions->SetValue(true); - m_checkBoxCopyPermissions->SetToolTip( _("Transfer file and folder permissions.") ); - - bSizer178->Add( m_checkBoxCopyPermissions, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_staticText93 = new wxStaticText( m_panel39, wxID_ANY, _("(requires administrator rights)"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText93->Wrap( -1 ); - m_staticText93->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer178->Add( m_staticText93, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer160->Add( bSizer178, 0, wxEXPAND, 5 ); - - - bSizer186->Add( bSizer160, 0, wxEXPAND|wxALL, 5 ); - - m_staticline39 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer186->Add( m_staticline39, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer188; - bSizer188 = new wxBoxSizer( wxVERTICAL ); - - m_staticText95 = new wxStaticText( m_panel39, wxID_ANY, _("Automatic retry on error:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText95->Wrap( -1 ); - bSizer188->Add( m_staticText95, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - wxFlexGridSizer* fgSizer6; - fgSizer6 = new wxFlexGridSizer( 0, 2, 5, 5 ); - fgSizer6->SetFlexibleDirection( wxBOTH ); - fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText96 = new wxStaticText( m_panel39, wxID_ANY, _("Retry count:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText96->Wrap( -1 ); - fgSizer6->Add( m_staticText96, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_spinCtrlAutoRetryCount = new wxSpinCtrl( m_panel39, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), wxSP_ARROW_KEYS, 0, 2000000000, 4 ); - fgSizer6->Add( m_spinCtrlAutoRetryCount, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextAutoRetryDelay = new wxStaticText( m_panel39, wxID_ANY, _("Delay (in seconds):"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextAutoRetryDelay->Wrap( -1 ); - fgSizer6->Add( m_staticTextAutoRetryDelay, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_spinCtrlAutoRetryDelay = new wxSpinCtrl( m_panel39, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), wxSP_ARROW_KEYS, 0, 2000000000, 0 ); - fgSizer6->Add( m_spinCtrlAutoRetryDelay, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer188->Add( fgSizer6, 0, wxLEFT, 10 ); - - - bSizer186->Add( bSizer188, 0, wxALL, 10 ); - - - bSizer166->Add( bSizer186, 0, wxEXPAND, 5 ); - - m_staticline191 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer166->Add( m_staticline191, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer181; - bSizer181 = new wxBoxSizer( wxVERTICAL ); - - m_staticText85 = new wxStaticText( m_panel39, wxID_ANY, _("Customize context menu:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText85->Wrap( -1 ); - bSizer181->Add( m_staticText85, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - m_gridCustomCommand = new wxGrid( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_gridCustomCommand->CreateGrid( 5, 2 ); - m_gridCustomCommand->EnableEditing( true ); - m_gridCustomCommand->EnableGridLines( true ); - m_gridCustomCommand->EnableDragGridSize( false ); - m_gridCustomCommand->SetMargins( 0, 0 ); - - // Columns - m_gridCustomCommand->SetColSize( 0, 165 ); - m_gridCustomCommand->SetColSize( 1, 196 ); - m_gridCustomCommand->EnableDragColMove( false ); - m_gridCustomCommand->EnableDragColSize( true ); - m_gridCustomCommand->SetColLabelSize( 20 ); - m_gridCustomCommand->SetColLabelValue( 0, _("Description") ); - m_gridCustomCommand->SetColLabelValue( 1, _("Command line") ); - m_gridCustomCommand->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Rows - m_gridCustomCommand->EnableDragRowSize( false ); - m_gridCustomCommand->SetRowLabelSize( 1 ); - m_gridCustomCommand->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_gridCustomCommand->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - bSizer181->Add( m_gridCustomCommand, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer193; - bSizer193 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonAddRow = new wxBitmapButton( m_panel39, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer193->Add( m_bpButtonAddRow, 0, 0, 5 ); - - m_bpButtonRemoveRow = new wxBitmapButton( m_panel39, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - bSizer193->Add( m_bpButtonRemoveRow, 0, 0, 5 ); - - - bSizer193->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_hyperlink17 = new wxHyperlinkCtrl( m_panel39, wxID_ANY, _("Show examples"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer193->Add( m_hyperlink17, 0, wxLEFT, 5 ); - - - bSizer181->Add( bSizer193, 0, wxTOP|wxEXPAND, 5 ); - - - bSizer166->Add( bSizer181, 1, wxEXPAND|wxALL, 10 ); - - m_staticline192 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer166->Add( m_staticline192, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer1881; - bSizer1881 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonResetDialogs = new zen::BitmapTextButton( m_panel39, wxID_ANY, _("Restore hidden windows"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer1881->Add( m_buttonResetDialogs, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10 ); - - m_staticline40 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer1881->Add( m_staticline40, 0, wxEXPAND, 5 ); - - - bSizer166->Add( bSizer1881, 0, 0, 5 ); - - - m_panel39->SetSizer( bSizer166 ); - m_panel39->Layout(); - bSizer166->Fit( m_panel39 ); - bSizer95->Add( m_panel39, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_staticline36 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer95->Add( m_staticline36, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonDefault = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonDefault, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizerStdButtons->Add( 0, 0, 1, 0, 5 ); - - m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonOkay->SetDefault(); - m_buttonOkay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerStdButtons->Add( m_buttonOkay, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer95->Add( bSizerStdButtons, 0, wxEXPAND, 5 ); - - - this->SetSizer( bSizer95 ); - this->Layout(); - bSizer95->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( OptionsDlgGenerated::OnClose ) ); - m_spinCtrlAutoRetryCount->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( OptionsDlgGenerated::OnToggleAutoRetryCount ), NULL, this ); - m_bpButtonAddRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnAddRow ), NULL, this ); - m_bpButtonRemoveRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnRemoveRow ), NULL, this ); - m_hyperlink17->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( OptionsDlgGenerated::OnHelpShowExamples ), NULL, this ); - m_buttonResetDialogs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnResetDialogs ), NULL, this ); - m_buttonDefault->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnDefault ), NULL, this ); - m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnOkay ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnCancel ), NULL, this ); + this->SetSizeHints( wxSize( -1,-1 ), wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer95; + bSizer95 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapSettings = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer72->Add( m_bitmapSettings, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticText44 = new wxStaticText( this, wxID_ANY, _("The following settings are used for all synchronization jobs."), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticText44->Wrap( 500 ); + bSizer72->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + + bSizer95->Add( bSizer72, 0, 0, 5 ); + + m_staticline20 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer95->Add( m_staticline20, 0, wxEXPAND, 5 ); + + m_panel39 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel39->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer166; + bSizer166 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer186; + bSizer186 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer160; + bSizer160 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer176; + bSizer176 = new wxBoxSizer( wxHORIZONTAL ); + + m_checkBoxFailSafe = new wxCheckBox( m_panel39, wxID_ANY, _("Fail-safe file copy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxFailSafe->SetValue(true); + m_checkBoxFailSafe->SetToolTip( _("Copy to a temporary file (*.ffs_tmp) before overwriting target.\nThis guarantees a consistent state even in case of a serious error.") ); + + bSizer176->Add( m_checkBoxFailSafe, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText91 = new wxStaticText( m_panel39, wxID_ANY, _("(recommended)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText91->Wrap( -1 ); + m_staticText91->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer176->Add( m_staticText91, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer160->Add( bSizer176, 0, wxEXPAND, 5 ); + + bSizerLockedFiles = new wxBoxSizer( wxHORIZONTAL ); + + m_checkBoxCopyLocked = new wxCheckBox( m_panel39, wxID_ANY, _("Copy locked files"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxCopyLocked->SetValue(true); + m_checkBoxCopyLocked->SetToolTip( _("Copy shared or locked files using the Volume Shadow Copy Service.") ); + + bSizerLockedFiles->Add( m_checkBoxCopyLocked, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText92 = new wxStaticText( m_panel39, wxID_ANY, _("(requires administrator rights)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText92->Wrap( -1 ); + m_staticText92->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizerLockedFiles->Add( m_staticText92, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer160->Add( bSizerLockedFiles, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer178; + bSizer178 = new wxBoxSizer( wxHORIZONTAL ); + + m_checkBoxCopyPermissions = new wxCheckBox( m_panel39, wxID_ANY, _("Copy file access permissions"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxCopyPermissions->SetValue(true); + m_checkBoxCopyPermissions->SetToolTip( _("Transfer file and folder permissions.") ); + + bSizer178->Add( m_checkBoxCopyPermissions, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_staticText93 = new wxStaticText( m_panel39, wxID_ANY, _("(requires administrator rights)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText93->Wrap( -1 ); + m_staticText93->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer178->Add( m_staticText93, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer160->Add( bSizer178, 0, wxEXPAND, 5 ); + + + bSizer186->Add( bSizer160, 0, wxEXPAND|wxALL, 5 ); + + m_staticline39 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer186->Add( m_staticline39, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer188; + bSizer188 = new wxBoxSizer( wxVERTICAL ); + + m_staticText95 = new wxStaticText( m_panel39, wxID_ANY, _("Automatic retry on error:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText95->Wrap( -1 ); + bSizer188->Add( m_staticText95, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + wxFlexGridSizer* fgSizer6; + fgSizer6 = new wxFlexGridSizer( 0, 2, 5, 5 ); + fgSizer6->SetFlexibleDirection( wxBOTH ); + fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText96 = new wxStaticText( m_panel39, wxID_ANY, _("Retry count:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText96->Wrap( -1 ); + fgSizer6->Add( m_staticText96, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_spinCtrlAutoRetryCount = new wxSpinCtrl( m_panel39, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), wxSP_ARROW_KEYS, 0, 2000000000, 4 ); + fgSizer6->Add( m_spinCtrlAutoRetryCount, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextAutoRetryDelay = new wxStaticText( m_panel39, wxID_ANY, _("Delay (in seconds):"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextAutoRetryDelay->Wrap( -1 ); + fgSizer6->Add( m_staticTextAutoRetryDelay, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_spinCtrlAutoRetryDelay = new wxSpinCtrl( m_panel39, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), wxSP_ARROW_KEYS, 0, 2000000000, 0 ); + fgSizer6->Add( m_spinCtrlAutoRetryDelay, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer188->Add( fgSizer6, 0, wxLEFT, 10 ); + + + bSizer186->Add( bSizer188, 0, wxALL, 10 ); + + + bSizer166->Add( bSizer186, 0, wxEXPAND, 5 ); + + m_staticline191 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer166->Add( m_staticline191, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer181; + bSizer181 = new wxBoxSizer( wxVERTICAL ); + + m_staticText85 = new wxStaticText( m_panel39, wxID_ANY, _("Customize context menu:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText85->Wrap( -1 ); + bSizer181->Add( m_staticText85, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + m_gridCustomCommand = new wxGrid( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_gridCustomCommand->CreateGrid( 5, 2 ); + m_gridCustomCommand->EnableEditing( true ); + m_gridCustomCommand->EnableGridLines( true ); + m_gridCustomCommand->EnableDragGridSize( false ); + m_gridCustomCommand->SetMargins( 0, 0 ); + + // Columns + m_gridCustomCommand->SetColSize( 0, 165 ); + m_gridCustomCommand->SetColSize( 1, 196 ); + m_gridCustomCommand->EnableDragColMove( false ); + m_gridCustomCommand->EnableDragColSize( true ); + m_gridCustomCommand->SetColLabelSize( 20 ); + m_gridCustomCommand->SetColLabelValue( 0, _("Description") ); + m_gridCustomCommand->SetColLabelValue( 1, _("Command line") ); + m_gridCustomCommand->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Rows + m_gridCustomCommand->EnableDragRowSize( false ); + m_gridCustomCommand->SetRowLabelSize( 1 ); + m_gridCustomCommand->SetRowLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_gridCustomCommand->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + bSizer181->Add( m_gridCustomCommand, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer193; + bSizer193 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonAddRow = new wxBitmapButton( m_panel39, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer193->Add( m_bpButtonAddRow, 0, 0, 5 ); + + m_bpButtonRemoveRow = new wxBitmapButton( m_panel39, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + bSizer193->Add( m_bpButtonRemoveRow, 0, 0, 5 ); + + + bSizer193->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_hyperlink17 = new wxHyperlinkCtrl( m_panel39, wxID_ANY, _("Show examples"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer193->Add( m_hyperlink17, 0, wxLEFT, 5 ); + + + bSizer181->Add( bSizer193, 0, wxTOP|wxEXPAND, 5 ); + + + bSizer166->Add( bSizer181, 1, wxEXPAND|wxALL, 10 ); + + m_staticline192 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer166->Add( m_staticline192, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer1881; + bSizer1881 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonResetDialogs = new zen::BitmapTextButton( m_panel39, wxID_ANY, _("Restore hidden windows"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer1881->Add( m_buttonResetDialogs, 0, wxALL|wxALIGN_CENTER_VERTICAL, 10 ); + + m_staticline40 = new wxStaticLine( m_panel39, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer1881->Add( m_staticline40, 0, wxEXPAND, 5 ); + + + bSizer166->Add( bSizer1881, 0, 0, 5 ); + + + m_panel39->SetSizer( bSizer166 ); + m_panel39->Layout(); + bSizer166->Fit( m_panel39 ); + bSizer95->Add( m_panel39, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_staticline36 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer95->Add( m_staticline36, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonDefault = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonDefault, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizerStdButtons->Add( 0, 0, 1, 0, 5 ); + + m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerStdButtons->Add( m_buttonOkay, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer95->Add( bSizerStdButtons, 0, wxEXPAND, 5 ); + + + this->SetSizer( bSizer95 ); + this->Layout(); + bSizer95->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( OptionsDlgGenerated::OnClose ) ); + m_spinCtrlAutoRetryCount->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( OptionsDlgGenerated::OnToggleAutoRetryCount ), NULL, this ); + m_bpButtonAddRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnAddRow ), NULL, this ); + m_bpButtonRemoveRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnRemoveRow ), NULL, this ); + m_hyperlink17->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( OptionsDlgGenerated::OnHelpShowExamples ), NULL, this ); + m_buttonResetDialogs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnResetDialogs ), NULL, this ); + m_buttonDefault->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnDefault ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnOkay ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( OptionsDlgGenerated::OnCancel ), NULL, this ); } OptionsDlgGenerated::~OptionsDlgGenerated() @@ -3039,22 +3070,22 @@ OptionsDlgGenerated::~OptionsDlgGenerated() TooltipDialogGenerated::TooltipDialogGenerated( 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* bSizer158; - bSizer158 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapLeft = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer158->Add( m_bitmapLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextMain = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - 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 ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeft = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer158->Add( m_bitmapLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextMain = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + 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 ); } TooltipDialogGenerated::~TooltipDialogGenerated() @@ -3063,60 +3094,60 @@ TooltipDialogGenerated::~TooltipDialogGenerated() SelectTimespanDlgGenerated::SelectTimespanDlgGenerated( 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->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer96; - bSizer96 = new wxBoxSizer( wxVERTICAL ); - - m_panel35 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel35->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer98; - bSizer98 = new wxBoxSizer( wxHORIZONTAL ); - - m_calendarFrom = new wxCalendarCtrl( m_panel35, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS|wxNO_BORDER ); - bSizer98->Add( m_calendarFrom, 0, wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_calendarTo = new wxCalendarCtrl( m_panel35, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS|wxNO_BORDER ); - bSizer98->Add( m_calendarTo, 0, wxALL, 10 ); - - - m_panel35->SetSizer( bSizer98 ); - m_panel35->Layout(); - bSizer98->Fit( m_panel35 ); - bSizer96->Add( m_panel35, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticline21 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer96->Add( m_staticline21, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonOkay->SetDefault(); - m_buttonOkay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerStdButtons->Add( m_buttonOkay, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - - bSizer96->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); - - - this->SetSizer( bSizer96 ); - this->Layout(); - bSizer96->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SelectTimespanDlgGenerated::OnClose ) ); - m_calendarFrom->Connect( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler( SelectTimespanDlgGenerated::OnChangeSelectionFrom ), NULL, this ); - m_calendarTo->Connect( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler( SelectTimespanDlgGenerated::OnChangeSelectionTo ), NULL, this ); - m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SelectTimespanDlgGenerated::OnOkay ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SelectTimespanDlgGenerated::OnCancel ), NULL, this ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer96; + bSizer96 = new wxBoxSizer( wxVERTICAL ); + + m_panel35 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel35->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer98; + bSizer98 = new wxBoxSizer( wxHORIZONTAL ); + + m_calendarFrom = new wxCalendarCtrl( m_panel35, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS|wxNO_BORDER ); + bSizer98->Add( m_calendarFrom, 0, wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_calendarTo = new wxCalendarCtrl( m_panel35, wxID_ANY, wxDefaultDateTime, wxDefaultPosition, wxDefaultSize, wxCAL_SHOW_HOLIDAYS|wxNO_BORDER ); + bSizer98->Add( m_calendarTo, 0, wxALL, 10 ); + + + m_panel35->SetSizer( bSizer98 ); + m_panel35->Layout(); + bSizer98->Fit( m_panel35 ); + bSizer96->Add( m_panel35, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline21 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer96->Add( m_staticline21, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonOkay = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerStdButtons->Add( m_buttonOkay, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + + bSizer96->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); + + + this->SetSizer( bSizer96 ); + this->Layout(); + bSizer96->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SelectTimespanDlgGenerated::OnClose ) ); + m_calendarFrom->Connect( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler( SelectTimespanDlgGenerated::OnChangeSelectionFrom ), NULL, this ); + m_calendarTo->Connect( wxEVT_CALENDAR_SEL_CHANGED, wxCalendarEventHandler( SelectTimespanDlgGenerated::OnChangeSelectionTo ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SelectTimespanDlgGenerated::OnOkay ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SelectTimespanDlgGenerated::OnCancel ), NULL, this ); } SelectTimespanDlgGenerated::~SelectTimespanDlgGenerated() @@ -3125,306 +3156,306 @@ SelectTimespanDlgGenerated::~SelectTimespanDlgGenerated() AboutDlgGenerated::AboutDlgGenerated( 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->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer31; - bSizer31 = new wxBoxSizer( wxVERTICAL ); - - m_panel41 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel41->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer162; - bSizer162 = new wxBoxSizer( wxVERTICAL ); - - m_bitmapLogo = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer162->Add( m_bitmapLogo, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticline341 = new wxStaticLine( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer162->Add( m_staticline341, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer174; - bSizer174 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer181; - bSizer181 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer187; - bSizer187 = new wxBoxSizer( wxVERTICAL ); - - m_staticText96 = new wxStaticText( m_panel41, wxID_ANY, _("Source code written in C++ using:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText96->Wrap( -1 ); - bSizer187->Add( m_staticText96, 0, wxALL, 5 ); - - wxBoxSizer* bSizer171; - bSizer171 = new wxBoxSizer( wxHORIZONTAL ); - - m_hyperlink11 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("MS Visual C++"), wxT("http://msdn.microsoft.com/library/60k1461a.aspx"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink11->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink11->SetToolTip( _("http://msdn.microsoft.com/library/60k1461a.aspx") ); - - bSizer171->Add( m_hyperlink11, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink9 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("MinGW"), wxT("http://www.mingw.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink9->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink9->SetToolTip( _("http://www.mingw.org") ); - - bSizer171->Add( m_hyperlink9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink10 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Code::Blocks"), wxT("http://www.codeblocks.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink10->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink10->SetToolTip( _("http://www.codeblocks.org") ); - - bSizer171->Add( m_hyperlink10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink7 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("wxWidgets"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink7->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink7->SetToolTip( _("http://www.wxwidgets.org") ); - - bSizer171->Add( m_hyperlink7, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink14 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("wxFormBuilder"), wxT("http://wxformbuilder.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink14->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink14->SetToolTip( _("http://wxformbuilder.org") ); - - bSizer171->Add( m_hyperlink14, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer187->Add( bSizer171, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizer172; - bSizer172 = new wxBoxSizer( wxHORIZONTAL ); - - m_hyperlink15 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("zen::Xml"), wxT("http://zenxml.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink15->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink15->SetToolTip( _("http://zenxml.sourceforge.net") ); - - bSizer172->Add( m_hyperlink15, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink13 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Boost"), wxT("http://www.boost.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink13->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink13->SetToolTip( _("http://www.boost.org") ); - - bSizer172->Add( m_hyperlink13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink16 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Artistic Style"), wxT("http://astyle.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink16->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink16->SetToolTip( _("http://astyle.sourceforge.net") ); - - bSizer172->Add( m_hyperlink16, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink12 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Google Test"), wxT("http://code.google.com/p/googletest"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink12->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink12->SetToolTip( _("http://code.google.com/p/googletest") ); - - bSizer172->Add( m_hyperlink12, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink18 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Unicode NSIS"), wxT("http://www.scratchpaper.com"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink18->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink18->SetToolTip( _("http://www.scratchpaper.com") ); - - bSizer172->Add( m_hyperlink18, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer187->Add( bSizer172, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer181->Add( bSizer187, 0, wxALL|wxEXPAND, 5 ); - - m_panelDonate = new wxPanel( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panelDonate->SetBackgroundColour( wxColour( 153, 170, 187 ) ); - - wxBoxSizer* bSizer183; - bSizer183 = new wxBoxSizer( wxVERTICAL ); - - m_panel39 = new wxPanel( m_panelDonate, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel39->SetBackgroundColour( wxColour( 221, 221, 255 ) ); - - wxBoxSizer* bSizer184; - bSizer184 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer184->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_animCtrlWink = new wxAnimationCtrl( m_panel39, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 48,48 ), wxAC_DEFAULT_STYLE ); - bSizer184->Add( m_animCtrlWink, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer178; - bSizer178 = new wxBoxSizer( wxVERTICAL ); - - m_staticText83 = new wxStaticText( m_panel39, wxID_ANY, _("If you like FreeFileSync"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText83->Wrap( -1 ); - m_staticText83->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - m_staticText83->SetForegroundColour( wxColour( 0, 0, 0 ) ); - - bSizer178->Add( m_staticText83, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonDonate = new wxButton( m_panel39, wxID_ANY, _("Donate with PayPal"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonDonate->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) ); - m_buttonDonate->SetToolTip( _("http://freefilesync.sourceforge.net/donate.php") ); - - bSizer178->Add( m_buttonDonate, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer184->Add( bSizer178, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer184->Add( 0, 0, 1, wxEXPAND, 5 ); - - - m_panel39->SetSizer( bSizer184 ); - m_panel39->Layout(); - bSizer184->Fit( m_panel39 ); - bSizer183->Add( m_panel39, 0, wxEXPAND|wxALL, 5 ); - - - m_panelDonate->SetSizer( bSizer183 ); - m_panelDonate->Layout(); - bSizer183->Fit( m_panelDonate ); - bSizer181->Add( m_panelDonate, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - wxBoxSizer* bSizer186; - bSizer186 = new wxBoxSizer( wxVERTICAL ); - - m_staticText94 = new wxStaticText( m_panel41, wxID_ANY, _("Feedback and suggestions are welcome"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText94->Wrap( -1 ); - bSizer186->Add( m_staticText94, 0, wxALL, 5 ); - - wxBoxSizer* bSizer166; - bSizer166 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bitmap9 = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_bitmap9->SetToolTip( _("Homepage") ); - - bSizer166->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_hyperlink1 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("freefilesync.sf.net"), wxT("http://freefilesync.sf.net/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink1->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, true, wxEmptyString ) ); - m_hyperlink1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizer166->Add( m_hyperlink1, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bitmap10 = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_bitmap10->SetToolTip( _("Email") ); - - bSizer166->Add( m_bitmap10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_hyperlink2 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("zenju@gmx.de"), wxT("mailto:zenju@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, true, wxEmptyString ) ); - m_hyperlink2->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizer166->Add( m_hyperlink2, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); - - - bSizer186->Add( bSizer166, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer181->Add( bSizer186, 0, wxALL|wxEXPAND, 5 ); - - m_staticline34 = new wxStaticLine( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer181->Add( m_staticline34, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer185; - bSizer185 = new wxBoxSizer( wxVERTICAL ); - - m_staticText93 = new wxStaticText( m_panel41, wxID_ANY, _("Published under the GNU General Public License"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText93->Wrap( -1 ); - bSizer185->Add( m_staticText93, 0, wxALL, 5 ); - - wxBoxSizer* bSizer1671; - bSizer1671 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap13 = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer1671->Add( m_bitmap13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink5 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("http://www.gnu.org/licenses/gpl.html"), wxT("http://www.gnu.org/licenses/gpl.html"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - bSizer1671->Add( m_hyperlink5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer185->Add( bSizer1671, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer181->Add( bSizer185, 0, wxALL|wxEXPAND, 5 ); - - - bSizer174->Add( bSizer181, 0, 0, 5 ); - - m_staticline37 = new wxStaticLine( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer174->Add( m_staticline37, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer177; - bSizer177 = new wxBoxSizer( wxVERTICAL ); - - m_staticText54 = new wxStaticText( m_panel41, wxID_ANY, _("Many thanks for localization:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText54->Wrap( 200 ); - m_staticText54->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizer177->Add( m_staticText54, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - - bSizer177->Add( 0, 5, 0, 0, 5 ); - - m_scrolledWindowTranslators = new wxScrolledWindow( m_panel41, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxVSCROLL ); - m_scrolledWindowTranslators->SetScrollRate( 10, 10 ); - m_scrolledWindowTranslators->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_scrolledWindowTranslators->SetMinSize( wxSize( 220,-1 ) ); - - fgSizerTranslators = new wxFlexGridSizer( 0, 2, 2, 10 ); - fgSizerTranslators->SetFlexibleDirection( wxBOTH ); - fgSizerTranslators->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - m_scrolledWindowTranslators->SetSizer( fgSizerTranslators ); - m_scrolledWindowTranslators->Layout(); - fgSizerTranslators->Fit( m_scrolledWindowTranslators ); - bSizer177->Add( m_scrolledWindowTranslators, 1, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxEXPAND, 5 ); - - - bSizer174->Add( bSizer177, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); - - - bSizer162->Add( bSizer174, 0, 0, 5 ); - - - m_panel41->SetSizer( bSizer162 ); - m_panel41->Layout(); - bSizer162->Fit( m_panel41 ); - bSizer31->Add( m_panel41, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_staticline36 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer31->Add( m_staticline36, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonClose = new wxButton( this, wxID_OK, _("Close"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonClose->SetDefault(); - bSizerStdButtons->Add( m_buttonClose, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer31->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); - - - this->SetSizer( bSizer31 ); - this->Layout(); - bSizer31->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); - m_buttonDonate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnDonate ), NULL, this ); - m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer31; + bSizer31 = new wxBoxSizer( wxVERTICAL ); + + m_panel41 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel41->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer162; + bSizer162 = new wxBoxSizer( wxVERTICAL ); + + m_bitmapLogo = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer162->Add( m_bitmapLogo, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline341 = new wxStaticLine( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer162->Add( m_staticline341, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer174; + bSizer174 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer181; + bSizer181 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer187; + bSizer187 = new wxBoxSizer( wxVERTICAL ); + + m_staticText96 = new wxStaticText( m_panel41, wxID_ANY, _("Source code written in C++ using:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText96->Wrap( -1 ); + bSizer187->Add( m_staticText96, 0, wxALL, 5 ); + + wxBoxSizer* bSizer171; + bSizer171 = new wxBoxSizer( wxHORIZONTAL ); + + m_hyperlink11 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("MS Visual C++"), wxT("http://msdn.microsoft.com/library/60k1461a.aspx"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink11->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink11->SetToolTip( _("http://msdn.microsoft.com/library/60k1461a.aspx") ); + + bSizer171->Add( m_hyperlink11, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink9 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("MinGW"), wxT("http://www.mingw.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink9->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink9->SetToolTip( _("http://www.mingw.org") ); + + bSizer171->Add( m_hyperlink9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink10 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Code::Blocks"), wxT("http://www.codeblocks.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink10->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink10->SetToolTip( _("http://www.codeblocks.org") ); + + bSizer171->Add( m_hyperlink10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink7 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("wxWidgets"), wxT("http://www.wxwidgets.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink7->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink7->SetToolTip( _("http://www.wxwidgets.org") ); + + bSizer171->Add( m_hyperlink7, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink14 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("wxFormBuilder"), wxT("http://wxformbuilder.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink14->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink14->SetToolTip( _("http://wxformbuilder.org") ); + + bSizer171->Add( m_hyperlink14, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer187->Add( bSizer171, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizer172; + bSizer172 = new wxBoxSizer( wxHORIZONTAL ); + + m_hyperlink15 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("zen::Xml"), wxT("http://zenxml.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink15->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink15->SetToolTip( _("http://zenxml.sourceforge.net") ); + + bSizer172->Add( m_hyperlink15, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink13 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Boost"), wxT("http://www.boost.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink13->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink13->SetToolTip( _("http://www.boost.org") ); + + bSizer172->Add( m_hyperlink13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink16 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Artistic Style"), wxT("http://astyle.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink16->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink16->SetToolTip( _("http://astyle.sourceforge.net") ); + + bSizer172->Add( m_hyperlink16, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink12 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Google Test"), wxT("http://code.google.com/p/googletest"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink12->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink12->SetToolTip( _("http://code.google.com/p/googletest") ); + + bSizer172->Add( m_hyperlink12, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink18 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Unicode NSIS"), wxT("http://www.scratchpaper.com"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink18->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink18->SetToolTip( _("http://www.scratchpaper.com") ); + + bSizer172->Add( m_hyperlink18, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer187->Add( bSizer172, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer181->Add( bSizer187, 0, wxALL|wxEXPAND, 5 ); + + m_panelDonate = new wxPanel( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelDonate->SetBackgroundColour( wxColour( 153, 170, 187 ) ); + + wxBoxSizer* bSizer183; + bSizer183 = new wxBoxSizer( wxVERTICAL ); + + m_panel39 = new wxPanel( m_panelDonate, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel39->SetBackgroundColour( wxColour( 221, 221, 255 ) ); + + wxBoxSizer* bSizer184; + bSizer184 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer184->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_animCtrlWink = new wxAnimationCtrl( m_panel39, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 48,48 ), wxAC_DEFAULT_STYLE ); + bSizer184->Add( m_animCtrlWink, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer178; + bSizer178 = new wxBoxSizer( wxVERTICAL ); + + m_staticText83 = new wxStaticText( m_panel39, wxID_ANY, _("If you like FreeFileSync"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText83->Wrap( -1 ); + m_staticText83->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + m_staticText83->SetForegroundColour( wxColour( 0, 0, 0 ) ); + + bSizer178->Add( m_staticText83, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonDonate = new wxButton( m_panel39, wxID_ANY, _("Donate with PayPal"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonDonate->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) ); + m_buttonDonate->SetToolTip( _("http://freefilesync.sourceforge.net/donate.php") ); + + bSizer178->Add( m_buttonDonate, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer184->Add( bSizer178, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer184->Add( 0, 0, 1, wxEXPAND, 5 ); + + + m_panel39->SetSizer( bSizer184 ); + m_panel39->Layout(); + bSizer184->Fit( m_panel39 ); + bSizer183->Add( m_panel39, 0, wxEXPAND|wxALL, 5 ); + + + m_panelDonate->SetSizer( bSizer183 ); + m_panelDonate->Layout(); + bSizer183->Fit( m_panelDonate ); + bSizer181->Add( m_panelDonate, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxBoxSizer* bSizer186; + bSizer186 = new wxBoxSizer( wxVERTICAL ); + + m_staticText94 = new wxStaticText( m_panel41, wxID_ANY, _("Feedback and suggestions are welcome"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText94->Wrap( -1 ); + bSizer186->Add( m_staticText94, 0, wxALL, 5 ); + + wxBoxSizer* bSizer166; + bSizer166 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bitmap9 = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_bitmap9->SetToolTip( _("Homepage") ); + + bSizer166->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_hyperlink1 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("freefilesync.sf.net"), wxT("http://freefilesync.sf.net/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink1->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, true, wxEmptyString ) ); + m_hyperlink1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizer166->Add( m_hyperlink1, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bitmap10 = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_bitmap10->SetToolTip( _("Email") ); + + bSizer166->Add( m_bitmap10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_hyperlink2 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("zenju@gmx.de"), wxT("mailto:zenju@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink2->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, true, wxEmptyString ) ); + m_hyperlink2->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizer166->Add( m_hyperlink2, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); + + + bSizer186->Add( bSizer166, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer181->Add( bSizer186, 0, wxALL|wxEXPAND, 5 ); + + m_staticline34 = new wxStaticLine( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer181->Add( m_staticline34, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer185; + bSizer185 = new wxBoxSizer( wxVERTICAL ); + + m_staticText93 = new wxStaticText( m_panel41, wxID_ANY, _("Published under the GNU General Public License"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText93->Wrap( -1 ); + bSizer185->Add( m_staticText93, 0, wxALL, 5 ); + + wxBoxSizer* bSizer1671; + bSizer1671 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap13 = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer1671->Add( m_bitmap13, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink5 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("http://www.gnu.org/licenses/gpl.html"), wxT("http://www.gnu.org/licenses/gpl.html"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + bSizer1671->Add( m_hyperlink5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer185->Add( bSizer1671, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer181->Add( bSizer185, 0, wxALL|wxEXPAND, 5 ); + + + bSizer174->Add( bSizer181, 0, 0, 5 ); + + m_staticline37 = new wxStaticLine( m_panel41, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer174->Add( m_staticline37, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer177; + bSizer177 = new wxBoxSizer( wxVERTICAL ); + + m_staticText54 = new wxStaticText( m_panel41, wxID_ANY, _("Many thanks for localization:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText54->Wrap( 200 ); + m_staticText54->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizer177->Add( m_staticText54, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + + bSizer177->Add( 0, 5, 0, 0, 5 ); + + m_scrolledWindowTranslators = new wxScrolledWindow( m_panel41, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxVSCROLL ); + m_scrolledWindowTranslators->SetScrollRate( 10, 10 ); + m_scrolledWindowTranslators->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_scrolledWindowTranslators->SetMinSize( wxSize( 220,-1 ) ); + + fgSizerTranslators = new wxFlexGridSizer( 0, 2, 2, 10 ); + fgSizerTranslators->SetFlexibleDirection( wxBOTH ); + fgSizerTranslators->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + + m_scrolledWindowTranslators->SetSizer( fgSizerTranslators ); + m_scrolledWindowTranslators->Layout(); + fgSizerTranslators->Fit( m_scrolledWindowTranslators ); + bSizer177->Add( m_scrolledWindowTranslators, 1, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxEXPAND, 5 ); + + + bSizer174->Add( bSizer177, 0, wxEXPAND|wxTOP|wxLEFT, 5 ); + + + bSizer162->Add( bSizer174, 0, 0, 5 ); + + + m_panel41->SetSizer( bSizer162 ); + m_panel41->Layout(); + bSizer162->Fit( m_panel41 ); + bSizer31->Add( m_panel41, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_staticline36 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer31->Add( m_staticline36, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonClose = new wxButton( this, wxID_OK, _("Close"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonClose->SetDefault(); + bSizerStdButtons->Add( m_buttonClose, 0, wxALL|wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer31->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); + + + this->SetSizer( bSizer31 ); + this->Layout(); + bSizer31->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); + m_buttonDonate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnDonate ), NULL, this ); + m_buttonClose->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); } AboutDlgGenerated::~AboutDlgGenerated() diff --git a/FreeFileSync/Source/ui/gui_generated.h b/FreeFileSync/Source/ui/gui_generated.h index 3a14c35f..37c1c307 100644 --- a/FreeFileSync/Source/ui/gui_generated.h +++ b/FreeFileSync/Source/ui/gui_generated.h @@ -14,10 +14,10 @@ class FolderHistoryBox; class OnCompletionBox; class ToggleButton; -namespace zen{ class BitmapTextButton; } -namespace zen{ class Graph2D; } -namespace zen{ class Grid; } -namespace zen{ class TripleSplitter; } +namespace zen { class BitmapTextButton; } +namespace zen { class Graph2D; } +namespace zen { class Grid; } +namespace zen { class TripleSplitter; } #include <wx/string.h> #include <wx/bitmap.h> @@ -42,9 +42,9 @@ namespace zen{ class TripleSplitter; } #include <wx/listbox.h> #include <wx/frame.h> #include <wx/tglbtn.h> -#include <wx/choice.h> -#include <wx/hyperlink.h> #include <wx/spinctrl.h> +#include <wx/hyperlink.h> +#include <wx/choice.h> #include <wx/notebook.h> #include <wx/dialog.h> #include <wx/gauge.h> @@ -60,777 +60,784 @@ namespace zen{ class TripleSplitter; } /////////////////////////////////////////////////////////////////////////////// /// Class MainDialogGenerated /////////////////////////////////////////////////////////////////////////////// -class MainDialogGenerated : public wxFrame +class MainDialogGenerated : public wxFrame { - private: - - protected: - wxMenuBar* m_menubar1; - wxMenu* m_menuFile; - wxMenuItem* m_menuItemNew; - wxMenuItem* m_menuItemLoad; - wxMenuItem* m_menuItemSave; - wxMenuItem* m_menuItemSaveAs; - wxMenuItem* m_menuItemSaveAsBatch; - wxMenuItem* m_menuItemCompare; - wxMenuItem* m_menuItemSynchronize; - wxMenu* m_menuTools; - wxMenuItem* m_menuItemOptions; - wxMenu* m_menuLanguages; - wxMenu* m_menuHelp; - wxMenuItem* m_menuItemHelp; - wxMenu* m_menuCheckVersion; - wxMenuItem* m_menuItemCheckVersionNow; - wxMenuItem* m_menuItemCheckVersionAuto; - wxMenuItem* m_menuItemAbout; - wxBoxSizer* bSizerPanelHolder; - wxPanel* m_panelTopButtons; - wxBoxSizer* bSizerTopButtons; - zen::BitmapTextButton* m_buttonCancel; - zen::BitmapTextButton* m_buttonCompare; - wxBitmapButton* m_bpButtonCmpConfig; - wxBitmapButton* m_bpButtonFilter; - wxBitmapButton* m_bpButtonSyncConfig; - zen::BitmapTextButton* m_buttonSync; - wxPanel* m_panelDirectoryPairs; - wxStaticText* m_staticTextResolvedPathL; - wxBitmapButton* m_bpButtonAddPair; - wxButton* m_buttonSelectDirLeft; - wxPanel* m_panelTopMiddle; - wxBitmapButton* m_bpButtonSwapSides; - wxStaticText* m_staticTextResolvedPathR; - wxButton* m_buttonSelectDirRight; - wxScrolledWindow* m_scrolledWindowFolderPairs; - wxBoxSizer* bSizerAddFolderPairs; - zen::Grid* m_gridNavi; - wxPanel* m_panelCenter; - zen::TripleSplitter* m_splitterMain; - zen::Grid* m_gridMainL; - zen::Grid* m_gridMainC; - zen::Grid* m_gridMainR; - wxPanel* m_panelStatusBar; - wxBoxSizer* bSizerFileStatus; - wxBoxSizer* bSizerStatusLeft; - wxBoxSizer* bSizerStatusLeftDirectories; - wxStaticBitmap* m_bitmapSmallDirectoryLeft; - wxStaticText* m_staticTextStatusLeftDirs; - wxBoxSizer* bSizerStatusLeftFiles; - wxStaticBitmap* m_bitmapSmallFileLeft; - wxStaticText* m_staticTextStatusLeftFiles; - wxStaticText* m_staticTextStatusLeftBytes; - wxStaticLine* m_staticline9; - wxStaticText* m_staticTextStatusMiddle; - wxBoxSizer* bSizerStatusRight; - wxStaticLine* m_staticline10; - wxBoxSizer* bSizerStatusRightDirectories; - wxStaticBitmap* m_bitmapSmallDirectoryRight; - wxStaticText* m_staticTextStatusRightDirs; - wxBoxSizer* bSizerStatusRightFiles; - wxStaticBitmap* m_bitmapSmallFileRight; - wxStaticText* m_staticTextStatusRightFiles; - wxStaticText* m_staticTextStatusRightBytes; - wxStaticText* m_staticTextFullStatus; - wxPanel* m_panelSearch; - wxBitmapButton* m_bpButtonHideSearch; - wxStaticText* m_staticText101; - wxTextCtrl* m_textCtrlSearchTxt; - wxCheckBox* m_checkBoxMatchCase; - wxPanel* m_panelConfig; - wxBoxSizer* bSizerConfig; - wxBitmapButton* m_bpButtonNew; - wxStaticText* m_staticText951; - wxBitmapButton* m_bpButtonOpen; - wxStaticText* m_staticText95; - wxBitmapButton* m_bpButtonSave; - wxStaticText* m_staticText961; - wxBitmapButton* m_bpButtonSaveAs; - wxBitmapButton* m_bpButtonSaveAsBatch; - wxStaticText* m_staticText97; - wxListBox* m_listBoxHistory; - wxPanel* m_panelViewFilter; - wxBoxSizer* bSizerViewFilter; - wxStaticText* m_staticTextViewType; - ToggleButton* m_bpButtonViewTypeSyncAction; - ToggleButton* m_bpButtonShowExcluded; - wxStaticText* m_staticTextSelectView; - ToggleButton* m_bpButtonShowDeleteLeft; - ToggleButton* m_bpButtonShowUpdateLeft; - ToggleButton* m_bpButtonShowCreateLeft; - ToggleButton* m_bpButtonShowLeftOnly; - ToggleButton* m_bpButtonShowLeftNewer; - ToggleButton* m_bpButtonShowEqual; - ToggleButton* m_bpButtonShowDoNothing; - ToggleButton* m_bpButtonShowDifferent; - ToggleButton* m_bpButtonShowRightNewer; - ToggleButton* m_bpButtonShowRightOnly; - ToggleButton* m_bpButtonShowCreateRight; - ToggleButton* m_bpButtonShowUpdateRight; - ToggleButton* m_bpButtonShowDeleteRight; - ToggleButton* m_bpButtonShowConflict; - wxStaticText* m_staticText96; - wxPanel* m_panelStatistics; - wxBoxSizer* bSizer1801; - wxStaticBitmap* m_bitmapDeleteLeft; - wxStaticText* m_staticTextDeleteLeft; - wxStaticBitmap* m_bitmapUpdateLeft; - wxStaticText* m_staticTextUpdateLeft; - wxStaticBitmap* m_bitmapCreateLeft; - wxStaticText* m_staticTextCreateLeft; - wxStaticBitmap* m_bitmapData; - wxStaticText* m_staticTextData; - wxStaticBitmap* m_bitmapCreateRight; - wxStaticText* m_staticTextCreateRight; - wxStaticBitmap* m_bitmapUpdateRight; - wxStaticText* m_staticTextUpdateRight; - wxStaticBitmap* m_bitmapDeleteRight; - wxStaticText* m_staticTextDeleteRight; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnConfigNew( wxCommandEvent& event ) { event.Skip(); } - virtual void OnConfigLoad( wxCommandEvent& event ) { event.Skip(); } - virtual void OnConfigSave( wxCommandEvent& event ) { event.Skip(); } - virtual void OnConfigSaveAs( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSaveAsBatchJob( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCompare( wxCommandEvent& event ) { event.Skip(); } - virtual void OnStartSync( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuQuit( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuOptions( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuFindItem( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuExportFileList( wxCommandEvent& event ) { event.Skip(); } - virtual void OnShowHelp( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuCheckVersion( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuCheckVersionAutomatically( wxCommandEvent& event ) { event.Skip(); } - virtual void OnMenuAbout( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCmpSettings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCompSettingsContext( wxMouseEvent& event ) { event.Skip(); } - virtual void OnConfigureFilter( wxCommandEvent& event ) { event.Skip(); } - virtual void OnGlobalFilterContext( wxMouseEvent& event ) { event.Skip(); } - virtual void OnSyncSettings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSyncSettingsContext( wxMouseEvent& event ) { event.Skip(); } - virtual void OnAddFolderPair( wxCommandEvent& event ) { event.Skip(); } - virtual void OnRemoveTopFolderPair( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSwapSides( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHideSearchPanel( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSearchGridEnter( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCfgHistoryKeyEvent( wxKeyEvent& event ) { event.Skip(); } - virtual void OnLoadFromHistory( wxCommandEvent& event ) { event.Skip(); } - virtual void OnLoadFromHistoryDoubleClick( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCfgHistoryRightClick( wxMouseEvent& event ) { event.Skip(); } - virtual void OnToggleViewType( wxCommandEvent& event ) { event.Skip(); } - virtual void OnToggleViewButton( wxCommandEvent& event ) { event.Skip(); } - virtual void OnViewButtonRightClick( wxMouseEvent& event ) { event.Skip(); } - - - public: - wxPanel* m_panelTopLeft; - wxBitmapButton* m_bpButtonRemovePair; - FolderHistoryBox* m_directoryLeft; - wxBitmapButton* m_bpButtonAltCompCfg; - wxBitmapButton* m_bpButtonLocalFilter; - wxBitmapButton* m_bpButtonAltSyncCfg; - wxPanel* m_panelTopRight; - FolderHistoryBox* m_directoryRight; - wxBoxSizer* bSizerStatistics; - wxBoxSizer* bSizerData; - - MainDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("dummy"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 900,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); - - ~MainDialogGenerated(); - +private: + +protected: + wxMenuBar* m_menubar1; + wxMenu* m_menuFile; + wxMenuItem* m_menuItemNew; + wxMenuItem* m_menuItemLoad; + wxMenuItem* m_menuItemSave; + wxMenuItem* m_menuItemSaveAs; + wxMenuItem* m_menuItemSaveAsBatch; + wxMenuItem* m_menuItemCompare; + wxMenuItem* m_menuItemSynchronize; + wxMenu* m_menuTools; + wxMenuItem* m_menuItemOptions; + wxMenu* m_menuLanguages; + wxMenu* m_menuHelp; + wxMenuItem* m_menuItemHelp; + wxMenu* m_menuCheckVersion; + wxMenuItem* m_menuItemCheckVersionNow; + wxMenuItem* m_menuItemCheckVersionAuto; + wxMenuItem* m_menuItemAbout; + wxBoxSizer* bSizerPanelHolder; + wxPanel* m_panelTopButtons; + wxBoxSizer* bSizerTopButtons; + zen::BitmapTextButton* m_buttonCancel; + zen::BitmapTextButton* m_buttonCompare; + wxBitmapButton* m_bpButtonCmpConfig; + wxBitmapButton* m_bpButtonFilter; + wxBitmapButton* m_bpButtonSyncConfig; + zen::BitmapTextButton* m_buttonSync; + wxPanel* m_panelDirectoryPairs; + wxStaticText* m_staticTextResolvedPathL; + wxBitmapButton* m_bpButtonAddPair; + wxButton* m_buttonSelectDirLeft; + wxPanel* m_panelTopMiddle; + wxBitmapButton* m_bpButtonSwapSides; + wxStaticText* m_staticTextResolvedPathR; + wxButton* m_buttonSelectDirRight; + wxScrolledWindow* m_scrolledWindowFolderPairs; + wxBoxSizer* bSizerAddFolderPairs; + zen::Grid* m_gridNavi; + wxPanel* m_panelCenter; + zen::TripleSplitter* m_splitterMain; + zen::Grid* m_gridMainL; + zen::Grid* m_gridMainC; + zen::Grid* m_gridMainR; + wxPanel* m_panelStatusBar; + wxBoxSizer* bSizerFileStatus; + wxBoxSizer* bSizerStatusLeft; + wxBoxSizer* bSizerStatusLeftDirectories; + wxStaticBitmap* m_bitmapSmallDirectoryLeft; + wxStaticText* m_staticTextStatusLeftDirs; + wxBoxSizer* bSizerStatusLeftFiles; + wxStaticBitmap* m_bitmapSmallFileLeft; + wxStaticText* m_staticTextStatusLeftFiles; + wxStaticText* m_staticTextStatusLeftBytes; + wxStaticLine* m_staticline9; + wxStaticText* m_staticTextStatusMiddle; + wxBoxSizer* bSizerStatusRight; + wxStaticLine* m_staticline10; + wxBoxSizer* bSizerStatusRightDirectories; + wxStaticBitmap* m_bitmapSmallDirectoryRight; + wxStaticText* m_staticTextStatusRightDirs; + wxBoxSizer* bSizerStatusRightFiles; + wxStaticBitmap* m_bitmapSmallFileRight; + wxStaticText* m_staticTextStatusRightFiles; + wxStaticText* m_staticTextStatusRightBytes; + wxStaticText* m_staticTextFullStatus; + wxPanel* m_panelSearch; + wxBitmapButton* m_bpButtonHideSearch; + wxStaticText* m_staticText101; + wxTextCtrl* m_textCtrlSearchTxt; + wxCheckBox* m_checkBoxMatchCase; + wxPanel* m_panelConfig; + wxBoxSizer* bSizerConfig; + wxBitmapButton* m_bpButtonNew; + wxStaticText* m_staticText951; + wxBitmapButton* m_bpButtonOpen; + wxStaticText* m_staticText95; + wxBitmapButton* m_bpButtonSave; + wxStaticText* m_staticText961; + wxBitmapButton* m_bpButtonSaveAs; + wxBitmapButton* m_bpButtonSaveAsBatch; + wxStaticText* m_staticText97; + wxListBox* m_listBoxHistory; + wxPanel* m_panelViewFilter; + wxBoxSizer* bSizerViewFilter; + wxStaticText* m_staticTextViewType; + ToggleButton* m_bpButtonViewTypeSyncAction; + ToggleButton* m_bpButtonShowExcluded; + wxStaticText* m_staticTextSelectView; + ToggleButton* m_bpButtonShowDeleteLeft; + ToggleButton* m_bpButtonShowUpdateLeft; + ToggleButton* m_bpButtonShowCreateLeft; + ToggleButton* m_bpButtonShowLeftOnly; + ToggleButton* m_bpButtonShowLeftNewer; + ToggleButton* m_bpButtonShowEqual; + ToggleButton* m_bpButtonShowDoNothing; + ToggleButton* m_bpButtonShowDifferent; + ToggleButton* m_bpButtonShowRightNewer; + ToggleButton* m_bpButtonShowRightOnly; + ToggleButton* m_bpButtonShowCreateRight; + ToggleButton* m_bpButtonShowUpdateRight; + ToggleButton* m_bpButtonShowDeleteRight; + ToggleButton* m_bpButtonShowConflict; + wxStaticText* m_staticText96; + wxPanel* m_panelStatistics; + wxBoxSizer* bSizer1801; + wxStaticBitmap* m_bitmapDeleteLeft; + wxStaticText* m_staticTextDeleteLeft; + wxStaticBitmap* m_bitmapUpdateLeft; + wxStaticText* m_staticTextUpdateLeft; + wxStaticBitmap* m_bitmapCreateLeft; + wxStaticText* m_staticTextCreateLeft; + wxStaticBitmap* m_bitmapData; + wxStaticText* m_staticTextData; + wxStaticBitmap* m_bitmapCreateRight; + wxStaticText* m_staticTextCreateRight; + wxStaticBitmap* m_bitmapUpdateRight; + wxStaticText* m_staticTextUpdateRight; + wxStaticBitmap* m_bitmapDeleteRight; + wxStaticText* m_staticTextDeleteRight; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnConfigNew( wxCommandEvent& event ) { event.Skip(); } + virtual void OnConfigLoad( wxCommandEvent& event ) { event.Skip(); } + virtual void OnConfigSave( wxCommandEvent& event ) { event.Skip(); } + virtual void OnConfigSaveAs( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSaveAsBatchJob( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCompare( wxCommandEvent& event ) { event.Skip(); } + virtual void OnStartSync( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuQuit( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuOptions( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuFindItem( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuResetLayout( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuExportFileList( wxCommandEvent& event ) { event.Skip(); } + virtual void OnShowHelp( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuCheckVersion( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuCheckVersionAutomatically( wxCommandEvent& event ) { event.Skip(); } + virtual void OnMenuAbout( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCmpSettings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCompSettingsContext( wxMouseEvent& event ) { event.Skip(); } + virtual void OnConfigureFilter( wxCommandEvent& event ) { event.Skip(); } + virtual void OnGlobalFilterContext( wxMouseEvent& event ) { event.Skip(); } + virtual void OnSyncSettings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSyncSettingsContext( wxMouseEvent& event ) { event.Skip(); } + virtual void OnAddFolderPair( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveTopFolderPair( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSwapSides( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHideSearchPanel( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSearchGridEnter( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCfgHistoryKeyEvent( wxKeyEvent& event ) { event.Skip(); } + virtual void OnLoadFromHistory( wxCommandEvent& event ) { event.Skip(); } + virtual void OnLoadFromHistoryDoubleClick( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCfgHistoryRightClick( wxMouseEvent& event ) { event.Skip(); } + virtual void OnToggleViewType( wxCommandEvent& event ) { event.Skip(); } + virtual void OnToggleViewButton( wxCommandEvent& event ) { event.Skip(); } + virtual void OnViewButtonRightClick( wxMouseEvent& event ) { event.Skip(); } + + +public: + wxPanel* m_panelTopLeft; + wxBitmapButton* m_bpButtonRemovePair; + FolderHistoryBox* m_directoryLeft; + wxBitmapButton* m_bpButtonAltCompCfg; + wxBitmapButton* m_bpButtonLocalFilter; + wxBitmapButton* m_bpButtonAltSyncCfg; + wxPanel* m_panelTopRight; + FolderHistoryBox* m_directoryRight; + wxBoxSizer* bSizerStatistics; + wxBoxSizer* bSizerData; + + MainDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("dummy"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 900,600 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); + + ~MainDialogGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class ConfigDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class ConfigDlgGenerated : public wxDialog +class ConfigDlgGenerated : public wxDialog { - private: - - protected: - wxNotebook* m_notebook; - wxPanel* m_panelCompSettingsHolder; - wxBoxSizer* bSizerLocalCompSettings; - wxCheckBox* m_checkBoxUseLocalCmpOptions; - wxStaticLine* m_staticline59; - wxPanel* m_panelComparisonSettings; - wxStaticText* m_staticText91; - wxStaticBitmap* m_bitmapByTime; - wxToggleButton* m_toggleBtnTimeSize; - wxStaticBitmap* m_bitmapByContent; - wxToggleButton* m_toggleBtnContent; - wxStaticLine* m_staticline42; - wxTextCtrl* m_textCtrlCompVarDescription; - wxStaticLine* m_staticline33; - wxStaticText* m_staticText92; - wxChoice* m_choiceHandleSymlinks; - wxHyperlinkCtrl* m_hyperlink24; - wxStaticLine* m_staticline331; - wxPanel* m_panelFilterSettingsHolder; - wxBoxSizer* bSizerLocalFilterSettings; - wxStaticText* m_staticText144; - wxStaticLine* m_staticline61; - wxPanel* m_panelFilterSettings; - wxStaticBitmap* m_bitmapInclude; - wxStaticText* m_staticText78; - wxTextCtrl* m_textCtrlInclude; - wxStaticLine* m_staticline22; - wxStaticBitmap* m_bitmapExclude; - wxStaticText* m_staticText77; - wxHyperlinkCtrl* m_hyperlink171; - wxTextCtrl* m_textCtrlExclude; - wxStaticLine* m_staticline24; - wxStaticBitmap* m_bitmapFilterDate; - wxStaticText* m_staticText79; - wxSpinCtrl* m_spinCtrlTimespan; - wxChoice* m_choiceUnitTimespan; - wxStaticLine* m_staticline23; - wxStaticBitmap* m_bitmapFilterSize; - wxStaticText* m_staticText80; - wxStaticText* m_staticText101; - wxSpinCtrl* m_spinCtrlMinSize; - wxChoice* m_choiceUnitMinSize; - wxStaticText* m_staticText102; - wxSpinCtrl* m_spinCtrlMaxSize; - wxChoice* m_choiceUnitMaxSize; - wxStaticLine* m_staticline62; - wxButton* m_buttonReset; - wxStaticText* m_staticText44; - wxPanel* m_panelSyncSettingsHolder; - wxBoxSizer* bSizerLocalSyncSettings; - wxCheckBox* m_checkBoxUseLocalSyncOptions; - wxStaticLine* m_staticline60; - wxPanel* m_panelSyncSettings; - wxStaticText* m_staticText86; - wxToggleButton* m_toggleBtnTwoWay; - wxToggleButton* m_toggleBtnMirror; - wxToggleButton* m_toggleBtnUpdate; - wxToggleButton* m_toggleBtnCustom; - wxCheckBox* m_checkBoxDetectMove; - wxStaticLine* m_staticline53; - wxTextCtrl* m_textCtrlSyncVarDescription; - wxStaticLine* m_staticline43; - wxBoxSizer* bSizerSyncConfig; - wxStaticText* m_staticText119; - wxStaticText* m_staticText120; - wxFlexGridSizer* fgSizerSyncDirections; - wxStaticBitmap* m_bitmapLeftOnly; - wxStaticBitmap* m_bitmapLeftNewer; - wxStaticBitmap* m_bitmapDifferent; - wxStaticBitmap* m_bitmapConflict; - wxStaticBitmap* m_bitmapRightNewer; - wxStaticBitmap* m_bitmapRightOnly; - wxBitmapButton* m_bpButtonLeftOnly; - wxBitmapButton* m_bpButtonLeftNewer; - wxBitmapButton* m_bpButtonDifferent; - wxBitmapButton* m_bpButtonConflict; - wxBitmapButton* m_bpButtonRightNewer; - wxBitmapButton* m_bpButtonRightOnly; - wxStaticBitmap* m_bitmapDatabase; - wxStaticLine* m_staticline54; - wxStaticText* m_staticText87; - wxToggleButton* m_toggleBtnPermanent; - wxToggleButton* m_toggleBtnRecycler; - wxToggleButton* m_toggleBtnVersioning; - wxBoxSizer* bSizerVersioning; - wxPanel* m_panelVersioning; - FolderHistoryBox* m_versioningFolder; - wxButton* m_buttonSelectDirVersioning; - wxBoxSizer* bSizer192; - wxStaticText* m_staticText93; - wxChoice* m_choiceVersioningStyle; - wxStaticText* m_staticTextNamingCvtPart1; - wxStaticText* m_staticTextNamingCvtPart2Bold; - wxStaticText* m_staticTextNamingCvtPart3; - wxHyperlinkCtrl* m_hyperlink17; - wxBoxSizer* bSizerMiscConfig; - wxStaticLine* m_staticline582; - wxStaticText* m_staticText88; - wxToggleButton* m_toggleBtnErrorIgnore; - wxToggleButton* m_toggleBtnErrorPopup; - wxStaticLine* m_staticline57; - wxBoxSizer* bSizerOnCompletion; - wxStaticText* m_staticText89; - OnCompletionBox* m_comboBoxOnCompletion; - wxBoxSizer* bSizerStdButtons; - wxButton* m_buttonOkay; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnToggleLocalCompSettings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTimeSizeDouble( wxMouseEvent& event ) { event.Skip(); } - virtual void OnTimeSize( wxCommandEvent& event ) { event.Skip(); } - virtual void OnContentDouble( wxMouseEvent& event ) { event.Skip(); } - virtual void OnContent( wxCommandEvent& event ) { event.Skip(); } - virtual void OnChangeErrorHandling( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpComparisonSettings( wxHyperlinkEvent& event ) { event.Skip(); } - virtual void OnChangeFilterOption( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpShowExamples( wxHyperlinkEvent& event ) { event.Skip(); } - virtual void OnFilterReset( wxCommandEvent& event ) { event.Skip(); } - virtual void OnToggleLocalSyncSettings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSyncTwoWayDouble( wxMouseEvent& event ) { event.Skip(); } - virtual void OnSyncTwoWay( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSyncMirrorDouble( wxMouseEvent& event ) { event.Skip(); } - virtual void OnSyncMirror( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSyncUpdateDouble( wxMouseEvent& event ) { event.Skip(); } - virtual void OnSyncUpdate( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSyncCustomDouble( wxMouseEvent& event ) { event.Skip(); } - virtual void OnSyncCustom( wxCommandEvent& event ) { event.Skip(); } - virtual void OnToggleDetectMovedFiles( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExLeftSideOnly( wxCommandEvent& event ) { event.Skip(); } - virtual void OnLeftNewer( wxCommandEvent& event ) { event.Skip(); } - virtual void OnDifferent( wxCommandEvent& event ) { event.Skip(); } - virtual void OnConflict( wxCommandEvent& event ) { event.Skip(); } - virtual void OnRightNewer( wxCommandEvent& event ) { event.Skip(); } - virtual void OnExRightSideOnly( wxCommandEvent& event ) { event.Skip(); } - virtual void OnDeletionPermanent( wxCommandEvent& event ) { event.Skip(); } - virtual void OnDeletionRecycler( wxCommandEvent& event ) { event.Skip(); } - virtual void OnDeletionVersioning( wxCommandEvent& event ) { event.Skip(); } - virtual void OnChangeSyncOption( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpVersioning( wxHyperlinkEvent& event ) { event.Skip(); } - virtual void OnErrorIgnore( wxCommandEvent& event ) { event.Skip(); } - virtual void OnErrorPopup( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - - - public: - - ConfigDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("dummy"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); - ~ConfigDlgGenerated(); - +private: + +protected: + wxNotebook* m_notebook; + wxPanel* m_panelCompSettingsHolder; + wxBoxSizer* bSizerLocalCompSettings; + wxCheckBox* m_checkBoxUseLocalCmpOptions; + wxStaticLine* m_staticline59; + wxPanel* m_panelComparisonSettings; + wxStaticText* m_staticText91; + wxStaticBitmap* m_bitmapByTime; + wxToggleButton* m_toggleBtnTimeSize; + wxStaticBitmap* m_bitmapByContent; + wxToggleButton* m_toggleBtnContent; + wxStaticLine* m_staticline42; + wxTextCtrl* m_textCtrlCompVarDescription; + wxStaticLine* m_staticline33; + wxCheckBox* m_checkBoxTimeShift; + wxSpinCtrl* m_spinCtrlTimeShift; + wxHyperlinkCtrl* m_hyperlink241; + wxStaticLine* m_staticline44; + wxStaticText* m_staticText92; + wxChoice* m_choiceHandleSymlinks; + wxHyperlinkCtrl* m_hyperlink24; + wxStaticLine* m_staticline441; + wxStaticLine* m_staticline331; + wxPanel* m_panelFilterSettingsHolder; + wxBoxSizer* bSizerLocalFilterSettings; + wxStaticText* m_staticText144; + wxStaticLine* m_staticline61; + wxPanel* m_panelFilterSettings; + wxStaticBitmap* m_bitmapInclude; + wxStaticText* m_staticText78; + wxTextCtrl* m_textCtrlInclude; + wxStaticLine* m_staticline22; + wxStaticBitmap* m_bitmapExclude; + wxStaticText* m_staticText77; + wxHyperlinkCtrl* m_hyperlink171; + wxTextCtrl* m_textCtrlExclude; + wxStaticLine* m_staticline24; + wxStaticBitmap* m_bitmapFilterDate; + wxStaticText* m_staticText79; + wxSpinCtrl* m_spinCtrlTimespan; + wxChoice* m_choiceUnitTimespan; + wxStaticLine* m_staticline23; + wxStaticBitmap* m_bitmapFilterSize; + wxStaticText* m_staticText80; + wxStaticText* m_staticText101; + wxSpinCtrl* m_spinCtrlMinSize; + wxChoice* m_choiceUnitMinSize; + wxStaticText* m_staticText102; + wxSpinCtrl* m_spinCtrlMaxSize; + wxChoice* m_choiceUnitMaxSize; + wxStaticLine* m_staticline62; + wxButton* m_buttonReset; + wxStaticText* m_staticText44; + wxPanel* m_panelSyncSettingsHolder; + wxBoxSizer* bSizerLocalSyncSettings; + wxCheckBox* m_checkBoxUseLocalSyncOptions; + wxStaticLine* m_staticline60; + wxPanel* m_panelSyncSettings; + wxStaticText* m_staticText86; + wxToggleButton* m_toggleBtnTwoWay; + wxToggleButton* m_toggleBtnMirror; + wxToggleButton* m_toggleBtnUpdate; + wxToggleButton* m_toggleBtnCustom; + wxCheckBox* m_checkBoxDetectMove; + wxStaticLine* m_staticline53; + wxTextCtrl* m_textCtrlSyncVarDescription; + wxStaticLine* m_staticline43; + wxBoxSizer* bSizerSyncConfig; + wxStaticText* m_staticText119; + wxStaticText* m_staticText120; + wxFlexGridSizer* fgSizerSyncDirections; + wxStaticBitmap* m_bitmapLeftOnly; + wxStaticBitmap* m_bitmapLeftNewer; + wxStaticBitmap* m_bitmapDifferent; + wxStaticBitmap* m_bitmapConflict; + wxStaticBitmap* m_bitmapRightNewer; + wxStaticBitmap* m_bitmapRightOnly; + wxBitmapButton* m_bpButtonLeftOnly; + wxBitmapButton* m_bpButtonLeftNewer; + wxBitmapButton* m_bpButtonDifferent; + wxBitmapButton* m_bpButtonConflict; + wxBitmapButton* m_bpButtonRightNewer; + wxBitmapButton* m_bpButtonRightOnly; + wxStaticBitmap* m_bitmapDatabase; + wxStaticLine* m_staticline54; + wxStaticText* m_staticText87; + wxToggleButton* m_toggleBtnPermanent; + wxToggleButton* m_toggleBtnRecycler; + wxToggleButton* m_toggleBtnVersioning; + wxBoxSizer* bSizerVersioning; + wxPanel* m_panelVersioning; + FolderHistoryBox* m_versioningFolder; + wxButton* m_buttonSelectDirVersioning; + wxBoxSizer* bSizer192; + wxStaticText* m_staticText93; + wxChoice* m_choiceVersioningStyle; + wxStaticText* m_staticTextNamingCvtPart1; + wxStaticText* m_staticTextNamingCvtPart2Bold; + wxStaticText* m_staticTextNamingCvtPart3; + wxHyperlinkCtrl* m_hyperlink17; + wxBoxSizer* bSizerMiscConfig; + wxStaticLine* m_staticline582; + wxStaticText* m_staticText88; + wxToggleButton* m_toggleBtnErrorIgnore; + wxToggleButton* m_toggleBtnErrorPopup; + wxStaticLine* m_staticline57; + wxBoxSizer* bSizerOnCompletion; + wxStaticText* m_staticText89; + OnCompletionBox* m_comboBoxOnCompletion; + wxBoxSizer* bSizerStdButtons; + wxButton* m_buttonOkay; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnToggleLocalCompSettings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTimeSizeDouble( wxMouseEvent& event ) { event.Skip(); } + virtual void OnTimeSize( wxCommandEvent& event ) { event.Skip(); } + virtual void OnContentDouble( wxMouseEvent& event ) { event.Skip(); } + virtual void OnContent( wxCommandEvent& event ) { event.Skip(); } + virtual void OnChangeCompOption( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHelpTimeShift( wxHyperlinkEvent& event ) { event.Skip(); } + virtual void OnHelpComparisonSettings( wxHyperlinkEvent& event ) { event.Skip(); } + virtual void OnChangeFilterOption( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHelpShowExamples( wxHyperlinkEvent& event ) { event.Skip(); } + virtual void OnFilterReset( wxCommandEvent& event ) { event.Skip(); } + virtual void OnToggleLocalSyncSettings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSyncTwoWayDouble( wxMouseEvent& event ) { event.Skip(); } + virtual void OnSyncTwoWay( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSyncMirrorDouble( wxMouseEvent& event ) { event.Skip(); } + virtual void OnSyncMirror( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSyncUpdateDouble( wxMouseEvent& event ) { event.Skip(); } + virtual void OnSyncUpdate( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSyncCustomDouble( wxMouseEvent& event ) { event.Skip(); } + virtual void OnSyncCustom( wxCommandEvent& event ) { event.Skip(); } + virtual void OnToggleDetectMovedFiles( wxCommandEvent& event ) { event.Skip(); } + virtual void OnExLeftSideOnly( wxCommandEvent& event ) { event.Skip(); } + virtual void OnLeftNewer( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDifferent( wxCommandEvent& event ) { event.Skip(); } + virtual void OnConflict( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRightNewer( wxCommandEvent& event ) { event.Skip(); } + virtual void OnExRightSideOnly( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeletionPermanent( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeletionRecycler( wxCommandEvent& event ) { event.Skip(); } + virtual void OnDeletionVersioning( wxCommandEvent& event ) { event.Skip(); } + virtual void OnChangeSyncOption( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHelpVersioning( wxHyperlinkEvent& event ) { event.Skip(); } + virtual void OnErrorIgnore( wxCommandEvent& event ) { event.Skip(); } + virtual void OnErrorPopup( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + + +public: + + ConfigDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("dummy"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + ~ConfigDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class SyncConfirmationDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncConfirmationDlgGenerated : public wxDialog +class SyncConfirmationDlgGenerated : public wxDialog { - private: - - protected: - wxStaticBitmap* m_bitmapSync; - wxStaticText* m_staticTextHeader; - wxStaticLine* m_staticline371; - wxPanel* m_panelStatistics; - wxStaticLine* m_staticline38; - wxStaticText* m_staticText84; - wxStaticText* m_staticTextVariant; - wxStaticLine* m_staticline14; - wxStaticText* m_staticText83; - wxStaticBitmap* m_bitmapDeleteLeft; - wxStaticBitmap* m_bitmapUpdateLeft; - wxStaticBitmap* m_bitmapCreateLeft; - wxStaticBitmap* m_bitmapData; - wxStaticBitmap* m_bitmapCreateRight; - wxStaticBitmap* m_bitmapUpdateRight; - wxStaticBitmap* m_bitmapDeleteRight; - wxStaticText* m_staticTextDeleteLeft; - wxStaticText* m_staticTextUpdateLeft; - wxStaticText* m_staticTextCreateLeft; - wxStaticText* m_staticTextData; - wxStaticText* m_staticTextCreateRight; - wxStaticText* m_staticTextUpdateRight; - wxStaticText* m_staticTextDeleteRight; - wxStaticLine* m_staticline381; - wxStaticLine* m_staticline12; - wxCheckBox* m_checkBoxDontShowAgain; - wxBoxSizer* bSizerStdButtons; - wxButton* m_buttonStartSync; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnStartSync( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - - - public: - - SyncConfirmationDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeFileSync"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~SyncConfirmationDlgGenerated(); - +private: + +protected: + wxStaticBitmap* m_bitmapSync; + wxStaticText* m_staticTextHeader; + wxStaticLine* m_staticline371; + wxPanel* m_panelStatistics; + wxStaticLine* m_staticline38; + wxStaticText* m_staticText84; + wxStaticText* m_staticTextVariant; + wxStaticLine* m_staticline14; + wxStaticText* m_staticText83; + wxStaticBitmap* m_bitmapDeleteLeft; + wxStaticBitmap* m_bitmapUpdateLeft; + wxStaticBitmap* m_bitmapCreateLeft; + wxStaticBitmap* m_bitmapData; + wxStaticBitmap* m_bitmapCreateRight; + wxStaticBitmap* m_bitmapUpdateRight; + wxStaticBitmap* m_bitmapDeleteRight; + wxStaticText* m_staticTextDeleteLeft; + wxStaticText* m_staticTextUpdateLeft; + wxStaticText* m_staticTextCreateLeft; + wxStaticText* m_staticTextData; + wxStaticText* m_staticTextCreateRight; + wxStaticText* m_staticTextUpdateRight; + wxStaticText* m_staticTextDeleteRight; + wxStaticLine* m_staticline381; + wxStaticLine* m_staticline12; + wxCheckBox* m_checkBoxDontShowAgain; + wxBoxSizer* bSizerStdButtons; + wxButton* m_buttonStartSync; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnStartSync( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + + +public: + + SyncConfirmationDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("FreeFileSync"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~SyncConfirmationDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class FolderPairPanelGenerated /////////////////////////////////////////////////////////////////////////////// -class FolderPairPanelGenerated : public wxPanel +class FolderPairPanelGenerated : public wxPanel { - private: - - protected: - wxButton* m_buttonSelectDirLeft; - wxButton* m_buttonSelectDirRight; - - public: - wxPanel* m_panelLeft; - wxBitmapButton* m_bpButtonRemovePair; - FolderHistoryBox* m_directoryLeft; - wxPanel* m_panel20; - wxBitmapButton* m_bpButtonAltCompCfg; - wxBitmapButton* m_bpButtonLocalFilter; - wxBitmapButton* m_bpButtonAltSyncCfg; - wxPanel* m_panelRight; - FolderHistoryBox* m_directoryRight; - - FolderPairPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0 ); - ~FolderPairPanelGenerated(); - +private: + +protected: + wxButton* m_buttonSelectDirLeft; + wxButton* m_buttonSelectDirRight; + +public: + wxPanel* m_panelLeft; + wxBitmapButton* m_bpButtonRemovePair; + FolderHistoryBox* m_directoryLeft; + wxPanel* m_panel20; + wxBitmapButton* m_bpButtonAltCompCfg; + wxBitmapButton* m_bpButtonLocalFilter; + wxBitmapButton* m_bpButtonAltSyncCfg; + wxPanel* m_panelRight; + FolderHistoryBox* m_directoryRight; + + FolderPairPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0 ); + ~FolderPairPanelGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class CompareProgressDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class CompareProgressDlgGenerated : public wxPanel +class CompareProgressDlgGenerated : public wxPanel { - private: - - protected: - wxPanel* m_panelStatistics; - wxStaticText* m_staticTextItemsFoundLabel; - wxStaticText* m_staticTextItemsFound; - wxStaticText* m_staticTextItemsRemainingLabel; - wxBoxSizer* bSizerItemsRemaining; - wxStaticText* m_staticTextItemsRemaining; - wxStaticText* m_staticTextDataRemaining; - wxStaticText* m_staticTextTimeRemainingLabel; - wxStaticText* m_staticTextTimeRemaining; - wxStaticText* m_staticTextTimeElapsed; - wxStaticText* m_staticTextStatus; - wxGauge* m_gauge2; - wxStaticText* m_staticTextSpeed; - - public: - - CompareProgressDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxRAISED_BORDER ); - ~CompareProgressDlgGenerated(); - +private: + +protected: + wxPanel* m_panelStatistics; + wxStaticText* m_staticTextItemsFoundLabel; + wxStaticText* m_staticTextItemsFound; + wxStaticText* m_staticTextItemsRemainingLabel; + wxBoxSizer* bSizerItemsRemaining; + wxStaticText* m_staticTextItemsRemaining; + wxStaticText* m_staticTextDataRemaining; + wxStaticText* m_staticTextTimeRemainingLabel; + wxStaticText* m_staticTextTimeRemaining; + wxStaticText* m_staticTextTimeElapsed; + wxStaticText* m_staticTextStatus; + wxGauge* m_gauge2; + wxStaticText* m_staticTextSpeed; + +public: + + CompareProgressDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxRAISED_BORDER ); + ~CompareProgressDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class SyncProgressPanelGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncProgressPanelGenerated : public wxPanel +class SyncProgressPanelGenerated : public wxPanel { - private: - - protected: - wxBoxSizer* bSizer42; - wxBoxSizer* bSizer171; - wxStaticText* m_staticText87; - - public: - wxBoxSizer* bSizerRoot; - wxStaticBitmap* m_bitmapStatus; - wxStaticText* m_staticTextPhase; - wxAnimationCtrl* m_animCtrlSyncing; - wxBitmapButton* m_bpButtonMinimizeToTray; - wxBoxSizer* bSizerStatusText; - wxStaticText* m_staticTextStatus; - wxPanel* m_panelProgress; - wxPanel* m_panelItemsProcessed; - wxStaticText* m_staticTextProcessedObj; - wxStaticText* m_staticTextDataProcessed; - wxPanel* m_panelItemsRemaining; - wxStaticText* m_staticTextRemainingObj; - wxStaticText* m_staticTextDataRemaining; - wxPanel* m_panelTimeRemaining; - wxStaticText* m_staticTextRemTime; - wxStaticText* m_staticTextTimeElapsed; - zen::Graph2D* m_panelGraphBytes; - zen::Graph2D* m_panelGraphItems; - wxNotebook* m_notebookResult; - wxStaticLine* m_staticlineFooter; - wxBoxSizer* bSizerStdButtons; - wxBoxSizer* bSizerOnCompletion; - OnCompletionBox* m_comboBoxOnCompletion; - wxButton* m_buttonClose; - wxButton* m_buttonPause; - wxButton* m_buttonStop; - - SyncProgressPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); - ~SyncProgressPanelGenerated(); - +private: + +protected: + wxBoxSizer* bSizer42; + wxBoxSizer* bSizer171; + wxStaticText* m_staticText87; + +public: + wxBoxSizer* bSizerRoot; + wxStaticBitmap* m_bitmapStatus; + wxStaticText* m_staticTextPhase; + wxAnimationCtrl* m_animCtrlSyncing; + wxBitmapButton* m_bpButtonMinimizeToTray; + wxBoxSizer* bSizerStatusText; + wxStaticText* m_staticTextStatus; + wxPanel* m_panelProgress; + wxPanel* m_panelItemsProcessed; + wxStaticText* m_staticTextProcessedObj; + wxStaticText* m_staticTextDataProcessed; + wxPanel* m_panelItemsRemaining; + wxStaticText* m_staticTextRemainingObj; + wxStaticText* m_staticTextDataRemaining; + wxPanel* m_panelTimeRemaining; + wxStaticText* m_staticTextRemTime; + wxStaticText* m_staticTextTimeElapsed; + zen::Graph2D* m_panelGraphBytes; + zen::Graph2D* m_panelGraphItems; + wxNotebook* m_notebookResult; + wxStaticLine* m_staticlineFooter; + wxBoxSizer* bSizerStdButtons; + wxBoxSizer* bSizerOnCompletion; + OnCompletionBox* m_comboBoxOnCompletion; + wxButton* m_buttonClose; + wxButton* m_buttonPause; + wxButton* m_buttonStop; + + SyncProgressPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~SyncProgressPanelGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class LogPanelGenerated /////////////////////////////////////////////////////////////////////////////// -class LogPanelGenerated : public wxPanel +class LogPanelGenerated : public wxPanel { - private: - - protected: - ToggleButton* m_bpButtonErrors; - ToggleButton* m_bpButtonWarnings; - ToggleButton* m_bpButtonInfo; - wxStaticLine* m_staticline13; - zen::Grid* m_gridMessages; - - // Virtual event handlers, overide them in your derived class - virtual void OnErrors( wxCommandEvent& event ) { event.Skip(); } - virtual void OnWarnings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnInfo( wxCommandEvent& event ) { event.Skip(); } - - - public: - - LogPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL ); - ~LogPanelGenerated(); - +private: + +protected: + ToggleButton* m_bpButtonErrors; + ToggleButton* m_bpButtonWarnings; + ToggleButton* m_bpButtonInfo; + wxStaticLine* m_staticline13; + zen::Grid* m_gridMessages; + + // Virtual event handlers, overide them in your derived class + virtual void OnErrors( wxCommandEvent& event ) { event.Skip(); } + virtual void OnWarnings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnInfo( wxCommandEvent& event ) { event.Skip(); } + + +public: + + LogPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL ); + ~LogPanelGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class BatchDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class BatchDlgGenerated : public wxDialog +class BatchDlgGenerated : public wxDialog { - private: - - protected: - wxStaticBitmap* m_bitmapBatchJob; - wxStaticText* m_staticTextDescr; - wxStaticLine* m_staticline18; - wxPanel* m_panel35; - wxStaticText* m_staticText82; - wxToggleButton* m_toggleBtnErrorIgnore; - wxToggleButton* m_toggleBtnErrorPopup; - wxToggleButton* m_toggleBtnErrorStop; - wxStaticLine* m_staticline26; - wxCheckBox* m_checkBoxRunMinimized; - wxStaticText* m_staticText81; - OnCompletionBox* m_comboBoxOnCompletion; - wxStaticLine* m_staticline25; - wxCheckBox* m_checkBoxGenerateLogfile; - wxPanel* m_panelLogfile; - wxButton* m_buttonSelectLogfileDir; - wxCheckBox* m_checkBoxLogfilesLimit; - wxSpinCtrl* m_spinCtrlLogfileLimit; - wxHyperlinkCtrl* m_hyperlink17; - wxStaticLine* m_staticline13; - wxBoxSizer* bSizerStdButtons; - wxButton* m_buttonSaveAs; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnErrorIgnore( wxCommandEvent& event ) { event.Skip(); } - virtual void OnErrorPopup( wxCommandEvent& event ) { event.Skip(); } - virtual void OnErrorStop( wxCommandEvent& event ) { event.Skip(); } - virtual void OnToggleGenerateLogfile( wxCommandEvent& event ) { event.Skip(); } - virtual void OnToggleLogfilesLimit( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpScheduleBatch( wxHyperlinkEvent& event ) { event.Skip(); } - virtual void OnSaveBatchJob( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - - - public: - FolderHistoryBox* m_logfileDir; - - BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Save as Batch Job"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~BatchDlgGenerated(); - +private: + +protected: + wxStaticBitmap* m_bitmapBatchJob; + wxStaticText* m_staticTextDescr; + wxStaticLine* m_staticline18; + wxPanel* m_panel35; + wxStaticText* m_staticText82; + wxToggleButton* m_toggleBtnErrorIgnore; + wxToggleButton* m_toggleBtnErrorPopup; + wxToggleButton* m_toggleBtnErrorStop; + wxStaticLine* m_staticline26; + wxCheckBox* m_checkBoxRunMinimized; + wxStaticText* m_staticText81; + OnCompletionBox* m_comboBoxOnCompletion; + wxStaticLine* m_staticline25; + wxCheckBox* m_checkBoxGenerateLogfile; + wxPanel* m_panelLogfile; + wxButton* m_buttonSelectLogfileDir; + wxCheckBox* m_checkBoxLogfilesLimit; + wxSpinCtrl* m_spinCtrlLogfileLimit; + wxHyperlinkCtrl* m_hyperlink17; + wxStaticLine* m_staticline13; + wxBoxSizer* bSizerStdButtons; + wxButton* m_buttonSaveAs; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnErrorIgnore( wxCommandEvent& event ) { event.Skip(); } + virtual void OnErrorPopup( wxCommandEvent& event ) { event.Skip(); } + virtual void OnErrorStop( wxCommandEvent& event ) { event.Skip(); } + virtual void OnToggleGenerateLogfile( wxCommandEvent& event ) { event.Skip(); } + virtual void OnToggleLogfilesLimit( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHelpScheduleBatch( wxHyperlinkEvent& event ) { event.Skip(); } + virtual void OnSaveBatchJob( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + + +public: + FolderHistoryBox* m_logfileDir; + + BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Save as Batch Job"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~BatchDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class DeleteDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class DeleteDlgGenerated : public wxDialog +class DeleteDlgGenerated : public wxDialog { - private: - - protected: - wxStaticBitmap* m_bitmapDeleteType; - wxStaticText* m_staticTextHeader; - wxStaticLine* m_staticline91; - wxPanel* m_panel31; - wxStaticLine* m_staticline42; - wxTextCtrl* m_textCtrlFileList; - wxStaticLine* m_staticline9; - wxBoxSizer* bSizerStdButtons; - wxCheckBox* m_checkBoxUseRecycler; - wxButton* m_buttonOK; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnUseRecycler( 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 = _("Delete Items"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); - ~DeleteDlgGenerated(); - +private: + +protected: + wxStaticBitmap* m_bitmapDeleteType; + wxStaticText* m_staticTextHeader; + wxStaticLine* m_staticline91; + wxPanel* m_panel31; + wxStaticLine* m_staticline42; + wxTextCtrl* m_textCtrlFileList; + wxStaticLine* m_staticline9; + wxBoxSizer* bSizerStdButtons; + wxCheckBox* m_checkBoxUseRecycler; + wxButton* m_buttonOK; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnUseRecycler( 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 = _("Delete Items"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + ~DeleteDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class OptionsDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class OptionsDlgGenerated : public wxDialog +class OptionsDlgGenerated : public wxDialog { - private: - - protected: - wxStaticBitmap* m_bitmapSettings; - wxStaticText* m_staticText44; - wxStaticLine* m_staticline20; - wxPanel* m_panel39; - wxCheckBox* m_checkBoxFailSafe; - wxStaticText* m_staticText91; - wxBoxSizer* bSizerLockedFiles; - wxCheckBox* m_checkBoxCopyLocked; - wxStaticText* m_staticText92; - wxCheckBox* m_checkBoxCopyPermissions; - wxStaticText* m_staticText93; - wxStaticLine* m_staticline39; - wxStaticText* m_staticText95; - wxStaticText* m_staticText96; - wxSpinCtrl* m_spinCtrlAutoRetryCount; - wxStaticText* m_staticTextAutoRetryDelay; - wxSpinCtrl* m_spinCtrlAutoRetryDelay; - wxStaticLine* m_staticline191; - wxStaticText* m_staticText85; - wxGrid* m_gridCustomCommand; - wxBitmapButton* m_bpButtonAddRow; - wxBitmapButton* m_bpButtonRemoveRow; - wxHyperlinkCtrl* m_hyperlink17; - wxStaticLine* m_staticline192; - zen::BitmapTextButton* m_buttonResetDialogs; - wxStaticLine* m_staticline40; - wxStaticLine* m_staticline36; - wxBoxSizer* bSizerStdButtons; - wxButton* m_buttonDefault; - wxButton* m_buttonOkay; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnToggleAutoRetryCount( wxCommandEvent& event ) { event.Skip(); } - virtual void OnAddRow( wxCommandEvent& event ) { event.Skip(); } - virtual void OnRemoveRow( wxCommandEvent& event ) { event.Skip(); } - virtual void OnHelpShowExamples( wxHyperlinkEvent& event ) { event.Skip(); } - virtual void OnResetDialogs( 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: - - OptionsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~OptionsDlgGenerated(); - +private: + +protected: + wxStaticBitmap* m_bitmapSettings; + wxStaticText* m_staticText44; + wxStaticLine* m_staticline20; + wxPanel* m_panel39; + wxCheckBox* m_checkBoxFailSafe; + wxStaticText* m_staticText91; + wxBoxSizer* bSizerLockedFiles; + wxCheckBox* m_checkBoxCopyLocked; + wxStaticText* m_staticText92; + wxCheckBox* m_checkBoxCopyPermissions; + wxStaticText* m_staticText93; + wxStaticLine* m_staticline39; + wxStaticText* m_staticText95; + wxStaticText* m_staticText96; + wxSpinCtrl* m_spinCtrlAutoRetryCount; + wxStaticText* m_staticTextAutoRetryDelay; + wxSpinCtrl* m_spinCtrlAutoRetryDelay; + wxStaticLine* m_staticline191; + wxStaticText* m_staticText85; + wxGrid* m_gridCustomCommand; + wxBitmapButton* m_bpButtonAddRow; + wxBitmapButton* m_bpButtonRemoveRow; + wxHyperlinkCtrl* m_hyperlink17; + wxStaticLine* m_staticline192; + zen::BitmapTextButton* m_buttonResetDialogs; + wxStaticLine* m_staticline40; + wxStaticLine* m_staticline36; + wxBoxSizer* bSizerStdButtons; + wxButton* m_buttonDefault; + wxButton* m_buttonOkay; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnToggleAutoRetryCount( wxCommandEvent& event ) { event.Skip(); } + virtual void OnAddRow( wxCommandEvent& event ) { event.Skip(); } + virtual void OnRemoveRow( wxCommandEvent& event ) { event.Skip(); } + virtual void OnHelpShowExamples( wxHyperlinkEvent& event ) { event.Skip(); } + virtual void OnResetDialogs( 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: + + OptionsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Options"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~OptionsDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class TooltipDialogGenerated /////////////////////////////////////////////////////////////////////////////// -class TooltipDialogGenerated : public wxDialog +class TooltipDialogGenerated : public wxDialog { - private: - - protected: - - public: - wxStaticBitmap* m_bitmapLeft; - wxStaticText* m_staticTextMain; - - TooltipDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~TooltipDialogGenerated(); - +private: + +protected: + +public: + wxStaticBitmap* m_bitmapLeft; + wxStaticText* m_staticTextMain; + + TooltipDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~TooltipDialogGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class SelectTimespanDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SelectTimespanDlgGenerated : public wxDialog +class SelectTimespanDlgGenerated : public wxDialog { - private: - - protected: - wxPanel* m_panel35; - wxCalendarCtrl* m_calendarFrom; - wxCalendarCtrl* m_calendarTo; - wxStaticLine* m_staticline21; - wxBoxSizer* bSizerStdButtons; - wxButton* m_buttonOkay; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnChangeSelectionFrom( wxCalendarEvent& event ) { event.Skip(); } - virtual void OnChangeSelectionTo( wxCalendarEvent& event ) { event.Skip(); } - virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - - - public: - - SelectTimespanDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Time Span"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~SelectTimespanDlgGenerated(); - +private: + +protected: + wxPanel* m_panel35; + wxCalendarCtrl* m_calendarFrom; + wxCalendarCtrl* m_calendarTo; + wxStaticLine* m_staticline21; + wxBoxSizer* bSizerStdButtons; + wxButton* m_buttonOkay; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnChangeSelectionFrom( wxCalendarEvent& event ) { event.Skip(); } + virtual void OnChangeSelectionTo( wxCalendarEvent& event ) { event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + + +public: + + SelectTimespanDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Select Time Span"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~SelectTimespanDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class AboutDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class AboutDlgGenerated : public wxDialog +class AboutDlgGenerated : public wxDialog { - private: - - protected: - wxPanel* m_panel41; - wxStaticBitmap* m_bitmapLogo; - wxStaticLine* m_staticline341; - wxStaticText* m_staticText96; - wxHyperlinkCtrl* m_hyperlink11; - wxHyperlinkCtrl* m_hyperlink9; - wxHyperlinkCtrl* m_hyperlink10; - wxHyperlinkCtrl* m_hyperlink7; - wxHyperlinkCtrl* m_hyperlink14; - wxHyperlinkCtrl* m_hyperlink15; - wxHyperlinkCtrl* m_hyperlink13; - wxHyperlinkCtrl* m_hyperlink16; - wxHyperlinkCtrl* m_hyperlink12; - wxHyperlinkCtrl* m_hyperlink18; - wxPanel* m_panelDonate; - wxPanel* m_panel39; - wxAnimationCtrl* m_animCtrlWink; - wxStaticText* m_staticText83; - wxButton* m_buttonDonate; - wxStaticText* m_staticText94; - wxStaticBitmap* m_bitmap9; - wxHyperlinkCtrl* m_hyperlink1; - wxStaticBitmap* m_bitmap10; - wxHyperlinkCtrl* m_hyperlink2; - wxStaticLine* m_staticline34; - wxStaticText* m_staticText93; - wxStaticBitmap* m_bitmap13; - wxHyperlinkCtrl* m_hyperlink5; - wxStaticLine* m_staticline37; - wxStaticText* m_staticText54; - wxScrolledWindow* m_scrolledWindowTranslators; - wxFlexGridSizer* fgSizerTranslators; - wxStaticLine* m_staticline36; - wxBoxSizer* bSizerStdButtons; - wxButton* m_buttonClose; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } - virtual void OnDonate( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOK( wxCommandEvent& event ) { event.Skip(); } - - - public: - - AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~AboutDlgGenerated(); - +private: + +protected: + wxPanel* m_panel41; + wxStaticBitmap* m_bitmapLogo; + wxStaticLine* m_staticline341; + wxStaticText* m_staticText96; + wxHyperlinkCtrl* m_hyperlink11; + wxHyperlinkCtrl* m_hyperlink9; + wxHyperlinkCtrl* m_hyperlink10; + wxHyperlinkCtrl* m_hyperlink7; + wxHyperlinkCtrl* m_hyperlink14; + wxHyperlinkCtrl* m_hyperlink15; + wxHyperlinkCtrl* m_hyperlink13; + wxHyperlinkCtrl* m_hyperlink16; + wxHyperlinkCtrl* m_hyperlink12; + wxHyperlinkCtrl* m_hyperlink18; + wxPanel* m_panelDonate; + wxPanel* m_panel39; + wxAnimationCtrl* m_animCtrlWink; + wxStaticText* m_staticText83; + wxButton* m_buttonDonate; + wxStaticText* m_staticText94; + wxStaticBitmap* m_bitmap9; + wxHyperlinkCtrl* m_hyperlink1; + wxStaticBitmap* m_bitmap10; + wxHyperlinkCtrl* m_hyperlink2; + wxStaticLine* m_staticline34; + wxStaticText* m_staticText93; + wxStaticBitmap* m_bitmap13; + wxHyperlinkCtrl* m_hyperlink5; + wxStaticLine* m_staticline37; + wxStaticText* m_staticText54; + wxScrolledWindow* m_scrolledWindowTranslators; + wxFlexGridSizer* fgSizerTranslators; + wxStaticLine* m_staticline36; + wxBoxSizer* bSizerStdButtons; + wxButton* m_buttonClose; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ) { event.Skip(); } + virtual void OnDonate( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOK( wxCommandEvent& event ) { event.Skip(); } + + +public: + + AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~AboutDlgGenerated(); + }; #endif //__GUI_GENERATED_H__ diff --git a/FreeFileSync/Source/ui/gui_status_handler.cpp b/FreeFileSync/Source/ui/gui_status_handler.cpp index a36f3089..dfd89444 100644 --- a/FreeFileSync/Source/ui/gui_status_handler.cpp +++ b/FreeFileSync/Source/ui/gui_status_handler.cpp @@ -29,9 +29,63 @@ CompareStatusHandler::CompareStatusHandler(MainDialog& dlg) : wxWindowUpdateLocker dummy(&mainDlg); //leads to GUI corruption problems on Linux/OS X! #endif - //display status panel during compare mainDlg.compareStatus->init(*this); //clear old values before showing panel - mainDlg.auiMgr.GetPane(mainDlg.compareStatus->getAsWindow()).Show(); + + //------------------------------------------------------------------ + const wxAuiPaneInfo& topPanel = mainDlg.auiMgr.GetPane(mainDlg.m_panelTopButtons); + wxAuiPaneInfo& statusPanel = mainDlg.auiMgr.GetPane(mainDlg.compareStatus->getAsWindow()); + + //determine best status panel row near top panel + switch (topPanel.dock_direction) + { + case wxAUI_DOCK_TOP: + case wxAUI_DOCK_BOTTOM: + statusPanel.Layer (topPanel.dock_layer); + statusPanel.Direction(topPanel.dock_direction); + statusPanel.Row (topPanel.dock_row + 1); + break; + + case wxAUI_DOCK_LEFT: + case wxAUI_DOCK_RIGHT: + statusPanel.Layer (std::max(0, topPanel.dock_layer - 1)); + statusPanel.Direction(wxAUI_DOCK_TOP); + statusPanel.Row (0); + break; + //case wxAUI_DOCK_CENTRE: + } + + wxAuiPaneInfoArray& paneArray = mainDlg.auiMgr.GetAllPanes(); + + const bool statusRowTaken = [&]() -> bool + { + for (size_t i = 0; i < paneArray.size(); ++i) + { + wxAuiPaneInfo& paneInfo = paneArray[i]; + + if (&paneInfo != &statusPanel && + paneInfo.dock_layer == statusPanel.dock_layer && + paneInfo.dock_direction == statusPanel.dock_direction && + paneInfo.dock_row == statusPanel.dock_row) + return true; + } + return false; + }(); + + //move all rows that are in the way one step further + if (statusRowTaken) + for (size_t i = 0; i < paneArray.size(); ++i) + { + wxAuiPaneInfo& paneInfo = paneArray[i]; + + if (&paneInfo != &statusPanel && + paneInfo.dock_layer == statusPanel.dock_layer && + paneInfo.dock_direction == statusPanel.dock_direction && + paneInfo.dock_row >= statusPanel.dock_row) + ++paneInfo.dock_row; + } + //------------------------------------------------------------------ + + statusPanel.Show(); mainDlg.auiMgr.Update(); } @@ -49,9 +103,9 @@ CompareStatusHandler::~CompareStatusHandler() mainDlg.Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), nullptr, this); mainDlg.m_buttonCancel->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompareStatusHandler::OnAbortCompare), nullptr, this); - mainDlg.compareStatus->teardown(); mainDlg.auiMgr.GetPane(mainDlg.compareStatus->getAsWindow()).Hide(); mainDlg.auiMgr.Update(); + mainDlg.compareStatus->teardown(); } @@ -68,7 +122,7 @@ void CompareStatusHandler::OnKeyPressed(wxKeyEvent& event) } -void CompareStatusHandler::initNewPhase(int objectsTotal, Int64 dataTotal, Phase phaseID) +void CompareStatusHandler::initNewPhase(int objectsTotal, std::int64_t dataTotal, Phase phaseID) { StatusHandler::initNewPhase(objectsTotal, dataTotal, phaseID); @@ -299,7 +353,7 @@ SyncStatusHandler::~SyncStatusHandler() } -void SyncStatusHandler::initNewPhase(int objectsTotal, Int64 dataTotal, Phase phaseID) +void SyncStatusHandler::initNewPhase(int objectsTotal, std::int64_t dataTotal, Phase phaseID) { assert(phaseID == PHASE_SYNCHRONIZING); StatusHandler::initNewPhase(objectsTotal, dataTotal, phaseID); @@ -310,7 +364,7 @@ void SyncStatusHandler::initNewPhase(int objectsTotal, Int64 dataTotal, Phase ph } -void SyncStatusHandler::updateProcessedData(int objectsDelta, Int64 dataDelta) +void SyncStatusHandler::updateProcessedData(int objectsDelta, std::int64_t dataDelta) { StatusHandler::updateProcessedData(objectsDelta, dataDelta); if (progressDlg) diff --git a/FreeFileSync/Source/ui/gui_status_handler.h b/FreeFileSync/Source/ui/gui_status_handler.h index ce75db82..47c6e431 100644 --- a/FreeFileSync/Source/ui/gui_status_handler.h +++ b/FreeFileSync/Source/ui/gui_status_handler.h @@ -7,13 +7,12 @@ #ifndef GUISTATUSHANDLER_H_INCLUDED #define GUISTATUSHANDLER_H_INCLUDED -#include <wx/event.h> #include <zen/error_log.h> -//#include <wx/stopwatch.h> +#include <wx/event.h> #include "progress_indicator.h" +#include "main_dlg.h" #include "../lib/status_handler.h" #include "../lib/process_xml.h" -#include "main_dlg.h" //Exception class used to abort the "compare" and "sync" process @@ -28,7 +27,7 @@ public: CompareStatusHandler(MainDialog& dlg); ~CompareStatusHandler(); - virtual void initNewPhase(int objectsTotal, zen::Int64 dataTotal, Phase phaseID); + virtual void initNewPhase(int objectsTotal, std::int64_t dataTotal, Phase phaseID); virtual void forceUiRefresh(); virtual Response reportError(const std::wstring& text, size_t retryNumber); @@ -60,8 +59,8 @@ public: std::vector<Zstring>& onCompletionHistory); ~SyncStatusHandler(); - virtual void initNewPhase (int objectsTotal, zen::Int64 dataTotal, Phase phaseID); - virtual void updateProcessedData(int objectsDelta, zen::Int64 dataDelta); + virtual void initNewPhase (int objectsTotal, std::int64_t dataTotal, Phase phaseID); + virtual void updateProcessedData(int objectsDelta, std::int64_t dataDelta); virtual void reportInfo(const std::wstring& text); virtual void forceUiRefresh(); diff --git a/FreeFileSync/Source/ui/main_dlg.cpp b/FreeFileSync/Source/ui/main_dlg.cpp index dbad3c87..4c27407a 100644 --- a/FreeFileSync/Source/ui/main_dlg.cpp +++ b/FreeFileSync/Source/ui/main_dlg.cpp @@ -8,7 +8,6 @@ #include <zen/format_unit.h> #include <zen/file_handling.h> #include <zen/serialize.h> -//#include <zen/perf.h> #include <zen/thread.h> #include <zen/shell_execute.h> #include <wx/clipbrd.h> @@ -90,19 +89,19 @@ public: wxWindow& dropWindow1, Grid& dropGrid, wxButton& dirSelectButton, - FolderHistoryBox& dirName, + FolderHistoryBox& dirpath, wxStaticText& staticText) : - DirectoryName(dropWindow1, dirSelectButton, dirName, &staticText, &dropGrid.getMainWin()), + DirectoryName(dropWindow1, dirSelectButton, dirpath, &staticText, &dropGrid.getMainWin()), mainDlg_(mainDlg) {} virtual bool acceptDrop(const std::vector<wxString>& droppedFiles, const wxPoint& clientPos, const wxWindow& wnd) override { - if (std::any_of(droppedFiles.begin(), droppedFiles.end(), [](const wxString& filename) + if (std::any_of(droppedFiles.begin(), droppedFiles.end(), [](const wxString& filepath) { using namespace xmlAccess; try { - switch (getXmlType(utfCvrtTo<Zstring>(filename))) //throw FileError + switch (getXmlType(utfCvrtTo<Zstring>(filepath))) //throw FileError { case XML_TYPE_GUI: case XML_TYPE_BATCH: @@ -126,8 +125,8 @@ public: } private: - DirectoryNameMainImpl(const DirectoryNameMainImpl&); - DirectoryNameMainImpl& operator=(const DirectoryNameMainImpl&); + DirectoryNameMainImpl (const DirectoryNameMainImpl&) = delete; + DirectoryNameMainImpl& operator=(const DirectoryNameMainImpl&) = delete; MainDialog& mainDlg_; }; @@ -176,14 +175,14 @@ public: FolderPairPanel(wxWindow* parent, MainDialog& mainDialog) : FolderPairPanelGenerated(parent), FolderPairCallback<FolderPairPanelGenerated>(static_cast<FolderPairPanelGenerated&>(*this), mainDialog), //pass FolderPairPanelGenerated part... - dirNameLeft (*m_panelLeft, *m_buttonSelectDirLeft, *m_directoryLeft), - dirNameRight(*m_panelRight, *m_buttonSelectDirRight, *m_directoryRight) + dirpathLeft (*m_panelLeft, *m_buttonSelectDirLeft, *m_directoryLeft), + dirpathRight(*m_panelRight, *m_buttonSelectDirRight, *m_directoryRight) { - dirNameLeft .Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); - dirNameRight.Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); + dirpathLeft .Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); + dirpathRight.Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); - dirNameLeft .Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); - dirNameRight.Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); + dirpathLeft .Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); + dirpathRight.Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); } void setValues(const Zstring& leftDir, @@ -193,16 +192,16 @@ public: const FilterConfig& filter) { setConfig(cmpCfg, syncCfg, filter); - dirNameLeft .setName(toWx(leftDir)); - dirNameRight.setName(toWx(rightDir)); + dirpathLeft .setPath(toWx(leftDir)); + dirpathRight.setPath(toWx(rightDir)); } - Zstring getLeftDir () const { return toZ(dirNameLeft .getName()); } - Zstring getRightDir() const { return toZ(dirNameRight.getName()); } + Zstring getLeftDir () const { return toZ(dirpathLeft .getPath()); } + Zstring getRightDir() const { return toZ(dirpathRight.getPath()); } private: //support for drag and drop - DirectoryName<FolderHistoryBox> dirNameLeft; - DirectoryName<FolderHistoryBox> dirNameRight; + DirectoryName<FolderHistoryBox> dirpathLeft; + DirectoryName<FolderHistoryBox> dirpathRight; }; @@ -213,24 +212,24 @@ public: FolderPairCallback<MainDialogGenerated>(mainDialog, mainDialog), //prepare drag & drop - dirNameLeft(mainDialog, + dirpathLeft(mainDialog, *mainDialog.m_panelTopLeft, *mainDialog.m_gridMainL, *mainDialog.m_buttonSelectDirLeft, *mainDialog.m_directoryLeft, *mainDialog.m_staticTextResolvedPathL), - dirNameRight(mainDialog, + dirpathRight(mainDialog, *mainDialog.m_panelTopRight, *mainDialog.m_gridMainR, *mainDialog.m_buttonSelectDirRight, *mainDialog.m_directoryRight, *mainDialog.m_staticTextResolvedPathR) { - dirNameLeft .Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); - dirNameRight.Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); + dirpathLeft .Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); + dirpathRight.Connect(EVENT_ON_DIR_SELECTED, wxCommandEventHandler(MainDialog::onDirSelected), nullptr, &mainDialog); - dirNameLeft .Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); - dirNameRight.Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); + dirpathLeft .Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); + dirpathRight.Connect(EVENT_ON_DIR_MANUAL_CORRECTION, wxCommandEventHandler(MainDialog::onDirManualCorrection), nullptr, &mainDialog); } void setValues(const Zstring& leftDir, @@ -240,16 +239,16 @@ public: const FilterConfig& filter) { setConfig(cmpCfg, syncCfg, filter); - dirNameLeft .setName(toWx(leftDir)); - dirNameRight.setName(toWx(rightDir)); + dirpathLeft .setPath(toWx(leftDir)); + dirpathRight.setPath(toWx(rightDir)); } - Zstring getLeftDir () const { return toZ(dirNameLeft .getName()); } - Zstring getRightDir() const { return toZ(dirNameRight.getName()); } + Zstring getLeftDir () const { return toZ(dirpathLeft .getPath()); } + Zstring getRightDir() const { return toZ(dirpathRight.getPath()); } private: //support for drag and drop - DirectoryNameMainImpl dirNameLeft; - DirectoryNameMainImpl dirNameRight; + DirectoryNameMainImpl dirpathLeft; + DirectoryNameMainImpl dirpathRight; }; @@ -375,31 +374,31 @@ void MainDialog::create(const Zstring& globalConfigFile) if (fileExists(globalConfigFile)) //else: globalCfg already has default values globalSettings = loadGlobalConfig(globalConfigFile); - std::vector<Zstring> filenames = globalSettings.gui.lastUsedConfigFiles; //2. now try last used files + std::vector<Zstring> filepaths = globalSettings.gui.lastUsedConfigFiles; //2. now try last used files //------------------------------------------------------------------------------------------ //check existence of all files in parallel: GetFirstResult<FalseType> firstMissingDir; - for (const Zstring& filename : filenames) - firstMissingDir.addJob([filename] { return filename.empty() /*ever empty??*/ || !fileExists(filename) ? make_unique<FalseType>() : nullptr; }); + for (const Zstring& filepath : filepaths) + firstMissingDir.addJob([filepath] { return filepath.empty() /*ever empty??*/ || !fileExists(filepath) ? make_unique<FalseType>() : nullptr; }); //potentially slow network access: give all checks 500ms to finish const bool allFilesExist = firstMissingDir.timedWait(boost::posix_time::milliseconds(500)) && //false: time elapsed !firstMissingDir.get(); //no missing if (!allFilesExist) - filenames.clear(); //we do NOT want to show an error due to last config file missing on application start! + filepaths.clear(); //we do NOT want to show an error due to last config file missing on application start! //------------------------------------------------------------------------------------------ - if (filenames.empty()) + if (filepaths.empty()) { if (zen::fileExists(lastRunConfigName())) //3. try to load auto-save config - filenames.push_back(lastRunConfigName()); + filepaths.push_back(lastRunConfigName()); } XmlGuiConfig guiCfg; //structure to receive gui settings with default values - if (filenames.empty()) + if (filepaths.empty()) { //add default exclusion filter: this is only ever relevant when creating new configurations! //a default XmlGuiConfig does not need these user-specific exclusions! @@ -412,7 +411,7 @@ void MainDialog::create(const Zstring& globalConfigFile) try { std::wstring warningMsg; - readAnyConfig(filenames, guiCfg, warningMsg); //throw FileError + readAnyConfig(filepaths, guiCfg, warningMsg); //throw FileError if (!warningMsg.empty()) showNotificationDialog(nullptr, DialogInfoType::WARNING, PopupDialogCfg().setDetailInstructions(warningMsg)); @@ -425,7 +424,7 @@ void MainDialog::create(const Zstring& globalConfigFile) //------------------------------------------------------------------------------------------ - create(globalConfigFile, &globalSettings, guiCfg, filenames, false); + create(globalConfigFile, &globalSettings, guiCfg, filepaths, false); } @@ -471,6 +470,8 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, bool startComparison) : MainDialogGenerated(nullptr), globalConfigFile_(globalConfigFile), + manualTimeSpanFrom(0), + manualTimeSpanTo (0), folderHistoryLeft (std::make_shared<FolderHistory>()), //make sure it is always bound folderHistoryRight(std::make_shared<FolderHistory>()), // focusWindowAfterSearch(nullptr) @@ -754,8 +755,8 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, auto addDirCheck = [&](const FolderPairEnh& fp) { - const Zstring dirLeft = getFormattedDirectoryName(fp.dirnamePhraseLeft ); //should not block!? - const Zstring dirRight = getFormattedDirectoryName(fp.dirnamePhraseRight); // + const Zstring dirLeft = getFormattedDirectoryPath(fp.dirpathPhraseLeft ); //should not block!? + const Zstring dirRight = getFormattedDirectoryPath(fp.dirpathPhraseRight); // if (dirLeft.empty() != dirRight.empty()) //only skip check if both sides are empty! havePartialPair = true; @@ -1313,7 +1314,7 @@ Zstring getExistingParentFolder(const FileSystemObject& fsObj) while (dirObj) { if (!dirObj->isEmpty<side>()) - return dirObj->getFullName<side>(); + return dirObj->getFullPath<side>(); dirObj = dynamic_cast<const DirPair*>(&dirObj->parent()); } @@ -1347,8 +1348,8 @@ void MainDialog::openExternalApplication(const wxString& commandline, const std: Zstring fallbackDir; if (selectionTmp.empty()) fallbackDir = leftSide ? - getFormattedDirectoryName(firstFolderPair->getLeftDir()) : - getFormattedDirectoryName(firstFolderPair->getRightDir()); + getFormattedDirectoryPath(firstFolderPair->getLeftDir()) : + getFormattedDirectoryPath(firstFolderPair->getRightDir()); else fallbackDir = leftSide ? @@ -1395,10 +1396,10 @@ void MainDialog::openExternalApplication(const wxString& commandline, const std: //regular command evaluation for (const FileSystemObject* fsObj : selectionTmp) //context menu calls this function only if selection is not empty! { - Zstring path1 = fsObj->getBaseDirPf<LEFT_SIDE>() + fsObj->getObjRelativeName(); //full path, even if item is not existing! + Zstring path1 = fsObj->getBaseDirPf<LEFT_SIDE>() + fsObj->getPairRelativePath(); //full path, even if item is not existing! Zstring dir1 = beforeLast(path1, FILE_NAME_SEPARATOR); //Win: wrong for root paths like "C:\file.txt" - Zstring path2 = fsObj->getBaseDirPf<RIGHT_SIDE>() + fsObj->getObjRelativeName(); + Zstring path2 = fsObj->getBaseDirPf<RIGHT_SIDE>() + fsObj->getPairRelativePath(); Zstring dir2 = beforeLast(path2, FILE_NAME_SEPARATOR); if (!leftSide) @@ -1428,8 +1429,8 @@ void MainDialog::setStatusBarFileStatistics(size_t filesOnLeftView, size_t foldersOnLeftView, size_t filesOnRightView, size_t foldersOnRightView, - zen::UInt64 filesizeLeftView, - zen::UInt64 filesizeRightView) + std::uint64_t filesizeLeftView, + std::uint64_t filesizeRightView) { #ifdef ZEN_WIN wxWindowUpdateLocker dummy(m_panelStatusBar); //leads to GUI corruption problems on Linux/OS X! @@ -1445,14 +1446,14 @@ void MainDialog::setStatusBarFileStatistics(size_t filesOnLeftView, setText(*m_staticTextStatusLeftDirs, _P("1 directory", "%x directories", foldersOnLeftView)); setText(*m_staticTextStatusLeftFiles, _P("1 file", "%x files", filesOnLeftView)); - setText(*m_staticTextStatusLeftBytes, L"(" + filesizeToShortString(to<Int64>(filesizeLeftView)) + L")"); + setText(*m_staticTextStatusLeftBytes, L"(" + filesizeToShortString(filesizeLeftView) + L")"); //------------------------------------------------------------------------------ bSizerStatusRightDirectories->Show(foldersOnRightView > 0); bSizerStatusRightFiles ->Show(filesOnRightView > 0); setText(*m_staticTextStatusRightDirs, _P("1 directory", "%x directories", foldersOnRightView)); setText(*m_staticTextStatusRightFiles, _P("1 file", "%x files", filesOnRightView)); - setText(*m_staticTextStatusRightBytes, L"(" + filesizeToShortString(to<Int64>(filesizeRightView)) + L")"); + setText(*m_staticTextStatusRightBytes, L"(" + filesizeToShortString(filesizeRightView) + L")"); //------------------------------------------------------------------------------ wxString statusMiddleNew; if (gridDataView->rowsTotal() > 0) @@ -2035,13 +2036,13 @@ void MainDialog::onNaviGridContext(GridClickEvent& event) const bool isDir = dynamic_cast<const DirPair*>(selection[0]) != nullptr; //by short name - Zstring labelShort = Zstring(Zstr("*")) + FILE_NAME_SEPARATOR + selection[0]->getObjShortName(); + Zstring labelShort = Zstring(Zstr("*")) + FILE_NAME_SEPARATOR + selection[0]->getPairShortName(); if (isDir) labelShort += Zstring(FILE_NAME_SEPARATOR) + Zstr("*"); submenu.addItem(utfCvrtTo<wxString>(labelShort), [this, &selection, include] { filterShortname(*selection[0], include); }); //by relative path - Zstring labelRel = FILE_NAME_SEPARATOR + selection[0]->getObjRelativeName(); + Zstring labelRel = FILE_NAME_SEPARATOR + selection[0]->getPairRelativePath(); if (isDir) labelRel += Zstring(FILE_NAME_SEPARATOR) + Zstr("*"); submenu.addItem(utfCvrtTo<wxString>(labelRel), [this, &selection, include] { filterItems(selection, include); }); @@ -2153,23 +2154,23 @@ void MainDialog::onMainGridContextRim(bool leftSide) //by extension if (!isDir) { - const Zstring filename = afterLast(selection[0]->getObjRelativeName(), FILE_NAME_SEPARATOR); - if (contains(filename, Zchar('.'))) //be careful: afterLast returns the whole string if '.' is not found! + const Zstring filepath = afterLast(selection[0]->getPairRelativePath(), FILE_NAME_SEPARATOR); + if (contains(filepath, Zchar('.'))) //be careful: afterLast returns the whole string if '.' is not found! { - const Zstring extension = afterLast(filename, Zchar('.')); + const Zstring extension = afterLast(filepath, Zchar('.')); submenu.addItem(L"*." + utfCvrtTo<wxString>(extension), [this, extension, include] { filterExtension(extension, include); }); } } //by short name - Zstring labelShort = Zstring(Zstr("*")) + FILE_NAME_SEPARATOR + selection[0]->getObjShortName(); + Zstring labelShort = Zstring(Zstr("*")) + FILE_NAME_SEPARATOR + selection[0]->getPairShortName(); if (isDir) labelShort += Zstring(FILE_NAME_SEPARATOR) + Zstr("*"); submenu.addItem(utfCvrtTo<wxString>(labelShort), [this, &selection, include] { filterShortname(*selection[0], include); }); //by relative path - Zstring labelRel = FILE_NAME_SEPARATOR + selection[0]->getObjRelativeName(); + Zstring labelRel = FILE_NAME_SEPARATOR + selection[0]->getPairRelativePath(); if (isDir) labelRel += Zstring(FILE_NAME_SEPARATOR) + Zstr("*"); submenu.addItem(utfCvrtTo<wxString>(labelRel), [this, &selection, include] { filterItems(selection, include); }); @@ -2286,7 +2287,7 @@ void MainDialog::filterExtension(const Zstring& extension, bool include) void MainDialog::filterShortname(const FileSystemObject& fsObj, bool include) { - Zstring phrase = Zstring(Zstr("*")) + FILE_NAME_SEPARATOR + fsObj.getObjShortName(); + Zstring phrase = Zstring(Zstr("*")) + FILE_NAME_SEPARATOR + fsObj.getPairShortName(); const bool isDir = dynamic_cast<const DirPair*>(&fsObj) != nullptr; if (isDir) phrase += Zstring(FILE_NAME_SEPARATOR) + Zstr("*"); //include filter: * required; exclude filter: * optional, but let's still apply it! @@ -2308,7 +2309,7 @@ void MainDialog::filterItems(const std::vector<FileSystemObject*>& selection, bo phrase += Zstr("\n"); //#pragma warning(suppress: 6011) -> fsObj bound in this context! - phrase += FILE_NAME_SEPARATOR + fsObj->getObjRelativeName(); + phrase += FILE_NAME_SEPARATOR + fsObj->getPairRelativePath(); const bool isDir = dynamic_cast<const DirPair*>(fsObj) != nullptr; if (isDir) @@ -2413,16 +2414,19 @@ void MainDialog::onGridLabelContext(Grid& grid, ColumnTypeRim type, const std::v } +void MainDialog::resetLayout() +{ + m_splitterMain->setSashOffset(0); + auiMgr.LoadPerspective(defaultPerspective); + updateGuiForFolderPair(); +} + + void MainDialog::OnContextSetLayout(wxMouseEvent& event) { ContextMenu menu; - menu.addItem(_("Reset layout"), [&] - { - m_splitterMain->setSashOffset(0); - auiMgr.LoadPerspective(defaultPerspective); - updateGuiForFolderPair(); - }); + menu.addItem(replaceCpy(_("&Reset layout"), L"&", L""), [&] { resetLayout(); }); //reuse translation from gui builder //---------------------------------------------------------------------------------------- bool addedSeperator = false; @@ -2516,16 +2520,16 @@ void MainDialog::onDirManualCorrection(wxCommandEvent& event) } -wxString getFormattedHistoryElement(const Zstring& filename) +wxString getFormattedHistoryElement(const Zstring& filepath) { - Zstring output = afterLast(filename, FILE_NAME_SEPARATOR); + Zstring output = afterLast(filepath, FILE_NAME_SEPARATOR); if (endsWith(output, Zstr(".ffs_gui"))) output = beforeLast(output, Zstr('.')); return utfCvrtTo<wxString>(output); } -void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filenames) +void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filepaths) { //determine highest "last use" index number of m_listBoxHistory int lastUseIndexMax = 0; @@ -2537,7 +2541,7 @@ void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filenames) std::deque<bool> selections(m_listBoxHistory->GetCount()); //items to select after update of history list - for (const Zstring& filename : filenames) + for (const Zstring& filepath : filepaths) { //Do we need to additionally check for aliases of the same physical files here? (and aliases for lastRunConfigName?) @@ -2546,7 +2550,7 @@ void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filenames) for (unsigned int i = 0; i < m_listBoxHistory->GetCount(); ++i) if (auto histData = dynamic_cast<wxClientHistoryData*>(m_listBoxHistory->GetClientObject(i))) { - if (EqualFilename()(filename, histData->cfgFile_)) + if (EqualFilename()(filepath, histData->cfgFile_)) return std::make_pair(histData, i); } else @@ -2566,12 +2570,12 @@ void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filenames) wxString label; unsigned int newPos = 0; - if (EqualFilename()(filename, lastRunConfigName())) + if (EqualFilename()(filepath, lastRunConfigName())) label = lastSessionLabel; else { //workaround wxWidgets 2.9 bug on GTK screwing up the client data if the list box is sorted: - label = getFormattedHistoryElement(filename); + label = getFormattedHistoryElement(filepath); //"linear-time insertion sort": for (; newPos < m_listBoxHistory->GetCount(); ++newPos) @@ -2584,7 +2588,7 @@ void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filenames) } assert(!m_listBoxHistory->IsSorted()); - m_listBoxHistory->Insert(label, newPos, new wxClientHistoryData(filename, ++lastUseIndexMax)); + m_listBoxHistory->Insert(label, newPos, new wxClientHistoryData(filepath, ++lastUseIndexMax)); selections.insert(selections.begin() + newPos, true); } @@ -2600,19 +2604,19 @@ void MainDialog::addFileToCfgHistory(const std::vector<Zstring>& filenames) } -void MainDialog::removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filenames) +void MainDialog::removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filepaths) { //don't use wxString: NOT thread-safe! (e.g. non-atomic ref-count) - auto getMissingFilesAsync = [filenames]() -> std::vector<Zstring> + auto getMissingFilesAsync = [filepaths]() -> std::vector<Zstring> { //boost::this_thread::sleep(boost::posix_time::millisec(5000)); //check existence of all config files in parallel! std::list<boost::unique_future<bool>> fileEx; - for (const Zstring& filename : filenames) - fileEx.push_back(zen::async2<bool>([=] { return fileExists(filename); })); + for (const Zstring& filepath : filepaths) + fileEx.push_back(zen::async2<bool>([=] { return fileExists(filepath); })); //potentially slow network access => limit maximum wait time! wait_for_all_timed(fileEx.begin(), fileEx.end(), boost::posix_time::milliseconds(1000)); @@ -2620,7 +2624,7 @@ void MainDialog::removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filen std::vector<Zstring> missingFiles; auto itFut = fileEx.begin(); - for (auto it = filenames.begin(); it != filenames.end(); ++it, (void)++itFut) //void: prevent ADL from dragging in boost's ,-overload: "MSVC warning C4913: user defined binary operator ',' exists but no overload could convert all operands" + for (auto it = filepaths.begin(); it != filepaths.end(); ++it, (void)++itFut) //void: prevent ADL from dragging in boost's ,-overload: "MSVC warning C4913: user defined binary operator ',' exists but no overload could convert all operands" if (itFut->is_ready() && !itFut->get()) //remove only files that are confirmed to be non-existent missingFiles.push_back(*it); @@ -2631,14 +2635,14 @@ void MainDialog::removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filen } -void MainDialog::removeCfgHistoryItems(const std::vector<Zstring>& filenames) +void MainDialog::removeCfgHistoryItems(const std::vector<Zstring>& filepaths) { - std::for_each(filenames.begin(), filenames.end(), [&](const Zstring& filename) + std::for_each(filepaths.begin(), filepaths.end(), [&](const Zstring& filepath) { const int histSize = m_listBoxHistory->GetCount(); for (int i = 0; i < histSize; ++i) if (auto histData = dynamic_cast<wxClientHistoryData*>(m_listBoxHistory->GetClientObject(i))) - if (EqualFilename()(filename, histData->cfgFile_)) + if (EqualFilename()(filepath, histData->cfgFile_)) { m_listBoxHistory->Delete(i); break; @@ -2680,7 +2684,7 @@ void MainDialog::updateUnsavedCfgStatus() { const wchar_t* EM_DASH = L" \u2014 "; title += xmlAccess::extractJobName(activeConfigFiles[0]); - std::for_each(activeConfigFiles.begin() + 1, activeConfigFiles.end(), [&](const Zstring& filename) { title += EM_DASH + xmlAccess::extractJobName(filename); }); + std::for_each(activeConfigFiles.begin() + 1, activeConfigFiles.end(), [&](const Zstring& filepath) { title += EM_DASH + xmlAccess::extractJobName(filepath); }); } else title += L"FreeFileSync - " + _("Folder Comparison and Synchronization"); @@ -2945,9 +2949,9 @@ void MainDialog::OnConfigLoad(wxCommandEvent& event) { wxArrayString tmp; filePicker.GetPaths(tmp); - std::vector<wxString> filenames(tmp.begin(), tmp.end()); + std::vector<wxString> filepaths(tmp.begin(), tmp.end()); - loadConfiguration(toZ(filenames)); + loadConfiguration(toZ(filepaths)); } } @@ -2975,23 +2979,23 @@ void MainDialog::OnLoadFromHistory(wxCommandEvent& event) wxArrayInt selections; m_listBoxHistory->GetSelections(selections); - std::vector<Zstring> filenames; + std::vector<Zstring> filepaths; std::for_each(selections.begin(), selections.end(), [&](int pos) { if (auto histData = dynamic_cast<const wxClientHistoryData*>(m_listBoxHistory->GetClientObject(pos))) - filenames.push_back(histData->cfgFile_); + filepaths.push_back(histData->cfgFile_); else assert(false); }); - if (!filenames.empty()) - loadConfiguration(filenames); + if (!filepaths.empty()) + loadConfiguration(filepaths); //user changed m_listBoxHistory selection so it's this method's responsibility to synchronize with activeConfigFiles: //- if user cancelled saving old config //- there's an error loading new config - //- filenames is empty and user tried to unselect the current config + //- filepaths is empty and user tried to unselect the current config addFileToCfgHistory(activeConfigFiles); } @@ -3001,17 +3005,17 @@ void MainDialog::OnLoadFromHistoryDoubleClick(wxCommandEvent& event) wxArrayInt selections; m_listBoxHistory->GetSelections(selections); - std::vector<Zstring> filenames; + std::vector<Zstring> filepaths; std::for_each(selections.begin(), selections.end(), [&](int pos) { if (auto histData = dynamic_cast<const wxClientHistoryData*>(m_listBoxHistory->GetClientObject(pos))) - filenames.push_back(histData->cfgFile_); + filepaths.push_back(histData->cfgFile_); else assert(false); }); - if (!filenames.empty()) - if (loadConfiguration(filenames)) + if (!filepaths.empty()) + if (loadConfiguration(filepaths)) { //simulate button click on "compare" wxCommandEvent dummy2(wxEVT_COMMAND_BUTTON_CLICKED); @@ -3024,9 +3028,9 @@ void MainDialog::OnLoadFromHistoryDoubleClick(wxCommandEvent& event) } -bool MainDialog::loadConfiguration(const std::vector<Zstring>& filenames) +bool MainDialog::loadConfiguration(const std::vector<Zstring>& filepaths) { - if (filenames.empty()) + if (filepaths.empty()) return true; if (!saveOldConfig()) @@ -3038,13 +3042,13 @@ bool MainDialog::loadConfiguration(const std::vector<Zstring>& filenames) { //allow reading batch configurations also std::wstring warningMsg; - xmlAccess::readAnyConfig(filenames, newGuiCfg, warningMsg); //throw FileError + xmlAccess::readAnyConfig(filepaths, newGuiCfg, warningMsg); //throw FileError if (!warningMsg.empty()) { showNotificationDialog(this, DialogInfoType::WARNING, PopupDialogCfg().setDetailInstructions(warningMsg)); - setConfig(newGuiCfg, filenames); - setLastUsedConfig(filenames, xmlAccess::XmlGuiConfig()); //simulate changed config due to parsing errors + setConfig(newGuiCfg, filepaths); + setLastUsedConfig(filepaths, xmlAccess::XmlGuiConfig()); //simulate changed config due to parsing errors return false; } } @@ -3054,7 +3058,7 @@ bool MainDialog::loadConfiguration(const std::vector<Zstring>& filenames) return false; } - setConfig(newGuiCfg, filenames); + setConfig(newGuiCfg, filepaths); //flashStatusInformation(("Configuration loaded")); -> irrelevant!? return true; } @@ -3153,21 +3157,21 @@ void MainDialog::onSetSyncDirection(SyncDirectionEvent& event) } -void MainDialog::setLastUsedConfig(const Zstring& filename, const xmlAccess::XmlGuiConfig& guiConfig) +void MainDialog::setLastUsedConfig(const Zstring& filepath, const xmlAccess::XmlGuiConfig& guiConfig) { - std::vector<Zstring> filenames; - filenames.push_back(filename); - setLastUsedConfig(filenames, guiConfig); + std::vector<Zstring> filepaths; + filepaths.push_back(filepath); + setLastUsedConfig(filepaths, guiConfig); } -void MainDialog::setLastUsedConfig(const std::vector<Zstring>& filenames, +void MainDialog::setLastUsedConfig(const std::vector<Zstring>& filepaths, const xmlAccess::XmlGuiConfig& guiConfig) { - activeConfigFiles = filenames; + activeConfigFiles = filepaths; lastConfigurationSaved = guiConfig; - addFileToCfgHistory(activeConfigFiles); //put filename on list of last used config files + addFileToCfgHistory(activeConfigFiles); //put filepath on list of last used config files updateUnsavedCfgStatus(); } @@ -3185,8 +3189,8 @@ void MainDialog::setConfig(const xmlAccess::XmlGuiConfig& newGuiCfg, const std:: updateGlobalFilterButton(); //set first folder pair - firstFolderPair->setValues(currentCfg.mainCfg.firstPair.dirnamePhraseLeft, - currentCfg.mainCfg.firstPair.dirnamePhraseRight, + firstFolderPair->setValues(currentCfg.mainCfg.firstPair.dirpathPhraseLeft, + currentCfg.mainCfg.firstPair.dirpathPhraseRight, currentCfg.mainCfg.firstPair.altCmpConfig, currentCfg.mainCfg.firstPair.altSyncConfig, currentCfg.mainCfg.firstPair.localFilter); @@ -3509,14 +3513,13 @@ void MainDialog::OnCompare(wxCommandEvent& event) //class handling status display and error messages CompareStatusHandler statusHandler(*this); - const std::vector<zen::FolderPairCfg> cmpConfig = zen::extractCompareCfg(getConfig().mainCfg); + const std::vector<zen::FolderPairCfg> cmpConfig = extractCompareCfg(getConfig().mainCfg, globalCfg.fileTimeTolerance); //GUI mode: place directory locks on directories isolated(!) during both comparison and synchronization std::unique_ptr<LockHolder> dirLocks; //COMPARE DIRECTORIES - compare(globalCfg.fileTimeTolerance, - globalCfg.optDialogs, + compare(globalCfg.optDialogs, true, //allow pw prompt globalCfg.runWithBackgroundPriority, globalCfg.createLockFile, @@ -3700,15 +3703,15 @@ void MainDialog::OnStartSync(wxCommandEvent& event) std::unique_ptr<LockHolder> dirLocks; if (globalCfg.createLockFile) { - std::set<Zstring, LessFilename> dirnamesExisting; + std::set<Zstring, LessFilename> dirpathsExisting; for (auto it = begin(folderCmp); it != end(folderCmp); ++it) { if (it->isExisting<LEFT_SIDE>()) //do NOT check directory existence again! - dirnamesExisting.insert(it->getBaseDirPf<LEFT_SIDE >()); + dirpathsExisting.insert(it->getBaseDirPf<LEFT_SIDE >()); if (it->isExisting<RIGHT_SIDE>()) - dirnamesExisting.insert(it->getBaseDirPf<RIGHT_SIDE>()); + dirpathsExisting.insert(it->getBaseDirPf<RIGHT_SIDE>()); } - dirLocks = make_unique<LockHolder>(dirnamesExisting, globalCfg.optDialogs.warningDirectoryLockFailed, statusHandler); + dirLocks = make_unique<LockHolder>(dirpathsExisting, globalCfg.optDialogs.warningDirectoryLockFailed, statusHandler); } //START SYNCHRONIZATION @@ -3854,8 +3857,8 @@ void MainDialog::updateGridViewData() size_t foldersOnLeftView = 0; size_t filesOnRightView = 0; size_t foldersOnRightView = 0; - zen::UInt64 filesizeLeftView; - zen::UInt64 filesizeRightView; + std::uint64_t filesizeLeftView = 0; + std::uint64_t filesizeRightView = 0; auto updateVisibility = [](ToggleButton* btn, bool shown) { @@ -4142,8 +4145,8 @@ void MainDialog::OnAddFolderPair(wxCommandEvent& event) //clear first pair const FolderPairEnh cfgEmpty; - firstFolderPair->setValues(cfgEmpty.dirnamePhraseLeft, - cfgEmpty.dirnamePhraseRight, + firstFolderPair->setValues(cfgEmpty.dirpathPhraseLeft, + cfgEmpty.dirpathPhraseRight, cfgEmpty.altCmpConfig, cfgEmpty.altSyncConfig, cfgEmpty.localFilter); @@ -4165,8 +4168,8 @@ void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) const FolderPairEnh cfgSecond = getEnhancedPair(additionalFolderPairs[0]); //reset first pair - firstFolderPair->setValues(cfgSecond.dirnamePhraseLeft, - cfgSecond.dirnamePhraseRight, + firstFolderPair->setValues(cfgSecond.dirpathPhraseLeft, + cfgSecond.dirpathPhraseRight, cfgSecond.altCmpConfig, cfgSecond.altSyncConfig, cfgSecond.localFilter); @@ -4294,8 +4297,8 @@ void MainDialog::addAddFolderPair(const std::vector<FolderPairEnh>& newPairs, bo //wxComboBox screws up miserably if width/height is smaller than the magic number 4! Problem occurs when trying to set tooltip //so we have to update window sizes before setting configuration: for (auto it = newPairs.begin(); it != newPairs.end(); ++it)//set alternate configuration - newEntries[it - newPairs.begin()]->setValues(it->dirnamePhraseLeft, - it->dirnamePhraseRight, + newEntries[it - newPairs.begin()]->setValues(it->dirpathPhraseLeft, + it->dirpathPhraseRight, it->altCmpConfig, it->altSyncConfig, it->localFilter); @@ -4355,7 +4358,7 @@ void MainDialog::OnMenuOptions(wxCommandEvent& event) void MainDialog::OnMenuExportFileList(wxCommandEvent& event) { - //get a filename + //get a filepath wxFileDialog filePicker(this, //creating this on freestore leads to memleak! wxEmptyString, wxEmptyString, @@ -4367,7 +4370,7 @@ void MainDialog::OnMenuExportFileList(wxCommandEvent& event) wxBusyCursor dummy; - const Zstring filename = utfCvrtTo<Zstring>(filePicker.GetPath()); + const Zstring filepath = utfCvrtTo<Zstring>(filePicker.GetPath()); //http://en.wikipedia.org/wiki/Comma-separated_values const lconv* localInfo = ::localeconv(); //always bound according to doc @@ -4440,7 +4443,7 @@ void MainDialog::OnMenuExportFileList(wxCommandEvent& event) try { //write file - FileOutput fileOut(filename, zen::FileOutput::ACC_OVERWRITE); //throw FileError + FileOutput fileOut(filepath, zen::FileOutput::ACC_OVERWRITE); //throw FileError replace(header, '\n', LINE_BREAK); fileOut.write(&*header.begin(), header.size()); //throw FileError diff --git a/FreeFileSync/Source/ui/main_dlg.h b/FreeFileSync/Source/ui/main_dlg.h index 6a2069e1..84a52e8b 100644 --- a/FreeFileSync/Source/ui/main_dlg.h +++ b/FreeFileSync/Source/ui/main_dlg.h @@ -11,7 +11,6 @@ #include <set> #include <stack> #include <memory> -#include <zen/int64.h> #include <zen/async_task.h> #include <wx+/file_drop.h> #include <wx/aui/aui.h> @@ -66,8 +65,8 @@ private: friend class PanelMoveWindow; //configuration load/save - void setLastUsedConfig(const Zstring& filename, const xmlAccess::XmlGuiConfig& guiConfig); - void setLastUsedConfig(const std::vector<Zstring>& filenames, const xmlAccess::XmlGuiConfig& guiConfig); + void setLastUsedConfig(const Zstring& filepath, const xmlAccess::XmlGuiConfig& guiConfig); + void setLastUsedConfig(const std::vector<Zstring>& filepaths, const xmlAccess::XmlGuiConfig& guiConfig); xmlAccess::XmlGuiConfig getConfig() const; void setConfig(const xmlAccess::XmlGuiConfig& newGuiCfg, const std::vector<Zstring>& referenceFiles); @@ -75,7 +74,7 @@ private: void setGlobalCfgOnInit(const xmlAccess::XmlGlobalSettings& globalSettings); //messes with Maximize(), window sizes, so call just once! xmlAccess::XmlGlobalSettings getGlobalCfgBeforeExit(); //destructive "get" thanks to "Iconize(false), Maximize(false)" - bool loadConfiguration(const std::vector<Zstring>& filenames); //return true if loaded successfully + bool loadConfiguration(const std::vector<Zstring>& filepaths); //return true if loaded successfully bool trySaveConfig (const Zstring* guiFilename); //return true if saved successfully bool trySaveBatchConfig(const Zstring* batchFileToUpdate); // @@ -88,9 +87,9 @@ private: void initViewFilterButtons(); void setViewFilterDefault(); - void addFileToCfgHistory(const std::vector<Zstring>& filenames); //= update/insert + apply selection - void removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filenames); - void removeCfgHistoryItems(const std::vector<Zstring>& filenames); + void addFileToCfgHistory(const std::vector<Zstring>& filepaths); //= update/insert + apply selection + void removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filepaths); + void removeCfgHistoryItems(const std::vector<Zstring>& filepaths); void addAddFolderPair(const std::vector<zen::FolderPairEnh>& newPairs, bool addFront = false); void removeAddFolderPair(size_t pos); @@ -129,7 +128,7 @@ private: //status bar supports one of the following two states at a time: void setStatusBarFullText(const wxString& msg); - void setStatusBarFileStatistics(size_t filesOnLeftView, size_t foldersOnLeftView, size_t filesOnRightView, size_t foldersOnRightView, zen::UInt64 filesizeLeftView, zen::UInt64 filesizeRightView); + void setStatusBarFileStatistics(size_t filesOnLeftView, size_t foldersOnLeftView, size_t filesOnRightView, size_t foldersOnRightView, std::uint64_t filesizeLeftView, std::uint64_t filesizeRightView); void flashStatusInformation(const wxString& msg); //temporarily show different status (only valid for setStatusBarFullText) void restoreStatusInformation(); //called automatically after a few seconds @@ -232,6 +231,8 @@ private: void hideFindPanel(); void startFindNext(); //F3 + void resetLayout(); + virtual void OnSearchGridEnter(wxCommandEvent& event) override; virtual void OnHideSearchPanel(wxCommandEvent& event) override; void OnSearchPanelKeyPressed(wxKeyEvent& event); @@ -239,6 +240,7 @@ private: //menu events virtual void OnMenuOptions (wxCommandEvent& event) override; virtual void OnMenuExportFileList(wxCommandEvent& event) override; + virtual void OnMenuResetLayout (wxCommandEvent& event) override { resetLayout(); } virtual void OnMenuFindItem (wxCommandEvent& event) override; virtual void OnMenuCheckVersion (wxCommandEvent& event) override; virtual void OnMenuCheckVersionAutomatically(wxCommandEvent& event) override; @@ -304,7 +306,8 @@ private: wxString defaultPerspective; - zen::Int64 manualTimeSpanFrom, manualTimeSpanTo; //buffer manual time span selection at session level + std::int64_t manualTimeSpanFrom; + std::int64_t manualTimeSpanTo; //buffer manual time span selection at session level std::shared_ptr<FolderHistory> folderHistoryLeft; //shared by all wxComboBox dropdown controls std::shared_ptr<FolderHistory> folderHistoryRight; //always bound! diff --git a/FreeFileSync/Source/ui/progress_indicator.cpp b/FreeFileSync/Source/ui/progress_indicator.cpp index 87f8e158..791b3bdf 100644 --- a/FreeFileSync/Source/ui/progress_indicator.cpp +++ b/FreeFileSync/Source/ui/progress_indicator.cpp @@ -257,7 +257,7 @@ void CompareProgressDialog::Pimpl::updateStatusPanelNow() auto dataTotal = syncStat_->getDataTotal (ProcessCallback::PHASE_COMPARING_CONTENT); //add both data + obj-count, to handle "deletion-only" cases - const double fraction = dataTotal + objectsTotal == 0 ? 0 : std::max(0.0, to<double>(dataCurrent + objectsCurrent) / to<double>(dataTotal + objectsTotal)); + const double fraction = dataTotal + objectsTotal == 0 ? 0 : std::max(0.0, 1.0 * (dataCurrent + objectsCurrent) / (dataTotal + objectsTotal)); //dialog caption, taskbar setTitle(fractionToString(fraction) + wxT(" - ") + _("Comparing content...")); @@ -282,11 +282,11 @@ void CompareProgressDialog::Pimpl::updateStatusPanelNow() timeLastSpeedEstimateMs = timeNowMs; if (numeric::dist(binCompStartMs, timeNowMs) >= 1000) //discard stats for first second: probably messy - perf->addSample(objectsCurrent, to<double>(dataCurrent), timeNowMs); + perf->addSample(objectsCurrent, dataCurrent, timeNowMs); //remaining time: display with relative error of 10% - based on samples taken every 0.5 sec only //-> call more often than once per second to correctly show last few seconds countdown, but don't call too often to avoid occasional jitter - Opt<double> remTimeSec = perf->getRemainingTimeSec(to<double>(dataTotal - dataCurrent)); + Opt<double> remTimeSec = perf->getRemainingTimeSec(dataTotal - dataCurrent); setText(*m_staticTextTimeRemaining, remTimeSec ? remainingTimeToString(*remTimeSec) : L"-", &layoutChanged); //current speed -> Win 7 copy uses 1 sec update interval instead @@ -998,7 +998,7 @@ struct LabelFormatterBytes : public LabelFormatter return e * numeric::nearMatch(a, std::begin(steps), std::end(steps)); } - virtual wxString formatText(double value, double optimalBlockSize) const { return filesizeToShortString(Int64(value)); }; + virtual wxString formatText(double value, double optimalBlockSize) const { return filesizeToShortString(static_cast<std::int64_t>(value)); }; }; @@ -1382,8 +1382,8 @@ void SyncProgressDialogImpl<TopLevelDialog>::notifyProgressChange() //noexcept! break; case ProcessCallback::PHASE_COMPARING_CONTENT: case ProcessCallback::PHASE_SYNCHRONIZING: - curveDataBytes->addRecord(timeElapsed.timeMs(), to<double>(syncStat_->getDataCurrent (syncStat_->currentPhase()))); - curveDataItems->addRecord(timeElapsed.timeMs(), syncStat_->getObjectsCurrent(syncStat_->currentPhase())); + curveDataBytes->addRecord(timeElapsed.timeMs(), syncStat_->getDataCurrent (syncStat_->currentPhase())); + curveDataItems->addRecord(timeElapsed.timeMs(), syncStat_->getObjectsCurrent(syncStat_->currentPhase())); break; } } @@ -1519,11 +1519,11 @@ void SyncProgressDialogImpl<TopLevelDialog>::updateGuiInt(bool allowYield) { const int itemsCurrent = syncStat_->getObjectsCurrent(syncStat_->currentPhase()); const int itemsTotal = syncStat_->getObjectsTotal (syncStat_->currentPhase()); - const Int64 dataCurrent = syncStat_->getDataCurrent (syncStat_->currentPhase()); - const Int64 dataTotal = syncStat_->getDataTotal (syncStat_->currentPhase()); + const std::int64_t dataCurrent = syncStat_->getDataCurrent (syncStat_->currentPhase()); + const std::int64_t dataTotal = syncStat_->getDataTotal (syncStat_->currentPhase()); //add both data + obj-count, to handle "deletion-only" cases - const double fraction = dataTotal + itemsTotal == 0 ? 1 : std::max(0.0, to<double>(dataCurrent + itemsCurrent) / to<double>(dataTotal + itemsTotal)); + const double fraction = dataTotal + itemsTotal == 0 ? 1 : std::max(0.0, 1.0 * (dataCurrent + itemsCurrent) / (dataTotal + itemsTotal)); //---------------------------------------------------------------------------------------------------- //dialog caption, taskbar, systray tooltip @@ -1534,17 +1534,17 @@ void SyncProgressDialogImpl<TopLevelDialog>::updateGuiInt(bool allowYield) if (taskbar_.get()) taskbar_->setProgress(fraction); //constant line graph - curveDataBytesCurrent->setValue(timeNowMs / 1000.0, to<double>(dataCurrent)); - curveDataItemsCurrent->setValue(timeNowMs / 1000.0, itemsCurrent); + curveDataBytesCurrent->setValue(timeNowMs / 1000.0, dataCurrent); + curveDataItemsCurrent->setValue(timeNowMs / 1000.0, itemsCurrent); //tentatively update total time, may be improved on below: const double timeTotalSecTentative = dataTotal == dataCurrent ? timeNowMs / 1000.0 : std::max(curveDataBytesTotal->getValueX(), timeNowMs / 1000.0); - curveDataBytesTotal->setValue(timeTotalSecTentative, to<double>(dataTotal)); - curveDataItemsTotal->setValue(timeTotalSecTentative, itemsTotal); + curveDataBytesTotal->setValue(timeTotalSecTentative, dataTotal); + curveDataItemsTotal->setValue(timeTotalSecTentative, itemsTotal); //even though notifyProgressChange() already set the latest data, let's add another sample to have all curves consider "timeNowMs" //no problem with adding too many records: CurveDataStatistics will remove duplicate entries! - curveDataBytes->addRecord(timeNowMs, to<double>(dataCurrent)); + curveDataBytes->addRecord(timeNowMs, dataCurrent); curveDataItems->addRecord(timeNowMs, itemsCurrent); //remaining objects and data @@ -1560,7 +1560,7 @@ void SyncProgressDialogImpl<TopLevelDialog>::updateGuiInt(bool allowYield) timeLastSpeedEstimateMs = timeNowMs; if (numeric::dist(phaseStartMs, timeNowMs) >= 1000) //discard stats for first second: probably messy - perf->addSample(itemsCurrent, to<double>(dataCurrent), timeNowMs); + perf->addSample(itemsCurrent, dataCurrent, timeNowMs); //current speed -> Win 7 copy uses 1 sec update interval instead Opt<std::wstring> bps = perf->getBytesPerSecond(); @@ -1570,7 +1570,7 @@ void SyncProgressDialogImpl<TopLevelDialog>::updateGuiInt(bool allowYield) //remaining time: display with relative error of 10% - based on samples taken every 0.5 sec only //-> call more often than once per second to correctly show last few seconds countdown, but don't call too often to avoid occasional jitter - Opt<double> remTimeSec = perf->getRemainingTimeSec(to<double>(dataTotal - dataCurrent)); + Opt<double> remTimeSec = perf->getRemainingTimeSec(dataTotal - dataCurrent); setText(*pnl.m_staticTextRemTime, remTimeSec ? remainingTimeToString(*remTimeSec) : L"-", &layoutChanged); //update estimated total time marker with precision of "10% remaining time" only to avoid needless jumping around: @@ -1819,8 +1819,8 @@ void SyncProgressDialogImpl<TopLevelDialog>::processHasFinished(SyncResult resul { const int itemsCurrent = syncStat_->getObjectsCurrent(syncStat_->currentPhase()); const int itemsTotal = syncStat_->getObjectsTotal (syncStat_->currentPhase()); - const Int64 dataCurrent = syncStat_->getDataCurrent (syncStat_->currentPhase()); - const Int64 dataTotal = syncStat_->getDataTotal (syncStat_->currentPhase()); + const std::int64_t dataCurrent = syncStat_->getDataCurrent (syncStat_->currentPhase()); + const std::int64_t dataTotal = syncStat_->getDataTotal (syncStat_->currentPhase()); assert(dataCurrent <= dataTotal); //set overall speed (instead of current speed) diff --git a/FreeFileSync/Source/ui/small_dlgs.cpp b/FreeFileSync/Source/ui/small_dlgs.cpp index 78baa218..6857c806 100644 --- a/FreeFileSync/Source/ui/small_dlgs.cpp +++ b/FreeFileSync/Source/ui/small_dlgs.cpp @@ -624,7 +624,7 @@ ReturnSmallDlg::ButtonPressed zen::showOptionsDlg(wxWindow* parent, xmlAccess::X class SelectTimespanDlg : public SelectTimespanDlgGenerated { public: - SelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& timeTo); + SelectTimespanDlg(wxWindow* parent, std::int64_t& timeFrom, std::int64_t& timeTo); private: virtual void OnOkay(wxCommandEvent& event); @@ -642,8 +642,8 @@ private: m_calendarFrom->SetDate(m_calendarTo->GetDate()); } - Int64& timeFrom_; - Int64& timeTo_; + std::int64_t& timeFrom_; + std::int64_t& timeTo_; }; @@ -659,7 +659,7 @@ time_t localDateTimeToUtc(const wxDateTime& localTime) } -SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& timeTo) : +SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, std::int64_t& timeFrom, std::int64_t& timeTo) : SelectTimespanDlgGenerated(parent), timeFrom_(timeFrom), timeTo_(timeTo) @@ -693,8 +693,8 @@ SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& t if (timeFrom_ == 0) timeFrom_ = timeTo_ - 7 * 24 * 3600; //default time span: one week from "now" - m_calendarFrom->SetDate(utcToLocalDateTime(to<time_t>(timeFrom_))); - m_calendarTo ->SetDate(utcToLocalDateTime(to<time_t>(timeTo_))); + m_calendarFrom->SetDate(utcToLocalDateTime(timeFrom_)); + m_calendarTo ->SetDate(utcToLocalDateTime(timeTo_)); #if wxCHECK_VERSION(2, 9, 5) //doesn't seem to be a problem here: @@ -744,7 +744,7 @@ void SelectTimespanDlg::OnOkay(wxCommandEvent& event) } -ReturnSmallDlg::ButtonPressed zen::showSelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& timeTo) +ReturnSmallDlg::ButtonPressed zen::showSelectTimespanDlg(wxWindow* parent, std::int64_t& timeFrom, std::int64_t& timeTo) { SelectTimespanDlg timeSpanDlg(parent, timeFrom, timeTo); return static_cast<ReturnSmallDlg::ButtonPressed>(timeSpanDlg.ShowModal()); diff --git a/FreeFileSync/Source/ui/small_dlgs.h b/FreeFileSync/Source/ui/small_dlgs.h index 78e7a075..7b488e57 100644 --- a/FreeFileSync/Source/ui/small_dlgs.h +++ b/FreeFileSync/Source/ui/small_dlgs.h @@ -8,7 +8,6 @@ #define SMALLDIALOGS_H_INCLUDED #include <wx/window.h> -//#include "../file_hierarchy.h" #include "../lib/process_xml.h" #include "../synchronization.h" @@ -43,7 +42,7 @@ ReturnSmallDlg::ButtonPressed showCompareCfgDialog(wxWindow* parent, CompConfig& ReturnSmallDlg::ButtonPressed showOptionsDlg(wxWindow* parent, xmlAccess::XmlGlobalSettings& globalSettings); -ReturnSmallDlg::ButtonPressed showSelectTimespanDlg(wxWindow* parent, Int64& timeFrom, Int64& timeTo); +ReturnSmallDlg::ButtonPressed showSelectTimespanDlg(wxWindow* parent, std::int64_t& timeFrom, std::int64_t& timeTo); } #endif // SMALLDIALOGS_H_INCLUDED diff --git a/FreeFileSync/Source/ui/sorting.h b/FreeFileSync/Source/ui/sorting.h index 46477d0f..1493faa4 100644 --- a/FreeFileSync/Source/ui/sorting.h +++ b/FreeFileSync/Source/ui/sorting.h @@ -4,8 +4,8 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef SORTING_H_INCLUDED -#define SORTING_H_INCLUDED +#ifndef SORTING_H_82574232452345 +#define SORTING_H_82574232452345 #include <zen/assert_static.h> #include <zen/type_tools.h> @@ -33,56 +33,65 @@ bool isDirectoryPair(const FileSystemObject& fsObj) template <bool ascending, SelectedSide side> inline bool lessShortFileName(const FileSystemObject& a, const FileSystemObject& b) { - //presort types: first files, then directories then empty rows + //sort order: first files/symlinks, then directories then empty rows + + //empty rows always last if (a.isEmpty<side>()) - return false; //empty rows always last + return false; else if (b.isEmpty<side>()) - return true; //empty rows always last - + return true; - if (isDirectoryPair(a)) //sort directories by relative name + //directories after files/symlinks: + if (isDirectoryPair(a)) { - if (isDirectoryPair(b)) - return LessFilename()(a.getRelativeName<side>(), b.getRelativeName<side>()); - else + if (!isDirectoryPair(b)) return false; } - else - { - if (isDirectoryPair(b)) - return true; - else - return makeSortDirection(LessFilename(), Int2Type<ascending>())(a.getShortName<side>(), b.getShortName<side>()); - } + else if (isDirectoryPair(b)) + return true; + + //sort directories and files/symlinks by short name + return makeSortDirection(LessFilename(), Int2Type<ascending>())(a.getItemName<side>(), b.getItemName<side>()); } +template <bool ascending, SelectedSide side> inline +bool lessFullPath(const FileSystemObject& a, const FileSystemObject& b) +{ + //empty rows always last + if (a.isEmpty<side>()) + return false; + else if (b.isEmpty<side>()) + return true; -template <bool ascending> //side currently unused! -bool lessRelativeName(const FileSystemObject& a, const FileSystemObject& b) + return makeSortDirection(LessFilename(), Int2Type<ascending>())(a.getFullPath<side>(), b.getFullPath<side>()); +} + + +template <bool ascending> inline //side currently unused! +bool lessRelativeFolder(const FileSystemObject& a, const FileSystemObject& b) { const bool isDirectoryA = isDirectoryPair(a); - const Zstring& relDirNameA = isDirectoryA ? - a.getObjRelativeName() : //directory - beforeLast(a.getObjRelativeName(), FILE_NAME_SEPARATOR); //returns empty string if ch not found + const Zstring& relFolderA = isDirectoryA ? + a.getPairRelativePath() : //directory + beforeLast(a.getPairRelativePath(), FILE_NAME_SEPARATOR); //returns empty string if ch not found const bool isDirectoryB = isDirectoryPair(b); - const Zstring& relDirNameB = isDirectoryB ? - b.getObjRelativeName() : //directory - beforeLast(b.getObjRelativeName(), FILE_NAME_SEPARATOR); //returns empty string if ch not found + const Zstring& relFolderB = isDirectoryB ? + b.getPairRelativePath() : //directory + beforeLast(b.getPairRelativePath(), FILE_NAME_SEPARATOR); //returns empty string if ch not found - //compare relative names without filenames first - const int rv = cmpFileName(relDirNameA, relDirNameB); + //compare relative names without filepaths first + const int rv = cmpFileName(relFolderA, relFolderB); if (rv != 0) return makeSortDirection(std::less<int>(), Int2Type<ascending>())(rv, 0); - else //compare the filenames - { - if (isDirectoryB) //directories shall appear before files - return false; - else if (isDirectoryA) - return true; - return LessFilename()(a.getObjShortName(), b.getObjShortName()); - } + //compare the filepaths + if (isDirectoryB) //directories shall appear before files + return false; + else if (isDirectoryA) + return true; + + return LessFilename()(a.getPairShortName(), b.getPairShortName()); } @@ -95,13 +104,10 @@ bool lessFilesize(const FileSystemObject& a, const FileSystemObject& b) else if (b.isEmpty<side>()) return true; - const bool isDirA = dynamic_cast<const DirPair*>(&a) != nullptr; - const bool isDirB = dynamic_cast<const DirPair*>(&b) != nullptr; - //directories second last - if (isDirA) + if (isDirectoryPair(a)) return false; - else if (isDirB) + else if (isDirectoryPair(b)) return true; const FilePair* fileObjA = dynamic_cast<const FilePair*>(&a); @@ -114,7 +120,7 @@ bool lessFilesize(const FileSystemObject& a, const FileSystemObject& b) return true; //return list beginning with largest files first - return makeSortDirection(std::less<UInt64>(), Int2Type<ascending>())(fileObjA->getFileSize<side>(), fileObjB->getFileSize<side>()); + return makeSortDirection(std::less<std::uint64_t>(), Int2Type<ascending>())(fileObjA->getFileSize<side>(), fileObjB->getFileSize<side>()); } @@ -126,7 +132,6 @@ bool lessFiletime(const FileSystemObject& a, const FileSystemObject& b) else if (b.isEmpty<side>()) return true; //empty rows always last - const FilePair* fileObjA = dynamic_cast<const FilePair*>(&a); const FilePair* fileObjB = dynamic_cast<const FilePair*>(&b); @@ -138,11 +143,11 @@ bool lessFiletime(const FileSystemObject& a, const FileSystemObject& b) else if (!fileObjB && !linkObjB) return true; //directories last - zen::Int64 dateA = fileObjA ? fileObjA->getLastWriteTime<side>() : linkObjA->getLastWriteTime<side>(); - zen::Int64 dateB = fileObjB ? fileObjB->getLastWriteTime<side>() : linkObjB->getLastWriteTime<side>(); + const std::int64_t dateA = fileObjA ? fileObjA->getLastWriteTime<side>() : linkObjA->getLastWriteTime<side>(); + const std::int64_t dateB = fileObjB ? fileObjB->getLastWriteTime<side>() : linkObjB->getLastWriteTime<side>(); //return list beginning with newest files first - return makeSortDirection(std::less<Int64>(), Int2Type<ascending>())(dateA, dateB); + return makeSortDirection(std::less<std::int64_t>(), Int2Type<ascending>())(dateA, dateB); } @@ -161,9 +166,9 @@ bool lessExtension(const FileSystemObject& a, const FileSystemObject& b) auto getExtension = [&](const FileSystemObject& fsObj) -> Zstring { - const Zstring& shortName = fsObj.getShortName<side>(); + const Zstring& shortName = fsObj.getItemName<side>(); const size_t pos = shortName.rfind(Zchar('.')); - return pos == Zstring::npos ? Zstring() : Zstring(shortName.c_str() + pos + 1); + return pos == Zstring::npos ? Zstring() : Zstring(shortName.begin() + pos + 1, shortName.end()); }; return makeSortDirection(LessFilename(), Int2Type<ascending>())(getExtension(a), getExtension(b)); @@ -190,4 +195,4 @@ bool lessSyncDirection(const FileSystemObject& a, const FileSystemObject& b) } } -#endif // SORTING_H_INCLUDED +#endif //SORTING_H_82574232452345 diff --git a/FreeFileSync/Source/ui/sync_cfg.cpp b/FreeFileSync/Source/ui/sync_cfg.cpp index f6e3c41d..a2711e0c 100644 --- a/FreeFileSync/Source/ui/sync_cfg.cpp +++ b/FreeFileSync/Source/ui/sync_cfg.cpp @@ -65,13 +65,15 @@ private: }; //------------- comparison panel ---------------------- - virtual void OnHelpComparisonSettings(wxHyperlinkEvent& event) override { displayHelpEntry(L"html/Comparison Settings.html", this); } + virtual void OnHelpComparisonSettings(wxHyperlinkEvent& event) override { displayHelpEntry(L"html/Comparison Settings.html" , this); } + virtual void OnHelpTimeShift (wxHyperlinkEvent& event) override { displayHelpEntry(L"html/Daylight Saving Time.html", this); } virtual void OnToggleLocalCompSettings(wxCommandEvent& event) override { updateCompGui(); updateSyncGui(); /*affects sync settings, too!*/ } virtual void OnTimeSize(wxCommandEvent& event) override { localCmpVar = CMP_BY_TIME_SIZE; updateCompGui(); updateSyncGui(); /*affects sync settings, too!*/ } virtual void OnContent (wxCommandEvent& event) override { localCmpVar = CMP_BY_CONTENT; updateCompGui(); updateSyncGui(); /*affects sync settings, too!*/ } virtual void OnTimeSizeDouble(wxMouseEvent& event) override; virtual void OnContentDouble (wxMouseEvent& event) override; + virtual void OnChangeCompOption(wxCommandEvent& event) override { updateCompGui(); } void updateCompGui(); @@ -250,6 +252,9 @@ ConfigDialog::ConfigDialog(wxWindow* parent, setEnumVal(enumDescrHandleSyml, *m_choiceHandleSymlinks, cmpCfg.handleSymlinks); + m_checkBoxTimeShift->SetValue(cmpCfg.optTimeShiftHours != 0); + m_spinCtrlTimeShift->SetValue(cmpCfg.optTimeShiftHours == 0 ? 1 : cmpCfg.optTimeShiftHours); + if (useAlternateCmpCfg) m_checkBoxUseLocalCmpOptions->SetValue(*useAlternateCmpCfg); else @@ -434,6 +439,8 @@ void ConfigDialog::updateCompGui() //active variant description: setText(*m_textCtrlCompVarDescription, L"\n" + getCompVariantDescription(localCmpVar)); + + m_spinCtrlTimeShift->Enable(m_checkBoxTimeShift->GetValue()); } @@ -704,7 +711,7 @@ void ConfigDialog::setSyncOptions(const SyncOptions& so) directionCfg = so.syncCfg.directionCfg; //make working copy; ownership *not* on GUI handleDeletion = so.syncCfg.handleDeletion; - versioningFolder.setName(utfCvrtTo<wxString>(so.syncCfg.versioningDirectory)); + versioningFolder.setPath(utfCvrtTo<wxString>(so.syncCfg.versioningDirectory)); setEnumVal(enumVersioningStyle, *m_choiceVersioningStyle, so.syncCfg.versioningStyle); //misc config @@ -721,7 +728,7 @@ ConfigDialog::SyncOptions ConfigDialog::getSyncOptions() const output.syncCfg.directionCfg = directionCfg; output.syncCfg.handleDeletion = handleDeletion; - output.syncCfg.versioningDirectory = utfCvrtTo<Zstring>(versioningFolder.getName()); + output.syncCfg.versioningDirectory = utfCvrtTo<Zstring>(versioningFolder.getPath()); output.syncCfg.versioningStyle = getEnumVal(enumVersioningStyle, *m_choiceVersioningStyle); output.onGuiError = onGuiError; @@ -909,6 +916,7 @@ void ConfigDialog::OnOkay(wxCommandEvent& event) cmpCfgOut.compareVar = localCmpVar; cmpCfgOut.handleSymlinks = getEnumVal(enumDescrHandleSyml, *m_choiceHandleSymlinks); + cmpCfgOut.optTimeShiftHours = m_checkBoxTimeShift->GetValue() ? m_spinCtrlTimeShift->GetValue() : 0; //------------- filter panel -------------------------- FilterConfig filterCfg = getFilter(); diff --git a/FreeFileSync/Source/ui/tray_icon.h b/FreeFileSync/Source/ui/tray_icon.h index 24c97eb0..c83641a7 100644 --- a/FreeFileSync/Source/ui/tray_icon.h +++ b/FreeFileSync/Source/ui/tray_icon.h @@ -31,8 +31,8 @@ public: void setProgress(double fraction); //number between [0, 1], for small progress indicator private: - FfsTrayIcon(const FfsTrayIcon&); //=delete - FfsTrayIcon& operator=(const FfsTrayIcon&); //=delete + FfsTrayIcon (const FfsTrayIcon&) = delete; + FfsTrayIcon& operator=(const FfsTrayIcon&) = delete; class TaskBarImpl; TaskBarImpl* trayIcon; diff --git a/FreeFileSync/Source/ui/tree_view.cpp b/FreeFileSync/Source/ui/tree_view.cpp index 1dc1b767..9768c01a 100644 --- a/FreeFileSync/Source/ui/tree_view.cpp +++ b/FreeFileSync/Source/ui/tree_view.cpp @@ -40,19 +40,22 @@ void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in TreeView::Container& cont, //out Function pred) { - auto getBytes = [](const FilePair& fileObj) -> UInt64 //MSVC screws up miserably if we put this lambda into std::for_each + auto getBytes = [](const FilePair& fileObj) //MSVC screws up miserably if we put this lambda into std::for_each { - //give accumulated bytes the semantics of a sync preview! - if (fileObj.isActive()) - switch (fileObj.getSyncDir()) - { - case SyncDirection::LEFT: - return fileObj.getFileSize<RIGHT_SIDE>(); - case SyncDirection::RIGHT: - return fileObj.getFileSize<LEFT_SIDE>(); - case SyncDirection::NONE: - break; - } + ////give accumulated bytes the semantics of a sync preview! + //if (fileObj.isActive()) + // switch (fileObj.getSyncDir()) + // { + // case SyncDirection::LEFT: + // return fileObj.getFileSize<RIGHT_SIDE>(); + // case SyncDirection::RIGHT: + // return fileObj.getFileSize<LEFT_SIDE>(); + // case SyncDirection::NONE: + // break; + // } + + //prefer file-browser semantics over sync preview (=> always show useful numbers, even for SyncDirection::NONE) + //discussion: https://sourceforge.net/p/freefilesync/discussion/open-discussion/thread/ba6b6a33 return std::max(fileObj.getFileSize<LEFT_SIDE>(), fileObj.getFileSize<RIGHT_SIDE>()); }; @@ -86,20 +89,20 @@ void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in const bool included = pred(subDirObj); cont.subDirs.push_back(TreeView::DirNodeImpl()); // - auto& subDirView = cont.subDirs.back(); - TreeView::extractVisibleSubtree(subDirObj, subDirView, pred); + auto& subDirCont = cont.subDirs.back(); + TreeView::extractVisibleSubtree(subDirObj, subDirCont, pred); if (included) - ++subDirView.itemCountGross; + ++subDirCont.itemCountGross; - cont.bytesGross += subDirView.bytesGross; - cont.itemCountGross += subDirView.itemCountGross; + cont.bytesGross += subDirCont.bytesGross; + cont.itemCountGross += subDirCont.itemCountGross; - if (!included && !subDirView.firstFileId && subDirView.subDirs.empty()) + if (!included && !subDirCont.firstFileId && subDirCont.subDirs.empty()) cont.subDirs.pop_back(); else { - subDirView.objId = subDirObj.getId(); - compressNode(subDirView); + subDirCont.objId = subDirObj.getId(); + compressNode(subDirCont); } } } @@ -108,22 +111,22 @@ void TreeView::extractVisibleSubtree(HierarchyObject& hierObj, //in namespace { //generate nice percentage numbers which precisely sum up to 100 -void calcPercentage(std::vector<std::pair<UInt64, int*>>& workList) +void calcPercentage(std::vector<std::pair<std::uint64_t, int*>>& workList) { - const UInt64 total = std::accumulate(workList.begin(), workList.end(), UInt64(), - [](UInt64 sum, const std::pair<UInt64, int*>& pair) { return sum + pair.first; }); + const std::uint64_t total = std::accumulate(workList.begin(), workList.end(), std::uint64_t(), + [](std::uint64_t sum, const std::pair<std::uint64_t, int*>& pair) { return sum + pair.first; }); if (total == 0U) //this case doesn't work with the error minimizing algorithm below { - for (std::pair<UInt64, int*>& pair : workList) + for (auto& pair : workList) *pair.second = 0; return; } int remainingPercent = 100; - for (std::pair<UInt64, int*>& pair : workList) + for (auto& pair : workList) { - *pair.second = to<int>(pair.first * 100U / total); //round down + *pair.second = static_cast<int>(pair.first * 100U / total); //round down remainingPercent -= *pair.second; } assert(remainingPercent >= 0); @@ -134,12 +137,12 @@ void calcPercentage(std::vector<std::pair<UInt64, int*>>& workList) if (remainingPercent > 0) { std::nth_element(workList.begin(), workList.begin() + remainingPercent - 1, workList.end(), - [total](const std::pair<UInt64, int*>& lhs, const std::pair<UInt64, int*>& rhs) + [total](const std::pair<std::uint64_t, int*>& lhs, const std::pair<std::uint64_t, int*>& rhs) { return lhs.first * 100U % total > rhs.first * 100U % total; }); - std::for_each(workList.begin(), workList.begin() + remainingPercent, [&](std::pair<UInt64, int*>& pair) { ++*pair.second; }); + std::for_each(workList.begin(), workList.begin() + remainingPercent, [&](std::pair<std::uint64_t, int*>& pair) { ++*pair.second; }); } } @@ -235,7 +238,7 @@ struct TreeView::LessShortName else if (!dirObjR) return true; - return makeSortDirection(LessFilename(), Int2Type<ascending>())(dirObjL->getObjShortName(), dirObjR->getObjShortName()); + return makeSortDirection(LessFilename(), Int2Type<ascending>())(dirObjL->getPairShortName(), dirObjR->getPairShortName()); } case TreeView::TYPE_FILES: @@ -250,7 +253,7 @@ struct TreeView::LessShortName template <bool ascending> void TreeView::sortSingleLevel(std::vector<TreeLine>& items, ColumnTypeNavi columnType) { - auto getBytes = [](const TreeLine& line) -> UInt64 + auto getBytes = [](const TreeLine& line) -> std::uint64_t { switch (line.type_) { @@ -303,7 +306,7 @@ void TreeView::getChildren(const Container& cont, unsigned int level, std::vecto { output.clear(); output.reserve(cont.subDirs.size() + 1); //keep pointers in "workList" valid - std::vector<std::pair<UInt64, int*>> workList; + std::vector<std::pair<std::uint64_t, int*>> workList; for (const DirNodeImpl& subDir : cont.subDirs) { @@ -373,7 +376,7 @@ void TreeView::applySubView(std::vector<RootNodeImpl>&& newView) //this were only possible if we replaced "std::vector<RootNodeImpl>" with "Container"! flatTree.reserve(folderCmpView.size()); //keep pointers in "workList" valid - std::vector<std::pair<UInt64, int*>> workList; + std::vector<std::pair<std::uint64_t, int*>> workList; for (const RootNodeImpl& root : folderCmpView) { @@ -808,13 +811,13 @@ private: switch (static_cast<ColumnTypeNavi>(colType)) { case COL_TYPE_NAVI_BYTES: - return filesizeToShortString(to<Int64>(node->bytes_)); + return filesizeToShortString(node->bytes_); case COL_TYPE_NAVI_DIRECTORY: if (const TreeView::RootNode* root = dynamic_cast<const TreeView::RootNode*>(node.get())) return utfCvrtTo<wxString>(root->displayName_); else if (const TreeView::DirNode* dir = dynamic_cast<const TreeView::DirNode*>(node.get())) - return utfCvrtTo<wxString>(dir->dirObj_.getObjShortName()); + return utfCvrtTo<wxString>(dir->dirObj_.getPairShortName()); else if (dynamic_cast<const TreeView::FilesNode*>(node.get())) return _("Files"); break; diff --git a/FreeFileSync/Source/ui/tree_view.h b/FreeFileSync/Source/ui/tree_view.h index c9152c89..db5edbb8 100644 --- a/FreeFileSync/Source/ui/tree_view.h +++ b/FreeFileSync/Source/ui/tree_view.h @@ -57,20 +57,20 @@ public: //--------------------------------------------------------------------- struct Node { - Node(int percent, UInt64 bytes, int itemCount, unsigned int level, NodeStatus status) : + Node(int percent, std::uint64_t bytes, int itemCount, unsigned int level, NodeStatus status) : percent_(percent), level_(level), status_(status), bytes_(bytes), itemCount_(itemCount) {} virtual ~Node() {} const int percent_; //[0, 100] const unsigned int level_; const NodeStatus status_; - const UInt64 bytes_; + const std::uint64_t bytes_; const int itemCount_; }; struct FilesNode : public Node { - FilesNode(int percent, UInt64 bytes, int itemCount, unsigned int level, const std::vector<FileSystemObject*>& filesAndLinks) : + FilesNode(int percent, std::uint64_t bytes, int itemCount, unsigned int level, const std::vector<FileSystemObject*>& filesAndLinks) : Node(percent, bytes, itemCount, level, STATUS_EMPTY), filesAndLinks_(filesAndLinks) {} std::vector<FileSystemObject*> filesAndLinks_; //files and symlinks matching view filter; pointers are bound! @@ -78,13 +78,13 @@ public: struct DirNode : public Node { - DirNode(int percent, UInt64 bytes, int itemCount, unsigned int level, NodeStatus status, DirPair& dirObj) : Node(percent, bytes, itemCount, level, status), dirObj_(dirObj) {} + DirNode(int percent, std::uint64_t bytes, int itemCount, unsigned int level, NodeStatus status, DirPair& dirObj) : Node(percent, bytes, itemCount, level, status), dirObj_(dirObj) {} DirPair& dirObj_; }; struct RootNode : public Node { - RootNode(int percent, UInt64 bytes, int itemCount, NodeStatus status, BaseDirPair& baseDirObj, const Zstring displayName) : + RootNode(int percent, std::uint64_t bytes, int itemCount, NodeStatus status, BaseDirPair& baseDirObj, const Zstring displayName) : Node(percent, bytes, itemCount, 0, status), baseDirObj_(baseDirObj), displayName_(displayName) {} BaseDirPair& baseDirObj_; @@ -108,9 +108,15 @@ private: struct Container { - Container() : itemCountGross(), itemCountNet(), firstFileId(nullptr) {} - UInt64 bytesGross; - UInt64 bytesNet; //bytes for files on view in this directory only + Container() : + bytesGross(), + bytesNet(), + itemCountGross(), + itemCountNet(), + firstFileId(nullptr) {} + + std::uint64_t bytesGross; + std::uint64_t bytesNet; //bytes for files on view in this directory only int itemCountGross; int itemCountNet; //number of files on view for in this directory only diff --git a/FreeFileSync/Source/version/version.h b/FreeFileSync/Source/version/version.h index ceed62b3..db8931f9 100644 --- a/FreeFileSync/Source/version/version.h +++ b/FreeFileSync/Source/version/version.h @@ -3,7 +3,7 @@ namespace zen { -const wchar_t currentVersion[] = L"6.7"; //internal linkage! +const wchar_t currentVersion[] = L"6.8"; //internal linkage! } #endif diff --git a/wx+/file_drop.h b/wx+/file_drop.h index 5a28096d..47019a04 100644 --- a/wx+/file_drop.h +++ b/wx+/file_drop.h @@ -87,11 +87,11 @@ public: private: virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& fileArray) { - std::vector<wxString> filenames(fileArray.begin(), fileArray.end()); - if (!filenames.empty()) + std::vector<wxString> filepaths(fileArray.begin(), fileArray.end()); + if (!filepaths.empty()) //create a custom event on drop window: execute event after file dropping is completed! (after mouse is released) if (wxEvtHandler* handler = dropWindow_.GetEventHandler()) - handler->AddPendingEvent(FileDropEvent(filenames, dropWindow_, wxPoint(x, y))); + handler->AddPendingEvent(FileDropEvent(filepaths, dropWindow_, wxPoint(x, y))); return true; } diff --git a/wx+/graph.cpp b/wx+/graph.cpp index 1a8f4376..22358922 100644 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -10,7 +10,6 @@ #include <numeric> #include <zen/basic_math.h> #include <zen/scope_guard.h> -//#include <wx/settings.h> #include "dc.h" using namespace zen; @@ -224,6 +223,7 @@ void cutPoints(std::vector<CurvePoint>& curvePoints, std::vector<char>& oobMarke { assert(curvePoints.size() == oobMarker.size()); if (curvePoints.size() != oobMarker.size() || curvePoints.empty()) return; + auto isMarkedOob = [&](size_t index) { return oobMarker[index] != 0; }; //test if point is start of a OOB line std::vector<CurvePoint> curvePointsTmp; diff --git a/wx+/image_resources.cpp b/wx+/image_resources.cpp index 09a34de0..3c471e2c 100644 --- a/wx+/image_resources.cpp +++ b/wx+/image_resources.cpp @@ -46,26 +46,26 @@ public: return inst; } - void init(const Zstring& filename); + void init(const Zstring& filepath); const wxBitmap& getImage(const wxString& name) const; const wxAnimation& getAnimation(const wxString& name) const; private: GlobalResources() {} - GlobalResources(const GlobalResources&); - GlobalResources& operator=(const GlobalResources&); + GlobalResources (const GlobalResources&) = delete; + GlobalResources& operator=(const GlobalResources&) = delete; std::map<wxString, wxBitmap> bitmaps; std::map<wxString, wxAnimation> anims; }; -void GlobalResources::init(const Zstring& filename) +void GlobalResources::init(const Zstring& filepath) { assert(bitmaps.empty() && anims.empty()); - wxFFileInputStream input(utfCvrtTo<wxString>(filename)); + wxFFileInputStream input(utfCvrtTo<wxString>(filepath)); if (input.IsOk()) //if not... we don't want to react too harsh here { //activate support for .png files @@ -115,7 +115,7 @@ const wxAnimation& GlobalResources::getAnimation(const wxString& name) const } -void zen::initResourceImages(const Zstring& filename) { GlobalResources::instance().init(filename); } +void zen::initResourceImages(const Zstring& filepath) { GlobalResources::instance().init(filepath); } const wxBitmap& zen::getResourceImage(const wxString& name) { return GlobalResources::instance().getImage(name); } diff --git a/wx+/image_resources.h b/wx+/image_resources.h index 61e0b61c..b16544ac 100644 --- a/wx+/image_resources.h +++ b/wx+/image_resources.h @@ -13,7 +13,7 @@ namespace zen { -void initResourceImages(const Zstring& filename); //pass resources .zip file at application startup +void initResourceImages(const Zstring& filepath); //pass resources .zip file at application startup const wxBitmap& getResourceImage (const wxString& name); const wxAnimation& getResourceAnimation(const wxString& name); diff --git a/wx+/popup_dlg_generated.cpp b/wx+/popup_dlg_generated.cpp index f823ed5e..a0a4cd5d 100644 --- a/wx+/popup_dlg_generated.cpp +++ b/wx+/popup_dlg_generated.cpp @@ -52,18 +52,18 @@ PopupDialogGenerated::PopupDialogGenerated( wxWindow* parent, wxWindowID id, con bSizer25 = new wxBoxSizer( wxVERTICAL ); m_checkBoxCustom = new wxCheckBox( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer25->Add( m_checkBoxCustom, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer25->Add( m_checkBoxCustom, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); m_buttonAffirmative = new wxButton( this, wxID_YES, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonAffirmative, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizerStdButtons->Add( m_buttonAffirmative, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); m_buttonNegative = new wxButton( this, wxID_NO, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonNegative, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bSizerStdButtons->Add( m_buttonNegative, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); m_buttonCancel = new wxButton( this, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + bSizerStdButtons->Add( m_buttonCancel, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); bSizer25->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); diff --git a/zen/async_task.h b/zen/async_task.h index c5e5857a..f9bea890 100644 --- a/zen/async_task.h +++ b/zen/async_task.h @@ -9,8 +9,8 @@ #include <list> #include <functional> -#include <zen/thread.h> -#include <zen/scope_guard.h> +#include "thread.h" +#include "scope_guard.h" //#include "type_tools.h" namespace zen diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp index 258a1c35..3751e5dd 100644 --- a/zen/dir_watcher.cpp +++ b/zen/dir_watcher.cpp @@ -22,7 +22,7 @@ #elif defined ZEN_MAC #include <CoreServices/CoreServices.h> -#include <zen/osx_string.h> +#include "osx_string.h" #endif using namespace zen; @@ -35,7 +35,7 @@ class SharedData { public: //context of worker thread - void addChanges(const char* buffer, DWORD bytesWritten, const Zstring& dirname) //throw () + void addChanges(const char* buffer, DWORD bytesWritten, const Zstring& dirpath) //throw () { boost::lock_guard<boost::mutex> dummy(lockAccess); @@ -48,7 +48,7 @@ public: { const FILE_NOTIFY_INFORMATION& notifyInfo = reinterpret_cast<const FILE_NOTIFY_INFORMATION&>(*bufPos); - const Zstring fullname = dirname + Zstring(notifyInfo.FileName, notifyInfo.FileNameLength / sizeof(WCHAR)); + const Zstring fullpath = dirpath + Zstring(notifyInfo.FileName, notifyInfo.FileNameLength / sizeof(WCHAR)); [&] { @@ -57,7 +57,7 @@ public: if (notifyInfo.Action == FILE_ACTION_MODIFIED) { //note: this check will not work if top watched directory has been renamed - const DWORD ret = ::GetFileAttributes(applyLongPathPrefix(fullname).c_str()); + const DWORD ret = ::GetFileAttributes(applyLongPathPrefix(fullpath).c_str()); if (ret != INVALID_FILE_ATTRIBUTES && (ret & FILE_ATTRIBUTE_DIRECTORY)) //returns true for (dir-)symlinks also return; } @@ -67,14 +67,14 @@ public: { case FILE_ACTION_ADDED: case FILE_ACTION_RENAMED_NEW_NAME: //harmonize with "move" which is notified as "create + delete" - changedFiles.push_back(DirWatcher::Entry(DirWatcher::ACTION_CREATE, fullname)); + changedFiles.push_back(DirWatcher::Entry(DirWatcher::ACTION_CREATE, fullpath)); break; case FILE_ACTION_REMOVED: case FILE_ACTION_RENAMED_OLD_NAME: - changedFiles.push_back(DirWatcher::Entry(DirWatcher::ACTION_DELETE, fullname)); + changedFiles.push_back(DirWatcher::Entry(DirWatcher::ACTION_DELETE, fullpath)); break; case FILE_ACTION_MODIFIED: - changedFiles.push_back(DirWatcher::Entry(DirWatcher::ACTION_UPDATE, fullname)); + changedFiles.push_back(DirWatcher::Entry(DirWatcher::ACTION_UPDATE, fullpath)); break; } }(); @@ -87,10 +87,10 @@ public: } ////context of main thread - //void addChange(const Zstring& dirname) //throw () + //void addChange(const Zstring& dirpath) //throw () //{ // boost::lock_guard<boost::mutex> dummy(lockAccess); - // changedFiles.insert(dirname); + // changedFiles.insert(dirpath); //} @@ -144,10 +144,10 @@ public: ReadChangesAsync(const Zstring& directory, //make sure to not leak-in thread-unsafe types! const std::shared_ptr<SharedData>& shared) : shared_(shared), - dirnamePf(appendSeparator(directory)), + dirpathPf(appendSeparator(directory)), hDir(INVALID_HANDLE_VALUE) { - hDir = ::CreateFile(applyLongPathPrefix(dirnamePf).c_str(), //_In_ LPCTSTR lpFileName, + hDir = ::CreateFile(applyLongPathPrefix(dirpathPf).c_str(), //_In_ LPCTSTR lpFileName, FILE_LIST_DIRECTORY, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, nullptr, //_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, @@ -165,7 +165,7 @@ public: hDir(INVALID_HANDLE_VALUE) { shared_ = std::move(other.shared_); - dirnamePf = std::move(other.dirnamePf); + dirpathPf = std::move(other.dirpathPf); std::swap(hDir, other.hDir); } @@ -194,7 +194,7 @@ public: if (overlapped.hEvent == nullptr) { const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! - return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirnamePf)), formatSystemError(L"CreateEvent", lastError), lastError); + return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirpathPf)), formatSystemError(L"CreateEvent", lastError), lastError); } ZEN_ON_SCOPE_EXIT(::CloseHandle(overlapped.hEvent)); @@ -214,7 +214,7 @@ public: nullptr)) // __in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine { const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! - return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirnamePf)), formatSystemError(L"ReadDirectoryChangesW", lastError), lastError); + return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirpathPf)), formatSystemError(L"ReadDirectoryChangesW", lastError), lastError); } //async I/O is a resource that needs to be guarded since it will write to local variable "buffer"! @@ -238,7 +238,7 @@ public: { const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! if (lastError != ERROR_IO_INCOMPLETE) - return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirnamePf)), formatSystemError(L"GetOverlappedResult", lastError), lastError); + return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(dirpathPf)), formatSystemError(L"GetOverlappedResult", lastError), lastError); //execute asynchronous procedure calls (APC) queued on this thread ::SleepEx(50, // __in DWORD dwMilliseconds, @@ -248,7 +248,7 @@ public: } guardAio.dismiss(); - shared_->addChanges(&buffer[0], bytesWritten, dirnamePf); //throw () + shared_->addChanges(&buffer[0], bytesWritten, dirpathPf); //throw () } } catch (boost::thread_interrupted&) @@ -260,13 +260,13 @@ public: HANDLE getDirHandle() const { return hDir; } //for reading/monitoring purposes only, don't abuse (e.g. close handle)! private: - ReadChangesAsync(const ReadChangesAsync&); - ReadChangesAsync& operator=(const ReadChangesAsync&); + ReadChangesAsync (const ReadChangesAsync&) = delete; + ReadChangesAsync& operator=(const ReadChangesAsync&) = delete; //shared between main and worker: std::shared_ptr<SharedData> shared_; //worker thread only: - Zstring dirnamePf; //thread safe! + Zstring dirpathPf; //thread safe! HANDLE hDir; }; @@ -314,7 +314,7 @@ struct DirWatcher::Pimpl boost::thread worker; std::shared_ptr<SharedData> shared; - Zstring dirname; + Zstring dirpath; std::unique_ptr<HandleVolumeRemoval> volRemoval; }; @@ -323,7 +323,7 @@ DirWatcher::DirWatcher(const Zstring& directory) : //throw FileError pimpl_(new Pimpl) { pimpl_->shared = std::make_shared<SharedData>(); - pimpl_->dirname = directory; + pimpl_->dirpath = directory; ReadChangesAsync reader(directory, pimpl_->shared); //throw FileError pimpl_->volRemoval.reset(new HandleVolumeRemoval(reader.getDirHandle(), pimpl_->worker)); //throw FileError @@ -360,7 +360,7 @@ std::vector<DirWatcher::Entry> DirWatcher::getChanges(const std::function<void() boost::thread::sleep(boost::get_system_time() + boost::posix_time::milliseconds(50)); } - output.push_back(Entry(ACTION_DELETE, pimpl_->dirname)); //report removal as change to main directory + output.push_back(Entry(ACTION_DELETE, pimpl_->dirpath)); //report removal as change to main directory } else //the normal case... pimpl_->shared->fetchChanges(output); //throw FileError @@ -376,11 +376,11 @@ class DirsOnlyTraverser : public zen::TraverseCallback public: DirsOnlyTraverser(std::vector<Zstring>& dirs) : dirs_(dirs) {} - virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details) {} - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) { return LINK_SKIP; } - virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& fullName) + virtual void onFile (const Zchar* shortName, const Zstring& filepath, const FileInfo& details) {} + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { return LINK_SKIP; } + virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& dirpath) { - dirs_.push_back(fullName); + dirs_.push_back(dirpath); return this; } virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber) { throw FileError(msg); } @@ -396,7 +396,7 @@ struct DirWatcher::Pimpl { Pimpl() : notifDescr() {} - Zstring baseDirname; + Zstring basedirpath; int notifDescr; std::map<int, Zstring> watchDescrs; //watch descriptor and (sub-)directory name (postfixed with separator) -> owned by "notifDescr" }; @@ -406,18 +406,18 @@ DirWatcher::DirWatcher(const Zstring& directory) : //throw FileError pimpl_(new Pimpl) { //get all subdirectories - Zstring dirname = directory; - if (endsWith(dirname, FILE_NAME_SEPARATOR)) - dirname.resize(dirname.size() - 1); + Zstring dirpathFmt = directory; + if (endsWith(dirpathFmt, FILE_NAME_SEPARATOR)) + dirpathFmt.resize(dirpathFmt.size() - 1); - std::vector<Zstring> fullDirList { dirname }; + std::vector<Zstring> fullDirList { dirpathFmt }; { DirsOnlyTraverser traverser(fullDirList); //throw FileError - zen::traverseFolder(dirname, traverser); //don't traverse into symlinks (analog to windows build) + zen::traverseFolder(dirpathFmt, traverser); //don't traverse into symlinks (analog to windows build) } //init - pimpl_->baseDirname = directory; + pimpl_->basedirpath = directory; pimpl_->notifDescr = ::inotify_init(); if (pimpl_->notifDescr == -1) throwFileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(directory)), L"inotify_init", getLastError()); @@ -481,7 +481,7 @@ std::vector<DirWatcher::Entry> DirWatcher::getChanges(const std::function<void() if (errno == EAGAIN) //this error is ignored in all inotify wrappers I found return std::vector<Entry>(); - throwFileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(pimpl_->baseDirname)), L"read", getLastError()); + throwFileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(pimpl_->basedirpath)), L"read", getLastError()); } std::vector<Entry> output; @@ -573,18 +573,18 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& directory) : pimpl_(new Pimpl) { - CFStringRef dirnameCf = osx::createCFString(directory.c_str()); //returns nullptr on error - if (!dirnameCf) + CFStringRef dirpathCf = osx::createCFString(directory.c_str()); //returns nullptr on error + if (!dirpathCf) throw FileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(directory)), L"Function call failed: createCFString"); //no error code documented! - ZEN_ON_SCOPE_EXIT(::CFRelease(dirnameCf)); + ZEN_ON_SCOPE_EXIT(::CFRelease(dirpathCf)); - CFArrayRef dirnameCfArray = ::CFArrayCreate(nullptr, //CFAllocatorRef allocator, - reinterpret_cast<const void**>(&dirnameCf), //const void** values, + CFArrayRef dirpathCfArray = ::CFArrayCreate(nullptr, //CFAllocatorRef allocator, + reinterpret_cast<const void**>(&dirpathCf), //const void** values, 1, //CFIndex numValues, nullptr); //const CFArrayCallBacks* callBacks - if (!dirnameCfArray) + if (!dirpathCfArray) throw FileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtFileName(directory)), L"Function call failed: CFArrayCreate"); //no error code documented! - ZEN_ON_SCOPE_EXIT(::CFRelease(dirnameCfArray)); + ZEN_ON_SCOPE_EXIT(::CFRelease(dirpathCfArray)); FSEventStreamContext context = {}; context.info = &pimpl_->changedFiles; @@ -592,7 +592,7 @@ DirWatcher::DirWatcher(const Zstring& directory) : pimpl_->eventStream = ::FSEventStreamCreate(nullptr, //CFAllocatorRef allocator, &eventCallback, //FSEventStreamCallback callback, &context, //FSEventStreamContext* context, - dirnameCfArray, //CFArrayRef pathsToWatch, + dirpathCfArray, //CFArrayRef pathsToWatch, kFSEventStreamEventIdSinceNow, //FSEventStreamEventId sinceWhen, 0, //CFTimeInterval latency, in seconds kFSEventStreamCreateFlagWatchRoot | diff --git a/zen/dir_watcher.h b/zen/dir_watcher.h index bc9714a0..99131470 100644 --- a/zen/dir_watcher.h +++ b/zen/dir_watcher.h @@ -49,18 +49,18 @@ public: struct Entry { Entry() : action_(ACTION_CREATE) {} - Entry(ActionType action, const Zstring& filename) : action_(action), filename_(filename) {} + Entry(ActionType action, const Zstring& filepath) : action_(action), filepath_(filepath) {} ActionType action_; - Zstring filename_; + Zstring filepath_; }; //extract accumulated changes since last call std::vector<Entry> getChanges(const std::function<void()>& processGuiMessages); //throw FileError private: - DirWatcher(const DirWatcher&); - DirWatcher& operator=(const DirWatcher&); + DirWatcher (const DirWatcher&) = delete; + DirWatcher& operator=(const DirWatcher&) = delete; struct Pimpl; std::unique_ptr<Pimpl> pimpl_; diff --git a/zen/dst_hack.cpp b/zen/dst_hack.cpp index 95fbe732..52d45679 100644 --- a/zen/dst_hack.cpp +++ b/zen/dst_hack.cpp @@ -14,16 +14,16 @@ using namespace zen; namespace { //fast ::GetVolumePathName() clone: let's hope it's not too simple (doesn't honor mount points) -Zstring getVolumeName(const Zstring& filename) +Zstring getVolumeName(const Zstring& filepath) { //this call is expensive: ~1.5 ms! - // if (!::GetVolumePathName(filename.c_str(), //__in LPCTSTR lpszFileName, + // if (!::GetVolumePathName(filepath.c_str(), //__in LPCTSTR lpszFileName, // fsName, //__out LPTSTR lpszVolumePathName, // BUFFER_SIZE)) //__in DWORD cchBufferLength // ... // Zstring volumePath = appendSeparator(fsName); - const Zstring nameFmt = appendSeparator(removeLongPathPrefix(filename)); //throw() + const Zstring nameFmt = appendSeparator(removeLongPathPrefix(filepath)); //throw() if (startsWith(nameFmt, Zstr("\\\\"))) //UNC path: "\\ComputerName\SharedFolder\" { @@ -50,9 +50,9 @@ Zstring getVolumeName(const Zstring& filename) } -bool dst::isFatDrive(const Zstring& fileName) //throw() +bool dst::isFatDrive(const Zstring& filepath) //throw() { - const Zstring volumePath = getVolumeName(fileName); + const Zstring volumePath = getVolumeName(filepath); if (volumePath.empty()) return false; @@ -123,37 +123,34 @@ Requires Windows Vista! namespace { -//convert UInt64 and Int64 to FILETIME +//convert std::uint64_t and std::int64_t to FILETIME inline -FILETIME toFiletime(Int64 number) +FILETIME toFiletime(std::uint64_t number) { - const UInt64 unsig = to<UInt64>(number); + ULARGE_INTEGER cvt = {}; + cvt.QuadPart = number; - FILETIME output = {}; - output.dwLowDateTime = unsig.getLo(); - output.dwHighDateTime = unsig.getHi(); + const FILETIME output = { cvt.LowPart, cvt.HighPart }; return output; } -FILETIME toFiletime(UInt64 number) +inline +FILETIME toFiletime(std::int64_t number) { - FILETIME output = {}; - output.dwLowDateTime = number.getLo(); - output.dwHighDateTime = number.getHi(); - return output; + return toFiletime(static_cast<std::uint64_t>(number)); } inline -UInt64 toUInt64(const FILETIME& fileTime) +std::uint64_t toUInt64(const FILETIME& fileTime) { - return UInt64(fileTime.dwLowDateTime, fileTime.dwHighDateTime); + return get64BitUInt(fileTime.dwLowDateTime, fileTime.dwHighDateTime); } inline -Int64 toInt64(const FILETIME& fileTime) +std::int64_t toInt64(const FILETIME& fileTime) { - return to<Int64>(UInt64(fileTime.dwLowDateTime, fileTime.dwHighDateTime)); + return get64BitUInt(fileTime.dwLowDateTime, fileTime.dwHighDateTime); //convert unsigned to signed in return } @@ -216,7 +213,7 @@ const size_t WRITE_TIME_HASH_BITS = CREATE_TIME_INFO_BITS - INDICATOR_EXISTING_B template <size_t precision> inline -FILETIME encodeRawInformation(UInt64 rawInfo) +FILETIME encodeRawInformation(std::uint64_t rawInfo) { rawInfo *= precision; rawInfo += toUInt64(FAT_MIN_TIME); @@ -227,13 +224,13 @@ FILETIME encodeRawInformation(UInt64 rawInfo) template <size_t precision> inline -UInt64 extractRawInformation(const FILETIME& createTime) +std::uint64_t extractRawInformation(const FILETIME& createTime) { assert(toUInt64(FAT_MIN_TIME) <= toUInt64(createTime)); assert(toUInt64(createTime) <= toUInt64(FAT_MAX_TIME)); //FAT create time ranges from 1980 - 2107 (2^7 years) with 1/100 seconds precision - UInt64 rawInfo = toUInt64(createTime); + std::uint64_t rawInfo = toUInt64(createTime); rawInfo -= toUInt64(FAT_MIN_TIME); rawInfo /= precision; //reduce precision (FILETIME has unit 10^-7 s) @@ -245,9 +242,9 @@ UInt64 extractRawInformation(const FILETIME& createTime) //convert write time to it's minimal representation (no restriction to FAT range "1980 - 2107") inline -UInt64 extractRawWriteTime(const FILETIME& writeTime) +std::uint64_t extractRawWriteTime(const FILETIME& writeTime) { - UInt64 rawInfo = toUInt64(writeTime); + std::uint64_t rawInfo = toUInt64(writeTime); assert(rawInfo % PRECISION_WRITE_TIME == 0U); rawInfo /= PRECISION_WRITE_TIME; //reduce precision (FILETIME has unit 10^-7 s) return rawInfo; @@ -258,7 +255,7 @@ UInt64 extractRawWriteTime(const FILETIME& writeTime) inline FILETIME roundToFatWriteTime(const FILETIME& writeTime) { - UInt64 rawData = toUInt64(writeTime); + std::uint64_t rawData = toUInt64(writeTime); if (rawData % PRECISION_WRITE_TIME != 0U) rawData += PRECISION_WRITE_TIME; @@ -277,7 +274,7 @@ std::bitset<UTC_LOCAL_OFFSET_BITS> getUtcLocalShift() const FILETIME localTime = utcToLocal(utcTime); - const int timeShiftSec = to<int>((toInt64(localTime) - toInt64(utcTime)) / 10000000); //time shift in seconds + const int timeShiftSec = static_cast<int>((toInt64(localTime) - toInt64(utcTime)) / 10000000); //time shift in seconds const int timeShiftQuarter = timeShiftSec / (60 * 15); //time shift in quarter-hours @@ -311,7 +308,7 @@ int convertUtcLocalShift(std::bitset<UTC_LOCAL_OFFSET_BITS> rawShift) } -bool dst::fatHasUtcEncoded(const RawTime& rawTime) //"createTimeRaw" as retrieved by ::FindFirstFile() and ::GetFileAttributesEx(); throw (std::runtime_error) +bool dst::fatHasUtcEncoded(const RawTime& rawTime) //"createTimeRaw" as retrieved by ::FindFirstFile() and ::GetFileAttributesEx(); throw std::runtime_error { if (toUInt64(rawTime.createTimeRaw) < toUInt64(FAT_MIN_TIME) || toUInt64(FAT_MAX_TIME) < toUInt64(rawTime.createTimeRaw)) @@ -320,7 +317,7 @@ bool dst::fatHasUtcEncoded(const RawTime& rawTime) //"createTimeRaw" as retrieve return false; } - const UInt64 rawInfo = extractRawInformation<PRECISION_CREATE_TIME>(utcToLocal(rawTime.createTimeRaw)); + const std::uint64_t rawInfo = extractRawInformation<PRECISION_CREATE_TIME>(utcToLocal(rawTime.createTimeRaw)); assert_static(WRITE_TIME_HASH_BITS == 30); return (extractRawWriteTime(utcToLocal(rawTime.writeTimeRaw)) & 0x3FFFFFFFU) == (rawInfo & 0x3FFFFFFFU) && //ensure write time wasn't changed externally @@ -335,7 +332,7 @@ dst::RawTime dst::fatEncodeUtcTime(const FILETIME& writeTimeRealUtc) //throw std //create time lets us store 40 bit of information //indicator that utc time is encoded -> hopefully results in a date long way in the future; but even if this bit is accidentally set, we still have the hash! - UInt64 data = 1U; + std::uint64_t data = 1U; const std::bitset<UTC_LOCAL_OFFSET_BITS> utcShift = getUtcLocalShift(); data <<= UTC_LOCAL_OFFSET_BITS; @@ -358,14 +355,14 @@ FILETIME dst::fatDecodeUtcTime(const RawTime& rawTime) //return real UTC time; t if (!fatHasUtcEncoded(rawTime)) return rawTime.writeTimeRaw; - const UInt64 rawInfo = extractRawInformation<PRECISION_CREATE_TIME>(utcToLocal(rawTime.createTimeRaw)); + const std::uint64_t rawInfo = extractRawInformation<PRECISION_CREATE_TIME>(utcToLocal(rawTime.createTimeRaw)); - const std::bitset<UTC_LOCAL_OFFSET_BITS> rawShift(to<int>((rawInfo >> WRITE_TIME_HASH_BITS) & 0x7FU)); //static_cast<int>: a shame MSC... "unsigned long" should be supported instead! + const std::bitset<UTC_LOCAL_OFFSET_BITS> rawShift(static_cast<int>((rawInfo >> WRITE_TIME_HASH_BITS) & 0x7FU)); //static_cast<int>: a shame MSC... "unsigned long long" should be supported instead! assert_static(UTC_LOCAL_OFFSET_BITS == 7); - const int timeShiftSec = convertUtcLocalShift(rawShift); + const std::int64_t timeShiftSec = convertUtcLocalShift(rawShift); const FILETIME writeTimeLocal = utcToLocal(rawTime.writeTimeRaw); - const Int64 realUTC = toInt64(writeTimeLocal) - Int64(timeShiftSec) * 10000000; + const std::int64_t realUTC = toInt64(writeTimeLocal) - timeShiftSec * 10000000; return toFiletime(realUTC); } diff --git a/zen/file_error.h b/zen/file_error.h index cb5e3a7b..73cfa17a 100644 --- a/zen/file_error.h +++ b/zen/file_error.h @@ -55,11 +55,11 @@ std::wstring operator+(const std::wstring& lhs, const Zstring& rhs) { return std inline -std::wstring fmtFileName(const Zstring& filename) +std::wstring fmtFileName(const Zstring& filepath) { std::wstring output; output += L'\"'; - output += utfCvrtTo<std::wstring>(filename); + output += utfCvrtTo<std::wstring>(filepath); output += L'\"'; return output; } diff --git a/zen/file_handling.cpp b/zen/file_handling.cpp index cecebff1..b4622a9c 100644 --- a/zen/file_handling.cpp +++ b/zen/file_handling.cpp @@ -8,13 +8,13 @@ #include <map> #include <algorithm> #include <stdexcept> +#include "int64.h" #include "file_traverser.h" #include "scope_guard.h" #include "symlink_target.h" #include "file_io.h" #include "assert_static.h" #include "file_id_def.h" -//#include <boost/thread/tss.hpp> #ifdef ZEN_WIN #include <Aclapi.h> @@ -35,7 +35,6 @@ #elif defined ZEN_MAC #include <sys/mount.h> //statfs -//#include <utime.h> #endif #if defined ZEN_LINUX || defined ZEN_MAC @@ -46,34 +45,34 @@ using namespace zen; -bool zen::fileExists(const Zstring& filename) +bool zen::fileExists(const Zstring& filepath) { //symbolic links (broken or not) are also treated as existing files! #ifdef ZEN_WIN - const DWORD attr = ::GetFileAttributes(applyLongPathPrefix(filename).c_str()); + const DWORD attr = ::GetFileAttributes(applyLongPathPrefix(filepath).c_str()); if (attr != INVALID_FILE_ATTRIBUTES) return (attr & FILE_ATTRIBUTE_DIRECTORY) == 0; //returns true for (file-)symlinks also #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat fileInfo = {}; - if (::stat(filename.c_str(), &fileInfo) == 0) //follow symlinks! + if (::stat(filepath.c_str(), &fileInfo) == 0) //follow symlinks! return S_ISREG(fileInfo.st_mode); #endif return false; } -bool zen::dirExists(const Zstring& dirname) +bool zen::dirExists(const Zstring& dirpath) { //symbolic links (broken or not) are also treated as existing directories! #ifdef ZEN_WIN - const DWORD attr = ::GetFileAttributes(applyLongPathPrefix(dirname).c_str()); + const DWORD attr = ::GetFileAttributes(applyLongPathPrefix(dirpath).c_str()); if (attr != INVALID_FILE_ATTRIBUTES) return (attr & FILE_ATTRIBUTE_DIRECTORY) != 0; //returns true for (dir-)symlinks also #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat dirInfo = {}; - if (::stat(dirname.c_str(), &dirInfo) == 0) //follow symlinks! + if (::stat(dirpath.c_str(), &dirInfo) == 0) //follow symlinks! return S_ISDIR(dirInfo.st_mode); #endif return false; @@ -137,7 +136,7 @@ namespace { #ifdef ZEN_WIN //(try to) enhance error messages by showing which processes lock the file -Zstring getLockingProcessNames(const Zstring& filename) //throw(), empty string if none found or error occurred +Zstring getLockingProcessNames(const Zstring& filepath) //throw(), empty string if none found or error occurred { if (vistaOrLater()) { @@ -146,7 +145,7 @@ Zstring getLockingProcessNames(const Zstring& filename) //throw(), empty string const DllFun<FunType_freeString> freeString (getDllName(), funName_freeString); if (getLockingProcesses && freeString) - if (const wchar_t* procList = getLockingProcesses(filename.c_str())) + if (const wchar_t* procList = getLockingProcesses(filepath.c_str())) { ZEN_ON_SCOPE_EXIT(freeString(procList)); return procList; @@ -158,14 +157,14 @@ Zstring getLockingProcessNames(const Zstring& filename) //throw(), empty string } -UInt64 zen::getFilesize(const Zstring& filename) //throw FileError +std::uint64_t zen::getFilesize(const Zstring& filepath) //throw FileError { #ifdef ZEN_WIN WIN32_FIND_DATA fileInfo = {}; { - const HANDLE searchHandle = ::FindFirstFile(applyLongPathPrefix(filename).c_str(), &fileInfo); + const HANDLE searchHandle = ::FindFirstFile(applyLongPathPrefix(filepath).c_str(), &fileInfo); if (searchHandle == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"FindFirstFile", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"FindFirstFile", getLastError()); ::FindClose(searchHandle); } // WIN32_FILE_ATTRIBUTE_DATA sourceAttr = {}; @@ -174,11 +173,11 @@ UInt64 zen::getFilesize(const Zstring& filename) //throw FileError // &sourceAttr)) //__out LPVOID lpFileInformation if (!isSymlink(fileInfo)) - return UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); + return get64BitUInt(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); else { //open handle to target of symbolic link - const HANDLE hFile = ::CreateFile(applyLongPathPrefix(filename).c_str(), //_In_ LPCTSTR lpFileName, + const HANDLE hFile = ::CreateFile(applyLongPathPrefix(filepath).c_str(), //_In_ LPCTSTR lpFileName, 0, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, nullptr, //_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, @@ -186,27 +185,27 @@ UInt64 zen::getFilesize(const Zstring& filename) //throw FileError FILE_FLAG_BACKUP_SEMANTICS, /*needed to open a directory*/ //_In_ DWORD dwFlagsAndAttributes, nullptr); //_In_opt_ HANDLE hTemplateFile if (hFile == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"CreateFile", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"CreateFile", getLastError()); ZEN_ON_SCOPE_EXIT(::CloseHandle(hFile)); BY_HANDLE_FILE_INFORMATION fileInfoHnd = {}; if (!::GetFileInformationByHandle(hFile, &fileInfoHnd)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"GetFileInformationByHandle", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"GetFileInformationByHandle", getLastError()); - return UInt64(fileInfoHnd.nFileSizeLow, fileInfoHnd.nFileSizeHigh); + return get64BitUInt(fileInfoHnd.nFileSizeLow, fileInfoHnd.nFileSizeHigh); } #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat fileInfo = {}; - if (::stat(filename.c_str(), &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"stat", getLastError()); + if (::stat(filepath.c_str(), &fileInfo) != 0) + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"stat", getLastError()); - return UInt64(fileInfo.st_size); + return fileInfo.st_size; #endif } -UInt64 zen::getFreeDiskSpace(const Zstring& path) //throw FileError +std::uint64_t zen::getFreeDiskSpace(const Zstring& path) //throw FileError { #ifdef ZEN_WIN ULARGE_INTEGER bytesFree = {}; @@ -216,52 +215,52 @@ UInt64 zen::getFreeDiskSpace(const Zstring& path) //throw FileError nullptr)) //__out_opt PULARGE_INTEGER lpTotalNumberOfFreeBytes throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(path)), L"GetDiskFreeSpaceEx", getLastError()); - return UInt64(bytesFree.LowPart, bytesFree.HighPart); + return get64BitUInt(bytesFree.LowPart, bytesFree.HighPart); #elif defined ZEN_LINUX || defined ZEN_MAC struct statfs info = {}; if (::statfs(path.c_str(), &info) != 0) throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(path)), L"statfs", getLastError()); - return UInt64(info.f_bsize) * info.f_bavail; + return static_cast<std::uint64_t>(info.f_bsize) * info.f_bavail; #endif } -bool zen::removeFile(const Zstring& filename) //throw FileError +bool zen::removeFile(const Zstring& filepath) //throw FileError { #ifdef ZEN_WIN const wchar_t functionName[] = L"DeleteFile"; - const Zstring& filenameFmt = applyLongPathPrefix(filename); - if (!::DeleteFile(filenameFmt.c_str())) + const Zstring& filepathFmt = applyLongPathPrefix(filepath); + if (!::DeleteFile(filepathFmt.c_str())) #elif defined ZEN_LINUX || defined ZEN_MAC const wchar_t functionName[] = L"unlink"; - if (::unlink(filename.c_str()) != 0) + if (::unlink(filepath.c_str()) != 0) #endif { ErrorCode lastError = getLastError(); #ifdef ZEN_WIN if (lastError == ERROR_ACCESS_DENIED) //function fails if file is read-only { - ::SetFileAttributes(filenameFmt.c_str(), FILE_ATTRIBUTE_NORMAL); //(try to) normalize file attributes + ::SetFileAttributes(filepathFmt.c_str(), FILE_ATTRIBUTE_NORMAL); //(try to) normalize file attributes - if (::DeleteFile(filenameFmt.c_str())) //now try again... + if (::DeleteFile(filepathFmt.c_str())) //now try again... return true; lastError = ::GetLastError(); } #endif - if (!somethingExists(filename)) //warning: changes global error code!! + if (!somethingExists(filepath)) //warning: changes global error code!! return false; //neither file nor any other object (e.g. broken symlink) with that name existing - caveat: what if "access is denied"!?!??!?!? //begin of "regular" error reporting - const std::wstring errorMsg = replaceCpy(_("Cannot delete file %x."), L"%x", fmtFileName(filename)); + const std::wstring errorMsg = replaceCpy(_("Cannot delete file %x."), L"%x", fmtFileName(filepath)); std::wstring errorDescr = formatSystemError(functionName, lastError); #ifdef ZEN_WIN if (lastError == ERROR_SHARING_VIOLATION || //-> enhance error message! lastError == ERROR_LOCK_VIOLATION) { - const Zstring procList = getLockingProcessNames(filename); //throw() + const Zstring procList = getLockingProcessNames(filepath); //throw() if (!procList.empty()) errorDescr = _("The file is locked by another process:") + L"\n" + procList; } @@ -364,17 +363,17 @@ void renameFile_sub(const Zstring& oldName, const Zstring& newName) //throw File ::GetShortPathName() ::GetLongPathName() */ template <typename Function> -Zstring getFilenameFmt(const Zstring& filename, Function fun) //throw(); returns empty string on error +Zstring getFilenameFmt(const Zstring& filepath, Function fun) //throw(); returns empty string on error { - const Zstring filenameFmt = applyLongPathPrefix(filename); + const Zstring filepathFmt = applyLongPathPrefix(filepath); - const DWORD bufferSize = fun(filenameFmt.c_str(), nullptr, 0); + const DWORD bufferSize = fun(filepathFmt.c_str(), nullptr, 0); if (bufferSize == 0) return Zstring(); std::vector<wchar_t> buffer(bufferSize); - const DWORD charsWritten = fun(filenameFmt.c_str(), //__in LPCTSTR lpszShortPath, + const DWORD charsWritten = fun(filepathFmt.c_str(), //__in LPCTSTR lpszShortPath, &buffer[0], //__out LPTSTR lpszLongPath, bufferSize); //__in DWORD cchBuffer if (charsWritten == 0 || charsWritten >= bufferSize) @@ -384,18 +383,18 @@ Zstring getFilenameFmt(const Zstring& filename, Function fun) //throw(); returns } -Zstring findUnused8Dot3Name(const Zstring& filename) //find a unique 8.3 short name +Zstring findUnused8Dot3Name(const Zstring& filepath) //find a unique 8.3 short name { - const Zstring pathPrefix = contains(filename, FILE_NAME_SEPARATOR) ? - (beforeLast(filename, FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR) : Zstring(); + const Zstring pathPrefix = contains(filepath, FILE_NAME_SEPARATOR) ? + (beforeLast(filepath, FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR) : Zstring(); - Zstring extension = afterLast(afterLast(filename, FILE_NAME_SEPARATOR), Zchar('.')); //extension needn't contain reasonable data + Zstring extension = afterLast(afterLast(filepath, FILE_NAME_SEPARATOR), Zchar('.')); //extension needn't contain reasonable data if (extension.empty()) extension = Zstr("FFS"); else if (extension.length() > 3) extension.resize(3); - for (int index = 0; index < 100000000; ++index) //filename must be representable by <= 8 characters + for (int index = 0; index < 100000000; ++index) //filepath must be representable by <= 8 characters { const Zstring output = pathPrefix + numberTo<Zstring>(index) + Zchar('.') + extension; if (!somethingExists(output)) //ensure uniqueness @@ -405,24 +404,24 @@ Zstring findUnused8Dot3Name(const Zstring& filename) //find a unique 8.3 short n } -bool have8dot3NameClash(const Zstring& filename) +bool have8dot3NameClash(const Zstring& filepath) { - if (!contains(filename, FILE_NAME_SEPARATOR)) + if (!contains(filepath, FILE_NAME_SEPARATOR)) return false; - if (somethingExists(filename)) //name OR directory! + if (somethingExists(filepath)) //name OR directory! { - const Zstring origName = afterLast(filename, FILE_NAME_SEPARATOR); //returns the whole string if ch not found - const Zstring shortName = afterLast(getFilenameFmt(filename, ::GetShortPathName), FILE_NAME_SEPARATOR); //throw() returns empty string on error - const Zstring longName = afterLast(getFilenameFmt(filename, ::GetLongPathName ), FILE_NAME_SEPARATOR); // + const Zstring origName = afterLast(filepath, FILE_NAME_SEPARATOR); //returns the whole string if ch not found + const Zstring shortName = afterLast(getFilenameFmt(filepath, ::GetShortPathName), FILE_NAME_SEPARATOR); //throw() returns empty string on error + const Zstring longName = afterLast(getFilenameFmt(filepath, ::GetLongPathName ), FILE_NAME_SEPARATOR); // if (!shortName.empty() && !longName .empty() && EqualFilename()(origName, shortName) && !EqualFilename()(shortName, longName)) { - //for filename short and long file name are equal and another unrelated file happens to have the same short name - //e.g. filename == "TESTWE~1", but another file is existing named "TestWeb" with short name ""TESTWE~1" + //for filepath short and long file name are equal and another unrelated file happens to have the same short name + //e.g. filepath == "TESTWE~1", but another file is existing named "TestWeb" with short name ""TESTWE~1" return true; } } @@ -432,14 +431,14 @@ bool have8dot3NameClash(const Zstring& filename) class Fix8Dot3NameClash //throw FileError { public: - Fix8Dot3NameClash(const Zstring& filename) + Fix8Dot3NameClash(const Zstring& filepath) { - const Zstring longName = afterLast(getFilenameFmt(filename, ::GetLongPathName), FILE_NAME_SEPARATOR); //throw() returns empty string on error + const Zstring longName = afterLast(getFilenameFmt(filepath, ::GetLongPathName), FILE_NAME_SEPARATOR); //throw() returns empty string on error - unrelatedFile = beforeLast(filename, FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + longName; + unrelatedFile = beforeLast(filepath, FILE_NAME_SEPARATOR) + FILE_NAME_SEPARATOR + longName; //find another name in short format: this ensures the actual short name WILL be renamed as well! - unrelatedFileParked = findUnused8Dot3Name(filename); + unrelatedFileParked = findUnused8Dot3Name(filepath); //move already existing short name out of the way for now renameFile_sub(unrelatedFile, unrelatedFileParked); //throw FileError, ErrorDifferentVolume @@ -476,7 +475,7 @@ void zen::renameFile(const Zstring& oldName, const Zstring& newName) //throw Fil //try to handle issues with already existing short 8.3 file names on Windows if (have8dot3NameClash(newName)) { - Fix8Dot3NameClash dummy(newName); //throw FileError; move clashing filename to the side + Fix8Dot3NameClash dummy(newName); //throw FileError; move clashing filepath to the side //now try again... renameFile_sub(oldName, newName); //throw FileError return; @@ -496,29 +495,29 @@ public: files_(files), dirs_(dirs) {} - virtual void onFile(const Zchar* shortName, const Zstring& fullName, const FileInfo& details) + virtual void onFile(const Zchar* shortName, const Zstring& filepath, const FileInfo& details) { - files_.push_back(fullName); + files_.push_back(filepath); } - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) { - if (dirExists(fullName)) //dir symlink + if (dirExists(linkpath)) //dir symlink dirs_.push_back(shortName); else //file symlink, broken symlink files_.push_back(shortName); return LINK_SKIP; } - virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& fullName) + virtual TraverseCallback* onDir(const Zchar* shortName, const Zstring& dirpath) { - dirs_.push_back(fullName); + dirs_.push_back(dirpath); return nullptr; //DON'T traverse into subdirs; removeDirectory works recursively! } virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber) { throw FileError(msg); } virtual HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) { throw FileError(msg); } private: - CollectFilesFlat(const CollectFilesFlat&); - CollectFilesFlat& operator=(const CollectFilesFlat&); + CollectFilesFlat (const CollectFilesFlat&) = delete; + CollectFilesFlat& operator=(const CollectFilesFlat&) = delete; std::vector<Zstring>& files_; std::vector<Zstring>& dirs_; @@ -526,8 +525,8 @@ private: void removeDirectoryImpl(const Zstring& directory, //throw FileError - const std::function<void (const Zstring& filename)>& onBeforeFileDeletion, - const std::function<void (const Zstring& dirname)>& onBeforeDirDeletion) + const std::function<void (const Zstring& filepath)>& onBeforeFileDeletion, + const std::function<void (const Zstring& dirpath)>& onBeforeDirDeletion) { assert(somethingExists(directory)); //[!] @@ -563,15 +562,15 @@ void removeDirectoryImpl(const Zstring& directory, //throw FileError } //delete directories recursively - for (const Zstring& dirname : dirList) - removeDirectoryImpl(dirname, onBeforeFileDeletion, onBeforeDirDeletion); //throw FileError; call recursively to correctly handle symbolic links + for (const Zstring& dirpath : dirList) + removeDirectoryImpl(dirpath, onBeforeFileDeletion, onBeforeDirDeletion); //throw FileError; call recursively to correctly handle symbolic links //delete files - for (const Zstring& filename : fileList) + for (const Zstring& filepath : fileList) { if (onBeforeFileDeletion) - onBeforeFileDeletion(filename); //call once per file - removeFile(filename); //throw FileError + onBeforeFileDeletion(filepath); //call once per file + removeFile(filepath); //throw FileError } //parent directory is deleted last @@ -594,7 +593,7 @@ void removeDirectoryImpl(const Zstring& directory, //throw FileError #ifdef ZEN_WIN -void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const FILETIME& lastWriteTime, ProcSymlink procSl) //throw FileError +void setFileTimeRaw(const Zstring& filepath, const FILETIME& creationTime, const FILETIME& lastWriteTime, ProcSymlink procSl) //throw FileError { { //extra scope for debug check below @@ -623,21 +622,21 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const DWORD attribs = INVALID_FILE_ATTRIBUTES; ZEN_ON_SCOPE_EXIT( if (attribs != INVALID_FILE_ATTRIBUTES) - ::SetFileAttributes(applyLongPathPrefix(filename).c_str(), attribs); + ::SetFileAttributes(applyLongPathPrefix(filepath).c_str(), attribs); ); auto removeReadonly = [&]() -> bool //throw FileError; may need to remove the readonly-attribute (e.g. on FAT usb drives) { if (attribs == INVALID_FILE_ATTRIBUTES) { - const DWORD tmpAttr = ::GetFileAttributes(applyLongPathPrefix(filename).c_str()); + const DWORD tmpAttr = ::GetFileAttributes(applyLongPathPrefix(filepath).c_str()); if (tmpAttr == INVALID_FILE_ATTRIBUTES) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filename)), L"GetFileAttributes", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(filepath)), L"GetFileAttributes", getLastError()); if (tmpAttr & FILE_ATTRIBUTE_READONLY) { - if (!::SetFileAttributes(applyLongPathPrefix(filename).c_str(), FILE_ATTRIBUTE_NORMAL)) - throwFileError(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtFileName(filename)), L"SetFileAttributes", getLastError()); + if (!::SetFileAttributes(applyLongPathPrefix(filepath).c_str(), FILE_ATTRIBUTE_NORMAL)) + throwFileError(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtFileName(filepath)), L"SetFileAttributes", getLastError()); attribs = tmpAttr; //reapplied on scope exit return true; @@ -648,7 +647,7 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const auto openFile = [&](bool conservativeApproach) { - return ::CreateFile(applyLongPathPrefix(filename).c_str(), //_In_ LPCTSTR lpFileName, + return ::CreateFile(applyLongPathPrefix(filepath).c_str(), //_In_ LPCTSTR lpFileName, (conservativeApproach ? //some NAS seem to have issues with FILE_WRITE_ATTRIBUTES, even worse, they may fail silently! //http://sourceforge.net/tracker/?func=detail&atid=1093081&aid=3536680&group_id=234430 @@ -687,7 +686,7 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const continue; //3. after these herculean stunts we give up... - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filename)), L"CreateFile", lastError); + throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filepath)), L"CreateFile", lastError); } } break; @@ -719,7 +718,7 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const FileBasicInfo, //__in FILE_INFO_BY_HANDLE_CLASS FileInformationClass, &basicInfo, //__in LPVOID lpFileInformation, sizeof(basicInfo))) //__in DWORD dwBufferSize - throwFileError(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtFileName(filename)), L"SetFileInformationByHandle", getLastError()); + throwFileError(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtFileName(filepath)), L"SetFileInformationByHandle", getLastError()); }; auto toLargeInteger = [](const FILETIME& ft) -> LARGE_INTEGER @@ -757,11 +756,11 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const } } - std::wstring errorMsg = replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filename)); + std::wstring errorMsg = replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filepath)); //add more meaningful message: FAT accepts only a subset of the NTFS date range if (lastError == ERROR_INVALID_PARAMETER && - dst::isFatDrive(filename)) + dst::isFatDrive(filepath)) { //we need a low-level reliable routine to format a potentially invalid date => don't use strftime!!! auto fmtDate = [](const FILETIME& ft) -> Zstring @@ -813,7 +812,7 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const FILETIME creationTimeDbg = {}; FILETIME lastWriteTimeDbg = {}; - HANDLE hFile = ::CreateFile(applyLongPathPrefix(filename).c_str(), //_In_ LPCTSTR lpFileName, + HANDLE hFile = ::CreateFile(applyLongPathPrefix(filepath).c_str(), //_In_ LPCTSTR lpFileName, FILE_READ_ATTRIBUTES | FILE_WRITE_ATTRIBUTES, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, nullptr, //_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, @@ -829,8 +828,8 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const nullptr, &lastWriteTimeDbg)); - assert(::CompareFileTime(&creationTimeDbg, &creationTime) == 0); - assert(::CompareFileTime(&lastWriteTimeDbg, &lastWriteTime) == 0); + assert(std::abs(filetimeToTimeT(creationTimeDbg ) - filetimeToTimeT(creationTime )) <= 2); //respect 2 second FAT/FAT32 precision + assert(std::abs(filetimeToTimeT(lastWriteTimeDbg) - filetimeToTimeT(lastWriteTime)) <= 2); // #endif } #endif @@ -838,8 +837,8 @@ void setFileTimeRaw(const Zstring& filename, const FILETIME& creationTime, const void zen::removeDirectory(const Zstring& directory, //throw FileError - const std::function<void (const Zstring& filename)>& onBeforeFileDeletion, - const std::function<void (const Zstring& dirname)>& onBeforeDirDeletion) + const std::function<void (const Zstring& filepath)>& onBeforeFileDeletion, + const std::function<void (const Zstring& dirpath)>& onBeforeDirDeletion) { //no error situation if directory is not existing! manual deletion relies on it! if (!somethingExists(directory)) @@ -848,22 +847,25 @@ void zen::removeDirectory(const Zstring& directory, //throw FileError } -void zen::setFileTime(const Zstring& filename, const Int64& modTime, ProcSymlink procSl) //throw FileError +void zen::setFileTime(const Zstring& filepath, std::int64_t modTime, ProcSymlink procSl) //throw FileError { #ifdef ZEN_WIN FILETIME creationTime = {}; - FILETIME lastWriteTime = toFileTime(modTime); + FILETIME lastWriteTime = timetToFileTime(modTime); //####################################### DST hack ########################################### - if (dst::isFatDrive(filename)) //throw(); hacky: does not consider symlinks pointing to FAT! + warn_static("let's tentatively disable the DST hack:") +#if 0 + if (dst::isFatDrive(filepath)) //throw(); hacky: does not consider symlinks pointing to FAT! { const dst::RawTime encodedTime = dst::fatEncodeUtcTime(lastWriteTime); //throw std::runtime_error creationTime = encodedTime.createTimeRaw; lastWriteTime = encodedTime.writeTimeRaw; } +#endif //####################################### DST hack ########################################### - setFileTimeRaw(filename, creationTime, lastWriteTime, procSl); //throw FileError + setFileTimeRaw(filepath, creationTime, lastWriteTime, procSl); //throw FileError #elif defined ZEN_LINUX || defined ZEN_MAC //sigh, we can't use utimensat on NTFS volumes on Ubuntu: silent failure!!! what morons are programming this shit??? @@ -872,35 +874,35 @@ void zen::setFileTime(const Zstring& filename, const Int64& modTime, ProcSymlink // newTimes[0].tv_nsec = UTIME_OMIT; //omit access time // newTimes[1].tv_sec = to<time_t>(modTime); //modification time (seconds) // - // if (::utimensat(AT_FDCWD, filename.c_str(), newTimes, procSl == SYMLINK_DIRECT ? AT_SYMLINK_NOFOLLOW : 0) != 0) - // throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filename)), L"utimensat", getLastError()); + // if (::utimensat(AT_FDCWD, filepath.c_str(), newTimes, procSl == SYMLINK_DIRECT ? AT_SYMLINK_NOFOLLOW : 0) != 0) + // throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filepath)), L"utimensat", getLastError()); //=> fallback to "retarded-idiot version"! -- DarkByte //OS X: utime() is obsoleted by utimes()! utimensat() not yet implemented struct ::timeval newTimes[2] = {}; - newTimes[0].tv_sec = ::time(nullptr); //access time (seconds) - newTimes[1].tv_sec = to<time_t>(modTime); //modification time (seconds) + newTimes[0].tv_sec = ::time(nullptr); //access time (seconds) + newTimes[1].tv_sec = modTime; //modification time (seconds) const int rv = procSl == ProcSymlink::FOLLOW ? - :: utimes(filename.c_str(), newTimes) : - ::lutimes(filename.c_str(), newTimes); + :: utimes(filepath.c_str(), newTimes) : + ::lutimes(filepath.c_str(), newTimes); if (rv != 0) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filename)), L"utimes", getLastError()); + throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtFileName(filepath)), L"utimes", getLastError()); #endif } -bool zen::supportsPermissions(const Zstring& dirname) //throw FileError +bool zen::supportsPermissions(const Zstring& dirpath) //throw FileError { #ifdef ZEN_WIN const DWORD bufferSize = MAX_PATH + 1; std::vector<wchar_t> buffer(bufferSize); - if (!::GetVolumePathName(dirname.c_str(), //__in LPCTSTR lpszFileName, + if (!::GetVolumePathName(dirpath.c_str(), //__in LPCTSTR lpszFileName, &buffer[0], //__out LPTSTR lpszVolumePathName, bufferSize)) //__in DWORD cchBufferLength - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(dirname)), L"GetVolumePathName", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(dirpath)), L"GetVolumePathName", getLastError()); DWORD fsFlags = 0; if (!::GetVolumeInformation(&buffer[0], //__in_opt LPCTSTR lpRootPathName, @@ -911,7 +913,7 @@ bool zen::supportsPermissions(const Zstring& dirname) //throw FileError &fsFlags, //__out_opt LPDWORD lpFileSystemFlags, nullptr, //__out LPTSTR lpFileSystemNameBuffer, 0)) //__in DWORD nFileSystemNameSize - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(dirname)), L"GetVolumeInformation", getLastError()); + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(dirpath)), L"GetVolumeInformation", getLastError()); return (fsFlags & FILE_PERSISTENT_ACLS) != 0; @@ -1431,7 +1433,7 @@ void zen::copySymlink(const Zstring& sourceLink, const Zstring& targetLink, bool if (::lstat(sourceLink.c_str(), &srcInfo) != 0) throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(sourceLink)), L"lstat", getLastError()); - setFileTime(targetLink, Int64(srcInfo.st_mtime), ProcSymlink::DIRECT); //throw FileError + setFileTime(targetLink, srcInfo.st_mtime, ProcSymlink::DIRECT); //throw FileError #endif if (copyFilePermissions) @@ -1545,7 +1547,7 @@ bool canCopyAsSparse(const Zstring& sourceFile, const Zstring& targetFile) //thr //precondition: canCopyAsSparse() must return "true"! void copyFileWindowsSparse(const Zstring& sourceFile, const Zstring& targetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* newAttrib) //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting, ErrorFileLocked { assert(canCopyAsSparse(sourceFile, targetFile)); @@ -1641,10 +1643,10 @@ void copyFileWindowsSparse(const Zstring& sourceFile, //return up-to-date file attributes if (newAttrib) { - newAttrib->fileSize = UInt64(fileInfoSource.nFileSizeLow, fileInfoSource.nFileSizeHigh); - newAttrib->modificationTime = toTimeT(fileInfoSource.ftLastWriteTime); //no DST hack (yet) - newAttrib->sourceFileId = extractFileID(fileInfoSource); - newAttrib->targetFileId = extractFileID(fileInfoTarget); + newAttrib->fileSize = get64BitUInt(fileInfoSource.nFileSizeLow, fileInfoSource.nFileSizeHigh); + newAttrib->modificationTime = filetimeToTimeT(fileInfoSource.ftLastWriteTime); //no DST hack (yet) + newAttrib->sourceFileId = extractFileId(fileInfoSource); + newAttrib->targetFileId = extractFileId(fileInfoTarget); } //#################### copy NTFS compressed attribute ######################### @@ -1737,7 +1739,7 @@ void copyFileWindowsSparse(const Zstring& sourceFile, //invoke callback method to update progress indicators if (onUpdateCopyStatus) - onUpdateCopyStatus(Int64(bytesRead)); //throw X! + onUpdateCopyStatus(bytesRead); //throw X! if (bytesRead > 0) someBytesWritten = true; @@ -1747,7 +1749,7 @@ void copyFileWindowsSparse(const Zstring& sourceFile, //DST hack not required, since both source and target volumes cannot be FAT! //::BackupRead() silently fails reading encrypted files -> double check! - if (!someBytesWritten && UInt64(fileInfoSource.nFileSizeLow, fileInfoSource.nFileSizeHigh) != 0U) + if (!someBytesWritten && get64BitUInt(fileInfoSource.nFileSizeLow, fileInfoSource.nFileSizeHigh) != 0U) //note: there is no guaranteed ordering relation beween bytes transferred and file size! Consider ADS (>) and compressed/sparse files (<)! throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtFileName(sourceFile)), L"unknown error"); //user should never see this -> this method is called only if "canCopyAsSparse()" @@ -1804,7 +1806,7 @@ public: //call context: copyCallbackInternal() void reportErrorShouldCopyAsSparse() { shouldCopyAsSparse = true; } - void reportUserException(const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus) { exceptionInUserCallback = onUpdateCopyStatus; } + void reportUserException(const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus) { exceptionInUserCallback = onUpdateCopyStatus; } void reportError(const std::wstring& msg, const std::wstring& description) { errorMsg = std::make_pair(msg, description); } @@ -1827,30 +1829,31 @@ public: private: bool shouldCopyAsSparse; // std::pair<std::wstring, std::wstring> errorMsg; //these are exclusive! - std::function<void(Int64 bytesDelta)> exceptionInUserCallback; // -> optional + std::function<void(std::int64_t bytesDelta)> exceptionInUserCallback; // -> optional }; struct CallbackData { - CallbackData(const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + CallbackData(const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, const Zstring& sourceFile, const Zstring& targetFile) : sourceFile_(sourceFile), targetFile_(targetFile), onUpdateCopyStatus_(onUpdateCopyStatus), fileInfoSrc(), - fileInfoTrg() {} + fileInfoTrg(), + bytesReported() {} const Zstring& sourceFile_; const Zstring& targetFile_; - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus_; + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus_; ErrorHandling errorHandler; BY_HANDLE_FILE_INFORMATION fileInfoSrc; //modified by CopyFileEx() at beginning BY_HANDLE_FILE_INFORMATION fileInfoTrg; // - Int64 bytesReported; //used internally to calculate bytes transferred delta + std::int64_t bytesReported; //used internally to calculate bytes transferred delta }; @@ -1962,7 +1965,7 @@ const bool supportNonEncryptedDestination = winXpOrLater(); //encrypted destinat void copyFileWindowsDefault(const Zstring& sourceFile, const Zstring& targetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* newAttrib) //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting, ErrorFileLocked, ErrorShouldCopyAsSparse { //try to get backup read and write privileges: who knows, maybe this helps solve some obscure "access denied" errors @@ -2039,10 +2042,10 @@ void copyFileWindowsDefault(const Zstring& sourceFile, //trying to copy > 4GB file to FAT/FAT32 volume gives obscure ERROR_INVALID_PARAMETER (FAT can indeed handle files up to 4 Gig, tested!) if (lastError == ERROR_INVALID_PARAMETER && dst::isFatDrive(targetFile) && - getFilesize(sourceFile) >= 4U * UInt64(1024U * 1024 * 1024)) //throw FileError + getFilesize(sourceFile) >= 4U * std::uint64_t(1024U * 1024 * 1024)) //throw FileError errorDescr += L"\nFAT volumes cannot store files larger than 4 gigabyte."; - //note: ERROR_INVALID_PARAMETER can also occur when copying to a SharePoint server or MS SkyDrive and the target filename is of a restricted type. + //note: ERROR_INVALID_PARAMETER can also occur when copying to a SharePoint server or MS SkyDrive and the target filepath is of a restricted type. } catch (FileError&) {} @@ -2051,16 +2054,18 @@ void copyFileWindowsDefault(const Zstring& sourceFile, if (newAttrib) { - newAttrib->fileSize = UInt64(cbd.fileInfoSrc.nFileSizeLow, cbd.fileInfoSrc.nFileSizeHigh); + newAttrib->fileSize = get64BitUInt(cbd.fileInfoSrc.nFileSizeLow, cbd.fileInfoSrc.nFileSizeHigh); //newAttrib->modificationTime = -> set further below - newAttrib->sourceFileId = extractFileID(cbd.fileInfoSrc); - newAttrib->targetFileId = extractFileID(cbd.fileInfoTrg); + newAttrib->sourceFileId = extractFileId(cbd.fileInfoSrc); + newAttrib->targetFileId = extractFileId(cbd.fileInfoTrg); } { FILETIME creationtime = cbd.fileInfoSrc.ftCreationTime; FILETIME lastWriteTimeRaw = cbd.fileInfoSrc.ftLastWriteTime; //####################################### DST hack ########################################### + warn_static("let's tentatively disable the DST hack:") +#if 0 if (dst::isFatDrive(sourceFile)) //throw(); hacky: does not consider symlinks pointing to FAT! { const dst::RawTime rawTime(creationtime, lastWriteTimeRaw); @@ -2070,10 +2075,11 @@ void copyFileWindowsDefault(const Zstring& sourceFile, ::GetSystemTimeAsFileTime(&creationtime); //real creation time information is not available... } } +#endif //####################################### DST hack ########################################### if (newAttrib) - newAttrib->modificationTime = toTimeT(lastWriteTimeRaw); + newAttrib->modificationTime = filetimeToTimeT(lastWriteTimeRaw); //caveat: - ::CopyFileEx() silently *ignores* failure to set modification time!!! => we always need to set it again but with proper error checking! // - perf-loss on USB sticks with many small files of about 30%! @@ -2081,12 +2087,15 @@ void copyFileWindowsDefault(const Zstring& sourceFile, FILETIME lastWriteTimeOut = lastWriteTimeRaw; //####################################### DST hack ########################################### + warn_static("let's tentatively disable the DST hack:") +#if 0 if (dst::isFatDrive(targetFile)) //throw(); target cannot be a symlink in this context! { const dst::RawTime encodedTime = dst::fatEncodeUtcTime(lastWriteTimeRaw); //throw std::runtime_error creationTimeOut = encodedTime.createTimeRaw; lastWriteTimeOut = encodedTime.writeTimeRaw; } +#endif //####################################### DST hack ########################################### setFileTimeRaw(targetFile, creationTimeOut, lastWriteTimeOut, ProcSymlink::FOLLOW); //throw FileError @@ -2098,7 +2107,7 @@ void copyFileWindowsDefault(const Zstring& sourceFile, //another layer to support copying sparse files inline -void copyFileWindowsSelectRoutine(const Zstring& sourceFile, const Zstring& targetFile, const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* sourceAttr) +void copyFileWindowsSelectRoutine(const Zstring& sourceFile, const Zstring& targetFile, const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* sourceAttr) { try { @@ -2115,7 +2124,7 @@ void copyFileWindowsSelectRoutine(const Zstring& sourceFile, const Zstring& targ inline void copyFileWindows(const Zstring& sourceFile, const Zstring& targetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* sourceAttr) { try @@ -2127,8 +2136,8 @@ void copyFileWindows(const Zstring& sourceFile, //try to handle issues with already existing short 8.3 file names on Windows if (have8dot3NameClash(targetFile)) { - Fix8Dot3NameClash dummy(targetFile); //throw FileError; move clashing filename to the side - copyFileWindowsSelectRoutine(sourceFile, targetFile, onUpdateCopyStatus, sourceAttr); //throw FileError; the short filename name clash is solved, this should work now + Fix8Dot3NameClash dummy(targetFile); //throw FileError; move clashing filepath to the side + copyFileWindowsSelectRoutine(sourceFile, targetFile, onUpdateCopyStatus, sourceAttr); //throw FileError; the short filepath name clash is solved, this should work now return; } throw; @@ -2139,7 +2148,7 @@ void copyFileWindows(const Zstring& sourceFile, #elif defined ZEN_LINUX || defined ZEN_MAC void copyFileLinuxMac(const Zstring& sourceFile, const Zstring& targetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* newAttrib) //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting { //open sourceFile for reading @@ -2165,7 +2174,7 @@ void copyFileLinuxMac(const Zstring& sourceFile, //invoke callback method to update progress indicators if (onUpdateCopyStatus) - onUpdateCopyStatus(Int64(bytesRead)); //throw X! + onUpdateCopyStatus(bytesRead); //throw X! } while (!fileIn.eof()); @@ -2178,10 +2187,10 @@ void copyFileLinuxMac(const Zstring& sourceFile, if (newAttrib) { - newAttrib->fileSize = UInt64(sourceInfo.st_size); + newAttrib->fileSize = sourceInfo.st_size; newAttrib->modificationTime = sourceInfo.st_mtime; - newAttrib->sourceFileId = extractFileID(sourceInfo); - newAttrib->targetFileId = extractFileID(targetInfo); + newAttrib->sourceFileId = extractFileId(sourceInfo); + newAttrib->targetFileId = extractFileId(targetInfo); } } } @@ -2220,7 +2229,7 @@ copyFileWindowsDefault(::CopyFileEx) copyFileWindowsSparse(::BackupRead/::Backu inline void copyFileSelectOs(const Zstring& sourceFile, const Zstring& targetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* sourceAttr) { #ifdef ZEN_WIN @@ -2238,7 +2247,7 @@ void zen::copyFile(const Zstring& sourceFile, //throw FileError, ErrorTargetPath bool copyFilePermissions, bool transactionalCopy, const std::function<void()>& onDeleteTargetFile, - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, InSyncAttributes* sourceAttr) { if (transactionalCopy) diff --git a/zen/file_handling.h b/zen/file_handling.h index c3ce1d83..b58f6c07 100644 --- a/zen/file_handling.h +++ b/zen/file_handling.h @@ -11,12 +11,11 @@ #include "zstring.h" #include "file_error.h" #include "file_id_def.h" -#include "int64.h" namespace zen { -bool fileExists (const Zstring& filename); //noexcept; check whether file or file-symlink exists -bool dirExists (const Zstring& dirname ); //noexcept; check whether directory or dir-symlink exists +bool fileExists (const Zstring& filepath); //noexcept; check whether file or file-symlink exists +bool dirExists (const Zstring& dirpath ); //noexcept; check whether directory or dir-symlink exists bool symlinkExists (const Zstring& linkname); //noexcept; check whether a symbolic link exists bool somethingExists(const Zstring& objname ); //noexcept; check whether any object with this name exists @@ -26,21 +25,21 @@ enum class ProcSymlink FOLLOW }; -void setFileTime(const Zstring& filename, const Int64& modificationTime, ProcSymlink procSl); //throw FileError +void setFileTime(const Zstring& filepath, std::int64_t modificationTime, ProcSymlink procSl); //throw FileError //symlink handling: always evaluate target -UInt64 getFilesize(const Zstring& filename); //throw FileError -UInt64 getFreeDiskSpace(const Zstring& path); //throw FileError +std::uint64_t getFilesize(const Zstring& filepath); //throw FileError +std::uint64_t getFreeDiskSpace(const Zstring& path); //throw FileError -bool removeFile(const Zstring& filename); //throw FileError; return "false" if file is not existing +bool removeFile(const Zstring& filepath); //throw FileError; return "false" if file is not existing void removeDirectory(const Zstring& directory, //throw FileError - const std::function<void (const Zstring& filename)>& onBeforeFileDeletion = nullptr, //optional; - const std::function<void (const Zstring& dirname)>& onBeforeDirDeletion = nullptr); //one call for each *existing* object! + const std::function<void (const Zstring& filepath)>& onBeforeFileDeletion = nullptr, //optional; + const std::function<void (const Zstring& dirpath)>& onBeforeDirDeletion = nullptr); //one call for each *existing* object! //rename file or directory: no copying!!! void renameFile(const Zstring& oldName, const Zstring& newName); //throw FileError, ErrorDifferentVolume, ErrorTargetExisting -bool supportsPermissions(const Zstring& dirname); //throw FileError, dereferences symlinks +bool supportsPermissions(const Zstring& dirpath); //throw FileError, dereferences symlinks //if parent directory not existing: create recursively: void makeDirectory(const Zstring& directory, bool failIfExists = false); //throw FileError, ErrorTargetExisting @@ -52,8 +51,8 @@ void makeDirectoryPlain(const Zstring& directory, const Zstring& templateDir, bo struct InSyncAttributes { - UInt64 fileSize; - Int64 modificationTime; //time_t UTC compatible + std::uint64_t fileSize; + std::int64_t modificationTime; //time_t UTC compatible FileId sourceFileId; FileId targetFileId; }; @@ -64,11 +63,11 @@ void copyFile(const Zstring& sourceFile, //throw FileError, ErrorTargetPathMissi bool transactionalCopy, //if target is existing user needs to implement deletion: copyFile() NEVER overwrites target if already existing! //if transactionalCopy == true, full read access on source had been proven at this point, so it's safe to delete it. - const std::function<void()>& onDeleteTargetFile, //may be nullptr; throw X! + const std::function<void()>& onDeleteTargetFile, //may be nullptr; may throw! //Linux: unconditionally //Windows: first exception is swallowed, updateCopyStatus() is then called again where it should throw again and the exception will propagate as expected //accummulated delta != file size! consider ADS, sparse, compressed files - const std::function<void(Int64 bytesDelta)>& onUpdateCopyStatus, //may be nullptr; throw X! + const std::function<void(std::int64_t bytesDelta)>& onUpdateCopyStatus, //may be nullptr; may throw! InSyncAttributes* newAttrib = nullptr); //return current attributes at the time of copy diff --git a/zen/file_id_def.h b/zen/file_id_def.h index 0608aacd..daadd391 100644 --- a/zen/file_id_def.h +++ b/zen/file_id_def.h @@ -27,21 +27,21 @@ typedef ULONGLONG FileIndex; typedef std::pair<DeviceId, FileIndex> FileId; inline -FileId extractFileID(const BY_HANDLE_FILE_INFORMATION& fileInfo) +FileId extractFileId(const BY_HANDLE_FILE_INFORMATION& fileInfo) { - ULARGE_INTEGER uint = {}; - uint.HighPart = fileInfo.nFileIndexHigh; - uint.LowPart = fileInfo.nFileIndexLow; + ULARGE_INTEGER fileIndex = {}; + fileIndex.HighPart = fileInfo.nFileIndexHigh; + fileIndex.LowPart = fileInfo.nFileIndexLow; - return fileInfo.dwVolumeSerialNumber != 0 && uint.QuadPart != 0 ? - FileId(fileInfo.dwVolumeSerialNumber, uint.QuadPart) : FileId(); + return fileInfo.dwVolumeSerialNumber != 0 && fileIndex.QuadPart != 0 ? + FileId(fileInfo.dwVolumeSerialNumber, fileIndex.QuadPart) : FileId(); } inline -FileId extractFileID(DWORD dwVolumeSerialNumber, ULARGE_INTEGER fileId) +FileId extractFileId(DWORD volumeSerialNumber, ULONGLONG fileIndex) { - return dwVolumeSerialNumber != 0 && fileId.QuadPart != 0 ? - FileId(dwVolumeSerialNumber, fileId.QuadPart) : FileId(); + return volumeSerialNumber != 0 && fileIndex != 0 ? + FileId(volumeSerialNumber, fileIndex) : FileId(); } assert_static(sizeof(FileId().first ) == sizeof(BY_HANDLE_FILE_INFORMATION().dwVolumeSerialNumber)); @@ -58,7 +58,7 @@ typedef decltype(impl::StatDummy::st_ino) FileIndex; typedef std::pair<DeviceId, FileIndex> FileId; inline -FileId extractFileID(const struct ::stat& fileInfo) +FileId extractFileId(const struct ::stat& fileInfo) { return fileInfo.st_dev != 0 && fileInfo.st_ino != 0 ? FileId(fileInfo.st_dev, fileInfo.st_ino) : FileId(); diff --git a/zen/file_io.cpp b/zen/file_io.cpp index 82b1def5..e11a1201 100644 --- a/zen/file_io.cpp +++ b/zen/file_io.cpp @@ -24,7 +24,7 @@ namespace { #ifdef ZEN_WIN //(try to) enhance error messages by showing which processes lock the file -Zstring getLockingProcessNames(const Zstring& filename) //throw(), empty string if none found or error occurred +Zstring getLockingProcessNames(const Zstring& filepath) //throw(), empty string if none found or error occurred { if (vistaOrLater()) { @@ -33,7 +33,7 @@ Zstring getLockingProcessNames(const Zstring& filename) //throw(), empty string const DllFun<FunType_freeString> freeString (getDllName(), funName_freeString); if (getLockingProcesses && freeString) - if (const wchar_t* procList = getLockingProcesses(filename.c_str())) + if (const wchar_t* procList = getLockingProcesses(filepath.c_str())) { ZEN_ON_SCOPE_EXIT(freeString(procList)); return procList; @@ -43,11 +43,11 @@ Zstring getLockingProcessNames(const Zstring& filename) //throw(), empty string } #elif defined ZEN_LINUX || defined ZEN_MAC -//"filename" could be a named pipe which *blocks* forever during "open()"! https://sourceforge.net/p/freefilesync/bugs/221/ -void checkForUnsupportedType(const Zstring& filename) //throw FileError +//"filepath" could be a named pipe which *blocks* forever during "open()"! https://sourceforge.net/p/freefilesync/bugs/221/ +void checkForUnsupportedType(const Zstring& filepath) //throw FileError { struct ::stat fileInfo = {}; - if (::stat(filename.c_str(), &fileInfo) != 0) //follows symlinks + if (::stat(filepath.c_str(), &fileInfo) != 0) //follows symlinks return; //let the caller handle errors like "not existing" if (!S_ISREG(fileInfo.st_mode) && @@ -64,21 +64,21 @@ void checkForUnsupportedType(const Zstring& filename) //throw FileError const std::wstring numFmt = printNumber<std::wstring>(L"0%06o", m & S_IFMT); return name ? numFmt + L", " + name : numFmt; }; - throw FileError(replaceCpy(_("Type of item %x is not supported:"), L"%x", fmtFileName(filename)) + L" " + getTypeName(fileInfo.st_mode)); + throw FileError(replaceCpy(_("Type of item %x is not supported:"), L"%x", fmtFileName(filepath)) + L" " + getTypeName(fileInfo.st_mode)); } } #endif } -FileInput::FileInput(FileHandle handle, const Zstring& filename) : FileInputBase(filename), fileHandle(handle) {} +FileInput::FileInput(FileHandle handle, const Zstring& filepath) : FileInputBase(filepath), fileHandle(handle) {} -FileInput::FileInput(const Zstring& filename) : FileInputBase(filename) //throw FileError +FileInput::FileInput(const Zstring& filepath) : FileInputBase(filepath) //throw FileError { #ifdef ZEN_WIN const wchar_t functionName[] = L"CreateFile"; - fileHandle = ::CreateFile(applyLongPathPrefix(filename).c_str(), //_In_ LPCTSTR lpFileName, + fileHandle = ::CreateFile(applyLongPathPrefix(filepath).c_str(), //_In_ LPCTSTR lpFileName, GENERIC_READ, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, nullptr, //_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes, @@ -111,21 +111,21 @@ FileInput::FileInput(const Zstring& filename) : FileInputBase(filename) //throw nullptr); //_In_opt_ HANDLE hTemplateFile if (fileHandle == INVALID_HANDLE_VALUE) #elif defined ZEN_LINUX || defined ZEN_MAC - checkForUnsupportedType(filename); //throw FileError; reading a named pipe would block forever! + checkForUnsupportedType(filepath); //throw FileError; reading a named pipe would block forever! const wchar_t functionName[] = L"fopen"; - fileHandle = ::fopen(filename.c_str(), "r,type=record,noseek"); //utilize UTF-8 filename + fileHandle = ::fopen(filepath.c_str(), "r,type=record,noseek"); //utilize UTF-8 filepath if (!fileHandle) #endif { const ErrorCode lastError = getLastError(); //copy before making other system calls! - const std::wstring errorMsg = replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filename)); + const std::wstring errorMsg = replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filepath)); std::wstring errorDescr = formatSystemError(functionName, lastError); #ifdef ZEN_WIN if (lastError == ERROR_SHARING_VIOLATION || //-> enhance error message! lastError == ERROR_LOCK_VIOLATION) { - const Zstring procList = getLockingProcessNames(filename); //throw() + const Zstring procList = getLockingProcessNames(filepath); //throw() if (!procList.empty()) errorDescr = _("The file is locked by another process:") + L"\n" + procList; } @@ -184,18 +184,18 @@ size_t FileInput::read(void* buffer, size_t bytesToRead) //returns actual number } -FileOutput::FileOutput(FileHandle handle, const Zstring& filename) : FileOutputBase(filename), fileHandle(handle) {} +FileOutput::FileOutput(FileHandle handle, const Zstring& filepath) : FileOutputBase(filepath), fileHandle(handle) {} -FileOutput::FileOutput(const Zstring& filename, AccessFlag access) : //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting - FileOutputBase(filename) +FileOutput::FileOutput(const Zstring& filepath, AccessFlag access) : //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting + FileOutputBase(filepath) { #ifdef ZEN_WIN const DWORD dwCreationDisposition = access == FileOutput::ACC_OVERWRITE ? CREATE_ALWAYS : CREATE_NEW; auto getHandle = [&](DWORD dwFlagsAndAttributes) { - return ::CreateFile(applyLongPathPrefix(filename).c_str(), //_In_ LPCTSTR lpFileName, + return ::CreateFile(applyLongPathPrefix(filepath).c_str(), //_In_ LPCTSTR lpFileName, GENERIC_READ | GENERIC_WRITE, //_In_ DWORD dwDesiredAccess, /* http://msdn.microsoft.com/en-us/library/aa363858(v=vs.85).aspx quote: When an application creates a file across a network, it is better @@ -220,7 +220,7 @@ FileOutput::FileOutput(const Zstring& filename, AccessFlag access) : //throw Fil if (lastError == ERROR_ACCESS_DENIED && dwCreationDisposition == CREATE_ALWAYS) { - const DWORD attrib = ::GetFileAttributes(applyLongPathPrefix(filename).c_str()); + const DWORD attrib = ::GetFileAttributes(applyLongPathPrefix(filepath).c_str()); if (attrib != INVALID_FILE_ATTRIBUTES) { fileHandle = getHandle(attrib); //retry: alas this may still fail for hidden file, e.g. accessing shared folder in XP as Virtual Box guest! @@ -231,13 +231,13 @@ FileOutput::FileOutput(const Zstring& filename, AccessFlag access) : //throw Fil //begin of "regular" error reporting if (fileHandle == INVALID_HANDLE_VALUE) { - const std::wstring errorMsg = replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(filename)); + const std::wstring errorMsg = replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(filepath)); std::wstring errorDescr = formatSystemError(L"CreateFile", lastError); if (lastError == ERROR_SHARING_VIOLATION || //-> enhance error message! lastError == ERROR_LOCK_VIOLATION) { - const Zstring procList = getLockingProcessNames(filename); //throw() + const Zstring procList = getLockingProcessNames(filepath); //throw() if (!procList.empty()) errorDescr = _("The file is locked by another process:") + L"\n" + procList; } @@ -254,8 +254,8 @@ FileOutput::FileOutput(const Zstring& filename, AccessFlag access) : //throw Fil } #elif defined ZEN_LINUX || defined ZEN_MAC - checkForUnsupportedType(filename); //throw FileError; writing a named pipe would block forever! - fileHandle = ::fopen(filename.c_str(), + checkForUnsupportedType(filepath); //throw FileError; writing a named pipe would block forever! + fileHandle = ::fopen(filepath.c_str(), //GNU extension: https://www.securecoding.cert.org/confluence/display/cplusplus/FIO03-CPP.+Do+not+make+assumptions+about+fopen()+and+file+creation access == ACC_OVERWRITE ? "w,type=record,noseek" : "wx,type=record,noseek"); if (!fileHandle) @@ -311,13 +311,13 @@ void FileOutput::write(const void* buffer, size_t bytesToWrite) //throw FileErro #if defined ZEN_LINUX || defined ZEN_MAC //Compare copy_reg() in copy.c: ftp://ftp.gnu.org/gnu/coreutils/coreutils-5.0.tar.gz -FileInputUnbuffered::FileInputUnbuffered(const Zstring& filename) : FileInputBase(filename) //throw FileError +FileInputUnbuffered::FileInputUnbuffered(const Zstring& filepath) : FileInputBase(filepath) //throw FileError { - checkForUnsupportedType(filename); //throw FileError; reading a named pipe would block forever! + checkForUnsupportedType(filepath); //throw FileError; reading a named pipe would block forever! - fdFile = ::open(filename.c_str(), O_RDONLY); + fdFile = ::open(filepath.c_str(), O_RDONLY); if (fdFile == -1) //don't check "< 0" -> docu seems to allow "-2" to be a valid file handle - throwFileError(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filename)), L"open", getLastError()); + throwFileError(replaceCpy(_("Cannot open file %x."), L"%x", fmtFileName(filepath)), L"open", getLastError()); } @@ -348,16 +348,16 @@ size_t FileInputUnbuffered::read(void* buffer, size_t bytesToRead) //throw FileE } -FileOutputUnbuffered::FileOutputUnbuffered(const Zstring& filename, mode_t mode) : FileOutputBase(filename) //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting +FileOutputUnbuffered::FileOutputUnbuffered(const Zstring& filepath, mode_t mode) : FileOutputBase(filepath) //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting { - //checkForUnsupportedType(filename); -> not needed, open() + O_EXCL shoul fail fast + //checkForUnsupportedType(filepath); -> not needed, open() + O_EXCL shoul fail fast //overwrite is: O_CREAT | O_WRONLY | O_TRUNC - fdFile = ::open(filename.c_str(), O_CREAT | O_WRONLY | O_EXCL, mode & (S_IRWXU | S_IRWXG | S_IRWXO)); + fdFile = ::open(filepath.c_str(), O_CREAT | O_WRONLY | O_EXCL, mode & (S_IRWXU | S_IRWXG | S_IRWXO)); if (fdFile == -1) { const int lastError = errno; //copy before making other system calls! - const std::wstring errorMsg = replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(filename)); + const std::wstring errorMsg = replaceCpy(_("Cannot write file %x."), L"%x", fmtFileName(filepath)); const std::wstring errorDescr = formatSystemError(L"open", lastError); if (lastError == EEXIST) @@ -370,7 +370,7 @@ FileOutputUnbuffered::FileOutputUnbuffered(const Zstring& filename, mode_t mode) } } -FileOutputUnbuffered::FileOutputUnbuffered(int fd, const Zstring& filename) : FileOutputBase(filename), fdFile(fd) {} +FileOutputUnbuffered::FileOutputUnbuffered(int fd, const Zstring& filepath) : FileOutputBase(filepath), fdFile(fd) {} FileOutputUnbuffered::~FileOutputUnbuffered() { ::close(fdFile); } diff --git a/zen/file_io.h b/zen/file_io.h index 2e9e828e..5ae6eb1c 100644 --- a/zen/file_io.h +++ b/zen/file_io.h @@ -37,11 +37,11 @@ typedef FILE* FileHandle; class FileInput : public FileInputBase { public: - FileInput(const Zstring& filename); //throw FileError - FileInput(FileHandle handle, const Zstring& filename); //takes ownership! + FileInput(const Zstring& filepath); //throw FileError + FileInput(FileHandle handle, const Zstring& filepath); //takes ownership! ~FileInput(); - virtual size_t read(void* buffer, size_t bytesToRead); //throw FileError; returns actual number of bytes read + virtual size_t read(void* buffer, size_t bytesToRead) override; //throw FileError; returns actual number of bytes read //expected to fill buffer completely unless "end of file" private: @@ -52,11 +52,11 @@ private: class FileOutput : public FileOutputBase { public: - FileOutput(const Zstring& filename, AccessFlag access); //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting - FileOutput(FileHandle handle, const Zstring& filename); //takes ownership! + FileOutput(const Zstring& filepath, AccessFlag access); //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting + FileOutput(FileHandle handle, const Zstring& filepath); //takes ownership! ~FileOutput(); - virtual void write(const void* buffer, size_t bytesToWrite); //throw FileError + virtual void write(const void* buffer, size_t bytesToWrite) override; //throw FileError private: FileHandle fileHandle; @@ -66,11 +66,11 @@ private: class FileInputUnbuffered : public FileInputBase { public: - FileInputUnbuffered(const Zstring& filename); //throw FileError + FileInputUnbuffered(const Zstring& filepath); //throw FileError ~FileInputUnbuffered(); //considering safe-read.c it seems buffer size should be a multiple of 8192 - virtual size_t read(void* buffer, size_t bytesToRead); //throw FileError; returns actual number of bytes read + virtual size_t read(void* buffer, size_t bytesToRead) override; //throw FileError; returns actual number of bytes read //do NOT rely on partially filled buffer meaning EOF! int getDescriptor() { return fdFile;} @@ -83,11 +83,11 @@ class FileOutputUnbuffered : public FileOutputBase { public: //creates a new file (no overwrite allowed!) - FileOutputUnbuffered(const Zstring& filename, mode_t mode); //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting - FileOutputUnbuffered(int fd, const Zstring& filename); //takes ownership! + FileOutputUnbuffered(const Zstring& filepath, mode_t mode); //throw FileError, ErrorTargetPathMissing, ErrorTargetExisting + FileOutputUnbuffered(int fd, const Zstring& filepath); //takes ownership! ~FileOutputUnbuffered(); - virtual void write(const void* buffer, size_t bytesToWrite); //throw FileError + virtual void write(const void* buffer, size_t bytesToWrite) override; //throw FileError int getDescriptor() { return fdFile;} private: diff --git a/zen/file_traverser.cpp b/zen/file_traverser.cpp index 65d95f4a..d8f2d0cf 100644 --- a/zen/file_traverser.cpp +++ b/zen/file_traverser.cpp @@ -8,9 +8,10 @@ #include "sys_error.h" #include "assert_static.h" #include "symlink_target.h" +#include "int64.h" #ifdef ZEN_WIN -#include <zen/win_ver.h> +#include "win_ver.h" #include "long_path_prefix.h" #include "dst_hack.h" #include "file_handling.h" //remove this huge dependency when getting rid of DST hack!! until then we need "setFileTime" @@ -18,7 +19,7 @@ #include "FindFilePlus/find_file_plus.h" #elif defined ZEN_MAC -#include <zen/osx_string.h> +#include "osx_string.h" #endif #if defined ZEN_LINUX || defined ZEN_MAC @@ -29,7 +30,7 @@ using namespace zen; - + namespace { //implement "retry" in a generic way: @@ -78,7 +79,7 @@ bool tryReportingItemError(Command cmd, zen::TraverseCallback& callback, const Z #ifdef ZEN_WIN -void getInfoFromFileSymlink(const Zstring& linkName, zen::TraverseCallback::FileInfo& output) //throw FileError +TraverseCallback::FileInfo getInfoFromFileSymlink(const Zstring& linkName) //throw FileError { //open handle to target of symbolic link HANDLE hFile = ::CreateFile(zen::applyLongPathPrefix(linkName).c_str(), //_In_ LPCTSTR lpFileName, @@ -104,11 +105,12 @@ void getInfoFromFileSymlink(const Zstring& linkName, zen::TraverseCallback::File if (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) throw FileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtFileName(linkName)), formatSystemError(L"GetFileInformationByHandle", static_cast<DWORD>(ERROR_FILE_INVALID))); - //write output - output.fileSize = UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); - output.lastWriteTime = toTimeT(fileInfo.ftLastWriteTime); - output.id = extractFileID(fileInfo); //consider detection of moved files: allow for duplicate file ids, renaming affects symlink, not target, ... + TraverseCallback::FileInfo output; + output.fileSize = get64BitUInt(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); + output.lastWriteTime = filetimeToTimeT(fileInfo.ftLastWriteTime); + output.id = extractFileId(fileInfo); //consider detection of moved files: allow for duplicate file ids, renaming affects symlink, not target, ... //output.symlinkInfo -> not filled here + return output; } @@ -154,17 +156,17 @@ struct TraverserPolicy //see "policy based design" typedef ... DirHandle; typedef ... FindData; -static void create(const Zstring& directory, DirHandle& hnd); //throw FileError - *no* concession to FindFirstFile(): open handle only, *no* return of data! +static DirHandle create(const Zstring& directory); //throw FileError - don't follow FindFirstFile() design: open handle only, *no* return of data! static void destroy(DirHandle hnd); //throw() static bool getEntry(DirHandle hnd, const Zstring& directory, FindData& fileInfo) //throw FileError, NeedFallbackToWin32Traverser -> fallback to FindFirstFile()/FindNextFile() //FindData "member" functions -static void extractFileInfo (const FindData& fileInfo, DWORD volumeSerial, TraverseCallback::FileInfo& output); //volumeSerial may be 0 if not available! -static Int64 getModTime (const FindData& fileInfo); +static TraverseCallback::FileInfo extractFileInfo(const FindData& fileInfo, DWORD volumeSerial); //volumeSerial may be 0 if not available! +static std::int64_t getModTime (const FindData& fileInfo); static const FILETIME& getModTimeRaw (const FindData& fileInfo); //yet another concession to DST hack static const FILETIME& getCreateTimeRaw(const FindData& fileInfo); // -static const wchar_t* getShortName (const FindData& fileInfo); +static const wchar_t* getItemName (const FindData& fileInfo); static bool isDirectory (const FindData& fileInfo); static bool isSymlink (const FindData& fileInfo); } @@ -177,40 +179,41 @@ struct Win32Traverser { struct DirHandle { - DirHandle() : searchHandle(nullptr), haveData(true), data() {} + DirHandle(HANDLE hnd, const WIN32_FIND_DATA& d) : searchHandle(hnd), haveData(true), data(d) {} + explicit DirHandle(HANDLE hnd) : searchHandle(hnd), haveData(false) {} HANDLE searchHandle; - bool haveData; WIN32_FIND_DATA data; }; typedef WIN32_FIND_DATA FindData; - static void create(const Zstring& dirname, DirHandle& hnd) //throw FileError + static DirHandle create(const Zstring& dirpath) //throw FileError { - const Zstring& dirnamePf = appendSeparator(dirname); + const Zstring& dirpathPf = appendSeparator(dirpath); - hnd.searchHandle = ::FindFirstFile(applyLongPathPrefix(dirnamePf + L'*').c_str(), &hnd.data); + WIN32_FIND_DATA fileData = {}; + HANDLE hnd = ::FindFirstFile(applyLongPathPrefix(dirpathPf + L'*').c_str(), &fileData); //no noticable performance difference compared to FindFirstFileEx with FindExInfoBasic, FIND_FIRST_EX_CASE_SENSITIVE and/or FIND_FIRST_EX_LARGE_FETCH - if (hnd.searchHandle == INVALID_HANDLE_VALUE) + if (hnd == INVALID_HANDLE_VALUE) { const DWORD lastError = ::GetLastError(); //copy before making other system calls! - hnd.haveData = false; if (lastError == ERROR_FILE_NOT_FOUND) { //1. directory may not exist *or* 2. it is completely empty: not all directories contain "., .." entries, e.g. a drive's root directory; NetDrive // -> FindFirstFile() is a nice example of violation of API design principle of single responsibility - if (dirExists(dirname)) //yes, a race-condition, still the best we can do - return; + if (dirExists(dirpath)) //yes, a race-condition, still the best we can do + return DirHandle(hnd); } - throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtFileName(dirname)), L"FindFirstFile", lastError); + throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtFileName(dirpath)), L"FindFirstFile", lastError); } + return DirHandle(hnd, fileData); } static void destroy(const DirHandle& hnd) { ::FindClose(hnd.searchHandle); } //throw() - static bool getEntry(DirHandle& hnd, const Zstring& dirname, FindData& fileInfo) //throw FileError + static bool getEntry(DirHandle& hnd, const Zstring& dirpath, FindData& fileInfo) //throw FileError { if (hnd.searchHandle == INVALID_HANDLE_VALUE) //handle special case of "truly empty directories" return false; @@ -228,22 +231,25 @@ struct Win32Traverser if (lastError == ERROR_NO_MORE_FILES) //not an error situation return false; //else we have a problem... report it: - throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtFileName(dirname)), L"FindNextFile", lastError); + throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtFileName(dirpath)), L"FindNextFile", lastError); } return true; } - static void extractFileInfo(const FindData& fileInfo, DWORD volumeSerial, TraverseCallback::FileInfo& output) + static TraverseCallback::FileInfo extractFileInfo(const FindData& fileInfo, DWORD volumeSerial) { - output.fileSize = UInt64(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); + TraverseCallback::FileInfo output; + output.fileSize = get64BitUInt(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); output.lastWriteTime = getModTime(fileInfo); - output.id = FileId(); + //output.id = FileId(); + //output.symlinkInfo = nullptr; + return output; } - static Int64 getModTime (const FindData& fileInfo) { return toTimeT(fileInfo.ftLastWriteTime); } + static std::int64_t getModTime (const FindData& fileInfo) { return filetimeToTimeT(fileInfo.ftLastWriteTime); } static const FILETIME& getModTimeRaw (const FindData& fileInfo) { return fileInfo.ftLastWriteTime; } static const FILETIME& getCreateTimeRaw(const FindData& fileInfo) { return fileInfo.ftCreationTime; } - static const wchar_t* getShortName (const FindData& fileInfo) { return fileInfo.cFileName; } + static const wchar_t* getItemName (const FindData& fileInfo) { return fileInfo.cFileName; } static bool isDirectory (const FindData& fileInfo) { return (fileInfo.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } static bool isSymlink (const FindData& fileInfo) { return zen::isSymlink(fileInfo); } //[!] keep namespace }; @@ -256,23 +262,25 @@ struct FilePlusTraverser { struct DirHandle { - DirHandle() : searchHandle(nullptr) {} + explicit DirHandle(findplus::FindHandle hnd) : searchHandle(hnd) {} findplus::FindHandle searchHandle; }; typedef findplus::FileInformation FindData; - static void create(const Zstring& dirname, DirHandle& hnd) //throw FileError + static DirHandle create(const Zstring& dirpath) //throw FileError { - hnd.searchHandle = ::openDir(applyLongPathPrefix(dirname).c_str()); - if (hnd.searchHandle == nullptr) - throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtFileName(dirname)), L"openDir", getLastError()); + const findplus::FindHandle hnd = ::openDir(applyLongPathPrefix(dirpath).c_str()); + if (!hnd) + throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtFileName(dirpath)), L"openDir", getLastError()); + + return DirHandle(hnd); } static void destroy(DirHandle hnd) { ::closeDir(hnd.searchHandle); } //throw() - static bool getEntry(DirHandle hnd, const Zstring& dirname, FindData& fileInfo) //throw FileError, NeedFallbackToWin32Traverser + static bool getEntry(DirHandle hnd, const Zstring& dirpath, FindData& fileInfo) //throw FileError, NeedFallbackToWin32Traverser { if (!::readDir(hnd.searchHandle, fileInfo)) { @@ -289,23 +297,26 @@ struct FilePlusTraverser //fallback should apply to whole directory sub-tree! => client needs to handle duplicate file notifications! //else we have a problem... report it: - throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtFileName(dirname)), L"readDir", lastError); + throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtFileName(dirpath)), L"readDir", lastError); } return true; } - static void extractFileInfo(const FindData& fileInfo, DWORD volumeSerial, TraverseCallback::FileInfo& output) + static TraverseCallback::FileInfo extractFileInfo(const FindData& fileInfo, DWORD volumeSerial) { - output.fileSize = fileInfo.fileSize.QuadPart; + TraverseCallback::FileInfo output; + output.fileSize = fileInfo.fileSize; output.lastWriteTime = getModTime(fileInfo); - output.id = extractFileID(volumeSerial, fileInfo.fileId); + output.id = extractFileId(volumeSerial, fileInfo.fileId); + //output.symlinkInfo = nullptr; + return output; } - static Int64 getModTime (const FindData& fileInfo) { return toTimeT(fileInfo.lastWriteTime); } + static std::int64_t getModTime (const FindData& fileInfo) { return filetimeToTimeT(fileInfo.lastWriteTime); } static const FILETIME& getModTimeRaw (const FindData& fileInfo) { return fileInfo.lastWriteTime; } static const FILETIME& getCreateTimeRaw(const FindData& fileInfo) { return fileInfo.creationTime; } - static const wchar_t* getShortName (const FindData& fileInfo) { return fileInfo.shortName; } + static const wchar_t* getItemName (const FindData& fileInfo) { return fileInfo.shortName; } static bool isDirectory (const FindData& fileInfo) { return (fileInfo.fileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } static bool isSymlink (const FindData& fileInfo) { return zen::isSymlink(fileInfo.fileAttributes, fileInfo.reparseTag); } //[!] keep namespace }; @@ -320,139 +331,15 @@ public: } private: - DirTraverser(const Zstring& baseDirectory, TraverseCallback& sink, DstHackCallback* dstCallback) : - needDstHack(dstCallback ? dst::isFatDrive(baseDirectory) : false) - { - try //traversing certain folders with restricted permissions requires this privilege! (but copying these files may still fail) - { - activatePrivilege(SE_BACKUP_NAME); //throw FileError - } - catch (FileError&) {} //don't cause issues in user mode - - if (::openDir && ::readDir && ::closeDir) - { - try - { - traverse<FilePlusTraverser>(baseDirectory, sink, retrieveVolumeSerial(baseDirectory)); //throw NeedFallbackToWin32Traverser; retrieveVolumeSerial returns 0 on error - } - catch (NeedFallbackToWin32Traverser&) { traverse<Win32Traverser>(baseDirectory, sink, 0); } - } - else //fallback - traverse<Win32Traverser>(baseDirectory, sink, 0); - - //apply daylight saving time hack AFTER file traversing, to give separate feedback to user - if (needDstHack) - if (dstCallback) //bound if "needDstHack == true" - applyDstHack(*dstCallback); - } - - DirTraverser(const DirTraverser&); - DirTraverser& operator=(const DirTraverser&); + DirTraverser(const Zstring& baseDirectory, TraverseCallback& sink, DstHackCallback* dstCallback); + DirTraverser (const DirTraverser&) = delete; + DirTraverser& operator=(const DirTraverser&) = delete; template <class Trav> - void traverse(const Zstring& dirname, zen::TraverseCallback& sink, DWORD volumeSerial /*may be 0!*/) //throw NeedFallbackToWin32Traverser - { - //no need to check for endless recursion: Windows seems to have an internal path limit of about 700 chars - - typename Trav::DirHandle searchHandle; - - if (!tryReportingDirError([&] { Trav::create(dirname, searchHandle); /*throw FileError*/ }, sink)) - return; //ignored error - ZEN_ON_SCOPE_EXIT(Trav::destroy(searchHandle)); - - typename Trav::FindData findData = {}; - - for (;;) - { - bool gotEntry = false; - tryReportingDirError([&] - { - gotEntry = Trav::getEntry(searchHandle, dirname, findData); //throw FileError, NeedFallbackToWin32Traverser - }, sink); - if (!gotEntry) //no more items or ignored error - return; - - //skip "." and ".." - const Zchar* const shortName = Trav::getShortName(findData); - if (shortName[0] == L'.' && - (shortName[1] == 0 || (shortName[1] == L'.' && shortName[2] == 0))) - continue; - - const Zstring& fullName = appendSeparator(dirname) + shortName; - - if (Trav::isSymlink(findData)) //check first! - { - TraverseCallback::SymlinkInfo linkInfo; - linkInfo.lastWriteTime = Trav::getModTime (findData); - - switch (sink.onSymlink(shortName, fullName, linkInfo)) - { - case TraverseCallback::LINK_FOLLOW: - if (Trav::isDirectory(findData)) - { - if (TraverseCallback* trav = sink.onDir(shortName, fullName)) - { - ZEN_ON_SCOPE_EXIT(sink.releaseDirTraverser(trav)); - try - { - traverse<Trav>(fullName, *trav, retrieveVolumeSerial(fullName)); //throw NeedFallbackToWin32Traverser; symlink may link to different volume => redetermine volume serial! - } - catch (NeedFallbackToWin32Traverser&) { traverse<Win32Traverser>(fullName, *trav, 0); } - } - } - else //a file - { - TraverseCallback::FileInfo targetInfo; - const bool validLink = tryReportingItemError([&] //try to resolve symlink (and report error on failure!!!) - { - getInfoFromFileSymlink(fullName, targetInfo); //throw FileError - targetInfo.symlinkInfo = &linkInfo; - }, sink, shortName); - - if (validLink) - sink.onFile(shortName, fullName, targetInfo); - // else //broken symlink -> ignore: it's client's responsibility to handle error! - } - break; - - case TraverseCallback::LINK_SKIP: - break; - } - } - else if (Trav::isDirectory(findData)) - { - if (TraverseCallback* trav = sink.onDir(shortName, fullName)) - { - ZEN_ON_SCOPE_EXIT(sink.releaseDirTraverser(trav)); - try - { - traverse<Trav>(fullName, *trav, volumeSerial); //throw NeedFallbackToWin32Traverser - } - catch (NeedFallbackToWin32Traverser&) { traverse<Win32Traverser>(fullName, *trav, 0); } - } - } - else //a file - { - TraverseCallback::FileInfo fileInfo; - Trav::extractFileInfo(findData, volumeSerial, fileInfo); - - //####################################### DST hack ########################################### - if (needDstHack) - { - const dst::RawTime rawTime(Trav::getCreateTimeRaw(findData), Trav::getModTimeRaw(findData)); - - if (dst::fatHasUtcEncoded(rawTime)) //throw std::runtime_error - fileInfo.lastWriteTime = toTimeT(dst::fatDecodeUtcTime(rawTime)); //return real UTC time; throw std::runtime_error - else - markForDstHack.push_back(std::make_pair(fullName, toTimeT(rawTime.writeTimeRaw))); - } - //####################################### DST hack ########################################### - - sink.onFile(shortName, fullName, fileInfo); - } - } - } + void traverse(const Zstring& dirpath, TraverseCallback& sink, DWORD volumeSerial); + template <class Trav> + void traverseWithException(const Zstring& dirpath, TraverseCallback& sink, DWORD volumeSerial /*may be 0!*/); //throw FileError, NeedFallbackToWin32Traverser //####################################### DST hack ########################################### void applyDstHack(zen::DstHackCallback& dstCallback) @@ -482,7 +369,7 @@ private: //even at this point it's not sure whether data was written correctly, again cloud storages tend to lie about success status if (filesToValidate-- > 0) { - const dst::RawTime encodedTime = dst::fatEncodeUtcTime(toFileTime(it->second)); //throw std::runtime_error + const dst::RawTime encodedTime = dst::fatEncodeUtcTime(timetToFileTime(it->second)); //throw std::runtime_error //dst hack: verify data written; attention: this check may fail for "sync.ffs_lock" WIN32_FILE_ATTRIBUTE_DATA debugeAttr = {}; @@ -502,11 +389,144 @@ private: } const bool needDstHack; - typedef std::vector<std::pair<Zstring, Int64>> FilenameTimeList; + typedef std::vector<std::pair<Zstring, std::int64_t>> FilenameTimeList; FilenameTimeList markForDstHack; //####################################### DST hack ########################################### }; + +template <> inline +void DirTraverser::traverse<Win32Traverser>(const Zstring& dirpath, TraverseCallback& sink, DWORD volumeSerial) +{ + tryReportingDirError([&] + { + traverseWithException<Win32Traverser>(dirpath, sink, 0); //throw FileError + }, sink); +} + + +template <> inline +void DirTraverser::traverse<FilePlusTraverser>(const Zstring& dirpath, TraverseCallback& sink, DWORD volumeSerial) +{ + try + { + tryReportingDirError([&] + { + traverseWithException<FilePlusTraverser>(dirpath, sink, volumeSerial); //throw FileError, NeedFallbackToWin32Traverser + }, sink); + } + catch (NeedFallbackToWin32Traverser&) { traverse<Win32Traverser>(dirpath, sink, 0); } +} + + +inline +DirTraverser::DirTraverser(const Zstring& baseDirectory, TraverseCallback& sink, DstHackCallback* dstCallback) : + needDstHack(dstCallback ? dst::isFatDrive(baseDirectory) : false) +{ + try //traversing certain folders with restricted permissions requires this privilege! (but copying these files may still fail) + { + activatePrivilege(SE_BACKUP_NAME); //throw FileError + } + catch (FileError&) {} //don't cause issues in user mode + + if (::openDir && ::readDir && ::closeDir) + traverse<FilePlusTraverser>(baseDirectory, sink, retrieveVolumeSerial(baseDirectory)); //retrieveVolumeSerial returns 0 on error + else //fallback + traverse<Win32Traverser>(baseDirectory, sink, 0); + + //apply daylight saving time hack AFTER file traversing, to give separate feedback to user + if (needDstHack) + if (dstCallback) //bound if "needDstHack == true" + applyDstHack(*dstCallback); +} + + +template <class Trav> +void DirTraverser::traverseWithException(const Zstring& dirpath, TraverseCallback& sink, DWORD volumeSerial /*may be 0!*/) //throw FileError, NeedFallbackToWin32Traverser +{ + //no need to check for endless recursion: Windows seems to have an internal path limit of about 700 chars + + typename Trav::DirHandle searchHandle = Trav::create(dirpath); //throw FileError + ZEN_ON_SCOPE_EXIT(Trav::destroy(searchHandle)); + + typename Trav::FindData findData = {}; + + while (Trav::getEntry(searchHandle, dirpath, findData)) //throw FileError, NeedFallbackToWin32Traverser + //don't retry but restart dir traversal on error! http://blogs.msdn.com/b/oldnewthing/archive/2014/06/12/10533529.aspx + { + //skip "." and ".." + const Zchar* const shortName = Trav::getItemName(findData); + if (shortName[0] == L'.' && + (shortName[1] == 0 || (shortName[1] == L'.' && shortName[2] == 0))) + continue; + + const Zstring& itempath = appendSeparator(dirpath) + shortName; + + if (Trav::isSymlink(findData)) //check first! + { + TraverseCallback::SymlinkInfo linkInfo; + linkInfo.lastWriteTime = Trav::getModTime (findData); + + switch (sink.onSymlink(shortName, itempath, linkInfo)) + { + case TraverseCallback::LINK_FOLLOW: + if (Trav::isDirectory(findData)) + { + if (TraverseCallback* trav = sink.onDir(shortName, itempath)) + { + ZEN_ON_SCOPE_EXIT(sink.releaseDirTraverser(trav)); + traverse<Trav>(itempath, *trav, retrieveVolumeSerial(itempath)); //symlink may link to different volume => redetermine volume serial! + } + } + else //a file + { + TraverseCallback::FileInfo targetInfo; + const bool validLink = tryReportingItemError([&] //try to resolve symlink (and report error on failure!!!) + { + targetInfo = getInfoFromFileSymlink(itempath); //throw FileError + targetInfo.symlinkInfo = &linkInfo; + }, sink, shortName); + + if (validLink) + sink.onFile(shortName, itempath, targetInfo); + // else //broken symlink -> ignore: it's client's responsibility to handle error! + } + break; + + case TraverseCallback::LINK_SKIP: + break; + } + } + else if (Trav::isDirectory(findData)) + { + if (TraverseCallback* trav = sink.onDir(shortName, itempath)) + { + ZEN_ON_SCOPE_EXIT(sink.releaseDirTraverser(trav)); + traverse<Trav>(itempath, *trav, volumeSerial); + } + } + else //a file + { + TraverseCallback::FileInfo fileInfo = Trav::extractFileInfo(findData, volumeSerial); + + //####################################### DST hack ########################################### + if (needDstHack) + { + const dst::RawTime rawTime(Trav::getCreateTimeRaw(findData), Trav::getModTimeRaw(findData)); + + if (dst::fatHasUtcEncoded(rawTime)) //throw std::runtime_error + fileInfo.lastWriteTime = filetimeToTimeT(dst::fatDecodeUtcTime(rawTime)); //return real UTC time; throw std::runtime_error + else + markForDstHack.push_back(std::make_pair(itempath, filetimeToTimeT(rawTime.writeTimeRaw))); + } + //####################################### DST hack ########################################### + + sink.onFile(shortName, itempath, fileInfo); + } + } +} + + #elif defined ZEN_LINUX || defined ZEN_MAC class DirTraverser { @@ -535,32 +555,34 @@ private: traverse(directoryFormatted, sink); } - DirTraverser(const DirTraverser&); - DirTraverser& operator=(const DirTraverser&); + DirTraverser (const DirTraverser&) = delete; + DirTraverser& operator=(const DirTraverser&) = delete; - void traverse(const Zstring& dirname, zen::TraverseCallback& sink) + void traverse(const Zstring& dirpath, TraverseCallback& sink) { - //no need to check for endless recursion: Linux has a fixed limit on the number of symbolic links in a path + tryReportingDirError([&] + { + traverseWithException(dirpath, sink); //throw FileError + }, sink); + } - DIR* dirObj = nullptr; - if (!tryReportingDirError([&] + void traverseWithException(const Zstring& dirpath, TraverseCallback& sink) //throw FileError { - dirObj = ::opendir(dirname.c_str()); //directory must NOT end with path separator, except "/" - if (!dirObj) - throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtFileName(dirname)), L"opendir", getLastError()); - }, sink)) - return; //ignored error + //no need to check for endless recursion: Linux has a fixed limit on the number of symbolic links in a path + + DIR* dirObj = ::opendir(dirpath.c_str()); //directory must NOT end with path separator, except "/" + if (!dirObj) + throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtFileName(dirpath)), L"opendir", getLastError()); ZEN_ON_SCOPE_EXIT(::closedir(dirObj)); //never close nullptr handles! -> crash for (;;) { struct ::dirent* dirEntry = nullptr; - tryReportingDirError([&] - { - if (::readdir_r(dirObj, reinterpret_cast< ::dirent*>(&buffer[0]), &dirEntry) != 0) - throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtFileName(dirname)), L"readdir_r", getLastError()); - }, sink); - if (!dirEntry) //no more items or ignored error + if (::readdir_r(dirObj, reinterpret_cast< ::dirent*>(&buffer[0]), &dirEntry) != 0) + throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtFileName(dirpath)), L"readdir_r", getLastError()); + //don't retry but restart dir traversal on error! http://blogs.msdn.com/b/oldnewthing/archive/2014/06/12/10533529.aspx + + if (!dirEntry) //no more items return; //don't return "." and ".." @@ -588,13 +610,13 @@ private: //const char* sampleDecomposed = "\x6f\xcc\x81.txt"; //const char* samplePrecomposed = "\xc3\xb3.txt"; #endif - const Zstring& fullName = appendSeparator(dirname) + shortName; + const Zstring& itempath = appendSeparator(dirpath) + shortName; struct ::stat statData = {}; if (!tryReportingItemError([&] { - if (::lstat(fullName.c_str(), &statData) != 0) //lstat() does not resolve symlinks - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(fullName)), L"lstat", getLastError()); + if (::lstat(itempath.c_str(), &statData) != 0) //lstat() does not resolve symlinks + throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtFileName(itempath)), L"lstat", getLastError()); }, sink, shortName)) continue; //ignore error: skip file @@ -603,7 +625,7 @@ private: TraverseCallback::SymlinkInfo linkInfo; linkInfo.lastWriteTime = statData.st_mtime; //UTC time (ANSI C format); unit: 1 second - switch (sink.onSymlink(shortName, fullName, linkInfo)) + switch (sink.onSymlink(shortName, itempath, linkInfo)) { case TraverseCallback::LINK_FOLLOW: { @@ -611,28 +633,28 @@ private: struct ::stat statDataTrg = {}; bool validLink = tryReportingItemError([&] { - if (::stat(fullName.c_str(), &statDataTrg) != 0) - throwFileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtFileName(fullName)), L"stat", getLastError()); + if (::stat(itempath.c_str(), &statDataTrg) != 0) + throwFileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtFileName(itempath)), L"stat", getLastError()); }, sink, shortName); if (validLink) { if (S_ISDIR(statDataTrg.st_mode)) //a directory { - if (TraverseCallback* trav = sink.onDir(shortName, fullName)) + if (TraverseCallback* trav = sink.onDir(shortName, itempath)) { ZEN_ON_SCOPE_EXIT(sink.releaseDirTraverser(trav)); - traverse(fullName, *trav); + traverse(itempath, *trav); } } else //a file or named pipe, ect. { TraverseCallback::FileInfo fileInfo; - fileInfo.fileSize = zen::UInt64(statDataTrg.st_size); + fileInfo.fileSize = statDataTrg.st_size; fileInfo.lastWriteTime = statDataTrg.st_mtime; //UTC time (time_t format); unit: 1 second - fileInfo.id = extractFileID(statDataTrg); + fileInfo.id = extractFileId(statDataTrg); fileInfo.symlinkInfo = &linkInfo; - sink.onFile(shortName, fullName, fileInfo); + sink.onFile(shortName, itempath, fileInfo); } } // else //broken symlink -> ignore: it's client's responsibility to handle error! @@ -645,20 +667,20 @@ private: } else if (S_ISDIR(statData.st_mode)) //a directory { - if (TraverseCallback* trav = sink.onDir(shortName, fullName)) + if (TraverseCallback* trav = sink.onDir(shortName, itempath)) { ZEN_ON_SCOPE_EXIT(sink.releaseDirTraverser(trav)); - traverse(fullName, *trav); + traverse(itempath, *trav); } } else //a file or named pipe, ect. { TraverseCallback::FileInfo fileInfo; - fileInfo.fileSize = zen::UInt64(statData.st_size); + fileInfo.fileSize = statData.st_size; fileInfo.lastWriteTime = statData.st_mtime; //UTC time (time_t format); unit: 1 second - fileInfo.id = extractFileID(statData); + fileInfo.id = extractFileId(statData); - sink.onFile(shortName, fullName, fileInfo); + sink.onFile(shortName, itempath, fileInfo); } /* It may be a good idea to not check "S_ISREG(statData.st_mode)" explicitly and to not issue an error message on other types to support these scenarios: @@ -679,7 +701,12 @@ private: } -void zen::traverseFolder(const Zstring& dirname, TraverseCallback& sink, DstHackCallback* dstCallback) +void zen::traverseFolder(const Zstring& dirpath, TraverseCallback& sink, DstHackCallback* dstCallback) { - DirTraverser::execute(dirname, sink, dstCallback); + warn_static("let's tentatively disable the DST hack:") + DirTraverser::execute(dirpath, sink, nullptr); + return; +#if 0 + DirTraverser::execute(dirpath, sink, dstCallback); +#endif } diff --git a/zen/file_traverser.h b/zen/file_traverser.h index db93a688..f240d8c7 100644 --- a/zen/file_traverser.h +++ b/zen/file_traverser.h @@ -7,8 +7,8 @@ #ifndef FILETRAVERSER_H_INCLUDED #define FILETRAVERSER_H_INCLUDED +#include <cstdint> #include "zstring.h" -#include "int64.h" #include "file_id_def.h" //advanced file traverser returning metadata and hierarchical information on files and directories @@ -21,14 +21,17 @@ struct TraverseCallback struct SymlinkInfo { - Int64 lastWriteTime; //number of seconds since Jan. 1st 1970 UTC + SymlinkInfo() : lastWriteTime() {} + + std::int64_t lastWriteTime; //number of seconds since Jan. 1st 1970 UTC }; struct FileInfo { - FileInfo() : symlinkInfo() {} - UInt64 fileSize; //unit: bytes! - Int64 lastWriteTime; //number of seconds since Jan. 1st 1970 UTC + FileInfo() : fileSize(), lastWriteTime(), symlinkInfo() {} + + std::uint64_t fileSize; //unit: bytes! + std::int64_t lastWriteTime; //number of seconds since Jan. 1st 1970 UTC FileId id; //optional: initial if not supported! const SymlinkInfo* symlinkInfo; //only filled if file is a followed symlink }; @@ -45,13 +48,13 @@ struct TraverseCallback ON_ERROR_IGNORE }; - virtual void onFile (const Zchar* shortName, const Zstring& fullName, const FileInfo& details) = 0; - virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& fullName, const SymlinkInfo& details) = 0; - virtual TraverseCallback* onDir (const Zchar* shortName, const Zstring& fullName) = 0; + virtual void onFile (const Zchar* shortName, const Zstring& filepath, const FileInfo& details) = 0; + virtual HandleLink onSymlink(const Zchar* shortName, const Zstring& linkpath, const SymlinkInfo& details) = 0; + virtual TraverseCallback* onDir (const Zchar* shortName, const Zstring& dirpath) = 0; //nullptr: ignore directory, non-nullptr: traverse into using the (new) callback => implement releaseDirTraverser() if necessary! virtual void releaseDirTraverser(TraverseCallback* trav) {} - virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber) = 0; //failed directory traversal -> consider directory data as incomplete! + virtual HandleError reportDirError (const std::wstring& msg, size_t retryNumber) = 0; //failed directory traversal -> consider directory data at current level as incomplete! virtual HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) = 0; //failed to get data for single file/dir/symlink only! }; @@ -60,7 +63,7 @@ struct TraverseCallback struct DstHackCallback { virtual ~DstHackCallback() {} - virtual void requestUiRefresh(const Zstring& filename) = 0; //applying DST hack imposes significant one-time performance drawback => callback to inform user + virtual void requestUiRefresh(const Zstring& filepath) = 0; //applying DST hack imposes significant one-time performance drawback => callback to inform user }; #elif defined ZEN_LINUX || defined ZEN_MAC struct DstHackCallback; //DST hack not required on Unix @@ -69,7 +72,7 @@ struct DstHackCallback; //DST hack not required on Unix //custom traverser with detail information about files //- client needs to handle duplicate file reports! (FilePlusTraverser fallback, retrying to read directory contents, ...) //- directory may end with PATH_SEPARATOR -void traverseFolder(const Zstring& dirname, //throw() +void traverseFolder(const Zstring& dirpath, //throw() TraverseCallback& sink, DstHackCallback* dstCallback = nullptr); //apply DST hack if callback is supplied } diff --git a/zen/fixed_list.h b/zen/fixed_list.h index 7e35f012..63ef3f2f 100644 --- a/zen/fixed_list.h +++ b/zen/fixed_list.h @@ -129,8 +129,8 @@ public: size_t size() const { return sz; } private: - FixedList(const FixedList&); - FixedList& operator=(const FixedList&); + FixedList (const FixedList&) = delete; + FixedList& operator=(const FixedList&) = delete; void pushNode(Node* newNode) //throw() { diff --git a/zen/format_unit.cpp b/zen/format_unit.cpp index bcf318d9..e251dc3c 100644 --- a/zen/format_unit.cpp +++ b/zen/format_unit.cpp @@ -5,20 +5,21 @@ // ************************************************************************** #include "format_unit.h" -#include <zen/basic_math.h> -#include <zen/i18n.h> -#include <zen/time.h> +#include "basic_math.h" +#include "i18n.h" +#include "time.h" +#include "int64.h" #include <cwchar> //swprintf #include <ctime> #include <cstdio> #ifdef ZEN_WIN -#include <zen/win.h> //includes "windows.h" -#include <zen/win_ver.h> +#include "win.h" //includes "windows.h" +#include "win_ver.h" #elif defined ZEN_LINUX || defined ZEN_MAC -#include <clocale> //thousands separator -#include <zen/utf.h> // +#include <clocale> //thousands separator +#include "utf.h" // #endif using namespace zen; @@ -35,14 +36,15 @@ std::wstring zen::formatThreeDigitPrecision(double value) } -std::wstring zen::filesizeToShortString(Int64 size) +std::wstring zen::filesizeToShortString(std::int64_t size) { //if (size < 0) return _("Error"); -> really? if (numeric::abs(size) <= 999) - return _P("1 byte", "%x bytes", to<int>(size)); + return _P("1 byte", "%x bytes", static_cast<int>(size)); + + double sizeInUnit = static_cast<double>(size); - double sizeInUnit = to<double>(size); auto formatUnit = [&](const std::wstring& unitTxt) { return replaceCpy(unitTxt, L"%x", formatThreeDigitPrecision(sizeInUnit)); }; sizeInUnit /= 1024; @@ -282,12 +284,12 @@ const bool useNewLocalTimeCalculation = zen::vistaOrLater(); #endif -std::wstring zen::utcToLocalTimeString(Int64 utcTime) +std::wstring zen::utcToLocalTimeString(std::int64_t utcTime) { auto errorMsg = [&] { return _("Error") + L" (time_t: " + numberTo<std::wstring>(utcTime) + L")"; }; #ifdef ZEN_WIN - FILETIME lastWriteTimeUtc = toFileTime(utcTime); //convert ansi C time to FILETIME + FILETIME lastWriteTimeUtc = timetToFileTime(utcTime); //convert ansi C time to FILETIME SYSTEMTIME systemTimeLocal = {}; @@ -325,7 +327,7 @@ std::wstring zen::utcToLocalTimeString(Int64 utcTime) loc.second = systemTimeLocal.wSecond; #elif defined ZEN_LINUX || defined ZEN_MAC - zen::TimeComp loc = zen::localTime(to<time_t>(utcTime)); + zen::TimeComp loc = zen::localTime(utcTime); #endif std::wstring dateString = formatTime<std::wstring>(L"%x %X", loc); diff --git a/zen/format_unit.h b/zen/format_unit.h index e3e2d107..237b9f04 100644 --- a/zen/format_unit.h +++ b/zen/format_unit.h @@ -8,15 +8,15 @@ #define FMT_UNIT_8702184019487324 #include <string> -#include <zen/int64.h> -#include <zen/string_tools.h> +#include <cstdint> +#include "string_tools.h" namespace zen { -std::wstring filesizeToShortString(Int64 filesize); +std::wstring filesizeToShortString(std::int64_t filesize); std::wstring remainingTimeToString(double timeInSec); std::wstring fractionToString(double fraction); //within [0, 1] -std::wstring utcToLocalTimeString(Int64 utcTime); //like Windows Explorer would... +std::wstring utcToLocalTimeString(std::int64_t utcTime); //like Windows Explorer would... std::wstring formatThreeDigitPrecision(double value); //= *at least* three digits @@ -44,7 +44,7 @@ std::wstring includeNumberSeparator(const std::wstring& number); template <class NumberType> inline std::wstring toGuiString(NumberType number) { - //assert_static(IsInteger<NumberType>::value); -> doesn't work for UInt64 + assert_static(IsInteger<NumberType>::value); return ffs_Impl::includeNumberSeparator(zen::numberTo<std::wstring>(number)); } } diff --git a/zen/int64.h b/zen/int64.h index f658e034..4183c8da 100644 --- a/zen/int64.h +++ b/zen/int64.h @@ -7,251 +7,65 @@ #ifndef FFS_LARGE_64_BIT_INTEGER_H_INCLUDED #define FFS_LARGE_64_BIT_INTEGER_H_INCLUDED -#include <cassert> -#include <limits> #include <cstdint> -#include <cstdint> -#include <ostream> -#include "assert_static.h" -#include "type_tools.h" #ifdef ZEN_WIN #include "win.h" #endif -/* -zen::Int64/zen::UInt64: wrapper classes around std::int64_t/std::uint64_t - - - default initialization with 0 - - debug runtime overflow/underflow checks - - safe and explicit semantics: no unsafe type conversions - - safe conversion to and from Windows 64-bit integers - - specializes std::numeric_limits - - support stream operator<< and operator>> -*/ - namespace zen { -template <class T, class U> inline -void checkRange(U value) -{ - //caveat: std::numeric_limits<T>::min returns minimum positive(!) number for T = double, while behaving correctly for integer types... sigh - assert(double(std::numeric_limits<T>::lowest()) <= double(value) && //new with C++11! - double(std::numeric_limits<T>::max() ) >= double(value)); -} - -class Int64 -{ -public: - //safe implicit conversions - Int64() : value(0) {} - Int64(const Int64& rhs) : value(rhs.value) {} - template <class T> - Int64(T rhs, typename EnableIf<IsSignedInt<T>::value&& sizeof(T) <= sizeof(std::int64_t)>::Type* = nullptr) : - value(static_cast<std::int64_t>(rhs)) {} - - //unsafe explicit but checked conversion for all other integer types - template <class T> explicit Int64(T rhs, typename EnableIf<!(IsSignedInt<T>::value&& sizeof(T) <= sizeof(std::int64_t))>::Type* = nullptr) : - value(static_cast<std::int64_t>(rhs)) { checkRange<std::int64_t>(rhs); } - - Int64& operator=(const Int64& rhs) { value = rhs.value; return *this; } - #ifdef ZEN_WIN - Int64(DWORD low, LONG high) +inline + std::int64_t get64BitInt(DWORD low, LONG high) { - assert_static(sizeof(low) + sizeof(high) == sizeof(value)); + static_assert(sizeof(low) + sizeof(high) == sizeof(std::int64_t), ""); LARGE_INTEGER cvt = {}; cvt.LowPart = low; cvt.HighPart = high; - value = cvt.QuadPart; - } - LONG getHi() const - { - LARGE_INTEGER cvt = {}; - cvt.QuadPart = value; - return cvt.HighPart; + return cvt.QuadPart; } - DWORD getLo() const - { - LARGE_INTEGER cvt = {}; - cvt.QuadPart = value; - return cvt.LowPart; - } -#endif - - Int64& operator+=(const Int64& rhs) { checkRange<std::int64_t>(double(value) + rhs.value); value += rhs.value; return *this; } - Int64& operator-=(const Int64& rhs) { checkRange<std::int64_t>(double(value) - rhs.value); value -= rhs.value; return *this; } - Int64& operator*=(const Int64& rhs) { checkRange<std::int64_t>(double(value) * rhs.value); value *= rhs.value; return *this; } - Int64& operator/=(const Int64& rhs) { assert(rhs.value != 0); value /= rhs.value; return *this; } - Int64& operator%=(const Int64& rhs) { assert(rhs.value != 0); value %= rhs.value; return *this; } - Int64& operator&=(const Int64& rhs) { value &= rhs.value; return *this;} - Int64& operator|=(const Int64& rhs) { value |= rhs.value; return *this;} - Int64& operator<<=(int rhs) { assert(rhs < 0 || (value << rhs) >> rhs == value); value <<= rhs; return *this; } - Int64& operator>>=(int rhs) { assert(rhs > 0 || (value >> rhs) << rhs == value); value >>= rhs; return *this; } - Int64 operator-() const { return -value; } - - inline friend bool operator==(const Int64& lhs, const Int64& rhs) { return lhs.value == rhs.value; } - inline friend bool operator!=(const Int64& lhs, const Int64& rhs) { return lhs.value != rhs.value; } - inline friend bool operator< (const Int64& lhs, const Int64& rhs) { return lhs.value < rhs.value; } - inline friend bool operator> (const Int64& lhs, const Int64& rhs) { return lhs.value > rhs.value; } - inline friend bool operator<=(const Int64& lhs, const Int64& rhs) { return lhs.value <= rhs.value; } - inline friend bool operator>=(const Int64& lhs, const Int64& rhs) { return lhs.value >= rhs.value; } - - //checked conversion to arbitrary target integer type - template <class T> inline friend T to(Int64 number) { checkRange<T>(number.value); return static_cast<T>(number.value); } - template <class T> inline friend std::basic_istream<T>& operator>>(std::basic_istream<T>& lhs, Int64& rhs) { lhs >> rhs.value; return lhs; } - template <class T> inline friend std::basic_ostream<T>& operator<<(std::basic_ostream<T>& lhs, const Int64& rhs) { lhs << rhs.value; return lhs; } +std::int64_t get64BitInt(std::uint64_t low, std::int64_t high) = delete; -private: - std::int64_t value; -}; -inline Int64 operator+ (const Int64& lhs, const Int64& rhs) { return Int64(lhs) += rhs; } -inline Int64 operator- (const Int64& lhs, const Int64& rhs) { return Int64(lhs) -= rhs; } -inline Int64 operator* (const Int64& lhs, const Int64& rhs) { return Int64(lhs) *= rhs; } -inline Int64 operator/ (const Int64& lhs, const Int64& rhs) { return Int64(lhs) /= rhs; } -inline Int64 operator% (const Int64& lhs, const Int64& rhs) { return Int64(lhs) %= rhs; } -inline Int64 operator& (const Int64& lhs, const Int64& rhs) { return Int64(lhs) &= rhs; } -inline Int64 operator| (const Int64& lhs, const Int64& rhs) { return Int64(lhs) |= rhs; } -inline Int64 operator<<(const Int64& lhs, int rhs) { return Int64(lhs) <<= rhs; } -inline Int64 operator>>(const Int64& lhs, int rhs) { return Int64(lhs) >>= rhs; } - - -class UInt64 -{ -public: - //safe implicit conversions - UInt64() : value(0) {} - UInt64(const UInt64& rhs) : value(rhs.value) {} - template <class T> - UInt64(T rhs, typename EnableIf<IsUnsignedInt<T>::value&& sizeof(T) <= sizeof(std::uint64_t)>::Type* = nullptr) : - value(static_cast<std::uint64_t>(rhs)) {} - - //unsafe explicit but checked conversion for all other integer types - template <class T> explicit UInt64(T rhs, typename EnableIf<!(IsUnsignedInt<T>::value&& sizeof(T) <= sizeof(std::uint64_t))>::Type* = nullptr) : - value(static_cast<std::uint64_t>(rhs)) { checkRange<std::uint64_t>(rhs); } - - UInt64& operator=(const UInt64& rhs) { value = rhs.value; return *this; } - -#ifdef ZEN_WIN - UInt64(DWORD low, DWORD high) +inline +std::uint64_t get64BitUInt(DWORD low, DWORD high) { - assert_static(sizeof(low) + sizeof(high) == sizeof(value)); + static_assert(sizeof(low) + sizeof(high) == sizeof(std::uint64_t), ""); ULARGE_INTEGER cvt = {}; cvt.LowPart = low; cvt.HighPart = high; - value = cvt.QuadPart; - } - DWORD getHi() const - { - ULARGE_INTEGER cvt = {}; - cvt.QuadPart = value; - return cvt.HighPart; - } - DWORD getLo() const - { - ULARGE_INTEGER cvt = {}; - cvt.QuadPart = value; - return cvt.LowPart; + return cvt.QuadPart; } -#endif - - UInt64& operator+=(const UInt64& rhs) { checkRange<std::uint64_t>(double(value) + rhs.value); value += rhs.value; return *this; } - UInt64& operator-=(const UInt64& rhs) { checkRange<std::uint64_t>(double(value) - rhs.value); value -= rhs.value; return *this; } - UInt64& operator*=(const UInt64& rhs) { checkRange<std::uint64_t>(double(value) * rhs.value); value *= rhs.value; return *this; } - UInt64& operator/=(const UInt64& rhs) { assert(rhs.value != 0); value /= rhs.value; return *this; } - UInt64& operator%=(const UInt64& rhs) { assert(rhs.value != 0); value %= rhs.value; return *this; } - UInt64& operator&=(const UInt64& rhs) { value &= rhs.value; return *this;} - UInt64& operator|=(const UInt64& rhs) { value |= rhs.value; return *this;} - UInt64& operator<<=(int rhs) { assert(rhs < 0 || (value << rhs) >> rhs == value); value <<= rhs; return *this; } - UInt64& operator>>=(int rhs) { assert(rhs > 0 || (value >> rhs) << rhs == value); value >>= rhs; return *this; } - - inline friend bool operator==(const UInt64& lhs, const UInt64& rhs) { return lhs.value == rhs.value; } - inline friend bool operator!=(const UInt64& lhs, const UInt64& rhs) { return lhs.value != rhs.value; } - inline friend bool operator< (const UInt64& lhs, const UInt64& rhs) { return lhs.value < rhs.value; } - inline friend bool operator> (const UInt64& lhs, const UInt64& rhs) { return lhs.value > rhs.value; } - inline friend bool operator<=(const UInt64& lhs, const UInt64& rhs) { return lhs.value <= rhs.value; } - inline friend bool operator>=(const UInt64& lhs, const UInt64& rhs) { return lhs.value >= rhs.value; } - - //checked conversion to arbitrary target integer type - template <class T> friend T to(UInt64 number); - - template <class T> inline friend std::basic_istream<T>& operator>>(std::basic_istream<T>& lhs, UInt64& rhs) { lhs >> rhs.value; return lhs; } - template <class T> inline friend std::basic_ostream<T>& operator<<(std::basic_ostream<T>& lhs, const UInt64& rhs) { lhs << rhs.value; return lhs; } - -private: - std::uint64_t value; -}; - -template <class T> inline T to(UInt64 number) { checkRange<T>(number.value); return static_cast<T>(number.value); } //Clang 3.2 doesn't properly handle inline-friends defined in class definition -inline UInt64 operator+ (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) += rhs; } -inline UInt64 operator- (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) -= rhs; } -inline UInt64 operator* (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) *= rhs; } -inline UInt64 operator/ (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) /= rhs; } -inline UInt64 operator% (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) %= rhs; } -inline UInt64 operator& (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) &= rhs; } -inline UInt64 operator| (const UInt64& lhs, const UInt64& rhs) { return UInt64(lhs) |= rhs; } -inline UInt64 operator<<(const UInt64& lhs, int rhs) { return UInt64(lhs) <<= rhs; } -inline UInt64 operator>>(const UInt64& lhs, int rhs) { return UInt64(lhs) >>= rhs; } +std::int64_t get64BitUInt(std::uint64_t low, std::uint64_t high) = delete; -template <> inline UInt64 to(Int64 number) { checkRange<std::uint64_t>(number.value); return UInt64(number.value); } -template <> inline Int64 to(UInt64 number) { checkRange<std:: int64_t>(number.value); return Int64(number.value); } - -#ifdef ZEN_WIN //convert FILETIME (number of 100-nanosecond intervals since January 1, 1601 UTC) // to time_t (number of seconds since Jan. 1st 1970 UTC) // //FAT32 time is preserved exactly: FAT32 -> toTimeT -> tofiletime -> FAT32 inline -Int64 toTimeT(const FILETIME& ft) +std::int64_t filetimeToTimeT(const FILETIME& ft) { - return to<Int64>(UInt64(ft.dwLowDateTime, ft.dwHighDateTime) / 10000000U) - Int64(3054539008UL, 2); + return static_cast<std::int64_t>(get64BitUInt(ft.dwLowDateTime, ft.dwHighDateTime) / 10000000U) - get64BitInt(3054539008UL, 2); //caveat: signed/unsigned arithmetics! //timeshift between ansi C time and FILETIME in seconds == 11644473600s } inline -FILETIME toFileTime(const Int64& utcTime) -{ - const UInt64 fileTimeLong = to<UInt64>(utcTime + Int64(3054539008UL, 2)) * 10000000U; - const FILETIME output = { fileTimeLong.getLo(), fileTimeLong.getHi() }; +FILETIME timetToFileTime(std::int64_t utcTime) +{ + ULARGE_INTEGER cvt = {}; + cvt.QuadPart = (utcTime + get64BitInt(3054539008UL, 2)) * 10000000U; //caveat: signed/unsigned arithmetics! + + const FILETIME output = { cvt.LowPart, cvt.HighPart }; return output; } #endif } -//specialize numeric limits -namespace std -{ -assert_static(std::numeric_limits<std:: int64_t>::is_specialized); -assert_static(std::numeric_limits<std::uint64_t>::is_specialized); - -template <> class numeric_limits<zen::Int64> : public numeric_limits<std::int64_t> -{ -public: - static zen::Int64 min() throw() { return numeric_limits<std::int64_t>::min(); } - static zen::Int64 max() throw() { return numeric_limits<std::int64_t>::max(); } -}; - -template <> class numeric_limits<zen::UInt64> : public numeric_limits<std::uint64_t> -{ -public: - static zen::UInt64 min() throw() { return numeric_limits<std::uint64_t>::min(); } - static zen::UInt64 max() throw() { return numeric_limits<std::uint64_t>::max(); } -}; -} - -/* -//specialize zen type trait -namespace zen -> we cannot mix signed/unsigned in general arithmetic operations -> we'll use the ostream-approach -{ -template <> struct IsUnsignedInt<UInt64> : StaticBool<true> {}; -template <> struct IsSignedInt <Int64> : StaticBool<true> {}; -} -*/ #endif //FFS_LARGE_64_BIT_INTEGER_H_INCLUDED diff --git a/zen/long_path_prefix.h b/zen/long_path_prefix.h index 0669cf88..824c7084 100644 --- a/zen/long_path_prefix.h +++ b/zen/long_path_prefix.h @@ -12,14 +12,14 @@ namespace zen { -//handle filenames longer-equal 260 (== MAX_PATH) characters by applying \\?\-prefix; see: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath +//handle filepaths longer-equal 260 (== MAX_PATH) characters by applying \\?\-prefix; see: http://msdn.microsoft.com/en-us/library/aa365247(VS.85).aspx#maxpath /* 1. path must be absolute 2. if path is smaller than MAX_PATH nothing is changed! caveat: FindFirstFile() "Prepending the string "\\?\" does not allow access to the root directory." 3. path may already contain \\?\-prefix */ Zstring applyLongPathPrefix(const Zstring& path); //noexcept -Zstring applyLongPathPrefixCreateDir(const Zstring& path); //noexcept -> special rule for ::CreateDirectory()/::CreateDirectoryEx(): MAX_PATH - 12(=^ 8.3 filename) is threshold +Zstring applyLongPathPrefixCreateDir(const Zstring& path); //noexcept -> special rule for ::CreateDirectory()/::CreateDirectoryEx(): MAX_PATH - 12(=^ 8.3 filepath) is threshold Zstring removeLongPathPrefix(const Zstring& path); //noexcept @@ -97,7 +97,7 @@ Zstring zen::applyLongPathPrefix(const Zstring& path) inline Zstring zen::applyLongPathPrefixCreateDir(const Zstring& path) //noexcept { - //special rule for ::CreateDirectoryEx(): MAX_PATH - 12(=^ 8.3 filename) is threshold + //special rule for ::CreateDirectoryEx(): MAX_PATH - 12(=^ 8.3 filepath) is threshold return applyLongPathPrefixImpl<MAX_PATH - 12> (path); } diff --git a/zen/notify_removal.cpp b/zen/notify_removal.cpp index c66eb3c1..3de375f2 100644 --- a/zen/notify_removal.cpp +++ b/zen/notify_removal.cpp @@ -35,8 +35,8 @@ public: private: MessageProvider(); ~MessageProvider(); - MessageProvider(const MessageProvider&); - MessageProvider& operator=(const MessageProvider&); + MessageProvider (const MessageProvider&) = delete; + MessageProvider& operator=(const MessageProvider&) = delete; static const wchar_t dummyWindowName[]; @@ -173,8 +173,8 @@ public: } private: - Pimpl(Pimpl&); - Pimpl& operator=(Pimpl&); + Pimpl (const Pimpl&) = delete; + Pimpl& operator=(const Pimpl&) = delete; virtual void onMessage(UINT message, WPARAM wParam, LPARAM lParam) //throw()! { diff --git a/zen/process_priority.cpp b/zen/process_priority.cpp index a50fbd75..d2f6dc26 100644 --- a/zen/process_priority.cpp +++ b/zen/process_priority.cpp @@ -5,18 +5,17 @@ // ************************************************************************** #include "process_priority.h" -#include <zen/sys_error.h> -#include <zen/i18n.h> +#include "sys_error.h" +#include "i18n.h" #ifdef ZEN_WIN #include "win.h" //includes "windows.h" #elif defined ZEN_LINUX -//#include <sys/syscall.h> #elif defined ZEN_MAC #include <sys/resource.h> //getiopolicy_np -#include <IOKit/pwr_mgt/IOPMLib.h> //keep in .cpp file to not pollute global namespace! e.g. with UInt64 +#include <IOKit/pwr_mgt/IOPMLib.h> //keep in .cpp file to not pollute global namespace! #endif using namespace zen; diff --git a/zen/recycler.cpp b/zen/recycler.cpp index 0e4e4be0..41ea6002 100644 --- a/zen/recycler.cpp +++ b/zen/recycler.cpp @@ -5,7 +5,7 @@ // ************************************************************************** #include "recycler.h" -#include <zen/file_handling.h> +#include "file_handling.h" #ifdef ZEN_WIN #include "thread.h" @@ -16,9 +16,9 @@ #include "IFileOperation/file_op.h" #elif defined ZEN_LINUX -#include <zen/scope_guard.h> #include <sys/stat.h> #include <gio/gio.h> +#include "scope_guard.h" #elif defined ZEN_MAC #include <CoreServices/CoreServices.h> @@ -54,14 +54,14 @@ struct CallbackData }; -bool onRecyclerCallback(const wchar_t* filename, void* sink) +bool onRecyclerCallback(const wchar_t* itempath, void* sink) { CallbackData& cbd = *static_cast<CallbackData*>(sink); //sink is NOT optional here if (cbd.notifyDeletionStatus_) try { - cbd.notifyDeletionStatus_(filename); //throw ? + cbd.notifyDeletionStatus_(itempath); //throw ? } catch (...) { @@ -73,11 +73,11 @@ bool onRecyclerCallback(const wchar_t* filename, void* sink) } -void zen::recycleOrDelete(const std::vector<Zstring>& filenames, const std::function<void (const Zstring& currentItem)>& notifyDeletionStatus) +void zen::recycleOrDelete(const std::vector<Zstring>& itempaths, const std::function<void (const Zstring& currentItem)>& notifyDeletionStatus) { - if (filenames.empty()) + if (itempaths.empty()) return; - //::SetFileAttributes(applyLongPathPrefix(filename).c_str(), FILE_ATTRIBUTE_NORMAL); + //::SetFileAttributes(applyLongPathPrefix(itempath).c_str(), FILE_ATTRIBUTE_NORMAL); //warning: moving long file paths to recycler does not work! //both ::SHFileOperation() and ::IFileOperation() cannot delete a folder named "System Volume Information" with normal attributes but shamelessly report success //both ::SHFileOperation() and ::IFileOperation() can't handle \\?\-prefix! @@ -89,11 +89,11 @@ void zen::recycleOrDelete(const std::vector<Zstring>& filenames, const std::func const DllFun<FunType_getLastErrorMessage> getLastErrorMessage(getDllName(), funName_getLastErrorMessage); if (!moveToRecycler || !getLastErrorMessage) - throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(filenames[0])), + throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(itempaths[0])), replaceCpy(_("Cannot load file %x."), L"%x", fmtFileName(getDllName()))); std::vector<const wchar_t*> cNames; - for (auto it = filenames.begin(); it != filenames.end(); ++it) //CAUTION: do not create temporary strings here!! + for (auto it = itempaths.begin(); it != itempaths.end(); ++it) //CAUTION: do not create temporary strings here!! cNames.push_back(it->c_str()); CallbackData cbd(notifyDeletionStatus); @@ -106,26 +106,26 @@ void zen::recycleOrDelete(const std::vector<Zstring>& filenames, const std::func assert(false); } - std::wstring filenameFmt = fmtFileName(filenames[0]); //probably not the correct file name for file lists larger than 1! - if (filenames.size() > 1) - filenameFmt += L", ..."; //give at least some hint that there are multiple files, and the error need not be related to the first one + std::wstring itempathFmt = fmtFileName(itempaths[0]); //probably not the correct file name for file lists larger than 1! + if (itempaths.size() > 1) + itempathFmt += L", ..."; //give at least some hint that there are multiple files, and the error need not be related to the first one - throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", filenameFmt), getLastErrorMessage()); //already includes details about locking errors! + throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", itempathFmt), getLastErrorMessage()); //already includes details about locking errors! } } else //regular recycle bin usage: available since XP { - Zstring filenamesDoubleNull; - for (const Zstring& filename : filenames) + Zstring itempathsDoubleNull; + for (const Zstring& itempath : itempaths) { - filenamesDoubleNull += filename; - filenamesDoubleNull += L'\0'; + itempathsDoubleNull += itempath; + itempathsDoubleNull += L'\0'; } SHFILEOPSTRUCT fileOp = {}; fileOp.hwnd = nullptr; fileOp.wFunc = FO_DELETE; - fileOp.pFrom = filenamesDoubleNull.c_str(); + fileOp.pFrom = itempathsDoubleNull.c_str(); fileOp.pTo = nullptr; fileOp.fFlags = FOF_ALLOWUNDO | FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; fileOp.fAnyOperationsAborted = false; @@ -135,25 +135,25 @@ void zen::recycleOrDelete(const std::vector<Zstring>& filenames, const std::func //"You should use fully-qualified path names with this function. Using it with relative path names is not thread safe." if (::SHFileOperation(&fileOp) != 0 || fileOp.fAnyOperationsAborted) { - throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(filenames[0]))); //probably not the correct file name for file list larger than 1! + throw FileError(replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(itempaths[0]))); //probably not the correct file name for file list larger than 1! } } } #endif -bool zen::recycleOrDelete(const Zstring& filename) //throw FileError +bool zen::recycleOrDelete(const Zstring& itempath) //throw FileError { - if (!somethingExists(filename)) //[!] do not optimize away, OS X needs this for reliable detection of "recycle bin missing" + if (!somethingExists(itempath)) //[!] do not optimize away, OS X needs this for reliable detection of "recycle bin missing" return false; //neither file nor any other object with that name existing: no error situation, manual deletion relies on it! #ifdef ZEN_WIN - std::vector<Zstring> filenames; - filenames.push_back(filename); - recycleOrDelete(filenames, nullptr); //throw FileError + std::vector<Zstring> itempaths; + itempaths.push_back(itempath); + recycleOrDelete(itempaths, nullptr); //throw FileError #elif defined ZEN_LINUX - GFile* file = ::g_file_new_for_path(filename.c_str()); //never fails according to docu + GFile* file = ::g_file_new_for_path(itempath.c_str()); //never fails according to docu ZEN_ON_SCOPE_EXIT(g_object_unref(file);) GError* error = nullptr; @@ -161,7 +161,7 @@ bool zen::recycleOrDelete(const Zstring& filename) //throw FileError if (!::g_file_trash(file, nullptr, &error)) { - const std::wstring errorMsg = replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(filename)); + const std::wstring errorMsg = replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(itempath)); if (!error) throw FileError(errorMsg, L"Unknown error."); //user should never see this @@ -170,13 +170,13 @@ bool zen::recycleOrDelete(const Zstring& filename) //throw FileError if (error->code == G_IO_ERROR_NOT_SUPPORTED) { struct ::stat fileInfo = {}; - if (::lstat(filename.c_str(), &fileInfo) != 0) + if (::lstat(itempath.c_str(), &fileInfo) != 0) return false; if (S_ISLNK(fileInfo.st_mode) || S_ISREG(fileInfo.st_mode)) - removeFile(filename); //throw FileError + removeFile(itempath); //throw FileError else if (S_ISDIR(fileInfo.st_mode)) - removeDirectory(filename); //throw FileError + removeDirectory(itempath); //throw FileError return true; } @@ -188,11 +188,11 @@ bool zen::recycleOrDelete(const Zstring& filename) //throw FileError //we cannot use FSPathMoveObjectToTrashSync directly since it follows symlinks! assert_static(sizeof(Zchar) == sizeof(char)); - const UInt8* filenameUtf8 = reinterpret_cast<const UInt8*>(filename.c_str()); + const UInt8* itempathUtf8 = reinterpret_cast<const UInt8*>(itempath.c_str()); auto throwFileError = [&](OSStatus oss) { - const std::wstring errorMsg = replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(filename)); + const std::wstring errorMsg = replaceCpy(_("Unable to move %x to the recycle bin."), L"%x", fmtFileName(itempath)); std::wstring errorDescr = L"OSStatus Code " + numberTo<std::wstring>(oss); if (const char* description = ::GetMacOSStatusCommentString(oss)) //found no documentation for proper use of GetMacOSStatusCommentString @@ -201,7 +201,7 @@ bool zen::recycleOrDelete(const Zstring& filename) //throw FileError }; FSRef objectRef = {}; //= POD structure not a pointer type! - OSStatus rv = ::FSPathMakeRefWithOptions(filenameUtf8, //const UInt8 *path, + OSStatus rv = ::FSPathMakeRefWithOptions(itempathUtf8, //const UInt8 *path, kFSPathMakeRefDoNotFollowLeafSymlink, //OptionBits options, &objectRef, //FSRef *ref, nullptr); //Boolean *isDirectory @@ -218,13 +218,13 @@ bool zen::recycleOrDelete(const Zstring& filename) //throw FileError if (rv2 == -120) //=="Directory not found or incomplete pathname." but should really be "recycle bin directory not found"! { struct ::stat fileInfo = {}; - if (::lstat(filename.c_str(), &fileInfo) != 0) + if (::lstat(itempath.c_str(), &fileInfo) != 0) return false; if (S_ISLNK(fileInfo.st_mode) || S_ISREG(fileInfo.st_mode)) - removeFile(filename); //throw FileError + removeFile(itempath); //throw FileError else if (S_ISDIR(fileInfo.st_mode)) - removeDirectory(filename); //throw FileError + removeDirectory(itempath); //throw FileError return true; } @@ -352,7 +352,7 @@ We really need access to a similar function to check whether a directory support The following function looks perfect, alas it is restricted to local files and to the implementation of GIO only: - gboolean _g_local_file_has_trash_dir(const char* dirname, dev_t dir_dev); + gboolean _g_local_file_has_trash_dir(const char* dirpath, dev_t dir_dev); See: http://www.netmite.com/android/mydroid/2.0/external/bluetooth/glib/gio/glocalfileinfo.h Just checking for "G_FILE_ATTRIBUTE_ACCESS_CAN_TRASH" is not correct, since we find in diff --git a/zen/recycler.h b/zen/recycler.h index 255f11ef..e900dfa3 100644 --- a/zen/recycler.h +++ b/zen/recycler.h @@ -9,8 +9,7 @@ #include <vector> #include <functional> -#include <zen/file_error.h> -#include <zen/zstring.h> +#include "file_error.h" namespace zen { @@ -32,14 +31,14 @@ Already included in package "gtk+-2.0"! */ //move a file or folder to Recycle Bin (deletes permanently if recycler is not available) -> crappy semantics, but we have no choice thanks to Windows' design -bool recycleOrDelete(const Zstring& filename); //throw FileError, return "true" if file/dir was actually deleted +bool recycleOrDelete(const Zstring& itempath); //throw FileError, return "true" if file/dir was actually deleted #ifdef ZEN_WIN //can take a long time if recycle bin is full and drive is slow!!! => buffer volume ids! bool recycleBinExists(const Zstring& pathName, const std::function<void ()>& onUpdateGui); //throw FileError -void recycleOrDelete(const std::vector<Zstring>& filenames, //throw FileError, return "true" if file/dir was actually deleted +void recycleOrDelete(const std::vector<Zstring>& filepaths, //throw FileError, return "true" if file/dir was actually deleted //may throw: first exception is swallowed, updateStatus() is then called again where it should throw again and the exception will propagate as expected const std::function<void (const Zstring& currentItem)>& notifyDeletionStatus); //optional; currentItem may be empty #endif diff --git a/zen/serialize.h b/zen/serialize.h index 9a14e6af..64df0329 100644 --- a/zen/serialize.h +++ b/zen/serialize.h @@ -8,8 +8,8 @@ #define SERIALIZE_H_INCLUDED_83940578357 #include <cstdint> -#include <zen/string_base.h> -#include <zen/file_io.h> +#include "string_base.h" +#include "file_io.h" namespace zen { @@ -54,8 +54,8 @@ private: //---------------------------------------------------------------------- //functions based on binary container abstraction -template <class BinContainer> void saveBinStream(const Zstring& filename, const BinContainer& cont); //throw FileError -template <class BinContainer> BinContainer loadBinStream(const Zstring& filename); //throw FileError +template <class BinContainer> void saveBinStream(const Zstring& filepath, const BinContainer& cont); //throw FileError +template <class BinContainer> BinContainer loadBinStream(const Zstring& filepath); //throw FileError /* @@ -135,22 +135,22 @@ template < class BinInputStream> void readArray (BinInputStream& stre //-----------------------implementation------------------------------- template <class BinContainer> inline -void saveBinStream(const Zstring& filename, const BinContainer& cont) //throw FileError +void saveBinStream(const Zstring& filepath, const BinContainer& cont) //throw FileError { assert_static(sizeof(typename BinContainer::value_type) == 1); //expect: bytes (until further) - FileOutput fileOut(filename, zen::FileOutput::ACC_OVERWRITE); //throw FileError + FileOutput fileOut(filepath, zen::FileOutput::ACC_OVERWRITE); //throw FileError if (!cont.empty()) fileOut.write(&*cont.begin(), cont.size()); //throw FileError } template <class BinContainer> inline -BinContainer loadBinStream(const Zstring& filename) //throw FileError +BinContainer loadBinStream(const Zstring& filepath) //throw FileError { assert_static(sizeof(typename BinContainer::value_type) == 1); //expect: bytes (until further) - FileInput fileIn(filename); //throw FileError + FileInput fileIn(filepath); //throw FileError BinContainer contOut; const size_t blockSize = 128 * 1024; diff --git a/zen/shell_execute.h b/zen/shell_execute.h index 78526b70..9f99315a 100644 --- a/zen/shell_execute.h +++ b/zen/shell_execute.h @@ -46,11 +46,11 @@ void shellExecute2(const Zstring& command, ExecutionType type) //throw FileError std::copy(tmp, tmp + argc, std::back_inserter(argv)); } - Zstring filename; + Zstring filepath; Zstring arguments; if (!argv.empty()) { - filename = argv[0]; + filepath = argv[0]; for (auto iter = argv.begin() + 1; iter != argv.end(); ++iter) arguments += (iter != argv.begin() ? L" " : L"") + (iter->empty() || std::any_of(iter->begin(), iter->end(), &isWhiteSpace<wchar_t>) ? L"\"" + *iter + L"\"" : *iter); @@ -63,12 +63,12 @@ void shellExecute2(const Zstring& command, ExecutionType type) //throw FileError execInfo.fMask = type == EXEC_TYPE_SYNC ? (SEE_MASK_NOCLOSEPROCESS | SEE_MASK_FLAG_DDEWAIT) : 0; //don't use SEE_MASK_ASYNCOK -> returns successful despite errors! execInfo.fMask |= SEE_MASK_UNICODE | SEE_MASK_FLAG_NO_UI; //::ShellExecuteEx() shows a non-blocking pop-up dialog on errors -> we want a blocking one execInfo.lpVerb = nullptr; - execInfo.lpFile = filename.c_str(); + execInfo.lpFile = filepath.c_str(); execInfo.lpParameters = arguments.c_str(); execInfo.nShow = SW_SHOWNORMAL; if (!::ShellExecuteEx(&execInfo)) //__inout LPSHELLEXECUTEINFO lpExecInfo - throwFileError(_("Incorrect command line:") + L"\nFile: " + filename + L"\nArg: " + arguments, L"ShellExecuteEx", ::GetLastError()); + throwFileError(_("Incorrect command line:") + L"\nFile: " + filepath + L"\nArg: " + arguments, L"ShellExecuteEx", ::GetLastError()); if (execInfo.hProcess) { diff --git a/zen/symlink_target.h b/zen/symlink_target.h index 13226f1f..21833492 100644 --- a/zen/symlink_target.h +++ b/zen/symlink_target.h @@ -12,7 +12,6 @@ #ifdef ZEN_WIN #include "win.h" //includes "windows.h" -//#include <WinIoCtl.h> #include "privilege.h" #include "long_path_prefix.h" #include "dll.h" diff --git a/zen/thread.h b/zen/thread.h index d74eaa5b..8c72e43f 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -43,8 +43,8 @@ std::async replacement without crappy semantics: 2. does not follow C++11 [futures.async], Paragraph 5, where std::future waits for thread in destructor Example: - Zstring dirname = ... - auto ft = zen::async([=](){ return zen::dirExists(dirname); }); + Zstring dirpath = ... + auto ft = zen::async([=](){ return zen::dirExists(dirpath); }); if (ft.timed_wait(boost::posix_time::milliseconds(200)) && ft.get()) //dir exising */ diff --git a/zen/win_ver.h b/zen/win_ver.h index 766c0ee9..e123737d 100644 --- a/zen/win_ver.h +++ b/zen/win_ver.h @@ -8,7 +8,7 @@ #define WINDOWS_VERSION_HEADER_238470348254325 #include <cstdint> -#include <zen/win.h> //includes "windows.h" +#include "win.h" //includes "windows.h" namespace zen { diff --git a/zen/xml_io.cpp b/zen/xml_io.cpp index a8236300..485d78bb 100644 --- a/zen/xml_io.cpp +++ b/zen/xml_io.cpp @@ -12,13 +12,13 @@ using namespace zen; -XmlDoc zen::loadXmlDocument(const Zstring& filename) //throw FileError +XmlDoc zen::loadXmlDocument(const Zstring& filepath) //throw FileError { //can't simply use zen::loadBinStream() due to the short-circuit xml-validation below! std::string stream; - FileInput inputFile(filename); //throw FileError + FileInput inputFile(filepath); //throw FileError { //quick test whether input is an XML: avoid loading large binary files up front! const std::string xmlBegin = "<?xml version="; @@ -29,7 +29,7 @@ XmlDoc zen::loadXmlDocument(const Zstring& filename) //throw FileError if (!startsWith(stream, xmlBegin) && !startsWith(stream, BYTE_ORDER_MARK_UTF8 + xmlBegin)) //allow BOM! - throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filename))); + throw FileError(replaceCpy(_("File %x does not contain a valid configuration."), L"%x", fmtFileName(filepath))); } const size_t blockSize = 128 * 1024; @@ -51,32 +51,32 @@ XmlDoc zen::loadXmlDocument(const Zstring& filename) //throw FileError { throw FileError( replaceCpy(replaceCpy(replaceCpy(_("Error parsing file %x, row %y, column %z."), - L"%x", fmtFileName(filename)), + L"%x", fmtFileName(filepath)), L"%y", numberTo<std::wstring>(e.row + 1)), L"%z", numberTo<std::wstring>(e.col + 1))); } } -void zen::saveXmlDocument(const XmlDoc& doc, const Zstring& filename) //throw FileError +void zen::saveXmlDocument(const XmlDoc& doc, const Zstring& filepath) //throw FileError { std::string stream = serialize(doc); //noexcept //only update xml file if there are real changes try { - if (getFilesize(filename) == stream.size()) //throw FileError - if (loadBinStream<std::string>(filename) == stream) //throw FileError + if (getFilesize(filepath) == stream.size()) //throw FileError + if (loadBinStream<std::string>(filepath) == stream) //throw FileError return; } catch (FileError&) {} - FileOutput outputFile(filename, FileOutput::ACC_OVERWRITE); //throw FileError + FileOutput outputFile(filepath, FileOutput::ACC_OVERWRITE); //throw FileError outputFile.write(stream.c_str(), stream.length()); // } -void zen::checkForMappingErrors(const XmlIn& xmlInput, const Zstring& filename) //throw FileError +void zen::checkForMappingErrors(const XmlIn& xmlInput, const Zstring& filepath) //throw FileError { if (xmlInput.errorsOccured()) { @@ -84,6 +84,6 @@ void zen::checkForMappingErrors(const XmlIn& xmlInput, const Zstring& filename) for (const std::wstring& elem : xmlInput.getErrorsAs<std::wstring>()) msg += L"\n" + elem; - throw FileError(replaceCpy(_("Configuration file %x loaded partially only."), L"%x", fmtFileName(filename)) + L"\n\n" + msg); + throw FileError(replaceCpy(_("Configuration file %x loaded partially only."), L"%x", fmtFileName(filepath)) + L"\n\n" + msg); } } diff --git a/zen/xml_io.h b/zen/xml_io.h index b53a5ef4..e3e47f59 100644 --- a/zen/xml_io.h +++ b/zen/xml_io.h @@ -8,8 +8,7 @@ #define XMLBASE_H_INCLUDED #include <zenxml/xml.h> -#include <zen/zstring.h> -#include <zen/file_error.h> +#include "file_error.h" //combine zen::Xml and zen file i/o //-> loadXmlDocument vs loadStream: @@ -18,10 +17,10 @@ namespace zen { -XmlDoc loadXmlDocument(const Zstring& filename); //throw FileError -void checkForMappingErrors(const XmlIn& xmlInput, const Zstring& filename); //throw FileError +XmlDoc loadXmlDocument(const Zstring& filepath); //throw FileError +void checkForMappingErrors(const XmlIn& xmlInput, const Zstring& filepath); //throw FileError -void saveXmlDocument(const XmlDoc& doc, const Zstring& filename); //throw FileError +void saveXmlDocument(const XmlDoc& doc, const Zstring& filepath); //throw FileError } #endif // XMLBASE_H_INCLUDED diff --git a/zen/zstring.cpp b/zen/zstring.cpp index 3e579b1e..f1858efc 100644 --- a/zen/zstring.cpp +++ b/zen/zstring.cpp @@ -12,7 +12,6 @@ #include "win_ver.h" #elif defined ZEN_MAC -//#include <zen/scope_guard.h> #include <ctype.h> //toupper() #endif @@ -75,8 +74,8 @@ private: } } - LeakChecker(const LeakChecker&); - LeakChecker& operator=(const LeakChecker&); + LeakChecker (const LeakChecker&) = delete; + LeakChecker& operator=(const LeakChecker&) = delete; static std::string rawMemToString(const void* ptr, size_t size) { @@ -165,7 +164,7 @@ int z_impl::compareFilenamesNoCase(const wchar_t* lhs, const wchar_t* rhs, size_ else //fallback { //do NOT use "CompareString"; this function is NOT accurate (even with LOCALE_INVARIANT and SORT_STRINGSORT): for example "weiß" == "weiss"!!! - //the only reliable way to compare filenames (with XP) is to call "CharUpper" or "LCMapString": + //the only reliable way to compare filepaths (with XP) is to call "CharUpper" or "LCMapString": auto copyToUpperCase = [](const wchar_t* strIn, wchar_t* strOut, size_t len) { diff --git a/zen/zstring.h b/zen/zstring.h index f103faf7..2152954d 100644 --- a/zen/zstring.h +++ b/zen/zstring.h @@ -8,10 +8,9 @@ #define ZSTRING_H_INCLUDED #include "string_base.h" + #ifdef ZEN_LINUX #include <cstring> //strcmp -#elif defined ZEN_MAC -//#include <strings.h> //strcasecmp #endif @@ -66,7 +65,7 @@ typedef zen::Zbase<Zchar, zen::StorageRefCountThreadSafe, AllocatorFreeStoreChec -//Compare filenames: Windows does NOT distinguish between upper/lower-case, while Linux DOES +//Compare filepaths: Windows does NOT distinguish between upper/lower-case, while Linux DOES template <template <class, class> class SP, class AP> int cmpFileName(const zen::Zbase<Zchar, SP, AP>& lhs, const zen::Zbase<Zchar, SP, AP>& rhs); @@ -114,7 +113,7 @@ int cmpFileName(const zen::Zbase<Zchar, SP, AP>& lhs, const zen::Zbase<Zchar, SP #if defined ZEN_WIN || defined ZEN_MAC return z_impl::compareFilenamesNoCase(lhs.data(), rhs.data(), lhs.length(), rhs.length()); #elif defined ZEN_LINUX - return std::strcmp(lhs.c_str(), rhs.c_str()); //POSIX filenames don't have embedded 0 + return std::strcmp(lhs.c_str(), rhs.c_str()); //POSIX filepaths don't have embedded 0 //#elif defined ZEN_MAC // return ::strcasecmp(lhs.c_str(), rhs.c_str()); //locale-dependent! #endif |