diff options
author | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:57:46 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2015-10-02 14:57:46 +0200 |
commit | ad4e3d2c55e75193c41356c23619f80add41db18 (patch) | |
tree | dd836d120f50e472106e04968ef8185c25e4242e | |
parent | 7.4 (diff) | |
download | FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.gz FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.tar.bz2 FreeFileSync-ad4e3d2c55e75193c41356c23619f80add41db18.zip |
7.5
113 files changed, 7090 insertions, 6434 deletions
diff --git a/FreeFileSync/Build/Changelog.txt b/FreeFileSync/Build/Changelog.txt index d570e546..cdc477f5 100644 --- a/FreeFileSync/Build/Changelog.txt +++ b/FreeFileSync/Build/Changelog.txt @@ -1,3 +1,21 @@ +FreeFileSync 7.5 [2015-10-01] +----------------------------- +Detect moved files on source even for targets with no (SFTP) or unstable (FAT) file id support +Improved performance for detection of moved files by over 50% +Added folder picker to select SFTP paths +Support additional SFTP ciphers by building upon OpenSSL backend +Added 10-seconds time out when SFTP command is hanging indefinitely +Work around unexpected SFTP session termination on Synology servers +Fixed various libssh2 and OpenSSL memory leaks +Fixed FreeFileSync taskbar link reuse (Windows 7) +Avoid last error code being overwritten by certain C runtimes before evaluation +Run online update check asynchronously (Windows) +Check source item existence before cleaning target during versioning (Linux, OS X) +Check folder recursion limit to catch stack overflows +Doubled potential folder traversal recursion depth (Windows) +Consider child elements of excluded folders during database clean up + + FreeFileSync 7.4 [2015-09-01] ----------------------------- Switch between all folder pair configurations directly in the sync config dialog diff --git a/FreeFileSync/Build/Help/html/external-applications.html b/FreeFileSync/Build/Help/html/external-applications.html index 7b46ca54..a4c6daad 100644 --- a/FreeFileSync/Build/Help/html/external-applications.html +++ b/FreeFileSync/Build/Help/html/external-applications.html @@ -17,7 +17,7 @@ <p> You can customize this behavior and integrate other external applications into FreeFileSync: - Navigate to <b>Menu → Tools → Global settings: Customize context menu</b> + Navigate to <b>Menu → Tools → Options: Customize context menu</b> and add or replace a command. The first entry is executed when double-clicking a row on main grid or pressing ENTER while all other entries can be accessed via the context menu shown after a right mouse click. In addition to regular <a href="macros.html">Macros</a>, the following specific macros are available: </p> diff --git a/FreeFileSync/Build/Help/html/tips-and-tricks.html b/FreeFileSync/Build/Help/html/tips-and-tricks.html index ce43b6aa..473b716b 100644 --- a/FreeFileSync/Build/Help/html/tips-and-tricks.html +++ b/FreeFileSync/Build/Help/html/tips-and-tricks.html @@ -43,11 +43,11 @@ <img src="../images/config-double-click.png" alt="Double-click on configuration"> <div class="separation_line"></div> - <div class="tip">You can start synchronization directly without having to compare first.</div> + <div class="tip">You can start synchronization directly without clicking on compare first.</div> <img src="../images/direct-synchronize.png" alt="Start synchronization directly"> <div class="separation_line"></div> - <div class="tip">You can move all windows by clicking on a free area and holding the mouse button.</div> + <div class="tip">You can move a window by clicking on a free area and holding the mouse button.</div> <img src="../images/dialog-drag-move.png" alt="Move dialog via mouse"> <div class="separation_line"></div> diff --git a/FreeFileSync/Build/Help/html/volume-shadow-copy.html b/FreeFileSync/Build/Help/html/volume-shadow-copy.html index 6c38ac91..9f67d18c 100644 --- a/FreeFileSync/Build/Help/html/volume-shadow-copy.html +++ b/FreeFileSync/Build/Help/html/volume-shadow-copy.html @@ -11,7 +11,7 @@ <p> FreeFileSync supports copying locked or shared files by creating a Volume Shadow - Copy of the source drive. This feature can be configured via <b>Menu → Tools → Global settings: Copy locked files</b>. + Copy of the source drive. This feature can be configured via <b>Menu → Tools → Options: Copy locked files</b>. </p> <div class="box-outer"><div class="bluebox"><div class="box-inner"> diff --git a/FreeFileSync/Build/Languages/german.lng b/FreeFileSync/Build/Languages/german.lng index d1da0553..22c4c994 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>SFTP folder</source> -<target>SFTP-Ordner</target> - <source>Both sides have changed since last synchronization.</source> <target>Beide Seiten wurden seit der letzten Synchronisation verändert.</target> @@ -497,8 +494,8 @@ Die Befehlszeile wird ausgelöst, wenn: - neue Ordner erscheinen (z.B. Anschluss eines USB Sticks) </target> -<source>&Start</source> -<target>&Start</target> +<source>Start</source> +<target>Start</target> <source>About</source> <target>Ãœber</target> @@ -683,30 +680,6 @@ Die Befehlszeile wird ausgelöst, wenn: <source>Serious Error</source> <target>Schwerer Fehler</target> -<source>Check for Program Updates</source> -<target>Suche nach neuer Programmversion</target> - -<source>A new version of FreeFileSync is available:</source> -<target>Eine neue Version von FreeFileSync ist verfügbar:</target> - -<source>Download now?</source> -<target>Jetzt herunterladen?</target> - -<source>&Download</source> -<target>Zum &Download</target> - -<source>FreeFileSync is up to date.</source> -<target>FreeFileSync ist auf dem neuesten Stand.</target> - -<source>Unable to connect to www.freefilesync.org.</source> -<target>Es kann keine Verbindung zu www.freefilesync.org aufgebaut werden.</target> - -<source>Cannot find current FreeFileSync version number online. Do you want to check manually?</source> -<target>Die aktuelle FreeFileSync Versionsnummer wurde online nicht gefunden. Möchten Sie manuell prüfen?</target> - -<source>&Check</source> -<target>&Prüfen</target> - <source>Symlink</source> <target>Symlink</target> @@ -773,6 +746,15 @@ Die Befehlszeile wird ausgelöst, wenn: <source>Please select a folder on a local file system, network or an MTP device.</source> <target>Bitte wählen Sie einen Ordner auf einem lokalen Dateisystem, Netzwerk oder MTP Gerät.</target> +<source>SFTP folder</source> +<target>SFTP-Ordner</target> + +<source>Select SFTP folder</source> +<target>SFTP-Ordner auswählen</target> + +<source>Select alternative folder type</source> +<target>Alternativen Ordnertyp auswählen</target> + <source>&New</source> <target>&Neu</target> @@ -842,9 +824,6 @@ Die Befehlszeile wird ausgelöst, wenn: <source>Remove folder pair</source> <target>Ordnerpaar entfernen</target> -<source>Select SFTP folder</source> -<target>SFTP-Ordner auswählen</target> - <source>Swap sides</source> <target>Seiten vertauschen</target> @@ -1042,6 +1021,12 @@ Die Befehlszeile wird ausgelöst, wenn: <source>Directory on server:</source> <target>Verzeichnis auf Server:</target> +<source>Select a directory on the server:</source> +<target>Verzeichnis auf dem Server auswählen:</target> + +<source>Select Folder</source> +<target>Ordner auswählen</target> + <source>Start synchronization now?</source> <target>Synchronisation jetzt starten?</target> @@ -1108,9 +1093,6 @@ Die Befehlszeile wird ausgelöst, wenn: <source>&Overwrite existing files</source> <target>&Existierende Dateien überschreiben</target> -<source>&Copy</source> -<target>&Kopieren</target> - <source>The following settings are used for all synchronization jobs.</source> <target>Die folgenden Einstellungen werden für alle Synchronisationsaufgaben verwendet.</target> @@ -1231,6 +1213,12 @@ Dadurch wird ein konsistenter Datenstand auch im schweren Fehlerfall garantiert. <source>Overview</source> <target>Ãœbersicht</target> +<source>&Download</source> +<target>Zum &Download</target> + +<source>A new version of FreeFileSync is available:</source> +<target>Eine neue Version von FreeFileSync ist verfügbar:</target> + <source>Confirm</source> <target>Bestätigen</target> @@ -1432,27 +1420,27 @@ Dadurch wird ein konsistenter Datenstand auch im schweren Fehlerfall garantiert. <source>Shut down</source> <target>Herunterfahren</target> +<source>Paused</source> +<target>Angehalten</target> + +<source>Initializing...</source> +<target>Initialisiere...</target> + <source>Scanning...</source> <target>Suche Dateien...</target> <source>Comparing content...</source> <target>Vergleiche Dateiinhalt...</target> +<source>Completed</source> +<target>Fertig</target> + <source>Info</source> <target>Info</target> <source>Select all</source> <target>Alle auswählen</target> -<source>Paused</source> -<target>Angehalten</target> - -<source>Initializing...</source> -<target>Initialisiere...</target> - -<source>Completed</source> -<target>Fertig</target> - <source>&Continue</source> <target>&Fortfahren</target> @@ -1462,6 +1450,9 @@ Dadurch wird ein konsistenter Datenstand auch im schweren Fehlerfall garantiert. <source>Log</source> <target>Protokoll</target> +<source>Loading...</source> +<target>Lade...</target> + <source> <pluralform>Copy the following item to another folder?</pluralform> <pluralform>Copy the following %x items to another folder?</pluralform> @@ -1600,6 +1591,24 @@ Dadurch wird ein konsistenter Datenstand auch im schweren Fehlerfall garantiert. <source>Percentage</source> <target>Prozent</target> +<source>Check for Program Updates</source> +<target>Suche nach neuer Programmversion</target> + +<source>Download now?</source> +<target>Jetzt herunterladen?</target> + +<source>FreeFileSync is up to date.</source> +<target>FreeFileSync ist auf dem neuesten Stand.</target> + +<source>Unable to connect to www.freefilesync.org.</source> +<target>Es kann keine Verbindung zu www.freefilesync.org aufgebaut werden.</target> + +<source>Cannot find current FreeFileSync version number online. Do you want to check manually?</source> +<target>Die aktuelle FreeFileSync Versionsnummer wurde online nicht gefunden. Möchten Sie manuell prüfen?</target> + +<source>&Check</source> +<target>&Prüfen</target> + <source>Unable to register to receive system messages.</source> <target>Die Registrierung zum Empfang von Systemmeldungen ist fehlgeschlagen.</target> diff --git a/FreeFileSync/Source/LICENSE b/FreeFileSync/Source/LICENSE index 88b549b5..e35c64cb 100644 --- a/FreeFileSync/Source/LICENSE +++ b/FreeFileSync/Source/LICENSE @@ -1,5 +1,6 @@ A. GNU GENERAL PUBLIC LICENSE B. libssh2 License +C. OpenSSL and SSLeay License A. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -665,4 +666,119 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +C. OpenSSL and SSLeay License + +OpenSSL License + +==================================================================== +Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================== + +This product includes cryptographic software written by Eric Young +(eay@cryptsoft.com). This product includes software written by Tim +Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] + END OF TERMS AND CONDITIONS diff --git a/FreeFileSync/Source/RealtimeSync/folder_selector2.cpp b/FreeFileSync/Source/RealtimeSync/folder_selector2.cpp index 72fe7b11..30e260fd 100644 --- a/FreeFileSync/Source/RealtimeSync/folder_selector2.cpp +++ b/FreeFileSync/Source/RealtimeSync/folder_selector2.cpp @@ -15,6 +15,9 @@ #include "../lib/resolve_path.h" #ifdef ZEN_WIN_VISTA_AND_LATER #include "../ui/ifile_dialog.h" + +#elif defined ZEN_LINUX + #include <gtk/gtk.h> #endif using namespace zen; @@ -48,6 +51,12 @@ FolderSelector2::FolderSelector2(wxWindow& dropWindow, folderPathCtrl_(folderPathCtrl), staticText_(staticText) { +#ifdef ZEN_LINUX + //file drag and drop directly into the text control unhelpfully inserts in format "file://..<cr><nl>"; see folder_history_box.cpp + if (GtkWidget* widget = folderPathCtrl.GetConnectWidget()) + ::gtk_drag_dest_unset(widget); +#endif + //prepare drag & drop setupFileDrop(dropWindow_); dropWindow_.Connect(EVENT_DROP_FILE, FileDropEventHandler(FolderSelector2::onFilesDropped), nullptr, this); @@ -83,7 +92,7 @@ void FolderSelector2::onMouseWheel(wxMouseEvent& event) evtHandler->AddPendingEvent(event); break; } - // event.Skip(); + // event.Skip(); } diff --git a/FreeFileSync/Source/RealtimeSync/gui_generated.cpp b/FreeFileSync/Source/RealtimeSync/gui_generated.cpp index 803863c2..b15f0e5a 100644 --- a/FreeFileSync/Source/RealtimeSync/gui_generated.cpp +++ b/FreeFileSync/Source/RealtimeSync/gui_generated.cpp @@ -222,7 +222,7 @@ MainDlgGenerated::MainDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr m_staticline5 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); bSizerMain->Add( m_staticline5, 0, wxEXPAND, 5 ); - m_buttonStart = new zen::BitmapTextButton( this, wxID_OK, _("&Start"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonStart = new zen::BitmapTextButton( this, wxID_OK, _("Start"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_buttonStart->SetDefault(); m_buttonStart->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); diff --git a/FreeFileSync/Source/RealtimeSync/main_dlg.cpp b/FreeFileSync/Source/RealtimeSync/main_dlg.cpp index b0e02ca7..ade897ad 100644 --- a/FreeFileSync/Source/RealtimeSync/main_dlg.cpp +++ b/FreeFileSync/Source/RealtimeSync/main_dlg.cpp @@ -39,14 +39,7 @@ class DirectoryPanel : public FolderGenerated public: DirectoryPanel(wxWindow* parent) : FolderGenerated(parent), - folderSelector_(*this, *m_buttonSelectFolder, *m_txtCtrlDirectory, nullptr /*staticText*/) - { -#ifdef ZEN_LINUX - //file drag and drop directly into the text control unhelpfully inserts in format "file://..<cr><nl>"; see folder_history_box.cpp - if (GtkWidget* widget = m_txtCtrlDirectory->GetConnectWidget()) - ::gtk_drag_dest_unset(widget); -#endif - } + folderSelector_(*this, *m_buttonSelectFolder, *m_txtCtrlDirectory, nullptr /*staticText*/) {} void setPath(const Zstring& dirpath) { folderSelector_.setPath(dirpath); } Zstring getPath() const { return folderSelector_.getPath(); } @@ -70,12 +63,6 @@ MainDialog::MainDialog(wxDialog* dlg, const Zstring& cfgFileName) wxWindowUpdateLocker dummy(this); //leads to GUI corruption problems on Linux/OS X! #endif -#ifdef ZEN_LINUX - //file drag and drop directly into the text control unhelpfully inserts in format "file://..<cr><nl>"; see folder_history_box.cpp - if (GtkWidget* widget = m_txtCtrlDirectoryMain->GetConnectWidget()) - ::gtk_drag_dest_unset(widget); -#endif - SetIcon(getRtsIcon()); //set application icon setRelativeFontSize(*m_buttonStart, 1.5); @@ -87,12 +74,11 @@ MainDialog::MainDialog(wxDialog* dlg, const Zstring& cfgFileName) m_bpButtonRemoveTopFolder->SetBitmapLabel(getResourceImage(L"item_remove")); setBitmapTextLabel(*m_buttonStart, getResourceImage(L"startRts").ConvertToImage(), m_buttonStart->GetLabel(), 5, 8); - //register key event Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(MainDialog::OnKeyPressed), nullptr, this); //prepare drag & drop - dirpathFirst = zen::make_unique<FolderSelector2>(*m_panelMainFolder, *m_buttonSelectFolderMain, *m_txtCtrlDirectoryMain, m_staticTextFinalPath); + dirpathFirst = std::make_unique<FolderSelector2>(*m_panelMainFolder, *m_buttonSelectFolderMain, *m_txtCtrlDirectoryMain, m_staticTextFinalPath); //--------------------------- load config values ------------------------------------ xmlAccess::XmlRealConfig newConfig; @@ -142,8 +128,6 @@ MainDialog::MainDialog(wxDialog* dlg, const Zstring& cfgFileName) //drag and drop .ffs_real and .ffs_batch on main dialog setupFileDrop(*m_panelMain); m_panelMain->Connect(EVENT_DROP_FILE, FileDropEventHandler(MainDialog::onFilesDropped), nullptr, this); - - timerForAsyncTasks.Connect(wxEVT_TIMER, wxEventHandler(MainDialog::onProcessAsyncTasks), nullptr, this); } @@ -170,15 +154,6 @@ void MainDialog::onQueryEndSession() } -void MainDialog::onProcessAsyncTasks(wxEvent& event) -{ - //schedule and run long-running tasks asynchronously - asyncTasks.evalResults(); //process results on GUI queue - if (asyncTasks.empty()) - timerForAsyncTasks.Stop(); -} - - const Zstring& MainDialog::lastConfigFileName() { static Zstring instance = zen::getConfigDir() + Zstr("LastRun.ffs_real"); @@ -200,8 +175,12 @@ void MainDialog::OnMenuAbout(wxCommandEvent& event) #error what is going on? #endif - build += zen::is64BitBuild ? L" x64" : L" x86"; - static_assert(zen::is32BitBuild || zen::is64BitBuild, ""); + build += +#ifdef ZEN_BUILD_32BIT + L" x86"; +#elif defined ZEN_BUILD_64BIT + L" x64"; +#endif showNotificationDialog(this, DialogInfoType::INFO, PopupDialogCfg(). setTitle(_("About")). @@ -495,7 +474,7 @@ void MainDialog::removeAddFolder(size_t pos) //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 //=> since we're in a mouse button callback of a sub-component of "pairToDelete" we need to delay deletion ourselves: - processAsync2([] {}, [pairToDelete] { pairToDelete->Destroy(); }); + guiQueue.processAsync([] {}, [pairToDelete] { pairToDelete->Destroy(); }); //set size of scrolled window const size_t additionalRows = std::min(dirpathsExtra.size(), MAX_ADD_FOLDERS); //up to MAX_ADD_FOLDERS additional folders shall be shown diff --git a/FreeFileSync/Source/RealtimeSync/main_dlg.h b/FreeFileSync/Source/RealtimeSync/main_dlg.h index 159a135f..768b6098 100644 --- a/FreeFileSync/Source/RealtimeSync/main_dlg.h +++ b/FreeFileSync/Source/RealtimeSync/main_dlg.h @@ -4,14 +4,14 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef REALTIMESYNCMAIN_H -#define REALTIMESYNCMAIN_H +#ifndef RTS_MAIN_DLG_H_2384790842252445 +#define RTS_MAIN_DLG_H_2384790842252445 #include "gui_generated.h" #include <vector> #include <memory> #include <zen/zstring.h> -#include <zen/async_task.h> +#include <wx+/async_task.h> #include <wx+/file_drop.h> #include <wx/timer.h> #include "folder_selector2.h" @@ -53,9 +53,6 @@ private: xmlAccess::XmlRealConfig getConfiguration(); void setLastUsedConfig(const Zstring& filepath); - void layoutAsync(); //call Layout() asynchronously - - //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(); @@ -67,16 +64,7 @@ private: Zstring currentConfigFileName; - void onProcessAsyncTasks(wxEvent& event); - - template <class Fun, class Fun2> - void processAsync(Fun doAsync, Fun2 evalOnGui) { asyncTasks.add(doAsync, evalOnGui); timerForAsyncTasks.Start(50); /*timer interval in [ms] */ } - template <class Fun, class Fun2> - void processAsync2(Fun doAsync, Fun2 evalOnGui) { asyncTasks.add2(doAsync, evalOnGui); timerForAsyncTasks.Start(50); /*timer interval in [ms] */ } - - //schedule and run long-running tasks asynchronously, but process results on GUI queue - zen::AsyncTasks asyncTasks; - wxTimer timerForAsyncTasks; //don't use wxWidgets idle handling => repeated idle requests/consumption hogs 100% cpu! + zen::AsyncGuiQueue guiQueue; //schedule and run long-running tasks asynchronously, but process results on GUI queue }; -#endif // REALTIMESYNCMAIN_H +#endif //RTS_MAIN_DLG_H_2384790842252445 diff --git a/FreeFileSync/Source/algorithm.cpp b/FreeFileSync/Source/algorithm.cpp index cce383db..189d63ea 100644 --- a/FreeFileSync/Source/algorithm.cpp +++ b/FreeFileSync/Source/algorithm.cpp @@ -7,6 +7,7 @@ #include "algorithm.h" #include <set> #include <unordered_map> +#include <zen/perf.h> #include "lib/norm_filter.h" #include "lib/db_file.h" #include "lib/cmp_filetime.h" @@ -219,7 +220,7 @@ bool stillInSync(const InSyncFile& dbFile, CompareVariant compareVar, int fileTi switch (compareVar) { case CMP_BY_TIME_SIZE: - if (dbFile.cmpVar == CMP_BY_CONTENT) return true; //special rule: this is already "good enough" for CMP_BY_TIME_SIZE! + if (dbFile.cmpVar == CMP_BY_CONTENT) return true; //special rule: this is certainly "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, optTimeShiftHours); @@ -311,64 +312,90 @@ bool stillInSync(const InSyncDir& dbDir) class DetectMovedFiles { public: - static void execute(BaseDirPair& baseDirectory, const InSyncDir& dbContainer) { DetectMovedFiles(baseDirectory, dbContainer); } + static void execute(BaseDirPair& baseDirectory, const InSyncDir& dbFolder) { DetectMovedFiles(baseDirectory, dbFolder); } private: - DetectMovedFiles(BaseDirPair& baseDirectory, const InSyncDir& dbContainer) : + DetectMovedFiles(BaseDirPair& baseDirectory, const InSyncDir& dbFolder) : cmpVar (baseDirectory.getCompVariant()), fileTimeTolerance(baseDirectory.getFileTimeTolerance()), optTimeShiftHours(baseDirectory.getTimeShift()) { - recurse(baseDirectory); + recurse(baseDirectory, &dbFolder); - if (!exLeftOnly.empty() && !exRightOnly.empty()) - detectFilePairs(dbContainer); + if ((!exLeftOnlyById .empty() || !exLeftOnlyByPath .empty()) && + (!exRightOnlyById.empty() || !exRightOnlyByPath.empty())) + detectMovePairs(dbFolder); } - void recurse(HierarchyObject& hierObj) + void recurse(HierarchyObject& hierObj, const InSyncDir* dbFolder) { for (FilePair& fileObj : hierObj.refSubFiles()) { + auto getDbFileEntry = [&]() -> const InSyncFile* //evaluate lazily! + { + if (dbFolder) + { + auto it = dbFolder->files.find(fileObj.getPairShortName()); + if (it != dbFolder->files.end()) + return &it->second; + } + return nullptr; + }; + const CompareFilesResult cat = fileObj.getCategory(); if (cat == FILE_LEFT_SIDE_ONLY) { - if (!fileObj.getFileId<LEFT_SIDE>().empty()) + if (const InSyncFile* dbFile = getDbFileEntry()) + exLeftOnlyByPath.emplace(dbFile, &fileObj); + else if (!fileObj.getFileId<LEFT_SIDE>().empty()) { - auto rv = exLeftOnly.emplace(fileObj.getFileId<LEFT_SIDE>(), &fileObj); - assert(rv.second); - if (!rv.second) //duplicate file ID! NTFS hard links? + auto rv = exLeftOnlyById.emplace(fileObj.getFileId<LEFT_SIDE>(), &fileObj); + if (!rv.second) //duplicate file ID! NTFS hard link/symlink? rv.first->second = nullptr; } } else if (cat == FILE_RIGHT_SIDE_ONLY) { - if (!fileObj.getFileId<RIGHT_SIDE>().empty()) + if (const InSyncFile* dbFile = getDbFileEntry()) + exRightOnlyByPath.emplace(dbFile, &fileObj); + else if (!fileObj.getFileId<RIGHT_SIDE>().empty()) { - auto rv = exRightOnly.emplace(fileObj.getFileId<RIGHT_SIDE>(), &fileObj); - assert(rv.second); - if (!rv.second) //duplicate file ID! NTFS hard links? + auto rv = exRightOnlyById.emplace(fileObj.getFileId<RIGHT_SIDE>(), &fileObj); + if (!rv.second) //duplicate file ID! NTFS hard link/symlink? rv.first->second = nullptr; } } } + for (DirPair& dirObj : hierObj.refSubDirs()) - recurse(dirObj); + { + const InSyncDir* dbSubFolder = nullptr; //try to find corresponding database entry + if (dbFolder) + { + auto it = dbFolder->dirs.find(dirObj.getPairShortName()); + if (it != dbFolder->dirs.end()) + dbSubFolder = &it->second; + } + + recurse(dirObj, dbSubFolder); + } } - void detectFilePairs(const InSyncDir& container) const + void detectMovePairs(const InSyncDir& container) const { for (auto& dbFile : container.files) findAndSetMovePair(dbFile.second); for (auto& dbDir : container.dirs) - detectFilePairs(dbDir.second); + detectMovePairs(dbDir.second); } - static bool sameSizeAndDateLeft(const FilePair& fsObj, const InSyncFile& dbEntry) + template <SelectedSide side> + static bool sameSizeAndDate(const FilePair& fileObj, const InSyncFile& dbFile) { - return fsObj.getFileSize<LEFT_SIDE>() == dbEntry.fileSize && - sameFileTime(fsObj.getLastWriteTime<LEFT_SIDE>(), dbEntry.left.lastWriteTimeRaw, 2, 0); + return fileObj.getFileSize<side>() == dbFile.fileSize && + sameFileTime(fileObj.getLastWriteTime<side>(), getDescriptor<side>(dbFile).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) @@ -376,47 +403,56 @@ private: //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, 0); - } - void findAndSetMovePair(const InSyncFile& dbEntry) const + template <SelectedSide side> + static FilePair* getAssocFilePair(const InSyncFile& dbFile, + const std::unordered_map<ABF::FileId, FilePair*, StringHash>& exOneSideById, + const std::unordered_map<const InSyncFile*, FilePair*>& exOneSideByPath) { - const ABF::FileId idLeft = dbEntry.left .fileId; - const ABF::FileId idRight = dbEntry.right.fileId; + { + auto it = exOneSideByPath.find(&dbFile); + if (it != exOneSideByPath.end()) + return it->second; //if there is an association by path, don't care if there is also an association by id, + //even if the association by path doesn't match time and size while the association by id does! + //- there doesn't seem to be (any?) value in allowing this! + //- note: exOneSideById isn't filled in this case, see recurse() + } - if (!idLeft .empty() && - !idRight.empty() && - stillInSync(dbEntry, cmpVar, fileTimeTolerance, optTimeShiftHours)) + const ABF::FileId fileId = getDescriptor<side>(dbFile).fileId; + if (!fileId.empty()) { - auto itL = exLeftOnly.find(idLeft); - if (itL != exLeftOnly.end()) - if (FilePair* fileLeftOnly = itL->second) //= nullptr, if duplicate ID! - if (sameSizeAndDateLeft(*fileLeftOnly, dbEntry)) - { - auto itR = exRightOnly.find(idRight); - if (itR != exRightOnly.end()) - if (FilePair* fileRightOnly = itR->second) //= nullptr, if duplicate ID! - if (sameSizeAndDateRight(*fileRightOnly, dbEntry)) - if (fileLeftOnly ->getMoveRef() == nullptr && //the db may contain duplicate file ids on left or right side: e.g. consider aliasing through symlinks - fileRightOnly->getMoveRef() == nullptr) //=> should not be a problem (same id, size, date => alias!) but don't let a row participate in two move pairs! - { - fileLeftOnly ->setMoveRef(fileRightOnly->getId()); //found a pair, mark it! - fileRightOnly->setMoveRef(fileLeftOnly ->getId()); // - } - } + auto it = exOneSideById.find(fileId); + if (it != exOneSideById.end()) + return it->second; //= nullptr, if duplicate ID! } + return nullptr; + } + + void findAndSetMovePair(const InSyncFile& dbFile) const + { + if (stillInSync(dbFile, cmpVar, fileTimeTolerance, optTimeShiftHours)) + if (FilePair* fileLeftOnly = getAssocFilePair<LEFT_SIDE>(dbFile, exLeftOnlyById, exLeftOnlyByPath)) + if (sameSizeAndDate<LEFT_SIDE>(*fileLeftOnly, dbFile)) + if (FilePair* fileRightOnly = getAssocFilePair<RIGHT_SIDE>(dbFile, exRightOnlyById, exRightOnlyByPath)) + if (sameSizeAndDate<RIGHT_SIDE>(*fileRightOnly, dbFile)) + if (fileLeftOnly ->getMoveRef() == nullptr && //don't let a row participate in two move pairs! + fileRightOnly->getMoveRef() == nullptr) // + { + fileLeftOnly ->setMoveRef(fileRightOnly->getId()); //found a pair, mark it! + fileRightOnly->setMoveRef(fileLeftOnly ->getId()); // + } } const CompareVariant cmpVar; const int fileTimeTolerance; const unsigned int optTimeShiftHours; - std::map<ABF::FileId, FilePair*> exLeftOnly; //FilePair* == nullptr for duplicate ids! => consider aliasing through symlinks! - std::map<ABF::FileId, FilePair*> exRightOnly; //=> avoid ambiguity for mixtures of files/symlinks on one side and allow 1-1 mapping only! + std::unordered_map<ABF::FileId, FilePair*, StringHash> exLeftOnlyById; //FilePair* == nullptr for duplicate ids! => consider aliasing through symlinks! + std::unordered_map<ABF::FileId, FilePair*, StringHash> exRightOnlyById; //=> avoid ambiguity for mixtures of files/symlinks on one side and allow 1-1 mapping only! + //MSVC: std::unordered_map: about twice as fast as std::map for 1 million items! + std::unordered_map<const InSyncFile*, FilePair*> exLeftOnlyByPath; //MSVC: only 4% faster than std::map for 1 million items! + std::unordered_map<const InSyncFile*, FilePair*> exRightOnlyByPath; /* detect renamed files: @@ -430,19 +466,17 @@ private: Algorithm: ---------- DB-file left <--- (name, size, date) ---> DB-file right - | | - | (file ID, size, date) | (file ID, size, date) - \|/ \|/ + | | + | (file ID, size, date) | (file ID, size, date) + | or | or + | (file path, size, date) | (file path, size, date) + \|/ \|/ file left only file right only FAT caveat: File Ids are generally not stable when file is either moved or renamed! => 1. Move/rename operations on FAT cannot be detected reliably. => 2. database generally contains wrong file ID on FAT after renaming from .ffs_tmp files => correct file Ids in database only after next sync => 3. even exFAT screws up (but less than FAT) and changes IDs after file move. Did they learn nothing from the past? - - Possible refinement - ------------------- - If the file ID is wrong (FAT) or not available, we could at least allow direct association by name, instead of breaking the chain completely: support NTFS -> FAT */ }; @@ -451,10 +485,10 @@ private: class RedetermineTwoWay { public: - static void execute(BaseDirPair& baseDirectory, const InSyncDir& dbContainer) { RedetermineTwoWay(baseDirectory, dbContainer); } + static void execute(BaseDirPair& baseDirectory, const InSyncDir& dbFolder) { RedetermineTwoWay(baseDirectory, dbFolder); } private: - RedetermineTwoWay(BaseDirPair& baseDirectory, const InSyncDir& dbContainer) : + RedetermineTwoWay(BaseDirPair& baseDirectory, const InSyncDir& dbFolder) : 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.")), @@ -465,20 +499,20 @@ private: //-> 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) - recurse(baseDirectory, &dbContainer); + recurse(baseDirectory, &dbFolder); } - void recurse(HierarchyObject& hierObj, const InSyncDir* dbContainer) const + void recurse(HierarchyObject& hierObj, const InSyncDir* dbFolder) const { for (FilePair& fileObj : hierObj.refSubFiles()) - processFile(fileObj, dbContainer); + processFile(fileObj, dbFolder); for (SymlinkPair& linkObj : hierObj.refSubLinks()) - processSymlink(linkObj, dbContainer); + processSymlink(linkObj, dbFolder); for (DirPair& dirObj : hierObj.refSubDirs()) - processDir(dirObj, dbContainer); + processDir(dirObj, dbFolder); } - void processFile(FilePair& fileObj, const InSyncDir* dbContainer) const + void processFile(FilePair& fileObj, const InSyncDir* dbFolder) const { const CompareFilesResult cat = fileObj.getCategory(); if (cat == FILE_EQUAL) @@ -493,10 +527,10 @@ private: //try to find corresponding database entry const InSyncDir::FileList::value_type* dbEntry = nullptr; - if (dbContainer) + if (dbFolder) { - auto it = dbContainer->files.find(fileObj.getPairShortName()); - if (it != dbContainer->files.end()) + auto it = dbFolder->files.find(fileObj.getPairShortName()); + if (it != dbFolder->files.end()) dbEntry = &*it; } @@ -521,7 +555,7 @@ private: } } - void processSymlink(SymlinkPair& linkObj, const InSyncDir* dbContainer) const + void processSymlink(SymlinkPair& linkObj, const InSyncDir* dbFolder) const { const CompareSymlinkResult cat = linkObj.getLinkCategory(); if (cat == SYMLINK_EQUAL) @@ -529,10 +563,10 @@ private: //try to find corresponding database entry const InSyncDir::LinkList::value_type* dbEntry = nullptr; - if (dbContainer) + if (dbFolder) { - auto it = dbContainer->symlinks.find(linkObj.getPairShortName()); - if (it != dbContainer->symlinks.end()) + auto it = dbFolder->symlinks.find(linkObj.getPairShortName()); + if (it != dbFolder->symlinks.end()) dbEntry = &*it; } @@ -557,7 +591,7 @@ private: } } - void processDir(DirPair& dirObj, const InSyncDir* dbContainer) const + void processDir(DirPair& dirObj, const InSyncDir* dbFolder) const { const CompareDirResult cat = dirObj.getDirCategory(); @@ -570,10 +604,10 @@ private: //try to find corresponding database entry const InSyncDir::DirList::value_type* dbEntry = nullptr; - if (dbContainer) + if (dbFolder) { - auto it = dbContainer->dirs.find(dirObj.getPairShortName()); - if (it != dbContainer->dirs.end()) + auto it = dbFolder->dirs.find(dirObj.getPairShortName()); + if (it != dbFolder->dirs.end()) dbEntry = &*it; } @@ -860,13 +894,13 @@ private: void processDir(DirPair& dirObj) const { - bool subObjMightMatch = true; - const bool filterPassed = filterProc.passDirFilter(dirObj.getPairRelativePath(), &subObjMightMatch); + bool childItemMightMatch = true; + const bool filterPassed = filterProc.passDirFilter(dirObj.getPairRelativePath(), &childItemMightMatch); if (Eval<strategy>::process(dirObj)) dirObj.setActive(filterPassed); - if (!subObjMightMatch) //use same logic like directory traversing here: evaluate filter in subdirs only if objects could match + if (!childItemMightMatch) //use same logic like directory traversing here: evaluate filter in subdirs only if objects could match { inOrExcludeAllRows<false>(dirObj); //exclude all files dirs in subfolders => incompatible with STRATEGY_OR! return; diff --git a/FreeFileSync/Source/application.cpp b/FreeFileSync/Source/application.cpp index a33fe98e..ee1aac03 100644 --- a/FreeFileSync/Source/application.cpp +++ b/FreeFileSync/Source/application.cpp @@ -41,7 +41,7 @@ IMPLEMENT_APP(Application) #ifdef _MSC_VER //catch CRT floating point errors: http://msdn.microsoft.com/en-us/library/k3backsw.aspx -int _matherr(struct _exception* except) +int _matherr(_Inout_ struct _exception* except) { assert(false); return 0; //use default action @@ -598,7 +598,6 @@ void runBatchMode(const Zstring& globalConfigFile, const XmlBatchConfig& batchCf try //begin of synchronization process (all in one try-catch block) { - const TimeComp timeStamp = localTime(); const SwitchToGui switchBatchToGui(globalConfigFile, globalCfg, referenceFile, batchCfg); //prepare potential operational switch @@ -635,19 +634,17 @@ void runBatchMode(const Zstring& globalConfigFile, const XmlBatchConfig& batchCf std::unique_ptr<LockHolder> dirLocks; //COMPARE DIRECTORIES - FolderComparison folderCmp; - compare(globalCfg.optDialogs, - allowPwPrompt, - globalCfg.runWithBackgroundPriority, - globalCfg.createLockFile, - dirLocks, - cmpConfig, - folderCmp, - statusHandler); + FolderComparison cmpResult = compare(globalCfg.optDialogs, + allowPwPrompt, //allowUserInteraction + globalCfg.runWithBackgroundPriority, + globalCfg.createLockFile, + dirLocks, + cmpConfig, + statusHandler); //START SYNCHRONIZATION const std::vector<FolderPairSyncCfg> syncProcessCfg = extractSyncCfg(batchCfg.mainCfg); - if (syncProcessCfg.size() != folderCmp.size()) + if (syncProcessCfg.size() != cmpResult.size()) throw std::logic_error("Programming Error: Contract violation! " + std::string(__FILE__) + ":" + numberTo<std::string>(__LINE__)); synchronize(timeStamp, @@ -658,7 +655,7 @@ void runBatchMode(const Zstring& globalConfigFile, const XmlBatchConfig& batchCf globalCfg.failsafeFileCopy, globalCfg.runWithBackgroundPriority, syncProcessCfg, - folderCmp, + cmpResult, statusHandler); } catch (BatchAbortProcess&) {} //exit used by statusHandler diff --git a/FreeFileSync/Source/comparison.cpp b/FreeFileSync/Source/comparison.cpp index e5e2728d..86c21a76 100644 --- a/FreeFileSync/Source/comparison.cpp +++ b/FreeFileSync/Source/comparison.cpp @@ -59,7 +59,7 @@ struct ResolvedFolderPair struct ResolvedBaseFolders { std::vector<ResolvedFolderPair> resolvedPairs; - std::set<const ABF*, ABF::LessItemPath> existingBaseFolders; //references resolvedPairs variable!!! + std::set<const ABF*, ABF::LessItemPath> existingBaseFolders; //references "resolvedPairs" variable!!! }; @@ -188,9 +188,7 @@ ComparisonBuffer::ComparisonBuffer(const std::set<DirectoryKey>& keysToRead, Pro class CbImpl : public FillBufferCallback { public: - CbImpl(ProcessCallback& pcb) : - callback_(pcb), - itemsReported(0) {} + CbImpl(ProcessCallback& pcb) : callback_(pcb) {} void reportStatus(const std::wstring& statusMsg, int itemsTotal) override { @@ -218,7 +216,7 @@ ComparisonBuffer::ComparisonBuffer(const std::set<DirectoryKey>& keysToRead, Pro private: ProcessCallback& callback_; - int itemsReported; + int itemsReported = 0; } cb(callback); fillBuffer(keysToRead, //in @@ -708,10 +706,12 @@ void stripExcludedDirectories(HierarchyObject& hierObj, const HardFilter& filter //remove superfluous directories: // this does not invalidate "std::vector<FilePair*>& undefinedFiles", since we delete folders only - // and there is no side-effect for memory positions of FilePair and SymlinkPair thanks to zen::FixedList! + // and there is no side-effect for memory positions of FilePair and SymlinkPair thanks to zen::FixedList! + static_assert(IsSameType<FixedList<DirPair>, HierarchyObject::SubDirVec>::value, ""); + hierObj.refSubDirs().remove_if([&](DirPair& dirObj) { - const bool included = filterProc.passDirFilter(dirObj.getPairRelativePath(), nullptr); //subObjMightMatch is false, child items were already excluded during scanning + const bool included = filterProc.passDirFilter(dirObj.getPairRelativePath(), nullptr); //childItemMightMatch is false, child items were already excluded during scanning if (!included) //falsify only! (e.g. might already be inactive due to read error!) dirObj.setActive(false); @@ -792,21 +792,20 @@ std::shared_ptr<BaseDirPair> ComparisonBuffer::performComparison(const ResolvedF } -void zen::compare(xmlAccess::OptionalDialogs& warnings, - bool allowUserInteraction, - bool runWithBackgroundPriority, - bool createDirLocks, - std::unique_ptr<LockHolder>& dirLocks, - const std::vector<FolderPairCfg>& cfgList, - FolderComparison& output, - ProcessCallback& callback) +FolderComparison zen::compare(xmlAccess::OptionalDialogs& warnings, + bool allowUserInteraction, + bool runWithBackgroundPriority, + bool createDirLocks, + std::unique_ptr<LockHolder>& dirLocks, + const std::vector<FolderPairCfg>& cfgList, + ProcessCallback& callback) { //specify process and resource handling priorities std::unique_ptr<ScheduleForBackgroundProcessing> backgroundPrio; if (runWithBackgroundPriority) try { - backgroundPrio = make_unique<ScheduleForBackgroundProcessing>(); //throw FileError + backgroundPrio = std::make_unique<ScheduleForBackgroundProcessing>(); //throw FileError } catch (const FileError& e) //not an error in this context { @@ -817,7 +816,7 @@ void zen::compare(xmlAccess::OptionalDialogs& warnings, std::unique_ptr<PreventStandby> noStandby; try { - noStandby = make_unique<PreventStandby>(); //throw FileError + noStandby = std::make_unique<PreventStandby>(); //throw FileError } catch (const FileError& e) //not an error in this context { @@ -860,7 +859,7 @@ void zen::compare(xmlAccess::OptionalDialogs& warnings, if (Opt<Zstring> folderPath = ABF::getNativeItemPath(baseFolder->getAbstractPath())) //restrict directory locking to native paths until further dirPathsExisting.insert(*folderPath); - dirLocks = zen::make_unique<LockHolder>(dirPathsExisting, warnings.warningDirectoryLockFailed, callback); + dirLocks = std::make_unique<LockHolder>(dirPathsExisting, warnings.warningDirectoryLockFailed, callback); } try @@ -876,7 +875,7 @@ void zen::compare(xmlAccess::OptionalDialogs& warnings, dirsToRead.emplace(*w.first.abfRight, w.second.filter.nameFilter, w.second.handleSymlinks); } - FolderComparison outputTmp; //write to output as a transaction! + FolderComparison output; //reduce peak memory by restricting lifetime of ComparisonBuffer to have ended when loading potentially huge InSyncDir instance in redetermineSyncDirection() { @@ -903,26 +902,26 @@ void zen::compare(xmlAccess::OptionalDialogs& warnings, switch (w.second.compareVar) { case CMP_BY_TIME_SIZE: - outputTmp.push_back(cmpBuff.compareByTimeSize(w.first, w.second)); + output.push_back(cmpBuff.compareByTimeSize(w.first, w.second)); break; case CMP_BY_CONTENT: assert(!outputByContent.empty()); if (!outputByContent.empty()) { - outputTmp.push_back(outputByContent.front()); + output.push_back(outputByContent.front()); outputByContent.pop_front(); } break; } } - assert(outputTmp.size() == cfgList.size()); + assert(output.size() == cfgList.size()); //--------- set initial sync-direction -------------------------------------------------- - for (auto j = begin(outputTmp); j != end(outputTmp); ++j) + for (auto j = begin(output); j != end(output); ++j) { - const FolderPairCfg& fpCfg = cfgList[j - outputTmp.begin()]; + const FolderPairCfg& fpCfg = cfgList[j - output.begin()]; callback.reportStatus(_("Calculating sync directions...")); callback.forceUiRefresh(); @@ -932,14 +931,13 @@ void zen::compare(xmlAccess::OptionalDialogs& warnings, [&](std::int64_t bytesDelta) { callback.requestUiRefresh(); });//throw X } - //output is written only if everything was processed correctly - //note: output mustn't change during this process to be in sync with GUI grid view!!! - outputTmp.swap(output); + return output; } catch (const std::bad_alloc& e) { callback.reportFatalError(_("Out of memory.") + L" " + utfCvrtTo<std::wstring>(e.what())); //we need to maintain the "output.size() == cfgList.size()" contract in ALL cases! => abort callback.abortProcessNow(); //throw X + throw std::logic_error("Programming Error: Contract violation! " + std::string(__FILE__) + ":" + numberTo<std::string>(__LINE__)); } } diff --git a/FreeFileSync/Source/comparison.h b/FreeFileSync/Source/comparison.h index c96137de..0a88ef8a 100644 --- a/FreeFileSync/Source/comparison.h +++ b/FreeFileSync/Source/comparison.h @@ -51,14 +51,13 @@ struct FolderPairCfg std::vector<FolderPairCfg> extractCompareCfg(const MainConfiguration& mainCfg, int fileTimeTolerance); //fill FolderPairCfg and resolve folder pairs //FFS core routine: -void compare(xmlAccess::OptionalDialogs& warnings, - bool allowUserInteraction, - bool runWithBackgroundPriority, - bool createDirLocks, - std::unique_ptr<LockHolder>& dirLocks, //out - const std::vector<FolderPairCfg>& cfgList, - FolderComparison& output, //out - ProcessCallback& callback); +FolderComparison compare(xmlAccess::OptionalDialogs& warnings, + bool allowUserInteraction, + bool runWithBackgroundPriority, + bool createDirLocks, + std::unique_ptr<LockHolder>& dirLocks, //out + const std::vector<FolderPairCfg>& cfgList, + ProcessCallback& callback); } #endif // COMPARISON_H_INCLUDED diff --git a/FreeFileSync/Source/file_hierarchy.h b/FreeFileSync/Source/file_hierarchy.h index 4b532b2e..ca3974ff 100644 --- a/FreeFileSync/Source/file_hierarchy.h +++ b/FreeFileSync/Source/file_hierarchy.h @@ -114,22 +114,22 @@ struct DirContainer LinkList links; //non-followed symlinks //convenience - DirContainer& addSubDir(const Zstring& shortName) + DirContainer& addSubDir(const Zstring& itemName) { - return dirs[shortName]; //value default-construction is okay here - //return dirs.emplace(shortName, DirContainer()).first->second; + return dirs[itemName]; //value default-construction is okay here + //return dirs.emplace(itemName, DirContainer()).first->second; } - void addSubFile(const Zstring& shortName, const FileDescriptor& fileData) + void addSubFile(const Zstring& itemName, const FileDescriptor& fileData) { - auto rv = files.emplace(shortName, fileData); + auto rv = files.emplace(itemName, fileData); if (!rv.second) //update entry if already existing (e.g. during folder traverser "retry") rv.first->second = fileData; } - void addSubLink(const Zstring& shortName, const LinkDescriptor& linkData) + void addSubLink(const Zstring& itemName, const LinkDescriptor& linkData) { - auto rv = links.emplace(shortName, linkData); + auto rv = links.emplace(itemName, linkData); if (!rv.second) rv.first->second = linkData; } @@ -373,7 +373,7 @@ public: std::wstring getCatExtraDescription() const; //only filled if getCategory() == FILE_CONFLICT or FILE_DIFFERENT_METADATA //sync settings - SyncDirection getSyncDir() const; + SyncDirection getSyncDir() const { return syncDir_; } void setSyncDir(SyncDirection newDir); void setSyncDirConflict(const std::wstring& description); //set syncDir = SyncDirection::NONE + fill conflict description @@ -405,8 +405,6 @@ protected: HierarchyObject& parentObj, CompareFilesResult defaultCmpResult) : cmpResult(defaultCmpResult), - selectedForSynchronization(true), - syncDir_(SyncDirection::NONE), shortNameLeft_(shortNameLeft), shortNameRight_(shortNameRight), //shortNameRight_(shortNameRight == shortNameLeft ? shortNameLeft : shortNameRight), -> strangely doesn't seem to shrink peak memory consumption at all! @@ -434,10 +432,10 @@ private: std::unique_ptr<std::wstring> cmpResultDescr; //only filled if getCategory() == FILE_CONFLICT or FILE_DIFFERENT_METADATA CompareFilesResult cmpResult; //although this uses 4 bytes there is currently *no* space wasted in class layout! - bool selectedForSynchronization; + bool selectedForSynchronization = true; //Note: we model *four* states with following two variables => "syncDirectionConflict is empty or syncDir == NONE" is a class invariant!!! - SyncDirection syncDir_; //1 byte: optimize memory layout! + SyncDirection syncDir_ = SyncDirection::NONE; //1 byte: optimize memory layout! std::unique_ptr<std::wstring> syncDirectionConflict; //non-empty if we have a conflict setting sync-direction //get rid of std::wstring small string optimization (consumes 32/48 byte on VS2010 x86/x64!) @@ -463,9 +461,7 @@ public: HierarchyObject& parentObj, CompareDirResult defaultCmpResult) : FileSystemObject(shortNameLeft, shortNameRight, parentObj, static_cast<CompareFilesResult>(defaultCmpResult)), - HierarchyObject(getPairRelativePath() + FILE_NAME_SEPARATOR, parentObj.getRoot()), - syncOpBuffered(SO_DO_NOTHING), - haveBufferedSyncOp(false) {} + HierarchyObject(getPairRelativePath() + FILE_NAME_SEPARATOR, parentObj.getRoot()) {} SyncOperation getSyncOperation() const override; @@ -477,8 +473,8 @@ private: void removeObjectR() override; void notifySyncCfgChanged() override { haveBufferedSyncOp = false; FileSystemObject::notifySyncCfgChanged(); HierarchyObject::notifySyncCfgChanged(); } - mutable SyncOperation syncOpBuffered; //determining sync-op for directory may be expensive as it depends on child-objects -> buffer it - mutable bool haveBufferedSyncOp; // + mutable SyncOperation syncOpBuffered = SO_DO_NOTHING; //determining sync-op for directory may be expensive as it depends on child-objects -> buffer it + mutable bool haveBufferedSyncOp = false; // }; //------------------------------------------------------------------ @@ -498,8 +494,7 @@ public: HierarchyObject& parentObj) : FileSystemObject(shortNameLeft, shortNameRight, parentObj, defaultCmpResult), dataLeft(left), - dataRight(right), - moveFileRef(nullptr) {} + dataRight(right) {} template <SelectedSide side> std::int64_t getLastWriteTime() const; template <SelectedSide side> std::uint64_t getFileSize() const; @@ -534,7 +529,7 @@ private: FileDescriptor dataLeft; FileDescriptor dataRight; - ObjectId moveFileRef; //optional, filled by redetermineSyncDirection() + ObjectId moveFileRef = nullptr; //optional, filled by redetermineSyncDirection() }; //------------------------------------------------------------------ @@ -633,20 +628,13 @@ inline std::wstring FileSystemObject::getCatExtraDescription() const { assert(getCategory() == FILE_CONFLICT || getCategory() == FILE_DIFFERENT_METADATA); - if (cmpResultDescr) //avoid ternary-WTF! + if (cmpResultDescr) //avoid ternary-WTF! (implicit copy-constructor call!!!!!!) return *cmpResultDescr; return std::wstring(); } inline -SyncDirection FileSystemObject::getSyncDir() const -{ - return syncDir_; -} - - -inline void FileSystemObject::setSyncDir(SyncDirection newDir) { syncDir_ = newDir; @@ -660,7 +648,7 @@ inline void FileSystemObject::setSyncDirConflict(const std::wstring& description) { syncDir_ = SyncDirection::NONE; - syncDirectionConflict = zen::make_unique<std::wstring>(description); + syncDirectionConflict = std::make_unique<std::wstring>(description); notifySyncCfgChanged(); } @@ -670,7 +658,7 @@ inline std::wstring FileSystemObject::getSyncOpConflict() const { assert(getSyncOperation() == SO_UNRESOLVED_CONFLICT); - if (syncDirectionConflict) //avoid ternary-WTF! + if (syncDirectionConflict) //avoid ternary-WTF! (implicit copy-constructor call!!!!!!) return *syncDirectionConflict; return std::wstring(); } @@ -715,7 +703,7 @@ const Zstring& FileSystemObject::getItemName() const template <SelectedSide side> inline Zstring FileSystemObject::getRelativePath() const { - if (isEmpty<side>()) //avoid ternary-WTF! + if (isEmpty<side>()) //avoid ternary-WTF! (implicit copy-constructor call!!!!!!) return Zstring(); return parent_.getPairRelativePathPf() + getItemName<side>(); } @@ -796,14 +784,14 @@ inline void FileSystemObject::setCategoryConflict(const std::wstring& description) { cmpResult = FILE_CONFLICT; - cmpResultDescr = zen::make_unique<std::wstring>(description); + cmpResultDescr = std::make_unique<std::wstring>(description); } inline void FileSystemObject::setCategoryDiffMetadata(const std::wstring& description) { cmpResult = FILE_DIFFERENT_METADATA; - cmpResultDescr = zen::make_unique<std::wstring>(description); + cmpResultDescr = std::make_unique<std::wstring>(description); } inline diff --git a/FreeFileSync/Source/fs/abstract.cpp b/FreeFileSync/Source/fs/abstract.cpp index 79ba889f..283e3c17 100644 --- a/FreeFileSync/Source/fs/abstract.cpp +++ b/FreeFileSync/Source/fs/abstract.cpp @@ -124,10 +124,10 @@ ABF::FileAttribAfterCopy ABF::copyFileTransactional(const AbstractPathRef& apSou { /* Note: non-transactional file copy solves at least four problems: - -> skydrive - doesn't allow for .ffs_tmp extension and returns ERROR_INVALID_PARAMETER - -> network renaming issues - -> allow for true delete before copy to handle low disk space problems - -> higher performance on non-buffered drives (e.g. usb sticks) + -> skydrive - doesn't allow for .ffs_tmp extension and returns ERROR_INVALID_PARAMETER + -> network renaming issues + -> allow for true delete before copy to handle low disk space problems + -> higher performance on non-buffered drives (e.g. usb sticks) */ if (onDeleteTargetFile) onDeleteTargetFile(); @@ -166,18 +166,18 @@ struct FlatTraverserCallback: public ABF::TraverserCallback { FlatTraverserCallback(const AbstractPathRef& folderPath) : folderPath_(folderPath) {} - void onFile (const FileInfo& fi) override { fileNames_ .push_back(fi.shortName); } - std::unique_ptr<TraverserCallback> onDir (const DirInfo& di) override { folderNames_.push_back(di.shortName); return nullptr; } + void onFile (const FileInfo& fi) override { fileNames_ .push_back(fi.itemName); } + std::unique_ptr<TraverserCallback> onDir (const DirInfo& di) override { folderNames_.push_back(di.itemName); return nullptr; } HandleLink onSymlink(const SymlinkInfo& si) override { - if (ABF::folderExists(ABF::appendRelPath(folderPath_, si.shortName))) //dir symlink - folderLinkNames_.push_back(si.shortName); + if (ABF::folderExists(ABF::appendRelPath(folderPath_, si.itemName))) //dir symlink + folderLinkNames_.push_back(si.itemName); else //file symlink, broken symlink - fileNames_.push_back(si.shortName); + fileNames_.push_back(si.itemName); return TraverserCallback::LINK_SKIP; } - HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override { throw FileError(msg); } - HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) override { throw FileError(msg); } + HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override { throw FileError(msg); } + HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zstring& itemName) override { throw FileError(msg); } const std::vector<Zstring>& refFileNames () const { return fileNames_; } const std::vector<Zstring>& refFolderNames () const { return folderNames_; } @@ -198,7 +198,7 @@ void removeFolderRecursivelyImpl(const AbstractPathRef& folderPath, //throw File assert(!ABF::symlinkExists(folderPath)); //[!] no symlinks in this context!!! assert(ABF::folderExists(folderPath)); //Do NOT traverse into it deleting contained files!!! - FlatTraverserCallback ft(folderPath); //traverse source directory one level deep + FlatTraverserCallback ft(folderPath); //deferred recursion => save stack space and allow deletion of extremely deep hierarchies! ABF::traverseFolder(folderPath, ft); //throw FileError for (const Zstring& fileName : ft.refFileNames()) @@ -219,7 +219,6 @@ void removeFolderRecursivelyImpl(const AbstractPathRef& folderPath, //throw File ABF::removeFolderSimple(linkPath); //throw FileError } - //remove folders recursively: for (const Zstring& folderName : ft.refFolderNames()) removeFolderRecursivelyImpl(ABF::appendRelPath(folderPath, folderName), //throw FileError onBeforeFileDeletion, onBeforeFolderDeletion); diff --git a/FreeFileSync/Source/fs/abstract.h b/FreeFileSync/Source/fs/abstract.h index ffc4fd73..b54deecb 100644 --- a/FreeFileSync/Source/fs/abstract.h +++ b/FreeFileSync/Source/fs/abstract.h @@ -40,6 +40,9 @@ struct AbstractBaseFolder { virtual Zstring getInitPathPhrase() const = 0; //noexcept + //copy this instance for life-time management and safe access on any method by a different thread: + virtual std::unique_ptr<AbstractBaseFolder> createIndependentCopy() const = 0; //noexcept + static std::wstring getDisplayPath(const AbstractPathRef& ap) { return ap.abf->getDisplayPath(ap.itemPathImpl); } static Zstring getFileShortName(const AbstractPathRef& ap) { return ap.abf->getFileShortName(ap.itemPathImpl); } @@ -94,6 +97,7 @@ struct AbstractBaseFolder static Zstring getSymlinkContentBuffer(const AbstractPathRef& ap) { return ap.abf->getSymlinkContentBuffer(ap.itemPathImpl); } //throw FileError //---------------------------------------------------------------------------------------------------------------- + struct IconLoader { std::function<ImageHolder(int pixelSize)> getThumbnailImage; //optional, noexcept! @@ -127,6 +131,7 @@ struct AbstractBaseFolder //TRANSACTIONAL output stream! => call finalize when done! //- takes ownership and deletes on errors!!!! => transactionally create output stream first if not existing!! + //- AbstractPathRef member => implicit contract: ABF instance needs to out-live OutputStream! struct OutputStream { virtual ~OutputStream(); @@ -164,13 +169,13 @@ struct AbstractBaseFolder struct SymlinkInfo { - const Zchar* shortName; + const Zstring& itemName; std::int64_t lastWriteTime; //number of seconds since Jan. 1st 1970 UTC }; struct FileInfo { - const Zchar* shortName; + const Zstring& itemName; std::uint64_t fileSize; //unit: bytes! std::int64_t lastWriteTime; //number of seconds since Jan. 1st 1970 UTC const FileId id; //optional: empty if not supported! @@ -179,7 +184,7 @@ struct AbstractBaseFolder struct DirInfo { - const Zchar* shortName; + const Zstring& itemName; }; enum HandleLink @@ -200,10 +205,9 @@ struct AbstractBaseFolder //nullptr: ignore directory, non-nullptr: traverse into, using the (new) callback 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! + virtual HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zstring& itemName) = 0; //failed to get data for single file/dir/symlink only! }; - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! //- client needs to handle duplicate file reports! (FilePlusTraverser fallback, retrying to read directory contents, ...) static void traverseFolder(const AbstractPathRef& ap, TraverserCallback& sink) { ap.abf->traverseFolder(ap.itemPathImpl, sink); } //---------------------------------------------------------------------------------------------------------------- @@ -244,8 +248,15 @@ struct AbstractBaseFolder virtual ~AbstractBaseFolder() {} - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! - AbstractPathRef getAbstractPath(const Zstring& relPath) const { return AbstractPathRef(*this, appendRelPathToItemPathImpl(getBasePathImpl(), relPath)); } + AbstractPathRef getAbstractPath(const Zstring& relPath) const + { +#ifdef ZEN_WIN + assert(!contains(relPath, L"/")); //relPath is expected to use FILE_NAME_SEPARATOR! +#endif + assert(relPath.empty() || (!startsWith(relPath, FILE_NAME_SEPARATOR) && !endsWith(relPath, FILE_NAME_SEPARATOR))); + + return AbstractPathRef(*this, appendRelPathToItemPathImpl(getBasePathImpl(), relPath)); + } AbstractPathRef getAbstractPath() const { return AbstractPathRef(*this, getBasePathImpl()); } //limitation: zen::Opt requires default-constructibility => we need to use std::unique_ptr: @@ -283,13 +294,10 @@ protected: //grant derived classes access to AbstractPathRef: private: virtual bool isNativeFileSystem() const { return false; }; - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! virtual std::wstring getDisplayPath(const Zstring& itemPathImpl) const = 0; - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! virtual Zstring appendRelPathToItemPathImpl(const Zstring& itemPathImpl, const Zstring& relPath) const = 0; - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! virtual Zstring getBasePathImpl() const = 0; //used during folder creation if parent folder is missing @@ -336,7 +344,7 @@ private: const std::uint64_t* streamSize, //optional const std::int64_t* modificationTime) const = 0; // //---------------------------------------------------------------------------------------------------------------- - virtual void traverseFolder(const Zstring& itemPathImpl, TraverserCallback& sink) const = 0; + virtual void traverseFolder(const Zstring& itemPathImpl, TraverserCallback& sink) const = 0; //noexcept //---------------------------------------------------------------------------------------------------------------- //symlink handling: follow link! @@ -376,7 +384,7 @@ bool tryReportingDirError(Command cmd, AbstractBaseFolder::TraverserCallback& ca template <class Command> inline //function object expecting to throw FileError if operation fails -bool tryReportingItemError(Command cmd, AbstractBaseFolder::TraverserCallback& callback, const Zchar* shortName) //return "true" on success, "false" if error was ignored +bool tryReportingItemError(Command cmd, AbstractBaseFolder::TraverserCallback& callback, const Zstring& itemName) //return "true" on success, "false" if error was ignored { for (size_t retryNumber = 0;; ++retryNumber) try @@ -386,7 +394,7 @@ bool tryReportingItemError(Command cmd, AbstractBaseFolder::TraverserCallback& c } catch (const FileError& e) { - switch (callback.reportItemError(e.toString(), retryNumber, shortName)) + switch (callback.reportItemError(e.toString(), retryNumber, itemName)) { case AbstractBaseFolder::TraverserCallback::ON_ERROR_RETRY: break; @@ -409,6 +417,7 @@ struct AbstractPathRef::ItemId ItemId(const AbstractBaseFolder* abfIn, const Zstring& itemPathImplIn) : abf(abfIn), itemPathImpl(itemPathImplIn) {} inline friend bool operator<(const ItemId& lhs, const ItemId& rhs) { return lhs.abf != rhs.abf ? lhs.abf < rhs.abf : lhs.itemPathImpl < rhs.itemPathImpl; } + //don't treat itemPathImpl like regular file path => no case-insensitive comparison on Windows/OS X! private: const void* abf; @@ -488,7 +497,7 @@ AbstractBaseFolder::OutputStream::~OutputStream() { if (!finalizeSucceeded) //transactional output stream! => clean up! try { removeFile(filePath_); /*throw FileError*/ } - catch (FileError&) { assert(false); } + catch (FileError& e) { (void)e; assert(false); } } diff --git a/FreeFileSync/Source/fs/native.cpp b/FreeFileSync/Source/fs/native.cpp index 60b9faea..5398b507 100644 --- a/FreeFileSync/Source/fs/native.cpp +++ b/FreeFileSync/Source/fs/native.cpp @@ -16,13 +16,34 @@ #include "../lib/icon_loader.h" #include "native_traverser_impl.h" -#if defined ZEN_LINUX || defined ZEN_MAC +#ifdef ZEN_WIN + #include <zen/com_tools.h> + +#elif defined ZEN_LINUX || defined ZEN_MAC #include <fcntl.h> //fallocate, fcntl #endif namespace { +#ifdef ZEN_WIN + //manage COM-cleanup at per-thread-scope: + thread_local std::unique_ptr<ComInitializer> nativeComInitThread; +#endif + + +void initComForThread() //throw FileError +{ +#ifdef ZEN_WIN + try + { + if (!nativeComInitThread) nativeComInitThread = std::make_unique<ComInitializer>(); //throw SysError + } + catch (const SysError& e) { throw FileError(e.toString()); } //there's little value in giving additional/misleading context info => just convert SysError to FileError +#endif +} + + class RecycleSessionNative : public AbstractBaseFolder::RecycleSession { public: @@ -50,12 +71,12 @@ void evalAttributeByHandle(FileHandle fh, const Zstring& filePath, Function eval #ifdef ZEN_WIN BY_HANDLE_FILE_INFORMATION fileInfo = {}; if (!::GetFileInformationByHandle(fh, &fileInfo)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"GetFileInformationByHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"GetFileInformationByHandle"); #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat fileInfo = {}; if (::fstat(fh, &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"fstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"fstat"); #endif evalFileInfo(fileInfo); } @@ -109,13 +130,13 @@ void preAllocateSpaceBestEffort(FileHandle fh, const std::uint64_t streamSize, c fileSize, //__in LARGE_INTEGER liDistanceToMove, nullptr, //__out_opt PLARGE_INTEGER lpNewFilePointer, FILE_BEGIN)) //__in DWORD dwMoveMethod - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"SetFilePointerEx", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"SetFilePointerEx"); if (!::SetEndOfFile(fh)) - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"SetEndOfFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"SetEndOfFile"); if (!::SetFilePointerEx(fh, {}, nullptr, FILE_BEGIN)) - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"SetFilePointerEx", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"SetFilePointerEx"); #elif defined ZEN_LINUX //don't use potentially inefficient ::posix_fallocate! @@ -143,7 +164,7 @@ void preAllocateSpaceBestEffort(FileHandle fh, const std::uint64_t streamSize, c //https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man2/ftruncate.2.html //=> file is extended with zeros, file offset is not changed if (::ftruncate(fh, streamSize) != 0) - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"ftruncate", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(displayPath)), L"ftruncate"); //F_PREALLOCATE + ftruncate seems optimal: http://adityaramesh.com/io_benchmark/ #endif @@ -220,14 +241,35 @@ public: NativeBaseFolder(const Zstring& baseDirPathIn) : baseDirPath(baseDirPathIn) {} + static Zstring getItemPathImplForRecycler(const AbstractPathRef& ap) + { + if (typeid(getAbf(ap)) != typeid(NativeBaseFolder)) + throw std::logic_error("Programming Error: Contract violation! " + std::string(__FILE__) + ":" + numberTo<std::string>(__LINE__)); + return getItemPathImpl(ap); + } + +private: + Zstring getInitPathPhrase() const override /*noexcept*/ { return baseDirPath; } + + //copy this instance for life-time management and safe access on any method by a different thread: + std::unique_ptr<AbstractBaseFolder> createIndependentCopy() const override //noexcept + { + return std::make_unique<NativeBaseFolder>(baseDirPath); //safe: Zstring uses atomic ref-count + } + bool emptyBaseFolderPath() const override { return baseDirPath.empty(); } - std::uint64_t getFreeDiskSpace() const override { return zen::getFreeDiskSpace(baseDirPath); } //throw FileError, returns 0 if not available + std::uint64_t getFreeDiskSpace() const override //throw FileError, returns 0 if not available + { + initComForThread(); //throw FileError + return zen::getFreeDiskSpace(baseDirPath); //throw FileError + } //---------------------------------------------------------------------------------------------------------------- bool supportsRecycleBin(const std::function<void ()>& onUpdateGui) const override //throw FileError { #ifdef ZEN_WIN + initComForThread(); //throw FileError return recycleBinExists(baseDirPath, onUpdateGui); //throw FileError #elif defined ZEN_LINUX || defined ZEN_MAC @@ -237,29 +279,17 @@ public: std::unique_ptr<RecycleSession> createRecyclerSession() const override //throw FileError, return value must be bound! { + initComForThread(); //throw FileError assert(supportsRecycleBin(nullptr)); - return make_unique<RecycleSessionNative>(appendSeparator(baseDirPath)); + return std::make_unique<RecycleSessionNative>(appendSeparator(baseDirPath)); } - static Zstring getItemPathImplForRecycler(const AbstractPathRef& ap) - { - if (typeid(getAbf(ap)) != typeid(NativeBaseFolder)) - throw std::logic_error("Programming Error: Contract violation! " + std::string(__FILE__) + ":" + numberTo<std::string>(__LINE__)); - return getItemPathImpl(ap); - } - -private: bool isNativeFileSystem() const override { return true; } - Zstring getInitPathPhrase() const override /*noexcept*/ { return baseDirPath; } - - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! std::wstring getDisplayPath(const Zstring& itemPathImpl) const override { return utfCvrtTo<std::wstring>(itemPathImpl); } - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! Zstring appendRelPathToItemPathImpl(const Zstring& itemPathImpl, const Zstring& relPath) const override { return appendPaths(itemPathImpl, relPath, FILE_NAME_SEPARATOR); } - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! Zstring getBasePathImpl() const override { return baseDirPath; } //used during folder creation if parent folder is missing @@ -310,79 +340,149 @@ private: //---------------------------------------------------------------------------------------------------------------- //should provide for single ATOMIC folder creation! - void createFolderSimple(const Zstring& itemPathImpl) const override - { copyNewDirectory(Zstring(), itemPathImpl, false /*copyFilePermissions*/); } //throw FileError, ErrorTargetExisting, ErrorTargetPathMissing + void createFolderSimple(const Zstring& itemPathImpl) const override //throw FileError, ErrorTargetExisting, ErrorTargetPathMissing + { + initComForThread(); //throw FileError + copyNewDirectory(Zstring(), itemPathImpl, false /*copyFilePermissions*/); + } - void removeFolderSimple(const Zstring& itemPathImpl) const override { zen::removeDirectorySimple(itemPathImpl); } //throw FileError + void removeFolderSimple(const Zstring& itemPathImpl) const override //throw FileError + { + initComForThread(); //throw FileError + zen::removeDirectorySimple(itemPathImpl); //throw FileError + } - bool removeFile(const Zstring& itemPathImpl) const override { return zen::removeFile(itemPathImpl); } //throw FileError + bool removeFile(const Zstring& itemPathImpl) const override //throw FileError + { + initComForThread(); //throw FileError + return zen::removeFile(itemPathImpl); //throw FileError + } //---------------------------------------------------------------------------------------------------------------- void setModTime(const Zstring& itemPathImpl, std::int64_t modificationTime) const override //throw FileError, follows symlinks - { zen::setFileTime(itemPathImpl, modificationTime, ProcSymlink::FOLLOW); } //throw FileError + { + initComForThread(); //throw FileError + zen::setFileTime(itemPathImpl, modificationTime, ProcSymlink::FOLLOW); //throw FileError + } void setModTimeSymlink(const Zstring& itemPathImpl, std::int64_t modificationTime) const override //throw FileError - { zen::setFileTime(itemPathImpl, modificationTime, ProcSymlink::DIRECT); } //throw FileError + { + initComForThread(); //throw FileError + zen::setFileTime(itemPathImpl, modificationTime, ProcSymlink::DIRECT); //throw FileError + } - AbstractPathRef getResolvedSymlinkPath(const Zstring& itemPathImpl) const override { return makeAbstractItem(*this, zen::getResolvedSymlinkPath(itemPathImpl)); } //throw FileError + AbstractPathRef getResolvedSymlinkPath(const Zstring& itemPathImpl) const override //throw FileError + { + initComForThread(); //throw FileError + return makeAbstractItem(*this, zen::getResolvedSymlinkPath(itemPathImpl)); //throw FileError + } - Zstring getSymlinkContentBuffer(const Zstring& itemPathImpl) const override { return getSymlinkTargetRaw(itemPathImpl); } //throw FileError + Zstring getSymlinkContentBuffer(const Zstring& itemPathImpl) const override //throw FileError + { + initComForThread(); //throw FileError + return getSymlinkTargetRaw(itemPathImpl); //throw FileError + } - void recycleItemDirectly(const Zstring& itemPathImpl) const override { zen::recycleOrDelete(itemPathImpl); } //throw FileError + void recycleItemDirectly(const Zstring& itemPathImpl) const override //throw FileError + { + initComForThread(); //throw FileError + zen::recycleOrDelete(itemPathImpl); //throw FileError + } //---------------------------------------------------------------------------------------------------------------- //- THREAD-SAFETY: must be thread-safe like an int! => no dangling references to this instance! IconLoader getAsyncIconLoader(const Zstring& itemPathImpl) const override //noexcept! { - //COM should already have been initialized by icon buffer IconLoader wl = {}; - wl.getFileIcon = [itemPathImpl](int pixelSize) { return getFileIcon (itemPathImpl, pixelSize); }; //noexcept! - wl.getThumbnailImage = [itemPathImpl](int pixelSize) { return getThumbnailImage(itemPathImpl, pixelSize); }; // + wl.getFileIcon = [itemPathImpl](int pixelSize) //noexcept! + { + try + { + initComForThread(); //throw FileError + return getFileIcon(itemPathImpl, pixelSize); + } + catch (FileError&) { assert(false); return ImageHolder(); } + }; + + wl.getThumbnailImage = [itemPathImpl](int pixelSize) //noexcept! + { + try + { + initComForThread(); //throw FileError + return getThumbnailImage(itemPathImpl, pixelSize); + } + catch (FileError&) { assert(false); return ImageHolder(); } + }; return wl; } //- THREAD-SAFETY: must be thread-safe like an int! => no dangling references to this instance! + std::function<bool()> /*throw FileError*/ getAsyncCheckFolderExists(const Zstring& itemPathImpl) const override //noexcept + { + warn_static("finish file error detection") + + return [itemPathImpl] + { + initComForThread(); //throw FileError + return zen::dirExists(itemPathImpl); + }; + } + + //- THREAD-SAFETY: must be thread-safe like an int! => no dangling references to this instance! std::function<void()> /*throw FileError*/ getAsyncConnectFolder(bool allowUserInteraction) const override //noexcept { + warn_static("clean-up/remove/re-think the getAsyncConnectFolder() function") + const Zstring dirPath = baseDirPath; //help lambda capture syntax... return [dirPath, allowUserInteraction]() { #ifdef ZEN_WIN + initComForThread(); //throw FileError + //login to network share, if necessary loginNetworkShare(dirPath, allowUserInteraction); #endif }; } - //- THREAD-SAFETY: must be thread-safe like an int! => no dangling references to this instance! - std::function<bool()> /*throw FileError*/ getAsyncCheckFolderExists(const Zstring& itemPathImpl) const override //noexcept - { - warn_static("finish file error detection") - - return [itemPathImpl] { return zen::dirExists(itemPathImpl); }; - } //---------------------------------------------------------------------------------------------------------------- //return value always bound: - std::unique_ptr<InputStream > getInputStream (const Zstring& itemPathImpl) const override { return make_unique<InputStreamNative >(itemPathImpl); } //throw FileError, ErrorFileLocked + std::unique_ptr<InputStream > getInputStream (const Zstring& itemPathImpl) const override //throw FileError, ErrorFileLocked + { + initComForThread(); //throw FileError + return std::make_unique<InputStreamNative >(itemPathImpl); //throw FileError, ErrorFileLocked + } + std::unique_ptr<OutputStream> getOutputStream(const Zstring& itemPathImpl, //throw FileError, ErrorTargetExisting const std::uint64_t* streamSize, //optional const std::int64_t* modificationTime) const override // { + initComForThread(); //throw FileError + //AbstractBaseFolder::OutputStream takes ownership and deletes on errors!!!! => transactionally create output stream first!! auto&& fop = FileOutput(itemPathImpl, FileOutput::ACC_CREATE_NEW); //throw FileError, ErrorTargetExisting - return make_unique<OutputStreamNative>(std::move(fop), makeAbstractItem(*this, itemPathImpl), streamSize, modificationTime); //throw FileError + return std::make_unique<OutputStreamNative>(std::move(fop), makeAbstractItem(*this, itemPathImpl), streamSize, modificationTime); //throw FileError } + //---------------------------------------------------------------------------------------------------------------- - //- THREAD-SAFETY: expect accesses from multiple threads to the same instance => synchronize internally!!! - void traverseFolder(const Zstring& itemPathImpl, TraverserCallback& sink) const override { DirTraverser::execute(itemPathImpl, sink); } + void traverseFolder(const Zstring& itemPathImpl, TraverserCallback& sink) const override //noexcept + { +#ifdef ZEN_WIN + if (!tryReportingDirError([&] { initComForThread(); /*throw FileError*/ }, sink)) + return; +#endif + DirTraverser::execute(itemPathImpl, sink); //noexcept + } //---------------------------------------------------------------------------------------------------------------- //symlink handling: follow link! FileAttribAfterCopy copyFileForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget, bool copyFilePermissions, //throw FileError, ErrorTargetExisting, ErrorFileLocked const std::function<void(std::int64_t bytesDelta)>& onNotifyCopyStatus) const override //may be nullptr; throw X! { + initComForThread(); //throw FileError + const InSyncAttributes attrNew = copyNewFile(itemPathImplSource, getItemPathImpl(apTarget), //throw FileError, ErrorTargetExisting, ErrorFileLocked copyFilePermissions, onNotifyCopyStatus); //may be nullptr; throw X! FileAttribAfterCopy attrOut = {}; @@ -394,16 +494,29 @@ private: } //symlink handling: follow link! - void copyNewFolderForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget, bool copyFilePermissions) const override - { zen::copyNewDirectory(itemPathImplSource, getItemPathImpl(apTarget), copyFilePermissions); } //throw FileError + void copyNewFolderForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget, bool copyFilePermissions) const override //throw FileError + { + initComForThread(); //throw FileError + zen::copyNewDirectory(itemPathImplSource, getItemPathImpl(apTarget), copyFilePermissions); + } - void copySymlinkForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget, bool copyFilePermissions) const override - { zen::copySymlink(itemPathImplSource, getItemPathImpl(apTarget), copyFilePermissions); } //throw FileError + void copySymlinkForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget, bool copyFilePermissions) const override //throw FileError + { + initComForThread(); //throw FileError + zen::copySymlink(itemPathImplSource, getItemPathImpl(apTarget), copyFilePermissions); //throw FileError + } - void renameItemForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget) const override - { zen::renameFile(itemPathImplSource, getItemPathImpl(apTarget));} //throw FileError, ErrorTargetExisting, ErrorDifferentVolume + void renameItemForSameAbfType(const Zstring& itemPathImplSource, const AbstractPathRef& apTarget) const override //throw FileError, ErrorTargetExisting, ErrorDifferentVolume + { + initComForThread(); //throw FileError + zen::renameFile(itemPathImplSource, getItemPathImpl(apTarget)); //throw FileError, ErrorTargetExisting, ErrorDifferentVolume + } - bool supportsPermissions() const override { return zen::supportsPermissions(baseDirPath); } //throw FileError + bool supportsPermissions() const override //throw FileError + { + initComForThread(); //throw FileError + return zen::supportsPermissions(baseDirPath); + } const Zstring baseDirPath; }; @@ -602,6 +715,6 @@ bool zen::acceptsFolderPathPhraseNative(const Zstring& folderPathPhrase) //noexc std::unique_ptr<AbstractBaseFolder> zen::createBaseFolderNative(const Zstring& folderPathPhrase) //noexcept { - return make_unique<NativeBaseFolder>(getResolvedFilePath(folderPathPhrase)); + return std::make_unique<NativeBaseFolder>(getResolvedFilePath(folderPathPhrase)); warn_static("get volume by name for idle HDD! => call async getFormattedDirectoryPath, but currently not thread-safe") } diff --git a/FreeFileSync/Source/fs/native_traverser_impl.h b/FreeFileSync/Source/fs/native_traverser_impl.h index 0a802f32..1b6e2a6c 100644 --- a/FreeFileSync/Source/fs/native_traverser_impl.h +++ b/FreeFileSync/Source/fs/native_traverser_impl.h @@ -71,14 +71,14 @@ private: DIR* dirObj = ::opendir(dirPath.c_str()); //directory must NOT end with path separator, except "/" if (!dirObj) - throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtPath(dirPath)), L"opendir", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot open directory %x."), L"%x", fmtPath(dirPath)), L"opendir"); ZEN_ON_SCOPE_EXIT(::closedir(dirObj)); //never close nullptr handles! -> crash for (;;) { struct ::dirent* dirEntry = nullptr; if (::readdir_r(dirObj, reinterpret_cast< ::dirent*>(&buffer[0]), &dirEntry) != 0) - throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"readdir_r", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"readdir_r"); //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 @@ -98,7 +98,7 @@ private: if (!tryReportingItemError([&] { if (::lstat(itemPath.c_str(), &statData) != 0) //lstat() does not resolve symlinks - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(itemPath)), L"lstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(itemPath)), L"lstat"); }, sink, itemName)) continue; //ignore error: skip file @@ -116,7 +116,7 @@ private: bool validLink = tryReportingItemError([&] { if (::stat(itemPath.c_str(), &statDataTrg) != 0) - throwFileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(itemPath)), L"stat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(itemPath)), L"stat"); }, sink, itemName); if (validLink) diff --git a/FreeFileSync/Source/lib/binary.cpp b/FreeFileSync/Source/lib/binary.cpp index f55a99a9..899d45a8 100644 --- a/FreeFileSync/Source/lib/binary.cpp +++ b/FreeFileSync/Source/lib/binary.cpp @@ -16,8 +16,8 @@ namespace { /* 1. there seems to be no perf improvement possible when using file mappings instad of ::ReadFile() calls on Windows: - => buffered access: same perf - => unbuffered access: same perf on USB stick, file mapping 30% slower on local disk + => buffered access: same perf + => unbuffered access: same perf on USB stick, file mapping 30% slower on local disk 2. Tests on Win7 x64 show that buffer size does NOT matter if files are located on different physical disks! Impact of buffer size when files are on same disk: diff --git a/FreeFileSync/Source/lib/db_file.cpp b/FreeFileSync/Source/lib/db_file.cpp index ede6a00d..f3f9177b 100644 --- a/FreeFileSync/Source/lib/db_file.cpp +++ b/FreeFileSync/Source/lib/db_file.cpp @@ -367,31 +367,31 @@ private: size_t fileCount = readNumber<std::uint32_t>(inputBoth); while (fileCount-- != 0) { - const Zstring shortName = readUtf8(inputBoth); + const Zstring itemName = readUtf8(inputBoth); const auto cmpVar = static_cast<CompareVariant>(readNumber<std::int32_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); + container.addFile(itemName, dataL, dataR, cmpVar, fileSize); } size_t linkCount = readNumber<std::uint32_t>(inputBoth); while (linkCount-- != 0) { - const Zstring shortName = readUtf8(inputBoth); + const Zstring itemName = readUtf8(inputBoth); const auto cmpVar = static_cast<CompareVariant>(readNumber<std::int32_t>(inputBoth)); InSyncDescrLink dataL = readLink(inputLeft); InSyncDescrLink dataR = readLink(inputRight); - container.addSymlink(shortName, dataL, dataR, cmpVar); + container.addSymlink(itemName, dataL, dataR, cmpVar); } size_t dirCount = readNumber<std::uint32_t>(inputBoth); while (dirCount-- != 0) { - const Zstring shortName = readUtf8(inputBoth); - auto status = static_cast<InSyncDir::InSyncStatus>(readNumber<std::int32_t>(inputBoth)); + const Zstring itemName = readUtf8(inputBoth); + const auto status = static_cast<InSyncDir::InSyncStatus>(readNumber<std::int32_t>(inputBoth)); - InSyncDir& subDir = container.addDir(shortName, status); + InSyncDir& subDir = container.addDir(itemName, status); recurse(subDir); } } @@ -401,7 +401,7 @@ private: InSyncDescrFile readFile(MemStreamIn& input) const { //attention: order of function argument evaluation is undefined! So do it one after the other... - auto lastWriteTimeRaw = readNumber<std::int64_t>(input); //throw UnexpectedEndOfStreamError + const auto lastWriteTimeRaw = readNumber<std::int64_t>(input); //throw UnexpectedEndOfStreamError ABF::FileId fileId; warn_static("remove after migration! 2015-05-02") @@ -424,7 +424,7 @@ private: static InSyncDescrLink readLink(MemStreamIn& input) { - auto lastWriteTimeRaw = readNumber<std::int64_t>(input); + const auto lastWriteTimeRaw = readNumber<std::int64_t>(input); return InSyncDescrLink(lastWriteTimeRaw); } @@ -470,7 +470,7 @@ private: if (!rv.second) { #if defined ZEN_WIN || defined ZEN_MAC //caveat: key must be updated, if there is a change in short name case!!! - if (rv.first->first != key) + if (rv.first->first != key) //=> conceptually case-sensitivity should be part of "value", not "key" { map.erase(rv.first); return map.emplace(key, value).first->second; @@ -504,7 +504,7 @@ private: */ } - void process(const HierarchyObject::SubFileVec& currentFiles, const Zstring& parentRelativeNamePf, InSyncDir::FileList& dbFiles) + void process(const HierarchyObject::SubFileVec& currentFiles, const Zstring& parentRelPathPf, InSyncDir::FileList& dbFiles) { std::unordered_set<const InSyncFile*> toPreserve; //referencing fixed-in-memory std::map elements @@ -543,13 +543,13 @@ private: if (toPreserve.find(&v.second) != toPreserve.end()) return false; //all items not existing in "currentFiles" have either been deleted meanwhile or been excluded via filter: - const Zstring& shortName = v.first; - return filter_.passFileFilter(parentRelativeNamePf + shortName); + const Zstring& itemRelPath = parentRelPathPf + v.first; + return filter_.passFileFilter(itemRelPath); //note: items subject to traveral errors are also excluded by this file filter here! see comparison.cpp, modified file filter for read errors }); } - void process(const HierarchyObject::SubLinkVec& currentLinks, const Zstring& parentRelativeNamePf, InSyncDir::LinkList& dbLinks) + void process(const HierarchyObject::SubLinkVec& currentLinks, const Zstring& parentRelPathPf, InSyncDir::LinkList& dbLinks) { std::unordered_set<const InSyncSymlink*> toPreserve; @@ -581,12 +581,12 @@ private: if (toPreserve.find(&v.second) != toPreserve.end()) return false; //all items not existing in "currentLinks" have either been deleted meanwhile or been excluded via filter: - const Zstring& shortName = v.first; - return filter_.passFileFilter(parentRelativeNamePf + shortName); + const Zstring& itemRelPath = parentRelPathPf + v.first; + return filter_.passFileFilter(itemRelPath); }); } - void process(const HierarchyObject::SubDirVec& currentDirs, const Zstring& parentRelativeNamePf, InSyncDir::DirList& dbDirs) + void process(const HierarchyObject::SubDirVec& currentDirs, const Zstring& parentRelPathPf, InSyncDir::DirList& dbDirs) { std::unordered_set<const InSyncDir*> toPreserve; @@ -628,7 +628,7 @@ private: //reuse last "in-sync" if available or insert strawman entry (do not try to update and thereby remove child elements!!!) InSyncDir& dir = dbDirs.emplace(dirObj.getPairShortName(), InSyncDir(InSyncDir::DIR_STATUS_STRAW_MAN)).first->second; toPreserve.insert(&dir); - recurse(dirObj, dir); //unconditional recursion without filter check! => no problem since "subObjMightMatch" is optional!!! + recurse(dirObj, dir); //unconditional recursion without filter check! => no problem since "childItemMightMatch" is optional!!! } break; @@ -647,19 +647,38 @@ private: } //delete removed items (= "in-sync") from database - erase_if(dbDirs, [&](const InSyncDir::DirList::value_type& v) -> bool + erase_if(dbDirs, [&](InSyncDir::DirList::value_type& v) -> bool { if (toPreserve.find(&v.second) != toPreserve.end()) return false; - const Zstring& shortName = v.first; - return filter_.passDirFilter(parentRelativeNamePf + shortName, nullptr); + + const Zstring& itemRelPath = parentRelPathPf + v.first; //if directory is not included in "currentDirs", it is either not existing anymore, in which case it should be deleted from database //or it was excluded via filter and the database entry should be preserved - warn_static("insufficient for *.txt-include filters! -> e.g. " - "1. *.txt-include, both sides in sync, txt-fiels in subfolder" - "2. delete all subfolders externally " - "3. sync => db should be updated == entries removed for .txt; mabye even for deleted subfolders!?!") + bool childItemMightMatch = true; + const bool passFilter = filter_.passDirFilter(itemRelPath, &childItemMightMatch); + if (!passFilter && childItemMightMatch) + dbSetEmptyState(v.second, appendSeparator(itemRelPath)); //child items might match, e.g. *.txt include filter! + return passFilter; + }); + } + + //delete all entries for removed folder (= "in-sync") from database + void dbSetEmptyState(InSyncDir& dir, const Zstring& parentRelPathPf) + { + erase_if(dir.files, [&](const InSyncDir::FileList::value_type& v) { return filter_.passFileFilter(parentRelPathPf + v.first); }); + erase_if(dir.symlinks, [&](const InSyncDir::LinkList::value_type& v) { return filter_.passFileFilter(parentRelPathPf + v.first); }); + + erase_if(dir.dirs, [&](InSyncDir::DirList::value_type& v) + { + const Zstring& itemRelPath = parentRelPathPf + v.first; + + bool childItemMightMatch = true; + const bool passFilter = filter_.passDirFilter(itemRelPath, &childItemMightMatch); + if (!passFilter && childItemMightMatch) + dbSetEmptyState(v.second, appendSeparator(itemRelPath)); + return passFilter; }); } diff --git a/FreeFileSync/Source/lib/db_file.h b/FreeFileSync/Source/lib/db_file.h index d6e9dee2..3f5e43ed 100644 --- a/FreeFileSync/Source/lib/db_file.h +++ b/FreeFileSync/Source/lib/db_file.h @@ -66,7 +66,7 @@ struct InSyncDir //------------------------------------------------------------------ typedef std::map<Zstring, InSyncDir, LessFilePath> DirList; // - typedef std::map<Zstring, InSyncFile, LessFilePath> FileList; // key: shortName + typedef std::map<Zstring, InSyncFile, LessFilePath> FileList; // key: file name typedef std::map<Zstring, InSyncSymlink, LessFilePath> LinkList; // //------------------------------------------------------------------ diff --git a/FreeFileSync/Source/lib/dir_exist_async.h b/FreeFileSync/Source/lib/dir_exist_async.h index 85ea9f84..492522f4 100644 --- a/FreeFileSync/Source/lib/dir_exist_async.h +++ b/FreeFileSync/Source/lib/dir_exist_async.h @@ -41,7 +41,7 @@ DirectoryStatus checkFolderExistenceUpdating(const std::set<const ABF*, ABF::Les for (const ABF* baseFolder : baseFolders) if (!baseFolder->emptyBaseFolderPath()) //skip empty dirs { - AbstractPathRef folderPath = baseFolder->getAbstractPath(Zstring()); + AbstractPathRef folderPath = baseFolder->getAbstractPath(); std::function<void()> connectFolder /*throw FileError*/ = baseFolder->getAsyncConnectFolder(allowUserInteraction); //noexcept std::function<bool()> dirExists /*throw FileError*/ = ABF::getAsyncCheckFolderExists(folderPath); //noexcept @@ -62,7 +62,7 @@ DirectoryStatus checkFolderExistenceUpdating(const std::set<const ABF*, ABF::Les for (auto& fi : futureInfo) { - const std::wstring& displayPathFmt = fmtPath(ABF::getDisplayPath(fi.first->getAbstractPath(Zstring()))); + const std::wstring& displayPathFmt = fmtPath(ABF::getDisplayPath(fi.first->getAbstractPath())); procCallback.reportStatus(replaceCpy(_("Searching for folder %x..."), L"%x", displayPathFmt)); //may throw! diff --git a/FreeFileSync/Source/lib/dir_lock.cpp b/FreeFileSync/Source/lib/dir_lock.cpp index fa035b7c..190378ad 100644 --- a/FreeFileSync/Source/lib/dir_lock.cpp +++ b/FreeFileSync/Source/lib/dir_lock.cpp @@ -133,7 +133,7 @@ std::uint64_t getLockFileSize(const Zstring& filepath) //throw FileError WIN32_FIND_DATA 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", fmtPath(filepath)), L"FindFirstFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filepath)), L"FindFirstFile"); ::FindClose(searchHandle); return get64BitUInt(fileInfo.nFileSizeLow, fileInfo.nFileSizeHigh); @@ -141,7 +141,7 @@ std::uint64_t getLockFileSize(const Zstring& filepath) //throw FileError #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat fileInfo = {}; if (::stat(filepath.c_str(), &fileInfo) != 0) //follow symbolic links - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filepath)), L"stat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filepath)), L"stat"); return fileInfo.st_size; #endif @@ -165,7 +165,7 @@ Zstring getLoginSid() //throw FileError if (!::OpenProcessToken(::GetCurrentProcess(), //__in HANDLE ProcessHandle, TOKEN_ALL_ACCESS, //__in DWORD DesiredAccess, &hToken)) //__out PHANDLE TokenHandle - throwFileError(_("Cannot get process information."), L"OpenProcessToken", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"OpenProcessToken"); ZEN_ON_SCOPE_EXIT(::CloseHandle(hToken)); DWORD bufferSize = [&] @@ -174,7 +174,7 @@ Zstring getLoginSid() //throw FileError if (!::GetTokenInformation(hToken, TokenGroups, nullptr, 0, &sz)) { if (::GetLastError() != ERROR_INSUFFICIENT_BUFFER) - throwFileError(_("Cannot get process information."), L"GetTokenInformation", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"GetTokenInformation"); if (sz > 0) return sz; @@ -189,7 +189,7 @@ Zstring getLoginSid() //throw FileError &buffer[0], //__out_opt LPVOID TokenInformation, bufferSize, //__in DWORD TokenInformationLength, &bufferSize)) //__out PDWORD ReturnLength - throwFileError(_("Cannot get process information."), L"GetTokenInformation", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"GetTokenInformation"); auto groups = reinterpret_cast<const TOKEN_GROUPS*>(&buffer[0]); @@ -199,7 +199,7 @@ Zstring getLoginSid() //throw FileError LPTSTR sidStr = nullptr; if (!::ConvertSidToStringSid(groups->Groups[i].Sid, //__in PSID Sid, &sidStr)) //__out LPTSTR *StringSid - throwFileError(_("Cannot get process information."), L"ConvertSidToStringSid", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"ConvertSidToStringSid"); ZEN_ON_SCOPE_EXIT(::LocalFree(sidStr)); return sidStr; } @@ -224,7 +224,7 @@ Opt<SessionId> getSessionId(ProcessId processId) //throw FileError HANDLE snapshot = ::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, //__in DWORD dwFlags, 0); //__in DWORD th32ProcessID if (snapshot == INVALID_HANDLE_VALUE) - throwFileError(_("Cannot get process information."), L"CreateToolhelp32Snapshot", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"CreateToolhelp32Snapshot"); ZEN_ON_SCOPE_EXIT(::CloseHandle(snapshot)); PROCESSENTRY32 processEntry = {}; @@ -232,7 +232,7 @@ Opt<SessionId> getSessionId(ProcessId processId) //throw FileError if (!::Process32First(snapshot, //__in HANDLE hSnapshot, &processEntry)) //__inout LPPROCESSENTRY32 lppe - throwFileError(_("Cannot get process information."), L"Process32First", getLastError()); //ERROR_NO_MORE_FILES not possible + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"Process32First"); //ERROR_NO_MORE_FILES not possible do { if (processEntry.th32ProcessID == processId) //yes, MSDN says this is the way: http://msdn.microsoft.com/en-us/library/windows/desktop/ms684868(v=vs.85).aspx @@ -240,9 +240,9 @@ Opt<SessionId> getSessionId(ProcessId processId) //throw FileError } while (::Process32Next(snapshot, &processEntry)); - const DWORD lastError = ::GetLastError(); //caveat: eval before "throw" which can overwrite error code after memory allocation! (MinGW + Win XP) - if (lastError != ERROR_NO_MORE_FILES) //yes, they call it "files" - throwFileError(_("Cannot get process information."), L"Process32Next", lastError); + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! + if (ec != ERROR_NO_MORE_FILES) //yes, they call it "files" + throw FileError(_("Cannot get process information."), formatSystemError(L"Process32Next", ec)); return NoValue(); @@ -252,7 +252,7 @@ Opt<SessionId> getSessionId(ProcessId processId) //throw FileError pid_t procSid = ::getsid(processId); //NOT to be confused with "login session", e.g. not stable on OS X!!! if (procSid == -1) - throwFileError(_("Cannot get process information."), L"getsid", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"getsid"); return procSid; #endif @@ -276,7 +276,7 @@ struct LockInformation //throw FileError if (!::GetComputerNameEx(ComputerNameDnsFullyQualified, //__in COMPUTER_NAME_FORMAT NameType, bufferSize > 0 ? &buffer[0] : nullptr, //__out LPTSTR lpBuffer, &bufferSize)) //__inout LPDWORD lpnSize - throwFileError(_("Cannot get process information."), L"GetComputerNameEx", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"GetComputerNameEx"); computerName = "Windows." + utfCvrtTo<std::string>(&buffer[0]); @@ -284,7 +284,7 @@ struct LockInformation //throw FileError buffer.resize(bufferSize); if (!::GetUserName(&buffer[0], //__out LPTSTR lpBuffer, &bufferSize)) //__inout LPDWORD lpnSize - throwFileError(_("Cannot get process information."), L"GetUserName", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"GetUserName"); userId = utfCvrtTo<std::string>(&buffer[0]); #elif defined ZEN_LINUX || defined ZEN_MAC @@ -293,12 +293,12 @@ struct LockInformation //throw FileError std::vector<char> buffer(10000); if (::gethostname(&buffer[0], buffer.size()) != 0) - throwFileError(_("Cannot get process information."), L"gethostname", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"gethostname"); computerName += "Linux."; //distinguish linux/windows lock files computerName += &buffer[0]; if (::getdomainname(&buffer[0], buffer.size()) != 0) - throwFileError(_("Cannot get process information."), L"getdomainname", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"getdomainname"); computerName += "."; computerName += &buffer[0]; @@ -310,7 +310,7 @@ struct LockInformation //throw FileError struct passwd buffer2 = {}; struct passwd* pwsEntry = nullptr; if (::getpwuid_r(userIdNo, &buffer2, &buffer[0], buffer.size(), &pwsEntry) != 0) //getlogin() is deprecated and not working on Ubuntu at all!!! - throwFileError(_("Cannot get process information."), L"getpwuid_r", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot get process information."), L"getpwuid_r"); if (!pwsEntry) throw FileError(_("Cannot get process information."), L"no login found"); //should not happen? userId += '(' + std::string(pwsEntry->pw_name) + ')'; //follow Linux naming convention "1000(zenju)" @@ -366,7 +366,7 @@ struct LockInformation //throw FileError }; -//wxGetFullHostName() is a performance killer for some users, so don't touch! +//wxGetFullHostName() is a performance killer and can hang for some users, so don't touch! LockInformation retrieveLockInfo(const Zstring& lockfilepath) //throw FileError @@ -545,12 +545,12 @@ bool tryLock(const Zstring& lockfilepath) //throw FileError nullptr); //_In_opt_ HANDLE hTemplateFile if (fileHandle == INVALID_HANDLE_VALUE) { - const DWORD lastError = ::GetLastError(); - if (lastError == ERROR_FILE_EXISTS || //confirmed to be used - lastError == ERROR_ALREADY_EXISTS) //comment on msdn claims, this one is used on Windows Mobile 6 + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! + if (ec == ERROR_FILE_EXISTS || //confirmed to be used + ec == 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", fmtPath(lockfilepath)), L"CreateFile", lastError); + + throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(lockfilepath)), formatSystemError(L"CreateFile", ec)); } ScopeGuard guardLockFile = zen::makeGuard([&] { removeFile(lockfilepath); }); FileOutput fileOut(fileHandle, lockfilepath); //pass handle ownership @@ -570,7 +570,7 @@ bool tryLock(const Zstring& lockfilepath) //throw FileError if (errno == EEXIST) return false; else - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(lockfilepath)), L"open", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(lockfilepath)), L"open"); } ScopeGuard guardLockFile = zen::makeGuard([&] { removeFile(lockfilepath); }); FileOutput fileOut(fileHandle, lockfilepath); //pass handle ownership diff --git a/FreeFileSync/Source/lib/hard_filter.cpp b/FreeFileSync/Source/lib/hard_filter.cpp index 7bc0f66a..19bde7fd 100644 --- a/FreeFileSync/Source/lib/hard_filter.cpp +++ b/FreeFileSync/Source/lib/hard_filter.cpp @@ -27,7 +27,7 @@ bool zen::operator<(const HardFilter& lhs, const HardFilter& rhs) namespace { //constructing them in addFilterEntry becomes perf issue for large filter lists -const Zstring asterisk(Zstr("*")); +const Zstring asterisk = Zstr("*"); const Zstring sepAsterisk = FILE_NAME_SEPARATOR + asterisk; const Zstring asteriskSep = asterisk + FILE_NAME_SEPARATOR; const Zstring asteriskSepAsterisk = asteriskSep + asterisk; @@ -52,7 +52,7 @@ void addFilterEntry(const Zstring& filterPhrase, std::vector<Zstring>& masksFile | \*\* | remove \ +---------+-------- | *blah | - | *\blah | -> add blah + | *\blah | -> add blah | *\*blah | -> add *blah +---------+-------- | blah\ | remove \; folder only @@ -283,9 +283,9 @@ bool NameFilter::passFileFilter(const Zstring& relFilePath) const } -bool NameFilter::passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch) const +bool NameFilter::passDirFilter(const Zstring& relDirPath, bool* childItemMightMatch) const { - assert(!subObjMightMatch || *subObjMightMatch == true); //check correct usage + assert(!childItemMightMatch || *childItemMightMatch == true); //check correct usage #if defined ZEN_WIN || defined ZEN_MAC //Windows does NOT distinguish between upper/lower-case const Zstring& pathFmt = makeUpperCopy(relDirPath); @@ -296,18 +296,18 @@ bool NameFilter::passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch if (matchesMask<AnyMatch>(pathFmt, excludeMasksFileFolder) || matchesMask<AnyMatch>(pathFmt, excludeMasksFolder)) { - if (subObjMightMatch) - *subObjMightMatch = false; //perf: no need to traverse deeper; subfolders/subfiles would be excluded by filter anyway! + if (childItemMightMatch) + *childItemMightMatch = false; //perf: no need to traverse deeper; subfolders/subfiles would be excluded by filter anyway! /* - Attention: the design choice that "subObjMightMatch" is optional implies that the filter must provide correct results no matter if this - value is considered by the client! In particular, if *subObjMightMatch == false, then any filter evaluations for child items must + Attention: the design choice that "childItemMightMatch" is optional implies that the filter must provide correct results no matter if this + value is considered by the client! In particular, if *childItemMightMatch == false, then any filter evaluations for child items must also return "false"! - This is not a problem for folder traversal which stops at the first *subObjMightMatch == false anyway, but other code continues recursing further, + This is not a problem for folder traversal which stops at the first *childItemMightMatch == false anyway, but other code continues recursing further, e.g. the database update code in db_file.cpp recurses unconditionally without filter check! It's possible to construct edge cases with incorrect - behavior if "subObjMightMatch" were not optional: - 1. two folders including a sub folder with some files are in sync with up-to-date database files - 2. deny access to this sub folder on both sides and start sync ignoring errors - 3. => database entries of this sub folder are incorrectly deleted! (if sub-folder is excluded, but child items are not!) + behavior if "childItemMightMatch" were not optional: + 1. two folders including a sub folder with some files are in sync with up-to-date database files + 2. deny access to this sub folder on both sides and start sync ignoring errors + 3. => database entries of this sub folder are incorrectly deleted! (if sub-folder is excluded, but child items are not!) */ return false; } @@ -315,12 +315,12 @@ bool NameFilter::passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch if (!matchesMask<AnyMatch>(pathFmt, includeMasksFileFolder) && !matchesMask<AnyMatch>(pathFmt, includeMasksFolder)) { - if (subObjMightMatch) + if (childItemMightMatch) { const Zstring& childPathBegin = pathFmt + FILE_NAME_SEPARATOR; - *subObjMightMatch = matchesMaskBegin(childPathBegin, includeMasksFileFolder) || //might match a file or folder in subdirectory - matchesMaskBegin(childPathBegin, includeMasksFolder); // + *childItemMightMatch = matchesMaskBegin(childPathBegin, includeMasksFileFolder) || //might match a file or folder in subdirectory + matchesMaskBegin(childPathBegin, includeMasksFolder); // } return false; } diff --git a/FreeFileSync/Source/lib/hard_filter.h b/FreeFileSync/Source/lib/hard_filter.h index 04c2f9f9..4a562ec3 100644 --- a/FreeFileSync/Source/lib/hard_filter.h +++ b/FreeFileSync/Source/lib/hard_filter.h @@ -35,8 +35,8 @@ public: //filtering virtual bool passFileFilter(const Zstring& relFilePath) const = 0; - virtual bool passDirFilter (const Zstring& relDirPath, bool* subObjMightMatch) const = 0; - //subObjMightMatch: file/dir in subdirectories could(!) match + virtual bool passDirFilter (const Zstring& relDirPath, bool* childItemMightMatch) const = 0; + //childItemMightMatch: file/dir in subdirectories could(!) match //note: this hint is only set if passDirFilter returns false! virtual bool isNull() const = 0; //filter is equivalent to NullFilter, but may be technically slower @@ -64,7 +64,7 @@ class NullFilter : public HardFilter //no filtering at all { public: bool passFileFilter(const Zstring& relFilePath) const override { return true; } - bool passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch) const override; + bool passDirFilter(const Zstring& relDirPath, bool* childItemMightMatch) const override; bool isNull() const override { return true; } FilterRef copyFilterAddingExclusion(const Zstring& excludePhrase) const override; @@ -81,7 +81,7 @@ public: void addExclusion(const Zstring& excludePhrase); bool passFileFilter(const Zstring& relFilePath) const override; - bool passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch) const override; + bool passDirFilter(const Zstring& relDirPath, bool* childItemMightMatch) const override; bool isNull() const override; static bool isNull(const Zstring& includePhrase, const Zstring& excludePhrase); //*fast* check without expensive NameFilter construction! @@ -103,7 +103,7 @@ public: CombinedFilter(const NameFilter& first, const NameFilter& second) : first_(first), second_(second) { assert(!first.isNull() && !second.isNull()); } //if either is null, then wy use CombinedFilter? bool passFileFilter(const Zstring& relFilePath) const override; - bool passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch) const override; + bool passDirFilter(const Zstring& relDirPath, bool* childItemMightMatch) const override; bool isNull() const override; FilterRef copyFilterAddingExclusion(const Zstring& excludePhrase) const override; @@ -121,9 +121,9 @@ private: //--------------- inline implementation --------------------------------------- inline -bool NullFilter::passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch) const +bool NullFilter::passDirFilter(const Zstring& relDirPath, bool* childItemMightMatch) const { - assert(!subObjMightMatch || *subObjMightMatch == true); //check correct usage + assert(!childItemMightMatch || *childItemMightMatch == true); //check correct usage return true; } @@ -164,14 +164,14 @@ bool CombinedFilter::passFileFilter(const Zstring& relFilePath) const inline -bool CombinedFilter::passDirFilter(const Zstring& relDirPath, bool* subObjMightMatch) const +bool CombinedFilter::passDirFilter(const Zstring& relDirPath, bool* childItemMightMatch) const { - if (first_.passDirFilter(relDirPath, subObjMightMatch)) - return second_.passDirFilter(relDirPath, subObjMightMatch); + if (first_.passDirFilter(relDirPath, childItemMightMatch)) + return second_.passDirFilter(relDirPath, childItemMightMatch); else { - if (subObjMightMatch && *subObjMightMatch) - second_.passDirFilter(relDirPath, subObjMightMatch); + if (childItemMightMatch && *childItemMightMatch) + second_.passDirFilter(relDirPath, childItemMightMatch); return false; } } diff --git a/FreeFileSync/Source/lib/help_provider.h b/FreeFileSync/Source/lib/help_provider.h index 328ebddf..8e42b87d 100644 --- a/FreeFileSync/Source/lib/help_provider.h +++ b/FreeFileSync/Source/lib/help_provider.h @@ -71,7 +71,7 @@ private: { if (!chmHlp) { - chmHlp = make_unique<wxCHMHelpController>(); + chmHlp = std::make_unique<wxCHMHelpController>(); chmHlp->Initialize(utfCvrtTo<wxString>(zen::getResourceDir()) + L"FreeFileSync.chm"); } } diff --git a/FreeFileSync/Source/lib/icon_buffer.cpp b/FreeFileSync/Source/lib/icon_buffer.cpp index 98426049..b2d0162b 100644 --- a/FreeFileSync/Source/lib/icon_buffer.cpp +++ b/FreeFileSync/Source/lib/icon_buffer.cpp @@ -14,6 +14,7 @@ #ifdef ZEN_WIN #include <zen/win_ver.h> + #include <zen/com_tools.h> #endif using namespace zen; @@ -38,8 +39,7 @@ wxBitmap extractWxBitmap(ImageHolder&& ih) { assert(std::this_thread::get_id() == mainThreadId); #ifndef NDEBUG - auto check = [&] { assert(!ih); }; //work around V120_XP compilation issue - ZEN_ON_SCOPE_EXIT(check()); + ZEN_ON_SCOPE_EXIT(assert(!ih)); #endif if (!ih.getRgb()) @@ -107,12 +107,12 @@ ImageHolder getDisplayIcon(const ABF::IconLoader& iconLoader, const Zstring& tem if (!hasStandardIconExtension(templateName)) //"pricey" extensions are stored with full path and are read from disk, while cheap ones require just the extension #endif if (iconLoader.getFileIcon) - if (ImageHolder img = iconLoader.getFileIcon(IconBuffer::getSize(sz))) - return img; + if (ImageHolder ih = iconLoader.getFileIcon(IconBuffer::getSize(sz))) + return ih; //3. fallbacks - if (ImageHolder img = getIconByTemplatePath(templateName, IconBuffer::getSize(sz))) - return img; + if (ImageHolder ih = getIconByTemplatePath(templateName, IconBuffer::getSize(sz))) + return ih; return genericFileIcon(IconBuffer::getSize(sz)); } @@ -209,7 +209,7 @@ public: IconData& idata = refData(it); if (idata.iconRaw) //if not yet converted... { - idata.iconFmt = make_unique<wxBitmap>(extractWxBitmap(std::move(idata.iconRaw))); //convert in main thread! + idata.iconFmt = std::make_unique<wxBitmap>(extractWxBitmap(std::move(idata.iconRaw))); //convert in main thread! assert(!idata.iconRaw); } return idata.iconFmt ? *idata.iconFmt : wxNullBitmap; //idata.iconRaw may be inserted as empty from worker thread! @@ -231,7 +231,7 @@ public: } //must be called by main thread only! => ~wxBitmap() is NOT thread-safe! - //call at an appropriate time, e.g. after Workload::setWorkload() + //call at an appropriate time, e.g. after Workload::setWorkload() void limitSize() { assert(std::this_thread::get_id() == mainThreadId); @@ -251,7 +251,7 @@ private: #ifdef __clang__ //workaround libc++ limitation for incomplete types: http://llvm.org/bugs/show_bug.cgi?id=17701 typedef std::map<AbstractPathRef::ItemId, std::unique_ptr<IconData>> FileIconMap; static IconData& refData(FileIconMap::iterator it) { return *(it->second); } - static std::unique_ptr<IconData> makeValueObject() { return make_unique<IconData>(); } + static std::unique_ptr<IconData> makeValueObject() { return std::make_unique<IconData>(); } #else typedef std::map<AbstractPathRef::ItemId, IconData> FileIconMap; IconData& refData(FileIconMap::iterator it) { return it->second; } @@ -365,17 +365,17 @@ public: RunOnStartup() { #ifdef ZEN_WIN - //thumbnail.h prerequisites: 1. initialize COM, 2. initialize system image list + //icon_loader.h/file_icon_win.h prerequisites: 1. initialize COM, 2. initialize system image list typedef BOOL (WINAPI* FileIconInitFun)(BOOL fRestoreCache); const SysDllFun<FileIconInitFun> fileIconInit(L"Shell32.dll", reinterpret_cast<LPCSTR>(660)); //MS requires and documents this magic number assert(fileIconInit); if (fileIconInit) fileIconInit(true); //MSDN: "TRUE to restore the system image cache from disk; FALSE otherwise." /* - "FileIconInit's "fRestoreCache" parameter determines whether or not it loads the 48-or-so "standard" shell icons. If FALSE is specified, - it only loads a very minimal set of icons. [...] SHGetFileInfo internally call FileIconInit(FALSE), so if you want - your copy of the system image list to contain the standard icons, you should call FileIconInit(TRUE) at startup." - - Jim Barry, MVP (Windows SDK) + "FileIconInit's "fRestoreCache" parameter determines whether or not it loads the 48-or-so "standard" shell icons. If FALSE is specified, + it only loads a very minimal set of icons. [...] SHGetFileInfo internally call FileIconInit(FALSE), so if you want + your copy of the system image list to contain the standard icons, you should call FileIconInit(TRUE) at startup." + - Jim Barry, MVP (Windows SDK) */ #endif } @@ -385,25 +385,27 @@ public: void WorkerThread::operator()() const //thread entry { #ifdef ZEN_WIN - //1. Initialize COM - if (FAILED(::CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE))) //may return S_FALSE, which is NO failure, see MSDN + try { - assert(false); - return; - } - ZEN_ON_SCOPE_EXIT(::CoUninitialize()); + //1. Initialize COM here due to the icon_loader.h dependency only, but NOT due to native.h, mtp.h's internal COM usage => this is not our responsibility! + ComInitializer ci; //throw SysError #endif - for (;;) - { - interruptionPoint(); //throw ThreadInterruption + for (;;) + { + interruptionPoint(); //throw ThreadInterruption - //start work: blocks until next icon to load is retrieved: - const WorkItem workItem = workload_->extractNextFile(); //throw ThreadInterruption + //start work: blocks until next icon to load is retrieved: + const WorkItem workItem = workload_->extractNextFile(); //throw ThreadInterruption - if (!buffer_->hasIcon(workItem.id_)) //perf: workload may contain duplicate entries? - buffer_->insert(workItem.id_, getDisplayIcon(workItem.iconLoader_, workItem.fileName_, iconSizeType)); + if (!buffer_->hasIcon(workItem.id_)) //perf: workload may contain duplicate entries? + buffer_->insert(workItem.id_, getDisplayIcon(workItem.iconLoader_, workItem.fileName_, iconSizeType)); + } + +#ifdef ZEN_WIN } + catch (SysError&) { assert(false); } +#endif } //######################### redirect to impl ##################################################### @@ -421,7 +423,7 @@ struct IconBuffer::Pimpl }; -IconBuffer::IconBuffer(IconSize sz) : pimpl(make_unique<Pimpl>()), iconSizeType(sz) +IconBuffer::IconBuffer(IconSize sz) : pimpl(std::make_unique<Pimpl>()), iconSizeType(sz) { pimpl->worker = InterruptibleThread(WorkerThread(pimpl->workload, pimpl->buffer, sz)); } @@ -502,7 +504,13 @@ void IconBuffer::setWorkload(const std::vector<AbstractPathRef>& load) wxBitmap IconBuffer::getIconByExtension(const Zstring& filePath) { - const Zstring& extension = getFileExtension(filePath); + //comparison of ItemIds is currently case-sensitive: +#if defined ZEN_WIN || defined ZEN_MAC + const Zstring& extension = makeUpperCopy(getFileExtension(filePath)); +#elif defined ZEN_LINUX + const Zstring& extension = getFileExtension(filePath); +#endif + const AbstractPathRef::ItemId extId(nullptr, extension); if (Opt<wxBitmap> ico = pimpl->buffer->retrieve(extId)) @@ -510,6 +518,7 @@ wxBitmap IconBuffer::getIconByExtension(const Zstring& filePath) const Zstring& templateName(extension.empty() ? Zstr("file") : Zstr("file.") + extension); //don't pass actual file name to getIconByTemplatePath(), e.g. "AUTHORS" has own mime type on Linux!!! + //=> we want to buffer by extension only to minimize buffer-misses! pimpl->buffer->insert(extId, getIconByTemplatePath(templateName, IconBuffer::getSize(iconSizeType))); Opt<wxBitmap> ico = pimpl->buffer->retrieve(extId); diff --git a/FreeFileSync/Source/lib/icon_buffer.h b/FreeFileSync/Source/lib/icon_buffer.h index 1e2c9a47..f149df2a 100644 --- a/FreeFileSync/Source/lib/icon_buffer.h +++ b/FreeFileSync/Source/lib/icon_buffer.h @@ -4,8 +4,8 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef ICONBUFFER_H_INCLUDED -#define ICONBUFFER_H_INCLUDED +#ifndef ICONBUFFER_H_INCLUDED_8425703245726394256 +#define ICONBUFFER_H_INCLUDED_8425703245726394256 #include <vector> #include <memory> @@ -53,4 +53,4 @@ private: bool hasLinkExtension(const Zstring& filepath); } -#endif // ICONBUFFER_H_INCLUDED +#endif //ICONBUFFER_H_INCLUDED_8425703245726394256 diff --git a/FreeFileSync/Source/lib/localization.cpp b/FreeFileSync/Source/lib/localization.cpp index 8f53b5b5..040c26d2 100644 --- a/FreeFileSync/Source/lib/localization.cpp +++ b/FreeFileSync/Source/lib/localization.cpp @@ -108,7 +108,7 @@ FFSTranslation::FFSTranslation(const Zstring& filepath, wxLanguage languageId) : transMappingPl.emplace(std::make_pair(engSingular, engPlural), plFormsWide); } - pluralParser = zen::make_unique<parse_plural::PluralForm>(header.pluralDefinition); //throw parse_plural::ParsingError + pluralParser = std::make_unique<parse_plural::PluralForm>(header.pluralDefinition); //throw parse_plural::ParsingError } @@ -191,7 +191,7 @@ ExistingTranslations::ExistingTranslations() assert(!lngHeader.flagFile .empty()); /* There is some buggy behavior in wxWidgets which maps "zh_TW" to simplified chinese. - Fortunately locales can be also entered as description. I changed to "Chinese (Traditional)" which works fine. + Fortunately locales can be also entered as description. => use "Chinese (Traditional)" which works fine. */ if (const wxLanguageInfo* locInfo = wxLocale::FindLanguageInfo(utfCvrtTo<wxString>(lngHeader.localeName))) { @@ -385,7 +385,7 @@ public: void init(wxLanguage lng) { locale.reset(); //avoid global locale lifetime overlap! wxWidgets cannot handle this and will crash! - locale = zen::make_unique<wxLocale>(); + locale = std::make_unique<wxLocale>(); const wxLanguageInfo* sysLngInfo = wxLocale::GetLanguageInfo(wxLocale::GetSystemLanguage()); const wxLanguageInfo* selLngInfo = wxLocale::GetLanguageInfo(lng); @@ -445,7 +445,7 @@ void zen::setLanguage(int language) //throw FileError else try { - zen::setTranslator(zen::make_unique<FFSTranslation>(utfCvrtTo<Zstring>(languageFile), static_cast<wxLanguage>(language))); //throw lngfile::ParsingError, parse_plural::ParsingError + zen::setTranslator(std::make_unique<FFSTranslation>(utfCvrtTo<Zstring>(languageFile), static_cast<wxLanguage>(language))); //throw lngfile::ParsingError, parse_plural::ParsingError } catch (lngfile::ParsingError& e) { diff --git a/FreeFileSync/Source/lib/parallel_scan.cpp b/FreeFileSync/Source/lib/parallel_scan.cpp index fc4f9af8..e06c9dd6 100644 --- a/FreeFileSync/Source/lib/parallel_scan.cpp +++ b/FreeFileSync/Source/lib/parallel_scan.cpp @@ -9,6 +9,7 @@ #include <zen/thread.h> #include <zen/scope_guard.h> #include <zen/fixed_list.h> +#include <zen/tick_count.h> #include "db_file.h" #include "lock_holder.h" @@ -119,7 +120,7 @@ PERF NOTE -------------------------------------------- Windows 7: 1st(unbuffered) |2nd (OS buffered) - ---------------------------------- + ---------------------------------- 1 Thread: 57s | 8s 2 Threads: 39s | 7s @@ -128,7 +129,7 @@ Windows 7: -------------------------------------------------- Windows 7: Windows XP: 1st(unbuffered) |2nd (OS buffered) 1st(unbuffered) |2nd (OS buffered) - ---------------------------------- ---------------------------------- + ---------------------------------- ---------------------------------- 1 Thread: 41s | 13s 1 Thread: 45s | 13s 2 Threads: 42s | 11s 2 Threads: 38s | 8s @@ -156,13 +157,15 @@ typedef Zbase<wchar_t, StorageRefCountThreadSafe> BasicWString; //thread-safe st class AsyncCallback //actor pattern { public: + AsyncCallback(size_t reportingIntervalMs) : reportingIntervalTicks(reportingIntervalMs * ticksPerSec() / 1000) {} + //blocking call: context of worker thread FillBufferCallback::HandleError reportError(const std::wstring& msg, size_t retryNumber) //throw ThreadInterruption { std::unique_lock<std::mutex> dummy(lockErrorInfo); interruptibleWait(conditionCanReportError, dummy, [this] { return !errorInfo && !errorResponse; }); //throw ThreadInterruption - errorInfo = make_unique<std::pair<BasicWString, size_t>>(copyStringTo<BasicWString>(msg), retryNumber); + errorInfo = std::make_unique<std::pair<BasicWString, size_t>>(copyStringTo<BasicWString>(msg), retryNumber); interruptibleWait(conditionGotResponse, dummy, [this] { return static_cast<bool>(errorResponse); }); //throw ThreadInterruption @@ -183,7 +186,7 @@ public: if (errorInfo.get() && !errorResponse.get()) { FillBufferCallback::HandleError rv = callback.reportError(copyStringTo<std::wstring>(errorInfo->first), errorInfo->second); //throw! - errorResponse = make_unique<FillBufferCallback::HandleError>(rv); + errorResponse = std::make_unique<FillBufferCallback::HandleError>(rv); dummy.unlock(); //optimization for condition_variable::notify_all() conditionGotResponse.notify_all(); //instead of notify_one(); workaround bug: https://svn.boost.org/trac/boost/ticket/7796 @@ -192,13 +195,23 @@ public: void incrementNotifyingThreadId() { ++notifyingThreadID; } //context of main thread - //perf optimization?: - bool mayReportCurrentFile(int threadID) const { return threadID == notifyingThreadID; } - - void reportCurrentFile(const std::wstring& filepath, int threadID) //context of worker thread + //perf optimization: comparison phase is 7% faster by avoiding needless std::wstring contstruction for reportCurrentFile() + bool mayReportCurrentFile(int threadID, TickVal& lastReportTime) const { - if (threadID != notifyingThreadID) return; //only one thread at a time may report status + if (threadID != notifyingThreadID) //only one thread at a time may report status + return false; + + const TickVal now = getTicks(); //0 on error + if (dist(lastReportTime, now) >= reportingIntervalTicks) //perform ui updates not more often than necessary + { + lastReportTime = now; //keep "lastReportTime" at worker thread level to avoid locking! + return true; + } + return false; + } + void reportCurrentFile(const std::wstring& filepath) //context of worker thread + { std::lock_guard<std::mutex> dummy(lockCurrentStatus); currentFile = copyStringTo<BasicWString>(filepath); } @@ -245,6 +258,7 @@ private: std::mutex lockCurrentStatus; //use a different lock for current file: continue traversing while some thread may process an error BasicWString currentFile; + const std::int64_t reportingIntervalTicks; const BasicWString textScanning { copyStringTo<BasicWString>(_("Scanning:")) }; //this one is (currently) not shared and could be made a std::wstring, but we stay consistent and use thread-safe variables in this class only! @@ -255,26 +269,26 @@ private: //------------------------------------------------------------------------------------------------- -struct TraverserShared +struct TraverserConfig { public: - TraverserShared(int threadID, + TraverserConfig(int threadID, const ABF& abf, const HardFilter::FilterRef& filter, SymLinkHandling handleSymlinks, std::map<Zstring, std::wstring, LessFilePath>& failedDirReads, std::map<Zstring, std::wstring, LessFilePath>& failedItemReads, AsyncCallback& acb) : - abstractBaseFolder(abf), - filterInstance(filter), + baseFolder(abf), + filter_(filter), handleSymlinks_(handleSymlinks), failedDirReads_ (failedDirReads), failedItemReads_(failedItemReads), acb_(acb), threadID_(threadID) {} - const ABF& abstractBaseFolder; - const HardFilter::FilterRef filterInstance; //always bound! + const ABF& baseFolder; + const HardFilter::FilterRef filter_; //always bound! const SymLinkHandling handleSymlinks_; std::map<Zstring, std::wstring, LessFilePath>& failedDirReads_; @@ -282,30 +296,34 @@ public: AsyncCallback& acb_; const int threadID_; + TickVal lastReportTime; }; class DirCallback : public ABF::TraverserCallback { public: - DirCallback(TraverserShared& config, + DirCallback(TraverserConfig& config, const Zstring& relNameParentPf, //postfixed with FILE_NAME_SEPARATOR! - DirContainer& output) : + DirContainer& output, + int level) : cfg(config), relNameParentPf_(relNameParentPf), - output_(output) {} + output_(output), + level_(level) {} virtual void onFile (const FileInfo& fi) override; // virtual std::unique_ptr<TraverserCallback> onDir (const DirInfo& di) override; //throw ThreadInterruption virtual HandleLink onSymlink(const SymlinkInfo& li) override; // - HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override; //throw ThreadInterruption - HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) override; // + HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override; //throw ThreadInterruption + HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zstring& itemName) override; // private: - TraverserShared& cfg; + TraverserConfig& cfg; const Zstring relNameParentPf_; DirContainer& output_; + const int level_; }; @@ -313,36 +331,34 @@ void DirCallback::onFile(const FileInfo& fi) //throw ThreadInterruption { interruptionPoint(); //throw ThreadInterruption - const Zstring fileNameShort(fi.shortName); - //do not list the database file(s) sync.ffs_db, sync.x64.ffs_db, etc. or lock files - if (endsWith(fileNameShort, SYNC_DB_FILE_ENDING) || - endsWith(fileNameShort, LOCK_FILE_ENDING)) + if (endsWith(fi.itemName, SYNC_DB_FILE_ENDING) || + endsWith(fi.itemName, LOCK_FILE_ENDING)) return; - const Zstring relFilePath = relNameParentPf_ + fileNameShort; + const Zstring relFilePath = relNameParentPf_ + fi.itemName; - //update status information no matter whether object is excluded or not! - if (cfg.acb_.mayReportCurrentFile(cfg.threadID_)) - cfg.acb_.reportCurrentFile(ABF::getDisplayPath(cfg.abstractBaseFolder.getAbstractPath(relFilePath)), cfg.threadID_); + //update status information no matter whether item is excluded or not! + if (cfg.acb_.mayReportCurrentFile(cfg.threadID_, cfg.lastReportTime)) + cfg.acb_.reportCurrentFile(ABF::getDisplayPath(cfg.baseFolder.getAbstractPath(relFilePath))); //------------------------------------------------------------------------------------ //apply filter before processing (use relative name!) - if (!cfg.filterInstance->passFileFilter(relFilePath)) + if (!cfg.filter_->passFileFilter(relFilePath)) return; // 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 - ID per file: 43.9s - ID per file > 1MB: 7.2s - ID per dir: 8.4s + regular: 6.9s + ID per file: 43.9s + ID per file > 1MB: 7.2s + ID per dir: 8.4s - Linux: retrieveFileID takes about 50% longer in VM! (avoidable because of redundant stat() call!) + Linux: retrieveFileID takes about 50% longer in VM! (avoidable because of redundant stat() call!) */ - output_.addSubFile(fileNameShort, FileDescriptor(fi.lastWriteTime, fi.fileSize, fi.id, fi.symlinkInfo != nullptr)); + output_.addSubFile(fi.itemName, FileDescriptor(fi.lastWriteTime, fi.fileSize, fi.id, fi.symlinkInfo != nullptr)); cfg.acb_.incItemsScanned(); //add 1 element to the progress indicator } @@ -352,25 +368,33 @@ std::unique_ptr<ABF::TraverserCallback> DirCallback::onDir(const DirInfo& di) // { interruptionPoint(); //throw ThreadInterruption - const Zstring& relDirPath = relNameParentPf_ + di.shortName; + const Zstring& relDirPath = relNameParentPf_ + di.itemName; - //update status information no matter whether object is excluded or not! - if (cfg.acb_.mayReportCurrentFile(cfg.threadID_)) - cfg.acb_.reportCurrentFile(ABF::getDisplayPath(cfg.abstractBaseFolder.getAbstractPath(relDirPath)), cfg.threadID_); + //update status information no matter whether item is excluded or not! + if (cfg.acb_.mayReportCurrentFile(cfg.threadID_, cfg.lastReportTime)) + cfg.acb_.reportCurrentFile(ABF::getDisplayPath(cfg.baseFolder.getAbstractPath(relDirPath))); //------------------------------------------------------------------------------------ //apply filter before processing (use relative name!) - bool subObjMightMatch = true; - const bool passFilter = cfg.filterInstance->passDirFilter(relDirPath, &subObjMightMatch); - if (!passFilter && !subObjMightMatch) + bool childItemMightMatch = true; + const bool passFilter = cfg.filter_->passDirFilter(relDirPath, &childItemMightMatch); + if (!passFilter && !childItemMightMatch) return nullptr; //do NOT traverse subdirs //else: attention! ensure directory filtering is applied later to exclude actually filtered directories - DirContainer& subDir = output_.addSubDir(di.shortName); + DirContainer& subDir = output_.addSubDir(di.itemName); if (passFilter) cfg.acb_.incItemsScanned(); //add 1 element to the progress indicator - return make_unique<DirCallback>(cfg, relDirPath + FILE_NAME_SEPARATOR, subDir); //releaseDirTraverser() is guaranteed to be called in any case + //------------------------------------------------------------------------------------ + if (level_ > 100) //Win32 traverser: stack overflow approximately at level 1000 + if (!tryReportingItemError([&] //check after DirContainer::addSubDir() + { + throw FileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", ABF::getDisplayPath(cfg.baseFolder.getAbstractPath(relDirPath))), L"Endless recursion."); + }, *this, di.itemName)) + return nullptr; + + return std::make_unique<DirCallback>(cfg, relDirPath + FILE_NAME_SEPARATOR, subDir, level_ + 1); //releaseDirTraverser() is guaranteed to be called in any case } @@ -378,11 +402,11 @@ DirCallback::HandleLink DirCallback::onSymlink(const SymlinkInfo& si) //throw Th { interruptionPoint(); //throw ThreadInterruption - const Zstring& relLinkPath = relNameParentPf_ + si.shortName; + const Zstring& relLinkPath = relNameParentPf_ + si.itemName; - //update status information no matter whether object is excluded or not! - if (cfg.acb_.mayReportCurrentFile(cfg.threadID_)) - cfg.acb_.reportCurrentFile(ABF::getDisplayPath(cfg.abstractBaseFolder.getAbstractPath(relLinkPath)), cfg.threadID_); + //update status information no matter whether item is excluded or not! + if (cfg.acb_.mayReportCurrentFile(cfg.threadID_, cfg.lastReportTime)) + cfg.acb_.reportCurrentFile(ABF::getDisplayPath(cfg.baseFolder.getAbstractPath(relLinkPath))); switch (cfg.handleSymlinks_) { @@ -390,21 +414,21 @@ DirCallback::HandleLink DirCallback::onSymlink(const SymlinkInfo& si) //throw Th return LINK_SKIP; case SYMLINK_DIRECT: - if (cfg.filterInstance->passFileFilter(relLinkPath)) //always use file filter: Link type may not be "stable" on Linux! + if (cfg.filter_->passFileFilter(relLinkPath)) //always use file filter: Link type may not be "stable" on Linux! { - output_.addSubLink(si.shortName, LinkDescriptor(si.lastWriteTime)); + output_.addSubLink(si.itemName, LinkDescriptor(si.lastWriteTime)); cfg.acb_.incItemsScanned(); //add 1 element to the progress indicator } return LINK_SKIP; case SYMLINK_FOLLOW: //filter symlinks before trying to follow them: handle user-excluded broken symlinks! - //since we don't know what type the symlink will resolve to, only do this when both variants agree: - if (!cfg.filterInstance->passFileFilter(relLinkPath)) + //since we don't know yet what type the symlink will resolve to, only do this when both variants agree: + if (!cfg.filter_->passFileFilter(relLinkPath)) { - bool subObjMightMatch = true; - if (!cfg.filterInstance->passDirFilter(relLinkPath, &subObjMightMatch)) - if (!subObjMightMatch) + bool childItemMightMatch = true; + if (!cfg.filter_->passDirFilter(relLinkPath, &childItemMightMatch)) + if (!childItemMightMatch) return LINK_SKIP; } return LINK_FOLLOW; @@ -431,12 +455,12 @@ DirCallback::HandleError DirCallback::reportDirError(const std::wstring& msg, si } -DirCallback::HandleError DirCallback::reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) //throw ThreadInterruption +DirCallback::HandleError DirCallback::reportItemError(const std::wstring& msg, size_t retryNumber, const Zstring& itemName) //throw ThreadInterruption { switch (cfg.acb_.reportError(msg, retryNumber)) //throw ThreadInterruption { case FillBufferCallback::ON_ERROR_IGNORE: - cfg.failedItemReads_[relNameParentPf_ + shortName] = msg; + cfg.failedItemReads_[relNameParentPf_ + itemName] = msg; return ON_ERROR_IGNORE; case FillBufferCallback::ON_ERROR_RETRY: @@ -453,43 +477,41 @@ class WorkerThread public: WorkerThread(int threadID, const std::shared_ptr<AsyncCallback>& acb, - const DirectoryKey& dirKey, + std::unique_ptr<ABF>&& baseFolder, //always bound! + const HardFilter::FilterRef& filter, // + SymLinkHandling handleSymlinks, DirectoryValue& dirOutput) : - threadID_(threadID), acb_(acb), - dirKey_(dirKey), - dirOutput_(dirOutput) {} - - void operator()() const //thread entry + baseFolder_(std::move(baseFolder)), + outputContainer(dirOutput.dirCont), + travCfg(threadID, + *baseFolder_, + filter, + handleSymlinks, //shared by all(!) instances of DirCallback while traversing a folder hierarchy + dirOutput.failedDirReads, + dirOutput.failedItemReads, + *acb_) {} + + void operator()() //thread entry { acb_->incActiveWorker(); - ZEN_ON_SCOPE_EXIT(acb_->decActiveWorker();); - - const AbstractPathRef& baseFolderItem = dirKey_.baseFolder_->getAbstractPath(); + ZEN_ON_SCOPE_EXIT(acb_->decActiveWorker()); - if (acb_->mayReportCurrentFile(threadID_)) - acb_->reportCurrentFile(ABF::getDisplayPath(baseFolderItem), threadID_); //just in case first directory access is blocking + const AbstractPathRef& baseFolderPath = baseFolder_->getAbstractPath(); - TraverserShared travCfg(threadID_, - *dirKey_.baseFolder_, - dirKey_.filter_, - dirKey_.handleSymlinks_, //shared by all(!) instances of DirCallback while traversing a folder hierarchy - dirOutput_.failedDirReads, - dirOutput_.failedItemReads, - *acb_); + if (acb_->mayReportCurrentFile(travCfg.threadID_, travCfg.lastReportTime)) + acb_->reportCurrentFile(ABF::getDisplayPath(baseFolderPath)); //just in case first directory access is blocking - DirCallback traverser(travCfg, - Zstring(), - dirOutput_.dirCont); + DirCallback cb(travCfg, Zstring(), outputContainer, 0); - ABF::traverseFolder(baseFolderItem, traverser); //throw X + ABF::traverseFolder(baseFolderPath, cb); //throw X } private: - const int threadID_; std::shared_ptr<AsyncCallback> acb_; - const DirectoryKey dirKey_; - DirectoryValue& dirOutput_; + std::unique_ptr<ABF> baseFolder_; //always bound! + DirContainer& outputContainer; + TraverserConfig travCfg; }; } @@ -497,7 +519,7 @@ private: void zen::fillBuffer(const std::set<DirectoryKey>& keysToRead, //in std::map<DirectoryKey, DirectoryValue>& buf, //out FillBufferCallback& callback, - size_t updateInterval) + size_t updateIntervalMs) { buf.clear(); @@ -512,7 +534,7 @@ void zen::fillBuffer(const std::set<DirectoryKey>& keysToRead, //in wt.join(); //in this context it is possible a thread is *not* joinable anymore due to the thread::try_join_for() below! }); - auto acb = std::make_shared<AsyncCallback>(); + auto acb = std::make_shared<AsyncCallback>(updateIntervalMs / 2 /*reportingIntervalMs*/); //init worker threads for (const DirectoryKey& key : keysToRead) @@ -521,7 +543,12 @@ void zen::fillBuffer(const std::set<DirectoryKey>& keysToRead, //in DirectoryValue& dirOutput = buf[key]; const int threadId = static_cast<int>(worker.size()); - worker.emplace_back(WorkerThread(threadId, acb, key, dirOutput)); + worker.emplace_back(WorkerThread(threadId, + acb, + key.baseFolder_->createIndependentCopy(), //copy instance for safe access on any method by a different thread! + key.filter_, + key.handleSymlinks_, + dirOutput)); } //wait until done @@ -535,7 +562,7 @@ void zen::fillBuffer(const std::set<DirectoryKey>& keysToRead, //in //process errors acb->processErrors(callback); } - while (!wt.tryJoinFor(std::chrono::milliseconds(updateInterval))); + while (!wt.tryJoinFor(std::chrono::milliseconds(updateIntervalMs))); acb->incrementNotifyingThreadId(); //process info messages of one thread at a time only } diff --git a/FreeFileSync/Source/lib/parallel_scan.h b/FreeFileSync/Source/lib/parallel_scan.h index fdf0677f..f75fab99 100644 --- a/FreeFileSync/Source/lib/parallel_scan.h +++ b/FreeFileSync/Source/lib/parallel_scan.h @@ -75,7 +75,7 @@ public: void fillBuffer(const std::set<DirectoryKey>& keysToRead, //in std::map<DirectoryKey, DirectoryValue>& buf, //out FillBufferCallback& callback, - size_t updateInterval); //unit: [ms] + size_t updateIntervalMs); //unit: [ms] } #endif // PARALLEL_SCAN_H_INCLUDED diff --git a/FreeFileSync/Source/lib/perf_check.cpp b/FreeFileSync/Source/lib/perf_check.cpp index 19ff4bda..ed34b7ef 100644 --- a/FreeFileSync/Source/lib/perf_check.cpp +++ b/FreeFileSync/Source/lib/perf_check.cpp @@ -35,7 +35,7 @@ PerfCheck::~PerfCheck() outputFile.Write(wxT(";")); outputFile.Write(numberTo<wxString>(it->second.objCount_)); outputFile.Write(wxT(";")); - outputFile.Write(numberTo<wxString>(it->second.data_)); + outputFile.Write(numberTo<wxString>(it->second.data_)); outputFile.Write(wxT("\n")); } */ diff --git a/FreeFileSync/Source/lib/process_xml.cpp b/FreeFileSync/Source/lib/process_xml.cpp index f303ecd0..9201133a 100644 --- a/FreeFileSync/Source/lib/process_xml.cpp +++ b/FreeFileSync/Source/lib/process_xml.cpp @@ -79,23 +79,6 @@ Zstring xmlAccess::getGlobalConfigFile() } -void xmlAccess::OptionalDialogs::resetDialogs() -{ - warningDependentFolders = true; - warningFolderPairRaceCondition = true; - warningSignificantDifference = true; - warningNotEnoughDiskSpace = true; - warningUnresolvedConflicts = true; - warningDatabaseError = true; - warningRecyclerMissing = true; - warningInputFieldEmpty = true; - warningDirectoryLockFailed = true; - popupOnConfigChange = true; - confirmSyncStart = true; - confirmExternalCommandMassInvoke = true; -} - - xmlAccess::XmlGuiConfig xmlAccess::convertBatchToGui(const xmlAccess::XmlBatchConfig& batchCfg) //noexcept { XmlGuiConfig output; diff --git a/FreeFileSync/Source/lib/process_xml.h b/FreeFileSync/Source/lib/process_xml.h index 12d6ac44..e309978a 100644 --- a/FreeFileSync/Source/lib/process_xml.h +++ b/FreeFileSync/Source/lib/process_xml.h @@ -4,8 +4,8 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef PROCESSXML_H_INCLUDED -#define PROCESSXML_H_INCLUDED +#ifndef PROCESSXML_H_INCLUDED_28345825704254262435 +#define PROCESSXML_H_INCLUDED_28345825704254262435 #include <zen/xml_io.h> #include <wx/gdicmn.h> @@ -47,14 +47,10 @@ typedef std::vector<std::pair<Description, Commandline>> ExternalApps; //--------------------------------------------------------------------- struct XmlGuiConfig { - XmlGuiConfig() : - handleError(ON_GUIERROR_POPUP), - highlightSyncAction(true) {} //initialize values - zen::MainConfiguration mainCfg; - OnGuiError handleError; //reaction on error situation during synchronization - bool highlightSyncAction; + OnGuiError handleError = ON_GUIERROR_POPUP; //reaction on error situation during synchronization + bool highlightSyncAction = true; }; @@ -69,38 +65,29 @@ bool operator==(const XmlGuiConfig& lhs, const XmlGuiConfig& rhs) struct XmlBatchConfig { - XmlBatchConfig() : - runMinimized(false), - logfilesCountLimit(-1), - handleError(ON_ERROR_POPUP) {} - zen::MainConfiguration mainCfg; - bool runMinimized; + bool runMinimized = false; Zstring logFolderPathPhrase; - int logfilesCountLimit; //max logfiles; 0 := don't save logfiles; < 0 := no limit - OnError handleError; //reaction on error situation during synchronization + int logfilesCountLimit = -1; //max logfiles; 0 := don't save logfiles; < 0 := no limit + OnError handleError = ON_ERROR_POPUP; //reaction on error situation during synchronization }; struct OptionalDialogs { - OptionalDialogs() { resetDialogs();} - - void resetDialogs(); - - bool warningDependentFolders; - bool warningFolderPairRaceCondition; - bool warningSignificantDifference; - bool warningNotEnoughDiskSpace; - bool warningUnresolvedConflicts; - bool warningDatabaseError; - bool warningRecyclerMissing; - bool warningInputFieldEmpty; - bool warningDirectoryLockFailed; - bool popupOnConfigChange; - bool confirmSyncStart; - bool confirmExternalCommandMassInvoke; + bool warningDependentFolders = true; + bool warningFolderPairRaceCondition = true; + bool warningSignificantDifference = true; + bool warningNotEnoughDiskSpace = true; + bool warningUnresolvedConflicts = true; + bool warningDatabaseError = true; + bool warningRecyclerMissing = true; + bool warningInputFieldEmpty = true; + bool warningDirectoryLockFailed = true; + bool popupOnConfigChange = true; + bool confirmSyncStart = true; + bool confirmExternalCommandMassInvoke = true; }; @@ -114,50 +101,46 @@ enum FileIconSize struct ViewFilterDefault { - ViewFilterDefault() : equal(false), conflict(true), excluded(true) - { - leftOnly = rightOnly = leftNewer = rightNewer = different = true; - createLeft = createRight = updateLeft = updateRight = deleteLeft = deleteRight = doNothing = true; - } - bool equal; // - bool conflict; //shared - bool excluded; // - bool leftOnly, rightOnly, leftNewer, rightNewer, different; //category view - bool createLeft, createRight, updateLeft, updateRight, deleteLeft, deleteRight, doNothing; //action view + //shared + bool equal = false; + bool conflict = true; + bool excluded = false; + //category view + bool leftOnly = true; + bool rightOnly = true; + bool leftNewer = true; + bool rightNewer = true; + bool different = true; + //action view + bool createLeft = true; + bool createRight = true; + bool updateLeft = true; + bool updateRight = true; + bool deleteLeft = true; + bool deleteRight = true; + bool doNothing = true; }; Zstring getGlobalConfigFile(); struct XmlGlobalSettings { + XmlGlobalSettings() {} //clang needs this + //--------------------------------------------------------------------- //Shared (GUI/BATCH) settings - XmlGlobalSettings() : - programLanguage(zen::retrieveSystemLanguage()), - failsafeFileCopy(true), - copyLockedFiles(false), //safer default: avoid copies of partially written files - copyFilePermissions(false), - automaticRetryCount(0), - automaticRetryDelay(5), - fileTimeTolerance(2), //default 2s: FAT vs NTFS - runWithBackgroundPriority(false), - createLockFile(true), - verifyFileCopy(false), - lastSyncsLogFileSizeMax(100000) //maximum size for LastSyncs.log: use a human-readable number - {} - - int programLanguage; - bool failsafeFileCopy; - bool copyLockedFiles; - bool copyFilePermissions; - size_t automaticRetryCount; - size_t automaticRetryDelay; //unit: [sec] - - int fileTimeTolerance; //max. allowed file time deviation; < 0 means unlimited tolerance - bool runWithBackgroundPriority; - bool createLockFile; - bool verifyFileCopy; //verify copied files - size_t lastSyncsLogFileSizeMax; + int programLanguage = zen::retrieveSystemLanguage(); + bool failsafeFileCopy = true; + bool copyLockedFiles = false; //safer default: avoid copies of partially written files + bool copyFilePermissions = false; + size_t automaticRetryCount = 0; + size_t automaticRetryDelay = 5; //unit: [sec] + + int fileTimeTolerance = 2; //max. allowed file time deviation; < 0 means unlimited tolerance; default 2s: FAT vs NTFS + bool runWithBackgroundPriority = false; + bool createLockFile = true; + bool verifyFileCopy = false; + size_t lastSyncsLogFileSizeMax = 100000; //maximum size for LastSyncs.log: use a human-readable number OptionalDialogs optDialogs; @@ -232,7 +215,7 @@ struct XmlGlobalSettings #endif struct { - bool keepRelPaths = true; + bool keepRelPaths = true; bool overwriteIfExists = false; Zstring lastUsedPath; std::vector<Zstring> folderHistory; @@ -249,8 +232,8 @@ struct XmlGlobalSettings bool showIcons = true; FileIconSize iconSize = ICON_SIZE_SMALL; - long lastUpdateCheck = 0; //time of last update check - wxString lastOnlineVersion; + time_t lastUpdateCheck = 0; //number of seconds since 00:00 hours, Jan 1, 1970 UTC + std::wstring lastOnlineVersion; ViewFilterDefault viewFilterDefault; wxString guiPerspectiveLast; //used by wxAuiManager @@ -279,4 +262,4 @@ XmlBatchConfig convertGuiToBatch(const XmlGuiConfig& guiCfg, const XmlBatchCon std::wstring extractJobName(const Zstring& configFilename); } -#endif // PROCESSXML_H_INCLUDED +#endif //PROCESSXML_H_INCLUDED_28345825704254262435 diff --git a/FreeFileSync/Source/lib/resolve_path.cpp b/FreeFileSync/Source/lib/resolve_path.cpp index 1f00fbfa..f14078db 100644 --- a/FreeFileSync/Source/lib/resolve_path.cpp +++ b/FreeFileSync/Source/lib/resolve_path.cpp @@ -108,9 +108,9 @@ private: wchar_t buffer[MAX_PATH] = {}; if (SUCCEEDED(::SHGetFolderPath(nullptr, //__in HWND hwndOwner, csidl | CSIDL_FLAG_DONT_VERIFY, //__in int nFolder, - nullptr, //__in HANDLE hToken, + nullptr, //__in HANDLE hToken, 0 /* == SHGFP_TYPE_CURRENT*/, //__in DWORD dwFlags, - buffer))) //__out LPTSTR pszPath + buffer))) //__out LPTSTR pszPath { Zstring dirpath = buffer; if (!dirpath.empty()) @@ -183,21 +183,21 @@ private: addFolderId(FOLDERID_QuickLaunch, L"csidl_QuickLaunch"); // C:\Users\<user>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch /* - CSIDL_APPDATA covered by %AppData% - CSIDL_LOCAL_APPDATA covered by %LocalAppData% -> not on XP! - CSIDL_COMMON_APPDATA covered by %ProgramData% -> not on XP! - CSIDL_PROFILE covered by %UserProfile% - CSIDL_WINDOWS covered by %WinDir% - CSIDL_SYSTEM covered by %WinDir% - CSIDL_SYSTEMX86 covered by %WinDir% - CSIDL_PROGRAM_FILES covered by %ProgramFiles% - CSIDL_PROGRAM_FILES_COMMON covered by %CommonProgramFiles% - CSIDL_PROGRAM_FILESX86 covered by %ProgramFiles(x86)% -> not on XP! - CSIDL_PROGRAM_FILES_COMMONX86 covered by %CommonProgramFiles(x86)% -> not on XP! - CSIDL_ADMINTOOLS not relevant? - CSIDL_COMMON_ADMINTOOLS not relevant? - - FOLDERID_Public covered by %Public% + CSIDL_APPDATA covered by %AppData% + CSIDL_LOCAL_APPDATA covered by %LocalAppData% -> not on XP! + CSIDL_COMMON_APPDATA covered by %ProgramData% -> not on XP! + CSIDL_PROFILE covered by %UserProfile% + CSIDL_WINDOWS covered by %WinDir% + CSIDL_SYSTEM covered by %WinDir% + CSIDL_SYSTEMX86 covered by %WinDir% + CSIDL_PROGRAM_FILES covered by %ProgramFiles% + CSIDL_PROGRAM_FILES_COMMON covered by %CommonProgramFiles% + CSIDL_PROGRAM_FILESX86 covered by %ProgramFiles(x86)% -> not on XP! + CSIDL_PROGRAM_FILES_COMMONX86 covered by %CommonProgramFiles(x86)% -> not on XP! + CSIDL_ADMINTOOLS not relevant? + CSIDL_COMMON_ADMINTOOLS not relevant? + + FOLDERID_Public covered by %Public% */ return output; } @@ -351,7 +351,7 @@ Opt<Zstring> getPathByVolumenName(const Zstring& volumeName) //return no value o nullptr, //__out LPTSTR lpFileSystemNameBuffer, 0)) //__in DWORD nFileSystemNameSize if (EqualFilePath()(volumeName, &volName[0])) - return zen::make_unique<Zstring>(path); + return std::make_unique<Zstring>(path); return nullptr; }); } @@ -553,12 +553,12 @@ Zstring zen::getResolvedFilePath(const Zstring& pathPhrase) //noexcept */ path = resolveRelativePath(path); - auto isVolumeRoot = [](const Zstring& path) + auto isVolumeRoot = [](const Zstring& dirPath) { #ifdef ZEN_WIN - return path.size() == 3 && isAlpha(path[0]) && path[1] == L':' && path[2] == L'\\'; + return dirPath.size() == 3 && isAlpha(dirPath[0]) && dirPath[1] == L':' && dirPath[2] == L'\\'; #elif defined ZEN_LINUX || defined ZEN_MAC - return path == "/"; + return dirPath == "/"; #endif }; @@ -577,23 +577,23 @@ void zen::loginNetworkShare(const Zstring& dirpathOrig, bool allowUserInteractio /* ATTENTION: it is not safe to retrieve UNC path via ::WNetGetConnection() for every type of network share: - network type |::WNetGetConnection rv | lpRemoteName | existing UNC path + network type |::WNetGetConnection rv | lpRemoteName | existing UNC path -----------------------------|-------------------------|---------------------------------|---------------- - inactive local network share | ERROR_CONNECTION_UNAVAIL| \\192.168.1.27\new2 | YES - WebDrive | NO_ERROR | \\Webdrive-ZenJu\GNU | NO - Box.net (WebDav) | NO_ERROR | \\www.box.net\DavWWWRoot\dav | YES - NetDrive | ERROR_NOT_CONNECTED | <empty> | NO + inactive local network share | ERROR_CONNECTION_UNAVAIL| \\192.168.1.27\new2 | YES + WebDrive | NO_ERROR | \\Webdrive-ZenJu\GNU | NO + Box.net (WebDav) | NO_ERROR | \\www.box.net\DavWWWRoot\dav | YES + NetDrive | ERROR_NOT_CONNECTED | <empty> | NO ____________________________________________________________________________________________________________ Windows Login Prompt Naming Conventions: - network share: \\<server>\<share> e.g. \\WIN-XP\folder or \\192.168.1.50\folder - user account: <Domain>\<user> e.g. WIN-XP\Zenju or 192.168.1.50\Zenju + network share: \\<server>\<share> e.g. \\WIN-XP\folder or \\192.168.1.50\folder + user account: <Domain>\<user> e.g. WIN-XP\Zenju or 192.168.1.50\Zenju Windows Command Line: - list *all* active network connections, including deviceless ones which are hidden in Explorer: - net use + net use - delete active connection: - net use /delete \\server\share + net use /delete \\server\share ____________________________________________________________________________________________________________ Scenario: XP-shared folder is accessed by Win 7 over LAN with access limited to a certain user @@ -611,11 +611,11 @@ void zen::loginNetworkShare(const Zstring& dirpathOrig, bool allowUserInteractio nullptr, //__in LPCTSTR lpPassword, nullptr, //__in LPCTSTR lpUsername, 0); //__in DWORD dwFlags - //53L ERROR_BAD_NETPATH The network path was not found. + //53L ERROR_BAD_NETPATH The network path was not found. //67L ERROR_BAD_NET_NAME - //86L ERROR_INVALID_PASSWORD - //1219L ERROR_SESSION_CREDENTIAL_CONFLICT Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. - //1326L ERROR_LOGON_FAILURE Logon failure: unknown user name or bad password. + //86L ERROR_INVALID_PASSWORD + //1219L ERROR_SESSION_CREDENTIAL_CONFLICT Multiple connections to a server or shared resource by the same user, using more than one user name, are not allowed. Disconnect all previous connections to the server or shared resource and try again. + //1326L ERROR_LOGON_FAILURE Logon failure: unknown user name or bad password. //1236L ERROR_CONNECTION_ABORTED if (somethingExists(trgRes.lpRemoteName)) //blocks! return; //success: connection usable! -> don't care about "rv" @@ -630,8 +630,8 @@ void zen::loginNetworkShare(const Zstring& dirpathOrig, bool allowUserInteractio { //avoid problem II.) DWORD rv2= ::WNetCancelConnection2(trgRes.lpRemoteName, //_In_ LPCTSTR lpName, - 0, //_In_ DWORD dwFlags, - true); //_In_ BOOL fForce + 0, //_In_ DWORD dwFlags, + true); //_In_ BOOL fForce //2250L ERROR_NOT_CONNECTED //enforce login prompt diff --git a/FreeFileSync/Source/lib/resolve_path.h b/FreeFileSync/Source/lib/resolve_path.h index 0ce9c34c..fac1e3ff 100644 --- a/FreeFileSync/Source/lib/resolve_path.h +++ b/FreeFileSync/Source/lib/resolve_path.h @@ -13,13 +13,13 @@ namespace zen { /* - - expand macros - - trim whitespace - - expand volume path by name - - convert relative paths into absolute + - expand macros + - trim whitespace + - expand volume path by name + - convert relative paths into absolute - => may block for slow USB sticks and idle HDDs - => not thread-safe, see ::GetFullPathName()! + => may block for slow USB sticks and idle HDDs + => not thread-safe, see ::GetFullPathName()! */ Zstring getResolvedFilePath(const Zstring& pathPhrase); //noexcept diff --git a/FreeFileSync/Source/lib/versioning.cpp b/FreeFileSync/Source/lib/versioning.cpp index ea3ce43b..4cfa84df 100644 --- a/FreeFileSync/Source/lib/versioning.cpp +++ b/FreeFileSync/Source/lib/versioning.cpp @@ -63,8 +63,7 @@ bool impl::isMatchingVersion(const Zstring& shortname, const Zstring& shortnameV /* -- handle not existing source -- create target super directories if missing +create target super directories if missing */ void FileVersioner::moveItemToVersioning(const AbstractPathRef& itemPath, const Zstring& relativePath, //throw FileError const std::function<void(const AbstractPathRef& sourcePath, const AbstractPathRef& targetPath)>& moveItem) //move source -> target; may throw FileError @@ -94,11 +93,8 @@ void FileVersioner::moveItemToVersioning(const AbstractPathRef& itemPath, const { moveItem(itemPath, versionedItemPath); //throw FileError } - catch (FileError&) //expected to fail if target directory is not yet existing! + catch (const FileError&) //expected to fail if target directory is not yet existing! { - if (!ABF::somethingExists(itemPath)) //missing source file 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 AbstractPathRef versionedParentPath = versioningFolder_->getAbstractPath(beforeLast(versionedRelPath, FILE_NAME_SEPARATOR, IF_MISSING_RETURN_NONE)); if (!ABF::somethingExists(versionedParentPath)) //->(minor) file system race condition! @@ -116,7 +112,7 @@ void FileVersioner::moveItemToVersioning(const AbstractPathRef& itemPath, const namespace { //move source to target across volumes -//no need to check if: - super-directories of target exist - source exists: done by moveItemToVersioning() +//no need to check if super-directories of target exist: done by moveItemToVersioning() //if target already exists, it is overwritten, even if it is a different type, e.g. a directory! template <class Function> void moveItem(const AbstractPathRef& sourcePath, //throw FileError @@ -125,48 +121,55 @@ void moveItem(const AbstractPathRef& sourcePath, //throw FileError { assert(ABF::fileExists(sourcePath) || ABF::symlinkExists(sourcePath) || !ABF::somethingExists(sourcePath)); //we process files and symlinks only - auto removeTarget = [&] - { - try - { - //file or (broken) file-symlink: - ABF::removeFile(targetPath); //throw FileError - } - catch (FileError&) - { - //folder or folder-symlink: - if (ABF::folderExists(targetPath)) //directory or dir-symlink - { - assert(ABF::symlinkExists(targetPath)); //we do not expect targetPath to be a directory in general (but possible!) - ABF::removeFolderRecursively(targetPath, nullptr /*onBeforeFileDeletion*/, nullptr /*onBeforeFolderDeletion*/); //throw FileError - } - else - throw; - } - }; - //first try to move directly without copying try { ABF::renameItem(sourcePath, targetPath); //throw FileError, ErrorTargetExisting, ErrorDifferentVolume return; //great, we get away cheaply! } - //if moving failed, treat as error (except when it tried to move to a different volume: in this case we will copy the file) - catch (const ErrorDifferentVolume&) + catch (const FileError&) { - removeTarget(); //throw FileError - copyDelete(); // - } - catch (const ErrorTargetExisting&) - { - removeTarget(); //throw FileError - try + //missing source item is not an error => check BEFORE calling removeTarget()! + if (!ABF::somethingExists(sourcePath)) + return; //object *not* processed + + auto removeTarget = [&] { - ABF::renameItem(sourcePath, targetPath); //throw FileError, (ErrorTargetExisting), ErrorDifferentVolume - } + try + { + //file or (broken) file-symlink: + ABF::removeFile(targetPath); //throw FileError + } + catch (FileError&) + { + //folder or folder-symlink: + if (ABF::folderExists(targetPath)) //directory or dir-symlink + { + assert(ABF::symlinkExists(targetPath)); //we do not expect targetPath to be a directory in general (but possible!) + ABF::removeFolderRecursively(targetPath, nullptr /*onBeforeFileDeletion*/, nullptr /*onBeforeFolderDeletion*/); //throw FileError + } + else + throw; + } + }; + + try { throw; } catch (const ErrorDifferentVolume&) { - copyDelete(); //throw FileError + removeTarget(); //throw FileError + copyDelete(); // + } + catch (const ErrorTargetExisting&) + { + removeTarget(); //throw FileError + try + { + ABF::renameItem(sourcePath, targetPath); //throw FileError, (ErrorTargetExisting), ErrorDifferentVolume + } + catch (const ErrorDifferentVolume&) + { + copyDelete(); //throw FileError + } } } } @@ -235,25 +238,25 @@ struct FlatTraverserCallback: public ABF::TraverserCallback { FlatTraverserCallback(const AbstractPathRef& folderPath) : folderPath_(folderPath) {} - void onFile (const FileInfo& fi) override { fileNames_ .push_back(fi.shortName); } - std::unique_ptr<TraverserCallback> onDir (const DirInfo& di) override { folderNames_.push_back(di.shortName); return nullptr; } - HandleLink onSymlink(const SymlinkInfo& si) override - { - if (ABF::folderExists(ABF::appendRelPath(folderPath_, si.shortName))) //dir symlink - folderLinkNames_.push_back(si.shortName); - else //file symlink, broken symlink - fileLinkNames_.push_back(si.shortName); - return TraverserCallback::LINK_SKIP; - } - HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override { throw FileError(msg); } - HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) override { throw FileError(msg); } - const std::vector<Zstring>& refFileNames () const { return fileNames_; } const std::vector<Zstring>& refFolderNames () const { return folderNames_; } const std::vector<Zstring>& refFileLinkNames () const { return fileLinkNames_; } const std::vector<Zstring>& refFolderLinkNames() const { return folderLinkNames_; } private: + void onFile (const FileInfo& fi) override { fileNames_ .push_back(fi.itemName); } + std::unique_ptr<TraverserCallback> onDir (const DirInfo& di) override { folderNames_.push_back(di.itemName); return nullptr; } + HandleLink onSymlink(const SymlinkInfo& si) override + { + if (ABF::folderExists(ABF::appendRelPath(folderPath_, si.itemName))) //dir symlink + folderLinkNames_.push_back(si.itemName); + else //file symlink, broken symlink + fileLinkNames_.push_back(si.itemName); + return TraverserCallback::LINK_SKIP; + } + HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override { throw FileError(msg); } + HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zstring& itemName) override { throw FileError(msg); } + const AbstractPathRef folderPath_; std::vector<Zstring> fileNames_; std::vector<Zstring> folderNames_; diff --git a/FreeFileSync/Source/lib/versioning.h b/FreeFileSync/Source/lib/versioning.h index e132a7fb..7a9d0ea9 100644 --- a/FreeFileSync/Source/lib/versioning.h +++ b/FreeFileSync/Source/lib/versioning.h @@ -19,13 +19,13 @@ namespace zen //e.g. move C:\Source\subdir\Sample.txt -> D:\Revisions\subdir\Sample.txt 2012-05-15 131513.txt //scheme: <revisions directory>\<relpath>\<filename>.<ext> YYYY-MM-DD HHMMSS.<ext> /* - - ignores missing source files/dirs - - creates missing intermediate directories - - does not create empty directories - - 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 filepath!! + - ignores missing source files/dirs + - creates missing intermediate directories + - does not create empty directories + - 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 filepath!! */ class FileVersioner diff --git a/FreeFileSync/Source/process_callback.h b/FreeFileSync/Source/process_callback.h index 7948f2af..eb50a571 100644 --- a/FreeFileSync/Source/process_callback.h +++ b/FreeFileSync/Source/process_callback.h @@ -37,16 +37,16 @@ struct ProcessCallback 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 - 3. file contains significant ADS data, is sparse or compressed - 4. file/directory already deleted externally: nothing to do, 0 logical operations and data + 1. file cannot be moved -> fallback to copy + delete + 2. file copy, actual size changed after comparison + 3. file contains significant ADS data, is sparse or compressed + 4. file/directory already deleted externally: nothing to do, 0 logical operations and data 5. auto-resolution for failed create operations due to missing source - 6. directory deletion: may contain more items than scanned by FFS (excluded by filter) or less (contains followed symlinks) - 7. delete directory to recycler: no matter how many child-elements exist, this is only 1 item to process! - 8. user-defined deletion directory on different volume: full file copy required (instead of move) - 9. Binary file comparison: short-circuit behavior if files differ - 10. Error during file copy, retry: bytes were copied => increases total workload! + 6. directory deletion: may contain more items than scanned by FFS (excluded by filter) or less (contains followed symlinks) + 7. delete directory to recycler: no matter how many child-elements exist, this is only 1 item to process! + 8. user-defined deletion directory on different volume: full file copy required (instead of move) + 9. Binary file comparison: short-circuit behavior if files differ + 10. Error during file copy, retry: bytes were copied => increases total workload! */ //opportunity to abort must be implemented in a frequently executed method like requestUiRefresh() diff --git a/FreeFileSync/Source/structures.cpp b/FreeFileSync/Source/structures.cpp index c25cd1a5..f4a46dc6 100644 --- a/FreeFileSync/Source/structures.cpp +++ b/FreeFileSync/Source/structures.cpp @@ -264,7 +264,7 @@ std::int64_t resolve(size_t value, UnitTime unit, std::int64_t defaultVal) // localTimeFmt->tm_hour = 0; //0-23 // const time_t timeFrom = ::mktime(localTimeFmt); - // int dayOfWeek = (localTimeFmt->tm_wday + 6) % 7; //tm_wday := days since Sunday 0-6 + // int dayOfWeek = (localTimeFmt->tm_wday + 6) % 7; //tm_wday := days since Sunday 0-6 // // +6 == -1 in Z_7 // return std::int64_t(timeFrom) - daysSinceBeginOfWeek(dayOfWeek) * 24 * 3600; diff --git a/FreeFileSync/Source/structures.h b/FreeFileSync/Source/structures.h index f3cff19f..822beed0 100644 --- a/FreeFileSync/Source/structures.h +++ b/FreeFileSync/Source/structures.h @@ -4,8 +4,8 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef FREEFILESYNC_H_INCLUDED -#define FREEFILESYNC_H_INCLUDED +#ifndef STRUCTURES_H_8210478915019450901745 +#define STRUCTURES_H_8210478915019450901745 #include <vector> #include <memory> @@ -29,7 +29,7 @@ enum SymLinkHandling }; -enum class SyncDirection : unsigned char //we need to save space for use in FileSystemObject! +enum class SyncDirection : unsigned char //save space for use in FileSystemObject! { LEFT, RIGHT, @@ -102,20 +102,12 @@ std::wstring getSymbol(SyncOperation op); //method used for exporting .csv file struct DirectionSet { - DirectionSet() : - exLeftSideOnly (SyncDirection::RIGHT), - exRightSideOnly(SyncDirection::LEFT), - leftNewer (SyncDirection::RIGHT), - rightNewer (SyncDirection::LEFT), - different (SyncDirection::NONE), - conflict (SyncDirection::NONE) {} - - SyncDirection exLeftSideOnly; - SyncDirection exRightSideOnly; - SyncDirection leftNewer; //CMP_BY_TIME_SIZE only! - SyncDirection rightNewer; // - SyncDirection different; //CMP_BY_CONTENT only! - SyncDirection conflict; + SyncDirection exLeftSideOnly = SyncDirection::RIGHT; + SyncDirection exRightSideOnly = SyncDirection::LEFT; + SyncDirection leftNewer = SyncDirection::RIGHT; //CMP_BY_TIME_SIZE only! + SyncDirection rightNewer = SyncDirection::LEFT; // + SyncDirection different = SyncDirection::NONE; //CMP_BY_CONTENT only! + SyncDirection conflict = SyncDirection::NONE; }; DirectionSet getTwoWayUpdateSet(); @@ -141,11 +133,9 @@ struct DirectionConfig //technical representation of sync-config CUSTOM //use custom directions }; - DirectionConfig() : var(TWOWAY), detectMovedFiles(false) {} - - Variant var; - DirectionSet custom; //custom sync directions - bool detectMovedFiles; //dependent from Variant: e.g. always active for DirectionConfig::TWOWAY! => use functions below for evaluation! + Variant var = TWOWAY; + DirectionSet custom; //sync directions for variant CUSTOM + bool detectMovedFiles = false; //dependent from Variant: e.g. always active for DirectionConfig::TWOWAY! => use functions below for evaluation! }; inline @@ -175,14 +165,9 @@ bool effectivelyEqual(const DirectionConfig& lhs, const DirectionConfig& rhs) struct CompConfig { - CompConfig() : - compareVar(CMP_BY_TIME_SIZE), - handleSymlinks(SYMLINK_EXCLUDE), - optTimeShiftHours(0) {} - - CompareVariant compareVar; - SymLinkHandling handleSymlinks; - unsigned int optTimeShiftHours; //if != 0: treat modification times with this offset as equal + CompareVariant compareVar = CMP_BY_TIME_SIZE; + SymLinkHandling handleSymlinks = SYMLINK_EXCLUDE; + unsigned int optTimeShiftHours = 0; //if != 0: treat modification times with this offset as equal }; inline @@ -212,16 +197,12 @@ enum VersioningStyle struct SyncConfig { - SyncConfig() : - handleDeletion(DELETE_TO_RECYCLER), - versioningStyle(VER_STYLE_REPLACE) {} - //sync direction settings DirectionConfig directionCfg; - DeletionPolicy handleDeletion; //use Recycle, delete permanently or move to user-defined location + DeletionPolicy handleDeletion = DELETE_TO_RECYCLER; //use Recycle, delete permanently or move to user-defined location //versioning options - VersioningStyle versioningStyle; + VersioningStyle versioningStyle = VER_STYLE_REPLACE; Zstring versioningFolderPhrase; //int versionCountLimit; //max versions per file (DELETE_TO_VERSIONING); < 0 := no limit }; @@ -269,14 +250,15 @@ enum UnitTime struct FilterConfig { - FilterConfig(const Zstring& include = Zstr("*"), - const Zstring& exclude = Zstring(), - size_t timeSpanIn = 0, - UnitTime unitTimeSpanIn = UTIME_NONE, - size_t sizeMinIn = 0, - UnitSize unitSizeMinIn = USIZE_NONE, - size_t sizeMaxIn = 0, - UnitSize unitSizeMaxIn = USIZE_NONE) : + FilterConfig() {} + FilterConfig(const Zstring& include, + const Zstring& exclude, + size_t timeSpanIn, + UnitTime unitTimeSpanIn, + size_t sizeMinIn, + UnitSize unitSizeMinIn, + size_t sizeMaxIn, + UnitSize unitSizeMaxIn) : includeFilter(include), excludeFilter(exclude), timeSpan (timeSpanIn), @@ -291,7 +273,7 @@ struct FilterConfig 1. using it creates a NEW folder hierarchy! -> must be considered by <Automatic>-mode! (fortunately it turns out, doing nothing already has perfect semantics :) 2. it applies equally to both sides => it always matches either both sides or none! => can be used while traversing a single folder! */ - Zstring includeFilter; + Zstring includeFilter = Zstr("*"); Zstring excludeFilter; /* @@ -300,14 +282,14 @@ struct FilterConfig 2. => it is applied after traversing and just marks rows, (NO deletions after comparison are allowed) 3. => equivalent to a user temporarily (de-)selecting rows -> not relevant for <Automatic>-mode! ;) */ - size_t timeSpan; - UnitTime unitTimeSpan; + size_t timeSpan = 0; + UnitTime unitTimeSpan = UTIME_NONE; - size_t sizeMin; - UnitSize unitSizeMin; + size_t sizeMin = 0; + UnitSize unitSizeMin = USIZE_NONE; - size_t sizeMax; - UnitSize unitSizeMax; + size_t sizeMax = 0; + UnitSize unitSizeMax = USIZE_NONE; }; inline @@ -405,4 +387,4 @@ bool operator==(const MainConfiguration& lhs, const MainConfiguration& rhs) MainConfiguration merge(const std::vector<MainConfiguration>& mainCfgs); } -#endif // FREEFILESYNC_H_INCLUDED +#endif //STRUCTURES_H_8210478915019450901745 diff --git a/FreeFileSync/Source/synchronization.cpp b/FreeFileSync/Source/synchronization.cpp index f46862ba..3d4ed798 100644 --- a/FreeFileSync/Source/synchronization.cpp +++ b/FreeFileSync/Source/synchronization.cpp @@ -340,7 +340,7 @@ private: { assert(deletionPolicy_ == DELETE_TO_VERSIONING); if (!versioner.get()) - versioner = zen::make_unique<FileVersioner>(std::move(versioningFolder), versioningStyle_, timeStamp_); //throw FileError + versioner = std::make_unique<FileVersioner>(std::move(versioningFolder), versioningStyle_, timeStamp_); //throw FileError return *versioner; }; @@ -1201,7 +1201,7 @@ void SynchronizeFolderPair::synchronizeFileInt(FilePair& fileObj, SyncOperation catch (FileError&) { warn_static("still an error if base dir is missing!") - // const Zstring basedir = beforeLast(fileObj.getBaseDirPf<side>(), FILE_NAME_SEPARATOR); //what about C:\ ??? + // const Zstring basedir = beforeLast(fileObj.getBaseDirPf<side>(), FILE_NAME_SEPARATOR); //what about C:\ ??? //if (!dirExists(basedir) || @@ -1635,20 +1635,20 @@ void verifyFiles(const AbstractPathRef& sourcePath, const AbstractPathRef& targe FILE_ATTRIBUTE_NORMAL, //_In_ DWORD dwFlagsAndAttributes, nullptr); //_In_opt_ HANDLE hTemplateFile if (fileHandle == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(*nativeTargetPath)), L"CreateFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(*nativeTargetPath)), L"CreateFile"); ZEN_ON_SCOPE_EXIT(::CloseHandle(fileHandle)); if (!::FlushFileBuffers(fileHandle)) - throwFileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(*nativeTargetPath)), L"FlushFileBuffers", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(*nativeTargetPath)), L"FlushFileBuffers"); #elif defined ZEN_LINUX || defined ZEN_MAC const int fileHandle = ::open(nativeTargetPath->c_str(), O_WRONLY); if (fileHandle == -1) - throwFileError(replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(*nativeTargetPath)), L"open", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(*nativeTargetPath)), L"open"); ZEN_ON_SCOPE_EXIT(::close(fileHandle)); if (::fsync(fileHandle) != 0) - throwFileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(*nativeTargetPath)), L"fsync", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(*nativeTargetPath)), L"fsync"); #endif } //close file handles! @@ -1763,9 +1763,9 @@ bool createBaseDirectory(BaseDirPair& baseDirObj, ProcessCallback& callback) //n temporaryNetworkDrop = true; //Is it possible we're catching a "false-positive" here, could FFS have created the directory indirectly after comparison? - // 1. deletion handling: recycler -> no, temp directory created only at first deletion - // 2. deletion handling: versioning -> " - // 3. log file creates containing folder -> no, log only created in batch mode, and only *before* comparison + // 1. deletion handling: recycler -> no, temp directory created only at first deletion + // 2. deletion handling: versioning -> " + // 3. log file creates containing folder -> no, log only created in batch mode, and only *before* comparison } }, callback); //throw X? return !errMsg && !temporaryNetworkDrop; @@ -1806,7 +1806,7 @@ void zen::synchronize(const TimeComp& timeStamp, if (runWithBackgroundPriority) try { - backgroundPrio = make_unique<ScheduleForBackgroundProcessing>(); //throw FileError + backgroundPrio = std::make_unique<ScheduleForBackgroundProcessing>(); //throw FileError } catch (const FileError& e) //not an error in this context { @@ -1817,7 +1817,7 @@ void zen::synchronize(const TimeComp& timeStamp, std::unique_ptr<PreventStandby> noStandby; try { - noStandby = make_unique<PreventStandby>(); //throw FileError + noStandby = std::make_unique<PreventStandby>(); //throw FileError } catch (const FileError& e) //not an error in this context { @@ -2129,7 +2129,7 @@ void zen::synchronize(const TimeComp& timeStamp, //shadow copy buffer: per sync-instance, not folder pair std::unique_ptr<shadow::ShadowCopy> shadowCopyHandler; if (copyLockedFiles) - shadowCopyHandler = make_unique<shadow::ShadowCopy>(); + shadowCopyHandler = std::make_unique<shadow::ShadowCopy>(); #endif try diff --git a/FreeFileSync/Source/ui/batch_config.cpp b/FreeFileSync/Source/ui/batch_config.cpp index 85f4564f..85d4d7c1 100644 --- a/FreeFileSync/Source/ui/batch_config.cpp +++ b/FreeFileSync/Source/ui/batch_config.cpp @@ -24,13 +24,6 @@ using namespace xmlAccess; namespace { -enum ButtonPressed -{ - BUTTON_CANCEL, - BUTTON_SAVE_AS -}; - - class BatchDialog : public BatchDlgGenerated { public: @@ -40,8 +33,8 @@ public: size_t onCompletionHistoryMax); private: - void OnClose (wxCloseEvent& event) override { EndModal(BUTTON_CANCEL); } - void OnCancel (wxCommandEvent& event) override { EndModal(BUTTON_CANCEL); } + void OnClose (wxCloseEvent& event) override { EndModal(ReturnBatchConfig::BUTTON_CANCEL); } + void OnCancel (wxCommandEvent& event) override { EndModal(ReturnBatchConfig::BUTTON_CANCEL); } void OnSaveBatchJob(wxCommandEvent& event) override; void OnErrorPopup (wxCommandEvent& event) override { localBatchCfg.handleError = ON_ERROR_POPUP; updateGui(); } void OnErrorIgnore (wxCommandEvent& event) override { localBatchCfg.handleError = ON_ERROR_IGNORE; updateGui(); } @@ -86,7 +79,7 @@ BatchDialog::BatchDialog(wxWindow* parent, m_bitmapBatchJob->SetBitmap(getResourceImage(L"batch")); - logfileDir = make_unique<FolderSelector>(*m_panelLogfile, *m_buttonSelectLogFolder, *m_bpButtonSelectAltLogFolder, *m_logFolderPath, nullptr /*staticText*/, nullptr /*wxWindow*/); + logfileDir = std::make_unique<FolderSelector>(*m_panelLogfile, *m_buttonSelectLogFolder, *m_bpButtonSelectAltLogFolder, *m_logFolderPath, nullptr /*staticText*/, nullptr /*wxWindow*/); setConfig(batchCfg); @@ -169,16 +162,16 @@ void BatchDialog::OnSaveBatchJob(wxCommandEvent& event) batchCfgOutRef = getConfig(); m_comboBoxOnCompletion->addItemHistory(); //a good place to commit current "on completion" history item onCompletionHistoryOut = m_comboBoxOnCompletion->getHistory(); - EndModal(BUTTON_SAVE_AS); + EndModal(ReturnBatchConfig::BUTTON_SAVE_AS); } } -bool zen::customizeBatchConfig(wxWindow* parent, - xmlAccess::XmlBatchConfig& batchCfg, //in/out - std::vector<Zstring>& onCompletionHistory, - size_t onCompletionHistoryMax) +ReturnBatchConfig::ButtonPressed zen::customizeBatchConfig(wxWindow* parent, + xmlAccess::XmlBatchConfig& batchCfg, //in/out + std::vector<Zstring>& onCompletionHistory, + size_t onCompletionHistoryMax) { BatchDialog batchDlg(parent, batchCfg, onCompletionHistory, onCompletionHistoryMax); - return static_cast<ButtonPressed>(batchDlg.ShowModal()) == BUTTON_SAVE_AS; + return static_cast<ReturnBatchConfig::ButtonPressed>(batchDlg.ShowModal()); } diff --git a/FreeFileSync/Source/ui/batch_config.h b/FreeFileSync/Source/ui/batch_config.h index 2e85d8de..ab3064ef 100644 --- a/FreeFileSync/Source/ui/batch_config.h +++ b/FreeFileSync/Source/ui/batch_config.h @@ -13,11 +13,21 @@ namespace zen { +struct ReturnBatchConfig +{ + enum ButtonPressed + { + BUTTON_CANCEL, + BUTTON_SAVE_AS + }; +}; + + //show and let user customize batch settings (without saving) -bool customizeBatchConfig(wxWindow* parent, //return "false" if aborted, "true" on "do save" - xmlAccess::XmlBatchConfig& batchCfg, //in/out - std::vector<Zstring>& onCompletionHistory, - size_t onCompletionHistoryMax); +ReturnBatchConfig::ButtonPressed customizeBatchConfig(wxWindow* parent, + xmlAccess::XmlBatchConfig& batchCfg, //in/out + std::vector<Zstring>& onCompletionHistory, + size_t onCompletionHistoryMax); } #endif // BATCHCONFIG_H_INCLUDED diff --git a/FreeFileSync/Source/ui/batch_status_handler.cpp b/FreeFileSync/Source/ui/batch_status_handler.cpp index a58da82e..90b3b627 100644 --- a/FreeFileSync/Source/ui/batch_status_handler.cpp +++ b/FreeFileSync/Source/ui/batch_status_handler.cpp @@ -70,16 +70,16 @@ struct LogTraverserCallback: public ABF::TraverserCallback void onFile(const FileInfo& fi) override { - if (pathStartsWith(fi.shortName, prefix_) && pathEndsWith(fi.shortName, Zstr(".log"))) - logFileNames_.push_back(fi.shortName); + if (pathStartsWith(fi.itemName, prefix_) && pathEndsWith(fi.itemName, Zstr(".log"))) + logFileNames_.push_back(fi.itemName); if (onUpdateStatus_) onUpdateStatus_(); } std::unique_ptr<TraverserCallback> onDir (const DirInfo& di) override { return nullptr; } HandleLink onSymlink(const SymlinkInfo& si) override { return TraverserCallback::LINK_SKIP; } - HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override { assert(false); return ON_ERROR_IGNORE; } //errors are not critical in this context - HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zchar* shortName) override { assert(false); return ON_ERROR_IGNORE; } // + HandleError reportDirError (const std::wstring& msg, size_t retryNumber) override { assert(false); return ON_ERROR_IGNORE; } //errors are not critical in this context + HandleError reportItemError(const std::wstring& msg, size_t retryNumber, const Zstring& itemName) override { assert(false); return ON_ERROR_IGNORE; } // private: std::vector<Zstring>& logFileNames_; //out @@ -145,7 +145,7 @@ BatchStatusHandler::BatchStatusHandler(bool showProgress, progressDlg(createProgressDialog(*this, [this] { this->onProgressDialogTerminate(); }, *this, nullptr, showProgress, jobName, onCompletion, onCompletionHistory)), jobName_(jobName), timeStamp_(timeStamp), - startTime_(wxGetUTCTimeMillis().GetValue()), + startTime_(std::time(nullptr)), logFolderPathPhrase_(logFolderPathPhrase) { //ATTENTION: "progressDlg" is an unmanaged resource!!! However, at this point we already consider construction complete! => @@ -154,7 +154,7 @@ BatchStatusHandler::BatchStatusHandler(bool showProgress, //... //if (logFile) - // ::wxSetEnv(L"logfile", utfCvrtTo<wxString>(logFile->getFilename())); + // ::wxSetEnv(L"logfile", utfCvrtTo<wxString>(logFile->getFilename())); constructorGuard.dismiss(); } @@ -243,7 +243,7 @@ BatchStatusHandler::~BatchStatusHandler() finalStatusMsg, getObjectsCurrent(PHASE_SYNCHRONIZING), getDataCurrent(PHASE_SYNCHRONIZING), getObjectsTotal (PHASE_SYNCHRONIZING), getDataTotal (PHASE_SYNCHRONIZING), - (wxGetUTCTimeMillis().GetValue() - startTime_) / 1000 + std::time(nullptr) - startTime_ }; //----------------- write results into user-specified logfile ------------------------ diff --git a/FreeFileSync/Source/ui/batch_status_handler.h b/FreeFileSync/Source/ui/batch_status_handler.h index b2ac7227..df1adc36 100644 --- a/FreeFileSync/Source/ui/batch_status_handler.h +++ b/FreeFileSync/Source/ui/batch_status_handler.h @@ -69,7 +69,7 @@ private: const std::wstring jobName_; const zen::TimeComp timeStamp_; - const int64_t startTime_; //don't use wxStopWatch: may overflow after a few days due to ::QueryPerformanceCounter() + const time_t startTime_; //don't use wxStopWatch: may overflow after a few days due to ::QueryPerformanceCounter() const Zstring logFolderPathPhrase_; }; diff --git a/FreeFileSync/Source/ui/custom_grid.cpp b/FreeFileSync/Source/ui/custom_grid.cpp index 11de7272..060446bd 100644 --- a/FreeFileSync/Source/ui/custom_grid.cpp +++ b/FreeFileSync/Source/ui/custom_grid.cpp @@ -146,7 +146,7 @@ struct IconManager //fileIcon (IconBuffer::genericFileIcon(sz)), dirIcon (IconBuffer::genericDirIcon (sz)), linkOverlayIcon(IconBuffer::linkOverlayIcon(sz)), - iconUpdater(make_unique<IconUpdater>(provLeft, provRight, iconBuffer)) {} + iconUpdater(std::make_unique<IconUpdater>(provLeft, provRight, iconBuffer)) {} void startIconUpdater(); IconBuffer& refIconBuffer() { return iconBuffer; } @@ -535,7 +535,7 @@ private: //see repaint behavior of ::ScrollWindow() function! fileIcon = iconMgr_->refIconBuffer().getIconByExtension(ii.fsObj->template getItemName<side>()); //better than nothing } - break; //return iconMgr_->getGenericFileIcon(); + break; //return iconMgr_->getGenericFileIcon(); case IconInfo::EMPTY: break; @@ -568,7 +568,7 @@ private: std::unique_ptr<wxDCTextColourChanger> dummy3; if (getRowDisplayType(row) != DISP_TYPE_NORMAL) - dummy3 = make_unique<wxDCTextColourChanger>(dc, *wxBLACK); //accessibility: always set both foreground AND background colors! + dummy3 = std::make_unique<wxDCTextColourChanger>(dc, *wxBLACK); //accessibility: always set both foreground AND background colors! //draw text if (static_cast<ColumnTypeRim>(colType) == COL_TYPE_SIZE && refGrid().GetLayoutDirection() != wxLayout_RightToLeft) @@ -831,7 +831,7 @@ public: if (row < refGrid().getRowCount()) { refGrid().clearSelection(DENY_GRID_EVENT); //don't emit event, prevent recursion! - dragSelection = make_unique<std::pair<size_t, BlockPosition>>(row, mousePosToBlock(clientPos, row, static_cast<ColumnTypeMiddle>(colType))); + dragSelection = std::make_unique<std::pair<size_t, BlockPosition>>(row, mousePosToBlock(clientPos, row, static_cast<ColumnTypeMiddle>(colType))); toolTip.hide(); //handle custom tooltip } } @@ -905,7 +905,7 @@ public: { if (highlight) refreshHighlight(highlight->row_); //refresh old highlight - highlight = make_unique<MouseHighlight>(row, mousePosToBlock(clientPos, row, static_cast<ColumnTypeMiddle>(*ct))); + highlight = std::make_unique<MouseHighlight>(row, mousePosToBlock(clientPos, row, static_cast<ColumnTypeMiddle>(*ct))); refreshHighlight(highlight->row_); diff --git a/FreeFileSync/Source/ui/folder_pair.h b/FreeFileSync/Source/ui/folder_pair.h index 787e049c..721af19e 100644 --- a/FreeFileSync/Source/ui/folder_pair.h +++ b/FreeFileSync/Source/ui/folder_pair.h @@ -131,7 +131,7 @@ private: std::unique_ptr<FilterConfig>& filterCfgOnClipboard = getFilterCfgOnClipboardRef(); - auto copyFilter = [&] { filterCfgOnClipboard = make_unique<FilterConfig>(this->localFilter); }; + auto copyFilter = [&] { filterCfgOnClipboard = std::make_unique<FilterConfig>(this->localFilter); }; auto pasteFilter = [&] { if (filterCfgOnClipboard) diff --git a/FreeFileSync/Source/ui/folder_selector.cpp b/FreeFileSync/Source/ui/folder_selector.cpp index 679b32b0..2c5e94d3 100644 --- a/FreeFileSync/Source/ui/folder_selector.cpp +++ b/FreeFileSync/Source/ui/folder_selector.cpp @@ -157,7 +157,7 @@ void FolderSelector::onMouseWheel(wxMouseEvent& event) evtHandler->AddPendingEvent(event); break; } - // event.Skip(); + // event.Skip(); } diff --git a/FreeFileSync/Source/ui/folder_selector.h b/FreeFileSync/Source/ui/folder_selector.h index e21044ca..961acbe8 100644 --- a/FreeFileSync/Source/ui/folder_selector.h +++ b/FreeFileSync/Source/ui/folder_selector.h @@ -19,13 +19,13 @@ namespace zen //handle drag and drop, tooltip, label and manual input, coordinating a wxWindow, wxButton, and wxComboBox/wxTextCtrl /* Reasons NOT to use wxDirPickerCtrl, but wxButton instead: - - Crash on GTK 2: http://favapps.wordpress.com/2012/06/11/freefilesync-crash-in-linux-when-syncing-solved/ - - still uses outdated ::SHBrowseForFolder() (even on Windows 7) - - selection dialog remembers size, but NOT position => if user enlarges window, the next time he opens the dialog it may leap out of visible screen - - hard-codes "Browse" button label + - Crash on GTK 2: http://favapps.wordpress.com/2012/06/11/freefilesync-crash-in-linux-when-syncing-solved/ + - still uses outdated ::SHBrowseForFolder() (even on Windows 7) + - selection dialog remembers size, but NOT position => if user enlarges window, the next time he opens the dialog it may leap out of visible screen + - hard-codes "Browse" button label */ -extern const wxEventType EVENT_ON_FOLDER_SELECTED; //directory is changed by the user (except manual type-in) +extern const wxEventType EVENT_ON_FOLDER_SELECTED; //directory is changed by the user (except manual type-in) extern const wxEventType EVENT_ON_FOLDER_MANUAL_EDIT; //manual type-in //example: wnd.Connect(EVENT_ON_FOLDER_SELECTED, wxCommandEventHandler(MyDlg::OnDirSelected), nullptr, this); diff --git a/FreeFileSync/Source/ui/grid_view.cpp b/FreeFileSync/Source/ui/grid_view.cpp index c57e718b..db7f64e9 100644 --- a/FreeFileSync/Source/ui/grid_view.cpp +++ b/FreeFileSync/Source/ui/grid_view.cpp @@ -522,7 +522,7 @@ void GridView::sortView(ColumnTypeRim type, bool onLeft, bool ascending) viewRef.clear(); rowPositions.clear(); rowPositionsFirstChild.clear(); - currentSort = make_unique<SortInfo>(type, onLeft, ascending); + currentSort = std::make_unique<SortInfo>(type, onLeft, ascending); switch (type) { diff --git a/FreeFileSync/Source/ui/gui_generated.cpp b/FreeFileSync/Source/ui/gui_generated.cpp index c8a70413..1f912c77 100644 --- a/FreeFileSync/Source/ui/gui_generated.cpp +++ b/FreeFileSync/Source/ui/gui_generated.cpp @@ -19,978 +19,978 @@ 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_menuFile->AppendSeparator(); - - 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(); - - wxMenuItem* m_menuItem4; - m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItem4 ); - - m_menubar1->Append( m_menuFile, _("&File") ); - - m_menu4 = new wxMenu(); - m_menuItemCompare = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("Start &comparison") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL ); - m_menu4->Append( m_menuItemCompare ); - - m_menu4->AppendSeparator(); - - m_menuItemCompSettings = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("C&omparison settings") ) + wxT('\t') + wxT("F6"), wxEmptyString, wxITEM_NORMAL ); - m_menu4->Append( m_menuItemCompSettings ); - - m_menuItemFilter = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("&Filter settings") ) + wxT('\t') + wxT("F7"), wxEmptyString, wxITEM_NORMAL ); - m_menu4->Append( m_menuItemFilter ); - - m_menuItemSyncSettings = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("S&ynchronization settings") ) + wxT('\t') + wxT("F8"), wxEmptyString, wxITEM_NORMAL ); - m_menu4->Append( m_menuItemSyncSettings ); - - m_menu4->AppendSeparator(); - - m_menuItemSynchronize = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("Start &synchronization") ) + wxT('\t') + wxT("F9"), wxEmptyString, wxITEM_NORMAL ); - m_menu4->Append( m_menuItemSynchronize ); - - m_menubar1->Append( m_menu4, _("&Actions") ); - - m_menuTools = new wxMenu(); - m_menuItemOptions = new wxMenuItem( m_menuTools, wxID_PREFERENCES, wxString( _("&Preferences") ) + wxT('\t') + wxT("Ctrl+,"), 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, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1791; - bSizer1791 = new wxBoxSizer( wxVERTICAL ); - - bSizerTopButtons = new wxBoxSizer( wxHORIZONTAL ); - - 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 ); - - 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( 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 ); - - 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, 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_folderPathLeft = new FolderHistoryBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer182->Add( m_folderPathLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectFolderLeft = new wxButton( m_panelTopLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectFolderLeft->SetToolTip( _("Select a folder") ); - - bSizer182->Add( m_buttonSelectFolderLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltFolderLeft = new wxBitmapButton( m_panelTopLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltFolderLeft->SetToolTip( _("Select SFTP folder") ); - - bSizer182->Add( m_bpButtonSelectAltFolderLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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_folderPathRight = new FolderHistoryBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer179->Add( m_folderPathRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectFolderRight = new wxButton( m_panelTopRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectFolderRight->SetToolTip( _("Select a folder") ); - - bSizer179->Add( m_buttonSelectFolderRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltFolderRight = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltFolderRight->SetToolTip( _("Select SFTP folder") ); - - bSizer179->Add( m_bpButtonSelectAltFolderRight, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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( _("dummy") ); - - 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( _("dummy") ); - - 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 updated") ); - - 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 updated") ); - - 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 updated") ); - - 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 updated") ); - - 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_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); - this->Connect( m_menuItemCompare->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); - this->Connect( m_menuItemCompSettings->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ) ); - this->Connect( m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ) ); - this->Connect( m_menuItemSyncSettings->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ) ); - this->Connect( m_menuItemSynchronize->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); - 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_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); - m_bpButtonCmpConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnCompSettingsContext ), NULL, this ); - m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), 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::OnTopFolderPairAdd ), NULL, this ); - m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopFolderPairRemove ), NULL, this ); - m_bpButtonSwapSides->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); - m_bpButtonAltCompCfg->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopLocalCompCfg ), NULL, this ); - m_bpButtonLocalFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopLocalFilterCfg ), NULL, this ); - m_bpButtonAltSyncCfg->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopLocalSyncCfg ), 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_KEY_DOWN, 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_menuFile->AppendSeparator(); + + 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(); + + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("E&xit") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem4 ); + + m_menubar1->Append( m_menuFile, _("&File") ); + + m_menu4 = new wxMenu(); + m_menuItemCompare = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("Start &comparison") ) + wxT('\t') + wxT("F5"), wxEmptyString, wxITEM_NORMAL ); + m_menu4->Append( m_menuItemCompare ); + + m_menu4->AppendSeparator(); + + m_menuItemCompSettings = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("C&omparison settings") ) + wxT('\t') + wxT("F6"), wxEmptyString, wxITEM_NORMAL ); + m_menu4->Append( m_menuItemCompSettings ); + + m_menuItemFilter = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("&Filter settings") ) + wxT('\t') + wxT("F7"), wxEmptyString, wxITEM_NORMAL ); + m_menu4->Append( m_menuItemFilter ); + + m_menuItemSyncSettings = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("S&ynchronization settings") ) + wxT('\t') + wxT("F8"), wxEmptyString, wxITEM_NORMAL ); + m_menu4->Append( m_menuItemSyncSettings ); + + m_menu4->AppendSeparator(); + + m_menuItemSynchronize = new wxMenuItem( m_menu4, wxID_ANY, wxString( _("Start &synchronization") ) + wxT('\t') + wxT("F9"), wxEmptyString, wxITEM_NORMAL ); + m_menu4->Append( m_menuItemSynchronize ); + + m_menubar1->Append( m_menu4, _("&Actions") ); + + m_menuTools = new wxMenu(); + m_menuItemOptions = new wxMenuItem( m_menuTools, wxID_PREFERENCES, wxString( _("&Preferences") ) + wxT('\t') + wxT("Ctrl+,"), 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, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1791; + bSizer1791 = new wxBoxSizer( wxVERTICAL ); + + bSizerTopButtons = new wxBoxSizer( wxHORIZONTAL ); + + 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 ); + + 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( 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 ); + + 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, 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_folderPathLeft = new FolderHistoryBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer182->Add( m_folderPathLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectFolderLeft = new wxButton( m_panelTopLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectFolderLeft->SetToolTip( _("Select a folder") ); + + bSizer182->Add( m_buttonSelectFolderLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltFolderLeft = new wxBitmapButton( m_panelTopLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltFolderLeft->SetToolTip( _("Select SFTP folder") ); + + bSizer182->Add( m_bpButtonSelectAltFolderLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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_folderPathRight = new FolderHistoryBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer179->Add( m_folderPathRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectFolderRight = new wxButton( m_panelTopRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectFolderRight->SetToolTip( _("Select a folder") ); + + bSizer179->Add( m_buttonSelectFolderRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltFolderRight = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltFolderRight->SetToolTip( _("Select SFTP folder") ); + + bSizer179->Add( m_bpButtonSelectAltFolderRight, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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( _("dummy") ); + + 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( _("dummy") ); + + 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 updated") ); + + 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 updated") ); + + 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 updated") ); + + 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 updated") ); + + 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_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); + this->Connect( m_menuItemCompare->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); + this->Connect( m_menuItemCompSettings->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ) ); + this->Connect( m_menuItemFilter->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ) ); + this->Connect( m_menuItemSyncSettings->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ) ); + this->Connect( m_menuItemSynchronize->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); + 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_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_RIGHT_DOWN, wxMouseEventHandler( MainDialogGenerated::OnCompSettingsContext ), NULL, this ); + m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), 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::OnTopFolderPairAdd ), NULL, this ); + m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopFolderPairRemove ), NULL, this ); + m_bpButtonSwapSides->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); + m_bpButtonAltCompCfg->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopLocalCompCfg ), NULL, this ); + m_bpButtonLocalFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopLocalFilterCfg ), NULL, this ); + m_bpButtonAltSyncCfg->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnTopLocalSyncCfg ), 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_KEY_DOWN, 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() @@ -999,844 +999,844 @@ 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 ); - - wxBoxSizer* bSizer190; - bSizer190 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer1911; - bSizer1911 = new wxBoxSizer( wxVERTICAL ); - - m_staticTextFolderPairLabel = new wxStaticText( this, wxID_ANY, _("Folder pair:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextFolderPairLabel->Wrap( -1 ); - bSizer1911->Add( m_staticTextFolderPairLabel, 0, wxALL, 5 ); - - m_listBoxFolderPair = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); - bSizer1911->Add( m_listBoxFolderPair, 1, 0, 5 ); - - - bSizer190->Add( bSizer1911, 0, wxEXPAND|wxLEFT, 5 ); - - 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_checkBoxSymlinksInclude = new wxCheckBox( m_panelComparisonSettings, wxID_ANY, _("Include &symbolic links:"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1721->Add( m_checkBoxSymlinksInclude, 0, wxALL, 5 ); - - wxBoxSizer* bSizer176; - bSizer176 = new wxBoxSizer( wxVERTICAL ); - - m_radioBtnSymlinksFollow = new wxRadioButton( m_panelComparisonSettings, wxID_ANY, _("&Follow"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnSymlinksFollow->SetValue( true ); - bSizer176->Add( m_radioBtnSymlinksFollow, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_radioBtnSymlinksDirect = new wxRadioButton( m_panelComparisonSettings, wxID_ANY, _("&Direct"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer176->Add( m_radioBtnSymlinksDirect, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer1721->Add( bSizer176, 0, wxEXPAND|wxLEFT, 18 ); - - m_hyperlink24 = new wxHyperlinkCtrl( m_panelComparisonSettings, wxID_ANY, _("More information"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - bSizer1721->Add( m_hyperlink24, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - bSizer1734->Add( bSizer1721, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - 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"), 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_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( 590 ); - bSizer280->Add( m_staticText44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - - bSizer280->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticline46 = new wxStaticLine( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer280->Add( m_staticline46, 0, wxEXPAND, 5 ); - - m_buttonClear = new wxButton( m_panelFilterSettingsHolder, wxID_DEFAULT, _("C&lear"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer280->Add( m_buttonClear, 0, wxALL|wxALIGN_CENTER_VERTICAL, 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( _("- Not supported by all file systems\n- Requires and creates database files\n- Detection not available for first sync") ); - - 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 ); - - wxBoxSizer* bSizer180; - bSizer180 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText87 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Delete files:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText87->Wrap( -1 ); - bSizer180->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); - - m_radioBtnPermanent = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Permanent"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_radioBtnPermanent->SetToolTip( _("Delete or overwrite files permanently") ); - - bSizer180->Add( m_radioBtnPermanent, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_radioBtnRecycler = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Recycle bin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnRecycler->SetToolTip( _("Back up deleted and overwritten files in the recycle bin") ); - - bSizer180->Add( m_radioBtnRecycler, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_radioBtnVersioning = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Versioning"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnVersioning->SetToolTip( _("Move files to a user-defined folder") ); - - bSizer180->Add( m_radioBtnVersioning, 0, wxALL, 5 ); - - - bSizer184->Add( bSizer180, 0, 0, 5 ); - - bSizerVersioning = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonDeletionType = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); - bSizerVersioning->Add( m_bpButtonDeletionType, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - 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_versioningFolderPath = new FolderHistoryBox( m_panelVersioning, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer156->Add( m_versioningFolderPath, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectVersioningFolder = new wxButton( m_panelVersioning, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectVersioningFolder->SetToolTip( _("Select a folder") ); - - bSizer156->Add( m_buttonSelectVersioningFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltFolder = new wxBitmapButton( m_panelVersioning, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltFolder->SetToolTip( _("Select SFTP folder") ); - - bSizer156->Add( m_bpButtonSelectAltFolder, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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|wxLEFT, 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_radioBtnIgnoreErrors = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_radioBtnIgnoreErrors->SetToolTip( _("Hide all error and warning messages") ); - - bSizer175->Add( m_radioBtnIgnoreErrors, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_radioBtnPopupOnErrors = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnPopupOnErrors->SetToolTip( _("Show pop-up on errors or warnings") ); - - bSizer175->Add( m_radioBtnPopupOnErrors, 0, wxALL, 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 ); - - bSizer190->Add( m_notebook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); - - - bSizer7->Add( bSizer190, 1, 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 ); - - - 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_listBoxFolderPair->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnSelectFolderPair ), NULL, this ); - 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_checkBoxSymlinksInclude->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeCompOption ), 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_buttonClear->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_radioBtnPermanent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionPermanent ), NULL, this ); - m_radioBtnRecycler->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionRecycler ), NULL, this ); - m_radioBtnVersioning->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionVersioning ), NULL, this ); - m_bpButtonDeletionType->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleDeletionType ), 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_radioBtnIgnoreErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnErrorIgnore ), NULL, this ); - m_radioBtnPopupOnErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 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 ); + + wxBoxSizer* bSizer190; + bSizer190 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer1911; + bSizer1911 = new wxBoxSizer( wxVERTICAL ); + + m_staticTextFolderPairLabel = new wxStaticText( this, wxID_ANY, _("Folder pair:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextFolderPairLabel->Wrap( -1 ); + bSizer1911->Add( m_staticTextFolderPairLabel, 0, wxALL, 5 ); + + m_listBoxFolderPair = new wxListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB ); + bSizer1911->Add( m_listBoxFolderPair, 1, 0, 5 ); + + + bSizer190->Add( bSizer1911, 0, wxEXPAND|wxLEFT, 5 ); + + 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_checkBoxSymlinksInclude = new wxCheckBox( m_panelComparisonSettings, wxID_ANY, _("Include &symbolic links:"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1721->Add( m_checkBoxSymlinksInclude, 0, wxALL, 5 ); + + wxBoxSizer* bSizer176; + bSizer176 = new wxBoxSizer( wxVERTICAL ); + + m_radioBtnSymlinksFollow = new wxRadioButton( m_panelComparisonSettings, wxID_ANY, _("&Follow"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnSymlinksFollow->SetValue( true ); + bSizer176->Add( m_radioBtnSymlinksFollow, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_radioBtnSymlinksDirect = new wxRadioButton( m_panelComparisonSettings, wxID_ANY, _("&Direct"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer176->Add( m_radioBtnSymlinksDirect, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer1721->Add( bSizer176, 0, wxEXPAND|wxLEFT, 18 ); + + m_hyperlink24 = new wxHyperlinkCtrl( m_panelComparisonSettings, wxID_ANY, _("More information"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + bSizer1721->Add( m_hyperlink24, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + bSizer1734->Add( bSizer1721, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + 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"), 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_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( 590 ); + bSizer280->Add( m_staticText44, 0, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + + bSizer280->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticline46 = new wxStaticLine( m_panelFilterSettingsHolder, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer280->Add( m_staticline46, 0, wxEXPAND, 5 ); + + m_buttonClear = new wxButton( m_panelFilterSettingsHolder, wxID_DEFAULT, _("C&lear"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer280->Add( m_buttonClear, 0, wxALL|wxALIGN_CENTER_VERTICAL, 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( _("- Not supported by all file systems\n- Requires and creates database files\n- Detection not available for first sync") ); + + 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 ); + + wxBoxSizer* bSizer180; + bSizer180 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText87 = new wxStaticText( m_panelSyncSettings, wxID_ANY, _("Delete files:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText87->Wrap( -1 ); + bSizer180->Add( m_staticText87, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + + m_radioBtnPermanent = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Permanent"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_radioBtnPermanent->SetToolTip( _("Delete or overwrite files permanently") ); + + bSizer180->Add( m_radioBtnPermanent, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_radioBtnRecycler = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Recycle bin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnRecycler->SetToolTip( _("Back up deleted and overwritten files in the recycle bin") ); + + bSizer180->Add( m_radioBtnRecycler, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_radioBtnVersioning = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Versioning"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnVersioning->SetToolTip( _("Move files to a user-defined folder") ); + + bSizer180->Add( m_radioBtnVersioning, 0, wxALL, 5 ); + + + bSizer184->Add( bSizer180, 0, 0, 5 ); + + bSizerVersioning = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonDeletionType = new wxBitmapButton( m_panelSyncSettings, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 46,46 ), wxBU_AUTODRAW ); + bSizerVersioning->Add( m_bpButtonDeletionType, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + 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_versioningFolderPath = new FolderHistoryBox( m_panelVersioning, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer156->Add( m_versioningFolderPath, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectVersioningFolder = new wxButton( m_panelVersioning, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectVersioningFolder->SetToolTip( _("Select a folder") ); + + bSizer156->Add( m_buttonSelectVersioningFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltFolder = new wxBitmapButton( m_panelVersioning, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltFolder->SetToolTip( _("Select SFTP folder") ); + + bSizer156->Add( m_bpButtonSelectAltFolder, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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|wxLEFT, 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_radioBtnIgnoreErrors = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_radioBtnIgnoreErrors->SetToolTip( _("Hide all error and warning messages") ); + + bSizer175->Add( m_radioBtnIgnoreErrors, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_radioBtnPopupOnErrors = new wxRadioButton( m_panelSyncSettings, wxID_ANY, _("&Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnPopupOnErrors->SetToolTip( _("Show pop-up on errors or warnings") ); + + bSizer175->Add( m_radioBtnPopupOnErrors, 0, wxALL, 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 ); + + bSizer190->Add( m_notebook, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 ); + + + bSizer7->Add( bSizer190, 1, 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 ); + + + 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_listBoxFolderPair->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnSelectFolderPair ), NULL, this ); + 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_checkBoxSymlinksInclude->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnChangeCompOption ), 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_buttonClear->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_radioBtnPermanent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionPermanent ), NULL, this ); + m_radioBtnRecycler->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionRecycler ), NULL, this ); + m_radioBtnVersioning->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnDeletionVersioning ), NULL, this ); + m_bpButtonDeletionType->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ConfigDlgGenerated::OnToggleDeletionType ), 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_radioBtnIgnoreErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( ConfigDlgGenerated::OnErrorIgnore ), NULL, this ); + m_radioBtnPopupOnErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 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() @@ -1845,98 +1845,98 @@ ConfigDlgGenerated::~ConfigDlgGenerated() 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_bpButtonFolderPairOptions = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); - m_bpButtonFolderPairOptions->SetToolTip( _("Arrange folder pair") ); - - bSizer134->Add( m_bpButtonFolderPairOptions, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - 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_folderPathLeft = new FolderHistoryBox( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer134->Add( m_folderPathLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectFolderLeft = new wxButton( m_panelLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectFolderLeft->SetToolTip( _("Select a folder") ); - - bSizer134->Add( m_buttonSelectFolderLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltFolderLeft = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltFolderLeft->SetToolTip( _("Select SFTP folder") ); - - bSizer134->Add( m_bpButtonSelectAltFolderLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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_folderPathRight = new FolderHistoryBox( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer135->Add( m_folderPathRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectFolderRight = new wxButton( m_panelRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectFolderRight->SetToolTip( _("Select a folder") ); - - bSizer135->Add( m_buttonSelectFolderRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltFolderRight = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltFolderRight->SetToolTip( _("Select SFTP folder") ); - - bSizer135->Add( m_bpButtonSelectAltFolderRight, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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_bpButtonFolderPairOptions = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 25,25 ), wxBU_AUTODRAW ); + m_bpButtonFolderPairOptions->SetToolTip( _("Arrange folder pair") ); + + bSizer134->Add( m_bpButtonFolderPairOptions, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + 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_folderPathLeft = new FolderHistoryBox( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer134->Add( m_folderPathLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectFolderLeft = new wxButton( m_panelLeft, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectFolderLeft->SetToolTip( _("Select a folder") ); + + bSizer134->Add( m_buttonSelectFolderLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltFolderLeft = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltFolderLeft->SetToolTip( _("Select SFTP folder") ); + + bSizer134->Add( m_bpButtonSelectAltFolderLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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_folderPathRight = new FolderHistoryBox( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer135->Add( m_folderPathRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectFolderRight = new wxButton( m_panelRight, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectFolderRight->SetToolTip( _("Select a folder") ); + + bSizer135->Add( m_buttonSelectFolderRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltFolderRight = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltFolderRight->SetToolTip( _("Select SFTP folder") ); + + bSizer135->Add( m_bpButtonSelectAltFolderRight, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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() @@ -1945,384 +1945,470 @@ FolderPairPanelGenerated::~FolderPairPanelGenerated() SftpSetupDlgGenerated::SftpSetupDlgGenerated( 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_bitmapSftp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer72->Add( m_bitmapSftp, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Enter your SFTP login details:"), 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, wxSize( -1,-1 ), wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline371, 0, wxEXPAND, 5 ); - - m_panel41 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panel41->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - - wxBoxSizer* bSizer185; - bSizer185 = new wxBoxSizer( wxHORIZONTAL ); - - wxFlexGridSizer* fgSizer16; - fgSizer16 = new wxFlexGridSizer( 0, 2, 0, 0 ); - fgSizer16->AddGrowableCol( 1 ); - fgSizer16->SetFlexibleDirection( wxBOTH ); - fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText12311 = new wxStaticText( m_panel41, wxID_ANY, _("Server name or IP address:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText12311->Wrap( -1 ); - fgSizer16->Add( m_staticText12311, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - wxBoxSizer* bSizer183; - bSizer183 = new wxBoxSizer( wxHORIZONTAL ); - - m_textCtrlServer = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 260,-1 ), 0 ); - bSizer183->Add( m_textCtrlServer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText1233 = new wxStaticText( m_panel41, wxID_ANY, _("Port:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1233->Wrap( -1 ); - bSizer183->Add( m_staticText1233, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_textCtrlPort = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), 0 ); - bSizer183->Add( m_textCtrlPort, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - fgSizer16->Add( bSizer183, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - fgSizer16->Add( 0, 0, 0, 0, 5 ); - - wxBoxSizer* bSizer181; - bSizer181 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText1381 = new wxStaticText( m_panel41, wxID_ANY, _("Examples:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1381->Wrap( -1 ); - m_staticText1381->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer181->Add( m_staticText1381, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxRIGHT, 5 ); - - m_staticText1382 = new wxStaticText( m_panel41, wxID_ANY, _("www.website.com"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1382->Wrap( -1 ); - m_staticText1382->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer181->Add( m_staticText1382, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_staticText138 = new wxStaticText( m_panel41, wxID_ANY, _("123.123.123"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText138->Wrap( -1 ); - m_staticText138->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - bSizer181->Add( m_staticText138, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - - fgSizer16->Add( bSizer181, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticText123 = new wxStaticText( m_panel41, wxID_ANY, _("User name:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText123->Wrap( -1 ); - fgSizer16->Add( m_staticText123, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_textCtrlUserName = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer16->Add( m_textCtrlUserName, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText1231 = new wxStaticText( m_panel41, wxID_ANY, _("Password:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1231->Wrap( -1 ); - fgSizer16->Add( m_staticText1231, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); - - wxBoxSizer* bSizer182; - bSizer182 = new wxBoxSizer( wxVERTICAL ); - - m_textCtrlPasswordVisible = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer182->Add( m_textCtrlPasswordVisible, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_textCtrlPasswordHidden = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD ); - bSizer182->Add( m_textCtrlPasswordHidden, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - - fgSizer16->Add( bSizer182, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - fgSizer16->Add( 0, 0, 0, 0, 5 ); - - m_checkBoxShowPassword = new wxCheckBox( m_panel41, wxID_ANY, _("&Show password"), wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer16->Add( m_checkBoxShowPassword, 0, wxEXPAND|wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText1232 = new wxStaticText( m_panel41, wxID_ANY, _("Directory on server:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1232->Wrap( -1 ); - fgSizer16->Add( m_staticText1232, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_textCtrlServerPath = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - fgSizer16->Add( m_textCtrlServerPath, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer185->Add( fgSizer16, 0, wxALL, 5 ); - - - m_panel41->SetSizer( bSizer185 ); - m_panel41->Layout(); - bSizer185->Fit( m_panel41 ); - bSizer134->Add( m_panel41, 1, wxEXPAND, 5 ); - - m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline12, 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, 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 ); - - - bSizer134->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); - - - this->SetSizer( bSizer134 ); - this->Layout(); - bSizer134->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SftpSetupDlgGenerated::OnClose ) ); - m_checkBoxShowPassword->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::OnToggleShowPassword ), NULL, this ); - m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::OnOkay ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::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_bitmapSftp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer72->Add( m_bitmapSftp, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Enter your SFTP login details:"), 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, wxSize( -1,-1 ), wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline371, 0, wxEXPAND, 5 ); + + m_panel41 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panel41->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer185; + bSizer185 = new wxBoxSizer( wxHORIZONTAL ); + + wxFlexGridSizer* fgSizer16; + fgSizer16 = new wxFlexGridSizer( 0, 2, 0, 0 ); + fgSizer16->AddGrowableCol( 1 ); + fgSizer16->SetFlexibleDirection( wxBOTH ); + fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText12311 = new wxStaticText( m_panel41, wxID_ANY, _("Server name or IP address:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText12311->Wrap( -1 ); + fgSizer16->Add( m_staticText12311, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxBoxSizer* bSizer183; + bSizer183 = new wxBoxSizer( wxHORIZONTAL ); + + m_textCtrlServer = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 260,-1 ), 0 ); + bSizer183->Add( m_textCtrlServer, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText1233 = new wxStaticText( m_panel41, wxID_ANY, _("Port:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1233->Wrap( -1 ); + bSizer183->Add( m_staticText1233, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_textCtrlPort = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 60,-1 ), 0 ); + bSizer183->Add( m_textCtrlPort, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + fgSizer16->Add( bSizer183, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + fgSizer16->Add( 0, 0, 0, 0, 5 ); + + wxBoxSizer* bSizer181; + bSizer181 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText1381 = new wxStaticText( m_panel41, wxID_ANY, _("Examples:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1381->Wrap( -1 ); + m_staticText1381->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer181->Add( m_staticText1381, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_RIGHT|wxBOTTOM|wxRIGHT, 5 ); + + m_staticText1382 = new wxStaticText( m_panel41, wxID_ANY, _("www.website.com"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1382->Wrap( -1 ); + m_staticText1382->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer181->Add( m_staticText1382, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_staticText138 = new wxStaticText( m_panel41, wxID_ANY, _("123.123.123"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText138->Wrap( -1 ); + m_staticText138->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + bSizer181->Add( m_staticText138, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + + fgSizer16->Add( bSizer181, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText123 = new wxStaticText( m_panel41, wxID_ANY, _("User name:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText123->Wrap( -1 ); + fgSizer16->Add( m_staticText123, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_textCtrlUserName = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer16->Add( m_textCtrlUserName, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText1231 = new wxStaticText( m_panel41, wxID_ANY, _("Password:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1231->Wrap( -1 ); + fgSizer16->Add( m_staticText1231, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + + wxBoxSizer* bSizer182; + bSizer182 = new wxBoxSizer( wxVERTICAL ); + + m_textCtrlPasswordVisible = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer182->Add( m_textCtrlPasswordVisible, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_textCtrlPasswordHidden = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PASSWORD ); + bSizer182->Add( m_textCtrlPasswordHidden, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + + fgSizer16->Add( bSizer182, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + + fgSizer16->Add( 0, 0, 0, 0, 5 ); + + m_checkBoxShowPassword = new wxCheckBox( m_panel41, wxID_ANY, _("&Show password"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer16->Add( m_checkBoxShowPassword, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticText1232 = new wxStaticText( m_panel41, wxID_ANY, _("Directory on server:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1232->Wrap( -1 ); + fgSizer16->Add( m_staticText1232, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + wxBoxSizer* bSizer206; + bSizer206 = new wxBoxSizer( wxHORIZONTAL ); + + m_textCtrlServerPath = new wxTextCtrl( m_panel41, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer206->Add( m_textCtrlServerPath, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectFolder = new wxButton( m_panel41, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectFolder->SetToolTip( _("Select a folder") ); + + bSizer206->Add( m_buttonSelectFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + fgSizer16->Add( bSizer206, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); + + + bSizer185->Add( fgSizer16, 1, wxALL, 5 ); + + + m_panel41->SetSizer( bSizer185 ); + m_panel41->Layout(); + bSizer185->Fit( m_panel41 ); + bSizer134->Add( m_panel41, 1, wxEXPAND, 5 ); + + m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline12, 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, 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 ); + + + bSizer134->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); + + + this->SetSizer( bSizer134 ); + this->Layout(); + bSizer134->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SftpSetupDlgGenerated::OnClose ) ); + m_checkBoxShowPassword->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::OnToggleShowPassword ), NULL, this ); + m_buttonSelectFolder->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::OnBrowseSftpFolder ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::OnOkay ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpSetupDlgGenerated::OnCancel ), NULL, this ); } SftpSetupDlgGenerated::~SftpSetupDlgGenerated() { } +SftpFolderPickerGenerated::SftpFolderPickerGenerated( 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_bitmapSftp = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer72->Add( m_bitmapSftp, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("Select a directory on the server:"), 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, wxSize( -1,-1 ), wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline371, 0, wxEXPAND, 5 ); + + m_panel41 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panel41->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + + wxBoxSizer* bSizer185; + bSizer185 = new wxBoxSizer( wxVERTICAL ); + + m_treeCtrlFileSystem = new wxTreeCtrl( m_panel41, wxID_ANY, wxDefaultPosition, wxSize( 350,400 ), wxTR_FULL_ROW_HIGHLIGHT|wxTR_HAS_BUTTONS|wxTR_LINES_AT_ROOT|wxTR_NO_LINES|wxNO_BORDER ); + bSizer185->Add( m_treeCtrlFileSystem, 1, wxEXPAND, 5 ); + + + m_panel41->SetSizer( bSizer185 ); + m_panel41->Layout(); + bSizer185->Fit( m_panel41 ); + bSizer134->Add( m_panel41, 1, wxEXPAND, 5 ); + + m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline12, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonOkay = new wxButton( this, wxID_OK, _("Select Folder"), 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, 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 ); + + + bSizer134->Add( bSizerStdButtons, 0, wxALIGN_RIGHT, 5 ); + + + this->SetSizer( bSizer134 ); + this->Layout(); + bSizer134->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SftpFolderPickerGenerated::OnClose ) ); + m_treeCtrlFileSystem->Connect( wxEVT_COMMAND_TREE_ITEM_EXPANDING, wxTreeEventHandler( SftpFolderPickerGenerated::OnExpandNode ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpFolderPickerGenerated::OnOkay ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SftpFolderPickerGenerated::OnCancel ), NULL, this ); +} + +SftpFolderPickerGenerated::~SftpFolderPickerGenerated() +{ +} + 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 updated") ); - - 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 updated") ); - - 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 updated") ); - - 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 updated") ); - - 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 ); + 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 updated") ); + + 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 updated") ); + + 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 updated") ); + + 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 updated") ); + + 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() @@ -2331,110 +2417,110 @@ SyncConfirmationDlgGenerated::~SyncConfirmationDlgGenerated() 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() @@ -2443,320 +2529,320 @@ 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 ); - - wxBoxSizer* bSizer175; - bSizer175 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapGraphKeyBytes = new wxStaticBitmap( m_panelProgress, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer175->Add( m_bitmapGraphKeyBytes, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - - wxStaticText* m_staticText99; - m_staticText99 = new wxStaticText( m_panelProgress, wxID_ANY, _("Bytes copied:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText99->Wrap( -1 ); - bSizer175->Add( m_staticText99, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer161->Add( bSizer175, 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 ); - - wxBoxSizer* bSizer174; - bSizer174 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapGraphKeyItems = new wxStaticBitmap( m_panelProgress, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer174->Add( m_bitmapGraphKeyItems, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); - - wxStaticText* m_staticText100; - m_staticText100 = new wxStaticText( m_panelProgress, wxID_ANY, _("Items processed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText100->Wrap( -1 ); - bSizer174->Add( m_staticText100, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer161->Add( bSizer174, 0, 0, 5 ); - - 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, 310, 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 ); + + wxBoxSizer* bSizer175; + bSizer175 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapGraphKeyBytes = new wxStaticBitmap( m_panelProgress, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer175->Add( m_bitmapGraphKeyBytes, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); + + wxStaticText* m_staticText99; + m_staticText99 = new wxStaticText( m_panelProgress, wxID_ANY, _("Bytes copied:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText99->Wrap( -1 ); + bSizer175->Add( m_staticText99, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer161->Add( bSizer175, 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 ); + + wxBoxSizer* bSizer174; + bSizer174 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapGraphKeyItems = new wxStaticBitmap( m_panelProgress, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer174->Add( m_bitmapGraphKeyItems, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, 5 ); + + wxStaticText* m_staticText100; + m_staticText100 = new wxStaticText( m_panelProgress, wxID_ANY, _("Items processed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText100->Wrap( -1 ); + bSizer174->Add( m_staticText100, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer161->Add( bSizer174, 0, 0, 5 ); + + 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, 310, 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() @@ -2765,48 +2851,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() @@ -2815,186 +2901,186 @@ 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_radioBtnIgnoreErrors = new wxRadioButton( m_panel35, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnIgnoreErrors->SetToolTip( _("Hide all error and warning messages") ); - - bSizer169->Add( m_radioBtnIgnoreErrors, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_radioBtnPopupOnErrors = new wxRadioButton( m_panel35, wxID_ANY, _("&Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnPopupOnErrors->SetToolTip( _("Show pop-up on errors or warnings") ); - - bSizer169->Add( m_radioBtnPopupOnErrors, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_radioBtnStopOnError = new wxRadioButton( m_panel35, wxID_ANY, _("&Stop"), wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnStopOnError->SetToolTip( _("Stop synchronization at first error") ); - - bSizer169->Add( m_radioBtnStopOnError, 0, wxALL|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_logFolderPath = new FolderHistoryBox( m_panelLogfile, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer1721->Add( m_logFolderPath, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectLogFolder = new wxButton( m_panelLogfile, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectLogFolder->SetToolTip( _("Select a folder") ); - - bSizer1721->Add( m_buttonSelectLogFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltLogFolder = new wxBitmapButton( m_panelLogfile, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltLogFolder->SetToolTip( _("Select SFTP folder") ); - - bSizer1721->Add( m_bpButtonSelectAltLogFolder, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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 ); - - 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, 5 ); - - - this->SetSizer( bSizer54 ); - this->Layout(); - bSizer54->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); - m_radioBtnIgnoreErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnErrorIgnore ), NULL, this ); - m_radioBtnPopupOnErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnErrorPopup ), NULL, this ); - m_radioBtnStopOnError->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 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_radioBtnIgnoreErrors = new wxRadioButton( m_panel35, wxID_ANY, _("&Ignore"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnIgnoreErrors->SetToolTip( _("Hide all error and warning messages") ); + + bSizer169->Add( m_radioBtnIgnoreErrors, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_radioBtnPopupOnErrors = new wxRadioButton( m_panel35, wxID_ANY, _("&Pop-up"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnPopupOnErrors->SetToolTip( _("Show pop-up on errors or warnings") ); + + bSizer169->Add( m_radioBtnPopupOnErrors, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_radioBtnStopOnError = new wxRadioButton( m_panel35, wxID_ANY, _("&Stop"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnStopOnError->SetToolTip( _("Stop synchronization at first error") ); + + bSizer169->Add( m_radioBtnStopOnError, 0, wxALL|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_logFolderPath = new FolderHistoryBox( m_panelLogfile, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer1721->Add( m_logFolderPath, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectLogFolder = new wxButton( m_panelLogfile, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectLogFolder->SetToolTip( _("Select a folder") ); + + bSizer1721->Add( m_buttonSelectLogFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltLogFolder = new wxBitmapButton( m_panelLogfile, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltLogFolder->SetToolTip( _("Select SFTP folder") ); + + bSizer1721->Add( m_bpButtonSelectAltLogFolder, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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 ); + + 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, 5 ); + + + this->SetSizer( bSizer54 ); + this->Layout(); + bSizer54->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_radioBtnIgnoreErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnErrorIgnore ), NULL, this ); + m_radioBtnPopupOnErrors->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnErrorPopup ), NULL, this ); + m_radioBtnStopOnError->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, 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() @@ -3003,81 +3089,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 ); - - 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 ); + 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() @@ -3086,112 +3172,112 @@ DeleteDlgGenerated::~DeleteDlgGenerated() CopyToDlgGenerated::CopyToDlgGenerated( 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_bitmapCopyTo = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer72->Add( m_bitmapCopyTo, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); - - m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER ); - m_staticTextHeader->Wrap( 460 ); - 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 ); - - wxBoxSizer* bSizer182; - bSizer182 = new wxBoxSizer( wxHORIZONTAL ); - - m_targetFolderPath = new FolderHistoryBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - bSizer182->Add( m_targetFolderPath, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonSelectTargetFolder = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); - m_buttonSelectTargetFolder->SetToolTip( _("Select a folder") ); - - bSizer182->Add( m_buttonSelectTargetFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSelectAltTargetFolder = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); - m_bpButtonSelectAltTargetFolder->SetToolTip( _("Select SFTP folder") ); - - bSizer182->Add( m_bpButtonSelectAltTargetFolder, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer24->Add( bSizer182, 0, wxEXPAND|wxALL, 5 ); - - m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer24->Add( m_staticline9, 0, wxEXPAND, 5 ); - - bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer189; - bSizer189 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxKeepRelPath = new wxCheckBox( this, wxID_ANY, _("&Keep relative paths"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxKeepRelPath->SetValue(true); - bSizer189->Add( m_checkBoxKeepRelPath, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); - - m_checkBoxOverwriteIfExists = new wxCheckBox( this, wxID_ANY, _("&Overwrite existing files"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxOverwriteIfExists->SetValue(true); - bSizer189->Add( m_checkBoxOverwriteIfExists, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - bSizerStdButtons->Add( bSizer189, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonOK = new wxButton( this, wxID_OK, _("&Copy"), 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( CopyToDlgGenerated::OnClose ) ); - m_checkBoxKeepRelPath->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnUseRecycler ), NULL, this ); - m_checkBoxOverwriteIfExists->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnUseRecycler ), NULL, this ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnOK ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::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_bitmapCopyTo = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer72->Add( m_bitmapCopyTo, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 10 ); + + m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0|wxNO_BORDER ); + m_staticTextHeader->Wrap( 460 ); + 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 ); + + wxBoxSizer* bSizer182; + bSizer182 = new wxBoxSizer( wxHORIZONTAL ); + + m_targetFolderPath = new FolderHistoryBox( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + bSizer182->Add( m_targetFolderPath, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonSelectTargetFolder = new wxButton( this, wxID_ANY, _("Browse"), wxDefaultPosition, wxDefaultSize, 0 ); + m_buttonSelectTargetFolder->SetToolTip( _("Select a folder") ); + + bSizer182->Add( m_buttonSelectTargetFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSelectAltTargetFolder = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 26,-1 ), wxBU_AUTODRAW ); + m_bpButtonSelectAltTargetFolder->SetToolTip( _("Select SFTP folder") ); + + bSizer182->Add( m_bpButtonSelectAltTargetFolder, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer24->Add( bSizer182, 0, wxEXPAND|wxALL, 5 ); + + m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer24->Add( m_staticline9, 0, wxEXPAND, 5 ); + + bSizerStdButtons = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer189; + bSizer189 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxKeepRelPath = new wxCheckBox( this, wxID_ANY, _("&Keep relative paths"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxKeepRelPath->SetValue(true); + bSizer189->Add( m_checkBoxKeepRelPath, 0, wxALIGN_CENTER_VERTICAL|wxALL|wxEXPAND, 5 ); + + m_checkBoxOverwriteIfExists = new wxCheckBox( this, wxID_ANY, _("&Overwrite existing files"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxOverwriteIfExists->SetValue(true); + bSizer189->Add( m_checkBoxOverwriteIfExists, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + + bSizerStdButtons->Add( bSizer189, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonOK = new wxButton( this, wxID_OK, _("Copy"), 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( CopyToDlgGenerated::OnClose ) ); + m_checkBoxKeepRelPath->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnUseRecycler ), NULL, this ); + m_checkBoxOverwriteIfExists->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnUseRecycler ), NULL, this ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnOK ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CopyToDlgGenerated::OnCancel ), NULL, this ); } CopyToDlgGenerated::~CopyToDlgGenerated() @@ -3200,258 +3286,258 @@ CopyToDlgGenerated::~CopyToDlgGenerated() 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, _("Show hidden dialogs again"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonResetDialogs->SetToolTip( _("Show all permanently hidden dialogs and warning messages again") ); - - 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, _("Show hidden dialogs again"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonResetDialogs->SetToolTip( _("Show all permanently hidden dialogs and warning messages again") ); + + 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() @@ -3460,22 +3546,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() @@ -3484,60 +3570,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() @@ -3546,308 +3632,308 @@ 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://www.visualstudio.com"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink11->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink11->SetToolTip( _("http://www.visualstudio.com") ); - - bSizer171->Add( m_hyperlink11, 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|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") ); - - bSizer171->Add( m_hyperlink16, 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_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_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_hyperlink10 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("libssh2"), wxT("http://www.libssh2.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink10->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink10->SetToolTip( _("http://www.libssh2.org") ); - - bSizer172->Add( m_hyperlink10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink18 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("NSIS"), wxT("http://nsis.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink18->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink18->SetToolTip( _("http://nsis.sourceforge.net") ); - - bSizer172->Add( m_hyperlink18, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink9 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Inno Setup"), wxT("http://www.jrsoftware.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink9->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); - m_hyperlink9->SetToolTip( _("http://www.jrsoftware.org") ); - - bSizer172->Add( m_hyperlink9, 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_bitmapDonate = new wxStaticBitmap( m_panel39, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer184->Add( m_bitmapDonate, 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://www.freefilesync.org/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_bitmapHomepage = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_bitmapHomepage->SetToolTip( _("Homepage") ); - - bSizer166->Add( m_bitmapHomepage, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_hyperlink1 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("FreeFileSync.org"), wxT("http://www.freefilesync.org/"), 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 ) ); - m_hyperlink1->SetToolTip( _("http://www.freefilesync.org") ); - - bSizer166->Add( m_hyperlink1, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bitmapEmail = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_bitmapEmail->SetToolTip( _("Email") ); - - bSizer166->Add( m_bitmapEmail, 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 ) ); - m_hyperlink2->SetToolTip( _("mailto:zenju@gmx.de") ); - - 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_bitmapGpl = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); - bSizer1671->Add( m_bitmapGpl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink5 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("http://www.gnu.org/licenses/gpl-3.0"), wxT("http://www.gnu.org/licenses/gpl-3.0"), 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://www.visualstudio.com"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink11->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink11->SetToolTip( _("http://www.visualstudio.com") ); + + bSizer171->Add( m_hyperlink11, 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|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") ); + + bSizer171->Add( m_hyperlink16, 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_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_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_hyperlink10 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("libssh2"), wxT("http://www.libssh2.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink10->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink10->SetToolTip( _("http://www.libssh2.org") ); + + bSizer172->Add( m_hyperlink10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink18 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("NSIS"), wxT("http://nsis.sourceforge.net"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink18->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink18->SetToolTip( _("http://nsis.sourceforge.net") ); + + bSizer172->Add( m_hyperlink18, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink9 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("Inno Setup"), wxT("http://www.jrsoftware.org"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink9->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW ) ); + m_hyperlink9->SetToolTip( _("http://www.jrsoftware.org") ); + + bSizer172->Add( m_hyperlink9, 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_bitmapDonate = new wxStaticBitmap( m_panel39, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer184->Add( m_bitmapDonate, 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://www.freefilesync.org/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_bitmapHomepage = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_bitmapHomepage->SetToolTip( _("Homepage") ); + + bSizer166->Add( m_bitmapHomepage, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_hyperlink1 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("FreeFileSync.org"), wxT("http://www.freefilesync.org/"), 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 ) ); + m_hyperlink1->SetToolTip( _("http://www.freefilesync.org") ); + + bSizer166->Add( m_hyperlink1, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer166->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bitmapEmail = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_bitmapEmail->SetToolTip( _("Email") ); + + bSizer166->Add( m_bitmapEmail, 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 ) ); + m_hyperlink2->SetToolTip( _("mailto:zenju@gmx.de") ); + + 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_bitmapGpl = new wxStaticBitmap( m_panel41, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), 0 ); + bSizer1671->Add( m_bitmapGpl, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink5 = new wxHyperlinkCtrl( m_panel41, wxID_ANY, _("http://www.gnu.org/licenses/gpl-3.0"), wxT("http://www.gnu.org/licenses/gpl-3.0"), 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 cf86dd53..309b86f1 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> @@ -48,6 +48,7 @@ namespace zen{ class TripleSplitter; } #include <wx/choice.h> #include <wx/notebook.h> #include <wx/dialog.h> +#include <wx/treectrl.h> #include <wx/gauge.h> #include <wx/animate.h> #include <wx/grid.h> @@ -61,891 +62,925 @@ 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; - wxMenu* m_menu4; - wxMenuItem* m_menuItemCompare; - wxMenuItem* m_menuItemCompSettings; - wxMenuItem* m_menuItemFilter; - wxMenuItem* m_menuItemSyncSettings; - 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; - wxBitmapButton* m_bpButtonCmpConfig; - zen::BitmapTextButton* m_buttonCancel; - zen::BitmapTextButton* m_buttonCompare; - wxBitmapButton* m_bpButtonFilter; - wxBitmapButton* m_bpButtonSyncConfig; - zen::BitmapTextButton* m_buttonSync; - wxPanel* m_panelDirectoryPairs; - wxStaticText* m_staticTextResolvedPathL; - wxBitmapButton* m_bpButtonAddPair; - wxButton* m_buttonSelectFolderLeft; - wxPanel* m_panelTopMiddle; - wxBitmapButton* m_bpButtonSwapSides; - wxStaticText* m_staticTextResolvedPathR; - wxButton* m_buttonSelectFolderRight; - 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 OnMenuQuit( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCompare( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCmpSettings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnConfigureFilter( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSyncSettings( wxCommandEvent& event ) { event.Skip(); } - virtual void OnStartSync( 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 OnCompSettingsContext( wxMouseEvent& event ) { event.Skip(); } - virtual void OnGlobalFilterContext( wxMouseEvent& event ) { event.Skip(); } - virtual void OnSyncSettingsContext( wxMouseEvent& event ) { event.Skip(); } - virtual void OnTopFolderPairAdd( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTopFolderPairRemove( wxCommandEvent& event ) { event.Skip(); } - virtual void OnSwapSides( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTopLocalCompCfg( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTopLocalFilterCfg( wxCommandEvent& event ) { event.Skip(); } - virtual void OnTopLocalSyncCfg( 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_folderPathLeft; - wxBitmapButton* m_bpButtonSelectAltFolderLeft; - wxBitmapButton* m_bpButtonAltCompCfg; - wxBitmapButton* m_bpButtonLocalFilter; - wxBitmapButton* m_bpButtonAltSyncCfg; - wxPanel* m_panelTopRight; - FolderHistoryBox* m_folderPathRight; - wxBitmapButton* m_bpButtonSelectAltFolderRight; - 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; + wxMenu* m_menu4; + wxMenuItem* m_menuItemCompare; + wxMenuItem* m_menuItemCompSettings; + wxMenuItem* m_menuItemFilter; + wxMenuItem* m_menuItemSyncSettings; + 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; + wxBitmapButton* m_bpButtonCmpConfig; + zen::BitmapTextButton* m_buttonCancel; + zen::BitmapTextButton* m_buttonCompare; + wxBitmapButton* m_bpButtonFilter; + wxBitmapButton* m_bpButtonSyncConfig; + zen::BitmapTextButton* m_buttonSync; + wxPanel* m_panelDirectoryPairs; + wxStaticText* m_staticTextResolvedPathL; + wxBitmapButton* m_bpButtonAddPair; + wxButton* m_buttonSelectFolderLeft; + wxPanel* m_panelTopMiddle; + wxBitmapButton* m_bpButtonSwapSides; + wxStaticText* m_staticTextResolvedPathR; + wxButton* m_buttonSelectFolderRight; + 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 OnMenuQuit( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCompare( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCmpSettings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnConfigureFilter( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSyncSettings( wxCommandEvent& event ) { event.Skip(); } + virtual void OnStartSync( 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 OnCompSettingsContext( wxMouseEvent& event ) { event.Skip(); } + virtual void OnGlobalFilterContext( wxMouseEvent& event ) { event.Skip(); } + virtual void OnSyncSettingsContext( wxMouseEvent& event ) { event.Skip(); } + virtual void OnTopFolderPairAdd( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTopFolderPairRemove( wxCommandEvent& event ) { event.Skip(); } + virtual void OnSwapSides( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTopLocalCompCfg( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTopLocalFilterCfg( wxCommandEvent& event ) { event.Skip(); } + virtual void OnTopLocalSyncCfg( 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_folderPathLeft; + wxBitmapButton* m_bpButtonSelectAltFolderLeft; + wxBitmapButton* m_bpButtonAltCompCfg; + wxBitmapButton* m_bpButtonLocalFilter; + wxBitmapButton* m_bpButtonAltSyncCfg; + wxPanel* m_panelTopRight; + FolderHistoryBox* m_folderPathRight; + wxBitmapButton* m_bpButtonSelectAltFolderRight; + 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: - wxStaticText* m_staticTextFolderPairLabel; - wxListBox* m_listBoxFolderPair; - 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; - wxCheckBox* m_checkBoxSymlinksInclude; - wxRadioButton* m_radioBtnSymlinksFollow; - wxRadioButton* m_radioBtnSymlinksDirect; - 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; - wxStaticText* m_staticText44; - wxStaticLine* m_staticline46; - wxButton* m_buttonClear; - 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; - wxRadioButton* m_radioBtnPermanent; - wxRadioButton* m_radioBtnRecycler; - wxRadioButton* m_radioBtnVersioning; - wxBoxSizer* bSizerVersioning; - wxBitmapButton* m_bpButtonDeletionType; - wxPanel* m_panelVersioning; - FolderHistoryBox* m_versioningFolderPath; - wxButton* m_buttonSelectVersioningFolder; - 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; - wxRadioButton* m_radioBtnIgnoreErrors; - wxRadioButton* m_radioBtnPopupOnErrors; - 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 OnSelectFolderPair( wxCommandEvent& 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 OnToggleDeletionType( 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: - wxBitmapButton* m_bpButtonSelectAltFolder; - - 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: + wxStaticText* m_staticTextFolderPairLabel; + wxListBox* m_listBoxFolderPair; + 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; + wxCheckBox* m_checkBoxSymlinksInclude; + wxRadioButton* m_radioBtnSymlinksFollow; + wxRadioButton* m_radioBtnSymlinksDirect; + 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; + wxStaticText* m_staticText44; + wxStaticLine* m_staticline46; + wxButton* m_buttonClear; + 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; + wxRadioButton* m_radioBtnPermanent; + wxRadioButton* m_radioBtnRecycler; + wxRadioButton* m_radioBtnVersioning; + wxBoxSizer* bSizerVersioning; + wxBitmapButton* m_bpButtonDeletionType; + wxPanel* m_panelVersioning; + FolderHistoryBox* m_versioningFolderPath; + wxButton* m_buttonSelectVersioningFolder; + 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; + wxRadioButton* m_radioBtnIgnoreErrors; + wxRadioButton* m_radioBtnPopupOnErrors; + 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 OnSelectFolderPair( wxCommandEvent& 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 OnToggleDeletionType( 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: + wxBitmapButton* m_bpButtonSelectAltFolder; + + 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 FolderPairPanelGenerated /////////////////////////////////////////////////////////////////////////////// -class FolderPairPanelGenerated : public wxPanel +class FolderPairPanelGenerated : public wxPanel { - private: - - protected: - wxButton* m_buttonSelectFolderLeft; - wxButton* m_buttonSelectFolderRight; - - public: - wxPanel* m_panelLeft; - wxBitmapButton* m_bpButtonFolderPairOptions; - wxBitmapButton* m_bpButtonRemovePair; - FolderHistoryBox* m_folderPathLeft; - wxBitmapButton* m_bpButtonSelectAltFolderLeft; - wxPanel* m_panel20; - wxBitmapButton* m_bpButtonAltCompCfg; - wxBitmapButton* m_bpButtonLocalFilter; - wxBitmapButton* m_bpButtonAltSyncCfg; - wxPanel* m_panelRight; - FolderHistoryBox* m_folderPathRight; - wxBitmapButton* m_bpButtonSelectAltFolderRight; - - FolderPairPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0 ); - ~FolderPairPanelGenerated(); - +private: + +protected: + wxButton* m_buttonSelectFolderLeft; + wxButton* m_buttonSelectFolderRight; + +public: + wxPanel* m_panelLeft; + wxBitmapButton* m_bpButtonFolderPairOptions; + wxBitmapButton* m_bpButtonRemovePair; + FolderHistoryBox* m_folderPathLeft; + wxBitmapButton* m_bpButtonSelectAltFolderLeft; + wxPanel* m_panel20; + wxBitmapButton* m_bpButtonAltCompCfg; + wxBitmapButton* m_bpButtonLocalFilter; + wxBitmapButton* m_bpButtonAltSyncCfg; + wxPanel* m_panelRight; + FolderHistoryBox* m_folderPathRight; + wxBitmapButton* m_bpButtonSelectAltFolderRight; + + FolderPairPanelGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0 ); + ~FolderPairPanelGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// Class SftpSetupDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SftpSetupDlgGenerated : public wxDialog +class SftpSetupDlgGenerated : public wxDialog { - private: - - protected: - wxStaticBitmap* m_bitmapSftp; - wxStaticText* m_staticTextHeader; - wxStaticLine* m_staticline371; - wxPanel* m_panel41; - wxStaticText* m_staticText12311; - wxTextCtrl* m_textCtrlServer; - wxStaticText* m_staticText1233; - wxTextCtrl* m_textCtrlPort; - wxStaticText* m_staticText1381; - wxStaticText* m_staticText1382; - wxStaticText* m_staticText138; - wxStaticText* m_staticText123; - wxTextCtrl* m_textCtrlUserName; - wxStaticText* m_staticText1231; - wxTextCtrl* m_textCtrlPasswordVisible; - wxTextCtrl* m_textCtrlPasswordHidden; - wxCheckBox* m_checkBoxShowPassword; - wxStaticText* m_staticText1232; - wxTextCtrl* m_textCtrlServerPath; - wxStaticLine* m_staticline12; - 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 OnToggleShowPassword( wxCommandEvent& event ) { event.Skip(); } - virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } - virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } - - - public: - - SftpSetupDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("SSH File Transfer Protocol"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); - ~SftpSetupDlgGenerated(); - +private: + +protected: + wxStaticBitmap* m_bitmapSftp; + wxStaticText* m_staticTextHeader; + wxStaticLine* m_staticline371; + wxPanel* m_panel41; + wxStaticText* m_staticText12311; + wxTextCtrl* m_textCtrlServer; + wxStaticText* m_staticText1233; + wxTextCtrl* m_textCtrlPort; + wxStaticText* m_staticText1381; + wxStaticText* m_staticText1382; + wxStaticText* m_staticText138; + wxStaticText* m_staticText123; + wxTextCtrl* m_textCtrlUserName; + wxStaticText* m_staticText1231; + wxTextCtrl* m_textCtrlPasswordVisible; + wxTextCtrl* m_textCtrlPasswordHidden; + wxCheckBox* m_checkBoxShowPassword; + wxStaticText* m_staticText1232; + wxTextCtrl* m_textCtrlServerPath; + wxButton* m_buttonSelectFolder; + wxStaticLine* m_staticline12; + 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 OnToggleShowPassword( wxCommandEvent& event ) { event.Skip(); } + virtual void OnBrowseSftpFolder( wxCommandEvent& event ) { event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + + +public: + + SftpSetupDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("SSH File Transfer Protocol"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + ~SftpSetupDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SftpFolderPickerGenerated +/////////////////////////////////////////////////////////////////////////////// +class SftpFolderPickerGenerated : public wxDialog +{ +private: + +protected: + wxStaticBitmap* m_bitmapSftp; + wxStaticText* m_staticTextHeader; + wxStaticLine* m_staticline371; + wxPanel* m_panel41; + wxTreeCtrl* m_treeCtrlFileSystem; + wxStaticLine* m_staticline12; + 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 OnExpandNode( wxTreeEvent& event ) { event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ) { event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); } + + +public: + + SftpFolderPickerGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("SSH File Transfer Protocol"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + ~SftpFolderPickerGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// 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 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; - wxStaticBitmap* m_bitmapGraphKeyBytes; - zen::Graph2D* m_panelGraphBytes; - wxStaticBitmap* m_bitmapGraphKeyItems; - 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; + wxStaticBitmap* m_bitmapGraphKeyBytes; + zen::Graph2D* m_panelGraphBytes; + wxStaticBitmap* m_bitmapGraphKeyItems; + 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; - wxRadioButton* m_radioBtnIgnoreErrors; - wxRadioButton* m_radioBtnPopupOnErrors; - wxRadioButton* m_radioBtnStopOnError; - wxStaticLine* m_staticline26; - wxCheckBox* m_checkBoxRunMinimized; - wxStaticText* m_staticText81; - OnCompletionBox* m_comboBoxOnCompletion; - wxStaticLine* m_staticline25; - wxCheckBox* m_checkBoxGenerateLogfile; - wxPanel* m_panelLogfile; - wxButton* m_buttonSelectLogFolder; - 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_logFolderPath; - wxBitmapButton* m_bpButtonSelectAltLogFolder; - - 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; + wxRadioButton* m_radioBtnIgnoreErrors; + wxRadioButton* m_radioBtnPopupOnErrors; + wxRadioButton* m_radioBtnStopOnError; + wxStaticLine* m_staticline26; + wxCheckBox* m_checkBoxRunMinimized; + wxStaticText* m_staticText81; + OnCompletionBox* m_comboBoxOnCompletion; + wxStaticLine* m_staticline25; + wxCheckBox* m_checkBoxGenerateLogfile; + wxPanel* m_panelLogfile; + wxButton* m_buttonSelectLogFolder; + 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_logFolderPath; + wxBitmapButton* m_bpButtonSelectAltLogFolder; + + 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 CopyToDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class CopyToDlgGenerated : public wxDialog +class CopyToDlgGenerated : public wxDialog { - private: - - protected: - wxStaticBitmap* m_bitmapCopyTo; - wxStaticText* m_staticTextHeader; - wxStaticLine* m_staticline91; - wxPanel* m_panel31; - wxStaticLine* m_staticline42; - wxTextCtrl* m_textCtrlFileList; - wxButton* m_buttonSelectTargetFolder; - wxStaticLine* m_staticline9; - wxBoxSizer* bSizerStdButtons; - wxCheckBox* m_checkBoxKeepRelPath; - wxCheckBox* m_checkBoxOverwriteIfExists; - 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: - FolderHistoryBox* m_targetFolderPath; - wxBitmapButton* m_bpButtonSelectAltTargetFolder; - - CopyToDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Copy items"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); - ~CopyToDlgGenerated(); - +private: + +protected: + wxStaticBitmap* m_bitmapCopyTo; + wxStaticText* m_staticTextHeader; + wxStaticLine* m_staticline91; + wxPanel* m_panel31; + wxStaticLine* m_staticline42; + wxTextCtrl* m_textCtrlFileList; + wxButton* m_buttonSelectTargetFolder; + wxStaticLine* m_staticline9; + wxBoxSizer* bSizerStdButtons; + wxCheckBox* m_checkBoxKeepRelPath; + wxCheckBox* m_checkBoxOverwriteIfExists; + 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: + FolderHistoryBox* m_targetFolderPath; + wxBitmapButton* m_bpButtonSelectAltTargetFolder; + + CopyToDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Copy items"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxMAXIMIZE_BOX|wxRESIZE_BORDER ); + ~CopyToDlgGenerated(); + }; /////////////////////////////////////////////////////////////////////////////// /// 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_hyperlink7; - wxHyperlinkCtrl* m_hyperlink14; - wxHyperlinkCtrl* m_hyperlink16; - wxHyperlinkCtrl* m_hyperlink15; - wxHyperlinkCtrl* m_hyperlink12; - wxHyperlinkCtrl* m_hyperlink13; - wxHyperlinkCtrl* m_hyperlink10; - wxHyperlinkCtrl* m_hyperlink18; - wxHyperlinkCtrl* m_hyperlink9; - wxPanel* m_panelDonate; - wxPanel* m_panel39; - wxStaticBitmap* m_bitmapDonate; - wxStaticText* m_staticText83; - wxButton* m_buttonDonate; - wxStaticText* m_staticText94; - wxStaticBitmap* m_bitmapHomepage; - wxHyperlinkCtrl* m_hyperlink1; - wxStaticBitmap* m_bitmapEmail; - wxHyperlinkCtrl* m_hyperlink2; - wxStaticLine* m_staticline34; - wxStaticText* m_staticText93; - wxStaticBitmap* m_bitmapGpl; - 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_hyperlink7; + wxHyperlinkCtrl* m_hyperlink14; + wxHyperlinkCtrl* m_hyperlink16; + wxHyperlinkCtrl* m_hyperlink15; + wxHyperlinkCtrl* m_hyperlink12; + wxHyperlinkCtrl* m_hyperlink13; + wxHyperlinkCtrl* m_hyperlink10; + wxHyperlinkCtrl* m_hyperlink18; + wxHyperlinkCtrl* m_hyperlink9; + wxPanel* m_panelDonate; + wxPanel* m_panel39; + wxStaticBitmap* m_bitmapDonate; + wxStaticText* m_staticText83; + wxButton* m_buttonDonate; + wxStaticText* m_staticText94; + wxStaticBitmap* m_bitmapHomepage; + wxHyperlinkCtrl* m_hyperlink1; + wxStaticBitmap* m_bitmapEmail; + wxHyperlinkCtrl* m_hyperlink2; + wxStaticLine* m_staticline34; + wxStaticText* m_staticText93; + wxStaticBitmap* m_bitmapGpl; + 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 2502788b..d3b9be5c 100644 --- a/FreeFileSync/Source/ui/gui_status_handler.cpp +++ b/FreeFileSync/Source/ui/gui_status_handler.cpp @@ -246,7 +246,7 @@ StatusHandlerFloatingDialog::StatusHandlerFloatingDialog(wxFrame* parentDlg, automaticRetryCount_(automaticRetryCount), automaticRetryDelay_(automaticRetryDelay), jobName_(jobName), -startTime_(wxGetUTCTimeMillis().GetValue()) {} +startTime_(std::time(nullptr)) {} StatusHandlerFloatingDialog::~StatusHandlerFloatingDialog() @@ -314,7 +314,7 @@ StatusHandlerFloatingDialog::~StatusHandlerFloatingDialog() jobName_, finalStatus, getObjectsCurrent(PHASE_SYNCHRONIZING), getDataCurrent(PHASE_SYNCHRONIZING), getObjectsTotal (PHASE_SYNCHRONIZING), getDataTotal (PHASE_SYNCHRONIZING), - (wxGetUTCTimeMillis().GetValue() - startTime_) / 1000 + std::time(nullptr) - startTime_ }; //----------------- write results into LastSyncs.log------------------------ diff --git a/FreeFileSync/Source/ui/gui_status_handler.h b/FreeFileSync/Source/ui/gui_status_handler.h index 35789972..9674c448 100644 --- a/FreeFileSync/Source/ui/gui_status_handler.h +++ b/FreeFileSync/Source/ui/gui_status_handler.h @@ -80,7 +80,7 @@ private: const size_t automaticRetryCount_; const size_t automaticRetryDelay_; const std::wstring jobName_; - const int64_t startTime_; //don't use wxStopWatch: may overflow after a few days due to ::QueryPerformanceCounter() + const time_t startTime_; //don't use wxStopWatch: may overflow after a few days due to ::QueryPerformanceCounter() }; diff --git a/FreeFileSync/Source/ui/main_dlg.cpp b/FreeFileSync/Source/ui/main_dlg.cpp index 9e19ce3c..c392ebc7 100644 --- a/FreeFileSync/Source/ui/main_dlg.cpp +++ b/FreeFileSync/Source/ui/main_dlg.cpp @@ -401,7 +401,7 @@ void MainDialog::create(const Zstring& globalConfigFile) GetFirstResult<FalseType> firstMissingDir; for (const Zstring& filepath : filepaths) - firstMissingDir.addJob([filepath] { return filepath.empty() /*ever empty??*/ || !fileExists(filepath) ? make_unique<FalseType>() : nullptr; }); + firstMissingDir.addJob([filepath] { return filepath.empty() /*ever empty??*/ || !fileExists(filepath) ? std::make_unique<FalseType>() : nullptr; }); //potentially slow network access: give all checks 500ms to finish const bool allFilesExist = firstMissingDir.timedWait(std::chrono::milliseconds(500)) && //false: time elapsed @@ -490,12 +490,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), - localKeyEventsEnabled(true) + folderHistoryRight(std::make_shared<FolderHistory>()) // { m_folderPathLeft ->init(folderHistoryLeft); m_folderPathRight->init(folderHistoryRight); @@ -542,7 +538,7 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, auiMgr.SetManagedWindow(this); auiMgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); - compareStatus = make_unique<CompareProgressDialog>(*this); //integrate the compare status panel (in hidden state) + compareStatus = std::make_unique<CompareProgressDialog>(*this); //integrate the compare status panel (in hidden state) //caption required for all panes that can be manipulated by the users => used by context menu auiMgr.AddPane(m_panelCenter, @@ -705,7 +701,7 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, } //show FreeFileSync update reminder - if (!globalSettings.gui.lastOnlineVersion.empty() && isNewerFreeFileSyncVersion(globalSettings.gui.lastOnlineVersion)) + if (!globalSettings.gui.lastOnlineVersion.empty() && haveNewerVersionOnline(globalSettings.gui.lastOnlineVersion)) { auto menu = new wxMenu(); wxMenuItem* newItem = new wxMenuItem(menu, wxID_ANY, _("&Download")); @@ -718,7 +714,7 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, zen::setMainWindow(this); //init handling of first folder pair - firstFolderPair = make_unique<FolderPairFirst>(*this); + firstFolderPair = std::make_unique<FolderPairFirst>(*this); initViewFilterButtons(); @@ -745,8 +741,6 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, setupFileDrop(*m_gridNavi); m_gridNavi->Connect(EVENT_DROP_FILE, FileDropEventHandler(MainDialog::onNaviPanelFilesDropped), nullptr, this); - timerForAsyncTasks.Connect(wxEVT_TIMER, wxEventHandler(MainDialog::onProcessAsyncTasks), nullptr, this); - //Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResize), nullptr, this); //Connect(wxEVT_MOVE, wxSizeEventHandler(MainDialog::OnResize), nullptr, this); @@ -836,7 +830,7 @@ MainDialog::MainDialog(const Zstring& globalConfigFile, return nullptr; } catch (FileError&) {} - return make_unique<FalseType>(); + return std::make_unique<FalseType>(); }); const bool startComparisonNow = !firstMissingDir.timedWait(std::chrono::milliseconds(500)) || //= no result yet => start comparison anyway! @@ -875,8 +869,8 @@ MainDialog::~MainDialog() #ifdef ZEN_MAC //more (non-portable) wxWidgets crap: wxListBox leaks wxClientData, both of the following functions fail to clean up: - // src/common/ctrlsub.cpp:: wxItemContainer::~wxItemContainer() -> empty function body!!! - // src/osx/listbox_osx.cpp: wxListBox::~wxListBox() + // src/common/ctrlsub.cpp:: wxItemContainer::~wxItemContainer() -> empty function body!!! + // src/osx/listbox_osx.cpp: wxListBox::~wxListBox() //=> finally a manual wxItemContainer::Clear() will render itself useful: m_listBoxHistory->Clear(); #endif @@ -1513,8 +1507,8 @@ void MainDialog::flashStatusInformation(const wxString& text) m_panelStatusBar->Layout(); //if (needLayoutUpdate) auiMgr.Update(); -> not needed here, this is called anyway in updateGui() - processAsync2([] { std::this_thread::sleep_for(std::chrono::milliseconds(2500)); }, - [this] { this->restoreStatusInformation(); }); + guiQueue.processAsync([] { std::this_thread::sleep_for(std::chrono::milliseconds(2500)); }, + [this] { this->restoreStatusInformation(); }); } @@ -1540,15 +1534,6 @@ void MainDialog::restoreStatusInformation() } -void MainDialog::onProcessAsyncTasks(wxEvent& event) -{ - //schedule and run long-running tasks asynchronously - asyncTasks.evalResults(); //process results on GUI queue - if (asyncTasks.empty()) - timerForAsyncTasks.Stop(); -} - - void MainDialog::disableAllElements(bool enableAbort) { //disables all elements (except abort button) that might receive user input during long-running processes: @@ -2679,7 +2664,7 @@ void MainDialog::removeObsoleteCfgHistoryItems(const std::vector<Zstring>& filep return missingFiles; }; - processAsync(getMissingFilesAsync, [this](const std::vector<Zstring>& files) { removeCfgHistoryItems(files); }); + guiQueue.processAsync(getMissingFilesAsync, [this](const std::vector<Zstring>& files) { removeCfgHistoryItems(files); }); } @@ -2881,10 +2866,10 @@ bool MainDialog::trySaveBatchConfig(const Zstring* batchFileToUpdate) else { //let user update batch config: this should change batch-exclusive settings only, else the "setLastUsedConfig" below would be somewhat of a lie - if (!customizeBatchConfig(this, - batchCfg, //in/out - globalCfg.gui.onCompletionHistory, - globalCfg.gui.onCompletionHistoryMax)) + if (customizeBatchConfig(this, + batchCfg, //in/out + globalCfg.gui.onCompletionHistory, + globalCfg.gui.onCompletionHistoryMax) != ReturnBatchConfig::BUTTON_SAVE_AS) return false; Zstring defaultFileName = !activeCfgFilename.empty() ? activeCfgFilename : Zstr("BatchRun.ffs_batch"); @@ -3448,7 +3433,7 @@ void MainDialog::OnGlobalFilterContext(wxMouseEvent& event) updateGlobalFilterButton(); //refresh global filter icon applyFilterConfig(); //re-apply filter }; - auto copyFilter = [&] { filterCfgOnClipboard = make_unique<FilterConfig>(currentCfg.mainCfg.globalFilter); }; + auto copyFilter = [&] { filterCfgOnClipboard = std::make_unique<FilterConfig>(currentCfg.mainCfg.globalFilter); }; auto pasteFilter = [&] { if (filterCfgOnClipboard) @@ -3490,7 +3475,7 @@ inline wxBitmap buttonPressed(const std::string& name) { wxBitmap background = getResourceImage(L"buttonPressed"); - return mirrorIfRtl(layOver(getResourceImage(utfCvrtTo<wxString>(name)), background)); + return mirrorIfRtl(layOver(background, getResourceImage(utfCvrtTo<wxString>(name)))); } @@ -3539,23 +3524,23 @@ void MainDialog::setViewFilterDefault() auto setButton = [](ToggleButton* tb, bool value) { tb->setActive(value); }; const auto& def = globalCfg.gui.viewFilterDefault; - setButton(m_bpButtonShowExcluded, def.excluded); - setButton(m_bpButtonShowEqual, def.equal); - setButton(m_bpButtonShowConflict, def.conflict); + setButton(m_bpButtonShowExcluded, def.excluded); + setButton(m_bpButtonShowEqual, def.equal); + setButton(m_bpButtonShowConflict, def.conflict); - setButton(m_bpButtonShowLeftOnly, def.leftOnly); - setButton(m_bpButtonShowRightOnly, def.rightOnly); - setButton(m_bpButtonShowLeftNewer, def.leftNewer); - setButton(m_bpButtonShowRightNewer, def.rightNewer); - setButton(m_bpButtonShowDifferent, def.different); + setButton(m_bpButtonShowLeftOnly, def.leftOnly); + setButton(m_bpButtonShowRightOnly, def.rightOnly); + setButton(m_bpButtonShowLeftNewer, def.leftNewer); + setButton(m_bpButtonShowRightNewer, def.rightNewer); + setButton(m_bpButtonShowDifferent, def.different); - setButton(m_bpButtonShowCreateLeft, def.createLeft); + setButton(m_bpButtonShowCreateLeft, def.createLeft); setButton(m_bpButtonShowCreateRight,def.createRight); - setButton(m_bpButtonShowUpdateLeft, def.updateLeft); + setButton(m_bpButtonShowUpdateLeft, def.updateLeft); setButton(m_bpButtonShowUpdateRight,def.updateRight); - setButton(m_bpButtonShowDeleteLeft, def.deleteLeft); + setButton(m_bpButtonShowDeleteLeft, def.deleteLeft); setButton(m_bpButtonShowDeleteRight,def.deleteRight); - setButton(m_bpButtonShowDoNothing, def.doNothing); + setButton(m_bpButtonShowDoNothing, def.doNothing); } @@ -3647,14 +3632,13 @@ void MainDialog::OnCompare(wxCommandEvent& event) std::unique_ptr<LockHolder> dirLocks; //COMPARE DIRECTORIES - compare(globalCfg.optDialogs, - true, //allow pw prompt - globalCfg.runWithBackgroundPriority, - globalCfg.createLockFile, - dirLocks, - cmpConfig, - folderCmp, - statusHandler); //throw GuiAbortProcess + folderCmp = compare(globalCfg.optDialogs, + true, //allowUserInteraction + globalCfg.runWithBackgroundPriority, + globalCfg.createLockFile, + dirLocks, + cmpConfig, + statusHandler); //throw GuiAbortProcess } catch (GuiAbortProcess&) { @@ -3849,7 +3833,7 @@ void MainDialog::OnStartSync(wxCommandEvent& event) if (Opt<Zstring> nativeFolderPath = ABF::getNativeItemPath(it->getABF<RIGHT_SIDE >().getAbstractPath())) dirPathsExisting.insert(*nativeFolderPath); } - dirLocks = zen::make_unique<LockHolder>(dirPathsExisting, globalCfg.optDialogs.warningDirectoryLockFailed, statusHandler); + dirLocks = std::make_unique<LockHolder>(dirPathsExisting, globalCfg.optDialogs.warningDirectoryLockFailed, statusHandler); } //START SYNCHRONIZATION @@ -4579,7 +4563,7 @@ void MainDialog::removeAddFolderPair(size_t pos) //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 //=> since we're in a mouse button callback of a sub-component of "panel" we need to delay deletion ourselves: - processAsync2([] {}, [panel] { panel->Destroy(); }); + guiQueue.processAsync([] {}, [panel] { panel->Destroy(); }); updateGuiForFolderPair(); clearGrid(pos + 1); //+ GUI update @@ -4704,7 +4688,7 @@ void MainDialog::OnMenuExportFileList(wxCommandEvent& event) //main grid: write rows one after the other instead of creating one big string: memory allocation might fail; think 1 million rows! /* performance test case "export 600.000 rows" to CSV: - aproach 1. assemble single temporary string, then write file: 4.6s + aproach 1. assemble single temporary string, then write file: 4.6s aproach 2. write to buffered file output directly for each row: 6.4s */ const size_t rowCount = m_gridMainL->getRowCount(); @@ -4763,10 +4747,16 @@ void MainDialog::OnMenuCheckVersionAutomatically(wxCommandEvent& event) if (updateCheckActive(globalCfg.gui.lastUpdateCheck)) disableUpdateCheck(globalCfg.gui.lastUpdateCheck); else - globalCfg.gui.lastUpdateCheck = 0; //reset to GlobalSetting.xml default value! + globalCfg.gui.lastUpdateCheck = 0; //reset to GlobalSettings.xml default value! m_menuItemCheckVersionAuto->Check(updateCheckActive(globalCfg.gui.lastUpdateCheck)); - zen::checkForUpdatePeriodically(this, globalCfg.gui.lastUpdateCheck, globalCfg.gui.lastOnlineVersion, [&] { flashStatusInformation(_("Searching for program updates...")); }); + + if (runPeriodicUpdateCheckNow(globalCfg.gui.lastUpdateCheck)) + { + flashStatusInformation(_("Searching for program updates...")); + //synchronous update check is sufficient here: + evalPeriodicUpdateCheck(this, globalCfg.gui.lastUpdateCheck, globalCfg.gui.lastOnlineVersion, retrieveOnlineVersion().get()); + } } @@ -4776,7 +4766,16 @@ void MainDialog::OnRegularUpdateCheck(wxIdleEvent& event) Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), nullptr, this); if (manualProgramUpdateRequired()) - zen::checkForUpdatePeriodically(this, globalCfg.gui.lastUpdateCheck, globalCfg.gui.lastOnlineVersion, [&] { flashStatusInformation(_("Searching for program updates...")); }); + if (runPeriodicUpdateCheckNow(globalCfg.gui.lastUpdateCheck)) + { + flashStatusInformation(_("Searching for program updates...")); + + guiQueue.processAsync([] { return retrieveOnlineVersion(); }, + [this] (std::shared_ptr<UpdateCheckResult>&& result) + { + evalPeriodicUpdateCheck(this, globalCfg.gui.lastUpdateCheck, globalCfg.gui.lastOnlineVersion, result.get()); + }); + } } diff --git a/FreeFileSync/Source/ui/main_dlg.h b/FreeFileSync/Source/ui/main_dlg.h index 2f99a62e..5d1aebf7 100644 --- a/FreeFileSync/Source/ui/main_dlg.h +++ b/FreeFileSync/Source/ui/main_dlg.h @@ -8,10 +8,10 @@ #define MAINDIALOG_H_891048132454564 #include <map> -#include <set> +#include <list> #include <stack> #include <memory> -#include <zen/async_task.h> +#include <wx+/async_task.h> #include <wx+/file_drop.h> #include <wx/aui/aui.h> #include "gui_generated.h" @@ -123,14 +123,6 @@ private: void openExternalApplication(const wxString& commandline, const std::vector<zen::FileSystemObject*>& selection, bool leftSide); //selection may be empty - //don't use wxWidgets idle handling => repeated idle requests/consumption hogs 100% cpu! - void onProcessAsyncTasks(wxEvent& event); - - template <class Fun, class Fun2> - void processAsync(Fun doAsync, Fun2 evalOnGui) { asyncTasks.add(doAsync, evalOnGui); timerForAsyncTasks.Start(50); /*timer interval in [ms] */ } - template <class Fun, class Fun2> - void processAsync2(Fun doAsync, Fun2 evalOnGui) { asyncTasks.add2(doAsync, evalOnGui); timerForAsyncTasks.Start(50); /*timer interval in [ms] */ } - //status bar supports one of the following two states at a time: void setStatusBarFileStatistics(size_t filesOnLeftView, size_t foldersOnLeftView, size_t filesOnRightView, size_t foldersOnRightView, std::uint64_t filesizeLeftView, std::uint64_t filesizeRightView); //void setStatusBarFullText(const wxString& msg); @@ -324,21 +316,19 @@ private: wxString defaultPerspective; - std::int64_t manualTimeSpanFrom; - std::int64_t manualTimeSpanTo; //buffer manual time span selection at session level + std::int64_t manualTimeSpanFrom = 0; + std::int64_t manualTimeSpanTo = 0; //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! - //schedule and run long-running tasks asynchronously, but process results on GUI queue - zen::AsyncTasks asyncTasks; - wxTimer timerForAsyncTasks; //don't use wxWidgets idle handling => repeated idle requests/consumption hogs 100% cpu! + zen::AsyncGuiQueue guiQueue; //schedule and run long-running tasks asynchronously, but process results on GUI queue std::unique_ptr<zen::FilterConfig> filterCfgOnClipboard; //copy/paste of filter config - wxWindow* focusWindowAfterSearch; //used to restore focus after search panel is closed + wxWindow* focusWindowAfterSearch = nullptr; //used to restore focus after search panel is closed - bool localKeyEventsEnabled; + bool localKeyEventsEnabled = true; }; #endif //MAINDIALOG_H_891048132454564 diff --git a/FreeFileSync/Source/ui/progress_indicator.cpp b/FreeFileSync/Source/ui/progress_indicator.cpp index e334bb14..044be243 100644 --- a/FreeFileSync/Source/ui/progress_indicator.cpp +++ b/FreeFileSync/Source/ui/progress_indicator.cpp @@ -47,12 +47,13 @@ using namespace zen; namespace { -const int GAUGE_FULL_RANGE = 50000; - //window size used for statistics in milliseconds const int WINDOW_REMAINING_TIME_MS = 60000; //USB memory stick scenario can have drop outs of 40 seconds => 60 sec. window size handles it const int WINDOW_BYTES_PER_SEC = 5000; // +const int GAUGE_FULL_RANGE = 50000; + + //don't use wxStopWatch for long-running measurements: internally it uses ::QueryPerformanceCounter() which can overflow after only a few days: //https://sourceforge.net/p/freefilesync/discussion/help/thread/5d62339e @@ -93,7 +94,7 @@ public: } private: - long long startTime = wxGetUTCTimeMillis().GetValue(); //alas no a steady clock, but something's got to give! + wxLongLong_t startTime = wxGetUTCTimeMillis().GetValue(); //alas not a steady clock, but something's got to give! bool paused = false; int64_t elapsedUntilPause = 0; }; @@ -149,23 +150,21 @@ private: wxString titleTextBackup; StopWatch timeElapsed; - int64_t binCompStartMs; //begin of binary comparison phase in [ms] + int64_t binCompStartMs = 0; //begin of binary comparison phase in [ms] - const Statistics* syncStat_; //only bound while sync is running + const Statistics* syncStat_ = nullptr; //only bound while sync is running std::unique_ptr<Taskbar> taskbar_; std::unique_ptr<PerfCheck> perf; //estimate remaining time - int64_t timeLastSpeedEstimateMs; //used for calculating intervals between showing and collecting perf samples + int64_t timeLastSpeedEstimateMs = -1000000; //used for calculating intervals between showing and collecting perf samples + //initial value: just some big number }; CompareProgressDialog::Pimpl::Pimpl(wxFrame& parentWindow) : CompareProgressDlgGenerated(&parentWindow), - parentWindow_(parentWindow), - binCompStartMs(0), - syncStat_(nullptr), - timeLastSpeedEstimateMs(-1000000) //some big number + parentWindow_(parentWindow) { //make sure that standard height matches PHASE_COMPARING_CONTENT statistics layout m_staticTextItemsFoundLabel->Hide(); @@ -186,7 +185,7 @@ void CompareProgressDialog::Pimpl::init(const Statistics& syncStat) try //try to get access to Windows 7/Ubuntu taskbar { - taskbar_ = make_unique<Taskbar>(parentWindow_); + taskbar_ = std::make_unique<Taskbar>(parentWindow_); } catch (const TaskbarNotAvailable&) {} @@ -228,7 +227,7 @@ void CompareProgressDialog::Pimpl::teardown() void CompareProgressDialog::Pimpl::switchToCompareBytewise() { //start to measure perf - perf = make_unique<PerfCheck>(WINDOW_REMAINING_TIME_MS, WINDOW_BYTES_PER_SEC); + perf = std::make_unique<PerfCheck>(WINDOW_REMAINING_TIME_MS, WINDOW_BYTES_PER_SEC); timeLastSpeedEstimateMs = -1000000; //some big number binCompStartMs = timeElapsed.timeMs(); @@ -400,7 +399,7 @@ bool isComponentOf(const wxWindow* child, const wxWindow* top) inline wxBitmap getImageButtonPressed(const wchar_t* name) { - return layOver(getResourceImage(name), getResourceImage(L"log button pressed")); + return layOver(getResourceImage(L"log button pressed"), getResourceImage(name)); } @@ -779,9 +778,9 @@ private: //else //switch (keyCode) //{ - // case WXK_RETURN: - // case WXK_NUMPAD_ENTER: - // return; + // case WXK_RETURN: + // case WXK_NUMPAD_ENTER: + // return; //} event.Skip(); //unknown keypress: propagate @@ -1001,7 +1000,7 @@ private: static const size_t MAX_BUFFER_SIZE = 2500000; //sizeof(single node) worst case ~ 3 * 8 byte ptr + 16 byte key/value = 40 byte - std::map<int64_t, double> samples; //time, unit: [ms] !don't use std::multimap, see getLessEq() + std::map <int64_t, double> samples; //time, unit: [ms] !don't use std::multimap, see getLessEq() std::pair<int64_t, double> lastSample; //artificial most current record at the end of samples to visualize current time! }; @@ -1009,8 +1008,6 @@ private: class CurveDataRectangleArea : public CurveData { public: - CurveDataRectangleArea() : x_(), y_() {} - void setValue (double x, double y) { x_ = x; y_ = y; } void setValueX(double x) { x_ = x; } double getValueX() const { return x_; } @@ -1025,8 +1022,8 @@ private: points.emplace_back(x_, 0); } - double x_; //time elapsed in seconds - double y_; //items/bytes processed + double x_ = 0; //time elapsed in seconds + double y_ = 0; //items/bytes processed }; @@ -1118,8 +1115,8 @@ template <class TopLevelDialog> //can be a wxFrame or wxDialog class SyncProgressDialogImpl : public TopLevelDialog, public SyncProgressDialog /*we need derivation, not composition! 1. SyncProgressDialogImpl IS a wxFrame/wxDialog - 2. implement virtual ~wxFrame() - 3. event handling below assumes lifetime is larger-equal than wxFrame's + 2. implement virtual ~wxFrame() + 3. event handling below assumes lifetime is larger-equal than wxFrame's */ { public: @@ -1274,7 +1271,7 @@ SyncProgressDialogImpl<TopLevelDialog>::SyncProgressDialogImpl(long style, //wxF if (wxFrame* frame = getTaskbarFrame(*this)) try //try to get access to Windows 7/Ubuntu taskbar { - taskbar_ = make_unique<Taskbar>(*frame); //throw TaskbarNotAvailable + taskbar_ = std::make_unique<Taskbar>(*frame); //throw TaskbarNotAvailable } catch (const TaskbarNotAvailable&) {} @@ -1433,7 +1430,7 @@ void SyncProgressDialogImpl<TopLevelDialog>::initNewPhase() notifyProgressChange(); //make sure graphs get initial values //start new measurement - perf = make_unique<PerfCheck>(WINDOW_REMAINING_TIME_MS, WINDOW_BYTES_PER_SEC); + perf = std::make_unique<PerfCheck>(WINDOW_REMAINING_TIME_MS, WINDOW_BYTES_PER_SEC); timeLastSpeedEstimateMs = -1000000; //some big number phaseStartMs = timeElapsed.timeMs(); @@ -2034,28 +2031,28 @@ template <class TopLevelDialog> void SyncProgressDialogImpl<TopLevelDialog>::OnIconize(wxIconizeEvent& event) { /* - propagate progress dialog minimize/maximize to parent - ----------------------------------------------------- + propagate progress dialog minimize/maximize to parent + ----------------------------------------------------- Fedora/Debian/Ubuntu: - - wxDialog cannot be minimized - - worse, wxGTK sends stray iconize events *after* wxDialog::Destroy() - - worse, on Fedora an iconize event is issued directly after calling Close() - - worse, even wxDialog::Hide() causes iconize event! - => nothing to do - SUSE: - - wxDialog can be minimized (it just vanishes!) and in general also minimizes parent: except for our progress wxDialog!!! - - worse, wxDialog::Hide() causes iconize event - - probably the same issues with stray iconize events like Fedora/Debian/Ubuntu - - minimize button is always shown, even if wxMINIMIZE_BOX is omitted! - => nothing to do - Mac OS X: - - wxDialog can be minimized and automatically minimizes parent - - no iconize events seen by wxWidgets! - => nothing to do - Windows: - - wxDialog can be minimized but does not also minimize parent - - iconize events only seen for manual minimize - => propagate event to parent + - wxDialog cannot be minimized + - worse, wxGTK sends stray iconize events *after* wxDialog::Destroy() + - worse, on Fedora an iconize event is issued directly after calling Close() + - worse, even wxDialog::Hide() causes iconize event! + => nothing to do + SUSE: + - wxDialog can be minimized (it just vanishes!) and in general also minimizes parent: except for our progress wxDialog!!! + - worse, wxDialog::Hide() causes iconize event + - probably the same issues with stray iconize events like Fedora/Debian/Ubuntu + - minimize button is always shown, even if wxMINIMIZE_BOX is omitted! + => nothing to do + Mac OS X: + - wxDialog can be minimized and automatically minimizes parent + - no iconize events seen by wxWidgets! + => nothing to do + Windows: + - wxDialog can be minimized but does not also minimize parent + - iconize events only seen for manual minimize + => propagate event to parent */ #ifdef ZEN_WIN if (parentFrame_) @@ -2071,7 +2068,7 @@ void SyncProgressDialogImpl<TopLevelDialog>::minimizeToTray() { if (!trayIcon.get()) { - trayIcon = make_unique<FfsTrayIcon>([this] { this->resumeFromSystray(); }); //FfsTrayIcon lifetime is a subset of "this"'s lifetime! + trayIcon = std::make_unique<FfsTrayIcon>([this] { this->resumeFromSystray(); }); //FfsTrayIcon lifetime is a subset of "this"'s lifetime! //we may destroy FfsTrayIcon even while in the FfsTrayIcon callback!!!! updateGuiInt(false); //set tray tooltip + progress: e.g. no updates while paused diff --git a/FreeFileSync/Source/ui/small_dlgs.cpp b/FreeFileSync/Source/ui/small_dlgs.cpp index 26679fa5..4023d3ba 100644 --- a/FreeFileSync/Source/ui/small_dlgs.cpp +++ b/FreeFileSync/Source/ui/small_dlgs.cpp @@ -29,6 +29,7 @@ #include "../version/version.h" #ifdef ZEN_WIN_VISTA_AND_LATER + #include "sftp_folder_picker.h" #include "../fs/sftp.h" #endif #ifdef ZEN_WIN @@ -94,8 +95,12 @@ AboutDlg::AboutDlg(wxWindow* parent) : AboutDlgGenerated(parent) #error what is going on? #endif - build += zen::is64BitBuild ? L" x64" : L" x86"; - static_assert(zen::is32BitBuild || zen::is64BitBuild, ""); + build += +#ifdef ZEN_BUILD_32BIT + L" x86"; +#elif defined ZEN_BUILD_64BIT + L" x64"; +#endif GetSizer()->SetSizeHints(this); //~=Fit() + SetMinSize() @@ -157,7 +162,11 @@ private: void OnCancel(wxCommandEvent& event) override { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } void OnClose (wxCloseEvent& event) override { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } void OnToggleShowPassword(wxCommandEvent& event) override; + void OnBrowseSftpFolder (wxCommandEvent& event) override; + + std::pair<SftpLoginInfo, Zstring> getSftpLogin() const; + //output-only parameters: Zstring& folderPathPhraseOut; }; @@ -175,7 +184,7 @@ SftpSetupDlg::SftpSetupDlg(wxWindow* parent, Zstring& folderPathPhrase) : SftpSe if (acceptsFolderPathPhraseSftp(folderPathPhrase)) //noexcept { - auto res = getResolvedSftpPath(folderPathPhrase); //noexcept + const auto res = getResolvedSftpPath(folderPathPhrase); //noexcept const SftpLoginInfo login = res.first; const Zstring serverRelPath = res.second; @@ -212,7 +221,7 @@ void SftpSetupDlg::OnToggleShowPassword(wxCommandEvent& event) } -void SftpSetupDlg::OnOkay(wxCommandEvent& event) +std::pair<SftpLoginInfo, Zstring /*host-relative path*/> SftpSetupDlg::getSftpLogin() const { SftpLoginInfo login = {}; login.server = utfCvrtTo<Zstring>(m_textCtrlServer ->GetValue()); @@ -222,11 +231,30 @@ void SftpSetupDlg::OnOkay(wxCommandEvent& event) Zstring serverRelPath = utfCvrtTo<Zstring>(m_textCtrlServerPath->GetValue()); - trim(login.server); - trim(login.username); - trim(serverRelPath); + return std::make_pair(login, serverRelPath); //noexcept +} + + +void SftpSetupDlg::OnBrowseSftpFolder(wxCommandEvent& event) +{ + const auto res = getSftpLogin(); + const SftpLoginInfo login = res.first; + Zstring serverRelPath = res.second; + + if (showSftpFolderPicker(this, login, serverRelPath) == ReturnSftpPicker::BUTTON_OKAY) + { + m_textCtrlServerPath->ChangeValue(utfCvrtTo<wxString>(serverRelPath)); + } +} + + +void SftpSetupDlg::OnOkay(wxCommandEvent& event) +{ + const auto res = getSftpLogin(); + const SftpLoginInfo login = res.first; + const Zstring serverRelPath = res.second; - folderPathPhraseOut = assembleSftpFolderPathPhrase(login, serverRelPath); //noexcept + folderPathPhraseOut = condenseToSftpFolderPathPhrase(login, serverRelPath); //noexcept EndModal(ReturnSmallDlg::BUTTON_OKAY); } @@ -236,7 +264,6 @@ ReturnSmallDlg::ButtonPressed zen::showSftpSetupDialog(wxWindow* parent, Zstring { SftpSetupDlg setupDlg(parent, folderPathPhrase); return static_cast<ReturnSmallDlg::ButtonPressed>(setupDlg.ShowModal()); - } #endif @@ -258,12 +285,13 @@ private: void OnCancel(wxCommandEvent& event) override { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } void OnClose (wxCloseEvent& event) override { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } - Zstring& outLastUsedPath; - bool& outKeepRelPaths; - bool& outOverwriteIfExists; - std::unique_ptr<FolderSelector> targetFolder; //always bound std::shared_ptr<FolderHistory> folderHistory_; + + //output-only parameters: + Zstring& lastUsedPathOut; + bool& keepRelPathsOut; + bool& overwriteIfExistsOut; }; @@ -275,10 +303,10 @@ CopyToDialog::CopyToDialog(wxWindow* parent, bool& keepRelPaths, bool& overwriteIfExists) : CopyToDlgGenerated(parent), - outLastUsedPath(lastUsedPath), - outKeepRelPaths(keepRelPaths), - outOverwriteIfExists(overwriteIfExists), - folderHistory_(folderHistory) + folderHistory_(folderHistory), + lastUsedPathOut(lastUsedPath), + keepRelPathsOut(keepRelPaths), + overwriteIfExistsOut(overwriteIfExists) { #ifdef ZEN_WIN new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" @@ -291,7 +319,7 @@ CopyToDialog::CopyToDialog(wxWindow* parent, m_bitmapCopyTo->SetBitmap(getResourceImage(L"copy_to")); - targetFolder = make_unique<FolderSelector>(*this, *m_buttonSelectTargetFolder, *m_bpButtonSelectAltTargetFolder, *m_targetFolderPath, nullptr /*staticText*/, nullptr /*wxWindow*/); + targetFolder = std::make_unique<FolderSelector>(*this, *m_buttonSelectTargetFolder, *m_bpButtonSelectAltTargetFolder, *m_targetFolderPath, nullptr /*staticText*/, nullptr /*wxWindow*/); m_targetFolderPath->init(folderHistory_); @@ -340,11 +368,11 @@ void CopyToDialog::OnOK(wxCommandEvent& event) } //------------------------------------------------------------- - outLastUsedPath = targetFolder->getPath(); - outKeepRelPaths = m_checkBoxKeepRelPath->GetValue(); - outOverwriteIfExists = m_checkBoxOverwriteIfExists->GetValue(); + lastUsedPathOut = targetFolder->getPath(); + keepRelPathsOut = m_checkBoxKeepRelPath->GetValue(); + overwriteIfExistsOut = m_checkBoxOverwriteIfExists->GetValue(); - folderHistory_->addItem(outLastUsedPath); + folderHistory_->addItem(lastUsedPathOut); EndModal(ReturnSmallDlg::BUTTON_OKAY); } @@ -389,8 +417,10 @@ private: const std::vector<zen::FileSystemObject*>& rowsToDeleteOnLeft; const std::vector<zen::FileSystemObject*>& rowsToDeleteOnRight; - bool& outRefuseRecycleBin; const TickVal tickCountStartup; + + //output-only parameters: + bool& useRecycleBinOut; }; @@ -401,8 +431,8 @@ DeleteDialog::DeleteDialog(wxWindow* parent, DeleteDlgGenerated(parent), rowsToDeleteOnLeft(rowsOnLeft), rowsToDeleteOnRight(rowsOnRight), - outRefuseRecycleBin(useRecycleBin), - tickCountStartup(getTicks()) + tickCountStartup(getTicks()), + useRecycleBinOut(useRecycleBin) { #ifdef ZEN_WIN new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" @@ -477,7 +507,7 @@ void DeleteDialog::OnOK(wxCommandEvent& event) if (dist(tickCountStartup, now) * 1000 / tps < 50) return; - outRefuseRecycleBin = m_checkBoxUseRecycler->GetValue(); + useRecycleBinOut = m_checkBoxUseRecycler->GetValue(); EndModal(ReturnSmallDlg::BUTTON_OKAY); } @@ -512,7 +542,8 @@ private: void OnCancel (wxCommandEvent& event) override { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } void OnClose (wxCloseEvent& event) override { EndModal(ReturnSmallDlg::BUTTON_CANCEL); } - bool& m_dontShowAgain; + //output-only parameters: + bool& dontShowAgainOut; }; @@ -521,7 +552,7 @@ SyncConfirmationDlg::SyncConfirmationDlg(wxWindow* parent, const SyncStatistics& st, bool& dontShowAgain) : SyncConfirmationDlgGenerated(parent), - m_dontShowAgain(dontShowAgain) + dontShowAgainOut(dontShowAgain) { #ifdef ZEN_WIN new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" @@ -573,7 +604,7 @@ SyncConfirmationDlg::SyncConfirmationDlg(wxWindow* parent, void SyncConfirmationDlg::OnStartSync(wxCommandEvent& event) { - m_dontShowAgain = m_checkBoxDontShowAgain->GetValue(); + dontShowAgainOut = m_checkBoxDontShowAgain->GetValue(); EndModal(ReturnSmallDlg::BUTTON_OKAY); } @@ -614,14 +645,16 @@ private: void setExtApp(const xmlAccess::ExternalApps& extApp); xmlAccess::ExternalApps getExtApp() const; - xmlAccess::XmlGlobalSettings& settings; std::map<std::wstring, std::wstring> descriptionTransToEng; //"translated description" -> "english" mapping for external application config + + //output-only parameters: + xmlAccess::XmlGlobalSettings& globalSettingsOut; }; OptionsDlg::OptionsDlg(wxWindow* parent, xmlAccess::XmlGlobalSettings& globalSettings) : OptionsDlgGenerated(parent), - settings(globalSettings) + globalSettingsOut(globalSettings) { #ifdef ZEN_WIN new zen::MouseMoveWindow(*this); //allow moving dialog by clicking (nearly) anywhere...; ownership passed to "this" @@ -710,15 +743,15 @@ void OptionsDlg::updateGui() void OptionsDlg::OnOkay(wxCommandEvent& event) { - //write settings only when okay-button is pressed! - settings.failsafeFileCopy = m_checkBoxFailSafe->GetValue(); - settings.copyLockedFiles = m_checkBoxCopyLocked->GetValue(); - settings.copyFilePermissions = m_checkBoxCopyPermissions->GetValue(); + //write settings only when okay-button is pressed (except hidden dialog reset)! + globalSettingsOut.failsafeFileCopy = m_checkBoxFailSafe->GetValue(); + globalSettingsOut.copyLockedFiles = m_checkBoxCopyLocked->GetValue(); + globalSettingsOut.copyFilePermissions = m_checkBoxCopyPermissions->GetValue(); - settings.automaticRetryCount = m_spinCtrlAutoRetryCount->GetValue(); - settings.automaticRetryDelay = m_spinCtrlAutoRetryDelay->GetValue(); + globalSettingsOut.automaticRetryCount = m_spinCtrlAutoRetryCount->GetValue(); + globalSettingsOut.automaticRetryDelay = m_spinCtrlAutoRetryDelay->GetValue(); - settings.gui.externelApplications = getExtApp(); + globalSettingsOut.gui.externelApplications = getExtApp(); EndModal(ReturnSmallDlg::BUTTON_OKAY); } @@ -731,7 +764,7 @@ void OptionsDlg::OnResetDialogs(wxCommandEvent& event) _("&Show"))) { case ConfirmationButton::DO_IT: - settings.optDialogs.resetDialogs(); + globalSettingsOut.optDialogs = xmlAccess::OptionalDialogs(); break; case ConfirmationButton::CANCEL: break; @@ -862,27 +895,16 @@ private: m_calendarFrom->SetDate(m_calendarTo->GetDate()); } - std::int64_t& timeFrom_; - std::int64_t& timeTo_; + //output-only parameters: + std::int64_t& timeFromOut; + std::int64_t& timeToOut; }; -wxDateTime utcToLocalDateTime(time_t utcTime) -{ - //wxDateTime models local(!) time (in contrast to what documentation says), but this constructor takes time_t UTC - return wxDateTime(utcTime); -} - -time_t localDateTimeToUtc(const wxDateTime& localTime) -{ - return localTime.GetTicks(); -} - - SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, std::int64_t& timeFrom, std::int64_t& timeTo) : SelectTimespanDlgGenerated(parent), - timeFrom_(timeFrom), - timeTo_(timeTo) + timeFromOut(timeFrom), + timeToOut(timeTo) { #ifdef ZEN_WIN new zen::MouseMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere...; ownership passed to "this" @@ -908,13 +930,17 @@ SelectTimespanDlg::SelectTimespanDlg(wxWindow* parent, std::int64_t& timeFrom, s m_calendarTo ->SetWindowStyleFlag(style); //set default values - if (timeTo_ == 0) - timeTo_ = wxGetUTCTime(); // - if (timeFrom_ == 0) - timeFrom_ = timeTo_ - 7 * 24 * 3600; //default time span: one week from "now" + std::int64_t timeFromTmp = timeFrom; + std::int64_t timeToTmp = timeTo; - m_calendarFrom->SetDate(utcToLocalDateTime(timeFrom_)); - m_calendarTo ->SetDate(utcToLocalDateTime(timeTo_)); + if (timeToTmp == 0) + timeToTmp = std::time(nullptr); // + if (timeFromTmp == 0) + timeFromTmp = timeToTmp - 7 * 24 * 3600; //default time span: one week from "now" + + //wxDateTime models local(!) time (in contrast to what documentation says), but it has a constructor taking time_t UTC + m_calendarFrom->SetDate(static_cast<time_t>(timeFromTmp)); + m_calendarTo ->SetDate(static_cast<time_t>(timeToTmp )); #if wxCHECK_VERSION(2, 9, 5) //doesn't seem to be a problem here: @@ -940,12 +966,12 @@ void SelectTimespanDlg::OnOkay(wxCommandEvent& event) //align to full days from.ResetTime(); - to += wxTimeSpan::Day(); to.ResetTime(); //reset local(!) time + to += wxTimeSpan::Day(); to -= wxTimeSpan::Second(); //go back to end of previous day - timeFrom_ = localDateTimeToUtc(from); - timeTo_ = localDateTimeToUtc(to); + timeFromOut = from.GetTicks(); + timeToOut = to .GetTicks(); /* { diff --git a/FreeFileSync/Source/ui/small_dlgs.h b/FreeFileSync/Source/ui/small_dlgs.h index 01d6f21c..d6db883f 100644 --- a/FreeFileSync/Source/ui/small_dlgs.h +++ b/FreeFileSync/Source/ui/small_dlgs.h @@ -4,8 +4,8 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef SMALLDIALOGS_H_INCLUDED -#define SMALLDIALOGS_H_INCLUDED +#ifndef SMALLDIALOGS_H_8321790875018750245 +#define SMALLDIALOGS_H_8321790875018750245 #include <wx/window.h> #include "../lib/process_xml.h" @@ -59,6 +59,4 @@ ReturnSmallDlg::ButtonPressed showSelectTimespanDlg(wxWindow* parent, std::int64 #endif } -#endif // SMALLDIALOGS_H_INCLUDED - - +#endif //SMALLDIALOGS_H_8321790875018750245 diff --git a/FreeFileSync/Source/ui/sync_cfg.cpp b/FreeFileSync/Source/ui/sync_cfg.cpp index f8b7cb99..fee76629 100644 --- a/FreeFileSync/Source/ui/sync_cfg.cpp +++ b/FreeFileSync/Source/ui/sync_cfg.cpp @@ -209,9 +209,9 @@ ConfigDialog::ConfigDialog(wxWindow* parent, GlobalSyncConfig& globalCfg, size_t onCompletionHistoryMax) : ConfigDlgGenerated(parent), + versioningFolder(*m_panelVersioning, *m_buttonSelectVersioningFolder, *m_bpButtonSelectAltFolder, *m_versioningFolderPath, nullptr /*staticText*/, nullptr /*wxWindow*/), globalCfgOut(globalCfg), folderPairConfigOut(folderPairConfig), - versioningFolder(*m_panelVersioning, *m_buttonSelectVersioningFolder, *m_bpButtonSelectAltFolder, *m_versioningFolderPath, nullptr /*staticText*/, nullptr /*wxWindow*/), globalCfg_(globalCfg), folderPairConfig_(folderPairConfig), onCompletionHistoryMax_(onCompletionHistoryMax) @@ -226,7 +226,7 @@ ConfigDialog::ConfigDialog(wxWindow* parent, //fill image list to cope with wxNotebook image setting design desaster... const int imageListSize = getResourceImage(L"cfg_compare_small").GetHeight(); assert(imageListSize == 16); //Windows default size for panel caption - auto imgList = make_unique<wxImageList>(imageListSize, imageListSize); + auto imgList = std::make_unique<wxImageList>(imageListSize, imageListSize); auto addToImageList = [&](const wxBitmap& bmp) { @@ -235,13 +235,13 @@ ConfigDialog::ConfigDialog(wxWindow* parent, imgList->Add(bmp); imgList->Add(greyScale(bmp)); }; - //make sure to add images in same sequence as ConfigTypeImage enum!!! + //add images in same sequence like ConfigTypeImage enum!!! addToImageList(getResourceImage(L"cfg_compare_small")); addToImageList(getResourceImage(L"filter_small" )); addToImageList(getResourceImage(L"cfg_sync_small" )); assert(imgList->GetImageCount() == static_cast<int>(ConfigTypeImage::SYNC_GREY) + 1); - m_notebook->AssignImageList(imgList.release()); //notebook takes ownership + m_notebook->AssignImageList(imgList.release()); //pass ownership m_notebook->SetPageText(static_cast<size_t>(SyncConfigPanel::COMPARISON), _("Comparison") + L" (F6)"); m_notebook->SetPageText(static_cast<size_t>(SyncConfigPanel::FILTER ), _("Filter") + L" (F7)"); diff --git a/FreeFileSync/Source/ui/taskbar.cpp b/FreeFileSync/Source/ui/taskbar.cpp index b12d6a06..73409419 100644 --- a/FreeFileSync/Source/ui/taskbar.cpp +++ b/FreeFileSync/Source/ui/taskbar.cpp @@ -194,7 +194,7 @@ public: //######################################################################################################## -Taskbar::Taskbar(const wxFrame& window) : pimpl_(zen::make_unique<Pimpl>(window)) {} //throw TaskbarNotAvailable +Taskbar::Taskbar(const wxFrame& window) : pimpl_(std::make_unique<Pimpl>(window)) {} //throw TaskbarNotAvailable Taskbar::~Taskbar() {} void Taskbar::setStatus(Status status) { pimpl_->setStatus(status); } diff --git a/FreeFileSync/Source/ui/tray_icon.cpp b/FreeFileSync/Source/ui/tray_icon.cpp index 3a4de1b0..54dbbfff 100644 --- a/FreeFileSync/Source/ui/tray_icon.cpp +++ b/FreeFileSync/Source/ui/tray_icon.cpp @@ -173,7 +173,7 @@ private: //void OnLeftDownClick(wxEvent& event) //{ - // //copied from wxTaskBarIconBase::OnRightButtonDown() + // //copied from wxTaskBarIconBase::OnRightButtonDown() // if (wxMenu* menu = CreatePopupMenu()) // { // PopupMenu(menu); diff --git a/FreeFileSync/Source/ui/tree_view.cpp b/FreeFileSync/Source/ui/tree_view.cpp index 294c9ee9..981bbdb2 100644 --- a/FreeFileSync/Source/ui/tree_view.cpp +++ b/FreeFileSync/Source/ui/tree_view.cpp @@ -681,7 +681,7 @@ std::unique_ptr<TreeView::Node> TreeView::getLine(size_t row) const case TreeView::TYPE_ROOT: { const auto& root = *static_cast<const TreeView::RootNodeImpl*>(flatTree[row].node_); - return zen::make_unique<TreeView::RootNode>(percent, root.bytesGross, root.itemCountGross, getStatus(row), *root.baseDirObj, root.displayName); + return std::make_unique<TreeView::RootNode>(percent, root.bytesGross, root.itemCountGross, getStatus(row), *root.baseDirObj, root.displayName); } break; @@ -689,7 +689,7 @@ std::unique_ptr<TreeView::Node> TreeView::getLine(size_t row) const { const auto* dir = static_cast<const TreeView::DirNodeImpl*>(flatTree[row].node_); if (auto dirObj = dynamic_cast<DirPair*>(FileSystemObject::retrieve(dir->objId))) - return zen::make_unique<TreeView::DirNode>(percent, dir->bytesGross, dir->itemCountGross, level, getStatus(row), *dirObj); + return std::make_unique<TreeView::DirNode>(percent, dir->bytesGross, dir->itemCountGross, level, getStatus(row), *dirObj); } break; @@ -710,7 +710,7 @@ std::unique_ptr<TreeView::Node> TreeView::getLine(size_t row) const if (lastViewFilterPred(fsObj)) filesAndLinks.push_back(&fsObj); - return zen::make_unique<TreeView::FilesNode>(percent, parentDir->bytesNet, parentDir->itemCountNet, level, filesAndLinks); + return std::make_unique<TreeView::FilesNode>(percent, parentDir->bytesNet, parentDir->itemCountNet, level, filesAndLinks); } } break; diff --git a/FreeFileSync/Source/ui/triple_splitter.cpp b/FreeFileSync/Source/ui/triple_splitter.cpp index 81bf5579..22e9b5d6 100644 --- a/FreeFileSync/Source/ui/triple_splitter.cpp +++ b/FreeFileSync/Source/ui/triple_splitter.cpp @@ -174,7 +174,7 @@ void TripleSplitter::onMouseLeftDown(wxMouseEvent& event) const int posX = event.GetPosition().x; if (hitOnSashLine(posX)) - activeMove = zen::make_unique<SashMove>(*this, posX, centerOffset); + activeMove = std::make_unique<SashMove>(*this, posX, centerOffset); event.Skip(); } diff --git a/FreeFileSync/Source/ui/triple_splitter.h b/FreeFileSync/Source/ui/triple_splitter.h index cb834b34..7acae675 100644 --- a/FreeFileSync/Source/ui/triple_splitter.h +++ b/FreeFileSync/Source/ui/triple_splitter.h @@ -15,14 +15,14 @@ //a not-so-crappy splitter window /* manage three contained windows: - 1. left and right window are stretched - 2. middle window is fixed size - 3. middle window position can be changed via mouse with two sash lines - ----------------- - | | | | - | | | | - | | | | - ----------------- + 1. left and right window are stretched + 2. middle window is fixed size + 3. middle window position can be changed via mouse with two sash lines + ----------------- + | | | | + | | | | + | | | | + ----------------- */ namespace zen diff --git a/FreeFileSync/Source/ui/version_check.cpp b/FreeFileSync/Source/ui/version_check.cpp index 1855a6c4..691cf896 100644 --- a/FreeFileSync/Source/ui/version_check.cpp +++ b/FreeFileSync/Source/ui/version_check.cpp @@ -10,8 +10,10 @@ #include <zen/utf.h> #include <zen/scope_guard.h> #include <zen/build_info.h> -#include <wx/timer.h> -#include <wx/utils.h> +#include <zen/basic_math.h> +#include <zen/thread.h> //std::thread::id +//#include <wx/timer.h> +//#include <wx/utils.h> #include <wx+/popup_dlg.h> #include "version_id.h" @@ -22,12 +24,10 @@ #elif defined ZEN_LINUX #include <wx/protocol/http.h> - #include <wx/sstream.h> - #include <wx/utils.h> + // #include <wx/utils.h> #elif defined ZEN_MAC #include <wx/protocol/http.h> - #include <wx/sstream.h> #include <CoreServices/CoreServices.h> //Gestalt() #endif @@ -38,6 +38,8 @@ namespace { std::wstring getIso639Language() { + //respect thread-safety for WinInetAccess => don't use wxWidgets in the Windows build here!!! + #ifdef ZEN_WIN //use a more reliable function than wxWidgets: const int bufSize = 10; wchar_t buf[bufSize] = {}; @@ -48,18 +50,22 @@ std::wstring getIso639Language() if (0 < rv && rv < bufSize) return buf; //MSDN: "This can be a 3-letter code for languages that don't have a 2-letter code"! assert(false); -#endif + return std::wstring(); +#else const std::wstring localeName(wxLocale::GetLanguageCanonicalName(wxLocale::GetSystemLanguage())); if (localeName.empty()) return std::wstring(); assert(beforeLast(localeName, L"_", IF_MISSING_RETURN_ALL).size() == 2); return beforeLast(localeName, L"_", IF_MISSING_RETURN_ALL); +#endif } std::wstring getIso3166Country() { + //respect thread-safety for WinInetAccess => don't use wxWidgets in the Windows build here!!! + #ifdef ZEN_WIN //use a more reliable function than wxWidgets: const int bufSize = 10; wchar_t buf[bufSize] = {}; @@ -70,17 +76,22 @@ std::wstring getIso3166Country() if (0 < rv && rv < bufSize) return buf; //MSDN: "This can also return a number, such as "029" for Caribbean."! assert(false); -#endif + return std::wstring(); +#else const std::wstring localeName(wxLocale::GetLanguageCanonicalName(wxLocale::GetSystemLanguage())); if (localeName.empty()) return std::wstring(); return afterLast(localeName, L"_", IF_MISSING_RETURN_NONE); +#endif } -std::wstring getUserAgentName() //coordinate with on_check_latest_version.php +std::wstring getUserAgentName() { + //1. coordinate with on_check_latest_version.php + //2. respect thread-safety for WinInetAccess => don't use wxWidgets in the Windows build here!!! + std::wstring agentName = std::wstring(L"FreeFileSync (") + zen::ffsVersion; #ifdef ZEN_WIN @@ -110,11 +121,15 @@ std::wstring getUserAgentName() //coordinate with on_check_latest_version.php agentName += #ifdef ZEN_WIN - running64BitWindows() + running64BitWindows() ? L" 64" : L" 32"; + #elif defined ZEN_LINUX || defined ZEN_MAC - zen::is64BitBuild +#ifdef ZEN_BUILD_32BIT + L" 32"; +#elif defined ZEN_BUILD_64BIT + L" 64"; +#endif #endif - ? L" 64" : L" 32"; const std::wstring isoLang = getIso639Language(); const std::wstring isoCountry = getIso3166Country(); @@ -125,183 +140,156 @@ std::wstring getUserAgentName() //coordinate with on_check_latest_version.php return agentName; } -#ifdef ZEN_WIN + class InternetConnectionError {}; -class WinInetAccess //1. uses IE proxy settings! :) 2. follows HTTP redirects by default +#ifdef ZEN_WIN +//WinInet: 1. uses IE proxy settings! :) 2. follows HTTP redirects by default 3. swallows https +std::string readBytesFromUrl(const wchar_t* url) //throw InternetConnectionError { -public: - WinInetAccess(const wchar_t* url) //throw InternetConnectionError (if url cannot be reached; no need to also call readBytes()) + //::InternetAttemptConnect(0) -> not working as expected: succeeds even when there is no internet connection! + + HINTERNET hInternet = ::InternetOpen(getUserAgentName().c_str(), //_In_ LPCTSTR lpszAgent, + INTERNET_OPEN_TYPE_PRECONFIG, //_In_ DWORD dwAccessType, + nullptr, //_In_ LPCTSTR lpszProxyName, + nullptr, //_In_ LPCTSTR lpszProxyBypass, + 0); //_In_ DWORD dwFlags + if (!hInternet) + throw InternetConnectionError(); + ZEN_ON_SCOPE_EXIT(::InternetCloseHandle(hInternet)); + + HINTERNET hRequest = ::InternetOpenUrl(hInternet, //_In_ HINTERNET hInternet, + url, //_In_ LPCTSTR lpszUrl, + nullptr, //_In_ LPCTSTR lpszHeaders, + 0, //_In_ DWORD dwHeadersLength, + INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_UI, //_In_ DWORD dwFlags, + 0); //_In_ DWORD_PTR dwContext + if (!hRequest) //fails with ERROR_INTERNET_NAME_NOT_RESOLVED if server not found => the server-relative part is checked by HTTP_QUERY_STATUS_CODE below!!! + throw InternetConnectionError(); + ZEN_ON_SCOPE_EXIT(::InternetCloseHandle(hRequest)); + + DWORD statusCode = 0; + DWORD bufferLength = sizeof(statusCode); + if (!::HttpQueryInfo(hRequest, //_In_ HINTERNET hRequest, + HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, //_In_ DWORD dwInfoLevel, + &statusCode, //_Inout_ LPVOID lpvBuffer, + &bufferLength, //_Inout_ LPDWORD lpdwBufferLength, + nullptr)) //_Inout_ LPDWORD lpdwIndex + throw InternetConnectionError(); + + if (statusCode != HTTP_STATUS_OK) + throw InternetConnectionError(); //e.g. 404 - HTTP_STATUS_NOT_FOUND + + std::string buffer; + const DWORD blockSize = 64 * 1024; + //internet says "HttpQueryInfo() + HTTP_QUERY_CONTENT_LENGTH" not supported by all http servers... + for (;;) { - //::InternetAttemptConnect(0) -> not working as expected: succeeds even when there is no internet connection! - - hInternet = ::InternetOpen(getUserAgentName().c_str(), //_In_ LPCTSTR lpszAgent, - INTERNET_OPEN_TYPE_PRECONFIG, //_In_ DWORD dwAccessType, - nullptr, //_In_ LPCTSTR lpszProxyName, - nullptr, //_In_ LPCTSTR lpszProxyBypass, - 0); //_In_ DWORD dwFlags - if (!hInternet) - throw InternetConnectionError(); - zen::ScopeGuard guardInternet = zen::makeGuard([&] { ::InternetCloseHandle(hInternet); }); - - hRequest = ::InternetOpenUrl(hInternet, //_In_ HINTERNET hInternet, - url, //_In_ LPCTSTR lpszUrl, - nullptr, //_In_ LPCTSTR lpszHeaders, - 0, //_In_ DWORD dwHeadersLength, - INTERNET_FLAG_KEEP_CONNECTION | INTERNET_FLAG_RELOAD | INTERNET_FLAG_NO_UI, //_In_ DWORD dwFlags, - 0); //_In_ DWORD_PTR dwContext - if (!hRequest) //won't fail due to unreachable url here! There is no substitute for HTTP_QUERY_STATUS_CODE!!! - throw InternetConnectionError(); - zen::ScopeGuard guardRequest = zen::makeGuard([&] { ::InternetCloseHandle(hRequest); }); - - DWORD statusCode = 0; - DWORD bufferLength = sizeof(statusCode); - if (!::HttpQueryInfo(hRequest, //_In_ HINTERNET hRequest, - HTTP_QUERY_STATUS_CODE | HTTP_QUERY_FLAG_NUMBER, //_In_ DWORD dwInfoLevel, - &statusCode, //_Inout_ LPVOID lpvBuffer, - &bufferLength, //_Inout_ LPDWORD lpdwBufferLength, - nullptr)) //_Inout_ LPDWORD lpdwIndex - throw InternetConnectionError(); + buffer.resize(buffer.size() + blockSize); - if (statusCode != HTTP_STATUS_OK) - throw InternetConnectionError(); //e.g. 404 - HTTP_STATUS_NOT_FOUND + DWORD bytesRead = 0; + if (!::InternetReadFile(hRequest, //_In_ HINTERNET hFile, + &*(buffer.begin() + buffer.size() - blockSize), //_Out_ LPVOID lpBuffer, + blockSize, //_In_ DWORD dwNumberOfBytesToRead, + &bytesRead)) //_Out_ LPDWORD lpdwNumberOfBytesRead + throw InternetConnectionError(); - guardRequest .dismiss(); - guardInternet.dismiss(); - } + if (bytesRead < blockSize) + buffer.resize(buffer.size() - (blockSize - bytesRead)); //caveat: unsigned arithmetics - ~WinInetAccess() - { - ::InternetCloseHandle(hRequest); - ::InternetCloseHandle(hInternet); + if (bytesRead == 0) + return buffer; } - - template <class OutputIterator> - OutputIterator readBytes(OutputIterator result) //throw InternetConnectionError - { - //internet says "HttpQueryInfo() + HTTP_QUERY_CONTENT_LENGTH" not supported by all http servers... - const DWORD bufferSize = 64 * 1024; - std::vector<char> buffer(bufferSize); - for (;;) - { - DWORD bytesRead = 0; - if (!::InternetReadFile(hRequest, //_In_ HINTERNET hFile, - &buffer[0], //_Out_ LPVOID lpBuffer, - bufferSize, //_In_ DWORD dwNumberOfBytesToRead, - &bytesRead)) //_Out_ LPDWORD lpdwNumberOfBytesRead - throw InternetConnectionError(); - if (bytesRead == 0) - return result; - - result = std::copy(buffer.begin(), buffer.begin() + bytesRead, result); - } - } - -private: - HINTERNET hInternet; - HINTERNET hRequest; -}; +} inline -bool canAccessUrl(const wchar_t* url) //throw () +bool internetIsAlive() //noexcept { try { - (void)WinInetAccess(url); //throw InternetConnectionError + readBytesFromUrl(L"http://www.google.com/"); //throw InternetConnectionError return true; } catch (const InternetConnectionError&) { return false; } } +#else +#ifndef NDEBUG + const std::thread::id mainThreadId = std::this_thread::get_id(); +#endif -template <class OutputIterator> inline -OutputIterator readBytesUrl(const wchar_t* url, OutputIterator result) //throw InternetConnectionError +std::string readBytesFromUrl(const wxString& url, int level = 0) //throw InternetConnectionError { - return WinInetAccess(url).readBytes(result); //throw InternetConnectionError -} + assert(std::this_thread::get_id() == mainThreadId); + assert(wxApp::IsMainLoopRunning()); + + wxString urlFmt = url; + assert(!startsWith(urlFmt, L"https:")); //not supported by wxHTTP! + if (startsWith(urlFmt, L"http://")) + urlFmt = afterFirst(urlFmt, L"://", IF_MISSING_RETURN_NONE); + const wxString server = beforeFirst(urlFmt, L'/', IF_MISSING_RETURN_ALL); + const wxString page = L'/' + afterFirst(urlFmt, L'/', IF_MISSING_RETURN_NONE); -#else -inline -bool canAccessUrl(const wxString& server, const wxString& page, int timeout) //throw () -{ - wxWindowDisabler dummy; wxHTTP webAccess; webAccess.SetHeader(L"content-type", L"text/html; charset=utf-8"); webAccess.SetHeader(L"USER-AGENT", getUserAgentName()); - webAccess.SetTimeout(timeout); //default: 10 minutes(WTF are these wxWidgets people thinking???)... + webAccess.SetTimeout(5 /*[s]*/); //default: 10 minutes: WTF are these wxWidgets people thinking??? - if (webAccess.Connect(server)) //will *not* fail for non-reachable url here! - { - std::unique_ptr<wxInputStream> httpStream(webAccess.GetInputStream(page)); //call before checking wxHTTP::GetResponse() - const int rs = webAccess.GetResponse(); - - if (rs == 301 || //http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection - rs == 302 || - rs == 303 || - rs == 307 || - rs == 308) - return true; - - if (rs == 200) //HTTP_STATUS_OK - return true; - } - return false; + if (!webAccess.Connect(server)) //will *not* fail for non-reachable url here! + throw InternetConnectionError(); + + std::unique_ptr<wxInputStream> httpStream(webAccess.GetInputStream(page)); //must be deleted BEFORE webAccess is closed + const int rs = webAccess.GetResponse(); + + if (rs == 301 || //http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection + rs == 302 || + rs == 303 || + rs == 307 || + rs == 308) + if (level < 5) //"A user agent should not automatically redirect a request more than five times, since such redirections usually indicate an infinite loop." + { + const wxString newUrl = webAccess.GetHeader(L"Location"); + if (!newUrl.empty()) + return readBytesFromUrl(newUrl, level + 1); + } + + if (rs != 200 || //HTTP_STATUS_OK + !httpStream || webAccess.GetError() != wxPROTO_NOERR) + throw InternetConnectionError(); + + std::string buffer; + int newValue = 0; + while ((newValue = httpStream->GetC()) != wxEOF) + buffer.push_back(newValue); + return buffer; } -bool getStringFromUrl(const wxString& server, const wxString& page, int timeout, wxString* output, int level = 0) //true on successful connection +inline +bool internetIsAlive() //noexcept { - wxWindowDisabler dummy; + const wxString server = L"www.google.com"; + const wxString page = L"/"; + wxHTTP webAccess; webAccess.SetHeader(L"content-type", L"text/html; charset=utf-8"); - webAccess.SetHeader(L"USER-AGENT", getUserAgentName()); - - webAccess.SetTimeout(timeout); //default: 10 minutes(WTF are these wxWidgets people thinking???)... - - if (webAccess.Connect(server)) //will *not* fail for non-reachable url here! - { - //wxApp::IsMainLoopRunning(); // should return true - - std::unique_ptr<wxInputStream> httpStream(webAccess.GetInputStream(page)); - //must be deleted BEFORE webAccess is closed - const int rs = webAccess.GetResponse(); - - if (rs == 301 || //http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection - rs == 302 || - rs == 303 || - rs == 307 || - rs == 308) - if (level < 5) //"A user agent should not automatically redirect a request more than five times, since such redirections usually indicate an infinite loop." - { + webAccess.SetTimeout(5 /*[s]*/); //default: 10 minutes: WTF are these wxWidgets people thinking??? - wxString newLocation = webAccess.GetHeader(L"Location"); - if (!newLocation.empty()) - { - assert(!startsWith(newLocation, L"https:")); //not supported by wxHTTP! - if (startsWith(newLocation, L"http://")) - newLocation = afterFirst(newLocation, L"://", IF_MISSING_RETURN_NONE); - const wxString serverNew = beforeFirst(newLocation, L'/', IF_MISSING_RETURN_ALL); - const wxString pageNew = L'/' + afterFirst(newLocation, L'/', IF_MISSING_RETURN_NONE); + if (!webAccess.Connect(server)) //will *not* fail for non-reachable url here! + return false; - return getStringFromUrl(serverNew, pageNew, timeout, output, level + 1); - } - } + std::unique_ptr<wxInputStream> httpStream(webAccess.GetInputStream(page)); //call before checking wxHTTP::GetResponse() + const int rs = webAccess.GetResponse(); - if (rs == 200) //HTTP_STATUS_OK - if (httpStream && webAccess.GetError() == wxPROTO_NOERR) - { - if (output) - { - output->clear(); - wxStringOutputStream outStream(output); - httpStream->Read(outStream); - } - return true; - } - } - return false; + return rs == 301 || //http://en.wikipedia.org/wiki/List_of_HTTP_status_codes#3xx_Redirection + rs == 302 || + rs == 303 || + rs == 307 || + rs == 308 || + rs == 200; //HTTP_STATUS_OK + //attention: http://www.google.com/ might redirect to "https" => don't follow, just return "true"!!! } #endif @@ -313,45 +301,36 @@ enum GetVerResult GET_VER_PAGE_NOT_FOUND //version file seems to have moved! => trigger an update! }; -GetVerResult getOnlineVersion(wxString& version) +//access is thread-safe on Windows (WinInet), but not on Linux/OS X (wxWidgets) +GetVerResult getOnlineVersion(std::wstring& version) { -#ifdef ZEN_WIN //internet access supporting proxy connections - std::vector<char> output; try { //harmonize with wxHTTP: latest_version.txt must not use https!!! - readBytesUrl(L"http://www.freefilesync.org/latest_version.txt", std::back_inserter(output)); //throw InternetConnectionError + const std::string buffer = readBytesFromUrl(L"http://www.freefilesync.org/latest_version.txt"); //throw InternetConnectionError + version = utfCvrtTo<std::wstring>(buffer); + trim(version); //Windows: remove trailing blank and newline + return version.empty() ? GET_VER_PAGE_NOT_FOUND : GET_VER_SUCCESS; //empty version possible?? } catch (const InternetConnectionError&) { - return canAccessUrl(L"http://www.google.com/") ? GET_VER_PAGE_NOT_FOUND : GET_VER_NO_CONNECTION; - } - output.push_back('\0'); - version = utfCvrtTo<wxString>(&output[0]); - -#else - if (!getStringFromUrl(L"www.freefilesync.org", L"/latest_version.txt", 5, &version)) - { - return canAccessUrl(L"www.google.com", L"/", 1) ? GET_VER_PAGE_NOT_FOUND : GET_VER_NO_CONNECTION; + return internetIsAlive() ? GET_VER_PAGE_NOT_FOUND : GET_VER_NO_CONNECTION; } -#endif - trim(version); //Windows: remove trailing blank and newline - return version.empty() ? GET_VER_PAGE_NOT_FOUND : GET_VER_SUCCESS; //empty version possible?? } -std::vector<size_t> parseVersion(const wxString& version) +std::vector<size_t> parseVersion(const std::wstring& version) { - std::vector<wxString> digits = split(version, FFS_VERSION_SEPARATOR); + std::vector<std::wstring> digits = split(version, FFS_VERSION_SEPARATOR); std::vector<size_t> output; - std::transform(digits.begin(), digits.end(), std::back_inserter(output), [&](const wxString& d) { return stringTo<size_t>(d); }); + std::transform(digits.begin(), digits.end(), std::back_inserter(output), [&](const std::wstring& d) { return stringTo<size_t>(d); }); return output; } } -bool zen::isNewerFreeFileSyncVersion(const wxString& onlineVersion) +bool zen::haveNewerVersionOnline(const std::wstring& onlineVersion) { std::vector<size_t> current = parseVersion(zen::ffsVersion); std::vector<size_t> online = parseVersion(onlineVersion); @@ -364,26 +343,26 @@ bool zen::isNewerFreeFileSyncVersion(const wxString& onlineVersion) } -bool zen::updateCheckActive(long lastUpdateCheck) +bool zen::updateCheckActive(time_t lastUpdateCheck) { return lastUpdateCheck != getInactiveCheckId(); } -void zen::disableUpdateCheck(long& lastUpdateCheck) +void zen::disableUpdateCheck(time_t& lastUpdateCheck) { lastUpdateCheck = getInactiveCheckId(); } -void zen::checkForUpdateNow(wxWindow* parent, wxString& lastOnlineVersion) +void zen::checkForUpdateNow(wxWindow* parent, std::wstring& lastOnlineVersion) { - wxString onlineVersion; + std::wstring onlineVersion; switch (getOnlineVersion(onlineVersion)) { case GET_VER_SUCCESS: lastOnlineVersion = onlineVersion; - if (isNewerFreeFileSyncVersion(onlineVersion)) + if (haveNewerVersionOnline(onlineVersion)) { switch (showConfirmationDialog(parent, DialogInfoType::INFO, PopupDialogCfg(). setTitle(_("Check for Program Updates")). @@ -427,54 +406,87 @@ void zen::checkForUpdateNow(wxWindow* parent, wxString& lastOnlineVersion) } -void zen::checkForUpdatePeriodically(wxWindow* parent, long& lastUpdateCheck, wxString& lastOnlineVersion, const std::function<void()>& onBeforeInternetAccess) +bool zen::runPeriodicUpdateCheckNow(time_t lastUpdateCheck) { if (updateCheckActive(lastUpdateCheck)) { - if (wxGetLocalTime() >= lastUpdateCheck + 7 * 24 * 3600) //check weekly - { - onBeforeInternetAccess(); //notify client before (potentially) blocking some time - wxString onlineVersion; - switch (getOnlineVersion(onlineVersion)) + static_assert(sizeof(time_t) >= 8, "Still using 32-bit time_t? WTF!!"); + const time_t now = std::time(nullptr); + return numeric::dist(now, lastUpdateCheck) >= 7 * 24 * 3600; //check weekly + } + return false; +} + + +struct zen::UpdateCheckResult +{ +#ifdef ZEN_WIN + GetVerResult versionStatus = GET_VER_PAGE_NOT_FOUND; + std::wstring onlineVersion; +#endif +}; + + +std::shared_ptr<UpdateCheckResult> zen::retrieveOnlineVersion() +{ +#ifdef ZEN_WIN + auto result = std::make_shared<UpdateCheckResult>(); + result->versionStatus = getOnlineVersion(result->onlineVersion); //access is thread-safe on Windows only! + return result; +#else + return nullptr; +#endif +} + + +void zen::evalPeriodicUpdateCheck(wxWindow* parent, time_t& lastUpdateCheck, std::wstring& lastOnlineVersion, const UpdateCheckResult* result) +{ +#ifdef ZEN_WIN + const GetVerResult versionStatus = result->versionStatus; + const std::wstring onlineVersion = result->onlineVersion; +#else + std::wstring onlineVersion; + const GetVerResult versionStatus = getOnlineVersion(onlineVersion); +#endif + + switch (versionStatus) + { + case GET_VER_SUCCESS: + lastUpdateCheck = std::time(nullptr); + lastOnlineVersion = onlineVersion; + + if (haveNewerVersionOnline(onlineVersion)) { - case GET_VER_SUCCESS: - lastUpdateCheck = wxGetLocalTime(); - lastOnlineVersion = onlineVersion; - - if (isNewerFreeFileSyncVersion(onlineVersion)) - { - switch (showConfirmationDialog(parent, DialogInfoType::INFO, PopupDialogCfg(). - setTitle(_("Check for Program Updates")). - setMainInstructions(_("A new version of FreeFileSync is available:") + L" " + onlineVersion + L"\n\n" + _("Download now?")), - _("&Download"))) - { - case ConfirmationButton::DO_IT: - wxLaunchDefaultBrowser(L"http://www.freefilesync.org/get_latest.php"); - break; - case ConfirmationButton::CANCEL: - break; - } - } - break; + switch (showConfirmationDialog(parent, DialogInfoType::INFO, PopupDialogCfg(). + setTitle(_("Check for Program Updates")). + setMainInstructions(_("A new version of FreeFileSync is available:") + L" " + onlineVersion + L"\n\n" + _("Download now?")), + _("&Download"))) + { + case ConfirmationButton::DO_IT: + wxLaunchDefaultBrowser(L"http://www.freefilesync.org/get_latest.php"); + break; + case ConfirmationButton::CANCEL: + break; + } + } + break; - case GET_VER_NO_CONNECTION: - break; //ignore this error - - case GET_VER_PAGE_NOT_FOUND: - lastOnlineVersion = L"unknown"; - switch (showConfirmationDialog(parent, DialogInfoType::ERROR2, PopupDialogCfg(). - setTitle(_("Check for Program Updates")). - setMainInstructions(_("Cannot find current FreeFileSync version number online. Do you want to check manually?")), - _("&Check"))) - { - case ConfirmationButton::DO_IT: - wxLaunchDefaultBrowser(L"http://www.freefilesync.org/get_latest.php"); - break; - case ConfirmationButton::CANCEL: - break; - } + case GET_VER_NO_CONNECTION: + break; //ignore this error + + case GET_VER_PAGE_NOT_FOUND: + lastOnlineVersion = L"unknown"; + switch (showConfirmationDialog(parent, DialogInfoType::ERROR2, PopupDialogCfg(). + setTitle(_("Check for Program Updates")). + setMainInstructions(_("Cannot find current FreeFileSync version number online. Do you want to check manually?")), + _("&Check"))) + { + case ConfirmationButton::DO_IT: + wxLaunchDefaultBrowser(L"http://www.freefilesync.org/get_latest.php"); + break; + case ConfirmationButton::CANCEL: break; } - } + break; } } diff --git a/FreeFileSync/Source/ui/version_check.h b/FreeFileSync/Source/ui/version_check.h index 589e4589..dbc945e8 100644 --- a/FreeFileSync/Source/ui/version_check.h +++ b/FreeFileSync/Source/ui/version_check.h @@ -8,18 +8,27 @@ #define VERSION_CHECK_HEADER_324872374893274983275 #include <functional> +#include <memory> #include <wx/window.h> namespace zen { -void checkForUpdateNow(wxWindow* parent, wxString& lastOnlineVersion); -void checkForUpdatePeriodically(wxWindow* parent, long& lastUpdateCheck, wxString& lastOnlineVersion, const std::function<void()>& onBeforeInternetAccess); //-1: check never +bool updateCheckActive(time_t lastUpdateCheck); +void disableUpdateCheck(time_t& lastUpdateCheck); +bool haveNewerVersionOnline(const std::wstring& onlineVersion); -bool updateCheckActive(long lastUpdateCheck); -void disableUpdateCheck(long& lastUpdateCheck); +void checkForUpdateNow(wxWindow* parent, std::wstring& lastOnlineVersion); -bool isNewerFreeFileSyncVersion(const wxString& onlineVersion); +//periodic update check: +bool runPeriodicUpdateCheckNow(time_t lastUpdateCheck); + +//long-runing part of the check: thread-safe => run asynchronously +struct UpdateCheckResult; +std::shared_ptr<UpdateCheckResult> retrieveOnlineVersion(); + +//eval on gui thread: +void evalPeriodicUpdateCheck(wxWindow* parent, time_t& lastUpdateCheck, std::wstring& lastOnlineVersion, const UpdateCheckResult* result); } #endif //VERSION_CHECK_HEADER_324872374893274983275 diff --git a/FreeFileSync/Source/version/version.h b/FreeFileSync/Source/version/version.h index 2d225043..c0cc4452 100644 --- a/FreeFileSync/Source/version/version.h +++ b/FreeFileSync/Source/version/version.h @@ -3,7 +3,7 @@ namespace zen { -const wchar_t ffsVersion[] = L"7.4"; //internal linkage! +const wchar_t ffsVersion[] = L"7.5"; //internal linkage! const wchar_t FFS_VERSION_SEPARATOR = L'.'; } @@ -1,5 +1,6 @@ A. GNU GENERAL PUBLIC LICENSE B. libssh2 License +C. OpenSSL and SSLeay License A. GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 @@ -665,4 +666,119 @@ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +C. OpenSSL and SSLeay License + +OpenSSL License + +==================================================================== +Copyright (c) 1998-2011 The OpenSSL Project. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + +3. All advertising materials mentioning features or use of this + software must display the following acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit. (http://www.openssl.org/)" + +4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to + endorse or promote products derived from this software without + prior written permission. For written permission, please contact + openssl-core@openssl.org. + +5. Products derived from this software may not be called "OpenSSL" + nor may "OpenSSL" appear in their names without prior written + permission of the OpenSSL Project. + +6. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes software developed by the OpenSSL Project + for use in the OpenSSL Toolkit (http://www.openssl.org/)" + +THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. +==================================================================== + +This product includes cryptographic software written by Eric Young +(eay@cryptsoft.com). This product includes software written by Tim +Hudson (tjh@cryptsoft.com). + +Original SSLeay License + +Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) +All rights reserved. + +This package is an SSL implementation written +by Eric Young (eay@cryptsoft.com). +The implementation was written so as to conform with Netscapes SSL. + +This library is free for commercial and non-commercial use as long as +the following conditions are aheared to. The following conditions +apply to all code found in this distribution, be it the RC4, RSA, +lhash, DES, etc., code; not just the SSL code. The SSL documentation +included with this distribution is covered by the same copyright terms +except that the holder is Tim Hudson (tjh@cryptsoft.com). + +Copyright remains Eric Young's, and as such any Copyright notices in +the code are not to be removed. +If this package is used in a product, Eric Young should be given attribution +as the author of the parts of the library used. +This can be in the form of a textual message at program startup or +in documentation (online or textual) provided with the package. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: +1. Redistributions of source code must retain the copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. All advertising materials mentioning features or use of this software + must display the following acknowledgement: + "This product includes cryptographic software written by + Eric Young (eay@cryptsoft.com)" + The word 'cryptographic' can be left out if the rouines from the library + being used are not cryptographic related :-). +4. If you include any Windows specific code (or a derivative thereof) from + the apps directory (application code) you must include an acknowledgement: + "This product includes software written by Tim Hudson (tjh@cryptsoft.com)" + +THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +The licence and distribution terms for any publically available version or +derivative of this code cannot be changed. i.e. this code cannot simply be +copied and put under another distribution licence +[including the GNU Public Licence.] + END OF TERMS AND CONDITIONS diff --git a/wx+/async_task.h b/wx+/async_task.h new file mode 100644 index 00000000..b23f6948 --- /dev/null +++ b/wx+/async_task.h @@ -0,0 +1,147 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * +// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * +// ************************************************************************** + +#ifndef ASYNC_JOB_839147839170432143214321 +#define ASYNC_JOB_839147839170432143214321 + +#include <functional> +#include <zen/thread.h> +#include <zen/scope_guard.h> +#include <zen/stl_tools.h> +#include <wx/timer.h> + + +namespace zen +{ +/* +Run a task in an async thread, but process result in GUI event loop +------------------------------------------------------------------- +1. put AsyncGuiQueue instance inside a dialog: + AsyncGuiQueue guiQueue; + +2. schedule async task and synchronous continuation: + guiQueue.processAsync(evalAsync, evalOnGui); +*/ + +namespace impl +{ +struct Task +{ + virtual ~Task() {} + virtual bool resultReady () const = 0; + virtual void evaluateResult() = 0; +}; + + +template <class ResultType, class Fun> +class ConcreteTask : public Task +{ +public: + template <class Fun2> + ConcreteTask(std::future<ResultType>&& asyncResult, Fun2&& evalOnGui) : asyncResult_(std::move(asyncResult)), evalOnGui_(std::forward<Fun2>(evalOnGui)) {} + + bool resultReady () const override { return isReady(asyncResult_); } + void evaluateResult() override + { +#ifndef NDEBUG + assert(resultReady() && !resultEvaluated_); + resultEvaluated_ = true; +#endif + evalResult(IsSameType<ResultType, void>()); + } + +private: + void evalResult(FalseType /*void result type*/) { evalOnGui_(asyncResult_.get()); } + void evalResult(TrueType /*void result type*/) { asyncResult_.get(); evalOnGui_(); } + + std::future<ResultType> asyncResult_; + Fun evalOnGui_; //keep "evalOnGui" strictly separated from async thread: in particular do not copy in thread! +#ifndef NDEBUG + bool resultEvaluated_ = false; +#endif +}; + + +class AsyncTasks +{ +public: + AsyncTasks() {} + + template <class Fun, class Fun2> + void add(Fun&& evalAsync, Fun2&& evalOnGui) + { + using ResultType = decltype(evalAsync()); + tasks.push_back(std::make_unique<ConcreteTask<ResultType, Fun2>>(zen::runAsync(std::forward<Fun>(evalAsync)), std::forward<Fun2>(evalOnGui))); + } + //equivalent to "evalOnGui(evalAsync())" + // -> evalAsync: the usual thread-safety requirements apply! + // -> evalOnGui: no thread-safety concerns, but must only reference variables with greater-equal lifetime than the AsyncTask instance! + + void evalResults() //call from gui thread repreatedly + { + if (!inRecursion) //prevent implicit recursion, e.g. if we're called from an idle event and spawn another one via the callback below + { + inRecursion = true; + ZEN_ON_SCOPE_EXIT(inRecursion = false); + + std::vector<std::unique_ptr<Task>> readyTasks; //Reentrancy; access to AsyncTasks::add is not protected! => evaluate outside erase_if + + erase_if(tasks, [&](std::unique_ptr<Task>& task) + { + if (task->resultReady()) + { + readyTasks.push_back(std::move(task)); + return true; + } + return false; + }); + + for (auto& task : readyTasks) + task->evaluateResult(); + } + } + + bool empty() const { return tasks.empty(); } + +private: + AsyncTasks (const AsyncTasks&) = delete; + AsyncTasks& operator=(const AsyncTasks&) = delete; + + bool inRecursion = false; + std::vector<std::unique_ptr<Task>> tasks; +}; +} + + +class AsyncGuiQueue : private wxEvtHandler +{ +public: + AsyncGuiQueue() { timer.Connect(wxEVT_TIMER, wxEventHandler(AsyncGuiQueue::onTimerEvent), nullptr, this); } + + template <class Fun, class Fun2> + void processAsync(Fun&& evalAsync, Fun2&& evalOnGui) + { + asyncTasks.add(std::forward<Fun >(evalAsync), + std::forward<Fun2>(evalOnGui)); + if (!timer.IsRunning()) + timer.Start(50 /*unit: [ms]*/); + } + +private: + void onTimerEvent(wxEvent& event) //schedule and run long-running tasks asynchronously + { + asyncTasks.evalResults(); //process results on GUI queue + if (asyncTasks.empty()) + timer.Stop(); + } + + impl::AsyncTasks asyncTasks; + wxTimer timer; //don't use wxWidgets' idle handling => repeated idle requests/consumption hogs 100% cpu! +}; + +} + +#endif //ASYNC_JOB_839147839170432143214321 diff --git a/wx+/choice_enum.h b/wx+/choice_enum.h index 6a795d4a..9b1575ee 100644 --- a/wx+/choice_enum.h +++ b/wx+/choice_enum.h @@ -27,10 +27,10 @@ Set enum value: setEnumVal(enumDescrMap, *m_choiceHandleError, value); Get enum value: - value = getEnumVal(enumDescrMap, *m_choiceHandleError) + value = getEnumVal(enumDescrMap, *m_choiceHandleError) Update enum tooltips (after user changed selection): - updateTooltipEnumVal(enumDescrMap, *m_choiceHandleError); + updateTooltipEnumVal(enumDescrMap, *m_choiceHandleError); */ diff --git a/wx+/context_menu.h b/wx+/context_menu.h index 2ae85162..ec62852d 100644 --- a/wx+/context_menu.h +++ b/wx+/context_menu.h @@ -17,10 +17,10 @@ A context menu supporting C++11 lambda callbacks! Usage: - ContextMenu menu; - menu.addItem(L"Some Label", [&]{ ...do something... }); -> capture by reference is fine, as long as captured variables have at least scope of ContextMenu::popup()! - ... - menu.popup(wnd); + ContextMenu menu; + menu.addItem(L"Some Label", [&]{ ...do something... }); -> capture by reference is fine, as long as captured variables have at least scope of ContextMenu::popup()! + ... + menu.popup(wnd); */ namespace zen @@ -28,7 +28,7 @@ namespace zen class ContextMenu : private wxEvtHandler { public: - ContextMenu() : menu(zen::make_unique<wxMenu>()) {} + ContextMenu() : menu(std::make_unique<wxMenu>()) {} void addItem(const wxString& label, const std::function<void()>& command, const wxBitmap* bmp = nullptr, bool enabled = true) { @@ -48,7 +48,7 @@ public: auto it = refDcToAreaMap().find(&dc); if (it != refDcToAreaMap().end()) { - oldRect = zen::make_unique<wxRect>(it->second); + oldRect = std::make_unique<wxRect>(it->second); wxRect tmp = r; tmp.Intersect(*oldRect); //better safe than sorry @@ -98,7 +98,7 @@ public: { const wxSize clientSize = wnd.GetClientSize(); if (!buffer_ || clientSize != wxSize(buffer->GetWidth(), buffer->GetHeight())) - buffer = zen::make_unique<wxBitmap>(clientSize.GetWidth(), clientSize.GetHeight()); + buffer = std::make_unique<wxBitmap>(clientSize.GetWidth(), clientSize.GetHeight()); SelectObject(*buffer); diff --git a/wx+/file_drop.h b/wx+/file_drop.h index c9f2469c..f8943788 100644 --- a/wx+/file_drop.h +++ b/wx+/file_drop.h @@ -28,8 +28,8 @@ namespace zen /* 1. setup a window to emit EVENT_DROP_FILE: - - simple file system paths: setupFileDrop - - any shell paths with validation: setupShellItemDrop + - simple file system paths: setupFileDrop + - any shell paths with validation: setupShellItemDrop 2. register events: wnd.Connect (EVENT_DROP_FILE, FileDropEventHandler(MyDlg::OnFilesDropped), nullptr, this); diff --git a/wx+/graph.cpp b/wx+/graph.cpp index d76e4d41..601c4913 100644 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -453,7 +453,7 @@ void Graph2D::onPaintEvent(wxPaintEvent& event) void Graph2D::OnMouseLeftDown(wxMouseEvent& event) { - activeSel = zen::make_unique<MouseSelection>(*this, event.GetPosition()); + activeSel = std::make_unique<MouseSelection>(*this, event.GetPosition()); if (!event.ControlDown()) oldSel.clear(); diff --git a/wx+/graph.h b/wx+/graph.h index 34c7ab3c..ea05709d 100644 --- a/wx+/graph.h +++ b/wx+/graph.h @@ -27,19 +27,20 @@ Example: setLabelY(Graph2D::Y_LABEL_RIGHT, 60, std::make_shared<LabelFormatterBytes>())); //set graph data std::shared_ptr<CurveData> curveDataBytes = ... - m_panelGraph->setCurve(curveDataBytes, Graph2D::CurveAttributes().setLineWidth(2).setColor(wxColor(0, 192, 0))); + m_panelGraph->setCurve(curveDataBytes, Graph2D::CurveAttributes().setLineWidth(2).setColor(wxColor(0, 192, 0))); */ struct CurvePoint { - CurvePoint() : x(0), y(0) {} + CurvePoint() {} CurvePoint(double xVal, double yVal) : x(xVal), y(yVal) {} - double x; - double y; + double x = 0; + double y = 0; }; inline bool operator==(const CurvePoint& lhs, const CurvePoint& rhs) { return lhs.x == rhs.x && lhs.y == rhs.y; } inline bool operator!=(const CurvePoint& lhs, const CurvePoint& rhs) { return !(lhs == rhs); } + struct CurveData { virtual ~CurveData() {} @@ -67,9 +68,10 @@ struct SparseCurveData : public CurveData private: void getPoints(double minX, double maxX, int pixelWidth, std::vector<CurvePoint>& points) const override; - bool addSteps_; + const bool addSteps_; }; + struct ArrayCurveData : public SparseCurveData { virtual double getValue(size_t pos) const = 0; @@ -96,12 +98,14 @@ private: } }; + struct VectorCurveData : public ArrayCurveData { std::vector<double>& refData() { return data; } private: double getValue(size_t pos) const override { return pos < data.size() ? data[pos] : 0; } size_t getSize() const override { return data.size(); } + std::vector<double> data; }; @@ -118,6 +122,7 @@ struct LabelFormatter virtual wxString formatText(double value, double optimalBlockSize) const = 0; }; + double nextNiceNumber(double blockSize); //round to next number which is convenient to read, e.g. 2.13 -> 2; 2.7 -> 2.5 struct DecimalNumberFormatter : public LabelFormatter @@ -172,8 +177,7 @@ public: class CurveAttributes { public: - CurveAttributes() : autoColor(true), drawCurveArea(false), lineWidth(2) {} - + CurveAttributes() {} //required by GCC CurveAttributes& setColor (const wxColour& col) { color = col; autoColor = false; return *this; } CurveAttributes& fillCurveArea(const wxColour& col) { fillColor = col; drawCurveArea = true; return *this; } CurveAttributes& setLineWidth(size_t width) { lineWidth = static_cast<int>(width); return *this; } @@ -181,13 +185,13 @@ public: private: friend class Graph2D; - bool autoColor; + bool autoColor = true; wxColour color; - bool drawCurveArea; + bool drawCurveArea = false; wxColour fillColor; - int lineWidth; + int lineWidth = 2; }; void setCurve(const std::shared_ptr<CurveData>& data, const CurveAttributes& ca = CurveAttributes()); @@ -226,24 +230,6 @@ public: class MainAttributes { public: - MainAttributes() : - minXauto(true), - maxXauto(true), - minX(0), - maxX(0), - minYauto(true), - maxYauto(true), - minY(0), - maxY(0), - labelposX(X_LABEL_BOTTOM), - xLabelHeight(25), - labelFmtX(std::make_shared<DecimalNumberFormatter>()), - labelposY(Y_LABEL_LEFT), - yLabelWidth(60), - labelFmtY(std::make_shared<DecimalNumberFormatter>()), - backgroundColor(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)), - mouseSelMode(SELECT_RECTANGLE) {} - MainAttributes& setMinX(double newMinX) { minX = newMinX; minXauto = false; return *this; } MainAttributes& setMaxX(double newMaxX) { maxX = newMaxX; maxXauto = false; return *this; } @@ -278,28 +264,28 @@ public: private: friend class Graph2D; - bool minXauto; //autodetect range for X value - bool maxXauto; - double minX; //x-range to visualize - double maxX; + bool minXauto = true; //autodetect range for X value + bool maxXauto = true; + double minX = 0; //x-range to visualize + double maxX = 0; // - bool minYauto; //autodetect range for Y value - bool maxYauto; - double minY; //y-range to visualize - double maxY; + bool minYauto = true; //autodetect range for Y value + bool maxYauto = true; + double minY = 0; //y-range to visualize + double maxY = 0; // - PosLabelX labelposX; - int xLabelHeight; - std::shared_ptr<LabelFormatter> labelFmtX; + PosLabelX labelposX = X_LABEL_BOTTOM; + int xLabelHeight = 25; + std::shared_ptr<LabelFormatter> labelFmtX = std::make_shared<DecimalNumberFormatter>(); - PosLabelY labelposY; - int yLabelWidth; - std::shared_ptr<LabelFormatter> labelFmtY; + PosLabelY labelposY = Y_LABEL_LEFT; + int yLabelWidth = 60; + std::shared_ptr<LabelFormatter> labelFmtY = std::make_shared<DecimalNumberFormatter>(); std::map<PosCorner, wxString> cornerTexts; - wxColour backgroundColor; - SelMode mouseSelMode; + wxColour backgroundColor = wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW); + SelMode mouseSelMode = SELECT_RECTANGLE; }; void setAttributes(const MainAttributes& newAttr) { attr = newAttr; Refresh(); } MainAttributes getAttributes() const { return attr; } diff --git a/wx+/grid.cpp b/wx+/grid.cpp index 9eea2e28..c819763f 100644 --- a/wx+/grid.cpp +++ b/wx+/grid.cpp @@ -162,9 +162,9 @@ void drawTextLabelFitting(wxDC& dc, const wxString& text, const wxRect& rect, in wxDC::GetMultiLineTextExtent() is implemented in terms of wxDC::GetTextExtent() average total times: - Windows Linux - single wxDC::DrawText() 7µs 50µs - wxDC::DrawLabel() + 10µs 90µs + Windows Linux + single wxDC::DrawText() 7µs 50µs + wxDC::DrawLabel() + 10µs 90µs repeated GetTextExtent() */ @@ -581,8 +581,7 @@ public: wnd_(wnd), colFrom_(colFrom), colTo_(colFrom), - clientPosX_(clientPosX), - singleClick_(true) { wnd_.CaptureMouse(); } + clientPosX_(clientPosX) { wnd_.CaptureMouse(); } ~ColumnMove() { if (wnd_.HasCapture()) wnd_.ReleaseMouse(); } size_t getColumnFrom() const { return colFrom_; } @@ -597,7 +596,7 @@ private: const size_t colFrom_; size_t colTo_; const int clientPosX_; - bool singleClick_; + bool singleClick_ = true; }; } @@ -695,10 +694,10 @@ private: { if (!event.LeftDClick()) //double-clicks never seem to arrive here; why is this checked at all??? if (Opt<int> colWidth = refParent().getColWidth(action->col)) - activeResizing = make_unique<ColumnResizing>(*this, action->col, *colWidth, event.GetPosition().x); + activeResizing = std::make_unique<ColumnResizing>(*this, action->col, *colWidth, event.GetPosition().x); } else //a move or single click - activeMove = make_unique<ColumnMove>(*this, action->col, event.GetPosition().x); + activeMove = std::make_unique<ColumnMove>(*this, action->col, event.GetPosition().x); } event.Skip(); } @@ -792,7 +791,7 @@ private: { if (const Opt<ColAction> action = refParent().clientPosToColumnAction(event.GetPosition())) { - highlightCol = make_unique<size_t>(action->col); + highlightCol = std::make_unique<size_t>(action->col); if (action->wantResize) SetCursor(wxCURSOR_SIZEWE); //set window-local only! :) @@ -863,11 +862,8 @@ public: RowLabelWin& rowLabelWin, ColLabelWin& colLabelWin) : SubWindow(parent), rowLabelWin_(rowLabelWin), - colLabelWin_(colLabelWin), - cursorRow(0), - selectionAnchor(0), - gridUpdatePending(false) - { + colLabelWin_(colLabelWin) + { Connect(EVENT_GRID_HAS_SCROLLED, wxEventHandler(MainWin::onRequestWindowUpdate), nullptr, this); } @@ -994,15 +990,15 @@ private: if (!event.RightDown() || !refParent().isSelected(row)) //do NOT start a new selection if user right-clicks on a selected area! { if (event.ControlDown()) - activeSelection = make_unique<MouseSelection>(*this, row, !refParent().isSelected(row)); + activeSelection = std::make_unique<MouseSelection>(*this, row, !refParent().isSelected(row)); else if (event.ShiftDown()) { - activeSelection = make_unique<MouseSelection>(*this, selectionAnchor, true); + activeSelection = std::make_unique<MouseSelection>(*this, selectionAnchor, true); refParent().clearSelection(ALLOW_GRID_EVENT); } else { - activeSelection = make_unique<MouseSelection>(*this, row, true); + activeSelection = std::make_unique<MouseSelection>(*this, row, true); refParent().clearSelection(ALLOW_GRID_EVENT); } } @@ -1096,9 +1092,7 @@ private: { public: MouseSelection(MainWin& wnd, size_t rowStart, bool positiveSelect) : - wnd_(wnd), rowStart_(rowStart), rowCurrent_(rowStart), positiveSelect_(positiveSelect), toScrollX(0), toScrollY(0), - tickCountLast(getTicks()), - ticksPerSec_(ticksPerSec()) + wnd_(wnd), rowStart_(rowStart), rowCurrent_(rowStart), positiveSelect_(positiveSelect) { wnd_.CaptureMouse(); timer.Connect(wxEVT_TIMER, wxEventHandler(MouseSelection::onTimer), nullptr, this); @@ -1121,8 +1115,7 @@ private: tickCountLast = now; } - wxMouseState mouseState = wxGetMouseState(); - const wxPoint clientPos = wnd_.ScreenToClient(wxPoint(mouseState.GetX(), mouseState.GetY())); + const wxPoint clientPos = wnd_.ScreenToClient(wxGetMousePosition()); const wxSize clientSize = wnd_.GetClientSize(); assert(wnd_.GetClientAreaOrigin() == wxPoint()); @@ -1183,10 +1176,10 @@ private: ptrdiff_t rowCurrent_; const bool positiveSelect_; wxTimer timer; - double toScrollX; //count outstanding scroll units to scroll while dragging mouse - double toScrollY; // - TickVal tickCountLast; - const std::int64_t ticksPerSec_; + double toScrollX = 0; //count outstanding scroll units to scroll while dragging mouse + double toScrollY = 0; // + TickVal tickCountLast = getTicks(); + const std::int64_t ticksPerSec_ = ticksPerSec(); }; void ScrollWindow(int dx, int dy, const wxRect* rect) override @@ -1224,9 +1217,9 @@ private: std::unique_ptr<MouseSelection> activeSelection; //bound while user is selecting with mouse - ptrdiff_t cursorRow; - size_t selectionAnchor; - bool gridUpdatePending; + ptrdiff_t cursorRow = 0; + size_t selectionAnchor = 0; + bool gridUpdatePending = false; }; //---------------------------------------------------------------------------------------------------------------- @@ -1237,14 +1230,7 @@ Grid::Grid(wxWindow* parent, const wxPoint& pos, const wxSize& size, long style, - const wxString& name) : wxScrolledWindow(parent, id, pos, size, style | wxWANTS_CHARS, name), - showScrollbarX(SB_SHOW_AUTOMATIC), - showScrollbarY(SB_SHOW_AUTOMATIC), - colLabelHeight(0), //dummy init - drawRowLabel(true), - allowColumnMove(true), - allowColumnResize(true), - rowCountOld(0) + const wxString& name) : wxScrolledWindow(parent, id, pos, size, style | wxWANTS_CHARS, name) { cornerWin_ = new CornerWin (*this); // rowLabelWin_ = new RowLabelWin(*this); //owership handled by "this" @@ -1278,24 +1264,24 @@ void Grid::updateWindowSizes(bool updateScrollbar) { /* We have to deal with TWO nasty circular dependencies: 1. - rowLabelWidth - /|\ - mainWin::client width - /|\ - SetScrollbars -> show/hide horizontal scrollbar depending on client width - /|\ - mainWin::client height -> possibly trimmed by horizontal scrollbars - /|\ - rowLabelWidth + rowLabelWidth + /|\ + mainWin::client width + /|\ + SetScrollbars -> show/hide horizontal scrollbar depending on client width + /|\ + mainWin::client height -> possibly trimmed by horizontal scrollbars + /|\ + rowLabelWidth 2. - mainWin_->GetClientSize() - /|\ - SetScrollbars -> show/hide scrollbars depending on whether client size is big enough - /|\ - GetClientSize(); -> possibly trimmed by scrollbars - /|\ - mainWin_->GetClientSize() -> also trimmed, since it's a sub-window! + mainWin_->GetClientSize() + /|\ + SetScrollbars -> show/hide scrollbars depending on whether client size is big enough + /|\ + GetClientSize(); -> possibly trimmed by scrollbars + /|\ + mainWin_->GetClientSize() -> also trimmed, since it's a sub-window! */ //break this vicious circle: @@ -1379,27 +1365,27 @@ void Grid::updateWindowSizes(bool updateScrollbar) ------------------------ \|/ | | | | | ------------------------ \|/ - gw := gross width - nw := net width := gross width - sb size - gh := gross height - nh := net height := gross height - sb size + gw := gross width + nw := net width := gross width - sb size + gh := gross height + nh := net height := gross height - sb size There are 6 cases that can occur: --------------------------------- - lw := logical width - lh := logical height + lw := logical width + lh := logical height 1. lw <= gw && lh <= gh => no scrollbars needed 2. lw > gw && lh > gh => need both scrollbars 3. lh > gh - 4.1 lw <= nw => need vertical scrollbar only - 4.2 nw < lw <= gw => need both scrollbars + 4.1 lw <= nw => need vertical scrollbar only + 4.2 nw < lw <= gw => need both scrollbars 4. lw > gw - 3.1 lh <= nh => need horizontal scrollbar only - 3.2 nh < lh <= gh => need both scrollbars + 3.1 lh <= nh => need horizontal scrollbar only + 3.2 nh < lh <= gh => need both scrollbars */ } } @@ -2051,11 +2037,11 @@ void Grid::scrollTo(size_t row) } - bool Grid::Enable(bool enable) - { - Refresh(); - return wxScrolledWindow::Enable(enable); - } +bool Grid::Enable(bool enable) +{ + Refresh(); + return wxScrolledWindow::Enable(enable); +} size_t Grid::getGridCursor() const @@ -323,21 +323,21 @@ private: ColLabelWin* colLabelWin_; MainWin* mainWin_; - ScrollBarStatus showScrollbarX; - ScrollBarStatus showScrollbarY; + ScrollBarStatus showScrollbarX = SB_SHOW_AUTOMATIC; + ScrollBarStatus showScrollbarY = SB_SHOW_AUTOMATIC; - int colLabelHeight; - bool drawRowLabel; + int colLabelHeight = 0; + bool drawRowLabel = true; std::shared_ptr<GridData> dataView_; Selection selection; - bool allowColumnMove; - bool allowColumnResize; + bool allowColumnMove = true; + bool allowColumnResize = true; std::vector<VisibleColumn> visibleCols; //individual widths, type and total column count std::vector<ColumnAttribute> oldColAttributes; //visible + nonvisible columns; use for conversion in setColumnConfig()/getColumnConfig() *only*! - size_t rowCountOld; //at the time of last Grid::Refresh() + size_t rowCountOld = 0; //at the time of last Grid::Refresh() }; } diff --git a/wx+/image_resources.cpp b/wx+/image_resources.cpp index 7383f620..98cdc7a8 100644 --- a/wx+/image_resources.cpp +++ b/wx+/image_resources.cpp @@ -22,7 +22,7 @@ namespace void loadAnimFromZip(wxZipInputStream& zipInput, wxAnimation& anim) { //work around wxWidgets bug: - //construct seekable input stream (zip-input stream is non-seekable) for wxAnimation::Load() + //construct seekable input stream (zip-input stream is not seekable) for wxAnimation::Load() //luckily this method call is very fast: below measurement precision! std::vector<char> data; data.reserve(10000); diff --git a/wx+/image_tools.h b/wx+/image_tools.h index 5e21bd40..43c1a625 100644 --- a/wx+/image_tools.h +++ b/wx+/image_tools.h @@ -33,7 +33,7 @@ wxImage stackImages(const wxImage& img1, const wxImage& img2, ImageStackLayout d wxImage createImageFromText(const wxString& text, const wxFont& font, const wxColor& col); -wxBitmap layOver(const wxBitmap& foreground, const wxBitmap& background); //merge +wxBitmap layOver(const wxBitmap& background, const wxBitmap& foreground); //merge wxImage greyScale(const wxImage& img); //greyscale + brightness adaption wxBitmap greyScale(const wxBitmap& bmp); // @@ -147,7 +147,7 @@ void adjustBrightness(wxImage& img, int targetLevel) inline -wxBitmap layOver(const wxBitmap& foreground, const wxBitmap& background) +wxBitmap layOver(const wxBitmap& background, const wxBitmap& foreground) { assert(foreground.HasAlpha() == background.HasAlpha()); //we don't support mixed-mode brittleness! diff --git a/wx+/popup_dlg.cpp b/wx+/popup_dlg.cpp index 480021eb..188ad76d 100644 --- a/wx+/popup_dlg.cpp +++ b/wx+/popup_dlg.cpp @@ -145,7 +145,7 @@ public: else m_checkBoxCustom->Hide(); - Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(StandardPopupDialog::OnKeyPressed), nullptr, this); + Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(StandardPopupDialog::OnKeyPressed), nullptr, this); //dialog-specific local key events } private: @@ -154,11 +154,19 @@ private: void OnKeyPressed(wxKeyEvent& event) { - const int keyCode = event.GetKeyCode(); - if (keyCode == WXK_ESCAPE) //handle case where cancel button is hidden! + switch (event.GetKeyCode()) { - EndModal(static_cast<int>(ConfirmationButton3::CANCEL)); - return; + case WXK_RETURN: + case WXK_NUMPAD_ENTER: + { + wxCommandEvent dummy(wxEVT_COMMAND_BUTTON_CLICKED); + OnButtonAffirmative(dummy); + return; + } + + case WXK_ESCAPE: //handle case where cancel button is hidden! + EndModal(static_cast<int>(ConfirmationButton3::CANCEL)); + return; } event.Skip(); } @@ -55,7 +55,7 @@ void drawRtlImpl(wxDC& dc, const wxRect& rect, std::unique_ptr<wxBitmap>& buffer if (dc.GetLayoutDirection() == wxLayout_RightToLeft) { if (!buffer || buffer->GetWidth() != rect.width || buffer->GetHeight() < rect.height) //[!] since we do a mirror, width needs to match exactly! - buffer = zen::make_unique<wxBitmap>(rect.width, rect.height); + buffer = std::make_unique<wxBitmap>(rect.width, rect.height); wxMemoryDC memDc(*buffer); memDc.Blit(wxPoint(0, 0), rect.GetSize(), &dc, rect.GetTopLeft()); //blit in: background is mirrored due to memDc, dc having different layout direction! diff --git a/zen/async_task.h b/zen/async_task.h deleted file mode 100644 index 76e7824f..00000000 --- a/zen/async_task.h +++ /dev/null @@ -1,73 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl-3.0 * -// * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * -// ************************************************************************** - -#ifndef ASYNC_JOB_839147839170432143214321 -#define ASYNC_JOB_839147839170432143214321 - -#include <list> -#include <functional> -#include "thread.h" -#include "scope_guard.h" - - -namespace zen -{ -//run a job in an async thread, but process result on GUI event loop -class AsyncTasks -{ -public: - AsyncTasks() {} - - template <class Fun, class Fun2> - void add(Fun runAsync, Fun2 evalOnGui) - //equivalent to "evalOnGui(runAsync())" - // -> runAsync: the usual thread-safety requirements apply! - // -> evalOnGui: no thread-safety concerns, but must only reference variables with greater-equal lifetime than the AsyncTask instance! - { - tasks.push_back(zen::runAsync([=]() -> std::function<void()> - { - auto result = runAsync(); - return [=]{ evalOnGui(result); }; - })); - } - - template <class Fun, class Fun2> - void add2(Fun runAsync, Fun2 evalOnGui) //for evalOnGui taking no parameters - { - tasks.push_back(zen::runAsync([runAsync, evalOnGui]() -> std::function<void()> { runAsync(); return [evalOnGui]{ evalOnGui(); }; })); - } - - void evalResults() //call from gui thread repreatedly - { - if (!inRecursion) //prevent implicit recursion, e.g. if we're called from an idle event and spawn another one via the callback below - { - inRecursion = true; - ZEN_ON_SCOPE_EXIT(inRecursion = false); - - tasks.remove_if([](std::future<std::function<void()>>& ft) -> bool - { - if (isReady(ft)) - { - (ft.get())(); - return true; - } - return false; - }); - } - } - - bool empty() const { return tasks.empty(); } - -private: - AsyncTasks (const AsyncTasks&) = delete; - AsyncTasks& operator=(const AsyncTasks&) = delete; - - bool inRecursion = false; - std::list<std::future<std::function<void()>>> tasks; -}; -} - -#endif //ASYNC_JOB_839147839170432143214321 diff --git a/zen/build_info.h b/zen/build_info.h index 4eeb8195..7c738847 100644 --- a/zen/build_info.h +++ b/zen/build_info.h @@ -4,17 +4,35 @@ // * Copyright (C) Zenju (zenju AT gmx DOT de) - All Rights Reserved * // ************************************************************************** -#ifndef BUILDINFO_H_INCLUDED -#define BUILDINFO_H_INCLUDED +#ifndef BUILDINFO_H_5928539285603428657 +#define BUILDINFO_H_5928539285603428657 namespace zen { -//determine build info -//safer than checking for _WIN64 (defined on windows for 64-bit compilations only) while _WIN32 is always defined (even for x64 compiler!) -static const bool is32BitBuild = sizeof(void*) == 4; -static const bool is64BitBuild = sizeof(void*) == 8; +//determine build info: defines ZEN_BUILD_32BIT or ZEN_BUILD_64BIT -static_assert(is32BitBuild || is64BitBuild, ""); +#ifdef ZEN_WIN + #ifdef _WIN64 + #define ZEN_BUILD_64BIT + #else + #define ZEN_BUILD_32BIT + #endif + +#else + #ifdef __LP64__ + #define ZEN_BUILD_64BIT + #else + #define ZEN_BUILD_32BIT + #endif +#endif + +#ifdef ZEN_BUILD_32BIT + static_assert(sizeof(void*) == 4, ""); +#endif + +#ifdef ZEN_BUILD_64BIT + static_assert(sizeof(void*) == 8, ""); +#endif } -#endif //BUILDINFO_H_INCLUDED +#endif //BUILDINFO_H_5928539285603428657 diff --git a/zen/dir_watcher.cpp b/zen/dir_watcher.cpp index 4abf3c0a..3bab8d34 100644 --- a/zen/dir_watcher.cpp +++ b/zen/dir_watcher.cpp @@ -121,7 +121,7 @@ public: std::lock_guard<std::mutex> dummy(lockAccess); ErrorInfo newInfo = { copyStringTo<BasicWString>(msg), copyStringTo<BasicWString>(description), errorCode }; - errorInfo = make_unique<ErrorInfo>(newInfo); + errorInfo = std::make_unique<ErrorInfo>(newInfo); } private: @@ -159,7 +159,7 @@ public: FILE_FLAG_OVERLAPPED, //_In_ DWORD dwFlagsAndAttributes, nullptr); //_In_opt_ HANDLE hTemplateFile if (hDir == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(directory)), L"CreateFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(directory)), L"CreateFile"); //end of constructor, no need to start managing "hDir" } @@ -193,7 +193,7 @@ public: nullptr); //__in_opt LPCTSTR lpName if (overlapped.hEvent == nullptr) { - const DWORD ec = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(dirpathPf)), formatSystemError(L"CreateEvent", ec), ec); } ZEN_ON_SCOPE_EXIT(::CloseHandle(overlapped.hEvent)); @@ -213,7 +213,7 @@ public: &overlapped, // __inout_opt LPOVERLAPPED lpOverlapped, nullptr)) // __in_opt LPOVERLAPPED_COMPLETION_ROUTINE lpCompletionRoutine { - const DWORD ec = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(dirpathPf)), formatSystemError(L"ReadDirectoryChangesW", ec), ec); } @@ -239,7 +239,7 @@ public: &bytesWritten, //__out LPDWORD lpNumberOfBytesTransferred, false)) //__in BOOL bWait { - const DWORD ec = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! if (ec != ERROR_IO_INCOMPLETE) return shared_->reportError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(dirpathPf)), formatSystemError(L"GetOverlappedResult", ec), ec); @@ -327,12 +327,12 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError baseDirPath(dirPath), - pimpl_(zen::make_unique<Pimpl>()) + pimpl_(std::make_unique<Pimpl>()) { pimpl_->shared = std::make_shared<SharedData>(); ReadChangesAsync reader(dirPath, pimpl_->shared); //throw FileError - pimpl_->volRemoval = zen::make_unique<HandleVolumeRemoval>(reader.getDirHandle(), dirPath, pimpl_->worker); //throw FileError + pimpl_->volRemoval = std::make_unique<HandleVolumeRemoval>(reader.getDirHandle(), dirPath, pimpl_->worker); //throw FileError pimpl_->worker = InterruptibleThread(std::move(reader)); } @@ -384,7 +384,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError baseDirPath(dirPath), - pimpl_(zen::make_unique<Pimpl>()) + pimpl_(std::make_unique<Pimpl>()) { //get all subdirectories std::vector<Zstring> fullDirList { baseDirPath }; @@ -405,7 +405,7 @@ DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError //init pimpl_->notifDescr = ::inotify_init(); if (pimpl_->notifDescr == -1) - throwFileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(baseDirPath)), L"inotify_init", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(baseDirPath)), L"inotify_init"); zen::ScopeGuard guardDescr = zen::makeGuard([&] { ::close(pimpl_->notifDescr); }); @@ -417,7 +417,7 @@ DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError initSuccess = ::fcntl(pimpl_->notifDescr, F_SETFL, flags | O_NONBLOCK) != -1; } if (!initSuccess) - throwFileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(baseDirPath)), L"fcntl", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(baseDirPath)), L"fcntl"); //add watches for (const Zstring& subDirPath : fullDirList) @@ -425,17 +425,17 @@ DirWatcher::DirWatcher(const Zstring& dirPath) : //throw FileError int wd = ::inotify_add_watch(pimpl_->notifDescr, subDirPath.c_str(), IN_ONLYDIR | //"Only watch pathname if it is a directory." IN_DONT_FOLLOW | //don't follow symbolic links - IN_CREATE | - IN_MODIFY | + IN_CREATE | + IN_MODIFY | IN_CLOSE_WRITE | - IN_DELETE | + IN_DELETE | IN_DELETE_SELF | IN_MOVED_FROM | IN_MOVED_TO | IN_MOVE_SELF); if (wd == -1) { - const auto ec = getLastError(); + const ErrorCode ec = getLastError(); //copy before directly/indirectly making other system calls! if (ec == ENOSPC) //fix misleading system message "No space left on device" throw FileError(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(subDirPath)), formatSystemError(L"inotify_add_watch", ec, L"The user limit on the total number of inotify watches was reached or the kernel failed to allocate a needed resource.")); @@ -473,7 +473,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", fmtPath(baseDirPath)), L"read", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot monitor directory %x."), L"%x", fmtPath(baseDirPath)), L"read"); } std::vector<Entry> output; @@ -565,7 +565,7 @@ struct DirWatcher::Pimpl DirWatcher::DirWatcher(const Zstring& dirPath) : baseDirPath(dirPath), - pimpl_(zen::make_unique<Pimpl>()) + pimpl_(std::make_unique<Pimpl>()) { CFStringRef dirpathCf = osx::createCFString(baseDirPath.c_str()); //returns nullptr on error if (!dirpathCf) diff --git a/zen/dir_watcher.h b/zen/dir_watcher.h index 7a1ada96..1d6d53cc 100644 --- a/zen/dir_watcher.h +++ b/zen/dir_watcher.h @@ -22,18 +22,18 @@ namespace zen //watch directory including subdirectories /* !Note handling of directories!: - Windows: removal of top watched directory is NOT notified when watching the dir handle, e.g. brute force usb stick removal, - (watchting for GUID_DEVINTERFACE_WPD OTOH works fine!) - however manual unmount IS notified (e.g. usb stick removal, then re-insert), but watching is stopped! - Renaming of top watched directory handled incorrectly: Not notified(!) + additional changes in subfolders - now do report FILE_ACTION_MODIFIED for directory (check that should prevent this fails!) + Windows: removal of top watched directory is NOT notified when watching the dir handle, e.g. brute force usb stick removal, + (watchting for GUID_DEVINTERFACE_WPD OTOH works fine!) + however manual unmount IS notified (e.g. usb stick removal, then re-insert), but watching is stopped! + Renaming of top watched directory handled incorrectly: Not notified(!) + additional changes in subfolders + now do report FILE_ACTION_MODIFIED for directory (check that should prevent this fails!) Linux: newly added subdirectories are reported but not automatically added for watching! -> reset Dirwatcher! - removal of top watched directory is NOT notified! + removal of top watched directory is NOT notified! - OS X: everything works as expected; renaming of top level folder is also detected + OS X: everything works as expected; renaming of top level folder is also detected - Overcome all issues portably: check existence of top watched directory externally + reinstall watch after changes in directory structure (added directories) are detected + Overcome all issues portably: check existence of top watched directory externally + reinstall watch after changes in directory structure (added directories) are detected */ class DirWatcher { diff --git a/zen/file_access.cpp b/zen/file_access.cpp index c898c5d2..e04673d3 100644 --- a/zen/file_access.cpp +++ b/zen/file_access.cpp @@ -21,7 +21,7 @@ #include "long_path_prefix.h" #include "win_ver.h" #ifdef ZEN_WIN_VISTA_AND_LATER - #include <zen/vista_file_op.h> + #include <zen/vista_file_op.h> //requires COM initialization! #endif @@ -105,14 +105,14 @@ bool zen::somethingExists(const Zstring& itemPath) const DWORD attr = ::GetFileAttributes(applyLongPathPrefix(itemPath).c_str()); if (attr != INVALID_FILE_ATTRIBUTES) return true; - const DWORD lastError = ::GetLastError(); + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! //handle obscure file permission problem where ::GetFileAttributes() fails with ERROR_ACCESS_DENIED or ERROR_SHARING_VIOLATION //while parent directory traversal is successful: e.g. "C:\pagefile.sys" - if (lastError != ERROR_PATH_NOT_FOUND && //perf: short circuit for common "not existing" error codes - lastError != ERROR_FILE_NOT_FOUND && // - lastError != ERROR_BAD_NETPATH && // - lastError != ERROR_BAD_NET_NAME) // + if (ec != ERROR_PATH_NOT_FOUND && //perf: short circuit for common "not existing" error codes + ec != ERROR_FILE_NOT_FOUND && // + ec != ERROR_BAD_NETPATH && // + ec != ERROR_BAD_NET_NAME) // { WIN32_FIND_DATA fileInfo = {}; const HANDLE searchHandle = ::FindFirstFile(applyLongPathPrefix(itemPath).c_str(), &fileInfo); @@ -179,7 +179,7 @@ std::uint64_t zen::getFilesize(const Zstring& filePath) //throw FileError WIN32_FIND_DATA 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", fmtPath(filePath)), L"FindFirstFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"FindFirstFile"); ::FindClose(searchHandle); if (!isSymlink(fileInfo)) @@ -199,20 +199,20 @@ std::uint64_t zen::getFilesize(const Zstring& filePath) //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", fmtPath(filePath)), L"CreateFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"CreateFile"); ZEN_ON_SCOPE_EXIT(::CloseHandle(hFile)); //why not use ::GetFileSizeEx() instead??? BY_HANDLE_FILE_INFORMATION fileInfoHnd = {}; if (!::GetFileInformationByHandle(hFile, &fileInfoHnd)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"GetFileInformationByHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"GetFileInformationByHandle"); return get64BitUInt(fileInfoHnd.nFileSizeLow, fileInfoHnd.nFileSizeHigh); #elif defined ZEN_LINUX || defined ZEN_MAC struct ::stat fileInfo = {}; if (::stat(filePath.c_str(), &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"stat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"stat"); return fileInfo.st_size; #endif @@ -227,7 +227,7 @@ std::uint64_t zen::getFreeDiskSpace(const Zstring& path) //throw FileError, retu &bytesFree, //__out_opt PULARGE_INTEGER lpFreeBytesAvailable, nullptr, //__out_opt PULARGE_INTEGER lpTotalNumberOfBytes, nullptr)) //__out_opt PULARGE_INTEGER lpTotalNumberOfFreeBytes - throwFileError(replaceCpy(_("Cannot determine free disk space for %x."), L"%x", fmtPath(path)), L"GetDiskFreeSpaceEx", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine free disk space for %x."), L"%x", fmtPath(path)), L"GetDiskFreeSpaceEx"); //return 0 if info is not available: "The GetDiskFreeSpaceEx function returns zero for lpFreeBytesAvailable for all CD requests" return get64BitUInt(bytesFree.LowPart, bytesFree.HighPart); @@ -235,7 +235,7 @@ std::uint64_t zen::getFreeDiskSpace(const Zstring& path) //throw FileError, retu #elif defined ZEN_LINUX || defined ZEN_MAC struct ::statfs info = {}; if (::statfs(path.c_str(), &info) != 0) - throwFileError(replaceCpy(_("Cannot determine free disk space for %x."), L"%x", fmtPath(path)), L"statfs", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine free disk space for %x."), L"%x", fmtPath(path)), L"statfs"); return static_cast<std::uint64_t>(info.f_bsize) * info.f_bavail; #endif @@ -253,15 +253,15 @@ bool zen::removeFile(const Zstring& filePath) //throw FileError if (::unlink(filePath.c_str()) != 0) #endif { - ErrorCode lastError = getLastError(); + ErrorCode ec = getLastError(); //copy before directly/indirectly making other system calls! #ifdef ZEN_WIN - if (lastError == ERROR_ACCESS_DENIED) //function fails if file is read-only + if (ec == ERROR_ACCESS_DENIED) //function fails if file is read-only { ::SetFileAttributes(applyLongPathPrefix(filePath).c_str(), FILE_ATTRIBUTE_NORMAL); //(try to) normalize file attributes if (::DeleteFile(applyLongPathPrefix(filePath).c_str())) //now try again... return true; - lastError = ::GetLastError(); + ec = ::GetLastError(); } #endif if (!somethingExists(filePath)) //warning: changes global error code!! @@ -269,11 +269,11 @@ bool zen::removeFile(const Zstring& filePath) //throw FileError //begin of "regular" error reporting const std::wstring errorMsg = replaceCpy(_("Cannot delete file %x."), L"%x", fmtPath(filePath)); - std::wstring errorDescr = formatSystemError(functionName, lastError); + std::wstring errorDescr = formatSystemError(functionName, ec); #ifdef ZEN_WIN_VISTA_AND_LATER - if (lastError == ERROR_SHARING_VIOLATION || //-> enhance error message! - lastError == ERROR_LOCK_VIOLATION) + if (ec == ERROR_SHARING_VIOLATION || //-> enhance error message! + ec == ERROR_LOCK_VIOLATION) { const std::wstring procList = vista::getLockingProcesses(filePath); //noexcept if (!procList.empty()) @@ -299,7 +299,7 @@ void zen::removeDirectorySimple(const Zstring& dirPath) //throw FileError if (::rmdir(dirPath.c_str()) != 0) #endif { - const ErrorCode ec = getLastError(); + const ErrorCode ec = getLastError(); //copy before making other system calls! if (!somethingExists(dirPath)) //warning: changes global error code!! return; @@ -308,12 +308,12 @@ void zen::removeDirectorySimple(const Zstring& dirPath) //throw FileError if (symlinkExists(dirPath)) { if (::unlink(dirPath.c_str()) != 0) - throwFileError(replaceCpy(_("Cannot delete directory %x."), L"%x", fmtPath(dirPath)), L"unlink", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot delete directory %x."), L"%x", fmtPath(dirPath)), L"unlink"); return; } #endif - throwFileError(replaceCpy(_("Cannot delete directory %x."), L"%x", fmtPath(dirPath)), functionName, ec); + throw FileError(replaceCpy(_("Cannot delete directory %x."), L"%x", fmtPath(dirPath)), formatSystemError(functionName, ec)); } //may spuriously fail with ERROR_DIR_NOT_EMPTY(145) even though all child items have //successfully been *marked* for deletion, but some application still has a handle open! @@ -332,10 +332,11 @@ void removeDirectoryImpl(const Zstring& dirPath) //throw FileError std::vector<Zstring> fileList; std::vector<Zstring> dirLinkList; std::vector<Zstring> dirList; + //get all files and directories from current directory (WITHOUT subdirectories!) traverseFolder(dirPath, [&](const FileInfo& fi) { fileList.push_back(fi.fullPath); }, - [&](const DirInfo& di) { dirList .push_back(di.fullPath); }, + [&](const DirInfo& di) { dirList .push_back(di.fullPath); }, //defer recursion => save stack space and allow deletion of extremely deep hierarchies! [&](const SymlinkInfo& si) { #ifdef ZEN_WIN @@ -391,9 +392,9 @@ void renameFile_sub(const Zstring& pathSource, const Zstring& pathTarget) //thro pathTargetFmt.c_str(), //__in_opt LPCTSTR lpNewFileName, 0)) //__in DWORD dwFlags { - DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! + DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! - if (lastError == ERROR_ACCESS_DENIED) //MoveFileEx may fail to rename a read-only file on a SAMBA-share -> (try to) handle this + if (ec == ERROR_ACCESS_DENIED) //MoveFileEx may fail to rename a read-only file on a SAMBA-share -> (try to) handle this { const DWORD oldAttr = ::GetFileAttributes(pathSourceFmt.c_str()); if (oldAttr != INVALID_FILE_ATTRIBUTES && (oldAttr & FILE_ATTRIBUTE_READONLY)) @@ -411,7 +412,7 @@ void renameFile_sub(const Zstring& pathSource, const Zstring& pathTarget) //thro } else { - lastError = ::GetLastError(); //use error code from second call to ::MoveFileEx() + ec = ::GetLastError(); //use error code from second call to ::MoveFileEx() //cleanup: (try to) restore file attributes: assume pathSource is still existing ::SetFileAttributes(pathSourceFmt.c_str(), oldAttr); } @@ -420,11 +421,11 @@ void renameFile_sub(const Zstring& pathSource, const Zstring& pathTarget) //thro } //begin of "regular" error reporting const std::wstring errorMsg = replaceCpy(replaceCpy(_("Cannot move file %x to %y."), L"%x", L"\n" + fmtPath(pathSource)), L"%y", L"\n" + fmtPath(pathTarget)); - std::wstring errorDescr = formatSystemError(L"MoveFileEx", lastError); + std::wstring errorDescr = formatSystemError(L"MoveFileEx", ec); #ifdef ZEN_WIN_VISTA_AND_LATER //(try to) enhance error message - if (lastError == ERROR_SHARING_VIOLATION || - lastError == ERROR_LOCK_VIOLATION) + if (ec == ERROR_SHARING_VIOLATION || + ec == ERROR_LOCK_VIOLATION) { const std::wstring procList = vista::getLockingProcesses(pathSource); //noexcept if (!procList.empty()) @@ -432,37 +433,37 @@ void renameFile_sub(const Zstring& pathSource, const Zstring& pathTarget) //thro } #endif - if (lastError == ERROR_NOT_SAME_DEVICE) + if (ec == ERROR_NOT_SAME_DEVICE) throw ErrorDifferentVolume(errorMsg, errorDescr); - if (lastError == ERROR_ALREADY_EXISTS || //-> used on Win7 x64 - lastError == ERROR_FILE_EXISTS) //-> used by XP??? + if (ec == ERROR_ALREADY_EXISTS || //-> used on Win7 x64 + ec == ERROR_FILE_EXISTS) //-> used by XP??? throw ErrorTargetExisting(errorMsg, errorDescr); throw FileError(errorMsg, errorDescr); } #elif defined ZEN_LINUX || defined ZEN_MAC - //rename() will never fail with EEXIST, but always overwrite! - //=> Linux: renameat2() with RENAME_NOREPLACE -> still new, probably buggy - //=> OS X: no solution + //rename() will never fail with EEXIST, but always overwrite! + //=> Linux: renameat2() with RENAME_NOREPLACE -> still new, probably buggy + //=> OS X: no solution - auto throwException = [&](int ec) - { + auto throwException = [&](int ec) + { const std::wstring errorMsg = replaceCpy(replaceCpy(_("Cannot move file %x to %y."), L"%x", L"\n" + fmtPath(pathSource)), L"%y", L"\n" + fmtPath(pathTarget)); const std::wstring errorDescr = formatSystemError(L"rename", ec); if (ec == EXDEV) throw ErrorDifferentVolume(errorMsg, errorDescr); - if (ec == EEXIST) - throw ErrorTargetExisting(errorMsg, errorDescr); + if (ec == EEXIST) + throw ErrorTargetExisting(errorMsg, errorDescr); throw FileError(errorMsg, errorDescr); - }; + }; - if (!EqualFilePath()(pathSource, pathTarget)) //OS X: changing file name case is not an "already exists" error! - if (somethingExists(pathTarget)) - throwException(EEXIST); + if (!EqualFilePath()(pathSource, pathTarget)) //OS X: changing file name case is not an "already exists" error! + if (somethingExists(pathTarget)) + throwException(EEXIST); if (::rename(pathSource.c_str(), pathTarget.c_str()) != 0) - throwException(errno); + throwException(errno); #endif } @@ -645,12 +646,12 @@ void setFileTimeRaw(const Zstring& filePath, { const DWORD tmpAttr = ::GetFileAttributes(applyLongPathPrefix(filePath).c_str()); if (tmpAttr == INVALID_FILE_ATTRIBUTES) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"GetFileAttributes", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"GetFileAttributes"); if (tmpAttr & FILE_ATTRIBUTE_READONLY) { if (!::SetFileAttributes(applyLongPathPrefix(filePath).c_str(), FILE_ATTRIBUTE_NORMAL)) - throwFileError(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtPath(filePath)), L"SetFileAttributes", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtPath(filePath)), L"SetFileAttributes"); attribs = tmpAttr; //reapplied on scope exit return true; @@ -694,13 +695,13 @@ void setFileTimeRaw(const Zstring& filePath, hFile = openFile(false); if (hFile == INVALID_HANDLE_VALUE) { - const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! - if (lastError == ERROR_ACCESS_DENIED) + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! + if (ec == ERROR_ACCESS_DENIED) if (removeReadonly()) //throw FileError continue; //3. after these herculean stunts we give up... - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"CreateFile", lastError); + throw FileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), formatSystemError(L"CreateFile", ec)); } } break; @@ -713,10 +714,10 @@ void setFileTimeRaw(const Zstring& filePath, nullptr, //__in_opt const FILETIME *lpLastAccessTime, &lastWriteTime)) //__in_opt const FILETIME *lpLastWriteTime { - ErrorCode lastError = getLastError(); //copy before directly or indirectly making other system calls! + DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! //function may fail if file is read-only: https://sourceforge.net/tracker/?func=detail&atid=1093080&aid=3514569&group_id=234430 - if (lastError == ERROR_ACCESS_DENIED) + if (ec == ERROR_ACCESS_DENIED) { //dynamically load windows API function: available with Windows Vista and later typedef BOOL (WINAPI* SetFileInformationByHandleFunc)(HANDLE hFile, FILE_INFO_BY_HANDLE_CLASS FileInformationClass, LPVOID lpFileInformation, DWORD dwBufferSize); @@ -730,7 +731,7 @@ void setFileTimeRaw(const Zstring& filePath, 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", fmtPath(filePath)), L"SetFileInformationByHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtPath(filePath)), L"SetFileInformationByHandle"); }; auto toLargeInteger = [](const FILETIME& ft) -> LARGE_INTEGER @@ -763,7 +764,7 @@ void setFileTimeRaw(const Zstring& filePath, } catch (FileError&) {} - lastError = ERROR_SUCCESS; + ec = ERROR_SUCCESS; } } } @@ -771,7 +772,7 @@ void setFileTimeRaw(const Zstring& filePath, std::wstring errorMsg = replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)); //add more meaningful message: FAT accepts only a subset of the NTFS date range - if (lastError == ERROR_INVALID_PARAMETER && + if (ec == ERROR_INVALID_PARAMETER && isFatDrive(filePath)) { //we need a low-level reliable routine to format a potentially invalid date => don't use strftime!!! @@ -790,10 +791,10 @@ void setFileTimeRaw(const Zstring& filePath, std::vector<wchar_t> buffer(bufferSize); if (::GetDateFormat(LOCALE_USER_DEFAULT, //_In_ LCID Locale, 0, //_In_ DWORD dwFlags, - &st, //_In_opt_ const SYSTEMTIME *lpDate, - nullptr, //_In_opt_ LPCTSTR lpFormat, - &buffer[0], //_Out_opt_ LPTSTR lpDateStr, - bufferSize) > 0) //_In_ int cchDate + &st, //_In_opt_ const SYSTEMTIME *lpDate, + nullptr, //_In_opt_ LPCTSTR lpFormat, + &buffer[0], //_Out_opt_ LPTSTR lpDateStr, + bufferSize) > 0) //_In_ int cchDate dateTime = &buffer[0]; //GetDateFormat() returns char count *including* 0-termination! } } @@ -816,8 +817,8 @@ void setFileTimeRaw(const Zstring& filePath, (creationTime ? L"\n\tcreate (UTC): \t" + fmtDate(*creationTime) : L""); } - if (lastError != ERROR_SUCCESS) - throwFileError(errorMsg, L"SetFileTime", lastError); + if (ec != ERROR_SUCCESS) + throw FileError(errorMsg, formatSystemError(L"SetFileTime", ec)); } } #ifndef NDEBUG //verify written data: mainly required to check consistency of DST hack @@ -877,17 +878,17 @@ void setFileTimeRaw(const Zstring& filePath, const struct ::timespec& modTime, P if (errno == EACCES) //bullshit, access denied even with 0777 permissions! => utimes should work! throw ErrorLinuxFallbackToUtimes(L""); - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"open", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"open"); } ZEN_ON_SCOPE_EXIT(::close(fdFile)); if (::futimens(fdFile, newTimes) != 0) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"futimens", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"futimens"); } else { if (::utimensat(AT_FDCWD, filePath.c_str(), newTimes, AT_SYMLINK_NOFOLLOW) != 0) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"utimensat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"utimensat"); } } @@ -929,7 +930,7 @@ void setFileTimeRaw(const Zstring& filePath, (createTime ? sizeof(newTimes.createTime) : 0) + sizeof(newTimes.writeTime), //size_t attrBufSize, procSl == ProcSymlink::DIRECT ? FSOPT_NOFOLLOW : 0); //unsigned long options if (rv != 0) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"setattrlist", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"setattrlist"); } /* @@ -951,7 +952,7 @@ void getFileTimeRaw(int fd, //throw FileError sizeof(fileTimes), //size_t attrBufSize, 0); //unsigned long options if (rv != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"getattrlist", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(filePath)), L"getattrlist"); createTime.tv_sec = fileTimes.createTime.tv_sec; createTime.tv_nsec = fileTimes.createTime.tv_nsec; @@ -984,12 +985,12 @@ void zen::setFileTime(const Zstring& filePath, std::int64_t modTime, ProcSymlink if (procSl == ProcSymlink::FOLLOW) { if (::utimes(filePath.c_str(), writeTime) != 0) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"utimes", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"utimes"); } else { if (::lutimes(filePath.c_str(), writeTime) != 0) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"lutimes", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(filePath)), L"lutimes"); } } @@ -1010,7 +1011,7 @@ bool zen::supportsPermissions(const Zstring& dirpath) //throw FileError 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", fmtPath(dirpath)), L"GetVolumePathName", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(dirpath)), L"GetVolumePathName"); const Zstring volumePath = appendSeparator(&buffer[0]); @@ -1023,7 +1024,7 @@ bool zen::supportsPermissions(const Zstring& dirpath) //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", fmtPath(dirpath)), L"GetVolumeInformation", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(dirpath)), L"GetVolumeInformation"); return (fsFlags & FILE_PERSISTENT_ACLS) != 0; @@ -1049,7 +1050,7 @@ void copySecurityContext(const Zstring& source, const Zstring& target, ProcSymli errno == EOPNOTSUPP) //extended attributes are not supported by the filesystem return; - throwFileError(replaceCpy(_("Cannot read security context of %x."), L"%x", fmtPath(source)), L"getfilecon", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read security context of %x."), L"%x", fmtPath(source)), L"getfilecon"); } ZEN_ON_SCOPE_EXIT(::freecon(contextSource)); @@ -1077,7 +1078,7 @@ void copySecurityContext(const Zstring& source, const Zstring& target, ProcSymli ::setfilecon(target.c_str(), contextSource) : ::lsetfilecon(target.c_str(), contextSource); if (rv3 < 0) - throwFileError(replaceCpy(_("Cannot write security context of %x."), L"%x", fmtPath(target)), L"setfilecon", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write security context of %x."), L"%x", fmtPath(target)), L"setfilecon"); } #endif //HAVE_SELINUX @@ -1128,7 +1129,7 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P if (bytesNeeded > buffer.size()) buffer.resize(bytesNeeded); else - throwFileError(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourceResolved)), L"GetFileSecurity", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourceResolved)), L"GetFileSecurity"); } SECURITY_DESCRIPTOR& secDescr = reinterpret_cast<SECURITY_DESCRIPTOR&>(buffer[0]); @@ -1152,7 +1153,7 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION, //__in SECURITY_INFORMATION SecurityInformation, &secDescr)) //__in PSECURITY_DESCRIPTOR pSecurityDescriptor - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetResolved)), L"SetFileSecurity", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetResolved)), L"SetFileSecurity"); /* PSECURITY_DESCRIPTOR buffer = nullptr; @@ -1212,13 +1213,13 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P if (targetHandle.get() == INVALID_HANDLE_VALUE) throw FileError - SECURITY_INFORMATION secFlags = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION; + SECURITY_INFORMATION secFlags = OWNER_SECURITY_INFORMATION | GROUP_SECURITY_INFORMATION | DACL_SECURITY_INFORMATION | SACL_SECURITY_INFORMATION; - //SACL/DACL inheritence flag is NOT copied by default: we have to tell ::SetSecurityInfo(() to enable/disable it manually! - //if (secCtrl & SE_DACL_PRESENT) - secFlags |= (secCtrl & SE_DACL_PROTECTED) ? PROTECTED_DACL_SECURITY_INFORMATION : UNPROTECTED_DACL_SECURITY_INFORMATION; - //if (secCtrl & SE_SACL_PRESENT) - secFlags |= (secCtrl & SE_SACL_PROTECTED) ? PROTECTED_SACL_SECURITY_INFORMATION : UNPROTECTED_SACL_SECURITY_INFORMATION; + //SACL/DACL inheritence flag is NOT copied by default: we have to tell ::SetSecurityInfo(() to enable/disable it manually! + //if (secCtrl & SE_DACL_PRESENT) + secFlags |= (secCtrl & SE_DACL_PROTECTED) ? PROTECTED_DACL_SECURITY_INFORMATION : UNPROTECTED_DACL_SECURITY_INFORMATION; + //if (secCtrl & SE_SACL_PRESENT) + secFlags |= (secCtrl & SE_SACL_PROTECTED) ? PROTECTED_SACL_SECURITY_INFORMATION : UNPROTECTED_SACL_SECURITY_INFORMATION; // rc = ::SetNamedSecurityInfo(const_cast<WCHAR*>(applyLongPathPrefix(target).c_str()), //__in LPTSTR pObjectName, -> does NOT dereference symlinks! @@ -1232,7 +1233,7 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P if (rc != ERROR_SUCCESS) throw FileError - */ + */ #elif defined ZEN_LINUX @@ -1244,25 +1245,25 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P if (procSl == ProcSymlink::FOLLOW) { if (::stat(sourcePath.c_str(), &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"stat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"stat"); if (::chown(targetPath.c_str(), fileInfo.st_uid, fileInfo.st_gid) != 0) // may require admin rights! - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chown", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chown"); if (::chmod(targetPath.c_str(), fileInfo.st_mode) != 0) - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chmod", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chmod"); } else { if (::lstat(sourcePath.c_str(), &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"lstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"lstat"); if (::lchown(targetPath.c_str(), fileInfo.st_uid, fileInfo.st_gid) != 0) // may require admin rights! - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"lchown", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"lchown"); if (!symlinkExists(targetPath) && //setting access permissions doesn't make sense for symlinks on Linux: there is no lchmod() ::chmod(targetPath.c_str(), fileInfo.st_mode) != 0) - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chmod", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chmod"); } #elif defined ZEN_MAC @@ -1271,7 +1272,7 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P flags |= COPYFILE_NOFOLLOW; if (::copyfile(sourcePath.c_str(), targetPath.c_str(), 0, flags) != 0) - throwFileError(replaceCpy(replaceCpy(_("Cannot copy permissions from %x to %y."), L"%x", L"\n" + fmtPath(sourcePath)), L"%y", L"\n" + fmtPath(targetPath)), L"copyfile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(replaceCpy(_("Cannot copy permissions from %x to %y."), L"%x", L"\n" + fmtPath(sourcePath)), L"%y", L"\n" + fmtPath(targetPath)), L"copyfile"); //owner is *not* copied with ::copyfile(): @@ -1279,18 +1280,18 @@ void copyItemPermissions(const Zstring& sourcePath, const Zstring& targetPath, P if (procSl == ProcSymlink::FOLLOW) { if (::stat(sourcePath.c_str(), &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"stat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"stat"); if (::chown(targetPath.c_str(), fileInfo.st_uid, fileInfo.st_gid) != 0) // may require admin rights! - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chown", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"chown"); } else { if (::lstat(sourcePath.c_str(), &fileInfo) != 0) - throwFileError(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"lstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read permissions of %x."), L"%x", fmtPath(sourcePath)), L"lstat"); if (::lchown(targetPath.c_str(), fileInfo.st_uid, fileInfo.st_gid) != 0) // may require admin rights! - throwFileError(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"lchown", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write permissions of %x."), L"%x", fmtPath(targetPath)), L"lchown"); } #endif } @@ -1365,29 +1366,29 @@ void zen::copyNewDirectory(const Zstring& sourcePath, const Zstring& targetPath, if (!::CreateDirectory(applyLongPathPrefixCreateDir(targetPath).c_str(), //__in LPCTSTR lpPathName, nullptr)) //__in_opt LPSECURITY_ATTRIBUTES lpSecurityAttributes { - DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! + DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! //handle issues with already existing short 8.3 file names on Windows - if (lastError == ERROR_ALREADY_EXISTS) + if (ec == ERROR_ALREADY_EXISTS) if (have8dot3NameClash(targetPath)) { Fix8Dot3NameClash dummy(targetPath); //throw FileError; move clashing object to the side //now try again... if (::CreateDirectory(applyLongPathPrefixCreateDir(targetPath).c_str(), nullptr)) - lastError = ERROR_SUCCESS; + ec = ERROR_SUCCESS; else - lastError = ::GetLastError(); + ec = ::GetLastError(); } - if (lastError != ERROR_SUCCESS) + if (ec != ERROR_SUCCESS) { const std::wstring errorMsg = replaceCpy(_("Cannot create directory %x."), L"%x", fmtPath(targetPath)); - const std::wstring errorDescr = formatSystemError(L"CreateDirectory", lastError); + const std::wstring errorDescr = formatSystemError(L"CreateDirectory", ec); - if (lastError == ERROR_ALREADY_EXISTS) + if (ec == ERROR_ALREADY_EXISTS) throw ErrorTargetExisting(errorMsg, errorDescr); - else if (lastError == ERROR_PATH_NOT_FOUND) + else if (ec == ERROR_PATH_NOT_FOUND) throw ErrorTargetPathMissing(errorMsg, errorDescr); throw FileError(errorMsg, errorDescr); } @@ -1525,7 +1526,7 @@ void zen::copySymlink(const Zstring& sourceLink, const Zstring& targetLink, bool const wchar_t functionName[] = L"symlink"; if (::symlink(linkPath.c_str(), targetLink.c_str()) != 0) #endif - throwFileError(replaceCpy(replaceCpy(_("Cannot copy symbolic link %x to %y."), L"%x", L"\n" + fmtPath(sourceLink)), L"%y", L"\n" + fmtPath(targetLink)), functionName, getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(replaceCpy(_("Cannot copy symbolic link %x to %y."), L"%x", L"\n" + fmtPath(sourceLink)), L"%y", L"\n" + fmtPath(targetLink)), functionName); //allow only consistent objects to be created -> don't place before ::symlink, targetLink may already exist! zen::ScopeGuard guardNewLink = zen::makeGuard([&] @@ -1548,24 +1549,24 @@ void zen::copySymlink(const Zstring& sourceLink, const Zstring& targetLink, bool if (!::GetFileAttributesEx(applyLongPathPrefix(sourceLink).c_str(), //__in LPCTSTR lpFileName, GetFileExInfoStandard, //__in GET_FILEEX_INFO_LEVELS fInfoLevelId, &sourceAttr)) //__out LPVOID lpFileInformation - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceLink)), L"GetFileAttributesEx", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceLink)), L"GetFileAttributesEx"); setFileTimeRaw(targetLink, &sourceAttr.ftCreationTime, sourceAttr.ftLastWriteTime, ProcSymlink::DIRECT); //throw FileError #elif defined ZEN_LINUX struct ::stat sourceInfo = {}; if (::lstat(sourceLink.c_str(), &sourceInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceLink)), L"lstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceLink)), L"lstat"); setFileTime(targetLink, sourceInfo.st_mtime, ProcSymlink::DIRECT); //throw FileError #elif defined ZEN_MAC struct ::stat sourceInfo = {}; if (::lstat(sourceLink.c_str(), &sourceInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceLink)), L"lstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceLink)), L"lstat"); if (::copyfile(sourceLink.c_str(), targetLink.c_str(), 0, COPYFILE_XATTR | COPYFILE_NOFOLLOW) != 0) - throwFileError(replaceCpy(replaceCpy(_("Cannot copy attributes from %x to %y."), L"%x", L"\n" + fmtPath(sourceLink)), L"%y", L"\n" + fmtPath(targetLink)), L"copyfile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(replaceCpy(_("Cannot copy attributes from %x to %y."), L"%x", L"\n" + fmtPath(sourceLink)), L"%y", L"\n" + fmtPath(targetLink)), L"copyfile"); setFileTimeRaw(targetLink, &sourceInfo.st_birthtimespec, sourceInfo.st_mtimespec, ProcSymlink::DIRECT); //throw FileError #endif @@ -1582,15 +1583,15 @@ namespace #ifdef ZEN_WIN /* CopyFileEx() BackupRead() FileRead() - -------------------------------------------- -Attributes YES NO NO + -------------------------------------------- +Attributes YES NO NO create time NO NO NO -ADS YES YES NO -Encrypted YES NO(silent fail!) NO -Compressed NO NO NO -Sparse NO YES NO +ADS YES YES NO +Encrypted YES NO(silent fail!) NO +Compressed NO NO NO +Sparse NO YES NO Nonstandard FS YES UNKNOWN -> error writing ADS to Samba, issues reading from NAS, error copying files having "blocked" state... ect. -PERF - 6% faster +PERF - 6% faster Mark stream as compressed: FSCTL_SET_COMPRESSION - compatible with both BackupRead() and FileRead() @@ -1730,14 +1731,14 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw nullptr); //_In_opt_ HANDLE hTemplateFile if (hFileSource == INVALID_HANDLE_VALUE) { - const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! const std::wstring errorMsg = replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(sourceFile)); - std::wstring errorDescr = formatSystemError(L"CreateFile", lastError); + std::wstring errorDescr = formatSystemError(L"CreateFile", ec); //if file is locked throw "ErrorFileLocked" instead! - if (lastError == ERROR_SHARING_VIOLATION || - lastError == ERROR_LOCK_VIOLATION) + if (ec == ERROR_SHARING_VIOLATION || + ec == ERROR_LOCK_VIOLATION) { #ifdef ZEN_WIN_VISTA_AND_LATER //(try to) enhance error message const std::wstring procList = vista::getLockingProcesses(sourceFile); //noexcept @@ -1754,7 +1755,7 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw //---------------------------------------------------------------------- BY_HANDLE_FILE_INFORMATION fileInfoSource = {}; if (!::GetFileInformationByHandle(hFileSource, &fileInfoSource)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceFile)), L"GetFileInformationByHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceFile)), L"GetFileInformationByHandle"); //encrypted files cannot be read with BackupRead which would fail silently! const bool sourceIsEncrypted = (fileInfoSource.dwFileAttributes & FILE_ATTRIBUTE_ENCRYPTED) != 0; @@ -1785,15 +1786,15 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw nullptr); //_In_opt_ HANDLE hTemplateFile if (hFileTarget == INVALID_HANDLE_VALUE) { - const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! const std::wstring errorMsg = replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(targetFile)); - const std::wstring errorDescr = formatSystemError(L"CreateFile", lastError); + const std::wstring errorDescr = formatSystemError(L"CreateFile", ec); - if (lastError == ERROR_FILE_EXISTS || //confirmed to be used - lastError == ERROR_ALREADY_EXISTS) //comment on msdn claims, this one is used on Windows Mobile 6 + if (ec == ERROR_FILE_EXISTS || //confirmed to be used + ec == ERROR_ALREADY_EXISTS) //comment on msdn claims, this one is used on Windows Mobile 6 throw ErrorTargetExisting(errorMsg, errorDescr); - //if (lastError == ERROR_PATH_NOT_FOUND) throw ErrorTargetPathMissing(errorMsg, errorDescr); + //if (ec == ERROR_PATH_NOT_FOUND) throw ErrorTargetPathMissing(errorMsg, errorDescr); throw FileError(errorMsg, errorDescr); } @@ -1803,7 +1804,7 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw //---------------------------------------------------------------------- BY_HANDLE_FILE_INFORMATION fileInfoTarget = {}; if (!::GetFileInformationByHandle(hFileTarget, &fileInfoTarget)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(targetFile)), L"GetFileInformationByHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(targetFile)), L"GetFileInformationByHandle"); //return up-to-date file attributes InSyncAttributes newAttrib = {}; @@ -1854,7 +1855,7 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw 0, //_In_ DWORD nOutBufferSize, &bytesReturned, //_Out_opt_ LPDWORD lpBytesReturned, nullptr)) //_Inout_opt_ LPOVERLAPPED lpOverlapped - throwFileError(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtPath(targetFile)), L"DeviceIoControl, FSCTL_SET_SPARSE", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file attributes of %x."), L"%x", fmtPath(targetFile)), L"DeviceIoControl, FSCTL_SET_SPARSE"); } //---------------------------------------------------------------------- @@ -1881,7 +1882,7 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw false, //__in BOOL bAbort, false, //__in BOOL bProcessSecurity, &contextRead)) //__out LPVOID *lpContext - throwFileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(sourceFile)), L"BackupRead", getLastError()); //better use fine-granular error messages "reading/writing"! + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(sourceFile)), L"BackupRead"); //better use fine-granular error messages "reading/writing"! if (bytesRead > BUFFER_SIZE) throw FileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(sourceFile)), L"BackupRead: buffer overflow."); //user should never see this @@ -1897,7 +1898,7 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw false, //__in BOOL bAbort, false, //__in BOOL bProcessSecurity, &contextWrite)) //__out LPVOID *lpContext - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(targetFile)), L"BackupWrite", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(targetFile)), L"BackupWrite"); if (bytesWritten != bytesRead) throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(targetFile)), L"BackupWrite: incomplete write."); //user should never see this @@ -1920,7 +1921,7 @@ InSyncAttributes copyFileWindowsBackupStream(const Zstring& sourceFile, //throw &fileInfoSource.ftCreationTime, nullptr, &fileInfoSource.ftLastWriteTime)) - throwFileError(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(targetFile)), L"SetFileTime", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write modification time of %x."), L"%x", fmtPath(targetFile)), L"SetFileTime"); guardTarget.dismiss(); return newAttrib; @@ -1975,13 +1976,13 @@ DWORD CALLBACK copyCallbackInternal(LARGE_INTEGER totalFileSize, file time handling: ::CopyFileEx() will (only) copy file modification time over from source file AFTER the last invokation of this callback => it is possible to adapt file creation time of target in here, but NOT file modification time! - CAVEAT: if ::CopyFileEx() fails to set modification time, it silently ignores this error and returns success!!! (confirmed with Process Monitor) + CAVEAT: if ::CopyFileEx() fails to set modification time, it silently ignores this error and returns success!!! (confirmed with Process Monitor) alternate data stream handling: CopyFileEx() processes multiple streams one after another, stream 1 is the file data stream and always available! Each stream is initialized with CALLBACK_STREAM_SWITCH and provides *new* hSourceFile, hDestinationFile. Calling GetFileInformationByHandle() on hDestinationFile for stream > 1 results in ERROR_ACCESS_DENIED! - totalBytesTransferred contains size of *all* streams and so can be larger than the "file size" file attribute + totalBytesTransferred contains size of *all* streams and so can be larger than the "file size" file attribute */ CallbackData& cbd = *static_cast<CallbackData*>(lpData); @@ -1993,10 +1994,10 @@ DWORD CALLBACK copyCallbackInternal(LARGE_INTEGER totalFileSize, { //#################### return source file attributes ################################ if (!::GetFileInformationByHandle(hSourceFile, &cbd.fileInfoSrc)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(cbd.sourceFile_)), L"GetFileInformationByHandle", ::GetLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(cbd.sourceFile_)), L"GetFileInformationByHandle"); if (!::GetFileInformationByHandle(hDestinationFile, &cbd.fileInfoTrg)) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(cbd.targetFile_)), L"GetFileInformationByHandle", ::GetLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(cbd.targetFile_)), L"GetFileInformationByHandle"); //#################### switch to sparse file copy if req. ####################### #ifdef ZEN_WIN_VISTA_AND_LATER @@ -2087,7 +2088,7 @@ InSyncAttributes copyFileWindowsDefault(const Zstring& sourceFile, //throw FileE if (!success) { - const DWORD lastError = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! //don't suppress "lastError == ERROR_REQUEST_ABORTED": a user aborted operation IS an error condition! @@ -2095,23 +2096,23 @@ InSyncAttributes copyFileWindowsDefault(const Zstring& sourceFile, //throw FileE if (canCopyAsSparse(sourceFile, targetFile)) //noexcept throw ErrorFallbackToCopyAsBackupStream(L"sparse, copy failure"); - if (lastError == ERROR_ACCESS_DENIED && backupPrivilegesActive) + if (ec == ERROR_ACCESS_DENIED && backupPrivilegesActive) //chances are good this will work with copyFileWindowsBackupStream: https://sourceforge.net/p/freefilesync/discussion/open-discussion/thread/1998ebf2/ throw ErrorFallbackToCopyAsBackupStream(L"access denied"); //copying ADS may incorrectly fail with ERROR_FILE_NOT_FOUND: https://sourceforge.net/p/freefilesync/discussion/help/thread/a18a2c02/ - if (lastError == ERROR_FILE_NOT_FOUND && + if (ec == ERROR_FILE_NOT_FOUND && cbd.fileInfoSrc.nNumberOfLinks > 0 && cbd.fileInfoTrg.nNumberOfLinks > 0) throw ErrorFallbackToCopyAsBackupStream(L"bogus file not found"); //assemble error message... const std::wstring errorMsg = replaceCpy(replaceCpy(_("Cannot copy file %x to %y."), L"%x", L"\n" + fmtPath(sourceFile)), L"%y", L"\n" + fmtPath(targetFile)); - std::wstring errorDescr = formatSystemError(L"CopyFileEx", lastError); + std::wstring errorDescr = formatSystemError(L"CopyFileEx", ec); //if file is locked throw "ErrorFileLocked" instead! - if (lastError == ERROR_SHARING_VIOLATION || - lastError == ERROR_LOCK_VIOLATION) + if (ec == ERROR_SHARING_VIOLATION || + ec == ERROR_LOCK_VIOLATION) { #ifdef ZEN_WIN_VISTA_AND_LATER //(try to) enhance error message const std::wstring procList = vista::getLockingProcesses(sourceFile); //noexcept @@ -2122,8 +2123,8 @@ InSyncAttributes copyFileWindowsDefault(const Zstring& sourceFile, //throw FileE } //if target is existing this functions is expected to throw ErrorTargetExisting!!! - if (lastError == ERROR_FILE_EXISTS || //confirmed to be used - lastError == ERROR_ALREADY_EXISTS) //not sure if used -> better be safe than sorry!!! + if (ec == ERROR_FILE_EXISTS || //confirmed to be used + ec == ERROR_ALREADY_EXISTS) //not sure if used -> better be safe than sorry!!! { guardTarget.dismiss(); //don't delete file that existed previously! throw ErrorTargetExisting(errorMsg, errorDescr); @@ -2134,7 +2135,7 @@ InSyncAttributes copyFileWindowsDefault(const Zstring& sourceFile, //throw FileE try //add more meaningful message { //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 && + if (ec == ERROR_INVALID_PARAMETER && isFatDrive(targetFile) && getFilesize(sourceFile) >= 4U * std::uint64_t(1024U * 1024 * 1024)) //throw FileError errorDescr += L"\nFAT volumes cannot store files larger than 4 gigabytes."; @@ -2148,7 +2149,7 @@ InSyncAttributes copyFileWindowsDefault(const Zstring& sourceFile, //throw FileE } //caveat: - ::CopyFileEx() silently *ignores* failure to set modification time!!! => we always need to set it again but with proper error checking! - // - perf: recent measurements show no slow down at all for buffered USB sticks! + // - perf: recent measurements show no slow down at all for buffered USB sticks! setFileTimeRaw(targetFile, &cbd.fileInfoSrc.ftCreationTime, cbd.fileInfoSrc.ftLastWriteTime, ProcSymlink::FOLLOW); //throw FileError guardTarget.dismiss(); //target has been created successfully! @@ -2209,7 +2210,7 @@ InSyncAttributes copyFileOsSpecific(const Zstring& sourceFile, //throw FileError struct ::stat sourceInfo = {}; if (::fstat(fileIn.getHandle(), &sourceInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceFile)), L"fstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(sourceFile)), L"fstat"); const int fdTarget = ::open(targetFile.c_str(), O_WRONLY | O_CREAT | O_EXCL, sourceInfo.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO)); //analog to "cp" which copies "mode" (considering umask) by default @@ -2240,7 +2241,7 @@ InSyncAttributes copyFileOsSpecific(const Zstring& sourceFile, //throw FileError struct ::stat targetInfo = {}; if (::fstat(fileOut.getHandle(), &targetInfo) != 0) - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(targetFile)), L"fstat", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(targetFile)), L"fstat"); newAttrib.fileSize = sourceInfo.st_size; #ifdef ZEN_MAC @@ -2258,7 +2259,7 @@ InSyncAttributes copyFileOsSpecific(const Zstring& sourceFile, //throw FileError //docs: http://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man3/copyfile.3.html //source: http://www.opensource.apple.com/source/copyfile/copyfile-103.92.1/copyfile.c if (::fcopyfile(fileIn.getHandle(), fileOut.getHandle(), 0, COPYFILE_XATTR) != 0) - throwFileError(replaceCpy(replaceCpy(_("Cannot copy attributes from %x to %y."), L"%x", L"\n" + fmtPath(sourceFile)), L"%y", L"\n" + fmtPath(targetFile)), L"copyfile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(replaceCpy(_("Cannot copy attributes from %x to %y."), L"%x", L"\n" + fmtPath(sourceFile)), L"%y", L"\n" + fmtPath(targetFile)), L"copyfile"); #endif fileOut.close(); //throw FileError -> optional, but good place to catch errors when closing stream! @@ -2290,8 +2291,8 @@ InSyncAttributes copyFileOsSpecific(const Zstring& sourceFile, //throw FileError | copyFileOsSpecific (solve 8.3 issue on Windows) | - copyFileWindowsSelectRoutine - / \ + copyFileWindowsSelectRoutine + / \ copyFileWindowsDefault(::CopyFileEx) copyFileWindowsBackupStream(::BackupRead/::BackupWrite) */ } diff --git a/zen/file_error.h b/zen/file_error.h index d8c6224c..7be52282 100644 --- a/zen/file_error.h +++ b/zen/file_error.h @@ -36,14 +36,23 @@ DEFINE_NEW_FILE_ERROR(ErrorFileLocked); DEFINE_NEW_FILE_ERROR(ErrorDifferentVolume); -//CAVEAT: evalulate global error code *before* "throw" statement which may overwrite error code -//due to a memory allocation before it creates the thrown instance! (e.g. affects MinGW + Win XP!!!) -template <class FE = FileError> inline -void throwFileError(const std::wstring& msg, const std::wstring& functionName, const ErrorCode ec) //throw FileError -{ - throw FE(msg, formatSystemError(functionName, ec)); -} +//CAVEAT: thread-local Win32 error code is easily overwritten => evaluate *before* making any (indirect) system calls: +//-> MinGW + Win XP: "throw" statement allocates memory to hold the exception object => error code is cleared +//-> VC 2015, Debug: std::wstring allocator internally calls ::FlsGetValue() => error code is cleared +#ifdef _MSC_VER +#define THROW_LAST_FILE_ERROR(msg, functionName) \ + do \ + { \ + const ErrorCode ecInternal = getLastError(); \ + throw FileError(msg, formatSystemError(functionName, ecInternal)); \ + \ + __pragma(warning(suppress: 4127)) /*"conditional expression is constant"*/ \ + } while (false) +#else //variant witout "__pragma": +#define THROW_LAST_FILE_ERROR(msg, functionName) \ + do { const ErrorCode ecInternal = getLastError(); throw FileError(msg, formatSystemError(functionName, ecInternal)); } while (false) +#endif //----------- facilitate usage of std::wstring for error messages -------------------- diff --git a/zen/file_io.cpp b/zen/file_io.cpp index 1ea8b1b1..68e852da 100644 --- a/zen/file_io.cpp +++ b/zen/file_io.cpp @@ -121,7 +121,7 @@ FileInput::FileInput(const Zstring& filepath) : //throw FileError, ErrorFileLock //begin of "regular" error reporting if (fileHandle == INVALID_HANDLE_VALUE) { - const DWORD ec = ::GetLastError(); //copy before directly or indirectly making other system calls! + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! const std::wstring errorMsg = replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(filepath)); std::wstring errorDescr = formatSystemError(L"CreateFile", ec); @@ -145,7 +145,7 @@ FileInput::FileInput(const Zstring& filepath) : //throw FileError, ErrorFileLock //don't use O_DIRECT: http://yarchive.net/comp/linux/o_direct.html fileHandle = ::open(filepath.c_str(), O_RDONLY); if (fileHandle == -1) //don't check "< 0" -> docu seems to allow "-2" to be a valid file handle - throwFileError(replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(filepath)), L"open", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot open file %x."), L"%x", fmtPath(filepath)), L"open"); #endif //------------------------------------------------------------------------------------------------------ @@ -162,7 +162,7 @@ FileInput::FileInput(const Zstring& filepath) : //throw FileError, ErrorFileLock #ifdef ZEN_LINUX //handle still un-owned => need constructor guard //optimize read-ahead on input file: if (::posix_fadvise(fileHandle, 0, 0, POSIX_FADV_SEQUENTIAL) != 0) - throwFileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(filepath)), L"posix_fadvise", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(filepath)), L"posix_fadvise"); #elif defined ZEN_MAC //"dtruss" doesn't show use of "fcntl() F_RDAHEAD/F_RDADVISE" for "cp") @@ -197,7 +197,7 @@ size_t FileInput::read(void* buffer, size_t bytesToRead) //throw FileError; retu static_cast<DWORD>(bytesToRead), //__in DWORD nNumberOfBytesToRead, &bytesRead, //__out_opt LPDWORD lpNumberOfBytesRead, nullptr)) //__inout_opt LPOVERLAPPED lpOverlapped - throwFileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(getFilePath())), L"ReadFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(getFilePath())), L"ReadFile"); #elif defined ZEN_LINUX || defined ZEN_MAC ssize_t bytesRead = 0; @@ -208,7 +208,7 @@ size_t FileInput::read(void* buffer, size_t bytesToRead) //throw FileError; retu while (bytesRead < 0 && errno == EINTR); //Compare copy_reg() in copy.c: ftp://ftp.gnu.org/gnu/coreutils/coreutils-8.23.tar.xz if (bytesRead < 0) - throwFileError(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(getFilePath())), L"read", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file %x."), L"%x", fmtPath(getFilePath())), L"read"); #endif if (bytesRead == 0) //"zero indicates end of file" return bytesReadTotal; @@ -262,7 +262,7 @@ FileOutput::FileOutput(const Zstring& filepath, AccessFlag access) : //throw Fil fileHandle = createHandle(FILE_ATTRIBUTE_NORMAL); if (fileHandle == INVALID_HANDLE_VALUE) { - DWORD ec = ::GetLastError(); //copy before directly or indirectly making other system calls! + DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! //CREATE_ALWAYS fails with ERROR_ACCESS_DENIED if the existing file is hidden or "system" http://msdn.microsoft.com/en-us/library/windows/desktop/aa363858(v=vs.85).aspx if (ec == ERROR_ACCESS_DENIED && dwCreationDisposition == CREATE_ALWAYS) @@ -352,10 +352,10 @@ void FileOutput::close() //throw FileError #ifdef ZEN_WIN if (!::CloseHandle(fileHandle)) - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"CloseHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"CloseHandle"); #elif defined ZEN_LINUX || defined ZEN_MAC if (::close(fileHandle) != 0) - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"close", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"close"); #endif } @@ -369,7 +369,7 @@ void FileOutput::write(const void* buffer, size_t bytesToWrite) //throw FileErro static_cast<DWORD>(bytesToWrite), //__in DWORD nNumberOfBytesToWrite, &bytesWritten, //__out_opt LPDWORD lpNumberOfBytesWritten, nullptr)) //__inout_opt LPOVERLAPPED lpOverlapped - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"WriteFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"WriteFile"); if (bytesWritten != bytesToWrite) //must be fulfilled for synchronous writes! throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"WriteFile: incomplete write."); //user should never see this @@ -389,7 +389,7 @@ void FileOutput::write(const void* buffer, size_t bytesToWrite) //throw FileErro if (bytesWritten == 0) //comment in safe-read.c suggests to treat this as an error due to buggy drivers errno = ENOSPC; - throwFileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"write", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"write"); } if (bytesWritten > static_cast<ssize_t>(bytesToWrite)) //better safe than sorry throw FileError(replaceCpy(_("Cannot write file %x."), L"%x", fmtPath(getFilePath())), L"write: buffer overflow."); //user should never see this diff --git a/zen/file_traverser.cpp b/zen/file_traverser.cpp index 3ef94032..facce75c 100644 --- a/zen/file_traverser.cpp +++ b/zen/file_traverser.cpp @@ -39,15 +39,15 @@ void zen::traverseFolder(const Zstring& dirPath, HANDLE hDir = ::FindFirstFile(applyLongPathPrefix(appendSeparator(dirPath) + L'*').c_str(), &findData); if (hDir == INVALID_HANDLE_VALUE) { - const DWORD lastError = ::GetLastError(); //copy before making other system calls! - if (lastError == ERROR_FILE_NOT_FOUND) + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! + if (ec == 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(dirPath)) //yes, a race-condition, still the best we can do return; } - throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtPath(dirPath)), L"FindFirstFile", lastError); + throw FileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtPath(dirPath)), formatSystemError(L"FindFirstFile", ec)); } ZEN_ON_SCOPE_EXIT(::FindClose(hDir)); @@ -58,37 +58,39 @@ void zen::traverseFolder(const Zstring& dirPath, firstIteration = false; else if (!::FindNextFile(hDir, &findData)) { - const DWORD lastError = ::GetLastError(); - if (lastError == ERROR_NO_MORE_FILES) //not an error situation + const DWORD ec = ::GetLastError(); //copy before directly/indirectly making other system calls! + if (ec == ERROR_NO_MORE_FILES) //not an error situation return; //else we have a problem... report it: - throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"FindNextFile", lastError); + throw FileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), formatSystemError(L"FindNextFile", ec)); } //skip "." and ".." - const Zchar* const shortName = findData.cFileName; + const wchar_t* const itemNameRaw = findData.cFileName; - if (shortName[0] == 0) throw FileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"FindNextFile: Data corruption; item is missing a name."); - if (shortName[0] == L'.' && - (shortName[1] == 0 || (shortName[1] == L'.' && shortName[2] == 0))) + if (itemNameRaw[0] == 0) + throw FileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"FindNextFile: Data corruption; item with empty name."); + + if (itemNameRaw[0] == L'.' && + (itemNameRaw[1] == 0 || (itemNameRaw[1] == L'.' && itemNameRaw[2] == 0))) continue; - const Zstring& itempath = appendSeparator(dirPath) + shortName; + const Zstring& itemPath = appendSeparator(dirPath) + itemNameRaw; if (zen::isSymlink(findData)) //check first! { if (onLink) - onLink({ shortName, itempath, filetimeToTimeT(findData.ftLastWriteTime) }); + onLink({ itemPath, filetimeToTimeT(findData.ftLastWriteTime) }); } else if ((findData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0) { if (onDir) - onDir({ shortName, itempath }); + onDir({ itemPath }); } else //a file { if (onFile) - onFile({ shortName, itempath, get64BitUInt(findData.nFileSizeLow, findData.nFileSizeHigh), filetimeToTimeT(findData.ftLastWriteTime) }); + onFile({ itemPath, get64BitUInt(findData.nFileSizeLow, findData.nFileSizeHigh), filetimeToTimeT(findData.ftLastWriteTime) }); } } @@ -106,32 +108,34 @@ void zen::traverseFolder(const Zstring& dirPath, DIR* dirObj = ::opendir(dirPath.c_str()); //directory must NOT end with path separator, except "/" if (!dirObj) - throwFileError(replaceCpy(_("Cannot open directory %x."), L"%x", fmtPath(dirPath)), L"opendir", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot open directory %x."), L"%x", fmtPath(dirPath)), L"opendir"); ZEN_ON_SCOPE_EXIT(::closedir(dirObj)); //never close nullptr handles! -> crash for (;;) { struct ::dirent* dirEntry = nullptr; if (::readdir_r(dirObj, reinterpret_cast< ::dirent*>(&buffer[0]), &dirEntry) != 0) - throwFileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"readdir_r", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"readdir_r"); //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 ".." - const char* shortName = dirEntry->d_name; + const char* itemNameRaw = dirEntry->d_name; + + if (itemNameRaw[0] == 0) + throw FileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"readdir_r: Data corruption; item with empty name."); - if (shortName[0] == 0) throw FileError(replaceCpy(_("Cannot enumerate directory %x."), L"%x", fmtPath(dirPath)), L"readdir_r: Data corruption; item is missing a name."); - if (shortName[0] == '.' && - (shortName[1] == 0 || (shortName[1] == '.' && shortName[2] == 0))) + if (itemNameRaw[0] == '.' && + (itemNameRaw[1] == 0 || (itemNameRaw[1] == '.' && itemNameRaw[2] == 0))) continue; #ifdef ZEN_MAC //some file system abstraction layers fail to properly return decomposed UTF8: http://developer.apple.com/library/mac/#qa/qa1173/_index.html //so we need to do it ourselves; perf: ~600 ns per conversion //note: it's not sufficient to apply this in z_impl::compareFilenamesNoCase: if UTF8 forms differ, FFS assumes a rename in case sensitivity and // will try to propagate the rename => this won't work if target drive reports a particular UTF8 form only! - if (CFStringRef cfStr = osx::createCFString(shortName)) + if (CFStringRef cfStr = osx::createCFString(itemNameRaw)) { ZEN_ON_SCOPE_EXIT(::CFRelease(cfStr)); @@ -140,19 +144,19 @@ void zen::traverseFolder(const Zstring& dirPath, { bufferUtfDecomposed.resize(lenMax); if (::CFStringGetFileSystemRepresentation(cfStr, &bufferUtfDecomposed[0], lenMax)) //get decomposed UTF form (verified!) despite ambiguous documentation - shortName = &bufferUtfDecomposed[0]; + itemNameRaw = &bufferUtfDecomposed[0]; } } //const char* sampleDecomposed = "\x6f\xcc\x81.txt"; //const char* samplePrecomposed = "\xc3\xb3.txt"; #endif - const Zstring& itempath = appendSeparator(dirPath) + shortName; + const Zstring& itemPath = appendSeparator(dirPath) + itemNameRaw; struct ::stat statData = {}; try { - if (::lstat(itempath.c_str(), &statData) != 0) //lstat() does not resolve symlinks - throwFileError(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(itempath)), L"lstat", getLastError()); + if (::lstat(itemPath.c_str(), &statData) != 0) //lstat() does not resolve symlinks + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot read file attributes of %x."), L"%x", fmtPath(itemPath)), L"lstat"); } catch (const FileError& e) { @@ -164,17 +168,17 @@ void zen::traverseFolder(const Zstring& dirPath, if (S_ISLNK(statData.st_mode)) //on Linux there is no distinction between file and directory symlinks! { if (onLink) - onLink({ shortName, itempath, statData.st_mtime}); + onLink({ itemPath, statData.st_mtime}); } else if (S_ISDIR(statData.st_mode)) //a directory { if (onDir) - onDir({ shortName, itempath }); + onDir({ itemPath }); } else //a file or named pipe, ect. { if (onFile) - onFile({ shortName, itempath, makeUnsigned(statData.st_size), statData.st_mtime }); + onFile({ itemPath, makeUnsigned(statData.st_size), statData.st_mtime }); } /* 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: diff --git a/zen/file_traverser.h b/zen/file_traverser.h index 3f8030d3..75c7660c 100644 --- a/zen/file_traverser.h +++ b/zen/file_traverser.h @@ -16,7 +16,6 @@ namespace zen { struct FileInfo { - const Zchar* shortName; const Zstring& fullPath; std::uint64_t fileSize; //[bytes] std::int64_t lastWriteTime; //number of seconds since Jan. 1st 1970 UTC @@ -24,13 +23,11 @@ struct FileInfo struct DirInfo { - const Zchar* shortName; const Zstring& fullPath; }; struct SymlinkInfo { - const Zchar* shortName; const Zstring& fullPath; std::int64_t lastWriteTime; //number of seconds since Jan. 1st 1970 UTC }; diff --git a/zen/fixed_list.h b/zen/fixed_list.h index a1f83eb4..61ce3f16 100644 --- a/zen/fixed_list.h +++ b/zen/fixed_list.h @@ -27,10 +27,7 @@ class FixedList }; public: - FixedList() : - firstInsert(nullptr), - lastInsert(nullptr), - sz(0) {} + FixedList() {} ~FixedList() { clear(); } @@ -151,9 +148,9 @@ private: delete oldNode; } - Node* firstInsert; - Node* lastInsert; //point to last insertion; required by efficient emplace_back() - size_t sz; + Node* firstInsert = nullptr; + Node* lastInsert = nullptr; //point to last insertion; required by efficient emplace_back() + size_t sz = 0; }; } @@ -33,6 +33,7 @@ struct TranslationHandler { virtual ~TranslationHandler() {} + //C++11: std::wstring should be thread-safe like an int virtual std::wstring translate(const std::wstring& text) = 0; //simple translation virtual std::wstring translate(const std::wstring& singular, const std::wstring& plural, std::int64_t n) = 0; }; diff --git a/zen/long_path_prefix.h b/zen/long_path_prefix.h index 4b79e051..6f6ebfdc 100644 --- a/zen/long_path_prefix.h +++ b/zen/long_path_prefix.h @@ -30,9 +30,9 @@ Zstring ntPathToWin32Path(const Zstring& path); //noexcept http://msdn.microsoft.com/en-us/library/windows/desktop/aa365247%28v=vs.85%29.aspx#NT_Namespaces As used by GetModuleFileNameEx() and symlinks (FSCTL_GET_REPARSE_POINT): - E.g.: - \??\C:\folder -> C:\folder - \SystemRoot -> C:\Windows + E.g.: + \??\C:\folder -> C:\folder + \SystemRoot -> C:\Windows */ } diff --git a/zen/process_priority.cpp b/zen/process_priority.cpp index 577e33a6..017eaa8b 100644 --- a/zen/process_priority.cpp +++ b/zen/process_priority.cpp @@ -41,7 +41,7 @@ struct ScheduleForBackgroundProcessing::Pimpl {}; ScheduleForBackgroundProcessing::ScheduleForBackgroundProcessing() { if (!::SetPriorityClass(::GetCurrentProcess(), PROCESS_MODE_BACKGROUND_BEGIN)) //this call lowers CPU priority, too!! - throwFileError(_("Cannot change process I/O priorities."), L"SetPriorityClass", getLastError()); + THROW_LAST_FILE_ERROR(_("Cannot change process I/O priorities."), L"SetPriorityClass"); } @@ -64,32 +64,32 @@ ScheduleForBackgroundProcessing::~ScheduleForBackgroundProcessing() {}; /* struct ScheduleForBackgroundProcessing { - - required functions ioprio_get/ioprio_set are not part of glibc: http://linux.die.net/man/2/ioprio_set - - and probably never will: http://sourceware.org/bugzilla/show_bug.cgi?id=4464 - - /usr/include/linux/ioprio.h not available on Ubuntu, so we can't use it instead - - ScheduleForBackgroundProcessing() : oldIoPrio(getIoPriority(IOPRIO_WHO_PROCESS, ::getpid())) - { - if (oldIoPrio != -1) - setIoPriority(::getpid(), IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); - } - ~ScheduleForBackgroundProcessing() - { - if (oldIoPrio != -1) - setIoPriority(::getpid(), oldIoPrio); - } + - required functions ioprio_get/ioprio_set are not part of glibc: http://linux.die.net/man/2/ioprio_set + - and probably never will: http://sourceware.org/bugzilla/show_bug.cgi?id=4464 + - /usr/include/linux/ioprio.h not available on Ubuntu, so we can't use it instead + + ScheduleForBackgroundProcessing() : oldIoPrio(getIoPriority(IOPRIO_WHO_PROCESS, ::getpid())) + { + if (oldIoPrio != -1) + setIoPriority(::getpid(), IOPRIO_PRIO_VALUE(IOPRIO_CLASS_IDLE, 0)); + } + ~ScheduleForBackgroundProcessing() + { + if (oldIoPrio != -1) + setIoPriority(::getpid(), oldIoPrio); + } private: - static int getIoPriority(pid_t pid) - { - return ::syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, pid); - } - static int setIoPriority(pid_t pid, int ioprio) - { - return ::syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, ioprio); - } - - const int oldIoPrio; + static int getIoPriority(pid_t pid) + { + return ::syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, pid); + } + static int setIoPriority(pid_t pid, int ioprio) + { + return ::syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, pid, ioprio); + } + + const int oldIoPrio; }; */ #endif diff --git a/zen/recycler.cpp b/zen/recycler.cpp index 75083d57..d49e686c 100644 --- a/zen/recycler.cpp +++ b/zen/recycler.cpp @@ -172,18 +172,18 @@ bool zen::recycleOrDelete(const Zstring& itempath) //throw FileError #ifdef ZEN_WIN -bool zen::recycleBinExists(const Zstring& dirpath, const std::function<void ()>& onUpdateGui) //throw FileError +bool zen::recycleBinExists(const Zstring& dirPath, const std::function<void ()>& onUpdateGui) //throw FileError { #ifdef ZEN_WIN_VISTA_AND_LATER - return vista::supportsRecycleBin(dirpath); //throw FileError + return vista::supportsRecycleBin(dirPath); //throw FileError #else //excessive runtime if recycle bin exists, is full and drive is slow: - auto ft = runAsync([dirpath]() + auto ft = runAsync([dirPath]() { SHQUERYRBINFO recInfo = {}; recInfo.cbSize = sizeof(recInfo); - return ::SHQueryRecycleBin(dirpath.c_str(), //__in_opt LPCTSTR pszRootPath, + return ::SHQueryRecycleBin(dirPath.c_str(), //__in_opt LPCTSTR pszRootPath, &recInfo); //__inout LPSHQUERYRBINFO pSHQueryRBInfo }); @@ -197,7 +197,7 @@ bool zen::recycleBinExists(const Zstring& dirpath, const std::function<void ()>& //1. ::SHQueryRecycleBin() is excessive: traverses whole $Recycle.Bin directory tree each time!!!! But it's safe and correct. //2. we can't simply buffer the ::SHQueryRecycleBin() based on volume serial number: - // "subst S:\ C:\" => GetVolumeInformation() returns same serial for C:\ and S:\, but S:\ does not support recycle bin! + // "subst S:\ C:\" => GetVolumeInformation() returns same serial for C:\ and S:\, but S:\ does not support recycle bin! //3. we would prefer to use CLSID_RecycleBinManager beginning with Vista... if only this interface were documented!!! @@ -210,7 +210,7 @@ bool zen::recycleBinExists(const Zstring& dirpath, const std::function<void ()>& /* Zstring rootPathPf = appendSeparator(&buffer[0]); - const bool canUseFastCheckForRecycler = winXpOrLater(); + const bool canUseFastCheckForRecycler = winXpOrLater(); if (!canUseFastCheckForRecycler) //== "checkForRecycleBin" return STATUS_REC_UNKNOWN; diff --git a/zen/recycler.h b/zen/recycler.h index 7c63cf8a..3df7fda2 100644 --- a/zen/recycler.h +++ b/zen/recycler.h @@ -21,7 +21,8 @@ namespace zen Windows ------- -Recycler API always available: during runtime either SHFileOperation or IFileOperation (since Vista) will be dynamically selected +-> Recycler API always available: during runtime either SHFileOperation or IFileOperation (since Vista) will be dynamically selected +-> COM needs to be initialized before calling any of these functions! CoInitializeEx/CoUninitialize Linux ----- @@ -31,15 +32,18 @@ Linker flags: `pkg-config --libs gio-2.0` 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& itempath); //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 //Win XP: can take a long time if recycle bin is full and drive is slow!!! => buffer result! -bool recycleBinExists(const Zstring& dirpath, const std::function<void ()>& onUpdateGui); //throw FileError +//Vista and later: dirPath must exist for a valid check! +bool recycleBinExists(const Zstring& dirPath, const std::function<void ()>& onUpdateGui); //throw FileError -void recycleOrDelete(const std::vector<Zstring>& filepaths, //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 const std::function<void (const std::wstring& displayPath)>& onRecycleItem); //optional; currentItem may be empty #endif } diff --git a/zen/scope_guard.h b/zen/scope_guard.h index 5e917853..b5564c9b 100644 --- a/zen/scope_guard.h +++ b/zen/scope_guard.h @@ -17,13 +17,13 @@ namespace zen //Scope Guard /* zen::ScopeGuard lockAio = zen::makeGuard([&] { ::CloseHandle(hDir); }); - ... - lockAio.dismiss(); + ... + lockAio.dismiss(); */ //Scope Exit /* - ZEN_ON_SCOPE_EXIT(::CloseHandle(hDir)); + ZEN_ON_SCOPE_EXIT(::CloseHandle(hDir)); */ class ScopeGuardBase @@ -32,7 +32,7 @@ public: void dismiss() { dismissed_ = true; } protected: - ScopeGuardBase() : dismissed_(false) {} + ScopeGuardBase() {} ScopeGuardBase(ScopeGuardBase&& other) : dismissed_(other.dismissed_) { other.dismiss(); } //take over responsibility ~ScopeGuardBase() {} //[!] protected non-virtual base class destructor @@ -42,7 +42,7 @@ private: ScopeGuardBase (const ScopeGuardBase&) = delete; ScopeGuardBase& operator=(const ScopeGuardBase&) = delete; - bool dismissed_; + bool dismissed_ = false; }; diff --git a/zen/serialize.h b/zen/serialize.h index 07d9362c..ff2871b1 100644 --- a/zen/serialize.h +++ b/zen/serialize.h @@ -67,7 +67,7 @@ template <class BinContainer> BinContainer loadBinStream(const Zstring& filepath ----------------------------- struct BinInputStream { - size_t read(void* data, size_t len); //return "len" bytes unless end of stream! + size_t read(void* data, size_t len); //return "len" bytes unless end of stream! }; ------------------------------ diff --git a/zen/shell_execute.h b/zen/shell_execute.h index b36bc5ea..2adce179 100644 --- a/zen/shell_execute.h +++ b/zen/shell_execute.h @@ -62,12 +62,14 @@ bool shellExecuteImpl(Function fillExecInfo, ExecutionType type) void shellExecute(const void* /*PCIDLIST_ABSOLUTE*/ shellItemPidl, const std::wstring& displayPath, ExecutionType type) //throw FileError { - if (!shellExecuteImpl([&](SHELLEXECUTEINFO& execInfo) -{ - execInfo.fMask |= SEE_MASK_IDLIST; - execInfo.lpIDList = const_cast<void*>(shellItemPidl); //lpIDList is documented as PCIDLIST_ABSOLUTE! - }, type)) //throw FileError - throwFileError(_("Incorrect command line:") + L"\n" + fmtPath(displayPath), L"ShellExecuteEx", ::GetLastError()); + auto fillExecInfo = [&](SHELLEXECUTEINFO& execInfo) + { + execInfo.fMask |= SEE_MASK_IDLIST; + execInfo.lpIDList = const_cast<void*>(shellItemPidl); //lpIDList is documented as PCIDLIST_ABSOLUTE! + }; + + if (!shellExecuteImpl(fillExecInfo , type)) //throw FileError + THROW_LAST_FILE_ERROR(_("Incorrect command line:") + L"\n" + fmtPath(displayPath), L"ShellExecuteEx"); } #endif @@ -97,12 +99,14 @@ void shellExecute(const Zstring& command, ExecutionType type) //throw FileError (iter->empty() || std::any_of(iter->begin(), iter->end(), &isWhiteSpace<wchar_t>) ? L"\"" + *iter + L"\"" : *iter); } - if (!shellExecuteImpl([&](SHELLEXECUTEINFO& execInfo) -{ - execInfo.lpFile = filepath.c_str(); + auto fillExecInfo = [&](SHELLEXECUTEINFO& execInfo) + { + execInfo.lpFile = filepath.c_str(); execInfo.lpParameters = arguments.c_str(); - }, type)) - throwFileError(_("Incorrect command line:") + L"\nFile: " + fmtPath(filepath) + L"\nArg: " + copyStringTo<std::wstring>(arguments), L"ShellExecuteEx", ::GetLastError()); + }; + + if (!shellExecuteImpl(fillExecInfo, type)) + THROW_LAST_FILE_ERROR(_("Incorrect command line:") + L"\nFile: " + fmtPath(filepath) + L"\nArg: " + copyStringTo<std::wstring>(arguments), L"ShellExecuteEx"); #elif defined ZEN_LINUX || defined ZEN_MAC /* diff --git a/zen/stl_tools.h b/zen/stl_tools.h index e949c5c9..1e38f1b0 100644 --- a/zen/stl_tools.h +++ b/zen/stl_tools.h @@ -13,6 +13,7 @@ #include <memory> #include <algorithm> #include "type_tools.h" +#include "build_info.h" //enhancements for <algorithm> namespace zen @@ -59,12 +60,19 @@ template <class InputIterator1, class InputIterator2> bool equal(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2); -//until std::make_unique is available in GCC: -template <class T, class... Args> inline -std::unique_ptr<T> make_unique(Args&& ... args) { return std::unique_ptr<T>(new T(std::forward<Args>(args)...)); } - +size_t hashBytes(const unsigned char* ptr, size_t len); +//support for custom string classes in std::unordered_set/map +struct StringHash +{ + template <class String> + size_t operator()(const String& str) const + { + const auto* strFirst = strBegin(str); + return hashBytes(reinterpret_cast<const unsigned char*>(strFirst), strLength(str) * sizeof(strFirst[0])); + } +}; @@ -199,6 +207,28 @@ bool equal(InputIterator1 first1, InputIterator1 last1, #if defined _MSC_VER && _MSC_VER <= 1600 static_assert(false, "VS2010 performance bug in std::unordered_set<>: http://drdobbs.com/blogs/cpp/232200410 -> should be fixed in VS11"); #endif + + +inline +size_t hashBytes(const unsigned char* ptr, size_t len) +{ + //http://en.wikipedia.org/wiki/Fowler%E2%80%93Noll%E2%80%93Vo_hash_function +#ifdef ZEN_BUILD_32BIT + const size_t basis = 2166136261U; + const size_t prime = 16777619U; +#elif defined ZEN_BUILD_64BIT + const size_t basis = 14695981039346656037ULL; + const size_t prime = 1099511628211ULL; +#endif + + size_t val = basis; + for (size_t i = 0; i < len; ++i) + { + val ^= static_cast<size_t>(ptr[i]); + val *= prime; + } + return val; +} } #endif //STL_TOOLS_HEADER_84567184321434 diff --git a/zen/string_base.h b/zen/string_base.h index 1bf8ed68..224797e8 100644 --- a/zen/string_base.h +++ b/zen/string_base.h @@ -198,7 +198,7 @@ private: length (static_cast<std::uint32_t>(len)), capacity(static_cast<std::uint32_t>(cap)) { static_assert(ATOMIC_INT_LOCK_FREE == 2, ""); } //2: "the types are always lock-free" - std::atomic<unsigned int> refCount { 1 }; //std:atomic is uninitialized by default! + std::atomic<unsigned int> refCount { 1 }; //std:atomic is uninitialized by default! std::uint32_t length; std::uint32_t capacity; //allocated size without null-termination }; @@ -211,9 +211,9 @@ private: //perf note: interestingly StorageDeepCopy and StorageRefCountThreadSafe show same performance in FFS comparison -template <class Char, //Character Type +template <class Char, //Character Type template <class, class> class SP = StorageRefCountThreadSafe, //Storage Policy - class AP = AllocatorOptimalSpeed> //Allocator Policy + class AP = AllocatorOptimalSpeed> //Allocator Policy class Zbase : public SP<Char, AP> { public: @@ -222,10 +222,10 @@ public: Zbase(const Char* source, size_t length); Zbase(const Zbase& source); Zbase(Zbase&& tmp) noexcept; - explicit Zbase(Char source); //dangerous if implicit: Char buffer[]; return buffer[0]; ups... forgot &, but not a compiler error! - -//allow explicit construction from different string type, prevent ambiguity via SFINAE -//template <class S> explicit Zbase(const S& other, typename S::value_type = 0); + //explicit Zbase(Char source); //dangerous if implicit: Char buffer[]; return buffer[0]; ups... forgot &, but not a compiler error! //-> non-standard extension!!! + + //allow explicit construction from different string type, prevent ambiguity via SFINAE + //template <class S> explicit Zbase(const S& other, typename S::value_type = 0); ~Zbase(); @@ -275,7 +275,7 @@ public: Zbase& operator+=(const Char* other); Zbase& operator+=(Char ch); - static const size_t npos = static_cast<size_t>(-1); + static const size_t npos = static_cast<size_t>(-1); private: Zbase (int) = delete; // @@ -307,8 +307,8 @@ template <class Char, template <class, class> class SP, class AP> inline Zbase<C template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP> operator+(Zbase<Char, SP, AP>&& lhs, const Char* rhs) { return std::move(lhs += rhs); } //lhs, is an l-value parameter... template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP> operator+(Zbase<Char, SP, AP>&& lhs, Char rhs) { return std::move(lhs += rhs); } //and not a local variable => no copy elision -template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP> operator+( Char lhs, const Zbase<Char, SP, AP>& rhs) { return Zbase<Char, SP, AP>(lhs) += rhs; } -template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP> operator+(const Char* lhs, const Zbase<Char, SP, AP>& rhs) { return Zbase<Char, SP, AP>(lhs) += rhs; } +template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP> operator+( Char lhs, const Zbase<Char, SP, AP>& rhs) { return Zbase<Char, SP, AP>(&lhs, 1) += rhs; } +template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP> operator+(const Char* lhs, const Zbase<Char, SP, AP>& rhs) { return Zbase<Char, SP, AP>(lhs ) += rhs; } @@ -333,15 +333,6 @@ Zbase<Char, SP, AP>::Zbase() template <class Char, template <class, class> class SP, class AP> inline -Zbase<Char, SP, AP>::Zbase(Char source) -{ - rawStr = this->create(1); - rawStr[0] = source; - rawStr[1] = 0; -} - - -template <class Char, template <class, class> class SP, class AP> inline Zbase<Char, SP, AP>::Zbase(const Char* source) { const size_t sourceLen = strLength(source); diff --git a/zen/string_tools.h b/zen/string_tools.h index 9708464e..8f83b9cd 100644 --- a/zen/string_tools.h +++ b/zen/string_tools.h @@ -18,7 +18,7 @@ #include "stl_tools.h" #include "string_traits.h" - + //enhance arbitray string class with useful non-member functions: namespace zen { @@ -444,9 +444,9 @@ S numberTo(const Num& number, Int2Type<NUM_TYPE_FLOATING_POINT>) /* perf: integer to string: (executed 10 mio. times) - std::stringstream - 14796 ms - std::sprintf - 3086 ms - formatInteger - 778 ms + std::stringstream - 14796 ms + std::sprintf - 3086 ms + formatInteger - 778 ms */ template <class OutputIterator, class Num> inline diff --git a/zen/string_traits.h b/zen/string_traits.h index add53d3a..61fa2625 100644 --- a/zen/string_traits.h +++ b/zen/string_traits.h @@ -16,21 +16,21 @@ namespace zen /* IsStringLike<>::value: IsStringLike<const wchar_t*>::value; //equals "true" - IsStringLike<const int*> ::value; //equals "false" + IsStringLike<const int*> ::value; //equals "false" GetCharType<>::Type: - GetCharType<std::wstring>::Type //equals wchar_t - GetCharType<wchar_t[5]> ::Type //equals wchar_t + GetCharType<std::wstring>::Type //equals wchar_t + GetCharType<wchar_t[5]> ::Type //equals wchar_t strLength(): - strLength(str); //equals str.length() - strLength(array); //equals cStringLength(array) + strLength(str); //equals str.length() + strLength(array); //equals cStringLength(array) strBegin(): -> not null-terminated! -> may be nullptr if length is 0! - std::wstring str(L"dummy"); - char array[] = "dummy"; - strBegin(str); //returns str.c_str() - strBegin(array); //returns array + std::wstring str(L"dummy"); + char array[] = "dummy"; + strBegin(str); //returns str.c_str() + strBegin(array); //returns array */ //reference a sub-string for consumption by zen string_tools diff --git a/zen/symlink_target.h b/zen/symlink_target.h index c4557559..b5ca8191 100644 --- a/zen/symlink_target.h +++ b/zen/symlink_target.h @@ -100,7 +100,7 @@ Zstring getSymlinkRawTargetString_impl(const Zstring& linkPath) //throw FileErro FILE_FLAG_BACKUP_SEMANTICS | FILE_FLAG_OPEN_REPARSE_POINT, //_In_ DWORD dwFlagsAndAttributes, nullptr); //_In_opt_ HANDLE hTemplateFile if (hLink == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"CreateFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"CreateFile"); ZEN_ON_SCOPE_EXIT(::CloseHandle(hLink)); //respect alignment issues... @@ -116,7 +116,7 @@ Zstring getSymlinkRawTargetString_impl(const Zstring& linkPath) //throw FileErro bufferSize, //__in DWORD nOutBufferSize, &bytesReturned, //__out_opt LPDWORD lpBytesReturned, nullptr)) //__inout_opt LPOVERLAPPED lpOverlapped - throwFileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"DeviceIoControl, FSCTL_GET_REPARSE_POINT", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"DeviceIoControl, FSCTL_GET_REPARSE_POINT"); REPARSE_DATA_BUFFER& reparseData = *reinterpret_cast<REPARSE_DATA_BUFFER*>(&buffer[0]); //REPARSE_DATA_BUFFER needs to be artificially enlarged! @@ -144,7 +144,7 @@ Zstring getSymlinkRawTargetString_impl(const Zstring& linkPath) //throw FileErro const ssize_t bytesWritten = ::readlink(linkPath.c_str(), &buffer[0], BUFFER_SIZE); if (bytesWritten < 0) - throwFileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"readlink", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"readlink"); if (bytesWritten >= static_cast<ssize_t>(BUFFER_SIZE)) //detect truncation, not an error for readlink! throw FileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), L"readlink: buffer truncated."); @@ -162,7 +162,7 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw FileError const SysDllFun<GetFinalPathNameByHandleWFunc> getFinalPathNameByHandle(L"kernel32.dll", "GetFinalPathNameByHandleW"); if (!getFinalPathNameByHandle) throw FileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), replaceCpy(_("Cannot find system function %x."), L"%x", L"\"GetFinalPathNameByHandleW\"")); - + const HANDLE hFile = ::CreateFile(applyLongPathPrefix(linkPath).c_str(), //_In_ LPCTSTR lpFileName, 0, //_In_ DWORD dwDesiredAccess, FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, //_In_ DWORD dwShareMode, @@ -172,12 +172,12 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw FileError FILE_FLAG_BACKUP_SEMANTICS, //_In_ DWORD dwFlagsAndAttributes, nullptr); //_In_opt_ HANDLE hTemplateFile if (hFile == INVALID_HANDLE_VALUE) - throwFileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"CreateFile", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"CreateFile"); ZEN_ON_SCOPE_EXIT(::CloseHandle(hFile)); const DWORD bufferSize = getFinalPathNameByHandle(hFile, nullptr, 0, 0); if (bufferSize == 0) - throwFileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"GetFinalPathNameByHandle", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"GetFinalPathNameByHandle"); std::vector<wchar_t> targetPath(bufferSize); const DWORD charsWritten = getFinalPathNameByHandle(hFile, //__in HANDLE hFile, @@ -188,7 +188,7 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw FileError { const std::wstring errorMsg = replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)); if (charsWritten == 0) - throwFileError(errorMsg, L"GetFinalPathNameByHandle", getLastError()); + THROW_LAST_FILE_ERROR(errorMsg, L"GetFinalPathNameByHandle"); throw FileError(errorMsg); } @@ -197,7 +197,7 @@ Zstring getResolvedSymlinkPath_impl(const Zstring& linkPath) //throw FileError #elif defined ZEN_LINUX || defined ZEN_MAC char* targetPath = ::realpath(linkPath.c_str(), nullptr); if (!targetPath) - throwFileError(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"realpath", getLastError()); + THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot determine final path for %x."), L"%x", fmtPath(linkPath)), L"realpath"); ZEN_ON_SCOPE_EXIT(::free(targetPath)); return targetPath; #endif @@ -216,13 +216,13 @@ Zstring getResolvedSymlinkPath(const Zstring& linkPath) { return getResolvedSyml #ifdef ZEN_WIN /* Reparse Point Tags - http://msdn.microsoft.com/en-us/library/windows/desktop/aa365511(v=vs.85).aspx + http://msdn.microsoft.com/en-us/library/windows/desktop/aa365511(v=vs.85).aspx WIN32_FIND_DATA structure - http://msdn.microsoft.com/en-us/library/windows/desktop/aa365740(v=vs.85).aspx + http://msdn.microsoft.com/en-us/library/windows/desktop/aa365740(v=vs.85).aspx The only surrogate reparse points are; - IO_REPARSE_TAG_MOUNT_POINT - IO_REPARSE_TAG_SYMLINK + IO_REPARSE_TAG_MOUNT_POINT + IO_REPARSE_TAG_SYMLINK */ inline diff --git a/zen/thread.h b/zen/thread.h index a3b8760b..b10dd342 100644 --- a/zen/thread.h +++ b/zen/thread.h @@ -25,7 +25,7 @@ public: InterruptibleThread& operator=(InterruptibleThread&& tmp) = default; template <class Function> - InterruptibleThread(Function f); + InterruptibleThread(Function&& f); bool joinable () const { return stdThread.joinable(); } void interrupt(); @@ -62,8 +62,8 @@ void interruptibleSleep(const std::chrono::duration<Rep, Period>& relTime); //th /* std::async replacement without crappy semantics: - 1. guaranteed to run asynchronously - 2. does not follow C++11 [futures.async], Paragraph 5, where std::future waits for thread in destructor + 1. guaranteed to run asynchronously + 2. does not follow C++11 [futures.async], Paragraph 5, where std::future waits for thread in destructor Example: Zstring dirpath = ... @@ -72,7 +72,7 @@ Example: //dir exising */ template <class Function> -auto runAsync(Function fun) -> std::future<decltype(fun())>; +auto runAsync(Function&& fun) -> std::future<decltype(fun())>; //wait for all with a time limit: return true if *all* results are available! template<class InputIterator, class Duration> @@ -90,7 +90,7 @@ public: GetFirstResult(); template <class Fun> - void addJob(Fun f); //f must return a std::unique_ptr<T> containing a value if successful + void addJob(Fun&& f); //f must return a std::unique_ptr<T> containing a value if successful template <class Duration> bool timedWait(const Duration& duration) const; //true: "get()" is ready, false: time elapsed @@ -139,18 +139,38 @@ private: //###################### implementation ###################### +namespace impl +{ template <class Function> inline -auto runAsync(Function fun) -> std::future<decltype(fun())> +auto runAsync(Function&& fun, TrueType /*copy-constructible*/) -> std::future<decltype(fun())> { typedef decltype(fun()) ResultType; - std::packaged_task<ResultType()> pt(std::move(fun)); + //note: std::packaged_task does NOT support move-only function objects! + std::packaged_task<ResultType()> pt(std::forward<Function>(fun)); auto fut = pt.get_future(); std::thread(std::move(pt)).detach(); //we have to explicitly detach since C++11: [thread.thread.destr] ~thread() calls std::terminate() if joinable()!!! return fut; } +template <class Function> inline +auto runAsync(Function&& fun, FalseType /*copy-constructible*/) -> std::future<decltype(fun())> +{ + //support move-only function objects! + auto sharedFun = std::make_shared<Function>(std::forward<Function>(fun)); + return runAsync([sharedFun]() { return (*sharedFun)(); }, TrueType()); +} +} + + +template <class Function> inline +auto runAsync(Function&& fun) -> std::future<decltype(fun())> +{ + return impl::runAsync(std::forward<Function>(fun), StaticBool<std::is_copy_constructible<Function>::value>()); +} + + template<class InputIterator, class Duration> inline bool wait_for_all_timed(InputIterator first, InputIterator last, const Duration& duration) { @@ -166,12 +186,6 @@ template <class T> class GetFirstResult<T>::AsyncResult { public: - AsyncResult() : -#ifndef NDEBUG - returnedResult(false), -#endif - jobsFinished(0) {} - //context: worker threads void reportFinished(std::unique_ptr<T>&& result) { @@ -208,11 +222,11 @@ private: bool jobDone(size_t jobsTotal) const { return result_ || (jobsFinished >= jobsTotal); } //call while locked! #ifndef NDEBUG - bool returnedResult; + bool returnedResult = false; #endif std::mutex lockResult; - size_t jobsFinished; // + size_t jobsFinished = 0; // std::unique_ptr<T> result_; //our condition is: "have result" or "jobsFinished == jobsTotal" std::condition_variable conditionJobDone; }; @@ -225,9 +239,9 @@ GetFirstResult<T>::GetFirstResult() : asyncResult_(std::make_shared<AsyncResult> template <class T> template <class Fun> inline -void GetFirstResult<T>::addJob(Fun f) //f must return a std::unique_ptr<T> containing a value on success +void GetFirstResult<T>::addJob(Fun&& f) //f must return a std::unique_ptr<T> containing a value on success { - std::thread t([asyncResult = this->asyncResult_, f = std::move(f)] { asyncResult->reportFinished(f()); }); + std::thread t([asyncResult = this->asyncResult_, f = std::forward<Fun>(f)] { asyncResult->reportFinished(f()); }); ++jobsTotal_; t.detach(); //we have to be explicit since C++11: [thread.thread.destr] ~thread() calls std::terminate() if joinable()!!! } @@ -367,12 +381,12 @@ void interruptibleSleep(const std::chrono::duration<Rep, Period>& relTime) //thr template <class Function> inline -InterruptibleThread::InterruptibleThread(Function f) : intStatus_(std::make_shared<InterruptionStatus>()) +InterruptibleThread::InterruptibleThread(Function&& f) : intStatus_(std::make_shared<InterruptionStatus>()) { std::promise<void> pFinished; threadCompleted = pFinished.get_future(); - stdThread = std::thread([f = std::move(f), + stdThread = std::thread([f = std::forward<Function>(f), intStatus = this->intStatus_, pFinished = std::move(pFinished)]() mutable { diff --git a/zen/tick_count.h b/zen/tick_count.h index bedc66a5..b5667c6c 100644 --- a/zen/tick_count.h +++ b/zen/tick_count.h @@ -65,8 +65,8 @@ public: return numeric::dist(lhs.val_.QuadPart, rhs.val_.QuadPart); //std::abs(a - b) can lead to overflow! #elif defined ZEN_LINUX //structure timespec documented with members: - // time_t tv_sec seconds - // long tv_nsec nanoseconds + // time_t tv_sec seconds + // long tv_nsec nanoseconds const int64_t deltaSec = lhs.val_.tv_sec - rhs.val_.tv_sec; const int64_t deltaNsec = lhs.val_.tv_nsec - rhs.val_.tv_nsec; return numeric::abs(deltaSec * 1000000000 + deltaNsec); @@ -114,8 +114,8 @@ int64_t ticksPerSec() //return 0 on error if (::mach_timebase_info(&tbi) != KERN_SUCCESS) return 0; //structure mach_timebase_info_data_t documented with members: - // uint32_t numer; - // uint32_t denom; + // uint32_t numer; + // uint32_t denom; return static_cast<int64_t>(1000000000) * tbi.denom / tbi.numer; #endif } @@ -154,8 +154,8 @@ struct GetFormat<FormatIsoDateTimeTag> //%Y-%m-%d %H:%M:%S - e.g. 2001-08-23 14: //strftime() craziness on invalid input: -// VS 2010: CRASH unless "_invalid_parameter_handler" is set: http://msdn.microsoft.com/en-us/library/ksazx244.aspx -// GCC: returns 0, apparently no crash. Still, considering some clib maintainer's comments, we should expect the worst! +// VS 2010: CRASH unless "_invalid_parameter_handler" is set: http://msdn.microsoft.com/en-us/library/ksazx244.aspx +// GCC: returns 0, apparently no crash. Still, considering some clib maintainer's comments, we should expect the worst! inline size_t strftimeWrap_impl(char* buffer, size_t bufferSize, const char* format, const struct std::tm* timeptr) { @@ -173,12 +173,12 @@ size_t strftimeWrap_impl(wchar_t* buffer, size_t bufferSize, const wchar_t* form inline bool isValid(const struct std::tm& t) { - -> not enough! MSCRT has different limits than the C standard which even seem to change with different versions: - _VALIDATE_RETURN((( timeptr->tm_sec >=0 ) && ( timeptr->tm_sec <= 59 ) ), EINVAL, FALSE) - _VALIDATE_RETURN(( timeptr->tm_year >= -1900 ) && ( timeptr->tm_year <= 8099 ), EINVAL, FALSE) - -> also std::mktime does *not* help here at all! + -> not enough! MSCRT has different limits than the C standard which even seem to change with different versions: + _VALIDATE_RETURN((( timeptr->tm_sec >=0 ) && ( timeptr->tm_sec <= 59 ) ), EINVAL, FALSE) + _VALIDATE_RETURN(( timeptr->tm_year >= -1900 ) && ( timeptr->tm_year <= 8099 ), EINVAL, FALSE) + -> also std::mktime does *not* help here at all! - auto inRange = [](int value, int minVal, int maxVal) { return minVal <= value && value <= maxVal; }; + auto inRange = [](int value, int minVal, int maxVal) { return minVal <= value && value <= maxVal; }; //http://www.cplusplus.com/reference/clibrary/ctime/tm/ return inRange(t.tm_sec , 0, 61) && diff --git a/zen/type_traits.h b/zen/type_traits.h index e03085d9..3ec90f49 100644 --- a/zen/type_traits.h +++ b/zen/type_traits.h @@ -60,20 +60,20 @@ template <class T> struct IsArithmetic; //IsInteger or IsFloat //################# Class Members ######################## /* Detect data or function members of a class by name: ZEN_INIT_DETECT_MEMBER + HasMember_ - Example: 1. ZEN_INIT_DETECT_MEMBER(c_str); - 2. HasMember_c_str<T>::value -> use as boolean + Example: 1. ZEN_INIT_DETECT_MEMBER(c_str); + 2. HasMember_c_str<T>::value -> use as boolean */ /* Detect data or function members of a class by name *and* type: ZEN_INIT_DETECT_MEMBER2 + HasMember_ - Example: 1. ZEN_INIT_DETECT_MEMBER2(size, size_t (T::*)() const); - 2. HasMember_size<T>::value -> use as boolean + Example: 1. ZEN_INIT_DETECT_MEMBER2(size, size_t (T::*)() const); + 2. HasMember_size<T>::value -> use as boolean */ /* Detect member type of a class: ZEN_INIT_DETECT_MEMBER_TYPE + HasMemberType_ - Example: 1. ZEN_INIT_DETECT_MEMBER_TYPE(value_type); - 2. HasMemberType_value_type<T>::value -> use as boolean + Example: 1. ZEN_INIT_DETECT_MEMBER_TYPE(value_type); + 2. HasMemberType_value_type<T>::value -> use as boolean */ @@ -130,29 +130,29 @@ template <class T> struct IsArithmetic : StaticBool<IsInteger<T>::value || IsFloat<T>::value> {}; //#################################################################### -#define ZEN_INIT_DETECT_MEMBER(NAME) \ +#define ZEN_INIT_DETECT_MEMBER(NAME) \ \ - template<bool isClass, class T> \ - struct HasMemberImpl_##NAME \ - { \ + template<bool isClass, class T> \ + struct HasMemberImpl_##NAME \ + { \ private: \ - typedef char Yes[1]; \ - typedef char No [2]; \ + typedef char Yes[1]; \ + typedef char No [2]; \ \ template <typename U, U t> \ - class Helper {}; \ - struct Fallback { int NAME; }; \ + class Helper {}; \ + struct Fallback { int NAME; }; \ \ - template <class U> \ - struct Helper2 : public U, public Fallback {}; /*this works only for class types!!!*/ \ + template <class U> \ + struct Helper2 : public U, public Fallback {}; /*this works only for class types!!!*/ \ \ - template <class U> static No& hasMember(Helper<int Fallback::*, &Helper2<U>::NAME>*); \ - template <class U> static Yes& hasMember(...); \ - public: \ - enum { value = sizeof(hasMember<T>(nullptr)) == sizeof(Yes) }; \ + template <class U> static No& hasMember(Helper<int Fallback::*, &Helper2<U>::NAME>*); \ + template <class U> static Yes& hasMember(...); \ + public: \ + enum { value = sizeof(hasMember<T>(nullptr)) == sizeof(Yes) }; \ }; \ \ - template<class T> \ + template<class T> \ struct HasMemberImpl_##NAME<false, T> : FalseType {}; \ \ template<typename T> \ @@ -160,37 +160,37 @@ struct IsArithmetic : StaticBool<IsInteger<T>::value || IsFloat<T>::value> {}; //#################################################################### -#define ZEN_INIT_DETECT_MEMBER2(NAME, TYPE) \ +#define ZEN_INIT_DETECT_MEMBER2(NAME, TYPE) \ \ - template<typename U> \ - class HasMember_##NAME \ - { \ - typedef char Yes[1]; \ - typedef char No [2]; \ + template<typename U> \ + class HasMember_##NAME \ + { \ + typedef char Yes[1]; \ + typedef char No [2]; \ \ template <typename T, T t> class Helper {}; \ \ - template <class T> static Yes& hasMember(Helper<TYPE, &T::NAME>*); \ - template <class T> static No& hasMember(...); \ - public: \ + template <class T> static Yes& hasMember(Helper<TYPE, &T::NAME>*); \ + template <class T> static No& hasMember(...); \ + public: \ enum { value = sizeof(hasMember<U>(nullptr)) == sizeof(Yes) }; \ }; //#################################################################### -#define ZEN_INIT_DETECT_MEMBER_TYPE(TYPENAME) \ +#define ZEN_INIT_DETECT_MEMBER_TYPE(TYPENAME) \ \ - template<typename T> \ - class HasMemberType_##TYPENAME \ - { \ - typedef char Yes[1]; \ - typedef char No [2]; \ + template<typename T> \ + class HasMemberType_##TYPENAME \ + { \ + typedef char Yes[1]; \ + typedef char No [2]; \ \ - template <typename U> class Helper {}; \ + template <typename U> class Helper {}; \ \ template <class U> static Yes& hasMemberType(Helper<typename U::TYPENAME>*); \ - template <class U> static No& hasMemberType(...); \ - public: \ - enum { value = sizeof(hasMemberType<T>(nullptr)) == sizeof(Yes) }; \ + template <class U> static No& hasMemberType(...); \ + public: \ + enum { value = sizeof(hasMemberType<T>(nullptr)) == sizeof(Yes) }; \ }; } diff --git a/zen/warn_static.h b/zen/warn_static.h index 1e942031..3f268ec3 100644 --- a/zen/warn_static.h +++ b/zen/warn_static.h @@ -19,7 +19,7 @@ Usage: #define STATIC_WARNING_MAKE_STRINGIZE(NUM) STATIC_WARNING_MAKE_STRINGIZE_SUB(NUM) #define warn_static(TXT) \ - __pragma(message (__FILE__ "(" STATIC_WARNING_MAKE_STRINGIZE(__LINE__) "): Warning: " ## TXT)) + __pragma(message(__FILE__ "(" STATIC_WARNING_MAKE_STRINGIZE(__LINE__) "): Warning: " ## TXT)) #elif defined __GNUC__ #define STATIC_WARNING_CONCAT_SUB(X, Y) X ## Y diff --git a/zen/zstring.cpp b/zen/zstring.cpp index e2a756e6..3b29e664 100644 --- a/zen/zstring.cpp +++ b/zen/zstring.cpp @@ -21,8 +21,8 @@ using namespace zen; /* Perf test: compare strings 10 mio times; 64 bit build ----------------------------------------------------- - string a = "Fjk84$%kgfj$%T\\\\Gffg\\gsdgf\\fgsx----------d-" - string b = "fjK84$%kgfj$%T\\\\gfFg\\gsdgf\\fgSy----------dfdf" + string a = "Fjk84$%kgfj$%T\\\\Gffg\\gsdgf\\fgsx----------d-" + string b = "fjK84$%kgfj$%T\\\\gfFg\\gsdgf\\fgSy----------dfdf" Windows (UTF16 wchar_t) 4 ns | wcscmp @@ -125,8 +125,7 @@ Zstring makeUpperCopy(const Zstring& str) if (len == 0) //LCMapString does not allow input sizes of 0! return str; - Zstring output; - output.resize(len); + Zstring output = str; //LOCALE_INVARIANT is NOT available with Windows 2000 -> ok |