diff options
-rw-r--r-- | Application.cpp | 252 | ||||
-rw-r--r-- | Application.h | 52 | ||||
-rw-r--r-- | Changelog.txt | 15 | ||||
-rw-r--r-- | FreeFileSync.cbp | 9 | ||||
-rw-r--r-- | FreeFileSync.cpp | 215 | ||||
-rw-r--r-- | FreeFileSync.h | 61 | ||||
-rw-r--r-- | Makefile | 44 | ||||
-rw-r--r-- | Makefile_Win.cmd (renamed from COMPILE.cmd) | 28 | ||||
-rw-r--r-- | Readme.txt | 32 | ||||
-rw-r--r-- | Resources.dat | bin | 107386 -> 113625 bytes | |||
-rw-r--r-- | german.lng (renamed from language.dat) | 148 | ||||
-rw-r--r-- | library/CustomGrid.cpp | 257 | ||||
-rw-r--r-- | library/CustomGrid.h | 22 | ||||
-rw-r--r-- | library/FreeFileSync.ico (renamed from FreeFileSync.ico) | bin | 94198 -> 94198 bytes | |||
-rw-r--r-- | library/FreeFileSync.xpm | 425 | ||||
-rw-r--r-- | library/globalFunctions.cpp | 4 | ||||
-rw-r--r-- | library/misc.cpp | 138 | ||||
-rw-r--r-- | library/misc.h | 52 | ||||
-rw-r--r-- | library/multithreading.cpp | 8 | ||||
-rw-r--r-- | library/multithreading.h | 1 | ||||
-rw-r--r-- | library/resources.cpp (renamed from ui/Resources.cpp) | 59 | ||||
-rw-r--r-- | library/resources.h (renamed from ui/Resources.h) | 26 | ||||
-rw-r--r-- | resource.rc | 2 | ||||
-rw-r--r-- | ui/MainDialog.cpp | 990 | ||||
-rw-r--r-- | ui/MainDialog.h | 99 | ||||
-rw-r--r-- | ui/SmallDialogs.cpp | 101 | ||||
-rw-r--r-- | ui/SmallDialogs.h | 50 | ||||
-rw-r--r-- | ui/SyncDialog.cpp | 466 | ||||
-rw-r--r-- | ui/SyncDialog.h | 82 | ||||
-rw-r--r-- | ui/guiGenerated.cpp | 1255 | ||||
-rw-r--r-- | ui/guiGenerated.h | 249 |
31 files changed, 3691 insertions, 1451 deletions
diff --git a/Application.cpp b/Application.cpp index c53953ff..81c4ac87 100644 --- a/Application.cpp +++ b/Application.cpp @@ -45,7 +45,7 @@ void Application::initialize() throw runtime_error(_("Could not set working directory to directory containing executable file!")); //set program language - programLanguage = new CustomLocale; + programLanguage.loadLanguageFromCfg(); //activate support for .png files wxImage::AddHandler(new wxPNGHandler); @@ -54,9 +54,9 @@ void Application::initialize() GlobalResources::loadResourceFiles(); //test if ffs is to be started on UI with config file passed as commandline parameter - wxString configFileUI = FreeFileSync::FFS_LastConfigFile; - if (argc >= 2 && wxFileExists(argv[1]) && FreeFileSync::isFFS_ConfigFile(argv[1])) - configFileUI = argv[1]; + wxString configFileForUI = FreeFileSync::FFS_LastConfigFile; + if (argc > 1 && wxFileExists(argv[1]) && FreeFileSync::isFFS_ConfigFile(argv[1])) + configFileForUI = argv[1]; //should it start in commandline mode? else if (argc > 1) @@ -71,15 +71,13 @@ void Application::initialize() else return; //wait for the user to close the status window } - else - ; //no parameters passed, continue with UI - - - //show UI dialog - MainDialog* frame = new MainDialog(0L, configFileUI); - frame->SetIcon(wxICON(aaaa)); // To Set App Icon - - frame->Show(); + else //no parameters passed: continue with UI + { + //show UI dialog + MainDialog* frame = new MainDialog(0L, configFileForUI, &programLanguage); + frame->SetIcon(*GlobalResources::programIcon); //set application icon + frame->Show(); + } } @@ -101,7 +99,6 @@ int Application::OnRun() int Application::OnExit() { GlobalResources::unloadResourceFiles(); - delete programLanguage; return 0; } @@ -115,22 +112,18 @@ SyncDirection convertCmdlineCfg(const wxString& cfg, const int i) { case 'L': return syncDirLeft; - break; case 'R': return syncDirRight; - break; case 'N': return syncDirNone; - break; default: assert(false); + return syncDirNone; } - //dummy return value to suppress compiler warning - return syncDirNone; } -void Application::initLog() +void Application::logInit() { wxString tmp = wxDateTime::Now().FormatISOTime(); tmp.Replace(":", ""); @@ -144,19 +137,24 @@ void Application::initLog() logFile<<endl; logFile<<_("Log-messages:")<<endl; logFile<<endl; + logWrite(_("Start")); } -void Application::writeLog(const wxString& logText, const wxString& problemType) +void Application::logWrite(const wxString& logText, const wxString& problemType) { + logFile<<"["<<wxDateTime::Now().FormatTime()<<"] "; + if (problemType != wxEmptyString) logFile<<problemType<<": "; + logFile<<logText<<endl; } -void Application::closeLog() +void Application::logClose(const wxString& finalText) { + logWrite(finalText, _("Stop")); logFile.close(); } @@ -176,16 +174,16 @@ void Application::parseCommandline() { wxCMD_LINE_OPTION, - "cmp", + GlobalResources::paramCompare, NULL, - _("Specify algorithm to test if files are equal:\n\n\t\tSIZEDATE: check filesize and date\n\t\tCONTENT: check file content\n"), + wxString(_("Specify algorithm to test if files are equal:\n\n\t\t")) + GlobalResources::valueSizeDate + _(": check filesize and date\n\t\t") + GlobalResources::valueContent + _(": check file content\n"), wxCMD_LINE_VAL_STRING, wxCMD_LINE_OPTION_MANDATORY }, { wxCMD_LINE_OPTION, - "cfg", + GlobalResources::paramCfg, NULL, _("Specify the sync-direction used for each type of file by a string of five chars:\n\n\t\tChar 1: Folders/files that exist on left side only\n\t\tChar 2: Folders/files that exist on right side only\n\t\tChar 3: Files that exist on both sides, left one is newer\n\t\tChar 4: Files that exist on both sides, right one is newer\n\t\tChar 5: Files that exist on both sides and are different\n\n\t\tSync-direction: L: left, R: right, N: none\n"), wxCMD_LINE_VAL_STRING, @@ -210,7 +208,7 @@ void Application::parseCommandline() { wxCMD_LINE_OPTION, - "incl", + GlobalResources::paramInclude, NULL, _("Specify names to be included separated by ';'. Wildcards '*' and '?' are supported. Default: \"*\"\n"), wxCMD_LINE_VAL_STRING, @@ -218,7 +216,7 @@ void Application::parseCommandline() { wxCMD_LINE_OPTION, - "excl", + GlobalResources::paramExclude, NULL, _("Specify names to be excluded separated by ';'. Wildcards '*' and '?' are supported. Default: \"\"\n"), wxCMD_LINE_VAL_STRING, @@ -226,16 +224,23 @@ void Application::parseCommandline() { wxCMD_LINE_SWITCH, - "skiperrors", + GlobalResources::paramContinueError, + NULL, + _("If errors occur during folder comparison or synchronization they are ignored and the process continues\n") + }, + + { + wxCMD_LINE_SWITCH, + GlobalResources::paramRecycler, NULL, - _("If errors occur during folder comparison or synchronization they are ignored and the process continues.\n") + _("Move files to Recycle Bin instead of deleting or overwriting them directly.\n") }, { wxCMD_LINE_SWITCH, - "silent", + GlobalResources::paramSilent, NULL, - _("\tDo not show UI messages but write to a logfile instead\n\nExamples:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Creates a mirror backup of the left directory\n2: Synchronizes all *.doc files from both directories simultaneously\n\n") + wxString(_("Do not show graphical status and error messages but write to a logfile instead")) + _(".\n\nExamples:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Creates a mirror backup of the left directory\n2: Synchronizes all *.doc files from both directories simultaneously\n\n") }, { @@ -256,15 +261,16 @@ void Application::parseCommandline() wxString rightDir; wxString included; wxString excluded; - bool skipErrors = parser.Found("skiperrors"); - bool silent = parser.Found("silent"); + bool continueOnError = parser.Found(GlobalResources::paramContinueError); + bool useRecycler = parser.Found(GlobalResources::paramRecycler); + bool silent = parser.Found(GlobalResources::paramSilent); applicationRunsOnCommandLineWithoutWindows = silent; //this value is needed for the application to decide whether to wait for windows to close or not //check existence of all commandline parameters - if (!parser.Found("cmp", &cmp) || - !parser.Found("cfg", &cfg) || + if (!parser.Found(GlobalResources::paramCompare, &cmp) || + !parser.Found(GlobalResources::paramCfg, &cfg) || parser.GetParamCount() != 2) { parser.Usage(); @@ -278,12 +284,12 @@ void Application::parseCommandline() //evaluate filter settings bool filteringEnabled = false; - if (parser.Found("incl", &included)) + if (parser.Found(GlobalResources::paramInclude, &included)) filteringEnabled = true; else included = "*"; - if (parser.Found("excl", &excluded)) + if (parser.Found(GlobalResources::paramExclude, &excluded)) filteringEnabled = true; else excluded = ""; @@ -292,7 +298,7 @@ void Application::parseCommandline() //-------------------------------------------------------------------- //check consistency of all commandline parameters - if ((cmp != "SIZEDATE" && cmp != "CONTENT") || + if ((cmp != GlobalResources::valueSizeDate && cmp != GlobalResources::valueContent) || cfg.Len() != 5 || (cfg[0] != 'L' && cfg[0] != 'R' && cfg[0] != 'N') || (cfg[1] != 'L' && cfg[1] != 'R' && cfg[1] != 'N') || @@ -305,32 +311,59 @@ void Application::parseCommandline() } //init logfile - if (silent) initLog(); + if (silent) logInit(); wxString logText; //check if directories exist if (!wxDirExists(leftDir)) { - wxString errorMessage = wxString(_("Directory ")) + leftDir + _(" does not exist. \n\nSynchronization aborted!"); - if (silent) writeLog(errorMessage, _("Warning")); - if (silent) closeLog(); - else wxMessageBox(errorMessage, _("Warning"), wxICON_WARNING); + wxString errorMessage = wxString(_("Directory ")) + leftDir + _(" does not exist."); + wxString statusMessage = wxString(_("Synchronization aborted!")); + if (silent) + { + logWrite(errorMessage, _("Warning")); + logClose(statusMessage); + } + else wxMessageBox(errorMessage + "\n\n" + statusMessage, _("Warning"), wxICON_WARNING); returnValue = -2; return; } else if (!wxDirExists(rightDir)) { - wxString errorMessage = wxString(_("Directory ")) + rightDir + _(" does not exist. \n\nSynchronization aborted!"); - if (silent) writeLog(errorMessage, _("Warning")); - if (silent) closeLog(); - else wxMessageBox(errorMessage, _("Warning"), wxICON_WARNING); + wxString errorMessage = wxString(_("Directory ")) + rightDir + _(" does not exist."); + wxString statusMessage = wxString(_("Synchronization aborted!")); + if (silent) + { + logWrite(errorMessage, _("Warning")); + logClose(statusMessage); + } + else wxMessageBox(errorMessage + "\n\n" + statusMessage, _("Warning"), wxICON_WARNING); returnValue = -2; return; } + //test existence of Recycle Bin + if (useRecycler) + { + if (!FreeFileSync::recycleBinExists()) + { + wxString errorMessage = wxString(_("Unable to initialize Recycle Bin!")); + wxString statusMessage = wxString(_("Synchronization aborted!")); + if (silent) + { + logWrite(errorMessage, _("Error")); + logClose(statusMessage); + } + else wxMessageBox(errorMessage + "\n\n" + statusMessage, _("Error"), wxICON_WARNING); + + returnValue = -2; + return; + } + } + //until here all options and parameters are consistent //-------------------------------------------------------------------- @@ -338,9 +371,9 @@ void Application::parseCommandline() SyncConfiguration syncConfiguration; FileCompareResult currentGridData; - if (cmp == "SIZEDATE") + if (cmp == GlobalResources::valueSizeDate) cmpVar = compareByTimeAndSize; - else if (cmp == "CONTENT") + else if (cmp == GlobalResources::valueContent) cmpVar = compareByContent; else assert (false); @@ -352,7 +385,7 @@ void Application::parseCommandline() syncConfiguration.different = convertCmdlineCfg(cfg, 4); //class handling status updates and error messages - CommandLineStatusUpdater statusUpdater(this, skipErrors, silent); + CommandLineStatusUpdater statusUpdater(this, continueOnError, silent); //begin of synchronization process (all in one try-catch block) try @@ -378,10 +411,10 @@ void Application::parseCommandline() if (nothingToSync) { wxString errorMessage = _("Nothing to synchronize. Both directories seem to contain the same data!"); - if (silent) writeLog("\n"); - if (silent) writeLog(errorMessage); - if (silent) closeLog(); - else statusUpdater.updateFinalStatus(errorMessage); + if (silent) + logClose(errorMessage); + else + statusUpdater.updateFinalStatus(errorMessage); returnValue = -3; return; @@ -393,35 +426,33 @@ void Application::parseCommandline() //START SYNCHRONIZATION //unsigned int startTime = GetTickCount(); - FreeFileSync::startSynchronizationProcess(currentGridData, syncConfiguration, &statusUpdater, false); //default: do not use recycle bin since it's not sure if its possible + FreeFileSync::startSynchronizationProcess(currentGridData, syncConfiguration, &statusUpdater, useRecycler); //default: do not use recycle bin since it's not sure if its possible //wxMessageBox(wxString::Format(wxT("%i"), unsigned(GetTickCount()) - startTime)); //show success message - wxString successMessage = _("Synchronization completed!"); - if (silent) writeLog("\n"); - if (silent) writeLog(successMessage); - if (silent) closeLog(); + wxString successMessage = _("Synchronization completed."); + if (silent) + logClose(successMessage); else statusUpdater.updateFinalStatus(successMessage); - } catch (AbortThisProcess& theException) //exit used by statusUpdater { - if (silent) writeLog("\n\nSynchronization aborted!"); - if (silent) closeLog(); + if (silent) + logClose(_("Synchronization aborted!")); returnValue = -4; return; } - return; //exit program and skip UI dialogs + return; //exit program and skip UI dialogs } //###################################################################################################### -CommandLineStatusUpdater::CommandLineStatusUpdater(Application* application, bool skipErr, bool silent) : +CommandLineStatusUpdater::CommandLineStatusUpdater(Application* application, bool continueOnError, bool silent) : app(application), - skipErrors(skipErr), + continueErrors(continueOnError), silentMode(silent), currentProcess(-1) { @@ -450,11 +481,11 @@ CommandLineStatusUpdater::~CommandLineStatusUpdater() //notify to syncStatusFrame that current process has ended if (abortionRequested) - syncStatusFrame->processHasFinished(statusAborted); //enable okay and close events + syncStatusFrame->processHasFinished(SyncStatus::statusAborted); //enable okay and close events else if (failedItems) - syncStatusFrame->processHasFinished(statusCompletedWithErrors); + syncStatusFrame->processHasFinished(SyncStatus::statusCompletedWithErrors); else - syncStatusFrame->processHasFinished(statusCompletedWithSuccess); + syncStatusFrame->processHasFinished(SyncStatus::statusCompletedWithSuccess); } } @@ -473,18 +504,18 @@ void CommandLineStatusUpdater::initNewProcess(int objectsTotal, double dataTotal if (!silentMode) { if (currentProcess == FreeFileSync::scanningFilesProcess) - syncStatusFrame->setCurrentStatus(statusScanning); + syncStatusFrame->setCurrentStatus(SyncStatus::statusScanning); else if (currentProcess == FreeFileSync::compareFileContentProcess) { syncStatusFrame->resetGauge(objectsTotal, dataTotal); - syncStatusFrame->setCurrentStatus(statusComparing); + syncStatusFrame->setCurrentStatus(SyncStatus::statusComparing); } else if (currentProcess == FreeFileSync::synchronizeFilesProcess) { syncStatusFrame->resetGauge(objectsTotal, dataTotal); - syncStatusFrame->setCurrentStatus(statusSynchronizing); + syncStatusFrame->setCurrentStatus(SyncStatus::statusSynchronizing); } else assert(false); } @@ -509,22 +540,21 @@ void CommandLineStatusUpdater::updateProcessedData(int objectsProcessed, double int CommandLineStatusUpdater::reportError(const wxString& text) { - if (silentMode) //write error message log and abort the complete session + if (silentMode) //write error message log and abort the complete session if necessary { - app->writeLog(text, _("Error")); + app->logWrite(text, _("Error")); - if (skipErrors) // <- /|\ before return, the logfile is written!!! + if (continueErrors) // <- /|\ before return, the logfile is written!!! return StatusUpdater::continueNext; else { abortionRequested = true; throw AbortThisProcess(); } - } else //show dialog to user who can decide how to continue { - if (skipErrors) //this option can be set from commandline or by the user in the error dialog on UI + if (continueErrors) //this option can be set from commandline or by the user in the error dialog on UI { unhandledErrors.Add(text); return StatusUpdater::continueNext; @@ -534,7 +564,7 @@ int CommandLineStatusUpdater::reportError(const wxString& text) wxString errorMessage = text + _("\n\nContinue with next object, retry or abort synchronization?"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, skipErrors); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueErrors); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -578,71 +608,3 @@ void CommandLineStatusUpdater::updateFinalStatus(const wxString& text) //set by if (!silentMode) syncStatusFrame->setStatusText_NoUpdate(text); } - - -//###################################################################################################### - - -wxString exchangeEscapeChars(char* temp) -{ - wxString output(temp); - output.Replace("\\\\", "\\"); - output.Replace("\\n", "\n"); - output.Replace("\\t", "\t"); - output.Replace("\"\"", """"); - output.Replace("\\\"", "\""); - return output; -} - - -CustomLocale::CustomLocale(int language, int flags) - :wxLocale(language, flags) -{ - char temp[100000]; -// wxString languageFile; -// switch (language) -// { -// case wxLANGUAGE_GERMAN: - wxString languageFile = "language.dat"; -// break; -// default: ; -// } - - //load language file into buffer - if (languageFile.size() != 0) - { - ifstream langFile(languageFile.c_str()); - if (langFile) - { - int rowNumber = 0; - TranslationLine currentLine; - while (langFile.getline(temp, 100000)) - { - if (rowNumber%2 == 0) - currentLine.original = exchangeEscapeChars(temp); - else - { - currentLine.translation = exchangeEscapeChars(temp); - translationDB.insert(currentLine); - } - ++rowNumber; - } - langFile.close(); - } - } -} - - -const wxChar* CustomLocale::GetString(const wxChar* szOrigString, const wxChar* szDomain) const -{ - TranslationLine currentLine; - currentLine.original = szOrigString; - - //look for translation in buffer table - Translation::iterator i; - if ((i = translationDB.find(currentLine)) != translationDB.end()) - return (i->translation.c_str()); - //fallback - return (szOrigString); -} - diff --git a/Application.h b/Application.h index f13dbe90..56298898 100644 --- a/Application.h +++ b/Application.h @@ -12,46 +12,10 @@ #include <wx/app.h> #include <wx/cmdline.h> -#include <set> #include <fstream> #include "FreeFileSync.h" #include "ui/smallDialogs.h" - -struct TranslationLine -{ - wxString original; - wxString translation; - - bool operator>(const TranslationLine& b ) const - { - return (original > b.original); - } - bool operator<(const TranslationLine& b) const - { - return (original < b.original); - } - bool operator==(const TranslationLine& b) const - { - return (original == b.original); - } -}; -typedef set<TranslationLine> Translation; - - -class CustomLocale : public wxLocale -{ -public: - CustomLocale(int language = wxLANGUAGE_ENGLISH, - int flags = wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); - - ~CustomLocale() {} - - const wxChar* GetString(const wxChar* szOrigString, const wxChar* szDomain = NULL) const; - -private: - Translation translationDB; -}; - +#include "library/misc.h" class Application : public wxApp { @@ -63,12 +27,10 @@ public: void initialize(); bool ProcessIdle(); //virtual method - friend class CommandLineStatusUpdate; - //methods for writing logs - void initLog(); - void writeLog(const wxString& logText, const wxString& problemType = wxEmptyString); - void closeLog(); + void logInit(); + void logWrite(const wxString& logText, const wxString& problemType = wxEmptyString); + void logClose(const wxString& finalText); private: void parseCommandline(); @@ -76,7 +38,7 @@ private: bool applicationRunsOnCommandLineWithoutWindows; ofstream logFile; - CustomLocale* programLanguage; + CustomLocale programLanguage; int returnValue; }; @@ -85,7 +47,7 @@ private: class CommandLineStatusUpdater : public StatusUpdater { public: - CommandLineStatusUpdater(Application* application, bool skipErr, bool silent); + CommandLineStatusUpdater(Application* application, bool continueOnError, bool silent); ~CommandLineStatusUpdater(); void updateStatusText(const wxString& text); @@ -99,7 +61,7 @@ public: private: Application* app; SyncStatus* syncStatusFrame; - bool skipErrors; + bool continueErrors; bool silentMode; wxArrayString unhandledErrors; //list of non-resolved errors diff --git a/Changelog.txt b/Changelog.txt index 1d714890..fa049ca7 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -1,6 +1,21 @@ FreeFileSync ------------ +Changelog v1.6 +-------------- +Significantly improved speed of filtering files and view (< 10 ms for > 200.000 rows(!)) +Fixed minor grid mis-alignment under some special conditions +Enhanced status bar with centered texts +Flexible filter options depending on compare variant +Improved synchronization statistics +Fixed issue when trying to delete system folders +Usability improvements +Recycle Bin usage as commandline parameter +New menu bar +Program language selectable from menu +UI-option to create sync jobs (batch files) for automated synchronization + + Changelog v1.5 -------------- Improved speed of comparison by file content diff --git a/FreeFileSync.cbp b/FreeFileSync.cbp index 0d45c186..78ca07bc 100644 --- a/FreeFileSync.cbp +++ b/FreeFileSync.cbp @@ -93,8 +93,12 @@ <Unit filename="library\customGrid.h" /> <Unit filename="library\globalFunctions.cpp" /> <Unit filename="library\globalFunctions.h" /> + <Unit filename="library\misc.cpp" /> + <Unit filename="library\misc.h" /> <Unit filename="library\multithreading.cpp" /> <Unit filename="library\multithreading.h" /> + <Unit filename="library\resources.cpp" /> + <Unit filename="library\resources.h" /> <Unit filename="library\wxWidgets.h" /> <Unit filename="resource.rc"> <Option compilerVar="WINDRES" /> @@ -103,8 +107,6 @@ <Unit filename="ui\guiGenerated.h" /> <Unit filename="ui\mainDialog.cpp" /> <Unit filename="ui\mainDialog.h" /> - <Unit filename="ui\resources.cpp" /> - <Unit filename="ui\resources.h" /> <Unit filename="ui\smallDialogs.cpp" /> <Unit filename="ui\smallDialogs.h" /> <Unit filename="ui\syncDialog.cpp" /> @@ -113,6 +115,9 @@ <code_completion /> <envvars /> <debugger /> + <wxsmith version="1"> + <gui name="wxWidgets" src="" main="" init_handlers="necessary" language="CPP" /> + </wxsmith> </Extensions> </Project> </CodeBlocks_project_file> diff --git a/FreeFileSync.cpp b/FreeFileSync.cpp index af0da109..9781e102 100644 --- a/FreeFileSync.cpp +++ b/FreeFileSync.cpp @@ -5,17 +5,22 @@ #include "library/globalFunctions.h" #include <wx/filename.h> #include <fstream> -#include "ui/resources.h" +#include "library/resources.h" #include <sys/stat.h> #ifdef FFS_WIN #include <windows.h> #endif // FFS_WIN +#ifdef FFS_LINUX +#include <utime.h> +#endif // FFS_LINUX + + using namespace globalFunctions; -const wxString FreeFileSync::FFS_ConfigFileID = "FFS_CONFIG"; -const wxString FreeFileSync::FFS_LastConfigFile = "LastRun.FFS"; +const wxString FreeFileSync::FFS_ConfigFileID = "FFS_CONFIG"; +const wxString FreeFileSync::FFS_LastConfigFile = "LastRun.ffs"; inline wxString formatTime(unsigned int number) @@ -85,13 +90,13 @@ void FreeFileSync::getFileInformation(FileInfo& output, const wxString& filename #else struct stat fileInfo; - if (stat (filename.c_str(), &fileInfo) != 0) + if (stat(filename.c_str(), &fileInfo) != 0) throw FileError(wxString(_("Could not retrieve file info for: ")) + "\"" + filename + "\""); - struct tm * timeinfo; + tm* timeinfo; timeinfo = localtime(&fileInfo.st_mtime); char buffer [50]; - strftime (buffer,50,"%Y-%m-%d %H:%M:%S",timeinfo); + strftime(buffer,50,"%Y-%m-%d %H:%M:%S",timeinfo); //local time output.lastWriteTime = buffer; @@ -664,7 +669,7 @@ public: fileOp.hNameMappings = NULL; fileOp.lpszProgressTitle = NULL; - if (fileOperation(&fileOp //Pointer to an SHFILEOPSTRUCT structure that contains information the function needs to carry out. + if (fileOperation(&fileOp //pointer to an SHFILEOPSTRUCT structure that contains information the function needs to carry out ) != 0 || fileOp.fAnyOperationsAborted) throw FileError(wxString(_("Error moving file ")) + "\"" + filename + "\"" + _(" to recycle bin!")); #endif // FFS_WIN } @@ -695,8 +700,8 @@ void FreeFileSync::removeFile(const wxString& filename) #ifdef FFS_WIN if (!SetFileAttributes( - filename.c_str(), // address of filename - FILE_ATTRIBUTE_NORMAL // address of attributes to set + filename.c_str(), // address of filename + FILE_ATTRIBUTE_NORMAL // attributes to set )) throw FileError(wxString(_("Error deleting file ")) + "\"" + filename + "\""); #endif // FFS_WIN @@ -732,9 +737,17 @@ void FreeFileSync::removeDirectory(const wxString& directory) dirList.Insert(directory, 0); //this directory will be deleted last for (int j = int(dirList.GetCount()) - 1; j >= 0 ; --j) + { +#ifdef FFS_WIN + if (!SetFileAttributes( + dirList[j].c_str(), // address of directory name + FILE_ATTRIBUTE_NORMAL // attributes to set + )) throw FileError(wxString(_("Error deleting directory ")) + "\"" + dirList[j] + "\""); +#endif // FFS_WIN if (!wxRmdir(dirList[j])) throw FileError(wxString(_("Error deleting directory ")) + "\"" + dirList[j] + "\""); + } } @@ -793,11 +806,40 @@ public: wxString source; wxString target; bool success; + wxString errorMessage; private: void longRunner() //virtual method implementation { - success = wxCopyFile(source, target, false); //abort if file exists + if (!wxCopyFile(source, target, false)) //abort if file exists + { + success = false; + errorMessage = wxString(_("Error copying file ")) + "\"" + source + "\"" + _(" to ") + "\"" + target + "\""; + return; + } + +#ifdef FFS_LINUX //copying files with Linux does not preserve the modification time => adapt after copying + struct stat fileInfo; + if (stat(source.c_str(), &fileInfo) != 0) //read modification time from source file + { + success = false; + errorMessage = wxString(_("Could not retrieve file info for: ")) + "\"" + source + "\""; + return; + } + + utimbuf newTimes; + newTimes.actime = fileInfo.st_mtime; + newTimes.modtime = fileInfo.st_mtime; + + if (utime(target.c_str(), &newTimes) != 0) + { + success = false; + errorMessage = wxString(_("Error adapting modification time of file ")) + "\"" + target + "\""; + return; + } +#endif // FFS_LINUX + + success = true; } wxLogNull* noWxLogs; @@ -818,7 +860,7 @@ void FreeFileSync::copyfileMultithreaded(const wxString& source, const wxString& //no mutex needed here since longRunner is finished if (!copyAndUpdate.success) - throw FileError(wxString(_("Error copying file ")) + "\"" + source + "\"" + _(" to ") + "\"" + target + "\""); + throw FileError(copyAndUpdate.errorMessage); } @@ -874,30 +916,73 @@ SyncDirection getSyncDirection(const CompareFilesResult cmpResult, const SyncCon } -bool getBytesToTransfer(double& result, const FileCompareLine& fileCmpLine, const SyncConfiguration& config) +bool getBytesToTransfer(int& objectsToCreate, + int& objectsToOverwrite, + int& objectsToDelete, + double& dataToProcess, + const FileCompareLine& fileCmpLine, + const SyncConfiguration& config) { //false if nothing has to be done - result = 0; //always initialize variables + objectsToCreate = 0; //always initialize variables + objectsToOverwrite = 0; + objectsToDelete = 0; + dataToProcess = 0; //do not add filtered entries if (!fileCmpLine.selectedForSynchronization) return false; + switch (fileCmpLine.cmpResult) { case fileOnLeftSideOnly: + //get data to process + switch (getSyncDirection(fileCmpLine.cmpResult, config)) + { + case syncDirLeft: //delete file on left + dataToProcess = 0; + objectsToDelete = 1; + break; + case syncDirRight: //copy from left to right + dataToProcess = fileCmpLine.fileDescrLeft.fileSize.ToDouble(); + objectsToCreate = 1; + break; + case syncDirNone: + return false; + } + break; + case fileOnRightSideOnly: + switch (getSyncDirection(fileCmpLine.cmpResult, config)) + { + case syncDirLeft: //copy from right to left + dataToProcess = fileCmpLine.fileDescrRight.fileSize.ToDouble();; + objectsToCreate = 1; + break; + case syncDirRight: //delete file on right + dataToProcess = 0; + objectsToDelete = 1; + break; + case syncDirNone: + return false; + } + break; + case leftFileNewer: case rightFileNewer: case filesDifferent: + //get data to process switch (getSyncDirection(fileCmpLine.cmpResult, config)) { case syncDirLeft: //copy from right to left - result = fileCmpLine.fileDescrRight.fileSize.ToDouble(); - return true; + dataToProcess = fileCmpLine.fileDescrRight.fileSize.ToDouble(); + objectsToOverwrite = 1; + break; case syncDirRight: //copy from left to right - result = fileCmpLine.fileDescrLeft.fileSize.ToDouble(); - return true; + dataToProcess = fileCmpLine.fileDescrLeft.fileSize.ToDouble(); + objectsToOverwrite = 1; + break; case syncDirNone: return false; } @@ -911,19 +996,31 @@ bool getBytesToTransfer(double& result, const FileCompareLine& fileCmpLine, cons } -void FreeFileSync::calcTotalBytesToSync(int& objectsTotal, double& dataTotal, const FileCompareResult& fileCmpResult, const SyncConfiguration& config) +void FreeFileSync::calcTotalBytesToSync(int& objectsToCreate, + int& objectsToOverwrite, + int& objectsToDelete, + double& dataToProcess, + const FileCompareResult& fileCmpResult, + const SyncConfiguration& config) { - objectsTotal = 0; - dataTotal = 0; + objectsToCreate = 0; + objectsToOverwrite = 0; + objectsToDelete = 0; + dataToProcess = 0; - double tmp = 0; + int toCreate = 0; + int toOverwrite = 0; + int toDelete = 0; + double data = 0; for (FileCompareResult::const_iterator i = fileCmpResult.begin(); i != fileCmpResult.end(); ++i) { //only sum up sizes of files AND directories - if (getBytesToTransfer(tmp, *i, config)) + if (getBytesToTransfer(toCreate, toOverwrite, toDelete, data, *i, config)) { - dataTotal+= tmp; - ++objectsTotal; + objectsToCreate+= toCreate; + objectsToOverwrite+= toOverwrite; + objectsToDelete+= toDelete; + dataToProcess+= data; } } } @@ -1149,17 +1246,17 @@ wxString FreeFileSync::formatFilesizeToShortString(const double filesize) temp = "Error"; break; case 1: - temp = wxString("0") + GlobalResources::floatingPointSeparator + "0" + temp; + temp = wxString("0") + GlobalResources::decimalPoint + "0" + temp; break; //0,01 case 2: - temp = wxString("0") + GlobalResources::floatingPointSeparator + temp; + temp = wxString("0") + GlobalResources::decimalPoint + temp; break; //0,11 case 3: - temp.insert(1, GlobalResources::floatingPointSeparator); + temp.insert(1, GlobalResources::decimalPoint); break; //1,11 case 4: temp = temp.substr(0, 3); - temp.insert(2, GlobalResources::floatingPointSeparator); + temp.insert(2, GlobalResources::decimalPoint); break; //11,1 case 5: temp = temp.substr(0, 3); @@ -1296,7 +1393,7 @@ bool deletionImminent(const FileCompareLine& line, const SyncConfiguration& conf } -class AlwaysWriteResult //this class ensures, that the result of the method below is ALWAYS written on exit, even if exceptions were thrown! +class AlwaysWriteResult //this class ensures, that the result of the method below is ALWAYS written on exit, even if exceptions are thrown! { public: AlwaysWriteResult(FileCompareResult& grid) : @@ -1327,10 +1424,18 @@ void FreeFileSync::startSynchronizationProcess(FileCompareResult& grid, const Sy AlwaysWriteResult writeOutput(grid); //ensure that grid is always written to, even if method is exitted via exceptions //inform about the total amount of data that will be processed from now on - int objectsTotal = 0; - double dataTotal = 0; - FreeFileSync::calcTotalBytesToSync(objectsTotal, dataTotal, grid, config); - statusUpdater->initNewProcess(objectsTotal, dataTotal, FreeFileSync::synchronizeFilesProcess); + int objectsToCreate = 0; + int objectsToOverwrite = 0; + int objectsToDelete = 0; + double dataToProcess = 0; + calcTotalBytesToSync(objectsToCreate, + objectsToOverwrite, + objectsToDelete, + dataToProcess, + grid, + config); + + statusUpdater->initNewProcess(objectsToCreate + objectsToOverwrite + objectsToDelete, dataToProcess, FreeFileSync::synchronizeFilesProcess); try { @@ -1396,10 +1501,19 @@ void FreeFileSync::startSynchronizationProcess(FileCompareResult& grid, const Sy if (fileSyncObject.synchronizeFile(*i, config, statusUpdater)) { //progress indicator update - //indicator is updated only if file is synched correctly (and if some sync was done)! - double processedData = 0; - if (getBytesToTransfer(processedData, *i, config)) //update status if some work was done (answer is always "yes" in this context) - statusUpdater->updateProcessedData(1, processedData); + //indicator is updated only if file is sync'ed correctly (and if some sync was done)! + int objectsToCreate = 0; + int objectsToOverwrite = 0; + int objectsToDelete = 0; + double dataToProcess = 0; + + if (getBytesToTransfer(objectsToCreate, + objectsToOverwrite, + objectsToDelete, + dataToProcess, + *i, + config)) //update status if some work was done (answer is always "yes" in this context) + statusUpdater->updateProcessedData(objectsToCreate + objectsToOverwrite + objectsToDelete, dataToProcess); } writeOutput.rowProcessedSuccessfully(i - grid.begin()); @@ -1493,12 +1607,10 @@ void FreeFileSync::deleteOnGridAndHD(FileCompareResult& grid, const set<int>& ro fileSyncObject.removeDirectory(currentCmpLine.fileDescrRight.filename); rowsToDeleteInGrid.insert(*i); - break; } catch (FileError& error) { - //if (updateClass) -> is mandatory int rv = statusUpdater->reportError(error.show()); @@ -1521,8 +1633,31 @@ void FreeFileSync::deleteOnGridAndHD(FileCompareResult& grid, const set<int>& ro for (set<int>::iterator i = additionalRowsToDelete.begin(); i != additionalRowsToDelete.end(); ++i) rowsToDeleteInGrid.insert(*i); - //remove deleted rows from grid removeRowsFromVector(grid, rowsToDeleteInGrid); } + +void updateUI_Now() +{ + //process UI events and prevent application from "not responding" -> NO performance issue! + wxTheApp->Yield(); + + // while (wxTheApp->Pending()) + // wxTheApp->Dispatch(); +} + + +bool updateUI_IsAllowed() +{ + static wxLongLong lastExec = 0; + + wxLongLong newExec = wxGetLocalTimeMillis(); + + if (newExec - lastExec >= uiUpdateInterval) //perform ui updates not more often than necessary + { + lastExec = newExec; + return true; + } + return false; +} diff --git a/FreeFileSync.h b/FreeFileSync.h index 3132a214..f2311bc1 100644 --- a/FreeFileSync.h +++ b/FreeFileSync.h @@ -1,6 +1,7 @@ #ifndef FREEFILESYNC_H_INCLUDED #define FREEFILESYNC_H_INCLUDED +#include "library/wxWidgets.h" #include <wx/string.h> #include <set> #include <vector> @@ -17,6 +18,12 @@ enum SyncDirection syncDirNone }; +enum CompareVariant +{ + compareByContent, + compareByTimeAndSize +}; + struct SyncConfiguration { SyncDirection exLeftSideOnly; @@ -26,6 +33,23 @@ struct SyncConfiguration SyncDirection different; }; +struct Configuration +{ //Compare setting + CompareVariant compareVar; + + //Synchronisation settings + SyncConfiguration syncConfiguration; + + //Filter setting + wxString includeFilter; + wxString excludeFilter; + bool hideFiltered; + bool filterIsActive; + + //other options + bool useRecycleBin; //use Recycle bin when deleting or overwriting files while synchronizing + bool continueOnError; //hides error messages during synchronization +}; struct FileInfo { @@ -43,7 +67,7 @@ enum ObjectType struct FileDescrLine { - FileDescrLine() : objType(isNothing) {}; + FileDescrLine() : objType(isNothing) {} wxString filename; // == directory + relFilename wxString directory; //directory to be synced @@ -55,7 +79,6 @@ struct FileDescrLine //the following operators are needed by template class "set" //DO NOT CHANGE THESE RELATIONS!!! - #ifdef FFS_WIN //Windows does NOT distinguish between upper/lower-case bool operator>(const FileDescrLine& b ) const @@ -70,9 +93,8 @@ struct FileDescrLine { return (relFilename.CmpNoCase(b.relFilename) == 0); } -#endif // FFS_WIN -#ifdef FFS_LINUX +#elif defined FFS_LINUX //Linux DOES distinguish between upper/lower-case bool operator>(const FileDescrLine& b ) const { @@ -86,7 +108,9 @@ struct FileDescrLine { return (relFilename.Cmp(b.relFilename) == 0); } -#endif // FFS_LINUX +#else + assert(false); +#endif }; typedef set<FileDescrLine> DirectoryDescrType; @@ -101,6 +125,7 @@ enum CompareFilesResult filesEqual }; + struct FileCompareLine { FileCompareLine() : selectedForSynchronization(true) {} @@ -114,11 +139,8 @@ struct FileCompareLine typedef vector<FileCompareLine> FileCompareResult; -enum CompareVariant -{ - compareByContent, - compareByTimeAndSize -}; +typedef int GridViewLine; +typedef vector<int> GridView; //vector of references to lines in FileCompareResult class GetAllFilesFull : public wxDirTraverser @@ -141,6 +163,9 @@ private: StatusUpdater* statusUpdater; }; +bool updateUI_IsAllowed(); //test if a specific amount of time is over +void updateUI_Now(); //do the updating + //Note: the following lines are a performance optimization for deleting elements from a vector. It is incredibly faster to create a new //vector and leave specific elements out than to delete row by row and force recopying of most elements for each single deletion (linear vs quadratic runtime) @@ -178,11 +203,7 @@ public: FreeFileSync(bool useRecycleBin); ~FreeFileSync(); - friend class MainDialog; - friend class GetAllFilesFull; - friend class CopyThread; - - //identifiers of different processed + //identifiers of different processes static const int scanningFilesProcess = 1; static const int compareFileContentProcess = 2; static const int synchronizeFilesProcess = 3; @@ -205,7 +226,12 @@ public: static wxString formatFilesizeToShortString(const double filesize); static wxString getFormattedDirectoryName(const wxString& dirname); - static void calcTotalBytesToSync(int& objectsTotal, double& dataTotal, const FileCompareResult& fileCmpResult, const SyncConfiguration& config); + static void calcTotalBytesToSync(int& objectsToCreate, + int& objectsToOverwrite, + int& objectsToDelete, + double& dataToProcess, + const FileCompareResult& fileCmpResult, + const SyncConfiguration& config); static void swapGrids(FileCompareResult& grid); @@ -214,6 +240,8 @@ public: static const wxString FFS_ConfigFileID; static const wxString FFS_LastConfigFile; + static void getFileInformation(FileInfo& output, const wxString& filename); + private: bool synchronizeFile(const FileCompareLine& filename, const SyncConfiguration& config, StatusUpdater* statusUpdater); // false if nothing had to be done bool synchronizeFolder(const FileCompareLine& filename, const SyncConfiguration& config, StatusUpdater* statusUpdater); // false if nothing had to be done @@ -226,7 +254,6 @@ private: //some special file functions static void generateFileAndFolderDescriptions(DirectoryDescrType& output, const wxString& directory, StatusUpdater* updateClass = 0); - static void getFileInformation(FileInfo& output, const wxString& filename); bool recycleBinShouldBeUsed; static RecycleBin recycler; diff --git a/Makefile b/Makefile new file mode 100644 index 00000000..3e8c3bbc --- /dev/null +++ b/Makefile @@ -0,0 +1,44 @@ +CPPFLAGS=-Wall -pipe -DNDEBUG `wx-config --cppflags` -DFFS_LINUX -O3 -pthread -c +ENDFLAGS=`wx-config --libs` -lwx_gtk2_aui-2.8 -O3 -pthread + +all: FreeFileSync + +obj/FreeFileSync.o: FreeFileSync.cpp + g++ $(CPPFLAGS) FreeFileSync.cpp -o obj/FreeFileSync.o + +obj/application.o: application.cpp + g++ $(CPPFLAGS) application.cpp -o obj/application.o + +obj/globalFunctions.o: library/globalFunctions.cpp + g++ $(CPPFLAGS) library/globalFunctions.cpp -o obj/globalFunctions.o + +obj/guiGenerated.o: ui/guiGenerated.cpp + g++ $(CPPFLAGS) ui/guiGenerated.cpp -o obj/guiGenerated.o + +obj/mainDialog.o: ui/mainDialog.cpp + g++ $(CPPFLAGS) ui/mainDialog.cpp -o obj/mainDialog.o + +obj/syncDialog.o: ui/syncDialog.cpp + g++ $(CPPFLAGS) ui/syncDialog.cpp -o obj/syncDialog.o + +obj/customGrid.o: library/customGrid.cpp + g++ $(CPPFLAGS) library/customGrid.cpp -o obj/customGrid.o + +obj/multithreading.o: library/multithreading.cpp + g++ $(CPPFLAGS) library/multithreading.cpp -o obj/multithreading.o + +obj/resources.o: library/resources.cpp + g++ $(CPPFLAGS) library/resources.cpp -o obj/resources.o + +obj/smallDialogs.o: ui/smallDialogs.cpp + g++ $(CPPFLAGS) ui/smallDialogs.cpp -o obj/smallDialogs.o + +obj/misc.o: library/misc.cpp + g++ $(CPPFLAGS) library/misc.cpp -o obj/misc.o + +FreeFileSync: obj/FreeFileSync.o obj/application.o obj/globalFunctions.o obj/guiGenerated.o obj/mainDialog.o obj/syncDialog.o obj/customGrid.o obj/resources.o obj/smallDialogs.o obj/multithreading.o obj/misc.o + g++ $(ENDFLAGS) -o FreeFileSync obj/application.o obj/FreeFileSync.o obj/globalFunctions.o obj/guiGenerated.o obj/mainDialog.o obj/syncDialog.o obj/customGrid.o obj/resources.o obj/smallDialogs.o obj/multithreading.o obj/misc.o + + +clean: + find obj -type f -exec rm {} \; diff --git a/COMPILE.cmd b/Makefile_Win.cmd index 39a43c30..08eb0053 100644 --- a/COMPILE.cmd +++ b/Makefile_Win.cmd @@ -2,20 +2,18 @@ set widgets=C:\Programme\CodeBlocks\wxWidgets set sources=C:\Programme\CodeBlocks\Projects\FreeFileSync md obj -md obj\Release -md obj\Release\library -md obj\Release\ui -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\application.cpp -o obj\Release\Application.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\FreeFileSync.cpp -o obj\Release\FreeFileSync.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\globalFunctions.cpp -o obj\Release\library\globalFunctions.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\multithreading.cpp -o obj\Release\library\multithreading.cpp.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\guiGenerated.cpp -o obj\Release\UI\GUI_Generated.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\mainDialog.cpp -o obj\Release\ui\MainDialog.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\syncDialog.cpp -o obj\Release\ui\SyncDialog.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\customGrid.cpp -o obj\Release\library\CustomGrid.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\resources.cpp -o obj\Release\ui\Resources.o -mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\smallDialogs.cpp -o obj\Release\ui\SmallDialogs.o -windres.exe -i %sources%\resource.rc -J rc -o obj\Release\resource.res -O coff -I%widgets%\include -I%widgets%\lib\gcc_lib\msw -mingw32-g++.exe -L%widgets%\lib\gcc_lib -o FreeFileSync.exe obj\Release\Application.o obj\Release\FreeFileSync.o obj\Release\library\globalFunctions.o obj\Release\library\multithreading.cpp.o obj\Release\ui\GUI_Generated.o obj\Release\ui\MainDialog.o obj\Release\ui\SyncDialog.o obj\Release\library\CustomGrid.o obj\Release\ui\Resources.o obj\Release\ui\SmallDialogs.o obj\Release\resource.res -s -mthreads -lwxmsw28_adv -lwxmsw28_core -lwxbase28 -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\application.cpp -o obj\Application.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\FreeFileSync.cpp -o obj\FreeFileSync.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\globalFunctions.cpp -o obj\globalFunctions.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\multithreading.cpp -o obj\multithreading.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\guiGenerated.cpp -o obj\GUI_Generated.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\mainDialog.cpp -o obj\MainDialog.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\syncDialog.cpp -o obj\SyncDialog.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\customGrid.cpp -o obj\CustomGrid.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\resources.cpp -o obj\Resources.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\library\misc.cpp -o obj\misc.o +mingw32-g++.exe -Wall -pipe -mthreads -D__GNUWIN32__ -D__WXMSW__ -DFFS_WIN -O2 -DNDEBUG -I%widgets%\include -I%widgets%\contrib\include -I%widgets%\lib\gcc_lib\msw -c %sources%\ui\smallDialogs.cpp -o obj\SmallDialogs.o +windres.exe -i %sources%\resource.rc -J rc -o obj\resource.res -O coff -I%widgets%\include -I%widgets%\lib\gcc_lib\msw +mingw32-g++.exe -L%widgets%\lib\gcc_lib -o FreeFileSync.exe obj\Application.o obj\FreeFileSync.o obj\globalFunctions.o obj\multithreading.o obj\misc.o obj\GUI_Generated.o obj\MainDialog.o obj\SyncDialog.o obj\CustomGrid.o obj\Resources.o obj\SmallDialogs.o obj\resource.res -s -mthreads -lwxmsw28_adv -lwxmsw28_core -lwxbase28 -lwxpng -lwxzlib -lkernel32 -luser32 -lgdi32 -lwinspool -lcomdlg32 -ladvapi32 -lshell32 -lole32 -loleaut32 -luuid -lcomctl32 -lwsock32 -lodbc32 -mwindows pause
\ No newline at end of file @@ -1,4 +1,4 @@ -FreeFileSync v1.5 +FreeFileSync v1.6 ----------------- Usage @@ -10,32 +10,34 @@ Usage Features -------- 1. Compare files (bytewise or by date) and synchronize them. -2. No limitations: An unlimited number of files can be synchronized. -3. Subfolders are also synchronized, especially empty folders. +2. No limitations: An arbitrary number of files can be synchronized. +3. Subfolders are also synchronized, including empty folders. 4. Network support. -5. Lean & easy accessible UI: Optimized for speed and large sets of data. -6. Algorithms coded in C/C++ completely. +5. Lean & easy accessible UI: Highly optimized for speed and huge sets of data. +6. Algorithms coded in C++ completely. 7. Focus on usability: - Only necessary functionality on UI: no overloaded menus or icon jungle. - Select folders via drag & drop. - - Your last configuration and screen settings are loaded on startup and saved on exit. - - Maintain and load different configurations by drag&drop, load-button or commandline + - Last configuration and screen settings are saved automatically. + - Maintain and load different configurations by drag&drop, load-button or commandline. - Double-click to show file in explorer. - - copy & paste support to export file-lists. - - right-click context menu - - delete superfluous/temporary files directly on main grid - - Progress indicators, status information and error reporting + - Copy & paste support to export file-lists. + - Delete superfluous/temporary files directly on main grid. + - Right-click context menu. + - Progress indicators, status information and error reporting. - Sort file-lists by name, size or date. - Display statistical data: total filesizes, amount of bytes that will be transfered with the current settings. -8. Easy commandline mode for automated synchronization (can be scheduled or used in Batch jobs). +8. Easy configurable commandline mode for automated synchronization. 9. Support for filesizes > 4 GB. 10. Option to move files to Recycle Bin instead of deleting/overwriting them. 11. UTC (coordinated world time) is used when comparing file times avoiding problems with time zones or daylight saving time. 12. Automatically ignore directories "\RECYCLER" and "System Volume Information" when comparing and syncing. 13. Localized German version available. -14. Based on wxWidgets Framework => Portable to many operating systems. -15. Filter functionality to include/exclude files from synchronization -16. Include/exclude specific files from synchronization manually. +14. Delete before copy: Avoid disc space shortages with large sync-operations. +15. Based on wxWidgets framework => Portable to many operating systems. +16. Filter functionality to include/exclude files from synchronization (without re-compare!). +17. Include/exclude specific files from synchronization manually. +18. Create sync jobs via GUI to synchronize automatically (can be scheduled or executed directly). Links diff --git a/Resources.dat b/Resources.dat Binary files differindex 170a8b90..08234bf7 100644 --- a/Resources.dat +++ b/Resources.dat diff --git a/language.dat b/german.lng index 1d478efb..ce675eee 100644 --- a/language.dat +++ b/german.lng @@ -2,6 +2,8 @@ Uhrzeit: already exists. Overwrite? existiert bereits. Überschreiben? + does not exist. + existiert nicht. does not exist. Aborting! existiert nicht. Abbruch! does not exist. \n\nSynchronization aborted! @@ -12,10 +14,16 @@ Element(e):\n\n items on left, Elemente links, +Synchronization started. +Synchronisation gestartet. items on right, Elemente rechts, of von +Start +Start +Stop +Stop overwriting und überschreibe row in view @@ -32,6 +40,10 @@ != Dateien sind verschieden\n &Abort &Abbruch +&About... +&Über... +&Advanced +&Erweitert &Back &Zurück &Cancel @@ -40,12 +52,28 @@ &Vergleichen &Continue &Fortfahren +&Create +&Erzeugen +&Create batch job +&Erstelle Batch-Job &Default &Standard +&Export file list +&Exportiere Dateiliste +&File +&Datei &Filter &Filter +&Help +&Hilfe +&Language +&Sprache &OK &OK +&Pause +&Pause +&Quit +&Beenden &Retry &Wiederholen &Start @@ -70,6 +98,8 @@ -Open-Source Datei-Synchronisation- . , +.\n\nExamples:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Creates a mirror backup of the left directory\n2: Synchronizes all *.doc files from both directories simultaneously\n\n +.\n\nBeispiele:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Erzeugt ein Spiegel-Backup des linken Verzeichnisses\n2: Synchronisiert alle *.doc Dateien aus beiden Verzeichnissen\n\n / / 1 item on left, @@ -78,6 +108,12 @@ 1 Element rechts, 1 row in view ( 1 Zeile zur Ansicht ( +1. Enter full file or directory names separated by ';'.\n2. Wildcard characters '*' and '?' are supported.\n3. Case sensitive expressions!\n\nExample: *.tmp;*\\filename.dat;*\\directory\\* +1. Komplette Datei- oder Verzeichnisnamen getrennt durch ';' eingeben.\n2. Die Platzhalter '*' und '?' werden unterstützt.\n3. Groß-/Kleinschreibung wird unterschieden!\n\nBeispiel: *.tmp;*\\filename.dat;*\\directory\\* +: check file content\n +: Prüfung auf Dateiinhalt\n +: check filesize and date\n\t\t +: Prüfung auf Dateigröße und -datum\n\t\t << left file is newer\n << linke Datei ist neuer\n <Directory> @@ -99,7 +135,7 @@ Abgebrochen Aborted! Abbruch! About -Info +Über Action Aktion All items have been synchronized! @@ -110,8 +146,12 @@ An exception occured Eine Exception wurde geworfen An exception occured! Eine Exception wurde geworfen! +Assemble a batch file with the following settings. To start synchronization in batch mode simply execute this file or schedule it in your operating system's task planner. +Erzeuge eine Batch-Datei mit den folgenden Parametern. Um im Batch-Modus zu synchronisieren, kann diese einfach gestartet oder in den Task-Planer des Betriebssystems eingetragen werden. Back Zurück +Batch file created successfully! +Batch-Datei wurde erfolgreich erstellt! Begin Synchronization Starte Synchronisation Benchmark: @@ -120,12 +160,16 @@ Cancel Abbruch Choose to hide filtered files/directories from list Gefilterte Dateien ein-/ausblenden +Comma separated list +Kommagetrennte Liste +Command file +Command Datei Compare both sides Beide Seiten vergleichen -Compare by -Vergleichen nach Compare by \"File size and date\"\n----------------------------------------\nThis compare variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time. For the latter the system's UTC time (coordinated word time) is used internally, although the local file time is displayed on the result list. So there are no problems concerning different time zones or daylight saving time.\n\nWhen \"Compare\" is triggered with this option set the following decision tree is processed:\n\n -----------------\n |Decision tree|\n -----------------\n ________|___________\n | |\n file exists on both sides on one side only\n _____|______ __|___\n | | | |\nequal different left right\n _________|_____________\n | | |\n left newer right newer different (but same date)\n\nAs a result 6 different status can be returned to categorize all files:\n\n- exists left only\n- exists right only\n- left newer\n- right newer\n- different (but same date)\n- equal\n\n\nCompare by \"File content\"\n----------------------------------------\nAs the name suggests, two files which share the same name are marked as equal if and only if they have the same content. This option is useful for consistency checks rather than backup operations. Therefore the file times are not taken into account at all.\n\nWith this option enabled the decision tree is smaller:\n\n -----------------\n |Decision tree|\n -----------------\n ________|___________\n | |\n file exists on both sides on one side only\n _____|______ __|___\n | | | |\nequal different left right\n\nAs a result the files are separated into the following categories:\n\n- exists left only\n- exists right only\n- different\n- equal Vergleichen nach \"Dateigröße und -datum\"\n---------------------------------------------------\nDiese Variante identifiziert zwei gleichnamige Dateien als gleich, wenn sie die gleiche Dateigröße haben UND der Zeitpunkt der letzten Änderung derselbe ist. Für Letzteres wird intern die UTC-Zeit (koordinierte Weltzeit) verwendet, auch wenn die lokale Zeit in der Ergebnisliste angezeigt wird. Dadurch werden Probleme vermieden, die durch verschiedene Zeitzonen oder Sommer-/Winterzeit entstehen.\n\nNachdem \"Compare\" mit dieser Einstellung gestartet wurde, wird der folgende Entscheidungsbaum abgearbeitet:\n\n -------------------------\n |Entscheidungsbaum|\n -------------------------\n __________|___________\n | |\n Datei ex. auf beiden Seiten nur auf einer Seite\n ________|____ __|___\n | | | |\n gleich verschieden links rechts\n __________|___________\n | | |\n links neuer rechts neuer verschieden (bei gleichem Datum)\n\nAls Ergebnis werden 6 verschiedene Status zurückgegeben, um Dateien zu kategorisieren:\n\n- existiert nur links\n- existiert nur rechts\n- links neuer\n- rechts neuer\n- verschieden (bei gleichem Datum)\n- gleich\n\n\nVergleichen nach \"Dateiinhalt\"\n------------------------------------\nWie der Name bereits sagt, werden zwei Dateien mit gleichem Namen genau dann als gleich angesehen, wenn sie den gleichen Dateiinhalt haben. Diese Einstellung ist eher für Konsistenzprüfungen geeignet als für Backup-Operationen. Aus diesem Grund wird der Zeitpunkt der letzten Änderung der Dateien nicht berücksichtigt.\n\nDer Entscheidungsbaum ist in diesem Fall kleiner:\n\n -------------------------\n |Entscheidungsbaum|\n -------------------------\n __________|___________\n | |\n Datei ex. auf beiden Seiten nur auf einer Seite\n ________|____ __|___\n | | | |\n gleich verschieden links rechts\n\nDas Ergebnis ist eine Aufteilung in folgende Kategorien:\n\n- existiert nur links\n- existiert nur rechts\n- verschieden\n- gleich +Compare by... +Vergleichen nach... Comparing content of files Vergleiche Inhalt der Dateien Comparing... @@ -136,18 +180,28 @@ Configuration Konfiguration Configuration loaded! Konfiguration geladen! +Configuration overview: +Übersicht der Parameter: Configuration saved! Konfiguration gespeichert! Configure Filter... Konfiguriere Filter... +Configure filter +Konfiguriere Filter Configure filter settings Konfiguriere Filter +Configure filter... +Konfiguriere Filter... Configure your own synchronization rules. Eigene Synchronisationsregeln definieren. Confirm Bestätigen Continue Fortfahren +Continue on error +Fortfahren bei Fehler +Continue on next errors +Fortfahren bei nächsten Fehlern Copy from left to right Von links nach rechts kopieren Copy from left to right overwriting @@ -170,12 +224,20 @@ Could not open file: Fehler beim Öffnen der Datei: Could not read configuration file Fehler beim Lesen der Konfigurationsdatei +Could not read language file +Fehler beim Lesen der Sprachdatei Could not retrieve file info for: Fehler beim Lesen der Dateiattribute von: Could not set working directory to directory containing executable file! Arbeitsverzeichnisses konnte nicht auf Pfad der .exe-Datei gelegt werden! Could not write to Fehler beim Schreiben von +Create a batch job +Erstelle Batch-Job +Create a batch job for automated synchronization +Erzeuge Batch-Job für die automatische Synchronisation +Create: +Erstellen: Creating folder Erstelle Verzeichnis Current operation: @@ -192,6 +254,8 @@ Data to compare: Zu vergleichende Daten: Data to transfer: Zu übertragende Daten: +Data: +Daten: Date Datum Default @@ -200,12 +264,20 @@ Delete files existing on left side only Lösche Dateien, die nur links existieren Delete files existing on right side only Lösche Dateien, die nur rechts existieren +Delete files/folders existing on left side only +Lösche Dateien/Ordner, die nur links existieren +Delete files/folders existing on right side only +Lösche Dateien/Ordner, die nur rechts existieren Delete files\tDEL Lösche Dateien\tDEL +Delete: +Löschen: Deleting file Lösche Datei Deleting folder Lösche Verzeichnis +Deutsch +Deutsch Directory Verzeichnis Directory on the left does not exist. Please select a new one! @@ -214,6 +286,10 @@ Directory on the right does not exist. Please select a new one! Verzeichnis auf der rechten Seite existiert nicht. Bitte ein anderes auswählen! Displays help on the command line parameters\n Hilfe zu den Kommandozeilenparametern\n +Do not show UI messages but write to a logfile instead\n\nExamples:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Creates a mirror backup of the left directory\n2: Synchronizes all *.doc files from both directories simultaneously\n\n +Keine UI-Meldungen anzeigen, sondern eine Logdatei schreiben\n\nBeispiele:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Erzeugt ein Backup des linken Verzeichnisses\n2: Synchronisiert alle *.doc Dateien aus beiden Verzeichnissen\n\n +Do not show graphical status and error messages but write to a logfile instead +Keine graphischen Status- und Fehlermeldungen anzeigen, sondern eine Logdatei erstellen Do nothing Nichts tun Do you really want to delete the following objects(s)? @@ -228,10 +304,14 @@ Dummy text Dummy text Email: Email: +English +English Equality condition Vergleich nach: Error Fehler +Error adapting modification time of file +Fehler beim Anpassen des Datums der letzten Änderung der Datei Error converting FILETIME to SYSTEMTIME Fehler beim Konvertieren der FILETIME nach SYSTEMTIME Error converting FILETIME to local FILETIME @@ -262,6 +342,8 @@ Feedback and suggestions are welcome at: Feedback und Vorschläge sind willkommen unter: File content Dateiinhalt +File list exported! +Dateiliste exportiert! File size and date Dateigröße und -datum Filename @@ -294,6 +376,10 @@ Files that exist on right view only Dateien, die nur rechts existieren Files to compare: Zu vergleichende Dateien: +Files/folders that exist on left side only +Dateien/Ordner, die nur links existieren +Files/folders that exist on right side only +Dateien/Ordner, die nur rechts existieren Filter Filter Filter active: Press again to deactivate @@ -304,6 +390,8 @@ Filter manually Manuell filtern Filter view Ansicht filtern +Final status +Finaler status Folders/files that exist on left side only Ordner/Dateien, die nur links existieren Folders/files that exist on right side only @@ -324,14 +412,18 @@ Hide filtered items Gefilterte Elemente ausblenden Hide further error messages Weitere Fehlermeldungen unterdrücken +Hide further error messages during the current process and continue +Unterdrücke alle nachfolgenden Fehlermeldungen für den aktuellen Prozess und fahre fort Hide further messages during current process Weitere Meldungen während dieser Operation ausblenden Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process Verhindert das Anzeigen von Fehlermeldungen während der Synchronisation:\nSie werden jedoch gesammelt und nach dem Vorgang als Liste angezeigt +Hints: +Tipps: Homepage: Homepage: -If errors occur during folder comparison or synchronization they are ignored and the process continues.\n -Wenn Fehler während des Vergleichs oder der Synchronisation auftreten, werden diese ignoriert und der Vorgang fortgesetzt.\n +If errors occur during folder comparison or synchronization they are ignored and the process continues\n +Wenn Fehler während des Vergleichs oder der Synchronisation auftreten, werden diese ignoriert und der Vorgang fortgesetzt\n If you like FFS: FFS unterstützen: Include @@ -342,6 +434,8 @@ It was not possible to gain access to Recycle Bin!\n\nIt's likely that you are n Die Papierkorbfunktion steht nicht zur Verfügung!\n\nWahrscheinlich ist das aktuelle Betriebssystem nicht Windows XP. (Möglicherweise Vista)\nWenn Sie diese Funktion wirklich benötigen kontaktieren Sie bitte den Autor. :) Items completed: Elemente komplett: +Left folder: +Linker Ordner: Legend\n Legende\n Load configuration from file:\n - use this choice box\n - drag & drop config file to this window\n - specify config file as first commandline parameter @@ -351,15 +445,21 @@ Konfiguration laden... Log-messages: Lognachrichten: Mirror backup of left folder: Right folder will be overwritten and exactly match left folder after synchronization. -Backup des linken Ordners erstellen: Der rechte Ordner wird dabei überschrieben und nach der Synchronisation dem linken exakt gleichen. +Spiegel-Backup des linken Ordners erstellen: Der rechte Ordner wird dabei überschrieben und nach der Synchronisation dem linken exakt gleichen. +Move files to Recycle Bin instead of deleting or overwriting them directly.\n +Verschiebe die Dateien in den Papierkorb anstatt sie zu löschen oder zu überschreiben.\n Not all items have been synchronized! You may try to synchronize the remaining items again (WITHOUT having to re-compare)! Nicht alle Objekte wurden synchronisiert! Die Synchronisation kann erneut gestartet werden (OHNE dass ein erneuter Vergleich notwendig ist)! Not all items were synchronized! Have a look at the list. Nicht alle Objekte wurden synchronisiert! Siehe die verbliebenen Elemente im Hauptfenster. Nothing to synchronize. Both directories seem to contain the same data! Nichts zu synchronisieren. Beide Verzeichnisse scheinen dieselben Daten zu enthalten! -Number of files and directories that will be copied or deleted -Anzahl der Dateien und Verzeichnisse, die kopiert oder gelöscht werden +Number of files or directories that will be created +Anzahl der Dateien oder Verzeichnisse, die erstellt werden +Number of files or directories that will be deleted +Anzahl der Dateien oder Verzeichnisse, die gelöscht werden +Number of files that will be overwritten +Anzahl der Dateien, die überschrieben werden OK OK Objects to process: @@ -368,6 +468,8 @@ One way -> Nach rechts -> Only files/directories that pass filtering will be relevant for synchronization.\n\n1. Enter full file or directory names separated by ';'.\n2. Wildcard characters '*' and '?' are supported.\n3. Case sensitive expressions!\n\nExample: *.tmp;C:\\data\\dummy.log;*filename*;*directory* Bei der Synchronisation werden nur die Dateien/Ordner berücksichtigt, die zu den\nFiltereinstellungen passen.\n\n1. Komplette Datei- oder Verzeichnisnamen getrennt durch ';' eingeben.\n2. Die Platzhalter '*' und '?' werden unterstützt.\n3. Groß-/Kleinschreibung wird unterschieden!\n\nBeispiel: *.tmp;C:\\data\\dummy.log;*filename*;*directory* +Only files/directories that pass filtering will be selected for synchronization. +Bei der Synchronisation werden nur die Dateien/Ordner berücksichtigt, die zu\nden Filtereinstellungen passen. Open synchronization dialog Zeige Synchronisationseinstellungen Open with Explorer\tD-Click @@ -382,6 +484,8 @@ Please select directories for both sides! Bitte für beide Seiten ein Verzeichnis wählen! Press button to activate filter Auswählen, um Filter zu aktivieren +Preview +Vorschau Published under the GNU General Public License: Veröffentlicht unter der GNU General Public License: Quit @@ -396,6 +500,8 @@ Result Ergebnis Retry Wiederholen +Right folder: +Rechter Ordner: Running... Aktiv... Save current configuration to file @@ -416,10 +522,16 @@ Select variant: Variante auswählen: Set filter for synchronization Filter einstellen +Shell script +Shell Skript +Silent mode +Stiller Modus Size Größe Source code written completely in C++ utilizing:\n\n MinGW \t\t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE\n\n by ZenJu Sourcecode komplett in C++ geschrieben unter Verwendung von:\n\n MinGW \t\t- Windows-Port der GNU Compiler Collection\n wxWidgets \t- Open-Source GUI-Framework\n wxFormBuilder\t- wxWidgets GUI-Builder\n CodeBlocks \t- Open-Source IDE\n\n ZenJu +Specify algorithm to test if files are equal:\n\n\t\t +Algorithmus wählen, um gleiche Dateien zu erkennen:\n\n\t\t Specify algorithm to test if files are equal:\n\n\t\tSIZEDATE: check filesize and date\n\t\tCONTENT: check file content\n Methode angeben, um gleiche Dateien zu erkennen:\n\n\t\tSIZEDATE: Prüfung auf Dateigröße und -datum\n\t\tCONTENT: Prüfung auf Dateiinhalt\n Specify names to be excluded separated by ';'. Wildcards '*' and '?' are supported. Default: \"\"\n @@ -434,16 +546,18 @@ Start synchronizing files Beginne Synchronisation der Daten Swap sides Vertausche Seiten +Synchronization aborted! +Synchronisation abgebrochen! Synchronization aborted: You may try to synchronize remaining items again (WITHOUT having to re-compare)! Synchronisation abgebrochen: Die Synchronisation kann erneut gestartet werden (OHNE dass ein erneuter Vergleich notwendig ist)! -Synchronization completed! -Synchronisation abgeschlossen! +Synchronization completed. +Synchronisation abgeschlossen. Synchronization settings Synchronisationseinstellungen Synchronization status Synchronisation: Status Synchronize both sides simultaneously: Copy new or updated files in both directions. -Beide Seiten gleichzeitig synchronisieren: Neue oder aktualisierte Dateien auf die jeweils andere Seite kopieren. +Beide Seiten gleichzeitig synchronisieren: Neue oder aktualisierte Dateien werden auf die jeweils andere Seite kopiert. Synchronizing... Synchronisiere... The selected file does not contain a valid configuration! @@ -452,12 +566,18 @@ The selected file does not exist anymore! Die gewählte Datei existiert nicht mehr! Total amount of data that will be copied Menge der Daten, die kopiert werden +Total amount of data that will be transferred +Gesamtmenge der Daten, die übertragen werden Two way <-> Beidseitig <-> Unable to create logfile! Fehler beim Erstellen der Logdatei! +Unable to initialize Recycle Bin! +Der Papierkorb konnte nicht initialisiert werden! Unable to load Resources.dat! Fehler beim Laden von Resources.dat! +Update: +Überschreiben: Use Recycle Bin Papierkorb verwenden Use Recycle Bin when deleting or overwriting files during synchronization @@ -467,7 +587,7 @@ Warnung Warning: Synchronization failed for Warnung: Synchronisation fehlgeschlagen für \n\nContinue with next object, retry or abort comparison? -\n\nMit nächstem Objekt fortsetzen, wiederholen oder abbrechen? +\n\nMit nächstem Objekt fortfahren, wiederholen oder abbrechen? \n\nContinue with next object, retry or abort synchronization? \n\nMit nächstem Objekt fortsetzen, wiederholen oder abbrechen? \n\nInformation: If you skip the error and continue or abort a re-compare will be necessary! @@ -476,7 +596,7 @@ Warnung: Synchronisation fehlgeschlagen für \n\nDieses Verzeichnis überspringen und mit Synchronisation fortfahren? \n\nSkip this file and continue synchronization? \n\nDiese Datei überspringen und mit Synchronisation fortfahren? -\tDo not show UI messages but write to a logfile instead\n\nExamples:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Creates a mirror backup of the left directory\n2: Synchronizes all *.doc files from both directories simultaneously\n\n -\tKeine UI-Meldungen anzeigen, sondern eine Logdatei schreiben\n\nBeispiele:\n\n1.) FreeFileSync -cmp SIZEDATE -cfg RRRRR C:\\Source C:\\Target\n2.) FreeFileSync -cmp sizedate -cfg rlrln c:\\dir1 c:\\dir2 -incl *.doc\n\n1: Erzeugt ein Backup des linken Verzeichnisses\n2: Synchronisiert alle *.doc Dateien aus beiden Verzeichnissen\n\n +dummy +dummy |> file on right side only\n |> Datei existiert nur rechts\n diff --git a/library/CustomGrid.cpp b/library/CustomGrid.cpp index 4f8c84ad..053244f5 100644 --- a/library/CustomGrid.cpp +++ b/library/CustomGrid.cpp @@ -1,4 +1,7 @@ #include "customGrid.h" +#include "globalFunctions.h" +#include "resources.h" +#include <wx/dc.h> const unsigned int MinimumRows = 15; @@ -6,20 +9,21 @@ const unsigned int MinimumRows = 15; class CustomGridTableBase : public wxGridStringTable { public: - CustomGridTableBase(int numRows, int numCols) : wxGridStringTable(numRows, numCols), gridIdentifier(0), currentUI_ViewPtr(0), lastNrRows(MinimumRows) - { - lightBlue = new wxColour(80, 110, 255); - } + CustomGridTableBase(int numRows, int numCols) : + wxGridStringTable(numRows, numCols), + lightBlue(80, 110, 255), + gridIdentifier(0), + gridRefUI(0), + gridData(0), + lastNrRows(MinimumRows) {} - ~CustomGridTableBase() - { - delete lightBlue; - } + ~CustomGridTableBase() {} - void setGridDataTable(UI_Grid* currentUI_ViewPtr) + void setGridDataTable(GridView* gridRefUI, FileCompareResult* gridData) { - this->currentUI_ViewPtr = currentUI_ViewPtr; + this->gridRefUI = gridRefUI; + this->gridData = gridData; } void SetGridIdentifier(int id) @@ -28,12 +32,12 @@ public: } //########################################################################### -//grid standard input output methods, redirected directly to UIGrid to improve performance +//grid standard input output methods, redirected directly to gridData to improve performance virtual int GetNumberRows() { - if (currentUI_ViewPtr) - return max(currentUI_ViewPtr->size(), MinimumRows); + if (gridRefUI) + return max(gridRefUI->size(), MinimumRows); return MinimumRows; //grid is initialized with this number of rows } @@ -42,52 +46,122 @@ public: return (GetValue(row, col) == wxEmptyString); } - virtual wxString GetValue( int row, int col ) + + inline + wxString evaluateCmpResult(const CompareFilesResult result, const bool selectedForSynchronization) { - if (currentUI_ViewPtr) + if (selectedForSynchronization) + switch (result) + { + case fileOnLeftSideOnly: + return "<|"; + break; + case fileOnRightSideOnly: + return "|>"; + break; + case rightFileNewer: + return ">>"; + break; + case leftFileNewer: + return "<<"; + break; + case filesDifferent: + return "!="; + break; + case filesEqual: + return "=="; + break; + default: + assert (false); + return wxEmptyString; + } + else return "(-)"; + } + + + virtual wxString GetValue(int row, int col) + { + if (gridRefUI) { - if (currentUI_ViewPtr->size() > unsigned(row)) + if (unsigned(row) < gridRefUI->size()) { + const FileCompareLine& gridLine = (*gridData)[(*gridRefUI)[row]]; + wxString fileSize; //tmp string + switch (gridIdentifier) { case 1: - if (4 > col) + if (col < 4) { - switch (col) + if (gridLine.fileDescrLeft.objType == isDirectory) { - case 0: - return (*currentUI_ViewPtr)[row].leftFilename; - case 1: - return (*currentUI_ViewPtr)[row].leftRelativePath; - case 2: - return (*currentUI_ViewPtr)[row].leftSize; - case 3: - return (*currentUI_ViewPtr)[row].leftDate; + switch (col) + { + case 0: //filename + return wxEmptyString; + case 1: //relative path + return gridLine.fileDescrLeft.relFilename; + case 2: //file size + return _("<Directory>"); + case 3: //date + return gridLine.fileDescrLeft.lastWriteTime; + } + } + else if (gridLine.fileDescrLeft.objType == isFile) + { + switch (col) + { + case 0: //filename + return gridLine.fileDescrLeft.relFilename.AfterLast(GlobalResources::fileNameSeparator); + case 1: //relative path + return gridLine.fileDescrLeft.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + case 2: //file size + return globalFunctions::includeNumberSeparator(fileSize = gridLine.fileDescrLeft.fileSize.ToString()); + case 3: //date + return gridLine.fileDescrLeft.lastWriteTime; + } } } break; case 2: - if (4 > col) + if (col < 4) { - switch (col) + if (gridLine.fileDescrRight.objType == isDirectory) { - case 0: - return (*currentUI_ViewPtr)[row].rightFilename; - case 1: - return (*currentUI_ViewPtr)[row].rightRelativePath; - case 2: - return (*currentUI_ViewPtr)[row].rightSize; - case 3: - return (*currentUI_ViewPtr)[row].rightDate; + switch (col) + { + case 0: //filename + return wxEmptyString; + case 1: //relative path + return gridLine.fileDescrRight.relFilename; + case 2: //file size + return _("<Directory>"); + case 3: //date + return gridLine.fileDescrRight.lastWriteTime; + } + } + else if (gridLine.fileDescrRight.objType == isFile) + { + switch (col) + { + case 0: //filename + return gridLine.fileDescrRight.relFilename.AfterLast(GlobalResources::fileNameSeparator); + case 1: //relative path + return gridLine.fileDescrRight.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + case 2: //file size + return globalFunctions::includeNumberSeparator(fileSize = gridLine.fileDescrRight.fileSize.ToString()); + case 3: //date + return gridLine.fileDescrRight.lastWriteTime; + } } } break; case 3: - if (1 > col) + if (col < 1) { - return (*currentUI_ViewPtr)[row].cmpResult; + return evaluateCmpResult(gridLine.cmpResult, gridLine.selectedForSynchronization);; } break; @@ -96,44 +170,44 @@ public: } } } - //if data not found in UIgrid table: + //if data is not found: return wxEmptyString; } virtual void SetValue( int row, int col, const wxString& value ) { - assert (false); //should not be used, since values are retrieved directly from currentUI_ViewPtr + assert (false); //should not be used, since values are retrieved directly from gridRefUI } virtual void Clear() { - assert (false); // we don't want to use this, since the visible grid is directly connected to currentUI_ViewPtr} + assert (false); // we don't want to use this, since the visible grid is directly connected to gridRefUI} } virtual bool InsertRows( size_t pos = 0, size_t numRows = 1 ) { - assert (false); // we don't want to use this, since the visible grid is directly connected to currentUI_ViewPtr} + assert (false); // we don't want to use this, since the visible grid is directly connected to gridRefUI} return true; } virtual bool AppendRows( size_t numRows = 1 ) { - assert (false); // we don't want to use this, since the visible grid is directly connected to currentUI_ViewPtr} + assert (false); // we don't want to use this, since the visible grid is directly connected to gridRefUI} return true; } virtual bool DeleteRows( size_t pos = 0, size_t numRows = 1 ) { - assert (false); // we don't want to use this, since the visible grid is directly connected to currentUI_ViewPtr} + assert (false); // we don't want to use this, since the visible grid is directly connected to gridRefUI} return true; } //update dimensions of grid: no need for InsertRows, AppendRows, DeleteRows anymore!!! void updateGridSizes() { - if (currentUI_ViewPtr) + if (gridRefUI) { int currentNrRows = GetNumberRows(); if (lastNrRows < currentNrRows) { - if ( GetView() ) + if (GetView()) { wxGridTableMessage msg(this, wxGRIDTABLE_NOTIFY_ROWS_APPENDED, @@ -144,7 +218,7 @@ public: } else if (lastNrRows > currentNrRows) { - if ( GetView() ) + if (GetView()) { wxGridTableMessage msg(this, wxGRIDTABLE_NOTIFY_ROWS_DELETED, @@ -160,19 +234,20 @@ public: //########################################################################### - bool markThisRow(int row) + bool markThisRow(int row) //rows that are filtered out are shown in different color { - if (currentUI_ViewPtr) + if (gridRefUI) { - if (unsigned(row) < currentUI_ViewPtr->size()) + if (unsigned(row) < gridRefUI->size()) { - if ((*currentUI_ViewPtr)[row].cmpResult == constFilteredOut) + if (!(*gridData)[(*gridRefUI)[row]].selectedForSynchronization) return true; } } return false; } + wxGridCellAttr* GetAttr(int row, int col, wxGridCellAttr::wxAttrKind kind) { wxGridCellAttr* result = wxGridTableBase::GetAttr(row, col, kind); @@ -188,7 +263,7 @@ public: } if (markThisRow(row)) - result->SetBackgroundColour(*lightBlue); + result->SetBackgroundColour(lightBlue); else result->SetBackgroundColour(*wxWHITE); } @@ -196,16 +271,17 @@ public: { result = new wxGridCellAttr; if (markThisRow(row)) - result->SetBackgroundColour(*lightBlue); + result->SetBackgroundColour(lightBlue); } return result; } private: - wxColour* lightBlue; + wxColour lightBlue; int gridIdentifier; - UI_Grid* currentUI_ViewPtr; //(fast) access to underlying grid data :) + GridView* gridRefUI; //(very fast) access to underlying grid data :) + FileCompareResult* gridData; int lastNrRows; }; @@ -213,21 +289,24 @@ private: //######################################################################################################## -CustomGrid::CustomGrid( wxWindow *parent, - wxWindowID id, - const wxPoint& pos, - const wxSize& size, - long style, - const wxString& name) - : wxGrid(parent, id, pos, size, style, name), +CustomGrid::CustomGrid(wxWindow *parent, + wxWindowID id, + const wxPoint& pos, + const wxSize& size, + long style, + const wxString& name) : + wxGrid(parent, id, pos, size, style, name), scrollbarsEnabled(true), m_grid1(0), m_grid2(0), m_grid3(0), gridDataTable(0), currentSortColumn(-1), - sortMarker(0) {} + sortMarker(0) +{} + CustomGrid::~CustomGrid() {} + bool CustomGrid::CreateGrid(int numRows, int numCols, wxGrid::wxGridSelectionModes selmode) { //use custom wxGridTableBase class for management of large sets of formatted data. @@ -255,6 +334,44 @@ void CustomGrid::SetScrollbar(int orientation, int position, int thumbSize, int } +//ensure that all grids are properly aligned: add some extra window space to grids that have no horizontal scrollbar +void CustomGrid::adjustGridHeights() //m_grid1, m_grid2, m_grid3 are not NULL in this context +{ + int y1 = 0; + int y2 = 0; + int y3 = 0; + int dummy = 0; + + m_grid1->GetViewStart(&dummy, &y1); + m_grid2->GetViewStart(&dummy, &y2); + m_grid3->GetViewStart(&dummy, &y3); + + if (y1 != y2 || y2 != y3) + { + int yMax = max(y1, max(y2, y3)); + + if (leadingPanel == 1) //do not handle case (y1 == yMax) here!!! Avoid back coupling! + m_grid1->SetMargins(0, 0); + else if (y1 < yMax) + m_grid1->SetMargins(0, 50); + + if (leadingPanel == 2) + m_grid2->SetMargins(0, 0); + else if (y2 < yMax) + m_grid2->SetMargins(0, 50); + + if (leadingPanel == 3) + m_grid3->SetMargins(0, 0); + else if (y3 < yMax) + m_grid3->SetMargins(0, 50); + + m_grid1->ForceRefresh(); + m_grid2->ForceRefresh(); + m_grid3->ForceRefresh(); + } +} + + //this method is called when grid view changes: useful for parallel updating of multiple grids void CustomGrid::DoPrepareDC(wxDC& dc) { @@ -266,24 +383,32 @@ void CustomGrid::DoPrepareDC(wxDC& dc) GetViewStart(&x, &y); m_grid2->Scroll(x, y); m_grid3->Scroll(-1, y); //scroll in y-direction only + adjustGridHeights(); //keep here to ensure m_grid1, m_grid2, m_grid3 != NULL } else if (leadingPanel == 2 && this == m_grid2) //avoid back coupling { GetViewStart(&x, &y); m_grid1->Scroll(x, y); m_grid3->Scroll(-1, y); + adjustGridHeights(); //keep here to ensure m_grid1, m_grid2, m_grid3 != NULL } else if (leadingPanel == 3 && this == m_grid3) //avoid back coupling { GetViewStart(&x, &y); m_grid1->Scroll(-1, y); m_grid2->Scroll(-1, y); + adjustGridHeights(); //keep here to ensure m_grid1, m_grid2, m_grid3 != NULL } } + //these classes will scroll together, hence the name ;) void CustomGrid::setScrollFriends(CustomGrid* grid1, CustomGrid* grid2, CustomGrid* grid3) { + assert(grid1); + assert(grid2); + assert(grid3); + m_grid1 = grid1; m_grid2 = grid2; m_grid3 = grid3; @@ -300,11 +425,11 @@ void CustomGrid::setScrollFriends(CustomGrid* grid1, CustomGrid* grid2, CustomGr } -void CustomGrid::setGridDataTable(UI_Grid* currentUI_ViewPtr) +void CustomGrid::setGridDataTable(GridView* gridRefUI, FileCompareResult* gridData) { //set underlying grid data assert(gridDataTable); - gridDataTable->setGridDataTable(currentUI_ViewPtr); + gridDataTable->setGridDataTable(gridRefUI, gridData); } @@ -322,7 +447,7 @@ void CustomGrid::setSortMarker(const int sortColumn, const wxBitmap* bitmap) } -void CustomGrid::DrawColLabel( wxDC& dc, int col ) +void CustomGrid::DrawColLabel(wxDC& dc, int col) { assert(0 <= col && col < 4); diff --git a/library/CustomGrid.h b/library/CustomGrid.h index 951aadc3..0679c6c7 100644 --- a/library/CustomGrid.h +++ b/library/CustomGrid.h @@ -1,27 +1,27 @@ #ifndef CUSTOMGRID_H_INCLUDED #define CUSTOMGRID_H_INCLUDED -#include "../ui/mainDialog.h" #include <vector> #include <wx/grid.h> +#include "../FreeFileSync.h" using namespace std; -extern int leadingPanel; - class CustomGridTableBase; //################################################################################## +extern int leadingPanel; + class CustomGrid : public wxGrid { public: - CustomGrid( wxWindow *parent, - wxWindowID id, - const wxPoint& pos = wxDefaultPosition, - const wxSize& size = wxDefaultSize, - long style = wxWANTS_CHARS, - const wxString& name = wxGridNameStr ); + CustomGrid(wxWindow *parent, + wxWindowID id, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxWANTS_CHARS, + const wxString& name = wxGridNameStr); ~CustomGrid(); @@ -37,7 +37,7 @@ public: void setScrollFriends(CustomGrid* grid1, CustomGrid* grid2, CustomGrid* grid3); - void setGridDataTable(UI_Grid* currentUI_ViewPtr); + void setGridDataTable(GridView* gridRefUI, FileCompareResult* gridData); void updateGridSizes(); @@ -47,6 +47,8 @@ public: void DrawColLabel( wxDC& dc, int col ); private: + void adjustGridHeights(); + bool scrollbarsEnabled; CustomGrid* m_grid1; diff --git a/FreeFileSync.ico b/library/FreeFileSync.ico Binary files differindex bceb6ee4..bceb6ee4 100644 --- a/FreeFileSync.ico +++ b/library/FreeFileSync.ico diff --git a/library/FreeFileSync.xpm b/library/FreeFileSync.xpm new file mode 100644 index 00000000..4165c5a1 --- /dev/null +++ b/library/FreeFileSync.xpm @@ -0,0 +1,425 @@ +/* XPM */ +static char * FreeFileSync_xpm[] = { +"32 32 390 2", +" c None", +". c #005927", +"+ c #046A38", +"@ c #1B7E4B", +"# c #318F5A", +"$ c #308F56", +"% c #258C4D", +"& c #128040", +"* c #036C36", +"= c #005A31", +"- c #005D28", +"; c #1F7D4E", +"> c #76B08F", +", c #ADD9B7", +"' c #B9EABB", +") c #A5E9A5", +"! c #8BE38A", +"~ c #6DDB6D", +"{ c #4DD04E", +"] c #2FC136", +"^ c #19A82F", +"/ c #078433", +"( c #005D33", +"_ c #036B35", +": c #6FAA8C", +"< c #D9EEDE", +"[ c #E0FDDD", +"} c #BDF3BB", +"| c #9BE89A", +"1 c #7DE07C", +"2 c #5FD85F", +"3 c #44D143", +"4 c #32D131", +"5 c #2AD929", +"6 c #25E422", +"7 c #1CE31C", +"8 c #0CB522", +"9 c #017235", +"0 c #0B6F3B", +"a c #9EC8B0", +"b c #EEFFEC", +"c c #CAF5C9", +"d c #A7EAA7", +"e c #8AE38A", +"f c #6EDB6E", +"g c #51D351", +"h c #39CF38", +"i c #2CD32B", +"j c #26DB26", +"k c #20E11F", +"l c #19E719", +"m c #13EF12", +"n c #0CFE08", +"o c #03DB0F", +"p c #007F31", +"q c #056B36", +"r c #98C7AA", +"s c #E3FEE0", +"t c #B8EEB7", +"u c #99E699", +"v c #7DDF7D", +"w c #60D760", +"x c #45D144", +"y c #33D530", +"z c #2ADA28", +"A c #23DC23", +"B c #1CE41C", +"C c #16F113", +"D c #0FF90C", +"E c #08FA07", +"F c #02FE02", +"G c #00FF00", +"H c #00E20A", +"I c #007434", +"J c #005E2F", +"K c #005E30", +"L c #005B2E", +"M c #005D2E", +"N c #6BAB87", +"O c #D5FAD2", +"P c #AAEAAA", +"Q c #8CE28C", +"R c #70DB70", +"S c #53D453", +"T c #3BD13A", +"U c #2DD42C", +"V c #1CB72C", +"W c #0D9830", +"X c #078931", +"Y c #068D2F", +"Z c #06A527", +"` c #04CF14", +" . c #00FC02", +".. c #00C914", +"+. c #1A8347", +"@. c #5ABA6B", +"#. c #4FBA60", +"$. c #36AA4A", +"%. c #299E42", +"&. c #8FDF92", +"*. c #81DE81", +"=. c #65D665", +"-. c #47D047", +";. c #33D232", +">. c #27CE2A", +",. c #0D8F30", +"'. c #005A2F", +"). c #005F33", +"!. c #008A2C", +"~. c #00D210", +"{. c #009629", +"]. c #369C56", +"^. c #81E87D", +"/. c #66DE63", +"(. c #50D94D", +"_. c #3BD538", +":. c #2CD52B", +"<. c #2DDD2D", +"[. c #34E034", +"}. c #2FDB2F", +"|. c #29D728", +"1. c #25D228", +"2. c #098033", +"3. c #00502E", +"4. c #006536", +"5. c #00A820", +"6. c #00F802", +"7. c #00D510", +"8. c #005D31", +"9. c #1D8945", +"0. c #60D860", +"a. c #4AD34A", +"b. c #36CF36", +"c. c #2BD42B", +"d. c #22DC22", +"e. c #19E419", +"f. c #0FED0F", +"g. c #08F608", +"h. c #05FE03", +"i. c #05E80B", +"j. c #009E21", +"k. c #006832", +"l. c #005734", +"m. c #009029", +"n. c #00EF05", +"o. c #00832D", +"p. c #057238", +"q. c #40C646", +"r. c #38D137", +"s. c #1BE41B", +"t. c #13ED13", +"u. c #0AF50A", +"v. c #02FD02", +"w. c #00DF0C", +"x. c #008730", +"y. c #004F30", +"z. c #00852C", +"A. c #00F105", +"B. c #00B41F", +"C. c #005E32", +"D. c #1DA434", +"E. c #2EDA2B", +"F. c #00A426", +"G. c #008C27", +"H. c #00B91B", +"I. c #098234", +"J. c #23DB23", +"K. c #1CE61B", +"L. c #00C019", +"M. c #006131", +"N. c #006233", +"O. c #006E2B", +"P. c #00622F", +"Q. c #006535", +"R. c #12BD23", +"S. c #14F511", +"T. c #00EE07", +"U. c #00A424", +"V. c #00612F", +"W. c #3A8D63", +"X. c #8ABBA3", +"Y. c #B3D1C2", +"Z. c #468F6D", +"`. c #005E2A", +" + c #038230", +".+ c #0AEF0C", +"++ c #03FF02", +"@+ c #00F703", +"#+ c #007931", +"$+ c #006230", +"%+ c #509A75", +"&+ c #BBD6C9", +"*+ c #FEFEFF", +"=+ c #FFFFFF", +"-+ c #E6F2EB", +";+ c #1F7C4D", +">+ c #005D35", +",+ c #009624", +"'+ c #00FC01", +")+ c #00ED07", +"!+ c #00BC1A", +"~+ c #00812F", +"{+ c #004E2E", +"]+ c #378C60", +"^+ c #B5D5C3", +"/+ c #FAFFFA", +"(+ c #FBFFF9", +"_+ c #ECFCEB", +":+ c #E1F8E1", +"<+ c #D8F6D8", +"[+ c #DBFCD8", +"}+ c #7BBE8F", +"|+ c #009022", +"1+ c #009823", +"2+ c #007030", +"3+ c #00492B", +"4+ c #046734", +"5+ c #65AE81", +"6+ c #D0F3D1", +"7+ c #D8FBD6", +"8+ c #C3F2C3", +"9+ c #B7EEB7", +"0+ c #AEECAE", +"a+ c #A5EAA5", +"b+ c #9CE79C", +"c+ c #94E694", +"d+ c #89E189", +"e+ c #198446", +"f+ c #31895D", +"g+ c #116C44", +"h+ c #00502A", +"i+ c #036230", +"j+ c #62B878", +"k+ c #AEF1AC", +"l+ c #9DE99C", +"m+ c #8FE38F", +"n+ c #86E186", +"o+ c #7CDE7C", +"p+ c #73DC73", +"q+ c #6AD96A", +"r+ c #61D761", +"s+ c #57D457", +"t+ c #53D951", +"u+ c #2CA941", +"v+ c #005F31", +"w+ c #549F7A", +"x+ c #B0D0C1", +"y+ c #0B6A38", +"z+ c #0D773D", +"A+ c #6EDB6F", +"B+ c #6BDF67", +"C+ c #5DD65D", +"D+ c #55D355", +"E+ c #4BD24B", +"F+ c #43D143", +"G+ c #3BD13B", +"H+ c #34D234", +"I+ c #2DD42D", +"J+ c #27D827", +"K+ c #22DF21", +"L+ c #1BDB1E", +"M+ c #027A34", +"N+ c #167646", +"O+ c #EDFBEE", +"P+ c #9FCDAF", +"Q+ c #0A6E39", +"R+ c #168C3B", +"S+ c #2BC034", +"T+ c #28D828", +"U+ c #21DD21", +"V+ c #1EE01E", +"W+ c #1AE41A", +"X+ c #15E915", +"Y+ c #10EE10", +"Z+ c #0CF30C", +"`+ c #08F808", +" @ c #05FB04", +".@ c #03FE02", +"+@ c #01A323", +"@@ c #00592A", +"#@ c #88C79A", +"$@ c #DBFFD5", +"%@ c #88CB97", +"&@ c #157942", +"*@ c #006732", +"=@ c #1FB431", +"-@ c #24EC22", +";@ c #0CF40C", +">@ c #00C515", +",@ c #005A33", +"'@ c #309358", +")@ c #A4ECA3", +"!@ c #A3EDA0", +"~@ c #7DD584", +"{@ c #288E4B", +"]@ c #006232", +"^@ c #0F8535", +"/@ c #36C739", +"(@ c #35D334", +"_@ c #29D729", +":@ c #0FF10F", +"<@ c #05FB05", +"[@ c #01FE01", +"}@ c #00FE00", +"|@ c #00CB13", +"1@ c #006135", +"2@ c #016432", +"3@ c #5ABF68", +"4@ c #7AE377", +"5@ c #71DF6F", +"6@ c #66DB65", +"7@ c #39B04A", +"8@ c #11823A", +"9@ c #026633", +"0@ c #00522D", +"a@ c #036E34", +"b@ c #129E2E", +"c@ c #25D826", +"d@ c #22E221", +"e@ c #1DE41D", +"f@ c #19E919", +"g@ c #15ED15", +"h@ c #11F210", +"i@ c #039626", +"j@ c #008F2A", +"k@ c #00A323", +"l@ c #00A522", +"m@ c #008530", +"n@ c #00532D", +"o@ c #0F7F3D", +"p@ c #4BCE4E", +"q@ c #49D547", +"r@ c #41D040", +"s@ c #3ED63B", +"t@ c #33D133", +"u@ c #23BF2E", +"v@ c #17AF2C", +"w@ c #12AE2B", +"x@ c #11B826", +"y@ c #17D71E", +"z@ c #18EF15", +"A@ c #12F211", +"B@ c #05FC05", +"C@ c #00B919", +"D@ c #005C35", +"E@ c #0F8C35", +"F@ c #2AD52A", +"G@ c #27DE25", +"H@ c #21DE22", +"I@ c #1EE41D", +"J@ c #1BEC19", +"K@ c #17F314", +"L@ c #12F90F", +"M@ c #0DFD0A", +"N@ c #08FD06", +"O@ c #03FD03", +"P@ c #00CB12", +"Q@ c #006C37", +"R@ c #00562F", +"S@ c #07912F", +"T@ c #12E316", +"U@ c #0DFC0A", +"V@ c #09FA09", +"W@ c #01FF01", +"X@ c #00BE18", +"Y@ c #006D37", +"Z@ c #008030", +"`@ c #00C814", +" # c #00FA02", +".# c #00DD0C", +"+# c #009827", +"@# c #006437", +"## c #00852E", +"$# c #00B11E", +"%# c #00D111", +"&# c #00E40A", +"*# c #00EF06", +"=# c #00E908", +"-# c #00D80E", +";# c #00BD18", +"># c #009528", +",# c #006D35", +"'# c #004F2E", +")# c #00492C", +"!# c #006032", +"~# c #006A32", +"{# c #006D31", +"]# c #006B31", +"^# c #006533", +"/# c #005631", +" ", +" ", +" . + @ # $ % & * = ", +" - ; > , ' ) ! ~ { ] ^ / ( ", +" _ : < [ } | 1 2 3 4 5 6 7 8 9 ", +" 0 a b c d e f g h i j k l m n o p ", +" q r s t u v w x y z A B C D E F G H I ", +" J K L M N O P Q R S T U V W X Y Z ` .G G G ..( ", +" +.@.#.$.%.&.| *.=.-.;.>.,.'. ).!.~.G G G {. ", +" ].^./.(._.:.<.[.}.|.1.2.3. 4.5.6.G 7.8. ", +" 9.0.a.b.c.d.e.f.g.h.i.j.k. l.m.n.G o. ", +" p.q.r.c.A s.t.u.v.G G G w.x. y.z.A.B. ", +" C.D.E.A s.t.u.v.G G G G G F. G.H. ", +" I.J.K.t.u.v.G G G G G L.M. N.O.P. ", +" Q.R.S.u.v.G G G G T.U.= V.W.X.Y.Z.`. ", +" +.+++G G G @+L.#+ $+%+&+*+=+=+-+;+ ", +" >+,+'+G )+!+~+{+ ]+^+/+(+_+:+<+[+}+V. ", +" N.|+1+2+3+ 4+5+6+7+8+9+0+a+b+c+d+e+ ", +" f+g+h+ i+j+k+l+m+n+o+p+q+r+s+t+u+v+ ", +" w+x+y+ z+A+B+C+D+E+F+G+H+I+J+K+L+M+ ", +" N+O+P+Q+ L R+S+T+U+V+W+X+Y+Z+`+ @.@+@ ", +" @@#@$@%@&@ *@=@-@;@v.G G G G G G >@,@ ", +" '@)@!@~@{@]@ ^@/@(@_@s.:@<@[@}@G G |@1@ ", +" 2@3@4@5@6@7@8@9@0@ a@b@c@d@e@f@g@h@u.i@j@k@l@m@n@ ", +" o@p@q@r@s@t@u@v@w@x@y@z@A@;@`+B@F G C@D@ ", +" E@F@G@H@I@J@K@L@M@N@O@[@G G G G P@Q@ ", +" R@S@T@U@V@B@v.W@G G G G G G G X@Y@ ", +" Z@`@ #G G G G G G G G .#+#@# ", +" ( ##$#%#&#*#=#-#;#>#,#'# ", +" )#!#~#{#]#^#/# ", +" ", +" "}; diff --git a/library/globalFunctions.cpp b/library/globalFunctions.cpp index db7211ef..d91fa8b1 100644 --- a/library/globalFunctions.cpp +++ b/library/globalFunctions.cpp @@ -1,5 +1,5 @@ #include "globalFunctions.h" -#include "../ui/resources.h" +#include "resources.h" inline int globalFunctions::round(const double d) @@ -89,6 +89,6 @@ double globalFunctions::wxStringToDouble(const wxString& number) wxString& globalFunctions::includeNumberSeparator(wxString& number) { for (int i = number.size() - 3; i > 0; i-= 3) - number.insert(i, GlobalResources::numberSeparator); + number.insert(i, GlobalResources::thousandsSeparator); return number; } diff --git a/library/misc.cpp b/library/misc.cpp new file mode 100644 index 00000000..2a5c0ec2 --- /dev/null +++ b/library/misc.cpp @@ -0,0 +1,138 @@ +#include "misc.h" +#include <fstream> +#include <wx/msgdlg.h> +#include "resources.h" + +wxString exchangeEscapeChars(char* temp) +{ + wxString output(temp); + output.Replace("\\\\", "\\"); + output.Replace("\\n", "\n"); + output.Replace("\\t", "\t"); + output.Replace("\"\"", """"); + output.Replace("\\\"", "\""); + return output; +} + + +CustomLocale::CustomLocale() : + wxLocale(), + currentLanguage(wxLANGUAGE_ENGLISH) +{} + + +CustomLocale::~CustomLocale() +{ + //write language to file + ofstream output("lang.dat"); + if (!output) + { + wxMessageBox(wxString(_("Could not write to ")) + "\"" + "lang.dat" + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + return; + } + output<<currentLanguage<<char(0); + output.close(); +} + + +void CustomLocale::loadLanguageFromCfg() //retrieve language from config file: do NOT put into constructor since working directory has not been set! +{ + int language = wxLANGUAGE_ENGLISH; + + //try to load language setting from file + ifstream input("lang.dat"); + if (input) + { + char buffer[20]; + input.getline(buffer, 20, char(0)); + language = atoi(buffer); + input.close(); + } + else + language = wxLocale::GetSystemLanguage(); + + wxLocale::Init(language, wxLOCALE_LOAD_DEFAULT | wxLOCALE_CONV_ENCODING); + + loadLanguageFile(language); +} + + +void CustomLocale::loadLanguageFile(int language) +{ + currentLanguage = language; + + wxString languageFile; + switch (language) + { + case wxLANGUAGE_GERMAN: + languageFile = "german.lng"; + break; + + default: + languageFile = ""; + currentLanguage = wxLANGUAGE_ENGLISH; + } + + //load language file into buffer + translationDB.clear(); + char temp[100000]; + if (!languageFile.IsEmpty()) + { + ifstream langFile(languageFile.c_str()); + if (langFile) + { + int rowNumber = 0; + TranslationLine currentLine; + + //Delimiter: + //---------- + //Linux: 0xa + //Mac: 0xd + //Win: 0xd 0xa +#ifdef FFS_WIN + while (langFile.getline(temp, 100000)) + { +#elif defined FFS_LINUX + while (langFile.getline(temp, 100000, 0xd)) //specify delimiter explicitely + { + //strangely this approach does NOT work under windows :( + langFile.get(); //delimiter 0xd is completely ignored (and also not extracted) +#else + assert (false); +#endif + if (rowNumber%2 == 0) + currentLine.original = exchangeEscapeChars(temp); + else + { + currentLine.translation = exchangeEscapeChars(temp); + translationDB.insert(currentLine); + } + ++rowNumber; + } + langFile.close(); + } + else + wxMessageBox(wxString(_("Could not read language file ")) + "\"" + languageFile + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + } + else + ; //if languageFile is empty language is defaulted to english + + //these global variables need to be redetermined on language selection + GlobalResources::decimalPoint = _("."); + GlobalResources::thousandsSeparator = _(","); +} + + +const wxChar* CustomLocale::GetString(const wxChar* szOrigString, const wxChar* szDomain) const +{ + TranslationLine currentLine; + currentLine.original = szOrigString; + + //look for translation in buffer table + Translation::iterator i; + if ((i = translationDB.find(currentLine)) != translationDB.end()) + return (i->translation.c_str()); + //fallback + return (szOrigString); +} + diff --git a/library/misc.h b/library/misc.h new file mode 100644 index 00000000..a8db4088 --- /dev/null +++ b/library/misc.h @@ -0,0 +1,52 @@ +#ifndef MISC_H_INCLUDED +#define MISC_H_INCLUDED + +#include <wx/string.h> +#include <set> +#include <wx/intl.h> + +using namespace std; + +struct TranslationLine +{ + wxString original; + wxString translation; + + bool operator>(const TranslationLine& b ) const + { + return (original > b.original); + } + bool operator<(const TranslationLine& b) const + { + return (original < b.original); + } + bool operator==(const TranslationLine& b) const + { + return (original == b.original); + } +}; +typedef set<TranslationLine> Translation; + + +class CustomLocale : public wxLocale +{ +public: + CustomLocale(); + + ~CustomLocale(); + + void loadLanguageFromCfg(); + void loadLanguageFile(int language); + int getLanguage() + { + return currentLanguage; + } + + const wxChar* GetString(const wxChar* szOrigString, const wxChar* szDomain = NULL) const; + +private: + Translation translationDB; + int currentLanguage; +}; + +#endif // MISC_H_INCLUDED diff --git a/library/multithreading.cpp b/library/multithreading.cpp index c5f38605..099836de 100644 --- a/library/multithreading.cpp +++ b/library/multithreading.cpp @@ -34,6 +34,8 @@ */ class WorkerThread : public wxThread { + friend class UpdateWhileExecuting; + public: WorkerThread(UpdateWhileExecuting* handler) : readyToBeginProcessing(), @@ -43,8 +45,10 @@ public: threadHandler(handler) { } + ~WorkerThread() {} + ExitCode Entry() { readyToBeginProcessing.Lock(); //this lock needs to be called IN the thread => calling it from constructor(Main thread) would be useless @@ -71,7 +75,7 @@ public: return 0; } - +private: wxMutex readyToBeginProcessing; wxCondition beginProcessing; @@ -80,8 +84,6 @@ public: bool threadIsInitialized; bool threadExitIsRequested; - -private: UpdateWhileExecuting* threadHandler; }; diff --git a/library/multithreading.h b/library/multithreading.h index b8481a0f..36b37f2a 100644 --- a/library/multithreading.h +++ b/library/multithreading.h @@ -47,6 +47,7 @@ class UpdateWhileExecuting public: UpdateWhileExecuting(); + virtual ~UpdateWhileExecuting(); void waitUntilReady(); diff --git a/ui/Resources.cpp b/library/resources.cpp index 207ff7c1..73e11575 100644 --- a/ui/Resources.cpp +++ b/library/resources.cpp @@ -2,25 +2,42 @@ #include <wx/wfstream.h> #include <wx/zipstrm.h> #include <wx/image.h> +#include <wx/icon.h> #include <stdexcept> //for std::runtime_error #ifdef FFS_WIN wxChar GlobalResources::fileNameSeparator = '\\'; -#endif // FFS_WIN - -#ifdef FFS_LINUX +#elif defined FFS_LINUX wxChar GlobalResources::fileNameSeparator = '/'; -#endif // FFS_LINUX +#else +assert(false); +#endif + +//these two global variables are language-dependent => cannot be set statically! See CustomLocale +const wxChar* GlobalResources::decimalPoint = ""; +const wxChar* GlobalResources::thousandsSeparator = ""; + -const wxChar* GlobalResources::floatingPointSeparator = ""; -const wxChar* GlobalResources::numberSeparator = ""; +//command line parameters +const wxChar* GlobalResources::paramCompare = "cmp"; +const wxChar* GlobalResources::paramCfg = "cfg"; +const wxChar* GlobalResources::paramInclude = "incl"; +const wxChar* GlobalResources::paramExclude = "excl"; +const wxChar* GlobalResources::paramContinueError = "continue"; +const wxChar* GlobalResources::paramRecycler = "recycler"; +const wxChar* GlobalResources::paramSilent = "silent"; + +const wxChar* GlobalResources::valueSizeDate = "SIZEDATE"; +const wxChar* GlobalResources::valueContent = "CONTENT"; map<wxString, wxBitmap*> GlobalResources::bitmapResource; wxBitmap* GlobalResources::bitmapLeftArrow = 0; -wxBitmap* GlobalResources::bitmapStartSync = 0; wxBitmap* GlobalResources::bitmapRightArrow = 0; +wxBitmap* GlobalResources::bitmapNoArrow = 0; +wxBitmap* GlobalResources::bitmapStartSync = 0; +wxBitmap* GlobalResources::bitmapStartSyncDis = 0; wxBitmap* GlobalResources::bitmapDelete = 0; wxBitmap* GlobalResources::bitmapEmail = 0; wxBitmap* GlobalResources::bitmapAbout = 0; @@ -63,21 +80,21 @@ wxBitmap* GlobalResources::bitmapStatusComparing = 0; wxBitmap* GlobalResources::bitmapStatusSyncing = 0; wxBitmap* GlobalResources::bitmapLogo = 0; wxBitmap* GlobalResources::bitmapFinished = 0; +wxBitmap* GlobalResources::bitmapStatusEdge = 0; wxAnimation* GlobalResources::animationMoney = 0; wxAnimation* GlobalResources::animationSync = 0; +wxIcon* GlobalResources::programIcon = 0; void GlobalResources::loadResourceFiles() { - floatingPointSeparator = _("."); - numberSeparator = _(","); - - //map, allocate and initialize pictures bitmapResource["left arrow.png"] = (bitmapLeftArrow = new wxBitmap(wxNullBitmap)); - bitmapResource["start sync.png"] = (bitmapStartSync = new wxBitmap(wxNullBitmap)); bitmapResource["right arrow.png"] = (bitmapRightArrow = new wxBitmap(wxNullBitmap)); + bitmapResource["no arrow.png"] = (bitmapNoArrow = new wxBitmap(wxNullBitmap)); + bitmapResource["start sync.png"] = (bitmapStartSync = new wxBitmap(wxNullBitmap)); + bitmapResource["start sync dis.png"] = (bitmapStartSyncDis = new wxBitmap(wxNullBitmap)); bitmapResource["delete.png"] = (bitmapDelete = new wxBitmap(wxNullBitmap)); bitmapResource["email.png"] = (bitmapEmail = new wxBitmap(wxNullBitmap)); bitmapResource["about.png"] = (bitmapAbout = new wxBitmap(wxNullBitmap)); @@ -120,9 +137,7 @@ void GlobalResources::loadResourceFiles() bitmapResource["statusSyncing.png"] = (bitmapStatusSyncing = new wxBitmap(wxNullBitmap)); bitmapResource["logo.png"] = (bitmapLogo = new wxBitmap(wxNullBitmap)); bitmapResource["finished.png"] = (bitmapFinished = new wxBitmap(wxNullBitmap)); - - animationMoney = new wxAnimation(wxNullAnimation); - animationSync = new wxAnimation(wxNullAnimation); + bitmapResource["statusEdge.png"] = (bitmapStatusEdge = new wxBitmap(wxNullBitmap)); wxFileInputStream input("Resources.dat"); if (!input.IsOk()) throw runtime_error(_("Unable to load Resources.dat!")); @@ -131,7 +146,7 @@ void GlobalResources::loadResourceFiles() wxZipEntry* entry; map<wxString, wxBitmap*>::iterator bmp; - while (entry = resourceFile.GetNextEntry()) + while ((entry = resourceFile.GetNextEntry())) { wxString name = entry->GetName(); @@ -140,8 +155,19 @@ void GlobalResources::loadResourceFiles() *(bmp->second) = wxBitmap(wxImage(resourceFile, wxBITMAP_TYPE_PNG)); } + //load all the other resource files + animationMoney = new wxAnimation(wxNullAnimation); + animationSync = new wxAnimation(wxNullAnimation); + animationMoney->LoadFile("Resources.a01"); animationSync->LoadFile("Resources.a02"); + +#ifdef FFS_WIN + programIcon = new wxIcon("winIcon"); +#else +#include "FreeFileSync.xpm" + programIcon = new wxIcon(FreeFileSync_xpm); +#endif } @@ -154,4 +180,5 @@ void GlobalResources::unloadResourceFiles() //free other resources delete animationMoney; delete animationSync; + delete programIcon; } diff --git a/ui/Resources.h b/library/resources.h index bfd2a8bc..de70198f 100644 --- a/ui/Resources.h +++ b/library/resources.h @@ -14,15 +14,30 @@ public: static void loadResourceFiles(); static void unloadResourceFiles(); - //language dependent global variables: need to be initialized by CustomLocale on program startup static wxChar fileNameSeparator; - static const wxChar* floatingPointSeparator; - static const wxChar* numberSeparator; + + //language dependent global variables: need to be initialized by CustomLocale on program startup and language switch + static const wxChar* decimalPoint; + static const wxChar* thousandsSeparator; + + //command line parameters + static const wxChar* paramCompare; + static const wxChar* paramCfg; + static const wxChar* paramInclude; + static const wxChar* paramExclude; + static const wxChar* paramContinueError; + static const wxChar* paramRecycler; + static const wxChar* paramSilent; + + static const wxChar* valueSizeDate; + static const wxChar* valueContent; //image resource objects static wxBitmap* bitmapLeftArrow; - static wxBitmap* bitmapStartSync; static wxBitmap* bitmapRightArrow; + static wxBitmap* bitmapNoArrow; + static wxBitmap* bitmapStartSync; + static wxBitmap* bitmapStartSyncDis; static wxBitmap* bitmapDelete; static wxBitmap* bitmapEmail; static wxBitmap* bitmapAbout; @@ -65,10 +80,13 @@ public: static wxBitmap* bitmapStatusSyncing; static wxBitmap* bitmapLogo; static wxBitmap* bitmapFinished; + static wxBitmap* bitmapStatusEdge; static wxAnimation* animationMoney; static wxAnimation* animationSync; + static wxIcon* programIcon; + private: //resource mapping static map<wxString, wxBitmap*> bitmapResource; diff --git a/resource.rc b/resource.rc index bdfb28d9..575f739b 100644 --- a/resource.rc +++ b/resource.rc @@ -1,2 +1,2 @@ #include "wx/msw/wx.rc" -aaaa ICON DISCARDABLE "FreeFileSync.ico" +winIcon ICON DISCARDABLE "library/FreeFileSync.ico" diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp index ec83f302..1c31fa2a 100644 --- a/ui/MainDialog.cpp +++ b/ui/MainDialog.cpp @@ -12,23 +12,24 @@ #include "../library/globalFunctions.h" #include <fstream> #include <wx/clipbrd.h> +#include <wx/file.h> #include "../library/customGrid.h" using namespace globalFunctions; int leadingPanel = 0; -MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : +MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale* language) : GuiGenerated(frame), - parent(frame), - stackObjects(0), + programLanguage(language), filteringInitialized(false), filteringPending(false), + synchronizationEnabled(false), + restartOnExit(false), cmpStatusUpdaterTmp(0) { m_bpButtonCompare->SetLabel(_("&Compare")); m_bpButtonSync->SetLabel(_("&Synchronize")); - m_bpButtonFilter->SetLabel(_("&Filter")); //initialize sync configuration readConfigurationFromHD(cfgFileName, true); @@ -46,10 +47,10 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : m_bpButton10->SetBitmapLabel(*GlobalResources::bitmapExit); m_bpButtonCompare->SetBitmapLabel(*GlobalResources::bitmapCompare); m_bpButtonSync->SetBitmapLabel(*GlobalResources::bitmapSync); - m_bpButtonSync->SetBitmapDisabled(*GlobalResources::bitmapSyncDisabled); m_bpButtonSwap->SetBitmapLabel(*GlobalResources::bitmapSwap); m_bpButton14->SetBitmapLabel(*GlobalResources::bitmapHelp); m_bpButton201->SetBitmapLabel(*GlobalResources::bitmapSave); + m_bitmap15->SetBitmap(*GlobalResources::bitmapStatusEdge); //prepare drag & drop m_panel1->SetDropTarget(new FileDropEvent(this, 1)); @@ -126,12 +127,12 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : m_grid3->setScrollFriends(m_grid1, m_grid2, m_grid3); //share UI grid data with grids - m_grid1->setGridDataTable(¤tUI_View); - m_grid2->setGridDataTable(¤tUI_View); - m_grid3->setGridDataTable(¤tUI_View); + m_grid1->setGridDataTable(&gridRefUI, ¤tGridData); + m_grid2->setGridDataTable(&gridRefUI, ¤tGridData); + m_grid3->setGridDataTable(&gridRefUI, ¤tGridData); //disable sync button as long as "compare" hasn't been triggered. - m_bpButtonSync->Disable(); + enableSynchronization(false); //make filesize right justified on grids wxGridCellAttr* cellAttributes = m_grid1->GetOrCreateCellAttr(0, 2); @@ -170,14 +171,30 @@ MainDialog::MainDialog(wxFrame* frame, const wxString& cfgFileName) : m_grid1->SetSelectionBackground(darkBlue); m_grid2->SetSelectionBackground(darkBlue); m_grid3->SetSelectionBackground(darkBlue); + m_grid1->SetSelectionForeground(*wxWHITE); + m_grid2->SetSelectionForeground(*wxWHITE); + m_grid3->SetSelectionForeground(*wxWHITE); + + enableSynchronization(false); + + //initialize language selection + switch (programLanguage->getLanguage()) + { + case wxLANGUAGE_GERMAN: + m_menuItemGerman->Check(); + break; + + default: + m_menuItemEnglish->Check(); + } } MainDialog::~MainDialog() { - m_grid1->setGridDataTable(0); - m_grid2->setGridDataTable(0); - m_grid3->setGridDataTable(0); + m_grid1->setGridDataTable(0, 0); + m_grid2->setGridDataTable(0, 0); + m_grid3->setGridDataTable(0, 0); m_grid1->setSortMarker(-1); m_grid2->setSortMarker(-1); @@ -243,6 +260,13 @@ MainDialog::~MainDialog() delete cfgFileHistory; writeConfigurationToHD(FreeFileSync::FFS_LastConfigFile); //don't trow exceptions in destructors + + if (restartOnExit) + { //create new dialog + MainDialog* frame = new MainDialog(0L, FreeFileSync::FFS_LastConfigFile, programLanguage); + frame->SetIcon(*GlobalResources::programIcon); //set application icon + frame->Show(); + } } @@ -284,32 +308,46 @@ void MainDialog::onGrid3access(wxEvent& event) } +void MainDialog::enableSynchronization(bool value) +{ + if (value) + { + synchronizationEnabled = true; + m_bpButtonSync->SetBitmapLabel(*GlobalResources::bitmapSync); + } + else + { + synchronizationEnabled = false; + m_bpButtonSync->SetBitmapLabel(*GlobalResources::bitmapSyncDisabled); + } +} + + void MainDialog::filterRangeManual(const set<int>& rowsToFilterOnUI_View) { if (rowsToFilterOnUI_View.size() > 0) { - int currentUI_Size = currentUI_View.size(); + int gridSizeUI = gridRefUI.size(); bool newSelection = false; //default: deselect range //leadingRow determines de-/selection of all other rows int leadingRow = *rowsToFilterOnUI_View.begin(); - if (0 <= leadingRow && leadingRow < currentUI_Size) - newSelection = !currentGridData[currentUI_View[leadingRow].linkToCurrentGridData].selectedForSynchronization; + if (0 <= leadingRow && leadingRow < gridSizeUI) + newSelection = !currentGridData[gridRefUI[leadingRow]].selectedForSynchronization; - if (hideFiltered) + if (cfg.hideFiltered) assert (!newSelection); //if hidefiltered is active, there should be no filtered elements on screen => current element was filtered out //get all lines that need to be filtered (e.g. if a folder is marked, then its subelements should be marked as well) set<int> rowsToFilterOnGridData; //rows to filter in backend - for (set<int>::iterator i = rowsToFilterOnUI_View.begin(); i != rowsToFilterOnUI_View.end(); ++i) { - if (0 <= *i && *i < currentUI_Size) + if (0 <= *i && *i < gridSizeUI) { - unsigned int gridIndex = currentUI_View[*i].linkToCurrentGridData; + unsigned int gridIndex = gridRefUI[*i]; rowsToFilterOnGridData.insert(gridIndex); FreeFileSync::addSubElements(rowsToFilterOnGridData, currentGridData, currentGridData[gridIndex]); @@ -320,41 +358,42 @@ void MainDialog::filterRangeManual(const set<int>& rowsToFilterOnUI_View) for (set<int>::iterator i = rowsToFilterOnGridData.begin(); i != rowsToFilterOnGridData.end(); ++i) currentGridData[*i].selectedForSynchronization = newSelection; - - set<int> filteredOutRowsOnUI; //determine rows that are currently filtered out on current UI view - - //update currentUI_View - for (UI_Grid::iterator i = currentUI_View.begin(); i != currentUI_View.end(); ++i) - { - const FileCompareLine& gridLine = currentGridData[i->linkToCurrentGridData]; - - i->cmpResult = evaluateCmpResult(gridLine.cmpResult, gridLine.selectedForSynchronization); - - if (!gridLine.selectedForSynchronization) - filteredOutRowsOnUI.insert(i - currentUI_View.begin()); - } - //signal UI that grids need to be refreshed on next Update() m_grid1->ForceRefresh(); m_grid2->ForceRefresh(); m_grid3->ForceRefresh(); - if (hideFiltered) + if (cfg.hideFiltered) { - //some delay to show user the rows he has filtered out before they are removed Update(); //show changes resulting from ForceRefresh() - wxMilliSleep(400); + + wxLongLong waitBegin = wxGetLocalTimeMillis(); + + //determine rows that are currently filtered out on current UI view (and need to be removed) + set<int> filteredOutRowsOnUI; + for (GridView::iterator i = gridRefUI.begin(); i != gridRefUI.end(); ++i) + { + const FileCompareLine& gridLine = currentGridData[*i]; + + if (!gridLine.selectedForSynchronization) + filteredOutRowsOnUI.insert(i - gridRefUI.begin()); + } + + //some delay to show user the rows he has filtered out before they are removed + unsigned long waitRemaining = max(400 - (wxGetLocalTimeMillis() - waitBegin).GetLo(), unsigned(0)); + wxMilliSleep(waitRemaining); //400 ms delay before rows are removed from UI //delete rows, that are filtered out: - removeRowsFromVector(currentUI_View, filteredOutRowsOnUI); + removeRowsFromVector(gridRefUI, filteredOutRowsOnUI); //redraw grid necessary to update new dimensions - writeGrid(currentGridData, true); //use UI buffer, no mapping from currentGridData to UI model again, just a re-dimensioning of grids - updateStatusInformation(currentUI_View); //status information has to be recalculated! + writeGrid(currentGridData, true); //use UI buffer, just a re-dimensioning of grids + updateStatusInformation(gridRefUI); //status information has to be recalculated! } } + //clear selection on grids - if (hideFiltered) + if (cfg.hideFiltered) { m_grid1->ClearSelection(); m_grid2->ClearSelection(); @@ -410,15 +449,16 @@ void MainDialog::OnIdleEvent(wxEvent& event) //------------------------------------------------------------------------------ //small routine to restore status information after some time - if (stackObjects > 0 ) //check if there is some work to do + if (stackObjects.size() > 0 ) //check if there is some work to do { wxLongLong currentTime = wxGetLocalTimeMillis(); - if (currentTime - lastStatusChange > 3000) //restore stackObject after three seconds + if (currentTime - lastStatusChange > 2000) //restore stackObject after two seconds { lastStatusChange = currentTime; - stackObjects--; - m_statusBar1->PopStatusText(1); + m_staticTextStatusMiddle->SetLabel(stackObjects.top()); + stackObjects.pop(); + m_panel7->Layout(); } } @@ -548,7 +588,7 @@ set<int> MainDialog::getSelectedRows() } } - removeInvalidRows(output, currentUI_View.size()); + removeInvalidRows(output, gridRefUI.size()); return output; } @@ -557,12 +597,12 @@ set<int> MainDialog::getSelectedRows() class DeleteStatusUpdater : public StatusUpdater { public: - DeleteStatusUpdater(bool& unsolvedErrorOccured) : suppressUI_Errormessages(false), unsolvedErrors(unsolvedErrorOccured) {} + DeleteStatusUpdater(bool& unsolvedErrorOccured) : continueOnError(false), unsolvedErrors(unsolvedErrorOccured) {} ~DeleteStatusUpdater() {} int reportError(const wxString& text) { - if (suppressUI_Errormessages) + if (continueOnError) { unsolvedErrors = true; return StatusUpdater::continueNext; @@ -570,7 +610,7 @@ public: wxString errorMessage = text + _("\n\nInformation: If you skip the error and continue or abort a re-compare will be necessary!"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, suppressUI_Errormessages); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueOnError); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -599,7 +639,7 @@ public: void triggerUI_Refresh() {} private: - bool suppressUI_Errormessages; + bool continueOnError; bool& unsolvedErrors; }; @@ -608,15 +648,15 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) { if (rowsToDeleteOnUI.size()) { - //map grid lines from UI to grid lines in backend + //map grid lines from UI to grid lines in backend (gridData) set<int> rowsToDeleteOnGrid; for (set<int>::iterator i = rowsToDeleteOnUI.begin(); i != rowsToDeleteOnUI.end(); ++i) - rowsToDeleteOnGrid.insert(currentUI_View[*i].linkToCurrentGridData); + rowsToDeleteOnGrid.insert(gridRefUI[*i]); wxString headerText; wxString filesToDelete; - if (useRecycleBin) + if (cfg.useRecycleBin) headerText = _("Do you really want to move the following objects(s) to the recycle bin?"); else headerText = _("Do you really want to delete the following objects(s)?"); @@ -634,7 +674,7 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) filesToDelete+= "\n"; } - DeleteDialog* confirmDeletion = new DeleteDialog(headerText, filesToDelete, this); //no destruction needed; attached to main window + DeleteDialog* confirmDeletion = new DeleteDialog(headerText, filesToDelete, this); //no destruction needed; attached to main window switch (confirmDeletion->ShowModal()) { @@ -646,7 +686,7 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) { //class errors when deleting files/folders DeleteStatusUpdater deleteStatusUpdater(unsolvedErrorOccured); - FreeFileSync::deleteOnGridAndHD(currentGridData, rowsToDeleteOnGrid, &deleteStatusUpdater, useRecycleBin); + FreeFileSync::deleteOnGridAndHD(currentGridData, rowsToDeleteOnGrid, &deleteStatusUpdater, cfg.useRecycleBin); } catch (AbortThisProcess& theException) {} @@ -654,11 +694,11 @@ void MainDialog::deleteFilesOnGrid(const set<int>& rowsToDeleteOnUI) //disable the sync button if errors occured during deletion if (unsolvedErrorOccured) - m_bpButtonSync->Disable(); + enableSynchronization(false); //redraw grid neccessary to update new dimensions and for UI-Backend data linkage - writeGrid(currentGridData); //do NOT use UI buffer here + writeGrid(currentGridData); //do NOT use UI buffer here m_grid1->ClearSelection(); //clear selection on grid m_grid2->ClearSelection(); //clear selection on grid @@ -682,9 +722,9 @@ void MainDialog::openWithFileBrowser(int rowNumber, int gridNr) { wxString command = "explorer " + FreeFileSync::getFormattedDirectoryName(m_directoryPanel1->GetValue()); //default - if (0 <= rowNumber && rowNumber < int(currentUI_View.size())) + if (0 <= rowNumber && rowNumber < int(gridRefUI.size())) { - wxString filename = currentGridData[currentUI_View[rowNumber].linkToCurrentGridData].fileDescrLeft.filename; + wxString filename = currentGridData[gridRefUI[rowNumber]].fileDescrLeft.filename; if (!filename.IsEmpty()) command = "explorer /select," + filename; @@ -695,9 +735,9 @@ void MainDialog::openWithFileBrowser(int rowNumber, int gridNr) { wxString command = "explorer " + FreeFileSync::getFormattedDirectoryName(m_directoryPanel2->GetValue()); //default - if (0 <= rowNumber && rowNumber < int(currentUI_View.size())) + if (0 <= rowNumber && rowNumber < int(gridRefUI.size())) { - wxString filename = currentGridData[currentUI_View[rowNumber].linkToCurrentGridData].fileDescrRight.filename; + wxString filename = currentGridData[gridRefUI[rowNumber]].fileDescrRight.filename; if (!filename.IsEmpty()) command = "explorer /select," + filename; @@ -711,15 +751,22 @@ void MainDialog::openWithFileBrowser(int rowNumber, int gridNr) void MainDialog::pushStatusInformation(const wxString& text) { lastStatusChange = wxGetLocalTimeMillis(); - ++stackObjects; - m_statusBar1->PushStatusText(text, 1); + + stackObjects.push(m_staticTextStatusMiddle->GetLabel()); + m_staticTextStatusMiddle->SetLabel(text); + + m_panel7->Layout(); } -void MainDialog::writeStatusInformation(const wxString& text) +void MainDialog::clearStatusBar() { - stackObjects = 0; - m_statusBar1->SetStatusText(text, 1); + while (stackObjects.size() > 0) + stackObjects.pop(); + + m_staticTextStatusLeft->SetLabel(wxEmptyString); + m_staticTextStatusMiddle->SetLabel(wxEmptyString); + m_staticTextStatusRight->SetLabel(wxEmptyString); } @@ -884,7 +931,7 @@ void MainDialog::OnDirChangedPanel1(wxFileDirPickerEvent& event) m_directoryPanel1->SetValue(newPath); //disable the sync button - m_bpButtonSync->Enable(false); + enableSynchronization(false); //clear grids currentGridData.clear(); @@ -901,7 +948,8 @@ void MainDialog::OnDirChangedPanel2(wxFileDirPickerEvent& event) m_directoryPanel2->SetValue(newPath); //disable the sync button - m_bpButtonSync->Enable(false); + enableSynchronization(false); + //clear grids currentGridData.clear(); writeGrid(currentGridData); @@ -910,20 +958,10 @@ void MainDialog::OnDirChangedPanel2(wxFileDirPickerEvent& event) } -void MainDialog::clearStatusBar() -{ - stackObjects = 0; //prevent old stack objects from popping up - - m_statusBar1->SetStatusText(""); - m_statusBar1->SetStatusText("", 1); - m_statusBar1->SetStatusText("", 2); -} - - wxString getFormattedHistoryElement(const wxString& filename) { wxString output = wxFileName(filename).GetFullName(); - if (output.EndsWith(".FFS")) + if (output.EndsWith(".ffs")) output = output.BeforeLast('.'); return output; } @@ -1012,14 +1050,12 @@ bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen else { //disable the sync button - mainDlg->m_bpButtonSync->Disable(); + mainDlg->enableSynchronization(false); //clear grids mainDlg->currentGridData.clear(); mainDlg->writeGrid(mainDlg->currentGridData); - mainDlg->clearStatusBar(); - const wxString droppedFileName = filenames[0]; //test if ffs config file has been dropped @@ -1042,7 +1078,7 @@ bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen void MainDialog::OnSaveConfig(wxCommandEvent& event) { - wxString defaultFileName = "SyncSettings.FFS"; + wxString defaultFileName = "SyncSettings.ffs"; //try to use last selected configuration file as default int selectedItem; @@ -1052,13 +1088,11 @@ void MainDialog::OnSaveConfig(wxCommandEvent& event) defaultFileName = cfgFileNames[selectedItem - 1]; - clearStatusBar(); - - wxFileDialog* filePicker = new wxFileDialog(this, "", "", defaultFileName, wxString(_("FreeFileSync configuration")) + " (*.FFS)|*.FFS", wxFD_SAVE); + wxFileDialog* filePicker = new wxFileDialog(this, "", "", defaultFileName, wxString(_("FreeFileSync configuration")) + " (*.ffs)|*.ffs", wxFD_SAVE); if (filePicker->ShowModal() == wxID_OK) { - wxString newFileName = filePicker->GetFilename(); + wxString newFileName = filePicker->GetPath(); if (wxFileExists(newFileName)) { @@ -1082,14 +1116,17 @@ void MainDialog::OnLoadConfiguration(wxCommandEvent& event) int selectedItem; if ((selectedItem = m_choiceLoad->GetSelection()) != wxNOT_FOUND) { - wxString newCfgFile; + //clear grids + currentGridData.clear(); + writeGrid(currentGridData); - clearStatusBar(); + wxString newCfgFile; + wxFileDialog* filePicker = NULL; switch (selectedItem) { case 0: //load config from file - wxFileDialog* filePicker = new wxFileDialog(this, "", "", "", wxString(_("FreeFileSync configuration")) + " (*.FFS)|*.FFS", wxFD_OPEN); + filePicker = new wxFileDialog(this, "", "", "", wxString(_("FreeFileSync configuration")) + " (*.ffs)|*.ffs", wxFD_OPEN); if (filePicker->ShowModal() == wxID_OK) newCfgFile = filePicker->GetFilename(); @@ -1140,13 +1177,17 @@ void MainDialog::OnChoiceKeyEvent(wxKeyEvent& event) } -void MainDialog::OnChangeCompareVariant(wxCommandEvent& event) +void MainDialog::OnCompareByTimeSize(wxCommandEvent& event) { - //disable the sync button - m_bpButtonSync->Enable(false); - //clear grids - currentGridData.clear(); - writeGrid(currentGridData); + cfg.compareVar = compareByTimeAndSize; + updateCompareButtons(); +} + + +void MainDialog::OnCompareByContent(wxCommandEvent& event) +{ + cfg.compareVar = compareByContent; + updateCompareButtons(); } @@ -1165,27 +1206,28 @@ void MainDialog::OnQuit(wxCommandEvent &event) void MainDialog::loadDefaultConfiguration() { //default values - syncConfiguration.exLeftSideOnly = syncDirRight; - syncConfiguration.exRightSideOnly = syncDirRight; - syncConfiguration.leftNewer = syncDirRight; - syncConfiguration.rightNewer = syncDirRight; - syncConfiguration.different = syncDirRight; + cfg.syncConfiguration.exLeftSideOnly = syncDirRight; + cfg.syncConfiguration.exRightSideOnly = syncDirRight; + cfg.syncConfiguration.leftNewer = syncDirRight; + cfg.syncConfiguration.rightNewer = syncDirRight; + cfg.syncConfiguration.different = syncDirRight; - m_radioBtnSizeDate->SetValue(true); //compare algorithm + cfg.compareVar = compareByTimeAndSize; //compare algorithm + updateCompareButtons(); - includeFilter = "*"; //include all files/folders - excludeFilter = ""; //exlude nothing + cfg.includeFilter = "*"; //include all files/folders + cfg.excludeFilter = ""; //exlude nothing //set status of filter button - filterIsActive = false; //do not filter by default - updateFilterButton(); + cfg.filterIsActive = false; //do not filter by default + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); //set status of "hide filtered items" checkbox - hideFiltered = false; //show filtered items - m_checkBoxHideFilt->SetValue(hideFiltered); + cfg.hideFiltered = false; //show filtered items + m_checkBoxHideFilt->SetValue(cfg.hideFiltered); - useRecycleBin = false; //do not use: in case OS doesn't support this, user will have to activate first and then get the error message - hideErrorMessages = false; + cfg.useRecycleBin = false; //do not use: in case OS doesn't support this, user will have to activate first and then get the error message + cfg.continueOnError = false; widthNotMaximized = wxDefaultCoord; heightNotMaximized = wxDefaultCoord; @@ -1225,24 +1267,15 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS //read sync configuration - syncConfiguration.exLeftSideOnly = SyncDirection(config.get()); - syncConfiguration.exRightSideOnly = SyncDirection(config.get()); - syncConfiguration.leftNewer = SyncDirection(config.get()); - syncConfiguration.rightNewer = SyncDirection(config.get()); - syncConfiguration.different = SyncDirection(config.get()); + cfg.syncConfiguration.exLeftSideOnly = SyncDirection(config.get()); + cfg.syncConfiguration.exRightSideOnly = SyncDirection(config.get()); + cfg.syncConfiguration.leftNewer = SyncDirection(config.get()); + cfg.syncConfiguration.rightNewer = SyncDirection(config.get()); + cfg.syncConfiguration.different = SyncDirection(config.get()); //read compare algorithm - switch (int(config.get())) - { - case compareByTimeAndSize: - m_radioBtnSizeDate->SetValue(true); - break; - case compareByContent: - m_radioBtnContent->SetValue(true); - break; - default: - assert (false); - } + cfg.compareVar = CompareVariant(config.get()); + updateCompareButtons(); //read column sizes for (int i = 0; i < m_grid1->GetNumberCols(); ++i) @@ -1294,23 +1327,23 @@ void MainDialog::readConfigurationFromHD(const wxString& filename, bool programS m_dirPicker2->SetPath(bigBuffer); //read filter settings: - hideFiltered = bool(config.get()); - m_checkBoxHideFilt->SetValue(hideFiltered); + cfg.hideFiltered = bool(config.get()); + m_checkBoxHideFilt->SetValue(cfg.hideFiltered); - filterIsActive = bool(config.get()); - updateFilterButton(); + cfg.filterIsActive = bool(config.get()); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); //include config.getline(bigBuffer, 10000, char(0)); - includeFilter = bigBuffer; + cfg.includeFilter = bigBuffer; //exclude config.getline(bigBuffer, 10000, char(0)); - excludeFilter = bigBuffer; + cfg.excludeFilter = bigBuffer; - useRecycleBin = bool(config.get()); + cfg.useRecycleBin = bool(config.get()); - hideErrorMessages = bool(config.get()); + cfg.continueOnError = bool(config.get()); config.close(); } @@ -1332,19 +1365,14 @@ void MainDialog::writeConfigurationToHD(const wxString& filename) config<<FreeFileSync::FFS_ConfigFileID.c_str(); //write sync configuration - config<<char(syncConfiguration.exLeftSideOnly) - <<char(syncConfiguration.exRightSideOnly) - <<char(syncConfiguration.leftNewer) - <<char(syncConfiguration.rightNewer) - <<char(syncConfiguration.different); - - //write find method - if (m_radioBtnSizeDate->GetValue()) - config<<char(compareByTimeAndSize); - else if (m_radioBtnContent->GetValue()) - config<<char(compareByContent); - else assert (false); + config<<char(cfg.syncConfiguration.exLeftSideOnly) + <<char(cfg.syncConfiguration.exRightSideOnly) + <<char(cfg.syncConfiguration.leftNewer) + <<char(cfg.syncConfiguration.rightNewer) + <<char(cfg.syncConfiguration.different); + //write compare algorithm + config<<char(cfg.compareVar); //write column sizes for (int i = 0; i < m_grid1->GetNumberCols(); ++i) @@ -1368,15 +1396,15 @@ void MainDialog::writeConfigurationToHD(const wxString& filename) <<m_directoryPanel2->GetValue().c_str()<<char(0); //write filter settings - config<<char(hideFiltered); - config<<char(filterIsActive); + config<<char(cfg.hideFiltered); + config<<char(cfg.filterIsActive); - config<<includeFilter.c_str()<<char(0) - <<excludeFilter.c_str()<<char(0); + config<<cfg.includeFilter.c_str()<<char(0) + <<cfg.excludeFilter.c_str()<<char(0); - config<<char(useRecycleBin); + config<<char(cfg.useRecycleBin); - config<<char(hideErrorMessages); + config<<char(cfg.continueOnError); config.close(); } @@ -1386,6 +1414,7 @@ void MainDialog::OnAbout(wxCommandEvent &event) { AboutDlg* aboutDlg = new AboutDlg(this); aboutDlg->ShowModal(); + event.Skip(); } @@ -1393,51 +1422,61 @@ void MainDialog::OnShowHelpDialog(wxCommandEvent &event) { HelpDlg* helpDlg = new HelpDlg(this); helpDlg->ShowModal(); + event.Skip(); } void MainDialog::OnFilterButton(wxCommandEvent &event) { //toggle filter on/off - filterIsActive = !filterIsActive; - + cfg.filterIsActive = !cfg.filterIsActive; //make sure, button-appearance and "filterIsActive" are in sync. - updateFilterButton(); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); - if (filterIsActive) - FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter); + if (cfg.filterIsActive) + FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); else FreeFileSync::removeFilterOnCurrentGridData(currentGridData); writeGrid(currentGridData); + event.Skip(); } void MainDialog::OnHideFilteredButton(wxCommandEvent &event) { //toggle showing filtered rows - hideFiltered = !hideFiltered; + cfg.hideFiltered = !cfg.hideFiltered; writeGrid(currentGridData); //make sure, checkbox and "hideFiltered" are in sync - m_checkBoxHideFilt->SetValue(hideFiltered); + m_checkBoxHideFilt->SetValue(cfg.hideFiltered); + event.Skip(); } void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) { - wxString beforeImage = includeFilter + wxChar(0) + excludeFilter; + wxString beforeImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; - FilterDlg* filterDlg = new FilterDlg(this, includeFilter, excludeFilter); + FilterDlg* filterDlg = new FilterDlg(this, cfg.includeFilter, cfg.excludeFilter); if (filterDlg->ShowModal() == FilterDlg::okayButtonPressed) { - wxString afterImage = includeFilter + wxChar(0) + excludeFilter; + wxString afterImage = cfg.includeFilter + wxChar(1) + cfg.excludeFilter; if (beforeImage != afterImage) //if filter settings are changed: set filtering to "on" { - filterIsActive = true; - updateFilterButton(); + if (afterImage == (wxString("*") + wxChar(1))) //default + { + cfg.filterIsActive = false; + FreeFileSync::removeFilterOnCurrentGridData(currentGridData); + } + else + { + cfg.filterIsActive = true; + FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); + } - FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter); + updateFilterButton(m_bpButtonFilter, cfg.filterIsActive); writeGrid(currentGridData); } @@ -1445,11 +1484,13 @@ void MainDialog::OnConfigureFilter(wxHyperlinkEvent &event) //no event.Skip() here, to not start browser } + void MainDialog::OnLeftOnlyFiles(wxCommandEvent& event) { leftOnlyFilesActive = !leftOnlyFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) @@ -1457,6 +1498,7 @@ void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) leftNewerFilesActive = !leftNewerFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnDifferentFiles(wxCommandEvent& event) @@ -1464,6 +1506,7 @@ void MainDialog::OnDifferentFiles(wxCommandEvent& event) differentFilesActive = !differentFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnRightNewerFiles(wxCommandEvent& event) @@ -1471,6 +1514,7 @@ void MainDialog::OnRightNewerFiles(wxCommandEvent& event) rightNewerFilesActive = !rightNewerFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) @@ -1478,6 +1522,7 @@ void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) rightOnlyFilesActive = !rightOnlyFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::OnEqualFiles(wxCommandEvent& event) @@ -1485,6 +1530,7 @@ void MainDialog::OnEqualFiles(wxCommandEvent& event) equalFilesActive = !equalFilesActive; updateViewFilterButtons(); writeGrid(currentGridData); + event.Skip(); }; void MainDialog::updateViewFilterButtons() @@ -1521,21 +1567,52 @@ void MainDialog::updateViewFilterButtons() } -void MainDialog::updateFilterButton() +void MainDialog::updateFilterButton(wxBitmapButton* filterButton, bool isActive) { - if (filterIsActive) + if (isActive) { - m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOn); - m_bpButtonFilter->SetToolTip(_("Filter active: Press again to deactivate")); + filterButton->SetBitmapLabel(*GlobalResources::bitmapFilterOn); + filterButton->SetToolTip(_("Filter active: Press again to deactivate")); } else { - m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOff); - m_bpButtonFilter->SetToolTip(_("Press button to activate filter")); + filterButton->SetBitmapLabel(*GlobalResources::bitmapFilterOff); + filterButton->SetToolTip(_("Press button to activate filter")); } } +void MainDialog::updateCompareButtons() +{ + switch (cfg.compareVar) + { + case compareByTimeAndSize: + m_radioBtnSizeDate->SetValue(true); + + m_bpButton21->Show(); //show or hide filter buttons depending on selected compare variant + m_bpButton23->Show(); + bSizer59->Layout(); + break; + case compareByContent: + m_radioBtnContent->SetValue(true); + + m_bpButton21->Hide(); + m_bpButton23->Hide(); + bSizer59->Layout(); + break; + default: + assert (false); + } + + //disable the sync button + enableSynchronization(false); + + //clear grids + currentGridData.clear(); + writeGrid(currentGridData); +} + + void MainDialog::OnCompare(wxCommandEvent &event) { if (m_directoryPanel1->GetValue().IsEmpty() || m_directoryPanel2->GetValue().IsEmpty()) @@ -1560,47 +1637,49 @@ void MainDialog::OnCompare(wxCommandEvent &event) wxBeginBusyCursor(); - CompareVariant cmpVar = compareByTimeAndSize; //assign a value to suppress compiler warning - if (m_radioBtnSizeDate->GetValue()) - cmpVar = compareByTimeAndSize; - else if (m_radioBtnContent->GetValue()) - cmpVar = compareByContent; - else assert (false); - + bool aborted = false; try { //class handling status display and error messages CompareStatusUpdater statusUpdater(this); cmpStatusUpdaterTmp = &statusUpdater; - stackObjects = 0; //unsigned int startTime3 = GetTickCount(); FreeFileSync::startCompareProcess(currentGridData, FreeFileSync::getFormattedDirectoryName(m_directoryPanel1->GetValue()), FreeFileSync::getFormattedDirectoryName(m_directoryPanel2->GetValue()), - cmpVar, + cfg.compareVar, &statusUpdater); //wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime3)); //filter currentGridData if option is set - if (filterIsActive) - FreeFileSync::filterCurrentGridData(currentGridData, includeFilter, excludeFilter); + if (cfg.filterIsActive) + FreeFileSync::filterCurrentGridData(currentGridData, cfg.includeFilter, cfg.excludeFilter); - //once compare is finished enable the sync button - m_bpButtonSync->Enable(); - m_bpButtonSync->SetFocus(); - - writeGrid(currentGridData); //keep it in try/catch to not overwrite status information if compare is abortet + writeGrid(currentGridData); //keep it in try/catch to not overwrite status information if compare is aborted cmpStatusUpdaterTmp = 0; } catch (AbortThisProcess& theException) { - //disable the sync button - m_bpButtonSync->Disable(); + aborted = true; + } + + if (aborted) + { //disable the sync button + enableSynchronization(false); + + m_bpButtonCompare->SetFocus(); + } + else + { //once compare is finished enable the sync button + enableSynchronization(true); + + m_bpButtonSync->SetFocus(); } wxEndBusyCursor(); + event.Skip(); } @@ -1608,55 +1687,26 @@ void MainDialog::OnAbortCompare(wxCommandEvent& event) { if (cmpStatusUpdaterTmp) cmpStatusUpdaterTmp->requestAbortion(); -} - - -inline -wxString MainDialog::evaluateCmpResult(const CompareFilesResult result, const bool selectedForSynchronization) -{ - if (selectedForSynchronization) - switch (result) - { - case fileOnLeftSideOnly: - return "<|"; - break; - case fileOnRightSideOnly: - return "|>"; - break; - case rightFileNewer: - return ">>"; - break; - case leftFileNewer: - return "<<"; - break; - case filesDifferent: - return "!="; - break; - case filesEqual: - return "=="; - break; - default: - assert (false); - } - else return constFilteredOut; + event.Skip(); } void MainDialog::writeGrid(const FileCompareResult& gridData, bool useUI_GridCache) { + m_grid1->BeginBatch(); + m_grid2->BeginBatch(); + m_grid3->BeginBatch(); + if (!useUI_GridCache) { //unsigned int startTime = GetTickCount(); - mapFileModelToUI(currentUI_View, gridData); //update currentUI_View + mapGridDataToUI(gridRefUI, gridData); //update gridRefUI //wxMessageBox(wxString("Benchmark: ") + numberToWxString(unsigned(GetTickCount()) - startTime) + " ms"); - updateStatusInformation(currentUI_View); //write status information for currentUI_View - } - m_grid1->BeginBatch(); - m_grid2->BeginBatch(); - m_grid3->BeginBatch(); + updateStatusInformation(gridRefUI); //write status information for gridRefUI + } - //all three grids retrieve their data directly from currentUI_View via a pointer!!! + //all three grids retrieve their data directly from currentGridData!!! //the only thing left to do is notify the grids to update their sizes (nr of rows), since this has to be communicated via messages by the grids m_grid1->updateGridSizes(); m_grid2->updateGridSizes(); @@ -1682,26 +1732,26 @@ void MainDialog::writeGrid(const FileCompareResult& gridData, bool useUI_GridCac } -void MainDialog::OnSync( wxCommandEvent& event ) +void MainDialog::OnSync(wxCommandEvent& event) { - //check if there are files/folders that can be synced - bool nothingToSync = true; - for (FileCompareResult::const_iterator i = currentGridData.begin(); i != currentGridData.end(); ++i) - if (i->cmpResult != filesEqual) + SyncDialog* syncDlg = new SyncDialog(this, currentGridData, cfg, synchronizationEnabled); + if (syncDlg->ShowModal() == SyncDialog::StartSynchronizationProcess) + { + //check if there are files/folders that can be synced + bool nothingToSync = true; + for (FileCompareResult::const_iterator i = currentGridData.begin(); i != currentGridData.end(); ++i) + if (i->cmpResult != filesEqual) + { + nothingToSync = false; + break; + } + + if (nothingToSync) { - nothingToSync = false; - break; + wxMessageBox(_("Nothing to synchronize. Both directories seem to contain the same data!"), _("Information"), wxICON_WARNING); + return; } - if (nothingToSync) - { - wxMessageBox(_("Nothing to synchronize. Both directories seem to contain the same data!"), _("Information"), wxICON_WARNING); - return; - } - - SyncDialog* syncDlg = new SyncDialog(this); - if (syncDlg->ShowModal() == SyncDialog::StartSynchronizationProcess) - { wxBeginBusyCursor(); clearStatusBar(); @@ -1709,17 +1759,17 @@ void MainDialog::OnSync( wxCommandEvent& event ) try { //class handling status updates and error messages - SyncStatusUpdater statusUpdater(this, hideErrorMessages); + SyncStatusUpdater statusUpdater(this, cfg.continueOnError); //start synchronization and return elements that were not sync'ed in currentGridData //unsigned int startTime3 = GetTickCount(); - FreeFileSync::startSynchronizationProcess(currentGridData, syncConfiguration, &statusUpdater, useRecycleBin); + FreeFileSync::startSynchronizationProcess(currentGridData, cfg.syncConfiguration, &statusUpdater, cfg.useRecycleBin); //wxMessageBox(numberToWxString(unsigned(GetTickCount()) - startTime3)); } catch (AbortThisProcess& theException) { //do NOT disable the sync button: user might want to try to sync the REMAINING rows - } //m_bpButtonSync->Disable(); + } //enableSynchronization(false); //display files that were not processed @@ -1730,12 +1780,13 @@ void MainDialog::OnSync( wxCommandEvent& event ) else { pushStatusInformation(_("All items have been synchronized!")); - m_bpButtonSync->Disable(); + enableSynchronization(false); } wxEndBusyCursor(); } + event.Skip(); } @@ -1762,7 +1813,7 @@ inline bool cmpString(const wxString& a, const wxString& b) { if (a.IsEmpty()) - return false; // if a and b are empty: false, if a empty, b not empty: also false, since empty rows should be put below on grid + return false; // if a and b are empty: false, if a empty, b not empty: also false, since empty rows should appear at the end else if (b.IsEmpty()) return true; // empty rows after filled rows: return true @@ -1772,6 +1823,7 @@ bool cmpString(const wxString& a, const wxString& b) else return (a > b); } + inline bool cmpLargeInt(const wxULongLong& a, const wxULongLong& b) { @@ -1782,78 +1834,125 @@ bool cmpLargeInt(const wxULongLong& a, const wxULongLong& b) } -bool sortGridLeft(const UI_GridLine& a, const UI_GridLine& b) +bool sortGridLeft(const GridViewLine a, const GridViewLine b) { + const FileDescrLine& gridDataLineA = (*currentGridDataPtr)[a].fileDescrLeft; + const FileDescrLine& gridDataLineB = (*currentGridDataPtr)[b].fileDescrLeft; + + wxString stringA; + wxString stringB; + switch (currentSortColumn) { case 0: - return cmpString(a.leftFilename, b.leftFilename); - break; + //presort types: first files, then directories then empty rows + if (gridDataLineA.objType == isNothing) + return false; //empty rows always last + else if (gridDataLineB.objType == isNothing) + return true; //empty rows always last + else if (gridDataLineA.objType == isDirectory) + return false; + else if (gridDataLineB.objType == isDirectory) + return true; + else + return cmpString(gridDataLineA.relFilename.AfterLast(GlobalResources::fileNameSeparator), + gridDataLineB.relFilename.AfterLast(GlobalResources::fileNameSeparator)); case 1: - return cmpString(a.leftRelativePath, b.leftRelativePath); - break; - case 2: - ObjectType typeA = (*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrLeft.objType; - ObjectType typeB = (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrLeft.objType; + if (gridDataLineA.objType == isDirectory) + stringA = gridDataLineA.relFilename; + else + stringA = gridDataLineA.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + + if (gridDataLineB.objType == isDirectory) + stringB = gridDataLineB.relFilename; + else + stringB = gridDataLineB.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + + return cmpString(stringA, stringB); + case 2: //presort types: first files, then directories then empty rows - if (typeA == isNothing) + if (gridDataLineA.objType == isNothing) return false; //empty rows always last - else if (typeB == isNothing) + else if (gridDataLineB.objType == isNothing) return true; //empty rows always last - else if (typeA == isDirectory) + else if (gridDataLineA.objType == isDirectory) return false; - else if (typeB == isDirectory) + else if (gridDataLineB.objType == isDirectory) return true; else //use unformatted filesizes and sort by size - return cmpLargeInt((*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrLeft.fileSize, (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrLeft.fileSize); + return cmpLargeInt(gridDataLineA.fileSize, gridDataLineB.fileSize); - break; case 3: - return cmpString(a.leftDate, b.leftDate); - break; + return cmpString(gridDataLineA.lastWriteTime, gridDataLineB.lastWriteTime); + default: assert(false); + return true; //dummy command } - return true; //dummy command } -bool sortGridRight(const UI_GridLine& a, const UI_GridLine& b) + +bool sortGridRight(const GridViewLine a, const GridViewLine b) { + const FileDescrLine& gridDataLineA = (*currentGridDataPtr)[a].fileDescrRight; + const FileDescrLine& gridDataLineB = (*currentGridDataPtr)[b].fileDescrRight; + + wxString stringA; + wxString stringB; + switch (currentSortColumn) { case 0: - return cmpString(a.rightFilename, b.rightFilename); - break; + //presort types: first files, then directories then empty rows + if (gridDataLineA.objType == isNothing) + return false; //empty rows always last + else if (gridDataLineB.objType == isNothing) + return true; //empty rows always last + else if (gridDataLineA.objType == isDirectory) + return false; + else if (gridDataLineB.objType == isDirectory) + return true; + else + return cmpString(gridDataLineA.relFilename.AfterLast(GlobalResources::fileNameSeparator), + gridDataLineB.relFilename.AfterLast(GlobalResources::fileNameSeparator)); + case 1: - return cmpString(a.rightRelativePath, b.rightRelativePath); - break; - case 2: - ObjectType typeA = (*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrRight.objType; - ObjectType typeB = (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrRight.objType; + if (gridDataLineA.objType == isDirectory) + stringA = gridDataLineA.relFilename; + else + stringA = gridDataLineA.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + + if (gridDataLineB.objType == isDirectory) + stringB = gridDataLineB.relFilename; + else + stringB = gridDataLineB.relFilename.BeforeLast(GlobalResources::fileNameSeparator); + return cmpString(stringA, stringB); + + case 2: //presort types: first files, then directories then empty rows - if (typeA == isNothing) + if (gridDataLineA.objType == isNothing) return false; //empty rows always last - else if (typeB == isNothing) + else if (gridDataLineB.objType == isNothing) return true; //empty rows always last - else if (typeA == isDirectory) + else if (gridDataLineA.objType == isDirectory) return false; - else if (typeB == isDirectory) + else if (gridDataLineB.objType == isDirectory) return true; else //use unformatted filesizes and sort by size - return cmpLargeInt((*currentGridDataPtr)[a.linkToCurrentGridData].fileDescrRight.fileSize, (*currentGridDataPtr)[b.linkToCurrentGridData].fileDescrRight.fileSize); + return cmpLargeInt(gridDataLineA.fileSize, gridDataLineB.fileSize); - break; case 3: - return cmpString(a.rightDate, b.rightDate); - break; + return cmpString(gridDataLineA.lastWriteTime, gridDataLineB.lastWriteTime); + default: assert(false); + return true; //dummy command } - return true; //dummy command } + void MainDialog::OnSortLeftGrid(wxGridEvent& event) { static bool columnSortAscending[4] = {true, true, false, true}; @@ -1864,8 +1963,12 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) { sortAscending = columnSortAscending[currentSortColumn]; columnSortAscending[currentSortColumn] = !columnSortAscending[currentSortColumn]; - sort(currentUI_View.begin(), currentUI_View.end(), sortGridLeft); - writeGrid(currentGridData, true); //use UI buffer, no mapping from currentGridData to UI model again + sort(gridRefUI.begin(), gridRefUI.end(), sortGridLeft); + + m_grid1->ForceRefresh(); + m_grid2->ForceRefresh(); + m_grid3->ForceRefresh(); + //set sort direction indicator on UI if (sortAscending) m_grid1->setSortMarker(currentSortColumn, GlobalResources::bitmapSmallUp); @@ -1876,6 +1979,7 @@ void MainDialog::OnSortLeftGrid(wxGridEvent& event) event.Skip(); } + void MainDialog::OnSortRightGrid(wxGridEvent& event) { static bool columnSortAscending[4] = {true, true, false, true}; @@ -1886,8 +1990,12 @@ void MainDialog::OnSortRightGrid(wxGridEvent& event) { sortAscending = columnSortAscending[currentSortColumn]; columnSortAscending[currentSortColumn] = !columnSortAscending[currentSortColumn]; - sort(currentUI_View.begin(), currentUI_View.end(), sortGridRight); - writeGrid(currentGridData, true); + sort(gridRefUI.begin(), gridRefUI.end(), sortGridRight); + + m_grid1->ForceRefresh(); + m_grid2->ForceRefresh(); + m_grid3->ForceRefresh(); + //set sort direction indicator on UI m_grid1->setSortMarker(-1); if (sortAscending) @@ -1909,62 +2017,27 @@ void MainDialog::OnSwapDirs( wxCommandEvent& event ) //swap grid information FreeFileSync::swapGrids(currentGridData); writeGrid(currentGridData); + event.Skip(); } -//this sorting method is currently NOT used -bool cmpGridSmallerThan(const UI_GridLine& a, const UI_GridLine& b) -{ - wxString cmpStringA; - wxString cmpStringB; - - for (int i = 0; i < 4; ++i) - { - switch (i) - { - case 0: - cmpStringA = a.leftRelativePath; - cmpStringB = b.leftRelativePath; - break; - case 1: - cmpStringA = a.leftFilename; - cmpStringB = b.leftFilename; - break; - case 2: - cmpStringA = a.rightRelativePath; - cmpStringB = b.rightRelativePath; - break; - case 3: - cmpStringA = a.rightFilename; - cmpStringB = b.rightFilename; - break; - default: - assert (false); - } - if (cmpStringA.IsEmpty()) - cmpStringA = '\255'; - if (cmpStringB.IsEmpty()) - cmpStringB = '\255'; - - if (cmpStringA != cmpStringB) - return (cmpStringA < cmpStringB); - } - return (false); -} - - -void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid) +void MainDialog::updateStatusInformation(const GridView& visibleGrid) { - clearStatusBar(); + while (stackObjects.size() > 0) + stackObjects.pop(); unsigned int objectsOnLeftView = 0; unsigned int objectsOnRightView = 0; wxULongLong filesizeLeftView; wxULongLong filesizeRightView; - for (UI_Grid::const_iterator i = visibleGrid.begin(); i != visibleGrid.end(); ++i) + wxString statusLeftNew; + wxString statusMiddleNew; + wxString statusRightNew; + + for (GridView::const_iterator i = visibleGrid.begin(); i != visibleGrid.end(); ++i) { - const FileCompareLine& refLine = currentGridData[i->linkToCurrentGridData]; + const FileCompareLine& refLine = currentGridData[*i]; //calculate total number of bytes for each sied if (refLine.fileDescrLeft.objType != isNothing) @@ -1984,36 +2057,44 @@ void MainDialog::updateStatusInformation(const UI_Grid& visibleGrid) wxString objectsViewLeft = numberToWxString(objectsOnLeftView); globalFunctions::includeNumberSeparator(objectsViewLeft); if (objectsOnLeftView == 1) - m_statusBar1->SetStatusText(wxString(_("1 item on left, ")) + FreeFileSync::formatFilesizeToShortString(filesizeLeftView), 0); + statusLeftNew = wxString(_("1 item on left, ")) + FreeFileSync::formatFilesizeToShortString(filesizeLeftView); else - m_statusBar1->SetStatusText(objectsViewLeft + _(" items on left, ") + FreeFileSync::formatFilesizeToShortString(filesizeLeftView), 0); + statusLeftNew = objectsViewLeft + _(" items on left, ") + FreeFileSync::formatFilesizeToShortString(filesizeLeftView); wxString objectsTotal = numberToWxString(currentGridData.size()); globalFunctions::includeNumberSeparator(objectsTotal); wxString objectsView = numberToWxString(visibleGrid.size()); globalFunctions::includeNumberSeparator(objectsView); if (currentGridData.size() == 1) - m_statusBar1->SetStatusText(objectsView + _(" of ") + objectsTotal + _(" row in view"), 1); + statusMiddleNew = objectsView + _(" of ") + objectsTotal + _(" row in view"); else - m_statusBar1->SetStatusText(objectsView + _(" of ") + objectsTotal + _(" rows in view"), 1); + statusMiddleNew = objectsView + _(" of ") + objectsTotal + _(" rows in view"); wxString objectsViewRight = numberToWxString(objectsOnRightView); globalFunctions::includeNumberSeparator(objectsViewRight); if (objectsOnRightView == 1) - m_statusBar1->SetStatusText(wxString(_("1 item on right, ")) + FreeFileSync::formatFilesizeToShortString(filesizeRightView), 2); + statusRightNew = wxString(_("1 item on right, ")) + FreeFileSync::formatFilesizeToShortString(filesizeRightView); else - m_statusBar1->SetStatusText(objectsViewRight + _(" items on right, ") + FreeFileSync::formatFilesizeToShortString(filesizeRightView), 2); + statusRightNew = objectsViewRight + _(" items on right, ") + FreeFileSync::formatFilesizeToShortString(filesizeRightView); + + //avoid screen flicker + if (m_staticTextStatusLeft->GetLabel() != statusLeftNew) + m_staticTextStatusLeft->SetLabel(statusLeftNew); + if (m_staticTextStatusMiddle->GetLabel() != statusMiddleNew) + m_staticTextStatusMiddle->SetLabel(statusMiddleNew); + if (m_staticTextStatusRight->GetLabel() != statusRightNew) + m_staticTextStatusRight->SetLabel(statusRightNew); + + m_panel7->Layout(); } -void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& fileCmpResult) +void MainDialog::mapGridDataToUI(GridView& output, const FileCompareResult& fileCmpResult) { output.clear(); - UI_GridLine gridline; unsigned int currentRow = 0; - wxString fileSize; //tmp string for (FileCompareResult::const_iterator i = fileCmpResult.begin(); i != fileCmpResult.end(); ++i, ++currentRow) { //process UI filter settings @@ -2042,85 +2123,20 @@ void MainDialog::mapFileModelToUI(UI_Grid& output, const FileCompareResult& file } //hide filtered row, if corresponding option is set - if (hideFiltered && !i->selectedForSynchronization) + if (cfg.hideFiltered && !i->selectedForSynchronization) continue; - if (i->fileDescrLeft.objType == isDirectory) - { - gridline.leftFilename = wxEmptyString; - gridline.leftRelativePath = i->fileDescrLeft.relFilename; - gridline.leftSize = _("<Directory>"); - } - else - { - gridline.leftFilename = i->fileDescrLeft.relFilename.AfterLast(GlobalResources::fileNameSeparator); - gridline.leftRelativePath = i->fileDescrLeft.relFilename.BeforeLast(GlobalResources::fileNameSeparator); - if (i->fileDescrLeft.fileSize != 0) - gridline.leftSize = globalFunctions::includeNumberSeparator(fileSize = i->fileDescrLeft.fileSize.ToString()); - else - gridline.leftSize = ""; - } - gridline.leftDate = i->fileDescrLeft.lastWriteTime; - - gridline.cmpResult = evaluateCmpResult(i->cmpResult, i->selectedForSynchronization); - gridline.linkToCurrentGridData = currentRow; - - if (i->fileDescrRight.objType == isDirectory) - { - gridline.rightFilename = wxEmptyString; - gridline.rightRelativePath = i->fileDescrRight.relFilename; - gridline.rightSize = _("<Directory>"); - } - else - { - gridline.rightFilename = i->fileDescrRight.relFilename.AfterLast(GlobalResources::fileNameSeparator); - gridline.rightRelativePath = i->fileDescrRight.relFilename.BeforeLast(GlobalResources::fileNameSeparator); - if (i->fileDescrRight.fileSize != 0) - gridline.rightSize = globalFunctions::includeNumberSeparator(fileSize = i->fileDescrRight.fileSize.ToString()); - else - gridline.rightSize = ""; - } - gridline.rightDate = i->fileDescrRight.lastWriteTime; - - output.push_back(gridline); + output.push_back(currentRow); } - //sorting is expensive: ca. 50% bigger runtime for large grids; unsorted doesn't look too bad, so it's disabled - // sort(output.begin(), output.end(), cmpGridSmallerThan); -} -//######################################################################################################## - - -void updateUI_Now() -{ - //process UI events and prevent application from "not responding" -> NO performance issue! - wxTheApp->Yield(); - -// while (wxTheApp->Pending()) -// wxTheApp->Dispatch(); -} - - -bool updateUI_IsAllowed() -{ - static wxLongLong lastExec = 0; - - wxLongLong newExec = wxGetLocalTimeMillis(); - - if (newExec - lastExec >= uiUpdateInterval) //perform ui updates not more often than necessary - { - lastExec = newExec; - return true; - } - return false; + //sorting is expensive: do performance measurements before implementing here! } - //######################################################################################################## CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg) : mainDialog(dlg), - suppressUI_Errormessages(false), + continueOnError(false), currentProcess(-1) { //prevent user input during "compare", do not disable maindialog since abort-button would also be disabled @@ -2147,20 +2163,28 @@ CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg) : mainDialog->m_choiceLoad->Disable(); mainDialog->m_bpButton10->Disable(); mainDialog->m_bpButton14->Disable(); + mainDialog->m_menubar1->EnableTop(0, false); + mainDialog->m_menubar1->EnableTop(1, false); + mainDialog->m_menubar1->EnableTop(2, false); + + //display status panel during compare + statusPanel = new CompareStatus(mainDialog); + mainDialog->bSizer1->Insert(1, statusPanel, 0, wxEXPAND | wxALL, 5 ); + //show abort button + mainDialog->m_buttonAbort->Enable(); mainDialog->m_buttonAbort->Show(); + mainDialog->m_bpButtonCompare->Disable(); mainDialog->m_bpButtonCompare->Hide(); mainDialog->m_buttonAbort->SetFocus(); - //display status panel during compare - statusPanel = new CompareStatus(mainDialog); - mainDialog->bSizer1->Insert(1, statusPanel, 0, wxEXPAND | wxALL, 5 ); - updateUI_Now(); - mainDialog->Layout(); - mainDialog->Refresh(); + //updateUI_Now(); + mainDialog->bSizer1->Layout(); //both sizers need to recalculate! + mainDialog->bSizer6->Layout(); } + CompareStatusUpdater::~CompareStatusUpdater() { //reenable complete main dialog @@ -2169,7 +2193,7 @@ CompareStatusUpdater::~CompareStatusUpdater() mainDialog->m_bpButtonFilter->Enable(); mainDialog->m_hyperlinkCfgFilter->Enable(); mainDialog->m_checkBoxHideFilt->Enable(); - //mainDialog->m_bpButtonSync->Enable(); don't enable this one, this is up to OnCompare to handle its status + mainDialog->m_bpButtonSync->Enable(); mainDialog->m_dirPicker1->Enable(); mainDialog->m_dirPicker2->Enable(); mainDialog->m_bpButtonSwap->Enable(); @@ -2186,11 +2210,16 @@ CompareStatusUpdater::~CompareStatusUpdater() mainDialog->m_choiceLoad->Enable(); mainDialog->m_bpButton10->Enable(); mainDialog->m_bpButton14->Enable(); + mainDialog->m_menubar1->EnableTop(0, true); + mainDialog->m_menubar1->EnableTop(1, true); + mainDialog->m_menubar1->EnableTop(2, true); if (abortionRequested) mainDialog->pushStatusInformation(_("Operation aborted!")); + mainDialog->m_buttonAbort->Disable(); mainDialog->m_buttonAbort->Hide(); + mainDialog->m_bpButtonCompare->Enable(); mainDialog->m_bpButtonCompare->Show(); //remove status panel from main window @@ -2201,6 +2230,7 @@ CompareStatusUpdater::~CompareStatusUpdater() mainDialog->Refresh(); } + inline void CompareStatusUpdater::updateStatusText(const wxString& text) { @@ -2233,14 +2263,14 @@ void CompareStatusUpdater::updateProcessedData(int objectsProcessed, double data int CompareStatusUpdater::reportError(const wxString& text) { - if (suppressUI_Errormessages) + if (continueOnError) return StatusUpdater::continueNext; statusPanel->updateStatusPanelNow(); wxString errorMessage = text + _("\n\nContinue with next object, retry or abort comparison?"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, suppressUI_Errormessages); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueOnError); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -2275,8 +2305,8 @@ void CompareStatusUpdater::triggerUI_Refresh() //######################################################################################################## -SyncStatusUpdater::SyncStatusUpdater(wxWindow* dlg, bool hideErrorMessages) : - suppressUI_Errormessages(hideErrorMessages) +SyncStatusUpdater::SyncStatusUpdater(wxWindow* dlg, bool continueOnError) : + continueError(continueOnError) { syncStatusFrame = new SyncStatus(this, dlg); syncStatusFrame->Show(); @@ -2306,11 +2336,11 @@ SyncStatusUpdater::~SyncStatusUpdater() //notify to syncStatusFrame that current process has ended if (abortionRequested) - syncStatusFrame->processHasFinished(statusAborted); //enable okay and close events + syncStatusFrame->processHasFinished(SyncStatus::statusAborted); //enable okay and close events else if (failedItems) - syncStatusFrame->processHasFinished(statusCompletedWithErrors); + syncStatusFrame->processHasFinished(SyncStatus::statusCompletedWithErrors); else - syncStatusFrame->processHasFinished(statusCompletedWithSuccess); + syncStatusFrame->processHasFinished(SyncStatus::statusCompletedWithSuccess); } @@ -2326,7 +2356,7 @@ void SyncStatusUpdater::initNewProcess(int objectsTotal, double dataTotal, int p assert (processID == FreeFileSync::synchronizeFilesProcess); syncStatusFrame->resetGauge(objectsTotal, dataTotal); - syncStatusFrame->setCurrentStatus(statusSynchronizing); + syncStatusFrame->setCurrentStatus(SyncStatus::statusSynchronizing); } @@ -2339,7 +2369,7 @@ void SyncStatusUpdater::updateProcessedData(int objectsProcessed, double dataPro int SyncStatusUpdater::reportError(const wxString& text) { - if (suppressUI_Errormessages) + if (continueError) { unhandledErrors.Add(text); return StatusUpdater::continueNext; @@ -2349,7 +2379,7 @@ int SyncStatusUpdater::reportError(const wxString& text) wxString errorMessage = text + _("\n\nContinue with next object, retry or abort synchronization?"); - ErrorDlg* errorDlg = new ErrorDlg(errorMessage, suppressUI_Errormessages); + ErrorDlg* errorDlg = new ErrorDlg(errorMessage, continueError); int rv = errorDlg->ShowModal(); errorDlg->Destroy(); @@ -2384,3 +2414,113 @@ void SyncStatusUpdater::triggerUI_Refresh() syncStatusFrame->updateStatusDialogNow(); } +//######################################################################################################## + + +//menu events +void MainDialog::OnMenuExportFileList(wxCommandEvent& event) +{ + //get a filename + wxString fileName = "FileList.csv"; //proposal + wxFileDialog* filePicker = new wxFileDialog(this, "", "", fileName, wxString(_("Comma separated list")) + " (*.csv)|*.csv", wxFD_SAVE); + + if (filePicker->ShowModal() == wxID_OK) + { + fileName = filePicker->GetPath(); + if (wxFileExists(fileName)) + { + wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString("\"") + fileName + "\"" + _(" already exists. Overwrite?"), _("Warning") , wxOK | wxCANCEL); + + if (messageDlg->ShowModal() != wxID_OK) + { + pushStatusInformation(_("Saved aborted!")); + event.Skip(); + return; + } + } + + //begin work + wxString exportString; + for (unsigned int i = 0; i < gridRefUI.size(); ++i) + { + for (int k = 0; k < m_grid1->GetNumberCols(); ++k) + { + exportString+= m_grid1->GetCellValue(i, k); + exportString+= '\t'; + } + + for (int k = 0; k < m_grid3->GetNumberCols(); ++k) + { + exportString+= m_grid3->GetCellValue(i, k); + exportString+= '\t'; + } + + for (int k = 0; k < m_grid2->GetNumberCols(); ++k) + { + exportString+= m_grid2->GetCellValue(i, k); + if (k != m_grid2->GetNumberCols() - 1) + exportString+= '\t'; + } + exportString+= '\n'; + } + + //write export file + wxFile output(fileName, wxFile::write); + + if (output.IsOpened()) + { + output.Write(exportString); + pushStatusInformation(_("File list exported!")); + } + else + { + wxMessageBox(wxString(_("Could not write to ")) + "\"" + fileName + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + } + } + + event.Skip(); +} + + +void MainDialog::OnMenuBatchJob(wxCommandEvent& event) +{ + BatchDialog* batchDlg = new BatchDialog(this, cfg, m_directoryPanel1->GetValue(), m_directoryPanel2->GetValue()); + if (batchDlg->ShowModal() == BatchDialog::batchFileCreated) + pushStatusInformation(_("Batch file created successfully!")); + + event.Skip(); +} + + +void MainDialog::OnMenuAbout(wxCommandEvent& event) +{ + AboutDlg* aboutDlg = new AboutDlg(this); + aboutDlg->ShowModal(); + event.Skip(); +} + + +void MainDialog::OnMenuQuit(wxCommandEvent& event) +{ + Destroy(); + event.Skip(); +} + + +void MainDialog::OnMenuLangEnglish(wxCommandEvent& event) +{ + programLanguage->loadLanguageFile(wxLANGUAGE_ENGLISH); //language is a global attribute + restartOnExit = true; + Destroy(); + event.Skip(); +} + + +void MainDialog::OnMenuLangGerman(wxCommandEvent& event) +{ + programLanguage->loadLanguageFile(wxLANGUAGE_GERMAN); //language is a global attribute + restartOnExit = true; + Destroy(); + event.Skip(); +} + diff --git a/ui/MainDialog.h b/ui/MainDialog.h index 3ac612fc..d60c489d 100644 --- a/ui/MainDialog.h +++ b/ui/MainDialog.h @@ -13,38 +13,16 @@ #include "../library/wxWidgets.h" #include "guiGenerated.h" #include "../FreeFileSync.h" - #include "syncDialog.h" #include "smallDialogs.h" -#include "resources.h" +#include "../library/resources.h" +#include "../library/misc.h" #include <wx/dnd.h> #include <wx/config.h> +#include <stack> using namespace std; -const wxString constFilteredOut = "(-)"; - -struct UI_GridLine -{ - wxString leftFilename; - wxString leftRelativePath; - wxString leftSize; - wxString leftDate; - - wxString cmpResult; - - wxString rightFilename; - wxString rightRelativePath; - wxString rightSize; - wxString rightDate; - - unsigned int linkToCurrentGridData; //rownumber of corresponding row in currentGridData -}; -typedef vector<UI_GridLine> UI_Grid; - -bool updateUI_IsAllowed(); //test if a specific amount of time is over -void updateUI_Now(); //do the updating - //IDs for context menu items enum ContextItem { @@ -61,32 +39,28 @@ class FileDropEvent; class MainDialog : public GuiGenerated { + friend class CompareStatusUpdater; + friend class FileDropEvent; + public: - MainDialog(wxFrame* frame, const wxString& cfgFileName); + MainDialog(wxFrame* frame, const wxString& cfgFileName, CustomLocale* language); ~MainDialog(); private: - friend class SyncDialog; - friend class FilterDlg; - friend class CompareStatusUpdater; - friend class SyncStatusUpdater; - friend class FileDropEvent; - void readConfigurationFromHD(const wxString& filename, bool programStartup = false); void writeConfigurationToHD(const wxString& filename); void loadDefaultConfiguration(); void updateViewFilterButtons(); - void updateFilterButton(); + void updateFilterButton(wxBitmapButton* filterButton, bool isActive); + void updateCompareButtons(); void addCfgFileToHistory(const wxString& filename); - static wxString evaluateCmpResult(const CompareFilesResult result, const bool selectedForSynchronization); - //main method for putting gridData on UI: maps data respecting current view settings void writeGrid(const FileCompareResult& gridData, bool useUI_GridCache = false); - void mapFileModelToUI(UI_Grid& output, const FileCompareResult& fileCmpResult); - void updateStatusInformation(const UI_Grid& output); + void mapGridDataToUI(GridView& output, const FileCompareResult& fileCmpResult); + void updateStatusInformation(const GridView& output); //context menu functions set<int> getSelectedRows(); @@ -100,7 +74,6 @@ private: //delayed status information restore void pushStatusInformation(const wxString& text); - void writeStatusInformation(const wxString& text); void clearStatusBar(); //events @@ -137,24 +110,36 @@ private: void OnRightOnlyFiles( wxCommandEvent& event); void OnEqualFiles( wxCommandEvent& event); + void OnBatchJob( wxCommandEvent& event); void OnSaveConfig( wxCommandEvent& event); void OnLoadConfiguration( wxCommandEvent& event); void OnChoiceKeyEvent( wxKeyEvent& event ); - void onResizeMainWindow(wxEvent& event); + void onResizeMainWindow( wxEvent& event); void OnAbortCompare( wxCommandEvent& event); void OnFilterButton( wxCommandEvent& event); void OnHideFilteredButton( wxCommandEvent& event); void OnConfigureFilter( wxHyperlinkEvent& event); void OnShowHelpDialog( wxCommandEvent& event); void OnSwapDirs( wxCommandEvent& event); - void OnChangeCompareVariant(wxCommandEvent& event); + void OnCompareByTimeSize( wxCommandEvent& event); + void OnCompareByContent( wxCommandEvent& event); void OnCompare( wxCommandEvent& event); void OnSync( wxCommandEvent& event); void OnClose( wxCloseEvent& event); void OnQuit( wxCommandEvent& event); void OnAbout( wxCommandEvent& event); + //menu events + void OnMenuExportFileList( wxCommandEvent& event); + void OnMenuBatchJob( wxCommandEvent& event); + void OnMenuAbout( wxCommandEvent& event); + void OnMenuQuit( wxCommandEvent& event); + void OnMenuLangEnglish( wxCommandEvent& event); + void OnMenuLangGerman( wxCommandEvent& event); + + void enableSynchronization(bool value); + //*********************************************** //global application variables are stored here: @@ -162,16 +147,9 @@ private: FileCompareResult currentGridData; //UI view of currentGridData - UI_Grid currentUI_View; - - //Synchronisation settings - SyncConfiguration syncConfiguration; + GridView gridRefUI; - //Filter setting - wxString includeFilter; - wxString excludeFilter; - bool hideFiltered; - bool filterIsActive; + Configuration cfg; //UI View Filter settings bool leftOnlyFilesActive; @@ -187,19 +165,14 @@ private: int posXNotMaximized; int posYNotMaximized; - //other options - bool useRecycleBin; //use Recycle bin when deleting or overwriting files while synchronizing - bool hideErrorMessages; //hides error messages during synchronization - //*********************************************** - - wxFrame* parent; - wxMenu* contextMenu; + CustomLocale* programLanguage; + //status information wxLongLong lastStatusChange; - int stackObjects; + stack<wxString> stackObjects; //save the last used config filenames wxConfig* cfgFileHistory; @@ -210,6 +183,10 @@ private: bool filteringInitialized; bool filteringPending; + bool synchronizationEnabled; //determines whether synchronization should be allowed + + bool restartOnExit; //restart dialog on exit (currently used, when language is changed) + CompareStatusUpdater* cmpStatusUpdaterTmp; //used only by the abort button when comparing }; @@ -239,8 +216,6 @@ private: //###################################################################################### //classes handling sync and compare error as well as status information -class CompareStatus; -class SyncStatus; class CompareStatusUpdater : public StatusUpdater { @@ -257,8 +232,8 @@ public: private: MainDialog* mainDialog; - bool suppressUI_Errormessages; CompareStatus* statusPanel; + bool continueOnError; int currentProcess; }; @@ -266,7 +241,7 @@ private: class SyncStatusUpdater : public StatusUpdater { public: - SyncStatusUpdater(wxWindow* dlg, bool hideErrorMessages); + SyncStatusUpdater(wxWindow* dlg, bool continueOnError); ~SyncStatusUpdater(); void updateStatusText(const wxString& text); @@ -279,7 +254,7 @@ public: private: SyncStatus* syncStatusFrame; - bool suppressUI_Errormessages; + bool continueError; wxArrayString unhandledErrors; //list of non-resolved errors }; diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp index 4e1cc148..36c5cae4 100644 --- a/ui/SmallDialogs.cpp +++ b/ui/SmallDialogs.cpp @@ -1,9 +1,11 @@ #include "smallDialogs.h" #include "../library/globalFunctions.h" -#include <fstream> +//#include <fstream> +#include "../library/resources.h" using namespace globalFunctions; + AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) { m_bitmap9->SetBitmap(*GlobalResources::bitmapWebsite); @@ -11,23 +13,27 @@ AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) m_bitmap11->SetBitmap(*GlobalResources::bitmapLogo); m_bitmap13->SetBitmap(*GlobalResources::bitmapGPL); - m_animationControl1->SetAnimation(*GlobalResources::animationMoney); - m_animationControl1->Play(); - //build wxString build = wxString(_("(Build: ")) + __TDATE__ + ")"; m_build->SetLabel(build); + m_animationControl1->SetAnimation(*GlobalResources::animationMoney); + m_animationControl1->Play(); //Note: The animation is created hidden(!) to not disturb constraint based window creation; + m_animationControl1->Show(); //an empty animation consumes a lot of space that later is NOT removed anymore. + m_button8->SetFocus(); } + AboutDlg::~AboutDlg() {} + void AboutDlg::OnClose(wxCloseEvent& event) { Destroy(); } + void AboutDlg::OnOK(wxCommandEvent& event) { Destroy(); @@ -106,7 +112,7 @@ void FilterDlg::OnDefault(wxCommandEvent& event) //######################################################################################## DeleteDialog::DeleteDialog(const wxString& headerText, const wxString& messageText, wxWindow* main) : - DeleteDialogGenerated(main) + DeleteDlgGenerated(main) { m_staticTextHeader->SetLabel(headerText); m_textCtrlMessage->SetValue(messageText); @@ -135,9 +141,9 @@ void DeleteDialog::OnClose(wxCloseEvent& event) //######################################################################################## -ErrorDlg::ErrorDlg(const wxString messageText, bool& suppressErrormessages) : +ErrorDlg::ErrorDlg(const wxString messageText, bool& continueError) : ErrorDlgGenerated(0), - suppressErrors(suppressErrormessages) + continueOnError(continueError) { m_bitmap10->SetBitmap(*GlobalResources::bitmapWarning); m_textCtrl8->SetValue(messageText); @@ -150,28 +156,28 @@ ErrorDlg::~ErrorDlg() {} void ErrorDlg::OnClose(wxCloseEvent& event) { - //suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here + //continueOnError = m_checkBoxContinueError->GetValue(); -> not needed here EndModal(abortButtonPressed); } void ErrorDlg::OnContinue(wxCommandEvent& event) { - suppressErrors = m_checkBoxSuppress->GetValue(); + continueOnError = m_checkBoxContinueError->GetValue(); EndModal(continueButtonPressed); } void ErrorDlg::OnRetry(wxCommandEvent& event) { - //suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here + //continueOnError = m_checkBoxContinueError->GetValue(); -> not needed here EndModal(retryButtonPressed); } void ErrorDlg::OnAbort(wxCommandEvent& event) { - //suppressErrors = m_checkBoxSuppress->GetValue(); -> not needed here + //continueOnError = m_checkBoxContinueError->GetValue(); -> not needed here EndModal(abortButtonPressed); } //######################################################################################## @@ -270,7 +276,7 @@ wxLongLong RemainingTime::getRemainingTime(double processedDataSinceLastCall, in //######################################################################################## SyncStatus::SyncStatus(StatusUpdater* updater, wxWindow* parentWindow) : - SyncStatusGenerated(parentWindow), + SyncStatusDlgGenerated(parentWindow), currentStatusUpdater(updater), windowToDis(parentWindow), currentProcessIsRunning(true), @@ -278,10 +284,10 @@ SyncStatus::SyncStatus(StatusUpdater* updater, wxWindow* parentWindow) : currentData(0), scalingFactor(0), currentObjects(0), - totalObjects(0) + totalObjects(0), + processPaused(false) { m_animationControl1->SetAnimation(*GlobalResources::animationSync); - m_animationControl1->SetInactiveBitmap(*GlobalResources::bitmapFinished); m_animationControl1->Play(); //initialize gauge @@ -351,7 +357,15 @@ void SyncStatus::updateStatusDialogNow() m_staticTextDataRemaining->SetLabel(remainingBytes); //do the ui update + bSizer28->Layout(); updateUI_Now(); + + //support for pause button + while (processPaused && currentProcessIsRunning) + { + wxMilliSleep(uiUpdateInterval); + updateUI_Now(); + } } @@ -399,16 +413,22 @@ void SyncStatus::setCurrentStatus(SyncStatusID id) void SyncStatus::processHasFinished(SyncStatusID id) //essential to call this in StatusUpdater derived class destructor { //at the LATEST(!) to prevent access to currentStatusUpdater - currentProcessIsRunning = false; //enable okay and close events + currentProcessIsRunning = false; //enable okay and close events; may be set ONLY in this method setCurrentStatus(id); + m_buttonAbort->Disable(); m_buttonAbort->Hide(); + m_buttonPause->Disable(); + m_buttonPause->Hide(); m_buttonOK->Show(); m_buttonOK->SetFocus(); m_animationControl1->Stop(); + //m_animationControl1->SetInactiveBitmap(*GlobalResources::bitmapFinished); + m_animationControl1->Hide(); + updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed Layout(); // } @@ -420,14 +440,34 @@ void SyncStatus::OnOkay(wxCommandEvent& event) } +void SyncStatus::OnPause(wxCommandEvent& event) +{ + if (processPaused) + { + processPaused = false; + m_buttonPause->SetLabel(_("Pause")); + m_animationControl1->Play(); + + } + else + { + processPaused = true; + m_buttonPause->SetLabel(_("Continue")); + m_animationControl1->Stop(); + } +} + + void SyncStatus::OnAbort(wxCommandEvent& event) { + processPaused = false; if (currentProcessIsRunning) currentStatusUpdater->requestAbortion(); } void SyncStatus::OnClose(wxCloseEvent& event) { + processPaused = false; if (currentProcessIsRunning) currentStatusUpdater->requestAbortion(); else Destroy(); @@ -449,6 +489,11 @@ CompareStatus::CompareStatus(wxWindow* parentWindow) : { //initialize gauge m_gauge2->SetRange(50000); m_gauge2->SetValue(0); + + //initially hide status that's relevant for comparing bytewise only + bSizer42->Hide(sbSizer13); + bSizer42->Hide(sbSizer11); + bSizer42->Layout(); } @@ -467,6 +512,11 @@ void CompareStatus::resetCmpGauge(int totalCmpObjectsToProcess, double totalCmpD scalingFactorCmp = 50000 / totalCmpData; //let's normalize to 50000 else scalingFactorCmp = 0; + + //show status for comparing bytewise + bSizer42->Show(sbSizer13); + bSizer42->Show(sbSizer11); + bSizer42->Layout(); } @@ -481,8 +531,8 @@ void CompareStatus::incProcessedCmpData_NoUpdate(int objectsProcessed, double da processedCmpData+= dataProcessed; processedCmpObjects+= objectsProcessed; -/* timeRemaining = calcTimeLeft.getRemainingTime(dataProcessed, totalCmpObjects - processedCmpObjects, totalCmpData - processedCmpData); - timeRemainingTimeStamp = wxGetLocalTimeMillis();*/ + /* timeRemaining = calcTimeLeft.getRemainingTime(dataProcessed, totalCmpObjects - processedCmpObjects, totalCmpData - processedCmpData); + timeRemainingTimeStamp = wxGetLocalTimeMillis();*/ } @@ -508,14 +558,15 @@ void CompareStatus::updateStatusPanelNow() //remaining bytes left for file comparison const wxString remainingBytes = FreeFileSync::formatFilesizeToShortString(totalCmpData - processedCmpData); m_staticTextDataToCompare->SetLabel(remainingBytes); -/* - //remaining time in seconds - if (timeRemaining != 0) - { - int time = ((timeRemaining - (wxGetLocalTimeMillis() - timeRemainingTimeStamp)) / 1000).GetLo(); - m_staticTextRemainingTime->SetLabel(numberToWxString(time) + " s"); - } -*/ + /* + //remaining time in seconds + if (timeRemaining != 0) + { + int time = ((timeRemaining - (wxGetLocalTimeMillis() - timeRemainingTimeStamp)) / 1000).GetLo(); + m_staticTextRemainingTime->SetLabel(numberToWxString(time) + " s"); + } + */ //do the ui update + bSizer42->Layout(); updateUI_Now(); } diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h index 0eb22395..c6495c83 100644 --- a/ui/SmallDialogs.h +++ b/ui/SmallDialogs.h @@ -1,9 +1,8 @@ #ifndef SMALLDIALOGS_H_INCLUDED #define SMALLDIALOGS_H_INCLUDED -#include "mainDialog.h" - -class MainDialog; +#include "../FreeFileSync.h" +#include "guiGenerated.h" class AboutDlg : public AboutDlgGenerated { @@ -48,7 +47,7 @@ private: }; -class DeleteDialog : public DeleteDialogGenerated +class DeleteDialog : public DeleteDlgGenerated { public: DeleteDialog(const wxString& headerText, const wxString& messageText, wxWindow* main); @@ -67,7 +66,7 @@ private: class ErrorDlg : public ErrorDlgGenerated { public: - ErrorDlg(const wxString messageText, bool& suppressErrormessages); + ErrorDlg(const wxString messageText, bool& continueError); ~ErrorDlg(); static const int continueButtonPressed = 35; @@ -80,28 +79,27 @@ private: void OnRetry(wxCommandEvent& event); void OnAbort(wxCommandEvent& event); - bool& suppressErrors; -}; - - -enum SyncStatusID -{ - statusAborted, - statusCompletedWithSuccess, - statusCompletedWithErrors, - statusPause, - statusScanning, - statusComparing, - statusSynchronizing + bool& continueOnError; }; -class SyncStatus : public SyncStatusGenerated +class SyncStatus : public SyncStatusDlgGenerated { public: SyncStatus(StatusUpdater* updater, wxWindow* parentWindow = 0); ~SyncStatus(); + enum SyncStatusID + { + statusAborted, + statusCompletedWithSuccess, + statusCompletedWithErrors, + statusPause, + statusScanning, + statusComparing, + statusSynchronizing + }; + void resetGauge(int totalObjectsToProcess, double totalDataToProcess); void incProgressIndicator_NoUpdate(int objectsProcessed, double dataProcessed); void setStatusText_NoUpdate(const wxString& text); @@ -112,6 +110,7 @@ public: private: void OnOkay(wxCommandEvent& event); + void OnPause(wxCommandEvent& event); void OnAbort(wxCommandEvent& event); void OnClose(wxCloseEvent& event); @@ -127,6 +126,7 @@ private: int totalObjects; wxString currentStatusText; + bool processPaused; }; /* @@ -178,12 +178,12 @@ private: double scalingFactorCmp; //nr of elements has to be normalized to smaller nr. because of range of int limitation int processedCmpObjects; //each object represents a file or directory processed int totalCmpObjects; -/* - //remaining time - RemainingTime calcTimeLeft; - wxLongLong timeRemaining; //time in milliseconds - wxLongLong timeRemainingTimeStamp; //time in milliseconds -*/ + /* + //remaining time + RemainingTime calcTimeLeft; + wxLongLong timeRemaining; //time in milliseconds + wxLongLong timeRemainingTimeStamp; //time in milliseconds + */ }; diff --git a/ui/SyncDialog.cpp b/ui/SyncDialog.cpp index b97badf8..c138544e 100644 --- a/ui/SyncDialog.cpp +++ b/ui/SyncDialog.cpp @@ -1,25 +1,44 @@ #include "syncDialog.h" #include "../library/globalFunctions.h" - -SyncDialog::SyncDialog(MainDialog* window) - : SyncDialogGenerated(window), mainDialog(window) +#include "../library/resources.h" +#include <wx/msgdlg.h> +#include <wx/file.h> +#include <wx/stdpaths.h> + +SyncDialog::SyncDialog(wxWindow* window, + const FileCompareResult& gridDataRef, + Configuration& config, + bool synchronizationEnabled) : + SyncDlgGenerated(window), + gridData(gridDataRef), + cfg(config) { - //make working copy of mainDialog->syncConfiguration and recycler setting - localSyncConfiguration = mainDialog->syncConfiguration; + //make working copy of mainDialog.cfg.syncConfiguration and recycler setting + localSyncConfiguration = config.syncConfiguration; + m_checkBoxUseRecycler->SetValue(cfg.useRecycleBin); + m_checkBoxContinueError->SetValue(cfg.continueOnError); - m_checkBoxUseRecycler->SetValue(mainDialog->useRecycleBin); - m_checkBoxHideErrors->SetValue(mainDialog->hideErrorMessages); + //set sync config icons + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + //update preview + calculatePreview(); //set icons for this dialog m_bpButton18->SetBitmapLabel(*GlobalResources::bitmapStartSync); + m_bpButton18->SetBitmapDisabled(*GlobalResources::bitmapStartSyncDis); m_bitmap13->SetBitmap(*GlobalResources::bitmapLeftOnlyDeact); m_bitmap14->SetBitmap(*GlobalResources::bitmapRightOnlyDeact); m_bitmap15->SetBitmap(*GlobalResources::bitmapLeftNewerDeact); m_bitmap16->SetBitmap(*GlobalResources::bitmapRightNewerDeact); m_bitmap17->SetBitmap(*GlobalResources::bitmapDifferentDeact); - //set sync config icons - updateConfigIcons(); + if (synchronizationEnabled) + m_bpButton18->Enable(); + else + { + m_bpButton18->Disable(); + m_button6->SetFocus(); + } //set radiobutton if (localSyncConfiguration.exLeftSideOnly == syncDirRight && @@ -47,99 +66,122 @@ SyncDialog::SyncDialog(MainDialog* window) SyncDialog::~SyncDialog() {} -void SyncDialog::updateConfigIcons() +void SyncDialog::updateConfigIcons(wxBitmapButton* button1, + wxBitmapButton* button2, + wxBitmapButton* button3, + wxBitmapButton* button4, + wxBitmapButton* button5, + const SyncConfiguration& syncConfig) { - if (localSyncConfiguration.exLeftSideOnly == syncDirRight) + if (syncConfig.exLeftSideOnly == syncDirRight) { - m_bpButton5->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton5->SetToolTip(_("Copy from left to right")); + button1->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button1->SetToolTip(_("Copy from left to right")); } - else if (localSyncConfiguration.exLeftSideOnly == syncDirLeft) + else if (syncConfig.exLeftSideOnly == syncDirLeft) { - m_bpButton5->SetBitmapLabel(*GlobalResources::bitmapDelete); - m_bpButton5->SetToolTip(_("Delete files existing on left side only")); + button1->SetBitmapLabel(*GlobalResources::bitmapDelete); + button1->SetToolTip(_("Delete files/folders existing on left side only")); } - else if (localSyncConfiguration.exLeftSideOnly == syncDirNone) + else if (syncConfig.exLeftSideOnly == syncDirNone) { - m_bpButton5->SetBitmapLabel(wxNullBitmap); - m_bpButton5->SetToolTip(_("Do nothing")); + button1->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button1->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.exRightSideOnly == syncDirRight) + if (syncConfig.exRightSideOnly == syncDirRight) { - m_bpButton6->SetBitmapLabel(*GlobalResources::bitmapDelete); - m_bpButton6->SetToolTip(_("Delete files existing on right side only")); + button2->SetBitmapLabel(*GlobalResources::bitmapDelete); + button2->SetToolTip(_("Delete files/folders existing on right side only")); } - else if (localSyncConfiguration.exRightSideOnly == syncDirLeft) + else if (syncConfig.exRightSideOnly == syncDirLeft) { - m_bpButton6->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton6->SetToolTip(_("Copy from right to left")); + button2->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button2->SetToolTip(_("Copy from right to left")); } - else if (localSyncConfiguration.exRightSideOnly == syncDirNone) + else if (syncConfig.exRightSideOnly == syncDirNone) { - m_bpButton6->SetBitmapLabel(wxNullBitmap); - m_bpButton6->SetToolTip(_("Do nothing")); + button2->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button2->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.leftNewer == syncDirRight) + if (syncConfig.leftNewer == syncDirRight) { - m_bpButton7->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton7->SetToolTip(_("Copy from left to right overwriting")); + button3->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button3->SetToolTip(_("Copy from left to right overwriting")); } - else if (localSyncConfiguration.leftNewer == syncDirLeft) + else if (syncConfig.leftNewer == syncDirLeft) { - m_bpButton7->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton7->SetToolTip(_("Copy from right to left overwriting")); + button3->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button3->SetToolTip(_("Copy from right to left overwriting")); } - else if (localSyncConfiguration.leftNewer == syncDirNone) + else if (syncConfig.leftNewer == syncDirNone) { - m_bpButton7->SetBitmapLabel(wxNullBitmap); - m_bpButton7->SetToolTip(_("Do nothing")); + button3->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button3->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.rightNewer == syncDirRight) + if (syncConfig.rightNewer == syncDirRight) { - m_bpButton8->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton8->SetToolTip(_("Copy from left to right overwriting")); + button4->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button4->SetToolTip(_("Copy from left to right overwriting")); } - else if (localSyncConfiguration.rightNewer == syncDirLeft) + else if (syncConfig.rightNewer == syncDirLeft) { - m_bpButton8->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton8->SetToolTip(_("Copy from right to left overwriting")); + button4->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button4->SetToolTip(_("Copy from right to left overwriting")); } - else if (localSyncConfiguration.rightNewer == syncDirNone) + else if (syncConfig.rightNewer == syncDirNone) { - m_bpButton8->SetBitmapLabel(wxNullBitmap); - m_bpButton8->SetToolTip(_("Do nothing")); + button4->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button4->SetToolTip(_("Do nothing")); } - if (localSyncConfiguration.different == syncDirRight) + if (syncConfig.different == syncDirRight) { - m_bpButton9->SetBitmapLabel(*GlobalResources::bitmapRightArrow); - m_bpButton9->SetToolTip(_("Copy from left to right overwriting")); + button5->SetBitmapLabel(*GlobalResources::bitmapRightArrow); + button5->SetToolTip(_("Copy from left to right overwriting")); } - else if (localSyncConfiguration.different == syncDirLeft) + else if (syncConfig.different == syncDirLeft) { - m_bpButton9->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); - m_bpButton9->SetToolTip(_("Copy from right to left overwriting")); + button5->SetBitmapLabel(*GlobalResources::bitmapLeftArrow); + button5->SetToolTip(_("Copy from right to left overwriting")); } - else if (localSyncConfiguration.different == syncDirNone) + else if (syncConfig.different == syncDirNone) { - m_bpButton9->SetBitmapLabel(wxNullBitmap); - m_bpButton9->SetToolTip(_("Do nothing")); + button5->SetBitmapLabel(*GlobalResources::bitmapNoArrow); + button5->SetToolTip(_("Do nothing")); } +} - //update preview of bytes to be transferred: - int objectsTotal = 0; - double dataTotal = 0; - FreeFileSync::calcTotalBytesToSync(objectsTotal, dataTotal, mainDialog->currentGridData, localSyncConfiguration); - - wxString objects = globalFunctions::numberToWxString(objectsTotal); - globalFunctions::includeNumberSeparator(objects); - wxString data = FreeFileSync::formatFilesizeToShortString(dataTotal); - m_textCtrl12->SetValue(objects); - m_textCtrl5->SetValue(data); +void SyncDialog::calculatePreview() +{ + //update preview of bytes to be transferred: + int objectsToCreate = 0; + int objectsToOverwrite = 0; + int objectsToDelete = 0; + double dataToProcess = 0; + FreeFileSync::calcTotalBytesToSync(objectsToCreate, + objectsToOverwrite, + objectsToDelete, + dataToProcess, + gridData, + localSyncConfiguration); + + wxString toCreate = globalFunctions::numberToWxString(objectsToCreate); + wxString toUpdate = globalFunctions::numberToWxString(objectsToOverwrite); + wxString toDelete = globalFunctions::numberToWxString(objectsToDelete); + wxString data = FreeFileSync::formatFilesizeToShortString(dataToProcess); + + globalFunctions::includeNumberSeparator(toCreate); + globalFunctions::includeNumberSeparator(toUpdate); + globalFunctions::includeNumberSeparator(toDelete); + + m_textCtrlCreate->SetValue(toCreate); + m_textCtrlUpdate->SetValue(toUpdate); + m_textCtrlDelete->SetValue(toDelete); + m_textCtrlData->SetValue(data); } @@ -158,9 +200,9 @@ void SyncDialog::OnCancel(wxCommandEvent& event) void SyncDialog::OnBack(wxCommandEvent& event) { //write configuration to main dialog - mainDialog->syncConfiguration = localSyncConfiguration; - mainDialog->useRecycleBin = m_checkBoxUseRecycler->GetValue(); - mainDialog->hideErrorMessages = m_checkBoxHideErrors->GetValue(); + cfg.syncConfiguration = localSyncConfiguration; + cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); + cfg.continueOnError = m_checkBoxContinueError->GetValue(); EndModal(0); } @@ -168,9 +210,9 @@ void SyncDialog::OnBack(wxCommandEvent& event) void SyncDialog::OnStartSync(wxCommandEvent& event) { //write configuration to main dialog - mainDialog->syncConfiguration = localSyncConfiguration; - mainDialog->useRecycleBin = m_checkBoxUseRecycler->GetValue(); - mainDialog->hideErrorMessages = m_checkBoxHideErrors->GetValue(); + cfg.syncConfiguration = localSyncConfiguration; + cfg.useRecycleBin = m_checkBoxUseRecycler->GetValue(); + cfg.continueOnError = m_checkBoxContinueError->GetValue(); EndModal(StartSynchronizationProcess); } @@ -189,7 +231,7 @@ void SyncDialog::OnSelectRecycleBin(wxCommandEvent& event) } -void SyncDialog::OnSyncLeftToRight( wxCommandEvent& event ) +void SyncDialog::OnSyncLeftToRight(wxCommandEvent& event) { localSyncConfiguration.exLeftSideOnly = syncDirRight; localSyncConfiguration.exRightSideOnly = syncDirRight; @@ -197,14 +239,15 @@ void SyncDialog::OnSyncLeftToRight( wxCommandEvent& event ) localSyncConfiguration.rightNewer = syncDirRight; localSyncConfiguration.different = syncDirRight; - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //if event is triggered by button m_radioBtn1->SetValue(true); } -void SyncDialog::OnSyncBothSides( wxCommandEvent& event ) +void SyncDialog::OnSyncBothSides(wxCommandEvent& event) { localSyncConfiguration.exLeftSideOnly = syncDirRight; localSyncConfiguration.exRightSideOnly = syncDirLeft; @@ -212,7 +255,9 @@ void SyncDialog::OnSyncBothSides( wxCommandEvent& event ) localSyncConfiguration.rightNewer = syncDirLeft; localSyncConfiguration.different = syncDirNone; - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); + //if event is triggered by button m_radioBtn2->SetValue(true); } @@ -233,7 +278,8 @@ void toggleSyncDirection(SyncDirection& current) void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -241,7 +287,8 @@ void SyncDialog::OnExLeftSideOnly( wxCommandEvent& event ) void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.exRightSideOnly); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -249,7 +296,8 @@ void SyncDialog::OnExRightSideOnly( wxCommandEvent& event ) void SyncDialog::OnLeftNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.leftNewer); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -257,7 +305,8 @@ void SyncDialog::OnLeftNewer( wxCommandEvent& event ) void SyncDialog::OnRightNewer( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.rightNewer); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } @@ -265,7 +314,264 @@ void SyncDialog::OnRightNewer( wxCommandEvent& event ) void SyncDialog::OnDifferent( wxCommandEvent& event ) { toggleSyncDirection(localSyncConfiguration.different); - updateConfigIcons(); + updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + calculatePreview(); //set custom config button m_radioBtn3->SetValue(true); } + +//################################################################################################################################### + + +BatchDialog::BatchDialog(wxWindow* window, + const Configuration& config, + const wxString& leftDir, + const wxString& rightDir) : + BatchDlgGenerated(window) +{ + //make working copy of mainDialog.cfg.syncConfiguration and recycler setting + localSyncConfiguration = config.syncConfiguration; + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); + + m_checkBoxUseRecycler->SetValue(config.useRecycleBin); + m_checkBoxContinueError->SetValue(config.continueOnError); + + switch (config.compareVar) + { + case compareByTimeAndSize: + m_radioBtnSizeDate->SetValue(true); + break; + case compareByContent: + m_radioBtnContent->SetValue(true); + break; + default: + assert (false); + } + + filterIsActive = config.filterIsActive; + updateFilterButton(); + + m_textCtrlInclude->SetValue(config.includeFilter); + m_textCtrlExclude->SetValue(config.excludeFilter); + + m_directoryPanel1->SetValue(leftDir); + m_directoryPanel2->SetValue(rightDir); + + //set icons for this dialog + m_bitmap13->SetBitmap(*GlobalResources::bitmapLeftOnlyDeact); + m_bitmap14->SetBitmap(*GlobalResources::bitmapRightOnlyDeact); + m_bitmap15->SetBitmap(*GlobalResources::bitmapLeftNewerDeact); + m_bitmap16->SetBitmap(*GlobalResources::bitmapRightNewerDeact); + m_bitmap17->SetBitmap(*GlobalResources::bitmapDifferentDeact); + m_bitmap8->SetBitmap(*GlobalResources::bitmapInclude); + m_bitmap9->SetBitmap(*GlobalResources::bitmapExclude); + + m_buttonCreate->SetFocus(); +} + +BatchDialog::~BatchDialog() +{} + + +void BatchDialog::updateFilterButton() +{ + if (filterIsActive) + { + m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOn); + m_bpButtonFilter->SetToolTip(_("Filter active: Press again to deactivate")); + + m_textCtrlInclude->Enable(); + m_textCtrlExclude->Enable(); + } + else + { + m_bpButtonFilter->SetBitmapLabel(*GlobalResources::bitmapFilterOff); + m_bpButtonFilter->SetToolTip(_("Press button to activate filter")); + + m_textCtrlInclude->Disable(); + m_textCtrlExclude->Disable(); + } +} + + +void BatchDialog::OnExLeftSideOnly(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.exLeftSideOnly); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnExRightSideOnly(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.exRightSideOnly); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnLeftNewer(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.leftNewer); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnRightNewer(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.rightNewer); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + +void BatchDialog::OnDifferent(wxCommandEvent& event) +{ + toggleSyncDirection(localSyncConfiguration.different); + SyncDialog::updateConfigIcons(m_bpButton5, m_bpButton6, m_bpButton7, m_bpButton8, m_bpButton9, localSyncConfiguration); +} + + +void BatchDialog::OnFilterButton(wxCommandEvent& event) +{ + filterIsActive = !filterIsActive; + updateFilterButton(); +} + + +void BatchDialog::OnSelectRecycleBin(wxCommandEvent& event) +{ + if (event.IsChecked()) + { + if (!FreeFileSync::recycleBinExists()) + { + wxMessageBox(_("It was not possible to gain access to Recycle Bin!\n\nIt's likely that you are not using Windows XP. (Probably Vista)\nIf you want this feature included, please contact the author. :)"), _("Error") , wxOK | wxICON_ERROR); + m_checkBoxUseRecycler->SetValue(false); + } + } +} + + +void BatchDialog::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void BatchDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void BatchDialog::OnCreateJob(wxCommandEvent& event) +{ + //get a filename +#ifdef FFS_WIN + wxString fileName = "SyncJob.cmd"; //proposal + wxFileDialog* filePicker = new wxFileDialog(this, "", "", fileName, wxString(_("Command file")) + " (*.cmd)|*.cmd", wxFD_SAVE); +#elif defined FFS_LINUX + wxString fileName = "SyncJob.sh"; //proposal + wxFileDialog* filePicker = new wxFileDialog(this, "", "", fileName, wxString(_("Shell script")) + " (*.sh)|*.sh", wxFD_SAVE); +#else + assert(false); +#endif + + if (filePicker->ShowModal() == wxID_OK) + { + fileName = filePicker->GetPath(); + if (wxFileExists(fileName)) + { + wxMessageDialog* messageDlg = new wxMessageDialog(this, wxString("\"") + fileName + "\"" + _(" already exists. Overwrite?"), _("Warning") , wxOK | wxCANCEL); + + if (messageDlg->ShowModal() != wxID_OK) + { + event.Skip(); + return; + } + } + + //assemble command line parameters + wxString outputString = parseConfiguration(); + + //write export file + wxFile output(fileName, wxFile::write); + if (output.IsOpened()) + { + output.Write(outputString); + EndModal(batchFileCreated); + } + else + wxMessageBox(wxString(_("Could not write to ")) + "\"" + fileName + "\"", _("An exception occured!"), wxOK | wxICON_ERROR); + } + +#ifdef FFS_LINUX + //for linux the batch file needs the executable flag + wxExecute(wxString("chmod +x ") + fileName); +#endif // FFS_LINUX + + event.Skip(); +} + + +wxString getFormattedSyncDirection(const SyncDirection direction) +{ + if (direction == syncDirRight) + return 'R'; + else if (direction == syncDirLeft) + return 'L'; + else if (direction == syncDirNone) + return 'N'; + else + { + assert (false); + return wxEmptyString; + } +} + + +wxString BatchDialog::parseConfiguration() +{ + wxString output; + +#ifdef FFS_LINUX + //shell script identifier + output+= "#!/bin/bash\n"; +#endif + + output+= "\"" + wxStandardPaths::Get().GetExecutablePath() + "\""; + + output+= wxString(" -") + GlobalResources::paramCompare + " "; + if (m_radioBtnSizeDate->GetValue()) + output+= GlobalResources::valueSizeDate; + else if (m_radioBtnContent->GetValue()) + output+= GlobalResources::valueContent; + else + assert(false); + + output+= wxString(" -") + GlobalResources::paramCfg + " " + + getFormattedSyncDirection(localSyncConfiguration.exLeftSideOnly) + + getFormattedSyncDirection(localSyncConfiguration.exRightSideOnly) + + getFormattedSyncDirection(localSyncConfiguration.leftNewer) + + getFormattedSyncDirection(localSyncConfiguration.rightNewer) + + getFormattedSyncDirection(localSyncConfiguration.different); + + if (filterIsActive) + { + output+= wxString(" -") + GlobalResources::paramInclude + " " + + "\"" + m_textCtrlInclude->GetValue() + "\""; + + output+= wxString(" -") + GlobalResources::paramExclude + " " + + "\"" + m_textCtrlExclude->GetValue() + "\""; + } + + if (m_checkBoxUseRecycler->GetValue()) + output+= wxString(" -") + GlobalResources::paramRecycler; + + if (m_checkBoxContinueError->GetValue()) + output+= wxString(" -") + GlobalResources::paramContinueError; + + if (m_checkBoxSilent->GetValue()) + output+= wxString(" -") + GlobalResources::paramSilent; + + output+= wxString(" ") + "\"" + m_directoryPanel1->GetValue() + "\""; + output+= wxString(" ") + "\"" + m_directoryPanel2->GetValue() + "\""; + + output+= "\n"; + + return output; +} + diff --git a/ui/SyncDialog.h b/ui/SyncDialog.h index 23d8ce5b..9e79c7d2 100644 --- a/ui/SyncDialog.h +++ b/ui/SyncDialog.h @@ -1,41 +1,85 @@ #ifndef SYNCDIALOG_H_INCLUDED #define SYNCDIALOG_H_INCLUDED -#include "mainDialog.h" +#include "../FreeFileSync.h" +#include "guiGenerated.h" -class MainDialog; - -class SyncDialog: public SyncDialogGenerated +class SyncDialog: public SyncDlgGenerated { public: - SyncDialog(MainDialog* window); + SyncDialog(wxWindow* window, + const FileCompareResult& gridDataRef, + Configuration& config, + bool synchronizationEnabled); + ~SyncDialog(); static const int StartSynchronizationProcess = 15; + static void updateConfigIcons(wxBitmapButton* button1, + wxBitmapButton* button2, + wxBitmapButton* button3, + wxBitmapButton* button4, + wxBitmapButton* button5, + const SyncConfiguration& syncConfig); + private: - //temporal copy of maindialog->syncConfiguration + void calculatePreview(); + + void OnSyncLeftToRight( wxCommandEvent& event); + void OnSyncBothSides( wxCommandEvent& event); + + void OnExLeftSideOnly( wxCommandEvent& event); + void OnExRightSideOnly( wxCommandEvent& event); + void OnLeftNewer( wxCommandEvent& event); + void OnRightNewer( wxCommandEvent& event); + void OnDifferent( wxCommandEvent& event); + + void OnStartSync( wxCommandEvent& event); + void OnClose( wxCloseEvent& event); + void OnBack( wxCommandEvent& event); + void OnCancel( wxCommandEvent& event); + + void OnSelectRecycleBin(wxCommandEvent& event); + + //temporal copy of maindialog.cfg.syncConfiguration SyncConfiguration localSyncConfiguration; + const FileCompareResult& gridData; + Configuration& cfg; +}; + - void updateConfigIcons(); +class BatchDialog: public BatchDlgGenerated +{ +public: + BatchDialog(wxWindow* window, + const Configuration& config, + const wxString& leftDir, + const wxString& rightDir); - void OnSyncLeftToRight( wxCommandEvent& event ); - void OnSyncBothSides( wxCommandEvent& event ); + ~BatchDialog(); - void OnExLeftSideOnly( wxCommandEvent& event ); - void OnExRightSideOnly( wxCommandEvent& event ); - void OnLeftNewer( wxCommandEvent& event ); - void OnRightNewer( wxCommandEvent& event ); - void OnDifferent( wxCommandEvent& event ); + static const int batchFileCreated = 15; - void OnStartSync(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - void OnBack(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); +private: + void OnExLeftSideOnly( wxCommandEvent& event); + void OnExRightSideOnly( wxCommandEvent& event); + void OnLeftNewer( wxCommandEvent& event); + void OnRightNewer( wxCommandEvent& event); + void OnDifferent( wxCommandEvent& event); + void OnFilterButton( wxCommandEvent& event); void OnSelectRecycleBin(wxCommandEvent& event); - MainDialog* mainDialog; + void OnClose( wxCloseEvent& event); + void OnCancel( wxCommandEvent& event); + void OnCreateJob( wxCommandEvent& event); + + void updateFilterButton(); + wxString parseConfiguration(); + + SyncConfiguration localSyncConfiguration; + bool filterIsActive; }; #endif // SYNCDIALOG_H_INCLUDED diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp index a6ad9e6c..56feba35 100644 --- a/ui/guiGenerated.cpp +++ b/ui/guiGenerated.cpp @@ -15,7 +15,7 @@ #include <wx/wx.h> #endif //WX_PRECOMP -#include "..\library\customGrid.h" +#include "../library/customGrid.h" #include "guiGenerated.h" @@ -25,93 +25,159 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + m_menubar1 = new wxMenuBar( 0 ); + m_menu1 = new wxMenu(); + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_menu1, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("CTRL-Q"), wxEmptyString, wxITEM_NORMAL ); + m_menu1->Append( m_menuItem4 ); + + m_menubar1->Append( m_menu1, _("&File") ); + + m_menu3 = new wxMenu(); + wxMenuItem* m_menuItem5; + m_menuItem5 = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Export file list") ) , wxEmptyString, wxITEM_NORMAL ); + m_menu3->Append( m_menuItem5 ); + + m_menu31 = new wxMenu(); + m_menuItemEnglish = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("English") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemEnglish ); + + m_menuItemGerman = new wxMenuItem( m_menu31, wxID_ANY, wxString( _("Deutsch") ) , wxEmptyString, wxITEM_RADIO ); + m_menu31->Append( m_menuItemGerman ); + + m_menu3->Append( -1, _("&Language"), m_menu31 ); + + m_menu3->AppendSeparator(); + + wxMenuItem* m_menuItem7; + m_menuItem7 = new wxMenuItem( m_menu3, wxID_ANY, wxString( _("&Create batch job") ) , wxEmptyString, wxITEM_NORMAL ); + m_menu3->Append( m_menuItem7 ); + + m_menubar1->Append( m_menu3, _("&Advanced") ); + + m_menu2 = new wxMenu(); + wxMenuItem* m_menuItem3; + m_menuItem3 = new wxMenuItem( m_menu2, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); + m_menu2->Append( m_menuItem3 ); + + m_menubar1->Append( m_menu2, _("&Help") ); + + this->SetMenuBar( m_menubar1 ); + bSizer1 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer6; + m_panel71 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel71->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); + bSizer6 = new wxBoxSizer( wxHORIZONTAL ); - bSizer6->Add( 40, 0, 0, wxEXPAND, 5 ); + bSizer6->Add( 40, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); wxBoxSizer* bSizer30; - bSizer30 = new wxBoxSizer( wxVERTICAL ); + bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - m_bpButtonCompare = new wxBitmapButton( this, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + m_bpButtonCompare = new wxBitmapButton( m_panel71, wxID_OK, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); m_bpButtonCompare->SetDefault(); m_bpButtonCompare->SetToolTip( _("Compare both sides") ); m_bpButtonCompare->SetToolTip( _("Compare both sides") ); - bSizer30->Add( m_bpButtonCompare, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bSizer30->Add( m_bpButtonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("Abort"), wxDefaultPosition, wxSize( 186,33 ), 0 ); + m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("Abort"), wxDefaultPosition, wxSize( 190,37 ), 0 ); m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Tahoma") ) ); + m_buttonAbort->Enable( false ); m_buttonAbort->Hide(); - bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); bSizer6->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); + wxBoxSizer* bSizer55; + bSizer55 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by") ), wxVERTICAL ); + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( m_panel71, wxID_ANY, _("Compare by...") ), wxHORIZONTAL ); - m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); + wxBoxSizer* bSizer45; + bSizer45 = new wxBoxSizer( wxVERTICAL ); + + m_radioBtnSizeDate = new wxRadioButton( m_panel71, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtnSizeDate->SetValue( true ); m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time (UTC) and date\nare the same.") ); - sbSizer6->Add( m_radioBtnSizeDate, 0, wxRIGHT|wxLEFT, 5 ); + bSizer45->Add( m_radioBtnSizeDate, 0, 0, 5 ); - m_radioBtnContent = new wxRadioButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnContent = new wxRadioButton( m_panel71, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); - sbSizer6->Add( m_radioBtnContent, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + bSizer45->Add( m_radioBtnContent, 0, wxTOP, 5 ); + + sbSizer6->Add( bSizer45, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton14 = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer6->Add( m_bpButton14, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL, 2 ); + - bSizer6->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 2 ); + bSizer55->Add( 0, 4, 0, 0, 5 ); - m_bpButton14 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - bSizer6->Add( m_bpButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + bSizer6->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer6->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer56; + bSizer56 = new wxBoxSizer( wxVERTICAL ); wxStaticBoxSizer* sbSizer9; - sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Filter files") ), wxHORIZONTAL ); + sbSizer9 = new wxStaticBoxSizer( new wxStaticBox( m_panel71, wxID_ANY, _("Filter files") ), wxHORIZONTAL ); - m_bpButtonFilter = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - sbSizer9->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + m_bpButtonFilter = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + sbSizer9->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); wxBoxSizer* bSizer23; bSizer23 = new wxBoxSizer( wxVERTICAL ); - m_hyperlinkCfgFilter = new wxHyperlinkCtrl( this, wxID_ANY, _("Configure Filter..."), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlinkCfgFilter = new wxHyperlinkCtrl( m_panel71, wxID_ANY, _("Configure filter..."), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); m_hyperlinkCfgFilter->SetNormalColour( wxColour( 0, 0, 255 ) ); m_hyperlinkCfgFilter->SetVisitedColour( wxColour( 0, 0, 255 ) ); - m_hyperlinkCfgFilter->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); + m_hyperlinkCfgFilter->SetBackgroundColour( wxColour( 128, 128, 150 ) ); bSizer23->Add( m_hyperlinkCfgFilter, 0, wxALL, 5 ); - m_checkBoxHideFilt = new wxCheckBox( this, wxID_ANY, _("Hide filtered items"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxHideFilt = new wxCheckBox( m_panel71, wxID_ANY, _("Hide filtered items"), wxDefaultPosition, wxDefaultSize, 0 ); m_checkBoxHideFilt->SetToolTip( _("Choose to hide filtered files/directories from list") ); bSizer23->Add( m_checkBoxHideFilt, 0, 0, 5 ); - sbSizer9->Add( bSizer23, 1, wxEXPAND, 5 ); + sbSizer9->Add( bSizer23, 0, 0, 5 ); + + bSizer56->Add( sbSizer9, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( sbSizer9, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_bpButtonSync = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + bSizer56->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer6->Add( bSizer56, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSync = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 190,37 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); m_bpButtonSync->SetToolTip( _("Open synchronization dialog") ); m_bpButtonSync->SetToolTip( _("Open synchronization dialog") ); - bSizer6->Add( m_bpButtonSync, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + bSizer6->Add( m_bpButtonSync, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - bSizer6->Add( 40, 0, 0, wxEXPAND, 5 ); + bSizer6->Add( 40, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer1->Add( bSizer6, 0, wxEXPAND, 5 ); + m_panel71->SetSizer( bSizer6 ); + m_panel71->Layout(); + bSizer6->Fit( m_panel71 ); + bSizer1->Add( m_panel71, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); wxBoxSizer* bSizer2; bSizer2 = new wxBoxSizer( wxHORIZONTAL ); @@ -124,10 +190,10 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_panel1, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); m_directoryPanel1 = new wxTextCtrl( m_panel1, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer2->Add( m_directoryPanel1, 1, wxALIGN_BOTTOM, 5 ); + sbSizer2->Add( m_directoryPanel1, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_dirPicker1 = new wxDirPickerCtrl( m_panel1, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); - sbSizer2->Add( m_dirPicker1, 0, wxALIGN_BOTTOM, 5 ); + sbSizer2->Add( m_dirPicker1, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer7->Add( sbSizer2, 0, wxEXPAND, 5 ); @@ -179,16 +245,16 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit m_bpButtonSwap->SetToolTip( _("Swap sides") ); - bSizer18->Add( m_bpButtonSwap, 0, wxTOP|wxALIGN_CENTER_HORIZONTAL, 3 ); + bSizer18->Add( m_bpButtonSwap, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 3 ); - m_grid3 = new CustomGrid( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER ); + m_grid3 = new CustomGrid( m_panel3, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); // Grid m_grid3->CreateGrid( 15, 1 ); m_grid3->EnableEditing( false ); m_grid3->EnableGridLines( true ); m_grid3->EnableDragGridSize( false ); - m_grid3->SetMargins( 0, 50 ); + m_grid3->SetMargins( 0, 0 ); // Columns m_grid3->SetColSize( 0, 45 ); @@ -208,7 +274,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit // Cell Defaults m_grid3->SetDefaultCellFont( wxFont( 12, 74, 90, 92, false, wxT("Arial") ) ); m_grid3->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - bSizer18->Add( m_grid3, 1, wxBOTTOM|wxTOP|wxALIGN_CENTER_HORIZONTAL, 3 ); + bSizer18->Add( m_grid3, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); m_panel3->SetSizer( bSizer18 ); m_panel3->Layout(); @@ -223,10 +289,10 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panel2, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); m_directoryPanel2 = new wxTextCtrl( m_panel2, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer3->Add( m_directoryPanel2, 1, wxALIGN_BOTTOM, 5 ); + sbSizer3->Add( m_directoryPanel2, 1, wxALIGN_CENTER_VERTICAL, 5 ); m_dirPicker2 = new wxDirPickerCtrl( m_panel2, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, wxDIRP_DIR_MUST_EXIST ); - sbSizer3->Add( m_dirPicker2, 0, wxALIGN_BOTTOM, 5 ); + sbSizer3->Add( m_dirPicker2, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer10->Add( sbSizer3, 0, wxEXPAND, 5 ); @@ -262,7 +328,7 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit // Cell Defaults m_grid2->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - bSizer10->Add( m_grid2, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer10->Add( m_grid2, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); m_panel2->SetSizer( bSizer10 ); m_panel2->Layout(); @@ -272,7 +338,6 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit bSizer1->Add( bSizer2, 1, wxEXPAND, 5 ); m_panel4 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer3; bSizer3 = new wxBoxSizer( wxHORIZONTAL ); m_bpButton11 = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); @@ -285,12 +350,18 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer58; + bSizer58 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer16; + sbSizer16 = new wxStaticBoxSizer( new wxStaticBox( m_panel4, wxID_ANY, _("Configuration") ), wxHORIZONTAL ); + m_bpButton201 = new wxBitmapButton( m_panel4, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); m_bpButton201->SetToolTip( _("Save current configuration to file") ); m_bpButton201->SetToolTip( _("Save current configuration to file") ); - bSizer3->Add( m_bpButton201, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( m_bpButton201, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); wxString m_choiceLoadChoices[] = { _("Load configuration...") }; int m_choiceLoadNChoices = sizeof( m_choiceLoadChoices ) / sizeof( wxString ); @@ -298,11 +369,20 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit m_choiceLoad->SetSelection( 0 ); m_choiceLoad->SetToolTip( _("Load configuration from file:\n - use this choice box\n - drag & drop config file to this window\n - specify config file as first commandline parameter") ); - bSizer3->Add( m_choiceLoad, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( m_choiceLoad, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer58->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer58->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer3->Add( bSizer58, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer59 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer31; sbSizer31 = new wxStaticBoxSizer( new wxStaticBox( m_panel4, wxID_ANY, _("Filter view") ), wxHORIZONTAL ); @@ -348,13 +428,18 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer31->Add( m_bpButton24, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer3->Add( sbSizer31, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer59->Add( sbSizer31, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer59->Add( 0, 4, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer3->Add( bSizer59, 0, wxALIGN_CENTER_VERTICAL, 5 ); bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer3->Add( 190, 0, 0, wxALL, 5 ); + bSizer3->Add( 185, 0, 0, wxALL, 5 ); bSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); @@ -371,16 +456,85 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit bSizer3->Fit( m_panel4 ); bSizer1->Add( m_panel4, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_panel7 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer451; + bSizer451 = new wxBoxSizer( wxHORIZONTAL ); + + bSizer451->SetMinSize( wxSize( -1,22 ) ); + wxBoxSizer* bSizer53; + bSizer53 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextStatusLeft = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusLeft->Wrap( -1 ); + bSizer53->Add( m_staticTextStatusLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer53->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer451->Add( bSizer53, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticline9 = new wxStaticLine( m_panel7, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer451->Add( m_staticline9, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxEXPAND, 2 ); + + + bSizer451->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextStatusMiddle = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusMiddle->Wrap( -1 ); + bSizer451->Add( m_staticTextStatusMiddle, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer451->Add( 26, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline10 = new wxStaticLine( m_panel7, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer451->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 ); + + m_staticTextStatusRight = new wxStaticText( m_panel7, wxID_ANY, _("Dummy text"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusRight->Wrap( -1 ); + bSizer52->Add( m_staticTextStatusRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer50; + bSizer50 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer50->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap15 = new wxStaticBitmap( m_panel7, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 10,10 ), 0 ); + bSizer50->Add( m_bitmap15, 0, wxALIGN_BOTTOM, 2 ); + + bSizer52->Add( bSizer50, 1, wxALIGN_BOTTOM|wxEXPAND, 5 ); + + bSizer451->Add( bSizer52, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel7->SetSizer( bSizer451 ); + m_panel7->Layout(); + bSizer451->Fit( m_panel7 ); + bSizer1->Add( m_panel7, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + this->SetSizer( bSizer1 ); this->Layout(); - m_statusBar1 = this->CreateStatusBar( 3, wxST_SIZEGRIP, wxID_ANY ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GuiGenerated::OnClose ) ); + this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuQuit ) ); + this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuExportFileList ) ); + this->Connect( m_menuItemEnglish->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangEnglish ) ); + this->Connect( m_menuItemGerman->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangGerman ) ); + this->Connect( m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuBatchJob ) ); + this->Connect( m_menuItem3->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuAbout ) ); m_bpButtonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnCompare ), NULL, this ); m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnAbortCompare ), NULL, this ); - m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); - m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); + m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByTimeSize ), NULL, this ); + m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByContent ), NULL, this ); m_bpButton14->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnShowHelpDialog ), NULL, this ); m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnFilterButton ), NULL, this ); m_hyperlinkCfgFilter->Connect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( GuiGenerated::OnConfigureFilter ), NULL, this ); @@ -415,10 +569,16 @@ GuiGenerated::~GuiGenerated() { // Disconnect Events this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GuiGenerated::OnClose ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuQuit ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuExportFileList ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangEnglish ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuLangGerman ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuBatchJob ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( GuiGenerated::OnMenuAbout ) ); m_bpButtonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnCompare ), NULL, this ); m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnAbortCompare ), NULL, this ); - m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); - m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnChangeCompareVariant ), NULL, this ); + m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByTimeSize ), NULL, this ); + m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( GuiGenerated::OnCompareByContent ), NULL, this ); m_bpButton14->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnShowHelpDialog ), NULL, this ); m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GuiGenerated::OnFilterButton ), NULL, this ); m_hyperlinkCfgFilter->Disconnect( wxEVT_COMMAND_HYPERLINK, wxHyperlinkEventHandler( GuiGenerated::OnConfigureFilter ), NULL, this ); @@ -454,7 +614,6 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, wxBoxSizer* bSizer40; bSizer40 = new wxBoxSizer( wxVERTICAL ); - wxBoxSizer* bSizer42; bSizer42 = new wxBoxSizer( wxHORIZONTAL ); wxStaticBoxSizer* sbSizer10; @@ -477,7 +636,6 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizer13; sbSizer13 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxHORIZONTAL ); m_staticText46 = new wxStaticText( this, wxID_ANY, _("Files to compare:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -497,7 +655,6 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - wxStaticBoxSizer* sbSizer11; sbSizer11 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxHORIZONTAL ); m_staticText32 = new wxStaticText( this, wxID_ANY, _("Data to compare:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -566,7 +723,7 @@ CompareStatusGenerated::~CompareStatusGenerated() { } -SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +SyncDlgGenerated::SyncDlgGenerated( 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 ); @@ -576,15 +733,9 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer181; bSizer181 = new wxBoxSizer( wxHORIZONTAL ); - - bSizer181->Add( 5, 0, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer29; bSizer29 = new wxBoxSizer( wxVERTICAL ); - - bSizer29->Add( 0, 5, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer201; bSizer201 = new wxBoxSizer( wxHORIZONTAL ); @@ -594,48 +745,32 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const m_bpButton18->SetToolTip( _("Start synchronization") ); - bSizer201->Add( m_bpButton18, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer201->Add( m_bpButton18, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer201->Add( 10, 0, 0, wxEXPAND, 5 ); + bSizer201->Add( 18, 0, 0, wxEXPAND, 5 ); - wxGridSizer* gSizer1; - gSizer1 = new wxGridSizer( 2, 2, 0, 0 ); - - m_staticText37 = new wxStaticText( this, wxID_ANY, _("Objects to process:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText37->Wrap( -1 ); - m_staticText37->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); - m_staticText37->SetToolTip( _("Number of files and directories that will be copied or deleted") ); - - gSizer1->Add( m_staticText37, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrl12 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 85,-1 ), wxTE_READONLY ); - m_textCtrl12->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxEmptyString ) ); - m_textCtrl12->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + wxBoxSizer* bSizer38; + bSizer38 = new wxBoxSizer( wxVERTICAL ); - gSizer1->Add( m_textCtrl12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText14 = new wxStaticText( this, wxID_ANY, _("Data to transfer:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText14->Wrap( -1 ); - m_staticText14->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); - m_staticText14->SetToolTip( _("Total amount of data that will be copied") ); + m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); - gSizer1->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer38->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_textCtrl5 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 55,-1 ), wxTE_READONLY ); - m_textCtrl5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_checkBoxContinueError = new wxCheckBox( this, wxID_ANY, _("Continue on error"), wxDefaultPosition, wxDefaultSize, 0 ); - gSizer1->Add( m_textCtrl5, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + m_checkBoxContinueError->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); - bSizer201->Add( gSizer1, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer38->Add( m_checkBoxContinueError, 0, wxALL, 5 ); - bSizer29->Add( bSizer201, 0, wxEXPAND, 5 ); + bSizer201->Add( bSizer38, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer29->Add( bSizer201, 1, 0, 5 ); - bSizer29->Add( 0, 3, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer23; - bSizer23 = new wxBoxSizer( wxHORIZONTAL ); + bSizer29->Add( 0, 5, 0, 0, 5 ); wxStaticBoxSizer* sbSizer7; sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -647,65 +782,60 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const sbSizer7->Add( m_staticText1, 0, wxALL, 5 ); wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 3, 3, 0, 0 ); - fgSizer1->SetFlexibleDirection( wxBOTH ); + fgSizer1 = new wxFlexGridSizer( 3, 3, 8, 5 ); + fgSizer1->SetFlexibleDirection( wxHORIZONTAL ); fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_radioBtn1 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn1->SetValue( true ); m_radioBtn1->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_radioBtn1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_radioBtn1, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_buttonOneWay = new wxButton( this, wxID_ANY, _("One way ->"), wxDefaultPosition, wxSize( 130,-1 ), 0 ); m_buttonOneWay->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticText8 = new wxStaticText( this, wxID_ANY, _("Mirror backup of left folder: Right folder will be overwritten and exactly match left folder after synchronization."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText8->Wrap( 200 ); - fgSizer1->Add( m_staticText8, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText8->Wrap( 260 ); + fgSizer1->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_radioBtn2 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn2->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_radioBtn2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_radioBtn2, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_buttonTwoWay = new wxButton( this, wxID_ANY, _("Two way <->"), wxDefaultPosition, wxSize( 130,-1 ), 0 ); m_buttonTwoWay->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_buttonTwoWay, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_buttonTwoWay, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticText10 = new wxStaticText( this, wxID_ANY, _("Synchronize both sides simultaneously: Copy new or updated files in both directions."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText10->Wrap( 200 ); - fgSizer1->Add( m_staticText10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText10->Wrap( 250 ); + fgSizer1->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_radioBtn3 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn3->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_radioBtn3, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_radioBtn3, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_staticText23 = new wxStaticText( this, wxID_ANY, _("Custom"), wxDefaultPosition, wxSize( 130,-1 ), wxALIGN_CENTRE|wxSTATIC_BORDER ); m_staticText23->Wrap( -1 ); m_staticText23->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxRIGHT, 5 ); + fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_staticText9 = new wxStaticText( this, wxID_ANY, _("Configure your own synchronization rules."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( 200 ); - fgSizer1->Add( m_staticText9, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText9->Wrap( 250 ); + fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - sbSizer7->Add( fgSizer1, 1, wxEXPAND, 5 ); + sbSizer7->Add( fgSizer1, 0, 0, 5 ); - bSizer23->Add( sbSizer7, 0, wxEXPAND, 5 ); + bSizer29->Add( sbSizer7, 0, wxEXPAND, 5 ); - bSizer23->Add( 0, 0, 1, wxEXPAND, 5 ); - - bSizer29->Add( bSizer23, 0, wxEXPAND, 5 ); - - - bSizer29->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer29->Add( 0, 5, 0, 0, 5 ); wxBoxSizer* bSizer291; bSizer291 = new wxBoxSizer( wxHORIZONTAL ); @@ -713,188 +843,370 @@ SyncDialogGenerated::SyncDialogGenerated( wxWindow* parent, wxWindowID id, const m_button6 = new wxButton( this, wxID_ANY, _("&Back"), wxDefaultPosition, wxSize( 100,32 ), 0 ); m_button6->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer291->Add( m_button6, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + bSizer291->Add( m_button6, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_button16 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,-1 ), 0 ); - bSizer291->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_button16 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); + bSizer291->Add( m_button16, 0, wxALIGN_BOTTOM, 5 ); - bSizer291->Add( 82, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer291->Add( 20, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer38; - bSizer38 = new wxBoxSizer( wxVERTICAL ); + wxStaticBoxSizer* sbSizer16; + sbSizer16 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Preview") ), wxHORIZONTAL ); - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); + wxFlexGridSizer* fgSizer5; + fgSizer5 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); + m_staticText37 = new wxStaticText( this, wxID_ANY, _("Create:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText37->Wrap( -1 ); + m_staticText37->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_staticText37->SetToolTip( _("Number of files or directories that will be created") ); - bSizer38->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer5->Add( m_staticText37, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_checkBoxHideErrors = new wxCheckBox( this, wxID_ANY, _("Hide error messages"), wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlCreate = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreate->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlCreate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreate->SetToolTip( _("Number of files and directories that will be created") ); - m_checkBoxHideErrors->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); + fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer38->Add( m_checkBoxHideErrors, 0, wxALL, 5 ); + m_staticText14 = new wxStaticText( this, wxID_ANY, _("Delete:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText14->Wrap( -1 ); + m_staticText14->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_staticText14->SetToolTip( _("Number of files or directories that will be deleted") ); - bSizer291->Add( bSizer38, 0, wxALIGN_BOTTOM|wxBOTTOM, 5 ); + fgSizer5->Add( m_staticText14, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer29->Add( bSizer291, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_textCtrlDelete = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDelete->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlDelete->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDelete->SetToolTip( _("Number of files and directories that will be deleted") ); - bSizer181->Add( bSizer29, 1, wxEXPAND, 5 ); + fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer30; - bSizer30 = new wxBoxSizer( wxVERTICAL ); + sbSizer16->Add( fgSizer5, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + wxFlexGridSizer* fgSizer6; + fgSizer6 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer6->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - bSizer30->Add( 0, 0, 1, wxEXPAND, 5 ); + m_staticText42 = new wxStaticText( this, wxID_ANY, _("Update:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText42->Wrap( -1 ); + m_staticText42->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_staticText42->SetToolTip( _("Number of files that will be overwritten") ); - wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration") ), wxVERTICAL ); + fgSizer6->Add( m_staticText42, 0, wxALIGN_CENTER_VERTICAL, 5 ); - wxBoxSizer* bSizer21; - bSizer21 = new wxBoxSizer( wxHORIZONTAL ); + m_textCtrlUpdate = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdate->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlUpdate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdate->SetToolTip( _("Number of files that will be overwritten") ); - m_staticText2 = new wxStaticText( this, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText2->Wrap( -1 ); - m_staticText2->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + fgSizer6->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer21->Add( m_staticText2, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticText43 = new wxStaticText( this, wxID_ANY, _("Data:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText43->Wrap( -1 ); + m_staticText43->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_staticText43->SetToolTip( _("Total amount of data that will be transferred") ); + fgSizer6->Add( m_staticText43, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer21->Add( 15, 0, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + m_textCtrlData = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlData->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); + m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); - m_staticText3 = new wxStaticText( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText3->Wrap( -1 ); - m_staticText3->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer21->Add( m_staticText3, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer16->Add( fgSizer6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - sbSizer6->Add( bSizer21, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer291->Add( sbSizer16, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - sbSizer6->Add( m_staticline3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer29->Add( bSizer291, 0, wxEXPAND, 5 ); - wxBoxSizer* bSizer9; - bSizer9 = new wxBoxSizer( wxHORIZONTAL ); + bSizer181->Add( bSizer29, 0, 0, 5 ); - wxBoxSizer* bSizer20; - bSizer20 = new wxBoxSizer( wxVERTICAL ); + + bSizer181->Add( 10, 0, 0, 0, 5 ); + + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration") ), wxVERTICAL ); + + wxGridSizer* gSizer3; + gSizer3 = new wxGridSizer( 1, 2, 0, 5 ); + + m_staticText21 = new wxStaticText( this, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText21, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText31 = new wxStaticText( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText31->Wrap( -1 ); + m_staticText31->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText31, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer6->Add( gSizer3, 0, wxEXPAND, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizer6->Add( m_staticline3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 5, 2, 0, 5 ); m_bitmap13 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap13->SetToolTip( _("Folders/files that exist on left side only") ); + m_bitmap13->SetToolTip( _("Files/folders that exist on left side only") ); - bSizer20->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton5 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap14 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap14->SetToolTip( _("Folders/files that exist on right side only") ); + m_bitmap14->SetToolTip( _("Files/folders that exist on right side only") ); - bSizer20->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton6 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap15 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap15->SetToolTip( _("Files that exist on both sides, left one is newer") ); - bSizer20->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton7 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap16 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap16->SetToolTip( _("Files that exist on both sides, right one is newer") ); - bSizer20->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton8 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap17 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); m_bitmap17->SetToolTip( _("Files that exist on both sides and are different") ); - bSizer20->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer9->Add( bSizer20, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButton9 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer6->Add( gSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - bSizer9->Add( 5, 0, 0, wxEXPAND, 5 ); + bSizer181->Add( sbSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_BOTTOM, 5 ); - wxBoxSizer* bSizer19; - bSizer19 = new wxBoxSizer( wxVERTICAL ); + bSizer7->Add( bSizer181, 0, wxALL, 5 ); - m_bpButton5 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + this->SetSizer( bSizer7 ); + this->Layout(); + bSizer7->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); + m_bpButton18->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnStartSync ), NULL, this ); + m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_radioBtn1->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtn2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_buttonTwoWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncCostum ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnBack ), NULL, this ); + m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnCancel ), NULL, this ); + m_bpButton5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButton6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); +} + +SyncDlgGenerated::~SyncDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDlgGenerated::OnClose ) ); + m_bpButton18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnStartSync ), NULL, this ); + m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_radioBtn1->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtn2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_buttonTwoWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnSyncBothSides ), NULL, this ); + m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDlgGenerated::OnSyncCostum ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnBack ), NULL, this ); + m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnCancel ), NULL, this ); + m_bpButton5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButton6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDlgGenerated::OnDifferent ), NULL, this ); +} + +SyncStatusDlgGenerated::SyncStatusDlgGenerated( 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* bSizer27; + bSizer27 = new wxBoxSizer( wxVERTICAL ); - bSizer19->Add( 0, 5, 0, wxEXPAND, 5 ); - m_bpButton6 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton6, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer27->Add( 0, 15, 0, wxEXPAND, 5 ); + wxBoxSizer* bSizer37; + bSizer37 = new wxBoxSizer( wxHORIZONTAL ); - bSizer19->Add( 0, 5, 1, wxEXPAND, 5 ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); - m_bpButton7 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Synchronization status"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer19->Add( 0, 5, 1, wxEXPAND, 5 ); + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - m_bpButton8 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton8, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer37->Add( m_panel8, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 )); + bSizer37->Add( m_animationControl1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer19->Add( 0, 5, 1, wxEXPAND, 5 ); + bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bpButton9 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer19->Add( m_bpButton9, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); + wxBoxSizer* bSizer42; + bSizer42 = new wxBoxSizer( wxHORIZONTAL ); - bSizer9->Add( bSizer19, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer9->Add( 5, 0, 0, wxEXPAND, 5 ); + m_bitmapStatus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 28,28 ), 0 ); + bSizer42->Add( m_bitmapStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - sbSizer6->Add( bSizer9, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatus->Wrap( -1 ); + m_staticTextStatus->SetFont( wxFont( 14, 74, 93, 90, false, wxT("Tahoma") ) ); - bSizer30->Add( sbSizer6, 0, wxALIGN_RIGHT|wxBOTTOM, 5 ); + bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - bSizer181->Add( bSizer30, 0, wxEXPAND|wxALIGN_BOTTOM, 5 ); + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer181->Add( 5, 0, 0, wxEXPAND, 5 ); + bSizer27->Add( bSizer42, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer7->Add( bSizer181, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer31; + bSizer31 = new wxBoxSizer( wxHORIZONTAL ); - this->SetSizer( bSizer7 ); + m_staticText21 = new wxStaticText( this, wxID_ANY, _("Current operation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer31->Add( m_staticText21, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + + bSizer27->Add( bSizer31, 0, wxEXPAND, 5 ); + + m_textCtrlInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); + m_textCtrlInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer27->Add( m_textCtrlInfo, 3, wxALL|wxEXPAND, 5 ); + + m_gauge1 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); + bSizer27->Add( m_gauge1, 0, wxALL|wxEXPAND, 5 ); + + bSizer28 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer32; + bSizer32 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText26 = new wxStaticText( this, wxID_ANY, _("Data remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText26->Wrap( -1 ); + m_staticText26->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + + bSizer32->Add( m_staticText26, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("--,- MB"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataRemaining->Wrap( -1 ); + m_staticTextDataRemaining->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer32->Add( m_staticTextDataRemaining, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer28->Add( bSizer32, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer28->Add( 0, 0, 1, 0, 5 ); + + m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonOK->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_buttonOK->Hide(); + + bSizer28->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonPause = new wxButton( this, wxID_ANY, _("&Pause"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonPause->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer28->Add( m_buttonPause, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonAbort->SetDefault(); + m_buttonAbort->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer28->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer28->Add( 0, 0, 1, 0, 5 ); + + wxBoxSizer* bSizer33; + bSizer33 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText25 = new wxStaticText( this, wxID_ANY, _("Files remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText25->Wrap( -1 ); + m_staticText25->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + + bSizer33->Add( m_staticText25, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("0000000"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextRemainingObj->Wrap( -1 ); + m_staticTextRemainingObj->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer33->Add( m_staticTextRemainingObj, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer28->Add( bSizer33, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + + bSizer27->Add( 0, 5, 0, wxEXPAND, 5 ); + + this->SetSizer( bSizer27 ); this->Layout(); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDialogGenerated::OnClose ) ); - m_bpButton18->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnStartSync ), NULL, this ); - m_radioBtn1->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtn2->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_buttonTwoWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_radioBtn3->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncCostum ), NULL, this ); - m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnBack ), NULL, this ); - m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnCancel ), NULL, this ); - m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSelectRecycleBin ), NULL, this ); - m_bpButton5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButton6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButton7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnLeftNewer ), NULL, this ); - m_bpButton8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnRightNewer ), NULL, this ); - m_bpButton9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnDifferent ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnOkay ), NULL, this ); + m_buttonPause->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnPause ), NULL, this ); + m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnAbort ), NULL, this ); } -SyncDialogGenerated::~SyncDialogGenerated() +SyncStatusDlgGenerated::~SyncStatusDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncDialogGenerated::OnClose ) ); - m_bpButton18->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnStartSync ), NULL, this ); - m_radioBtn1->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtn2->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_buttonTwoWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSyncBothSides ), NULL, this ); - m_radioBtn3->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncDialogGenerated::OnSyncCostum ), NULL, this ); - m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnBack ), NULL, this ); - m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnCancel ), NULL, this ); - m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnSelectRecycleBin ), NULL, this ); - m_bpButton5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButton6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButton7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnLeftNewer ), NULL, this ); - m_bpButton8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnRightNewer ), NULL, this ); - m_bpButton9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncDialogGenerated::OnDifferent ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnOkay ), NULL, this ); + m_buttonPause->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnPause ), NULL, this ); + m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusDlgGenerated::OnAbort ), NULL, this ); } HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -907,11 +1219,28 @@ HelpDlgGenerated::HelpDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr bSizer20->Add( 0, 10, 0, wxEXPAND, 5 ); - m_staticText12 = new wxStaticText( this, wxID_ANY, _("Help"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText12->Wrap( -1 ); - m_staticText12->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer72->Add( 20, 0, 0, 0, 5 ); + + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Help"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - bSizer20->Add( m_staticText12, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + bSizer72->Add( 20, 0, 0, 0, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer20->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); bSizer20->Add( 0, 5, 0, wxEXPAND, 5 ); @@ -950,7 +1279,7 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31 = new wxBoxSizer( wxVERTICAL ); - bSizer31->Add( 0, 10, 0, wxEXPAND, 5 ); + bSizer31->Add( 0, 5, 0, 0, 5 ); m_panel5 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); m_panel5->SetBackgroundColour( wxColour( 255, 255, 255 ) ); @@ -958,25 +1287,13 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer36; bSizer36 = new wxBoxSizer( wxHORIZONTAL ); - m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 277,55 ), 0 ); + m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 404,55 ), 0 ); bSizer36->Add( m_bitmap11, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer36->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText39 = new wxStaticText( m_panel5, wxID_ANY, _("FreeFileSync v1.5"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText39->Wrap( -1 ); - m_staticText39->SetFont( wxFont( 18, 74, 90, 92, false, wxT("Tahoma") ) ); - - bSizer36->Add( m_staticText39, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer36->Add( 50, 0, 0, wxEXPAND, 5 ); - m_panel5->SetSizer( bSizer36 ); m_panel5->Layout(); bSizer36->Fit( m_panel5 ); - bSizer31->Add( m_panel5, 0, wxALL|wxEXPAND, 5 ); + bSizer31->Add( m_panel5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); m_staticText15 = new wxStaticText( this, wxID_ANY, _("-Open-Source file synchronization-"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText15->Wrap( -1 ); @@ -988,15 +1305,24 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_build->Wrap( -1 ); m_build->SetFont( wxFont( 8, 74, 90, 90, false, wxT("Tahoma") ) ); - bSizer31->Add( m_build, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + bSizer31->Add( m_build, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer31->Add( 0, 10, 0, 0, 5 ); - bSizer31->Add( 0, 10, 0, wxEXPAND, 5 ); + wxBoxSizer* bSizer53; + bSizer53 = new wxBoxSizer( wxVERTICAL ); - m_textCtrl3 = new wxTextCtrl( this, wxID_ANY, _("Source code written completely in C++ utilizing:\n\n MinGW \t\t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE\n\n by ZenJu"), wxDefaultPosition, wxSize( 350,-1 ), wxTE_MULTILINE|wxTE_NO_VSCROLL|wxTE_READONLY|wxDOUBLE_BORDER ); + wxTextCtrl* m_textCtrl3; + m_textCtrl3 = new wxTextCtrl( this, wxID_ANY, _("Source code written completely in C++ utilizing:\n\n MinGW \t\t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE\n\n by ZenJu"), wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY|wxDOUBLE_BORDER ); m_textCtrl3->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - bSizer31->Add( m_textCtrl3, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 0 ); + bSizer53->Add( m_textCtrl3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + bSizer31->Add( bSizer53, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 30 ); + + + bSizer31->Add( 0, 7, 0, 0, 5 ); wxStaticBoxSizer* sbSizer7; sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -1010,11 +1336,11 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31->Add( sbSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer31->Add( m_staticline3, 0, wxALL|wxEXPAND, 5 ); + bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxFlexGridSizer* fgSizer2; fgSizer2 = new wxFlexGridSizer( 3, 3, 0, 0 ); - fgSizer2->SetFlexibleDirection( wxBOTH ); + fgSizer2->SetFlexibleDirection( wxHORIZONTAL ); fgSizer2->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); @@ -1043,7 +1369,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS m_hyperlink2 = new wxHyperlinkCtrl( this, wxID_ANY, _("zhnmju123@gmx.de"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); fgSizer2->Add( m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 48,48 )); + m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation); + m_animationControl1->Hide(); + fgSizer2->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); m_staticText151 = new wxStaticText( this, wxID_ANY, _("If you like FFS:"), wxDefaultPosition, wxDefaultSize, 0 ); @@ -1058,13 +1386,13 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer31->Add( fgSizer2, 0, wxLEFT|wxEXPAND, 10 ); m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer31->Add( m_staticline2, 0, wxEXPAND | wxALL, 5 ); + bSizer31->Add( m_staticline2, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); wxStaticBoxSizer* sbSizer14; sbSizer14 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Published under the GNU General Public License:") ), wxHORIZONTAL ); - sbSizer14->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_bitmap13 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 88,31 ), 0 ); sbSizer14->Add( m_bitmap13, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); @@ -1073,9 +1401,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS sbSizer14->Add( m_hyperlink5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - sbSizer14->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer31->Add( sbSizer14, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer31->Add( sbSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); m_button8 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); m_button8->SetDefault(); @@ -1085,6 +1413,9 @@ AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxS this->SetSizer( bSizer31 ); this->Layout(); + bSizer31->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); @@ -1124,9 +1455,11 @@ ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxS bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - m_checkBoxSuppress = new wxCheckBox( this, wxID_ANY, _("Hide further messages during current process"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxContinueError = new wxCheckBox( this, wxID_ANY, _("Continue on next errors"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer24->Add( m_checkBoxSuppress, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + m_checkBoxContinueError->SetToolTip( _("Hide further error messages during the current process and continue") ); + + bSizer24->Add( m_checkBoxContinueError, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); @@ -1134,18 +1467,18 @@ ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxS wxBoxSizer* bSizer25; bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonContinue = new wxButton( this, wxID_OK, _("&Continue"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonContinue = new wxButton( this, wxID_OK, _("&Continue"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonContinue->SetDefault(); m_buttonContinue->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonContinue, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonRetry->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonRetry, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonAbort->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonAbort, 0, wxALL, 5 ); @@ -1171,7 +1504,7 @@ ErrorDlgGenerated::~ErrorDlgGenerated() m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnAbort ), NULL, this ); } -DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +DeleteDlgGenerated::DeleteDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -1209,13 +1542,13 @@ DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, c wxBoxSizer* bSizer25; bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonOK->SetDefault(); - m_buttonOK->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_buttonOK->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonOK, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_buttonCancel->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer25->Add( m_buttonCancel, 0, wxALL, 5 ); @@ -1226,17 +1559,17 @@ DeleteDialogGenerated::DeleteDialogGenerated( wxWindow* parent, wxWindowID id, c this->Layout(); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDialogGenerated::OnClose ) ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnOK ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnCancel ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); } -DeleteDialogGenerated::~DeleteDialogGenerated() +DeleteDlgGenerated::~DeleteDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDialogGenerated::OnClose ) ); - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnOK ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDialogGenerated::OnCancel ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); + m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); } FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) @@ -1246,18 +1579,44 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w wxBoxSizer* bSizer21; bSizer21 = new wxBoxSizer( wxVERTICAL ); - m_staticText17 = new wxStaticText( this, wxID_ANY, _("Set filter for synchronization"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText17->Wrap( -1 ); - m_staticText17->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); + + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Set filter for synchronization"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer21->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 10 ); + + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be selected for synchronization."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText44->Wrap( -1 ); + bSizer21->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer21->Add( m_staticText17, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 10 ); + bSizer21->Add( 0, 10, 0, 0, 5 ); - bSizer21->Add( 0, 0, 1, wxEXPAND, 5 ); + wxBoxSizer* bSizer52; + bSizer52 = new wxBoxSizer( wxVERTICAL ); - m_staticText18 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be relevant for synchronization.\n\n1. Enter full file or directory names separated by ';'.\n2. Wildcard characters '*' and '?' are supported.\n3. Case sensitive expressions!\n\nExample: *.tmp;C:\\data\\dummy.log;*filename*;*directory*"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText45 = new wxStaticText( this, wxID_ANY, _("Hints:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText45->Wrap( -1 ); + m_staticText45->SetFont( wxFont( 10, 74, 90, 92, true, wxT("Tahoma") ) ); + + bSizer52->Add( m_staticText45, 0, wxBOTTOM, 5 ); + + m_staticText18 = new wxStaticText( this, wxID_ANY, _("1. Enter full file or directory names separated by ';'.\n2. Wildcard characters '*' and '?' are supported.\n3. Case sensitive expressions!\n\nExample: *.tmp;*\\filename.dat;*\\directory\\*"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText18->Wrap( -1 ); - bSizer21->Add( m_staticText18, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer52->Add( m_staticText18, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer21->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); wxStaticBoxSizer* sbSizer8; sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); @@ -1309,12 +1668,12 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer21->Add( sbSizer8, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer21->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer21->Add( 0, 0, 0, 0, 5 ); wxBoxSizer* bSizer22; bSizer22 = new wxBoxSizer( wxHORIZONTAL ); - m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button9->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); bSizer22->Add( m_button9, 0, wxALL, 5 ); @@ -1322,12 +1681,12 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w bSizer22->Add( 0, 0, 1, wxEXPAND, 5 ); - m_button17 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,-1 ), 0 ); - bSizer22->Add( m_button17, 0, wxALL, 5 ); + m_button17 = new wxButton( this, wxID_CANCEL, _("dummy"), wxDefaultPosition, wxSize( 0,0 ), 0 ); + bSizer22->Add( m_button17, 0, wxALIGN_BOTTOM, 5 ); - m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 80,30 ), 0 ); + m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); m_button10->SetDefault(); - m_button10->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_button10->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); bSizer22->Add( m_button10, 0, wxALL, 5 ); @@ -1335,6 +1694,9 @@ FilterDlgGenerated::FilterDlgGenerated( wxWindow* parent, wxWindowID id, const w this->SetSizer( bSizer21 ); this->Layout(); + bSizer21->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( FilterDlgGenerated::OnClose ) ); @@ -1352,145 +1714,336 @@ FilterDlgGenerated::~FilterDlgGenerated() m_button10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnOK ), NULL, this ); } -SyncStatusGenerated::SyncStatusGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +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( wxDefaultSize, wxDefaultSize ); - wxBoxSizer* bSizer27; - bSizer27 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer54; + bSizer54 = new wxBoxSizer( wxVERTICAL ); + wxBoxSizer* bSizer69; + bSizer69 = new wxBoxSizer( wxVERTICAL ); - bSizer27->Add( 0, 15, 0, wxEXPAND, 5 ); + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); - wxBoxSizer* bSizer37; - bSizer37 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); - m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 )); - bSizer37->Add( m_animationControl1, 0, wxALL, 5 ); + m_staticText56 = new wxStaticText( m_panel8, wxID_ANY, _("Create a batch job"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); - m_staticText20 = new wxStaticText( this, wxID_ANY, _("Synchronization status"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText20->Wrap( -1 ); - m_staticText20->SetFont( wxFont( 16, 74, 90, 92, false, wxT("Tahoma") ) ); + bSizer72->Add( m_staticText56, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer37->Add( m_staticText20, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer69->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - wxBoxSizer* bSizer42; - bSizer42 = new wxBoxSizer( wxHORIZONTAL ); + bSizer69->Add( 0, 5, 0, 0, 5 ); + m_staticText54 = new wxStaticText( this, wxID_ANY, _("Assemble a batch file with the following settings. To start synchronization in batch mode simply execute this file or schedule it in your operating system's task planner."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText54->Wrap( 380 ); + m_staticText54->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Tahoma") ) ); - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer69->Add( m_staticText54, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bitmapStatus = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 28,28 ), 0 ); - bSizer42->Add( m_bitmapStatus, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatus->Wrap( -1 ); - m_staticTextStatus->SetFont( wxFont( 14, 74, 93, 90, false, wxT("Tahoma") ) ); + bSizer69->Add( 0, 5, 0, 0, 5 ); - bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer69->Add( m_staticline10, 0, wxEXPAND|wxTOP, 5 ); + m_staticText531 = new wxStaticText( this, wxID_ANY, _("Configuration overview:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText531->Wrap( -1 ); + m_staticText531->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Arial Black") ) ); - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer69->Add( m_staticText531, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer27->Add( bSizer42, 0, wxEXPAND, 5 ); + wxStaticBoxSizer* sbSizer20; + sbSizer20 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); - wxBoxSizer* bSizer31; - bSizer31 = new wxBoxSizer( wxHORIZONTAL ); + wxFlexGridSizer* fgSizer9; + fgSizer9 = new wxFlexGridSizer( 2, 2, 5, 5 ); + fgSizer9->AddGrowableCol( 1 ); + fgSizer9->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer9->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - m_staticText21 = new wxStaticText( this, wxID_ANY, _("Current operation:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText21->Wrap( -1 ); - m_staticText21->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + m_staticText53 = new wxStaticText( this, wxID_ANY, _("Left folder:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText53->Wrap( -1 ); + m_staticText53->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer31->Add( m_staticText21, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer9->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_directoryPanel1 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer9->Add( m_directoryPanel1, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + m_staticText541 = new wxStaticText( this, wxID_ANY, _("Right folder:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText541->Wrap( -1 ); + m_staticText541->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); - bSizer27->Add( bSizer31, 0, wxEXPAND, 5 ); + fgSizer9->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - m_textCtrlInfo = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrlInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_directoryPanel2 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer9->Add( m_directoryPanel2, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer27->Add( m_textCtrlInfo, 3, wxALL|wxEXPAND, 5 ); + sbSizer20->Add( fgSizer9, 0, wxEXPAND, 5 ); - m_gauge1 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); - bSizer27->Add( m_gauge1, 0, wxALL|wxEXPAND, 5 ); + bSizer69->Add( sbSizer20, 1, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - wxBoxSizer* bSizer28; - bSizer28 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer67; + bSizer67 = new wxBoxSizer( wxHORIZONTAL ); - wxBoxSizer* bSizer32; - bSizer32 = new wxBoxSizer( wxHORIZONTAL ); + wxBoxSizer* bSizer57; + bSizer57 = new wxBoxSizer( wxVERTICAL ); - m_staticText26 = new wxStaticText( this, wxID_ANY, _("Data remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText26->Wrap( -1 ); - m_staticText26->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + wxBoxSizer* bSizer71; + bSizer71 = new wxBoxSizer( wxHORIZONTAL ); - bSizer32->Add( m_staticText26, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM|wxLEFT, 5 ); + wxBoxSizer* bSizer721; + bSizer721 = new wxBoxSizer( wxVERTICAL ); - m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("--,- MB"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataRemaining->Wrap( -1 ); - m_staticTextDataRemaining->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by...") ), wxVERTICAL ); - bSizer32->Add( m_staticTextDataRemaining, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnSizeDate->SetValue( true ); + m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time (UTC) and date\nare the same.") ); - bSizer28->Add( bSizer32, 0, wxALIGN_CENTER_VERTICAL, 5 ); + sbSizer6->Add( m_radioBtnSizeDate, 0, 0, 5 ); + m_radioBtnContent = new wxRadioButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same.") ); - bSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); + sbSizer6->Add( m_radioBtnContent, 0, wxTOP, 5 ); - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonOK->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); - m_buttonOK->Hide(); + bSizer721->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer28->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonAbort->SetDefault(); - m_buttonAbort->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + bSizer721->Add( 0, 10, 1, 0, 5 ); + + wxBoxSizer* bSizer38; + bSizer38 = new wxBoxSizer( wxVERTICAL ); - bSizer28->Add( m_buttonAbort, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxUseRecycler->SetToolTip( _("Use Recycle Bin when deleting or overwriting files during synchronization") ); - bSizer28->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer38->Add( m_checkBoxUseRecycler, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - wxBoxSizer* bSizer33; - bSizer33 = new wxBoxSizer( wxHORIZONTAL ); + m_checkBoxContinueError = new wxCheckBox( this, wxID_ANY, _("Continue on error"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText25 = new wxStaticText( this, wxID_ANY, _("Files remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText25->Wrap( -1 ); - m_staticText25->SetFont( wxFont( 10, 74, 93, 90, false, wxT("Tahoma") ) ); + m_checkBoxContinueError->SetToolTip( _("Hides error messages during synchronization:\nThey are collected and shown as a list at the end of the process") ); - bSizer33->Add( m_staticText25, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer38->Add( m_checkBoxContinueError, 0, wxALL, 5 ); - m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("1000000"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextRemainingObj->Wrap( -1 ); - m_staticTextRemainingObj->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + m_checkBoxSilent = new wxCheckBox( this, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer33->Add( m_staticTextRemainingObj, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + m_checkBoxSilent->SetToolTip( _("Do not show graphical status and error messages but write to a logfile instead") ); - bSizer28->Add( bSizer33, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizer38->Add( m_checkBoxSilent, 0, wxALL, 5 ); - bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizer721->Add( bSizer38, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer27->Add( 0, 5, 0, wxEXPAND, 5 ); + bSizer721->Add( 0, 10, 1, 0, 5 ); - this->SetSizer( bSizer27 ); + bSizer71->Add( bSizer721, 0, wxEXPAND, 5 ); + + + bSizer71->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonFilter = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + bSizer71->Add( m_bpButtonFilter, 0, wxALIGN_BOTTOM|wxRIGHT, 5 ); + + bSizer57->Add( bSizer71, 0, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer8; + sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + + wxBoxSizer* bSizer671; + bSizer671 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer681; + bSizer681 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap8 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + bSizer681->Add( m_bitmap8, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText15 = new wxStaticText( this, wxID_ANY, _("Include"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText15->Wrap( -1 ); + m_staticText15->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer681->Add( m_staticText15, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer671->Add( bSizer681, 1, wxEXPAND, 5 ); + + m_textCtrlInclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 250,-1 ), 0 ); + bSizer671->Add( m_textCtrlInclude, 0, wxALL, 5 ); + + sbSizer8->Add( bSizer671, 0, 0, 5 ); + + + sbSizer8->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer691; + bSizer691 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer70; + bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + bSizer70->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_staticText16 = new wxStaticText( this, wxID_ANY, _("Exclude"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText16->Wrap( -1 ); + m_staticText16->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer70->Add( m_staticText16, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer691->Add( bSizer70, 1, wxEXPAND, 5 ); + + m_textCtrlExclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 250,-1 ), 0 ); + bSizer691->Add( m_textCtrlExclude, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer8->Add( bSizer691, 0, 0, 5 ); + + bSizer57->Add( sbSizer8, 0, 0, 5 ); + + bSizer67->Add( bSizer57, 0, 0, 5 ); + + + bSizer67->Add( 10, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxStaticBoxSizer* sbSizer61; + sbSizer61 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Configuration") ), wxVERTICAL ); + + wxGridSizer* gSizer3; + gSizer3 = new wxGridSizer( 1, 2, 0, 5 ); + + m_staticText211 = new wxStaticText( this, wxID_ANY, _("Result"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText211->Wrap( -1 ); + m_staticText211->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText211, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText311 = new wxStaticText( this, wxID_ANY, _("Action"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText311->Wrap( -1 ); + m_staticText311->SetFont( wxFont( 8, 74, 90, 92, false, wxT("Tahoma") ) ); + + gSizer3->Add( m_staticText311, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer61->Add( gSizer3, 0, wxEXPAND, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizer61->Add( m_staticline3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxGridSizer* gSizer1; + gSizer1 = new wxGridSizer( 5, 2, 0, 5 ); + + m_bitmap13 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap13->SetToolTip( _("Files/folders that exist on left side only") ); + + gSizer1->Add( m_bitmap13, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton5 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap14 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap14->SetToolTip( _("Files/folders that exist on right side only") ); + + gSizer1->Add( m_bitmap14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton6 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap15 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap15->SetToolTip( _("Files that exist on both sides, left one is newer") ); + + gSizer1->Add( m_bitmap15, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton7 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap16 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap16->SetToolTip( _("Files that exist on both sides, right one is newer") ); + + gSizer1->Add( m_bitmap16, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton8 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmap17 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap17->SetToolTip( _("Files that exist on both sides and are different") ); + + gSizer1->Add( m_bitmap17, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton9 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + gSizer1->Add( m_bpButton9, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer61->Add( gSizer1, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + bSizer67->Add( sbSizer61, 0, 0, 5 ); + + bSizer69->Add( bSizer67, 0, wxALL, 5 ); + + m_staticline9 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer69->Add( m_staticline9, 0, wxTOP|wxBOTTOM|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer68; + bSizer68 = new wxBoxSizer( wxHORIZONTAL ); + + m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button6->SetFont( wxFont( 10, 74, 90, 90, false, wxT("Tahoma") ) ); + + bSizer68->Add( m_button6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonCreate = new wxButton( this, wxID_ANY, _("&Create"), wxDefaultPosition, wxSize( 120,35 ), 0 ); + m_buttonCreate->SetDefault(); + m_buttonCreate->SetFont( wxFont( 10, 74, 90, 92, false, wxT("Tahoma") ) ); + + bSizer68->Add( m_buttonCreate, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer69->Add( bSizer68, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer54->Add( bSizer69, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer54 ); this->Layout(); + bSizer54->Fit( this ); + + this->Centre( wxBOTH ); // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusGenerated::OnClose ) ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnOkay ), NULL, this ); - m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnAbort ), NULL, this ); + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_directoryPanel1->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterLeftDir ), NULL, this ); + m_directoryPanel2->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterRightDir ), NULL, this ); + m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnFilterButton ), NULL, this ); + m_bpButton5->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButton6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnDifferent ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); + m_buttonCreate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCreateJob ), NULL, this ); } -SyncStatusGenerated::~SyncStatusGenerated() +BatchDlgGenerated::~BatchDlgGenerated() { // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusGenerated::OnClose ) ); - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnOkay ), NULL, this ); - m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncStatusGenerated::OnAbort ), NULL, this ); + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_directoryPanel1->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterLeftDir ), NULL, this ); + m_directoryPanel2->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( BatchDlgGenerated::OnEnterRightDir ), NULL, this ); + m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSelectRecycleBin ), NULL, this ); + m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnFilterButton ), NULL, this ); + m_bpButton5->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButton6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButton7->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButton8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButton9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnDifferent ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); + m_buttonCreate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCreateJob ), NULL, this ); } diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h index 30376834..de725c92 100644 --- a/ui/guiGenerated.h +++ b/ui/guiGenerated.h @@ -12,32 +12,32 @@ class CustomGrid; +#include <wx/string.h> #include <wx/bitmap.h> #include <wx/image.h> #include <wx/icon.h> -#include <wx/bmpbuttn.h> +#include <wx/menu.h> #include <wx/gdicmn.h> #include <wx/font.h> #include <wx/colour.h> #include <wx/settings.h> -#include <wx/string.h> +#include <wx/bmpbuttn.h> #include <wx/button.h> #include <wx/sizer.h> #include <wx/radiobut.h> #include <wx/statbox.h> #include <wx/hyperlink.h> #include <wx/checkbox.h> +#include <wx/panel.h> #include <wx/textctrl.h> #include <wx/filepicker.h> #include <wx/grid.h> -#include <wx/panel.h> #include <wx/choice.h> -#include <wx/statusbr.h> -#include <wx/frame.h> #include <wx/stattext.h> -#include <wx/gauge.h> #include <wx/statline.h> #include <wx/statbmp.h> +#include <wx/frame.h> +#include <wx/gauge.h> #include <wx/dialog.h> #include <wx/animate.h> @@ -52,7 +52,16 @@ class GuiGenerated : public wxFrame private: protected: + wxMenuBar* m_menubar1; + wxMenu* m_menu1; + wxMenu* m_menu3; + wxMenu* m_menu31; + wxMenuItem* m_menuItemEnglish; + wxMenuItem* m_menuItemGerman; + wxMenu* m_menu2; wxBoxSizer* bSizer1; + wxPanel* m_panel71; + wxBoxSizer* bSizer6; wxBitmapButton* m_bpButtonCompare; wxButton* m_buttonAbort; @@ -60,9 +69,11 @@ class GuiGenerated : public wxFrame wxRadioButton* m_radioBtnContent; wxBitmapButton* m_bpButton14; + wxBitmapButton* m_bpButtonFilter; wxHyperlinkCtrl* m_hyperlinkCfgFilter; wxCheckBox* m_checkBoxHideFilt; + wxBitmapButton* m_bpButtonSync; wxPanel* m_panel1; @@ -77,11 +88,14 @@ class GuiGenerated : public wxFrame wxDirPickerCtrl* m_dirPicker2; CustomGrid* m_grid2; wxPanel* m_panel4; + wxBoxSizer* bSizer3; wxBitmapButton* m_bpButton11; wxBitmapButton* m_bpButton201; wxChoice* m_choiceLoad; + + wxBoxSizer* bSizer59; wxBitmapButton* m_bpButton20; wxBitmapButton* m_bpButton21; wxBitmapButton* m_bpButton25; @@ -91,14 +105,34 @@ class GuiGenerated : public wxFrame + wxBitmapButton* m_bpButton10; - wxStatusBar* m_statusBar1; + wxPanel* m_panel7; + + wxStaticText* m_staticTextStatusLeft; + + wxStaticLine* m_staticline9; + + wxStaticText* m_staticTextStatusMiddle; + + wxStaticLine* m_staticline10; + + wxStaticText* m_staticTextStatusRight; + + wxStaticBitmap* m_bitmap15; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnMenuQuit( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuExportFileList( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangEnglish( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuLangGerman( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuBatchJob( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuAbout( wxCommandEvent& event ){ event.Skip(); } virtual void OnCompare( wxCommandEvent& event ){ event.Skip(); } virtual void OnAbortCompare( wxCommandEvent& event ){ event.Skip(); } - virtual void OnChangeCompareVariant( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCompareByTimeSize( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCompareByContent( wxCommandEvent& event ){ event.Skip(); } virtual void OnShowHelpDialog( wxCommandEvent& event ){ event.Skip(); } virtual void OnFilterButton( wxCommandEvent& event ){ event.Skip(); } virtual void OnConfigureFilter( wxHyperlinkEvent& event ){ event.Skip(); } @@ -141,12 +175,15 @@ class CompareStatusGenerated : public wxPanel private: protected: + wxBoxSizer* bSizer42; wxStaticText* m_staticText321; wxStaticText* m_staticTextScanned; + wxStaticBoxSizer* sbSizer13; wxStaticText* m_staticText46; wxStaticText* m_staticTextFilesToCompare; + wxStaticBoxSizer* sbSizer11; wxStaticText* m_staticText32; wxStaticText* m_staticTextDataToCompare; @@ -163,21 +200,17 @@ class CompareStatusGenerated : public wxPanel }; /////////////////////////////////////////////////////////////////////////////// -/// Class SyncDialogGenerated +/// Class SyncDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncDialogGenerated : public wxDialog +class SyncDlgGenerated : public wxDialog { private: protected: - - wxBitmapButton* m_bpButton18; - wxStaticText* m_staticText37; - wxTextCtrl* m_textCtrl12; - wxStaticText* m_staticText14; - wxTextCtrl* m_textCtrl5; + wxCheckBox* m_checkBoxUseRecycler; + wxCheckBox* m_checkBoxContinueError; wxStaticText* m_staticText1; wxRadioButton* m_radioBtn1; @@ -190,44 +223,41 @@ class SyncDialogGenerated : public wxDialog wxStaticText* m_staticText23; wxStaticText* m_staticText9; - wxButton* m_button6; wxButton* m_button16; - wxCheckBox* m_checkBoxUseRecycler; - wxCheckBox* m_checkBoxHideErrors; - - wxStaticText* m_staticText2; + wxStaticText* m_staticText37; + wxTextCtrl* m_textCtrlCreate; + wxStaticText* m_staticText14; + wxTextCtrl* m_textCtrlDelete; + wxStaticText* m_staticText42; + wxTextCtrl* m_textCtrlUpdate; + wxStaticText* m_staticText43; + wxTextCtrl* m_textCtrlData; - wxStaticText* m_staticText3; + wxStaticText* m_staticText21; + wxStaticText* m_staticText31; wxStaticLine* m_staticline3; wxStaticBitmap* m_bitmap13; - wxStaticBitmap* m_bitmap14; - wxStaticBitmap* m_bitmap15; - wxStaticBitmap* m_bitmap16; - wxStaticBitmap* m_bitmap17; - wxBitmapButton* m_bpButton5; - + wxStaticBitmap* m_bitmap14; wxBitmapButton* m_bpButton6; - + wxStaticBitmap* m_bitmap15; wxBitmapButton* m_bpButton7; - + wxStaticBitmap* m_bitmap16; wxBitmapButton* m_bpButton8; - + wxStaticBitmap* m_bitmap17; wxBitmapButton* m_bpButton9; - - // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } virtual void OnStartSync( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncLeftToRight( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncBothSides( wxCommandEvent& event ){ event.Skip(); } virtual void OnSyncCostum( wxCommandEvent& event ){ event.Skip(); } virtual void OnBack( wxCommandEvent& event ){ event.Skip(); } virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } - virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnExRightSideOnly( wxCommandEvent& event ){ event.Skip(); } virtual void OnLeftNewer( wxCommandEvent& event ){ event.Skip(); } @@ -236,8 +266,53 @@ class SyncDialogGenerated : public wxDialog public: - SyncDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 523,356 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~SyncDialogGenerated(); + SyncDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~SyncDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SyncStatusDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class SyncStatusDlgGenerated : public wxDialog +{ + private: + + protected: + + wxPanel* m_panel8; + wxStaticText* m_staticText56; + wxAnimationCtrl* m_animationControl1; + + wxStaticBitmap* m_bitmapStatus; + wxStaticText* m_staticTextStatus; + + wxStaticText* m_staticText21; + + wxTextCtrl* m_textCtrlInfo; + wxBoxSizer* bSizer28; + wxStaticText* m_staticText26; + wxStaticText* m_staticTextDataRemaining; + + wxButton* m_buttonOK; + wxButton* m_buttonPause; + wxButton* m_buttonAbort; + + wxStaticText* m_staticText25; + wxStaticText* m_staticTextRemainingObj; + + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnPause( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAbort( wxCommandEvent& event ){ event.Skip(); } + + + public: + wxGauge* m_gauge1; + SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 614,371 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~SyncStatusDlgGenerated(); }; @@ -250,7 +325,10 @@ class HelpDlgGenerated : public wxDialog protected: - wxStaticText* m_staticText12; + wxPanel* m_panel8; + + wxStaticText* m_staticText56; + wxTextCtrl* m_textCtrl8; wxButton* m_button8; @@ -277,13 +355,10 @@ class AboutDlgGenerated : public wxDialog wxPanel* m_panel5; wxStaticBitmap* m_bitmap11; - - wxStaticText* m_staticText39; - wxStaticText* m_staticText15; wxStaticText* m_build; - wxTextCtrl* m_textCtrl3; + wxStaticText* m_staticText131; wxStaticLine* m_staticline3; wxStaticBitmap* m_bitmap9; @@ -308,7 +383,7 @@ class AboutDlgGenerated : public wxDialog public: - AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 422,603 ), long style = wxDEFAULT_DIALOG_STYLE ); + AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~AboutDlgGenerated(); }; @@ -325,7 +400,7 @@ class ErrorDlgGenerated : public wxDialog wxStaticBitmap* m_bitmap10; wxTextCtrl* m_textCtrl8; - wxCheckBox* m_checkBoxSuppress; + wxCheckBox* m_checkBoxContinueError; wxButton* m_buttonContinue; wxButton* m_buttonRetry; @@ -339,15 +414,15 @@ class ErrorDlgGenerated : public wxDialog public: - ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("An error occured"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 411,266 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("An error occured"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 445,293 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); ~ErrorDlgGenerated(); }; /////////////////////////////////////////////////////////////////////////////// -/// Class DeleteDialogGenerated +/// Class DeleteDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class DeleteDialogGenerated : public wxDialog +class DeleteDlgGenerated : public wxDialog { private: @@ -368,8 +443,8 @@ class DeleteDialogGenerated : public wxDialog public: - DeleteDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DeleteDialogGenerated(); + DeleteDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DeleteDlgGenerated(); }; @@ -381,8 +456,11 @@ class FilterDlgGenerated : public wxDialog private: protected: - wxStaticText* m_staticText17; + wxPanel* m_panel8; + wxStaticText* m_staticText56; + wxStaticText* m_staticText44; + wxStaticText* m_staticText45; wxStaticText* m_staticText18; wxStaticText* m_staticText15; @@ -406,49 +484,82 @@ class FilterDlgGenerated : public wxDialog public: - FilterDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure filter settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 472,367 ), long style = wxDEFAULT_DIALOG_STYLE ); + FilterDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure filter"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); ~FilterDlgGenerated(); }; /////////////////////////////////////////////////////////////////////////////// -/// Class SyncStatusGenerated +/// Class BatchDlgGenerated /////////////////////////////////////////////////////////////////////////////// -class SyncStatusGenerated : public wxDialog +class BatchDlgGenerated : public wxDialog { private: protected: + wxPanel* m_panel8; + wxStaticText* m_staticText56; - wxAnimationCtrl* m_animationControl1; - wxStaticText* m_staticText20; + wxStaticText* m_staticText54; - wxStaticBitmap* m_bitmapStatus; - wxStaticText* m_staticTextStatus; + wxStaticLine* m_staticline10; + wxStaticText* m_staticText531; + wxStaticText* m_staticText53; + wxTextCtrl* m_directoryPanel1; + wxStaticText* m_staticText541; + wxTextCtrl* m_directoryPanel2; + wxRadioButton* m_radioBtnSizeDate; + wxRadioButton* m_radioBtnContent; - wxStaticText* m_staticText21; + wxCheckBox* m_checkBoxUseRecycler; + wxCheckBox* m_checkBoxContinueError; + wxCheckBox* m_checkBoxSilent; - wxTextCtrl* m_textCtrlInfo; - wxStaticText* m_staticText26; - wxStaticText* m_staticTextDataRemaining; + wxBitmapButton* m_bpButtonFilter; + wxStaticBitmap* m_bitmap8; + wxStaticText* m_staticText15; + wxTextCtrl* m_textCtrlInclude; - wxStaticText* m_staticText25; - wxStaticText* m_staticTextRemainingObj; + wxStaticBitmap* m_bitmap9; + wxStaticText* m_staticText16; + wxTextCtrl* m_textCtrlExclude; + wxStaticText* m_staticText211; + wxStaticText* m_staticText311; + wxStaticLine* m_staticline3; + wxStaticBitmap* m_bitmap13; + wxBitmapButton* m_bpButton5; + wxStaticBitmap* m_bitmap14; + wxBitmapButton* m_bpButton6; + wxStaticBitmap* m_bitmap15; + wxBitmapButton* m_bpButton7; + wxStaticBitmap* m_bitmap16; + wxBitmapButton* m_bpButton8; + wxStaticBitmap* m_bitmap17; + wxBitmapButton* m_bpButton9; + wxStaticLine* m_staticline9; + wxButton* m_button6; + wxButton* m_buttonCreate; // Virtual event handlers, overide them in your derived class virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } - virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } - virtual void OnAbort( wxCommandEvent& event ){ event.Skip(); } + virtual void OnEnterLeftDir( wxCommandEvent& event ){ event.Skip(); } + virtual void OnEnterRightDir( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSelectRecycleBin( wxCommandEvent& event ){ event.Skip(); } + virtual void OnFilterButton( wxCommandEvent& event ){ event.Skip(); } + virtual void OnExLeftSideOnly( wxCommandEvent& event ){ event.Skip(); } + virtual void OnExRightSideOnly( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLeftNewer( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRightNewer( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDifferent( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCreateJob( wxCommandEvent& event ){ event.Skip(); } public: - wxGauge* m_gauge1; - wxButton* m_buttonOK; - wxButton* m_buttonAbort; - SyncStatusGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 614,371 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~SyncStatusGenerated(); + BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~BatchDlgGenerated(); }; |