From fbe76102e941b9f1edaf236788e42678f05fdf9a Mon Sep 17 00:00:00 2001 From: Daniel Wilhelm Date: Fri, 18 Apr 2014 17:08:06 +0200 Subject: 3.9 --- ui/MainDialog.cpp | 3804 ------------------------------------------ ui/MainDialog.h | 337 ---- ui/SmallDialogs.cpp | 1026 ------------ ui/SmallDialogs.h | 59 - ui/batchConfig.cpp | 801 --------- ui/batchConfig.h | 96 -- ui/batchStatusHandler.cpp | 390 ----- ui/batchStatusHandler.h | 57 - ui/batch_config.cpp | 840 ++++++++++ ui/batch_config.h | 96 ++ ui/batch_status_handler.cpp | 390 +++++ ui/batch_status_handler.h | 57 + ui/checkVersion.cpp | 162 -- ui/checkVersion.h | 18 - ui/check_version.cpp | 174 ++ ui/check_version.h | 18 + ui/folderPair.h | 206 --- ui/folder_pair.h | 206 +++ ui/gridView.cpp | 570 ------- ui/gridView.h | 237 --- ui/grid_view.cpp | 570 +++++++ ui/grid_view.h | 237 +++ ui/guiGenerated.cpp | 3768 ------------------------------------------ ui/guiGenerated.h | 1443 ---------------- ui/guiStatusHandler.cpp | 397 ----- ui/guiStatusHandler.h | 73 - ui/gui_generated.cpp | 3782 ++++++++++++++++++++++++++++++++++++++++++ ui/gui_generated.h | 1042 ++++++++++++ ui/gui_status_handler.cpp | 397 +++++ ui/gui_status_handler.h | 73 + ui/isNullFilter.h | 24 - ui/is_null_filter.h | 24 + ui/main_dlg.cpp | 3852 +++++++++++++++++++++++++++++++++++++++++++ ui/main_dlg.h | 337 ++++ ui/messagePopup.cpp | 188 --- ui/messagePopup.h | 78 - ui/mouseMoveWindow.cpp | 26 - ui/mouseMoveWindow.h | 36 - ui/mouse_move_dlg.cpp | 26 + ui/mouse_move_dlg.h | 36 + ui/msg_popup.cpp | 188 +++ ui/msg_popup.h | 78 + ui/progressIndicator.cpp | 970 ----------- ui/progressIndicator.h | 77 - ui/progress_indicator.cpp | 970 +++++++++++ ui/progress_indicator.h | 77 + ui/search.cpp | 6 +- ui/search.h | 2 +- ui/small_dlgs.cpp | 1028 ++++++++++++ ui/small_dlgs.h | 59 + ui/sorting.h | 48 +- ui/switchToGui.cpp | 27 - ui/switchToGui.h | 29 - ui/switch_to_gui.cpp | 27 + ui/switch_to_gui.h | 29 + ui/syncConfig.cpp | 477 ------ ui/syncConfig.h | 99 -- ui/sync_cfg.cpp | 477 ++++++ ui/sync_cfg.h | 99 ++ ui/trayIcon.cpp | 213 --- ui/trayIcon.h | 34 - ui/tray_icon.cpp | 213 +++ ui/tray_icon.h | 34 + 63 files changed, 15463 insertions(+), 15751 deletions(-) delete mode 100644 ui/MainDialog.cpp delete mode 100644 ui/MainDialog.h delete mode 100644 ui/SmallDialogs.cpp delete mode 100644 ui/SmallDialogs.h delete mode 100644 ui/batchConfig.cpp delete mode 100644 ui/batchConfig.h delete mode 100644 ui/batchStatusHandler.cpp delete mode 100644 ui/batchStatusHandler.h create mode 100644 ui/batch_config.cpp create mode 100644 ui/batch_config.h create mode 100644 ui/batch_status_handler.cpp create mode 100644 ui/batch_status_handler.h delete mode 100644 ui/checkVersion.cpp delete mode 100644 ui/checkVersion.h create mode 100644 ui/check_version.cpp create mode 100644 ui/check_version.h delete mode 100644 ui/folderPair.h create mode 100644 ui/folder_pair.h delete mode 100644 ui/gridView.cpp delete mode 100644 ui/gridView.h create mode 100644 ui/grid_view.cpp create mode 100644 ui/grid_view.h delete mode 100644 ui/guiGenerated.cpp delete mode 100644 ui/guiGenerated.h delete mode 100644 ui/guiStatusHandler.cpp delete mode 100644 ui/guiStatusHandler.h create mode 100644 ui/gui_generated.cpp create mode 100644 ui/gui_generated.h create mode 100644 ui/gui_status_handler.cpp create mode 100644 ui/gui_status_handler.h delete mode 100644 ui/isNullFilter.h create mode 100644 ui/is_null_filter.h create mode 100644 ui/main_dlg.cpp create mode 100644 ui/main_dlg.h delete mode 100644 ui/messagePopup.cpp delete mode 100644 ui/messagePopup.h delete mode 100644 ui/mouseMoveWindow.cpp delete mode 100644 ui/mouseMoveWindow.h create mode 100644 ui/mouse_move_dlg.cpp create mode 100644 ui/mouse_move_dlg.h create mode 100644 ui/msg_popup.cpp create mode 100644 ui/msg_popup.h delete mode 100644 ui/progressIndicator.cpp delete mode 100644 ui/progressIndicator.h create mode 100644 ui/progress_indicator.cpp create mode 100644 ui/progress_indicator.h create mode 100644 ui/small_dlgs.cpp create mode 100644 ui/small_dlgs.h delete mode 100644 ui/switchToGui.cpp delete mode 100644 ui/switchToGui.h create mode 100644 ui/switch_to_gui.cpp create mode 100644 ui/switch_to_gui.h delete mode 100644 ui/syncConfig.cpp delete mode 100644 ui/syncConfig.h create mode 100644 ui/sync_cfg.cpp create mode 100644 ui/sync_cfg.h delete mode 100644 ui/trayIcon.cpp delete mode 100644 ui/trayIcon.h create mode 100644 ui/tray_icon.cpp create mode 100644 ui/tray_icon.h (limited to 'ui') diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp deleted file mode 100644 index ce7129aa..00000000 --- a/ui/MainDialog.cpp +++ /dev/null @@ -1,3804 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "mainDialog.h" -#include -#include -#include "../shared/systemConstants.h" -#include -#include -#include -#include -#include "../library/customGrid.h" -#include "../shared/customButton.h" -#include "../shared/customComboBox.h" -#include -#include "../comparison.h" -#include "../synchronization.h" -#include "../algorithm.h" -#include "../shared/appMain.h" -#include "../shared/util.h" -#include "checkVersion.h" -#include "guiStatusHandler.h" -#include "syncConfig.h" -#include "../shared/localization.h" -#include "../shared/stringConv.h" -#include "smallDialogs.h" -#include "mouseMoveWindow.h" -#include "progressIndicator.h" -#include "messagePopup.h" -#include "../shared/dragAndDrop.h" -#include "../library/filter.h" -#include "../structures.h" -#include -#include -#include "gridView.h" -#include "../library/resources.h" -#include "../shared/fileHandling.h" -#include "../shared/recycler.h" -#include "../shared/xmlBase.h" -#include "../shared/standardPaths.h" -#include "../shared/toggleButton.h" -#include "folderPair.h" -#include "../shared/globalFunctions.h" -#include -#include "search.h" -#include "../shared/helpProvider.h" -#include "isNullFilter.h" -#include "batchConfig.h" -#include "../shared/checkExist.h" - -using namespace FreeFileSync; -using FreeFileSync::CustomLocale; - - -class MainFolderDragDrop : public DragDropOnMainDlg -{ -public: - MainFolderDragDrop(MainDialog& mainDlg, - wxWindow* dropWindow1, - wxWindow* dropWindow2, - wxDirPickerCtrl* dirPicker, - wxComboBox* dirName) : - - DragDropOnMainDlg(dropWindow1, dropWindow2, dirPicker, dirName), - mainDlg_(mainDlg) {} - - virtual bool AcceptDrop(const wxString& dropName) - { - const xmlAccess::XmlType fileType = xmlAccess::getXmlType(dropName); - - //test if ffs config file has been dropped - if (fileType == xmlAccess::XML_GUI_CONFIG) - { - mainDlg_.loadConfiguration(dropName); - return false; - } - //...or a ffs batch file - else if (fileType == xmlAccess::XML_BATCH_CONFIG) - { - BatchDialog* batchDlg = new BatchDialog(&mainDlg_, dropName); - if (batchDlg->ShowModal() == BatchDialog::BATCH_FILE_SAVED) - mainDlg_.pushStatusInformation(_("Batch file created successfully!")); - return false; - } - - //disable the sync button - mainDlg_.syncPreview->enableSynchronization(false); - - //clear grids - mainDlg_.gridDataView->clearAllRows(); - mainDlg_.updateGuiGrid(); - - return true; - } - -private: - MainFolderDragDrop(const MainFolderDragDrop&); - - MainDialog& mainDlg_; -}; - -//------------------------------------------------------------------ -/* class hierarchy: - - template<> - FolderPairPanelBasic - /|\ - | - template<> - FolderPairCallback FolderPairGenerated - /|\ /|\ - _________|________ ________| - | | | - FirstFolderPairCfg FolderPairPanel -*/ - -template -class FolderPairCallback : public FolderPairPanelBasic //implements callback functionality to MainDialog as imposed by FolderPairPanelBasic -{ -public: - FolderPairCallback(GuiPanel& basicPanel, MainDialog& mainDialog) : - FolderPairPanelBasic(basicPanel), //pass FolderPairGenerated part... - mainDlg(mainDialog) {} - -private: - virtual void OnLocalFilterCfgRemoveConfirm(wxCommandEvent& event) - { - FolderPairPanelBasic::OnLocalFilterCfgRemoveConfirm(event); - mainDlg.updateFilterConfig(); //update filter - } - - virtual void OnAltSyncCfgRemoveConfirm(wxCommandEvent& event) - { - FolderPairPanelBasic::OnAltSyncCfgRemoveConfirm(event); - mainDlg.updateSyncConfig(); - } - - virtual wxWindow* getParentWindow() - { - return &mainDlg; - } - - virtual MainConfiguration getMainConfig() const - { - return mainDlg.getCurrentConfiguration().mainCfg; - } - - virtual void OnAltSyncCfgChange() - { - mainDlg.updateSyncConfig(); - } - - virtual void OnLocalFilterCfgChange() - { - mainDlg.updateFilterConfig(); //re-apply filter - } - - MainDialog& mainDlg; -}; - - -class FolderPairPanel : - public FolderPairGenerated, //FolderPairPanel "owns" FolderPairGenerated! - public FolderPairCallback -{ -public: - FolderPairPanel(wxWindow* parent, MainDialog& mainDialog) : - FolderPairGenerated(parent), - FolderPairCallback(static_cast(*this), mainDialog), //pass FolderPairGenerated part... - dragDropOnLeft( m_panelLeft, m_dirPickerLeft, m_directoryLeft), - dragDropOnRight(m_panelRight, m_dirPickerRight, m_directoryRight) {} - -private: - //support for drag and drop - DragDropOnDlg dragDropOnLeft; - DragDropOnDlg dragDropOnRight; -}; - - -class FirstFolderPairCfg : public FolderPairCallback -{ -public: - FirstFolderPairCfg(MainDialog& mainDialog) : - FolderPairCallback(mainDialog, mainDialog), - - //prepare drag & drop - dragDropOnLeft(mainDialog, - mainDialog.m_panelLeft, - mainDialog.m_panelTopLeft, - mainDialog.m_dirPickerLeft, - mainDialog.m_directoryLeft), - dragDropOnRight(mainDialog, - mainDialog.m_panelRight, - mainDialog.m_panelTopRight, - mainDialog.m_dirPickerRight, - mainDialog.m_directoryRight) {} - -private: - //support for drag and drop - MainFolderDragDrop dragDropOnLeft; - MainFolderDragDrop dragDropOnRight; -}; - - -//workaround for wxWidgets: small hack to update menu items: actually this is a wxWidgets bug (affects Windows- and Linux-build) -class MenuItemUpdater -{ -public: - MenuItemUpdater(wxMenu* menuToUpdate) : menuToUpdate_(menuToUpdate) {} - - ~MenuItemUpdater() - { - //start updating menu icons - const wxMenuItemList& allItems = menuToUpdate_->GetMenuItems(); - - //retrieve menu item positions: unfortunately wxMenu doesn't offer a better way - MenuItemMap::iterator j; - int index = 0; - for (wxMenuItemList::const_iterator i = allItems.begin(); i != allItems.end(); ++i, ++index) - if ((j = menuItems.find(*i)) != menuItems.end()) - j->second = index; - - //finally update items - for (MenuItemMap::const_iterator i = menuItems.begin(); i != menuItems.end(); ++i) - if (i->second >= 0) - { - menuToUpdate_->Remove(i->first); //actual workaround - menuToUpdate_->Insert(i->second, i->first); // - } - } - - void addForUpdate(wxMenuItem* newEntry, const wxBitmap& newBitmap) - { - newEntry->SetBitmap(newBitmap); - menuItems.insert(std::pair(newEntry, -1)); - } - -private: - typedef std::map MenuItemMap; - wxMenu* menuToUpdate_; - MenuItemMap menuItems; -}; - - -struct DirNotFound -{ - bool operator()(const FolderPairEnh& fp) const - { - return !dirExists(FreeFileSync::getFormattedDirectoryName(fp.leftDirectory)) || - !dirExists(FreeFileSync::getFormattedDirectoryName(fp.rightDirectory)); - } -}; - - -//################################################################################################################################## -MainDialog::MainDialog(const wxString& cfgFileName, xmlAccess::XmlGlobalSettings& settings) : - MainDialogGenerated(NULL) -{ - xmlAccess::XmlGuiConfig guiCfg; //structure to receive gui settings, already defaulted!! - - const wxString actualConfigFile = cfgFileName.empty() ? lastConfigFileName() : cfgFileName; - - bool loadCfgSuccess = false; - if (!cfgFileName.empty() || fileExists(wxToZ(lastConfigFileName()))) - { - //load XML - try - { - xmlAccess::readGuiOrBatchConfig(actualConfigFile, guiCfg); //allow reading batch configurations also - loadCfgSuccess = true; - } - catch (const xmlAccess::XmlError& error) - { - if (error.getSeverity() == xmlAccess::XmlError::WARNING) - wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); - else - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); - } - } - - init(guiCfg, - settings, - !cfgFileName.empty() && loadCfgSuccess); - - setLastUsedConfig(actualConfigFile, loadCfgSuccess ? guiCfg : xmlAccess::XmlGuiConfig()); //simulate changed config on parsing errors -} - - -MainDialog::MainDialog(const xmlAccess::XmlGuiConfig& guiCfg, - xmlAccess::XmlGlobalSettings& settings, - bool startComparison) : - MainDialogGenerated(NULL) -{ - init(guiCfg, - settings, - startComparison); -} - - -MainDialog::~MainDialog() -{ - //keep non-inline destructor for std::auto_ptr to work with forward declaration - - cleanUp(true); //do NOT include any other code here! cleanUp() is re-used when switching languages -} - - -void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, - xmlAccess::XmlGlobalSettings& settings, - bool startComparison) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - //--------- avoid mirroring this dialog in RTL languages like Hebrew or Arabic -------------------- - m_panelViewFilter->SetLayoutDirection(wxLayout_LeftToRight); - m_panelStatusBar->SetLayoutDirection(wxLayout_LeftToRight); -// if (GetLayoutDirection() == wxLayout_RightToLeft) -//{ -// bSizerGridHolder->Detach(m_panelRight); -// bSizerGridHolder->Detach(m_panelLeft); -// bSizerGridHolder->Add(m_panelLeft); -// bSizerGridHolder->Prepend(m_panelRight); -//bSizerGridHolder->Fit(this); -// -// bSizerGridHolder->Layout(); -//} -//------------------------------------------------------------------------------------------------------ - - globalSettings = &settings; - gridDataView.reset(new FreeFileSync::GridView); - contextMenu.reset(new wxMenu); //initialize right-click context menu; will be dynamically re-created on each R-mouse-click - - compareStatus.reset(new CompareStatus(*this)); - cleanedUp = false; - lastSortColumn = -1; - lastSortGrid = NULL; - - updateFileIcons.reset(new IconUpdater(m_gridLeft, m_gridRight)); - -#ifdef FFS_WIN - moveWholeWindow.reset(new MouseMoveWindow(this)); -#endif - syncPreview.reset(new SyncPreview(this)); - - SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); - - SetIcon(*GlobalResources::getInstance().programIcon); //set application icon - - - //notify about (logical) application main window => program won't quit, but stay on this dialog - FreeFileSync::AppMainWindow::setMainWindow(this); - - //init handling of first folder pair - firstFolderPair.reset(new FirstFolderPairCfg(*this)); - - initViewFilterButtons(); - - //initialize and load configuration - readGlobalSettings(); - setCurrentConfiguration(guiCfg); - - //set icons for this dialog - m_bpButton10->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("exit"))); - m_buttonCompare->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("compare"))); - m_bpButtonSyncConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfig"))); - m_bpButtonCmpConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("cmpConfig"))); - m_bpButtonSave->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("save"))); - m_bpButtonLoad->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("load"))); - m_bpButtonAddPair->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("addFolderPair"))); - m_bitmap15->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusEdge"))); - - m_bitmapCreate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("create"))); - m_bitmapUpdate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("update"))); - m_bitmapDelete->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("delete"))); - m_bitmapData->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("data"))); - - bSizer6->Layout(); //wxButtonWithImage size might have changed - - //menu icons: workaround for wxWidgets: small hack to update menu items: actually this is a wxWidgets bug (affects Windows- and Linux-build) - MenuItemUpdater updateMenuFile(m_menuFile); - updateMenuFile.addForUpdate(m_menuItem10, GlobalResources::getInstance().getImageByName(wxT("compareSmall"))); - updateMenuFile.addForUpdate(m_menuItem11, GlobalResources::getInstance().getImageByName(wxT("syncSmall"))); - updateMenuFile.addForUpdate(m_menuItemNew, GlobalResources::getInstance().getImageByName(wxT("newSmall"))); - updateMenuFile.addForUpdate(m_menuItemSave, GlobalResources::getInstance().getImageByName(wxT("saveSmall"))); - updateMenuFile.addForUpdate(m_menuItemLoad, GlobalResources::getInstance().getImageByName(wxT("loadSmall"))); - - MenuItemUpdater updateMenuAdv(m_menuAdvanced); - updateMenuAdv.addForUpdate(m_menuItemGlobSett, GlobalResources::getInstance().getImageByName(wxT("settingsSmall"))); - updateMenuAdv.addForUpdate(m_menuItem7, GlobalResources::getInstance().getImageByName(wxT("batchSmall"))); - - MenuItemUpdater updateMenuHelp(m_menuHelp); - updateMenuHelp.addForUpdate(m_menuItemAbout, GlobalResources::getInstance().getImageByName(wxT("aboutSmall"))); - -#ifdef FFS_WIN - //allow moving main dialog by clicking (nearly) anywhere... - moveWholeWindow->connectSourceWindow(m_panel71); - moveWholeWindow->connectSourceWindow(m_panelBottom); - moveWholeWindow->connectSourceWindow(m_panelStatusBar); -#endif - -#ifdef FFS_LINUX - if (!FreeFileSync::isPortableVersion()) //disable update check for Linux installer-based version -> handled by .deb - m_menuItemCheckVer->Enable(false); -#endif - - //create language selection menu - for (std::vector::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) - { - wxMenuItem* newItem = new wxMenuItem(m_menuLanguages, wxID_ANY, i->languageName, wxEmptyString, wxITEM_NORMAL ); - newItem->SetBitmap(GlobalResources::getInstance().getImageByName(i->languageFlag)); - - //map menu item IDs with language IDs: evaluated when processing event handler - languageMenuItemMap.insert(std::map::value_type(newItem->GetId(), i->languageID)); - - //connect event - Connect(newItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnMenuLanguageSwitch)); - m_menuLanguages->Append(newItem); - } - - //support for CTRL + C and DEL on grids - m_gridLeft->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridLeftButtonEvent), NULL, this); - m_gridRight->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridRightButtonEvent), NULL, this); - m_gridMiddle->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridMiddleButtonEvent), NULL, this); - - Connect(wxEVT_IDLE, wxEventHandler(MainDialog::OnIdleEvent), NULL, this); - Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); - Connect(wxEVT_MOVE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); - - m_bpButtonFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(MainDialog::OnGlobalFilterOpenContext), NULL, this); - - //calculate witdh of folder pair manually (if scrollbars are visible) - m_scrolledWindowFolderPairs->Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResizeFolderPairs), NULL, this); - - //event handler for manual (un-)checking of rows and setting of sync direction - m_gridMiddle->Connect(FFS_CHECK_ROWS_EVENT, FFSCheckRowsEventHandler(MainDialog::OnCheckRows), NULL, this); - m_gridMiddle->Connect(FFS_SYNC_DIRECTION_EVENT, FFSSyncDirectionEventHandler(MainDialog::OnSetSyncDirection), NULL, this); - - //init grid settings - m_gridLeft ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); - m_gridMiddle->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); - m_gridRight ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); - - //disable sync button as long as "compare" hasn't been triggered. - syncPreview->enableSynchronization(false); - - //mainly to update row label sizes... - updateGuiGrid(); - - //integrate the compare status panel (in hidden state) - bSizer1->Insert(1, compareStatus->getAsWindow(), 0, wxEXPAND | wxBOTTOM, 5 ); - Layout(); //avoid screen flicker when panel is shown later - compareStatus->getAsWindow()->Hide(); - - //correct width of swap button above middle grid - const wxSize source = m_gridMiddle->GetSize(); - const wxSize target = m_bpButtonSwapSides->GetSize(); - const int spaceToAdd = source.GetX() - target.GetX(); - bSizerMiddle->Insert(1, spaceToAdd / 2, 0, 0); - bSizerMiddle->Insert(0, spaceToAdd - (spaceToAdd / 2), 0, 0); - - //register regular check for update on next idle event - Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), NULL, this); - - //asynchronous call to wxWindow::Layout(): fix superfluous frame on right and bottom when FFS is started in fullscreen mode - Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); - -//---------------------------------------------------------------------------------------------------------------------------------------------------------------- - //some convenience: if FFS is started with a *.ffs_gui file as commandline parameter AND all directories contained exist, comparison shall be started right off - if (startComparison) - { - const FreeFileSync::MainConfiguration currMainCfg = getCurrentConfiguration().mainCfg; - const bool allFoldersExist = !DirNotFound()(currMainCfg.firstPair) && - std::find_if(currMainCfg.additionalPairs.begin(), currMainCfg.additionalPairs.end(), - DirNotFound()) == currMainCfg.additionalPairs.end(); - if (allFoldersExist) - { - wxCommandEvent dummy2(wxEVT_COMMAND_BUTTON_CLICKED); - m_buttonCompare->AddPendingEvent(dummy2); //simulate button click on "compare" - } - } -//---------------------------------------------------------------------------------------------------------------------------------------------------------------- -} - - -void MainDialog::cleanUp(bool saveLastUsedConfig) -{ - if (!cleanedUp) - { - cleanedUp = true; - - //no need for wxEventHandler::Disconnect() here; done automatically when window is destoyed! - - m_gridLeft ->release(); //handle wxGrid-related callback on grid data after MainDialog has died... (Linux only) - m_gridMiddle->release(); - m_gridRight ->release(); - - //save configuration - if (saveLastUsedConfig) - writeConfigurationToXml(lastConfigFileName()); //don't throw exceptions in destructors - writeGlobalSettings(); - } -} - - -void MainDialog::readGlobalSettings() -{ - //apply window size and position at program startup ONLY - widthNotMaximized = globalSettings->gui.widthNotMaximized; - heightNotMaximized = globalSettings->gui.heightNotMaximized; - posXNotMaximized = globalSettings->gui.posXNotMaximized; - posYNotMaximized = globalSettings->gui.posYNotMaximized; - - //apply window size and position - if ( widthNotMaximized != wxDefaultCoord && - heightNotMaximized != wxDefaultCoord && - posXNotMaximized != wxDefaultCoord && - posYNotMaximized != wxDefaultCoord) - SetSize(posXNotMaximized, posYNotMaximized, widthNotMaximized, heightNotMaximized); - else - Centre(); - - Maximize(globalSettings->gui.isMaximized); - - //set column attributes - m_gridLeft->setColumnAttributes(globalSettings->gui.columnAttribLeft); - m_gridRight->setColumnAttributes(globalSettings->gui.columnAttribRight); - - //load list of last used configuration files (in reverse order) - for (std::vector::reverse_iterator i = globalSettings->gui.cfgFileHistory.rbegin(); - i != globalSettings->gui.cfgFileHistory.rend(); - ++i) - addFileToCfgHistory(*i); - - //load list of last used folders - for (std::vector::reverse_iterator i = globalSettings->gui.folderHistoryLeft.rbegin(); - i != globalSettings->gui.folderHistoryLeft.rend(); - ++i) - addLeftFolderToHistory(*i); - for (std::vector::reverse_iterator i = globalSettings->gui.folderHistoryRight.rbegin(); - i != globalSettings->gui.folderHistoryRight.rend(); - ++i) - addRightFolderToHistory(*i); - - //show/hide file icons - m_gridLeft->enableFileIcons(globalSettings->gui.showFileIconsLeft); - m_gridRight->enableFileIcons(globalSettings->gui.showFileIconsRight); - - //set selected tab - m_notebookBottomLeft->ChangeSelection(globalSettings->gui.selectedTabBottomLeft); -} - - -void MainDialog::writeGlobalSettings() -{ - //write global settings to (global) variable stored in application instance - globalSettings->gui.widthNotMaximized = widthNotMaximized; - globalSettings->gui.heightNotMaximized = heightNotMaximized; - globalSettings->gui.posXNotMaximized = posXNotMaximized; - globalSettings->gui.posYNotMaximized = posYNotMaximized; - globalSettings->gui.isMaximized = IsMaximized(); - - //retrieve column attributes - globalSettings->gui.columnAttribLeft = m_gridLeft->getColumnAttributes(); - globalSettings->gui.columnAttribRight = m_gridRight->getColumnAttributes(); - - //write list of last used configuration files - globalSettings->gui.cfgFileHistory = cfgFileNames; - - //write list of last used folders - globalSettings->gui.folderHistoryLeft.clear(); - const wxArrayString leftFolderHistory = m_directoryLeft->GetStrings(); - for (unsigned i = 0; i < leftFolderHistory.GetCount(); ++i) - globalSettings->gui.folderHistoryLeft.push_back(leftFolderHistory[i]); - - globalSettings->gui.folderHistoryRight.clear(); - const wxArrayString rightFolderHistory = m_directoryRight->GetStrings(); - for (unsigned i = 0; i < rightFolderHistory.GetCount(); ++i) - globalSettings->gui.folderHistoryRight.push_back(rightFolderHistory[i]); - - //get selected tab - globalSettings->gui.selectedTabBottomLeft = m_notebookBottomLeft->GetSelection(); -} - - -void MainDialog::setSyncDirManually(const std::set& rowsToSetOnUiTable, const FreeFileSync::SyncDirection dir) -{ - if (rowsToSetOnUiTable.size() > 0) - { - for (std::set::const_iterator i = rowsToSetOnUiTable.begin(); i != rowsToSetOnUiTable.end(); ++i) - { - FileSystemObject* fsObj = gridDataView->getObject(*i); - if (fsObj) - { - setSyncDirectionRec(dir, *fsObj); //set new direction (recursively) - FreeFileSync::setActiveStatus(true, *fsObj); //works recursively for directories - } - } - - updateGuiGrid(); - } -} - - -void MainDialog::filterRangeManually(const std::set& rowsToFilterOnUiTable, int leadingRow) -{ - if (rowsToFilterOnUiTable.size() > 0) - { - bool newSelection = false; //default: deselect range - - //leadingRow determines de-/selection of all other rows - const FileSystemObject* fsObj = gridDataView->getObject(leadingRow); - if (fsObj) - newSelection = !fsObj->isActive(); - - //if hidefiltered is active, there should be no filtered elements on screen => current element was filtered out - assert(!currentCfg.hideFilteredElements || !newSelection); - - //get all lines that need to be filtered - std::vector compRef; - gridDataView->getAllFileRef(rowsToFilterOnUiTable, compRef); //everything in compRef is bound - - for (std::vector::iterator i = compRef.begin(); i != compRef.end(); ++i) - FreeFileSync::setActiveStatus(newSelection, **i); //works recursively for directories - - refreshGridAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts - } -} - - -void MainDialog::OnIdleEvent(wxEvent& event) -{ - //small routine to restore status information after some time - if (stackObjects.size() > 0 ) //check if there is some work to do - { - wxLongLong currentTime = wxGetLocalTimeMillis(); - if (currentTime - lastStatusChange > 2500) //restore stackObject after two seconds - { - lastStatusChange = currentTime; - - m_staticTextStatusMiddle->SetLabel(stackObjects.top()); - stackObjects.pop(); - - if (stackObjects.empty()) - m_staticTextStatusMiddle->SetForegroundColour(*wxBLACK); //reset color - - m_panelStatusBar->Layout(); - } - } - - event.Skip(); -} - - -void MainDialog::copySelectionToClipboard(const CustomGrid* selectedGrid) -{ - const std::set selectedRows = getSelectedRows(selectedGrid); - if (selectedRows.size() > 0) - { - wxString clipboardString; - - for (std::set::const_iterator i = selectedRows.begin(); i != selectedRows.end(); ++i) - { - for (int k = 0; k < const_cast(selectedGrid)->GetNumberCols(); ++k) - { - clipboardString+= const_cast(selectedGrid)->GetCellValue(static_cast(*i), k); - if (k != const_cast(selectedGrid)->GetNumberCols() - 1) - clipboardString+= '\t'; - } - clipboardString+= '\n'; - } - - if (!clipboardString.IsEmpty()) - // Write text to the clipboard - if (wxTheClipboard->Open()) - { - // these data objects are held by the clipboard, - // so do not delete them in the app. - wxTheClipboard->SetData( new wxTextDataObject(clipboardString) ); - wxTheClipboard->Close(); - } - } -} - - -std::set MainDialog::getSelectedRows(const CustomGrid* grid) const -{ - std::set output = grid->getAllSelectedRows(); - - //remove invalid rows - output.erase(output.lower_bound(gridDataView->rowsOnView()), output.end()); - - return output; -} - - -std::set MainDialog::getSelectedRows() const -{ - //merge selections from left and right grid - std::set selection = getSelectedRows(m_gridLeft); - std::set additional = getSelectedRows(m_gridRight); - selection.insert(additional.begin(), additional.end()); - return selection; -} - - -class ManualDeletionHandler : private wxEvtHandler, public DeleteFilesHandler -{ -public: - ManualDeletionHandler(MainDialog* main, size_t totalObjToDel) : - mainDlg(main), - totalObjToDelete(totalObjToDel), - abortRequested(false), - ignoreErrors(false), - deletionCount(0) - { - mainDlg->disableAllElements(); //disable everything except abort button - mainDlg->clearStatusBar(); - - //register abort button - mainDlg->m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortCompare ), NULL, this ); - } - - ~ManualDeletionHandler() - { - //de-register abort button - mainDlg->m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortCompare ), NULL, this ); - - mainDlg->enableAllElements(); - } - - virtual Response reportError(const wxString& errorMessage) - { - if (abortRequested) - throw FreeFileSync::AbortThisProcess(); - - if (ignoreErrors) - return DeleteFilesHandler::IGNORE_ERROR; - - bool ignoreNextErrors = false; - ErrorDlg* errorDlg = new ErrorDlg(NULL, - ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - errorMessage, ignoreNextErrors); - const int rv = errorDlg->ShowModal(); - errorDlg->Destroy(); - switch (static_cast(rv)) - { - case ErrorDlg::BUTTON_IGNORE: - ignoreErrors = ignoreNextErrors; - return DeleteFilesHandler::IGNORE_ERROR; - case ErrorDlg::BUTTON_RETRY: - return DeleteFilesHandler::RETRY; - case ErrorDlg::BUTTON_ABORT: - throw FreeFileSync::AbortThisProcess(); - } - - assert (false); - return DeleteFilesHandler::IGNORE_ERROR; //dummy return value - } - - virtual void deletionSuccessful() //called for each file/folder that has been deleted - { - ++deletionCount; - - if (updateUiIsAllowed()) //test if specific time span between ui updates is over - { - wxString statusMessage = _("%x / %y objects deleted successfully"); - statusMessage.Replace(wxT("%x"), FreeFileSync::numberToStringSep(deletionCount), false); - statusMessage.Replace(wxT("%y"), FreeFileSync::numberToStringSep(totalObjToDelete), false); - - mainDlg->m_staticTextStatusMiddle->SetLabel(statusMessage); - mainDlg->m_panelStatusBar->Layout(); - - updateUiNow(); - } - - if (abortRequested) //test after (implicit) call to wxApp::Yield() - throw FreeFileSync::AbortThisProcess(); - } - -private: - void OnAbortCompare(wxCommandEvent& event) //handle abort button click - { - abortRequested = true; //don't throw exceptions in a GUI-Callback!!! (throw FreeFileSync::AbortThisProcess()) - } - - MainDialog* const mainDlg; - const size_t totalObjToDelete; - - bool abortRequested; - bool ignoreErrors; - size_t deletionCount; -}; - - -void MainDialog::deleteSelectedFiles() -{ - //get set of selected rows on view - const std::set viewSelectionLeft = getSelectedRows(m_gridLeft); - const std::set viewSelectionRight = getSelectedRows(m_gridRight); - - if (viewSelectionLeft.size() + viewSelectionRight.size()) - { - //map lines from GUI view to grid line references - std::vector compRefLeft; - gridDataView->getAllFileRef(viewSelectionLeft, compRefLeft); - - std::vector compRefRight; - gridDataView->getAllFileRef(viewSelectionRight, compRefRight); - - - int totalDeleteCount = 0; - - if (FreeFileSync::showDeleteDialog(compRefLeft, - compRefRight, - globalSettings->gui.deleteOnBothSides, - globalSettings->gui.useRecyclerForManualDeletion, - totalDeleteCount) == DefaultReturnCode::BUTTON_OKAY) - { - if (globalSettings->gui.useRecyclerForManualDeletion && !FreeFileSync::recycleBinExists()) - { - wxMessageBox(_("Recycle Bin not yet supported for this system!")); - return; - } - - try - { - //handle errors when deleting files/folders - ManualDeletionHandler statusHandler(this, totalDeleteCount); - - FreeFileSync::deleteFromGridAndHD(gridDataView->getDataTentative(), - compRefLeft, - compRefRight, - globalSettings->gui.deleteOnBothSides, - globalSettings->gui.useRecyclerForManualDeletion, - getCurrentConfiguration().mainCfg, - &statusHandler); - } - catch (FreeFileSync::AbortThisProcess&) {} - - //remove rows that empty: just a beautification, invalid rows shouldn't cause issues - gridDataView->removeInvalidRows(); - - //redraw grid neccessary to update new dimensions and for UI-Backend data linkage - updateGuiGrid(); //call immediately after deleteFromGridAndHD!!! - - m_gridLeft-> ClearSelection(); - m_gridMiddle->ClearSelection(); - m_gridRight-> ClearSelection(); - } - } -} - - -template -void exstractNames(const FileSystemObject& fsObj, wxString& name, wxString& dir) -{ - if (!fsObj.isEmpty()) - { - struct GetNames : public FSObjectVisitor - { - GetNames(wxString& nameIn, wxString& dirIn) : name_(nameIn), dir_(dirIn) {} - virtual void visit(const FileMapping& fileObj) - { - name_ = zToWx(fileObj.getFullName()); - dir_ = zToWx(fileObj.getFullName().BeforeLast(globalFunctions::FILE_NAME_SEPARATOR)); - } - virtual void visit(const SymLinkMapping& linkObj) - { - name_ = zToWx(linkObj.getFullName()); - dir_ = zToWx(linkObj.getFullName().BeforeLast(globalFunctions::FILE_NAME_SEPARATOR)); - } - virtual void visit(const DirMapping& dirObj) - { - dir_ = name_ = zToWx(dirObj.getFullName()); - } - - wxString& name_; - wxString& dir_; - ; - } getNames(name, dir); - fsObj.accept(getNames); - } - else - { - name.clear(); - dir.clear(); - } -} - - -void MainDialog::openExternalApplication(size_t rowNumber, bool leftSide, const wxString& commandline) -{ - if (commandline.empty()) - return; - - wxString command = commandline; - - wxString name; - wxString dir; - wxString nameCo; - wxString dirCo; - - const FileSystemObject* fsObj = gridDataView->getObject(rowNumber); - if (fsObj) - { - if (leftSide) - { - exstractNames( *fsObj, name, dir); - exstractNames(*fsObj, nameCo, dirCo); - } - else - { - exstractNames(*fsObj, name, dir); - exstractNames( *fsObj, nameCo, dirCo); - } -#ifdef FFS_WIN - if (name.empty()) - { - if (leftSide) - wxExecute(wxString(wxT("explorer ")) + zToWx(fsObj->getBaseDirPf())); - else - wxExecute(wxString(wxT("explorer ")) + zToWx(fsObj->getBaseDirPf())); - return; - } -#endif - } - else - { - //fallback - dir = zToWx(FreeFileSync::getFormattedDirectoryName(firstFolderPair->getLeftDir())); - dirCo = zToWx(FreeFileSync::getFormattedDirectoryName(firstFolderPair->getRightDir())); - - if (!leftSide) - std::swap(dir, dirCo); - -#ifdef FFS_WIN - wxExecute(wxString(wxT("explorer ")) + dir); //default - return; -#endif - } - - command.Replace(wxT("%nameCo"), nameCo, true); //attention: replace %nameCo, %dirCo BEFORE %name, %dir to handle dependency - command.Replace(wxT("%dirCo"), dirCo, true); - command.Replace(wxT("%name"), name, true); - command.Replace(wxT("%dir"), dir, true); - - wxExecute(command); -} - - -void MainDialog::pushStatusInformation(const wxString& text) -{ - lastStatusChange = wxGetLocalTimeMillis(); - stackObjects.push(m_staticTextStatusMiddle->GetLabel()); - m_staticTextStatusMiddle->SetLabel(text); - m_staticTextStatusMiddle->SetForegroundColour(wxColour(31, 57, 226)); //highlight color: blue - m_panelStatusBar->Layout(); -} - - -void MainDialog::clearStatusBar() -{ - while (stackObjects.size() > 0) - stackObjects.pop(); - - m_staticTextStatusMiddle->SetForegroundColour(*wxBLACK); //reset color - m_staticTextStatusLeft->SetLabel(wxEmptyString); - m_staticTextStatusMiddle->SetLabel(wxEmptyString); - m_staticTextStatusRight->SetLabel(wxEmptyString); -} - - -void MainDialog::disableAllElements() -{ - //disenables all elements (except abort button) that might receive user input during long-running processes: comparison, deletion - m_bpButtonCmpConfig-> Disable(); - m_notebookBottomLeft->Disable(); - m_checkBoxHideFilt-> Disable(); - m_bpButtonSyncConfig->Disable(); - m_buttonStartSync-> Disable(); - m_dirPickerLeft-> Disable(); - m_dirPickerRight-> Disable(); - m_bpButtonSwapSides-> Disable(); - m_bpButtonLeftOnly-> Disable(); - m_bpButtonLeftNewer-> Disable(); - m_bpButtonEqual-> Disable(); - m_bpButtonDifferent-> Disable(); - m_bpButtonRightNewer->Disable(); - m_bpButtonRightOnly-> Disable(); - m_panelLeft-> Disable(); - m_panelMiddle-> Disable(); - m_panelRight-> Disable(); - m_panelTopLeft-> Disable(); - m_panelTopMiddle-> Disable(); - m_panelTopRight-> Disable(); - m_bpButton10-> Disable(); - m_scrolledWindowFolderPairs->Disable(); - m_menubar1->EnableTop(0, false); - m_menubar1->EnableTop(1, false); - m_menubar1->EnableTop(2, false); - EnableCloseButton(false); - - //show abort button - m_buttonAbort->Enable(); - m_buttonAbort->Show(); - m_buttonCompare->Disable(); - m_buttonCompare->Hide(); - m_buttonAbort->SetFocus(); -} - - -void MainDialog::enableAllElements() -{ - m_bpButtonCmpConfig-> Enable(); - m_notebookBottomLeft->Enable(); - m_checkBoxHideFilt-> Enable(); - m_bpButtonSyncConfig->Enable(); - m_buttonStartSync-> Enable(); - m_dirPickerLeft-> Enable(); - m_dirPickerRight-> Enable(); - m_bpButtonSwapSides-> Enable(); - m_bpButtonLeftOnly-> Enable(); - m_bpButtonLeftNewer-> Enable(); - m_bpButtonEqual-> Enable(); - m_bpButtonDifferent-> Enable(); - m_bpButtonRightNewer->Enable(); - m_bpButtonRightOnly-> Enable(); - m_panelLeft-> Enable(); - m_panelMiddle-> Enable(); - m_panelRight-> Enable(); - m_panelTopLeft-> Enable(); - m_panelTopMiddle-> Enable(); - m_panelTopRight-> Enable(); - m_bpButton10-> Enable(); - m_scrolledWindowFolderPairs->Enable(); - m_menubar1->EnableTop(0, true); - m_menubar1->EnableTop(1, true); - m_menubar1->EnableTop(2, true); - EnableCloseButton(true); - - //show compare button - m_buttonAbort->Disable(); - m_buttonAbort->Hide(); - m_buttonCompare->Enable(); - m_buttonCompare->Show(); -} - - -void MainDialog::OnResize(wxSizeEvent& event) -{ - if (!IsMaximized()) - { - int width = 0; - int height = 0; - int x = 0; - int y = 0; - - GetSize(&width, &height); - GetPosition(&x, &y); - - if (width > 0 && height > 0 && x >= 0 && y >= 0) //test ALL parameters at once, since width/height are invalid if - { - //the window is minimized (eg x,y == -32000; height = 28, width = 160) - widthNotMaximized = width; - heightNotMaximized = height; - - posXNotMaximized = x; - posYNotMaximized = y; - } - } - - event.Skip(); -} - - -void MainDialog::OnResizeFolderPairs(wxSizeEvent& event) -{ - //adapt left-shift display distortion caused by scrollbars for multiple folder pairs - if (additionalFolderPairs.size() > 0) - { - const int width = m_panelTopLeft->GetSize().GetWidth(); - - for (std::vector::iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) - (*i)->m_panelLeft->SetMinSize(wxSize(width, -1)); - } - - event.Skip(); -} - - -void MainDialog::onGridLeftButtonEvent(wxKeyEvent& event) -{ - const int keyCode = event.GetKeyCode(); - - if (event.ControlDown()) - switch (keyCode) - { - case 'C': - case WXK_INSERT: //CTRL + C || CTRL + INS - copySelectionToClipboard(m_gridLeft); - break; - - case 'A': //CTRL + A - m_gridLeft->SelectAll(); - break; - - case 'F': //CTRL + F - FreeFileSync::startFind(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); - break; - - case WXK_NUMPAD_ADD: //CTRL + '+' - m_gridLeft->autoSizeColumns(); - break; - } - - else if (event.AltDown()) - switch (keyCode) - { - case WXK_LEFT: //ALT + <- - { - wxCommandEvent dummy; - OnContextSyncDirLeft(dummy); - } - break; - - case WXK_RIGHT: //ALT + -> - { - wxCommandEvent dummy; - OnContextSyncDirRight(dummy); - } - break; - - case WXK_UP: /* ALT + /|\ */ - case WXK_DOWN: /* ALT + \|/ */ - { - wxCommandEvent dummy; - OnContextSyncDirNone(dummy); - } - break; - } - - else - switch (keyCode) - { - case WXK_DELETE: - case WXK_NUMPAD_DELETE: - deleteSelectedFiles(); - break; - - case WXK_SPACE: - { - wxCommandEvent dummy; - OnContextFilterTemp(dummy); - } - break; - - case WXK_RETURN: - case WXK_NUMPAD_ENTER: - { - wxCommandEvent dummy(wxEVT_NULL, externalAppIDFirst); //open with first external application - OnContextOpenWith(dummy); - } - break; - - case WXK_F3: //F3 - case WXK_NUMPAD_F3: // - FreeFileSync::findNext(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); - break; - } - - //event.Skip(); -> swallow event! don't allow default grid commands! -} - - -void MainDialog::onGridMiddleButtonEvent(wxKeyEvent& event) -{ - const int keyCode = event.GetKeyCode(); - - if (event.ControlDown()) - { - if (keyCode == 67 || keyCode == WXK_INSERT) //CTRL + C || CTRL + INS - copySelectionToClipboard(m_gridMiddle); - } - - //event.Skip(); -> swallow event! don't allow default grid commands! -} - - -void MainDialog::onGridRightButtonEvent(wxKeyEvent& event) -{ - const int keyCode = event.GetKeyCode(); - - if (event.ControlDown()) - switch (keyCode) - { - case 'C': - case WXK_INSERT: //CTRL + C || CTRL + INS - copySelectionToClipboard(m_gridRight); - break; - - case 'A': //CTRL + A - m_gridRight->SelectAll(); - break; - - case 'F': //CTRL + F - FreeFileSync::startFind(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); - break; - - case WXK_NUMPAD_ADD: //CTRL + '+' - m_gridRight->autoSizeColumns(); - break; - } - - else if (event.AltDown()) - switch (keyCode) - { - case WXK_LEFT: //ALT + <- - { - wxCommandEvent dummy; - OnContextSyncDirLeft(dummy); - } - break; - - case WXK_RIGHT: //ALT + -> - { - wxCommandEvent dummy; - OnContextSyncDirRight(dummy); - } - break; - - case WXK_UP: /* ALT + /|\ */ - case WXK_DOWN: /* ALT + \|/ */ - { - wxCommandEvent dummy; - OnContextSyncDirNone(dummy); - } - break; - } - - else - switch (keyCode) - { - case WXK_DELETE: - case WXK_NUMPAD_DELETE: - deleteSelectedFiles(); - break; - - case WXK_SPACE: - { - wxCommandEvent dummy; - OnContextFilterTemp(dummy); - } - break; - - case WXK_RETURN: - case WXK_NUMPAD_ENTER: - { - wxCommandEvent dummy(wxEVT_NULL, externalAppIDFirst); //open with first external application - OnContextOpenWith(dummy); - } - break; - - case WXK_F3: //F3 - case WXK_NUMPAD_F3: // - FreeFileSync::findNext(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); - break; - } - - //event.Skip(); -> swallow event! don't allow default grid commands! -} - - - -//------------------------------------------------------------ -//temporal variables used by exclude via context menu -struct SelectedExtension : public wxObject -{ - SelectedExtension(const Zstring& ext) : extension(ext) {} - - Zstring extension; -}; - -struct FilterObject -{ - FilterObject(const Zstring& relName, bool isDirectory) : - relativeName(relName), - isDir(isDirectory) {} - Zstring relativeName; - bool isDir; -}; - -typedef std::vector FilterObjList; - -struct FilterObjContainer : public wxObject -{ - FilterObjContainer(const FilterObjList& objList) : selectedObjects(objList) {} - - FilterObjList selectedObjects; -}; -//------------------------------------------------------------ - - - -void MainDialog::OnContextRim(wxGridEvent& event) -{ - //usability: select row unter right-click if not already selected - wxGrid* sourceGrid = dynamic_cast(event.GetEventObject()); - if (sourceGrid != NULL) - { - const int clickedRow = event.GetRow(); - const int clickedCol = event.GetCol(); - if (clickedRow >= 0 && clickedCol >= 0 && !sourceGrid->IsInSelection(clickedRow, 0)) - { - sourceGrid->SelectRow(clickedRow); - sourceGrid->SetGridCursor(clickedRow, clickedCol); - - if (sourceGrid == m_gridLeft) - m_gridRight->ClearSelection(); - else if (sourceGrid == m_gridRight) - m_gridLeft->ClearSelection(); - } - } - //------------------------------------------------------------------------------ - - - const std::set selectionLeft = getSelectedRows(m_gridLeft); - const std::set selectionRight = getSelectedRows(m_gridRight); - - const size_t selectionBegin = selectionLeft.size() + selectionRight.size() == 0 ? 0 : - selectionLeft.size() == 0 ? *selectionRight.begin() : - selectionRight.size() == 0 ? *selectionLeft.begin() : - std::min(*selectionLeft.begin(), *selectionRight.begin()); - - const FileSystemObject* fsObj = gridDataView->getObject(selectionBegin); - - - //####################################################### - //re-create context menu - contextMenu.reset(new wxMenu); - - if (syncPreview->previewIsEnabled() && - fsObj && fsObj->getSyncOperation() != SO_EQUAL) - { - if (selectionLeft.size() + selectionRight.size() > 0) - { - //CONTEXT_SYNC_DIR_LEFT - wxMenuItem* menuItemSyncDirLeft = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_LEFT, wxString(_("Set direction:")) + - wxT(" ") + getSymbol(fsObj->testSyncOperation(true, SYNC_DIR_LEFT)) + - wxT("\tALT + LEFT")); //Linux needs a direction, "<-", because it has no context menu icons! - menuItemSyncDirLeft->SetBitmap(getSyncOpImage(fsObj->testSyncOperation(true, SYNC_DIR_LEFT))); - contextMenu->Append(menuItemSyncDirLeft); - - //CONTEXT_SYNC_DIR_NONE - wxMenuItem* menuItemSyncDirNone = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_NONE, wxString(_("Set direction:")) + - wxT(" ") + getSymbol(fsObj->testSyncOperation(true, SYNC_DIR_NONE)) + - wxT("\tALT + UP")); - menuItemSyncDirNone->SetBitmap(getSyncOpImage(fsObj->testSyncOperation(true, SYNC_DIR_NONE))); - contextMenu->Append(menuItemSyncDirNone); - - //CONTEXT_SYNC_DIR_RIGHT - wxMenuItem* menuItemSyncDirRight = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_RIGHT, wxString(_("Set direction:")) + - wxT(" ") + getSymbol(fsObj->testSyncOperation(true, SYNC_DIR_RIGHT)) + - wxT("\tALT + RIGHT")); - menuItemSyncDirRight->SetBitmap(getSyncOpImage(fsObj->testSyncOperation(true, SYNC_DIR_RIGHT))); - contextMenu->Append(menuItemSyncDirRight); - - contextMenu->AppendSeparator(); - } - } - - - //CONTEXT_FILTER_TEMP - if (fsObj && (selectionLeft.size() + selectionRight.size() > 0)) - { - if (fsObj->isActive()) - { - wxMenuItem* menuItemExclTemp = new wxMenuItem(contextMenu.get(), CONTEXT_FILTER_TEMP, wxString(_("Exclude temporarily")) + wxT("\tSPACE")); - menuItemExclTemp->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("checkboxFalse"))); - contextMenu->Append(menuItemExclTemp); - } - else - { - wxMenuItem* menuItemInclTemp = new wxMenuItem(contextMenu.get(), CONTEXT_FILTER_TEMP, wxString(_("Include temporarily")) + wxT("\tSPACE")); - menuItemInclTemp->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("checkboxTrue"))); - contextMenu->Append(menuItemInclTemp); - } - } - else - { - contextMenu->Append(CONTEXT_FILTER_TEMP, wxString(_("Exclude temporarily")) + wxT("\tSPACE")); //this element should always be visible - contextMenu->Enable(CONTEXT_FILTER_TEMP, false); - } - - //############################################################################################### - //get list of relative file/dir-names for filtering - FilterObjList exFilterCandidateObj; - - class AddFilter : public FSObjectVisitor - { - public: - AddFilter(FilterObjList& fl) : filterList_(fl) {} - virtual void visit(const FileMapping& fileObj) - { - filterList_.push_back(FilterObject(fileObj.getObjRelativeName(), false)); - } - virtual void visit(const SymLinkMapping& linkObj) - { - filterList_.push_back(FilterObject(linkObj.getObjRelativeName(), false)); - } - virtual void visit(const DirMapping& dirObj) - { - filterList_.push_back(FilterObject(dirObj.getObjRelativeName(), true)); - } - - private: - FilterObjList& filterList_; - } newFilterEntry(exFilterCandidateObj); - - - for (std::set::const_iterator i = selectionLeft.begin(); i != selectionLeft.end(); ++i) - { - const FileSystemObject* currObj = gridDataView->getObject(*i); - if (currObj && !currObj->isEmpty()) - currObj->accept(newFilterEntry); - } - for (std::set::const_iterator i = selectionRight.begin(); i != selectionRight.end(); ++i) - { - const FileSystemObject* currObj = gridDataView->getObject(*i); - if (currObj && !currObj->isEmpty()) - currObj->accept(newFilterEntry); - } - //############################################################################################### - - //CONTEXT_EXCLUDE_EXT - if (exFilterCandidateObj.size() > 0 && !exFilterCandidateObj[0].isDir) - { - const Zstring filename = exFilterCandidateObj[0].relativeName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR); - if (filename.Find(wxChar('.'), false) != Zstring::npos) //be careful: AfterLast would return the whole string if '.' were not found! - { - const Zstring extension = filename.AfterLast(DefaultChar('.')); - - //add context menu item - wxMenuItem* menuItemExclExt = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_EXT, wxString(_("Exclude via filter:")) + wxT(" ") + wxT("*.") + zToWx(extension)); - menuItemExclExt->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmall"))); - contextMenu->Append(menuItemExclExt); - - //connect event - contextMenu->Connect(CONTEXT_EXCLUDE_EXT, - wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(MainDialog::OnContextExcludeExtension), - new SelectedExtension(extension), //ownership passed! - this); - } - } - - - //CONTEXT_EXCLUDE_OBJ - wxMenuItem* menuItemExclObj = NULL; - if (exFilterCandidateObj.size() == 1) - menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + zToWx(exFilterCandidateObj[0].relativeName.AfterLast(globalFunctions::FILE_NAME_SEPARATOR))); - else if (exFilterCandidateObj.size() > 1) - menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + _("")); - - if (menuItemExclObj != NULL) - { - menuItemExclObj->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmall"))); - contextMenu->Append(menuItemExclObj); - - //connect event - contextMenu->Connect(CONTEXT_EXCLUDE_OBJ, - wxEVT_COMMAND_MENU_SELECTED, - wxCommandEventHandler(MainDialog::OnContextExcludeObject), - new FilterObjContainer(exFilterCandidateObj), //ownership passed! - this); - } - - - - //CONTEXT_EXTERNAL_APP - if (!globalSettings->gui.externelApplications.empty()) - { - contextMenu->AppendSeparator(); - - const bool externalAppEnabled = (m_gridLeft->isLeadGrid() || m_gridRight->isLeadGrid()) && - (selectionLeft.size() + selectionRight.size() == 1); - - int newID = externalAppIDFirst; - for (xmlAccess::ExternalApps::iterator i = globalSettings->gui.externelApplications.begin(); - i != globalSettings->gui.externelApplications.end(); - ++i, ++newID) - { - //some trick to translate default external apps on the fly: 1. "open in explorer" 2. "start directly" - wxString description = wxGetTranslation(i->first); - if (description.empty()) - description = wxT(" "); //wxWidgets doesn't like empty items - - if (i == globalSettings->gui.externelApplications.begin()) - contextMenu->Append(newID, description + wxT("\t") + wxString(_("D-Click")) + wxT("; ENTER")); - else - contextMenu->Append(newID, description); - - contextMenu->Enable(newID, externalAppEnabled); - - //register event - contextMenu->Connect(newID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextOpenWith), NULL, this); - } - } - - - contextMenu->AppendSeparator(); - - - //CONTEXT_CLIPBOARD - contextMenu->Append(CONTEXT_CLIPBOARD, _("Copy to clipboard\tCTRL+C")); - - if ( (m_gridLeft->isLeadGrid() && selectionLeft.size()) || - (m_gridRight->isLeadGrid() && selectionRight.size())) - contextMenu->Enable(CONTEXT_CLIPBOARD, true); - else - contextMenu->Enable(CONTEXT_CLIPBOARD, false); - - - //CONTEXT_DELETE_FILES - contextMenu->Append(CONTEXT_DELETE_FILES, _("Delete files\tDEL")); - - if (selectionLeft.size() + selectionRight.size() == 0) - contextMenu->Enable(CONTEXT_DELETE_FILES, false); - - - //############################################################################################### - //connect events - contextMenu->Connect(CONTEXT_FILTER_TEMP, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextFilterTemp), NULL, this); - contextMenu->Connect(CONTEXT_CLIPBOARD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCopyClipboard), NULL, this); - contextMenu->Connect(CONTEXT_DELETE_FILES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextDeleteFiles), NULL, this); - contextMenu->Connect(CONTEXT_SYNC_DIR_LEFT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirLeft), NULL, this); - contextMenu->Connect(CONTEXT_SYNC_DIR_NONE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirNone), NULL, this); - contextMenu->Connect(CONTEXT_SYNC_DIR_RIGHT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirRight), NULL, this); - - //show context menu - PopupMenu(contextMenu.get()); -} - - -void MainDialog::OnContextFilterTemp(wxCommandEvent& event) -{ - //merge selections from left and right grid - std::set selection = getSelectedRows(); - if (!selection.empty()) - filterRangeManually(selection, static_cast(*selection.begin())); -} - - -void MainDialog::OnContextExcludeExtension(wxCommandEvent& event) -{ - SelectedExtension* selExtension = dynamic_cast(event.m_callbackUserData); - if (selExtension) - { - const Zstring newExclude = Zstring(DefaultStr("*.")) + selExtension->extension; - - //add to filter config - Zstring& excludeFilter = currentCfg.mainCfg.globalFilter.excludeFilter; - if (!excludeFilter.empty() && !excludeFilter.EndsWith(DefaultStr(";"))) - excludeFilter += DefaultStr("\n"); - excludeFilter += newExclude + DefaultStr(";"); //';' is appended to 'mark' that next exclude extension entry won't write to new line - - updateFilterButtons(); - - //do not fully apply filter, just exclude new items - addExcludeFiltering(newExclude, gridDataView->getDataTentative()); - //applyFiltering(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); - updateGuiGrid(); - - if (currentCfg.hideFilteredElements) - { - m_gridLeft-> ClearSelection(); - m_gridRight-> ClearSelection(); - m_gridMiddle->ClearSelection(); - } - } -} - - -void MainDialog::OnContextExcludeObject(wxCommandEvent& event) -{ - FilterObjContainer* objCont = dynamic_cast(event.m_callbackUserData); - if (objCont) - { - if (objCont->selectedObjects.size() > 0) //check needed to determine if filtering is needed - { - Zstring newExclude; - for (std::vector::const_iterator i = objCont->selectedObjects.begin(); i != objCont->selectedObjects.end(); ++i) - { - if (i != objCont->selectedObjects.begin()) - newExclude += DefaultStr("\n"); - - newExclude += globalFunctions::FILE_NAME_SEPARATOR + i->relativeName; - if (i->isDir) - newExclude += globalFunctions::FILE_NAME_SEPARATOR; - } - - //add to filter config - Zstring& excludeFilter = currentCfg.mainCfg.globalFilter.excludeFilter; - if (!excludeFilter.empty() && !excludeFilter.EndsWith(DefaultStr("\n"))) - excludeFilter += DefaultStr("\n"); - excludeFilter += newExclude; - - updateFilterButtons(); - - //do not fully apply filter, just exclude new items - addExcludeFiltering(newExclude, gridDataView->getDataTentative()); - //applyFiltering(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); - updateGuiGrid(); - - if (currentCfg.hideFilteredElements) - { - m_gridLeft->ClearSelection(); - m_gridRight->ClearSelection(); - m_gridMiddle->ClearSelection(); - } - } - } -} - - -void MainDialog::OnContextCopyClipboard(wxCommandEvent& event) -{ - if (m_gridLeft->isLeadGrid()) - copySelectionToClipboard(m_gridLeft); - else if (m_gridRight->isLeadGrid()) - copySelectionToClipboard(m_gridRight); -} - - -void MainDialog::OnContextOpenWith(wxCommandEvent& event) -{ - if (m_gridLeft->isLeadGrid() || m_gridRight->isLeadGrid()) - { - const CustomGrid* leadGrid = m_gridLeft->isLeadGrid() ? - static_cast(m_gridLeft) : - static_cast(m_gridRight); - std::set selection = getSelectedRows(leadGrid); - - const int index = event.GetId() - externalAppIDFirst; - - if ( selection.size() == 1 && - 0 <= index && static_cast(index) < globalSettings->gui.externelApplications.size()) - openExternalApplication(*selection.begin(), m_gridLeft->isLeadGrid(), globalSettings->gui.externelApplications[index].second); - } -} - - -void MainDialog::OnContextDeleteFiles(wxCommandEvent& event) -{ - deleteSelectedFiles(); -} - - -void MainDialog::OnContextSyncDirLeft(wxCommandEvent& event) -{ - //merge selections from left and right grid - const std::set selection = getSelectedRows(); - setSyncDirManually(selection, FreeFileSync::SYNC_DIR_LEFT); -} - - -void MainDialog::OnContextSyncDirNone(wxCommandEvent& event) -{ - //merge selections from left and right grid - const std::set selection = getSelectedRows(); - setSyncDirManually(selection, FreeFileSync::SYNC_DIR_NONE); -} - - -void MainDialog::OnContextSyncDirRight(wxCommandEvent& event) -{ - //merge selections from left and right grid - const std::set selection = getSelectedRows(); - setSyncDirManually(selection, FreeFileSync::SYNC_DIR_RIGHT); -} - - -void MainDialog::OnContextRimLabelLeft(wxGridEvent& event) -{ - contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_LEFT, _("Customize...")); - - contextMenu->AppendSeparator(); - - wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_LEFT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); - contextMenu->Append(itemAutoAdjust); - itemAutoAdjust->Check(globalSettings->gui.autoAdjustColumnsLeft); - - contextMenu->Connect(CONTEXT_CUSTOMIZE_COLUMN_LEFT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCustColumnLeft), NULL, this); - contextMenu->Connect(CONTEXT_AUTO_ADJUST_COLUMN_LEFT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextAutoAdjustLeft), NULL, this); - - PopupMenu(contextMenu.get()); //show context menu -} - - -void MainDialog::OnContextRimLabelRight(wxGridEvent& event) -{ - contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, _("Customize...")); - - contextMenu->AppendSeparator(); - - wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_RIGHT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); - contextMenu->Append(itemAutoAdjust); - itemAutoAdjust->Check(globalSettings->gui.autoAdjustColumnsRight); - - contextMenu->Connect(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCustColumnRight), NULL, this); - contextMenu->Connect(CONTEXT_AUTO_ADJUST_COLUMN_RIGHT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextAutoAdjustRight), NULL, this); - - PopupMenu(contextMenu.get()); //show context menu -} - - -void MainDialog::OnContextCustColumnLeft(wxCommandEvent& event) -{ - xmlAccess::ColumnAttributes colAttr = m_gridLeft->getColumnAttributes(); - - if (FreeFileSync::showCustomizeColsDlg(colAttr) == DefaultReturnCode::BUTTON_OKAY) - { - m_gridLeft->setColumnAttributes(colAttr); - - m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); //hide sort direction indicator on GUI grids - m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - } -} - - -void MainDialog::OnContextCustColumnRight(wxCommandEvent& event) -{ - xmlAccess::ColumnAttributes colAttr = m_gridRight->getColumnAttributes(); - - if (FreeFileSync::showCustomizeColsDlg(colAttr) == DefaultReturnCode::BUTTON_OKAY) - { - m_gridRight->setColumnAttributes(colAttr); - - m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); //hide sort direction indicator on GUI grids - m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - } -} - - -void MainDialog::OnContextAutoAdjustLeft(wxCommandEvent& event) -{ - globalSettings->gui.autoAdjustColumnsLeft = !globalSettings->gui.autoAdjustColumnsLeft; - updateGuiGrid(); -} - - -void MainDialog::OnContextAutoAdjustRight(wxCommandEvent& event) -{ - globalSettings->gui.autoAdjustColumnsRight = !globalSettings->gui.autoAdjustColumnsRight; - updateGuiGrid(); -} - - -void MainDialog::OnContextMiddle(wxGridEvent& event) -{ - contextMenu.reset(new wxMenu); //re-create context menu - - contextMenu->Append(CONTEXT_CHECK_ALL, _("Include all rows")); - contextMenu->Append(CONTEXT_UNCHECK_ALL, _("Exclude all rows")); - - if (gridDataView->rowsTotal() == 0) - { - contextMenu->Enable(CONTEXT_CHECK_ALL, false); - contextMenu->Enable(CONTEXT_UNCHECK_ALL, false); - } - - contextMenu->Connect(CONTEXT_CHECK_ALL, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextIncludeAll), NULL, this); - contextMenu->Connect(CONTEXT_UNCHECK_ALL, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextExcludeAll), NULL, this); - - PopupMenu(contextMenu.get()); //show context menu -} - - -void MainDialog::OnContextMiddleLabel(wxGridEvent& event) -{ - contextMenu.reset(new wxMenu); //re-create context menu - - wxMenuItem* itemSyncPreview = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_PREVIEW, _("Synchronization Preview")); - wxMenuItem* itemCmpResult = new wxMenuItem(contextMenu.get(), CONTEXT_COMPARISON_RESULT, _("Comparison Result")); - - if (syncPreview->previewIsEnabled()) - itemSyncPreview->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("syncViewSmall"))); - else - itemCmpResult->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("cmpViewSmall"))); - - contextMenu->Append(itemCmpResult); - contextMenu->Append(itemSyncPreview); - - contextMenu->Connect(CONTEXT_SYNC_PREVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncView), NULL, this); - contextMenu->Connect(CONTEXT_COMPARISON_RESULT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextComparisonView), NULL, this); - - PopupMenu(contextMenu.get()); //show context menu -} - - -void MainDialog::OnContextIncludeAll(wxCommandEvent& event) -{ - FreeFileSync::setActiveStatus(true, gridDataView->getDataTentative()); - refreshGridAfterFilterChange(0); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts break; -} - - -void MainDialog::OnContextExcludeAll(wxCommandEvent& event) -{ - FreeFileSync::setActiveStatus(false, gridDataView->getDataTentative()); - refreshGridAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts -} - - -void MainDialog::OnContextComparisonView(wxCommandEvent& event) -{ - syncPreview->enablePreview(false); //change view -} - - -void MainDialog::OnContextSyncView(wxCommandEvent& event) -{ - syncPreview->enablePreview(true); //change view -} - - -void MainDialog::OnDirSelected(wxFileDirPickerEvent& event) -{ - //left and right directory text-control and dirpicker are synchronized by MainFolderDragDrop automatically - - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - gridDataView->clearAllRows(); - updateGuiGrid(); - - event.Skip(); -} - - -wxString getFormattedHistoryElement(const wxString& filename) -{ - wxString output = wxFileName(filename).GetFullName(); - if (output.EndsWith(wxT(".ffs_gui"))) - output = output.BeforeLast('.'); - return output; -} - - -//tests if the same filenames are specified, even if they are relative to the current working directory/include symlinks or \\?\ prefix -class FindDuplicates -{ -public: - FindDuplicates(const Zstring& name) : m_name(name) {} - - bool operator()(const wxString& other) const - { - return Utility::sameFileSpecified(m_name, wxToZ(other)); - } - -private: - const Zstring& m_name; -}; - - -void MainDialog::addFileToCfgHistory(const wxString& filename) -{ - //only (still) existing files should be included in the list - if (Utility::fileExists(wxToZ(filename), 200) == Utility::EXISTING_FALSE) //potentially slow network access: wait 200ms - return; - - std::vector::const_iterator i = find_if(cfgFileNames.begin(), cfgFileNames.end(), FindDuplicates(wxToZ(filename))); - if (i != cfgFileNames.end()) - { - //if entry is in the list, then jump to element - m_choiceHistory->SetSelection(i - cfgFileNames.begin()); - } - else - { - cfgFileNames.insert(cfgFileNames.begin(), filename); - - //the default config file should receive another name on GUI - if (Utility::sameFileSpecified(wxToZ(lastConfigFileName()), wxToZ(filename))) - m_choiceHistory->Insert(_(""), 0); //insert at beginning of list - else - m_choiceHistory->Insert(getFormattedHistoryElement(filename), 0); //insert at beginning of list - - m_choiceHistory->SetSelection(0); - } - - //keep maximal size of history list - if (cfgFileNames.size() > globalSettings->gui.cfgHistoryMax) - { - //delete last rows - cfgFileNames.pop_back(); - m_choiceHistory->Delete(globalSettings->gui.cfgHistoryMax); - } -} - - -void MainDialog::addLeftFolderToHistory(const wxString& leftFolder) -{ - m_directoryLeft->addPairToFolderHistory(leftFolder, globalSettings->gui.folderHistLeftMax); -} - - -void MainDialog::addRightFolderToHistory(const wxString& rightFolder) -{ - m_directoryRight->addPairToFolderHistory(rightFolder, globalSettings->gui.folderHistRightMax); -} - - -void MainDialog::OnSaveConfig(wxCommandEvent& event) -{ - trySaveConfig(); -} - - -bool MainDialog::trySaveConfig() //return true if saved successfully -{ - wxString defaultFileName = currentConfigFileName.empty() ? wxT("SyncSettings.ffs_gui") : currentConfigFileName; - //attention: currentConfigFileName may be an imported *.ffs_batch file! We don't want to overwrite it with a GUI config! - if (defaultFileName.EndsWith(wxT(".ffs_batch"))) - defaultFileName.Replace(wxT(".ffs_batch"), wxT(".ffs_gui"), false); - - - wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("FreeFileSync configuration")) + wxT(" (*.ffs_gui)|*.ffs_gui"), wxFD_SAVE); - if (filePicker->ShowModal() == wxID_OK) - { - const wxString newFileName = filePicker->GetPath(); - - if (FreeFileSync::fileExists(wxToZ(newFileName))) - { - QuestionDlg* messageDlg = new QuestionDlg(this, - QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, - wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\"")); - - if (messageDlg->ShowModal() != QuestionDlg::BUTTON_YES) - return trySaveConfig(); //retry - } - - if (writeConfigurationToXml(newFileName)) - { - pushStatusInformation(_("Configuration saved!")); - return true; - } - } - - return false; -} - - -void MainDialog::OnLoadConfig(wxCommandEvent& event) -{ - wxFileDialog* filePicker = new wxFileDialog(this, - wxEmptyString, - wxEmptyString, - wxEmptyString, - wxString(_("FreeFileSync configuration")) + wxT(" (*.ffs_gui;*.ffs_batch)|*.ffs_gui;*.ffs_batch"), wxFD_OPEN); - - if (filePicker->ShowModal() == wxID_OK) - loadConfiguration(filePicker->GetPath()); -} - - -void MainDialog::OnNewConfig(wxCommandEvent& event) -{ - if (!saveOldConfig()) //notify user about changed settings - return; - - setCurrentConfiguration(xmlAccess::XmlGuiConfig()); - - SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); - currentConfigFileName.clear(); -} - - -void MainDialog::OnLoadFromHistory(wxCommandEvent& event) -{ - const int selectedItem = m_choiceHistory->GetSelection(); - if (0 <= selectedItem && unsigned(selectedItem) < cfgFileNames.size()) - loadConfiguration(cfgFileNames[selectedItem]); -} - - -bool MainDialog::saveOldConfig() //return false on user abort -{ - //notify user about changed settings - if (globalSettings->optDialogs.popupOnConfigChange && !currentConfigFileName.empty()) //only if check is active and non-default config file loaded - { - if (lastConfigurationSaved != getCurrentConfiguration()) - { - bool dontShowAgain = !globalSettings->optDialogs.popupOnConfigChange; - - QuestionDlg* notifyChangeDlg = new QuestionDlg(this, - QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_NO | QuestionDlg::BUTTON_CANCEL, - _("Save changes to current configuration?"), - &dontShowAgain); - - switch (notifyChangeDlg->ShowModal()) - { - case QuestionDlg::BUTTON_YES: - if (!trySaveConfig()) - return false; - break; - case QuestionDlg::BUTTON_NO: - globalSettings->optDialogs.popupOnConfigChange = !dontShowAgain; - break; - case QuestionDlg::BUTTON_CANCEL: - return false; - } - } - } - return true; -} - - -void MainDialog::loadConfiguration(const wxString& filename) -{ - if (!filename.IsEmpty()) - { - if (!saveOldConfig()) - return; - - if (readConfigurationFromXml(filename)) - pushStatusInformation(_("Configuration loaded!")); - } -} - - -void MainDialog::OnCfgHistoryKeyEvent(wxKeyEvent& event) -{ - const int keyCode = event.GetKeyCode(); - if (keyCode == WXK_DELETE || keyCode == WXK_NUMPAD_DELETE) - { - //try to delete the currently selected config history item - const int selectedItem = m_choiceHistory->GetCurrentSelection(); - if ( 0 <= selectedItem && - selectedItem < int(m_choiceHistory->GetCount()) && - selectedItem < int(cfgFileNames.size())) - { - //delete selected row - cfgFileNames.erase(cfgFileNames.begin() + selectedItem); - m_choiceHistory->Delete(selectedItem); - } - } - event.Skip(); -} - - -void MainDialog::OnClose(wxCloseEvent &event) -{ - if (!saveOldConfig()) //notify user about changed settings - return; - - Destroy(); -} - - -void MainDialog::OnQuit(wxCommandEvent &event) -{ - if (!saveOldConfig()) //notify user about changed settings - return; - - Destroy(); -} - - -void MainDialog::OnCheckRows(FFSCheckRowsEvent& event) -{ - const int lowerBound = std::min(event.rowFrom, event.rowTo); - const int upperBound = std::max(event.rowFrom, event.rowTo); - - if (0 <= lowerBound) - { - std::set selectedRowsOnView; - - for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView->rowsOnView()) - 1); ++i) - selectedRowsOnView.insert(i); - - filterRangeManually(selectedRowsOnView, event.rowFrom); - } -} - - -void MainDialog::OnSetSyncDirection(FFSSyncDirectionEvent& event) -{ - const int lowerBound = std::min(event.rowFrom, event.rowTo); - const int upperBound = std::max(event.rowFrom, event.rowTo); - - if (0 <= lowerBound) - { - for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView->rowsOnView()) - 1); ++i) - { - FileSystemObject* fsObj = gridDataView->getObject(i); - if (fsObj) - { - setSyncDirectionRec(event.direction, *fsObj); //set new direction (recursively) - FreeFileSync::setActiveStatus(true, *fsObj); //works recursively for directories - } - } - - updateGuiGrid(); - } -} - - -bool MainDialog::readConfigurationFromXml(const wxString& filename) -{ - //load XML - xmlAccess::XmlGuiConfig newGuiCfg; //structure to receive gui settings, already defaulted!! - bool parsingError = true; - try - { - xmlAccess::readGuiOrBatchConfig(filename, newGuiCfg); //allow reading batch configurations also - parsingError = false; - } - catch (const xmlAccess::XmlError& error) - { - if (error.getSeverity() == xmlAccess::XmlError::WARNING) - wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); - else - { - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); - return false; - } - } - - setCurrentConfiguration(newGuiCfg); - - setLastUsedConfig(filename, parsingError ? xmlAccess::XmlGuiConfig() : newGuiCfg); //simulate changed config on parsing errors - - return !parsingError; -} - - -void MainDialog::setLastUsedConfig(const wxString& filename, const xmlAccess::XmlGuiConfig& guiConfig) -{ - addFileToCfgHistory(filename); //put filename on list of last used config files - - //set title - if (filename == lastConfigFileName()) - { - SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); - currentConfigFileName.clear(); - } - else - { - SetTitle(wxString(wxT("FreeFileSync - ")) + filename); - currentConfigFileName = filename; - } - - lastConfigurationSaved = guiConfig; -} - - -bool MainDialog::writeConfigurationToXml(const wxString& filename) -{ - const xmlAccess::XmlGuiConfig guiCfg = getCurrentConfiguration(); - - //write config to XML - try - { - xmlAccess::writeGuiConfig(guiCfg, filename); - } - catch (const xmlAccess::XmlError& error) - { - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); - return false; - } - - setLastUsedConfig(filename, guiCfg); - - return true; -} - - -void MainDialog::setCurrentConfiguration(const xmlAccess::XmlGuiConfig& newGuiCfg) -{ - currentCfg = newGuiCfg; - - //evaluate new settings... - - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - gridDataView->clearAllRows(); - updateGuiGrid(); - - //(re-)set view filter buttons - initViewFilterButtons(); - - updateFilterButtons(); - - //set first folder pair - firstFolderPair->setValues(currentCfg.mainCfg.firstPair.leftDirectory, - currentCfg.mainCfg.firstPair.rightDirectory, - currentCfg.mainCfg.firstPair.altSyncConfig, - currentCfg.mainCfg.firstPair.localFilter); - - addLeftFolderToHistory( zToWx(currentCfg.mainCfg.firstPair.leftDirectory)); //another hack: wxCombobox::Insert() asynchronously sends message - addRightFolderToHistory(zToWx(currentCfg.mainCfg.firstPair.rightDirectory)); //overwriting a later wxCombobox::SetValue()!!! :( - - //clear existing additional folder pairs - clearAddFolderPairs(); - - //set additional pairs - addFolderPair(currentCfg.mainCfg.additionalPairs); - - - //read GUI layout - m_checkBoxHideFilt->SetValue(currentCfg.hideFilteredElements); - - syncPreview->enablePreview(currentCfg.syncPreviewEnabled); - - //########################################################### - //update compare variant name - m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); - - //update sync variant name - m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + currentCfg.mainCfg.getSyncVariantName() + wxT(")")); - bSizer6->Layout(); //adapt layout for variant text -} - - -inline -FolderPairEnh getEnahncedPair(const FolderPairPanel* panel) -{ - return FolderPairEnh(panel->getLeftDir(), - panel->getRightDir(), - panel->getAltSyncConfig(), - panel->getAltFilterConfig()); -} - - -xmlAccess::XmlGuiConfig MainDialog::getCurrentConfiguration() const -{ - xmlAccess::XmlGuiConfig guiCfg = currentCfg; - - //load settings whose ownership lies not in currentCfg: - - //first folder pair - guiCfg.mainCfg.firstPair = FolderPairEnh(firstFolderPair->getLeftDir(), - firstFolderPair->getRightDir(), - firstFolderPair->getAltSyncConfig(), - firstFolderPair->getAltFilterConfig()); - - //add additional pairs - guiCfg.mainCfg.additionalPairs.clear(); - std::transform(additionalFolderPairs.begin(), additionalFolderPairs.end(), - std::back_inserter(guiCfg.mainCfg.additionalPairs), getEnahncedPair); - - //sync preview - guiCfg.syncPreviewEnabled = syncPreview->previewIsEnabled(); - - return guiCfg; -} - - -const wxString& MainDialog::lastConfigFileName() -{ - static wxString instance = FreeFileSync::getConfigDir() + wxT("LastRun.ffs_gui"); - return instance; -} - - -void MainDialog::refreshGridAfterFilterChange(const int delay) -{ - //signal UI that grids need to be refreshed on next Update() - m_gridLeft->ForceRefresh(); - m_gridMiddle->ForceRefresh(); - m_gridRight->ForceRefresh(); - Update(); //show changes resulting from ForceRefresh() - - if (currentCfg.hideFilteredElements) - { - wxMilliSleep(delay); //some delay to show user the rows he has filtered out before they are removed - updateGuiGrid(); //redraw grid to remove excluded elements (keeping sort sequence) - - m_gridLeft->ClearSelection(); - m_gridRight->ClearSelection(); - } - else - updateGuiGrid(); -} - - -void MainDialog::OnHideFilteredButton(wxCommandEvent &event) -{ - //toggle showing filtered rows - currentCfg.hideFilteredElements = !currentCfg.hideFilteredElements; - //make sure, checkbox and "hideFiltered" are in sync - m_checkBoxHideFilt->SetValue(currentCfg.hideFilteredElements); - - m_gridLeft->ClearSelection(); - m_gridRight->ClearSelection(); - updateGuiGrid(); - -// event.Skip(); -} - - -void MainDialog::OnConfigureFilter(wxCommandEvent &event) -{ - if (showFilterDialog(true, //is main filter dialog - currentCfg.mainCfg.globalFilter.includeFilter, - currentCfg.mainCfg.globalFilter.excludeFilter) == DefaultReturnCode::BUTTON_OKAY) - { - updateFilterButtons(); //refresh global filter icon - updateFilterConfig(); //re-apply filter - } - - //event.Skip() -} - - -void MainDialog::OnGlobalFilterOpenContext(wxCommandEvent& event) -{ - const int menuId = 1234; - contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(menuId, _("Clear filter settings")); - contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnGlobalFilterRemConfirm), NULL, this); - - if (isNullFilter(currentCfg.mainCfg.globalFilter)) - contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway - - PopupMenu(contextMenu.get()); //show context menu -} - - -void MainDialog::OnGlobalFilterRemConfirm(wxCommandEvent& event) -{ - currentCfg.mainCfg.globalFilter = FilterConfig(); - - updateFilterButtons(); //refresh global filter icon - updateFilterConfig(); //re-apply filter -} - - -void MainDialog::OnLeftOnlyFiles(wxCommandEvent& event) -{ - m_bpButtonLeftOnly->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) -{ - m_bpButtonLeftNewer->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnDifferentFiles(wxCommandEvent& event) -{ - m_bpButtonDifferent->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnRightNewerFiles(wxCommandEvent& event) -{ - m_bpButtonRightNewer->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) -{ - m_bpButtonRightOnly->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnEqualFiles(wxCommandEvent& event) -{ - m_bpButtonEqual->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnConflictFiles(wxCommandEvent& event) -{ - m_bpButtonConflict->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncCreateLeft(wxCommandEvent& event) -{ - m_bpButtonSyncCreateLeft->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncCreateRight(wxCommandEvent& event) -{ - m_bpButtonSyncCreateRight->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncDeleteLeft(wxCommandEvent& event) -{ - m_bpButtonSyncDeleteLeft->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncDeleteRight(wxCommandEvent& event) -{ - m_bpButtonSyncDeleteRight->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncDirLeft(wxCommandEvent& event) -{ - m_bpButtonSyncDirOverwLeft->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncDirRight(wxCommandEvent& event) -{ - m_bpButtonSyncDirOverwRight->toggle(); - updateGuiGrid(); -} - - -void MainDialog::OnSyncDirNone(wxCommandEvent& event) -{ - m_bpButtonSyncDirNone->toggle(); - updateGuiGrid(); -} - - -void MainDialog::initViewFilterButtons() -{ - //compare result buttons - m_bpButtonLeftOnly->init(GlobalResources::getInstance().getImageByName(wxT("leftOnlyAct")), - _("Hide files that exist on left side only"), - GlobalResources::getInstance().getImageByName(wxT("leftOnlyDeact")), - _("Show files that exist on left side only")); - - m_bpButtonRightOnly->init(GlobalResources::getInstance().getImageByName(wxT("rightOnlyAct")), - _("Hide files that exist on right side only"), - GlobalResources::getInstance().getImageByName(wxT("rightOnlyDeact")), - _("Show files that exist on right side only")); - - m_bpButtonLeftNewer->init(GlobalResources::getInstance().getImageByName(wxT("leftNewerAct")), - _("Hide files that are newer on left"), - GlobalResources::getInstance().getImageByName(wxT("leftNewerDeact")), - _("Show files that are newer on left")); - - m_bpButtonRightNewer->init(GlobalResources::getInstance().getImageByName(wxT("rightNewerAct")), - _("Hide files that are newer on right"), - GlobalResources::getInstance().getImageByName(wxT("rightNewerDeact")), - _("Show files that are newer on right")); - - m_bpButtonEqual->init(GlobalResources::getInstance().getImageByName(wxT("equalAct")), - _("Hide files that are equal"), - GlobalResources::getInstance().getImageByName(wxT("equalDeact")), - _("Show files that are equal")); - - m_bpButtonDifferent->init(GlobalResources::getInstance().getImageByName(wxT("differentAct")), - _("Hide files that are different"), - GlobalResources::getInstance().getImageByName(wxT("differentDeact")), - _("Show files that are different")); - - m_bpButtonConflict->init(GlobalResources::getInstance().getImageByName(wxT("conflictAct")), - _("Hide conflicts"), - GlobalResources::getInstance().getImageByName(wxT("conflictDeact")), - _("Show conflicts")); - - //sync preview buttons - m_bpButtonSyncCreateLeft->init(GlobalResources::getInstance().getImageByName(wxT("syncCreateLeftAct")), - _("Hide files that will be created on the left side"), - GlobalResources::getInstance().getImageByName(wxT("syncCreateLeftDeact")), - _("Show files that will be created on the left side")); - - m_bpButtonSyncCreateRight->init(GlobalResources::getInstance().getImageByName(wxT("syncCreateRightAct")), - _("Hide files that will be created on the right side"), - GlobalResources::getInstance().getImageByName(wxT("syncCreateRightDeact")), - _("Show files that will be created on the right side")); - - m_bpButtonSyncDeleteLeft->init(GlobalResources::getInstance().getImageByName(wxT("syncDeleteLeftAct")), - _("Hide files that will be deleted on the left side"), - GlobalResources::getInstance().getImageByName(wxT("syncDeleteLeftDeact")), - _("Show files that will be deleted on the left side")); - - m_bpButtonSyncDeleteRight->init(GlobalResources::getInstance().getImageByName(wxT("syncDeleteRightAct")), - _("Hide files that will be deleted on the right side"), - GlobalResources::getInstance().getImageByName(wxT("syncDeleteRightDeact")), - _("Show files that will be deleted on the right side")); - - m_bpButtonSyncDirOverwLeft->init(GlobalResources::getInstance().getImageByName(wxT("syncDirLeftAct")), - _("Hide files that will be overwritten on left side"), - GlobalResources::getInstance().getImageByName(wxT("syncDirLeftDeact")), - _("Show files that will be overwritten on left side")); - - m_bpButtonSyncDirOverwRight->init(GlobalResources::getInstance().getImageByName(wxT("syncDirRightAct")), - _("Hide files that will be overwritten on right side"), - GlobalResources::getInstance().getImageByName(wxT("syncDirRightDeact")), - _("Show files that will be overwritten on right side")); - - m_bpButtonSyncDirNone->init(GlobalResources::getInstance().getImageByName(wxT("syncDirNoneAct")), - _("Hide files that won't be copied"), - GlobalResources::getInstance().getImageByName(wxT("syncDirNoneDeact")), - _("Show files that won't be copied")); - - //compare result buttons - m_bpButtonLeftOnly-> setActive(true); - m_bpButtonRightOnly-> setActive(true); - m_bpButtonLeftNewer-> setActive(true); - m_bpButtonRightNewer->setActive(true); - m_bpButtonEqual-> setActive(false); - m_bpButtonDifferent-> setActive(true); - m_bpButtonConflict-> setActive(true); - - //sync preview buttons - m_bpButtonSyncCreateLeft-> setActive(true); - m_bpButtonSyncCreateRight-> setActive(true); - m_bpButtonSyncDeleteLeft-> setActive(true); - m_bpButtonSyncDeleteRight-> setActive(true); - m_bpButtonSyncDirOverwLeft-> setActive(true); - m_bpButtonSyncDirOverwRight->setActive(true); - m_bpButtonSyncDirNone-> setActive(true); -} - - -void MainDialog::updateFilterButtons() -{ - //prepare filter icon - if (m_notebookBottomLeft->GetImageList() == NULL) - { - wxImageList* panelIcons = new wxImageList(16, 16); - panelIcons->Add(wxBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmall")))); - panelIcons->Add(wxBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmallGrey")))); - m_notebookBottomLeft->AssignImageList(panelIcons); //pass ownership - } - - //global filter: test for Null-filter - if (isNullFilter(currentCfg.mainCfg.globalFilter)) - { - m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOff"))); - m_bpButtonFilter->SetToolTip(_("No filter selected")); - - //additional filter icon - m_notebookBottomLeft->SetPageImage(1, 1); - } - else - { - m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOn"))); - m_bpButtonFilter->SetToolTip(_("Filter is active")); - - //show filter icon - m_notebookBottomLeft->SetPageImage(1, 0); - } - - //update main local filter - firstFolderPair->refreshButtons(); - - //update folder pairs - for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) - { - FolderPairPanel* dirPair = *i; - dirPair->refreshButtons(); - } -} - - -void MainDialog::OnCompare(wxCommandEvent &event) -{ - //PERF_START; - clearStatusBar(); - - wxBusyCursor dummy; //show hourglass cursor - - //prevent temporary memory peak by clearing old result list - gridDataView->clearAllRows(); - updateGuiGrid(); //refresh GUI grid - - bool aborted = false; - try - { - //class handling status display and error messages - CompareStatusHandler statusHandler(this); - - //begin comparison - FreeFileSync::CompareProcess comparison(currentCfg.mainCfg.handleSymlinks, - currentCfg.mainCfg.hidden.fileTimeTolerance, - globalSettings->ignoreOneHourDiff, - globalSettings->optDialogs, - &statusHandler); - - //technical representation of comparison data - FreeFileSync::FolderComparison newCompareData; - - comparison.startCompareProcess( - FreeFileSync::extractCompareCfg(getCurrentConfiguration().mainCfg), //call getCurrentCfg() to get current values for directory pairs! - currentCfg.mainCfg.compareVar, - newCompareData); - - gridDataView->setData(newCompareData); //newCompareData is invalidated after this call - - //play (optional) sound notification after sync has completed (GUI and batch mode) - const wxString soundFile = FreeFileSync::getResourceDir() + wxT("Compare_Complete.wav"); - if (fileExists(wxToZ(soundFile))) - wxSound::Play(soundFile, wxSOUND_ASYNC); - } - catch (AbortThisProcess&) - { - aborted = true; - } - - if (aborted) - { - //disable the sync button - syncPreview->enableSynchronization(false); - m_buttonCompare->SetFocus(); - updateGuiGrid(); //refresh grid in ANY case! (also on abort) - } - else - { - //once compare is finished enable the sync button - syncPreview->enableSynchronization(true); - m_buttonStartSync->SetFocus(); - - //hide sort direction indicator on GUI grids - m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - - //reset last sort selection: used for determining sort direction - lastSortColumn = -1; - lastSortGrid = NULL; - - m_gridLeft-> ClearSelection(); - m_gridMiddle->ClearSelection(); - m_gridRight-> ClearSelection(); - - //add to folder history after successful comparison only - addLeftFolderToHistory( m_directoryLeft->GetValue()); - addRightFolderToHistory(m_directoryRight->GetValue()); - - //refresh grid in ANY case! (also on abort) - updateGuiGrid(); - - //prepare status information - wxString statusInfo; - if (allElementsEqual(gridDataView->getDataTentative())) - statusInfo += _("All directories in sync!"); - pushStatusInformation(statusInfo); - } -} - - -void MainDialog::updateGuiGrid() -{ - updateGridViewData(); //update gridDataView and write status information - - //all three grids retrieve their data directly via gridDataView - //the only thing left to do is notify the grids to updafte their sizes (nr of rows), since this has to be communicated by the grids via messages - m_gridLeft ->updateGridSizes(); - m_gridMiddle->updateGridSizes(); - m_gridRight ->updateGridSizes(); - - //enlarge label width to display row numbers correctly - const int nrOfRows = m_gridLeft->GetNumberRows(); - if (nrOfRows >= 0) - { -#ifdef FFS_WIN - const size_t digitWidth = 8; -#elif defined FFS_LINUX - const size_t digitWidth = 10; -#endif - const size_t nrOfDigits = globalFunctions::getDigitCount(static_cast(nrOfRows)); - m_gridLeft ->SetRowLabelSize(static_cast(nrOfDigits * digitWidth + 4)); - m_gridRight->SetRowLabelSize(static_cast(nrOfDigits * digitWidth + 4)); - } - - //support for column auto adjustment - if (globalSettings->gui.autoAdjustColumnsLeft) - m_gridLeft->autoSizeColumns(); - if (globalSettings->gui.autoAdjustColumnsRight) - m_gridRight->autoSizeColumns(); - - //update sync preview statistics - calculatePreview(); - - m_gridLeft ->Refresh(); - m_gridMiddle->Refresh(); - m_gridRight ->Refresh(); -} - - -void MainDialog::calculatePreview() -{ - //update preview of bytes to be transferred: - const SyncStatistics st(gridDataView->getDataTentative()); - const wxString toCreate = FreeFileSync::numberToStringSep(st.getCreate()); - const wxString toUpdate = FreeFileSync::numberToStringSep(st.getOverwrite()); - const wxString toDelete = FreeFileSync::numberToStringSep(st.getDelete()); - const wxString data = FreeFileSync::formatFilesizeToShortString(st.getDataToProcess()); - - m_textCtrlCreate->SetValue(toCreate); - m_textCtrlUpdate->SetValue(toUpdate); - m_textCtrlDelete->SetValue(toDelete); - m_textCtrlData->SetValue(data); -} - - -void MainDialog::OnSwitchView(wxCommandEvent& event) -{ - //toggle view - syncPreview->enablePreview(!syncPreview->previewIsEnabled()); -} - - -void MainDialog::OnSyncSettings(wxCommandEvent& event) -{ - SyncCfgDialog* syncDlg = new SyncCfgDialog(this, - currentCfg.mainCfg.compareVar, - currentCfg.mainCfg.syncConfiguration, - currentCfg.mainCfg.handleDeletion, - currentCfg.mainCfg.customDeletionDirectory, - ¤tCfg.ignoreErrors); - if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_APPLY) - { - updateSyncConfig(); - } -} - - -void MainDialog::OnCmpSettings(wxCommandEvent& event) -{ - //show window right next to the compare-config button - wxPoint windowPos = m_bpButtonCmpConfig->GetScreenPosition(); - windowPos.x += m_bpButtonCmpConfig->GetSize().GetWidth() + 5; - - if (FreeFileSync::showCompareCfgDialog(windowPos, - currentCfg.mainCfg.compareVar, - currentCfg.mainCfg.handleSymlinks) == DefaultReturnCode::BUTTON_OKAY) - { - //update compare variant name - m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); - bSizer6->Layout(); //adapt layout for variant text - - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - gridDataView->clearAllRows(); - updateGuiGrid(); - - m_buttonCompare->SetFocus(); - } -} - - -void MainDialog::OnStartSync(wxCommandEvent& event) -{ - if (!syncPreview->synchronizationIsEnabled()) - { - pushStatusInformation(_("Please run a Compare first before synchronizing!")); - return; - } - - //show sync preview screen - if (globalSettings->optDialogs.showSummaryBeforeSync) - { - bool dontShowAgain = false; - - if (FreeFileSync::showSyncPreviewDlg( - getCurrentConfiguration().mainCfg.getSyncVariantName(), - FreeFileSync::SyncStatistics(gridDataView->getDataTentative()), - dontShowAgain) != DefaultReturnCode::BUTTON_OKAY) - return; - - globalSettings->optDialogs.showSummaryBeforeSync = !dontShowAgain; - } - - wxBusyCursor dummy; //show hourglass cursor - - clearStatusBar(); - try - { - //PERF_START; - - //class handling status updates and error messages - SyncStatusHandler statusHandler(this, currentCfg.ignoreErrors); - - //check if there are files/folders to be sync'ed at all - if (!synchronizationNeeded(gridDataView->getDataTentative())) - statusHandler.reportInfo(_("Nothing to synchronize according to configuration!")); //inform about this special case - - //start synchronization and mark all elements processed - FreeFileSync::SyncProcess synchronization( - globalSettings->optDialogs, - currentCfg.mainCfg.hidden.verifyFileCopy, - globalSettings->copyLockedFiles, - statusHandler); - - const std::vector syncProcessCfg = FreeFileSync::extractSyncCfg(getCurrentConfiguration().mainCfg); - FolderComparison& dataToSync = gridDataView->getDataTentative(); - - //make sure syncProcessCfg and dataToSync have same size and correspond! - if (syncProcessCfg.size() != dataToSync.size()) - throw std::logic_error("Programming Error: Contract violation!"); //should never happen: sync button is deactivated if they are not in sync - - synchronization.startSynchronizationProcess(syncProcessCfg, dataToSync); - - //play (optional) sound notification after sync has completed (GUI and batch mode) - const wxString soundFile = FreeFileSync::getResourceDir() + wxT("Sync_Complete.wav"); - if (fileExists(wxToZ(soundFile))) - wxSound::Play(soundFile, wxSOUND_ASYNC); - } - catch (AbortThisProcess&) - { - //do NOT disable the sync button: user might want to try to sync the REMAINING rows - } //enableSynchronization(false); - - //remove rows that empty: just a beautification, invalid rows shouldn't cause issues - gridDataView->removeInvalidRows(); - - updateGuiGrid(); - - m_gridLeft-> ClearSelection(); - m_gridMiddle->ClearSelection(); - m_gridRight-> ClearSelection(); -} - - -void MainDialog::OnLeftGridDoubleClick(wxGridEvent& event) -{ - if (!globalSettings->gui.externelApplications.empty()) - openExternalApplication(event.GetRow(), true, globalSettings->gui.externelApplications[0].second); - // event.Skip(); -} - - -void MainDialog::OnRightGridDoubleClick(wxGridEvent& event) -{ - if (!globalSettings->gui.externelApplications.empty()) - openExternalApplication(event.GetRow(), false, globalSettings->gui.externelApplications[0].second); -// event.Skip(); -} - - -void MainDialog::OnSortLeftGrid(wxGridEvent& event) -{ - //determine direction for std::sort() - const int currentSortColumn = event.GetCol(); - if (0 <= currentSortColumn && currentSortColumn < int(xmlAccess::COLUMN_TYPE_COUNT)) - { - static bool sortDefault = true; - if (lastSortColumn != currentSortColumn || lastSortGrid != m_gridLeft) - sortDefault = true; - else - sortDefault = !sortDefault; - - lastSortColumn = currentSortColumn; - lastSortGrid = m_gridLeft; - - GridView::SortType st = GridView::SORT_BY_REL_NAME; - - const xmlAccess::ColumnTypes columnType = m_gridLeft->getTypeAtPos(currentSortColumn); - switch (columnType) - { - case xmlAccess::FULL_PATH: - st = GridView::SORT_BY_REL_NAME; - break; - case xmlAccess::FILENAME: - st = GridView::SORT_BY_FILENAME; - break; - case xmlAccess::REL_PATH: - st = GridView::SORT_BY_REL_NAME; - break; - case xmlAccess::DIRECTORY: - st = GridView::SORT_BY_DIRECTORY; - break; - case xmlAccess::SIZE: - st = GridView::SORT_BY_FILESIZE; - break; - case xmlAccess::DATE: - st = GridView::SORT_BY_DATE; - break; - case xmlAccess::EXTENSION: - st = GridView::SORT_BY_EXTENSION; - break; - } - - const bool sortAscending = sortDefault ? - GridView::getDefaultDirection(st) : - !GridView::getDefaultDirection(st); - - gridDataView->sortView(st, true, sortAscending); - - updateGuiGrid(); //refresh gridDataView - - //set sort direction indicator on UI - m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridLeft->setSortMarker(CustomGrid::SortMarker(currentSortColumn, sortAscending ? CustomGrid::ASCENDING : CustomGrid::DESCENDING)); - } -} - - -void MainDialog::OnSortMiddleGrid(wxGridEvent& event) -{ - //determine direction for std::sort() - static bool sortDefault = true; - if (lastSortColumn != 0 || lastSortGrid != m_gridMiddle) - sortDefault = true; - else - sortDefault = !sortDefault; - lastSortColumn = 0; - lastSortGrid = m_gridMiddle; - - //start sort - if (syncPreview->previewIsEnabled()) - gridDataView->sortView(GridView::SORT_BY_SYNC_DIRECTION, true, sortDefault); - else - gridDataView->sortView(GridView::SORT_BY_CMP_RESULT, true, sortDefault); - - updateGuiGrid(); //refresh gridDataView - - //set sort direction indicator on UI - m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridMiddle->setSortMarker(CustomGrid::SortMarker(0, sortDefault ? CustomGrid::ASCENDING : CustomGrid::DESCENDING)); -} - - -void MainDialog::OnSortRightGrid(wxGridEvent& event) -{ - //determine direction for std::sort() - const int currentSortColumn = event.GetCol(); - if (0 <= currentSortColumn && currentSortColumn < int(xmlAccess::COLUMN_TYPE_COUNT)) - { - static bool sortDefault = true; - if (lastSortColumn != currentSortColumn || lastSortGrid != m_gridRight) - sortDefault = true; - else - sortDefault = !sortDefault; - - lastSortColumn = currentSortColumn; - lastSortGrid = m_gridRight; - - GridView::SortType st = GridView::SORT_BY_REL_NAME; - - const xmlAccess::ColumnTypes columnType = m_gridRight->getTypeAtPos(currentSortColumn); - switch (columnType) - { - case xmlAccess::FULL_PATH: - st = GridView::SORT_BY_REL_NAME; - break; - case xmlAccess::FILENAME: - st = GridView::SORT_BY_FILENAME; - break; - case xmlAccess::REL_PATH: - st = GridView::SORT_BY_REL_NAME; - break; - case xmlAccess::DIRECTORY: - st = GridView::SORT_BY_DIRECTORY; - break; - case xmlAccess::SIZE: - st = GridView::SORT_BY_FILESIZE; - break; - case xmlAccess::DATE: - st = GridView::SORT_BY_DATE; - break; - case xmlAccess::EXTENSION: - st = GridView::SORT_BY_EXTENSION; - break; - } - - const bool sortAscending = sortDefault ? - GridView::getDefaultDirection(st) : - !GridView::getDefaultDirection(st); - - gridDataView->sortView(st, false, sortAscending); - - updateGuiGrid(); //refresh gridDataView - - //set sort direction indicator on UI - m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->setSortMarker(CustomGrid::SortMarker(currentSortColumn, sortAscending ? CustomGrid::ASCENDING : CustomGrid::DESCENDING)); - } -} - - -void MainDialog::OnSwapSides(wxCommandEvent& event) -{ - //swap directory names: first pair - firstFolderPair->setValues(firstFolderPair->getRightDir(), // swap directories - firstFolderPair->getLeftDir(), // - firstFolderPair->getAltSyncConfig(), - firstFolderPair->getAltFilterConfig()); - - //additional pairs - for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) - { - FolderPairPanel* dirPair = *i; - dirPair->setValues(dirPair->getRightDir(), // swap directories - dirPair->getLeftDir(), // - dirPair->getAltSyncConfig(), - dirPair->getAltFilterConfig()); - } - - //swap view filter - bool tmp = m_bpButtonLeftOnly->isActive(); - m_bpButtonLeftOnly->setActive(m_bpButtonRightOnly->isActive()); - m_bpButtonRightOnly->setActive(tmp); - - tmp = m_bpButtonLeftNewer->isActive(); - m_bpButtonLeftNewer->setActive(m_bpButtonRightNewer->isActive()); - m_bpButtonRightNewer->setActive(tmp); - - - tmp = m_bpButtonSyncCreateLeft->isActive(); - m_bpButtonSyncCreateLeft->setActive(m_bpButtonSyncCreateRight->isActive()); - m_bpButtonSyncCreateRight->setActive(tmp); - - tmp = m_bpButtonSyncDeleteLeft->isActive(); - m_bpButtonSyncDeleteLeft->setActive(m_bpButtonSyncDeleteRight->isActive()); - m_bpButtonSyncDeleteRight->setActive(tmp); - - tmp = m_bpButtonSyncDirOverwLeft->isActive(); - m_bpButtonSyncDirOverwLeft->setActive(m_bpButtonSyncDirOverwRight->isActive()); - m_bpButtonSyncDirOverwRight->setActive(tmp); - - //swap grid information - FreeFileSync::swapGrids(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); - updateGuiGrid(); -} - - -void MainDialog::updateGridViewData() -{ - size_t filesOnLeftView = 0; - size_t foldersOnLeftView = 0; - size_t filesOnRightView = 0; - size_t foldersOnRightView = 0; - wxULongLong filesizeLeftView; - wxULongLong filesizeRightView; - - //disable all buttons per default - m_bpButtonLeftOnly-> Show(false); - m_bpButtonRightOnly-> Show(false); - m_bpButtonLeftNewer-> Show(false); - m_bpButtonRightNewer->Show(false); - m_bpButtonDifferent-> Show(false); - m_bpButtonEqual-> Show(false); - m_bpButtonConflict-> Show(false); - - m_bpButtonSyncCreateLeft-> Show(false); - m_bpButtonSyncCreateRight-> Show(false); - m_bpButtonSyncDeleteLeft-> Show(false); - m_bpButtonSyncDeleteRight-> Show(false); - m_bpButtonSyncDirOverwLeft-> Show(false); - m_bpButtonSyncDirOverwRight->Show(false); - m_bpButtonSyncDirNone-> Show(false); - - - if (syncPreview->previewIsEnabled()) - { - const GridView::StatusSyncPreview result = gridDataView->updateSyncPreview(currentCfg.hideFilteredElements, - m_bpButtonSyncCreateLeft-> isActive(), - m_bpButtonSyncCreateRight-> isActive(), - m_bpButtonSyncDeleteLeft-> isActive(), - m_bpButtonSyncDeleteRight-> isActive(), - m_bpButtonSyncDirOverwLeft-> isActive(), - m_bpButtonSyncDirOverwRight->isActive(), - m_bpButtonSyncDirNone-> isActive(), - m_bpButtonEqual-> isActive(), - m_bpButtonConflict-> isActive()); - - filesOnLeftView = result.filesOnLeftView; - foldersOnLeftView = result.foldersOnLeftView; - filesOnRightView = result.filesOnRightView; - foldersOnRightView = result.foldersOnRightView; - filesizeLeftView = result.filesizeLeftView; - filesizeRightView = result.filesizeRightView; - - - //sync preview buttons - m_bpButtonSyncCreateLeft-> Show(result.existsSyncCreateLeft); - m_bpButtonSyncCreateRight-> Show(result.existsSyncCreateRight); - m_bpButtonSyncDeleteLeft-> Show(result.existsSyncDeleteLeft); - m_bpButtonSyncDeleteRight-> Show(result.existsSyncDeleteRight); - m_bpButtonSyncDirOverwLeft-> Show(result.existsSyncDirLeft); - m_bpButtonSyncDirOverwRight->Show(result.existsSyncDirRight); - m_bpButtonSyncDirNone-> Show(result.existsSyncDirNone); - m_bpButtonEqual-> Show(result.existsSyncEqual); - m_bpButtonConflict-> Show(result.existsConflict); - - if ( m_bpButtonSyncCreateLeft-> IsShown() || - m_bpButtonSyncCreateRight-> IsShown() || - m_bpButtonSyncDeleteLeft-> IsShown() || - m_bpButtonSyncDeleteRight-> IsShown() || - m_bpButtonSyncDirOverwLeft-> IsShown() || - m_bpButtonSyncDirOverwRight->IsShown() || - m_bpButtonSyncDirNone-> IsShown() || - m_bpButtonEqual-> IsShown() || - m_bpButtonConflict-> IsShown()) - { - m_panelViewFilter->Show(); - m_panelViewFilter->Layout(); - } - else - m_panelViewFilter->Hide(); - - } - else - { - const GridView::StatusCmpResult result = gridDataView->updateCmpResult(currentCfg.hideFilteredElements, - m_bpButtonLeftOnly-> isActive(), - m_bpButtonRightOnly-> isActive(), - m_bpButtonLeftNewer-> isActive(), - m_bpButtonRightNewer->isActive(), - m_bpButtonDifferent-> isActive(), - m_bpButtonEqual-> isActive(), - m_bpButtonConflict-> isActive()); - - filesOnLeftView = result.filesOnLeftView; - foldersOnLeftView = result.foldersOnLeftView; - filesOnRightView = result.filesOnRightView; - foldersOnRightView = result.foldersOnRightView; - filesizeLeftView = result.filesizeLeftView; - filesizeRightView = result.filesizeRightView; - - //comparison result view buttons - m_bpButtonLeftOnly-> Show(result.existsLeftOnly); - m_bpButtonRightOnly-> Show(result.existsRightOnly); - m_bpButtonLeftNewer-> Show(result.existsLeftNewer); - m_bpButtonRightNewer->Show(result.existsRightNewer); - m_bpButtonDifferent-> Show(result.existsDifferent); - m_bpButtonEqual-> Show(result.existsEqual); - m_bpButtonConflict-> Show(result.existsConflict); - - if ( m_bpButtonLeftOnly-> IsShown() || - m_bpButtonRightOnly-> IsShown() || - m_bpButtonLeftNewer-> IsShown() || - m_bpButtonRightNewer->IsShown() || - m_bpButtonDifferent-> IsShown() || - m_bpButtonEqual-> IsShown() || - m_bpButtonConflict-> IsShown()) - { - m_panelViewFilter->Show(); - m_panelViewFilter->Layout(); - } - else - m_panelViewFilter->Hide(); - } - - - bSizer3->Layout(); - - //update status information - clearStatusBar(); - - - wxString statusLeftNew; - wxString statusMiddleNew; - wxString statusRightNew; - -//################################################# -//format numbers to text: - -//show status information on "root" level. - if (foldersOnLeftView) - { - if (foldersOnLeftView == 1) - statusLeftNew += _("1 directory"); - else - { - wxString folderCount = FreeFileSync::numberToStringSep(foldersOnLeftView); - - wxString outputString = _("%x directories"); - outputString.Replace(wxT("%x"), folderCount, false); - statusLeftNew += outputString; - } - - if (filesOnLeftView) - statusLeftNew += wxT(" - "); - } - - if (filesOnLeftView) - { - if (filesOnLeftView == 1) - statusLeftNew += _("1 file"); - else - { - wxString fileCount = FreeFileSync::numberToStringSep(filesOnLeftView); - - wxString outputString = _("%x files"); - outputString.Replace(wxT("%x"), fileCount, false); - statusLeftNew += outputString; - } - statusLeftNew += wxT(" - "); - statusLeftNew += FreeFileSync::formatFilesizeToShortString(filesizeLeftView); - } - - const wxString objectsView = FreeFileSync::numberToStringSep(gridDataView->rowsOnView()); - if (gridDataView->rowsTotal() == 1) - { - wxString outputString = _("%x of 1 row in view"); - outputString.Replace(wxT("%x"), objectsView, false); - statusMiddleNew = outputString; - } - else - { - const wxString objectsTotal = FreeFileSync::numberToStringSep(gridDataView->rowsTotal()); - - wxString outputString = _("%x of %y rows in view"); - outputString.Replace(wxT("%x"), objectsView, false); - outputString.Replace(wxT("%y"), objectsTotal, false); - statusMiddleNew = outputString; - } - - if (foldersOnRightView) - { - if (foldersOnRightView == 1) - statusRightNew += _("1 directory"); - else - { - wxString folderCount = FreeFileSync::numberToStringSep(foldersOnRightView); - - wxString outputString = _("%x directories"); - outputString.Replace(wxT("%x"), folderCount, false); - statusRightNew += outputString; - } - - if (filesOnRightView) - statusRightNew += wxT(" - "); - } - - if (filesOnRightView) - { - if (filesOnRightView == 1) - statusRightNew += _("1 file"); - else - { - wxString fileCount = FreeFileSync::numberToStringSep(filesOnRightView); - - wxString outputString = _("%x files"); - outputString.Replace(wxT("%x"), fileCount, false); - statusRightNew += outputString; - } - - statusRightNew += wxT(" - "); - statusRightNew += 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_panelStatusBar->Layout(); -} - - -void MainDialog::OnAddFolderPair(wxCommandEvent& event) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - std::vector newPairs; - newPairs.push_back(getCurrentConfiguration().mainCfg.firstPair); - - addFolderPair(newPairs, true); //add pair in front of additonal pairs - - //clear first pair - const FolderPairEnh cfgEmpty; - firstFolderPair->setValues(cfgEmpty.leftDirectory, - cfgEmpty.rightDirectory, - cfgEmpty.altSyncConfig, - cfgEmpty.localFilter); - - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - gridDataView->clearAllRows(); - updateSyncConfig(); //mainly to update sync dir description text -} - - -void MainDialog::updateFilterConfig() -{ - applyFiltering(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); - refreshGridAfterFilterChange(400); -} - - -void MainDialog::updateSyncConfig() -{ - //update sync variant name - m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + getCurrentConfiguration().mainCfg.getSyncVariantName() + wxT(")")); - bSizer6->Layout(); //adapt layout for variant text - - - class RedetermineCallback : public DeterminationProblem - { - public: - RedetermineCallback(bool& warningSyncDatabase, wxWindow* parent) : - warningSyncDatabase_(warningSyncDatabase), - parent_(parent) {} - - virtual void reportWarning(const wxString& text) - { - if (warningSyncDatabase_) - { - bool dontWarnAgain = false; - WarningDlg* warningDlg = new WarningDlg(parent_, //show popup and ask user how to handle warning - WarningDlg::BUTTON_IGNORE, - text, - dontWarnAgain); - if (warningDlg->ShowModal() == WarningDlg::BUTTON_IGNORE) - warningSyncDatabase_ = !dontWarnAgain; - } - } - private: - bool& warningSyncDatabase_; - wxWindow* parent_; - } redetCallback(globalSettings->optDialogs.warningSyncDatabase, this); - - FreeFileSync::redetermineSyncDirection(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative(), &redetCallback); - updateGuiGrid(); -} - - -void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) -{ - if (additionalFolderPairs.size() > 0) - { - //get settings from second folder pair - const FolderPairEnh cfgSecond = getEnahncedPair(additionalFolderPairs[0]); - - //reset first pair - firstFolderPair->setValues(cfgSecond.leftDirectory, - cfgSecond.rightDirectory, - cfgSecond.altSyncConfig, - cfgSecond.localFilter); - - removeAddFolderPair(0); //remove second folder pair (first of additional folder pairs) - -//------------------------------------------------------------------ - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - gridDataView->clearAllRows(); - updateSyncConfig(); //mainly to update sync dir description text - } -} - - -void MainDialog::OnRemoveFolderPair(wxCommandEvent& event) -{ - const wxObject* const eventObj = event.GetEventObject(); //find folder pair originating the event - for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) - if (eventObj == (*i)->m_bpButtonRemovePair) - { - removeAddFolderPair(i - additionalFolderPairs.begin()); - -//------------------------------------------------------------------ - //disable the sync button - syncPreview->enableSynchronization(false); - - //clear grids - gridDataView->clearAllRows(); - updateSyncConfig(); //mainly to update sync dir description text - return; - } -} - - -const size_t MAX_ADD_FOLDER_PAIRS = 5; - - -void MainDialog::updateGuiForFolderPair() -{ - //adapt delete top folder pair button - if (additionalFolderPairs.size() == 0) - m_bpButtonRemovePair->Hide(); - else - m_bpButtonRemovePair->Show(); - - m_panelTopRight->Layout(); - - //adapt local filter and sync cfg for first folder pair - if ( additionalFolderPairs.size() == 0 && - firstFolderPair->getAltSyncConfig().get() == NULL && - NameFilter(firstFolderPair->getAltFilterConfig().includeFilter, - firstFolderPair->getAltFilterConfig().excludeFilter).isNull()) - { - m_bpButtonLocalFilter->Hide(); - m_bpButtonAltSyncCfg->Hide(); - - m_bpButtonSwapSides->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("swap"))); - } - else - { - m_bpButtonLocalFilter->Show(); - m_bpButtonAltSyncCfg->Show(); - - m_bpButtonSwapSides->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("swapSlim"))); - } - - m_panelTopMiddle->Layout(); -} - - -void MainDialog::addFolderPair(const std::vector& newPairs, bool addFront) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - if (!newPairs.empty()) - { - int pairHeight = 0; - for (std::vector::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) - { - //add new folder pair - FolderPairPanel* newPair = new FolderPairPanel(m_scrolledWindowFolderPairs, *this); - - //correct width of middle block - newPair->m_panel21->SetMinSize(wxSize(m_gridMiddle->GetSize().GetWidth(), -1)); - - //set width of left folder panel - const int width = m_panelTopLeft->GetSize().GetWidth(); - newPair->m_panelLeft->SetMinSize(wxSize(width, -1)); - - - if (addFront) - { - bSizerAddFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); - additionalFolderPairs.insert(additionalFolderPairs.begin(), newPair); - } - else - { - bSizerAddFolderPairs->Add(newPair, 0, wxEXPAND, 5); - additionalFolderPairs.push_back(newPair); - } - - //get size of scrolled window - pairHeight = newPair->GetSize().GetHeight(); - - //register events - newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolderPair), NULL, this); - - //set alternate configuration - newPair->setValues(i->leftDirectory, - i->rightDirectory, - i->altSyncConfig, - i->localFilter); - } - - //set size of scrolled window - const size_t visiblePairs = std::min(additionalFolderPairs.size(), MAX_ADD_FOLDER_PAIRS); //up to MAX_ADD_FOLDER_PAIRS additional pairs shall be shown - m_scrolledWindowFolderPairs->SetMinSize(wxSize( -1, pairHeight * static_cast(visiblePairs))); - - //update controls - m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size - m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window - bSizer1->Layout(); - } - - updateGuiForFolderPair(); -} - - -void MainDialog::removeAddFolderPair(size_t pos) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - if (pos < additionalFolderPairs.size()) - { - //remove folder pairs from window - FolderPairPanel* pairToDelete = additionalFolderPairs[pos]; - const int pairHeight = pairToDelete->GetSize().GetHeight(); - - bSizerAddFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually - pairToDelete->Destroy(); // - additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove element from vector - - //set size of scrolled window - const size_t additionalRows = additionalFolderPairs.size(); - if (additionalRows <= MAX_ADD_FOLDER_PAIRS) //up to MAX_ADD_FOLDER_PAIRS additional pairs shall be shown - m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, pairHeight * static_cast(additionalRows))); - - //update controls - m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size - m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window - bSizer1->Layout(); - } - - updateGuiForFolderPair(); -} - - -void MainDialog::clearAddFolderPairs() -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - additionalFolderPairs.clear(); - bSizerAddFolderPairs->Clear(true); - - m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, 0)); - bSizer1->Layout(); -} -//######################################################################################################## - - -//menu events -void MainDialog::OnMenuGlobalSettings(wxCommandEvent& event) -{ - FreeFileSync::showGlobalSettingsDlg(*globalSettings); - - //event.Skip(); -} - - -void MainDialog::OnMenuExportFileList(wxCommandEvent& event) -{ - //get a filename - const wxString defaultFileName = wxT("FileList.csv"); //proposal - wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("Comma separated list")) + wxT(" (*.csv)|*.csv"), wxFD_SAVE); - - if (filePicker->ShowModal() == wxID_OK) - { - const wxString newFileName = filePicker->GetPath(); - if (FreeFileSync::fileExists(wxToZ(newFileName))) - { - QuestionDlg* messageDlg = new QuestionDlg(this, - QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, - wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\"")); - - if (messageDlg->ShowModal() != QuestionDlg::BUTTON_YES) - { - OnMenuExportFileList(event); //retry - return; - } - } - - wxString exportString; - //write legend - exportString += wxString(_("Legend")) + wxT('\n'); - if (syncPreview->previewIsEnabled()) - { - exportString += wxString(wxT("\"")) + getDescription(SO_CREATE_NEW_LEFT) + wxT("\";") + getSymbol(SO_CREATE_NEW_LEFT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_CREATE_NEW_RIGHT) + wxT("\";") + getSymbol(SO_CREATE_NEW_RIGHT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_DELETE_LEFT) + wxT("\";") + getSymbol(SO_DELETE_LEFT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_DELETE_RIGHT) + wxT("\";") + getSymbol(SO_DELETE_RIGHT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_OVERWRITE_LEFT) + wxT("\";") + getSymbol(SO_OVERWRITE_LEFT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_OVERWRITE_RIGHT) + wxT("\";") + getSymbol(SO_OVERWRITE_RIGHT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_DO_NOTHING) + wxT("\";") + getSymbol(SO_DO_NOTHING) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_EQUAL) + wxT("\";") + getSymbol(SO_EQUAL) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(SO_UNRESOLVED_CONFLICT) + wxT("\";") + getSymbol(SO_UNRESOLVED_CONFLICT) + wxT('\n'); - } - else - { - exportString += wxString(wxT("\"")) + getDescription(FILE_LEFT_SIDE_ONLY) + wxT("\";") + getSymbol(FILE_LEFT_SIDE_ONLY) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(FILE_RIGHT_SIDE_ONLY) + wxT("\";") + getSymbol(FILE_RIGHT_SIDE_ONLY) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(FILE_LEFT_NEWER) + wxT("\";") + getSymbol(FILE_LEFT_NEWER) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(FILE_RIGHT_NEWER) + wxT("\";") + getSymbol(FILE_RIGHT_NEWER) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(FILE_DIFFERENT) + wxT("\";") + getSymbol(FILE_DIFFERENT) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(FILE_EQUAL) + wxT("\";") + getSymbol(FILE_EQUAL) + wxT('\n'); - exportString += wxString(wxT("\"")) + getDescription(FILE_CONFLICT) + wxT("\";") + getSymbol(FILE_CONFLICT) + wxT('\n'); - } - exportString += '\n'; - - //write header - for (int k = 0; k < m_gridLeft->GetNumberCols(); ++k) - { - exportString += m_gridLeft->GetColLabelValue(k); - exportString += ';'; - } - - for (int k = 0; k < m_gridMiddle->GetNumberCols(); ++k) - { - exportString += m_gridMiddle->GetColLabelValue(k); - exportString += ';'; - } - - for (int k = 0; k < m_gridRight->GetNumberCols(); ++k) - { - exportString += m_gridRight->GetColLabelValue(k); - if (k != m_gridRight->GetNumberCols() - 1) - exportString += ';'; - } - exportString += '\n'; - - //begin work - for (int i = 0; i < m_gridLeft->GetNumberRows(); ++i) - { - for (int k = 0; k < m_gridLeft->GetNumberCols(); ++k) - { - exportString += m_gridLeft->GetCellValue(i, k); - exportString += ';'; - } - - for (int k = 0; k < m_gridMiddle->GetNumberCols(); ++k) - { - exportString += m_gridMiddle->GetCellValue(i, k); - exportString += ';'; - } - - for (int k = 0; k < m_gridRight->GetNumberCols(); ++k) - { - exportString += m_gridRight->GetCellValue(i, k); - if (k != m_gridRight->GetNumberCols() - 1) - exportString+= ';'; - } - exportString+= '\n'; - } - - //write export file - wxFFile output(newFileName.c_str(), wxT("w")); //don't write in binary mode - if (output.IsOpened()) - { - output.Write(exportString); - pushStatusInformation(_("File list exported!")); - } - else - { - wxMessageBox(wxString(_("Error writing file:")) + wxT(" \"") + newFileName + wxT("\""), _("Error"), wxOK | wxICON_ERROR); - } - } -} - - -void MainDialog::OnMenuBatchJob(wxCommandEvent& event) -{ - //fill batch config structure - xmlAccess::XmlGuiConfig currCfg = getCurrentConfiguration(); //get UP TO DATE config, with updated values for main and additional folders! - - xmlAccess::XmlBatchConfig batchCfg; - batchCfg.mainCfg = currCfg.mainCfg; - - if (currentCfg.ignoreErrors) - batchCfg.handleError = xmlAccess::ON_ERROR_IGNORE; - else - batchCfg.handleError = xmlAccess::ON_ERROR_POPUP; - - BatchDialog* batchDlg = new BatchDialog(this, batchCfg); - if (batchDlg->ShowModal() == BatchDialog::BATCH_FILE_SAVED) - pushStatusInformation(_("Batch file created successfully!")); -} - - -void MainDialog::OnMenuCheckVersion(wxCommandEvent& event) -{ - FreeFileSync::checkForUpdateNow(); -} - - -void MainDialog::OnRegularUpdateCheck(wxIdleEvent& event) -{ - //execute just once per startup! - Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), NULL, this); - - FreeFileSync::checkForUpdatePeriodically(globalSettings->gui.lastUpdateCheck); -} - - -void MainDialog::OnLayoutWindowAsync(wxIdleEvent& event) -{ - //execute just once per startup! - Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); - - wxWindowUpdateLocker dummy(this); //avoid display distortion - - //adjust folder pair distortion on startup - m_scrolledWindowFolderPairs->Fit(); - - Layout(); //strangely this layout call works if called in next idle event only - Refresh(); -} - - -void MainDialog::OnMenuAbout(wxCommandEvent& event) -{ - FreeFileSync::showAboutDialog(); -} - - -void MainDialog::OnShowHelp(wxCommandEvent& event) -{ - FreeFileSync::displayHelpEntry(); -} - - -void MainDialog::OnMenuQuit(wxCommandEvent& event) -{ - if (!saveOldConfig()) //notify user about changed settings - return; - - Destroy(); -} - -//######################################################################################################### - -//language selection -void MainDialog::switchProgramLanguage(const int langID) -{ - //create new dialog with respect to new language - CustomLocale::getInstance().setLanguage(langID); //language is a global attribute - - const xmlAccess::XmlGuiConfig currentGuiCfg = getCurrentConfiguration(); - - cleanUp(false); //destructor's code: includes updating global settings - - //create new main window and delete old one - MainDialog* frame = new MainDialog(currentGuiCfg, *globalSettings, false); - frame->Show(); - - Destroy(); -} - - -void MainDialog::OnMenuLanguageSwitch(wxCommandEvent& event) -{ - std::map::const_iterator it = languageMenuItemMap.find(event.GetId()); - - if (it != languageMenuItemMap.end()) - switchProgramLanguage(it->second); -} - -//######################################################################################################### - -MainDialog::SyncPreview::SyncPreview(MainDialog* mainDlg) : - mainDlg_(mainDlg), - syncPreviewEnabled(false), - synchronizationEnabled(false) {} - - -bool MainDialog::SyncPreview::previewIsEnabled() const -{ - return syncPreviewEnabled; -} - - -void MainDialog::SyncPreview::enablePreview(bool value) -{ - if (value) - { - syncPreviewEnabled = true; - - //toggle display of sync preview in middle grid - mainDlg_->m_gridMiddle->enableSyncPreview(true); - - mainDlg_->Refresh(); - } - else - { - syncPreviewEnabled = false; - - //toggle display of sync preview in middle grid - mainDlg_->m_gridMiddle->enableSyncPreview(false); - - mainDlg_->Refresh(); - } - - mainDlg_->updateGuiGrid(); -} - - -void MainDialog::SyncPreview::enableSynchronization(bool value) -{ - if (value) - { - synchronizationEnabled = true; - mainDlg_->m_buttonStartSync->SetForegroundColour(*wxBLACK); - mainDlg_->m_buttonStartSync->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("sync"))); - } - else - { - synchronizationEnabled = false; - mainDlg_->m_buttonStartSync->SetForegroundColour(wxColor(128, 128, 128)); //Some colors seem to have problems with 16Bit color depth, well this one hasn't! - mainDlg_->m_buttonStartSync->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("syncDisabled"))); - } -} - - -bool MainDialog::SyncPreview::synchronizationIsEnabled() const -{ - return synchronizationEnabled; -} diff --git a/ui/MainDialog.h b/ui/MainDialog.h deleted file mode 100644 index 744a95da..00000000 --- a/ui/MainDialog.h +++ /dev/null @@ -1,337 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef MAINDIALOG_H -#define MAINDIALOG_H - -#include "guiGenerated.h" -#include -#include "../library/processXml.h" -#include -#include -#include - -class CompareStatusHandler; -class MainFolderDragDrop; -class CustomGrid; -class FFSCheckRowsEvent; -class FFSSyncDirectionEvent; -class IconUpdater; -class ManualDeletionHandler; -class FolderPairPanel; -class FirstFolderPairCfg; -class CompareStatus; - - -namespace FreeFileSync -{ -class CustomLocale; -class GridView; -class MouseMoveWindow; -} - - -class MainDialog : public MainDialogGenerated -{ -public: - MainDialog(const wxString& cfgFileName, - xmlAccess::XmlGlobalSettings& settings); - - MainDialog(const xmlAccess::XmlGuiConfig& guiCfg, - xmlAccess::XmlGlobalSettings& settings, - bool startComparison); - - ~MainDialog(); - -private: - friend class CompareStatusHandler; - friend class ManualDeletionHandler; - friend class MainFolderDragDrop; - template - friend class FolderPairCallback; - -//IDs for context menu items - enum ContextIDRim //context menu for left and right grids - { - CONTEXT_FILTER_TEMP = 10, - CONTEXT_EXCLUDE_EXT, - CONTEXT_EXCLUDE_OBJ, - CONTEXT_CLIPBOARD, - CONTEXT_EXTERNAL_APP, - CONTEXT_DELETE_FILES, - CONTEXT_SYNC_DIR_LEFT, - CONTEXT_SYNC_DIR_NONE, - CONTEXT_SYNC_DIR_RIGHT - }; - - enum ContextIDRimLabel//context menu for column settings - { - CONTEXT_CUSTOMIZE_COLUMN_LEFT, - CONTEXT_CUSTOMIZE_COLUMN_RIGHT, - CONTEXT_AUTO_ADJUST_COLUMN_LEFT, - CONTEXT_AUTO_ADJUST_COLUMN_RIGHT - }; - - enum ContextIDMiddle//context menu for middle grid - { - CONTEXT_CHECK_ALL = 20, - CONTEXT_UNCHECK_ALL - }; - - enum ContextIDMiddleLabel - { - CONTEXT_COMPARISON_RESULT = 30, - CONTEXT_SYNC_PREVIEW - }; - - MainDialog(); - - void init(const xmlAccess::XmlGuiConfig guiCfg, - xmlAccess::XmlGlobalSettings& settings, - bool startComparison); - - void cleanUp(bool saveLastUsedConfig); - - //configuration load/save - bool readConfigurationFromXml(const wxString& filename); - bool writeConfigurationToXml(const wxString& filename); - void setLastUsedConfig(const wxString& filename, const xmlAccess::XmlGuiConfig& guiConfig); - - xmlAccess::XmlGuiConfig getCurrentConfiguration() const; - void setCurrentConfiguration(const xmlAccess::XmlGuiConfig& newGuiCfg); - - static const wxString& lastConfigFileName(); - - xmlAccess::XmlGuiConfig lastConfigurationSaved; //support for: "Save changed configuration?" dialog - //used when saving configuration - wxString currentConfigFileName; - - void readGlobalSettings(); - void writeGlobalSettings(); - - void initViewFilterButtons(); - void updateFilterButtons(); - - void addFileToCfgHistory(const wxString& filename); - void addLeftFolderToHistory(const wxString& leftFolder); - void addRightFolderToHistory(const wxString& rightFolder); - - void addFolderPair(const std::vector& newPairs, bool addFront = false); - void removeAddFolderPair(size_t pos); - void clearAddFolderPairs(); - - void updateGuiForFolderPair(); //helper method: add usability by showing/hiding buttons related to folder pairs - - //main method for putting gridDataView on UI: updates data respecting current view settings - void updateGuiGrid(); - void updateGridViewData(); - - //context menu functions - std::set getSelectedRows(const CustomGrid* grid) const; - std::set getSelectedRows() const; - void setSyncDirManually(const std::set& rowsToSetOnUiTable, const FreeFileSync::SyncDirection dir); - void filterRangeManually(const std::set& rowsToFilterOnUiTable, int leadingRow); - void copySelectionToClipboard(const CustomGrid* selectedGrid); - void deleteSelectedFiles(); - - void openExternalApplication(size_t rowNumber, bool leftSide, const wxString& commandline); - static const int externalAppIDFirst = 1000; //id of first external app item - - //work to be done in idle time - void OnIdleEvent(wxEvent& event); - - //delayed status information restore - void pushStatusInformation(const wxString& text); - void clearStatusBar(); - - void disableAllElements(); //dis-/enables all elements (except abort button) that might receive user input during long-running processes: comparison, deletion - void enableAllElements(); // - - //events - void onGridLeftButtonEvent( wxKeyEvent& event); - void onGridRightButtonEvent( wxKeyEvent& event); - void onGridMiddleButtonEvent( wxKeyEvent& event); - void OnContextRim( wxGridEvent& event); - void OnContextRimLabelLeft( wxGridEvent& event); - void OnContextRimLabelRight( wxGridEvent& event); - void OnContextMiddle( wxGridEvent& event); - void OnContextMiddleLabel( wxGridEvent& event); - - //context menu handler methods - void OnContextFilterTemp(wxCommandEvent& event); - void OnContextExcludeExtension(wxCommandEvent& event); - void OnContextExcludeObject(wxCommandEvent& event); - void OnContextCopyClipboard(wxCommandEvent& event); - void OnContextOpenWith(wxCommandEvent& event); - void OnContextDeleteFiles(wxCommandEvent& event); - void OnContextSyncDirLeft(wxCommandEvent& event); - void OnContextSyncDirNone(wxCommandEvent& event); - void OnContextSyncDirRight(wxCommandEvent& event); - void OnContextCustColumnLeft(wxCommandEvent& event); - void OnContextCustColumnRight(wxCommandEvent& event); - void OnContextAutoAdjustLeft(wxCommandEvent& event); - void OnContextAutoAdjustRight(wxCommandEvent& event); - void OnContextIncludeAll(wxCommandEvent& event); - void OnContextExcludeAll(wxCommandEvent& event); - void OnContextComparisonView(wxCommandEvent& event); - void OnContextSyncView(wxCommandEvent& event); - - void OnDirSelected(wxFileDirPickerEvent& event); - - void OnCheckRows(FFSCheckRowsEvent& event); - void OnSetSyncDirection(FFSSyncDirectionEvent& event); - - void OnLeftGridDoubleClick( wxGridEvent& event); - void OnRightGridDoubleClick(wxGridEvent& event); - void OnSortLeftGrid( wxGridEvent& event); - void OnSortMiddleGrid( wxGridEvent& event); - void OnSortRightGrid( wxGridEvent& event); - - void OnLeftOnlyFiles( wxCommandEvent& event); - void OnRightOnlyFiles( wxCommandEvent& event); - void OnLeftNewerFiles( wxCommandEvent& event); - void OnRightNewerFiles( wxCommandEvent& event); - void OnEqualFiles( wxCommandEvent& event); - void OnDifferentFiles( wxCommandEvent& event); - void OnConflictFiles( wxCommandEvent& event); - - void OnSyncCreateLeft( wxCommandEvent& event); - void OnSyncCreateRight( wxCommandEvent& event); - void OnSyncDeleteLeft( wxCommandEvent& event); - void OnSyncDeleteRight( wxCommandEvent& event); - void OnSyncDirLeft( wxCommandEvent& event); - void OnSyncDirRight( wxCommandEvent& event); - void OnSyncDirNone( wxCommandEvent& event); - - void OnNewConfig( wxCommandEvent& event); - void OnSaveConfig( wxCommandEvent& event); - void OnLoadConfig( wxCommandEvent& event); - void OnLoadFromHistory( wxCommandEvent& event); - bool trySaveConfig(); //return true if saved successfully - bool saveOldConfig(); //return false on user abort - - void loadConfiguration(const wxString& filename); - void OnCfgHistoryKeyEvent( wxKeyEvent& event); - void OnRegularUpdateCheck( wxIdleEvent& event); - void OnLayoutWindowAsync( wxIdleEvent& event); - - void refreshGridAfterFilterChange(const int delay); - - void OnResize( wxSizeEvent& event); - void OnResizeFolderPairs( wxSizeEvent& event); - void OnHideFilteredButton( wxCommandEvent& event); - void OnConfigureFilter( wxCommandEvent& event); - void OnSwapSides( wxCommandEvent& event); - void OnCompare( wxCommandEvent& event); - void OnSwitchView( wxCommandEvent& event); - void OnSyncSettings( wxCommandEvent& event); - void OnCmpSettings( wxCommandEvent& event); - void OnStartSync( wxCommandEvent& event); - void OnClose( wxCloseEvent& event); - void OnQuit( wxCommandEvent& event); - - void OnGlobalFilterOpenContext(wxCommandEvent& event); - void OnGlobalFilterRemConfirm(wxCommandEvent& event); - - void calculatePreview(); - - void OnAddFolderPair( wxCommandEvent& event); - void OnRemoveFolderPair( wxCommandEvent& event); - void OnRemoveTopFolderPair( wxCommandEvent& event); - - void updateFilterConfig(); - void updateSyncConfig(); - - //menu events - void OnMenuGlobalSettings( wxCommandEvent& event); - void OnMenuExportFileList( wxCommandEvent& event); - void OnMenuBatchJob( wxCommandEvent& event); - void OnMenuCheckVersion( wxCommandEvent& event); - void OnMenuAbout( wxCommandEvent& event); - void OnShowHelp( wxCommandEvent& event); - void OnMenuQuit( wxCommandEvent& event); - void OnMenuLanguageSwitch( wxCommandEvent& event); - - void switchProgramLanguage(const int langID); - - typedef int MenuItemID; - typedef int LanguageID; - std::map languageMenuItemMap; //needed to attach menu item events - -//*********************************************** - //application variables are stored here: - - //global settings used by GUI and batch mode - xmlAccess::XmlGlobalSettings* globalSettings; //always bound - - //UI view of FolderComparison structure - std::auto_ptr gridDataView; - -//------------------------------------- - //functional configuration - xmlAccess::XmlGuiConfig currentCfg; - - //folder pairs: - std::auto_ptr firstFolderPair; //always bound!!! - std::vector additionalFolderPairs; //additional pairs to the first pair - - //gui settings - int widthNotMaximized; - int heightNotMaximized; - int posXNotMaximized; - int posYNotMaximized; -//------------------------------------- - - -//*********************************************** - std::auto_ptr contextMenu; - - //status information - wxLongLong lastStatusChange; - std::stack stackObjects; - - //compare status panel (hidden on start, shown when comparing) - std::auto_ptr compareStatus; //always bound - - bool cleanedUp; - - //save the last used config filename history - std::vector cfgFileNames; - - - //remember last sort executed (for determination of sort order) - int lastSortColumn; - const wxGrid* lastSortGrid; - - //update icons periodically: one updater instance for both left and right grids - std::auto_ptr updateFileIcons; - -#ifdef FFS_WIN - //enable moving window by clicking on sub-windows instead of header line - std::auto_ptr moveWholeWindow; -#endif - - //encapsulation of handling of sync preview - class SyncPreview //encapsulates MainDialog functionality for synchronization preview (friend class) - { - public: - SyncPreview(MainDialog* mainDlg); - - void enablePreview(bool value); - bool previewIsEnabled() const; - - void enableSynchronization(bool value); - bool synchronizationIsEnabled() const; - - private: - MainDialog* mainDlg_; - bool syncPreviewEnabled; //toggle to display configuration preview instead of comparison result - bool synchronizationEnabled; //determines whether synchronization should be allowed - }; - std::auto_ptr syncPreview; //always bound -}; - -#endif // MAINDIALOG_H diff --git a/ui/SmallDialogs.cpp b/ui/SmallDialogs.cpp deleted file mode 100644 index aa858454..00000000 --- a/ui/SmallDialogs.cpp +++ /dev/null @@ -1,1026 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "guiGenerated.h" -#include "smallDialogs.h" -#include "messagePopup.h" -#include "../library/resources.h" -#include "../algorithm.h" -#include "../shared/stringConv.h" -#include "../shared/util.h" -#include "../synchronization.h" -#include "../library/customGrid.h" -#include "../shared/customButton.h" -#include "../shared/localization.h" -#include "../shared/globalFunctions.h" -#include "../shared/buildInfo.h" -#include -#include - -using namespace FreeFileSync; - - -class AboutDlg : public AboutDlgGenerated -{ -public: - AboutDlg(wxWindow* window); - -private: - void OnClose(wxCloseEvent& event); - void OnOK(wxCommandEvent& event); -}; - - -AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) -{ - m_bitmap9->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("website"))); - m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("email"))); - m_bitmap11->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("logo"))); - m_bitmap13->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("gpl"))); - - //create language credits - for (std::vector::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) - { - //flag - wxStaticBitmap* staticBitmapFlag = new wxStaticBitmap(m_scrolledWindowTranslators, wxID_ANY, GlobalResources::getInstance().getImageByName(i->languageFlag), wxDefaultPosition, wxSize(-1,11), 0 ); - fgSizerTranslators->Add(staticBitmapFlag, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - //language name - wxStaticText* staticTextLanguage = new wxStaticText(m_scrolledWindowTranslators, wxID_ANY, i->languageName, wxDefaultPosition, wxDefaultSize, 0 ); - staticTextLanguage->Wrap( -1 ); - fgSizerTranslators->Add(staticTextLanguage, 0, wxALIGN_CENTER_VERTICAL, 5); - - //translator name - wxStaticText* staticTextTranslator = new wxStaticText(m_scrolledWindowTranslators, wxID_ANY, i->translatorName, wxDefaultPosition, wxDefaultSize, 0 ); - staticTextTranslator->Wrap( -1 ); - fgSizerTranslators->Add(staticTextTranslator, 0, wxALIGN_CENTER_VERTICAL, 5); - } - - bSizerTranslators->Fit(m_scrolledWindowTranslators); - - - //build information - wxString build = __TDATE__; -#if wxUSE_UNICODE - build += wxT(" - Unicode"); -#else - build += wxT(" - ANSI"); -#endif //wxUSE_UNICODE - - //compile time info about 32/64-bit build - if (Utility::is64BitBuild) - build += wxT(" x64"); - else - build += wxT(" x86"); - assert_static(Utility::is32BitBuild || Utility::is64BitBuild); - - wxString buildFormatted = _("(Build: %x)"); - buildFormatted.Replace(wxT("%x"), build); - - m_build->SetLabel(buildFormatted); - - m_animationControl1->SetAnimation(*GlobalResources::getInstance().animationMoney); - m_animationControl1->Play(); - - m_buttonOkay->SetFocus(); - Fit(); -} - - -void AboutDlg::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void AboutDlg::OnOK(wxCommandEvent& event) -{ - EndModal(0); -} - - -void FreeFileSync::showAboutDialog() -{ - AboutDlg* aboutDlg = new AboutDlg(NULL); - aboutDlg->ShowModal(); - aboutDlg->Destroy(); -} -//######################################################################################## - - -class HelpDlg : public HelpDlgGenerated -{ -public: - HelpDlg(wxWindow* window); - -private: - void OnClose(wxCloseEvent& event); - void OnOK(wxCommandEvent& event); -}; - - -HelpDlg::HelpDlg(wxWindow* window) : HelpDlgGenerated(window) -{ - m_notebook1->SetFocus(); - - m_bitmap25->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("help"))); - - //populate decision trees: "compare by date" - wxTreeItemId treeRoot = m_treeCtrl1->AddRoot(_("DECISION TREE")); - wxTreeItemId treeBothSides = m_treeCtrl1->AppendItem(treeRoot, _("file exists on both sides")); - wxTreeItemId treeOneSide = m_treeCtrl1->AppendItem(treeRoot, _("on one side only")); - - m_treeCtrl1->AppendItem(treeOneSide, _("- left")); - m_treeCtrl1->AppendItem(treeOneSide, _("- right")); - - m_treeCtrl1->AppendItem(treeBothSides, _("- equal")); - wxTreeItemId treeDifferent = m_treeCtrl1->AppendItem(treeBothSides, _("different")); - - m_treeCtrl1->AppendItem(treeDifferent, _("- left newer")); - m_treeCtrl1->AppendItem(treeDifferent, _("- right newer")); - m_treeCtrl1->AppendItem(treeDifferent, _("- conflict (same date, different size)")); - - m_treeCtrl1->ExpandAll(); - - //populate decision trees: "compare by content" - wxTreeItemId tree2Root = m_treeCtrl2->AddRoot(_("DECISION TREE")); - wxTreeItemId tree2BothSides = m_treeCtrl2->AppendItem(tree2Root, _("file exists on both sides")); - wxTreeItemId tree2OneSide = m_treeCtrl2->AppendItem(tree2Root, _("on one side only")); - - m_treeCtrl2->AppendItem(tree2OneSide, _("- left")); - m_treeCtrl2->AppendItem(tree2OneSide, _("- right")); - - m_treeCtrl2->AppendItem(tree2BothSides, _("- equal")); - m_treeCtrl2->AppendItem(tree2BothSides, _("- different")); - - m_treeCtrl2->ExpandAll(); -} - - -void HelpDlg::OnClose(wxCloseEvent& event) -{ - Destroy(); -} - - -void HelpDlg::OnOK(wxCommandEvent& event) -{ - Destroy(); -} - - -void FreeFileSync::showHelpDialog() -{ - HelpDlg* helpDlg = new HelpDlg(NULL); - helpDlg->ShowModal(); - helpDlg->Destroy(); -} -//######################################################################################## - - -class FilterDlg : public FilterDlgGenerated -{ -public: - FilterDlg(wxWindow* window, - bool isGlobalFilter, - Zstring& filterIncl, - Zstring& filterExcl); - ~FilterDlg() {} - - enum - { - BUTTON_APPLY = 1 - }; - -private: - void OnHelp(wxCommandEvent& event); - void OnDefault(wxCommandEvent& event); - void OnApply(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - - const bool isGlobalFilter_; - Zstring& includeFilter; - Zstring& excludeFilter; -}; - - -FilterDlg::FilterDlg(wxWindow* window, - bool isGlobalFilter, //global or local filter dialog? - Zstring& filterIncl, - Zstring& filterExcl) : - FilterDlgGenerated(window), - isGlobalFilter_(isGlobalFilter), - includeFilter(filterIncl), - excludeFilter(filterExcl) -{ - m_bitmap8->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("include"))); - m_bitmap9->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("exclude"))); - m_bitmap26->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("filterOn"))); - m_bpButtonHelp->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("help"))); - - m_textCtrlInclude->SetValue(zToWx(includeFilter)); - m_textCtrlExclude->SetValue(zToWx(excludeFilter)); - - m_panel13->Hide(); - m_button10->SetFocus(); - - //adapt header for global/local dialog - if (isGlobalFilter_) - m_staticTexHeader->SetLabel(_("Filter: All pairs")); - else - m_staticTexHeader->SetLabel(_("Filter: Single pair")); - - Fit(); -} - - -void FilterDlg::OnHelp(wxCommandEvent& event) -{ - m_bpButtonHelp->Hide(); - m_panel13->Show(); - Fit(); - Refresh(); - - event.Skip(); -} - - -void FilterDlg::OnDefault(wxCommandEvent& event) -{ - const FilterConfig nullFilter; - - if (isGlobalFilter_) - { - m_textCtrlInclude->SetValue(zToWx(nullFilter.includeFilter)); - //exclude various recycle bin directories with global filter - m_textCtrlExclude->SetValue(zToWx(standardExcludeFilter())); - } - else - { - m_textCtrlInclude->SetValue(zToWx(nullFilter.includeFilter)); - m_textCtrlExclude->SetValue(zToWx(nullFilter.excludeFilter)); - } - - //changes to mainDialog are only committed when the OK button is pressed - Fit(); -} - - -void FilterDlg::OnApply(wxCommandEvent& event) -{ - //only if user presses ApplyFilter, he wants the changes to be committed - includeFilter = wxToZ(m_textCtrlInclude->GetValue()); - excludeFilter = wxToZ(m_textCtrlExclude->GetValue()); - - //when leaving dialog: filter and redraw grid, if filter is active - EndModal(BUTTON_APPLY); -} - - -void FilterDlg::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void FilterDlg::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - - -DefaultReturnCode::Response FreeFileSync::showFilterDialog(bool isGlobalFilter, - Zstring& filterIncl, - Zstring& filterExcl) -{ - DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; - FilterDlg* filterDlg = new FilterDlg(NULL, - isGlobalFilter, //is main filter dialog - filterIncl, - filterExcl); - if (filterDlg->ShowModal() == FilterDlg::BUTTON_APPLY) - rv = DefaultReturnCode::BUTTON_OKAY; - - filterDlg->Destroy(); - return rv; -} -//######################################################################################## - - -class DeleteDialog : public DeleteDlgGenerated -{ -public: - DeleteDialog(wxWindow* main, - const std::vector& rowsOnLeft, - const std::vector& rowsOnRight, - bool& deleteOnBothSides, - bool& useRecycleBin, - int& totalDeleteCount); - - enum - { - BUTTON_OKAY = 1, - BUTTON_CANCEL - }; - -private: - void OnOK(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - void OnDelOnBothSides(wxCommandEvent& event); - void OnUseRecycler(wxCommandEvent& event); - - void updateTexts(); - - const std::vector& rowsToDeleteOnLeft; - const std::vector& rowsToDeleteOnRight; - bool& m_deleteOnBothSides; - bool& m_useRecycleBin; - int& totalDelCount; -}; - - -DeleteDialog::DeleteDialog(wxWindow* main, - const std::vector& rowsOnLeft, - const std::vector& rowsOnRight, - bool& deleteOnBothSides, - bool& useRecycleBin, - int& totalDeleteCount) : - DeleteDlgGenerated(main), - rowsToDeleteOnLeft(rowsOnLeft), - rowsToDeleteOnRight(rowsOnRight), - m_deleteOnBothSides(deleteOnBothSides), - m_useRecycleBin(useRecycleBin), - totalDelCount(totalDeleteCount) -{ - m_checkBoxDeleteBothSides->SetValue(deleteOnBothSides); - m_checkBoxUseRecycler->SetValue(useRecycleBin); - updateTexts(); - - m_buttonOK->SetFocus(); -} - - -void DeleteDialog::updateTexts() -{ - if (m_checkBoxUseRecycler->GetValue()) - { - m_staticTextHeader->SetLabel(_("Do you really want to move the following object(s) to the Recycle Bin?")); - m_bitmap12->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("recycler"))); - } - else - { - m_staticTextHeader->SetLabel(_("Do you really want to delete the following object(s)?")); - m_bitmap12->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("deleteFile"))); - } - - const std::pair delInfo = FreeFileSync::deleteFromGridAndHDPreview( - rowsToDeleteOnLeft, - rowsToDeleteOnRight, - m_checkBoxDeleteBothSides->GetValue()); - - const wxString filesToDelete = delInfo.first; - totalDelCount = delInfo.second; - - m_textCtrlMessage->SetValue(filesToDelete); - - Layout(); -} - - -void DeleteDialog::OnOK(wxCommandEvent& event) -{ - EndModal(BUTTON_OKAY); -} - -void DeleteDialog::OnCancel(wxCommandEvent& event) -{ - EndModal(BUTTON_CANCEL); -} - -void DeleteDialog::OnClose(wxCloseEvent& event) -{ - EndModal(BUTTON_CANCEL); -} - -void DeleteDialog::OnDelOnBothSides(wxCommandEvent& event) -{ - m_deleteOnBothSides = m_checkBoxDeleteBothSides->GetValue(); - updateTexts(); -} - -void DeleteDialog::OnUseRecycler(wxCommandEvent& event) -{ - m_useRecycleBin = m_checkBoxUseRecycler->GetValue(); - updateTexts(); -} - - -DefaultReturnCode::Response FreeFileSync::showDeleteDialog(const std::vector& rowsOnLeft, - const std::vector& rowsOnRight, - bool& deleteOnBothSides, - bool& useRecycleBin, - int& totalDeleteCount) -{ - DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; - - DeleteDialog* confirmDeletion = new DeleteDialog(NULL, - rowsOnLeft, - rowsOnRight, - deleteOnBothSides, - useRecycleBin, - totalDeleteCount); - if (confirmDeletion->ShowModal() == DeleteDialog::BUTTON_OKAY) - rv = DefaultReturnCode::BUTTON_OKAY; - - confirmDeletion->Destroy(); - return rv; -} -//######################################################################################## - - -class CustomizeColsDlg : public CustomizeColsDlgGenerated -{ -public: - CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr); - - enum - { - BUTTON_OKAY = 10 - }; - -private: - void OnOkay(wxCommandEvent& event); - void OnDefault(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - - void OnMoveUp(wxCommandEvent& event); - void OnMoveDown(wxCommandEvent& event); - - xmlAccess::ColumnAttributes& output; -}; - - -CustomizeColsDlg::CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr) : - CustomizeColsDlgGenerated(window), - output(attr) -{ - m_bpButton29->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("moveUp"))); - m_bpButton30->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("moveDown"))); - - xmlAccess::ColumnAttributes columnSettings = attr; - - sort(columnSettings.begin(), columnSettings.end(), xmlAccess::sortByPositionOnly); - - for (xmlAccess::ColumnAttributes::const_iterator i = columnSettings.begin(); i != columnSettings.end(); ++i) //love these iterators! - { - m_checkListColumns->Append(CustomGridRim::getTypeName(i->type)); - m_checkListColumns->Check(i - columnSettings.begin(), i->visible); - } - - m_checkListColumns->SetSelection(0); - Fit(); -} - - -void CustomizeColsDlg::OnOkay(wxCommandEvent& event) -{ - for (int i = 0; i < int(m_checkListColumns->GetCount()); ++i) - { - const wxString label = m_checkListColumns->GetString(i); - for (xmlAccess::ColumnAttributes::iterator j = output.begin(); j != output.end(); ++j) - { - if (CustomGridRim::getTypeName(j->type) == label) //not nice but short and no performance issue - { - j->position = i; - j->visible = m_checkListColumns->IsChecked(i);; - break; - } - } - } - - EndModal(BUTTON_OKAY); -} - - -void CustomizeColsDlg::OnDefault(wxCommandEvent& event) -{ - xmlAccess::ColumnAttributes defaultColumnAttr = CustomGridRim::getDefaultColumnAttributes(); - - m_checkListColumns->Clear(); - for (xmlAccess::ColumnAttributes::const_iterator i = defaultColumnAttr.begin(); i != defaultColumnAttr.end(); ++i) - { - m_checkListColumns->Append(CustomGridRim::getTypeName(i->type)); - m_checkListColumns->Check(i - defaultColumnAttr.begin(), i->visible); - } -} - - -void CustomizeColsDlg::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void CustomizeColsDlg::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void CustomizeColsDlg::OnMoveUp(wxCommandEvent& event) -{ - const int pos = m_checkListColumns->GetSelection(); - if (1 <= pos && pos < int(m_checkListColumns->GetCount())) - { - const bool checked = m_checkListColumns->IsChecked(pos); - const wxString label = m_checkListColumns->GetString(pos); - - m_checkListColumns->SetString(pos, m_checkListColumns->GetString(pos - 1)); - m_checkListColumns->Check(pos, m_checkListColumns->IsChecked(pos - 1)); - m_checkListColumns->SetString(pos - 1, label); - m_checkListColumns->Check(pos - 1, checked); - m_checkListColumns->Select(pos - 1); - } -} - - -void CustomizeColsDlg::OnMoveDown(wxCommandEvent& event) -{ - const int pos = m_checkListColumns->GetSelection(); - if (0 <= pos && pos < int(m_checkListColumns->GetCount()) - 1) - { - const bool checked = m_checkListColumns->IsChecked(pos); - const wxString label = m_checkListColumns->GetString(pos); - - m_checkListColumns->SetString(pos, m_checkListColumns->GetString(pos + 1)); - m_checkListColumns->Check(pos, m_checkListColumns->IsChecked(pos + 1)); - m_checkListColumns->SetString(pos + 1, label); - m_checkListColumns->Check(pos + 1, checked); - m_checkListColumns->Select(pos + 1); - } -} - - -DefaultReturnCode::Response FreeFileSync::showCustomizeColsDlg(xmlAccess::ColumnAttributes& attr) -{ - DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; - - CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(NULL, attr); - if (customizeDlg->ShowModal() == CustomizeColsDlg::BUTTON_OKAY) - rv = DefaultReturnCode::BUTTON_OKAY; - customizeDlg->Destroy(); - - return rv; -} -//######################################################################################## - - -class SyncPreviewDlg : public SyncPreviewDlgGenerated -{ -public: - SyncPreviewDlg(wxWindow* parentWindow, - const wxString& variantName, - const FreeFileSync::SyncStatistics& statistics, - bool& dontShowAgain); - enum - { - BUTTON_START = 1, - BUTTON_CANCEL = 2 - }; - -private: - void OnClose(wxCloseEvent& event); - void OnCancel(wxCommandEvent& event); - void OnStartSync(wxCommandEvent& event); - - bool& m_dontShowAgain; -}; - - - -SyncPreviewDlg::SyncPreviewDlg(wxWindow* parentWindow, - const wxString& variantName, - const FreeFileSync::SyncStatistics& statistics, - bool& dontShowAgain) : - SyncPreviewDlgGenerated(parentWindow), - m_dontShowAgain(dontShowAgain) -{ - using FreeFileSync::numberToStringSep; - - m_buttonStartSync->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("startSync"))); - m_bitmapCreate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("create"))); - m_bitmapUpdate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("update"))); - m_bitmapDelete->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("delete"))); - m_bitmapData->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("data"))); - - m_staticTextVariant->SetLabel(variantName); - m_textCtrlData->SetValue(FreeFileSync::formatFilesizeToShortString(statistics.getDataToProcess())); - - m_textCtrlCreateL->SetValue(numberToStringSep(statistics.getCreate( true, false))); - m_textCtrlUpdateL->SetValue(numberToStringSep(statistics.getOverwrite(true, false))); - m_textCtrlDeleteL->SetValue(numberToStringSep(statistics.getDelete( true, false))); - - m_textCtrlCreateR->SetValue(numberToStringSep(statistics.getCreate( false, true))); - m_textCtrlUpdateR->SetValue(numberToStringSep(statistics.getOverwrite(false, true))); - m_textCtrlDeleteR->SetValue(numberToStringSep(statistics.getDelete( false, true))); - - m_checkBoxDontShowAgain->SetValue(dontShowAgain); - - m_buttonStartSync->SetFocus(); - Fit(); -} - - -void SyncPreviewDlg::OnClose(wxCloseEvent& event) -{ - EndModal(BUTTON_CANCEL); -} - - -void SyncPreviewDlg::OnCancel(wxCommandEvent& event) -{ - EndModal(BUTTON_CANCEL); -} - - -void SyncPreviewDlg::OnStartSync(wxCommandEvent& event) -{ - m_dontShowAgain = m_checkBoxDontShowAgain->GetValue(); - EndModal(BUTTON_START); -} - - -DefaultReturnCode::Response FreeFileSync::showSyncPreviewDlg( - const wxString& variantName, - const FreeFileSync::SyncStatistics& statistics, - bool& dontShowAgain) -{ - DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; - - SyncPreviewDlg* preview = new SyncPreviewDlg(NULL, - variantName, - statistics, - dontShowAgain); - - if (preview->ShowModal() == SyncPreviewDlg::BUTTON_START) - rv = DefaultReturnCode::BUTTON_OKAY; - - preview->Destroy(); - - return rv; -} -//######################################################################################## - - -class CompareCfgDialog : public CmpCfgDlgGenerated -{ -public: - CompareCfgDialog(wxWindow* parentWindow, - const wxPoint& position, - FreeFileSync::CompareVariant& cmpVar, - SymLinkHandling& handleSymlinks); - - enum - { - BUTTON_OKAY = 10 - }; - -private: - void OnOkay(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - void OnCancel(wxCommandEvent& event); - void OnTimeSize(wxCommandEvent& event); - void OnContent(wxCommandEvent& event); - void OnShowHelp(wxCommandEvent& event); - - void updateView(); - - FreeFileSync::CompareVariant& cmpVarOut; - SymLinkHandling& handleSymlinksOut; -}; - - -namespace -{ -void setValue(wxChoice& choiceCtrl, FreeFileSync::SymLinkHandling value) -{ - choiceCtrl.Clear(); - choiceCtrl.Append(_("Ignore")); - choiceCtrl.Append(_("Direct")); - choiceCtrl.Append(_("Follow")); - - //default - choiceCtrl.SetSelection(0); - - switch (value) - { - case FreeFileSync::SYMLINK_IGNORE: - choiceCtrl.SetSelection(0); - break; - case FreeFileSync::SYMLINK_USE_DIRECTLY: - choiceCtrl.SetSelection(1); - break; - case FreeFileSync::SYMLINK_FOLLOW_LINK: - choiceCtrl.SetSelection(2); - break; - } -} - - -FreeFileSync::SymLinkHandling getValue(const wxChoice& choiceCtrl) -{ - switch (choiceCtrl.GetSelection()) - { - case 0: - return FreeFileSync::SYMLINK_IGNORE; - case 1: - return FreeFileSync::SYMLINK_USE_DIRECTLY; - case 2: - return FreeFileSync::SYMLINK_FOLLOW_LINK; - default: - assert(false); - return FreeFileSync::SYMLINK_IGNORE; - } -} -} - -CompareCfgDialog::CompareCfgDialog(wxWindow* parentWindow, - const wxPoint& position, - CompareVariant& cmpVar, - SymLinkHandling& handleSymlinks) : - CmpCfgDlgGenerated(parentWindow), - cmpVarOut(cmpVar), - handleSymlinksOut(handleSymlinks) -{ - //move dialog up so that compare-config button and first config-variant are on same level - Move(wxPoint(position.x, std::max(0, position.y - (m_buttonTimeSize->GetScreenPosition() - GetScreenPosition()).y))); - - m_bpButtonHelp->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("help"))); - m_bitmapByTime->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("cmpByTime"))); - m_bitmapByContent->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("cmpByContent"))); - - switch (cmpVar) - { - case CMP_BY_TIME_SIZE: - m_radioBtnSizeDate->SetValue(true); - m_buttonContent->SetFocus(); //set focus on the other button - break; - case CMP_BY_CONTENT: - m_radioBtnContent->SetValue(true); - m_buttonTimeSize->SetFocus(); //set focus on the other button - break; - } - - - setValue(*m_choiceHandleSymlinks, handleSymlinks); - - updateView(); -} - -void CompareCfgDialog::updateView() -{ - Fit(); -} - -void CompareCfgDialog::OnOkay(wxCommandEvent& event) -{ - if (m_radioBtnContent->GetValue()) - cmpVarOut = CMP_BY_CONTENT; - else - cmpVarOut = CMP_BY_TIME_SIZE; - - handleSymlinksOut = getValue(*m_choiceHandleSymlinks);; - - EndModal(BUTTON_OKAY); -} - - -void CompareCfgDialog::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void CompareCfgDialog::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void CompareCfgDialog::OnTimeSize(wxCommandEvent& event) -{ - m_radioBtnSizeDate->SetValue(true); - OnOkay(event); -} - - -void CompareCfgDialog::OnContent(wxCommandEvent& event) -{ - m_radioBtnContent->SetValue(true); - OnOkay(event); -} - - -void CompareCfgDialog::OnShowHelp(wxCommandEvent& event) -{ - HelpDlg* helpDlg = new HelpDlg(this); - helpDlg->ShowModal(); -} - - -DefaultReturnCode::Response FreeFileSync::showCompareCfgDialog( - const wxPoint& position, - CompareVariant& cmpVar, - SymLinkHandling& handleSymlinks) -{ - CompareCfgDialog syncDlg(NULL, position, cmpVar, handleSymlinks); - - return syncDlg.ShowModal() == CompareCfgDialog::BUTTON_OKAY ? - DefaultReturnCode::BUTTON_OKAY : - DefaultReturnCode::BUTTON_CANCEL; -} -//######################################################################################## - - -class GlobalSettingsDlg : public GlobalSettingsDlgGenerated -{ -public: - GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings); - - enum - { - BUTTON_OKAY = 10 - }; - -private: - void OnOkay(wxCommandEvent& event); - void OnResetDialogs(wxCommandEvent& event); - void OnDefault(wxCommandEvent& event); - void OnCancel(wxCommandEvent& event); - void OnClose(wxCloseEvent& event); - void OnAddRow(wxCommandEvent& event); - void OnRemoveRow(wxCommandEvent& event); - - void set(const xmlAccess::ExternalApps& extApp); - xmlAccess::ExternalApps getExtApp(); - - xmlAccess::XmlGlobalSettings& settings; -}; - - -GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings) : - GlobalSettingsDlgGenerated(window), - settings(globalSettings) -{ - m_bitmapSettings->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("settings"))); - m_buttonResetDialogs->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("warningSmall")), 5); - m_bpButtonAddRow->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("addFolderPair"))); - m_bpButtonRemoveRow->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("removeFolderPair"))); - - m_checkBoxIgnoreOneHour->SetValue(globalSettings.ignoreOneHourDiff); - m_checkBoxCopyLocked->SetValue(globalSettings.copyLockedFiles); - -#ifndef FFS_WIN - m_checkBoxCopyLocked->Hide(); -#endif - - set(globalSettings.gui.externelApplications); - - const wxString toolTip = wxString(_("Integrate external applications into context menu. The following macros are available:")) + wxT("\n\n") + - wxT("%name \t") + _("- full file or directory name") + wxT("\n") + - wxT("%dir \t") + _("- directory part only") + wxT("\n") + - wxT("%nameCo \t") + _("- Other side's counterpart to %name") + wxT("\n") + - wxT("%dirCo \t") + _("- Other side's counterpart to %dir"); - - m_gridCustomCommand->GetGridWindow()->SetToolTip(toolTip); - m_gridCustomCommand->GetGridColLabelWindow()->SetToolTip(toolTip); - - m_buttonOkay->SetFocus(); - - Fit(); -} - - -void GlobalSettingsDlg::OnOkay(wxCommandEvent& event) -{ - //write global settings only when okay-button is pressed! - settings.ignoreOneHourDiff = m_checkBoxIgnoreOneHour->GetValue(); - settings.copyLockedFiles = m_checkBoxCopyLocked->GetValue(); - - settings.gui.externelApplications = getExtApp(); - - EndModal(BUTTON_OKAY); -} - - -void GlobalSettingsDlg::OnResetDialogs(wxCommandEvent& event) -{ - QuestionDlg* messageDlg = new QuestionDlg(this, - QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, - _("Re-enable all hidden dialogs?")); - - if (messageDlg->ShowModal() == QuestionDlg::BUTTON_YES) - settings.optDialogs.resetDialogs(); -} - - -void GlobalSettingsDlg::OnDefault(wxCommandEvent& event) -{ - xmlAccess::XmlGlobalSettings defaultCfg; - - m_checkBoxIgnoreOneHour->SetValue(defaultCfg.ignoreOneHourDiff); - m_checkBoxCopyLocked->SetValue(defaultCfg.copyLockedFiles); - set(defaultCfg.gui.externelApplications); -} - - -void GlobalSettingsDlg::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void GlobalSettingsDlg::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void GlobalSettingsDlg::set(const xmlAccess::ExternalApps& extApp) -{ - const int rowCount = m_gridCustomCommand->GetNumberRows(); - if (rowCount > 0) - m_gridCustomCommand->DeleteRows(0, rowCount); - - m_gridCustomCommand->AppendRows(static_cast(extApp.size())); - for (xmlAccess::ExternalApps::const_iterator i = extApp.begin(); i != extApp.end(); ++i) - { - const int row = i - extApp.begin(); - m_gridCustomCommand->SetCellValue(row, 0, i->first); //description - m_gridCustomCommand->SetCellValue(row, 1, i->second); //commandline - } - Fit(); -} - - -xmlAccess::ExternalApps GlobalSettingsDlg::getExtApp() -{ - xmlAccess::ExternalApps output; - for (int i = 0; i < m_gridCustomCommand->GetNumberRows(); ++i) - output.push_back( - std::make_pair(m_gridCustomCommand->GetCellValue(i, 0), //description - m_gridCustomCommand->GetCellValue(i, 1))); //commandline - return output; -} - - -void GlobalSettingsDlg::OnAddRow(wxCommandEvent& event) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - const int selectedRow = m_gridCustomCommand->GetGridCursorRow(); - if (0 <= selectedRow && selectedRow < m_gridCustomCommand->GetNumberRows()) - m_gridCustomCommand->InsertRows(selectedRow); - else - m_gridCustomCommand->AppendRows(); - - Fit(); -} - - -void GlobalSettingsDlg::OnRemoveRow(wxCommandEvent& event) -{ - if (m_gridCustomCommand->GetNumberRows() > 0) - { - wxWindowUpdateLocker dummy(this); //avoid display distortion - - const int selectedRow = m_gridCustomCommand->GetGridCursorRow(); - if (0 <= selectedRow && selectedRow < m_gridCustomCommand->GetNumberRows()) - m_gridCustomCommand->DeleteRows(selectedRow); - else - m_gridCustomCommand->DeleteRows(m_gridCustomCommand->GetNumberRows() - 1); - - Fit(); - } -} - - -DefaultReturnCode::Response FreeFileSync::showGlobalSettingsDlg(xmlAccess::XmlGlobalSettings& globalSettings) -{ - DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; - - wxDialog* settingsDlg = new GlobalSettingsDlg(NULL, globalSettings); - if (settingsDlg->ShowModal() == GlobalSettingsDlg::BUTTON_OKAY) - rv = DefaultReturnCode::BUTTON_OKAY; - - settingsDlg->Destroy(); - - return rv; -} diff --git a/ui/SmallDialogs.h b/ui/SmallDialogs.h deleted file mode 100644 index acc69aa3..00000000 --- a/ui/SmallDialogs.h +++ /dev/null @@ -1,59 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef SMALLDIALOGS_H_INCLUDED -#define SMALLDIALOGS_H_INCLUDED - -#include "../fileHierarchy.h" -#include "../library/processXml.h" - -namespace FreeFileSync -{ -class SyncStatistics; - - -struct DefaultReturnCode -{ - enum Response - { - BUTTON_OKAY, - BUTTON_CANCEL - }; -}; - -void showAboutDialog(); - -void showHelpDialog(); - -DefaultReturnCode::Response showFilterDialog(bool isGlobalFilter, - Zstring& filterIncl, - Zstring& filterExcl); - -DefaultReturnCode::Response showDeleteDialog( - const std::vector& rowsOnLeft, - const std::vector& rowsOnRight, - bool& deleteOnBothSides, - bool& useRecycleBin, - int& totalDeleteCount); - -DefaultReturnCode::Response showCustomizeColsDlg(xmlAccess::ColumnAttributes& attr); - -DefaultReturnCode::Response showSyncPreviewDlg( - const wxString& variantName, - const SyncStatistics& statistics, - bool& dontShowAgain); - -DefaultReturnCode::Response showCompareCfgDialog( - const wxPoint& position, - CompareVariant& cmpVar, - SymLinkHandling& handleSymlinks); - -DefaultReturnCode::Response showGlobalSettingsDlg(xmlAccess::XmlGlobalSettings& globalSettings); -} - -#endif // SMALLDIALOGS_H_INCLUDED - - diff --git a/ui/batchConfig.cpp b/ui/batchConfig.cpp deleted file mode 100644 index ef85561e..00000000 --- a/ui/batchConfig.cpp +++ /dev/null @@ -1,801 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "batchConfig.h" -#include "../shared/xmlBase.h" -#include "folderPair.h" -#include -#include -#include "../shared/helpProvider.h" -#include "../shared/fileHandling.h" -#include "messagePopup.h" -#include -#include - -using namespace FreeFileSync; - - -class BatchFileDropEvent : public wxFileDropTarget -{ -public: - BatchFileDropEvent(BatchDialog& dlg) : - batchDlg(dlg) {} - - virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filenames) - { - if (!filenames.IsEmpty()) - { - const wxString droppedFileName = filenames[0]; - - xmlAccess::XmlType fileType = xmlAccess::getXmlType(droppedFileName); - - //test if ffs batch file has been dropped - if (fileType == xmlAccess::XML_BATCH_CONFIG) - batchDlg.loadBatchFile(droppedFileName); - else - { - wxString errorMessage = _("%x is not a valid FreeFileSync batch file!"); - errorMessage.Replace(wxT("%x"), wxString(wxT("\"")) + droppedFileName + wxT("\""), false); - wxMessageBox(errorMessage, _("Error"), wxOK | wxICON_ERROR); - } - } - return false; - } - -private: - BatchDialog& batchDlg; -}; - -//################################################################################################################################### - -//------------------------------------------------------------------ -/* class hierarchy: - - template<> - FolderPairPanelBasic - /|\ - | - template<> - FolderPairCallback BatchFolderPairGenerated - /|\ /|\ - _________|______________ ________| - | | | - FirstBatchFolderPairCfg BatchFolderPairPanel -*/ - -template -class FolderPairCallback : public FolderPairPanelBasic //implements callback functionality to BatchDialog as imposed by FolderPairPanelBasic -{ -public: - FolderPairCallback(GuiPanel& basicPanel, BatchDialog& batchDialog) : - FolderPairPanelBasic(basicPanel), //pass FolderPairGenerated part... - batchDlg(batchDialog) {} - -private: - virtual wxWindow* getParentWindow() - { - return &batchDlg; - } - - virtual MainConfiguration getMainConfig() const - { - return batchDlg.getCurrentConfiguration().mainCfg; - } - - BatchDialog& batchDlg; -}; - - -class BatchFolderPairPanel : - public BatchFolderPairGenerated, //BatchFolderPairPanel "owns" BatchFolderPairGenerated! - public FolderPairCallback -{ -public: - BatchFolderPairPanel(wxWindow* parent, BatchDialog& batchDialog) : - BatchFolderPairGenerated(parent), - FolderPairCallback(static_cast(*this), batchDialog), //pass BatchFolderPairGenerated part... - dragDropOnLeft( m_panelLeft, m_dirPickerLeft, m_directoryLeft), - dragDropOnRight(m_panelRight, m_dirPickerRight, m_directoryRight) {} - -private: - //support for drag and drop - DragDropOnDlg dragDropOnLeft; - DragDropOnDlg dragDropOnRight; -}; - - -class FirstBatchFolderPairCfg : public FolderPairCallback -{ -public: - FirstBatchFolderPairCfg(BatchDialog& batchDialog) : - FolderPairCallback(batchDialog, batchDialog), - - //prepare drag & drop - dragDropOnLeft(batchDialog.m_panelLeft, - batchDialog.m_dirPickerLeft, - batchDialog.m_directoryLeft), - dragDropOnRight(batchDialog.m_panelRight, - batchDialog.m_dirPickerRight, - batchDialog.m_directoryRight) {} - -private: - //support for drag and drop - DragDropOnDlg dragDropOnLeft; - DragDropOnDlg dragDropOnRight; -}; - - -//################################################################################################################################### -BatchDialog::BatchDialog(wxWindow* window, const xmlAccess::XmlBatchConfig& batchCfg) : - BatchDlgGenerated(window) -{ - init(); - loadBatchCfg(batchCfg); -} - - -BatchDialog::BatchDialog(wxWindow* window, const wxString& filename) : - BatchDlgGenerated(window) -{ - init(); - loadBatchFile(filename); -} - - -BatchDialog::~BatchDialog() {} //non-inline destructor for std::auto_ptr to work with forward declaration - - -void BatchDialog::init() -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - m_bpButtonCmpConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("cmpConfig"))); - m_bpButtonSyncConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfig"))); - - m_bpButtonHelp->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("help"))); - - //init handling of first folder pair - firstFolderPair.reset(new FirstBatchFolderPairCfg(*this)); - - m_bpButtonFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnGlobalFilterOpenContext), NULL, this); - - //prepare drag & drop for loading of *.ffs_batch files - SetDropTarget(new BatchFileDropEvent(*this)); - dragDropOnLogfileDir.reset(new DragDropOnDlg(m_panelLogging, m_dirPickerLogfileDir, m_textCtrlLogfileDir)); - - //set icons for this dialog - m_bpButtonAddPair->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("addFolderPair"))); - m_bitmap27->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("batch"))); - - m_buttonSave->SetFocus(); -} - -//------------------- error handling -------------------------- - -xmlAccess::OnError BatchDialog::getSelectionHandleError() const -{ - switch (m_choiceHandleError->GetSelection()) - { - case 0: - return xmlAccess::ON_ERROR_POPUP; - case 1: - return xmlAccess::ON_ERROR_IGNORE; - case 2: - return xmlAccess::ON_ERROR_EXIT; - default: - assert(false); - return xmlAccess::ON_ERROR_POPUP; - } -} - - -void BatchDialog::updateToolTipErrorHandling(const xmlAccess::OnError value) -{ - switch (value) - { - case xmlAccess::ON_ERROR_POPUP: - m_choiceHandleError->SetToolTip(_("Show popup on errors or warnings")); - break; - case xmlAccess::ON_ERROR_IGNORE: - m_choiceHandleError->SetToolTip(_("Hide all error and warning messages")); - break; - case xmlAccess::ON_ERROR_EXIT: - m_choiceHandleError->SetToolTip(_("Abort synchronization immediately")); - break; - } -} - - -void BatchDialog::setSelectionHandleError(const xmlAccess::OnError value) -{ - m_choiceHandleError->Clear(); - m_choiceHandleError->Append(_("Show popup")); - m_choiceHandleError->Append(_("Ignore errors")); - if (m_checkBoxSilent->GetValue()) //this option shall be available for silent mode only! - m_choiceHandleError->Append(_("Exit instantly")); - - //default - m_choiceHandleError->SetSelection(0); - - switch (value) - { - case xmlAccess::ON_ERROR_POPUP: - m_choiceHandleError->SetSelection(0); - break; - case xmlAccess::ON_ERROR_IGNORE: - m_choiceHandleError->SetSelection(1); - break; - case xmlAccess::ON_ERROR_EXIT: - if (m_checkBoxSilent->GetValue()) //this option shall be available for silent mode only! - m_choiceHandleError->SetSelection(2); - break; - } - - updateToolTipErrorHandling(getSelectionHandleError()); -} - - -void BatchDialog::OnChangeErrorHandling(wxCommandEvent& event) -{ - updateToolTipErrorHandling(getSelectionHandleError()); -} - - -void BatchDialog::OnCmpSettings(wxCommandEvent& event) -{ - - //show window right next to the compare-config button - wxPoint windowPos = m_bpButtonCmpConfig->GetScreenPosition(); - windowPos.x += m_bpButtonCmpConfig->GetSize().GetWidth() + 5; - - if (FreeFileSync::showCompareCfgDialog(windowPos, - localBatchCfg.mainCfg.compareVar, - localBatchCfg.mainCfg.handleSymlinks) == DefaultReturnCode::BUTTON_OKAY) - { - updateGui(); - } -} - - -void BatchDialog::OnSyncSettings(wxCommandEvent& event) -{ - SyncCfgDialog* syncDlg = new SyncCfgDialog(this, - localBatchCfg.mainCfg.compareVar, - localBatchCfg.mainCfg.syncConfiguration, - localBatchCfg.mainCfg.handleDeletion, - localBatchCfg.mainCfg.customDeletionDirectory, - NULL); - if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_APPLY) - { - updateGui(); - } -} - - -void BatchDialog::OnConfigureFilter(wxCommandEvent& event) -{ - if (showFilterDialog(true, //is main filter dialog - localBatchCfg.mainCfg.globalFilter.includeFilter, - localBatchCfg.mainCfg.globalFilter.excludeFilter) == DefaultReturnCode::BUTTON_OKAY) - { - updateGui(); - } -} - - -void BatchDialog::updateGui() //re-evaluate gui after config changes -{ - //update compare variant name - m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(localBatchCfg.mainCfg.compareVar) + wxT(")")); - - //update sync variant name - m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + localBatchCfg.mainCfg.getSyncVariantName() + wxT(")")); - - //set filter icon - if (isNullFilter(localBatchCfg.mainCfg.globalFilter)) - { - m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOff"))); - m_bpButtonFilter->SetToolTip(_("No filter selected")); - } - else - { - m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOn"))); - m_bpButtonFilter->SetToolTip(_("Filter is active")); - } - - m_panelOverview->Layout(); //adjust stuff inside scrolled window -} - - -void BatchDialog::OnGlobalFilterOpenContext(wxCommandEvent& event) -{ - const int menuId = 1234; - contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(menuId, _("Clear filter settings")); - contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(BatchDialog::OnGlobalFilterRemConfirm), NULL, this); - - if (isNullFilter(localBatchCfg.mainCfg.globalFilter)) - contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway - - PopupMenu(contextMenu.get()); //show context menu -} - - -void BatchDialog::OnGlobalFilterRemConfirm(wxCommandEvent& event) -{ - localBatchCfg.mainCfg.globalFilter = FilterConfig(); - updateGui(); -} - - -void BatchDialog::OnCheckSilent(wxCommandEvent& event) -{ - updateVisibleTabs(); - - //reset error handling depending on "m_checkBoxSilent" - setSelectionHandleError(getSelectionHandleError()); -} - - -void BatchDialog::OnHelp(wxCommandEvent& event) -{ -#ifdef FFS_WIN - FreeFileSync::displayHelpEntry(wxT("html\\advanced\\ScheduleBatch.html")); -#elif defined FFS_LINUX - FreeFileSync::displayHelpEntry(wxT("html/advanced/ScheduleBatch.html")); -#endif -} - - -void BatchDialog::updateVisibleTabs() -{ - showNotebookpage(m_panelLogging, _("Logging"), m_checkBoxSilent->GetValue()); -} - - -void BatchDialog::showNotebookpage(wxWindow* page, const wxString& pageName, bool show) -{ - int windowPosition = -1; - for (size_t i = 0; i < m_notebookSettings->GetPageCount(); ++i) - if (m_notebookSettings->GetPage(i) == page) - { - windowPosition = static_cast(i); - break; - } - - if (show) - { - if (windowPosition == -1) - m_notebookSettings->AddPage(page, pageName, false); - } - else - { - if (windowPosition != -1) - { - //do not delete currently selected tab!! - if (m_notebookSettings->GetCurrentPage() == m_notebookSettings->GetPage(windowPosition)) - m_notebookSettings->ChangeSelection(0); - - m_notebookSettings->RemovePage(windowPosition); - } - } -} - - -void BatchDialog::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void BatchDialog::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void BatchDialog::OnSaveBatchJob(wxCommandEvent& event) -{ - //get a filename - const wxString defaultFileName = proposedBatchFileName.empty() ? wxT("SyncJob.ffs_batch") : proposedBatchFileName; - - wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("FreeFileSync batch file")) + wxT(" (*.ffs_batch)|*.ffs_batch"), wxFD_SAVE); - if (filePicker->ShowModal() == wxID_OK) - { - const wxString newFileName = filePicker->GetPath(); - if (FreeFileSync::fileExists(wxToZ(newFileName))) - { - QuestionDlg* messageDlg = new QuestionDlg(this, - QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, - wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\"")); - - if (messageDlg->ShowModal() != QuestionDlg::BUTTON_YES) - { - OnSaveBatchJob(event); //retry - return; - } - } - - //create batch file - if (saveBatchFile(newFileName)) - EndModal(BATCH_FILE_SAVED); - } -} - - -void BatchDialog::OnLoadBatchJob(wxCommandEvent& event) -{ - wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, wxEmptyString, wxString(_("FreeFileSync batch file")) + wxT(" (*.ffs_batch)|*.ffs_batch"), wxFD_OPEN);; - if (filePicker->ShowModal() == wxID_OK) - loadBatchFile(filePicker->GetPath()); -} - - - -inline -FolderPairEnh getEnahncedPair(const BatchFolderPairPanel* panel) -{ - return FolderPairEnh(panel->getLeftDir(), - panel->getRightDir(), - panel->getAltSyncConfig(), - panel->getAltFilterConfig()); -} - - -xmlAccess::XmlBatchConfig BatchDialog::getCurrentConfiguration() const -{ - xmlAccess::XmlBatchConfig batchCfg = localBatchCfg; - - //load parameter with ownership within wxWidgets controls... - - //first folder pair - batchCfg.mainCfg.firstPair = FolderPairEnh(firstFolderPair->getLeftDir(), - firstFolderPair->getRightDir(), - firstFolderPair->getAltSyncConfig(), - firstFolderPair->getAltFilterConfig()); - - //add additional pairs - batchCfg.mainCfg.additionalPairs.clear(); - std::transform(additionalFolderPairs.begin(), additionalFolderPairs.end(), - std::back_inserter(batchCfg.mainCfg.additionalPairs), getEnahncedPair); - - - //load structure with batch settings "batchCfg" - batchCfg.silent = m_checkBoxSilent->GetValue(); - batchCfg.logFileDirectory = m_textCtrlLogfileDir->GetValue(); - batchCfg.handleError = getSelectionHandleError(); - - return batchCfg; -} - - -bool BatchDialog::saveBatchFile(const wxString& filename) -{ - const xmlAccess::XmlBatchConfig batchCfg = getCurrentConfiguration(); - - //write config to XML - try - { - xmlAccess::writeBatchConfig(batchCfg, filename); - } - catch (const xmlAccess::XmlError& error) - { - wxMessageBox(error.show().c_str(), _("Error"), wxOK | wxICON_ERROR); - return false; - } - - SetTitle(wxString(_("Create a batch job")) + wxT(" - ") + filename); - proposedBatchFileName = filename; //may be used on next save - - return true; -} - - -void BatchDialog::loadBatchFile(const wxString& filename) -{ - //load XML settings - xmlAccess::XmlBatchConfig batchCfg; //structure to receive gui settings - try - { - xmlAccess::readBatchConfig(filename, batchCfg); - } - catch (const xmlAccess::XmlError& error) - { - if (error.getSeverity() == xmlAccess::XmlError::WARNING) - wxMessageBox(error.show(), _("Warning"), wxOK | wxICON_WARNING); - else - { - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); - return; - } - } - - SetTitle(wxString(_("Create a batch job")) + wxT(" - ") + filename); - proposedBatchFileName = filename; //may be used on next save - this->loadBatchCfg(batchCfg); -} - - -void BatchDialog::loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - -//make working copy - localBatchCfg = batchCfg; - - m_checkBoxSilent->SetValue(batchCfg.silent); - m_textCtrlLogfileDir->SetValue(batchCfg.logFileDirectory); - //error handling is dependent from m_checkBoxSilent! /|\ \|/ - setSelectionHandleError(batchCfg.handleError); - - //set first folder pair - firstFolderPair->setValues(batchCfg.mainCfg.firstPair.leftDirectory, - batchCfg.mainCfg.firstPair.rightDirectory, - batchCfg.mainCfg.firstPair.altSyncConfig, - batchCfg.mainCfg.firstPair.localFilter); - - //remove existing additional folder pairs - clearAddFolderPairs(); - - //set additional pairs - addFolderPair(batchCfg.mainCfg.additionalPairs); - - updateVisibleTabs(); - - updateGui(); //re-evaluate gui after config changes - - Fit(); //needed - Refresh(); //needed - Centre(); -} - - -void BatchDialog::OnAddFolderPair(wxCommandEvent& event) -{ - wxWindowUpdateLocker dummy(this); //avoid display distortion - - std::vector newPairs; - newPairs.push_back(getCurrentConfiguration().mainCfg.firstPair); - - addFolderPair(newPairs, true); //add pair in front of additonal pairs - - //clear first pair - const FolderPairEnh cfgEmpty; - firstFolderPair->setValues(cfgEmpty.leftDirectory, - cfgEmpty.rightDirectory, - cfgEmpty.altSyncConfig, - cfgEmpty.localFilter); -} - - -void BatchDialog::OnRemoveFolderPair(wxCommandEvent& event) -{ - //find folder pair originating the event - const wxObject* const eventObj = event.GetEventObject(); - for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) - { - if (eventObj == static_cast((*i)->m_bpButtonRemovePair)) - { - removeAddFolderPair(i - additionalFolderPairs.begin()); - return; - } - } -} - - -void BatchDialog::OnRemoveTopFolderPair(wxCommandEvent& event) -{ - if (additionalFolderPairs.size() > 0) - { - //get settings from second folder pair - const FolderPairEnh cfgSecond = getEnahncedPair(additionalFolderPairs[0]); - - //reset first pair - firstFolderPair->setValues(cfgSecond.leftDirectory, - cfgSecond.rightDirectory, - cfgSecond.altSyncConfig, - cfgSecond.localFilter); - - removeAddFolderPair(0); //remove second folder pair (first of additional folder pairs) - } -} - - -const size_t MAX_FOLDER_PAIRS = 3; - - -void BatchDialog::updateGuiForFolderPair() -{ - //adapt delete top folder pair button - if (additionalFolderPairs.size() == 0) - m_bpButtonRemovePair->Hide(); - else - m_bpButtonRemovePair->Show(); - - //adapt local filter and sync cfg for first folder pair - if ( additionalFolderPairs.size() == 0 && - firstFolderPair->getAltSyncConfig().get() == NULL && - NameFilter(firstFolderPair->getAltFilterConfig().includeFilter, - firstFolderPair->getAltFilterConfig().excludeFilter).isNull()) - { - m_bpButtonLocalFilter->Hide(); - m_bpButtonAltSyncCfg->Hide(); - } - else - { - m_bpButtonLocalFilter->Show(); - m_bpButtonAltSyncCfg->Show(); - } - - m_scrolledWindow6->Fit(); //adjust scrolled window size - m_panelOverview->Layout(); //adjust stuff inside scrolled window -} - - -void BatchDialog::addFolderPair(const std::vector& newPairs, bool addFront) -{ - wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion - - if (!newPairs.empty()) - { - //add folder pairs - int pairHeight = 0; - for (std::vector::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) - { - BatchFolderPairPanel* newPair = new BatchFolderPairPanel(m_scrolledWindow6, *this); - - if (addFront) - { - bSizerAddFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); - additionalFolderPairs.insert(additionalFolderPairs.begin(), newPair); - } - else - { - bSizerAddFolderPairs->Add(newPair, 0, wxEXPAND, 5); - additionalFolderPairs.push_back(newPair); - } - - //get size of scrolled window - pairHeight = newPair->GetSize().GetHeight(); - - //register events - newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BatchDialog::OnRemoveFolderPair), NULL, this ); - - //set alternate configuration - newPair->setValues(i->leftDirectory, - i->rightDirectory, - i->altSyncConfig, - i->localFilter); - } - //set size of scrolled window - const size_t visiblePairs = std::min(additionalFolderPairs.size() + 1, MAX_FOLDER_PAIRS); //up to MAX_FOLDER_PAIRS pairs shall be shown - m_scrolledWindow6->SetMinSize(wxSize( -1, pairHeight * static_cast(visiblePairs))); - - //update controls - m_scrolledWindow6->Fit(); //adjust scrolled window size - m_panelOverview->Layout(); //adjust stuff inside scrolled window - Fit(); //adapt dialog size - - //after changing folder pairs window focus is lost: results in scrolled window scrolling to top each time window is shown: we don't want this - m_bpButtonAddPair->SetFocus(); - } - - updateGuiForFolderPair(); -} - - -void BatchDialog::removeAddFolderPair(const int pos) -{ - wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion - - if (0 <= pos && pos < static_cast(additionalFolderPairs.size())) - { - //remove folder pairs from window - BatchFolderPairPanel* pairToDelete = additionalFolderPairs[pos]; - const int pairHeight = pairToDelete->GetSize().GetHeight(); - - bSizerAddFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually - pairToDelete->Destroy(); // - additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove last element in vector - - //set size of scrolled window - const size_t visiblePairs = std::min(additionalFolderPairs.size() + 1, MAX_FOLDER_PAIRS); //up to MAX_FOLDER_PAIRS pairs shall be shown - m_scrolledWindow6->SetMinSize(wxSize(-1, pairHeight * static_cast(visiblePairs))); - - //update controls - m_scrolledWindow6->Fit(); //adjust scrolled window size - m_panelOverview->Layout(); //adjust stuff inside scrolled window - - m_panelOverview->InvalidateBestSize(); //needed for Fit() to work correctly! - Fit(); //adapt dialog size - - //after changing folder pairs window focus is lost: results in scrolled window scrolling to top each time window is shown: we don't want this - m_bpButtonCmpConfig->SetFocus(); - } - - updateGuiForFolderPair(); -} - - -void BatchDialog::clearAddFolderPairs() -{ - wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion - - additionalFolderPairs.clear(); - bSizerAddFolderPairs->Clear(true); - - m_scrolledWindow6->SetMinSize(wxSize(-1, sbSizerMainPair->GetSize().GetHeight())); //respect height of main pair -} - - -/* -#ifdef FFS_WIN -#include //includes "windows.h" -#include -#endif // FFS_WIN - -template -struct CleanUp -{ - CleanUp(T* element) : m_element(element) {} - - ~CleanUp() - { - m_element->Release(); - } - - T* m_element; -}; - - -bool BatchDialog::createBatchFile(const wxString& filename) -{ - //create shell link (instead of batch file) for full Unicode support - HRESULT hResult = E_FAIL; - IShellLink* pShellLink = NULL; - - if (FAILED(CoCreateInstance(CLSID_ShellLink, //class identifier - NULL, //object isn't part of an aggregate - CLSCTX_INPROC_SERVER, //context for running executable code - IID_IShellLink, //interface identifier - (void**)&pShellLink))) //pointer to storage of interface pointer - return false; - CleanUp cleanOnExit(pShellLink); - - wxString freeFileSyncExe = wxStandardPaths::Get().GetExecutablePath(); - if (FAILED(pShellLink->SetPath(freeFileSyncExe.c_str()))) - return false; - - if (FAILED(pShellLink->SetArguments(getCommandlineArguments().c_str()))) - return false; - - if (FAILED(pShellLink->SetIconLocation(freeFileSyncExe.c_str(), 1))) //second icon from executable file is used - return false; - - if (FAILED(pShellLink->SetDescription(_("FreeFileSync Batch Job")))) - return false; - - IPersistFile* pPersistFile = NULL; - if (FAILED(pShellLink->QueryInterface(IID_IPersistFile, (void**)&pPersistFile))) - return false; - CleanUp cleanOnExit2(pPersistFile); - - //pPersistFile->Save accepts unicode input only -#ifdef _UNICODE - hResult = pPersistFile->Save(filename.c_str(), TRUE); -#else - WCHAR wszTemp [MAX_PATH]; - if (MultiByteToWideChar(CP_ACP, 0, filename.c_str(), -1, wszTemp, MAX_PATH) == 0) - return false; - - hResult = pPersistFile->Save(wszTemp, TRUE); -#endif - if (FAILED(hResult)) - return false; - - return true; -} -*/ diff --git a/ui/batchConfig.h b/ui/batchConfig.h deleted file mode 100644 index 5fcf54a3..00000000 --- a/ui/batchConfig.h +++ /dev/null @@ -1,96 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef BATCHCONFIG_H_INCLUDED -#define BATCHCONFIG_H_INCLUDED - -#include "guiGenerated.h" -#include "../library/processXml.h" - - -namespace FreeFileSync -{ -class DragDropOnDlg; -} - -class BatchFolderPairPanel; -class FirstBatchFolderPairCfg; - - -class BatchDialog: public BatchDlgGenerated -{ - friend class BatchFileDropEvent; - template - friend class FolderPairCallback; - -public: - BatchDialog(wxWindow* window, const xmlAccess::XmlBatchConfig& batchCfg); - BatchDialog(wxWindow* window, const wxString& filename); - ~BatchDialog(); - - enum - { - BATCH_FILE_SAVED = 15 - }; - -private: - void init(); - - virtual void OnCmpSettings( wxCommandEvent& event); - virtual void OnSyncSettings( wxCommandEvent& event); - virtual void OnConfigureFilter( wxCommandEvent& event); - - virtual void OnHelp( wxCommandEvent& event); - - void OnGlobalFilterOpenContext(wxCommandEvent& event); - void OnGlobalFilterRemConfirm(wxCommandEvent& event); - virtual void OnCheckSilent( wxCommandEvent& event); - virtual void OnClose( wxCloseEvent& event); - virtual void OnCancel( wxCommandEvent& event); - virtual void OnSaveBatchJob( wxCommandEvent& event); - virtual void OnLoadBatchJob( wxCommandEvent& event); - virtual void OnAddFolderPair( wxCommandEvent& event); - virtual void OnRemoveFolderPair( wxCommandEvent& event); - virtual void OnRemoveTopFolderPair(wxCommandEvent& event); - - void addFolderPair(const std::vector& newPairs, bool addFront = false); - void removeAddFolderPair(const int pos); - void clearAddFolderPairs(); - - void updateGuiForFolderPair(); - - void updateGui(); //re-evaluate gui after config changes - - void updateVisibleTabs(); - void showNotebookpage(wxWindow* page, const wxString& pageName, bool show); - - //error handling - xmlAccess::OnError getSelectionHandleError() const; - void setSelectionHandleError(const xmlAccess::OnError value); - void OnChangeErrorHandling(wxCommandEvent& event); - void updateToolTipErrorHandling(const xmlAccess::OnError value); - - bool saveBatchFile(const wxString& filename); - void loadBatchFile(const wxString& filename); - void loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg); - - xmlAccess::XmlBatchConfig getCurrentConfiguration() const; - - boost::shared_ptr firstFolderPair; //always bound!!! - std::vector additionalFolderPairs; - - //used when saving batch file - wxString proposedBatchFileName; - - xmlAccess::XmlBatchConfig localBatchCfg; - - std::auto_ptr contextMenu; - - //add drag & drop support when selecting logfile directory - std::auto_ptr dragDropOnLogfileDir; -}; - -#endif // BATCHCONFIG_H_INCLUDED diff --git a/ui/batchStatusHandler.cpp b/ui/batchStatusHandler.cpp deleted file mode 100644 index 6914d9f5..00000000 --- a/ui/batchStatusHandler.cpp +++ /dev/null @@ -1,390 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "batchStatusHandler.h" -//#include "smallDialogs.h" -#include "messagePopup.h" -#include -#include -#include "../shared/standardPaths.h" -#include "../shared/fileHandling.h" -#include "../shared/stringConv.h" -#include "../shared/globalFunctions.h" -#include "../shared/appMain.h" -#include "../shared/util.h" - -using namespace FreeFileSync; - - -class LogFile -{ -public: - LogFile(const wxString& logfileDirectory, const wxString& batchFilename) //throw (FileError&) - { - const wxString logfileName = findUniqueLogname(logfileDirectory, batchFilename); - - logFile.Open(logfileName, wxT("w")); - if (!logFile.IsOpened()) - throw FileError(wxString(_("Unable to create logfile!")) + wxT("\"") + logfileName + wxT("\"")); - - //write header - wxString headerLine = wxString(wxT("FreeFileSync - ")) + - _("Batch execution") + wxT(" (") + - _("Date") + wxT(": ") + wxDateTime::Now().FormatDate() + wxT(" ") + //"Date" is used at other places too - _("Time") + wxT(":") + wxT(" ") + wxDateTime::Now().FormatTime() + wxT(")"); - logFile.Write(headerLine + wxChar('\n')); - logFile.Write(wxString().Pad(headerLine.Len(), wxChar('-')) + wxChar('\n') + wxChar('\n')); - - wxString caption = _("Log-messages:"); - logFile.Write(caption + wxChar('\n')); - logFile.Write(wxString().Pad(caption.Len(), wxChar('-')) + wxChar('\n')); - - logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + _("Start") + wxChar('\n') + wxChar('\n')); - - totalTime.Start(); //measure total time - } - - void writeLog(const ErrorLogging& log) - { - //write actual logfile - const ErrorLogging::MessageEntry& messages = log.getFormattedMessages(); - for (ErrorLogging::MessageEntry::const_iterator i = messages.begin(); i != messages.end(); ++i) - logFile.Write(*i + wxChar('\n')); - } - - ~LogFile() - { - //write ending - logFile.Write(wxChar('\n')); - - const long time = totalTime.Time(); //retrieve total time - logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ")); - logFile.Write(wxString(_("Stop")) + wxT(" (") + _("Total time:") + wxT(" ") + (wxTimeSpan::Milliseconds(time)).Format() + wxT(")")); - } - -private: - static wxString extractJobName(const wxString& batchFilename) - { - using namespace globalFunctions; - - const wxString shortName = batchFilename.AfterLast(FILE_NAME_SEPARATOR); //returns the whole string if seperator not found - const wxString jobName = shortName.BeforeLast(wxChar('.')); //returns empty string if seperator not found - return jobName.IsEmpty() ? shortName : jobName; - } - - - static wxString findUniqueLogname(const wxString& logfileDirectory, const wxString& batchFilename) - { - using namespace globalFunctions; - - //create logfile directory - Zstring logfileDir = logfileDirectory.empty() ? - wxToZ(FreeFileSync::getConfigDir() + wxT("Logs")) : - FreeFileSync::getFormattedDirectoryName(wxToZ(logfileDirectory)); - - if (!FreeFileSync::dirExists(logfileDir)) - FreeFileSync::createDirectory(logfileDir); //create recursively if necessary: may throw (FileError&) - - //assemble logfile name - if (!logfileDir.EndsWith(FILE_NAME_SEPARATOR)) - logfileDir += FILE_NAME_SEPARATOR; - - wxString logfileName = zToWx(logfileDir); - - //add prefix - logfileName += extractJobName(batchFilename) + wxT(" "); - - //add timestamp - wxString timeNow = wxDateTime::Now().FormatISOTime(); - timeNow.Replace(wxT(":"), wxT("")); - logfileName += wxDateTime::Now().FormatISODate() + wxChar(' ') + timeNow; - - wxString output = logfileName + wxT(".log"); - - //ensure uniqueness - for (int i = 1; FreeFileSync::somethingExists(wxToZ(output)); ++i) - output = logfileName + wxChar('_') + globalFunctions::numberToString(i) + wxT(".log"); - - return output; - } - - wxFFile logFile; - wxStopWatch totalTime; -}; - - -//############################################################################################################################## -BatchStatusHandler::BatchStatusHandler(bool runSilent, - const wxString& batchFilename, - const wxString* logfileDirectory, - const xmlAccess::OnError handleError, - const SwitchToGui& switchBatchToGui, //functionality to change from batch mode to GUI mode - int& returnVal) : - switchBatchToGui_(switchBatchToGui), - exitWhenFinished(runSilent), //=> exit immediately when finished - switchToGuiRequested(false), - handleError_(handleError), - currentProcess(StatusHandler::PROCESS_NONE), - returnValue(returnVal), - syncStatusFrame(*this, NULL, runSilent) -{ - if (logfileDirectory) - { - try - { - logFile.reset(new LogFile(*logfileDirectory, batchFilename)); - } - catch (FreeFileSync::FileError& error) - { - wxMessageBox(error.show(), _("Error"), wxOK | wxICON_ERROR); - returnValue = -7; - throw FreeFileSync::AbortThisProcess(); - } - } - - assert(runSilent || handleError != xmlAccess::ON_ERROR_EXIT); //shouldn't be selectable from GUI settings -} - - -BatchStatusHandler::~BatchStatusHandler() -{ - const int totalErrors = errorLog.errorsTotal(); //evaluate before finalizing log - - //finalize error log - if (abortIsRequested()) - { - returnValue = -4; - errorLog.logError(_("Synchronization aborted!")); - } - else if (totalErrors) - { - returnValue = -5; - errorLog.logWarning(_("Synchronization completed with errors!")); - } - else - errorLog.logInfo(_("Synchronization completed successfully!")); - - - //print the results list: logfile - if (logFile.get()) - logFile->writeLog(errorLog); - - //decide whether to stay on status screen or exit immediately... - if (switchToGuiRequested) //-> avoid recursive yield() calls, thous switch not before ending batch mode - { - switchBatchToGui_.execute(); //open FreeFileSync GUI - syncStatusFrame.closeWindowDirectly(); //syncStatusFrame is main window => program will quit directly - } - else if (!exitWhenFinished || syncStatusFrame.getAsWindow()->IsShown()) //warning: wxWindow::Show() is called within processHasFinished()! - { - //print the results list: GUI - wxString finalMessage; - if (totalErrors > 0) - { - wxString header(_("Warning: Synchronization failed for %x item(s):")); - header.Replace(wxT("%x"), FreeFileSync::numberToStringSep(totalErrors), false); - finalMessage += header + wxT("\n\n"); - } - - const ErrorLogging::MessageEntry& messages = errorLog.getFormattedMessages(); - for (ErrorLogging::MessageEntry::const_iterator i = messages.begin(); i != messages.end(); ++i) - { - finalMessage += *i; - finalMessage += wxT("\n\n"); - } - - //notify about (logical) application main window => program won't quit, but stay on this dialog - FreeFileSync::AppMainWindow::setMainWindow(syncStatusFrame.getAsWindow()); - - //notify to syncStatusFrame that current process has ended - if (abortIsRequested()) - syncStatusFrame.processHasFinished(SyncStatus::ABORTED, finalMessage); //enable okay and close events - else if (totalErrors) - syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_ERROR, finalMessage); - else - syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_SUCCESS, finalMessage); - } - else - syncStatusFrame.closeWindowDirectly(); //syncStatusFrame is main window => program will quit directly -} - - -inline -void BatchStatusHandler::updateStatusText(const Zstring& text) -{ - if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING && logFile.get()) //write file transfer information to log - errorLog.logInfo(zToWx(text)); - - syncStatusFrame.setStatusText_NoUpdate(text); -} - - -void BatchStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, StatusHandler::Process processID) -{ - currentProcess = processID; - - switch (currentProcess) - { - case StatusHandler::PROCESS_SCANNING: - syncStatusFrame.resetGauge(0, 0); //initialize some gui elements (remaining time, speed) - syncStatusFrame.setCurrentStatus(SyncStatus::SCANNING); - break; - case StatusHandler::PROCESS_COMPARING_CONTENT: - syncStatusFrame.resetGauge(objectsTotal, dataTotal); - syncStatusFrame.setCurrentStatus(SyncStatus::COMPARING_CONTENT); - break; - case StatusHandler::PROCESS_SYNCHRONIZING: - syncStatusFrame.resetGauge(objectsTotal, dataTotal); - syncStatusFrame.setCurrentStatus(SyncStatus::SYNCHRONIZING); - break; - case StatusHandler::PROCESS_NONE: - assert(false); - break; - } -} - - -inline -void BatchStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) -{ - switch (currentProcess) - { - case StatusHandler::PROCESS_SCANNING: - syncStatusFrame.incScannedObjects_NoUpdate(objectsProcessed); - break; - case StatusHandler::PROCESS_COMPARING_CONTENT: - case StatusHandler::PROCESS_SYNCHRONIZING: - syncStatusFrame.incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); - break; - case StatusHandler::PROCESS_NONE: - assert(false); - break; - } -} - - -void BatchStatusHandler::reportInfo(const wxString& infoMessage) -{ - errorLog.logInfo(infoMessage); -} - - -void BatchStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) -{ - errorLog.logWarning(warningMessage); - - if (!warningActive) - return; - - switch (handleError_) - { - case xmlAccess::ON_ERROR_POPUP: - { - //show popup and ask user how to handle warning - bool dontWarnAgain = false; - WarningDlg warningDlg(NULL, - WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_SWITCH | WarningDlg::BUTTON_ABORT, - warningMessage + wxT("\n\n") + _("Press \"Switch\" to open FreeFileSync GUI modus."), - dontWarnAgain); - warningDlg.Raise(); - const WarningDlg::Response rv = static_cast(warningDlg.ShowModal()); - switch (rv) - { - case WarningDlg::BUTTON_ABORT: - abortThisProcess(); - break; - - case WarningDlg::BUTTON_SWITCH: - errorLog.logWarning(_("Switching to FreeFileSync GUI modus...")); - switchToGuiRequested = true; - abortThisProcess(); - break; - - case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! - warningActive = !dontWarnAgain; - break; - } - } - break; //keep it! last switch might not find match - - case xmlAccess::ON_ERROR_EXIT: //abort - abortThisProcess(); - break; - - case xmlAccess::ON_ERROR_IGNORE: //no unhandled error situation! - break; - } -} - - -ErrorHandler::Response BatchStatusHandler::reportError(const wxString& errorMessage) -{ - switch (handleError_) - { - case xmlAccess::ON_ERROR_POPUP: - { - bool ignoreNextErrors = false; - ErrorDlg errorDlg(NULL, - ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - errorMessage, - ignoreNextErrors); - errorDlg.Raise(); - const ErrorDlg::ReturnCodes rv = static_cast(errorDlg.ShowModal()); - switch (rv) - { - case ErrorDlg::BUTTON_IGNORE: - if (ignoreNextErrors) //falsify only - handleError_ = xmlAccess::ON_ERROR_IGNORE; - errorLog.logError(errorMessage); - return ErrorHandler::IGNORE_ERROR; - - case ErrorDlg::BUTTON_RETRY: - return ErrorHandler::RETRY; - - case ErrorDlg::BUTTON_ABORT: - errorLog.logError(errorMessage); - abortThisProcess(); - } - } - break; //used if last switch didn't find a match - - case xmlAccess::ON_ERROR_EXIT: //abort - errorLog.logError(errorMessage); - abortThisProcess(); - - case xmlAccess::ON_ERROR_IGNORE: - errorLog.logError(errorMessage); - return ErrorHandler::IGNORE_ERROR; - } - - assert(false); - return ErrorHandler::IGNORE_ERROR; //dummy value - -} - - -void BatchStatusHandler::reportFatalError(const wxString& errorMessage) -{ - if (handleError_ == xmlAccess::ON_ERROR_POPUP) - exitWhenFinished = false; //log fatal error and show it on status dialog - - errorLog.logFatalError(errorMessage); - abortThisProcess(); -} - - -inline -void BatchStatusHandler::forceUiRefresh() -{ - syncStatusFrame.updateStatusDialogNow(); -} - - -void BatchStatusHandler::abortThisProcess() -{ - requestAbortion(); - throw FreeFileSync::AbortThisProcess(); //abort can be triggered by syncStatusFrame -} diff --git a/ui/batchStatusHandler.h b/ui/batchStatusHandler.h deleted file mode 100644 index fb37c62a..00000000 --- a/ui/batchStatusHandler.h +++ /dev/null @@ -1,57 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef BATCHSTATUSHANDLER_H_INCLUDED -#define BATCHSTATUSHANDLER_H_INCLUDED - -#include "../library/statusHandler.h" -#include "../library/processXml.h" -#include "../library/errorLogging.h" -#include "progressIndicator.h" -#include "switchToGui.h" - -class LogFile; -class SyncStatus; - - -class BatchStatusHandler : public StatusHandler -{ -public: - BatchStatusHandler(bool runSilent, //defines: -start minimized and -quit immediately when finished - const wxString& batchFilename, - const wxString* logfileDirectory, //optional: enable logging if available - const xmlAccess::OnError handleError, - const FreeFileSync::SwitchToGui& switchBatchToGui, //functionality to change from batch mode to GUI mode - int& returnVal); - ~BatchStatusHandler(); - - virtual void updateStatusText(const Zstring& text); - virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); - virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); - virtual void forceUiRefresh(); - - void reportInfo(const wxString& infoMessage); - virtual void reportWarning(const wxString& warningMessage, bool& warningActive); - virtual ErrorHandler::Response reportError(const wxString& errorMessage); - virtual void reportFatalError(const wxString& errorMessage); - -private: - virtual void abortThisProcess(); - - const FreeFileSync::SwitchToGui& switchBatchToGui_; //functionality to change from batch mode to GUI mode - bool exitWhenFinished; - bool switchToGuiRequested; - xmlAccess::OnError handleError_; - FreeFileSync::ErrorLogging errorLog; //list of non-resolved errors and warnings - Process currentProcess; - int& returnValue; - - SyncStatus syncStatusFrame; //the window managed by SyncStatus has longer lifetime than this handler! - boost::shared_ptr logFile; //optional! -}; - - -#endif // BATCHSTATUSHANDLER_H_INCLUDED diff --git a/ui/batch_config.cpp b/ui/batch_config.cpp new file mode 100644 index 00000000..21a2f2cd --- /dev/null +++ b/ui/batch_config.cpp @@ -0,0 +1,840 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "batch_config.h" +#include "../shared/xml_base.h" +#include "folder_pair.h" +#include +#include +#include "../shared/help_provider.h" +#include "../shared/file_handling.h" +#include "msg_popup.h" +#include +#include + +using namespace ffs3; + + +class BatchFileDropEvent : public wxFileDropTarget +{ +public: + BatchFileDropEvent(BatchDialog& dlg) : + batchDlg(dlg) {} + + virtual bool OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& fileArray) + { + if (fileArray.IsEmpty()) + return false; + + std::vector filenames; + for (size_t i = 0; i < fileArray.GetCount(); ++i) + filenames.push_back(fileArray[i]); + + + switch (xmlAccess::getMergeType(filenames)) //throw () + { + case xmlAccess::MERGE_BATCH: + case xmlAccess::MERGE_GUI: + case xmlAccess::MERGE_GUI_BATCH: + if (filenames.size() == 1) + { + batchDlg.loadBatchFile(filenames[0]); + return false; + } + else + { + xmlAccess::XmlBatchConfig batchCfg; + try + { + convertConfig(filenames, batchCfg); //throw (xmlAccess::XmlError) + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.msg(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); + return false; + } + } + batchDlg.loadBatchCfg(batchCfg); + } + break; + + case xmlAccess::MERGE_OTHER: + wxMessageBox(_("Invalid FreeFileSync config file!"), _("Error"), wxOK | wxICON_ERROR); + break; + } + + return false; + } + +private: + BatchDialog& batchDlg; +}; + +//################################################################################################################################### + +//------------------------------------------------------------------ +/* class hierarchy: + + template<> + FolderPairPanelBasic + /|\ + | + template<> + FolderPairCallback BatchFolderPairGenerated + /|\ /|\ + _________|______________ ________| + | | | + FirstBatchFolderPairCfg BatchFolderPairPanel +*/ + +template +class FolderPairCallback : public FolderPairPanelBasic //implements callback functionality to BatchDialog as imposed by FolderPairPanelBasic +{ +public: + FolderPairCallback(GuiPanel& basicPanel, BatchDialog& batchDialog) : + FolderPairPanelBasic(basicPanel), //pass FolderPairGenerated part... + batchDlg(batchDialog) {} + +private: + virtual wxWindow* getParentWindow() + { + return &batchDlg; + } + + virtual MainConfiguration getMainConfig() const + { + return batchDlg.getCurrentConfiguration().mainCfg; + } + + BatchDialog& batchDlg; +}; + + +class BatchFolderPairPanel : + public BatchFolderPairGenerated, //BatchFolderPairPanel "owns" BatchFolderPairGenerated! + public FolderPairCallback +{ +public: + BatchFolderPairPanel(wxWindow* parent, BatchDialog& batchDialog) : + BatchFolderPairGenerated(parent), + FolderPairCallback(static_cast(*this), batchDialog), //pass BatchFolderPairGenerated part... + dragDropOnLeft( m_panelLeft, m_dirPickerLeft, m_directoryLeft), + dragDropOnRight(m_panelRight, m_dirPickerRight, m_directoryRight) {} + +private: + //support for drag and drop + DragDropOnDlg dragDropOnLeft; + DragDropOnDlg dragDropOnRight; +}; + + +class FirstBatchFolderPairCfg : public FolderPairCallback +{ +public: + FirstBatchFolderPairCfg(BatchDialog& batchDialog) : + FolderPairCallback(batchDialog, batchDialog), + + //prepare drag & drop + dragDropOnLeft(batchDialog.m_panelLeft, + batchDialog.m_dirPickerLeft, + batchDialog.m_directoryLeft), + dragDropOnRight(batchDialog.m_panelRight, + batchDialog.m_dirPickerRight, + batchDialog.m_directoryRight) {} + +private: + //support for drag and drop + DragDropOnDlg dragDropOnLeft; + DragDropOnDlg dragDropOnRight; +}; + + +//################################################################################################################################### +BatchDialog::BatchDialog(wxWindow* window, const xmlAccess::XmlBatchConfig& batchCfg) : + BatchDlgGenerated(window) +{ + init(); + loadBatchCfg(batchCfg); +} + + +BatchDialog::BatchDialog(wxWindow* window, const wxString& filename) : + BatchDlgGenerated(window) +{ + init(); + loadBatchFile(filename); +} + + +BatchDialog::~BatchDialog() {} //non-inline destructor for std::auto_ptr to work with forward declaration + + +void BatchDialog::init() +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + m_bpButtonCmpConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("cmpConfig"))); + m_bpButtonSyncConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfig"))); + + m_bpButtonHelp->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("help"))); + + //init handling of first folder pair + firstFolderPair.reset(new FirstBatchFolderPairCfg(*this)); + + m_bpButtonFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(BatchDialog::OnGlobalFilterOpenContext), NULL, this); + + //prepare drag & drop for loading of *.ffs_batch files + SetDropTarget(new BatchFileDropEvent(*this)); + dragDropOnLogfileDir.reset(new DragDropOnDlg(m_panelLogging, m_dirPickerLogfileDir, m_textCtrlLogfileDir)); + + //set icons for this dialog + m_bpButtonAddPair->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("addFolderPair"))); + m_bitmap27->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("batch"))); + + m_buttonSave->SetFocus(); +} + +//------------------- error handling -------------------------- + +xmlAccess::OnError BatchDialog::getSelectionHandleError() const +{ + switch (m_choiceHandleError->GetSelection()) + { + case 0: + return xmlAccess::ON_ERROR_POPUP; + case 1: + return xmlAccess::ON_ERROR_IGNORE; + case 2: + return xmlAccess::ON_ERROR_EXIT; + default: + assert(false); + return xmlAccess::ON_ERROR_POPUP; + } +} + + +void BatchDialog::updateToolTipErrorHandling(const xmlAccess::OnError value) +{ + switch (value) + { + case xmlAccess::ON_ERROR_POPUP: + m_choiceHandleError->SetToolTip(_("Show popup on errors or warnings")); + break; + case xmlAccess::ON_ERROR_IGNORE: + m_choiceHandleError->SetToolTip(_("Hide all error and warning messages")); + break; + case xmlAccess::ON_ERROR_EXIT: + m_choiceHandleError->SetToolTip(_("Abort synchronization immediately")); + break; + } +} + + +void BatchDialog::setSelectionHandleError(const xmlAccess::OnError value) +{ + m_choiceHandleError->Clear(); + m_choiceHandleError->Append(_("Show popup")); + m_choiceHandleError->Append(_("Ignore errors")); + if (m_checkBoxSilent->GetValue()) //this option shall be available for silent mode only! + m_choiceHandleError->Append(_("Exit instantly")); + + //default + m_choiceHandleError->SetSelection(0); + + switch (value) + { + case xmlAccess::ON_ERROR_POPUP: + m_choiceHandleError->SetSelection(0); + break; + case xmlAccess::ON_ERROR_IGNORE: + m_choiceHandleError->SetSelection(1); + break; + case xmlAccess::ON_ERROR_EXIT: + if (m_checkBoxSilent->GetValue()) //this option shall be available for silent mode only! + m_choiceHandleError->SetSelection(2); + break; + } + + updateToolTipErrorHandling(getSelectionHandleError()); +} + + +void BatchDialog::OnChangeErrorHandling(wxCommandEvent& event) +{ + updateToolTipErrorHandling(getSelectionHandleError()); +} + + +void BatchDialog::OnCmpSettings(wxCommandEvent& event) +{ + + //show window right next to the compare-config button + wxPoint windowPos = m_bpButtonCmpConfig->GetScreenPosition(); + windowPos.x += m_bpButtonCmpConfig->GetSize().GetWidth() + 5; + + if (ffs3::showCompareCfgDialog(windowPos, + localBatchCfg.mainCfg.compareVar, + localBatchCfg.mainCfg.handleSymlinks) == DefaultReturnCode::BUTTON_OKAY) + { + updateGui(); + } +} + + +void BatchDialog::OnSyncSettings(wxCommandEvent& event) +{ + SyncCfgDialog* syncDlg = new SyncCfgDialog(this, + localBatchCfg.mainCfg.compareVar, + localBatchCfg.mainCfg.syncConfiguration, + localBatchCfg.mainCfg.handleDeletion, + localBatchCfg.mainCfg.customDeletionDirectory, + NULL); + if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_APPLY) + { + updateGui(); + } +} + + +void BatchDialog::OnConfigureFilter(wxCommandEvent& event) +{ + if (showFilterDialog(true, //is main filter dialog + localBatchCfg.mainCfg.globalFilter.includeFilter, + localBatchCfg.mainCfg.globalFilter.excludeFilter) == DefaultReturnCode::BUTTON_OKAY) + { + updateGui(); + } +} + + +void BatchDialog::updateGui() //re-evaluate gui after config changes +{ + //update compare variant name + m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(localBatchCfg.mainCfg.compareVar) + wxT(")")); + + //update sync variant name + m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + localBatchCfg.mainCfg.getSyncVariantName() + wxT(")")); + + //set filter icon + if (isNullFilter(localBatchCfg.mainCfg.globalFilter)) + { + m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOff"))); + m_bpButtonFilter->SetToolTip(_("No filter selected")); + } + else + { + m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOn"))); + m_bpButtonFilter->SetToolTip(_("Filter is active")); + } + + m_panelOverview->Layout(); //adjust stuff inside scrolled window +} + + +void BatchDialog::OnGlobalFilterOpenContext(wxCommandEvent& event) +{ + const int menuId = 1234; + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(menuId, _("Clear filter settings")); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(BatchDialog::OnGlobalFilterRemConfirm), NULL, this); + + if (isNullFilter(localBatchCfg.mainCfg.globalFilter)) + contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway + + PopupMenu(contextMenu.get()); //show context menu +} + + +void BatchDialog::OnGlobalFilterRemConfirm(wxCommandEvent& event) +{ + localBatchCfg.mainCfg.globalFilter = FilterConfig(); + updateGui(); +} + + +void BatchDialog::OnCheckSilent(wxCommandEvent& event) +{ + updateVisibleTabs(); + + //reset error handling depending on "m_checkBoxSilent" + setSelectionHandleError(getSelectionHandleError()); +} + + +void BatchDialog::OnHelp(wxCommandEvent& event) +{ +#ifdef FFS_WIN + ffs3::displayHelpEntry(wxT("html\\advanced\\ScheduleBatch.html")); +#elif defined FFS_LINUX + ffs3::displayHelpEntry(wxT("html/advanced/ScheduleBatch.html")); +#endif +} + + +void BatchDialog::updateVisibleTabs() +{ + showNotebookpage(m_panelLogging, _("Logging"), m_checkBoxSilent->GetValue()); +} + + +void BatchDialog::showNotebookpage(wxWindow* page, const wxString& pageName, bool show) +{ + int windowPosition = -1; + for (size_t i = 0; i < m_notebookSettings->GetPageCount(); ++i) + if (m_notebookSettings->GetPage(i) == page) + { + windowPosition = static_cast(i); + break; + } + + if (show) + { + if (windowPosition == -1) + m_notebookSettings->AddPage(page, pageName, false); + } + else + { + if (windowPosition != -1) + { + //do not delete currently selected tab!! + if (m_notebookSettings->GetCurrentPage() == m_notebookSettings->GetPage(windowPosition)) + m_notebookSettings->ChangeSelection(0); + + m_notebookSettings->RemovePage(windowPosition); + } + } +} + + +void BatchDialog::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void BatchDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void BatchDialog::OnSaveBatchJob(wxCommandEvent& event) +{ + //get a filename + wxString defaultFileName = proposedBatchFileName.empty() ? wxT("SyncJob.ffs_batch") : proposedBatchFileName; + + //attention: proposedBatchFileName may be an imported *.ffs_gui file! We don't want to overwrite it with a BATCH config! + if (defaultFileName.EndsWith(wxT(".ffs_gui"))) + defaultFileName.Replace(wxT(".ffs_gui"), wxT(".ffs_batch"), false); + + + wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("FreeFileSync batch file")) + wxT(" (*.ffs_batch)|*.ffs_batch"), wxFD_SAVE); + if (filePicker->ShowModal() == wxID_OK) + { + const wxString newFileName = filePicker->GetPath(); + if (ffs3::fileExists(wxToZ(newFileName))) + { + QuestionDlg* messageDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, + wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\"")); + + if (messageDlg->ShowModal() != QuestionDlg::BUTTON_YES) + { + OnSaveBatchJob(event); //retry + return; + } + } + + //create batch file + if (saveBatchFile(newFileName)) + EndModal(BATCH_FILE_SAVED); + } +} + + +void BatchDialog::OnLoadBatchJob(wxCommandEvent& event) +{ + wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, wxEmptyString, wxString(_("FreeFileSync configuration")) + wxT(" (*.ffs_batch;*.ffs_gui)|*.ffs_batch;*.ffs_gui"), wxFD_OPEN);; + if (filePicker->ShowModal() == wxID_OK) + loadBatchFile(filePicker->GetPath()); +} + + + +inline +FolderPairEnh getEnahncedPair(const BatchFolderPairPanel* panel) +{ + return FolderPairEnh(panel->getLeftDir(), + panel->getRightDir(), + panel->getAltSyncConfig(), + panel->getAltFilterConfig()); +} + + +xmlAccess::XmlBatchConfig BatchDialog::getCurrentConfiguration() const +{ + xmlAccess::XmlBatchConfig batchCfg = localBatchCfg; + + //load parameter with ownership within wxWidgets controls... + + //first folder pair + batchCfg.mainCfg.firstPair = FolderPairEnh(firstFolderPair->getLeftDir(), + firstFolderPair->getRightDir(), + firstFolderPair->getAltSyncConfig(), + firstFolderPair->getAltFilterConfig()); + + //add additional pairs + batchCfg.mainCfg.additionalPairs.clear(); + std::transform(additionalFolderPairs.begin(), additionalFolderPairs.end(), + std::back_inserter(batchCfg.mainCfg.additionalPairs), getEnahncedPair); + + + //load structure with batch settings "batchCfg" + batchCfg.silent = m_checkBoxSilent->GetValue(); + batchCfg.logFileDirectory = m_textCtrlLogfileDir->GetValue(); + batchCfg.handleError = getSelectionHandleError(); + + return batchCfg; +} + + +bool BatchDialog::saveBatchFile(const wxString& filename) +{ + const xmlAccess::XmlBatchConfig batchCfg = getCurrentConfiguration(); + + //write config to XML + try + { + xmlAccess::writeConfig(batchCfg, filename); + } + catch (const xmlAccess::XmlError& error) + { + wxMessageBox(error.msg().c_str(), _("Error"), wxOK | wxICON_ERROR); + return false; + } + + SetTitle(wxString(_("Create a batch job")) + wxT(" - ") + filename); + proposedBatchFileName = filename; //may be used on next save + + return true; +} + + +void BatchDialog::loadBatchFile(const wxString& filename) +{ + //load XML settings + xmlAccess::XmlBatchConfig batchCfg; //structure to receive gui settings + try + { + //open a *.ffs_gui or *.ffs_batch file! + std::vector filenames; + filenames.push_back(filename); + + xmlAccess::convertConfig(filenames, batchCfg); //throw (xmlAccess::XmlError) + + //xmlAccess::readConfig(filename, batchCfg); + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.msg(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); + return; + } + } + + SetTitle(wxString(_("Create a batch job")) + wxT(" - ") + filename); + proposedBatchFileName = filename; //may be used on next save + this->loadBatchCfg(batchCfg); +} + + +void BatchDialog::loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + +//make working copy + localBatchCfg = batchCfg; + + m_checkBoxSilent->SetValue(batchCfg.silent); + m_textCtrlLogfileDir->SetValue(batchCfg.logFileDirectory); + //error handling is dependent from m_checkBoxSilent! /|\ \|/ + setSelectionHandleError(batchCfg.handleError); + + //set first folder pair + firstFolderPair->setValues(batchCfg.mainCfg.firstPair.leftDirectory, + batchCfg.mainCfg.firstPair.rightDirectory, + batchCfg.mainCfg.firstPair.altSyncConfig, + batchCfg.mainCfg.firstPair.localFilter); + + //remove existing additional folder pairs + clearAddFolderPairs(); + + //set additional pairs + addFolderPair(batchCfg.mainCfg.additionalPairs); + + updateVisibleTabs(); + + updateGui(); //re-evaluate gui after config changes + + Fit(); //needed + Refresh(); //needed + Centre(); +} + + +void BatchDialog::OnAddFolderPair(wxCommandEvent& event) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + std::vector newPairs; + newPairs.push_back(getCurrentConfiguration().mainCfg.firstPair); + + addFolderPair(newPairs, true); //add pair in front of additonal pairs + + //clear first pair + const FolderPairEnh cfgEmpty; + firstFolderPair->setValues(cfgEmpty.leftDirectory, + cfgEmpty.rightDirectory, + cfgEmpty.altSyncConfig, + cfgEmpty.localFilter); +} + + +void BatchDialog::OnRemoveFolderPair(wxCommandEvent& event) +{ + //find folder pair originating the event + const wxObject* const eventObj = event.GetEventObject(); + for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + { + if (eventObj == static_cast((*i)->m_bpButtonRemovePair)) + { + removeAddFolderPair(i - additionalFolderPairs.begin()); + return; + } + } +} + + +void BatchDialog::OnRemoveTopFolderPair(wxCommandEvent& event) +{ + if (additionalFolderPairs.size() > 0) + { + //get settings from second folder pair + const FolderPairEnh cfgSecond = getEnahncedPair(additionalFolderPairs[0]); + + //reset first pair + firstFolderPair->setValues(cfgSecond.leftDirectory, + cfgSecond.rightDirectory, + cfgSecond.altSyncConfig, + cfgSecond.localFilter); + + removeAddFolderPair(0); //remove second folder pair (first of additional folder pairs) + } +} + + +const size_t MAX_FOLDER_PAIRS = 3; + + +void BatchDialog::updateGuiForFolderPair() +{ + //adapt delete top folder pair button + if (additionalFolderPairs.size() == 0) + m_bpButtonRemovePair->Hide(); + else + m_bpButtonRemovePair->Show(); + + //adapt local filter and sync cfg for first folder pair + if ( additionalFolderPairs.size() == 0 && + firstFolderPair->getAltSyncConfig().get() == NULL && + NameFilter(firstFolderPair->getAltFilterConfig().includeFilter, + firstFolderPair->getAltFilterConfig().excludeFilter).isNull()) + { + m_bpButtonLocalFilter->Hide(); + m_bpButtonAltSyncCfg->Hide(); + } + else + { + m_bpButtonLocalFilter->Show(); + m_bpButtonAltSyncCfg->Show(); + } + + m_scrolledWindow6->Fit(); //adjust scrolled window size + m_panelOverview->Layout(); //adjust stuff inside scrolled window +} + + +void BatchDialog::addFolderPair(const std::vector& newPairs, bool addFront) +{ + wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion + + if (!newPairs.empty()) + { + //add folder pairs + int pairHeight = 0; + for (std::vector::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) + { + BatchFolderPairPanel* newPair = new BatchFolderPairPanel(m_scrolledWindow6, *this); + + if (addFront) + { + bSizerAddFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); + additionalFolderPairs.insert(additionalFolderPairs.begin(), newPair); + } + else + { + bSizerAddFolderPairs->Add(newPair, 0, wxEXPAND, 5); + additionalFolderPairs.push_back(newPair); + } + + //get size of scrolled window + pairHeight = newPair->GetSize().GetHeight(); + + //register events + newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(BatchDialog::OnRemoveFolderPair), NULL, this ); + + //set alternate configuration + newPair->setValues(i->leftDirectory, + i->rightDirectory, + i->altSyncConfig, + i->localFilter); + } + //set size of scrolled window + const size_t visiblePairs = std::min(additionalFolderPairs.size() + 1, MAX_FOLDER_PAIRS); //up to MAX_FOLDER_PAIRS pairs shall be shown + m_scrolledWindow6->SetMinSize(wxSize( -1, pairHeight * static_cast(visiblePairs))); + + //update controls + m_scrolledWindow6->Fit(); //adjust scrolled window size + m_panelOverview->Layout(); //adjust stuff inside scrolled window + Fit(); //adapt dialog size + + //after changing folder pairs window focus is lost: results in scrolled window scrolling to top each time window is shown: we don't want this + m_bpButtonAddPair->SetFocus(); + } + + updateGuiForFolderPair(); +} + + +void BatchDialog::removeAddFolderPair(const int pos) +{ + wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion + + if (0 <= pos && pos < static_cast(additionalFolderPairs.size())) + { + //remove folder pairs from window + BatchFolderPairPanel* pairToDelete = additionalFolderPairs[pos]; + const int pairHeight = pairToDelete->GetSize().GetHeight(); + + bSizerAddFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually + pairToDelete->Destroy(); // + additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove last element in vector + + //set size of scrolled window + const size_t visiblePairs = std::min(additionalFolderPairs.size() + 1, MAX_FOLDER_PAIRS); //up to MAX_FOLDER_PAIRS pairs shall be shown + m_scrolledWindow6->SetMinSize(wxSize(-1, pairHeight * static_cast(visiblePairs))); + + //update controls + m_scrolledWindow6->Fit(); //adjust scrolled window size + m_panelOverview->Layout(); //adjust stuff inside scrolled window + + m_panelOverview->InvalidateBestSize(); //needed for Fit() to work correctly! + Fit(); //adapt dialog size + + //after changing folder pairs window focus is lost: results in scrolled window scrolling to top each time window is shown: we don't want this + m_bpButtonCmpConfig->SetFocus(); + } + + updateGuiForFolderPair(); +} + + +void BatchDialog::clearAddFolderPairs() +{ + wxWindowUpdateLocker dummy(m_panelOverview); //avoid display distortion + + additionalFolderPairs.clear(); + bSizerAddFolderPairs->Clear(true); + + m_scrolledWindow6->SetMinSize(wxSize(-1, sbSizerMainPair->GetSize().GetHeight())); //respect height of main pair +} + + +/* +#ifdef FFS_WIN +#include //includes "windows.h" +#include +#endif // FFS_WIN + +template +struct CleanUp +{ + CleanUp(T* element) : m_element(element) {} + + ~CleanUp() + { + m_element->Release(); + } + + T* m_element; +}; + + +bool BatchDialog::createBatchFile(const wxString& filename) +{ + //create shell link (instead of batch file) for full Unicode support + HRESULT hResult = E_FAIL; + IShellLink* pShellLink = NULL; + + if (FAILED(CoCreateInstance(CLSID_ShellLink, //class identifier + NULL, //object isn't part of an aggregate + CLSCTX_INPROC_SERVER, //context for running executable code + IID_IShellLink, //interface identifier + (void**)&pShellLink))) //pointer to storage of interface pointer + return false; + CleanUp cleanOnExit(pShellLink); + + wxString freeFileSyncExe = wxStandardPaths::Get().GetExecutablePath(); + if (FAILED(pShellLink->SetPath(freeFileSyncExe.c_str()))) + return false; + + if (FAILED(pShellLink->SetArguments(getCommandlineArguments().c_str()))) + return false; + + if (FAILED(pShellLink->SetIconLocation(freeFileSyncExe.c_str(), 1))) //second icon from executable file is used + return false; + + if (FAILED(pShellLink->SetDescription(_("FreeFileSync Batch Job")))) + return false; + + IPersistFile* pPersistFile = NULL; + if (FAILED(pShellLink->QueryInterface(IID_IPersistFile, (void**)&pPersistFile))) + return false; + CleanUp cleanOnExit2(pPersistFile); + + //pPersistFile->Save accepts unicode input only +#ifdef _UNICODE + hResult = pPersistFile->Save(filename.c_str(), TRUE); +#else + WCHAR wszTemp [MAX_PATH]; + if (MultiByteToWideChar(CP_ACP, 0, filename.c_str(), -1, wszTemp, MAX_PATH) == 0) + return false; + + hResult = pPersistFile->Save(wszTemp, TRUE); +#endif + if (FAILED(hResult)) + return false; + + return true; +} +*/ diff --git a/ui/batch_config.h b/ui/batch_config.h new file mode 100644 index 00000000..b2ff0cc8 --- /dev/null +++ b/ui/batch_config.h @@ -0,0 +1,96 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef BATCHCONFIG_H_INCLUDED +#define BATCHCONFIG_H_INCLUDED + +#include "gui_generated.h" +#include "../library/process_xml.h" + + +namespace ffs3 +{ +class DragDropOnDlg; +} + +class BatchFolderPairPanel; +class FirstBatchFolderPairCfg; + + +class BatchDialog: public BatchDlgGenerated +{ + friend class BatchFileDropEvent; + template + friend class FolderPairCallback; + +public: + BatchDialog(wxWindow* window, const xmlAccess::XmlBatchConfig& batchCfg); + BatchDialog(wxWindow* window, const wxString& filename); + ~BatchDialog(); + + enum + { + BATCH_FILE_SAVED = 15 + }; + +private: + void init(); + + virtual void OnCmpSettings( wxCommandEvent& event); + virtual void OnSyncSettings( wxCommandEvent& event); + virtual void OnConfigureFilter( wxCommandEvent& event); + + virtual void OnHelp( wxCommandEvent& event); + + void OnGlobalFilterOpenContext(wxCommandEvent& event); + void OnGlobalFilterRemConfirm(wxCommandEvent& event); + virtual void OnCheckSilent( wxCommandEvent& event); + virtual void OnClose( wxCloseEvent& event); + virtual void OnCancel( wxCommandEvent& event); + virtual void OnSaveBatchJob( wxCommandEvent& event); + virtual void OnLoadBatchJob( wxCommandEvent& event); + virtual void OnAddFolderPair( wxCommandEvent& event); + virtual void OnRemoveFolderPair( wxCommandEvent& event); + virtual void OnRemoveTopFolderPair(wxCommandEvent& event); + + void addFolderPair(const std::vector& newPairs, bool addFront = false); + void removeAddFolderPair(const int pos); + void clearAddFolderPairs(); + + void updateGuiForFolderPair(); + + void updateGui(); //re-evaluate gui after config changes + + void updateVisibleTabs(); + void showNotebookpage(wxWindow* page, const wxString& pageName, bool show); + + //error handling + xmlAccess::OnError getSelectionHandleError() const; + void setSelectionHandleError(const xmlAccess::OnError value); + void OnChangeErrorHandling(wxCommandEvent& event); + void updateToolTipErrorHandling(const xmlAccess::OnError value); + + bool saveBatchFile(const wxString& filename); + void loadBatchFile(const wxString& filename); + void loadBatchCfg(const xmlAccess::XmlBatchConfig& batchCfg); + + xmlAccess::XmlBatchConfig getCurrentConfiguration() const; + + boost::shared_ptr firstFolderPair; //always bound!!! + std::vector additionalFolderPairs; + + //used when saving batch file + wxString proposedBatchFileName; + + xmlAccess::XmlBatchConfig localBatchCfg; + + std::auto_ptr contextMenu; + + //add drag & drop support when selecting logfile directory + std::auto_ptr dragDropOnLogfileDir; +}; + +#endif // BATCHCONFIG_H_INCLUDED diff --git a/ui/batch_status_handler.cpp b/ui/batch_status_handler.cpp new file mode 100644 index 00000000..e67e4426 --- /dev/null +++ b/ui/batch_status_handler.cpp @@ -0,0 +1,390 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "batch_status_handler.h" +//#include "small_dlgs.h" +#include "msg_popup.h" +#include +#include +#include "../shared/standard_paths.h" +#include "../shared/file_handling.h" +#include "../shared/string_conv.h" +#include "../shared/global_func.h" +#include "../shared/app_main.h" +#include "../shared/util.h" + +using namespace ffs3; + + +class LogFile +{ +public: + LogFile(const wxString& logfileDirectory, const wxString& batchFilename) //throw (FileError&) + { + const wxString logfileName = findUniqueLogname(logfileDirectory, batchFilename); + + logFile.Open(logfileName, wxT("w")); + if (!logFile.IsOpened()) + throw FileError(wxString(_("Unable to create logfile!")) + wxT("\"") + logfileName + wxT("\"")); + + //write header + wxString headerLine = wxString(wxT("FreeFileSync - ")) + + _("Batch execution") + wxT(" (") + + _("Date") + wxT(": ") + wxDateTime::Now().FormatDate() + wxT(" ") + //"Date" is used at other places too + _("Time") + wxT(":") + wxT(" ") + wxDateTime::Now().FormatTime() + wxT(")"); + logFile.Write(headerLine + wxChar('\n')); + logFile.Write(wxString().Pad(headerLine.Len(), wxChar('-')) + wxChar('\n') + wxChar('\n')); + + wxString caption = _("Log-messages:"); + logFile.Write(caption + wxChar('\n')); + logFile.Write(wxString().Pad(caption.Len(), wxChar('-')) + wxChar('\n')); + + logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ") + _("Start") + wxChar('\n') + wxChar('\n')); + + totalTime.Start(); //measure total time + } + + void writeLog(const ErrorLogging& log) + { + //write actual logfile + const ErrorLogging::MessageEntry& messages = log.getFormattedMessages(); + for (ErrorLogging::MessageEntry::const_iterator i = messages.begin(); i != messages.end(); ++i) + logFile.Write(*i + wxChar('\n')); + } + + ~LogFile() + { + //write ending + logFile.Write(wxChar('\n')); + + const long time = totalTime.Time(); //retrieve total time + logFile.Write(wxString(wxT("[")) + wxDateTime::Now().FormatTime() + wxT("] ")); + logFile.Write(wxString(_("Stop")) + wxT(" (") + _("Total time:") + wxT(" ") + (wxTimeSpan::Milliseconds(time)).Format() + wxT(")")); + } + +private: + static wxString extractJobName(const wxString& batchFilename) + { + using namespace common; + + const wxString shortName = batchFilename.AfterLast(FILE_NAME_SEPARATOR); //returns the whole string if seperator not found + const wxString jobName = shortName.BeforeLast(wxChar('.')); //returns empty string if seperator not found + return jobName.IsEmpty() ? shortName : jobName; + } + + + static wxString findUniqueLogname(const wxString& logfileDirectory, const wxString& batchFilename) + { + using namespace common; + + //create logfile directory + Zstring logfileDir = logfileDirectory.empty() ? + wxToZ(ffs3::getConfigDir() + wxT("Logs")) : + ffs3::getFormattedDirectoryName(wxToZ(logfileDirectory)); + + if (!ffs3::dirExists(logfileDir)) + ffs3::createDirectory(logfileDir); //create recursively if necessary: may throw (FileError&) + + //assemble logfile name + if (!logfileDir.EndsWith(FILE_NAME_SEPARATOR)) + logfileDir += FILE_NAME_SEPARATOR; + + wxString logfileName = zToWx(logfileDir); + + //add prefix + logfileName += extractJobName(batchFilename) + wxT(" "); + + //add timestamp + wxString timeNow = wxDateTime::Now().FormatISOTime(); + timeNow.Replace(wxT(":"), wxT("")); + logfileName += wxDateTime::Now().FormatISODate() + wxChar(' ') + timeNow; + + wxString output = logfileName + wxT(".log"); + + //ensure uniqueness + for (int i = 1; ffs3::somethingExists(wxToZ(output)); ++i) + output = logfileName + wxChar('_') + common::numberToString(i) + wxT(".log"); + + return output; + } + + wxFFile logFile; + wxStopWatch totalTime; +}; + + +//############################################################################################################################## +BatchStatusHandler::BatchStatusHandler(bool runSilent, + const wxString& batchFilename, + const wxString* logfileDirectory, + const xmlAccess::OnError handleError, + const SwitchToGui& switchBatchToGui, //functionality to change from batch mode to GUI mode + int& returnVal) : + switchBatchToGui_(switchBatchToGui), + exitWhenFinished(runSilent), //=> exit immediately when finished + switchToGuiRequested(false), + handleError_(handleError), + currentProcess(StatusHandler::PROCESS_NONE), + returnValue(returnVal), + syncStatusFrame(*this, NULL, runSilent) +{ + if (logfileDirectory) + { + try + { + logFile.reset(new LogFile(*logfileDirectory, batchFilename)); + } + catch (ffs3::FileError& error) + { + wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); + returnValue = -7; + throw ffs3::AbortThisProcess(); + } + } + + assert(runSilent || handleError != xmlAccess::ON_ERROR_EXIT); //shouldn't be selectable from GUI settings +} + + +BatchStatusHandler::~BatchStatusHandler() +{ + const int totalErrors = errorLog.errorsTotal(); //evaluate before finalizing log + + //finalize error log + if (abortIsRequested()) + { + returnValue = -4; + errorLog.logError(_("Synchronization aborted!")); + } + else if (totalErrors) + { + returnValue = -5; + errorLog.logWarning(_("Synchronization completed with errors!")); + } + else + errorLog.logInfo(_("Synchronization completed successfully!")); + + + //print the results list: logfile + if (logFile.get()) + logFile->writeLog(errorLog); + + //decide whether to stay on status screen or exit immediately... + if (switchToGuiRequested) //-> avoid recursive yield() calls, thous switch not before ending batch mode + { + switchBatchToGui_.execute(); //open FreeFileSync GUI + syncStatusFrame.closeWindowDirectly(); //syncStatusFrame is main window => program will quit directly + } + else if (!exitWhenFinished || syncStatusFrame.getAsWindow()->IsShown()) //warning: wxWindow::Show() is called within processHasFinished()! + { + //print the results list: GUI + wxString finalMessage; + if (totalErrors > 0) + { + wxString header(_("Warning: Synchronization failed for %x item(s):")); + header.Replace(wxT("%x"), ffs3::numberToStringSep(totalErrors), false); + finalMessage += header + wxT("\n\n"); + } + + const ErrorLogging::MessageEntry& messages = errorLog.getFormattedMessages(); + for (ErrorLogging::MessageEntry::const_iterator i = messages.begin(); i != messages.end(); ++i) + { + finalMessage += *i; + finalMessage += wxT("\n\n"); + } + + //notify about (logical) application main window => program won't quit, but stay on this dialog + ffs3::AppMainWindow::setMainWindow(syncStatusFrame.getAsWindow()); + + //notify to syncStatusFrame that current process has ended + if (abortIsRequested()) + syncStatusFrame.processHasFinished(SyncStatus::ABORTED, finalMessage); //enable okay and close events + else if (totalErrors) + syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_ERROR, finalMessage); + else + syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_SUCCESS, finalMessage); + } + else + syncStatusFrame.closeWindowDirectly(); //syncStatusFrame is main window => program will quit directly +} + + +inline +void BatchStatusHandler::updateStatusText(const Zstring& text) +{ + if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING && logFile.get()) //write file transfer information to log + errorLog.logInfo(zToWx(text)); + + syncStatusFrame.setStatusText_NoUpdate(text); +} + + +void BatchStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, StatusHandler::Process processID) +{ + currentProcess = processID; + + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + syncStatusFrame.resetGauge(0, 0); //initialize some gui elements (remaining time, speed) + syncStatusFrame.setCurrentStatus(SyncStatus::SCANNING); + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: + syncStatusFrame.resetGauge(objectsTotal, dataTotal); + syncStatusFrame.setCurrentStatus(SyncStatus::COMPARING_CONTENT); + break; + case StatusHandler::PROCESS_SYNCHRONIZING: + syncStatusFrame.resetGauge(objectsTotal, dataTotal); + syncStatusFrame.setCurrentStatus(SyncStatus::SYNCHRONIZING); + break; + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } +} + + +inline +void BatchStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) +{ + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + syncStatusFrame.incScannedObjects_NoUpdate(objectsProcessed); + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: + case StatusHandler::PROCESS_SYNCHRONIZING: + syncStatusFrame.incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); + break; + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } +} + + +void BatchStatusHandler::reportInfo(const wxString& infoMessage) +{ + errorLog.logInfo(infoMessage); +} + + +void BatchStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) +{ + errorLog.logWarning(warningMessage); + + if (!warningActive) + return; + + switch (handleError_) + { + case xmlAccess::ON_ERROR_POPUP: + { + //show popup and ask user how to handle warning + bool dontWarnAgain = false; + WarningDlg warningDlg(NULL, + WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_SWITCH | WarningDlg::BUTTON_ABORT, + warningMessage + wxT("\n\n") + _("Press \"Switch\" to open FreeFileSync GUI mode."), + dontWarnAgain); + warningDlg.Raise(); + const WarningDlg::Response rv = static_cast(warningDlg.ShowModal()); + switch (rv) + { + case WarningDlg::BUTTON_ABORT: + abortThisProcess(); + break; + + case WarningDlg::BUTTON_SWITCH: + errorLog.logWarning(_("Switching to FreeFileSync GUI mode...")); + switchToGuiRequested = true; + abortThisProcess(); + break; + + case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! + warningActive = !dontWarnAgain; + break; + } + } + break; //keep it! last switch might not find match + + case xmlAccess::ON_ERROR_EXIT: //abort + abortThisProcess(); + break; + + case xmlAccess::ON_ERROR_IGNORE: //no unhandled error situation! + break; + } +} + + +ErrorHandler::Response BatchStatusHandler::reportError(const wxString& errorMessage) +{ + switch (handleError_) + { + case xmlAccess::ON_ERROR_POPUP: + { + bool ignoreNextErrors = false; + ErrorDlg errorDlg(NULL, + ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, + errorMessage, + ignoreNextErrors); + errorDlg.Raise(); + const ErrorDlg::ReturnCodes rv = static_cast(errorDlg.ShowModal()); + switch (rv) + { + case ErrorDlg::BUTTON_IGNORE: + if (ignoreNextErrors) //falsify only + handleError_ = xmlAccess::ON_ERROR_IGNORE; + errorLog.logError(errorMessage); + return ErrorHandler::IGNORE_ERROR; + + case ErrorDlg::BUTTON_RETRY: + return ErrorHandler::RETRY; + + case ErrorDlg::BUTTON_ABORT: + errorLog.logError(errorMessage); + abortThisProcess(); + } + } + break; //used if last switch didn't find a match + + case xmlAccess::ON_ERROR_EXIT: //abort + errorLog.logError(errorMessage); + abortThisProcess(); + + case xmlAccess::ON_ERROR_IGNORE: + errorLog.logError(errorMessage); + return ErrorHandler::IGNORE_ERROR; + } + + assert(false); + return ErrorHandler::IGNORE_ERROR; //dummy value + +} + + +void BatchStatusHandler::reportFatalError(const wxString& errorMessage) +{ + if (handleError_ == xmlAccess::ON_ERROR_POPUP) + exitWhenFinished = false; //log fatal error and show it on status dialog + + errorLog.logFatalError(errorMessage); + abortThisProcess(); +} + + +inline +void BatchStatusHandler::forceUiRefresh() +{ + syncStatusFrame.updateStatusDialogNow(); +} + + +void BatchStatusHandler::abortThisProcess() +{ + requestAbortion(); + throw ffs3::AbortThisProcess(); //abort can be triggered by syncStatusFrame +} diff --git a/ui/batch_status_handler.h b/ui/batch_status_handler.h new file mode 100644 index 00000000..f5497b0f --- /dev/null +++ b/ui/batch_status_handler.h @@ -0,0 +1,57 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef BATCHSTATUSHANDLER_H_INCLUDED +#define BATCHSTATUSHANDLER_H_INCLUDED + +#include "../library/status_handler.h" +#include "../library/process_xml.h" +#include "../library/error_log.h" +#include "progress_indicator.h" +#include "switch_to_gui.h" + +class LogFile; +class SyncStatus; + + +class BatchStatusHandler : public StatusHandler +{ +public: + BatchStatusHandler(bool runSilent, //defines: -start minimized and -quit immediately when finished + const wxString& batchFilename, + const wxString* logfileDirectory, //optional: enable logging if available + const xmlAccess::OnError handleError, + const ffs3::SwitchToGui& switchBatchToGui, //functionality to change from batch mode to GUI mode + int& returnVal); + ~BatchStatusHandler(); + + virtual void updateStatusText(const Zstring& text); + virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); + virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); + virtual void forceUiRefresh(); + + void reportInfo(const wxString& infoMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); + virtual ErrorHandler::Response reportError(const wxString& errorMessage); + virtual void reportFatalError(const wxString& errorMessage); + +private: + virtual void abortThisProcess(); + + const ffs3::SwitchToGui& switchBatchToGui_; //functionality to change from batch mode to GUI mode + bool exitWhenFinished; + bool switchToGuiRequested; + xmlAccess::OnError handleError_; + ffs3::ErrorLogging errorLog; //list of non-resolved errors and warnings + Process currentProcess; + int& returnValue; + + SyncStatus syncStatusFrame; //the window managed by SyncStatus has longer lifetime than this handler! + boost::shared_ptr logFile; //optional! +}; + + +#endif // BATCHSTATUSHANDLER_H_INCLUDED diff --git a/ui/checkVersion.cpp b/ui/checkVersion.cpp deleted file mode 100644 index 36d609b1..00000000 --- a/ui/checkVersion.cpp +++ /dev/null @@ -1,162 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "checkVersion.h" -#include -#include -#include -#include "../version/version.h" -#include -#include -#include "../shared/globalFunctions.h" -#include "messagePopup.h" -#include "../shared/standardPaths.h" - - -class CloseConnectionOnExit -{ -public: - CloseConnectionOnExit(wxInputStream* httpStream, wxHTTP& webAccess) : - m_httpStream(httpStream), - m_webAccess(webAccess) {} - - ~CloseConnectionOnExit() - { - delete m_httpStream; //must be deleted BEFORE webAccess is closed - m_webAccess.Close(); - } - -private: - wxInputStream* m_httpStream; - wxHTTP& m_webAccess; -}; - - -bool getOnlineVersion(wxString& version) -{ - wxHTTP webAccess; - wxInputStream* httpStream = NULL; - - wxWindowDisabler dummy; - CloseConnectionOnExit dummy2(httpStream, webAccess); - - webAccess.SetHeader(wxT("Content-type"), wxT("text/html; charset=utf-8")); - webAccess.SetTimeout(5); //5 seconds of timeout instead of 10 minutes... - - if (webAccess.Connect(wxT("freefilesync.cvs.sourceforge.net"))) //only the server, no pages here yet... - { - //wxApp::IsMainLoopRunning(); // should return true - - httpStream = webAccess.GetInputStream(wxT("/viewvc/freefilesync/version/version.txt")); - - if (httpStream && webAccess.GetError() == wxPROTO_NOERR) - { - wxString newestVersion; - wxStringOutputStream out_stream(&newestVersion); - httpStream->Read(out_stream); - if (!newestVersion.empty()) - { - version = newestVersion; - return true; - } - } - } - - return false; -} - - -bool newerVersionExists(const wxString& onlineVersion) -{ - wxString currentVersionCpy = FreeFileSync::currentVersion; - wxString onlineVersionCpy = onlineVersion; - - const wxChar VERSION_SEP = wxT('.'); - - using globalFunctions::stringToNumber; - - while ( currentVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND || - onlineVersionCpy.Find(VERSION_SEP) != wxNOT_FOUND) - { - const int currentMajor = stringToNumber(currentVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. - const int onlineMajor = stringToNumber(onlineVersionCpy.BeforeFirst(VERSION_SEP)); //Returns the whole string if VERSION_SEP is not found. - - if (currentMajor != onlineMajor) - return currentMajor < onlineMajor; - - currentVersionCpy = currentVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. - onlineVersionCpy = onlineVersionCpy.AfterFirst(VERSION_SEP); //Returns the empty string if VERSION_SEP is not found. - } - - return stringToNumber(currentVersionCpy) < stringToNumber(onlineVersionCpy); -} - - -void FreeFileSync::checkForUpdateNow() -{ - wxString onlineVersion; - if (!getOnlineVersion(onlineVersion)) - { - wxMessageBox(_("Unable to connect to sourceforge.net!"), _("Error"), wxOK | wxICON_ERROR); - return; - } - - if (newerVersionExists(onlineVersion)) - { - const int rv = wxMessageBox(wxString(_("A newer version of FreeFileSync is available:")) + wxT(" v") + onlineVersion + wxT(". ") + _("Download now?"), _("Information"), wxYES_NO | wxICON_QUESTION); - if (rv == wxYES) - wxLaunchDefaultBrowser(wxT("http://sourceforge.net/project/showfiles.php?group_id=234430")); - } - else - wxMessageBox(_("FreeFileSync is up to date!"), _("Information"), wxICON_INFORMATION); -} - - -void FreeFileSync::checkForUpdatePeriodically(long& lastUpdateCheck) -{ -#ifdef FFS_LINUX - if (!FreeFileSync::isPortableVersion()) //don't check for updates in installer version -> else: handled by .deb - return; -#endif - - if (lastUpdateCheck != -1) - { - if (lastUpdateCheck == 0) - { - QuestionDlg* const messageDlg = new QuestionDlg(NULL, - QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, - wxString(_("Do you want FreeFileSync to automatically check for updates every week?")) + wxT("\n") + - _("(Requires an Internet connection!)")); - - const bool checkRegularly = messageDlg->ShowModal() == QuestionDlg::BUTTON_YES; - messageDlg->Destroy(); - if (checkRegularly) - { - lastUpdateCheck = 123; //some old date (few seconds after 1970) - - checkForUpdatePeriodically(lastUpdateCheck); //check for updates now - } - else - lastUpdateCheck = -1; //don't check for updates anymore - } - else if (wxGetLocalTime() >= lastUpdateCheck + 7 * 24 * 3600) //check weekly - { - wxString onlineVersion; - if (!getOnlineVersion(onlineVersion)) - return; //do not handle error - - lastUpdateCheck = wxGetLocalTime(); - - if (newerVersionExists(onlineVersion)) - { - const int rv = wxMessageBox(wxString(_("A newer version of FreeFileSync is available:")) + wxT(" v") + onlineVersion + wxT(". ") + _("Download now?"), _("Information"), wxYES_NO | wxICON_QUESTION); - if (rv == wxYES) - wxLaunchDefaultBrowser(wxT("http://sourceforge.net/project/showfiles.php?group_id=234430")); - } - } - } -} - diff --git a/ui/checkVersion.h b/ui/checkVersion.h deleted file mode 100644 index 5aeaeb3a..00000000 --- a/ui/checkVersion.h +++ /dev/null @@ -1,18 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef UPDATEVERSION_H_INCLUDED -#define UPDATEVERSION_H_INCLUDED - - -namespace FreeFileSync -{ -void checkForUpdateNow(); - -void checkForUpdatePeriodically(long& lastUpdateCheck); -} - -#endif // UPDATEVERSION_H_INCLUDED diff --git a/ui/check_version.cpp b/ui/check_version.cpp new file mode 100644 index 00000000..d9f892d9 --- /dev/null +++ b/ui/check_version.cpp @@ -0,0 +1,174 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "check_version.h" +#include +#include +#include +#include "../version/version.h" +#include +#include +#include "../shared/global_func.h" +#include "msg_popup.h" +#include "../shared/standard_paths.h" +#include + + +class CloseConnectionOnExit +{ +public: + CloseConnectionOnExit(wxInputStream* httpStream, wxHTTP& webAccess) : + m_httpStream(httpStream), + m_webAccess(webAccess) {} + + ~CloseConnectionOnExit() + { + delete m_httpStream; //must be deleted BEFORE webAccess is closed + m_webAccess.Close(); + } + +private: + wxInputStream* m_httpStream; + wxHTTP& m_webAccess; +}; + + +bool getOnlineVersion(wxString& version) +{ + wxHTTP webAccess; + wxInputStream* httpStream = NULL; + + wxWindowDisabler dummy; + CloseConnectionOnExit dummy2(httpStream, webAccess); + + webAccess.SetHeader(wxT("Content-type"), wxT("text/html; charset=utf-8")); + webAccess.SetTimeout(5); //5 seconds of timeout instead of 10 minutes... + + if (webAccess.Connect(wxT("freefilesync.cvs.sourceforge.net"))) //only the server, no pages here yet... + { + //wxApp::IsMainLoopRunning(); // should return true + + httpStream = webAccess.GetInputStream(wxT("/viewvc/freefilesync/version/version.txt")); + + if (httpStream && webAccess.GetError() == wxPROTO_NOERR) + { + wxString newestVersion; + wxStringOutputStream out_stream(&newestVersion); + httpStream->Read(out_stream); + if (!newestVersion.empty()) + { + version = newestVersion; + return true; + } + } + } + + return false; +} + + +const wxChar VERSION_SEP = wxT('.'); + + +std::vector parseVersion(const wxString& version) +{ + std::vector output; + + wxStringTokenizer tkz(version, VERSION_SEP, wxTOKEN_RET_EMPTY); + while (tkz.HasMoreTokens()) + { + const wxString& token = tkz.GetNextToken(); + output.push_back(common::stringToNumber(token)); + } + return output; +} + + +bool newerVersionExists(const wxString& onlineVersion) +{ + std::vector current = parseVersion(ffs3::currentVersion); + std::vector online = parseVersion(onlineVersion); + + if (online.empty() || online[0] == 0) //onlineVersion may be "This website has been moved..." In this case better check for an update + return true; + + current.resize(std::max(current.size(), online.size())); + online. resize(std::max(current.size(), online.size())); + + typedef std::vector::const_iterator VerIter; + const std::pair mm = std::mismatch (current.begin(), current.end(), + online.begin()); + + return mm.first == current.end() ? false : //both versions match + *mm.first < *mm.second; +} + + +void ffs3::checkForUpdateNow() +{ + wxString onlineVersion; + if (!getOnlineVersion(onlineVersion)) + { + wxMessageBox(_("Unable to connect to sourceforge.net!"), _("Error"), wxOK | wxICON_ERROR); + return; + } + + if (newerVersionExists(onlineVersion)) + { + const int rv = wxMessageBox(wxString(_("A newer version of FreeFileSync is available:")) + wxT(" v") + onlineVersion + wxT(". ") + _("Download now?"), _("Information"), wxYES_NO | wxICON_QUESTION); + if (rv == wxYES) + wxLaunchDefaultBrowser(wxT("http://sourceforge.net/project/showfiles.php?group_id=234430")); + } + else + wxMessageBox(_("FreeFileSync is up to date!"), _("Information"), wxICON_INFORMATION); +} + + +void ffs3::checkForUpdatePeriodically(long& lastUpdateCheck) +{ +#ifdef FFS_LINUX + if (!ffs3::isPortableVersion()) //don't check for updates in installer version -> else: handled by .deb + return; +#endif + + if (lastUpdateCheck != -1) + { + if (lastUpdateCheck == 0) + { + QuestionDlg* const messageDlg = new QuestionDlg(NULL, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, + wxString(_("Do you want FreeFileSync to automatically check for updates every week?")) + wxT("\n") + + _("(Requires an Internet connection!)")); + + const bool checkRegularly = messageDlg->ShowModal() == QuestionDlg::BUTTON_YES; + messageDlg->Destroy(); + if (checkRegularly) + { + lastUpdateCheck = 123; //some old date (few seconds after 1970) + + checkForUpdatePeriodically(lastUpdateCheck); //check for updates now + } + else + lastUpdateCheck = -1; //don't check for updates anymore + } + else if (wxGetLocalTime() >= lastUpdateCheck + 7 * 24 * 3600) //check weekly + { + wxString onlineVersion; + if (!getOnlineVersion(onlineVersion)) + return; //do not handle error + + lastUpdateCheck = wxGetLocalTime(); + + if (newerVersionExists(onlineVersion)) + { + const int rv = wxMessageBox(wxString(_("A newer version of FreeFileSync is available:")) + wxT(" v") + onlineVersion + wxT(". ") + _("Download now?"), _("Information"), wxYES_NO | wxICON_QUESTION); + if (rv == wxYES) + wxLaunchDefaultBrowser(wxT("http://sourceforge.net/project/showfiles.php?group_id=234430")); + } + } + } +} + diff --git a/ui/check_version.h b/ui/check_version.h new file mode 100644 index 00000000..023e5023 --- /dev/null +++ b/ui/check_version.h @@ -0,0 +1,18 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef UPDATEVERSION_H_INCLUDED +#define UPDATEVERSION_H_INCLUDED + + +namespace ffs3 +{ +void checkForUpdateNow(); + +void checkForUpdatePeriodically(long& lastUpdateCheck); +} + +#endif // UPDATEVERSION_H_INCLUDED diff --git a/ui/folderPair.h b/ui/folderPair.h deleted file mode 100644 index 7a027fba..00000000 --- a/ui/folderPair.h +++ /dev/null @@ -1,206 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef FOLDERPAIR_H_INCLUDED -#define FOLDERPAIR_H_INCLUDED - -#include "../structures.h" -#include "../shared/dragAndDrop.h" -#include "../library/resources.h" -#include "smallDialogs.h" -#include "syncConfig.h" -#include -#include "isNullFilter.h" -#include "../shared/util.h" -#include "../shared/stringConv.h" - -namespace FreeFileSync -{ -//basic functionality for handling alternate folder pair configuration: change sync-cfg/filter cfg, right-click context menu, button icons... - -template -class FolderPairPanelBasic : private wxEvtHandler -{ -public: - typedef boost::shared_ptr AltSyncCfgPtr; - - - Zstring getLeftDir() const - { - return wxToZ(basicPanel_.m_directoryLeft->GetValue()); - } - - Zstring getRightDir() const - { - return wxToZ(basicPanel_.m_directoryRight->GetValue()); - } - - AltSyncCfgPtr getAltSyncConfig() const - { - return altSyncConfig; - } - - FilterConfig getAltFilterConfig() const - { - return localFilter; - } - - void setValues(const Zstring& leftDir, - const Zstring& rightDir, - AltSyncCfgPtr syncCfg, - const FilterConfig& filter) - { - altSyncConfig = syncCfg; - localFilter = filter; - - //insert directory names - FreeFileSync::setDirectoryName(zToWx(leftDir), basicPanel_.m_directoryLeft, basicPanel_.m_dirPickerLeft); - FreeFileSync::setDirectoryName(zToWx(rightDir), basicPanel_.m_directoryRight, basicPanel_.m_dirPickerRight); - - refreshButtons(); - } - - - void refreshButtons() - { - if (altSyncConfig.get()) - { - basicPanel_.m_bpButtonAltSyncCfg->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfigSmall"))); - basicPanel_.m_bpButtonAltSyncCfg->SetToolTip(wxString(_("Select alternate synchronization settings")) + wxT(" ") + globalFunctions::LINE_BREAK + - wxT("(") + getVariantName(altSyncConfig->syncConfiguration) + wxT(")")); - } - else - { - basicPanel_.m_bpButtonAltSyncCfg->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfigSmallGrey"))); - basicPanel_.m_bpButtonAltSyncCfg->SetToolTip(_("Select alternate synchronization settings")); - } - - //test for Null-filter - if (isNullFilter(localFilter)) - { - basicPanel_.m_bpButtonLocalFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterSmallGrey"))); - basicPanel_.m_bpButtonLocalFilter->SetToolTip(_("No filter selected")); - } - else - { - basicPanel_.m_bpButtonLocalFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterSmall"))); - basicPanel_.m_bpButtonLocalFilter->SetToolTip(_("Filter is active")); - } - } - -protected: - FolderPairPanelBasic(GuiPanel& basicPanel) : //takes reference on basic panel to be enhanced - basicPanel_(basicPanel) - { - //register events for removal of alternate configuration - basicPanel_.m_bpButtonAltSyncCfg->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfgRemove), NULL, this); - basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfgRemove), NULL, this); - - basicPanel_.m_bpButtonAltSyncCfg-> Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfg), NULL, this); - basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfg), NULL, this); - - basicPanel_.m_bpButtonRemovePair->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("removeFolderPair"))); - } - - virtual void OnLocalFilterCfgRemoveConfirm(wxCommandEvent& event) - { - localFilter = FilterConfig(); - refreshButtons(); - } - - virtual void OnAltSyncCfgRemoveConfirm(wxCommandEvent& event) - { - altSyncConfig.reset(); - refreshButtons(); - } - - -private: - void OnLocalFilterCfgRemove(wxCommandEvent& event) - { - const int menuId = 1234; - contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(menuId, _("Clear filter settings")); - contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfgRemoveConfirm), NULL, this); - - if (NameFilter(localFilter.includeFilter, localFilter.excludeFilter).isNull()) - contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway - - basicPanel_.PopupMenu(contextMenu.get()); //show context menu - } - - void OnAltSyncCfgRemove(wxCommandEvent& event) - { - const int menuId = 1234; - contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(menuId, _("Remove alternate settings")); - contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfgRemoveConfirm), NULL, this); - - if (!altSyncConfig.get()) - contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway - - basicPanel_.PopupMenu(contextMenu.get()); //show context menu - } - - virtual MainConfiguration getMainConfig() const = 0; - virtual wxWindow* getParentWindow() = 0; - - virtual void OnAltSyncCfgChange() {}; - - void OnAltSyncCfg(wxCommandEvent& event) - { - const MainConfiguration mainCfg = getMainConfig(); - const AlternateSyncConfig syncConfigMain(mainCfg.syncConfiguration, - mainCfg.handleDeletion, - mainCfg.customDeletionDirectory); - - AlternateSyncConfig altSyncCfg = altSyncConfig.get() ? *altSyncConfig : syncConfigMain; - SyncCfgDialog* syncDlg = new SyncCfgDialog(getParentWindow(), - mainCfg.compareVar, - altSyncCfg.syncConfiguration, - altSyncCfg.handleDeletion, - altSyncCfg.customDeletionDirectory, - NULL); - if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_APPLY) - { - altSyncConfig.reset(new AlternateSyncConfig(altSyncCfg)); - refreshButtons(); - - OnAltSyncCfgChange(); - } - } - - virtual void OnLocalFilterCfgChange() {}; - - void OnLocalFilterCfg(wxCommandEvent& event) - { - FilterConfig localFiltTmp = localFilter; - - if (showFilterDialog(false, //is local filter dialog - localFiltTmp.includeFilter, - localFiltTmp.excludeFilter) == DefaultReturnCode::BUTTON_OKAY) - { - localFilter = localFiltTmp; - refreshButtons(); - - OnLocalFilterCfgChange(); - } - } - - GuiPanel& basicPanel_; //panel to be enhanced by this template - - //alternate configuration attached to it - AltSyncCfgPtr altSyncConfig; //optional: present if non-NULL - FilterConfig localFilter; - - std::auto_ptr contextMenu; -}; -} - - -#endif // FOLDERPAIR_H_INCLUDED - - diff --git a/ui/folder_pair.h b/ui/folder_pair.h new file mode 100644 index 00000000..27f3ab29 --- /dev/null +++ b/ui/folder_pair.h @@ -0,0 +1,206 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef FOLDERPAIR_H_INCLUDED +#define FOLDERPAIR_H_INCLUDED + +#include "../structures.h" +#include "../shared/drag_n_drop.h" +#include "../library/resources.h" +#include "small_dlgs.h" +#include "sync_cfg.h" +#include +#include "is_null_filter.h" +#include "../shared/util.h" +#include "../shared/string_conv.h" + +namespace ffs3 +{ +//basic functionality for handling alternate folder pair configuration: change sync-cfg/filter cfg, right-click context menu, button icons... + +template +class FolderPairPanelBasic : private wxEvtHandler +{ +public: + typedef boost::shared_ptr AltSyncCfgPtr; + + + Zstring getLeftDir() const + { + return wxToZ(basicPanel_.m_directoryLeft->GetValue()); + } + + Zstring getRightDir() const + { + return wxToZ(basicPanel_.m_directoryRight->GetValue()); + } + + AltSyncCfgPtr getAltSyncConfig() const + { + return altSyncConfig; + } + + FilterConfig getAltFilterConfig() const + { + return localFilter; + } + + void setValues(const Zstring& leftDir, + const Zstring& rightDir, + AltSyncCfgPtr syncCfg, + const FilterConfig& filter) + { + altSyncConfig = syncCfg; + localFilter = filter; + + //insert directory names + ffs3::setDirectoryName(zToWx(leftDir), basicPanel_.m_directoryLeft, basicPanel_.m_dirPickerLeft); + ffs3::setDirectoryName(zToWx(rightDir), basicPanel_.m_directoryRight, basicPanel_.m_dirPickerRight); + + refreshButtons(); + } + + + void refreshButtons() + { + if (altSyncConfig.get()) + { + basicPanel_.m_bpButtonAltSyncCfg->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfigSmall"))); + basicPanel_.m_bpButtonAltSyncCfg->SetToolTip(wxString(_("Select alternate synchronization settings")) + wxT(" ") + common::LINE_BREAK + + wxT("(") + getVariantName(altSyncConfig->syncConfiguration) + wxT(")")); + } + else + { + basicPanel_.m_bpButtonAltSyncCfg->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfigSmallGrey"))); + basicPanel_.m_bpButtonAltSyncCfg->SetToolTip(_("Select alternate synchronization settings")); + } + + //test for Null-filter + if (isNullFilter(localFilter)) + { + basicPanel_.m_bpButtonLocalFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterSmallGrey"))); + basicPanel_.m_bpButtonLocalFilter->SetToolTip(_("No filter selected")); + } + else + { + basicPanel_.m_bpButtonLocalFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterSmall"))); + basicPanel_.m_bpButtonLocalFilter->SetToolTip(_("Filter is active")); + } + } + +protected: + FolderPairPanelBasic(GuiPanel& basicPanel) : //takes reference on basic panel to be enhanced + basicPanel_(basicPanel) + { + //register events for removal of alternate configuration + basicPanel_.m_bpButtonAltSyncCfg->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfgRemove), NULL, this); + basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfgRemove), NULL, this); + + basicPanel_.m_bpButtonAltSyncCfg-> Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfg), NULL, this); + basicPanel_.m_bpButtonLocalFilter->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfg), NULL, this); + + basicPanel_.m_bpButtonRemovePair->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("removeFolderPair"))); + } + + virtual void OnLocalFilterCfgRemoveConfirm(wxCommandEvent& event) + { + localFilter = FilterConfig(); + refreshButtons(); + } + + virtual void OnAltSyncCfgRemoveConfirm(wxCommandEvent& event) + { + altSyncConfig.reset(); + refreshButtons(); + } + + +private: + void OnLocalFilterCfgRemove(wxCommandEvent& event) + { + const int menuId = 1234; + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(menuId, _("Clear filter settings")); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FolderPairPanelBasic::OnLocalFilterCfgRemoveConfirm), NULL, this); + + if (NameFilter(localFilter.includeFilter, localFilter.excludeFilter).isNull()) + contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway + + basicPanel_.PopupMenu(contextMenu.get()); //show context menu + } + + void OnAltSyncCfgRemove(wxCommandEvent& event) + { + const int menuId = 1234; + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(menuId, _("Remove alternate settings")); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(FolderPairPanelBasic::OnAltSyncCfgRemoveConfirm), NULL, this); + + if (!altSyncConfig.get()) + contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway + + basicPanel_.PopupMenu(contextMenu.get()); //show context menu + } + + virtual MainConfiguration getMainConfig() const = 0; + virtual wxWindow* getParentWindow() = 0; + + virtual void OnAltSyncCfgChange() {}; + + void OnAltSyncCfg(wxCommandEvent& event) + { + const MainConfiguration mainCfg = getMainConfig(); + const AlternateSyncConfig syncConfigMain(mainCfg.syncConfiguration, + mainCfg.handleDeletion, + mainCfg.customDeletionDirectory); + + AlternateSyncConfig altSyncCfg = altSyncConfig.get() ? *altSyncConfig : syncConfigMain; + SyncCfgDialog* syncDlg = new SyncCfgDialog(getParentWindow(), + mainCfg.compareVar, + altSyncCfg.syncConfiguration, + altSyncCfg.handleDeletion, + altSyncCfg.customDeletionDirectory, + NULL); + if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_APPLY) + { + altSyncConfig.reset(new AlternateSyncConfig(altSyncCfg)); + refreshButtons(); + + OnAltSyncCfgChange(); + } + } + + virtual void OnLocalFilterCfgChange() {}; + + void OnLocalFilterCfg(wxCommandEvent& event) + { + FilterConfig localFiltTmp = localFilter; + + if (showFilterDialog(false, //is local filter dialog + localFiltTmp.includeFilter, + localFiltTmp.excludeFilter) == DefaultReturnCode::BUTTON_OKAY) + { + localFilter = localFiltTmp; + refreshButtons(); + + OnLocalFilterCfgChange(); + } + } + + GuiPanel& basicPanel_; //panel to be enhanced by this template + + //alternate configuration attached to it + AltSyncCfgPtr altSyncConfig; //optional: present if non-NULL + FilterConfig localFilter; + + std::auto_ptr contextMenu; +}; +} + + +#endif // FOLDERPAIR_H_INCLUDED + + diff --git a/ui/gridView.cpp b/ui/gridView.cpp deleted file mode 100644 index b3b1f2ae..00000000 --- a/ui/gridView.cpp +++ /dev/null @@ -1,570 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "gridView.h" -#include "sorting.h" -#include "../synchronization.h" -#include - -using namespace FreeFileSync; - - -GridView::StatusCmpResult::StatusCmpResult() : - existsLeftOnly(false), - existsRightOnly(false), - existsLeftNewer(false), - existsRightNewer(false), - existsDifferent(false), - existsEqual(false), - existsConflict(false), - - filesOnLeftView(0), - foldersOnLeftView(0), - filesOnRightView(0), - foldersOnRightView(0) {} - - -template -void getNumbers(const FileSystemObject& fsObj, StatusResult& result) -{ - struct GetValues : public FSObjectVisitor - { - GetValues(StatusResult& res) : result_(res) {} - - virtual void visit(const FileMapping& fileObj) - { - if (!fileObj.isEmpty()) - { - result_.filesizeLeftView += fileObj.getFileSize(); - ++result_.filesOnLeftView; - } - if (!fileObj.isEmpty()) - { - result_.filesizeRightView += fileObj.getFileSize(); - ++result_.filesOnRightView; - } - } - - virtual void visit(const SymLinkMapping& linkObj) - { - if (!linkObj.isEmpty()) - ++result_.filesOnLeftView; - - if (!linkObj.isEmpty()) - ++result_.filesOnRightView; - } - - virtual void visit(const DirMapping& dirObj) - { - if (!dirObj.isEmpty()) - ++result_.foldersOnLeftView; - - if (!dirObj.isEmpty()) - ++result_.foldersOnRightView; - } - StatusResult& result_; - } getVal(result); - fsObj.accept(getVal); -} - - -GridView::StatusCmpResult GridView::updateCmpResult(bool hideFiltered, //maps sortedRef to viewRef - bool leftOnlyFilesActive, - bool rightOnlyFilesActive, - bool leftNewerFilesActive, - bool rightNewerFilesActive, - bool differentFilesActive, - bool equalFilesActive, - bool conflictFilesActive) -{ - StatusCmpResult output; - - viewRef.clear(); - - for (std::vector::const_iterator j = sortedRef.begin(); j != sortedRef.end(); ++j) - { - const FileSystemObject* fsObj = getReferencedRow(*j); - if (fsObj) - { - //hide filtered row, if corresponding option is set - if (hideFiltered && !fsObj->isActive()) - continue; - - switch (fsObj->getCategory()) - { - case FILE_LEFT_SIDE_ONLY: - output.existsLeftOnly = true; - if (!leftOnlyFilesActive) continue; - break; - case FILE_RIGHT_SIDE_ONLY: - output.existsRightOnly = true; - if (!rightOnlyFilesActive) continue; - break; - case FILE_LEFT_NEWER: - output.existsLeftNewer = true; - if (!leftNewerFilesActive) continue; - break; - case FILE_RIGHT_NEWER: - output.existsRightNewer = true; - if (!rightNewerFilesActive) continue; - break; - case FILE_DIFFERENT: - output.existsDifferent = true; - if (!differentFilesActive) continue; - break; - case FILE_EQUAL: - output.existsEqual = true; - if (!equalFilesActive) continue; - break; - case FILE_CONFLICT: - output.existsConflict = true; - if (!conflictFilesActive) continue; - break; - } - - //calculate total number of bytes for each side - getNumbers(*fsObj, output); - - viewRef.push_back(*j); - } - } - - return output; -} - - -GridView::StatusSyncPreview::StatusSyncPreview() : - existsSyncCreateLeft(false), - existsSyncCreateRight(false), - existsSyncDeleteLeft(false), - existsSyncDeleteRight(false), - existsSyncDirLeft(false), - existsSyncDirRight(false), - existsSyncDirNone(false), - existsSyncEqual(false), - existsConflict(false), - - filesOnLeftView(0), - foldersOnLeftView(0), - filesOnRightView(0), - foldersOnRightView(0) {} - - -GridView::StatusSyncPreview GridView::updateSyncPreview(bool hideFiltered, //maps sortedRef to viewRef - bool syncCreateLeftActive, - bool syncCreateRightActive, - bool syncDeleteLeftActive, - bool syncDeleteRightActive, - bool syncDirOverwLeftActive, - bool syncDirOverwRightActive, - bool syncDirNoneActive, - bool syncEqualActive, - bool conflictFilesActive) -{ - StatusSyncPreview output; - - viewRef.clear(); - - for (std::vector::const_iterator j = sortedRef.begin(); j != sortedRef.end(); ++j) - { - const FileSystemObject* fsObj = getReferencedRow(*j); - if (fsObj) - { - //hide filtered row, if corresponding option is set - if (hideFiltered && !fsObj->isActive()) - continue; - - - switch (fsObj->getSyncOperation()) //evaluate comparison result and sync direction - { - case SO_CREATE_NEW_LEFT: - output.existsSyncCreateLeft = true; - if (!syncCreateLeftActive) continue; - break; - case SO_CREATE_NEW_RIGHT: - output.existsSyncCreateRight = true; - if (!syncCreateRightActive) continue; - break; - case SO_DELETE_LEFT: - output.existsSyncDeleteLeft = true; - if (!syncDeleteLeftActive) continue; - break; - case SO_DELETE_RIGHT: - output.existsSyncDeleteRight = true; - if (!syncDeleteRightActive) continue; - break; - case SO_OVERWRITE_RIGHT: - output.existsSyncDirRight = true; - if (!syncDirOverwRightActive) continue; - break; - case SO_OVERWRITE_LEFT: - output.existsSyncDirLeft = true; - if (!syncDirOverwLeftActive) continue; - break; - case SO_DO_NOTHING: - output.existsSyncDirNone = true; - if (!syncDirNoneActive) continue; - break; - case SO_EQUAL: - output.existsSyncEqual = true; - if (!syncEqualActive) continue; - break; - case SO_UNRESOLVED_CONFLICT: - output.existsConflict = true; - if (!conflictFilesActive) continue; - break; - } - - //calculate total number of bytes for each side - getNumbers(*fsObj, output); - - viewRef.push_back(*j); - } - } - - return output; -} - - -void GridView::getAllFileRef(const std::set& guiRows, std::vector& output) -{ - std::set::const_iterator upperEnd = guiRows.lower_bound(rowsOnView()); //loop over valid rows only! - - output.clear(); - output.reserve(guiRows.size()); - for (std::set::const_iterator i = guiRows.begin(); i != upperEnd; ++i) - { - FileSystemObject* fsObj = getReferencedRow(viewRef[*i]); - if (fsObj) - output.push_back(fsObj); - } -} - - -inline -bool GridView::isInvalidRow(const RefIndex& ref) const -{ - return getReferencedRow(ref) == NULL; -} - - -void GridView::removeInvalidRows() -{ - viewRef.clear(); - - //remove rows that have been deleted meanwhile - sortedRef.erase(std::remove_if(sortedRef.begin(), sortedRef.end(), - boost::bind(&GridView::isInvalidRow, this, _1)), sortedRef.end()); -} - - -void GridView::clearAllRows() -{ - viewRef.clear(); - sortedRef.clear(); - folderCmp.clear(); -} - - -class GridView::SerializeHierarchy -{ -public: - SerializeHierarchy(std::vector& sortedRef, size_t index) : - index_(index), - sortedRef_(sortedRef) {} - - void execute(const HierarchyObject& hierObj) - { - //add file references - std::for_each(hierObj.useSubFiles().begin(), hierObj.useSubFiles().end(), *this); - - //add symlink references - std::for_each(hierObj.useSubLinks().begin(), hierObj.useSubLinks().end(), *this); - - //add dir references - std::for_each(hierObj.useSubDirs().begin(), hierObj.useSubDirs().end(), *this); - } - - void operator()(const FileMapping& fileObj) - { - sortedRef_.push_back(RefIndex(index_, fileObj.getId())); - } - - void operator()(const SymLinkMapping& linkObj) - { - sortedRef_.push_back(RefIndex(index_, linkObj.getId())); - } - - void operator()(const DirMapping& dirObj) - { - sortedRef_.push_back(RefIndex(index_, dirObj.getId())); - execute(dirObj); //add recursion here to list sub-objects directly below parent! - } - -private: - size_t index_; - std::vector& sortedRef_; -}; - - -void GridView::setData(FolderComparison& newData) -{ - viewRef.clear(); - sortedRef.clear(); - folderCmp.swap(newData); - - //fill sortedRef - for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) - SerializeHierarchy(sortedRef, j - folderCmp.begin()).execute(*j); -} - - -//------------------------------------ SORTING TEMPLATES ------------------------------------------------ -template -class GridView::SortByDirectory : public std::binary_function -{ -public: - bool operator()(const RefIndex a, const RefIndex b) const - { - return ascending ? - a.folderIndex < b.folderIndex : - a.folderIndex > b.folderIndex; - } -}; - - -template -class GridView::SortByRelName : public std::binary_function -{ -public: - SortByRelName(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - //presort by folder pair - if (a.folderIndex != b.folderIndex) - return ascending ? - a.folderIndex < b.folderIndex : - a.folderIndex > b.folderIndex; - - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortByRelativeName(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - - -template -class GridView::SortByFileName : public std::binary_function -{ -public: - SortByFileName(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortByFileName(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - - -template -class GridView::SortByFileSize : public std::binary_function -{ -public: - SortByFileSize(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortByFileSize(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - - -template -class GridView::SortByDate : public std::binary_function -{ -public: - SortByDate(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortByDate(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - - -template -class GridView::SortByExtension : public std::binary_function -{ -public: - SortByExtension(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortByExtension(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - - -template -class GridView::SortByCmpResult : public std::binary_function -{ -public: - SortByCmpResult(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortByCmpResult(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - - -template -class GridView::SortBySyncDirection : public std::binary_function -{ -public: - SortBySyncDirection(const GridView& view) : m_view(view) {} - - bool operator()(const RefIndex a, const RefIndex b) const - { - const FileSystemObject* fsObjA = m_view.getReferencedRow(a); - const FileSystemObject* fsObjB = m_view.getReferencedRow(b); - if (fsObjA == NULL) //invalid rows shall appear at the end - return false; - else if (fsObjB == NULL) - return true; - - return sortBySyncDirection(*fsObjA, *fsObjB); - } -private: - const GridView& m_view; -}; - -//------------------------------------------------------------------------------------------------------- -bool GridView::getDefaultDirection(SortType type) //true: ascending; false: descending -{ - switch (type) - { - case SORT_BY_FILESIZE: - case SORT_BY_DATE: - return false; - - case SORT_BY_REL_NAME: - case SORT_BY_FILENAME: - case SORT_BY_EXTENSION: - case SORT_BY_CMP_RESULT: - case SORT_BY_DIRECTORY: - case SORT_BY_SYNC_DIRECTION: - return true; - } - assert(false); - return true; -} - - -void GridView::sortView(SortType type, bool onLeft, bool ascending) -{ - viewRef.clear(); - - switch (type) - { - case SORT_BY_REL_NAME: - if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); - else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); - else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); - else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); - break; - case SORT_BY_FILENAME: - if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); - else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); - else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); - else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); - break; - case SORT_BY_FILESIZE: - if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); - else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); - else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); - else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); - break; - case SORT_BY_DATE: - if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); - else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); - else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); - else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); - break; - case SORT_BY_EXTENSION: - if ( ascending && onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); - else if ( ascending && !onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); - else if (!ascending && onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); - else if (!ascending && !onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); - break; - case SORT_BY_CMP_RESULT: - if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByCmpResult(*this)); - else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByCmpResult(*this)); - break; - case SORT_BY_SYNC_DIRECTION: - if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortBySyncDirection(*this)); - else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortBySyncDirection(*this)); - break; - case SORT_BY_DIRECTORY: - if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByDirectory()); - else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByDirectory()); - break; - } -} - diff --git a/ui/gridView.h b/ui/gridView.h deleted file mode 100644 index c0639d2e..00000000 --- a/ui/gridView.h +++ /dev/null @@ -1,237 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef GRIDVIEW_H_INCLUDED -#define GRIDVIEW_H_INCLUDED - -#include "../fileHierarchy.h" - - -namespace FreeFileSync -{ -//gui view of FolderComparison -class GridView -{ -public: - //direct data access via row number - const FileSystemObject* getObject(size_t row) const; //returns NULL if object is not found; logarithmic complexity - FileSystemObject* getObject(size_t row); // - size_t rowsOnView() const; //only the currently visible elements - size_t rowsTotal() const; //total number of rows available - - //get references to FileSystemObject: no NULL-check needed! Everything's bound. - void getAllFileRef(const std::set& guiRows, std::vector& output); - - struct StatusCmpResult - { - StatusCmpResult(); - - bool existsLeftOnly; - bool existsRightOnly; - bool existsLeftNewer; - bool existsRightNewer; - bool existsDifferent; - bool existsEqual; - bool existsConflict; - - unsigned int filesOnLeftView; - unsigned int foldersOnLeftView; - unsigned int filesOnRightView; - unsigned int foldersOnRightView; - - wxULongLong filesizeLeftView; - wxULongLong filesizeRightView; - }; - - //comparison results view - StatusCmpResult updateCmpResult(bool hideFiltered, - bool leftOnlyFilesActive, - bool rightOnlyFilesActive, - bool leftNewerFilesActive, - bool rightNewerFilesActive, - bool differentFilesActive, - bool equalFilesActive, - bool conflictFilesActive); - - struct StatusSyncPreview - { - StatusSyncPreview(); - - bool existsSyncCreateLeft; - bool existsSyncCreateRight; - bool existsSyncDeleteLeft; - bool existsSyncDeleteRight; - bool existsSyncDirLeft; - bool existsSyncDirRight; - bool existsSyncDirNone; - bool existsSyncEqual; - bool existsConflict; - - unsigned int filesOnLeftView; - unsigned int foldersOnLeftView; - unsigned int filesOnRightView; - unsigned int foldersOnRightView; - - wxULongLong filesizeLeftView; - wxULongLong filesizeRightView; - }; - - //synchronization preview - StatusSyncPreview updateSyncPreview(bool hideFiltered, - bool syncCreateLeftActive, - bool syncCreateRightActive, - bool syncDeleteLeftActive, - bool syncDeleteRightActive, - bool syncDirOverwLeftActive, - bool syncDirOverwRightActive, - bool syncDirNoneActive, - bool syncEqualActive, - bool conflictFilesActive); - - - - FolderComparison& getDataTentative(); //get data for operation that does NOT add or reorder rows! (deletion is okay) - void setData(FolderComparison& newData); //set data, taking ownership: warning std::swap() is used!!! - void removeInvalidRows(); //remove rows that have been deleted meanwhile: call after manual deletion and synchronization! - void clearAllRows(); //clears everything - - //sorting... - enum SortType - { - SORT_BY_REL_NAME, - SORT_BY_FILENAME, - SORT_BY_FILESIZE, - SORT_BY_DATE, - SORT_BY_EXTENSION, - SORT_BY_CMP_RESULT, - SORT_BY_DIRECTORY, - SORT_BY_SYNC_DIRECTION - }; - - bool static getDefaultDirection(SortType type); //true: ascending; false: descending - - void sortView(SortType type, bool onLeft, bool ascending); //always call this method for sorting, never sort externally! - -private: - class SerializeHierarchy; - - struct RefIndex - { - RefIndex(size_t folderInd, HierarchyObject::ObjectID id) : - folderIndex(folderInd), - objId(id) {} - size_t folderIndex; - HierarchyObject::ObjectID objId; - }; - - FileSystemObject* getReferencedRow(const RefIndex ref); //returns NULL if not found - const FileSystemObject* getReferencedRow(const RefIndex ref) const; //returns NULL if not found - bool isInvalidRow(const RefIndex& ref) const; - - - std::vector viewRef; //partial view on sortedRef - // | - // | (update...) - // \|/ - std::vector sortedRef; //equivalent to folderCmp, but may be sorted - // | - // | (setData) - // \|/ - FolderComparison folderCmp; //actual comparison data: owned by GridView! - - - //sorting classes - template - class SortByDirectory; - - template - class SortByRelName; - - template - class SortByFileName; - - template - class SortByFileSize; - - template - class SortByDate; - - template - class SortByExtension; - - template - class SortByCmpResult; - - template - class SortBySyncDirection; -}; - - - - - - - - - - -//############################################################################ -//inline implementation - -inline -const FileSystemObject* GridView::getObject(size_t row) const -{ - if (row < rowsOnView()) - return getReferencedRow(viewRef[row]); - else - return NULL; -} - -inline -FileSystemObject* GridView::getObject(size_t row) -{ - //code re-use of const method: see Meyers Effective C++ - return const_cast(static_cast(*this).getObject(row)); -} - - -inline -size_t GridView::rowsOnView() const -{ - return viewRef.size(); -} - - -inline -FolderComparison& GridView::getDataTentative() -{ - return folderCmp; -} - -inline -size_t GridView::rowsTotal() const //total number of rows available -{ - return sortedRef.size(); -} - - -inline -const FreeFileSync::FileSystemObject* GridView::getReferencedRow(const RefIndex ref) const -{ - return folderCmp[ref.folderIndex].retrieveById(ref.objId); -} - - -inline -FreeFileSync::FileSystemObject* GridView::getReferencedRow(const RefIndex ref) -{ - //code re-use of const method: see Meyers Effective C++ - return const_cast(static_cast(*this).getReferencedRow(ref)); -} -} - - -#endif // GRIDVIEW_H_INCLUDED diff --git a/ui/grid_view.cpp b/ui/grid_view.cpp new file mode 100644 index 00000000..24e558fc --- /dev/null +++ b/ui/grid_view.cpp @@ -0,0 +1,570 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "grid_view.h" +#include "sorting.h" +#include "../synchronization.h" +#include + +using namespace ffs3; + + +GridView::StatusCmpResult::StatusCmpResult() : + existsLeftOnly(false), + existsRightOnly(false), + existsLeftNewer(false), + existsRightNewer(false), + existsDifferent(false), + existsEqual(false), + existsConflict(false), + + filesOnLeftView(0), + foldersOnLeftView(0), + filesOnRightView(0), + foldersOnRightView(0) {} + + +template +void getNumbers(const FileSystemObject& fsObj, StatusResult& result) +{ + struct GetValues : public FSObjectVisitor + { + GetValues(StatusResult& res) : result_(res) {} + + virtual void visit(const FileMapping& fileObj) + { + if (!fileObj.isEmpty()) + { + result_.filesizeLeftView += fileObj.getFileSize(); + ++result_.filesOnLeftView; + } + if (!fileObj.isEmpty()) + { + result_.filesizeRightView += fileObj.getFileSize(); + ++result_.filesOnRightView; + } + } + + virtual void visit(const SymLinkMapping& linkObj) + { + if (!linkObj.isEmpty()) + ++result_.filesOnLeftView; + + if (!linkObj.isEmpty()) + ++result_.filesOnRightView; + } + + virtual void visit(const DirMapping& dirObj) + { + if (!dirObj.isEmpty()) + ++result_.foldersOnLeftView; + + if (!dirObj.isEmpty()) + ++result_.foldersOnRightView; + } + StatusResult& result_; + } getVal(result); + fsObj.accept(getVal); +} + + +GridView::StatusCmpResult GridView::updateCmpResult(bool hideFiltered, //maps sortedRef to viewRef + bool leftOnlyFilesActive, + bool rightOnlyFilesActive, + bool leftNewerFilesActive, + bool rightNewerFilesActive, + bool differentFilesActive, + bool equalFilesActive, + bool conflictFilesActive) +{ + StatusCmpResult output; + + viewRef.clear(); + + for (std::vector::const_iterator j = sortedRef.begin(); j != sortedRef.end(); ++j) + { + const FileSystemObject* fsObj = getReferencedRow(*j); + if (fsObj) + { + //hide filtered row, if corresponding option is set + if (hideFiltered && !fsObj->isActive()) + continue; + + switch (fsObj->getCategory()) + { + case FILE_LEFT_SIDE_ONLY: + output.existsLeftOnly = true; + if (!leftOnlyFilesActive) continue; + break; + case FILE_RIGHT_SIDE_ONLY: + output.existsRightOnly = true; + if (!rightOnlyFilesActive) continue; + break; + case FILE_LEFT_NEWER: + output.existsLeftNewer = true; + if (!leftNewerFilesActive) continue; + break; + case FILE_RIGHT_NEWER: + output.existsRightNewer = true; + if (!rightNewerFilesActive) continue; + break; + case FILE_DIFFERENT: + output.existsDifferent = true; + if (!differentFilesActive) continue; + break; + case FILE_EQUAL: + output.existsEqual = true; + if (!equalFilesActive) continue; + break; + case FILE_CONFLICT: + output.existsConflict = true; + if (!conflictFilesActive) continue; + break; + } + + //calculate total number of bytes for each side + getNumbers(*fsObj, output); + + viewRef.push_back(*j); + } + } + + return output; +} + + +GridView::StatusSyncPreview::StatusSyncPreview() : + existsSyncCreateLeft(false), + existsSyncCreateRight(false), + existsSyncDeleteLeft(false), + existsSyncDeleteRight(false), + existsSyncDirLeft(false), + existsSyncDirRight(false), + existsSyncDirNone(false), + existsSyncEqual(false), + existsConflict(false), + + filesOnLeftView(0), + foldersOnLeftView(0), + filesOnRightView(0), + foldersOnRightView(0) {} + + +GridView::StatusSyncPreview GridView::updateSyncPreview(bool hideFiltered, //maps sortedRef to viewRef + bool syncCreateLeftActive, + bool syncCreateRightActive, + bool syncDeleteLeftActive, + bool syncDeleteRightActive, + bool syncDirOverwLeftActive, + bool syncDirOverwRightActive, + bool syncDirNoneActive, + bool syncEqualActive, + bool conflictFilesActive) +{ + StatusSyncPreview output; + + viewRef.clear(); + + for (std::vector::const_iterator j = sortedRef.begin(); j != sortedRef.end(); ++j) + { + const FileSystemObject* fsObj = getReferencedRow(*j); + if (fsObj) + { + //hide filtered row, if corresponding option is set + if (hideFiltered && !fsObj->isActive()) + continue; + + + switch (fsObj->getSyncOperation()) //evaluate comparison result and sync direction + { + case SO_CREATE_NEW_LEFT: + output.existsSyncCreateLeft = true; + if (!syncCreateLeftActive) continue; + break; + case SO_CREATE_NEW_RIGHT: + output.existsSyncCreateRight = true; + if (!syncCreateRightActive) continue; + break; + case SO_DELETE_LEFT: + output.existsSyncDeleteLeft = true; + if (!syncDeleteLeftActive) continue; + break; + case SO_DELETE_RIGHT: + output.existsSyncDeleteRight = true; + if (!syncDeleteRightActive) continue; + break; + case SO_OVERWRITE_RIGHT: + output.existsSyncDirRight = true; + if (!syncDirOverwRightActive) continue; + break; + case SO_OVERWRITE_LEFT: + output.existsSyncDirLeft = true; + if (!syncDirOverwLeftActive) continue; + break; + case SO_DO_NOTHING: + output.existsSyncDirNone = true; + if (!syncDirNoneActive) continue; + break; + case SO_EQUAL: + output.existsSyncEqual = true; + if (!syncEqualActive) continue; + break; + case SO_UNRESOLVED_CONFLICT: + output.existsConflict = true; + if (!conflictFilesActive) continue; + break; + } + + //calculate total number of bytes for each side + getNumbers(*fsObj, output); + + viewRef.push_back(*j); + } + } + + return output; +} + + +void GridView::getAllFileRef(const std::set& guiRows, std::vector& output) +{ + std::set::const_iterator upperEnd = guiRows.lower_bound(rowsOnView()); //loop over valid rows only! + + output.clear(); + output.reserve(guiRows.size()); + for (std::set::const_iterator i = guiRows.begin(); i != upperEnd; ++i) + { + FileSystemObject* fsObj = getReferencedRow(viewRef[*i]); + if (fsObj) + output.push_back(fsObj); + } +} + + +inline +bool GridView::isInvalidRow(const RefIndex& ref) const +{ + return getReferencedRow(ref) == NULL; +} + + +void GridView::removeInvalidRows() +{ + viewRef.clear(); + + //remove rows that have been deleted meanwhile + sortedRef.erase(std::remove_if(sortedRef.begin(), sortedRef.end(), + boost::bind(&GridView::isInvalidRow, this, _1)), sortedRef.end()); +} + + +void GridView::clearAllRows() +{ + viewRef.clear(); + sortedRef.clear(); + folderCmp.clear(); +} + + +class GridView::SerializeHierarchy +{ +public: + SerializeHierarchy(std::vector& sortedRef, size_t index) : + index_(index), + sortedRef_(sortedRef) {} + + void execute(const HierarchyObject& hierObj) + { + //add file references + std::for_each(hierObj.useSubFiles().begin(), hierObj.useSubFiles().end(), *this); + + //add symlink references + std::for_each(hierObj.useSubLinks().begin(), hierObj.useSubLinks().end(), *this); + + //add dir references + std::for_each(hierObj.useSubDirs().begin(), hierObj.useSubDirs().end(), *this); + } + + void operator()(const FileMapping& fileObj) + { + sortedRef_.push_back(RefIndex(index_, fileObj.getId())); + } + + void operator()(const SymLinkMapping& linkObj) + { + sortedRef_.push_back(RefIndex(index_, linkObj.getId())); + } + + void operator()(const DirMapping& dirObj) + { + sortedRef_.push_back(RefIndex(index_, dirObj.getId())); + execute(dirObj); //add recursion here to list sub-objects directly below parent! + } + +private: + size_t index_; + std::vector& sortedRef_; +}; + + +void GridView::setData(FolderComparison& newData) +{ + viewRef.clear(); + sortedRef.clear(); + folderCmp.swap(newData); + + //fill sortedRef + for (FolderComparison::const_iterator j = folderCmp.begin(); j != folderCmp.end(); ++j) + SerializeHierarchy(sortedRef, j - folderCmp.begin()).execute(*j); +} + + +//------------------------------------ SORTING TEMPLATES ------------------------------------------------ +template +class GridView::SortByDirectory : public std::binary_function +{ +public: + bool operator()(const RefIndex a, const RefIndex b) const + { + return ascending ? + a.folderIndex < b.folderIndex : + a.folderIndex > b.folderIndex; + } +}; + + +template +class GridView::SortByRelName : public std::binary_function +{ +public: + SortByRelName(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + //presort by folder pair + if (a.folderIndex != b.folderIndex) + return ascending ? + a.folderIndex < b.folderIndex : + a.folderIndex > b.folderIndex; + + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortByRelativeName(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + + +template +class GridView::SortByFileName : public std::binary_function +{ +public: + SortByFileName(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortByFileName(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + + +template +class GridView::SortByFileSize : public std::binary_function +{ +public: + SortByFileSize(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortByFileSize(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + + +template +class GridView::SortByDate : public std::binary_function +{ +public: + SortByDate(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortByDate(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + + +template +class GridView::SortByExtension : public std::binary_function +{ +public: + SortByExtension(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortByExtension(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + + +template +class GridView::SortByCmpResult : public std::binary_function +{ +public: + SortByCmpResult(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortByCmpResult(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + + +template +class GridView::SortBySyncDirection : public std::binary_function +{ +public: + SortBySyncDirection(const GridView& view) : m_view(view) {} + + bool operator()(const RefIndex a, const RefIndex b) const + { + const FileSystemObject* fsObjA = m_view.getReferencedRow(a); + const FileSystemObject* fsObjB = m_view.getReferencedRow(b); + if (fsObjA == NULL) //invalid rows shall appear at the end + return false; + else if (fsObjB == NULL) + return true; + + return sortBySyncDirection(*fsObjA, *fsObjB); + } +private: + const GridView& m_view; +}; + +//------------------------------------------------------------------------------------------------------- +bool GridView::getDefaultDirection(SortType type) //true: ascending; false: descending +{ + switch (type) + { + case SORT_BY_FILESIZE: + case SORT_BY_DATE: + return false; + + case SORT_BY_REL_NAME: + case SORT_BY_FILENAME: + case SORT_BY_EXTENSION: + case SORT_BY_CMP_RESULT: + case SORT_BY_DIRECTORY: + case SORT_BY_SYNC_DIRECTION: + return true; + } + assert(false); + return true; +} + + +void GridView::sortView(SortType type, bool onLeft, bool ascending) +{ + viewRef.clear(); + + switch (type) + { + case SORT_BY_REL_NAME: + if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); + else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); + else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); + else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByRelName(*this)); + break; + case SORT_BY_FILENAME: + if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); + else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); + else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); + else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileName(*this)); + break; + case SORT_BY_FILESIZE: + if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); + else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); + else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); + else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByFileSize(*this)); + break; + case SORT_BY_DATE: + if ( ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); + else if ( ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); + else if (!ascending && onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); + else if (!ascending && !onLeft) std::sort(sortedRef.begin(), sortedRef.end(), SortByDate(*this)); + break; + case SORT_BY_EXTENSION: + if ( ascending && onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); + else if ( ascending && !onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); + else if (!ascending && onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); + else if (!ascending && !onLeft) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByExtension(*this)); + break; + case SORT_BY_CMP_RESULT: + if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByCmpResult(*this)); + else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByCmpResult(*this)); + break; + case SORT_BY_SYNC_DIRECTION: + if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortBySyncDirection(*this)); + else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortBySyncDirection(*this)); + break; + case SORT_BY_DIRECTORY: + if ( ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByDirectory()); + else if (!ascending) std::stable_sort(sortedRef.begin(), sortedRef.end(), SortByDirectory()); + break; + } +} + diff --git a/ui/grid_view.h b/ui/grid_view.h new file mode 100644 index 00000000..0307d758 --- /dev/null +++ b/ui/grid_view.h @@ -0,0 +1,237 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef GRIDVIEW_H_INCLUDED +#define GRIDVIEW_H_INCLUDED + +#include "../file_hierarchy.h" + + +namespace ffs3 +{ +//gui view of FolderComparison +class GridView +{ +public: + //direct data access via row number + const FileSystemObject* getObject(size_t row) const; //returns NULL if object is not found; logarithmic complexity + FileSystemObject* getObject(size_t row); // + size_t rowsOnView() const; //only the currently visible elements + size_t rowsTotal() const; //total number of rows available + + //get references to FileSystemObject: no NULL-check needed! Everything's bound. + void getAllFileRef(const std::set& guiRows, std::vector& output); + + struct StatusCmpResult + { + StatusCmpResult(); + + bool existsLeftOnly; + bool existsRightOnly; + bool existsLeftNewer; + bool existsRightNewer; + bool existsDifferent; + bool existsEqual; + bool existsConflict; + + unsigned int filesOnLeftView; + unsigned int foldersOnLeftView; + unsigned int filesOnRightView; + unsigned int foldersOnRightView; + + wxULongLong filesizeLeftView; + wxULongLong filesizeRightView; + }; + + //comparison results view + StatusCmpResult updateCmpResult(bool hideFiltered, + bool leftOnlyFilesActive, + bool rightOnlyFilesActive, + bool leftNewerFilesActive, + bool rightNewerFilesActive, + bool differentFilesActive, + bool equalFilesActive, + bool conflictFilesActive); + + struct StatusSyncPreview + { + StatusSyncPreview(); + + bool existsSyncCreateLeft; + bool existsSyncCreateRight; + bool existsSyncDeleteLeft; + bool existsSyncDeleteRight; + bool existsSyncDirLeft; + bool existsSyncDirRight; + bool existsSyncDirNone; + bool existsSyncEqual; + bool existsConflict; + + unsigned int filesOnLeftView; + unsigned int foldersOnLeftView; + unsigned int filesOnRightView; + unsigned int foldersOnRightView; + + wxULongLong filesizeLeftView; + wxULongLong filesizeRightView; + }; + + //synchronization preview + StatusSyncPreview updateSyncPreview(bool hideFiltered, + bool syncCreateLeftActive, + bool syncCreateRightActive, + bool syncDeleteLeftActive, + bool syncDeleteRightActive, + bool syncDirOverwLeftActive, + bool syncDirOverwRightActive, + bool syncDirNoneActive, + bool syncEqualActive, + bool conflictFilesActive); + + + + FolderComparison& getDataTentative(); //get data for operation that does NOT add or reorder rows! (deletion is okay) + void setData(FolderComparison& newData); //set data, taking ownership: warning std::swap() is used!!! + void removeInvalidRows(); //remove rows that have been deleted meanwhile: call after manual deletion and synchronization! + void clearAllRows(); //clears everything + + //sorting... + enum SortType + { + SORT_BY_REL_NAME, + SORT_BY_FILENAME, + SORT_BY_FILESIZE, + SORT_BY_DATE, + SORT_BY_EXTENSION, + SORT_BY_CMP_RESULT, + SORT_BY_DIRECTORY, + SORT_BY_SYNC_DIRECTION + }; + + bool static getDefaultDirection(SortType type); //true: ascending; false: descending + + void sortView(SortType type, bool onLeft, bool ascending); //always call this method for sorting, never sort externally! + +private: + class SerializeHierarchy; + + struct RefIndex + { + RefIndex(size_t folderInd, HierarchyObject::ObjectID id) : + folderIndex(folderInd), + objId(id) {} + size_t folderIndex; + HierarchyObject::ObjectID objId; + }; + + FileSystemObject* getReferencedRow(const RefIndex ref); //returns NULL if not found + const FileSystemObject* getReferencedRow(const RefIndex ref) const; //returns NULL if not found + bool isInvalidRow(const RefIndex& ref) const; + + + std::vector viewRef; //partial view on sortedRef + // | + // | (update...) + // \|/ + std::vector sortedRef; //equivalent to folderCmp, but may be sorted + // | + // | (setData) + // \|/ + FolderComparison folderCmp; //actual comparison data: owned by GridView! + + + //sorting classes + template + class SortByDirectory; + + template + class SortByRelName; + + template + class SortByFileName; + + template + class SortByFileSize; + + template + class SortByDate; + + template + class SortByExtension; + + template + class SortByCmpResult; + + template + class SortBySyncDirection; +}; + + + + + + + + + + +//############################################################################ +//inline implementation + +inline +const FileSystemObject* GridView::getObject(size_t row) const +{ + if (row < rowsOnView()) + return getReferencedRow(viewRef[row]); + else + return NULL; +} + +inline +FileSystemObject* GridView::getObject(size_t row) +{ + //code re-use of const method: see Meyers Effective C++ + return const_cast(static_cast(*this).getObject(row)); +} + + +inline +size_t GridView::rowsOnView() const +{ + return viewRef.size(); +} + + +inline +FolderComparison& GridView::getDataTentative() +{ + return folderCmp; +} + +inline +size_t GridView::rowsTotal() const //total number of rows available +{ + return sortedRef.size(); +} + + +inline +const ffs3::FileSystemObject* GridView::getReferencedRow(const RefIndex ref) const +{ + return folderCmp[ref.folderIndex].retrieveById(ref.objId); +} + + +inline +ffs3::FileSystemObject* GridView::getReferencedRow(const RefIndex ref) +{ + //code re-use of const method: see Meyers Effective C++ + return const_cast(static_cast(*this).getReferencedRow(ref)); +} +} + + +#endif // GRIDVIEW_H_INCLUDED diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp deleted file mode 100644 index 920484ea..00000000 --- a/ui/guiGenerated.cpp +++ /dev/null @@ -1,3768 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#include "../library/customGrid.h" -#include "../shared/customButton.h" -#include "../shared/customComboBox.h" -#include "../shared/toggleButton.h" - -#include "guiGenerated.h" - -/////////////////////////////////////////////////////////////////////////// - -MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( 640,400 ), wxDefaultSize ); - - m_menubar1 = new wxMenuBar( 0 ); - m_menuFile = new wxMenu(); - m_menuItem10 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("1. &Compare") ) + wxT('\t') + wxT("ALT-C"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItem10 ); - - m_menuItem11 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("2. &Synchronize...") ) + wxT('\t') + wxT("ALT-S"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItem11 ); - - m_menuFile->AppendSeparator(); - - m_menuItemSwitchView = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&witch view") ) + wxT('\t') + wxT("ALT-W"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemSwitchView ); - - m_menuFile->AppendSeparator(); - - m_menuItemNew = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&New") ) + wxT('\t') + wxT("CTRL-N"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemNew ); - - m_menuItemSave = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&ave configuration...") ) + wxT('\t') + wxT("CTRL-S"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemSave ); - - m_menuItemLoad = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&Load configuration...") ) + wxT('\t') + wxT("CTRL-L"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItemLoad ); - - m_menuFile->AppendSeparator(); - - wxMenuItem* m_menuItem4; - m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("CTRL-Q"), wxEmptyString, wxITEM_NORMAL ); - m_menuFile->Append( m_menuItem4 ); - - m_menubar1->Append( m_menuFile, _("&File") ); - - m_menuAdvanced = new wxMenu(); - m_menuLanguages = new wxMenu(); - m_menuAdvanced->Append( -1, _("&Language"), m_menuLanguages ); - - m_menuAdvanced->AppendSeparator(); - - m_menuItemGlobSett = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Global settings...") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuAdvanced->Append( m_menuItemGlobSett ); - - m_menuItem7 = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Create batch job...") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuAdvanced->Append( m_menuItem7 ); - - wxMenuItem* m_menuItem5; - m_menuItem5 = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Export file list...") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuAdvanced->Append( m_menuItem5 ); - - m_menubar1->Append( m_menuAdvanced, _("&Advanced") ); - - m_menuHelp = new wxMenu(); - wxMenuItem* m_menuItemReadme; - m_menuItemReadme = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Content") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); - m_menuHelp->Append( m_menuItemReadme ); - - m_menuItemCheckVer = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Check for new version") ) , wxEmptyString, wxITEM_NORMAL ); - m_menuHelp->Append( m_menuItemCheckVer ); - - m_menuHelp->AppendSeparator(); - - m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("SHIFT-F1"), wxEmptyString, wxITEM_NORMAL ); - m_menuHelp->Append( m_menuItemAbout ); - - m_menubar1->Append( m_menuHelp, _("&Help") ); - - this->SetMenuBar( m_menubar1 ); - - bSizer1 = new wxBoxSizer( wxVERTICAL ); - - m_panel71 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL ); - bSizer6 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxFlexGridSizer* fgSizer121; - fgSizer121 = new wxFlexGridSizer( 2, 2, 0, 0 ); - fgSizer121->SetFlexibleDirection( wxBOTH ); - fgSizer121->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticTextCmpVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCmpVariant->Wrap( -1 ); - m_staticTextCmpVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - m_staticTextCmpVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - fgSizer121->Add( m_staticTextCmpVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - fgSizer121->Add( 0, 0, 1, 0, 5 ); - - wxBoxSizer* bSizer30; - bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("Compare"), wxDefaultPosition, wxSize( 180,42 ), 0 ); - m_buttonCompare->SetDefault(); - m_buttonCompare->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); - m_buttonCompare->SetToolTip( _("Compare both sides") ); - - bSizer30->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 180,42 ), 0 ); - m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); - m_buttonAbort->Enable( false ); - m_buttonAbort->Hide(); - - bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - fgSizer121->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonCmpConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); - m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); - - m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); - - fgSizer121->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); - - bSizer6->Add( fgSizer121, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - - bSizer6->Add( 0, 0, 1, 0, 5 ); - - wxFlexGridSizer* fgSizer12; - fgSizer12 = new wxFlexGridSizer( 2, 2, 0, 0 ); - fgSizer12->SetFlexibleDirection( wxBOTH ); - fgSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - fgSizer12->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticTextSyncVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSyncVariant->Wrap( -1 ); - m_staticTextSyncVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - m_staticTextSyncVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - fgSizer12->Add( m_staticTextSyncVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_bpButtonSyncConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); - m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); - - m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); - - fgSizer12->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); - - m_buttonStartSync = new wxButtonWithImage( m_panel71, wxID_ANY, _("Synchronize..."), wxDefaultPosition, wxSize( -1,42 ), 0 ); - m_buttonStartSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); - m_buttonStartSync->SetToolTip( _("Start synchronization") ); - - fgSizer12->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer6->Add( fgSizer12, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - - bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panel71->SetSizer( bSizer6 ); - m_panel71->Layout(); - bSizer6->Fit( m_panel71 ); - bSizer1->Add( m_panel71, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - wxBoxSizer* bSizer91; - bSizer91 = new wxBoxSizer( wxHORIZONTAL ); - - m_panelTopLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer92; - bSizer92 = new wxBoxSizer( wxVERTICAL ); - - sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_panelTopLeft, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); - - m_directoryLeft = new CustomComboBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - sbSizer2->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerLeft = new wxDirPickerCtrl( m_panelTopLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerLeft->SetToolTip( _("Select a folder") ); - - sbSizer2->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer92->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_panelTopLeft->SetSizer( bSizer92 ); - m_panelTopLeft->Layout(); - bSizer92->Fit( m_panelTopLeft ); - bSizer91->Add( m_panelTopLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_panelTopMiddle = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer93; - bSizer93 = new wxBoxSizer( wxVERTICAL ); - - - bSizer93->Add( 0, 3, 0, 0, 5 ); - - bSizerMiddle = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonSwapSides = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); - m_bpButtonSwapSides->SetToolTip( _("Swap sides") ); - - m_bpButtonSwapSides->SetToolTip( _("Swap sides") ); - - bSizerMiddle->Add( m_bpButtonSwapSides, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer93->Add( bSizerMiddle, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer160; - bSizer160 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer160->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLocalFilter = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer160->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer160->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer160->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer160->Add( 0, 0, 1, wxEXPAND, 5 ); - - bSizer93->Add( bSizer160, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_panelTopMiddle->SetSizer( bSizer93 ); - m_panelTopMiddle->Layout(); - bSizer93->Fit( m_panelTopMiddle ); - bSizer91->Add( m_panelTopMiddle, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_panelTopRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer94; - bSizer94 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer77; - bSizer77 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBoxSizer* sbSizer3; - sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelTopRight, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); - - m_bpButtonAddPair = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - - m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - - sbSizer3->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3 ); - - m_bpButtonRemovePair = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - sbSizer3->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_directoryRight = new CustomComboBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); - sbSizer3->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerRight = new wxDirPickerCtrl( m_panelTopRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerRight->SetToolTip( _("Select a folder") ); - - sbSizer3->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer77->Add( sbSizer3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - bSizer94->Add( bSizer77, 0, wxEXPAND|wxLEFT, 3 ); - - m_panelTopRight->SetSizer( bSizer94 ); - m_panelTopRight->Layout(); - bSizer94->Fit( m_panelTopRight ); - bSizer91->Add( m_panelTopRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - bSizer1->Add( bSizer91, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_scrolledWindowFolderPairs = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); - m_scrolledWindowFolderPairs->SetScrollRate( 5, 5 ); - m_scrolledWindowFolderPairs->SetMinSize( wxSize( -1,0 ) ); - - bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); - - m_scrolledWindowFolderPairs->SetSizer( bSizerAddFolderPairs ); - m_scrolledWindowFolderPairs->Layout(); - bSizerAddFolderPairs->Fit( m_scrolledWindowFolderPairs ); - bSizer1->Add( m_scrolledWindowFolderPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - bSizerGridHolder = new wxBoxSizer( wxHORIZONTAL ); - - m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer7; - bSizer7 = new wxBoxSizer( wxVERTICAL ); - - m_gridLeft = new CustomGridLeft( m_panelLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_gridLeft->CreateGrid( 15, 4 ); - m_gridLeft->EnableEditing( false ); - m_gridLeft->EnableGridLines( true ); - m_gridLeft->EnableDragGridSize( true ); - m_gridLeft->SetMargins( 0, 0 ); - - // Columns - m_gridLeft->EnableDragColMove( false ); - m_gridLeft->EnableDragColSize( true ); - m_gridLeft->SetColLabelSize( 20 ); - m_gridLeft->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - - // Rows - m_gridLeft->EnableDragRowSize( false ); - m_gridLeft->SetRowLabelSize( 38 ); - m_gridLeft->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_gridLeft->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - bSizer7->Add( m_gridLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); - - m_panelLeft->SetSizer( bSizer7 ); - m_panelLeft->Layout(); - bSizer7->Fit( m_panelLeft ); - bSizerGridHolder->Add( m_panelLeft, 1, wxEXPAND, 5 ); - - m_panelMiddle = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer18; - bSizer18 = new wxBoxSizer( wxVERTICAL ); - - m_gridMiddle = new CustomGridMiddle( m_panelMiddle, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_gridMiddle->CreateGrid( 15, 1 ); - m_gridMiddle->EnableEditing( false ); - m_gridMiddle->EnableGridLines( true ); - m_gridMiddle->EnableDragGridSize( false ); - m_gridMiddle->SetMargins( 0, 0 ); - - // Columns - m_gridMiddle->SetColSize( 0, 60 ); - m_gridMiddle->EnableDragColMove( false ); - m_gridMiddle->EnableDragColSize( false ); - m_gridMiddle->SetColLabelSize( 20 ); - m_gridMiddle->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Rows - m_gridMiddle->EnableDragRowSize( false ); - m_gridMiddle->SetRowLabelSize( 0 ); - m_gridMiddle->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_gridMiddle->SetDefaultCellFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Arial") ) ); - m_gridMiddle->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - bSizer18->Add( m_gridMiddle, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - m_panelMiddle->SetSizer( bSizer18 ); - m_panelMiddle->Layout(); - bSizer18->Fit( m_panelMiddle ); - bSizerGridHolder->Add( m_panelMiddle, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer10; - bSizer10 = new wxBoxSizer( wxVERTICAL ); - - m_gridRight = new CustomGridRight( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_gridRight->CreateGrid( 15, 4 ); - m_gridRight->EnableEditing( false ); - m_gridRight->EnableGridLines( true ); - m_gridRight->EnableDragGridSize( true ); - m_gridRight->SetMargins( 0, 0 ); - - // Columns - m_gridRight->EnableDragColMove( false ); - m_gridRight->EnableDragColSize( true ); - m_gridRight->SetColLabelSize( 20 ); - m_gridRight->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - - // Rows - m_gridRight->EnableDragRowSize( false ); - m_gridRight->SetRowLabelSize( 38 ); - m_gridRight->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_gridRight->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); - bSizer10->Add( m_gridRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); - - m_panelRight->SetSizer( bSizer10 ); - m_panelRight->Layout(); - bSizer10->Fit( m_panelRight ); - bSizerGridHolder->Add( m_panelRight, 1, wxEXPAND, 5 ); - - bSizer1->Add( bSizerGridHolder, 1, wxEXPAND, 5 ); - - m_panelBottom = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - bSizer3 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer120; - bSizer120 = new wxBoxSizer( wxVERTICAL ); - - m_notebookBottomLeft = new wxNotebook( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panel30 = new wxPanel( m_notebookBottomLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer139; - bSizer139 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonSave = new wxBitmapButton( m_panel30, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButtonSave->SetToolTip( _("Save current configuration to file") ); - - m_bpButtonSave->SetToolTip( _("Save current configuration to file") ); - - bSizer139->Add( m_bpButtonSave, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLoad = new wxBitmapButton( m_panel30, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButtonLoad->SetToolTip( _("Load configuration from file") ); - - m_bpButtonLoad->SetToolTip( _("Load configuration from file") ); - - bSizer139->Add( m_bpButtonLoad, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - wxArrayString m_choiceHistoryChoices; - m_choiceHistory = new wxChoice( m_panel30, wxID_ANY, wxDefaultPosition, wxSize( 170,-1 ), m_choiceHistoryChoices, 0 ); - m_choiceHistory->SetSelection( 0 ); - m_choiceHistory->SetToolTip( _("Load configuration history (press DEL to delete items)") ); - - bSizer139->Add( m_choiceHistory, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panel30->SetSizer( bSizer139 ); - m_panel30->Layout(); - bSizer139->Fit( m_panel30 ); - m_notebookBottomLeft->AddPage( m_panel30, _("Configuration"), true ); - m_panelFilter = new wxPanel( m_notebookBottomLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer140; - bSizer140 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonFilter = new wxBitmapButton( m_panelFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - bSizer140->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - wxBoxSizer* bSizer23; - bSizer23 = new wxBoxSizer( wxVERTICAL ); - - m_checkBoxHideFilt = new wxCheckBox( m_panelFilter, wxID_ANY, _("Hide excluded items"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxHideFilt->SetToolTip( _("Hide filtered or temporarily excluded files") ); - - bSizer23->Add( m_checkBoxHideFilt, 0, wxEXPAND, 5 ); - - bSizer140->Add( bSizer23, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelFilter->SetSizer( bSizer140 ); - m_panelFilter->Layout(); - bSizer140->Fit( m_panelFilter ); - m_notebookBottomLeft->AddPage( m_panelFilter, _("Filter files"), false ); - - bSizer120->Add( m_notebookBottomLeft, 0, wxALL, 5 ); - - bSizer3->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); - - m_panelViewFilter = new wxPanel( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer64; - bSizer64 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer31; - sbSizer31 = new wxStaticBoxSizer( new wxStaticBox( m_panelViewFilter, wxID_ANY, _("Filter view") ), wxHORIZONTAL ); - - sbSizer31->SetMinSize( wxSize( 100,-1 ) ); - - sbSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bpButtonSyncCreateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncCreateLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncDirOverwLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncDirOverwLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncDeleteLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncDeleteLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLeftOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLeftNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonEqual = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonEqual, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonDifferent = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncDirNone = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncDirNone, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonRightNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonRightOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncDeleteRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncDeleteRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncDirOverwRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncDirOverwRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonSyncCreateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonSyncCreateRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonConflict = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - sbSizer31->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - - sbSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); - - bSizer64->Add( sbSizer31, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_panelViewFilter->SetSizer( bSizer64 ); - m_panelViewFilter->Layout(); - bSizer64->Fit( m_panelViewFilter ); - bSizer3->Add( m_panelViewFilter, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bSizerBottomRight = new wxBoxSizer( wxHORIZONTAL ); - - - bSizerBottomRight->Add( 5, 0, 1, 0, 5 ); - - m_panelSyncPreview = new wxPanel( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer121; - bSizer121 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer161; - sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( m_panelSyncPreview, wxID_ANY, _("Statistics") ), wxHORIZONTAL ); - - wxFlexGridSizer* fgSizer5; - fgSizer5 = new wxFlexGridSizer( 2, 2, 0, 5 ); - fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_bitmapCreate = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapCreate->SetToolTip( _("Number of files and directories that will be created") ); - - fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_textCtrlCreate = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlCreate->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlCreate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlCreate->SetToolTip( _("Number of files and directories that will be created") ); - - fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapDelete = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapDelete->SetToolTip( _("Number of files and directories that will be deleted") ); - - fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlDelete = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlDelete->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlDelete->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlDelete->SetToolTip( _("Number of files and directories that will be deleted") ); - - fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizer161->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - wxFlexGridSizer* fgSizer6; - fgSizer6 = new wxFlexGridSizer( 2, 2, 0, 5 ); - fgSizer6->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_bitmapUpdate = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer6->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_textCtrlUpdate = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlUpdate->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlUpdate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlUpdate->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer6->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapData = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapData->SetToolTip( _("Total amount of data that will be transferred") ); - - fgSizer6->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_textCtrlData = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlData->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); - - fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizer161->Add( fgSizer6, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - bSizer121->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelSyncPreview->SetSizer( bSizer121 ); - m_panelSyncPreview->Layout(); - bSizer121->Fit( m_panelSyncPreview ); - bSizerBottomRight->Add( m_panelSyncPreview, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButton10 = new wxBitmapButton( m_panelBottom, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); - m_bpButton10->Hide(); - m_bpButton10->SetToolTip( _("Quit") ); - - m_bpButton10->Hide(); - m_bpButton10->SetToolTip( _("Quit") ); - - bSizerBottomRight->Add( m_bpButton10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); - - bSizer3->Add( bSizerBottomRight, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); - - m_panelBottom->SetSizer( bSizer3 ); - m_panelBottom->Layout(); - bSizer3->Fit( m_panelBottom ); - bSizer1->Add( m_panelBottom, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_panelStatusBar = 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_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusLeft->Wrap( -1 ); - m_staticTextStatusLeft->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - 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_panelStatusBar, 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_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusMiddle->Wrap( -1 ); - m_staticTextStatusMiddle->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - 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_panelStatusBar, 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_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatusRight->Wrap( -1 ); - m_staticTextStatusRight->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - 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_panelStatusBar, 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_panelStatusBar->SetSizer( bSizer451 ); - m_panelStatusBar->Layout(); - bSizer451->Fit( m_panelStatusBar ); - bSizer1->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - this->SetSizer( bSizer1 ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); - this->Connect( m_menuItem10->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); - this->Connect( m_menuItem11->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); - this->Connect( m_menuItemSwitchView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); - this->Connect( m_menuItemNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnNewConfig ) ); - this->Connect( m_menuItemSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); - this->Connect( m_menuItemLoad->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); - this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); - this->Connect( m_menuItemGlobSett->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); - this->Connect( m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); - this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); - this->Connect( m_menuItemReadme->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); - this->Connect( m_menuItemCheckVer->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); - this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); - m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); - m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); - m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); - m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); - m_dirPickerLeft->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); - m_bpButtonSwapSides->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); - m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); - m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRemoveTopFolderPair ), NULL, this ); - m_dirPickerRight->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); - m_gridLeft->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnLeftGridDoubleClick ), NULL, this ); - m_gridLeft->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); - m_gridLeft->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortLeftGrid ), NULL, this ); - m_gridLeft->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelLeft ), NULL, this ); - m_gridMiddle->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddle ), NULL, this ); - m_gridMiddle->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortMiddleGrid ), NULL, this ); - m_gridMiddle->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddleLabel ), NULL, this ); - m_gridRight->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnRightGridDoubleClick ), NULL, this ); - m_gridRight->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); - m_gridRight->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortRightGrid ), NULL, this ); - m_gridRight->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelRight ), NULL, this ); - m_bpButtonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ), NULL, this ); - m_bpButtonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ), NULL, this ); - m_choiceHistory->Connect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); - m_choiceHistory->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistory ), NULL, this ); - m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); - m_checkBoxHideFilt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideFilteredButton ), NULL, this ); - m_bpButtonSyncCreateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateLeft ), NULL, this ); - m_bpButtonSyncDirOverwLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); - m_bpButtonSyncDeleteLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteLeft ), NULL, this ); - m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftOnlyFiles ), NULL, this ); - m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftNewerFiles ), NULL, this ); - m_bpButtonEqual->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnEqualFiles ), NULL, this ); - m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); - m_bpButtonSyncDirNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); - m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); - m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); - m_bpButtonSyncDeleteRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteRight ), NULL, this ); - m_bpButtonSyncDirOverwRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); - m_bpButtonSyncCreateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateRight ), NULL, this ); - m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); - m_bpButton10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); -} - -MainDialogGenerated::~MainDialogGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnNewConfig ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); - this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); - m_buttonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); - m_bpButtonCmpConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); - m_bpButtonSyncConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); - m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); - m_dirPickerLeft->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); - m_bpButtonSwapSides->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); - m_bpButtonAddPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); - m_bpButtonRemovePair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRemoveTopFolderPair ), NULL, this ); - m_dirPickerRight->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); - m_gridLeft->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnLeftGridDoubleClick ), NULL, this ); - m_gridLeft->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); - m_gridLeft->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortLeftGrid ), NULL, this ); - m_gridLeft->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelLeft ), NULL, this ); - m_gridMiddle->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddle ), NULL, this ); - m_gridMiddle->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortMiddleGrid ), NULL, this ); - m_gridMiddle->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddleLabel ), NULL, this ); - m_gridRight->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnRightGridDoubleClick ), NULL, this ); - m_gridRight->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); - m_gridRight->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortRightGrid ), NULL, this ); - m_gridRight->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelRight ), NULL, this ); - m_bpButtonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ), NULL, this ); - m_bpButtonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ), NULL, this ); - m_choiceHistory->Disconnect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); - m_choiceHistory->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistory ), NULL, this ); - m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); - m_checkBoxHideFilt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideFilteredButton ), NULL, this ); - m_bpButtonSyncCreateLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateLeft ), NULL, this ); - m_bpButtonSyncDirOverwLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); - m_bpButtonSyncDeleteLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteLeft ), NULL, this ); - m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftOnlyFiles ), NULL, this ); - m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftNewerFiles ), NULL, this ); - m_bpButtonEqual->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnEqualFiles ), NULL, this ); - m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); - m_bpButtonSyncDirNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); - m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); - m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); - m_bpButtonSyncDeleteRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteRight ), NULL, this ); - m_bpButtonSyncDirOverwRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); - m_bpButtonSyncCreateRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateRight ), NULL, this ); - m_bpButtonConflict->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); - m_bpButton10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); -} - -FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) -{ - wxBoxSizer* bSizer74; - bSizer74 = new wxBoxSizer( wxHORIZONTAL ); - - m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer134; - bSizer134 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer134->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerLeft->SetToolTip( _("Select a folder") ); - - bSizer134->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_panelLeft->SetSizer( bSizer134 ); - m_panelLeft->Layout(); - bSizer134->Fit( m_panelLeft ); - bSizer74->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panel20 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel20->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); - - wxBoxSizer* bSizer95; - bSizer95 = new wxBoxSizer( wxHORIZONTAL ); - - m_panel21 = new wxPanel( m_panel20, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - m_panel21->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer96; - bSizer96 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer96->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bpButtonLocalFilter = new wxBitmapButton( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer96->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer96->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonAltSyncCfg = new wxBitmapButton( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer96->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer96->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_panel21->SetSizer( bSizer96 ); - m_panel21->Layout(); - bSizer96->Fit( m_panel21 ); - bSizer95->Add( m_panel21, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_panel20->SetSizer( bSizer95 ); - m_panel20->Layout(); - bSizer95->Fit( m_panel20 ); - bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer135; - bSizer135 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonRemovePair = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - bSizer135->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer135->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerRight->SetToolTip( _("Select a folder") ); - - bSizer135->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_panelRight->SetSizer( bSizer135 ); - m_panelRight->Layout(); - bSizer135->Fit( m_panelRight ); - bSizer74->Add( m_panelRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - this->SetSizer( bSizer74 ); - this->Layout(); - bSizer74->Fit( this ); -} - -FolderPairGenerated::~FolderPairGenerated() -{ -} - -BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) -{ - wxBoxSizer* bSizer142; - bSizer142 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer140; - bSizer140 = new wxBoxSizer( wxHORIZONTAL ); - - m_panel32 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER ); - wxBoxSizer* bSizer147; - bSizer147 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer136; - bSizer136 = new wxBoxSizer( wxVERTICAL ); - - m_bpButtonRemovePair = new wxBitmapButton( m_panel32, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - bSizer136->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer147->Add( bSizer136, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer143; - bSizer143 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer145; - bSizer145 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText53 = new wxStaticText( m_panel32, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText53->Wrap( -1 ); - m_staticText53->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - bSizer145->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer143->Add( bSizer145, 1, 0, 5 ); - - wxBoxSizer* bSizer146; - bSizer146 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText541 = new wxStaticText( m_panel32, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText541->Wrap( -1 ); - m_staticText541->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - bSizer146->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer143->Add( bSizer146, 1, 0, 5 ); - - bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_panel32->SetSizer( bSizer147 ); - m_panel32->Layout(); - bSizer147->Fit( m_panel32 ); - bSizer140->Add( m_panel32, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer144; - bSizer144 = new wxBoxSizer( wxVERTICAL ); - - m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer114; - bSizer114 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer114->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerLeft->SetToolTip( _("Select a folder") ); - - bSizer114->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLocalFilter = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer114->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelLeft->SetSizer( bSizer114 ); - m_panelLeft->Layout(); - bSizer114->Fit( m_panelLeft ); - bSizer144->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer115; - bSizer115 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer115->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerRight->SetToolTip( _("Select a folder") ); - - bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer115->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelRight->SetSizer( bSizer115 ); - m_panelRight->Layout(); - bSizer115->Fit( m_panelRight ); - bSizer144->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer140->Add( bSizer144, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer142->Add( bSizer140, 0, wxEXPAND, 5 ); - - - bSizer142->Add( 0, 5, 0, 0, 5 ); - - this->SetSizer( bSizer142 ); - this->Layout(); - bSizer142->Fit( this ); -} - -BatchFolderPairGenerated::~BatchFolderPairGenerated() -{ -} - -BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( 400,420 ), wxDefaultSize ); - - wxBoxSizer* bSizer54; - bSizer54 = new wxBoxSizer( wxVERTICAL ); - - bSizer69 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer87; - bSizer87 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap27 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer87->Add( m_bitmap27, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - 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, _("Batch job"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText56->Wrap( -1 ); - m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); - - bSizer72->Add( m_staticText56, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_panel8->SetSizer( bSizer72 ); - m_panel8->Layout(); - bSizer72->Fit( m_panel8 ); - bSizer87->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer87->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer69->Add( bSizer87, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer69->Add( 0, 5, 0, 0, 5 ); - - wxBoxSizer* bSizer70; - bSizer70 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText44 = new wxStaticText( this, wxID_ANY, _("Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe . This can also be scheduled in your operating system's task planner."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText44->Wrap( 500 ); - bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButtonHelp->SetToolTip( _("Help") ); - - m_bpButtonHelp->SetToolTip( _("Help") ); - - bSizer70->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - bSizer69->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer69->Add( 0, 5, 0, 0, 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") ) ); - - bSizer69->Add( m_staticText531, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_notebookSettings = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_panelOverview = new wxPanel( m_notebookSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer67; - bSizer67 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer120; - bSizer120 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer175; - bSizer175 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBoxSizer* sbSizer241; - sbSizer241 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Compare") ), wxHORIZONTAL ); - - m_bpButtonCmpConfig = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); - m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); - - m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); - - sbSizer241->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL, 3 ); - - - sbSizer241->Add( 10, 0, 0, 0, 5 ); - - m_staticTextCmpVariant = new wxStaticText( m_panelOverview, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextCmpVariant->Wrap( -1 ); - m_staticTextCmpVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - m_staticTextCmpVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - sbSizer241->Add( m_staticTextCmpVariant, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer175->Add( sbSizer241, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer175->Add( 0, 0, 1, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer26; - sbSizer26 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Filter files") ), wxVERTICAL ); - - m_bpButtonFilter = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); - sbSizer26->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 15 ); - - bSizer175->Add( sbSizer26, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer175->Add( 0, 0, 1, wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer252; - sbSizer252 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Synchronize...") ), wxHORIZONTAL ); - - m_staticTextSyncVariant = new wxStaticText( m_panelOverview, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSyncVariant->Wrap( -1 ); - m_staticTextSyncVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - m_staticTextSyncVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); - - sbSizer252->Add( m_staticTextSyncVariant, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - sbSizer252->Add( 10, 0, 0, 0, 5 ); - - m_bpButtonSyncConfig = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); - m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); - - m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); - - sbSizer252->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL, 3 ); - - bSizer175->Add( sbSizer252, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer120->Add( bSizer175, 0, wxEXPAND, 5 ); - - - bSizer120->Add( 0, 5, 0, 0, 5 ); - - m_scrolledWindow6 = new wxScrolledWindow( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); - m_scrolledWindow6->SetScrollRate( 5, 5 ); - wxBoxSizer* bSizer141; - bSizer141 = new wxBoxSizer( wxVERTICAL ); - - sbSizerMainPair = new wxBoxSizer( wxHORIZONTAL ); - - m_panelMainPair = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER ); - wxBoxSizer* bSizer147; - bSizer147 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer1361; - bSizer1361 = new wxBoxSizer( wxHORIZONTAL ); - - m_bpButtonAddPair = new wxBitmapButton( m_panelMainPair, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - - m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); - - bSizer1361->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3 ); - - m_bpButtonRemovePair = new wxBitmapButton( m_panelMainPair, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); - - bSizer1361->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer147->Add( bSizer1361, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer143; - bSizer143 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer145; - bSizer145 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText532 = new wxStaticText( m_panelMainPair, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText532->Wrap( -1 ); - m_staticText532->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - bSizer145->Add( m_staticText532, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer143->Add( bSizer145, 1, 0, 5 ); - - wxBoxSizer* bSizer146; - bSizer146 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText5411 = new wxStaticText( m_panelMainPair, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText5411->Wrap( -1 ); - m_staticText5411->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - bSizer146->Add( m_staticText5411, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer143->Add( bSizer146, 1, 0, 5 ); - - bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - m_panelMainPair->SetSizer( bSizer147 ); - m_panelMainPair->Layout(); - bSizer147->Fit( m_panelMainPair ); - sbSizerMainPair->Add( m_panelMainPair, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer158; - bSizer158 = new wxBoxSizer( wxVERTICAL ); - - m_panelLeft = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1141; - bSizer1141 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1141->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerLeft->SetToolTip( _("Select a folder") ); - - bSizer1141->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLocalFilter = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer1141->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelLeft->SetSizer( bSizer1141 ); - m_panelLeft->Layout(); - bSizer1141->Fit( m_panelLeft ); - bSizer158->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_panelRight = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer115; - bSizer115 = new wxBoxSizer( wxHORIZONTAL ); - - m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer115->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerRight->SetToolTip( _("Select a folder") ); - - bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); - bSizer115->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelRight->SetSizer( bSizer115 ); - m_panelRight->Layout(); - bSizer115->Fit( m_panelRight ); - bSizer158->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizerMainPair->Add( bSizer158, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); - - bSizer141->Add( sbSizerMainPair, 0, wxEXPAND, 5 ); - - bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); - - bSizer141->Add( bSizerAddFolderPairs, 0, wxEXPAND, 5 ); - - m_scrolledWindow6->SetSizer( bSizer141 ); - m_scrolledWindow6->Layout(); - bSizer141->Fit( m_scrolledWindow6 ); - bSizer120->Add( m_scrolledWindow6, 0, wxEXPAND, 5 ); - - - bSizer120->Add( 0, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxFlexGridSizer* fgSizer15; - fgSizer15 = new wxFlexGridSizer( 1, 2, 10, 10 ); - fgSizer15->SetFlexibleDirection( wxBOTH ); - fgSizer15->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - wxStaticBoxSizer* sbSizer24; - sbSizer24 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Status feedback") ), wxVERTICAL ); - - - sbSizer24->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_checkBoxSilent = new wxCheckBox( m_panelOverview, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxSilent->SetToolTip( _("Run minimized and write status information to a logfile") ); - - sbSizer24->Add( m_checkBoxSilent, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 14 ); - - - sbSizer24->Add( 0, 0, 1, wxEXPAND, 5 ); - - fgSizer15->Add( sbSizer24, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer25; - sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Error handling") ), wxHORIZONTAL ); - - wxArrayString m_choiceHandleErrorChoices; - m_choiceHandleError = new wxChoice( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); - m_choiceHandleError->SetSelection( 0 ); - sbSizer25->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - fgSizer15->Add( sbSizer25, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer120->Add( fgSizer15, 0, 0, 5 ); - - bSizer67->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); - - m_panelOverview->SetSizer( bSizer67 ); - m_panelOverview->Layout(); - bSizer67->Fit( m_panelOverview ); - m_notebookSettings->AddPage( m_panelOverview, _("Overview"), true ); - m_panelLogging = new wxPanel( m_notebookSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer117; - bSizer117 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer119; - bSizer119 = new wxBoxSizer( wxVERTICAL ); - - m_staticText120 = new wxStaticText( m_panelLogging, wxID_ANY, _("Select logfile directory:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText120->Wrap( -1 ); - bSizer119->Add( m_staticText120, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - wxStaticBoxSizer* sbSizer251; - sbSizer251 = new wxStaticBoxSizer( new wxStaticBox( m_panelLogging, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); - - m_textCtrlLogfileDir = new wxTextCtrl( m_panelLogging, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - sbSizer251->Add( m_textCtrlLogfileDir, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerLogfileDir = new wxDirPickerCtrl( m_panelLogging, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - m_dirPickerLogfileDir->SetToolTip( _("Select a folder") ); - - sbSizer251->Add( m_dirPickerLogfileDir, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer119->Add( sbSizer251, 1, wxEXPAND, 5 ); - - bSizer117->Add( bSizer119, 0, wxEXPAND|wxALL, 10 ); - - m_panelLogging->SetSizer( bSizer117 ); - m_panelLogging->Layout(); - bSizer117->Fit( m_panelLogging ); - m_notebookSettings->AddPage( m_panelLogging, _("Logging"), false ); - - bSizer69->Add( m_notebookSettings, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer68; - bSizer68 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonSave = new wxButton( this, wxID_SAVE, _("&Save"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonSave->SetDefault(); - m_buttonSave->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer68->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonLoad = new wxButton( this, wxID_OPEN, _("&Load"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonLoad->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer68->Add( m_buttonLoad, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button6->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer68->Add( m_button6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer69->Add( bSizer68, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer54->Add( bSizer69, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); - - this->SetSizer( bSizer54 ); - this->Layout(); - bSizer54->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); - m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnHelp ), NULL, this ); - m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCmpSettings ), NULL, this ); - m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnConfigureFilter ), NULL, this ); - m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSyncSettings ), NULL, this ); - m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnAddFolderPair ), NULL, this ); - m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRemoveTopFolderPair ), NULL, this ); - m_checkBoxSilent->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckSilent ), NULL, this ); - m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); - m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLoadBatchJob ), NULL, this ); - m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); -} - -BatchDlgGenerated::~BatchDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); - m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnHelp ), NULL, this ); - m_bpButtonCmpConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCmpSettings ), NULL, this ); - m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnConfigureFilter ), NULL, this ); - m_bpButtonSyncConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSyncSettings ), NULL, this ); - m_bpButtonAddPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnAddFolderPair ), NULL, this ); - m_bpButtonRemovePair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRemoveTopFolderPair ), NULL, this ); - m_checkBoxSilent->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckSilent ), NULL, this ); - m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); - m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLoadBatchJob ), NULL, this ); - m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); -} - -CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) -{ - wxBoxSizer* bSizer40; - bSizer40 = new wxBoxSizer( wxVERTICAL ); - - bSizer42 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer157; - bSizer157 = new wxBoxSizer( wxVERTICAL ); - - bSizerFilesFound = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText321 = new wxStaticText( this, wxID_ANY, _("Elements found:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText321->Wrap( -1 ); - m_staticText321->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizerFilesFound->Add( m_staticText321, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextScanned = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextScanned->Wrap( -1 ); - m_staticTextScanned->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizerFilesFound->Add( m_staticTextScanned, 0, wxALIGN_BOTTOM|wxLEFT, 5 ); - - bSizer157->Add( bSizerFilesFound, 0, 0, 5 ); - - bSizerFilesRemaining = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText46 = new wxStaticText( this, wxID_ANY, _("Elements remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText46->Wrap( -1 ); - m_staticText46->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizerFilesRemaining->Add( m_staticText46, 0, wxALIGN_BOTTOM, 5 ); - - wxBoxSizer* bSizer154; - bSizer154 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextFilesRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextFilesRemaining->Wrap( -1 ); - m_staticTextFilesRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizer154->Add( m_staticTextFilesRemaining, 0, wxALIGN_BOTTOM, 5 ); - - m_staticText117 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText117->Wrap( -1 ); - m_staticText117->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizer154->Add( m_staticText117, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataRemaining->Wrap( -1 ); - m_staticTextDataRemaining->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizer154->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); - - m_staticText118 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText118->Wrap( -1 ); - m_staticText118->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizer154->Add( m_staticText118, 0, wxALIGN_BOTTOM, 5 ); - - bSizerFilesRemaining->Add( bSizer154, 0, wxALIGN_BOTTOM|wxLEFT, 5 ); - - bSizer157->Add( bSizerFilesRemaining, 0, 0, 5 ); - - bSizer42->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - - sSizerSpeed = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText104 = new wxStaticText( this, wxID_ANY, _("Speed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText104->Wrap( -1 ); - m_staticText104->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - sSizerSpeed->Add( m_staticText104, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSpeed->Wrap( -1 ); - m_staticTextSpeed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - sSizerSpeed->Add( m_staticTextSpeed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - bSizer42->Add( sSizerSpeed, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer42->Add( 10, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - sSizerTimeRemaining = new wxBoxSizer( wxHORIZONTAL ); - - m_staticTextTimeRemFixed = new wxStaticText( this, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeRemFixed->Wrap( -1 ); - m_staticTextTimeRemFixed->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - sSizerTimeRemaining->Add( m_staticTextTimeRemFixed, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextTimeRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeRemaining->Wrap( -1 ); - m_staticTextTimeRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - sSizerTimeRemaining->Add( m_staticTextTimeRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - bSizer42->Add( sSizerTimeRemaining, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - - sSizerTimeElapsed = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticText* m_staticText37; - m_staticText37 = new wxStaticText( this, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText37->Wrap( -1 ); - m_staticText37->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - sSizerTimeElapsed->Add( m_staticText37, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextTimeElapsed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeElapsed->Wrap( -1 ); - m_staticTextTimeElapsed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - sSizerTimeElapsed->Add( m_staticTextTimeElapsed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - bSizer42->Add( sSizerTimeElapsed, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer40->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer48; - bSizer48 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText30 = new wxStaticText( this, wxID_ANY, _("Operation:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText30->Wrap( -1 ); - m_staticText30->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer48->Add( m_staticText30, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlStatus = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); - m_textCtrlStatus->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - - bSizer48->Add( m_textCtrlStatus, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer40->Add( bSizer48, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); - bSizer40->Add( m_gauge2, 0, wxALL|wxEXPAND, 5 ); - - this->SetSizer( bSizer40 ); - this->Layout(); - bSizer40->Fit( this ); -} - -CompareStatusGenerated::~CompareStatusGenerated() -{ -} - -SyncCfgDlgGenerated::SyncCfgDlgGenerated( 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* bSizer7; - bSizer7 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer181; - bSizer181 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer29; - bSizer29 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer7; - sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); - - m_staticText1 = new wxStaticText( this, wxID_ANY, _("Select variant:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1->Wrap( -1 ); - m_staticText1->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - sbSizer7->Add( m_staticText1, 0, wxALL, 5 ); - - wxFlexGridSizer* fgSizer1; - fgSizer1 = new wxFlexGridSizer( 4, 3, 8, 5 ); - fgSizer1->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_radioBtnAutomatic = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnAutomatic->SetValue( true ); - m_radioBtnAutomatic->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer1->Add( m_radioBtnAutomatic, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonAutomatic = new wxButton( this, wxID_ANY, _(""), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonAutomatic->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer1->Add( m_buttonAutomatic, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticText81 = new wxStaticText( this, wxID_ANY, _("Identify and propagate changes on both sides using a database. Deletions and conflicts are detected automatically."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText81->Wrap( 300 ); - fgSizer1->Add( m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_radioBtnMirror = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnMirror->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer1->Add( m_radioBtnMirror, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonOneWay = new wxButton( this, wxID_ANY, _("Mirror ->>"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonOneWay->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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( 300 ); - fgSizer1->Add( m_staticText8, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_radioBtnUpdate = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnUpdate->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer1->Add( m_radioBtnUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_buttonUpdate = new wxButton( this, wxID_ANY, _("Update ->"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_buttonUpdate->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer1->Add( m_buttonUpdate, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticText101 = new wxStaticText( this, wxID_ANY, _("Copy new or updated files to right folder."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText101->Wrap( 300 ); - fgSizer1->Add( m_staticText101, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - m_radioBtnCustom = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnCustom->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - m_radioBtnCustom->Enable( false ); - - fgSizer1->Add( m_radioBtnCustom, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer65; - bSizer65 = new wxBoxSizer( wxVERTICAL ); - - - bSizer65->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText23 = new wxStaticText( this, wxID_ANY, _("Custom"), wxDefaultPosition, wxSize( -1,-1 ), wxALIGN_CENTRE|wxSTATIC_BORDER ); - m_staticText23->Wrap( -1 ); - m_staticText23->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - bSizer65->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer65->Add( 0, 0, 1, wxEXPAND, 5 ); - - fgSizer1->Add( bSizer65, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticText9 = new wxStaticText( this, wxID_ANY, _("Configure your own synchronization rules."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( 300 ); - fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - sbSizer7->Add( fgSizer1, 0, 0, 5 ); - - bSizer29->Add( sbSizer7, 0, wxEXPAND, 5 ); - - - bSizer29->Add( 0, 5, 1, 0, 5 ); - - bSizer201 = new wxBoxSizer( wxHORIZONTAL ); - - sbSizerErrorHandling = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Error handling") ), wxHORIZONTAL ); - - wxArrayString m_choiceHandleErrorChoices; - m_choiceHandleError = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); - m_choiceHandleError->SetSelection( 0 ); - sbSizerErrorHandling->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer201->Add( sbSizerErrorHandling, 0, wxEXPAND|wxRIGHT, 10 ); - - wxStaticBoxSizer* sbSizer231; - sbSizer231 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Deletion handling") ), wxVERTICAL ); - - wxArrayString m_choiceHandleDeletionChoices; - m_choiceHandleDeletion = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleDeletionChoices, 0 ); - m_choiceHandleDeletion->SetSelection( 0 ); - sbSizer231->Add( m_choiceHandleDeletion, 0, wxBOTTOM, 5 ); - - m_panelCustomDeletionDir = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer1151; - bSizer1151 = new wxBoxSizer( wxHORIZONTAL ); - - m_textCtrlCustomDelFolder = new wxTextCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_textCtrlCustomDelFolder->SetMinSize( wxSize( 200,-1 ) ); - - bSizer1151->Add( m_textCtrlCustomDelFolder, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_dirPickerCustomDelFolder = new wxDirPickerCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); - bSizer1151->Add( m_dirPickerCustomDelFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panelCustomDeletionDir->SetSizer( bSizer1151 ); - m_panelCustomDeletionDir->Layout(); - bSizer1151->Fit( m_panelCustomDeletionDir ); - sbSizer231->Add( m_panelCustomDeletionDir, 0, 0, 5 ); - - bSizer201->Add( sbSizer231, 0, wxEXPAND, 5 ); - - bSizer29->Add( bSizer201, 0, wxTOP|wxBOTTOM, 5 ); - - - bSizer29->Add( 0, 5, 1, 0, 5 ); - - wxBoxSizer* bSizer291; - bSizer291 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonOK->SetDefault(); - m_buttonOK->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer291->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button16->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer291->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer291->Add( 20, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer29->Add( bSizer291, 0, wxEXPAND, 5 ); - - bSizer181->Add( bSizer29, 0, wxEXPAND, 5 ); - - - bSizer181->Add( 10, 0, 0, 0, 5 ); - - sbSizerSyncDirections = 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, _("Category"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText21->Wrap( -1 ); - m_staticText21->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - 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, 70, 90, 92, false, wxEmptyString ) ); - - gSizer3->Add( m_staticText31, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizerSyncDirections->Add( gSizer3, 0, wxEXPAND, 5 ); - - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - sbSizerSyncDirections->Add( m_staticline3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer121; - bSizer121 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer122; - bSizer122 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapLeftOnly = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapLeftOnly->SetToolTip( _("Files/folders that exist on left side only") ); - - bSizer122->Add( m_bitmapLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer122->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonLeftOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer122->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer121->Add( bSizer122, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer123; - bSizer123 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapRightOnly = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapRightOnly->SetToolTip( _("Files/folders that exist on right side only") ); - - bSizer123->Add( m_bitmapRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer123->Add( 5, 0, 0, 0, 5 ); - - m_bpButtonRightOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer123->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer121->Add( bSizer123, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer124; - bSizer124 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapLeftNewer = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapLeftNewer->SetToolTip( _("Files that exist on both sides, left one is newer") ); - - bSizer124->Add( m_bitmapLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer124->Add( 5, 0, 0, 0, 5 ); - - m_bpButtonLeftNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer124->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer121->Add( bSizer124, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer125; - bSizer125 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapRightNewer = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapRightNewer->SetToolTip( _("Files that exist on both sides, right one is newer") ); - - bSizer125->Add( m_bitmapRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer125->Add( 5, 0, 0, 0, 5 ); - - m_bpButtonRightNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer125->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer121->Add( bSizer125, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer126; - bSizer126 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapDifferent = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapDifferent->SetToolTip( _("Files that have different content") ); - - bSizer126->Add( m_bitmapDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer126->Add( 5, 0, 0, 0, 5 ); - - m_bpButtonDifferent = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer126->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer121->Add( bSizer126, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer127; - bSizer127 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapConflict = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); - m_bitmapConflict->SetToolTip( _("Conflicts/files that cannot be categorized") ); - - bSizer127->Add( m_bitmapConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer127->Add( 5, 0, 0, 0, 5 ); - - m_bpButtonConflict = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); - bSizer127->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer121->Add( bSizer127, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - sbSizerSyncDirections->Add( bSizer121, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer181->Add( sbSizerSyncDirections, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer7->Add( bSizer181, 0, wxALL, 5 ); - - this->SetSizer( bSizer7 ); - this->Layout(); - bSizer7->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncCfgDlgGenerated::OnClose ) ); - m_radioBtnAutomatic->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); - m_buttonAutomatic->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); - m_radioBtnMirror->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtnUpdate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); - m_buttonUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); - m_radioBtnCustom->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncCustom ), NULL, this ); - m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_choiceHandleDeletion->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeDeletionHandling ), NULL, this ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnApply ), NULL, this ); - m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnCancel ), NULL, this ); - m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnLeftNewer ), NULL, this ); - m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnRightNewer ), NULL, this ); - m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnDifferent ), NULL, this ); - m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnConflict ), NULL, this ); -} - -SyncCfgDlgGenerated::~SyncCfgDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncCfgDlgGenerated::OnClose ) ); - m_radioBtnAutomatic->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); - m_buttonAutomatic->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); - m_radioBtnMirror->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); - m_radioBtnUpdate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); - m_buttonUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); - m_radioBtnCustom->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncCustom ), NULL, this ); - m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_choiceHandleDeletion->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeDeletionHandling ), NULL, this ); - m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnApply ), NULL, this ); - m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnCancel ), NULL, this ); - m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExLeftSideOnly ), NULL, this ); - m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExRightSideOnly ), NULL, this ); - m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnLeftNewer ), NULL, this ); - m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnRightNewer ), NULL, this ); - m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnDifferent ), NULL, this ); - m_bpButtonConflict->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnConflict ), NULL, this ); -} - -CmpCfgDlgGenerated::CmpCfgDlgGenerated( 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* bSizer136; - bSizer136 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer55; - bSizer55 = new wxBoxSizer( wxVERTICAL ); - - wxStaticBoxSizer* sbSizer6; - sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by...") ), wxHORIZONTAL ); - - wxFlexGridSizer* fgSizer16; - fgSizer16 = new wxFlexGridSizer( 2, 3, 0, 0 ); - fgSizer16->SetFlexibleDirection( wxBOTH ); - fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); - m_radioBtnSizeDate->SetValue( true ); - m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same") ); - - fgSizer16->Add( m_radioBtnSizeDate, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapByTime = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapByTime->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same") ); - - fgSizer16->Add( m_bitmapByTime, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonTimeSize = new wxButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxSize( -1,42 ), 0 ); - m_buttonTimeSize->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - m_buttonTimeSize->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same") ); - - fgSizer16->Add( m_buttonTimeSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); - - m_radioBtnContent = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); - m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same") ); - - fgSizer16->Add( m_radioBtnContent, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapByContent = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapByContent->SetToolTip( _("Files are found equal if\n - file content\nis the same") ); - - fgSizer16->Add( m_bitmapByContent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_buttonContent = new wxButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxSize( -1,42 ), 0 ); - m_buttonContent->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - m_buttonContent->SetToolTip( _("Files are found equal if\n - file content\nis the same") ); - - fgSizer16->Add( m_buttonContent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - sbSizer6->Add( fgSizer16, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - sbSizer6->Add( m_staticline14, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButtonHelp->SetToolTip( _("Help") ); - - m_bpButtonHelp->SetToolTip( _("Help") ); - - sbSizer6->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 ); - - - bSizer55->Add( 0, 4, 0, 0, 5 ); - - wxStaticBoxSizer* sbSizer25; - sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbolic Link handling") ), wxVERTICAL ); - - wxArrayString m_choiceHandleSymlinksChoices; - m_choiceHandleSymlinks = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleSymlinksChoices, 0 ); - m_choiceHandleSymlinks->SetSelection( 0 ); - sbSizer25->Add( m_choiceHandleSymlinks, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer55->Add( sbSizer25, 0, wxEXPAND|wxTOP, 5 ); - - wxBoxSizer* bSizer22; - bSizer22 = new wxBoxSizer( wxHORIZONTAL ); - - m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button10->SetDefault(); - m_button10->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer22->Add( m_button10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button6->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer22->Add( m_button6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer55->Add( bSizer22, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer136->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - this->SetSizer( bSizer136 ); - this->Layout(); - bSizer136->Fit( this ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CmpCfgDlgGenerated::OnClose ) ); - m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); - m_buttonTimeSize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); - m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); - m_buttonContent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); - m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnShowHelp ), NULL, this ); - m_choiceHandleSymlinks->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_button10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnOkay ), NULL, this ); - m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnCancel ), NULL, this ); -} - -CmpCfgDlgGenerated::~CmpCfgDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CmpCfgDlgGenerated::OnClose ) ); - m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); - m_buttonTimeSize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); - m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); - m_buttonContent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); - m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnShowHelp ), NULL, this ); - m_choiceHandleSymlinks->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); - m_button10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnOkay ), NULL, this ); - m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnCancel ), NULL, this ); -} - -SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( 470,300 ), wxDefaultSize ); - this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); - - wxBoxSizer* bSizer27; - bSizer27 = new wxBoxSizer( wxVERTICAL ); - - - bSizer27->Add( 0, 15, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer37; - bSizer37 = new wxBoxSizer( wxHORIZONTAL ); - - m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 )); - bSizer37->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - 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, _("Synchronization status"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText56->Wrap( -1 ); - m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); - - bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - m_panel8->SetSizer( bSizer72 ); - m_panel8->Layout(); - bSizer72->Fit( m_panel8 ); - bSizer37->Add( m_panel8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer42; - bSizer42 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer42->Add( 0, 0, 1, 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 ); - - m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextStatus->Wrap( -1 ); - m_staticTextStatus->SetFont( wxFont( 14, 70, 93, 90, false, wxEmptyString ) ); - - bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); - - bSizer27->Add( bSizer42, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer31 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer111; - bSizer111 = new wxBoxSizer( wxVERTICAL ); - - bSizerObjectsRemaining = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText25 = new wxStaticText( this, wxID_ANY, _("Elements remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText25->Wrap( -1 ); - m_staticText25->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizerObjectsRemaining->Add( m_staticText25, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextRemainingObj->Wrap( -1 ); - m_staticTextRemainingObj->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizerObjectsRemaining->Add( m_staticTextRemainingObj, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - m_staticText96 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText96->Wrap( -1 ); - m_staticText96->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerObjectsRemaining->Add( m_staticText96, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataRemaining->Wrap( -1 ); - m_staticTextDataRemaining->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerObjectsRemaining->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); - - m_staticText97 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText97->Wrap( -1 ); - m_staticText97->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerObjectsRemaining->Add( m_staticText97, 0, wxALIGN_BOTTOM, 5 ); - - bSizer111->Add( bSizerObjectsRemaining, 0, 0, 5 ); - - bSizerObjectsProcessed = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText251 = new wxStaticText( this, wxID_ANY, _("Elements processed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText251->Wrap( -1 ); - m_staticText251->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizerObjectsProcessed->Add( m_staticText251, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextProcessedObj = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); - m_staticTextProcessedObj->Wrap( -1 ); - m_staticTextProcessedObj->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizerObjectsProcessed->Add( m_staticTextProcessedObj, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - m_staticText98 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText98->Wrap( -1 ); - m_staticText98->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerObjectsProcessed->Add( m_staticText98, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - m_staticTextDataProcessed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextDataProcessed->Wrap( -1 ); - m_staticTextDataProcessed->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerObjectsProcessed->Add( m_staticTextDataProcessed, 0, wxALIGN_BOTTOM, 5 ); - - m_staticText99 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText99->Wrap( -1 ); - m_staticText99->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); - - bSizerObjectsProcessed->Add( m_staticText99, 0, wxALIGN_BOTTOM, 5 ); - - bSizer111->Add( bSizerObjectsProcessed, 0, 0, 5 ); - - bSizer31->Add( bSizer111, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); - - wxBoxSizer* bSizer114; - bSizer114 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText55 = new wxStaticText( this, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText55->Wrap( -1 ); - m_staticText55->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer114->Add( m_staticText55, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextTimeElapsed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeElapsed->Wrap( -1 ); - m_staticTextTimeElapsed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizer114->Add( m_staticTextTimeElapsed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - bSizer31->Add( bSizer114, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer27->Add( bSizer31, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 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, wxEXPAND|wxALL, 5 ); - - m_gauge1 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); - bSizer27->Add( m_gauge1, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bSizer28 = new wxBoxSizer( wxHORIZONTAL ); - - bSizerSpeed = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText108 = new wxStaticText( this, wxID_ANY, _("Speed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText108->Wrap( -1 ); - m_staticText108->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizerSpeed->Add( m_staticText108, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextSpeed->Wrap( -1 ); - m_staticTextSpeed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizerSpeed->Add( m_staticTextSpeed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - bSizer28->Add( bSizerSpeed, 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, 70, 90, 90, false, wxEmptyString ) ); - m_buttonOK->Enable( false ); - m_buttonOK->Hide(); - - bSizer28->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonPause = new wxButton( this, wxID_ANY, _("&Pause"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonPause->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer28->Add( m_buttonPause, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer28->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - bSizer28->Add( 0, 0, 1, 0, 5 ); - - bSizerRemTime = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText21 = new wxStaticText( this, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText21->Wrap( -1 ); - m_staticText21->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizerRemTime->Add( m_staticText21, 0, wxALIGN_BOTTOM, 5 ); - - m_staticTextTimeRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextTimeRemaining->Wrap( -1 ); - m_staticTextTimeRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); - - bSizerRemTime->Add( m_staticTextTimeRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); - - bSizer28->Add( bSizerRemTime, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); - - - bSizer27->Add( 0, 5, 0, wxEXPAND, 5 ); - - this->SetSizer( bSizer27 ); - this->Layout(); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); - this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( SyncStatusDlgGenerated::OnIconize ) ); - 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 ); -} - -SyncStatusDlgGenerated::~SyncStatusDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); - this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( SyncStatusDlgGenerated::OnIconize ) ); - 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 ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer20; - bSizer20 = new wxBoxSizer( wxVERTICAL ); - - - bSizer20->Add( 0, 10, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer85; - bSizer85 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap25 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer85->Add( m_bitmap25, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); - m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); - - 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, 70, 90, 92, false, wxEmptyString ) ); - - bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer72->Add( 20, 0, 0, 0, 5 ); - - m_panel8->SetSizer( bSizer72 ); - m_panel8->Layout(); - bSizer72->Fit( m_panel8 ); - bSizer85->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer85->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer20->Add( bSizer85, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - m_scrolledWindow1 = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL ); - m_scrolledWindow1->SetScrollRate( 5, 5 ); - m_scrolledWindow1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVEBORDER ) ); - - wxBoxSizer* bSizer70; - bSizer70 = new wxBoxSizer( wxVERTICAL ); - - m_staticText59 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("Compare by \"File size and date\""), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText59->Wrap( 500 ); - m_staticText59->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - - bSizer70->Add( m_staticText59, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticText60 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText60->Wrap( 500 ); - bSizer70->Add( m_staticText60, 0, wxALL, 5 ); - - m_staticText61 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("When the comparison is started with this option set the following decision tree is processed:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText61->Wrap( 500 ); - bSizer70->Add( m_staticText61, 0, wxALL, 5 ); - - m_treeCtrl1 = new wxTreeCtrl( m_scrolledWindow1, wxID_ANY, wxDefaultPosition, wxSize( -1,175 ), wxTR_DEFAULT_STYLE ); - m_treeCtrl1->SetBackgroundColour( wxColour( 237, 236, 235 ) ); - - bSizer70->Add( m_treeCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_staticText63 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("As a result the files are separated into the following categories:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText63->Wrap( 500 ); - bSizer70->Add( m_staticText63, 0, wxALL, 5 ); - - m_staticText75 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- equal"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText75->Wrap( -1 ); - bSizer70->Add( m_staticText75, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText76 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- left newer"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText76->Wrap( -1 ); - bSizer70->Add( m_staticText76, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText77 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- right newer"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText77->Wrap( -1 ); - bSizer70->Add( m_staticText77, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText79 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- exists left only"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText79->Wrap( -1 ); - bSizer70->Add( m_staticText79, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText80 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- exists right only"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText80->Wrap( -1 ); - bSizer70->Add( m_staticText80, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText78 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- conflict"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText78->Wrap( -1 ); - bSizer70->Add( m_staticText78, 0, wxRIGHT|wxLEFT, 5 ); - - m_scrolledWindow1->SetSizer( bSizer70 ); - m_scrolledWindow1->Layout(); - bSizer70->Fit( m_scrolledWindow1 ); - m_notebook1->AddPage( m_scrolledWindow1, _("File size and date"), true ); - m_scrolledWindow5 = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL ); - m_scrolledWindow5->SetScrollRate( 5, 5 ); - m_scrolledWindow5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVEBORDER ) ); - - wxBoxSizer* bSizer74; - bSizer74 = new wxBoxSizer( wxVERTICAL ); - - m_staticText65 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("Compare by \"File content\""), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText65->Wrap( 500 ); - m_staticText65->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - - bSizer74->Add( m_staticText65, 0, wxALL, 5 ); - - m_staticText66 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("As 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:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText66->Wrap( 500 ); - bSizer74->Add( m_staticText66, 0, wxALL, 5 ); - - m_treeCtrl2 = new wxTreeCtrl( m_scrolledWindow5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE ); - m_treeCtrl2->SetBackgroundColour( wxColour( 237, 236, 235 ) ); - m_treeCtrl2->SetMinSize( wxSize( -1,130 ) ); - - bSizer74->Add( m_treeCtrl2, 0, wxALL|wxEXPAND, 5 ); - - m_staticText69 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("As a result the files are separated into the following categories:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText69->Wrap( 500 ); - bSizer74->Add( m_staticText69, 0, wxALL, 5 ); - - m_staticText81 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- equal"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText81->Wrap( -1 ); - bSizer74->Add( m_staticText81, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText82 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- different"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText82->Wrap( -1 ); - bSizer74->Add( m_staticText82, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText83 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- exists left only"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText83->Wrap( -1 ); - bSizer74->Add( m_staticText83, 0, wxRIGHT|wxLEFT, 5 ); - - m_staticText84 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- exists right only"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText84->Wrap( -1 ); - bSizer74->Add( m_staticText84, 0, wxRIGHT|wxLEFT, 5 ); - - m_scrolledWindow5->SetSizer( bSizer74 ); - m_scrolledWindow5->Layout(); - bSizer74->Fit( m_scrolledWindow5 ); - m_notebook1->AddPage( m_scrolledWindow5, _("File content"), false ); - - bSizer20->Add( m_notebook1, 1, wxEXPAND | wxALL, 5 ); - - m_button8 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_button8->SetDefault(); - m_button8->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer20->Add( m_button8, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - this->SetSizer( bSizer20 ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HelpDlgGenerated::OnClose ) ); - m_button8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HelpDlgGenerated::OnOK ), NULL, this ); -} - -HelpDlgGenerated::~HelpDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HelpDlgGenerated::OnClose ) ); - m_button8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HelpDlgGenerated::OnOK ), NULL, this ); -} - -AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer31; - bSizer31 = new wxBoxSizer( wxVERTICAL ); - - - 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 ) ); - - wxBoxSizer* bSizer36; - bSizer36 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 404,55 ), 0 ); - bSizer36->Add( m_bitmap11, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_panel5->SetSizer( bSizer36 ); - m_panel5->Layout(); - bSizer36->Fit( m_panel5 ); - bSizer31->Add( m_panel5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_build = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_build->Wrap( -1 ); - m_build->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - - bSizer31->Add( m_build, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer31->Add( 0, 10, 0, 0, 5 ); - - wxBoxSizer* bSizer53; - bSizer53 = new wxBoxSizer( wxVERTICAL ); - - m_scrolledWindowCodeInfo = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); - m_scrolledWindowCodeInfo->SetScrollRate( 5, 5 ); - m_scrolledWindowCodeInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - m_scrolledWindowCodeInfo->SetMinSize( wxSize( -1,125 ) ); - - bSizerCodeInfo = new wxBoxSizer( wxVERTICAL ); - - m_staticText72 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _("Source code written completely in C++ utilizing:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText72->Wrap( -1 ); - m_staticText72->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); - - bSizerCodeInfo->Add( m_staticText72, 0, wxTOP|wxBOTTOM|wxLEFT|wxEXPAND, 5 ); - - m_staticText73 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _(" MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText73->Wrap( -1 ); - bSizerCodeInfo->Add( m_staticText73, 0, wxALL|wxEXPAND, 5 ); - - m_staticText74 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _("- ZenJu -"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText74->Wrap( -1 ); - m_staticText74->SetFont( wxFont( 10, 74, 93, 92, false, wxT("Segoe Print") ) ); - - bSizerCodeInfo->Add( m_staticText74, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_scrolledWindowCodeInfo->SetSizer( bSizerCodeInfo ); - m_scrolledWindowCodeInfo->Layout(); - bSizerCodeInfo->Fit( m_scrolledWindowCodeInfo ); - bSizer53->Add( m_scrolledWindowCodeInfo, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 10 ); - - m_scrolledWindowTranslators = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); - m_scrolledWindowTranslators->SetScrollRate( 5, 5 ); - m_scrolledWindowTranslators->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - m_scrolledWindowTranslators->SetMinSize( wxSize( -1,140 ) ); - m_scrolledWindowTranslators->SetMaxSize( wxSize( -1,140 ) ); - - bSizerTranslators = new wxBoxSizer( wxVERTICAL ); - - m_staticText54 = new wxStaticText( m_scrolledWindowTranslators, wxID_ANY, _("Big thanks for localizing FreeFileSync goes out to:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText54->Wrap( -1 ); - m_staticText54->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); - - bSizerTranslators->Add( m_staticText54, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); - - - bSizerTranslators->Add( 0, 5, 0, 0, 5 ); - - fgSizerTranslators = new wxFlexGridSizer( 1, 3, 5, 20 ); - fgSizerTranslators->SetFlexibleDirection( wxBOTH ); - fgSizerTranslators->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - bSizerTranslators->Add( fgSizerTranslators, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_scrolledWindowTranslators->SetSizer( bSizerTranslators ); - m_scrolledWindowTranslators->Layout(); - bSizerTranslators->Fit( m_scrolledWindowTranslators ); - bSizer53->Add( m_scrolledWindowTranslators, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 5 ); - - bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 25 ); - - m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - m_staticText131 = new wxStaticText( this, wxID_ANY, _("Feedback and suggestions are welcome at:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText131->Wrap( -1 ); - m_staticText131->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); - - bSizer31->Add( m_staticText131, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer31->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer104; - bSizer104 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer103; - bSizer103 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap9->SetToolTip( _("FreeFileSync at Sourceforge") ); - - bSizer103->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink1 = new wxHyperlinkCtrl( this, wxID_ANY, _("Homepage"), wxT("http://sourceforge.net/projects/freefilesync/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink1->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - m_hyperlink1->SetToolTip( _("http://sourceforge.net/projects/freefilesync/") ); - - bSizer103->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer103->Add( 20, 0, 1, wxEXPAND, 5 ); - - m_hyperlink6 = new wxHyperlinkCtrl( this, wxID_ANY, _("Report translation error"), wxT("http://sourceforge.net/projects/freefilesync/forums/forum/976976"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink6->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - m_hyperlink6->SetToolTip( _("http://sourceforge.net/projects/freefilesync/forums/forum/976976") ); - - bSizer103->Add( m_hyperlink6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - bSizer104->Add( bSizer103, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer108; - bSizer108 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - m_bitmap10->SetToolTip( _("Email") ); - - bSizer108->Add( m_bitmap10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink2 = new wxHyperlinkCtrl( this, wxID_ANY, _("Email"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink2->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - m_hyperlink2->SetToolTip( _("zhnmju123@gmx.de") ); - - bSizer108->Add( m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer108->Add( 30, 0, 1, wxEXPAND, 5 ); - - m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation); - m_animationControl1->SetToolTip( _("Donate with PayPal") ); - - bSizer108->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_hyperlink3 = new wxHyperlinkCtrl( this, wxID_ANY, _("If you like FFS"), wxT("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123%40gmx%2ede&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - m_hyperlink3->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - m_hyperlink3->SetToolTip( _("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123%40gmx%2ede&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8") ); - - bSizer108->Add( m_hyperlink3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - bSizer104->Add( bSizer108, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - bSizer31->Add( bSizer104, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - 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|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 ); - - m_hyperlink5 = new wxHyperlinkCtrl( this, wxID_ANY, _("http://www.gnu.org/licenses/gpl.html"), wxT("http://www.gnu.org/licenses/gpl.html"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); - sbSizer14->Add( m_hyperlink5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer31->Add( sbSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_buttonOkay = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); - m_buttonOkay->SetDefault(); - m_buttonOkay->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer31->Add( m_buttonOkay, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - this->SetSizer( bSizer31 ); - this->Layout(); - bSizer31->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); - m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); -} - -AboutDlgGenerated::~AboutDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); - m_buttonOkay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); -} - -ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer24; - bSizer24 = new wxBoxSizer( wxVERTICAL ); - - - bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer26; - bSizer26 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - - bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore subsequent errors"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxIgnoreErrors->SetToolTip( _("Hide further error messages during the current process") ); - - bSizer24->Add( m_checkBoxIgnoreErrors, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 10 ); - - - bSizer24->Add( 0, 5, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer25; - bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonIgnore = new wxButton( this, wxID_OK, _("&Ignore"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonIgnore->SetDefault(); - m_buttonIgnore->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonIgnore, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonRetry->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonRetry, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonAbort, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - - bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - this->SetSizer( bSizer24 ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ErrorDlgGenerated::OnClose ) ); - m_buttonIgnore->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnIgnore ), NULL, this ); - m_buttonRetry->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnRetry ), NULL, this ); - m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnAbort ), NULL, this ); -} - -ErrorDlgGenerated::~ErrorDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ErrorDlgGenerated::OnClose ) ); - m_buttonIgnore->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnIgnore ), NULL, this ); - m_buttonRetry->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnRetry ), NULL, this ); - m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnAbort ), NULL, this ); -} - -WarningDlgGenerated::WarningDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer24; - bSizer24 = new wxBoxSizer( wxVERTICAL ); - - - bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer26; - bSizer26 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - - bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); - - bSizer24->Add( m_checkBoxDontShowAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 10 ); - - - bSizer24->Add( 0, 5, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer25; - bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonIgnore = new wxButton( this, wxID_IGNORE, _("&Ignore"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonIgnore->SetDefault(); - m_buttonIgnore->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonIgnore, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonSwitch = new wxButton( this, wxID_MORE, _("&Switch"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonSwitch->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonSwitch, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonAbort, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - - bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - this->SetSizer( bSizer24 ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( WarningDlgGenerated::OnClose ) ); - m_buttonIgnore->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnIgnore ), NULL, this ); - m_buttonSwitch->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnSwitch ), NULL, this ); - m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnAbort ), NULL, this ); -} - -WarningDlgGenerated::~WarningDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( WarningDlgGenerated::OnClose ) ); - m_buttonIgnore->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnIgnore ), NULL, this ); - m_buttonSwitch->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnSwitch ), NULL, this ); - m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnAbort ), NULL, this ); -} - -QuestionDlgGenerated::QuestionDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer24; - bSizer24 = new wxBoxSizer( wxVERTICAL ); - - - bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer26; - bSizer26 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); - bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - - bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_checkBoxDontAskAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); - - bSizer24->Add( m_checkBoxDontAskAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 10 ); - - - bSizer24->Add( 0, 5, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer25; - bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonYes = new wxButton( this, wxID_YES, _("&Yes"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonYes->SetDefault(); - m_buttonYes->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonYes, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonNo = new wxButton( this, wxID_NO, _("&No"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonNo->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonNo, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonCancel->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonCancel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - - bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - this->SetSizer( bSizer24 ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( QuestionDlgGenerated::OnClose ) ); - m_buttonYes->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnYes ), NULL, this ); - m_buttonNo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnNo ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCancel ), NULL, this ); -} - -QuestionDlgGenerated::~QuestionDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( QuestionDlgGenerated::OnClose ) ); - m_buttonYes->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnYes ), NULL, this ); - m_buttonNo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnNo ), NULL, this ); - m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCancel ), NULL, this ); -} - -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 ); - - wxBoxSizer* bSizer24; - bSizer24 = new wxBoxSizer( wxVERTICAL ); - - - bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer41; - bSizer41 = new wxBoxSizer( wxHORIZONTAL ); - - - bSizer41->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_bitmap12 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer41->Add( m_bitmap12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextHeader->Wrap( -1 ); - m_staticTextHeader->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer41->Add( m_staticTextHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer41->Add( 0, 0, 1, wxEXPAND, 5 ); - - bSizer24->Add( bSizer41, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer99; - bSizer99 = new wxBoxSizer( wxHORIZONTAL ); - - m_checkBoxDeleteBothSides = new wxCheckBox( this, wxID_ANY, _("Delete on both sides"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxDeleteBothSides->SetToolTip( _("Delete on both sides even if the file is selected on one side only") ); - - bSizer99->Add( m_checkBoxDeleteBothSides, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer99->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - - m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); - m_checkBoxUseRecycler->SetValue(true); - - bSizer99->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer24->Add( bSizer99, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); - - m_textCtrlMessage = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); - m_textCtrlMessage->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); - - bSizer24->Add( m_textCtrlMessage, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer25; - bSizer25 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonOK->SetDefault(); - m_buttonOK->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonOK, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); - - m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonCancel->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer25->Add( m_buttonCancel, 0, wxALL, 5 ); - - bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - this->SetSizer( bSizer24 ); - this->Layout(); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); - m_checkBoxDeleteBothSides->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); - m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), NULL, this ); - m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); - m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); -} - -DeleteDlgGenerated::~DeleteDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); - m_checkBoxDeleteBothSides->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); - m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), NULL, this ); - m_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 ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer21; - bSizer21 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer86; - bSizer86 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmap26 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer86->Add( m_bitmap26, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - - m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); - m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); - - wxBoxSizer* bSizer72; - bSizer72 = new wxBoxSizer( wxVERTICAL ); - - m_staticTexHeader = new wxStaticText( m_panel8, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTexHeader->Wrap( -1 ); - m_staticTexHeader->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); - - bSizer72->Add( m_staticTexHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - m_panel8->SetSizer( bSizer72 ); - m_panel8->Layout(); - bSizer72->Fit( m_panel8 ); - bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - - bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer21->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer70; - bSizer70 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the base synchronization directories."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText44->Wrap( 400 ); - bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButtonHelp->SetToolTip( _("Help") ); - - m_bpButtonHelp->SetToolTip( _("Help") ); - - bSizer70->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - bSizer21->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); - - - bSizer21->Add( 0, 5, 0, 0, 5 ); - - m_panel13 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - wxBoxSizer* bSizer69; - bSizer69 = new wxBoxSizer( wxVERTICAL ); - - m_staticline10 = new wxStaticLine( m_panel13, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer69->Add( m_staticline10, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer52; - bSizer52 = new wxBoxSizer( wxVERTICAL ); - - m_staticText45 = new wxStaticText( m_panel13, wxID_ANY, _("Hints:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText45->Wrap( -1 ); - m_staticText45->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); - - bSizer52->Add( m_staticText45, 0, wxBOTTOM, 5 ); - - m_staticText83 = new wxStaticText( m_panel13, wxID_ANY, _("1. Enter relative file or directory names separated by ';' or a new line."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText83->Wrap( -1 ); - bSizer52->Add( m_staticText83, 0, 0, 5 ); - - m_staticText84 = new wxStaticText( m_panel13, wxID_ANY, _("2. Use wildcard characters '*' and '?'."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText84->Wrap( -1 ); - bSizer52->Add( m_staticText84, 0, 0, 5 ); - - m_staticText85 = new wxStaticText( m_panel13, wxID_ANY, _("3. Exclude files directly on main grid via context menu."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText85->Wrap( -1 ); - bSizer52->Add( m_staticText85, 0, 0, 5 ); - - bSizer69->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); - - wxStaticBoxSizer* sbSizer21; - sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( m_panel13, wxID_ANY, _("Example") ), wxVERTICAL ); - - wxBoxSizer* bSizer66; - bSizer66 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: \\stuff\\temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText181->Wrap( -1 ); - bSizer66->Add( m_staticText181, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticText1811 = new wxStaticText( m_panel13, wxID_ANY, _("Synchronize all .doc, .zip and .exe files except everything in subfolder \"temp\"."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText1811->Wrap( 250 ); - m_staticText1811->SetFont( wxFont( 8, 70, 93, 90, false, wxEmptyString ) ); - - bSizer66->Add( m_staticText1811, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); - - sbSizer21->Add( bSizer66, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); - - bSizer69->Add( sbSizer21, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_panel13->SetSizer( bSizer69 ); - m_panel13->Layout(); - bSizer69->Fit( m_panel13 ); - bSizer21->Add( m_panel13, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxEXPAND, 5 ); - - wxStaticBoxSizer* sbSizer8; - sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); - - wxFlexGridSizer* fgSizer3; - fgSizer3 = new wxFlexGridSizer( 2, 2, 0, 0 ); - fgSizer3->AddGrowableCol( 1 ); - fgSizer3->AddGrowableRow( 1 ); - fgSizer3->SetFlexibleDirection( wxBOTH ); - fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText15 = new wxStaticText( this, wxID_ANY, _("Include"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText15->Wrap( -1 ); - m_staticText15->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer3->Add( m_staticText15, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_bitmap8 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); - fgSizer3->Add( m_bitmap8, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_textCtrlInclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); - fgSizer3->Add( m_textCtrlInclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - sbSizer8->Add( fgSizer3, 1, wxEXPAND, 5 ); - - wxFlexGridSizer* fgSizer4; - fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 ); - fgSizer4->AddGrowableCol( 1 ); - fgSizer4->AddGrowableRow( 1 ); - fgSizer4->SetFlexibleDirection( wxBOTH ); - fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_staticText16 = new wxStaticText( this, wxID_ANY, _("Exclude"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText16->Wrap( -1 ); - m_staticText16->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer4->Add( m_staticText16, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); - fgSizer4->Add( m_bitmap9, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlExclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); - fgSizer4->Add( m_textCtrlExclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - sbSizer8->Add( fgSizer4, 1, wxEXPAND, 5 ); - - bSizer21->Add( sbSizer8, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|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( -1,30 ), 0 ); - m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer22->Add( m_button9, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer22->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button10->SetDefault(); - m_button10->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer22->Add( m_button10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_button17 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button17->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer22->Add( m_button17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bSizer21->Add( bSizer22, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxEXPAND, 5 ); - - this->SetSizer( bSizer21 ); - this->Layout(); - bSizer21->Fit( this ); - - this->Centre( wxBOTH ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( FilterDlgGenerated::OnClose ) ); - m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnHelp ), NULL, this ); - m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnDefault ), NULL, this ); - m_button10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnApply ), NULL, this ); - m_button17->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnCancel ), NULL, this ); -} - -FilterDlgGenerated::~FilterDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( FilterDlgGenerated::OnClose ) ); - m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnHelp ), NULL, this ); - m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnDefault ), NULL, this ); - m_button10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnApply ), NULL, this ); - m_button17->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnCancel ), NULL, this ); -} - -CustomizeColsDlgGenerated::CustomizeColsDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - - wxBoxSizer* bSizer96; - bSizer96 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer99; - bSizer99 = new wxBoxSizer( wxHORIZONTAL ); - - wxArrayString m_checkListColumnsChoices; - m_checkListColumns = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkListColumnsChoices, 0 ); - bSizer99->Add( m_checkListColumns, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer98; - bSizer98 = new wxBoxSizer( wxVERTICAL ); - - m_bpButton29 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButton29->SetToolTip( _("Move column up") ); - - m_bpButton29->SetToolTip( _("Move column up") ); - - bSizer98->Add( m_bpButton29, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); - - m_bpButton30 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); - m_bpButton30->SetToolTip( _("Move column down") ); - - m_bpButton30->SetToolTip( _("Move column down") ); - - bSizer98->Add( m_bpButton30, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bSizer99->Add( bSizer98, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer96->Add( bSizer99, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - wxBoxSizer* bSizer97; - bSizer97 = new wxBoxSizer( wxHORIZONTAL ); - - m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button9, 0, wxALL, 5 ); - - - bSizer97->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - m_button28 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button28->SetDefault(); - m_button28->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer97->Add( m_button28, 0, wxALL, 5 ); - - m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button29, 0, wxALL, 5 ); - - bSizer96->Add( bSizer97, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - this->SetSizer( bSizer96 ); - this->Layout(); - bSizer96->Fit( this ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CustomizeColsDlgGenerated::OnClose ) ); - m_bpButton29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveUp ), NULL, this ); - m_bpButton30->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveDown ), NULL, this ); - m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); - m_button28->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), NULL, this ); - m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnCancel ), NULL, this ); -} - -CustomizeColsDlgGenerated::~CustomizeColsDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CustomizeColsDlgGenerated::OnClose ) ); - m_bpButton29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveUp ), NULL, this ); - m_bpButton30->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveDown ), NULL, this ); - m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); - m_button28->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), NULL, this ); - m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnCancel ), NULL, this ); -} - -GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxSize( 280,230 ), wxDefaultSize ); - - wxBoxSizer* bSizer95; - bSizer95 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer86; - bSizer86 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapSettings = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); - bSizer86->Add( m_bitmapSettings, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - - bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - 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, _("Global settings"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText56->Wrap( -1 ); - m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); - - bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - m_panel8->SetSizer( bSizer72 ); - m_panel8->Layout(); - bSizer72->Fit( m_panel8 ); - bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); - - bSizer95->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - bSizer95->Add( 0, 10, 0, 0, 5 ); - - wxStaticBoxSizer* sbSizer23; - sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); - - m_checkBoxIgnoreOneHour = new wxCheckBox( this, wxID_ANY, _("Ignore 1-hour file time difference"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxIgnoreOneHour->SetToolTip( _("Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes") ); - - sbSizer23->Add( m_checkBoxIgnoreOneHour, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_checkBoxCopyLocked = new wxCheckBox( this, wxID_ANY, _("Copy locked files"), wxDefaultPosition, wxDefaultSize, 0 ); - - m_checkBoxCopyLocked->SetToolTip( _("Copy shared or locked files using Volume Shadow Copy Service") ); - - sbSizer23->Add( m_checkBoxCopyLocked, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - sbSizer23->Add( m_staticline10, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer101; - bSizer101 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText100 = new wxStaticText( this, wxID_ANY, _("Hidden dialogs:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText100->Wrap( -1 ); - bSizer101->Add( m_staticText100, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer101->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_buttonResetDialogs = new wxButtonWithImage( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxSize( 80,-1 ), 0 ); - m_buttonResetDialogs->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - m_buttonResetDialogs->SetToolTip( _("Show hidden dialogs") ); - - bSizer101->Add( m_buttonResetDialogs, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizer23->Add( bSizer101, 0, wxEXPAND, 5 ); - - bSizer95->Add( sbSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - - bSizer95->Add( 0, 10, 0, 0, 5 ); - - wxStaticBoxSizer* sbSizer26; - sbSizer26 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("External applications") ), wxHORIZONTAL ); - - - sbSizer26->Add( 5, 0, 0, 0, 5 ); - - m_gridCustomCommand = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); - - // Grid - m_gridCustomCommand->CreateGrid( 5, 2 ); - m_gridCustomCommand->EnableEditing( true ); - m_gridCustomCommand->EnableGridLines( true ); - m_gridCustomCommand->EnableDragGridSize( false ); - m_gridCustomCommand->SetMargins( 0, 0 ); - - // Columns - m_gridCustomCommand->SetColSize( 0, 98 ); - m_gridCustomCommand->SetColSize( 1, 179 ); - m_gridCustomCommand->EnableDragColMove( false ); - m_gridCustomCommand->EnableDragColSize( true ); - m_gridCustomCommand->SetColLabelSize( 20 ); - m_gridCustomCommand->SetColLabelValue( 0, _("Description") ); - m_gridCustomCommand->SetColLabelValue( 1, _("Command line") ); - m_gridCustomCommand->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Rows - m_gridCustomCommand->EnableDragRowSize( false ); - m_gridCustomCommand->SetRowLabelSize( 0 ); - m_gridCustomCommand->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); - - // Label Appearance - - // Cell Defaults - m_gridCustomCommand->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); - sbSizer26->Add( m_gridCustomCommand, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - wxBoxSizer* bSizer157; - bSizer157 = new wxBoxSizer( wxVERTICAL ); - - m_bpButtonAddRow = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - bSizer157->Add( m_bpButtonAddRow, 0, 0, 5 ); - - m_bpButtonRemoveRow = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); - bSizer157->Add( m_bpButtonRemoveRow, 0, 0, 5 ); - - sbSizer26->Add( bSizer157, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - - sbSizer26->Add( 5, 0, 0, 0, 5 ); - - bSizer95->Add( sbSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - wxBoxSizer* bSizer97; - bSizer97 = new wxBoxSizer( wxHORIZONTAL ); - - m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button9, 0, wxALL, 5 ); - - - bSizer97->Add( 0, 0, 1, 0, 5 ); - - m_buttonOkay = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonOkay->SetDefault(); - m_buttonOkay->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer97->Add( m_buttonOkay, 0, wxALL, 5 ); - - m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button29, 0, wxALL, 5 ); - - bSizer95->Add( bSizer97, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - this->SetSizer( bSizer95 ); - this->Layout(); - bSizer95->Fit( this ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); - m_buttonResetDialogs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnResetDialogs ), NULL, this ); - m_bpButtonAddRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnAddRow ), NULL, this ); - m_bpButtonRemoveRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnRemoveRow ), NULL, this ); - m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); - m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); - m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); -} - -GlobalSettingsDlgGenerated::~GlobalSettingsDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); - m_buttonResetDialogs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnResetDialogs ), NULL, this ); - m_bpButtonAddRow->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnAddRow ), NULL, this ); - m_bpButtonRemoveRow->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnRemoveRow ), NULL, this ); - m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); - m_buttonOkay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); - m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); -} - -SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( 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* bSizer134; - bSizer134 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer158; - bSizer158 = new wxBoxSizer( wxHORIZONTAL ); - - m_buttonStartSync = new wxButtonWithImage( this, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); - m_buttonStartSync->SetDefault(); - m_buttonStartSync->SetFont( wxFont( 14, 70, 90, 92, false, wxT("Arial Black") ) ); - m_buttonStartSync->SetToolTip( _("Start synchronization") ); - - bSizer158->Add( m_buttonStartSync, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticline16 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); - bSizer158->Add( m_staticline16, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - wxStaticBoxSizer* sbSizer28; - sbSizer28 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Variant") ), wxVERTICAL ); - - m_staticTextVariant = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextVariant->Wrap( -1 ); - m_staticTextVariant->SetFont( wxFont( 10, 70, 90, 92, false, wxT("Arial Black") ) ); - - sbSizer28->Add( m_staticTextVariant, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer158->Add( sbSizer28, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); - - bSizer134->Add( bSizer158, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - - m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline14, 0, wxEXPAND, 5 ); - - wxBoxSizer* bSizer141; - bSizer141 = new wxBoxSizer( wxHORIZONTAL ); - - wxStaticBoxSizer* sbSizer161; - sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Statistics") ), wxVERTICAL ); - - wxBoxSizer* bSizer157; - bSizer157 = new wxBoxSizer( wxHORIZONTAL ); - - wxFlexGridSizer* fgSizer5; - fgSizer5 = new wxFlexGridSizer( 4, 2, 0, 5 ); - fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - - fgSizer5->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticText94 = new wxStaticText( this, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText94->Wrap( -1 ); - m_staticText94->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer5->Add( m_staticText94, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapCreate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapCreate->SetToolTip( _("Number of files and directories that will be created") ); - - fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_textCtrlCreateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlCreateL->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlCreateL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlCreateL->SetToolTip( _("Number of files and directories that will be created") ); - - fgSizer5->Add( m_textCtrlCreateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapUpdate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer5->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_textCtrlUpdateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlUpdateL->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlUpdateL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlUpdateL->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer5->Add( m_textCtrlUpdateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_bitmapDelete = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapDelete->SetToolTip( _("Number of files and directories that will be deleted") ); - - fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlDeleteL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlDeleteL->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlDeleteL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlDeleteL->SetToolTip( _("Number of files and directories that will be deleted") ); - - fgSizer5->Add( m_textCtrlDeleteL, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer157->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); - - wxFlexGridSizer* fgSizer51; - fgSizer51 = new wxFlexGridSizer( 3, 1, 0, 5 ); - fgSizer51->SetFlexibleDirection( wxHORIZONTAL ); - fgSizer51->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); - - m_staticText95 = new wxStaticText( this, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText95->Wrap( -1 ); - m_staticText95->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); - - fgSizer51->Add( m_staticText95, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlCreateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlCreateR->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlCreateR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlCreateR->SetToolTip( _("Number of files and directories that will be created") ); - - fgSizer51->Add( m_textCtrlCreateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlUpdateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlUpdateR->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlUpdateR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlUpdateR->SetToolTip( _("Number of files that will be overwritten") ); - - fgSizer51->Add( m_textCtrlUpdateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlDeleteR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlDeleteR->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlDeleteR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlDeleteR->SetToolTip( _("Number of files and directories that will be deleted") ); - - fgSizer51->Add( m_textCtrlDeleteR, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer157->Add( fgSizer51, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); - - sbSizer161->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - - sbSizer161->Add( 0, 10, 0, 0, 5 ); - - wxBoxSizer* bSizer156; - bSizer156 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapData = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - m_bitmapData->SetToolTip( _("Total amount of data that will be transferred") ); - - bSizer156->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); - - - bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); - - m_textCtrlData = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); - m_textCtrlData->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); - m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); - m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); - - bSizer156->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); - - sbSizer161->Add( bSizer156, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); - - bSizer141->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); - - bSizer134->Add( bSizer141, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); - - m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); - bSizer134->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); - - wxBoxSizer* bSizer142; - bSizer142 = new wxBoxSizer( wxHORIZONTAL ); - - m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); - - bSizer142->Add( m_checkBoxDontShowAgain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - - bSizer142->Add( 10, 0, 1, 0, 5 ); - - m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button16->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer142->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - - bSizer134->Add( bSizer142, 0, wxEXPAND, 5 ); - - this->SetSizer( bSizer134 ); - this->Layout(); - bSizer134->Fit( this ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncPreviewDlgGenerated::OnClose ) ); - m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnStartSync ), NULL, this ); - m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnCancel ), NULL, this ); -} - -SyncPreviewDlgGenerated::~SyncPreviewDlgGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncPreviewDlgGenerated::OnClose ) ); - m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnStartSync ), NULL, this ); - m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnCancel ), NULL, this ); -} - -PopupFrameGenerated1::PopupFrameGenerated1( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) -{ - this->SetSizeHints( wxDefaultSize, wxDefaultSize ); - this->SetBackgroundColour( wxColour( 255, 255, 255 ) ); - - wxBoxSizer* bSizer158; - bSizer158 = new wxBoxSizer( wxHORIZONTAL ); - - m_bitmapLeft = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); - bSizer158->Add( m_bitmapLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_staticTextMain = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticTextMain->Wrap( 600 ); - bSizer158->Add( m_staticTextMain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); - - this->SetSizer( bSizer158 ); - this->Layout(); - bSizer158->Fit( this ); -} - -PopupFrameGenerated1::~PopupFrameGenerated1() -{ -} - -SearchDialogGenerated::SearchDialogGenerated( 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* bSizer161; - bSizer161 = new wxBoxSizer( wxHORIZONTAL ); - - wxBoxSizer* bSizer166; - bSizer166 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer162; - bSizer162 = new wxBoxSizer( wxHORIZONTAL ); - - m_staticText101 = new wxStaticText( this, wxID_ANY, _("Find what:"), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText101->Wrap( -1 ); - bSizer162->Add( m_staticText101, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - m_textCtrlSearchTxt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 220,-1 ), 0 ); - bSizer162->Add( m_textCtrlSearchTxt, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); - - bSizer166->Add( bSizer162, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - - - bSizer166->Add( 0, 10, 0, 0, 5 ); - - m_checkBoxMatchCase = new wxCheckBox( this, wxID_ANY, _("Match case"), wxDefaultPosition, wxDefaultSize, 0 ); - - bSizer166->Add( m_checkBoxMatchCase, 0, wxALL|wxEXPAND, 5 ); - - bSizer161->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL, 5 ); - - wxBoxSizer* bSizer97; - bSizer97 = new wxBoxSizer( wxVERTICAL ); - - m_buttonFindNext = new wxButton( this, wxID_OK, _("&Find next"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_buttonFindNext->SetDefault(); - m_buttonFindNext->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); - - bSizer97->Add( m_buttonFindNext, 0, wxALL|wxEXPAND, 5 ); - - m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); - m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); - - bSizer97->Add( m_button29, 0, wxALL|wxEXPAND, 5 ); - - bSizer161->Add( bSizer97, 0, wxALIGN_CENTER_VERTICAL, 5 ); - - this->SetSizer( bSizer161 ); - this->Layout(); - bSizer161->Fit( this ); - - // Connect Events - this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SearchDialogGenerated::OnClose ) ); - m_textCtrlSearchTxt->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SearchDialogGenerated::OnText ), NULL, this ); - m_buttonFindNext->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnFindNext ), NULL, this ); - m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnCancel ), NULL, this ); -} - -SearchDialogGenerated::~SearchDialogGenerated() -{ - // Disconnect Events - this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SearchDialogGenerated::OnClose ) ); - m_textCtrlSearchTxt->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SearchDialogGenerated::OnText ), NULL, this ); - m_buttonFindNext->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnFindNext ), NULL, this ); - m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnCancel ), NULL, this ); -} diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h deleted file mode 100644 index f4793fc6..00000000 --- a/ui/guiGenerated.h +++ /dev/null @@ -1,1443 +0,0 @@ -/////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Apr 16 2008) -// http://www.wxformbuilder.org/ -// -// PLEASE DO "NOT" EDIT THIS FILE! -/////////////////////////////////////////////////////////////////////////// - -#ifndef __guiGenerated__ -#define __guiGenerated__ - -#include - -class CustomComboBox; -class CustomGridLeft; -class CustomGridMiddle; -class CustomGridRight; -class ToggleButton; -class wxButtonWithImage; - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/////////////////////////////////////////////////////////////////////////// - - -/////////////////////////////////////////////////////////////////////////////// -/// Class MainDialogGenerated -/////////////////////////////////////////////////////////////////////////////// -class MainDialogGenerated : public wxFrame -{ -private: - -protected: - wxMenuBar* m_menubar1; - wxMenu* m_menuFile; - wxMenuItem* m_menuItem10; - wxMenuItem* m_menuItem11; - wxMenuItem* m_menuItemSwitchView; - wxMenuItem* m_menuItemNew; - wxMenuItem* m_menuItemSave; - wxMenuItem* m_menuItemLoad; - wxMenu* m_menuAdvanced; - wxMenu* m_menuLanguages; - wxMenuItem* m_menuItemGlobSett; - wxMenuItem* m_menuItem7; - wxMenu* m_menuHelp; - wxMenuItem* m_menuItemCheckVer; - wxMenuItem* m_menuItemAbout; - wxBoxSizer* bSizer1; - wxPanel* m_panel71; - wxBoxSizer* bSizer6; - - wxStaticText* m_staticTextCmpVariant; - - wxButtonWithImage* m_buttonCompare; - wxButton* m_buttonAbort; - wxBitmapButton* m_bpButtonCmpConfig; - - - wxStaticText* m_staticTextSyncVariant; - wxBitmapButton* m_bpButtonSyncConfig; - wxButtonWithImage* m_buttonStartSync; - - wxStaticBoxSizer* sbSizer2; - wxPanel* m_panelTopMiddle; - - wxBoxSizer* bSizerMiddle; - wxBitmapButton* m_bpButtonSwapSides; - - - - wxBitmapButton* m_bpButtonAddPair; - wxScrolledWindow* m_scrolledWindowFolderPairs; - wxBoxSizer* bSizerAddFolderPairs; - wxBoxSizer* bSizerGridHolder; - CustomGridLeft* m_gridLeft; - wxPanel* m_panelMiddle; - CustomGridMiddle* m_gridMiddle; - CustomGridRight* m_gridRight; - wxPanel* m_panelBottom; - wxBoxSizer* bSizer3; - wxNotebook* m_notebookBottomLeft; - wxPanel* m_panel30; - wxBitmapButton* m_bpButtonSave; - wxBitmapButton* m_bpButtonLoad; - wxChoice* m_choiceHistory; - wxPanel* m_panelFilter; - wxBitmapButton* m_bpButtonFilter; - wxCheckBox* m_checkBoxHideFilt; - wxPanel* m_panelViewFilter; - - ToggleButton* m_bpButtonSyncCreateLeft; - ToggleButton* m_bpButtonSyncDirOverwLeft; - ToggleButton* m_bpButtonSyncDeleteLeft; - ToggleButton* m_bpButtonLeftOnly; - ToggleButton* m_bpButtonLeftNewer; - ToggleButton* m_bpButtonEqual; - ToggleButton* m_bpButtonDifferent; - ToggleButton* m_bpButtonSyncDirNone; - ToggleButton* m_bpButtonRightNewer; - ToggleButton* m_bpButtonRightOnly; - ToggleButton* m_bpButtonSyncDeleteRight; - ToggleButton* m_bpButtonSyncDirOverwRight; - ToggleButton* m_bpButtonSyncCreateRight; - ToggleButton* m_bpButtonConflict; - - wxBoxSizer* bSizerBottomRight; - - wxPanel* m_panelSyncPreview; - wxStaticBitmap* m_bitmapCreate; - wxTextCtrl* m_textCtrlCreate; - wxStaticBitmap* m_bitmapDelete; - wxTextCtrl* m_textCtrlDelete; - wxStaticBitmap* m_bitmapUpdate; - wxTextCtrl* m_textCtrlUpdate; - wxStaticBitmap* m_bitmapData; - wxTextCtrl* m_textCtrlData; - wxBitmapButton* m_bpButton10; - wxPanel* m_panelStatusBar; - - 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 OnCompare( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnStartSync( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSwitchView( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnNewConfig( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSaveConfig( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnLoadConfig( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMenuQuit( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMenuGlobalSettings( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMenuBatchJob( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMenuExportFileList( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnShowHelp( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMenuCheckVersion( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMenuAbout( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCmpSettings( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncSettings( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnDirSelected( wxFileDirPickerEvent& event ) - { - event.Skip(); - } - virtual void OnSwapSides( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnAddFolderPair( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnRemoveTopFolderPair( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnLeftGridDoubleClick( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnContextRim( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnSortLeftGrid( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnContextRimLabelLeft( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnContextMiddle( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnSortMiddleGrid( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnContextMiddleLabel( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnRightGridDoubleClick( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnSortRightGrid( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnContextRimLabelRight( wxGridEvent& event ) - { - event.Skip(); - } - virtual void OnCfgHistoryKeyEvent( wxKeyEvent& event ) - { - event.Skip(); - } - virtual void OnLoadFromHistory( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnConfigureFilter( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnHideFilteredButton( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncCreateLeft( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncDirLeft( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncDeleteLeft( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnLeftOnlyFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnLeftNewerFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnEqualFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnDifferentFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncDirNone( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnRightNewerFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnRightOnlyFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncDeleteRight( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncDirRight( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncCreateRight( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnConflictFiles( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnQuit( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - wxPanel* m_panelTopLeft; - CustomComboBox* m_directoryLeft; - wxDirPickerCtrl* m_dirPickerLeft; - wxBitmapButton* m_bpButtonLocalFilter; - wxBitmapButton* m_bpButtonAltSyncCfg; - wxPanel* m_panelTopRight; - wxBitmapButton* m_bpButtonRemovePair; - CustomComboBox* m_directoryRight; - wxDirPickerCtrl* m_dirPickerRight; - wxPanel* m_panelLeft; - wxPanel* m_panelRight; - MainDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 933,612 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); - ~MainDialogGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class FolderPairGenerated -/////////////////////////////////////////////////////////////////////////////// -class FolderPairGenerated : public wxPanel -{ -private: - -protected: - wxPanel* m_panel20; - - - - -public: - wxPanel* m_panelLeft; - wxTextCtrl* m_directoryLeft; - wxDirPickerCtrl* m_dirPickerLeft; - wxPanel* m_panel21; - wxBitmapButton* m_bpButtonLocalFilter; - wxBitmapButton* m_bpButtonAltSyncCfg; - wxPanel* m_panelRight; - wxBitmapButton* m_bpButtonRemovePair; - wxTextCtrl* m_directoryRight; - wxDirPickerCtrl* m_dirPickerRight; - FolderPairGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); - ~FolderPairGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class BatchFolderPairGenerated -/////////////////////////////////////////////////////////////////////////////// -class BatchFolderPairGenerated : public wxPanel -{ -private: - -protected: - wxPanel* m_panel32; - wxStaticText* m_staticText53; - wxStaticText* m_staticText541; - wxPanel* m_panelLeft; - wxPanel* m_panelRight; - - -public: - wxBitmapButton* m_bpButtonRemovePair; - wxTextCtrl* m_directoryLeft; - wxDirPickerCtrl* m_dirPickerLeft; - wxBitmapButton* m_bpButtonLocalFilter; - wxTextCtrl* m_directoryRight; - wxDirPickerCtrl* m_dirPickerRight; - wxBitmapButton* m_bpButtonAltSyncCfg; - BatchFolderPairGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); - ~BatchFolderPairGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class BatchDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class BatchDlgGenerated : public wxDialog -{ -private: - -protected: - wxBoxSizer* bSizer69; - wxStaticBitmap* m_bitmap27; - wxPanel* m_panel8; - wxStaticText* m_staticText56; - - - wxStaticText* m_staticText44; - wxBitmapButton* m_bpButtonHelp; - - wxStaticLine* m_staticline10; - wxStaticText* m_staticText531; - wxNotebook* m_notebookSettings; - wxPanel* m_panelOverview; - wxBitmapButton* m_bpButtonCmpConfig; - - wxStaticText* m_staticTextCmpVariant; - - wxBitmapButton* m_bpButtonFilter; - - wxStaticText* m_staticTextSyncVariant; - - wxBitmapButton* m_bpButtonSyncConfig; - - wxBoxSizer* sbSizerMainPair; - wxPanel* m_panelMainPair; - wxStaticText* m_staticText532; - wxStaticText* m_staticText5411; - wxBoxSizer* bSizerAddFolderPairs; - - - wxCheckBox* m_checkBoxSilent; - - wxChoice* m_choiceHandleError; - wxPanel* m_panelLogging; - wxStaticText* m_staticText120; - wxTextCtrl* m_textCtrlLogfileDir; - wxDirPickerCtrl* m_dirPickerLogfileDir; - wxButton* m_buttonSave; - wxButton* m_buttonLoad; - wxButton* m_button6; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnHelp( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCmpSettings( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnConfigureFilter( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncSettings( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnAddFolderPair( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnRemoveTopFolderPair( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCheckSilent( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnChangeErrorHandling( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSaveBatchJob( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnLoadBatchJob( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - wxScrolledWindow* m_scrolledWindow6; - wxBitmapButton* m_bpButtonAddPair; - wxBitmapButton* m_bpButtonRemovePair; - wxPanel* m_panelLeft; - wxTextCtrl* m_directoryLeft; - wxDirPickerCtrl* m_dirPickerLeft; - wxBitmapButton* m_bpButtonLocalFilter; - wxPanel* m_panelRight; - wxTextCtrl* m_directoryRight; - wxDirPickerCtrl* m_dirPickerRight; - wxBitmapButton* m_bpButtonAltSyncCfg; - BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Create a batch job"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~BatchDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class CompareStatusGenerated -/////////////////////////////////////////////////////////////////////////////// -class CompareStatusGenerated : public wxPanel -{ -private: - -protected: - wxBoxSizer* bSizer42; - wxBoxSizer* bSizerFilesFound; - wxStaticText* m_staticText321; - wxStaticText* m_staticTextScanned; - wxBoxSizer* bSizerFilesRemaining; - wxStaticText* m_staticText46; - wxStaticText* m_staticTextFilesRemaining; - wxStaticText* m_staticText117; - wxStaticText* m_staticTextDataRemaining; - wxStaticText* m_staticText118; - - wxBoxSizer* sSizerSpeed; - wxStaticText* m_staticText104; - wxStaticText* m_staticTextSpeed; - - wxBoxSizer* sSizerTimeRemaining; - wxStaticText* m_staticTextTimeRemFixed; - wxStaticText* m_staticTextTimeRemaining; - - wxBoxSizer* sSizerTimeElapsed; - wxStaticText* m_staticTextTimeElapsed; - wxStaticText* m_staticText30; - wxTextCtrl* m_textCtrlStatus; - wxGauge* m_gauge2; - -public: - CompareStatusGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); - ~CompareStatusGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class SyncCfgDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class SyncCfgDlgGenerated : public wxDialog -{ -private: - -protected: - wxStaticText* m_staticText1; - wxRadioButton* m_radioBtnAutomatic; - wxButton* m_buttonAutomatic; - wxStaticText* m_staticText81; - wxRadioButton* m_radioBtnMirror; - wxButton* m_buttonOneWay; - wxStaticText* m_staticText8; - wxRadioButton* m_radioBtnUpdate; - wxButton* m_buttonUpdate; - wxStaticText* m_staticText101; - wxRadioButton* m_radioBtnCustom; - - wxStaticText* m_staticText23; - - wxStaticText* m_staticText9; - - wxBoxSizer* bSizer201; - wxStaticBoxSizer* sbSizerErrorHandling; - wxChoice* m_choiceHandleError; - wxChoice* m_choiceHandleDeletion; - wxPanel* m_panelCustomDeletionDir; - wxTextCtrl* m_textCtrlCustomDelFolder; - wxDirPickerCtrl* m_dirPickerCustomDelFolder; - - wxButton* m_buttonOK; - wxButton* m_button16; - - - wxStaticBoxSizer* sbSizerSyncDirections; - wxStaticText* m_staticText21; - wxStaticText* m_staticText31; - wxStaticLine* m_staticline3; - wxStaticBitmap* m_bitmapLeftOnly; - - wxBitmapButton* m_bpButtonLeftOnly; - wxStaticBitmap* m_bitmapRightOnly; - - wxBitmapButton* m_bpButtonRightOnly; - wxStaticBitmap* m_bitmapLeftNewer; - - wxBitmapButton* m_bpButtonLeftNewer; - wxStaticBitmap* m_bitmapRightNewer; - - wxBitmapButton* m_bpButtonRightNewer; - wxStaticBitmap* m_bitmapDifferent; - - wxBitmapButton* m_bpButtonDifferent; - wxStaticBitmap* m_bitmapConflict; - - wxBitmapButton* m_bpButtonConflict; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnSyncAutomatic( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncLeftToRight( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncUpdate( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSyncCustom( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnChangeErrorHandling( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnChangeDeletionHandling( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnApply( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( 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 OnConflict( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - SyncCfgDlgGenerated( 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 ); - ~SyncCfgDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class CmpCfgDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class CmpCfgDlgGenerated : public wxDialog -{ -private: - -protected: - wxRadioButton* m_radioBtnSizeDate; - wxStaticBitmap* m_bitmapByTime; - wxButton* m_buttonTimeSize; - wxRadioButton* m_radioBtnContent; - wxStaticBitmap* m_bitmapByContent; - wxButton* m_buttonContent; - wxStaticLine* m_staticline14; - wxBitmapButton* m_bpButtonHelp; - - wxChoice* m_choiceHandleSymlinks; - wxButton* m_button10; - wxButton* m_button6; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnTimeSize( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnContent( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnShowHelp( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnChangeErrorHandling( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnOkay( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Comparison settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~CmpCfgDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class SyncStatusDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class SyncStatusDlgGenerated : public wxFrame -{ -private: - -protected: - - wxAnimationCtrl* m_animationControl1; - wxPanel* m_panel8; - wxStaticText* m_staticText56; - - wxStaticBitmap* m_bitmapStatus; - wxStaticText* m_staticTextStatus; - - wxBoxSizer* bSizer31; - wxBoxSizer* bSizerObjectsRemaining; - wxStaticText* m_staticText25; - wxStaticText* m_staticTextRemainingObj; - wxStaticText* m_staticText96; - wxStaticText* m_staticTextDataRemaining; - wxStaticText* m_staticText97; - wxBoxSizer* bSizerObjectsProcessed; - wxStaticText* m_staticText251; - wxStaticText* m_staticTextProcessedObj; - wxStaticText* m_staticText98; - wxStaticText* m_staticTextDataProcessed; - wxStaticText* m_staticText99; - - wxStaticText* m_staticText55; - wxStaticText* m_staticTextTimeElapsed; - wxTextCtrl* m_textCtrlInfo; - wxBoxSizer* bSizer28; - wxBoxSizer* bSizerSpeed; - wxStaticText* m_staticText108; - wxStaticText* m_staticTextSpeed; - - wxButton* m_buttonOK; - wxButton* m_buttonPause; - wxButton* m_buttonAbort; - - wxBoxSizer* bSizerRemTime; - wxStaticText* m_staticText21; - wxStaticText* m_staticTextTimeRemaining; - - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnIconize( wxIconizeEvent& 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( 638,376 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); - ~SyncStatusDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class HelpDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class HelpDlgGenerated : public wxDialog -{ -private: - -protected: - - wxStaticBitmap* m_bitmap25; - wxPanel* m_panel8; - - wxStaticText* m_staticText56; - - - wxNotebook* m_notebook1; - wxScrolledWindow* m_scrolledWindow1; - wxStaticText* m_staticText59; - wxStaticText* m_staticText60; - wxStaticText* m_staticText61; - wxTreeCtrl* m_treeCtrl1; - wxStaticText* m_staticText63; - wxStaticText* m_staticText75; - wxStaticText* m_staticText76; - wxStaticText* m_staticText77; - wxStaticText* m_staticText79; - wxStaticText* m_staticText80; - wxStaticText* m_staticText78; - wxScrolledWindow* m_scrolledWindow5; - wxStaticText* m_staticText65; - wxStaticText* m_staticText66; - wxTreeCtrl* m_treeCtrl2; - wxStaticText* m_staticText69; - wxStaticText* m_staticText81; - wxStaticText* m_staticText82; - wxStaticText* m_staticText83; - wxStaticText* m_staticText84; - wxButton* m_button8; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnOK( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - HelpDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 579,543 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~HelpDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class AboutDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class AboutDlgGenerated : public wxDialog -{ -private: - -protected: - - wxPanel* m_panel5; - wxStaticBitmap* m_bitmap11; - wxStaticText* m_build; - - wxScrolledWindow* m_scrolledWindowCodeInfo; - wxBoxSizer* bSizerCodeInfo; - wxStaticText* m_staticText72; - wxStaticText* m_staticText73; - wxStaticText* m_staticText74; - wxScrolledWindow* m_scrolledWindowTranslators; - wxBoxSizer* bSizerTranslators; - wxStaticText* m_staticText54; - - wxFlexGridSizer* fgSizerTranslators; - wxStaticLine* m_staticline3; - wxStaticText* m_staticText131; - wxStaticLine* m_staticline12; - wxStaticBitmap* m_bitmap9; - wxHyperlinkCtrl* m_hyperlink1; - - wxHyperlinkCtrl* m_hyperlink6; - wxStaticBitmap* m_bitmap10; - wxHyperlinkCtrl* m_hyperlink2; - - wxAnimationCtrl* m_animationControl1; - wxHyperlinkCtrl* m_hyperlink3; - wxStaticLine* m_staticline2; - - wxStaticBitmap* m_bitmap13; - wxHyperlinkCtrl* m_hyperlink5; - - wxButton* m_buttonOkay; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnOK( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~AboutDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class ErrorDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class ErrorDlgGenerated : public wxDialog -{ -private: - -protected: - - wxStaticBitmap* m_bitmap10; - wxTextCtrl* m_textCtrl8; - wxCheckBox* m_checkBoxIgnoreErrors; - - wxButton* m_buttonIgnore; - wxButton* m_buttonRetry; - wxButton* m_buttonAbort; - - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnIgnore( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnRetry( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnAbort( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Error"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 421,228 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~ErrorDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class WarningDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class WarningDlgGenerated : public wxDialog -{ -private: - -protected: - - wxTextCtrl* m_textCtrl8; - wxCheckBox* m_checkBoxDontShowAgain; - - wxButton* m_buttonIgnore; - wxButton* m_buttonSwitch; - wxButton* m_buttonAbort; - - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnIgnore( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnSwitch( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnAbort( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - wxStaticBitmap* m_bitmap10; - WarningDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Warning"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 421,231 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~WarningDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class QuestionDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class QuestionDlgGenerated : public wxDialog -{ -private: - -protected: - - wxStaticBitmap* m_bitmap10; - wxTextCtrl* m_textCtrl8; - wxCheckBox* m_checkBoxDontAskAgain; - - wxButton* m_buttonYes; - wxButton* m_buttonNo; - wxButton* m_buttonCancel; - - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnYes( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnNo( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - QuestionDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Question"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 420,198 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~QuestionDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class DeleteDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class DeleteDlgGenerated : public wxDialog -{ -private: - -protected: - - - wxStaticBitmap* m_bitmap12; - wxStaticText* m_staticTextHeader; - - wxCheckBox* m_checkBoxDeleteBothSides; - - wxCheckBox* m_checkBoxUseRecycler; - wxTextCtrl* m_textCtrlMessage; - wxButton* m_buttonOK; - wxButton* m_buttonCancel; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnDelOnBothSides( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnUseRecycler( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnOK( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - DeleteDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~DeleteDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class FilterDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class FilterDlgGenerated : public wxDialog -{ -private: - -protected: - wxStaticBitmap* m_bitmap26; - wxPanel* m_panel8; - wxStaticText* m_staticTexHeader; - - wxStaticText* m_staticText44; - wxBitmapButton* m_bpButtonHelp; - - wxPanel* m_panel13; - wxStaticLine* m_staticline10; - wxStaticText* m_staticText45; - wxStaticText* m_staticText83; - wxStaticText* m_staticText84; - wxStaticText* m_staticText85; - wxStaticText* m_staticText181; - wxStaticText* m_staticText1811; - - wxStaticText* m_staticText15; - wxStaticBitmap* m_bitmap8; - wxTextCtrl* m_textCtrlInclude; - - wxStaticText* m_staticText16; - wxStaticBitmap* m_bitmap9; - wxTextCtrl* m_textCtrlExclude; - - wxButton* m_button9; - - wxButton* m_button10; - wxButton* m_button17; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnHelp( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnDefault( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnApply( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - 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|wxRESIZE_BORDER ); - ~FilterDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class CustomizeColsDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class CustomizeColsDlgGenerated : public wxDialog -{ -private: - -protected: - wxCheckListBox* m_checkListColumns; - wxBitmapButton* m_bpButton29; - wxBitmapButton* m_bpButton30; - wxButton* m_button9; - - wxButton* m_button28; - wxButton* m_button29; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnMoveUp( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnMoveDown( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnDefault( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnOkay( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - CustomizeColsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Customize columns"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~CustomizeColsDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class GlobalSettingsDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class GlobalSettingsDlgGenerated : public wxDialog -{ -private: - -protected: - wxStaticBitmap* m_bitmapSettings; - - wxPanel* m_panel8; - wxStaticText* m_staticText56; - - wxCheckBox* m_checkBoxIgnoreOneHour; - wxCheckBox* m_checkBoxCopyLocked; - wxStaticLine* m_staticline10; - wxStaticText* m_staticText100; - - wxButtonWithImage* m_buttonResetDialogs; - - - wxGrid* m_gridCustomCommand; - wxBitmapButton* m_bpButtonAddRow; - wxBitmapButton* m_bpButtonRemoveRow; - - wxButton* m_button9; - - wxButton* m_buttonOkay; - wxButton* m_button29; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnResetDialogs( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnAddRow( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnRemoveRow( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnDefault( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnOkay( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - GlobalSettingsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); - ~GlobalSettingsDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class SyncPreviewDlgGenerated -/////////////////////////////////////////////////////////////////////////////// -class SyncPreviewDlgGenerated : public wxDialog -{ -private: - -protected: - wxButtonWithImage* m_buttonStartSync; - wxStaticLine* m_staticline16; - wxStaticText* m_staticTextVariant; - wxStaticLine* m_staticline14; - - wxStaticText* m_staticText94; - wxStaticBitmap* m_bitmapCreate; - wxTextCtrl* m_textCtrlCreateL; - wxStaticBitmap* m_bitmapUpdate; - wxTextCtrl* m_textCtrlUpdateL; - wxStaticBitmap* m_bitmapDelete; - wxTextCtrl* m_textCtrlDeleteL; - wxStaticText* m_staticText95; - wxTextCtrl* m_textCtrlCreateR; - wxTextCtrl* m_textCtrlUpdateR; - wxTextCtrl* m_textCtrlDeleteR; - - wxStaticBitmap* m_bitmapData; - - wxTextCtrl* m_textCtrlData; - - wxStaticLine* m_staticline12; - wxCheckBox* m_checkBoxDontShowAgain; - - wxButton* m_button16; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnStartSync( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization Preview"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); - ~SyncPreviewDlgGenerated(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class PopupFrameGenerated1 -/////////////////////////////////////////////////////////////////////////////// -class PopupFrameGenerated1 : public wxFrame -{ -private: - -protected: - -public: - wxStaticBitmap* m_bitmapLeft; - wxStaticText* m_staticTextMain; - PopupFrameGenerated1( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxSTATIC_BORDER ); - ~PopupFrameGenerated1(); - -}; - -/////////////////////////////////////////////////////////////////////////////// -/// Class SearchDialogGenerated -/////////////////////////////////////////////////////////////////////////////// -class SearchDialogGenerated : public wxDialog -{ -private: - -protected: - wxStaticText* m_staticText101; - wxTextCtrl* m_textCtrlSearchTxt; - - wxCheckBox* m_checkBoxMatchCase; - wxButton* m_buttonFindNext; - wxButton* m_button29; - - // Virtual event handlers, overide them in your derived class - virtual void OnClose( wxCloseEvent& event ) - { - event.Skip(); - } - virtual void OnText( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnFindNext( wxCommandEvent& event ) - { - event.Skip(); - } - virtual void OnCancel( wxCommandEvent& event ) - { - event.Skip(); - } - - -public: - SearchDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); - ~SearchDialogGenerated(); - -}; - -#endif //__guiGenerated__ diff --git a/ui/guiStatusHandler.cpp b/ui/guiStatusHandler.cpp deleted file mode 100644 index 3d91fbe7..00000000 --- a/ui/guiStatusHandler.cpp +++ /dev/null @@ -1,397 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "guiStatusHandler.h" -#include "smallDialogs.h" -#include "messagePopup.h" -#include "../shared/systemConstants.h" -#include "mainDialog.h" -#include -#include "../shared/globalFunctions.h" -#include "../shared/stringConv.h" -#include "../shared/util.h" - -using namespace FreeFileSync; - - -CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : - mainDialog(dlg), - ignoreErrors(false), - currentProcess(StatusHandler::PROCESS_NONE) -{ - wxWindowUpdateLocker dummy(mainDialog); //avoid display distortion - - //prevent user input during "compare", do not disable maindialog since abort-button would also be disabled - mainDialog->disableAllElements(); - - //display status panel during compare - mainDialog->compareStatus->init(); //clear old values and make visible - - mainDialog->bSizer1->Layout(); //both sizers need to recalculate! - mainDialog->bSizer6->Layout(); //adapt layout for wxBitmapWithImage - mainDialog->Refresh(); - - //register abort button - mainDialog->m_buttonAbort->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this); - - //register key event - mainDialog->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), NULL, this); -} - - -CompareStatusHandler::~CompareStatusHandler() -{ - updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks - - //reenable complete main dialog - mainDialog->enableAllElements(); - - if (abortIsRequested()) - mainDialog->pushStatusInformation(_("Operation aborted!")); - - //hide status panel from main window - mainDialog->compareStatus->finalize(); - - mainDialog->bSizer6->Layout(); //adapt layout for wxBitmapWithImage - mainDialog->Layout(); - mainDialog->Refresh(); - - //register key event - mainDialog->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), NULL, this); - //de-register abort button - mainDialog->m_buttonAbort->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this); -} - - -void CompareStatusHandler::OnKeyPressed(wxKeyEvent& event) -{ - const int keyCode = event.GetKeyCode(); - if (keyCode == WXK_ESCAPE) - { - wxCommandEvent dummy; - OnAbortCompare(dummy); - } - - event.Skip(); -} - - -void CompareStatusHandler::updateStatusText(const Zstring& text) -{ - mainDialog->compareStatus->setStatusText_NoUpdate(text); -} - - -void CompareStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID) -{ - currentProcess = processID; - - switch (currentProcess) - { - case StatusHandler::PROCESS_SCANNING: - break; - case StatusHandler::PROCESS_COMPARING_CONTENT: - { - wxWindowUpdateLocker dummy(mainDialog); - mainDialog->compareStatus->switchToCompareBytewise(objectsTotal, dataTotal); - mainDialog->Layout(); //show progress bar... - mainDialog->Refresh(); //remove distortion... - } - break; - case StatusHandler::PROCESS_SYNCHRONIZING: - case StatusHandler::PROCESS_NONE: - assert(false); - break; - } -} - - -inline -void CompareStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) -{ - switch (currentProcess) - { - case StatusHandler::PROCESS_SCANNING: - mainDialog->compareStatus->incScannedObjects_NoUpdate(objectsProcessed); - break; - case StatusHandler::PROCESS_COMPARING_CONTENT: - mainDialog->compareStatus->incProcessedCmpData_NoUpdate(objectsProcessed, dataProcessed); - break; - case StatusHandler::PROCESS_SYNCHRONIZING: - case StatusHandler::PROCESS_NONE: - assert(false); - break; - } -} - - -ErrorHandler::Response CompareStatusHandler::reportError(const wxString& message) -{ - if (ignoreErrors) - return ErrorHandler::IGNORE_ERROR; - - mainDialog->compareStatus->updateStatusPanelNow(); - - bool ignoreNextErrors = false; - ErrorDlg errorDlg(NULL, - ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - message, ignoreNextErrors); - errorDlg.Raise(); - switch (static_cast(errorDlg.ShowModal())) - { - case ErrorDlg::BUTTON_IGNORE: - ignoreErrors = ignoreNextErrors; - return ErrorHandler::IGNORE_ERROR; - - case ErrorDlg::BUTTON_RETRY: - return ErrorHandler::RETRY; - - case ErrorDlg::BUTTON_ABORT: - abortThisProcess(); - } - - assert(false); - return ErrorHandler::IGNORE_ERROR; //dummy return value -} - - -void CompareStatusHandler::reportFatalError(const wxString& errorMessage) -{ - mainDialog->compareStatus->updateStatusPanelNow(); - - bool dummy = false; - ErrorDlg errorDlg(NULL, - ErrorDlg::BUTTON_ABORT, - errorMessage, dummy); - errorDlg.Raise(); - errorDlg.ShowModal(); - abortThisProcess(); -} - - -void CompareStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) -{ - if (!warningActive || ignoreErrors) //if errors are ignored, then warnings should also - return; - - mainDialog->compareStatus->updateStatusPanelNow(); - - //show popup and ask user how to handle warning - bool dontWarnAgain = false; - WarningDlg warningDlg(NULL, - WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, - warningMessage, - dontWarnAgain); - warningDlg.Raise(); - switch (static_cast(warningDlg.ShowModal())) - { - case WarningDlg::BUTTON_IGNORE: - warningActive = !dontWarnAgain; - break; - - case WarningDlg::BUTTON_SWITCH: - assert(false); - case WarningDlg::BUTTON_ABORT: - abortThisProcess(); - break; - } -} - - -inline -void CompareStatusHandler::forceUiRefresh() -{ - mainDialog->compareStatus->updateStatusPanelNow(); -} - - -void CompareStatusHandler::OnAbortCompare(wxCommandEvent& event) -{ - requestAbortion(); -} - - -void CompareStatusHandler::abortThisProcess() -{ - requestAbortion(); - throw FreeFileSync::AbortThisProcess(); -} -//######################################################################################################## - - -SyncStatusHandler::SyncStatusHandler(wxTopLevelWindow* parentDlg, bool ignoreAllErrors) : - syncStatusFrame(*this, parentDlg, false), - ignoreErrors(ignoreAllErrors) {} - - -SyncStatusHandler::~SyncStatusHandler() -{ - const int totalErrors = errorLog.errorsTotal(); //evaluate before finalizing log - - //finalize error log - if (abortIsRequested()) - errorLog.logError(wxString(_("Synchronization aborted!")) + wxT(" \n") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!")); - else if (totalErrors) - errorLog.logWarning(wxString(_("Synchronization completed with errors!")) + wxT(" \n") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!")); - else - errorLog.logInfo(_("Synchronization completed successfully!")); - - - //print the results list - wxString finalMessage; - if (totalErrors > 0) - { - wxString header(_("Warning: Synchronization failed for %x item(s):")); - header.Replace(wxT("%x"), FreeFileSync::numberToStringSep(totalErrors), false); - finalMessage += header + wxT("\n\n"); - } - - const ErrorLogging::MessageEntry& messages = errorLog.getFormattedMessages(); - for (ErrorLogging::MessageEntry::const_iterator i = messages.begin(); i != messages.end(); ++i) - { - finalMessage += *i; - finalMessage += wxT("\n\n"); - } - - //notify to syncStatusFrame that current process has ended - if (abortIsRequested()) - syncStatusFrame.processHasFinished(SyncStatus::ABORTED, finalMessage); //enable okay and close events - else if (totalErrors > 0) - syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_ERROR, finalMessage); - else - syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_SUCCESS, finalMessage); -} - - -inline -void SyncStatusHandler::updateStatusText(const Zstring& text) -{ - syncStatusFrame.setStatusText_NoUpdate(text); -} - - -void SyncStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID) -{ - switch (processID) - { - case StatusHandler::PROCESS_SYNCHRONIZING: - syncStatusFrame.resetGauge(objectsTotal, dataTotal); - syncStatusFrame.setCurrentStatus(SyncStatus::SYNCHRONIZING); - break; - case StatusHandler::PROCESS_SCANNING: - case StatusHandler::PROCESS_COMPARING_CONTENT: - case StatusHandler::PROCESS_NONE: - assert(false); - break; - } -} - - -inline -void SyncStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) -{ - syncStatusFrame.incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); -} - - -ErrorHandler::Response SyncStatusHandler::reportError(const wxString& errorMessage) -{ - if (ignoreErrors) - { - errorLog.logError(errorMessage); - return ErrorHandler::IGNORE_ERROR; - } - - syncStatusFrame.updateStatusDialogNow(); - - bool ignoreNextErrors = false; - ErrorDlg errorDlg(NULL, - ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, - errorMessage, - ignoreNextErrors); - errorDlg.Raise(); - const ErrorDlg::ReturnCodes rv = static_cast(errorDlg.ShowModal()); - switch (rv) - { - case ErrorDlg::BUTTON_IGNORE: - ignoreErrors = ignoreNextErrors; - errorLog.logError(errorMessage); - return ErrorHandler::IGNORE_ERROR; - - case ErrorDlg::BUTTON_RETRY: - return ErrorHandler::RETRY; - - case ErrorDlg::BUTTON_ABORT: - errorLog.logError(errorMessage); - abortThisProcess(); - } - - assert (false); - errorLog.logError(errorMessage); - return ErrorHandler::IGNORE_ERROR; -} - - -void SyncStatusHandler::reportFatalError(const wxString& errorMessage) -{ - errorLog.logFatalError(errorMessage); - abortThisProcess(); -} - - -void SyncStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) -{ - errorLog.logWarning(warningMessage); - - if (ignoreErrors || !warningActive) //if errors are ignored, then warnings should also - return; - else - { - syncStatusFrame.updateStatusDialogNow(); - - //show popup and ask user how to handle warning - bool dontWarnAgain = false; - WarningDlg warningDlg(NULL, - WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, - warningMessage, - dontWarnAgain); - warningDlg.Raise(); - const WarningDlg::Response rv = static_cast(warningDlg.ShowModal()); - switch (rv) - { - case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! - warningActive = !dontWarnAgain; - return; - - case WarningDlg::BUTTON_SWITCH: - assert(false); - case WarningDlg::BUTTON_ABORT: - abortThisProcess(); - return; - } - - assert(false); - } -} - - -void SyncStatusHandler::reportInfo(const wxString& infoMessage) -{ - errorLog.logInfo(infoMessage); -} - - -void SyncStatusHandler::forceUiRefresh() -{ - syncStatusFrame.updateStatusDialogNow(); -} - - -void SyncStatusHandler::abortThisProcess() -{ - requestAbortion(); - throw FreeFileSync::AbortThisProcess(); //abort can be triggered by syncStatusFrame -} diff --git a/ui/guiStatusHandler.h b/ui/guiStatusHandler.h deleted file mode 100644 index 18bbdc10..00000000 --- a/ui/guiStatusHandler.h +++ /dev/null @@ -1,73 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef GUISTATUSHANDLER_H_INCLUDED -#define GUISTATUSHANDLER_H_INCLUDED - -#include "../library/statusHandler.h" -#include -#include "../library/errorLogging.h" -#include "progressIndicator.h" - -class SyncStatus; -class MainDialog; -class wxWindow; -class wxCommandEvent; - - -//classes handling sync and compare error as well as status information -class CompareStatusHandler : private wxEvtHandler, public StatusHandler -{ -public: - CompareStatusHandler(MainDialog* dlg); - ~CompareStatusHandler(); - - virtual void updateStatusText(const Zstring& text); - virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); - virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); - virtual void forceUiRefresh(); - - virtual ErrorHandler::Response reportError(const wxString& text); - virtual void reportFatalError(const wxString& errorMessage); - virtual void reportWarning(const wxString& warningMessage, bool& warningActive); - -private: - void OnKeyPressed(wxKeyEvent& event); - void OnAbortCompare(wxCommandEvent& event); //handle abort button click - virtual void abortThisProcess(); - - MainDialog* mainDialog; - bool ignoreErrors; - Process currentProcess; -}; - - -class SyncStatusHandler : public StatusHandler -{ -public: - SyncStatusHandler(wxTopLevelWindow* parentDlg, bool ignoreAllErrors); - ~SyncStatusHandler(); - - virtual void updateStatusText(const Zstring& text); - virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); - virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); - virtual void forceUiRefresh(); - - virtual ErrorHandler::Response reportError(const wxString& text); - virtual void reportFatalError(const wxString& errorMessage); - virtual void reportWarning(const wxString& warningMessage, bool& warningActive); - void reportInfo(const wxString& infoMessage); - -private: - virtual void abortThisProcess(); - - SyncStatus syncStatusFrame; //the window managed by SyncStatus has longer lifetime than this handler! - bool ignoreErrors; - FreeFileSync::ErrorLogging errorLog; -}; - - -#endif // GUISTATUSHANDLER_H_INCLUDED diff --git a/ui/gui_generated.cpp b/ui/gui_generated.cpp new file mode 100644 index 00000000..59257708 --- /dev/null +++ b/ui/gui_generated.cpp @@ -0,0 +1,3782 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#include "../library/custom_grid.h" +#include "../shared/custom_button.h" +#include "../shared/custom_combo_box.h" +#include "../shared/toggle_button.h" + +#include "gui_generated.h" + +/////////////////////////////////////////////////////////////////////////// + +MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( 640,400 ), wxDefaultSize ); + + m_menubar1 = new wxMenuBar( 0 ); + m_menuFile = new wxMenu(); + m_menuItem10 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("1. &Compare") ) + wxT('\t') + wxT("ALT-C"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem10 ); + + m_menuItem11 = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("2. &Synchronize...") ) + wxT('\t') + wxT("ALT-S"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem11 ); + + m_menuFile->AppendSeparator(); + + m_menuItemSwitchView = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&witch view") ) + wxT('\t') + wxT("ALT-W"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSwitchView ); + + m_menuFile->AppendSeparator(); + + m_menuItemNew = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&New") ) + wxT('\t') + wxT("CTRL-N"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemNew ); + + m_menuItemSave = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("S&ave configuration...") ) + wxT('\t') + wxT("CTRL-S"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemSave ); + + m_menuItemLoad = new wxMenuItem( m_menuFile, wxID_ANY, wxString( _("&Load configuration...") ) + wxT('\t') + wxT("CTRL-L"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItemLoad ); + + m_menuFile->AppendSeparator(); + + wxMenuItem* m_menuItem4; + m_menuItem4 = new wxMenuItem( m_menuFile, wxID_EXIT, wxString( _("&Quit") ) + wxT('\t') + wxT("CTRL-Q"), wxEmptyString, wxITEM_NORMAL ); + m_menuFile->Append( m_menuItem4 ); + + m_menubar1->Append( m_menuFile, _("&File") ); + + m_menuAdvanced = new wxMenu(); + m_menuLanguages = new wxMenu(); + m_menuAdvanced->Append( -1, _("&Language"), m_menuLanguages ); + + m_menuAdvanced->AppendSeparator(); + + m_menuItemGlobSett = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Global settings...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuAdvanced->Append( m_menuItemGlobSett ); + + m_menuItem7 = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Create batch job...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuAdvanced->Append( m_menuItem7 ); + + wxMenuItem* m_menuItem5; + m_menuItem5 = new wxMenuItem( m_menuAdvanced, wxID_ANY, wxString( _("&Export file list...") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuAdvanced->Append( m_menuItem5 ); + + m_menubar1->Append( m_menuAdvanced, _("&Advanced") ); + + m_menuHelp = new wxMenu(); + wxMenuItem* m_menuItemReadme; + m_menuItemReadme = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Content") ) + wxT('\t') + wxT("F1"), wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemReadme ); + + m_menuItemCheckVer = new wxMenuItem( m_menuHelp, wxID_ANY, wxString( _("&Check for new version") ) , wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemCheckVer ); + + m_menuHelp->AppendSeparator(); + + m_menuItemAbout = new wxMenuItem( m_menuHelp, wxID_ABOUT, wxString( _("&About...") ) + wxT('\t') + wxT("SHIFT-F1"), wxEmptyString, wxITEM_NORMAL ); + m_menuHelp->Append( m_menuItemAbout ); + + m_menubar1->Append( m_menuHelp, _("&Help") ); + + this->SetMenuBar( m_menubar1 ); + + bSizer1 = new wxBoxSizer( wxVERTICAL ); + + m_panel71 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL ); + bSizer6 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxFlexGridSizer* fgSizer121; + fgSizer121 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer121->SetFlexibleDirection( wxBOTH ); + fgSizer121->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticTextCmpVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCmpVariant->Wrap( -1 ); + m_staticTextCmpVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + m_staticTextCmpVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + fgSizer121->Add( m_staticTextCmpVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + fgSizer121->Add( 0, 0, 1, 0, 5 ); + + wxBoxSizer* bSizer30; + bSizer30 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("Compare"), wxDefaultPosition, wxSize( 180,42 ), 0 ); + m_buttonCompare->SetDefault(); + m_buttonCompare->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_buttonCompare->SetToolTip( _("Compare both sides") ); + + bSizer30->Add( m_buttonCompare, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonAbort = new wxButton( m_panel71, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 180,42 ), 0 ); + m_buttonAbort->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_buttonAbort->Enable( false ); + m_buttonAbort->Hide(); + + bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + fgSizer121->Add( bSizer30, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonCmpConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); + m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); + + m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); + + fgSizer121->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 3 ); + + bSizer6->Add( fgSizer121, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + + bSizer6->Add( 0, 0, 1, 0, 5 ); + + wxFlexGridSizer* fgSizer12; + fgSizer12 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer12->SetFlexibleDirection( wxBOTH ); + fgSizer12->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + + fgSizer12->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticTextSyncVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSyncVariant->Wrap( -1 ); + m_staticTextSyncVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + m_staticTextSyncVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + fgSizer12->Add( m_staticTextSyncVariant, 1, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonSyncConfig = new wxBitmapButton( m_panel71, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); + m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); + + m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); + + fgSizer12->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 3 ); + + m_buttonStartSync = new wxButtonWithImage( m_panel71, wxID_ANY, _("Synchronize..."), wxDefaultPosition, wxSize( -1,42 ), 0 ); + m_buttonStartSync->SetFont( wxFont( 14, 74, 90, 92, false, wxT("Arial Black") ) ); + m_buttonStartSync->SetToolTip( _("Start synchronization") ); + + fgSizer12->Add( m_buttonStartSync, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer6->Add( fgSizer12, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + + bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel71->SetSizer( bSizer6 ); + m_panel71->Layout(); + bSizer6->Fit( m_panel71 ); + bSizer1->Add( m_panel71, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + wxBoxSizer* bSizer91; + bSizer91 = new wxBoxSizer( wxHORIZONTAL ); + + m_panelTopLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelTopLeft->SetMinSize( wxSize( 1,1 ) ); + + wxBoxSizer* bSizer92; + bSizer92 = new wxBoxSizer( wxVERTICAL ); + + sbSizer2 = new wxStaticBoxSizer( new wxStaticBox( m_panelTopLeft, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); + + m_directoryLeft = new CustomComboBox( m_panelTopLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + sbSizer2->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerLeft = new wxDirPickerCtrl( m_panelTopLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerLeft->SetToolTip( _("Select a folder") ); + + sbSizer2->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer92->Add( sbSizer2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_panelTopLeft->SetSizer( bSizer92 ); + m_panelTopLeft->Layout(); + bSizer92->Fit( m_panelTopLeft ); + bSizer91->Add( m_panelTopLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelTopMiddle = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer93; + bSizer93 = new wxBoxSizer( wxVERTICAL ); + + + bSizer93->Add( 0, 3, 0, 0, 5 ); + + bSizerMiddle = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonSwapSides = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,-1 ), wxBU_AUTODRAW ); + m_bpButtonSwapSides->SetToolTip( _("Swap sides") ); + + m_bpButtonSwapSides->SetToolTip( _("Swap sides") ); + + bSizerMiddle->Add( m_bpButtonSwapSides, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer93->Add( bSizerMiddle, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer160; + bSizer160 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer160->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLocalFilter = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer160->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer160->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelTopMiddle, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer160->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer160->Add( 0, 0, 1, wxEXPAND, 5 ); + + bSizer93->Add( bSizer160, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_panelTopMiddle->SetSizer( bSizer93 ); + m_panelTopMiddle->Layout(); + bSizer93->Fit( m_panelTopMiddle ); + bSizer91->Add( m_panelTopMiddle, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelTopRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelTopRight->SetMinSize( wxSize( 1,1 ) ); + + wxBoxSizer* bSizer94; + bSizer94 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer77; + bSizer77 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sbSizer3; + sbSizer3 = new wxStaticBoxSizer( new wxStaticBox( m_panelTopRight, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); + + m_bpButtonAddPair = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); + + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); + + sbSizer3->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3 ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panelTopRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + sbSizer3->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_directoryRight = new CustomComboBox( m_panelTopRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); + sbSizer3->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerRight = new wxDirPickerCtrl( m_panelTopRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerRight->SetToolTip( _("Select a folder") ); + + sbSizer3->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer77->Add( sbSizer3, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); + + bSizer94->Add( bSizer77, 0, wxEXPAND|wxLEFT, 3 ); + + m_panelTopRight->SetSizer( bSizer94 ); + m_panelTopRight->Layout(); + bSizer94->Fit( m_panelTopRight ); + bSizer91->Add( m_panelTopRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + bSizer1->Add( bSizer91, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_scrolledWindowFolderPairs = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); + m_scrolledWindowFolderPairs->SetScrollRate( 5, 5 ); + m_scrolledWindowFolderPairs->SetMinSize( wxSize( -1,0 ) ); + + bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); + + m_scrolledWindowFolderPairs->SetSizer( bSizerAddFolderPairs ); + m_scrolledWindowFolderPairs->Layout(); + bSizerAddFolderPairs->Fit( m_scrolledWindowFolderPairs ); + bSizer1->Add( m_scrolledWindowFolderPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + bSizerGridHolder = new wxBoxSizer( wxHORIZONTAL ); + + m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer7; + bSizer7 = new wxBoxSizer( wxVERTICAL ); + + m_gridLeft = new CustomGridLeft( m_panelLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_gridLeft->CreateGrid( 15, 4 ); + m_gridLeft->EnableEditing( false ); + m_gridLeft->EnableGridLines( true ); + m_gridLeft->EnableDragGridSize( true ); + m_gridLeft->SetMargins( 0, 0 ); + + // Columns + m_gridLeft->EnableDragColMove( false ); + m_gridLeft->EnableDragColSize( true ); + m_gridLeft->SetColLabelSize( 20 ); + m_gridLeft->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + + // Rows + m_gridLeft->EnableDragRowSize( false ); + m_gridLeft->SetRowLabelSize( 38 ); + m_gridLeft->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_gridLeft->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + m_gridLeft->SetMinSize( wxSize( 1,1 ) ); + + bSizer7->Add( m_gridLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + + m_panelLeft->SetSizer( bSizer7 ); + m_panelLeft->Layout(); + bSizer7->Fit( m_panelLeft ); + bSizerGridHolder->Add( m_panelLeft, 1, wxEXPAND, 5 ); + + m_panelMiddle = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer18; + bSizer18 = new wxBoxSizer( wxVERTICAL ); + + m_gridMiddle = new CustomGridMiddle( m_panelMiddle, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_gridMiddle->CreateGrid( 15, 1 ); + m_gridMiddle->EnableEditing( false ); + m_gridMiddle->EnableGridLines( true ); + m_gridMiddle->EnableDragGridSize( false ); + m_gridMiddle->SetMargins( 0, 0 ); + + // Columns + m_gridMiddle->SetColSize( 0, 60 ); + m_gridMiddle->EnableDragColMove( false ); + m_gridMiddle->EnableDragColSize( false ); + m_gridMiddle->SetColLabelSize( 20 ); + m_gridMiddle->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Rows + m_gridMiddle->EnableDragRowSize( false ); + m_gridMiddle->SetRowLabelSize( 0 ); + m_gridMiddle->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_gridMiddle->SetDefaultCellFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 90, false, wxT("Arial") ) ); + m_gridMiddle->SetDefaultCellAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + bSizer18->Add( m_gridMiddle, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_panelMiddle->SetSizer( bSizer18 ); + m_panelMiddle->Layout(); + bSizer18->Fit( m_panelMiddle ); + bSizerGridHolder->Add( m_panelMiddle, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer10; + bSizer10 = new wxBoxSizer( wxVERTICAL ); + + m_gridRight = new CustomGridRight( m_panelRight, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_gridRight->CreateGrid( 15, 4 ); + m_gridRight->EnableEditing( false ); + m_gridRight->EnableGridLines( true ); + m_gridRight->EnableDragGridSize( true ); + m_gridRight->SetMargins( 0, 0 ); + + // Columns + m_gridRight->EnableDragColMove( false ); + m_gridRight->EnableDragColSize( true ); + m_gridRight->SetColLabelSize( 20 ); + m_gridRight->SetColLabelAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + + // Rows + m_gridRight->EnableDragRowSize( false ); + m_gridRight->SetRowLabelSize( 38 ); + m_gridRight->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_gridRight->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); + m_gridRight->SetMinSize( wxSize( 1,1 ) ); + + bSizer10->Add( m_gridRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + + m_panelRight->SetSizer( bSizer10 ); + m_panelRight->Layout(); + bSizer10->Fit( m_panelRight ); + bSizerGridHolder->Add( m_panelRight, 1, wxEXPAND, 5 ); + + bSizer1->Add( bSizerGridHolder, 1, wxEXPAND, 5 ); + + m_panelBottom = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizer3 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer120; + bSizer120 = new wxBoxSizer( wxVERTICAL ); + + m_notebookBottomLeft = new wxNotebook( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panel30 = new wxPanel( m_notebookBottomLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer139; + bSizer139 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonSave = new wxBitmapButton( m_panel30, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButtonSave->SetToolTip( _("Save current configuration to file") ); + + m_bpButtonSave->SetToolTip( _("Save current configuration to file") ); + + bSizer139->Add( m_bpButtonSave, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLoad = new wxBitmapButton( m_panel30, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButtonLoad->SetToolTip( _("Load configuration from file") ); + + m_bpButtonLoad->SetToolTip( _("Load configuration from file") ); + + bSizer139->Add( m_bpButtonLoad, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxArrayString m_choiceHistoryChoices; + m_choiceHistory = new wxChoice( m_panel30, wxID_ANY, wxDefaultPosition, wxSize( 170,-1 ), m_choiceHistoryChoices, 0 ); + m_choiceHistory->SetSelection( 0 ); + m_choiceHistory->SetToolTip( _("Load configuration history (press DEL to delete items)") ); + + bSizer139->Add( m_choiceHistory, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel30->SetSizer( bSizer139 ); + m_panel30->Layout(); + bSizer139->Fit( m_panel30 ); + m_notebookBottomLeft->AddPage( m_panel30, _("Configuration"), true ); + m_panelFilter = new wxPanel( m_notebookBottomLeft, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer140; + bSizer140 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonFilter = new wxBitmapButton( m_panelFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + bSizer140->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + wxBoxSizer* bSizer23; + bSizer23 = new wxBoxSizer( wxVERTICAL ); + + m_checkBoxHideFilt = new wxCheckBox( m_panelFilter, wxID_ANY, _("Hide excluded items"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxHideFilt->SetToolTip( _("Hide filtered or temporarily excluded files") ); + + bSizer23->Add( m_checkBoxHideFilt, 0, wxEXPAND, 5 ); + + bSizer140->Add( bSizer23, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelFilter->SetSizer( bSizer140 ); + m_panelFilter->Layout(); + bSizer140->Fit( m_panelFilter ); + m_notebookBottomLeft->AddPage( m_panelFilter, _("Filter files"), false ); + + bSizer120->Add( m_notebookBottomLeft, 0, wxALL, 5 ); + + bSizer3->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxLEFT, 5 ); + + m_panelViewFilter = new wxPanel( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer64; + bSizer64 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer31; + sbSizer31 = new wxStaticBoxSizer( new wxStaticBox( m_panelViewFilter, wxID_ANY, _("Filter view") ), wxHORIZONTAL ); + + sbSizer31->SetMinSize( wxSize( 100,-1 ) ); + + sbSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonSyncCreateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncCreateLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDirOverwLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDirOverwLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDeleteLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDeleteLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonEqual = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonEqual, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonDifferent = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDirNone = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDirNone, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonRightNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonRightOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDeleteRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDeleteRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncDirOverwRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncDirOverwRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonSyncCreateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonSyncCreateRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonConflict = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + sbSizer31->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + + sbSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + + bSizer64->Add( sbSizer31, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_panelViewFilter->SetSizer( bSizer64 ); + m_panelViewFilter->Layout(); + bSizer64->Fit( m_panelViewFilter ); + bSizer3->Add( m_panelViewFilter, 0, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizerBottomRight = new wxBoxSizer( wxHORIZONTAL ); + + + bSizerBottomRight->Add( 5, 0, 1, 0, 5 ); + + m_panelSyncPreview = new wxPanel( m_panelBottom, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer121; + bSizer121 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer161; + sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( m_panelSyncPreview, wxID_ANY, _("Statistics") ), wxHORIZONTAL ); + + wxFlexGridSizer* fgSizer5; + fgSizer5 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapCreate = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreate->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlCreate = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreate->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlCreate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreate->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer5->Add( m_textCtrlCreate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapDelete = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDelete->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlDelete = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDelete->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlDelete->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDelete->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer5->Add( m_textCtrlDelete, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer161->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + wxFlexGridSizer* fgSizer6; + fgSizer6 = new wxFlexGridSizer( 2, 2, 0, 5 ); + fgSizer6->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer6->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_bitmapUpdate = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer6->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlUpdate = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdate->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlUpdate->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdate->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer6->Add( m_textCtrlUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapData = new wxStaticBitmap( m_panelSyncPreview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapData->SetToolTip( _("Total amount of data that will be transferred") ); + + fgSizer6->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlData = new wxTextCtrl( m_panelSyncPreview, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlData->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); + + fgSizer6->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer161->Add( fgSizer6, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + bSizer121->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelSyncPreview->SetSizer( bSizer121 ); + m_panelSyncPreview->Layout(); + bSizer121->Fit( m_panelSyncPreview ); + bSizerBottomRight->Add( m_panelSyncPreview, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButton10 = new wxBitmapButton( m_panelBottom, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); + m_bpButton10->Hide(); + m_bpButton10->SetToolTip( _("Quit") ); + + m_bpButton10->Hide(); + m_bpButton10->SetToolTip( _("Quit") ); + + bSizerBottomRight->Add( m_bpButton10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); + + bSizer3->Add( bSizerBottomRight, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + + m_panelBottom->SetSizer( bSizer3 ); + m_panelBottom->Layout(); + bSizer3->Fit( m_panelBottom ); + bSizer1->Add( m_panelBottom, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_panelStatusBar = 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_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusLeft->Wrap( -1 ); + m_staticTextStatusLeft->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + 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_panelStatusBar, 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_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusMiddle->Wrap( -1 ); + m_staticTextStatusMiddle->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + 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_panelStatusBar, 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_panelStatusBar, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatusRight->Wrap( -1 ); + m_staticTextStatusRight->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + 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_panelStatusBar, 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_panelStatusBar->SetSizer( bSizer451 ); + m_panelStatusBar->Layout(); + bSizer451->Fit( m_panelStatusBar ); + bSizer1->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + this->SetSizer( bSizer1 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); + this->Connect( m_menuItem10->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); + this->Connect( m_menuItem11->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); + this->Connect( m_menuItemSwitchView->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); + this->Connect( m_menuItemNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnNewConfig ) ); + this->Connect( m_menuItemSave->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); + this->Connect( m_menuItemLoad->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); + this->Connect( m_menuItem4->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); + this->Connect( m_menuItemGlobSett->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); + this->Connect( m_menuItem7->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); + this->Connect( m_menuItem5->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); + this->Connect( m_menuItemReadme->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); + this->Connect( m_menuItemCheckVer->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); + this->Connect( m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); + m_buttonCompare->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); + m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); + m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); + m_dirPickerLeft->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); + m_bpButtonSwapSides->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); + m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRemoveTopFolderPair ), NULL, this ); + m_dirPickerRight->Connect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); + m_gridLeft->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnLeftGridDoubleClick ), NULL, this ); + m_gridLeft->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); + m_gridLeft->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortLeftGrid ), NULL, this ); + m_gridLeft->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelLeft ), NULL, this ); + m_gridMiddle->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddle ), NULL, this ); + m_gridMiddle->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortMiddleGrid ), NULL, this ); + m_gridMiddle->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddleLabel ), NULL, this ); + m_gridRight->Connect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnRightGridDoubleClick ), NULL, this ); + m_gridRight->Connect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); + m_gridRight->Connect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortRightGrid ), NULL, this ); + m_gridRight->Connect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelRight ), NULL, this ); + m_bpButtonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ), NULL, this ); + m_bpButtonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ), NULL, this ); + m_choiceHistory->Connect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); + m_choiceHistory->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistory ), NULL, this ); + m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); + m_checkBoxHideFilt->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideFilteredButton ), NULL, this ); + m_bpButtonSyncCreateLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateLeft ), NULL, this ); + m_bpButtonSyncDirOverwLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); + m_bpButtonSyncDeleteLeft->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteLeft ), NULL, this ); + m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftOnlyFiles ), NULL, this ); + m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftNewerFiles ), NULL, this ); + m_bpButtonEqual->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnEqualFiles ), NULL, this ); + m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); + m_bpButtonSyncDirNone->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); + m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); + m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); + m_bpButtonSyncDeleteRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteRight ), NULL, this ); + m_bpButtonSyncDirOverwRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); + m_bpButtonSyncCreateRight->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateRight ), NULL, this ); + m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); + m_bpButton10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); +} + +MainDialogGenerated::~MainDialogGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnCompare ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSwitchView ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnNewConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuQuit ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuGlobalSettings ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuBatchJob ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuExportFileList ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnShowHelp ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuCheckVersion ) ); + this->Disconnect( wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnMenuAbout ) ); + m_buttonCompare->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCompare ), NULL, this ); + m_bpButtonCmpConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnCmpSettings ), NULL, this ); + m_bpButtonSyncConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncSettings ), NULL, this ); + m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnStartSync ), NULL, this ); + m_dirPickerLeft->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); + m_bpButtonSwapSides->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSwapSides ), NULL, this ); + m_bpButtonAddPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemovePair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRemoveTopFolderPair ), NULL, this ); + m_dirPickerRight->Disconnect( wxEVT_COMMAND_DIRPICKER_CHANGED, wxFileDirPickerEventHandler( MainDialogGenerated::OnDirSelected ), NULL, this ); + m_gridLeft->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnLeftGridDoubleClick ), NULL, this ); + m_gridLeft->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); + m_gridLeft->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortLeftGrid ), NULL, this ); + m_gridLeft->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelLeft ), NULL, this ); + m_gridMiddle->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddle ), NULL, this ); + m_gridMiddle->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortMiddleGrid ), NULL, this ); + m_gridMiddle->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextMiddleLabel ), NULL, this ); + m_gridRight->Disconnect( wxEVT_GRID_CELL_LEFT_DCLICK, wxGridEventHandler( MainDialogGenerated::OnRightGridDoubleClick ), NULL, this ); + m_gridRight->Disconnect( wxEVT_GRID_CELL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRim ), NULL, this ); + m_gridRight->Disconnect( wxEVT_GRID_LABEL_LEFT_CLICK, wxGridEventHandler( MainDialogGenerated::OnSortRightGrid ), NULL, this ); + m_gridRight->Disconnect( wxEVT_GRID_LABEL_RIGHT_CLICK, wxGridEventHandler( MainDialogGenerated::OnContextRimLabelRight ), NULL, this ); + m_bpButtonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSaveConfig ), NULL, this ); + m_bpButtonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLoadConfig ), NULL, this ); + m_choiceHistory->Disconnect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); + m_choiceHistory->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( MainDialogGenerated::OnLoadFromHistory ), NULL, this ); + m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConfigureFilter ), NULL, this ); + m_checkBoxHideFilt->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnHideFilteredButton ), NULL, this ); + m_bpButtonSyncCreateLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateLeft ), NULL, this ); + m_bpButtonSyncDirOverwLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirLeft ), NULL, this ); + m_bpButtonSyncDeleteLeft->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteLeft ), NULL, this ); + m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftOnlyFiles ), NULL, this ); + m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnLeftNewerFiles ), NULL, this ); + m_bpButtonEqual->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnEqualFiles ), NULL, this ); + m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnDifferentFiles ), NULL, this ); + m_bpButtonSyncDirNone->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirNone ), NULL, this ); + m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightNewerFiles ), NULL, this ); + m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnRightOnlyFiles ), NULL, this ); + m_bpButtonSyncDeleteRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDeleteRight ), NULL, this ); + m_bpButtonSyncDirOverwRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncDirRight ), NULL, this ); + m_bpButtonSyncCreateRight->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnSyncCreateRight ), NULL, this ); + m_bpButtonConflict->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnConflictFiles ), NULL, this ); + m_bpButton10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( MainDialogGenerated::OnQuit ), NULL, this ); +} + +FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bSizer74; + bSizer74 = new wxBoxSizer( wxHORIZONTAL ); + + m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer134; + bSizer134 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer134->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerLeft->SetToolTip( _("Select a folder") ); + + bSizer134->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_panelLeft->SetSizer( bSizer134 ); + m_panelLeft->Layout(); + bSizer134->Fit( m_panelLeft ); + bSizer74->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel20 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel20->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); + + wxBoxSizer* bSizer95; + bSizer95 = new wxBoxSizer( wxHORIZONTAL ); + + m_panel21 = new wxPanel( m_panel20, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panel21->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer96; + bSizer96 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer96->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonLocalFilter = new wxBitmapButton( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer96->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer96->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panel21, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer96->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer96->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_panel21->SetSizer( bSizer96 ); + m_panel21->Layout(); + bSizer96->Fit( m_panel21 ); + bSizer95->Add( m_panel21, 0, wxRIGHT|wxLEFT|wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel20->SetSizer( bSizer95 ); + m_panel20->Layout(); + bSizer95->Fit( m_panel20 ); + bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer135; + bSizer135 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + bSizer135->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer135->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerRight->SetToolTip( _("Select a folder") ); + + bSizer135->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_panelRight->SetSizer( bSizer135 ); + m_panelRight->Layout(); + bSizer135->Fit( m_panelRight ); + bSizer74->Add( m_panelRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + this->SetSizer( bSizer74 ); + this->Layout(); + bSizer74->Fit( this ); +} + +FolderPairGenerated::~FolderPairGenerated() +{ +} + +BatchFolderPairGenerated::BatchFolderPairGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bSizer142; + bSizer142 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer140; + bSizer140 = new wxBoxSizer( wxHORIZONTAL ); + + m_panel32 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER ); + wxBoxSizer* bSizer147; + bSizer147 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer136; + bSizer136 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panel32, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + bSizer136->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer147->Add( bSizer136, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer143; + bSizer143 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer145; + bSizer145 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText53 = new wxStaticText( m_panel32, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText53->Wrap( -1 ); + m_staticText53->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + bSizer145->Add( m_staticText53, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer145, 1, 0, 5 ); + + wxBoxSizer* bSizer146; + bSizer146 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText541 = new wxStaticText( m_panel32, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText541->Wrap( -1 ); + m_staticText541->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + bSizer146->Add( m_staticText541, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer146, 1, 0, 5 ); + + bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_panel32->SetSizer( bSizer147 ); + m_panel32->Layout(); + bSizer147->Fit( m_panel32 ); + bSizer140->Add( m_panel32, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer144; + bSizer144 = new wxBoxSizer( wxVERTICAL ); + + m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer114; + bSizer114 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer114->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerLeft->SetToolTip( _("Select a folder") ); + + bSizer114->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLocalFilter = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer114->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelLeft->SetSizer( bSizer114 ); + m_panelLeft->Layout(); + bSizer114->Fit( m_panelLeft ); + bSizer144->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer115; + bSizer115 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer115->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerRight->SetToolTip( _("Select a folder") ); + + bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer115->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelRight->SetSizer( bSizer115 ); + m_panelRight->Layout(); + bSizer115->Fit( m_panelRight ); + bSizer144->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer140->Add( bSizer144, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer142->Add( bSizer140, 0, wxEXPAND, 5 ); + + + bSizer142->Add( 0, 5, 0, 0, 5 ); + + this->SetSizer( bSizer142 ); + this->Layout(); + bSizer142->Fit( this ); +} + +BatchFolderPairGenerated::~BatchFolderPairGenerated() +{ +} + +BatchDlgGenerated::BatchDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( 400,420 ), wxDefaultSize ); + + wxBoxSizer* bSizer54; + bSizer54 = new wxBoxSizer( wxVERTICAL ); + + bSizer69 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer87; + bSizer87 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap27 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); + bSizer87->Add( m_bitmap27, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + 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, _("Batch job"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + + bSizer72->Add( m_staticText56, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer87->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer87->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer69->Add( bSizer87, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer69->Add( 0, 5, 0, 0, 5 ); + + wxBoxSizer* bSizer70; + bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Assemble a batch file for automated synchronization. To start in batch mode simply pass the name of the file to the FreeFileSync executable: FreeFileSync.exe . This can also be scheduled in your operating system's task planner."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText44->Wrap( 500 ); + bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButtonHelp->SetToolTip( _("Help") ); + + m_bpButtonHelp->SetToolTip( _("Help") ); + + bSizer70->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer69->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer69->Add( 0, 5, 0, 0, 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") ) ); + + bSizer69->Add( m_staticText531, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_notebookSettings = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_panelOverview = new wxPanel( m_notebookSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer67; + bSizer67 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer120; + bSizer120 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer175; + bSizer175 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sbSizer241; + sbSizer241 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Compare") ), wxHORIZONTAL ); + + m_bpButtonCmpConfig = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); + m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); + + m_bpButtonCmpConfig->SetToolTip( _("Comparison settings") ); + + sbSizer241->Add( m_bpButtonCmpConfig, 0, wxALIGN_CENTER_VERTICAL, 3 ); + + + sbSizer241->Add( 10, 0, 0, 0, 5 ); + + m_staticTextCmpVariant = new wxStaticText( m_panelOverview, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextCmpVariant->Wrap( -1 ); + m_staticTextCmpVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + m_staticTextCmpVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + sbSizer241->Add( m_staticTextCmpVariant, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer175->Add( sbSizer241, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer175->Add( 0, 0, 1, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer26; + sbSizer26 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Filter files") ), wxVERTICAL ); + + m_bpButtonFilter = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW|wxFULL_REPAINT_ON_RESIZE ); + sbSizer26->Add( m_bpButtonFilter, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 15 ); + + bSizer175->Add( sbSizer26, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer175->Add( 0, 0, 1, wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer252; + sbSizer252 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Synchronize...") ), wxHORIZONTAL ); + + m_staticTextSyncVariant = new wxStaticText( m_panelOverview, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSyncVariant->Wrap( -1 ); + m_staticTextSyncVariant->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + m_staticTextSyncVariant->SetForegroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) ); + + sbSizer252->Add( m_staticTextSyncVariant, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizer252->Add( 10, 0, 0, 0, 5 ); + + m_bpButtonSyncConfig = new wxBitmapButton( m_panelOverview, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( -1,42 ), wxBU_AUTODRAW ); + m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); + + m_bpButtonSyncConfig->SetToolTip( _("Synchronization settings") ); + + sbSizer252->Add( m_bpButtonSyncConfig, 0, wxALIGN_CENTER_VERTICAL, 3 ); + + bSizer175->Add( sbSizer252, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer120->Add( bSizer175, 0, wxEXPAND, 5 ); + + + bSizer120->Add( 0, 5, 0, 0, 5 ); + + m_scrolledWindow6 = new wxScrolledWindow( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxVSCROLL ); + m_scrolledWindow6->SetScrollRate( 5, 5 ); + wxBoxSizer* bSizer141; + bSizer141 = new wxBoxSizer( wxVERTICAL ); + + sbSizerMainPair = new wxBoxSizer( wxHORIZONTAL ); + + m_panelMainPair = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER ); + wxBoxSizer* bSizer147; + bSizer147 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer1361; + bSizer1361 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonAddPair = new wxBitmapButton( m_panelMainPair, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); + + m_bpButtonAddPair->SetToolTip( _("Add folder pair") ); + + bSizer1361->Add( m_bpButtonAddPair, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 3 ); + + m_bpButtonRemovePair = new wxBitmapButton( m_panelMainPair, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + m_bpButtonRemovePair->SetToolTip( _("Remove folder pair") ); + + bSizer1361->Add( m_bpButtonRemovePair, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer147->Add( bSizer1361, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer143; + bSizer143 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer145; + bSizer145 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText532 = new wxStaticText( m_panelMainPair, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText532->Wrap( -1 ); + m_staticText532->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + bSizer145->Add( m_staticText532, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer145, 1, 0, 5 ); + + wxBoxSizer* bSizer146; + bSizer146 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText5411 = new wxStaticText( m_panelMainPair, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText5411->Wrap( -1 ); + m_staticText5411->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + bSizer146->Add( m_staticText5411, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer143->Add( bSizer146, 1, 0, 5 ); + + bSizer147->Add( bSizer143, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + m_panelMainPair->SetSizer( bSizer147 ); + m_panelMainPair->Layout(); + bSizer147->Fit( m_panelMainPair ); + sbSizerMainPair->Add( m_panelMainPair, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxVERTICAL ); + + m_panelLeft = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1141; + bSizer1141 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryLeft = new wxTextCtrl( m_panelLeft, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1141->Add( m_directoryLeft, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerLeft = new wxDirPickerCtrl( m_panelLeft, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerLeft->SetToolTip( _("Select a folder") ); + + bSizer1141->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLocalFilter = new wxBitmapButton( m_panelLeft, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer1141->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelLeft->SetSizer( bSizer1141 ); + m_panelLeft->Layout(); + bSizer1141->Fit( m_panelLeft ); + bSizer158->Add( m_panelLeft, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelRight = new wxPanel( m_scrolledWindow6, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer115; + bSizer115 = new wxBoxSizer( wxHORIZONTAL ); + + m_directoryRight = new wxTextCtrl( m_panelRight, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer115->Add( m_directoryRight, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerRight = new wxDirPickerCtrl( m_panelRight, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerRight->SetToolTip( _("Select a folder") ); + + bSizer115->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panelRight, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer115->Add( m_bpButtonAltSyncCfg, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelRight->SetSizer( bSizer115 ); + m_panelRight->Layout(); + bSizer115->Fit( m_panelRight ); + bSizer158->Add( m_panelRight, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizerMainPair->Add( bSizer158, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM, 5 ); + + bSizer141->Add( sbSizerMainPair, 0, wxEXPAND, 5 ); + + bSizerAddFolderPairs = new wxBoxSizer( wxVERTICAL ); + + bSizer141->Add( bSizerAddFolderPairs, 0, wxEXPAND, 5 ); + + m_scrolledWindow6->SetSizer( bSizer141 ); + m_scrolledWindow6->Layout(); + bSizer141->Fit( m_scrolledWindow6 ); + bSizer120->Add( m_scrolledWindow6, 0, wxEXPAND, 5 ); + + + bSizer120->Add( 0, 5, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxFlexGridSizer* fgSizer15; + fgSizer15 = new wxFlexGridSizer( 1, 2, 10, 10 ); + fgSizer15->SetFlexibleDirection( wxBOTH ); + fgSizer15->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + wxStaticBoxSizer* sbSizer24; + sbSizer24 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Status feedback") ), wxVERTICAL ); + + + sbSizer24->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_checkBoxSilent = new wxCheckBox( m_panelOverview, wxID_ANY, _("Silent mode"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxSilent->SetToolTip( _("Run minimized and write status information to a logfile") ); + + sbSizer24->Add( m_checkBoxSilent, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 14 ); + + + sbSizer24->Add( 0, 0, 1, wxEXPAND, 5 ); + + fgSizer15->Add( sbSizer24, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer25; + sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( m_panelOverview, wxID_ANY, _("Error handling") ), wxHORIZONTAL ); + + wxArrayString m_choiceHandleErrorChoices; + m_choiceHandleError = new wxChoice( m_panelOverview, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); + m_choiceHandleError->SetSelection( 0 ); + sbSizer25->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + fgSizer15->Add( sbSizer25, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer120->Add( fgSizer15, 0, 0, 5 ); + + bSizer67->Add( bSizer120, 1, wxALIGN_CENTER_VERTICAL|wxALL, 10 ); + + m_panelOverview->SetSizer( bSizer67 ); + m_panelOverview->Layout(); + bSizer67->Fit( m_panelOverview ); + m_notebookSettings->AddPage( m_panelOverview, _("Overview"), true ); + m_panelLogging = new wxPanel( m_notebookSettings, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer117; + bSizer117 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer119; + bSizer119 = new wxBoxSizer( wxVERTICAL ); + + m_staticText120 = new wxStaticText( m_panelLogging, wxID_ANY, _("Select logfile directory:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText120->Wrap( -1 ); + bSizer119->Add( m_staticText120, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + wxStaticBoxSizer* sbSizer251; + sbSizer251 = new wxStaticBoxSizer( new wxStaticBox( m_panelLogging, wxID_ANY, _("Drag && drop") ), wxHORIZONTAL ); + + m_textCtrlLogfileDir = new wxTextCtrl( m_panelLogging, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + sbSizer251->Add( m_textCtrlLogfileDir, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerLogfileDir = new wxDirPickerCtrl( m_panelLogging, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + m_dirPickerLogfileDir->SetToolTip( _("Select a folder") ); + + sbSizer251->Add( m_dirPickerLogfileDir, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer119->Add( sbSizer251, 1, wxEXPAND, 5 ); + + bSizer117->Add( bSizer119, 0, wxEXPAND|wxALL, 10 ); + + m_panelLogging->SetSizer( bSizer117 ); + m_panelLogging->Layout(); + bSizer117->Fit( m_panelLogging ); + m_notebookSettings->AddPage( m_panelLogging, _("Logging"), false ); + + bSizer69->Add( m_notebookSettings, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer68; + bSizer68 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonSave = new wxButton( this, wxID_SAVE, _("&Save"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonSave->SetDefault(); + m_buttonSave->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer68->Add( m_buttonSave, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonLoad = new wxButton( this, wxID_OPEN, _("&Load"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonLoad->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer68->Add( m_buttonLoad, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button6->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer68->Add( m_button6, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer69->Add( bSizer68, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer54->Add( bSizer69, 1, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); + + this->SetSizer( bSizer54 ); + this->Layout(); + bSizer54->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnHelp ), NULL, this ); + m_bpButtonCmpConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCmpSettings ), NULL, this ); + m_bpButtonFilter->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnConfigureFilter ), NULL, this ); + m_bpButtonSyncConfig->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSyncSettings ), NULL, this ); + m_bpButtonAddPair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemovePair->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRemoveTopFolderPair ), NULL, this ); + m_checkBoxSilent->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckSilent ), NULL, this ); + m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_buttonSave->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); + m_buttonLoad->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLoadBatchJob ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); +} + +BatchDlgGenerated::~BatchDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( BatchDlgGenerated::OnClose ) ); + m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnHelp ), NULL, this ); + m_bpButtonCmpConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCmpSettings ), NULL, this ); + m_bpButtonFilter->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnConfigureFilter ), NULL, this ); + m_bpButtonSyncConfig->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSyncSettings ), NULL, this ); + m_bpButtonAddPair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnAddFolderPair ), NULL, this ); + m_bpButtonRemovePair->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnRemoveTopFolderPair ), NULL, this ); + m_checkBoxSilent->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCheckSilent ), NULL, this ); + m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( BatchDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_buttonSave->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnSaveBatchJob ), NULL, this ); + m_buttonLoad->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnLoadBatchJob ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( BatchDlgGenerated::OnCancel ), NULL, this ); +} + +CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) : wxPanel( parent, id, pos, size, style ) +{ + wxBoxSizer* bSizer40; + bSizer40 = new wxBoxSizer( wxVERTICAL ); + + bSizer42 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer157; + bSizer157 = new wxBoxSizer( wxVERTICAL ); + + bSizerFilesFound = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText321 = new wxStaticText( this, wxID_ANY, _("Elements found:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText321->Wrap( -1 ); + m_staticText321->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizerFilesFound->Add( m_staticText321, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextScanned = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextScanned->Wrap( -1 ); + m_staticTextScanned->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizerFilesFound->Add( m_staticTextScanned, 0, wxALIGN_BOTTOM|wxLEFT, 5 ); + + bSizer157->Add( bSizerFilesFound, 0, 0, 5 ); + + bSizerFilesRemaining = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText46 = new wxStaticText( this, wxID_ANY, _("Elements remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText46->Wrap( -1 ); + m_staticText46->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizerFilesRemaining->Add( m_staticText46, 0, wxALIGN_BOTTOM, 5 ); + + wxBoxSizer* bSizer154; + bSizer154 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextFilesRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextFilesRemaining->Wrap( -1 ); + m_staticTextFilesRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizer154->Add( m_staticTextFilesRemaining, 0, wxALIGN_BOTTOM, 5 ); + + m_staticText117 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText117->Wrap( -1 ); + m_staticText117->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizer154->Add( m_staticText117, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataRemaining->Wrap( -1 ); + m_staticTextDataRemaining->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizer154->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); + + m_staticText118 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText118->Wrap( -1 ); + m_staticText118->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizer154->Add( m_staticText118, 0, wxALIGN_BOTTOM, 5 ); + + bSizerFilesRemaining->Add( bSizer154, 0, wxALIGN_BOTTOM|wxLEFT, 5 ); + + bSizer157->Add( bSizerFilesRemaining, 0, 0, 5 ); + + bSizer42->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + + sSizerSpeed = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText104 = new wxStaticText( this, wxID_ANY, _("Speed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText104->Wrap( -1 ); + m_staticText104->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + sSizerSpeed->Add( m_staticText104, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSpeed->Wrap( -1 ); + m_staticTextSpeed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + sSizerSpeed->Add( m_staticTextSpeed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + bSizer42->Add( sSizerSpeed, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer42->Add( 10, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + sSizerTimeRemaining = new wxBoxSizer( wxHORIZONTAL ); + + m_staticTextTimeRemFixed = new wxStaticText( this, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeRemFixed->Wrap( -1 ); + m_staticTextTimeRemFixed->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + sSizerTimeRemaining->Add( m_staticTextTimeRemFixed, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextTimeRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeRemaining->Wrap( -1 ); + m_staticTextTimeRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + sSizerTimeRemaining->Add( m_staticTextTimeRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + bSizer42->Add( sSizerTimeRemaining, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + + sSizerTimeElapsed = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticText* m_staticText37; + m_staticText37 = new wxStaticText( this, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText37->Wrap( -1 ); + m_staticText37->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + sSizerTimeElapsed->Add( m_staticText37, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextTimeElapsed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeElapsed->Wrap( -1 ); + m_staticTextTimeElapsed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + sSizerTimeElapsed->Add( m_staticTextTimeElapsed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + bSizer42->Add( sSizerTimeElapsed, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer40->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer48; + bSizer48 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText30 = new wxStaticText( this, wxID_ANY, _("Operation:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText30->Wrap( -1 ); + m_staticText30->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer48->Add( m_staticText30, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlStatus = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); + m_textCtrlStatus->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer48->Add( m_textCtrlStatus, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer40->Add( bSizer48, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + m_gauge2 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,14 ), wxGA_HORIZONTAL|wxGA_SMOOTH ); + bSizer40->Add( m_gauge2, 0, wxALL|wxEXPAND, 5 ); + + this->SetSizer( bSizer40 ); + this->Layout(); + bSizer40->Fit( this ); +} + +CompareStatusGenerated::~CompareStatusGenerated() +{ +} + +SyncCfgDlgGenerated::SyncCfgDlgGenerated( 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* bSizer7; + bSizer7 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer181; + bSizer181 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer29; + bSizer29 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer7; + sbSizer7 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Select variant:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1->Wrap( -1 ); + m_staticText1->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + sbSizer7->Add( m_staticText1, 0, wxALL, 5 ); + + wxFlexGridSizer* fgSizer1; + fgSizer1 = new wxFlexGridSizer( 4, 3, 8, 5 ); + fgSizer1->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer1->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_radioBtnAutomatic = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnAutomatic->SetValue( true ); + m_radioBtnAutomatic->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer1->Add( m_radioBtnAutomatic, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonAutomatic = new wxButton( this, wxID_ANY, _(""), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonAutomatic->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer1->Add( m_buttonAutomatic, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticText81 = new wxStaticText( this, wxID_ANY, _("Identify and propagate changes on both sides using a database. Deletions and conflicts are detected automatically."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText81->Wrap( 300 ); + fgSizer1->Add( m_staticText81, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_radioBtnMirror = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnMirror->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer1->Add( m_radioBtnMirror, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonOneWay = new wxButton( this, wxID_ANY, _("Mirror ->>"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonOneWay->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 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( 300 ); + fgSizer1->Add( m_staticText8, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_radioBtnUpdate = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnUpdate->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer1->Add( m_radioBtnUpdate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_buttonUpdate = new wxButton( this, wxID_ANY, _("Update ->"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_buttonUpdate->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer1->Add( m_buttonUpdate, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticText101 = new wxStaticText( this, wxID_ANY, _("Copy new or updated files to right folder."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText101->Wrap( 300 ); + fgSizer1->Add( m_staticText101, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + m_radioBtnCustom = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnCustom->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + m_radioBtnCustom->Enable( false ); + + fgSizer1->Add( m_radioBtnCustom, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer65; + bSizer65 = new wxBoxSizer( wxVERTICAL ); + + + bSizer65->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText23 = new wxStaticText( this, wxID_ANY, _("Custom"), wxDefaultPosition, wxSize( -1,-1 ), wxALIGN_CENTRE|wxSTATIC_BORDER ); + m_staticText23->Wrap( -1 ); + m_staticText23->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + bSizer65->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer65->Add( 0, 0, 1, wxEXPAND, 5 ); + + fgSizer1->Add( bSizer65, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticText9 = new wxStaticText( this, wxID_ANY, _("Configure your own synchronization rules."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText9->Wrap( 300 ); + fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + sbSizer7->Add( fgSizer1, 0, 0, 5 ); + + bSizer29->Add( sbSizer7, 0, wxEXPAND, 5 ); + + + bSizer29->Add( 0, 5, 1, 0, 5 ); + + bSizer201 = new wxBoxSizer( wxHORIZONTAL ); + + sbSizerErrorHandling = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Error handling") ), wxHORIZONTAL ); + + wxArrayString m_choiceHandleErrorChoices; + m_choiceHandleError = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleErrorChoices, 0 ); + m_choiceHandleError->SetSelection( 0 ); + sbSizerErrorHandling->Add( m_choiceHandleError, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer201->Add( sbSizerErrorHandling, 0, wxEXPAND|wxRIGHT, 10 ); + + wxStaticBoxSizer* sbSizer231; + sbSizer231 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Deletion handling") ), wxVERTICAL ); + + wxArrayString m_choiceHandleDeletionChoices; + m_choiceHandleDeletion = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleDeletionChoices, 0 ); + m_choiceHandleDeletion->SetSelection( 0 ); + sbSizer231->Add( m_choiceHandleDeletion, 0, wxBOTTOM, 5 ); + + m_panelCustomDeletionDir = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1151; + bSizer1151 = new wxBoxSizer( wxHORIZONTAL ); + + m_textCtrlCustomDelFolder = new wxTextCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_textCtrlCustomDelFolder->SetMinSize( wxSize( 200,-1 ) ); + + bSizer1151->Add( m_textCtrlCustomDelFolder, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_dirPickerCustomDelFolder = new wxDirPickerCtrl( m_panelCustomDeletionDir, wxID_ANY, wxEmptyString, _("Select a folder"), wxDefaultPosition, wxDefaultSize, 0 ); + bSizer1151->Add( m_dirPickerCustomDelFolder, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelCustomDeletionDir->SetSizer( bSizer1151 ); + m_panelCustomDeletionDir->Layout(); + bSizer1151->Fit( m_panelCustomDeletionDir ); + sbSizer231->Add( m_panelCustomDeletionDir, 0, 0, 5 ); + + bSizer201->Add( sbSizer231, 0, wxEXPAND, 5 ); + + bSizer29->Add( bSizer201, 0, wxTOP|wxBOTTOM, 5 ); + + + bSizer29->Add( 0, 5, 1, 0, 5 ); + + wxBoxSizer* bSizer291; + bSizer291 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonOK->SetDefault(); + m_buttonOK->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer291->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button16->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer291->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer291->Add( 20, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer29->Add( bSizer291, 0, wxEXPAND, 5 ); + + bSizer181->Add( bSizer29, 0, wxEXPAND, 5 ); + + + bSizer181->Add( 10, 0, 0, 0, 5 ); + + sbSizerSyncDirections = 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, _("Category"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + 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, 70, 90, 92, false, wxEmptyString ) ); + + gSizer3->Add( m_staticText31, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizerSyncDirections->Add( gSizer3, 0, wxEXPAND, 5 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizerSyncDirections->Add( m_staticline3, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer121; + bSizer121 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer122; + bSizer122 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeftOnly = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapLeftOnly->SetToolTip( _("Files/folders that exist on left side only") ); + + bSizer122->Add( m_bitmapLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer122->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonLeftOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer122->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer122, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer123; + bSizer123 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapRightOnly = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapRightOnly->SetToolTip( _("Files/folders that exist on right side only") ); + + bSizer123->Add( m_bitmapRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer123->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonRightOnly = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer123->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer123, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer124; + bSizer124 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeftNewer = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapLeftNewer->SetToolTip( _("Files that exist on both sides, left one is newer") ); + + bSizer124->Add( m_bitmapLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer124->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonLeftNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer124->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer124, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer125; + bSizer125 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapRightNewer = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapRightNewer->SetToolTip( _("Files that exist on both sides, right one is newer") ); + + bSizer125->Add( m_bitmapRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer125->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonRightNewer = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer125->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer125, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer126; + bSizer126 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapDifferent = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapDifferent->SetToolTip( _("Files that have different content") ); + + bSizer126->Add( m_bitmapDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer126->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonDifferent = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer126->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer126, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer127; + bSizer127 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapConflict = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 45,45 ), 0 ); + m_bitmapConflict->SetToolTip( _("Conflicts/files that cannot be categorized") ); + + bSizer127->Add( m_bitmapConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer127->Add( 5, 0, 0, 0, 5 ); + + m_bpButtonConflict = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 42,42 ), wxBU_AUTODRAW ); + bSizer127->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer121->Add( bSizer127, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + sbSizerSyncDirections->Add( bSizer121, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer181->Add( sbSizerSyncDirections, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer7->Add( bSizer181, 0, wxALL, 5 ); + + this->SetSizer( bSizer7 ); + this->Layout(); + bSizer7->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncCfgDlgGenerated::OnClose ) ); + m_radioBtnAutomatic->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); + m_buttonAutomatic->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); + m_radioBtnMirror->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtnUpdate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_buttonUpdate->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_radioBtnCustom->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncCustom ), NULL, this ); + m_choiceHandleError->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_choiceHandleDeletion->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeDeletionHandling ), NULL, this ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnApply ), NULL, this ); + m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnCancel ), NULL, this ); + m_bpButtonLeftOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnDifferent ), NULL, this ); + m_bpButtonConflict->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnConflict ), NULL, this ); +} + +SyncCfgDlgGenerated::~SyncCfgDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncCfgDlgGenerated::OnClose ) ); + m_radioBtnAutomatic->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); + m_buttonAutomatic->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncAutomatic ), NULL, this ); + m_radioBtnMirror->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_buttonOneWay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncLeftToRight ), NULL, this ); + m_radioBtnUpdate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_buttonUpdate->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncUpdate ), NULL, this ); + m_radioBtnCustom->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnSyncCustom ), NULL, this ); + m_choiceHandleError->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_choiceHandleDeletion->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( SyncCfgDlgGenerated::OnChangeDeletionHandling ), NULL, this ); + m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnApply ), NULL, this ); + m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnCancel ), NULL, this ); + m_bpButtonLeftOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExLeftSideOnly ), NULL, this ); + m_bpButtonRightOnly->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnExRightSideOnly ), NULL, this ); + m_bpButtonLeftNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnLeftNewer ), NULL, this ); + m_bpButtonRightNewer->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnRightNewer ), NULL, this ); + m_bpButtonDifferent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnDifferent ), NULL, this ); + m_bpButtonConflict->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncCfgDlgGenerated::OnConflict ), NULL, this ); +} + +CmpCfgDlgGenerated::CmpCfgDlgGenerated( 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* bSizer136; + bSizer136 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer55; + bSizer55 = new wxBoxSizer( wxVERTICAL ); + + wxStaticBoxSizer* sbSizer6; + sbSizer6 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Compare by...") ), wxHORIZONTAL ); + + wxFlexGridSizer* fgSizer16; + fgSizer16 = new wxFlexGridSizer( 2, 3, 0, 0 ); + fgSizer16->SetFlexibleDirection( wxBOTH ); + fgSizer16->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_radioBtnSizeDate = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_radioBtnSizeDate->SetValue( true ); + m_radioBtnSizeDate->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same") ); + + fgSizer16->Add( m_radioBtnSizeDate, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapByTime = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapByTime->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same") ); + + fgSizer16->Add( m_bitmapByTime, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonTimeSize = new wxButton( this, wxID_ANY, _("File size and date"), wxDefaultPosition, wxSize( -1,42 ), 0 ); + m_buttonTimeSize->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + m_buttonTimeSize->SetToolTip( _("Files are found equal if\n - filesize\n - last write time and date\nare the same") ); + + fgSizer16->Add( m_buttonTimeSize, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + + m_radioBtnContent = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); + m_radioBtnContent->SetToolTip( _("Files are found equal if\n - file content\nis the same") ); + + fgSizer16->Add( m_radioBtnContent, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapByContent = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapByContent->SetToolTip( _("Files are found equal if\n - file content\nis the same") ); + + fgSizer16->Add( m_bitmapByContent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_buttonContent = new wxButton( this, wxID_ANY, _("File content"), wxDefaultPosition, wxSize( -1,42 ), 0 ); + m_buttonContent->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + m_buttonContent->SetToolTip( _("Files are found equal if\n - file content\nis the same") ); + + fgSizer16->Add( m_buttonContent, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + sbSizer6->Add( fgSizer16, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + sbSizer6->Add( m_staticline14, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButtonHelp->SetToolTip( _("Help") ); + + m_bpButtonHelp->SetToolTip( _("Help") ); + + sbSizer6->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer55->Add( sbSizer6, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 2 ); + + + bSizer55->Add( 0, 4, 0, 0, 5 ); + + wxStaticBoxSizer* sbSizer25; + sbSizer25 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Symbolic Link handling") ), wxVERTICAL ); + + wxArrayString m_choiceHandleSymlinksChoices; + m_choiceHandleSymlinks = new wxChoice( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_choiceHandleSymlinksChoices, 0 ); + m_choiceHandleSymlinks->SetSelection( 0 ); + sbSizer25->Add( m_choiceHandleSymlinks, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer55->Add( sbSizer25, 0, wxEXPAND|wxTOP, 5 ); + + wxBoxSizer* bSizer22; + bSizer22 = new wxBoxSizer( wxHORIZONTAL ); + + m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button10->SetDefault(); + m_button10->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer22->Add( m_button10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_button6 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button6->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer22->Add( m_button6, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer55->Add( bSizer22, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer136->Add( bSizer55, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + this->SetSizer( bSizer136 ); + this->Layout(); + bSizer136->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CmpCfgDlgGenerated::OnClose ) ); + m_radioBtnSizeDate->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_buttonTimeSize->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_radioBtnContent->Connect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_buttonContent->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnShowHelp ), NULL, this ); + m_choiceHandleSymlinks->Connect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_button10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnOkay ), NULL, this ); + m_button6->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnCancel ), NULL, this ); +} + +CmpCfgDlgGenerated::~CmpCfgDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CmpCfgDlgGenerated::OnClose ) ); + m_radioBtnSizeDate->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_buttonTimeSize->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnTimeSize ), NULL, this ); + m_radioBtnContent->Disconnect( wxEVT_COMMAND_RADIOBUTTON_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_buttonContent->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnContent ), NULL, this ); + m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnShowHelp ), NULL, this ); + m_choiceHandleSymlinks->Disconnect( wxEVT_COMMAND_CHOICE_SELECTED, wxCommandEventHandler( CmpCfgDlgGenerated::OnChangeErrorHandling ), NULL, this ); + m_button10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnOkay ), NULL, this ); + m_button6->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CmpCfgDlgGenerated::OnCancel ), NULL, this ); +} + +SyncStatusDlgGenerated::SyncStatusDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( 470,300 ), wxDefaultSize ); + this->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); + + wxBoxSizer* bSizer27; + bSizer27 = new wxBoxSizer( wxVERTICAL ); + + + bSizer27->Add( 0, 15, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer37; + bSizer37 = new wxBoxSizer( wxHORIZONTAL ); + + m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation, wxDefaultPosition, wxSize( 45,45 )); + bSizer37->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + 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, _("Synchronization status"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer37->Add( m_panel8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer27->Add( bSizer37, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer42; + bSizer42 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer42->Add( 0, 0, 1, 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 ); + + m_staticTextStatus = new wxStaticText( this, wxID_ANY, _("Synchronizing..."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextStatus->Wrap( -1 ); + m_staticTextStatus->SetFont( wxFont( 14, 70, 93, 90, false, wxEmptyString ) ); + + bSizer42->Add( m_staticTextStatus, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + bSizer42->Add( 0, 0, 1, wxEXPAND, 5 ); + + bSizer27->Add( bSizer42, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer31 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer111; + bSizer111 = new wxBoxSizer( wxVERTICAL ); + + bSizerObjectsRemaining = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText25 = new wxStaticText( this, wxID_ANY, _("Elements remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText25->Wrap( -1 ); + m_staticText25->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizerObjectsRemaining->Add( m_staticText25, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextRemainingObj = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextRemainingObj->Wrap( -1 ); + m_staticTextRemainingObj->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizerObjectsRemaining->Add( m_staticTextRemainingObj, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + m_staticText96 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText96->Wrap( -1 ); + m_staticText96->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizerObjectsRemaining->Add( m_staticText96, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + m_staticTextDataRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataRemaining->Wrap( -1 ); + m_staticTextDataRemaining->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizerObjectsRemaining->Add( m_staticTextDataRemaining, 0, wxALIGN_BOTTOM, 5 ); + + m_staticText97 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText97->Wrap( -1 ); + m_staticText97->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizerObjectsRemaining->Add( m_staticText97, 0, wxALIGN_BOTTOM, 5 ); + + bSizer111->Add( bSizerObjectsRemaining, 0, 0, 5 ); + + bSizerObjectsProcessed = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText251 = new wxStaticText( this, wxID_ANY, _("Elements processed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText251->Wrap( -1 ); + m_staticText251->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizerObjectsProcessed->Add( m_staticText251, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextProcessedObj = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); + m_staticTextProcessedObj->Wrap( -1 ); + m_staticTextProcessedObj->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizerObjectsProcessed->Add( m_staticTextProcessedObj, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + m_staticText98 = new wxStaticText( this, wxID_ANY, _("("), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText98->Wrap( -1 ); + m_staticText98->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizerObjectsProcessed->Add( m_staticText98, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + m_staticTextDataProcessed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextDataProcessed->Wrap( -1 ); + m_staticTextDataProcessed->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizerObjectsProcessed->Add( m_staticTextDataProcessed, 0, wxALIGN_BOTTOM, 5 ); + + m_staticText99 = new wxStaticText( this, wxID_ANY, _(")"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText99->Wrap( -1 ); + m_staticText99->SetFont( wxFont( 9, 74, 90, 90, false, wxT("Arial") ) ); + + bSizerObjectsProcessed->Add( m_staticText99, 0, wxALIGN_BOTTOM, 5 ); + + bSizer111->Add( bSizerObjectsProcessed, 0, 0, 5 ); + + bSizer31->Add( bSizer111, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer31->Add( 0, 0, 1, wxEXPAND, 5 ); + + wxBoxSizer* bSizer114; + bSizer114 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText55 = new wxStaticText( this, wxID_ANY, _("Time elapsed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText55->Wrap( -1 ); + m_staticText55->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer114->Add( m_staticText55, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextTimeElapsed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeElapsed->Wrap( -1 ); + m_staticTextTimeElapsed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizer114->Add( m_staticTextTimeElapsed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + bSizer31->Add( bSizer114, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer27->Add( bSizer31, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxRIGHT|wxLEFT, 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, wxEXPAND|wxALL, 5 ); + + m_gauge1 = new wxGauge( this, wxID_ANY, 100, wxDefaultPosition, wxSize( -1,20 ), wxGA_HORIZONTAL ); + bSizer27->Add( m_gauge1, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizer28 = new wxBoxSizer( wxHORIZONTAL ); + + bSizerSpeed = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText108 = new wxStaticText( this, wxID_ANY, _("Speed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText108->Wrap( -1 ); + m_staticText108->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizerSpeed->Add( m_staticText108, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextSpeed = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSpeed->Wrap( -1 ); + m_staticTextSpeed->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizerSpeed->Add( m_staticTextSpeed, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + bSizer28->Add( bSizerSpeed, 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, 70, 90, 90, false, wxEmptyString ) ); + m_buttonOK->Enable( false ); + m_buttonOK->Hide(); + + bSizer28->Add( m_buttonOK, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonPause = new wxButton( this, wxID_ANY, _("&Pause"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonPause->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer28->Add( m_buttonPause, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer28->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + bSizer28->Add( 0, 0, 1, 0, 5 ); + + bSizerRemTime = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText21 = new wxStaticText( this, wxID_ANY, _("Time remaining:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText21->Wrap( -1 ); + m_staticText21->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizerRemTime->Add( m_staticText21, 0, wxALIGN_BOTTOM, 5 ); + + m_staticTextTimeRemaining = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextTimeRemaining->Wrap( -1 ); + m_staticTextTimeRemaining->SetFont( wxFont( 9, 74, 90, 92, false, wxT("Arial") ) ); + + bSizerRemTime->Add( m_staticTextTimeRemaining, 0, wxLEFT|wxALIGN_BOTTOM, 5 ); + + bSizer28->Add( bSizerRemTime, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer27->Add( bSizer28, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxALL, 5 ); + + + bSizer27->Add( 0, 5, 0, wxEXPAND, 5 ); + + this->SetSizer( bSizer27 ); + this->Layout(); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); + this->Connect( wxEVT_ICONIZE, wxIconizeEventHandler( SyncStatusDlgGenerated::OnIconize ) ); + 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 ); +} + +SyncStatusDlgGenerated::~SyncStatusDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncStatusDlgGenerated::OnClose ) ); + this->Disconnect( wxEVT_ICONIZE, wxIconizeEventHandler( SyncStatusDlgGenerated::OnIconize ) ); + 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 ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer20; + bSizer20 = new wxBoxSizer( wxVERTICAL ); + + + bSizer20->Add( 0, 10, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer85; + bSizer85 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap25 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); + bSizer85->Add( m_bitmap25, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); + + 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, 70, 90, 92, false, wxEmptyString ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer72->Add( 20, 0, 0, 0, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer85->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer85->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer20->Add( bSizer85, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_notebook1 = new wxNotebook( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + m_scrolledWindow1 = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL ); + m_scrolledWindow1->SetScrollRate( 5, 5 ); + m_scrolledWindow1->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVEBORDER ) ); + + wxBoxSizer* bSizer70; + bSizer70 = new wxBoxSizer( wxVERTICAL ); + + m_staticText59 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("Compare by \"File size and date\""), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText59->Wrap( 500 ); + m_staticText59->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + + bSizer70->Add( m_staticText59, 0, wxALL|wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText60 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("This variant evaluates two equally named files as being equal when they have the same file size AND the same last write date and time."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText60->Wrap( 500 ); + bSizer70->Add( m_staticText60, 0, wxALL, 5 ); + + m_staticText61 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("When the comparison is started with this option set the following decision tree is processed:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText61->Wrap( 500 ); + bSizer70->Add( m_staticText61, 0, wxALL, 5 ); + + m_treeCtrl1 = new wxTreeCtrl( m_scrolledWindow1, wxID_ANY, wxDefaultPosition, wxSize( -1,175 ), wxTR_DEFAULT_STYLE ); + m_treeCtrl1->SetBackgroundColour( wxColour( 237, 236, 235 ) ); + + bSizer70->Add( m_treeCtrl1, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_staticText63 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("As a result the files are separated into the following categories:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText63->Wrap( 500 ); + bSizer70->Add( m_staticText63, 0, wxALL, 5 ); + + m_staticText75 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- equal"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText75->Wrap( -1 ); + bSizer70->Add( m_staticText75, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText76 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- left newer"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText76->Wrap( -1 ); + bSizer70->Add( m_staticText76, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText77 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- right newer"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText77->Wrap( -1 ); + bSizer70->Add( m_staticText77, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText79 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- exists left only"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText79->Wrap( -1 ); + bSizer70->Add( m_staticText79, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText80 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- exists right only"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText80->Wrap( -1 ); + bSizer70->Add( m_staticText80, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText78 = new wxStaticText( m_scrolledWindow1, wxID_ANY, _("- conflict"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText78->Wrap( -1 ); + bSizer70->Add( m_staticText78, 0, wxRIGHT|wxLEFT, 5 ); + + m_scrolledWindow1->SetSizer( bSizer70 ); + m_scrolledWindow1->Layout(); + bSizer70->Fit( m_scrolledWindow1 ); + m_notebook1->AddPage( m_scrolledWindow1, _("File size and date"), true ); + m_scrolledWindow5 = new wxScrolledWindow( m_notebook1, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHSCROLL|wxSIMPLE_BORDER|wxVSCROLL ); + m_scrolledWindow5->SetScrollRate( 5, 5 ); + m_scrolledWindow5->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_INACTIVEBORDER ) ); + + wxBoxSizer* bSizer74; + bSizer74 = new wxBoxSizer( wxVERTICAL ); + + m_staticText65 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("Compare by \"File content\""), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText65->Wrap( 500 ); + m_staticText65->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + + bSizer74->Add( m_staticText65, 0, wxALL, 5 ); + + m_staticText66 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("As 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:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText66->Wrap( 500 ); + bSizer74->Add( m_staticText66, 0, wxALL, 5 ); + + m_treeCtrl2 = new wxTreeCtrl( m_scrolledWindow5, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE ); + m_treeCtrl2->SetBackgroundColour( wxColour( 237, 236, 235 ) ); + m_treeCtrl2->SetMinSize( wxSize( -1,130 ) ); + + bSizer74->Add( m_treeCtrl2, 0, wxALL|wxEXPAND, 5 ); + + m_staticText69 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("As a result the files are separated into the following categories:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText69->Wrap( 500 ); + bSizer74->Add( m_staticText69, 0, wxALL, 5 ); + + m_staticText81 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- equal"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText81->Wrap( -1 ); + bSizer74->Add( m_staticText81, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText82 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- different"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText82->Wrap( -1 ); + bSizer74->Add( m_staticText82, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText83 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- exists left only"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText83->Wrap( -1 ); + bSizer74->Add( m_staticText83, 0, wxRIGHT|wxLEFT, 5 ); + + m_staticText84 = new wxStaticText( m_scrolledWindow5, wxID_ANY, _("- exists right only"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText84->Wrap( -1 ); + bSizer74->Add( m_staticText84, 0, wxRIGHT|wxLEFT, 5 ); + + m_scrolledWindow5->SetSizer( bSizer74 ); + m_scrolledWindow5->Layout(); + bSizer74->Fit( m_scrolledWindow5 ); + m_notebook1->AddPage( m_scrolledWindow5, _("File content"), false ); + + bSizer20->Add( m_notebook1, 1, wxEXPAND | wxALL, 5 ); + + m_button8 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_button8->SetDefault(); + m_button8->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer20->Add( m_button8, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer20 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HelpDlgGenerated::OnClose ) ); + m_button8->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HelpDlgGenerated::OnOK ), NULL, this ); +} + +HelpDlgGenerated::~HelpDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( HelpDlgGenerated::OnClose ) ); + m_button8->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( HelpDlgGenerated::OnOK ), NULL, this ); +} + +AboutDlgGenerated::AboutDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer31; + bSizer31 = new wxBoxSizer( wxVERTICAL ); + + + 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 ) ); + + wxBoxSizer* bSizer36; + bSizer36 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap11 = new wxStaticBitmap( m_panel5, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 404,55 ), 0 ); + bSizer36->Add( m_bitmap11, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panel5->SetSizer( bSizer36 ); + m_panel5->Layout(); + bSizer36->Fit( m_panel5 ); + bSizer31->Add( m_panel5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_build = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_build->Wrap( -1 ); + m_build->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + + bSizer31->Add( m_build, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer31->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer53; + bSizer53 = new wxBoxSizer( wxVERTICAL ); + + m_scrolledWindowCodeInfo = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); + m_scrolledWindowCodeInfo->SetScrollRate( 5, 5 ); + m_scrolledWindowCodeInfo->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_scrolledWindowCodeInfo->SetMinSize( wxSize( -1,120 ) ); + + bSizerCodeInfo = new wxBoxSizer( wxVERTICAL ); + + m_staticText72 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _("Source code written completely in C++ utilizing:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText72->Wrap( -1 ); + m_staticText72->SetFont( wxFont( wxNORMAL_FONT->GetPointSize(), 70, 90, 92, false, wxEmptyString ) ); + + bSizerCodeInfo->Add( m_staticText72, 0, wxTOP|wxBOTTOM|wxLEFT|wxEXPAND, 5 ); + + m_staticText73 = new wxStaticText( m_scrolledWindowCodeInfo, wxID_ANY, _(" MinGW \t- Windows port of GNU Compiler Collection\n wxWidgets \t- Open-Source GUI framework\n wxFormBuilder\t- wxWidgets GUI-builder\n CodeBlocks \t- Open-Source IDE"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText73->Wrap( -1 ); + bSizerCodeInfo->Add( m_staticText73, 0, wxALL|wxEXPAND, 5 ); + + m_hyperlink21 = new wxHyperlinkCtrl( m_scrolledWindowCodeInfo, wxID_ANY, _("- ZenJu -"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink21->SetFont( wxFont( 10, 74, 93, 92, false, wxT("Segoe Print") ) ); + m_hyperlink21->SetToolTip( _("zhnmju123@gmx.de") ); + + bSizerCodeInfo->Add( m_hyperlink21, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_scrolledWindowCodeInfo->SetSizer( bSizerCodeInfo ); + m_scrolledWindowCodeInfo->Layout(); + bSizerCodeInfo->Fit( m_scrolledWindowCodeInfo ); + bSizer53->Add( m_scrolledWindowCodeInfo, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 10 ); + + m_scrolledWindowTranslators = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxDOUBLE_BORDER|wxHSCROLL|wxVSCROLL ); + m_scrolledWindowTranslators->SetScrollRate( 5, 5 ); + m_scrolledWindowTranslators->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + m_scrolledWindowTranslators->SetMinSize( wxSize( -1,140 ) ); + m_scrolledWindowTranslators->SetMaxSize( wxSize( -1,145 ) ); + + bSizerTranslators = new wxBoxSizer( wxVERTICAL ); + + m_staticText54 = new wxStaticText( m_scrolledWindowTranslators, wxID_ANY, _("Big thanks for localizing FreeFileSync goes out to:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText54->Wrap( -1 ); + m_staticText54->SetFont( wxFont( 8, 70, 90, 92, false, wxEmptyString ) ); + + bSizerTranslators->Add( m_staticText54, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); + + + bSizerTranslators->Add( 0, 5, 0, 0, 5 ); + + fgSizerTranslators = new wxFlexGridSizer( 50, 3, 5, 20 ); + fgSizerTranslators->SetFlexibleDirection( wxBOTH ); + fgSizerTranslators->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + bSizerTranslators->Add( fgSizerTranslators, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_scrolledWindowTranslators->SetSizer( bSizerTranslators ); + m_scrolledWindowTranslators->Layout(); + bSizerTranslators->Fit( m_scrolledWindowTranslators ); + bSizer53->Add( m_scrolledWindowTranslators, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM, 5 ); + + bSizer31->Add( bSizer53, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 25 ); + + m_staticline3 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer31->Add( m_staticline3, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + m_staticText131 = new wxStaticText( this, wxID_ANY, _("Feedback and suggestions are welcome at:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText131->Wrap( -1 ); + m_staticText131->SetFont( wxFont( 11, 70, 90, 92, false, wxEmptyString ) ); + + bSizer31->Add( m_staticText131, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer31->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer104; + bSizer104 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer103; + bSizer103 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap9->SetToolTip( _("FreeFileSync at Sourceforge") ); + + bSizer103->Add( m_bitmap9, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink1 = new wxHyperlinkCtrl( this, wxID_ANY, _("Homepage"), wxT("http://sourceforge.net/projects/freefilesync/"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink1->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + m_hyperlink1->SetToolTip( _("http://sourceforge.net/projects/freefilesync/") ); + + bSizer103->Add( m_hyperlink1, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer103->Add( 20, 0, 1, wxEXPAND, 5 ); + + m_hyperlink6 = new wxHyperlinkCtrl( this, wxID_ANY, _("Report translation error"), wxT("http://sourceforge.net/projects/freefilesync/forums/forum/976976"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink6->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + m_hyperlink6->SetToolTip( _("http://sourceforge.net/projects/freefilesync/forums/forum/976976") ); + + bSizer103->Add( m_hyperlink6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer104->Add( bSizer103, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer108; + bSizer108 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + m_bitmap10->SetToolTip( _("Email") ); + + bSizer108->Add( m_bitmap10, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink2 = new wxHyperlinkCtrl( this, wxID_ANY, _("Email"), wxT("mailto:zhnmju123@gmx.de"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink2->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + m_hyperlink2->SetToolTip( _("zhnmju123@gmx.de") ); + + bSizer108->Add( m_hyperlink2, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer108->Add( 30, 0, 1, wxEXPAND, 5 ); + + m_animationControl1 = new wxAnimationCtrl(this, wxID_ANY, wxNullAnimation); + m_animationControl1->SetToolTip( _("Donate with PayPal") ); + + bSizer108->Add( m_animationControl1, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_hyperlink3 = new wxHyperlinkCtrl( this, wxID_ANY, _("If you like FFS"), wxT("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123%40gmx%2ede&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + m_hyperlink3->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + m_hyperlink3->SetToolTip( _("https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=zhnmju123%40gmx%2ede&no_shipping=0&no_note=1&tax=0¤cy_code=EUR&lc=EN&bn=PP%2dDonationsBF&charset=UTF%2d8") ); + + bSizer108->Add( m_hyperlink3, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer104->Add( bSizer108, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + bSizer31->Add( bSizer104, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline2 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + 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|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 ); + + m_hyperlink5 = new wxHyperlinkCtrl( this, wxID_ANY, _("http://www.gnu.org/licenses/gpl.html"), wxT("http://www.gnu.org/licenses/gpl.html"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE ); + sbSizer14->Add( m_hyperlink5, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + sbSizer14->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer31->Add( sbSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + m_buttonOkay = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( 100,32 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer31->Add( m_buttonOkay, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + this->SetSizer( bSizer31 ); + this->Layout(); + bSizer31->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); +} + +AboutDlgGenerated::~AboutDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( AboutDlgGenerated::OnClose ) ); + m_buttonOkay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( AboutDlgGenerated::OnOK ), NULL, this ); +} + +ErrorDlgGenerated::ErrorDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer24; + bSizer24 = new wxBoxSizer( wxVERTICAL ); + + + bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer26; + bSizer26 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); + m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_checkBoxIgnoreErrors = new wxCheckBox( this, wxID_ANY, _("Ignore subsequent errors"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxIgnoreErrors->SetToolTip( _("Hide further error messages during the current process") ); + + bSizer24->Add( m_checkBoxIgnoreErrors, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 10 ); + + + bSizer24->Add( 0, 5, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer25; + bSizer25 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonIgnore = new wxButton( this, wxID_OK, _("&Ignore"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonIgnore->SetDefault(); + m_buttonIgnore->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonIgnore, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonRetry = new wxButton( this, wxID_RETRY, _("&Retry"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonRetry->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonRetry, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonAbort, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + + bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer24 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ErrorDlgGenerated::OnClose ) ); + m_buttonIgnore->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnIgnore ), NULL, this ); + m_buttonRetry->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnRetry ), NULL, this ); + m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnAbort ), NULL, this ); +} + +ErrorDlgGenerated::~ErrorDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( ErrorDlgGenerated::OnClose ) ); + m_buttonIgnore->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnIgnore ), NULL, this ); + m_buttonRetry->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnRetry ), NULL, this ); + m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ErrorDlgGenerated::OnAbort ), NULL, this ); +} + +WarningDlgGenerated::WarningDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer24; + bSizer24 = new wxBoxSizer( wxVERTICAL ); + + + bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer26; + bSizer26 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); + m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer24->Add( m_checkBoxDontShowAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 10 ); + + + bSizer24->Add( 0, 5, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer25; + bSizer25 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonIgnore = new wxButton( this, wxID_IGNORE, _("&Ignore"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonIgnore->SetDefault(); + m_buttonIgnore->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonIgnore, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonSwitch = new wxButton( this, wxID_MORE, _("&Switch"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonSwitch->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonSwitch, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonAbort = new wxButton( this, wxID_CANCEL, _("&Abort"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonAbort->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonAbort, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + + bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer24 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( WarningDlgGenerated::OnClose ) ); + m_buttonIgnore->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnIgnore ), NULL, this ); + m_buttonSwitch->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnSwitch ), NULL, this ); + m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnAbort ), NULL, this ); +} + +WarningDlgGenerated::~WarningDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( WarningDlgGenerated::OnClose ) ); + m_buttonIgnore->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnIgnore ), NULL, this ); + m_buttonSwitch->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnSwitch ), NULL, this ); + m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( WarningDlgGenerated::OnAbort ), NULL, this ); +} + +QuestionDlgGenerated::QuestionDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer24; + bSizer24 = new wxBoxSizer( wxVERTICAL ); + + + bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer26; + bSizer26 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap10 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 48,48 ), 0 ); + bSizer26->Add( m_bitmap10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrl8 = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); + m_textCtrl8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer26->Add( m_textCtrl8, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + bSizer24->Add( bSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_checkBoxDontAskAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer24->Add( m_checkBoxDontAskAgain, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP, 10 ); + + + bSizer24->Add( 0, 5, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer25; + bSizer25 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonYes = new wxButton( this, wxID_YES, _("&Yes"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonYes->SetDefault(); + m_buttonYes->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonYes, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonNo = new wxButton( this, wxID_NO, _("&No"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonNo->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonNo, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonCancel->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonCancel, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + + bSizer25->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer24 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( QuestionDlgGenerated::OnClose ) ); + m_buttonYes->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnYes ), NULL, this ); + m_buttonNo->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnNo ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCancel ), NULL, this ); +} + +QuestionDlgGenerated::~QuestionDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( QuestionDlgGenerated::OnClose ) ); + m_buttonYes->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnYes ), NULL, this ); + m_buttonNo->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnNo ), NULL, this ); + m_buttonCancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( QuestionDlgGenerated::OnCancel ), NULL, this ); +} + +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 ); + + wxBoxSizer* bSizer24; + bSizer24 = new wxBoxSizer( wxVERTICAL ); + + + bSizer24->Add( 0, 10, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer41; + bSizer41 = new wxBoxSizer( wxHORIZONTAL ); + + + bSizer41->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bitmap12 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); + bSizer41->Add( m_bitmap12, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextHeader = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextHeader->Wrap( -1 ); + m_staticTextHeader->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer41->Add( m_staticTextHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer41->Add( 0, 0, 1, wxEXPAND, 5 ); + + bSizer24->Add( bSizer41, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer99; + bSizer99 = new wxBoxSizer( wxHORIZONTAL ); + + m_checkBoxDeleteBothSides = new wxCheckBox( this, wxID_ANY, _("Delete on both sides"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxDeleteBothSides->SetToolTip( _("Delete on both sides even if the file is selected on one side only") ); + + bSizer99->Add( m_checkBoxDeleteBothSides, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer99->Add( 0, 0, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); + + m_checkBoxUseRecycler = new wxCheckBox( this, wxID_ANY, _("Use Recycle Bin"), wxDefaultPosition, wxDefaultSize, 0 ); + m_checkBoxUseRecycler->SetValue(true); + + bSizer99->Add( m_checkBoxUseRecycler, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer24->Add( bSizer99, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); + + m_textCtrlMessage = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE|wxTE_READONLY ); + m_textCtrlMessage->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_ACTIVEBORDER ) ); + + bSizer24->Add( m_textCtrlMessage, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer25; + bSizer25 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonOK = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonOK->SetDefault(); + m_buttonOK->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonOK, 0, wxTOP|wxBOTTOM|wxLEFT, 5 ); + + m_buttonCancel = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonCancel->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer25->Add( m_buttonCancel, 0, wxALL, 5 ); + + bSizer24->Add( bSizer25, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + this->SetSizer( bSizer24 ); + this->Layout(); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_checkBoxDeleteBothSides->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); + m_checkBoxUseRecycler->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), NULL, this ); + m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnOK ), NULL, this ); + m_buttonCancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnCancel ), NULL, this ); +} + +DeleteDlgGenerated::~DeleteDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( DeleteDlgGenerated::OnClose ) ); + m_checkBoxDeleteBothSides->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnDelOnBothSides ), NULL, this ); + m_checkBoxUseRecycler->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DeleteDlgGenerated::OnUseRecycler ), NULL, this ); + m_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 ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer21; + bSizer21 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer86; + bSizer86 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmap26 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); + bSizer86->Add( m_bitmap26, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); + + m_panel8 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSIMPLE_BORDER|wxTAB_TRAVERSAL ); + m_panel8->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_3DLIGHT ) ); + + wxBoxSizer* bSizer72; + bSizer72 = new wxBoxSizer( wxVERTICAL ); + + m_staticTexHeader = new wxStaticText( m_panel8, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTexHeader->Wrap( -1 ); + m_staticTexHeader->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + + bSizer72->Add( m_staticTexHeader, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + + bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer21->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer70; + bSizer70 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText44 = new wxStaticText( this, wxID_ANY, _("Only files/directories that pass filtering will be selected for synchronization. The filter will be applied to the name relative(!) to the base synchronization directories."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText44->Wrap( 400 ); + bSizer70->Add( m_staticText44, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bpButtonHelp = new wxBitmapButton( this, wxID_HELP, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButtonHelp->SetToolTip( _("Help") ); + + m_bpButtonHelp->SetToolTip( _("Help") ); + + bSizer70->Add( m_bpButtonHelp, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + bSizer21->Add( bSizer70, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); + + + bSizer21->Add( 0, 5, 0, 0, 5 ); + + m_panel13 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer69; + bSizer69 = new wxBoxSizer( wxVERTICAL ); + + m_staticline10 = new wxStaticLine( m_panel13, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer69->Add( m_staticline10, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer52; + bSizer52 = new wxBoxSizer( wxVERTICAL ); + + m_staticText45 = new wxStaticText( m_panel13, wxID_ANY, _("Hints:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText45->Wrap( -1 ); + m_staticText45->SetFont( wxFont( 10, 70, 90, 92, true, wxEmptyString ) ); + + bSizer52->Add( m_staticText45, 0, wxBOTTOM, 5 ); + + m_staticText83 = new wxStaticText( m_panel13, wxID_ANY, _("1. Enter relative file or directory names separated by ';' or a new line."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText83->Wrap( -1 ); + bSizer52->Add( m_staticText83, 0, 0, 5 ); + + m_staticText84 = new wxStaticText( m_panel13, wxID_ANY, _("2. Use wildcard characters '*' and '?'."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText84->Wrap( -1 ); + bSizer52->Add( m_staticText84, 0, 0, 5 ); + + m_staticText85 = new wxStaticText( m_panel13, wxID_ANY, _("3. Exclude files directly on main grid via context menu."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText85->Wrap( -1 ); + bSizer52->Add( m_staticText85, 0, 0, 5 ); + + bSizer69->Add( bSizer52, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 10 ); + + wxStaticBoxSizer* sbSizer21; + sbSizer21 = new wxStaticBoxSizer( new wxStaticBox( m_panel13, wxID_ANY, _("Example") ), wxVERTICAL ); + + wxBoxSizer* bSizer66; + bSizer66 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText181 = new wxStaticText( m_panel13, wxID_ANY, _("Include: *.doc;*.zip;*.exe\nExclude: \\stuff\\temp\\*"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText181->Wrap( -1 ); + bSizer66->Add( m_staticText181, 0, wxRIGHT|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticText1811 = new wxStaticText( m_panel13, wxID_ANY, _("Synchronize all .doc, .zip and .exe files except everything in subfolder \"temp\"."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1811->Wrap( 250 ); + m_staticText1811->SetFont( wxFont( 8, 70, 93, 90, false, wxEmptyString ) ); + + bSizer66->Add( m_staticText1811, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + + sbSizer21->Add( bSizer66, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT, 5 ); + + bSizer69->Add( sbSizer21, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_panel13->SetSizer( bSizer69 ); + m_panel13->Layout(); + bSizer69->Fit( m_panel13 ); + bSizer21->Add( m_panel13, 0, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM|wxEXPAND, 5 ); + + wxStaticBoxSizer* sbSizer8; + sbSizer8 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + + wxFlexGridSizer* fgSizer3; + fgSizer3 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer3->AddGrowableCol( 1 ); + fgSizer3->AddGrowableRow( 1 ); + fgSizer3->SetFlexibleDirection( wxBOTH ); + fgSizer3->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + + fgSizer3->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText15 = new wxStaticText( this, wxID_ANY, _("Include"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText15->Wrap( -1 ); + m_staticText15->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer3->Add( m_staticText15, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_bitmap8 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + fgSizer3->Add( m_bitmap8, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlInclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); + fgSizer3->Add( m_textCtrlInclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + sbSizer8->Add( fgSizer3, 1, wxEXPAND, 5 ); + + wxFlexGridSizer* fgSizer4; + fgSizer4 = new wxFlexGridSizer( 2, 2, 0, 0 ); + fgSizer4->AddGrowableCol( 1 ); + fgSizer4->AddGrowableRow( 1 ); + fgSizer4->SetFlexibleDirection( wxBOTH ); + fgSizer4->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + + fgSizer4->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText16 = new wxStaticText( this, wxID_ANY, _("Exclude"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText16->Wrap( -1 ); + m_staticText16->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer4->Add( m_staticText16, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_bitmap9 = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 30,30 ), 0 ); + fgSizer4->Add( m_bitmap9, 0, wxTOP|wxBOTTOM|wxLEFT|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlExclude = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( -1,-1 ), wxTE_MULTILINE ); + fgSizer4->Add( m_textCtrlExclude, 1, wxALL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + sbSizer8->Add( fgSizer4, 1, wxEXPAND, 5 ); + + bSizer21->Add( sbSizer8, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|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( -1,30 ), 0 ); + m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer22->Add( m_button9, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer22->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_button10 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button10->SetDefault(); + m_button10->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer22->Add( m_button10, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_button17 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button17->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer22->Add( m_button17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer21->Add( bSizer22, 0, wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM|wxEXPAND, 5 ); + + this->SetSizer( bSizer21 ); + this->Layout(); + bSizer21->Fit( this ); + + this->Centre( wxBOTH ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( FilterDlgGenerated::OnClose ) ); + m_bpButtonHelp->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnHelp ), NULL, this ); + m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnDefault ), NULL, this ); + m_button10->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnApply ), NULL, this ); + m_button17->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnCancel ), NULL, this ); +} + +FilterDlgGenerated::~FilterDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( FilterDlgGenerated::OnClose ) ); + m_bpButtonHelp->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnHelp ), NULL, this ); + m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnDefault ), NULL, this ); + m_button10->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnApply ), NULL, this ); + m_button17->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( FilterDlgGenerated::OnCancel ), NULL, this ); +} + +CustomizeColsDlgGenerated::CustomizeColsDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + + wxBoxSizer* bSizer96; + bSizer96 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer99; + bSizer99 = new wxBoxSizer( wxHORIZONTAL ); + + wxArrayString m_checkListColumnsChoices; + m_checkListColumns = new wxCheckListBox( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_checkListColumnsChoices, 0 ); + bSizer99->Add( m_checkListColumns, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer98; + bSizer98 = new wxBoxSizer( wxVERTICAL ); + + m_bpButton29 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButton29->SetToolTip( _("Move column up") ); + + m_bpButton29->SetToolTip( _("Move column up") ); + + bSizer98->Add( m_bpButton29, 0, wxTOP|wxRIGHT|wxLEFT, 5 ); + + m_bpButton30 = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + m_bpButton30->SetToolTip( _("Move column down") ); + + m_bpButton30->SetToolTip( _("Move column down") ); + + bSizer98->Add( m_bpButton30, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizer99->Add( bSizer98, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer96->Add( bSizer99, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + wxBoxSizer* bSizer97; + bSizer97 = new wxBoxSizer( wxHORIZONTAL ); + + m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer97->Add( m_button9, 0, wxALL, 5 ); + + + bSizer97->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + m_button28 = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button28->SetDefault(); + m_button28->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer97->Add( m_button28, 0, wxALL, 5 ); + + m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer97->Add( m_button29, 0, wxALL, 5 ); + + bSizer96->Add( bSizer97, 0, wxBOTTOM|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + this->SetSizer( bSizer96 ); + this->Layout(); + bSizer96->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CustomizeColsDlgGenerated::OnClose ) ); + m_bpButton29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveUp ), NULL, this ); + m_bpButton30->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveDown ), NULL, this ); + m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); + m_button28->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), NULL, this ); + m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnCancel ), NULL, this ); +} + +CustomizeColsDlgGenerated::~CustomizeColsDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( CustomizeColsDlgGenerated::OnClose ) ); + m_bpButton29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveUp ), NULL, this ); + m_bpButton30->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnMoveDown ), NULL, this ); + m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnDefault ), NULL, this ); + m_button28->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnOkay ), NULL, this ); + m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CustomizeColsDlgGenerated::OnCancel ), NULL, this ); +} + +GlobalSettingsDlgGenerated::GlobalSettingsDlgGenerated( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxSize( 280,230 ), wxDefaultSize ); + + wxBoxSizer* bSizer95; + bSizer95 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer86; + bSizer86 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapSettings = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), 0 ); + bSizer86->Add( m_bitmapSettings, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + + bSizer86->Add( 0, 0, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + 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, _("Global settings"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText56->Wrap( -1 ); + m_staticText56->SetFont( wxFont( 16, 70, 90, 92, false, wxEmptyString ) ); + + bSizer72->Add( m_staticText56, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + m_panel8->SetSizer( bSizer72 ); + m_panel8->Layout(); + bSizer72->Fit( m_panel8 ); + bSizer86->Add( m_panel8, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + bSizer95->Add( bSizer86, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + bSizer95->Add( 0, 10, 0, 0, 5 ); + + wxStaticBoxSizer* sbSizer23; + sbSizer23 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, wxEmptyString ), wxVERTICAL ); + + m_checkBoxIgnoreOneHour = new wxCheckBox( this, wxID_ANY, _("Ignore 1-hour file time difference"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxIgnoreOneHour->SetToolTip( _("Treat file times that differ by exactly +/- 1 hour as equal, less than 1 hour as conflict in order to handle Daylight Saving Time changes") ); + + sbSizer23->Add( m_checkBoxIgnoreOneHour, 0, wxALL|wxEXPAND, 5 ); + + m_checkBoxCopyLocked = new wxCheckBox( this, wxID_ANY, _("Copy locked files"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxCopyLocked->SetToolTip( _("Copy shared or locked files using Volume Shadow Copy Service\n(Requires Administrator rights)") ); + + sbSizer23->Add( m_checkBoxCopyLocked, 0, wxALL|wxEXPAND, 5 ); + + m_checkBoxCopyPermissions = new wxCheckBox( this, wxID_ANY, _("Copy filesystem permissions"), wxDefaultPosition, wxDefaultSize, 0 ); + + m_checkBoxCopyPermissions->SetToolTip( _("Transfer file and directory permissions\n(Requires Administrator rights)") ); + + sbSizer23->Add( m_checkBoxCopyPermissions, 0, wxALL|wxEXPAND, 5 ); + + m_staticline10 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + sbSizer23->Add( m_staticline10, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer101; + bSizer101 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText100 = new wxStaticText( this, wxID_ANY, _("Hidden dialogs:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText100->Wrap( -1 ); + bSizer101->Add( m_staticText100, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer101->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_buttonResetDialogs = new wxButtonWithImage( this, wxID_ANY, _("Reset"), wxDefaultPosition, wxSize( 80,-1 ), 0 ); + m_buttonResetDialogs->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + m_buttonResetDialogs->SetToolTip( _("Show hidden dialogs") ); + + bSizer101->Add( m_buttonResetDialogs, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer23->Add( bSizer101, 0, wxEXPAND, 5 ); + + bSizer95->Add( sbSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + + bSizer95->Add( 0, 10, 0, 0, 5 ); + + wxStaticBoxSizer* sbSizer26; + sbSizer26 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("External applications") ), wxHORIZONTAL ); + + + sbSizer26->Add( 5, 0, 0, 0, 5 ); + + m_gridCustomCommand = new wxGrid( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0 ); + + // Grid + m_gridCustomCommand->CreateGrid( 5, 2 ); + m_gridCustomCommand->EnableEditing( true ); + m_gridCustomCommand->EnableGridLines( true ); + m_gridCustomCommand->EnableDragGridSize( false ); + m_gridCustomCommand->SetMargins( 0, 0 ); + + // Columns + m_gridCustomCommand->SetColSize( 0, 129 ); + m_gridCustomCommand->SetColSize( 1, 179 ); + m_gridCustomCommand->EnableDragColMove( false ); + m_gridCustomCommand->EnableDragColSize( true ); + m_gridCustomCommand->SetColLabelSize( 20 ); + m_gridCustomCommand->SetColLabelValue( 0, _("Description") ); + m_gridCustomCommand->SetColLabelValue( 1, _("Command line") ); + m_gridCustomCommand->SetColLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Rows + m_gridCustomCommand->EnableDragRowSize( false ); + m_gridCustomCommand->SetRowLabelSize( 0 ); + m_gridCustomCommand->SetRowLabelAlignment( wxALIGN_CENTRE, wxALIGN_CENTRE ); + + // Label Appearance + + // Cell Defaults + m_gridCustomCommand->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_TOP ); + sbSizer26->Add( m_gridCustomCommand, 1, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + wxBoxSizer* bSizer157; + bSizer157 = new wxBoxSizer( wxVERTICAL ); + + m_bpButtonAddRow = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + bSizer157->Add( m_bpButtonAddRow, 0, 0, 5 ); + + m_bpButtonRemoveRow = new wxBitmapButton( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 19,21 ), wxBU_AUTODRAW ); + bSizer157->Add( m_bpButtonRemoveRow, 0, 0, 5 ); + + sbSizer26->Add( bSizer157, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + + sbSizer26->Add( 5, 0, 0, 0, 5 ); + + bSizer95->Add( sbSizer26, 1, wxALIGN_CENTER_HORIZONTAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + wxBoxSizer* bSizer97; + bSizer97 = new wxBoxSizer( wxHORIZONTAL ); + + m_button9 = new wxButton( this, wxID_DEFAULT, _("&Default"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button9->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer97->Add( m_button9, 0, wxALL, 5 ); + + + bSizer97->Add( 0, 0, 1, 0, 5 ); + + m_buttonOkay = new wxButton( this, wxID_OK, _("&OK"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonOkay->SetDefault(); + m_buttonOkay->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer97->Add( m_buttonOkay, 0, wxALL, 5 ); + + m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer97->Add( m_button29, 0, wxALL, 5 ); + + bSizer95->Add( bSizer97, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + this->SetSizer( bSizer95 ); + this->Layout(); + bSizer95->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); + m_buttonResetDialogs->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnResetDialogs ), NULL, this ); + m_bpButtonAddRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnAddRow ), NULL, this ); + m_bpButtonRemoveRow->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnRemoveRow ), NULL, this ); + m_button9->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); + m_buttonOkay->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); + m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); +} + +GlobalSettingsDlgGenerated::~GlobalSettingsDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( GlobalSettingsDlgGenerated::OnClose ) ); + m_buttonResetDialogs->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnResetDialogs ), NULL, this ); + m_bpButtonAddRow->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnAddRow ), NULL, this ); + m_bpButtonRemoveRow->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnRemoveRow ), NULL, this ); + m_button9->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnDefault ), NULL, this ); + m_buttonOkay->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnOkay ), NULL, this ); + m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( GlobalSettingsDlgGenerated::OnCancel ), NULL, this ); +} + +SyncPreviewDlgGenerated::SyncPreviewDlgGenerated( 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* bSizer134; + bSizer134 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxHORIZONTAL ); + + m_buttonStartSync = new wxButtonWithImage( this, wxID_ANY, _("Start"), wxDefaultPosition, wxSize( -1,40 ), 0 ); + m_buttonStartSync->SetDefault(); + m_buttonStartSync->SetFont( wxFont( 14, 70, 90, 92, false, wxT("Arial Black") ) ); + m_buttonStartSync->SetToolTip( _("Start synchronization") ); + + bSizer158->Add( m_buttonStartSync, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticline16 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_VERTICAL ); + bSizer158->Add( m_staticline16, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + wxStaticBoxSizer* sbSizer28; + sbSizer28 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Variant") ), wxVERTICAL ); + + m_staticTextVariant = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextVariant->Wrap( -1 ); + m_staticTextVariant->SetFont( wxFont( 10, 70, 90, 92, false, wxT("Arial Black") ) ); + + sbSizer28->Add( m_staticTextVariant, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer158->Add( sbSizer28, 1, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); + + bSizer134->Add( bSizer158, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_staticline14 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline14, 0, wxEXPAND, 5 ); + + wxBoxSizer* bSizer141; + bSizer141 = new wxBoxSizer( wxHORIZONTAL ); + + wxStaticBoxSizer* sbSizer161; + sbSizer161 = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Statistics") ), wxVERTICAL ); + + wxBoxSizer* bSizer157; + bSizer157 = new wxBoxSizer( wxHORIZONTAL ); + + wxFlexGridSizer* fgSizer5; + fgSizer5 = new wxFlexGridSizer( 4, 2, 0, 5 ); + fgSizer5->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer5->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + + fgSizer5->Add( 0, 0, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticText94 = new wxStaticText( this, wxID_ANY, _("Left"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText94->Wrap( -1 ); + m_staticText94->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer5->Add( m_staticText94, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapCreate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapCreate->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer5->Add( m_bitmapCreate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlCreateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreateL->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlCreateL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreateL->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer5->Add( m_textCtrlCreateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapUpdate = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapUpdate->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer5->Add( m_bitmapUpdate, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_textCtrlUpdateL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdateL->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlUpdateL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdateL->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer5->Add( m_textCtrlUpdateL, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_bitmapDelete = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapDelete->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer5->Add( m_bitmapDelete, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlDeleteL = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDeleteL->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlDeleteL->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDeleteL->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer5->Add( m_textCtrlDeleteL, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer157->Add( fgSizer5, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 5 ); + + wxFlexGridSizer* fgSizer51; + fgSizer51 = new wxFlexGridSizer( 3, 1, 0, 5 ); + fgSizer51->SetFlexibleDirection( wxHORIZONTAL ); + fgSizer51->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); + + m_staticText95 = new wxStaticText( this, wxID_ANY, _("Right"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText95->Wrap( -1 ); + m_staticText95->SetFont( wxFont( 9, 70, 90, 92, false, wxEmptyString ) ); + + fgSizer51->Add( m_staticText95, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlCreateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlCreateR->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlCreateR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlCreateR->SetToolTip( _("Number of files and directories that will be created") ); + + fgSizer51->Add( m_textCtrlCreateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlUpdateR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlUpdateR->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlUpdateR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlUpdateR->SetToolTip( _("Number of files that will be overwritten") ); + + fgSizer51->Add( m_textCtrlUpdateR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlDeleteR = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlDeleteR->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlDeleteR->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlDeleteR->SetToolTip( _("Number of files and directories that will be deleted") ); + + fgSizer51->Add( m_textCtrlDeleteR, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer157->Add( fgSizer51, 0, wxRIGHT|wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); + + sbSizer161->Add( bSizer157, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + + sbSizer161->Add( 0, 10, 0, 0, 5 ); + + wxBoxSizer* bSizer156; + bSizer156 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapData = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + m_bitmapData->SetToolTip( _("Total amount of data that will be transferred") ); + + bSizer156->Add( m_bitmapData, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxRIGHT, 5 ); + + + bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_textCtrlData = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); + m_textCtrlData->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); + m_textCtrlData->SetBackgroundColour( wxColour( 222, 222, 236 ) ); + m_textCtrlData->SetToolTip( _("Total amount of data that will be transferred") ); + + bSizer156->Add( m_textCtrlData, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer156->Add( 0, 0, 1, wxEXPAND, 5 ); + + sbSizer161->Add( bSizer156, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); + + bSizer141->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL|wxALL, 5 ); + + bSizer134->Add( bSizer141, 0, wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_staticline12 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL ); + bSizer134->Add( m_staticline12, 0, wxEXPAND|wxTOP|wxBOTTOM, 5 ); + + wxBoxSizer* bSizer142; + bSizer142 = new wxBoxSizer( wxHORIZONTAL ); + + m_checkBoxDontShowAgain = new wxCheckBox( this, wxID_ANY, _("Do not show this dialog again"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer142->Add( m_checkBoxDontShowAgain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + + bSizer142->Add( 10, 0, 1, 0, 5 ); + + m_button16 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button16->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer142->Add( m_button16, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + bSizer134->Add( bSizer142, 0, wxEXPAND, 5 ); + + this->SetSizer( bSizer134 ); + this->Layout(); + bSizer134->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncPreviewDlgGenerated::OnClose ) ); + m_buttonStartSync->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnStartSync ), NULL, this ); + m_button16->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnCancel ), NULL, this ); +} + +SyncPreviewDlgGenerated::~SyncPreviewDlgGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SyncPreviewDlgGenerated::OnClose ) ); + m_buttonStartSync->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnStartSync ), NULL, this ); + m_button16->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SyncPreviewDlgGenerated::OnCancel ), NULL, this ); +} + +PopupFrameGenerated1::PopupFrameGenerated1( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxFrame( parent, id, title, pos, size, style ) +{ + this->SetSizeHints( wxDefaultSize, wxDefaultSize ); + this->SetBackgroundColour( wxColour( 255, 255, 255 ) ); + + wxBoxSizer* bSizer158; + bSizer158 = new wxBoxSizer( wxHORIZONTAL ); + + m_bitmapLeft = new wxStaticBitmap( this, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxDefaultSize, 0 ); + bSizer158->Add( m_bitmapLeft, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_staticTextMain = new wxStaticText( this, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextMain->Wrap( 600 ); + bSizer158->Add( m_staticTextMain, 0, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + + this->SetSizer( bSizer158 ); + this->Layout(); + bSizer158->Fit( this ); +} + +PopupFrameGenerated1::~PopupFrameGenerated1() +{ +} + +SearchDialogGenerated::SearchDialogGenerated( 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* bSizer161; + bSizer161 = new wxBoxSizer( wxHORIZONTAL ); + + wxBoxSizer* bSizer166; + bSizer166 = new wxBoxSizer( wxVERTICAL ); + + wxBoxSizer* bSizer162; + bSizer162 = new wxBoxSizer( wxHORIZONTAL ); + + m_staticText101 = new wxStaticText( this, wxID_ANY, _("Find what:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText101->Wrap( -1 ); + bSizer162->Add( m_staticText101, 0, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + m_textCtrlSearchTxt = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 220,-1 ), 0 ); + bSizer162->Add( m_textCtrlSearchTxt, 1, wxALL|wxALIGN_CENTER_VERTICAL, 5 ); + + bSizer166->Add( bSizer162, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer166->Add( 0, 10, 0, 0, 5 ); + + m_checkBoxMatchCase = new wxCheckBox( this, wxID_ANY, _("Match case"), wxDefaultPosition, wxDefaultSize, 0 ); + + bSizer166->Add( m_checkBoxMatchCase, 0, wxALL|wxEXPAND, 5 ); + + bSizer161->Add( bSizer166, 1, wxALIGN_CENTER_VERTICAL, 5 ); + + wxBoxSizer* bSizer97; + bSizer97 = new wxBoxSizer( wxVERTICAL ); + + m_buttonFindNext = new wxButton( this, wxID_OK, _("&Find next"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_buttonFindNext->SetDefault(); + m_buttonFindNext->SetFont( wxFont( 10, 70, 90, 92, false, wxEmptyString ) ); + + bSizer97->Add( m_buttonFindNext, 0, wxALL|wxEXPAND, 5 ); + + m_button29 = new wxButton( this, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxSize( -1,30 ), 0 ); + m_button29->SetFont( wxFont( 10, 70, 90, 90, false, wxEmptyString ) ); + + bSizer97->Add( m_button29, 0, wxALL|wxEXPAND, 5 ); + + bSizer161->Add( bSizer97, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + this->SetSizer( bSizer161 ); + this->Layout(); + bSizer161->Fit( this ); + + // Connect Events + this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SearchDialogGenerated::OnClose ) ); + m_textCtrlSearchTxt->Connect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SearchDialogGenerated::OnText ), NULL, this ); + m_buttonFindNext->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnFindNext ), NULL, this ); + m_button29->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnCancel ), NULL, this ); +} + +SearchDialogGenerated::~SearchDialogGenerated() +{ + // Disconnect Events + this->Disconnect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( SearchDialogGenerated::OnClose ) ); + m_textCtrlSearchTxt->Disconnect( wxEVT_COMMAND_TEXT_UPDATED, wxCommandEventHandler( SearchDialogGenerated::OnText ), NULL, this ); + m_buttonFindNext->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnFindNext ), NULL, this ); + m_button29->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( SearchDialogGenerated::OnCancel ), NULL, this ); +} diff --git a/ui/gui_generated.h b/ui/gui_generated.h new file mode 100644 index 00000000..96ede3c4 --- /dev/null +++ b/ui/gui_generated.h @@ -0,0 +1,1042 @@ +/////////////////////////////////////////////////////////////////////////// +// C++ code generated with wxFormBuilder (version Apr 16 2008) +// http://www.wxformbuilder.org/ +// +// PLEASE DO "NOT" EDIT THIS FILE! +/////////////////////////////////////////////////////////////////////////// + +#ifndef __gui_generated__ +#define __gui_generated__ + +#include + +class CustomComboBox; +class CustomGridLeft; +class CustomGridMiddle; +class CustomGridRight; +class ToggleButton; +class wxButtonWithImage; + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/////////////////////////////////////////////////////////////////////////// + + +/////////////////////////////////////////////////////////////////////////////// +/// Class MainDialogGenerated +/////////////////////////////////////////////////////////////////////////////// +class MainDialogGenerated : public wxFrame +{ + private: + + protected: + wxMenuBar* m_menubar1; + wxMenu* m_menuFile; + wxMenuItem* m_menuItem10; + wxMenuItem* m_menuItem11; + wxMenuItem* m_menuItemSwitchView; + wxMenuItem* m_menuItemNew; + wxMenuItem* m_menuItemSave; + wxMenuItem* m_menuItemLoad; + wxMenu* m_menuAdvanced; + wxMenu* m_menuLanguages; + wxMenuItem* m_menuItemGlobSett; + wxMenuItem* m_menuItem7; + wxMenu* m_menuHelp; + wxMenuItem* m_menuItemCheckVer; + wxMenuItem* m_menuItemAbout; + wxBoxSizer* bSizer1; + wxPanel* m_panel71; + wxBoxSizer* bSizer6; + + wxStaticText* m_staticTextCmpVariant; + + wxButtonWithImage* m_buttonCompare; + wxButton* m_buttonAbort; + wxBitmapButton* m_bpButtonCmpConfig; + + + wxStaticText* m_staticTextSyncVariant; + wxBitmapButton* m_bpButtonSyncConfig; + wxButtonWithImage* m_buttonStartSync; + + wxStaticBoxSizer* sbSizer2; + wxPanel* m_panelTopMiddle; + + wxBoxSizer* bSizerMiddle; + wxBitmapButton* m_bpButtonSwapSides; + + + + wxBitmapButton* m_bpButtonAddPair; + wxScrolledWindow* m_scrolledWindowFolderPairs; + wxBoxSizer* bSizerAddFolderPairs; + wxBoxSizer* bSizerGridHolder; + CustomGridLeft* m_gridLeft; + wxPanel* m_panelMiddle; + CustomGridMiddle* m_gridMiddle; + CustomGridRight* m_gridRight; + wxPanel* m_panelBottom; + wxBoxSizer* bSizer3; + wxNotebook* m_notebookBottomLeft; + wxPanel* m_panel30; + wxBitmapButton* m_bpButtonSave; + wxBitmapButton* m_bpButtonLoad; + wxChoice* m_choiceHistory; + wxPanel* m_panelFilter; + wxBitmapButton* m_bpButtonFilter; + wxCheckBox* m_checkBoxHideFilt; + wxPanel* m_panelViewFilter; + + ToggleButton* m_bpButtonSyncCreateLeft; + ToggleButton* m_bpButtonSyncDirOverwLeft; + ToggleButton* m_bpButtonSyncDeleteLeft; + ToggleButton* m_bpButtonLeftOnly; + ToggleButton* m_bpButtonLeftNewer; + ToggleButton* m_bpButtonEqual; + ToggleButton* m_bpButtonDifferent; + ToggleButton* m_bpButtonSyncDirNone; + ToggleButton* m_bpButtonRightNewer; + ToggleButton* m_bpButtonRightOnly; + ToggleButton* m_bpButtonSyncDeleteRight; + ToggleButton* m_bpButtonSyncDirOverwRight; + ToggleButton* m_bpButtonSyncCreateRight; + ToggleButton* m_bpButtonConflict; + + wxBoxSizer* bSizerBottomRight; + + wxPanel* m_panelSyncPreview; + wxStaticBitmap* m_bitmapCreate; + wxTextCtrl* m_textCtrlCreate; + wxStaticBitmap* m_bitmapDelete; + wxTextCtrl* m_textCtrlDelete; + wxStaticBitmap* m_bitmapUpdate; + wxTextCtrl* m_textCtrlUpdate; + wxStaticBitmap* m_bitmapData; + wxTextCtrl* m_textCtrlData; + wxBitmapButton* m_bpButton10; + wxPanel* m_panelStatusBar; + + 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 OnCompare( wxCommandEvent& event ){ event.Skip(); } + virtual void OnStartSync( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSwitchView( wxCommandEvent& event ){ event.Skip(); } + virtual void OnNewConfig( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSaveConfig( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLoadConfig( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuQuit( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuGlobalSettings( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuBatchJob( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuExportFileList( wxCommandEvent& event ){ event.Skip(); } + virtual void OnShowHelp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuCheckVersion( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMenuAbout( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCmpSettings( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncSettings( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDirSelected( wxFileDirPickerEvent& event ){ event.Skip(); } + virtual void OnSwapSides( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAddFolderPair( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveTopFolderPair( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLeftGridDoubleClick( wxGridEvent& event ){ event.Skip(); } + virtual void OnContextRim( wxGridEvent& event ){ event.Skip(); } + virtual void OnSortLeftGrid( wxGridEvent& event ){ event.Skip(); } + virtual void OnContextRimLabelLeft( wxGridEvent& event ){ event.Skip(); } + virtual void OnContextMiddle( wxGridEvent& event ){ event.Skip(); } + virtual void OnSortMiddleGrid( wxGridEvent& event ){ event.Skip(); } + virtual void OnContextMiddleLabel( wxGridEvent& event ){ event.Skip(); } + virtual void OnRightGridDoubleClick( wxGridEvent& event ){ event.Skip(); } + virtual void OnSortRightGrid( wxGridEvent& event ){ event.Skip(); } + virtual void OnContextRimLabelRight( wxGridEvent& event ){ event.Skip(); } + virtual void OnCfgHistoryKeyEvent( wxKeyEvent& event ){ event.Skip(); } + virtual void OnLoadFromHistory( wxCommandEvent& event ){ event.Skip(); } + virtual void OnConfigureFilter( wxCommandEvent& event ){ event.Skip(); } + virtual void OnHideFilteredButton( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncCreateLeft( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDirLeft( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDeleteLeft( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLeftOnlyFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLeftNewerFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnEqualFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDifferentFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDirNone( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRightNewerFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRightOnlyFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDeleteRight( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncDirRight( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncCreateRight( wxCommandEvent& event ){ event.Skip(); } + virtual void OnConflictFiles( wxCommandEvent& event ){ event.Skip(); } + virtual void OnQuit( wxCommandEvent& event ){ event.Skip(); } + + + public: + wxPanel* m_panelTopLeft; + CustomComboBox* m_directoryLeft; + wxDirPickerCtrl* m_dirPickerLeft; + wxBitmapButton* m_bpButtonLocalFilter; + wxBitmapButton* m_bpButtonAltSyncCfg; + wxPanel* m_panelTopRight; + wxBitmapButton* m_bpButtonRemovePair; + CustomComboBox* m_directoryRight; + wxDirPickerCtrl* m_dirPickerRight; + wxPanel* m_panelLeft; + wxPanel* m_panelRight; + MainDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 933,612 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); + ~MainDialogGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class FolderPairGenerated +/////////////////////////////////////////////////////////////////////////////// +class FolderPairGenerated : public wxPanel +{ + private: + + protected: + wxPanel* m_panel20; + + + + + public: + wxPanel* m_panelLeft; + wxTextCtrl* m_directoryLeft; + wxDirPickerCtrl* m_dirPickerLeft; + wxPanel* m_panel21; + wxBitmapButton* m_bpButtonLocalFilter; + wxBitmapButton* m_bpButtonAltSyncCfg; + wxPanel* m_panelRight; + wxBitmapButton* m_bpButtonRemovePair; + wxTextCtrl* m_directoryRight; + wxDirPickerCtrl* m_dirPickerRight; + FolderPairGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~FolderPairGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class BatchFolderPairGenerated +/////////////////////////////////////////////////////////////////////////////// +class BatchFolderPairGenerated : public wxPanel +{ + private: + + protected: + wxPanel* m_panel32; + wxStaticText* m_staticText53; + wxStaticText* m_staticText541; + wxPanel* m_panelLeft; + wxPanel* m_panelRight; + + + public: + wxBitmapButton* m_bpButtonRemovePair; + wxTextCtrl* m_directoryLeft; + wxDirPickerCtrl* m_dirPickerLeft; + wxBitmapButton* m_bpButtonLocalFilter; + wxTextCtrl* m_directoryRight; + wxDirPickerCtrl* m_dirPickerRight; + wxBitmapButton* m_bpButtonAltSyncCfg; + BatchFolderPairGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~BatchFolderPairGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class BatchDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class BatchDlgGenerated : public wxDialog +{ + private: + + protected: + wxBoxSizer* bSizer69; + wxStaticBitmap* m_bitmap27; + wxPanel* m_panel8; + wxStaticText* m_staticText56; + + + wxStaticText* m_staticText44; + wxBitmapButton* m_bpButtonHelp; + + wxStaticLine* m_staticline10; + wxStaticText* m_staticText531; + wxNotebook* m_notebookSettings; + wxPanel* m_panelOverview; + wxBitmapButton* m_bpButtonCmpConfig; + + wxStaticText* m_staticTextCmpVariant; + + wxBitmapButton* m_bpButtonFilter; + + wxStaticText* m_staticTextSyncVariant; + + wxBitmapButton* m_bpButtonSyncConfig; + + wxBoxSizer* sbSizerMainPair; + wxPanel* m_panelMainPair; + wxStaticText* m_staticText532; + wxStaticText* m_staticText5411; + wxBoxSizer* bSizerAddFolderPairs; + + + wxCheckBox* m_checkBoxSilent; + + wxChoice* m_choiceHandleError; + wxPanel* m_panelLogging; + wxStaticText* m_staticText120; + wxTextCtrl* m_textCtrlLogfileDir; + wxDirPickerCtrl* m_dirPickerLogfileDir; + wxButton* m_buttonSave; + wxButton* m_buttonLoad; + wxButton* m_button6; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnHelp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCmpSettings( wxCommandEvent& event ){ event.Skip(); } + virtual void OnConfigureFilter( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncSettings( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAddFolderPair( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveTopFolderPair( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCheckSilent( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeErrorHandling( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSaveBatchJob( wxCommandEvent& event ){ event.Skip(); } + virtual void OnLoadBatchJob( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + wxScrolledWindow* m_scrolledWindow6; + wxBitmapButton* m_bpButtonAddPair; + wxBitmapButton* m_bpButtonRemovePair; + wxPanel* m_panelLeft; + wxTextCtrl* m_directoryLeft; + wxDirPickerCtrl* m_dirPickerLeft; + wxBitmapButton* m_bpButtonLocalFilter; + wxPanel* m_panelRight; + wxTextCtrl* m_directoryRight; + wxDirPickerCtrl* m_dirPickerRight; + wxBitmapButton* m_bpButtonAltSyncCfg; + BatchDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Create a batch job"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~BatchDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class CompareStatusGenerated +/////////////////////////////////////////////////////////////////////////////// +class CompareStatusGenerated : public wxPanel +{ + private: + + protected: + wxBoxSizer* bSizer42; + wxBoxSizer* bSizerFilesFound; + wxStaticText* m_staticText321; + wxStaticText* m_staticTextScanned; + wxBoxSizer* bSizerFilesRemaining; + wxStaticText* m_staticText46; + wxStaticText* m_staticTextFilesRemaining; + wxStaticText* m_staticText117; + wxStaticText* m_staticTextDataRemaining; + wxStaticText* m_staticText118; + + wxBoxSizer* sSizerSpeed; + wxStaticText* m_staticText104; + wxStaticText* m_staticTextSpeed; + + wxBoxSizer* sSizerTimeRemaining; + wxStaticText* m_staticTextTimeRemFixed; + wxStaticText* m_staticTextTimeRemaining; + + wxBoxSizer* sSizerTimeElapsed; + wxStaticText* m_staticTextTimeElapsed; + wxStaticText* m_staticText30; + wxTextCtrl* m_textCtrlStatus; + wxGauge* m_gauge2; + + public: + CompareStatusGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxTAB_TRAVERSAL ); + ~CompareStatusGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SyncCfgDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class SyncCfgDlgGenerated : public wxDialog +{ + private: + + protected: + wxStaticText* m_staticText1; + wxRadioButton* m_radioBtnAutomatic; + wxButton* m_buttonAutomatic; + wxStaticText* m_staticText81; + wxRadioButton* m_radioBtnMirror; + wxButton* m_buttonOneWay; + wxStaticText* m_staticText8; + wxRadioButton* m_radioBtnUpdate; + wxButton* m_buttonUpdate; + wxStaticText* m_staticText101; + wxRadioButton* m_radioBtnCustom; + + wxStaticText* m_staticText23; + + wxStaticText* m_staticText9; + + wxBoxSizer* bSizer201; + wxStaticBoxSizer* sbSizerErrorHandling; + wxChoice* m_choiceHandleError; + wxChoice* m_choiceHandleDeletion; + wxPanel* m_panelCustomDeletionDir; + wxTextCtrl* m_textCtrlCustomDelFolder; + wxDirPickerCtrl* m_dirPickerCustomDelFolder; + + wxButton* m_buttonOK; + wxButton* m_button16; + + + wxStaticBoxSizer* sbSizerSyncDirections; + wxStaticText* m_staticText21; + wxStaticText* m_staticText31; + wxStaticLine* m_staticline3; + wxStaticBitmap* m_bitmapLeftOnly; + + wxBitmapButton* m_bpButtonLeftOnly; + wxStaticBitmap* m_bitmapRightOnly; + + wxBitmapButton* m_bpButtonRightOnly; + wxStaticBitmap* m_bitmapLeftNewer; + + wxBitmapButton* m_bpButtonLeftNewer; + wxStaticBitmap* m_bitmapRightNewer; + + wxBitmapButton* m_bpButtonRightNewer; + wxStaticBitmap* m_bitmapDifferent; + + wxBitmapButton* m_bpButtonDifferent; + wxStaticBitmap* m_bitmapConflict; + + wxBitmapButton* m_bpButtonConflict; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnSyncAutomatic( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncLeftToRight( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncUpdate( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSyncCustom( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeErrorHandling( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeDeletionHandling( wxCommandEvent& event ){ event.Skip(); } + virtual void OnApply( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( 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 OnConflict( wxCommandEvent& event ){ event.Skip(); } + + + public: + SyncCfgDlgGenerated( 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 ); + ~SyncCfgDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class CmpCfgDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class CmpCfgDlgGenerated : public wxDialog +{ + private: + + protected: + wxRadioButton* m_radioBtnSizeDate; + wxStaticBitmap* m_bitmapByTime; + wxButton* m_buttonTimeSize; + wxRadioButton* m_radioBtnContent; + wxStaticBitmap* m_bitmapByContent; + wxButton* m_buttonContent; + wxStaticLine* m_staticline14; + wxBitmapButton* m_bpButtonHelp; + + wxChoice* m_choiceHandleSymlinks; + wxButton* m_button10; + wxButton* m_button6; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnTimeSize( wxCommandEvent& event ){ event.Skip(); } + virtual void OnContent( wxCommandEvent& event ){ event.Skip(); } + virtual void OnShowHelp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnChangeErrorHandling( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + CmpCfgDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Comparison settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~CmpCfgDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SyncStatusDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class SyncStatusDlgGenerated : public wxFrame +{ + private: + + protected: + + wxAnimationCtrl* m_animationControl1; + wxPanel* m_panel8; + wxStaticText* m_staticText56; + + wxStaticBitmap* m_bitmapStatus; + wxStaticText* m_staticTextStatus; + + wxBoxSizer* bSizer31; + wxBoxSizer* bSizerObjectsRemaining; + wxStaticText* m_staticText25; + wxStaticText* m_staticTextRemainingObj; + wxStaticText* m_staticText96; + wxStaticText* m_staticTextDataRemaining; + wxStaticText* m_staticText97; + wxBoxSizer* bSizerObjectsProcessed; + wxStaticText* m_staticText251; + wxStaticText* m_staticTextProcessedObj; + wxStaticText* m_staticText98; + wxStaticText* m_staticTextDataProcessed; + wxStaticText* m_staticText99; + + wxStaticText* m_staticText55; + wxStaticText* m_staticTextTimeElapsed; + wxTextCtrl* m_textCtrlInfo; + wxBoxSizer* bSizer28; + wxBoxSizer* bSizerSpeed; + wxStaticText* m_staticText108; + wxStaticText* m_staticTextSpeed; + + wxButton* m_buttonOK; + wxButton* m_buttonPause; + wxButton* m_buttonAbort; + + wxBoxSizer* bSizerRemTime; + wxStaticText* m_staticText21; + wxStaticText* m_staticTextTimeRemaining; + + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnIconize( wxIconizeEvent& 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( 638,376 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); + ~SyncStatusDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class HelpDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class HelpDlgGenerated : public wxDialog +{ + private: + + protected: + + wxStaticBitmap* m_bitmap25; + wxPanel* m_panel8; + + wxStaticText* m_staticText56; + + + wxNotebook* m_notebook1; + wxScrolledWindow* m_scrolledWindow1; + wxStaticText* m_staticText59; + wxStaticText* m_staticText60; + wxStaticText* m_staticText61; + wxTreeCtrl* m_treeCtrl1; + wxStaticText* m_staticText63; + wxStaticText* m_staticText75; + wxStaticText* m_staticText76; + wxStaticText* m_staticText77; + wxStaticText* m_staticText79; + wxStaticText* m_staticText80; + wxStaticText* m_staticText78; + wxScrolledWindow* m_scrolledWindow5; + wxStaticText* m_staticText65; + wxStaticText* m_staticText66; + wxTreeCtrl* m_treeCtrl2; + wxStaticText* m_staticText69; + wxStaticText* m_staticText81; + wxStaticText* m_staticText82; + wxStaticText* m_staticText83; + wxStaticText* m_staticText84; + wxButton* m_button8; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnOK( wxCommandEvent& event ){ event.Skip(); } + + + public: + HelpDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 579,543 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~HelpDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class AboutDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class AboutDlgGenerated : public wxDialog +{ + private: + + protected: + + wxPanel* m_panel5; + wxStaticBitmap* m_bitmap11; + wxStaticText* m_build; + + wxScrolledWindow* m_scrolledWindowCodeInfo; + wxBoxSizer* bSizerCodeInfo; + wxStaticText* m_staticText72; + wxStaticText* m_staticText73; + wxHyperlinkCtrl* m_hyperlink21; + wxScrolledWindow* m_scrolledWindowTranslators; + wxBoxSizer* bSizerTranslators; + wxStaticText* m_staticText54; + + wxFlexGridSizer* fgSizerTranslators; + wxStaticLine* m_staticline3; + wxStaticText* m_staticText131; + wxStaticLine* m_staticline12; + wxStaticBitmap* m_bitmap9; + wxHyperlinkCtrl* m_hyperlink1; + + wxHyperlinkCtrl* m_hyperlink6; + wxStaticBitmap* m_bitmap10; + wxHyperlinkCtrl* m_hyperlink2; + + wxAnimationCtrl* m_animationControl1; + wxHyperlinkCtrl* m_hyperlink3; + wxStaticLine* m_staticline2; + + wxStaticBitmap* m_bitmap13; + wxHyperlinkCtrl* m_hyperlink5; + + wxButton* m_buttonOkay; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnOK( wxCommandEvent& event ){ event.Skip(); } + + + public: + AboutDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("About"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~AboutDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class ErrorDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class ErrorDlgGenerated : public wxDialog +{ + private: + + protected: + + wxStaticBitmap* m_bitmap10; + wxTextCtrl* m_textCtrl8; + wxCheckBox* m_checkBoxIgnoreErrors; + + wxButton* m_buttonIgnore; + wxButton* m_buttonRetry; + wxButton* m_buttonAbort; + + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnIgnore( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRetry( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAbort( wxCommandEvent& event ){ event.Skip(); } + + + public: + ErrorDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Error"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 421,228 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~ErrorDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class WarningDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class WarningDlgGenerated : public wxDialog +{ + private: + + protected: + + wxTextCtrl* m_textCtrl8; + wxCheckBox* m_checkBoxDontShowAgain; + + wxButton* m_buttonIgnore; + wxButton* m_buttonSwitch; + wxButton* m_buttonAbort; + + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnIgnore( wxCommandEvent& event ){ event.Skip(); } + virtual void OnSwitch( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAbort( wxCommandEvent& event ){ event.Skip(); } + + + public: + wxStaticBitmap* m_bitmap10; + WarningDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Warning"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 421,231 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~WarningDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class QuestionDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class QuestionDlgGenerated : public wxDialog +{ + private: + + protected: + + wxStaticBitmap* m_bitmap10; + wxTextCtrl* m_textCtrl8; + wxCheckBox* m_checkBoxDontAskAgain; + + wxButton* m_buttonYes; + wxButton* m_buttonNo; + wxButton* m_buttonCancel; + + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnYes( wxCommandEvent& event ){ event.Skip(); } + virtual void OnNo( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + QuestionDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Question"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 420,198 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~QuestionDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class DeleteDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class DeleteDlgGenerated : public wxDialog +{ + private: + + protected: + + + wxStaticBitmap* m_bitmap12; + wxStaticText* m_staticTextHeader; + + wxCheckBox* m_checkBoxDeleteBothSides; + + wxCheckBox* m_checkBoxUseRecycler; + wxTextCtrl* m_textCtrlMessage; + wxButton* m_buttonOK; + wxButton* m_buttonCancel; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnDelOnBothSides( wxCommandEvent& event ){ event.Skip(); } + virtual void OnUseRecycler( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOK( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + DeleteDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Confirm"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 553,336 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~DeleteDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class FilterDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class FilterDlgGenerated : public wxDialog +{ + private: + + protected: + wxStaticBitmap* m_bitmap26; + wxPanel* m_panel8; + wxStaticText* m_staticTexHeader; + + wxStaticText* m_staticText44; + wxBitmapButton* m_bpButtonHelp; + + wxPanel* m_panel13; + wxStaticLine* m_staticline10; + wxStaticText* m_staticText45; + wxStaticText* m_staticText83; + wxStaticText* m_staticText84; + wxStaticText* m_staticText85; + wxStaticText* m_staticText181; + wxStaticText* m_staticText1811; + + wxStaticText* m_staticText15; + wxStaticBitmap* m_bitmap8; + wxTextCtrl* m_textCtrlInclude; + + wxStaticText* m_staticText16; + wxStaticBitmap* m_bitmap9; + wxTextCtrl* m_textCtrlExclude; + + wxButton* m_button9; + + wxButton* m_button10; + wxButton* m_button17; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnHelp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDefault( wxCommandEvent& event ){ event.Skip(); } + virtual void OnApply( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + 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|wxRESIZE_BORDER ); + ~FilterDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class CustomizeColsDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class CustomizeColsDlgGenerated : public wxDialog +{ + private: + + protected: + wxCheckListBox* m_checkListColumns; + wxBitmapButton* m_bpButton29; + wxBitmapButton* m_bpButton30; + wxButton* m_button9; + + wxButton* m_button28; + wxButton* m_button29; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnMoveUp( wxCommandEvent& event ){ event.Skip(); } + virtual void OnMoveDown( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDefault( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + CustomizeColsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Customize columns"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~CustomizeColsDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class GlobalSettingsDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class GlobalSettingsDlgGenerated : public wxDialog +{ + private: + + protected: + wxStaticBitmap* m_bitmapSettings; + + wxPanel* m_panel8; + wxStaticText* m_staticText56; + + wxCheckBox* m_checkBoxIgnoreOneHour; + wxCheckBox* m_checkBoxCopyLocked; + wxCheckBox* m_checkBoxCopyPermissions; + wxStaticLine* m_staticline10; + wxStaticText* m_staticText100; + + wxButtonWithImage* m_buttonResetDialogs; + + + wxGrid* m_gridCustomCommand; + wxBitmapButton* m_bpButtonAddRow; + wxBitmapButton* m_bpButtonRemoveRow; + + wxButton* m_button9; + + wxButton* m_buttonOkay; + wxButton* m_button29; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnResetDialogs( wxCommandEvent& event ){ event.Skip(); } + virtual void OnAddRow( wxCommandEvent& event ){ event.Skip(); } + virtual void OnRemoveRow( wxCommandEvent& event ){ event.Skip(); } + virtual void OnDefault( wxCommandEvent& event ){ event.Skip(); } + virtual void OnOkay( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + GlobalSettingsDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Global settings"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER ); + ~GlobalSettingsDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SyncPreviewDlgGenerated +/////////////////////////////////////////////////////////////////////////////// +class SyncPreviewDlgGenerated : public wxDialog +{ + private: + + protected: + wxButtonWithImage* m_buttonStartSync; + wxStaticLine* m_staticline16; + wxStaticText* m_staticTextVariant; + wxStaticLine* m_staticline14; + + wxStaticText* m_staticText94; + wxStaticBitmap* m_bitmapCreate; + wxTextCtrl* m_textCtrlCreateL; + wxStaticBitmap* m_bitmapUpdate; + wxTextCtrl* m_textCtrlUpdateL; + wxStaticBitmap* m_bitmapDelete; + wxTextCtrl* m_textCtrlDeleteL; + wxStaticText* m_staticText95; + wxTextCtrl* m_textCtrlCreateR; + wxTextCtrl* m_textCtrlUpdateR; + wxTextCtrl* m_textCtrlDeleteR; + + wxStaticBitmap* m_bitmapData; + + wxTextCtrl* m_textCtrlData; + + wxStaticLine* m_staticline12; + wxCheckBox* m_checkBoxDontShowAgain; + + wxButton* m_button16; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnStartSync( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + SyncPreviewDlgGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Synchronization Preview"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE ); + ~SyncPreviewDlgGenerated(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class PopupFrameGenerated1 +/////////////////////////////////////////////////////////////////////////////// +class PopupFrameGenerated1 : public wxFrame +{ + private: + + protected: + + public: + wxStaticBitmap* m_bitmapLeft; + wxStaticText* m_staticTextMain; + PopupFrameGenerated1( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxFRAME_NO_TASKBAR|wxSTAY_ON_TOP|wxSTATIC_BORDER ); + ~PopupFrameGenerated1(); + +}; + +/////////////////////////////////////////////////////////////////////////////// +/// Class SearchDialogGenerated +/////////////////////////////////////////////////////////////////////////////// +class SearchDialogGenerated : public wxDialog +{ + private: + + protected: + wxStaticText* m_staticText101; + wxTextCtrl* m_textCtrlSearchTxt; + + wxCheckBox* m_checkBoxMatchCase; + wxButton* m_buttonFindNext; + wxButton* m_button29; + + // Virtual event handlers, overide them in your derived class + virtual void OnClose( wxCloseEvent& event ){ event.Skip(); } + virtual void OnText( wxCommandEvent& event ){ event.Skip(); } + virtual void OnFindNext( wxCommandEvent& event ){ event.Skip(); } + virtual void OnCancel( wxCommandEvent& event ){ event.Skip(); } + + + public: + SearchDialogGenerated( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Find"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_DIALOG_STYLE ); + ~SearchDialogGenerated(); + +}; + +#endif //__gui_generated__ diff --git a/ui/gui_status_handler.cpp b/ui/gui_status_handler.cpp new file mode 100644 index 00000000..052c18bd --- /dev/null +++ b/ui/gui_status_handler.cpp @@ -0,0 +1,397 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "gui_status_handler.h" +#include "small_dlgs.h" +#include "msg_popup.h" +#include "../shared/system_constants.h" +#include "main_dlg.h" +#include +#include "../shared/global_func.h" +#include "../shared/string_conv.h" +#include "../shared/util.h" + +using namespace ffs3; + + +CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : + mainDialog(dlg), + ignoreErrors(false), + currentProcess(StatusHandler::PROCESS_NONE) +{ + wxWindowUpdateLocker dummy(mainDialog); //avoid display distortion + + //prevent user input during "compare", do not disable maindialog since abort-button would also be disabled + mainDialog->disableAllElements(); + + //display status panel during compare + mainDialog->compareStatus->init(); //clear old values and make visible + + mainDialog->bSizer1->Layout(); //both sizers need to recalculate! + mainDialog->bSizer6->Layout(); //adapt layout for wxBitmapWithImage + mainDialog->Refresh(); + + //register abort button + mainDialog->m_buttonAbort->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this); + + //register key event + mainDialog->Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), NULL, this); +} + + +CompareStatusHandler::~CompareStatusHandler() +{ + updateUiNow(); //ui update before enabling buttons again: prevent strange behaviour of delayed button clicks + + //reenable complete main dialog + mainDialog->enableAllElements(); + + if (abortIsRequested()) + mainDialog->pushStatusInformation(_("Operation aborted!")); + + //hide status panel from main window + mainDialog->compareStatus->finalize(); + + mainDialog->bSizer6->Layout(); //adapt layout for wxBitmapWithImage + mainDialog->Layout(); + mainDialog->Refresh(); + + //register key event + mainDialog->Disconnect(wxEVT_CHAR_HOOK, wxKeyEventHandler(CompareStatusHandler::OnKeyPressed), NULL, this); + //de-register abort button + mainDialog->m_buttonAbort->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this); +} + + +void CompareStatusHandler::OnKeyPressed(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + if (keyCode == WXK_ESCAPE) + { + wxCommandEvent dummy; + OnAbortCompare(dummy); + } + + event.Skip(); +} + + +void CompareStatusHandler::updateStatusText(const Zstring& text) +{ + mainDialog->compareStatus->setStatusText_NoUpdate(text); +} + + +void CompareStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID) +{ + currentProcess = processID; + + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: + { + wxWindowUpdateLocker dummy(mainDialog); + mainDialog->compareStatus->switchToCompareBytewise(objectsTotal, dataTotal); + mainDialog->Layout(); //show progress bar... + mainDialog->Refresh(); //remove distortion... + } + break; + case StatusHandler::PROCESS_SYNCHRONIZING: + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } +} + + +inline +void CompareStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) +{ + switch (currentProcess) + { + case StatusHandler::PROCESS_SCANNING: + mainDialog->compareStatus->incScannedObjects_NoUpdate(objectsProcessed); + break; + case StatusHandler::PROCESS_COMPARING_CONTENT: + mainDialog->compareStatus->incProcessedCmpData_NoUpdate(objectsProcessed, dataProcessed); + break; + case StatusHandler::PROCESS_SYNCHRONIZING: + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } +} + + +ErrorHandler::Response CompareStatusHandler::reportError(const wxString& message) +{ + if (ignoreErrors) + return ErrorHandler::IGNORE_ERROR; + + mainDialog->compareStatus->updateStatusPanelNow(); + + bool ignoreNextErrors = false; + ErrorDlg errorDlg(NULL, + ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, + message, ignoreNextErrors); + errorDlg.Raise(); + switch (static_cast(errorDlg.ShowModal())) + { + case ErrorDlg::BUTTON_IGNORE: + ignoreErrors = ignoreNextErrors; + return ErrorHandler::IGNORE_ERROR; + + case ErrorDlg::BUTTON_RETRY: + return ErrorHandler::RETRY; + + case ErrorDlg::BUTTON_ABORT: + abortThisProcess(); + } + + assert(false); + return ErrorHandler::IGNORE_ERROR; //dummy return value +} + + +void CompareStatusHandler::reportFatalError(const wxString& errorMessage) +{ + mainDialog->compareStatus->updateStatusPanelNow(); + + bool dummy = false; + ErrorDlg errorDlg(NULL, + ErrorDlg::BUTTON_ABORT, + errorMessage, dummy); + errorDlg.Raise(); + errorDlg.ShowModal(); + abortThisProcess(); +} + + +void CompareStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) +{ + if (!warningActive || ignoreErrors) //if errors are ignored, then warnings should also + return; + + mainDialog->compareStatus->updateStatusPanelNow(); + + //show popup and ask user how to handle warning + bool dontWarnAgain = false; + WarningDlg warningDlg(NULL, + WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, + warningMessage, + dontWarnAgain); + warningDlg.Raise(); + switch (static_cast(warningDlg.ShowModal())) + { + case WarningDlg::BUTTON_IGNORE: + warningActive = !dontWarnAgain; + break; + + case WarningDlg::BUTTON_SWITCH: + assert(false); + case WarningDlg::BUTTON_ABORT: + abortThisProcess(); + break; + } +} + + +inline +void CompareStatusHandler::forceUiRefresh() +{ + mainDialog->compareStatus->updateStatusPanelNow(); +} + + +void CompareStatusHandler::OnAbortCompare(wxCommandEvent& event) +{ + requestAbortion(); +} + + +void CompareStatusHandler::abortThisProcess() +{ + requestAbortion(); + throw ffs3::AbortThisProcess(); +} +//######################################################################################################## + + +SyncStatusHandler::SyncStatusHandler(wxTopLevelWindow* parentDlg, bool ignoreAllErrors) : + syncStatusFrame(*this, parentDlg, false), + ignoreErrors(ignoreAllErrors) {} + + +SyncStatusHandler::~SyncStatusHandler() +{ + const int totalErrors = errorLog.errorsTotal(); //evaluate before finalizing log + + //finalize error log + if (abortIsRequested()) + errorLog.logError(wxString(_("Synchronization aborted!")) + wxT(" \n") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!")); + else if (totalErrors) + errorLog.logWarning(wxString(_("Synchronization completed with errors!")) + wxT(" \n") + _("You may try to synchronize remaining items again (WITHOUT having to re-compare)!")); + else + errorLog.logInfo(_("Synchronization completed successfully!")); + + + //print the results list + wxString finalMessage; + if (totalErrors > 0) + { + wxString header(_("Warning: Synchronization failed for %x item(s):")); + header.Replace(wxT("%x"), ffs3::numberToStringSep(totalErrors), false); + finalMessage += header + wxT("\n\n"); + } + + const ErrorLogging::MessageEntry& messages = errorLog.getFormattedMessages(); + for (ErrorLogging::MessageEntry::const_iterator i = messages.begin(); i != messages.end(); ++i) + { + finalMessage += *i; + finalMessage += wxT("\n\n"); + } + + //notify to syncStatusFrame that current process has ended + if (abortIsRequested()) + syncStatusFrame.processHasFinished(SyncStatus::ABORTED, finalMessage); //enable okay and close events + else if (totalErrors > 0) + syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_ERROR, finalMessage); + else + syncStatusFrame.processHasFinished(SyncStatus::FINISHED_WITH_SUCCESS, finalMessage); +} + + +inline +void SyncStatusHandler::updateStatusText(const Zstring& text) +{ + syncStatusFrame.setStatusText_NoUpdate(text); +} + + +void SyncStatusHandler::initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID) +{ + switch (processID) + { + case StatusHandler::PROCESS_SYNCHRONIZING: + syncStatusFrame.resetGauge(objectsTotal, dataTotal); + syncStatusFrame.setCurrentStatus(SyncStatus::SYNCHRONIZING); + break; + case StatusHandler::PROCESS_SCANNING: + case StatusHandler::PROCESS_COMPARING_CONTENT: + case StatusHandler::PROCESS_NONE: + assert(false); + break; + } +} + + +inline +void SyncStatusHandler::updateProcessedData(int objectsProcessed, wxLongLong dataProcessed) +{ + syncStatusFrame.incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); +} + + +ErrorHandler::Response SyncStatusHandler::reportError(const wxString& errorMessage) +{ + if (ignoreErrors) + { + errorLog.logError(errorMessage); + return ErrorHandler::IGNORE_ERROR; + } + + syncStatusFrame.updateStatusDialogNow(); + + bool ignoreNextErrors = false; + ErrorDlg errorDlg(NULL, + ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, + errorMessage, + ignoreNextErrors); + errorDlg.Raise(); + const ErrorDlg::ReturnCodes rv = static_cast(errorDlg.ShowModal()); + switch (rv) + { + case ErrorDlg::BUTTON_IGNORE: + ignoreErrors = ignoreNextErrors; + errorLog.logError(errorMessage); + return ErrorHandler::IGNORE_ERROR; + + case ErrorDlg::BUTTON_RETRY: + return ErrorHandler::RETRY; + + case ErrorDlg::BUTTON_ABORT: + errorLog.logError(errorMessage); + abortThisProcess(); + } + + assert (false); + errorLog.logError(errorMessage); + return ErrorHandler::IGNORE_ERROR; +} + + +void SyncStatusHandler::reportFatalError(const wxString& errorMessage) +{ + errorLog.logFatalError(errorMessage); + abortThisProcess(); +} + + +void SyncStatusHandler::reportWarning(const wxString& warningMessage, bool& warningActive) +{ + errorLog.logWarning(warningMessage); + + if (ignoreErrors || !warningActive) //if errors are ignored, then warnings should also + return; + else + { + syncStatusFrame.updateStatusDialogNow(); + + //show popup and ask user how to handle warning + bool dontWarnAgain = false; + WarningDlg warningDlg(NULL, + WarningDlg::BUTTON_IGNORE | WarningDlg::BUTTON_ABORT, + warningMessage, + dontWarnAgain); + warningDlg.Raise(); + const WarningDlg::Response rv = static_cast(warningDlg.ShowModal()); + switch (rv) + { + case WarningDlg::BUTTON_IGNORE: //no unhandled error situation! + warningActive = !dontWarnAgain; + return; + + case WarningDlg::BUTTON_SWITCH: + assert(false); + case WarningDlg::BUTTON_ABORT: + abortThisProcess(); + return; + } + + assert(false); + } +} + + +void SyncStatusHandler::reportInfo(const wxString& infoMessage) +{ + errorLog.logInfo(infoMessage); +} + + +void SyncStatusHandler::forceUiRefresh() +{ + syncStatusFrame.updateStatusDialogNow(); +} + + +void SyncStatusHandler::abortThisProcess() +{ + requestAbortion(); + throw ffs3::AbortThisProcess(); //abort can be triggered by syncStatusFrame +} diff --git a/ui/gui_status_handler.h b/ui/gui_status_handler.h new file mode 100644 index 00000000..d519b142 --- /dev/null +++ b/ui/gui_status_handler.h @@ -0,0 +1,73 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef GUISTATUSHANDLER_H_INCLUDED +#define GUISTATUSHANDLER_H_INCLUDED + +#include "../library/status_handler.h" +#include +#include "../library/error_log.h" +#include "progress_indicator.h" + +class SyncStatus; +class MainDialog; +class wxWindow; +class wxCommandEvent; + + +//classes handling sync and compare error as well as status information +class CompareStatusHandler : private wxEvtHandler, public StatusHandler +{ +public: + CompareStatusHandler(MainDialog* dlg); + ~CompareStatusHandler(); + + virtual void updateStatusText(const Zstring& text); + virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); + virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); + virtual void forceUiRefresh(); + + virtual ErrorHandler::Response reportError(const wxString& text); + virtual void reportFatalError(const wxString& errorMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); + +private: + void OnKeyPressed(wxKeyEvent& event); + void OnAbortCompare(wxCommandEvent& event); //handle abort button click + virtual void abortThisProcess(); + + MainDialog* mainDialog; + bool ignoreErrors; + Process currentProcess; +}; + + +class SyncStatusHandler : public StatusHandler +{ +public: + SyncStatusHandler(wxTopLevelWindow* parentDlg, bool ignoreAllErrors); + ~SyncStatusHandler(); + + virtual void updateStatusText(const Zstring& text); + virtual void initNewProcess(int objectsTotal, wxLongLong dataTotal, Process processID); + virtual void updateProcessedData(int objectsProcessed, wxLongLong dataProcessed); + virtual void forceUiRefresh(); + + virtual ErrorHandler::Response reportError(const wxString& text); + virtual void reportFatalError(const wxString& errorMessage); + virtual void reportWarning(const wxString& warningMessage, bool& warningActive); + void reportInfo(const wxString& infoMessage); + +private: + virtual void abortThisProcess(); + + SyncStatus syncStatusFrame; //the window managed by SyncStatus has longer lifetime than this handler! + bool ignoreErrors; + ffs3::ErrorLogging errorLog; +}; + + +#endif // GUISTATUSHANDLER_H_INCLUDED diff --git a/ui/isNullFilter.h b/ui/isNullFilter.h deleted file mode 100644 index f68bc65d..00000000 --- a/ui/isNullFilter.h +++ /dev/null @@ -1,24 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef ISNULLFILTER_H_INCLUDED -#define ISNULLFILTER_H_INCLUDED - -#include "../structures.h" -#include "../library/filter.h" - -namespace FreeFileSync -{ - -inline -bool isNullFilter(const FilterConfig& filterCfg) -{ - return NameFilter(filterCfg.includeFilter, filterCfg.excludeFilter).isNull(); -} - -} - -#endif // ISNULLFILTER_H_INCLUDED diff --git a/ui/is_null_filter.h b/ui/is_null_filter.h new file mode 100644 index 00000000..aeb72533 --- /dev/null +++ b/ui/is_null_filter.h @@ -0,0 +1,24 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef ISNULLFILTER_H_INCLUDED +#define ISNULLFILTER_H_INCLUDED + +#include "../structures.h" +#include "../library/filter.h" + +namespace ffs3 +{ + +inline +bool isNullFilter(const FilterConfig& filterCfg) +{ + return NameFilter(filterCfg.includeFilter, filterCfg.excludeFilter).isNull(); +} + +} + +#endif // ISNULLFILTER_H_INCLUDED diff --git a/ui/main_dlg.cpp b/ui/main_dlg.cpp new file mode 100644 index 00000000..cc9568fb --- /dev/null +++ b/ui/main_dlg.cpp @@ -0,0 +1,3852 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "main_dlg.h" +#include +#include +#include "../shared/system_constants.h" +#include +#include +#include +#include +#include "../library/custom_grid.h" +#include "../shared/custom_button.h" +#include "../shared/custom_combo_box.h" +#include +#include "../comparison.h" +#include "../synchronization.h" +#include "../algorithm.h" +#include "../shared/app_main.h" +#include "../shared/util.h" +#include "check_version.h" +#include "gui_status_handler.h" +#include "sync_cfg.h" +#include "../shared/localization.h" +#include "../shared/string_conv.h" +#include "small_dlgs.h" +#include "mouse_move_dlg.h" +#include "progress_indicator.h" +#include "msg_popup.h" +#include "../shared/drag_n_drop.h" +#include "../library/filter.h" +#include "../structures.h" +#include +#include +#include "grid_view.h" +#include "../library/resources.h" +#include "../shared/file_handling.h" +#include "../shared/recycler.h" +#include "../shared/xml_base.h" +#include "../shared/standard_paths.h" +#include "../shared/toggle_button.h" +#include "folder_pair.h" +#include "../shared/global_func.h" +#include +#include "search.h" +#include "../shared/help_provider.h" +#include "is_null_filter.h" +#include "batch_config.h" +#include "../shared/check_exist.h" +#include + +using namespace ffs3; +using ffs3::CustomLocale; + + +class MainFolderDragDrop : public DragDropOnMainDlg +{ +public: + MainFolderDragDrop(MainDialog& mainDlg, + wxWindow* dropWindow1, + wxWindow* dropWindow2, + wxDirPickerCtrl* dirPicker, + wxComboBox* dirName) : + + DragDropOnMainDlg(dropWindow1, dropWindow2, dirPicker, dirName), + mainDlg_(mainDlg) {} + + virtual bool AcceptDrop(const std::vector& droppedFiles) + { + if (droppedFiles.empty()) + return true; + + switch (xmlAccess::getMergeType(droppedFiles)) //throw () + { + case xmlAccess::MERGE_BATCH: + if (droppedFiles.size() == 1) + { + BatchDialog* batchDlg = new BatchDialog(&mainDlg_, droppedFiles[0]); + if (batchDlg->ShowModal() == BatchDialog::BATCH_FILE_SAVED) + mainDlg_.pushStatusInformation(_("Batch file created successfully!")); + return false; + } + //fall-through for multiple *.ffs_batch files! + + case xmlAccess::MERGE_GUI: + case xmlAccess::MERGE_GUI_BATCH: + if (droppedFiles.size() == 1) + { + mainDlg_.loadConfiguration(droppedFiles[0]); + return false; + } + else + { + xmlAccess::XmlGuiConfig guiCfg; + try + { + convertConfig(droppedFiles, guiCfg); //throw (xmlAccess::XmlError) + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.msg(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); + return false; + } + } + mainDlg_.setCurrentConfiguration(guiCfg); + return false; + } + + case xmlAccess::MERGE_OTHER: + //=> return true: change directory selection via drag and drop + break; + } + + + //disable the sync button + mainDlg_.syncPreview->enableSynchronization(false); + + //clear grids + mainDlg_.gridDataView->clearAllRows(); + mainDlg_.updateGuiGrid(); + + return true; + } + +private: + MainFolderDragDrop(const MainFolderDragDrop&); + + MainDialog& mainDlg_; +}; + +//------------------------------------------------------------------ +/* class hierarchy: + + template<> + FolderPairPanelBasic + /|\ + | + template<> + FolderPairCallback FolderPairGenerated + /|\ /|\ + _________|________ ________| + | | | + FirstFolderPairCfg FolderPairPanel +*/ + +template +class FolderPairCallback : public FolderPairPanelBasic //implements callback functionality to MainDialog as imposed by FolderPairPanelBasic +{ +public: + FolderPairCallback(GuiPanel& basicPanel, MainDialog& mainDialog) : + FolderPairPanelBasic(basicPanel), //pass FolderPairGenerated part... + mainDlg(mainDialog) {} + +private: + virtual void OnLocalFilterCfgRemoveConfirm(wxCommandEvent& event) + { + FolderPairPanelBasic::OnLocalFilterCfgRemoveConfirm(event); + mainDlg.updateFilterConfig(); //update filter + } + + virtual void OnAltSyncCfgRemoveConfirm(wxCommandEvent& event) + { + FolderPairPanelBasic::OnAltSyncCfgRemoveConfirm(event); + mainDlg.updateSyncConfig(); + } + + virtual wxWindow* getParentWindow() + { + return &mainDlg; + } + + virtual MainConfiguration getMainConfig() const + { + return mainDlg.getCurrentConfiguration().mainCfg; + } + + virtual void OnAltSyncCfgChange() + { + mainDlg.updateSyncConfig(); + } + + virtual void OnLocalFilterCfgChange() + { + mainDlg.updateFilterConfig(); //re-apply filter + } + + MainDialog& mainDlg; +}; + + +class FolderPairPanel : + public FolderPairGenerated, //FolderPairPanel "owns" FolderPairGenerated! + public FolderPairCallback +{ +public: + FolderPairPanel(wxWindow* parent, MainDialog& mainDialog) : + FolderPairGenerated(parent), + FolderPairCallback(static_cast(*this), mainDialog), //pass FolderPairGenerated part... + dragDropOnLeft( m_panelLeft, m_dirPickerLeft, m_directoryLeft), + dragDropOnRight(m_panelRight, m_dirPickerRight, m_directoryRight) {} + +private: + //support for drag and drop + DragDropOnDlg dragDropOnLeft; + DragDropOnDlg dragDropOnRight; +}; + + +class FirstFolderPairCfg : public FolderPairCallback +{ +public: + FirstFolderPairCfg(MainDialog& mainDialog) : + FolderPairCallback(mainDialog, mainDialog), + + //prepare drag & drop + dragDropOnLeft(mainDialog, + mainDialog.m_panelLeft, + mainDialog.m_panelTopLeft, + mainDialog.m_dirPickerLeft, + mainDialog.m_directoryLeft), + dragDropOnRight(mainDialog, + mainDialog.m_panelRight, + mainDialog.m_panelTopRight, + mainDialog.m_dirPickerRight, + mainDialog.m_directoryRight) {} + +private: + //support for drag and drop + MainFolderDragDrop dragDropOnLeft; + MainFolderDragDrop dragDropOnRight; +}; + + +//workaround for wxWidgets: small hack to update menu items: actually this is a wxWidgets bug (affects Windows- and Linux-build) +class MenuItemUpdater +{ +public: + MenuItemUpdater(wxMenu* menuToUpdate) : menuToUpdate_(menuToUpdate) {} + + ~MenuItemUpdater() + { + //start updating menu icons + const wxMenuItemList& allItems = menuToUpdate_->GetMenuItems(); + + //retrieve menu item positions: unfortunately wxMenu doesn't offer a better way + MenuItemMap::iterator j; + int index = 0; + for (wxMenuItemList::const_iterator i = allItems.begin(); i != allItems.end(); ++i, ++index) + if ((j = menuItems.find(*i)) != menuItems.end()) + j->second = index; + + //finally update items + for (MenuItemMap::const_iterator i = menuItems.begin(); i != menuItems.end(); ++i) + if (i->second >= 0) + { + menuToUpdate_->Remove(i->first); //actual workaround + menuToUpdate_->Insert(i->second, i->first); // + } + } + + void addForUpdate(wxMenuItem* newEntry, const wxBitmap& newBitmap) + { + newEntry->SetBitmap(newBitmap); + menuItems.insert(std::pair(newEntry, -1)); + } + +private: + typedef std::map MenuItemMap; + wxMenu* menuToUpdate_; + MenuItemMap menuItems; +}; + + +struct DirNotFound +{ + bool operator()(const FolderPairEnh& fp) const + { + return !dirExists(ffs3::getFormattedDirectoryName(fp.leftDirectory)) || + !dirExists(ffs3::getFormattedDirectoryName(fp.rightDirectory)); + } +}; + + +//################################################################################################################################## +MainDialog::MainDialog(const wxString& cfgFileName, xmlAccess::XmlGlobalSettings& settings) : + MainDialogGenerated(NULL) +{ + xmlAccess::XmlGuiConfig guiCfg; //structure to receive gui settings, already defaulted!! + + const wxString currentConfigFile = cfgFileName.empty() ? lastConfigFileName() : cfgFileName; + + bool loadCfgSuccess = false; + if (!cfgFileName.empty() || fileExists(wxToZ(lastConfigFileName()))) + { + //load XML + try + { + std::vector filenames; + filenames.push_back(currentConfigFile); + + xmlAccess::convertConfig(filenames, guiCfg); //throw (xmlAccess::XmlError) + + loadCfgSuccess = true; + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.msg(), _("Warning"), wxOK | wxICON_WARNING); + else + wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); + } + } + + init(guiCfg, + settings, + !cfgFileName.empty() && loadCfgSuccess); + + setLastUsedConfig(currentConfigFile, loadCfgSuccess ? guiCfg : xmlAccess::XmlGuiConfig()); //simulate changed config on parsing errors +} + + +MainDialog::MainDialog(const xmlAccess::XmlGuiConfig& guiCfg, + xmlAccess::XmlGlobalSettings& settings, + bool startComparison) : + MainDialogGenerated(NULL) +{ + init(guiCfg, + settings, + startComparison); +} + + +MainDialog::~MainDialog() +{ + //keep non-inline destructor for std::auto_ptr to work with forward declaration + + cleanUp(true); //do NOT include any other code here! cleanUp() is re-used when switching languages +} + + +void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, + xmlAccess::XmlGlobalSettings& settings, + bool startComparison) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + //--------- avoid mirroring this dialog in RTL languages like Hebrew or Arabic -------------------- + m_panelViewFilter->SetLayoutDirection(wxLayout_LeftToRight); + m_panelStatusBar->SetLayoutDirection(wxLayout_LeftToRight); +// if (GetLayoutDirection() == wxLayout_RightToLeft) +//{ +// bSizerGridHolder->Detach(m_panelRight); +// bSizerGridHolder->Detach(m_panelLeft); +// bSizerGridHolder->Add(m_panelLeft); +// bSizerGridHolder->Prepend(m_panelRight); +//bSizerGridHolder->Fit(this); +// +// bSizerGridHolder->Layout(); +//} +//------------------------------------------------------------------------------------------------------ + + globalSettings = &settings; + gridDataView.reset(new ffs3::GridView); + contextMenu.reset(new wxMenu); //initialize right-click context menu; will be dynamically re-created on each R-mouse-click + + compareStatus.reset(new CompareStatus(*this)); + cleanedUp = false; + lastSortColumn = -1; + lastSortGrid = NULL; + + updateFileIcons.reset(new IconUpdater(m_gridLeft, m_gridRight)); + +#ifdef FFS_WIN + moveWholeWindow.reset(new MouseMoveWindow(this)); +#endif + syncPreview.reset(new SyncPreview(this)); + + SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); + + SetIcon(*GlobalResources::getInstance().programIcon); //set application icon + + + //notify about (logical) application main window => program won't quit, but stay on this dialog + ffs3::AppMainWindow::setMainWindow(this); + + //init handling of first folder pair + firstFolderPair.reset(new FirstFolderPairCfg(*this)); + + initViewFilterButtons(); + + //initialize and load configuration + readGlobalSettings(); + setCurrentConfiguration(guiCfg); + + //set icons for this dialog + m_bpButton10->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("exit"))); + m_buttonCompare->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("compare"))); + m_bpButtonSyncConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("syncConfig"))); + m_bpButtonCmpConfig->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("cmpConfig"))); + m_bpButtonSave->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("save"))); + m_bpButtonLoad->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("load"))); + m_bpButtonAddPair->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("addFolderPair"))); + m_bitmap15->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusEdge"))); + + m_bitmapCreate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("create"))); + m_bitmapUpdate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("update"))); + m_bitmapDelete->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("delete"))); + m_bitmapData->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("data"))); + + bSizer6->Layout(); //wxButtonWithImage size might have changed + + //menu icons: workaround for wxWidgets: small hack to update menu items: actually this is a wxWidgets bug (affects Windows- and Linux-build) + MenuItemUpdater updateMenuFile(m_menuFile); + updateMenuFile.addForUpdate(m_menuItem10, GlobalResources::getInstance().getImageByName(wxT("compareSmall"))); + updateMenuFile.addForUpdate(m_menuItem11, GlobalResources::getInstance().getImageByName(wxT("syncSmall"))); + updateMenuFile.addForUpdate(m_menuItemNew, GlobalResources::getInstance().getImageByName(wxT("newSmall"))); + updateMenuFile.addForUpdate(m_menuItemSave, GlobalResources::getInstance().getImageByName(wxT("saveSmall"))); + updateMenuFile.addForUpdate(m_menuItemLoad, GlobalResources::getInstance().getImageByName(wxT("loadSmall"))); + + MenuItemUpdater updateMenuAdv(m_menuAdvanced); + updateMenuAdv.addForUpdate(m_menuItemGlobSett, GlobalResources::getInstance().getImageByName(wxT("settingsSmall"))); + updateMenuAdv.addForUpdate(m_menuItem7, GlobalResources::getInstance().getImageByName(wxT("batchSmall"))); + + MenuItemUpdater updateMenuHelp(m_menuHelp); + updateMenuHelp.addForUpdate(m_menuItemAbout, GlobalResources::getInstance().getImageByName(wxT("aboutSmall"))); + +#ifdef FFS_WIN + //allow moving main dialog by clicking (nearly) anywhere... + moveWholeWindow->connectSourceWindow(m_panel71); + moveWholeWindow->connectSourceWindow(m_panelBottom); + moveWholeWindow->connectSourceWindow(m_panelStatusBar); +#endif + +#ifdef FFS_LINUX + if (!ffs3::isPortableVersion()) //disable update check for Linux installer-based version -> handled by .deb + m_menuItemCheckVer->Enable(false); +#endif + + //create language selection menu + for (std::vector::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) + { + wxMenuItem* newItem = new wxMenuItem(m_menuLanguages, wxID_ANY, i->languageName, wxEmptyString, wxITEM_NORMAL ); + newItem->SetBitmap(GlobalResources::getInstance().getImageByName(i->languageFlag)); + + //map menu item IDs with language IDs: evaluated when processing event handler + languageMenuItemMap.insert(std::map::value_type(newItem->GetId(), i->languageID)); + + //connect event + Connect(newItem->GetId(), wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnMenuLanguageSwitch)); + m_menuLanguages->Append(newItem); + } + + //support for CTRL + C and DEL on grids + m_gridLeft->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridLeftButtonEvent), NULL, this); + m_gridRight->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridRightButtonEvent), NULL, this); + m_gridMiddle->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::onGridMiddleButtonEvent), NULL, this); + + Connect(wxEVT_IDLE, wxEventHandler(MainDialog::OnIdleEvent), NULL, this); + Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); + Connect(wxEVT_MOVE, wxSizeEventHandler(MainDialog::OnResize), NULL, this); + + m_bpButtonFilter->Connect(wxEVT_RIGHT_DOWN, wxCommandEventHandler(MainDialog::OnGlobalFilterOpenContext), NULL, this); + + //calculate witdh of folder pair manually (if scrollbars are visible) + m_scrolledWindowFolderPairs->Connect(wxEVT_SIZE, wxSizeEventHandler(MainDialog::OnResizeFolderPairs), NULL, this); + + //event handler for manual (un-)checking of rows and setting of sync direction + m_gridMiddle->Connect(FFS_CHECK_ROWS_EVENT, FFSCheckRowsEventHandler(MainDialog::OnCheckRows), NULL, this); + m_gridMiddle->Connect(FFS_SYNC_DIRECTION_EVENT, FFSSyncDirectionEventHandler(MainDialog::OnSetSyncDirection), NULL, this); + + //init grid settings + m_gridLeft ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); + m_gridMiddle->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); + m_gridRight ->initSettings(m_gridLeft, m_gridMiddle, m_gridRight, gridDataView.get()); + + //disable sync button as long as "compare" hasn't been triggered. + syncPreview->enableSynchronization(false); + + //mainly to update row label sizes... + updateGuiGrid(); + + //integrate the compare status panel (in hidden state) + bSizer1->Insert(1, compareStatus->getAsWindow(), 0, wxEXPAND | wxBOTTOM, 5 ); + Layout(); //avoid screen flicker when panel is shown later + compareStatus->getAsWindow()->Hide(); + + //correct width of swap button above middle grid + const wxSize source = m_gridMiddle->GetSize(); + const wxSize target = m_bpButtonSwapSides->GetSize(); + const int spaceToAdd = source.GetX() - target.GetX(); + bSizerMiddle->Insert(1, spaceToAdd / 2, 0, 0); + bSizerMiddle->Insert(0, spaceToAdd - (spaceToAdd / 2), 0, 0); + + //register regular check for update on next idle event + Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), NULL, this); + + //asynchronous call to wxWindow::Layout(): fix superfluous frame on right and bottom when FFS is started in fullscreen mode + Connect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); + +//---------------------------------------------------------------------------------------------------------------------------------------------------------------- + //some convenience: if FFS is started with a *.ffs_gui file as commandline parameter AND all directories contained exist, comparison shall be started right off + if (startComparison) + { + const ffs3::MainConfiguration currMainCfg = getCurrentConfiguration().mainCfg; + const bool allFoldersExist = !DirNotFound()(currMainCfg.firstPair) && + std::find_if(currMainCfg.additionalPairs.begin(), currMainCfg.additionalPairs.end(), + DirNotFound()) == currMainCfg.additionalPairs.end(); + if (allFoldersExist) + { + wxCommandEvent dummy2(wxEVT_COMMAND_BUTTON_CLICKED); + m_buttonCompare->GetEventHandler()->AddPendingEvent(dummy2); //simulate button click on "compare" + } + } +//---------------------------------------------------------------------------------------------------------------------------------------------------------------- +} + + +void MainDialog::cleanUp(bool saveLastUsedConfig) +{ + if (!cleanedUp) + { + cleanedUp = true; + + //no need for wxEventHandler::Disconnect() here; done automatically when window is destoyed! + + m_gridLeft ->release(); //handle wxGrid-related callback on grid data after MainDialog has died... (Linux only) + m_gridMiddle->release(); + m_gridRight ->release(); + + //save configuration + if (saveLastUsedConfig) + writeConfigurationToXml(lastConfigFileName()); //don't throw exceptions in destructors + writeGlobalSettings(); + } +} + + +void MainDialog::readGlobalSettings() +{ + //apply window size and position at program startup ONLY + widthNotMaximized = globalSettings->gui.widthNotMaximized; + heightNotMaximized = globalSettings->gui.heightNotMaximized; + posXNotMaximized = globalSettings->gui.posXNotMaximized; + posYNotMaximized = globalSettings->gui.posYNotMaximized; + + //apply window size and position + if ( widthNotMaximized != wxDefaultCoord && + heightNotMaximized != wxDefaultCoord && + posXNotMaximized != wxDefaultCoord && + posYNotMaximized != wxDefaultCoord && + wxDisplay::GetFromPoint(wxPoint(posXNotMaximized, posYNotMaximized)) != wxNOT_FOUND) //make sure upper left corner is in visible view + SetSize(posXNotMaximized, posYNotMaximized, widthNotMaximized, heightNotMaximized); + else + Centre(); + + Maximize(globalSettings->gui.isMaximized); + + + //set column attributes + m_gridLeft->setColumnAttributes(globalSettings->gui.columnAttribLeft); + m_gridRight->setColumnAttributes(globalSettings->gui.columnAttribRight); + + //load list of last used configuration files (in reverse order) + for (std::vector::reverse_iterator i = globalSettings->gui.cfgFileHistory.rbegin(); + i != globalSettings->gui.cfgFileHistory.rend(); + ++i) + addFileToCfgHistory(*i); + + //load list of last used folders + for (std::vector::reverse_iterator i = globalSettings->gui.folderHistoryLeft.rbegin(); + i != globalSettings->gui.folderHistoryLeft.rend(); + ++i) + addLeftFolderToHistory(*i); + for (std::vector::reverse_iterator i = globalSettings->gui.folderHistoryRight.rbegin(); + i != globalSettings->gui.folderHistoryRight.rend(); + ++i) + addRightFolderToHistory(*i); + + //show/hide file icons + m_gridLeft->enableFileIcons(globalSettings->gui.showFileIconsLeft); + m_gridRight->enableFileIcons(globalSettings->gui.showFileIconsRight); + + //set selected tab + m_notebookBottomLeft->ChangeSelection(globalSettings->gui.selectedTabBottomLeft); +} + + +void MainDialog::writeGlobalSettings() +{ + //write global settings to (global) variable stored in application instance + globalSettings->gui.widthNotMaximized = widthNotMaximized; + globalSettings->gui.heightNotMaximized = heightNotMaximized; + globalSettings->gui.posXNotMaximized = posXNotMaximized; + globalSettings->gui.posYNotMaximized = posYNotMaximized; + globalSettings->gui.isMaximized = IsMaximized(); + + //retrieve column attributes + globalSettings->gui.columnAttribLeft = m_gridLeft->getColumnAttributes(); + globalSettings->gui.columnAttribRight = m_gridRight->getColumnAttributes(); + + //write list of last used configuration files + globalSettings->gui.cfgFileHistory = cfgFileNames; + + //write list of last used folders + globalSettings->gui.folderHistoryLeft.clear(); + const wxArrayString leftFolderHistory = m_directoryLeft->GetStrings(); + for (unsigned i = 0; i < leftFolderHistory.GetCount(); ++i) + globalSettings->gui.folderHistoryLeft.push_back(leftFolderHistory[i]); + + globalSettings->gui.folderHistoryRight.clear(); + const wxArrayString rightFolderHistory = m_directoryRight->GetStrings(); + for (unsigned i = 0; i < rightFolderHistory.GetCount(); ++i) + globalSettings->gui.folderHistoryRight.push_back(rightFolderHistory[i]); + + //get selected tab + globalSettings->gui.selectedTabBottomLeft = m_notebookBottomLeft->GetSelection(); +} + + +void MainDialog::setSyncDirManually(const std::set& rowsToSetOnUiTable, const ffs3::SyncDirection dir) +{ + if (rowsToSetOnUiTable.size() > 0) + { + for (std::set::const_iterator i = rowsToSetOnUiTable.begin(); i != rowsToSetOnUiTable.end(); ++i) + { + FileSystemObject* fsObj = gridDataView->getObject(*i); + if (fsObj) + { + setSyncDirectionRec(dir, *fsObj); //set new direction (recursively) + ffs3::setActiveStatus(true, *fsObj); //works recursively for directories + } + } + + updateGuiGrid(); + } +} + + +void MainDialog::filterRangeManually(const std::set& rowsToFilterOnUiTable, int leadingRow) +{ + if (rowsToFilterOnUiTable.size() > 0) + { + bool newSelection = false; //default: deselect range + + //leadingRow determines de-/selection of all other rows + const FileSystemObject* fsObj = gridDataView->getObject(leadingRow); + if (fsObj) + newSelection = !fsObj->isActive(); + + //if hidefiltered is active, there should be no filtered elements on screen => current element was filtered out + assert(!currentCfg.hideFilteredElements || !newSelection); + + //get all lines that need to be filtered + std::vector compRef; + gridDataView->getAllFileRef(rowsToFilterOnUiTable, compRef); //everything in compRef is bound + + for (std::vector::iterator i = compRef.begin(); i != compRef.end(); ++i) + ffs3::setActiveStatus(newSelection, **i); //works recursively for directories + + refreshGridAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts + } +} + + +void MainDialog::OnIdleEvent(wxEvent& event) +{ + //small routine to restore status information after some time + if (stackObjects.size() > 0 ) //check if there is some work to do + { + wxLongLong currentTime = wxGetLocalTimeMillis(); + if (currentTime - lastStatusChange > 2500) //restore stackObject after two seconds + { + lastStatusChange = currentTime; + + m_staticTextStatusMiddle->SetLabel(stackObjects.top()); + stackObjects.pop(); + + if (stackObjects.empty()) + m_staticTextStatusMiddle->SetForegroundColour(*wxBLACK); //reset color + + m_panelStatusBar->Layout(); + } + } + + event.Skip(); +} + + +void MainDialog::copySelectionToClipboard(const CustomGrid* selectedGrid) +{ + const std::set selectedRows = getSelectedRows(selectedGrid); + if (selectedRows.size() > 0) + { + wxString clipboardString; + + for (std::set::const_iterator i = selectedRows.begin(); i != selectedRows.end(); ++i) + { + for (int k = 0; k < const_cast(selectedGrid)->GetNumberCols(); ++k) + { + clipboardString+= const_cast(selectedGrid)->GetCellValue(static_cast(*i), k); + if (k != const_cast(selectedGrid)->GetNumberCols() - 1) + clipboardString+= '\t'; + } + clipboardString+= '\n'; + } + + if (!clipboardString.IsEmpty()) + // Write text to the clipboard + if (wxTheClipboard->Open()) + { + // these data objects are held by the clipboard, + // so do not delete them in the app. + wxTheClipboard->SetData( new wxTextDataObject(clipboardString) ); + wxTheClipboard->Close(); + } + } +} + + +std::set MainDialog::getSelectedRows(const CustomGrid* grid) const +{ + std::set output = grid->getAllSelectedRows(); + + //remove invalid rows + output.erase(output.lower_bound(gridDataView->rowsOnView()), output.end()); + + return output; +} + + +std::set MainDialog::getSelectedRows() const +{ + //merge selections from left and right grid + std::set selection = getSelectedRows(m_gridLeft); + std::set additional = getSelectedRows(m_gridRight); + selection.insert(additional.begin(), additional.end()); + return selection; +} + + +class ManualDeletionHandler : private wxEvtHandler, public DeleteFilesHandler +{ +public: + ManualDeletionHandler(MainDialog* main, size_t totalObjToDel) : + mainDlg(main), + totalObjToDelete(totalObjToDel), + abortRequested(false), + ignoreErrors(false), + deletionCount(0) + { + mainDlg->disableAllElements(); //disable everything except abort button + mainDlg->clearStatusBar(); + + //register abort button + mainDlg->m_buttonAbort->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortCompare ), NULL, this ); + } + + ~ManualDeletionHandler() + { + //de-register abort button + mainDlg->m_buttonAbort->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ManualDeletionHandler::OnAbortCompare ), NULL, this ); + + mainDlg->enableAllElements(); + } + + virtual Response reportError(const wxString& errorMessage) + { + if (abortRequested) + throw ffs3::AbortThisProcess(); + + if (ignoreErrors) + return DeleteFilesHandler::IGNORE_ERROR; + + bool ignoreNextErrors = false; + ErrorDlg* errorDlg = new ErrorDlg(NULL, + ErrorDlg::BUTTON_IGNORE | ErrorDlg::BUTTON_RETRY | ErrorDlg::BUTTON_ABORT, + errorMessage, ignoreNextErrors); + const int rv = errorDlg->ShowModal(); + errorDlg->Destroy(); + switch (static_cast(rv)) + { + case ErrorDlg::BUTTON_IGNORE: + ignoreErrors = ignoreNextErrors; + return DeleteFilesHandler::IGNORE_ERROR; + case ErrorDlg::BUTTON_RETRY: + return DeleteFilesHandler::RETRY; + case ErrorDlg::BUTTON_ABORT: + throw ffs3::AbortThisProcess(); + } + + assert (false); + return DeleteFilesHandler::IGNORE_ERROR; //dummy return value + } + + virtual void deletionSuccessful() //called for each file/folder that has been deleted + { + ++deletionCount; + + if (updateUiIsAllowed()) //test if specific time span between ui updates is over + { + wxString statusMessage = _("%x / %y objects deleted successfully"); + statusMessage.Replace(wxT("%x"), ffs3::numberToStringSep(deletionCount), false); + statusMessage.Replace(wxT("%y"), ffs3::numberToStringSep(totalObjToDelete), false); + + mainDlg->m_staticTextStatusMiddle->SetLabel(statusMessage); + mainDlg->m_panelStatusBar->Layout(); + + updateUiNow(); + } + + if (abortRequested) //test after (implicit) call to wxApp::Yield() + throw ffs3::AbortThisProcess(); + } + +private: + void OnAbortCompare(wxCommandEvent& event) //handle abort button click + { + abortRequested = true; //don't throw exceptions in a GUI-Callback!!! (throw ffs3::AbortThisProcess()) + } + + MainDialog* const mainDlg; + const size_t totalObjToDelete; + + bool abortRequested; + bool ignoreErrors; + size_t deletionCount; +}; + + +void MainDialog::deleteSelectedFiles() +{ + //get set of selected rows on view + const std::set viewSelectionLeft = getSelectedRows(m_gridLeft); + const std::set viewSelectionRight = getSelectedRows(m_gridRight); + + if (viewSelectionLeft.size() + viewSelectionRight.size()) + { + //map lines from GUI view to grid line references + std::vector compRefLeft; + gridDataView->getAllFileRef(viewSelectionLeft, compRefLeft); + + std::vector compRefRight; + gridDataView->getAllFileRef(viewSelectionRight, compRefRight); + + + int totalDeleteCount = 0; + + if (ffs3::showDeleteDialog(compRefLeft, + compRefRight, + globalSettings->gui.deleteOnBothSides, + globalSettings->gui.useRecyclerForManualDeletion, + totalDeleteCount) == DefaultReturnCode::BUTTON_OKAY) + { + if (globalSettings->gui.useRecyclerForManualDeletion && !ffs3::recycleBinExists()) + { + wxMessageBox(_("Recycle Bin not yet supported for this system!")); + return; + } + + try + { + //handle errors when deleting files/folders + ManualDeletionHandler statusHandler(this, totalDeleteCount); + + ffs3::deleteFromGridAndHD(gridDataView->getDataTentative(), + compRefLeft, + compRefRight, + globalSettings->gui.deleteOnBothSides, + globalSettings->gui.useRecyclerForManualDeletion, + getCurrentConfiguration().mainCfg, + &statusHandler); + } + catch (ffs3::AbortThisProcess&) {} + + //remove rows that empty: just a beautification, invalid rows shouldn't cause issues + gridDataView->removeInvalidRows(); + + //redraw grid neccessary to update new dimensions and for UI-Backend data linkage + updateGuiGrid(); //call immediately after deleteFromGridAndHD!!! + + m_gridLeft-> ClearSelection(); + m_gridMiddle->ClearSelection(); + m_gridRight-> ClearSelection(); + } + } +} + + +template +void exstractNames(const FileSystemObject& fsObj, wxString& name, wxString& dir) +{ + if (!fsObj.isEmpty()) + { + struct GetNames : public FSObjectVisitor + { + GetNames(wxString& nameIn, wxString& dirIn) : name_(nameIn), dir_(dirIn) {} + virtual void visit(const FileMapping& fileObj) + { + name_ = zToWx(fileObj.getFullName()); + dir_ = zToWx(fileObj.getFullName().BeforeLast(common::FILE_NAME_SEPARATOR)); + } + virtual void visit(const SymLinkMapping& linkObj) + { + name_ = zToWx(linkObj.getFullName()); + dir_ = zToWx(linkObj.getFullName().BeforeLast(common::FILE_NAME_SEPARATOR)); + } + virtual void visit(const DirMapping& dirObj) + { + dir_ = name_ = zToWx(dirObj.getFullName()); + } + + wxString& name_; + wxString& dir_; + ; + } getNames(name, dir); + fsObj.accept(getNames); + } + else + { + name.clear(); + dir.clear(); + } +} + + +void MainDialog::openExternalApplication(size_t rowNumber, bool leftSide, const wxString& commandline) +{ + if (commandline.empty()) + return; + + wxString command = commandline; + + wxString name; + wxString dir; + wxString nameCo; + wxString dirCo; + + const FileSystemObject* fsObj = gridDataView->getObject(rowNumber); + if (fsObj) + { + if (leftSide) + { + exstractNames( *fsObj, name, dir); + exstractNames(*fsObj, nameCo, dirCo); + } + else + { + exstractNames(*fsObj, name, dir); + exstractNames( *fsObj, nameCo, dirCo); + } +#ifdef FFS_WIN + if (name.empty()) + { + if (leftSide) + wxExecute(wxString(wxT("explorer ")) + zToWx(fsObj->getBaseDirPf())); + else + wxExecute(wxString(wxT("explorer ")) + zToWx(fsObj->getBaseDirPf())); + return; + } +#endif + } + else + { + //fallback + dir = zToWx(ffs3::getFormattedDirectoryName(firstFolderPair->getLeftDir())); + dirCo = zToWx(ffs3::getFormattedDirectoryName(firstFolderPair->getRightDir())); + + if (!leftSide) + std::swap(dir, dirCo); + +#ifdef FFS_WIN + wxExecute(wxString(wxT("explorer ")) + dir); //default + return; +#endif + } + + command.Replace(wxT("%nameCo"), nameCo, true); //attention: replace %nameCo, %dirCo BEFORE %name, %dir to handle dependency + command.Replace(wxT("%dirCo"), dirCo, true); + command.Replace(wxT("%name"), name, true); + command.Replace(wxT("%dir"), dir, true); + + wxExecute(command); +} + + +void MainDialog::pushStatusInformation(const wxString& text) +{ + lastStatusChange = wxGetLocalTimeMillis(); + stackObjects.push(m_staticTextStatusMiddle->GetLabel()); + m_staticTextStatusMiddle->SetLabel(text); + m_staticTextStatusMiddle->SetForegroundColour(wxColour(31, 57, 226)); //highlight color: blue + m_panelStatusBar->Layout(); +} + + +void MainDialog::clearStatusBar() +{ + while (stackObjects.size() > 0) + stackObjects.pop(); + + m_staticTextStatusMiddle->SetForegroundColour(*wxBLACK); //reset color + m_staticTextStatusLeft->SetLabel(wxEmptyString); + m_staticTextStatusMiddle->SetLabel(wxEmptyString); + m_staticTextStatusRight->SetLabel(wxEmptyString); +} + + +void MainDialog::disableAllElements() +{ + //disenables all elements (except abort button) that might receive user input during long-running processes: comparison, deletion + m_bpButtonCmpConfig-> Disable(); + m_notebookBottomLeft->Disable(); + m_checkBoxHideFilt-> Disable(); + m_bpButtonSyncConfig->Disable(); + m_buttonStartSync-> Disable(); + m_dirPickerLeft-> Disable(); + m_dirPickerRight-> Disable(); + m_bpButtonSwapSides-> Disable(); + m_bpButtonLeftOnly-> Disable(); + m_bpButtonLeftNewer-> Disable(); + m_bpButtonEqual-> Disable(); + m_bpButtonDifferent-> Disable(); + m_bpButtonRightNewer->Disable(); + m_bpButtonRightOnly-> Disable(); + m_panelLeft-> Disable(); + m_panelMiddle-> Disable(); + m_panelRight-> Disable(); + m_panelTopLeft-> Disable(); + m_panelTopMiddle-> Disable(); + m_panelTopRight-> Disable(); + m_bpButton10-> Disable(); + m_scrolledWindowFolderPairs->Disable(); + m_menubar1->EnableTop(0, false); + m_menubar1->EnableTop(1, false); + m_menubar1->EnableTop(2, false); + EnableCloseButton(false); + + //show abort button + m_buttonAbort->Enable(); + m_buttonAbort->Show(); + m_buttonCompare->Disable(); + m_buttonCompare->Hide(); + m_buttonAbort->SetFocus(); +} + + +void MainDialog::enableAllElements() +{ + m_bpButtonCmpConfig-> Enable(); + m_notebookBottomLeft->Enable(); + m_checkBoxHideFilt-> Enable(); + m_bpButtonSyncConfig->Enable(); + m_buttonStartSync-> Enable(); + m_dirPickerLeft-> Enable(); + m_dirPickerRight-> Enable(); + m_bpButtonSwapSides-> Enable(); + m_bpButtonLeftOnly-> Enable(); + m_bpButtonLeftNewer-> Enable(); + m_bpButtonEqual-> Enable(); + m_bpButtonDifferent-> Enable(); + m_bpButtonRightNewer->Enable(); + m_bpButtonRightOnly-> Enable(); + m_panelLeft-> Enable(); + m_panelMiddle-> Enable(); + m_panelRight-> Enable(); + m_panelTopLeft-> Enable(); + m_panelTopMiddle-> Enable(); + m_panelTopRight-> Enable(); + m_bpButton10-> Enable(); + m_scrolledWindowFolderPairs->Enable(); + m_menubar1->EnableTop(0, true); + m_menubar1->EnableTop(1, true); + m_menubar1->EnableTop(2, true); + EnableCloseButton(true); + + //show compare button + m_buttonAbort->Disable(); + m_buttonAbort->Hide(); + m_buttonCompare->Enable(); + m_buttonCompare->Show(); +} + + +void MainDialog::OnResize(wxSizeEvent& event) +{ + if (!IsMaximized()) + { + int width = 0; + int height = 0; + int x = 0; + int y = 0; + + GetSize(&width, &height); + GetPosition(&x, &y); + + if (width > 0 && height > 0 && x >= -200 && y >= -200) //test ALL parameters at once, since width/height are invalid if + { + //the window is minimized (eg x,y == -32000; height = 28, width = 160) + widthNotMaximized = width; //however visible(!) x < 0 and y < 0 are possible with dual monitors + heightNotMaximized = height; + + posXNotMaximized = x; + posYNotMaximized = y; + } + } + + event.Skip(); +} + + +void MainDialog::OnResizeFolderPairs(wxSizeEvent& event) +{ + //adapt left-shift display distortion caused by scrollbars for multiple folder pairs + if (additionalFolderPairs.size() > 0) + { + const int width = m_panelTopLeft->GetSize().GetWidth(); + + for (std::vector::iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + (*i)->m_panelLeft->SetMinSize(wxSize(width, -1)); + } + + event.Skip(); +} + + +void MainDialog::onGridLeftButtonEvent(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + + if (event.ControlDown()) + switch (keyCode) + { + case 'C': + case WXK_INSERT: //CTRL + C || CTRL + INS + copySelectionToClipboard(m_gridLeft); + break; + + case 'A': //CTRL + A + m_gridLeft->SelectAll(); + break; + + case 'F': //CTRL + F + ffs3::startFind(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); + break; + + case WXK_NUMPAD_ADD: //CTRL + '+' + m_gridLeft->autoSizeColumns(); + break; + } + + else if (event.AltDown()) + switch (keyCode) + { + case WXK_LEFT: //ALT + <- + { + wxCommandEvent dummy; + OnContextSyncDirLeft(dummy); + } + break; + + case WXK_RIGHT: //ALT + -> + { + wxCommandEvent dummy; + OnContextSyncDirRight(dummy); + } + break; + + case WXK_UP: /* ALT + /|\ */ + case WXK_DOWN: /* ALT + \|/ */ + { + wxCommandEvent dummy; + OnContextSyncDirNone(dummy); + } + break; + } + + else + switch (keyCode) + { + case WXK_DELETE: + case WXK_NUMPAD_DELETE: + deleteSelectedFiles(); + break; + + case WXK_SPACE: + { + wxCommandEvent dummy; + OnContextFilterTemp(dummy); + } + break; + + case WXK_RETURN: + case WXK_NUMPAD_ENTER: + { + wxCommandEvent dummy(wxEVT_NULL, externalAppIDFirst); //open with first external application + OnContextOpenWith(dummy); + } + break; + + case WXK_F3: //F3 + case WXK_NUMPAD_F3: // + ffs3::findNext(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); + break; + } + + //event.Skip(); -> swallow event! don't allow default grid commands! +} + + +void MainDialog::onGridMiddleButtonEvent(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + + if (event.ControlDown()) + { + if (keyCode == 67 || keyCode == WXK_INSERT) //CTRL + C || CTRL + INS + copySelectionToClipboard(m_gridMiddle); + } + + //event.Skip(); -> swallow event! don't allow default grid commands! +} + + +void MainDialog::onGridRightButtonEvent(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + + if (event.ControlDown()) + switch (keyCode) + { + case 'C': + case WXK_INSERT: //CTRL + C || CTRL + INS + copySelectionToClipboard(m_gridRight); + break; + + case 'A': //CTRL + A + m_gridRight->SelectAll(); + break; + + case 'F': //CTRL + F + ffs3::startFind(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); + break; + + case WXK_NUMPAD_ADD: //CTRL + '+' + m_gridRight->autoSizeColumns(); + break; + } + + else if (event.AltDown()) + switch (keyCode) + { + case WXK_LEFT: //ALT + <- + { + wxCommandEvent dummy; + OnContextSyncDirLeft(dummy); + } + break; + + case WXK_RIGHT: //ALT + -> + { + wxCommandEvent dummy; + OnContextSyncDirRight(dummy); + } + break; + + case WXK_UP: /* ALT + /|\ */ + case WXK_DOWN: /* ALT + \|/ */ + { + wxCommandEvent dummy; + OnContextSyncDirNone(dummy); + } + break; + } + + else + switch (keyCode) + { + case WXK_DELETE: + case WXK_NUMPAD_DELETE: + deleteSelectedFiles(); + break; + + case WXK_SPACE: + { + wxCommandEvent dummy; + OnContextFilterTemp(dummy); + } + break; + + case WXK_RETURN: + case WXK_NUMPAD_ENTER: + { + wxCommandEvent dummy(wxEVT_NULL, externalAppIDFirst); //open with first external application + OnContextOpenWith(dummy); + } + break; + + case WXK_F3: //F3 + case WXK_NUMPAD_F3: // + ffs3::findNext(*this, *m_gridLeft, *m_gridRight, globalSettings->gui.textSearchRespectCase); + break; + } + + //event.Skip(); -> swallow event! don't allow default grid commands! +} + + + +//------------------------------------------------------------ +//temporal variables used by exclude via context menu +struct SelectedExtension : public wxObject +{ + SelectedExtension(const Zstring& ext) : extension(ext) {} + + Zstring extension; +}; + +struct FilterObject +{ + FilterObject(const Zstring& relName, bool isDirectory) : + relativeName(relName), + isDir(isDirectory) {} + Zstring relativeName; + bool isDir; +}; + +typedef std::vector FilterObjList; + +struct FilterObjContainer : public wxObject +{ + FilterObjContainer(const FilterObjList& objList) : selectedObjects(objList) {} + + FilterObjList selectedObjects; +}; +//------------------------------------------------------------ + + + +void MainDialog::OnContextRim(wxGridEvent& event) +{ + //usability: select row unter right-click if not already selected + wxGrid* sourceGrid = dynamic_cast(event.GetEventObject()); + if (sourceGrid != NULL) + { + const int clickedRow = event.GetRow(); + const int clickedCol = event.GetCol(); + if (clickedRow >= 0 && clickedCol >= 0 && !sourceGrid->IsInSelection(clickedRow, 0)) + { + sourceGrid->SelectRow(clickedRow); + sourceGrid->SetGridCursor(clickedRow, clickedCol); + + if (sourceGrid == m_gridLeft) + m_gridRight->ClearSelection(); + else if (sourceGrid == m_gridRight) + m_gridLeft->ClearSelection(); + } + } + //------------------------------------------------------------------------------ + + + const std::set selectionLeft = getSelectedRows(m_gridLeft); + const std::set selectionRight = getSelectedRows(m_gridRight); + + const size_t selectionBegin = selectionLeft.size() + selectionRight.size() == 0 ? 0 : + selectionLeft.size() == 0 ? *selectionRight.begin() : + selectionRight.size() == 0 ? *selectionLeft.begin() : + std::min(*selectionLeft.begin(), *selectionRight.begin()); + + const FileSystemObject* fsObj = gridDataView->getObject(selectionBegin); + + + //####################################################### + //re-create context menu + contextMenu.reset(new wxMenu); + + if (syncPreview->previewIsEnabled() && + fsObj && fsObj->getSyncOperation() != SO_EQUAL) + { + if (selectionLeft.size() + selectionRight.size() > 0) + { + //CONTEXT_SYNC_DIR_LEFT + wxMenuItem* menuItemSyncDirLeft = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_LEFT, wxString(_("Set direction:")) + + wxT(" ") + getSymbol(fsObj->testSyncOperation(true, SYNC_DIR_LEFT)) + + wxT("\tALT + LEFT")); //Linux needs a direction, "<-", because it has no context menu icons! + menuItemSyncDirLeft->SetBitmap(getSyncOpImage(fsObj->testSyncOperation(true, SYNC_DIR_LEFT))); + contextMenu->Append(menuItemSyncDirLeft); + + //CONTEXT_SYNC_DIR_NONE + wxMenuItem* menuItemSyncDirNone = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_NONE, wxString(_("Set direction:")) + + wxT(" ") + getSymbol(fsObj->testSyncOperation(true, SYNC_DIR_NONE)) + + wxT("\tALT + UP")); + menuItemSyncDirNone->SetBitmap(getSyncOpImage(fsObj->testSyncOperation(true, SYNC_DIR_NONE))); + contextMenu->Append(menuItemSyncDirNone); + + //CONTEXT_SYNC_DIR_RIGHT + wxMenuItem* menuItemSyncDirRight = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_RIGHT, wxString(_("Set direction:")) + + wxT(" ") + getSymbol(fsObj->testSyncOperation(true, SYNC_DIR_RIGHT)) + + wxT("\tALT + RIGHT")); + menuItemSyncDirRight->SetBitmap(getSyncOpImage(fsObj->testSyncOperation(true, SYNC_DIR_RIGHT))); + contextMenu->Append(menuItemSyncDirRight); + + contextMenu->AppendSeparator(); + } + } + + + //CONTEXT_FILTER_TEMP + if (fsObj && (selectionLeft.size() + selectionRight.size() > 0)) + { + if (fsObj->isActive()) + { + wxMenuItem* menuItemExclTemp = new wxMenuItem(contextMenu.get(), CONTEXT_FILTER_TEMP, wxString(_("Exclude temporarily")) + wxT("\tSPACE")); + menuItemExclTemp->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("checkboxFalse"))); + contextMenu->Append(menuItemExclTemp); + } + else + { + wxMenuItem* menuItemInclTemp = new wxMenuItem(contextMenu.get(), CONTEXT_FILTER_TEMP, wxString(_("Include temporarily")) + wxT("\tSPACE")); + menuItemInclTemp->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("checkboxTrue"))); + contextMenu->Append(menuItemInclTemp); + } + } + else + { + contextMenu->Append(CONTEXT_FILTER_TEMP, wxString(_("Exclude temporarily")) + wxT("\tSPACE")); //this element should always be visible + contextMenu->Enable(CONTEXT_FILTER_TEMP, false); + } + + //############################################################################################### + //get list of relative file/dir-names for filtering + FilterObjList exFilterCandidateObj; + + class AddFilter : public FSObjectVisitor + { + public: + AddFilter(FilterObjList& fl) : filterList_(fl) {} + virtual void visit(const FileMapping& fileObj) + { + filterList_.push_back(FilterObject(fileObj.getObjRelativeName(), false)); + } + virtual void visit(const SymLinkMapping& linkObj) + { + filterList_.push_back(FilterObject(linkObj.getObjRelativeName(), false)); + } + virtual void visit(const DirMapping& dirObj) + { + filterList_.push_back(FilterObject(dirObj.getObjRelativeName(), true)); + } + + private: + FilterObjList& filterList_; + } newFilterEntry(exFilterCandidateObj); + + + for (std::set::const_iterator i = selectionLeft.begin(); i != selectionLeft.end(); ++i) + { + const FileSystemObject* currObj = gridDataView->getObject(*i); + if (currObj && !currObj->isEmpty()) + currObj->accept(newFilterEntry); + } + for (std::set::const_iterator i = selectionRight.begin(); i != selectionRight.end(); ++i) + { + const FileSystemObject* currObj = gridDataView->getObject(*i); + if (currObj && !currObj->isEmpty()) + currObj->accept(newFilterEntry); + } + //############################################################################################### + + //CONTEXT_EXCLUDE_EXT + if (exFilterCandidateObj.size() > 0 && !exFilterCandidateObj[0].isDir) + { + const Zstring filename = exFilterCandidateObj[0].relativeName.AfterLast(common::FILE_NAME_SEPARATOR); + if (filename.Find(wxChar('.'), false) != Zstring::npos) //be careful: AfterLast would return the whole string if '.' were not found! + { + const Zstring extension = filename.AfterLast(DefaultChar('.')); + + //add context menu item + wxMenuItem* menuItemExclExt = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_EXT, wxString(_("Exclude via filter:")) + wxT(" ") + wxT("*.") + zToWx(extension)); + menuItemExclExt->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmall"))); + contextMenu->Append(menuItemExclExt); + + //connect event + contextMenu->Connect(CONTEXT_EXCLUDE_EXT, + wxEVT_COMMAND_MENU_SELECTED, + wxCommandEventHandler(MainDialog::OnContextExcludeExtension), + new SelectedExtension(extension), //ownership passed! + this); + } + } + + + //CONTEXT_EXCLUDE_OBJ + wxMenuItem* menuItemExclObj = NULL; + if (exFilterCandidateObj.size() == 1) + menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + zToWx(exFilterCandidateObj[0].relativeName.AfterLast(common::FILE_NAME_SEPARATOR))); + else if (exFilterCandidateObj.size() > 1) + menuItemExclObj = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_OBJ, wxString(_("Exclude via filter:")) + wxT(" ") + _("")); + + if (menuItemExclObj != NULL) + { + menuItemExclObj->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmall"))); + contextMenu->Append(menuItemExclObj); + + //connect event + contextMenu->Connect(CONTEXT_EXCLUDE_OBJ, + wxEVT_COMMAND_MENU_SELECTED, + wxCommandEventHandler(MainDialog::OnContextExcludeObject), + new FilterObjContainer(exFilterCandidateObj), //ownership passed! + this); + } + + + + //CONTEXT_EXTERNAL_APP + if (!globalSettings->gui.externelApplications.empty()) + { + contextMenu->AppendSeparator(); + + const bool externalAppEnabled = (m_gridLeft->isLeadGrid() || m_gridRight->isLeadGrid()) && + (selectionLeft.size() + selectionRight.size() == 1); + + int newID = externalAppIDFirst; + for (xmlAccess::ExternalApps::iterator i = globalSettings->gui.externelApplications.begin(); + i != globalSettings->gui.externelApplications.end(); + ++i, ++newID) + { + //some trick to translate default external apps on the fly: 1. "open in explorer" 2. "start directly" + wxString description = wxGetTranslation(i->first); + if (description.empty()) + description = wxT(" "); //wxWidgets doesn't like empty items + + if (i == globalSettings->gui.externelApplications.begin()) + contextMenu->Append(newID, description + wxT("\t") + wxString(_("D-Click")) + wxT("; ENTER")); + else + contextMenu->Append(newID, description); + + contextMenu->Enable(newID, externalAppEnabled); + + //register event + contextMenu->Connect(newID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextOpenWith), NULL, this); + } + } + + + contextMenu->AppendSeparator(); + + + //CONTEXT_CLIPBOARD + contextMenu->Append(CONTEXT_CLIPBOARD, _("Copy to clipboard\tCTRL+C")); + + if ( (m_gridLeft->isLeadGrid() && selectionLeft.size()) || + (m_gridRight->isLeadGrid() && selectionRight.size())) + contextMenu->Enable(CONTEXT_CLIPBOARD, true); + else + contextMenu->Enable(CONTEXT_CLIPBOARD, false); + + + //CONTEXT_DELETE_FILES + contextMenu->Append(CONTEXT_DELETE_FILES, _("Delete files\tDEL")); + + if (selectionLeft.size() + selectionRight.size() == 0) + contextMenu->Enable(CONTEXT_DELETE_FILES, false); + + + //############################################################################################### + //connect events + contextMenu->Connect(CONTEXT_FILTER_TEMP, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextFilterTemp), NULL, this); + contextMenu->Connect(CONTEXT_CLIPBOARD, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCopyClipboard), NULL, this); + contextMenu->Connect(CONTEXT_DELETE_FILES, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextDeleteFiles), NULL, this); + contextMenu->Connect(CONTEXT_SYNC_DIR_LEFT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirLeft), NULL, this); + contextMenu->Connect(CONTEXT_SYNC_DIR_NONE, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirNone), NULL, this); + contextMenu->Connect(CONTEXT_SYNC_DIR_RIGHT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirRight), NULL, this); + + //show context menu + PopupMenu(contextMenu.get()); +} + + +void MainDialog::OnContextFilterTemp(wxCommandEvent& event) +{ + //merge selections from left and right grid + std::set selection = getSelectedRows(); + if (!selection.empty()) + filterRangeManually(selection, static_cast(*selection.begin())); +} + + +void MainDialog::OnContextExcludeExtension(wxCommandEvent& event) +{ + SelectedExtension* selExtension = dynamic_cast(event.m_callbackUserData); + if (selExtension) + { + const Zstring newExclude = Zstring(DefaultStr("*.")) + selExtension->extension; + + //add to filter config + Zstring& excludeFilter = currentCfg.mainCfg.globalFilter.excludeFilter; + if (!excludeFilter.empty() && !excludeFilter.EndsWith(DefaultStr(";"))) + excludeFilter += DefaultStr("\n"); + excludeFilter += newExclude + DefaultStr(";"); //';' is appended to 'mark' that next exclude extension entry won't write to new line + + updateFilterButtons(); + + //do not fully apply filter, just exclude new items + addExcludeFiltering(newExclude, gridDataView->getDataTentative()); + //applyFiltering(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); + updateGuiGrid(); + + if (currentCfg.hideFilteredElements) + { + m_gridLeft-> ClearSelection(); + m_gridRight-> ClearSelection(); + m_gridMiddle->ClearSelection(); + } + } +} + + +void MainDialog::OnContextExcludeObject(wxCommandEvent& event) +{ + FilterObjContainer* objCont = dynamic_cast(event.m_callbackUserData); + if (objCont) + { + if (objCont->selectedObjects.size() > 0) //check needed to determine if filtering is needed + { + Zstring newExclude; + for (std::vector::const_iterator i = objCont->selectedObjects.begin(); i != objCont->selectedObjects.end(); ++i) + { + if (i != objCont->selectedObjects.begin()) + newExclude += DefaultStr("\n"); + + newExclude += common::FILE_NAME_SEPARATOR + i->relativeName; + if (i->isDir) + newExclude += common::FILE_NAME_SEPARATOR; + } + + //add to filter config + Zstring& excludeFilter = currentCfg.mainCfg.globalFilter.excludeFilter; + if (!excludeFilter.empty() && !excludeFilter.EndsWith(DefaultStr("\n"))) + excludeFilter += DefaultStr("\n"); + excludeFilter += newExclude; + + updateFilterButtons(); + + //do not fully apply filter, just exclude new items + addExcludeFiltering(newExclude, gridDataView->getDataTentative()); + //applyFiltering(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); + updateGuiGrid(); + + if (currentCfg.hideFilteredElements) + { + m_gridLeft->ClearSelection(); + m_gridRight->ClearSelection(); + m_gridMiddle->ClearSelection(); + } + } + } +} + + +void MainDialog::OnContextCopyClipboard(wxCommandEvent& event) +{ + if (m_gridLeft->isLeadGrid()) + copySelectionToClipboard(m_gridLeft); + else if (m_gridRight->isLeadGrid()) + copySelectionToClipboard(m_gridRight); +} + + +void MainDialog::OnContextOpenWith(wxCommandEvent& event) +{ + if (m_gridLeft->isLeadGrid() || m_gridRight->isLeadGrid()) + { + const CustomGrid* leadGrid = m_gridLeft->isLeadGrid() ? + static_cast(m_gridLeft) : + static_cast(m_gridRight); + std::set selection = getSelectedRows(leadGrid); + + const int index = event.GetId() - externalAppIDFirst; + + if ( selection.size() == 1 && + 0 <= index && static_cast(index) < globalSettings->gui.externelApplications.size()) + openExternalApplication(*selection.begin(), m_gridLeft->isLeadGrid(), globalSettings->gui.externelApplications[index].second); + } +} + + +void MainDialog::OnContextDeleteFiles(wxCommandEvent& event) +{ + deleteSelectedFiles(); +} + + +void MainDialog::OnContextSyncDirLeft(wxCommandEvent& event) +{ + //merge selections from left and right grid + const std::set selection = getSelectedRows(); + setSyncDirManually(selection, ffs3::SYNC_DIR_LEFT); +} + + +void MainDialog::OnContextSyncDirNone(wxCommandEvent& event) +{ + //merge selections from left and right grid + const std::set selection = getSelectedRows(); + setSyncDirManually(selection, ffs3::SYNC_DIR_NONE); +} + + +void MainDialog::OnContextSyncDirRight(wxCommandEvent& event) +{ + //merge selections from left and right grid + const std::set selection = getSelectedRows(); + setSyncDirManually(selection, ffs3::SYNC_DIR_RIGHT); +} + + +void MainDialog::OnContextRimLabelLeft(wxGridEvent& event) +{ + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_LEFT, _("Customize...")); + + contextMenu->AppendSeparator(); + + wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_LEFT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); + contextMenu->Append(itemAutoAdjust); + itemAutoAdjust->Check(globalSettings->gui.autoAdjustColumnsLeft); + + contextMenu->Connect(CONTEXT_CUSTOMIZE_COLUMN_LEFT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCustColumnLeft), NULL, this); + contextMenu->Connect(CONTEXT_AUTO_ADJUST_COLUMN_LEFT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextAutoAdjustLeft), NULL, this); + + PopupMenu(contextMenu.get()); //show context menu +} + + +void MainDialog::OnContextRimLabelRight(wxGridEvent& event) +{ + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, _("Customize...")); + + contextMenu->AppendSeparator(); + + wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_RIGHT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); + contextMenu->Append(itemAutoAdjust); + itemAutoAdjust->Check(globalSettings->gui.autoAdjustColumnsRight); + + contextMenu->Connect(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCustColumnRight), NULL, this); + contextMenu->Connect(CONTEXT_AUTO_ADJUST_COLUMN_RIGHT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextAutoAdjustRight), NULL, this); + + PopupMenu(contextMenu.get()); //show context menu +} + + +void MainDialog::OnContextCustColumnLeft(wxCommandEvent& event) +{ + xmlAccess::ColumnAttributes colAttr = m_gridLeft->getColumnAttributes(); + + if (ffs3::showCustomizeColsDlg(colAttr) == DefaultReturnCode::BUTTON_OKAY) + { + m_gridLeft->setColumnAttributes(colAttr); + + m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); //hide sort direction indicator on GUI grids + m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + } +} + + +void MainDialog::OnContextCustColumnRight(wxCommandEvent& event) +{ + xmlAccess::ColumnAttributes colAttr = m_gridRight->getColumnAttributes(); + + if (ffs3::showCustomizeColsDlg(colAttr) == DefaultReturnCode::BUTTON_OKAY) + { + m_gridRight->setColumnAttributes(colAttr); + + m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); //hide sort direction indicator on GUI grids + m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + } +} + + +void MainDialog::OnContextAutoAdjustLeft(wxCommandEvent& event) +{ + globalSettings->gui.autoAdjustColumnsLeft = !globalSettings->gui.autoAdjustColumnsLeft; + updateGuiGrid(); +} + + +void MainDialog::OnContextAutoAdjustRight(wxCommandEvent& event) +{ + globalSettings->gui.autoAdjustColumnsRight = !globalSettings->gui.autoAdjustColumnsRight; + updateGuiGrid(); +} + + +void MainDialog::OnContextMiddle(wxGridEvent& event) +{ + contextMenu.reset(new wxMenu); //re-create context menu + + contextMenu->Append(CONTEXT_CHECK_ALL, _("Include all rows")); + contextMenu->Append(CONTEXT_UNCHECK_ALL, _("Exclude all rows")); + + if (gridDataView->rowsTotal() == 0) + { + contextMenu->Enable(CONTEXT_CHECK_ALL, false); + contextMenu->Enable(CONTEXT_UNCHECK_ALL, false); + } + + contextMenu->Connect(CONTEXT_CHECK_ALL, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextIncludeAll), NULL, this); + contextMenu->Connect(CONTEXT_UNCHECK_ALL, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextExcludeAll), NULL, this); + + PopupMenu(contextMenu.get()); //show context menu +} + + +void MainDialog::OnContextMiddleLabel(wxGridEvent& event) +{ + contextMenu.reset(new wxMenu); //re-create context menu + + wxMenuItem* itemSyncPreview = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_PREVIEW, _("Synchronization Preview")); + wxMenuItem* itemCmpResult = new wxMenuItem(contextMenu.get(), CONTEXT_COMPARISON_RESULT, _("Comparison Result")); + + if (syncPreview->previewIsEnabled()) + itemSyncPreview->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("syncViewSmall"))); + else + itemCmpResult->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("cmpViewSmall"))); + + contextMenu->Append(itemCmpResult); + contextMenu->Append(itemSyncPreview); + + contextMenu->Connect(CONTEXT_SYNC_PREVIEW, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncView), NULL, this); + contextMenu->Connect(CONTEXT_COMPARISON_RESULT, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextComparisonView), NULL, this); + + PopupMenu(contextMenu.get()); //show context menu +} + + +void MainDialog::OnContextIncludeAll(wxCommandEvent& event) +{ + ffs3::setActiveStatus(true, gridDataView->getDataTentative()); + refreshGridAfterFilterChange(0); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts break; +} + + +void MainDialog::OnContextExcludeAll(wxCommandEvent& event) +{ + ffs3::setActiveStatus(false, gridDataView->getDataTentative()); + refreshGridAfterFilterChange(400); //call this instead of updateGuiGrid() to add some delay if hideFiltered == true and to handle some graphical artifacts +} + + +void MainDialog::OnContextComparisonView(wxCommandEvent& event) +{ + syncPreview->enablePreview(false); //change view +} + + +void MainDialog::OnContextSyncView(wxCommandEvent& event) +{ + syncPreview->enablePreview(true); //change view +} + + +void MainDialog::OnDirSelected(wxFileDirPickerEvent& event) +{ + //left and right directory text-control and dirpicker are synchronized by MainFolderDragDrop automatically + + //disable the sync button + syncPreview->enableSynchronization(false); + + //clear grids + gridDataView->clearAllRows(); + updateGuiGrid(); + + event.Skip(); +} + + +wxString getFormattedHistoryElement(const wxString& filename) +{ + wxString output = wxFileName(filename).GetFullName(); + if (output.EndsWith(wxT(".ffs_gui"))) + output = output.BeforeLast('.'); + return output; +} + + +//tests if the same filenames are specified, even if they are relative to the current working directory/include symlinks or \\?\ prefix +class FindDuplicates +{ +public: + FindDuplicates(const Zstring& name) : m_name(name) {} + + bool operator()(const wxString& other) const + { + return util::sameFileSpecified(m_name, wxToZ(other)); + } + +private: + const Zstring& m_name; +}; + + +void MainDialog::addFileToCfgHistory(const wxString& filename) +{ + //only (still) existing files should be included in the list + if (util::fileExists(wxToZ(filename), 200) == util::EXISTING_FALSE) //potentially slow network access: wait 200ms + return; + + std::vector::const_iterator i = find_if(cfgFileNames.begin(), cfgFileNames.end(), FindDuplicates(wxToZ(filename))); + if (i != cfgFileNames.end()) + { + //if entry is in the list, then jump to element + m_choiceHistory->SetSelection(i - cfgFileNames.begin()); + } + else + { + cfgFileNames.insert(cfgFileNames.begin(), filename); + + //the default config file should receive another name on GUI + if (util::sameFileSpecified(wxToZ(lastConfigFileName()), wxToZ(filename))) + m_choiceHistory->Insert(_(""), 0); //insert at beginning of list + else + m_choiceHistory->Insert(getFormattedHistoryElement(filename), 0); //insert at beginning of list + + m_choiceHistory->SetSelection(0); + } + + //keep maximal size of history list + if (cfgFileNames.size() > globalSettings->gui.cfgHistoryMax) + { + //delete last rows + cfgFileNames.pop_back(); + m_choiceHistory->Delete(globalSettings->gui.cfgHistoryMax); + } +} + + +void MainDialog::addLeftFolderToHistory(const wxString& leftFolder) +{ + m_directoryLeft->addPairToFolderHistory(leftFolder, globalSettings->gui.folderHistLeftMax); +} + + +void MainDialog::addRightFolderToHistory(const wxString& rightFolder) +{ + m_directoryRight->addPairToFolderHistory(rightFolder, globalSettings->gui.folderHistRightMax); +} + + +void MainDialog::OnSaveConfig(wxCommandEvent& event) +{ + trySaveConfig(); +} + + +bool MainDialog::trySaveConfig() //return true if saved successfully +{ + wxString defaultFileName = currentConfigFileName.empty() ? wxT("SyncSettings.ffs_gui") : currentConfigFileName; + //attention: currentConfigFileName may be an imported *.ffs_batch file! We don't want to overwrite it with a GUI config! + if (defaultFileName.EndsWith(wxT(".ffs_batch"))) + defaultFileName.Replace(wxT(".ffs_batch"), wxT(".ffs_gui"), false); + + + wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("FreeFileSync configuration")) + wxT(" (*.ffs_gui)|*.ffs_gui"), wxFD_SAVE); + if (filePicker->ShowModal() == wxID_OK) + { + const wxString newFileName = filePicker->GetPath(); + + if (ffs3::fileExists(wxToZ(newFileName))) + { + QuestionDlg* messageDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, + wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\"")); + + if (messageDlg->ShowModal() != QuestionDlg::BUTTON_YES) + return trySaveConfig(); //retry + } + + if (writeConfigurationToXml(newFileName)) + { + pushStatusInformation(_("Configuration saved!")); + return true; + } + } + + return false; +} + + +void MainDialog::OnLoadConfig(wxCommandEvent& event) +{ + wxFileDialog* filePicker = new wxFileDialog(this, + wxEmptyString, + wxEmptyString, + wxEmptyString, + wxString(_("FreeFileSync configuration")) + wxT(" (*.ffs_gui;*.ffs_batch)|*.ffs_gui;*.ffs_batch"), wxFD_OPEN); + + if (filePicker->ShowModal() == wxID_OK) + loadConfiguration(filePicker->GetPath()); +} + + +void MainDialog::OnNewConfig(wxCommandEvent& event) +{ + if (!saveOldConfig()) //notify user about changed settings + return; + + setCurrentConfiguration(xmlAccess::XmlGuiConfig()); + + SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); + currentConfigFileName.clear(); +} + + +void MainDialog::OnLoadFromHistory(wxCommandEvent& event) +{ + const int selectedItem = m_choiceHistory->GetSelection(); + if (0 <= selectedItem && unsigned(selectedItem) < cfgFileNames.size()) + loadConfiguration(cfgFileNames[selectedItem]); +} + + +bool MainDialog::saveOldConfig() //return false on user abort +{ + //notify user about changed settings + if (globalSettings->optDialogs.popupOnConfigChange && !currentConfigFileName.empty()) //only if check is active and non-default config file loaded + { + if (lastConfigurationSaved != getCurrentConfiguration()) + { + bool dontShowAgain = !globalSettings->optDialogs.popupOnConfigChange; + + QuestionDlg* notifyChangeDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_NO | QuestionDlg::BUTTON_CANCEL, + _("Save changes to current configuration?"), + &dontShowAgain); + + switch (notifyChangeDlg->ShowModal()) + { + case QuestionDlg::BUTTON_YES: + if (!trySaveConfig()) + return false; + break; + case QuestionDlg::BUTTON_NO: + globalSettings->optDialogs.popupOnConfigChange = !dontShowAgain; + break; + case QuestionDlg::BUTTON_CANCEL: + return false; + } + } + } + return true; +} + + +void MainDialog::loadConfiguration(const wxString& filename) +{ + if (!filename.IsEmpty()) + { + if (!saveOldConfig()) + return; + + if (readConfigurationFromXml(filename)) + pushStatusInformation(_("Configuration loaded!")); + } +} + + +void MainDialog::OnCfgHistoryKeyEvent(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + if (keyCode == WXK_DELETE || keyCode == WXK_NUMPAD_DELETE) + { + //try to delete the currently selected config history item + const int selectedItem = m_choiceHistory->GetCurrentSelection(); + if ( 0 <= selectedItem && + selectedItem < int(m_choiceHistory->GetCount()) && + selectedItem < int(cfgFileNames.size())) + { + //delete selected row + cfgFileNames.erase(cfgFileNames.begin() + selectedItem); + m_choiceHistory->Delete(selectedItem); + } + } + event.Skip(); +} + + +void MainDialog::OnClose(wxCloseEvent &event) +{ + if (!saveOldConfig()) //notify user about changed settings + return; + + Destroy(); +} + + +void MainDialog::OnQuit(wxCommandEvent &event) +{ + if (!saveOldConfig()) //notify user about changed settings + return; + + Destroy(); +} + + +void MainDialog::OnCheckRows(FFSCheckRowsEvent& event) +{ + const int lowerBound = std::min(event.rowFrom, event.rowTo); + const int upperBound = std::max(event.rowFrom, event.rowTo); + + if (0 <= lowerBound) + { + std::set selectedRowsOnView; + + for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView->rowsOnView()) - 1); ++i) + selectedRowsOnView.insert(i); + + filterRangeManually(selectedRowsOnView, event.rowFrom); + } +} + + +void MainDialog::OnSetSyncDirection(FFSSyncDirectionEvent& event) +{ + const int lowerBound = std::min(event.rowFrom, event.rowTo); + const int upperBound = std::max(event.rowFrom, event.rowTo); + + if (0 <= lowerBound) + { + for (int i = lowerBound; i <= std::min(upperBound, int(gridDataView->rowsOnView()) - 1); ++i) + { + FileSystemObject* fsObj = gridDataView->getObject(i); + if (fsObj) + { + setSyncDirectionRec(event.direction, *fsObj); //set new direction (recursively) + ffs3::setActiveStatus(true, *fsObj); //works recursively for directories + } + } + + updateGuiGrid(); + } +} + + +bool MainDialog::readConfigurationFromXml(const wxString& filename) +{ + //load XML + xmlAccess::XmlGuiConfig newGuiCfg; //structure to receive gui settings, already defaulted!! + bool parsingError = true; + try + { + //allow reading batch configurations also + std::vector filenames; + filenames.push_back(filename); + + xmlAccess::convertConfig(filenames, newGuiCfg); //throw (xmlAccess::XmlError) + + parsingError = false; + } + catch (const xmlAccess::XmlError& error) + { + if (error.getSeverity() == xmlAccess::XmlError::WARNING) + wxMessageBox(error.msg(), _("Warning"), wxOK | wxICON_WARNING); + else + { + wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); + return false; + } + } + + setCurrentConfiguration(newGuiCfg); + + setLastUsedConfig(filename, parsingError ? xmlAccess::XmlGuiConfig() : newGuiCfg); //simulate changed config on parsing errors + + return !parsingError; +} + + +void MainDialog::setLastUsedConfig(const wxString& filename, const xmlAccess::XmlGuiConfig& guiConfig) +{ + addFileToCfgHistory(filename); //put filename on list of last used config files + + //set title + if (filename == lastConfigFileName()) + { + SetTitle(wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")); + currentConfigFileName.clear(); + } + else + { + SetTitle(wxString(wxT("FreeFileSync - ")) + filename); + currentConfigFileName = filename; + } + + lastConfigurationSaved = guiConfig; +} + + +bool MainDialog::writeConfigurationToXml(const wxString& filename) +{ + const xmlAccess::XmlGuiConfig guiCfg = getCurrentConfiguration(); + + //write config to XML + try + { + xmlAccess::writeConfig(guiCfg, filename); + } + catch (const xmlAccess::XmlError& error) + { + wxMessageBox(error.msg().c_str(), _("Error"), wxOK | wxICON_ERROR); + return false; + } + + setLastUsedConfig(filename, guiCfg); + + return true; +} + + +void MainDialog::setCurrentConfiguration(const xmlAccess::XmlGuiConfig& newGuiCfg) +{ + currentCfg = newGuiCfg; + + //evaluate new settings... + + //disable the sync button + syncPreview->enableSynchronization(false); + + //clear grids + gridDataView->clearAllRows(); + updateGuiGrid(); + + //(re-)set view filter buttons + initViewFilterButtons(); + + updateFilterButtons(); + + //set first folder pair + firstFolderPair->setValues(currentCfg.mainCfg.firstPair.leftDirectory, + currentCfg.mainCfg.firstPair.rightDirectory, + currentCfg.mainCfg.firstPair.altSyncConfig, + currentCfg.mainCfg.firstPair.localFilter); + + addLeftFolderToHistory( zToWx(currentCfg.mainCfg.firstPair.leftDirectory)); //another hack: wxCombobox::Insert() asynchronously sends message + addRightFolderToHistory(zToWx(currentCfg.mainCfg.firstPair.rightDirectory)); //overwriting a later wxCombobox::SetValue()!!! :( + + //clear existing additional folder pairs + clearAddFolderPairs(); + + //set additional pairs + addFolderPair(currentCfg.mainCfg.additionalPairs); + + + //read GUI layout + m_checkBoxHideFilt->SetValue(currentCfg.hideFilteredElements); + + syncPreview->enablePreview(currentCfg.syncPreviewEnabled); + + //########################################################### + //update compare variant name + m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); + + //update sync variant name + m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + currentCfg.mainCfg.getSyncVariantName() + wxT(")")); + bSizer6->Layout(); //adapt layout for variant text +} + + +inline +FolderPairEnh getEnahncedPair(const FolderPairPanel* panel) +{ + return FolderPairEnh(panel->getLeftDir(), + panel->getRightDir(), + panel->getAltSyncConfig(), + panel->getAltFilterConfig()); +} + + +xmlAccess::XmlGuiConfig MainDialog::getCurrentConfiguration() const +{ + xmlAccess::XmlGuiConfig guiCfg = currentCfg; + + //load settings whose ownership lies not in currentCfg: + + //first folder pair + guiCfg.mainCfg.firstPair = FolderPairEnh(firstFolderPair->getLeftDir(), + firstFolderPair->getRightDir(), + firstFolderPair->getAltSyncConfig(), + firstFolderPair->getAltFilterConfig()); + + //add additional pairs + guiCfg.mainCfg.additionalPairs.clear(); + std::transform(additionalFolderPairs.begin(), additionalFolderPairs.end(), + std::back_inserter(guiCfg.mainCfg.additionalPairs), getEnahncedPair); + + //sync preview + guiCfg.syncPreviewEnabled = syncPreview->previewIsEnabled(); + + return guiCfg; +} + + +const wxString& MainDialog::lastConfigFileName() +{ + static wxString instance = ffs3::getConfigDir() + wxT("LastRun.ffs_gui"); + return instance; +} + + +void MainDialog::refreshGridAfterFilterChange(const int delay) +{ + //signal UI that grids need to be refreshed on next Update() + m_gridLeft->ForceRefresh(); + m_gridMiddle->ForceRefresh(); + m_gridRight->ForceRefresh(); + Update(); //show changes resulting from ForceRefresh() + + if (currentCfg.hideFilteredElements) + { + wxMilliSleep(delay); //some delay to show user the rows he has filtered out before they are removed + updateGuiGrid(); //redraw grid to remove excluded elements (keeping sort sequence) + + m_gridLeft->ClearSelection(); + m_gridRight->ClearSelection(); + } + else + updateGuiGrid(); +} + + +void MainDialog::OnHideFilteredButton(wxCommandEvent &event) +{ + //toggle showing filtered rows + currentCfg.hideFilteredElements = !currentCfg.hideFilteredElements; + //make sure, checkbox and "hideFiltered" are in sync + m_checkBoxHideFilt->SetValue(currentCfg.hideFilteredElements); + + m_gridLeft->ClearSelection(); + m_gridRight->ClearSelection(); + updateGuiGrid(); + +// event.Skip(); +} + + +void MainDialog::OnConfigureFilter(wxCommandEvent &event) +{ + if (showFilterDialog(true, //is main filter dialog + currentCfg.mainCfg.globalFilter.includeFilter, + currentCfg.mainCfg.globalFilter.excludeFilter) == DefaultReturnCode::BUTTON_OKAY) + { + updateFilterButtons(); //refresh global filter icon + updateFilterConfig(); //re-apply filter + } + + //event.Skip() +} + + +void MainDialog::OnGlobalFilterOpenContext(wxCommandEvent& event) +{ + const int menuId = 1234; + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(menuId, _("Clear filter settings")); + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnGlobalFilterRemConfirm), NULL, this); + + if (isNullFilter(currentCfg.mainCfg.globalFilter)) + contextMenu->Enable(menuId, false); //disable menu item, if clicking wouldn't make sense anyway + + PopupMenu(contextMenu.get()); //show context menu +} + + +void MainDialog::OnGlobalFilterRemConfirm(wxCommandEvent& event) +{ + currentCfg.mainCfg.globalFilter = FilterConfig(); + + updateFilterButtons(); //refresh global filter icon + updateFilterConfig(); //re-apply filter +} + + +void MainDialog::OnLeftOnlyFiles(wxCommandEvent& event) +{ + m_bpButtonLeftOnly->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnLeftNewerFiles(wxCommandEvent& event) +{ + m_bpButtonLeftNewer->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnDifferentFiles(wxCommandEvent& event) +{ + m_bpButtonDifferent->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnRightNewerFiles(wxCommandEvent& event) +{ + m_bpButtonRightNewer->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnRightOnlyFiles(wxCommandEvent& event) +{ + m_bpButtonRightOnly->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnEqualFiles(wxCommandEvent& event) +{ + m_bpButtonEqual->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnConflictFiles(wxCommandEvent& event) +{ + m_bpButtonConflict->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncCreateLeft(wxCommandEvent& event) +{ + m_bpButtonSyncCreateLeft->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncCreateRight(wxCommandEvent& event) +{ + m_bpButtonSyncCreateRight->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncDeleteLeft(wxCommandEvent& event) +{ + m_bpButtonSyncDeleteLeft->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncDeleteRight(wxCommandEvent& event) +{ + m_bpButtonSyncDeleteRight->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncDirLeft(wxCommandEvent& event) +{ + m_bpButtonSyncDirOverwLeft->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncDirRight(wxCommandEvent& event) +{ + m_bpButtonSyncDirOverwRight->toggle(); + updateGuiGrid(); +} + + +void MainDialog::OnSyncDirNone(wxCommandEvent& event) +{ + m_bpButtonSyncDirNone->toggle(); + updateGuiGrid(); +} + + +void MainDialog::initViewFilterButtons() +{ + //compare result buttons + m_bpButtonLeftOnly->init(GlobalResources::getInstance().getImageByName(wxT("leftOnlyAct")), + _("Hide files that exist on left side only"), + GlobalResources::getInstance().getImageByName(wxT("leftOnlyDeact")), + _("Show files that exist on left side only")); + + m_bpButtonRightOnly->init(GlobalResources::getInstance().getImageByName(wxT("rightOnlyAct")), + _("Hide files that exist on right side only"), + GlobalResources::getInstance().getImageByName(wxT("rightOnlyDeact")), + _("Show files that exist on right side only")); + + m_bpButtonLeftNewer->init(GlobalResources::getInstance().getImageByName(wxT("leftNewerAct")), + _("Hide files that are newer on left"), + GlobalResources::getInstance().getImageByName(wxT("leftNewerDeact")), + _("Show files that are newer on left")); + + m_bpButtonRightNewer->init(GlobalResources::getInstance().getImageByName(wxT("rightNewerAct")), + _("Hide files that are newer on right"), + GlobalResources::getInstance().getImageByName(wxT("rightNewerDeact")), + _("Show files that are newer on right")); + + m_bpButtonEqual->init(GlobalResources::getInstance().getImageByName(wxT("equalAct")), + _("Hide files that are equal"), + GlobalResources::getInstance().getImageByName(wxT("equalDeact")), + _("Show files that are equal")); + + m_bpButtonDifferent->init(GlobalResources::getInstance().getImageByName(wxT("differentAct")), + _("Hide files that are different"), + GlobalResources::getInstance().getImageByName(wxT("differentDeact")), + _("Show files that are different")); + + m_bpButtonConflict->init(GlobalResources::getInstance().getImageByName(wxT("conflictAct")), + _("Hide conflicts"), + GlobalResources::getInstance().getImageByName(wxT("conflictDeact")), + _("Show conflicts")); + + //sync preview buttons + m_bpButtonSyncCreateLeft->init(GlobalResources::getInstance().getImageByName(wxT("syncCreateLeftAct")), + _("Hide files that will be created on the left side"), + GlobalResources::getInstance().getImageByName(wxT("syncCreateLeftDeact")), + _("Show files that will be created on the left side")); + + m_bpButtonSyncCreateRight->init(GlobalResources::getInstance().getImageByName(wxT("syncCreateRightAct")), + _("Hide files that will be created on the right side"), + GlobalResources::getInstance().getImageByName(wxT("syncCreateRightDeact")), + _("Show files that will be created on the right side")); + + m_bpButtonSyncDeleteLeft->init(GlobalResources::getInstance().getImageByName(wxT("syncDeleteLeftAct")), + _("Hide files that will be deleted on the left side"), + GlobalResources::getInstance().getImageByName(wxT("syncDeleteLeftDeact")), + _("Show files that will be deleted on the left side")); + + m_bpButtonSyncDeleteRight->init(GlobalResources::getInstance().getImageByName(wxT("syncDeleteRightAct")), + _("Hide files that will be deleted on the right side"), + GlobalResources::getInstance().getImageByName(wxT("syncDeleteRightDeact")), + _("Show files that will be deleted on the right side")); + + m_bpButtonSyncDirOverwLeft->init(GlobalResources::getInstance().getImageByName(wxT("syncDirLeftAct")), + _("Hide files that will be overwritten on left side"), + GlobalResources::getInstance().getImageByName(wxT("syncDirLeftDeact")), + _("Show files that will be overwritten on left side")); + + m_bpButtonSyncDirOverwRight->init(GlobalResources::getInstance().getImageByName(wxT("syncDirRightAct")), + _("Hide files that will be overwritten on right side"), + GlobalResources::getInstance().getImageByName(wxT("syncDirRightDeact")), + _("Show files that will be overwritten on right side")); + + m_bpButtonSyncDirNone->init(GlobalResources::getInstance().getImageByName(wxT("syncDirNoneAct")), + _("Hide files that won't be copied"), + GlobalResources::getInstance().getImageByName(wxT("syncDirNoneDeact")), + _("Show files that won't be copied")); + + //compare result buttons + m_bpButtonLeftOnly-> setActive(true); + m_bpButtonRightOnly-> setActive(true); + m_bpButtonLeftNewer-> setActive(true); + m_bpButtonRightNewer->setActive(true); + m_bpButtonEqual-> setActive(false); + m_bpButtonDifferent-> setActive(true); + m_bpButtonConflict-> setActive(true); + + //sync preview buttons + m_bpButtonSyncCreateLeft-> setActive(true); + m_bpButtonSyncCreateRight-> setActive(true); + m_bpButtonSyncDeleteLeft-> setActive(true); + m_bpButtonSyncDeleteRight-> setActive(true); + m_bpButtonSyncDirOverwLeft-> setActive(true); + m_bpButtonSyncDirOverwRight->setActive(true); + m_bpButtonSyncDirNone-> setActive(true); +} + + +void MainDialog::updateFilterButtons() +{ + //prepare filter icon + if (m_notebookBottomLeft->GetImageList() == NULL) + { + wxImageList* panelIcons = new wxImageList(16, 16); + panelIcons->Add(wxBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmall")))); + panelIcons->Add(wxBitmap(GlobalResources::getInstance().getImageByName(wxT("filterSmallGrey")))); + m_notebookBottomLeft->AssignImageList(panelIcons); //pass ownership + } + + //global filter: test for Null-filter + if (isNullFilter(currentCfg.mainCfg.globalFilter)) + { + m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOff"))); + m_bpButtonFilter->SetToolTip(_("No filter selected")); + + //additional filter icon + m_notebookBottomLeft->SetPageImage(1, 1); + } + else + { + m_bpButtonFilter->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("filterOn"))); + m_bpButtonFilter->SetToolTip(_("Filter is active")); + + //show filter icon + m_notebookBottomLeft->SetPageImage(1, 0); + } + + //update main local filter + firstFolderPair->refreshButtons(); + + //update folder pairs + for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + { + FolderPairPanel* dirPair = *i; + dirPair->refreshButtons(); + } +} + + +void MainDialog::OnCompare(wxCommandEvent &event) +{ + //PERF_START; + clearStatusBar(); + + wxBusyCursor dummy; //show hourglass cursor + + //prevent temporary memory peak by clearing old result list + gridDataView->clearAllRows(); + updateGuiGrid(); //refresh GUI grid + + bool aborted = false; + try + { + //class handling status display and error messages + CompareStatusHandler statusHandler(this); + + //begin comparison + ffs3::CompareProcess comparison(currentCfg.mainCfg.handleSymlinks, + globalSettings->fileTimeTolerance, + globalSettings->ignoreOneHourDiff, + globalSettings->optDialogs, + &statusHandler); + + //technical representation of comparison data + ffs3::FolderComparison newCompareData; + + comparison.startCompareProcess( + ffs3::extractCompareCfg(getCurrentConfiguration().mainCfg), //call getCurrentCfg() to get current values for directory pairs! + currentCfg.mainCfg.compareVar, + newCompareData); + + gridDataView->setData(newCompareData); //newCompareData is invalidated after this call + + //play (optional) sound notification after sync has completed (GUI and batch mode) + const wxString soundFile = ffs3::getResourceDir() + wxT("Compare_Complete.wav"); + if (fileExists(wxToZ(soundFile))) + wxSound::Play(soundFile, wxSOUND_ASYNC); + } + catch (AbortThisProcess&) + { + aborted = true; + } + + if (aborted) + { + //disable the sync button + syncPreview->enableSynchronization(false); + m_buttonCompare->SetFocus(); + updateGuiGrid(); //refresh grid in ANY case! (also on abort) + } + else + { + //once compare is finished enable the sync button + syncPreview->enableSynchronization(true); + m_buttonStartSync->SetFocus(); + + //hide sort direction indicator on GUI grids + m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + + //reset last sort selection: used for determining sort direction + lastSortColumn = -1; + lastSortGrid = NULL; + + m_gridLeft-> ClearSelection(); + m_gridMiddle->ClearSelection(); + m_gridRight-> ClearSelection(); + + //add to folder history after successful comparison only + addLeftFolderToHistory( m_directoryLeft->GetValue()); + addRightFolderToHistory(m_directoryRight->GetValue()); + + //refresh grid in ANY case! (also on abort) + updateGuiGrid(); + + //prepare status information + wxString statusInfo; + if (allElementsEqual(gridDataView->getDataTentative())) + statusInfo += _("All directories in sync!"); + pushStatusInformation(statusInfo); + } +} + + +void MainDialog::updateGuiGrid() +{ + updateGridViewData(); //update gridDataView and write status information + + //all three grids retrieve their data directly via gridDataView + //the only thing left to do is notify the grids to updafte their sizes (nr of rows), since this has to be communicated by the grids via messages + m_gridLeft ->updateGridSizes(); + m_gridMiddle->updateGridSizes(); + m_gridRight ->updateGridSizes(); + + //enlarge label width to display row numbers correctly + const int nrOfRows = m_gridLeft->GetNumberRows(); + if (nrOfRows >= 0) + { +#ifdef FFS_WIN + const size_t digitWidth = 8; +#elif defined FFS_LINUX + const size_t digitWidth = 10; +#endif + const size_t nrOfDigits = common::getDigitCount(static_cast(nrOfRows)); + m_gridLeft ->SetRowLabelSize(static_cast(nrOfDigits * digitWidth + 4)); + m_gridRight->SetRowLabelSize(static_cast(nrOfDigits * digitWidth + 4)); + } + + //support for column auto adjustment + if (globalSettings->gui.autoAdjustColumnsLeft) + m_gridLeft->autoSizeColumns(); + if (globalSettings->gui.autoAdjustColumnsRight) + m_gridRight->autoSizeColumns(); + + //update sync preview statistics + calculatePreview(); + + m_gridLeft ->Refresh(); + m_gridMiddle->Refresh(); + m_gridRight ->Refresh(); +} + + +void MainDialog::calculatePreview() +{ + //update preview of bytes to be transferred: + const SyncStatistics st(gridDataView->getDataTentative()); + const wxString toCreate = ffs3::numberToStringSep(st.getCreate()); + const wxString toUpdate = ffs3::numberToStringSep(st.getOverwrite()); + const wxString toDelete = ffs3::numberToStringSep(st.getDelete()); + const wxString data = ffs3::formatFilesizeToShortString(st.getDataToProcess()); + + m_textCtrlCreate->SetValue(toCreate); + m_textCtrlUpdate->SetValue(toUpdate); + m_textCtrlDelete->SetValue(toDelete); + m_textCtrlData->SetValue(data); +} + + +void MainDialog::OnSwitchView(wxCommandEvent& event) +{ + //toggle view + syncPreview->enablePreview(!syncPreview->previewIsEnabled()); +} + + +void MainDialog::OnSyncSettings(wxCommandEvent& event) +{ + SyncCfgDialog* syncDlg = new SyncCfgDialog(this, + currentCfg.mainCfg.compareVar, + currentCfg.mainCfg.syncConfiguration, + currentCfg.mainCfg.handleDeletion, + currentCfg.mainCfg.customDeletionDirectory, + ¤tCfg.ignoreErrors); + if (syncDlg->ShowModal() == SyncCfgDialog::BUTTON_APPLY) + updateSyncConfig(); +} + + +void MainDialog::OnCmpSettings(wxCommandEvent& event) +{ + //show window right next to the compare-config button + wxPoint windowPos = m_bpButtonCmpConfig->GetScreenPosition(); + windowPos.x += m_bpButtonCmpConfig->GetSize().GetWidth() + 5; + + if (ffs3::showCompareCfgDialog(windowPos, + currentCfg.mainCfg.compareVar, + currentCfg.mainCfg.handleSymlinks) == DefaultReturnCode::BUTTON_OKAY) + { + //update compare variant name + m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); + bSizer6->Layout(); //adapt layout for variant text + + //disable the sync button + syncPreview->enableSynchronization(false); + + //clear grids + gridDataView->clearAllRows(); + updateGuiGrid(); + + //convenience: change sync view + switch (currentCfg.mainCfg.compareVar) + { + case CMP_BY_TIME_SIZE: + syncPreview->enablePreview(true); + break; + case CMP_BY_CONTENT: + syncPreview->enablePreview(false); + break; + } + + m_buttonCompare->SetFocus(); + } +} + + +void MainDialog::OnStartSync(wxCommandEvent& event) +{ + if (!syncPreview->synchronizationIsEnabled()) + { + pushStatusInformation(_("Please run a Compare first before synchronizing!")); + return; + } + + //show sync preview screen + if (globalSettings->optDialogs.showSummaryBeforeSync) + { + bool dontShowAgain = false; + + if (ffs3::showSyncPreviewDlg( + getCurrentConfiguration().mainCfg.getSyncVariantName(), + ffs3::SyncStatistics(gridDataView->getDataTentative()), + dontShowAgain) != DefaultReturnCode::BUTTON_OKAY) + return; + + globalSettings->optDialogs.showSummaryBeforeSync = !dontShowAgain; + } + + wxBusyCursor dummy; //show hourglass cursor + + clearStatusBar(); + try + { + //PERF_START; + + //class handling status updates and error messages + SyncStatusHandler statusHandler(this, currentCfg.ignoreErrors); + + //check if there are files/folders to be sync'ed at all + if (!synchronizationNeeded(gridDataView->getDataTentative())) + statusHandler.reportInfo(_("Nothing to synchronize according to configuration!")); //inform about this special case + + //start synchronization and mark all elements processed + ffs3::SyncProcess synchronization( + globalSettings->optDialogs, + globalSettings->verifyFileCopy, + globalSettings->copyLockedFiles, + globalSettings->copyFilePermissions, + statusHandler); + + const std::vector syncProcessCfg = ffs3::extractSyncCfg(getCurrentConfiguration().mainCfg); + FolderComparison& dataToSync = gridDataView->getDataTentative(); + + //make sure syncProcessCfg and dataToSync have same size and correspond! + if (syncProcessCfg.size() != dataToSync.size()) + throw std::logic_error("Programming Error: Contract violation!"); //should never happen: sync button is deactivated if they are not in sync + + synchronization.startSynchronizationProcess(syncProcessCfg, dataToSync); + + //play (optional) sound notification after sync has completed (GUI and batch mode) + const wxString soundFile = ffs3::getResourceDir() + wxT("Sync_Complete.wav"); + if (fileExists(wxToZ(soundFile))) + wxSound::Play(soundFile, wxSOUND_ASYNC); + } + catch (AbortThisProcess&) + { + //do NOT disable the sync button: user might want to try to sync the REMAINING rows + } //enableSynchronization(false); + + //remove rows that empty: just a beautification, invalid rows shouldn't cause issues + gridDataView->removeInvalidRows(); + + updateGuiGrid(); + + m_gridLeft-> ClearSelection(); + m_gridMiddle->ClearSelection(); + m_gridRight-> ClearSelection(); +} + + +void MainDialog::OnLeftGridDoubleClick(wxGridEvent& event) +{ + if (!globalSettings->gui.externelApplications.empty()) + openExternalApplication(event.GetRow(), true, globalSettings->gui.externelApplications[0].second); + // event.Skip(); +} + + +void MainDialog::OnRightGridDoubleClick(wxGridEvent& event) +{ + if (!globalSettings->gui.externelApplications.empty()) + openExternalApplication(event.GetRow(), false, globalSettings->gui.externelApplications[0].second); +// event.Skip(); +} + + +void MainDialog::OnSortLeftGrid(wxGridEvent& event) +{ + //determine direction for std::sort() + const int currentSortColumn = event.GetCol(); + if (0 <= currentSortColumn && currentSortColumn < int(xmlAccess::COLUMN_TYPE_COUNT)) + { + static bool sortDefault = true; + if (lastSortColumn != currentSortColumn || lastSortGrid != m_gridLeft) + sortDefault = true; + else + sortDefault = !sortDefault; + + lastSortColumn = currentSortColumn; + lastSortGrid = m_gridLeft; + + GridView::SortType st = GridView::SORT_BY_REL_NAME; + + const xmlAccess::ColumnTypes columnType = m_gridLeft->getTypeAtPos(currentSortColumn); + switch (columnType) + { + case xmlAccess::FULL_PATH: + st = GridView::SORT_BY_REL_NAME; + break; + case xmlAccess::FILENAME: + st = GridView::SORT_BY_FILENAME; + break; + case xmlAccess::REL_PATH: + st = GridView::SORT_BY_REL_NAME; + break; + case xmlAccess::DIRECTORY: + st = GridView::SORT_BY_DIRECTORY; + break; + case xmlAccess::SIZE: + st = GridView::SORT_BY_FILESIZE; + break; + case xmlAccess::DATE: + st = GridView::SORT_BY_DATE; + break; + case xmlAccess::EXTENSION: + st = GridView::SORT_BY_EXTENSION; + break; + } + + const bool sortAscending = sortDefault ? + GridView::getDefaultDirection(st) : + !GridView::getDefaultDirection(st); + + gridDataView->sortView(st, true, sortAscending); + + updateGuiGrid(); //refresh gridDataView + + //set sort direction indicator on UI + m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridLeft->setSortMarker(CustomGrid::SortMarker(currentSortColumn, sortAscending ? CustomGrid::ASCENDING : CustomGrid::DESCENDING)); + } +} + + +void MainDialog::OnSortMiddleGrid(wxGridEvent& event) +{ + //determine direction for std::sort() + static bool sortDefault = true; + if (lastSortColumn != 0 || lastSortGrid != m_gridMiddle) + sortDefault = true; + else + sortDefault = !sortDefault; + lastSortColumn = 0; + lastSortGrid = m_gridMiddle; + + //start sort + if (syncPreview->previewIsEnabled()) + gridDataView->sortView(GridView::SORT_BY_SYNC_DIRECTION, true, sortDefault); + else + gridDataView->sortView(GridView::SORT_BY_CMP_RESULT, true, sortDefault); + + updateGuiGrid(); //refresh gridDataView + + //set sort direction indicator on UI + m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridRight->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridMiddle->setSortMarker(CustomGrid::SortMarker(0, sortDefault ? CustomGrid::ASCENDING : CustomGrid::DESCENDING)); +} + + +void MainDialog::OnSortRightGrid(wxGridEvent& event) +{ + //determine direction for std::sort() + const int currentSortColumn = event.GetCol(); + if (0 <= currentSortColumn && currentSortColumn < int(xmlAccess::COLUMN_TYPE_COUNT)) + { + static bool sortDefault = true; + if (lastSortColumn != currentSortColumn || lastSortGrid != m_gridRight) + sortDefault = true; + else + sortDefault = !sortDefault; + + lastSortColumn = currentSortColumn; + lastSortGrid = m_gridRight; + + GridView::SortType st = GridView::SORT_BY_REL_NAME; + + const xmlAccess::ColumnTypes columnType = m_gridRight->getTypeAtPos(currentSortColumn); + switch (columnType) + { + case xmlAccess::FULL_PATH: + st = GridView::SORT_BY_REL_NAME; + break; + case xmlAccess::FILENAME: + st = GridView::SORT_BY_FILENAME; + break; + case xmlAccess::REL_PATH: + st = GridView::SORT_BY_REL_NAME; + break; + case xmlAccess::DIRECTORY: + st = GridView::SORT_BY_DIRECTORY; + break; + case xmlAccess::SIZE: + st = GridView::SORT_BY_FILESIZE; + break; + case xmlAccess::DATE: + st = GridView::SORT_BY_DATE; + break; + case xmlAccess::EXTENSION: + st = GridView::SORT_BY_EXTENSION; + break; + } + + const bool sortAscending = sortDefault ? + GridView::getDefaultDirection(st) : + !GridView::getDefaultDirection(st); + + gridDataView->sortView(st, false, sortAscending); + + updateGuiGrid(); //refresh gridDataView + + //set sort direction indicator on UI + m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridRight->setSortMarker(CustomGrid::SortMarker(currentSortColumn, sortAscending ? CustomGrid::ASCENDING : CustomGrid::DESCENDING)); + } +} + + +void MainDialog::OnSwapSides(wxCommandEvent& event) +{ + //swap directory names: first pair + firstFolderPair->setValues(firstFolderPair->getRightDir(), // swap directories + firstFolderPair->getLeftDir(), // + firstFolderPair->getAltSyncConfig(), + firstFolderPair->getAltFilterConfig()); + + //additional pairs + for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + { + FolderPairPanel* dirPair = *i; + dirPair->setValues(dirPair->getRightDir(), // swap directories + dirPair->getLeftDir(), // + dirPair->getAltSyncConfig(), + dirPair->getAltFilterConfig()); + } + + //swap view filter + bool tmp = m_bpButtonLeftOnly->isActive(); + m_bpButtonLeftOnly->setActive(m_bpButtonRightOnly->isActive()); + m_bpButtonRightOnly->setActive(tmp); + + tmp = m_bpButtonLeftNewer->isActive(); + m_bpButtonLeftNewer->setActive(m_bpButtonRightNewer->isActive()); + m_bpButtonRightNewer->setActive(tmp); + + + tmp = m_bpButtonSyncCreateLeft->isActive(); + m_bpButtonSyncCreateLeft->setActive(m_bpButtonSyncCreateRight->isActive()); + m_bpButtonSyncCreateRight->setActive(tmp); + + tmp = m_bpButtonSyncDeleteLeft->isActive(); + m_bpButtonSyncDeleteLeft->setActive(m_bpButtonSyncDeleteRight->isActive()); + m_bpButtonSyncDeleteRight->setActive(tmp); + + tmp = m_bpButtonSyncDirOverwLeft->isActive(); + m_bpButtonSyncDirOverwLeft->setActive(m_bpButtonSyncDirOverwRight->isActive()); + m_bpButtonSyncDirOverwRight->setActive(tmp); + + //swap grid information + ffs3::swapGrids(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); + updateGuiGrid(); +} + + +void MainDialog::updateGridViewData() +{ + size_t filesOnLeftView = 0; + size_t foldersOnLeftView = 0; + size_t filesOnRightView = 0; + size_t foldersOnRightView = 0; + wxULongLong filesizeLeftView; + wxULongLong filesizeRightView; + + //disable all buttons per default + m_bpButtonLeftOnly-> Show(false); + m_bpButtonRightOnly-> Show(false); + m_bpButtonLeftNewer-> Show(false); + m_bpButtonRightNewer->Show(false); + m_bpButtonDifferent-> Show(false); + m_bpButtonEqual-> Show(false); + m_bpButtonConflict-> Show(false); + + m_bpButtonSyncCreateLeft-> Show(false); + m_bpButtonSyncCreateRight-> Show(false); + m_bpButtonSyncDeleteLeft-> Show(false); + m_bpButtonSyncDeleteRight-> Show(false); + m_bpButtonSyncDirOverwLeft-> Show(false); + m_bpButtonSyncDirOverwRight->Show(false); + m_bpButtonSyncDirNone-> Show(false); + + + if (syncPreview->previewIsEnabled()) + { + const GridView::StatusSyncPreview result = gridDataView->updateSyncPreview(currentCfg.hideFilteredElements, + m_bpButtonSyncCreateLeft-> isActive(), + m_bpButtonSyncCreateRight-> isActive(), + m_bpButtonSyncDeleteLeft-> isActive(), + m_bpButtonSyncDeleteRight-> isActive(), + m_bpButtonSyncDirOverwLeft-> isActive(), + m_bpButtonSyncDirOverwRight->isActive(), + m_bpButtonSyncDirNone-> isActive(), + m_bpButtonEqual-> isActive(), + m_bpButtonConflict-> isActive()); + + filesOnLeftView = result.filesOnLeftView; + foldersOnLeftView = result.foldersOnLeftView; + filesOnRightView = result.filesOnRightView; + foldersOnRightView = result.foldersOnRightView; + filesizeLeftView = result.filesizeLeftView; + filesizeRightView = result.filesizeRightView; + + + //sync preview buttons + m_bpButtonSyncCreateLeft-> Show(result.existsSyncCreateLeft); + m_bpButtonSyncCreateRight-> Show(result.existsSyncCreateRight); + m_bpButtonSyncDeleteLeft-> Show(result.existsSyncDeleteLeft); + m_bpButtonSyncDeleteRight-> Show(result.existsSyncDeleteRight); + m_bpButtonSyncDirOverwLeft-> Show(result.existsSyncDirLeft); + m_bpButtonSyncDirOverwRight->Show(result.existsSyncDirRight); + m_bpButtonSyncDirNone-> Show(result.existsSyncDirNone); + m_bpButtonEqual-> Show(result.existsSyncEqual); + m_bpButtonConflict-> Show(result.existsConflict); + + if ( m_bpButtonSyncCreateLeft-> IsShown() || + m_bpButtonSyncCreateRight-> IsShown() || + m_bpButtonSyncDeleteLeft-> IsShown() || + m_bpButtonSyncDeleteRight-> IsShown() || + m_bpButtonSyncDirOverwLeft-> IsShown() || + m_bpButtonSyncDirOverwRight->IsShown() || + m_bpButtonSyncDirNone-> IsShown() || + m_bpButtonEqual-> IsShown() || + m_bpButtonConflict-> IsShown()) + { + m_panelViewFilter->Show(); + m_panelViewFilter->Layout(); + } + else + m_panelViewFilter->Hide(); + + } + else + { + const GridView::StatusCmpResult result = gridDataView->updateCmpResult(currentCfg.hideFilteredElements, + m_bpButtonLeftOnly-> isActive(), + m_bpButtonRightOnly-> isActive(), + m_bpButtonLeftNewer-> isActive(), + m_bpButtonRightNewer->isActive(), + m_bpButtonDifferent-> isActive(), + m_bpButtonEqual-> isActive(), + m_bpButtonConflict-> isActive()); + + filesOnLeftView = result.filesOnLeftView; + foldersOnLeftView = result.foldersOnLeftView; + filesOnRightView = result.filesOnRightView; + foldersOnRightView = result.foldersOnRightView; + filesizeLeftView = result.filesizeLeftView; + filesizeRightView = result.filesizeRightView; + + //comparison result view buttons + m_bpButtonLeftOnly-> Show(result.existsLeftOnly); + m_bpButtonRightOnly-> Show(result.existsRightOnly); + m_bpButtonLeftNewer-> Show(result.existsLeftNewer); + m_bpButtonRightNewer->Show(result.existsRightNewer); + m_bpButtonDifferent-> Show(result.existsDifferent); + m_bpButtonEqual-> Show(result.existsEqual); + m_bpButtonConflict-> Show(result.existsConflict); + + if ( m_bpButtonLeftOnly-> IsShown() || + m_bpButtonRightOnly-> IsShown() || + m_bpButtonLeftNewer-> IsShown() || + m_bpButtonRightNewer->IsShown() || + m_bpButtonDifferent-> IsShown() || + m_bpButtonEqual-> IsShown() || + m_bpButtonConflict-> IsShown()) + { + m_panelViewFilter->Show(); + m_panelViewFilter->Layout(); + } + else + m_panelViewFilter->Hide(); + } + + + bSizer3->Layout(); + + //update status information + clearStatusBar(); + + + wxString statusLeftNew; + wxString statusMiddleNew; + wxString statusRightNew; + +//################################################# +//format numbers to text: + +//show status information on "root" level. + if (foldersOnLeftView) + { + if (foldersOnLeftView == 1) + statusLeftNew += _("1 directory"); + else + { + wxString folderCount = ffs3::numberToStringSep(foldersOnLeftView); + + wxString outputString = _("%x directories"); + outputString.Replace(wxT("%x"), folderCount, false); + statusLeftNew += outputString; + } + + if (filesOnLeftView) + statusLeftNew += wxT(" - "); + } + + if (filesOnLeftView) + { + if (filesOnLeftView == 1) + statusLeftNew += _("1 file"); + else + { + wxString fileCount = ffs3::numberToStringSep(filesOnLeftView); + + wxString outputString = _("%x files"); + outputString.Replace(wxT("%x"), fileCount, false); + statusLeftNew += outputString; + } + statusLeftNew += wxT(" - "); + statusLeftNew += ffs3::formatFilesizeToShortString(filesizeLeftView); + } + + const wxString objectsView = ffs3::numberToStringSep(gridDataView->rowsOnView()); + if (gridDataView->rowsTotal() == 1) + { + wxString outputString = _("%x of 1 row in view"); + outputString.Replace(wxT("%x"), objectsView, false); + statusMiddleNew = outputString; + } + else + { + const wxString objectsTotal = ffs3::numberToStringSep(gridDataView->rowsTotal()); + + wxString outputString = _("%x of %y rows in view"); + outputString.Replace(wxT("%x"), objectsView, false); + outputString.Replace(wxT("%y"), objectsTotal, false); + statusMiddleNew = outputString; + } + + if (foldersOnRightView) + { + if (foldersOnRightView == 1) + statusRightNew += _("1 directory"); + else + { + wxString folderCount = ffs3::numberToStringSep(foldersOnRightView); + + wxString outputString = _("%x directories"); + outputString.Replace(wxT("%x"), folderCount, false); + statusRightNew += outputString; + } + + if (filesOnRightView) + statusRightNew += wxT(" - "); + } + + if (filesOnRightView) + { + if (filesOnRightView == 1) + statusRightNew += _("1 file"); + else + { + wxString fileCount = ffs3::numberToStringSep(filesOnRightView); + + wxString outputString = _("%x files"); + outputString.Replace(wxT("%x"), fileCount, false); + statusRightNew += outputString; + } + + statusRightNew += wxT(" - "); + statusRightNew += ffs3::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_panelStatusBar->Layout(); +} + + +void MainDialog::OnAddFolderPair(wxCommandEvent& event) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + std::vector newPairs; + newPairs.push_back(getCurrentConfiguration().mainCfg.firstPair); + + addFolderPair(newPairs, true); //add pair in front of additonal pairs + + //clear first pair + const FolderPairEnh cfgEmpty; + firstFolderPair->setValues(cfgEmpty.leftDirectory, + cfgEmpty.rightDirectory, + cfgEmpty.altSyncConfig, + cfgEmpty.localFilter); + + //disable the sync button + syncPreview->enableSynchronization(false); + + //clear grids + gridDataView->clearAllRows(); + updateSyncConfig(); //mainly to update sync dir description text +} + + +void MainDialog::updateFilterConfig() +{ + applyFiltering(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative()); + refreshGridAfterFilterChange(400); +} + + +void MainDialog::updateSyncConfig() +{ + //update sync variant name + m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + getCurrentConfiguration().mainCfg.getSyncVariantName() + wxT(")")); + bSizer6->Layout(); //adapt layout for variant text + + + class RedetermineCallback : public DeterminationProblem + { + public: + RedetermineCallback(bool& warningSyncDatabase, wxWindow* parent) : + warningSyncDatabase_(warningSyncDatabase), + parent_(parent) {} + + virtual void reportWarning(const wxString& text) + { + if (warningSyncDatabase_) + { + bool dontWarnAgain = false; + WarningDlg* warningDlg = new WarningDlg(parent_, //show popup and ask user how to handle warning + WarningDlg::BUTTON_IGNORE, + text, + dontWarnAgain); + if (warningDlg->ShowModal() == WarningDlg::BUTTON_IGNORE) + warningSyncDatabase_ = !dontWarnAgain; + } + } + private: + bool& warningSyncDatabase_; + wxWindow* parent_; + } redetCallback(globalSettings->optDialogs.warningSyncDatabase, this); + + ffs3::redetermineSyncDirection(getCurrentConfiguration().mainCfg, gridDataView->getDataTentative(), &redetCallback); + updateGuiGrid(); +} + + +void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) +{ + if (additionalFolderPairs.size() > 0) + { + //get settings from second folder pair + const FolderPairEnh cfgSecond = getEnahncedPair(additionalFolderPairs[0]); + + //reset first pair + firstFolderPair->setValues(cfgSecond.leftDirectory, + cfgSecond.rightDirectory, + cfgSecond.altSyncConfig, + cfgSecond.localFilter); + + removeAddFolderPair(0); //remove second folder pair (first of additional folder pairs) + +//------------------------------------------------------------------ + //disable the sync button + syncPreview->enableSynchronization(false); + + //clear grids + gridDataView->clearAllRows(); + updateSyncConfig(); //mainly to update sync dir description text + } +} + + +void MainDialog::OnRemoveFolderPair(wxCommandEvent& event) +{ + const wxObject* const eventObj = event.GetEventObject(); //find folder pair originating the event + for (std::vector::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + if (eventObj == (*i)->m_bpButtonRemovePair) + { + removeAddFolderPair(i - additionalFolderPairs.begin()); + +//------------------------------------------------------------------ + //disable the sync button + syncPreview->enableSynchronization(false); + + //clear grids + gridDataView->clearAllRows(); + updateSyncConfig(); //mainly to update sync dir description text + return; + } +} + + +const size_t MAX_ADD_FOLDER_PAIRS = 5; + + +void MainDialog::updateGuiForFolderPair() +{ + //adapt delete top folder pair button + if (additionalFolderPairs.size() == 0) + m_bpButtonRemovePair->Hide(); + else + m_bpButtonRemovePair->Show(); + + m_panelTopRight->Layout(); + + //adapt local filter and sync cfg for first folder pair + if ( additionalFolderPairs.size() == 0 && + firstFolderPair->getAltSyncConfig().get() == NULL && + NameFilter(firstFolderPair->getAltFilterConfig().includeFilter, + firstFolderPair->getAltFilterConfig().excludeFilter).isNull()) + { + m_bpButtonLocalFilter->Hide(); + m_bpButtonAltSyncCfg->Hide(); + + m_bpButtonSwapSides->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("swap"))); + } + else + { + m_bpButtonLocalFilter->Show(); + m_bpButtonAltSyncCfg->Show(); + + m_bpButtonSwapSides->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("swapSlim"))); + } + + m_panelTopMiddle->Layout(); +} + + +void MainDialog::addFolderPair(const std::vector& newPairs, bool addFront) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + if (!newPairs.empty()) + { + int pairHeight = 0; + for (std::vector::const_iterator i = newPairs.begin(); i != newPairs.end(); ++i) + { + //add new folder pair + FolderPairPanel* newPair = new FolderPairPanel(m_scrolledWindowFolderPairs, *this); + + //correct width of middle block + newPair->m_panel21->SetMinSize(wxSize(m_gridMiddle->GetSize().GetWidth(), -1)); + + //set width of left folder panel + const int width = m_panelTopLeft->GetSize().GetWidth(); + newPair->m_panelLeft->SetMinSize(wxSize(width, -1)); + + + if (addFront) + { + bSizerAddFolderPairs->Insert(0, newPair, 0, wxEXPAND, 5); + additionalFolderPairs.insert(additionalFolderPairs.begin(), newPair); + } + else + { + bSizerAddFolderPairs->Add(newPair, 0, wxEXPAND, 5); + additionalFolderPairs.push_back(newPair); + } + + //get size of scrolled window + pairHeight = newPair->GetSize().GetHeight(); + + //register events + newPair->m_bpButtonRemovePair->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(MainDialog::OnRemoveFolderPair), NULL, this); + + //set alternate configuration + newPair->setValues(i->leftDirectory, + i->rightDirectory, + i->altSyncConfig, + i->localFilter); + } + + //set size of scrolled window + const size_t visiblePairs = std::min(additionalFolderPairs.size(), MAX_ADD_FOLDER_PAIRS); //up to MAX_ADD_FOLDER_PAIRS additional pairs shall be shown + m_scrolledWindowFolderPairs->SetMinSize(wxSize( -1, pairHeight * static_cast(visiblePairs))); + + //update controls + m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + bSizer1->Layout(); + } + + updateGuiForFolderPair(); +} + + +void MainDialog::removeAddFolderPair(size_t pos) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + if (pos < additionalFolderPairs.size()) + { + //remove folder pairs from window + FolderPairPanel* pairToDelete = additionalFolderPairs[pos]; + const int pairHeight = pairToDelete->GetSize().GetHeight(); + + bSizerAddFolderPairs->Detach(pairToDelete); //Remove() does not work on Window*, so do it manually + pairToDelete->Destroy(); // + additionalFolderPairs.erase(additionalFolderPairs.begin() + pos); //remove element from vector + + //set size of scrolled window + const size_t additionalRows = additionalFolderPairs.size(); + if (additionalRows <= MAX_ADD_FOLDER_PAIRS) //up to MAX_ADD_FOLDER_PAIRS additional pairs shall be shown + m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, pairHeight * static_cast(additionalRows))); + + //update controls + m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + bSizer1->Layout(); + } + + updateGuiForFolderPair(); +} + + +void MainDialog::clearAddFolderPairs() +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + additionalFolderPairs.clear(); + bSizerAddFolderPairs->Clear(true); + + m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, 0)); + bSizer1->Layout(); +} +//######################################################################################################## + + +//menu events +void MainDialog::OnMenuGlobalSettings(wxCommandEvent& event) +{ + ffs3::showGlobalSettingsDlg(*globalSettings); + + //event.Skip(); +} + + +void MainDialog::OnMenuExportFileList(wxCommandEvent& event) +{ + //get a filename + const wxString defaultFileName = wxT("FileList.csv"); //proposal + wxFileDialog* filePicker = new wxFileDialog(this, wxEmptyString, wxEmptyString, defaultFileName, wxString(_("Comma separated list")) + wxT(" (*.csv)|*.csv"), wxFD_SAVE); + + if (filePicker->ShowModal() == wxID_OK) + { + const wxString newFileName = filePicker->GetPath(); + if (ffs3::fileExists(wxToZ(newFileName))) + { + QuestionDlg* messageDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, + wxString(_("File already exists. Overwrite?")) + wxT(" \"") + newFileName + wxT("\"")); + + if (messageDlg->ShowModal() != QuestionDlg::BUTTON_YES) + { + OnMenuExportFileList(event); //retry + return; + } + } + + wxString exportString; + //write legend + exportString += wxString(_("Legend")) + wxT('\n'); + if (syncPreview->previewIsEnabled()) + { + exportString += wxString(wxT("\"")) + getDescription(SO_CREATE_NEW_LEFT) + wxT("\";") + getSymbol(SO_CREATE_NEW_LEFT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_CREATE_NEW_RIGHT) + wxT("\";") + getSymbol(SO_CREATE_NEW_RIGHT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_DELETE_LEFT) + wxT("\";") + getSymbol(SO_DELETE_LEFT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_DELETE_RIGHT) + wxT("\";") + getSymbol(SO_DELETE_RIGHT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_OVERWRITE_LEFT) + wxT("\";") + getSymbol(SO_OVERWRITE_LEFT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_OVERWRITE_RIGHT) + wxT("\";") + getSymbol(SO_OVERWRITE_RIGHT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_DO_NOTHING) + wxT("\";") + getSymbol(SO_DO_NOTHING) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_EQUAL) + wxT("\";") + getSymbol(SO_EQUAL) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(SO_UNRESOLVED_CONFLICT) + wxT("\";") + getSymbol(SO_UNRESOLVED_CONFLICT) + wxT('\n'); + } + else + { + exportString += wxString(wxT("\"")) + getDescription(FILE_LEFT_SIDE_ONLY) + wxT("\";") + getSymbol(FILE_LEFT_SIDE_ONLY) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(FILE_RIGHT_SIDE_ONLY) + wxT("\";") + getSymbol(FILE_RIGHT_SIDE_ONLY) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(FILE_LEFT_NEWER) + wxT("\";") + getSymbol(FILE_LEFT_NEWER) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(FILE_RIGHT_NEWER) + wxT("\";") + getSymbol(FILE_RIGHT_NEWER) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(FILE_DIFFERENT) + wxT("\";") + getSymbol(FILE_DIFFERENT) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(FILE_EQUAL) + wxT("\";") + getSymbol(FILE_EQUAL) + wxT('\n'); + exportString += wxString(wxT("\"")) + getDescription(FILE_CONFLICT) + wxT("\";") + getSymbol(FILE_CONFLICT) + wxT('\n'); + } + exportString += '\n'; + + //write header + for (int k = 0; k < m_gridLeft->GetNumberCols(); ++k) + { + exportString += m_gridLeft->GetColLabelValue(k); + exportString += ';'; + } + + for (int k = 0; k < m_gridMiddle->GetNumberCols(); ++k) + { + exportString += m_gridMiddle->GetColLabelValue(k); + exportString += ';'; + } + + for (int k = 0; k < m_gridRight->GetNumberCols(); ++k) + { + exportString += m_gridRight->GetColLabelValue(k); + if (k != m_gridRight->GetNumberCols() - 1) + exportString += ';'; + } + exportString += '\n'; + + //begin work + for (int i = 0; i < m_gridLeft->GetNumberRows(); ++i) + { + for (int k = 0; k < m_gridLeft->GetNumberCols(); ++k) + { + exportString += m_gridLeft->GetCellValue(i, k); + exportString += ';'; + } + + for (int k = 0; k < m_gridMiddle->GetNumberCols(); ++k) + { + exportString += m_gridMiddle->GetCellValue(i, k); + exportString += ';'; + } + + for (int k = 0; k < m_gridRight->GetNumberCols(); ++k) + { + exportString += m_gridRight->GetCellValue(i, k); + if (k != m_gridRight->GetNumberCols() - 1) + exportString+= ';'; + } + exportString+= '\n'; + } + + //write export file + wxFFile output(newFileName.c_str(), wxT("w")); //don't write in binary mode + if (output.IsOpened()) + { + output.Write(exportString); + pushStatusInformation(_("File list exported!")); + } + else + { + wxMessageBox(wxString(_("Error writing file:")) + wxT(" \"") + newFileName + wxT("\""), _("Error"), wxOK | wxICON_ERROR); + } + } +} + + +void MainDialog::OnMenuBatchJob(wxCommandEvent& event) +{ + //fill batch config structure + const xmlAccess::XmlGuiConfig currCfg = getCurrentConfiguration(); //get UP TO DATE config, with updated values for main and additional folders! + + const xmlAccess::XmlBatchConfig batchCfg = convertGuiToBatch(currCfg); + + BatchDialog* batchDlg = new BatchDialog(this, batchCfg); + if (batchDlg->ShowModal() == BatchDialog::BATCH_FILE_SAVED) + pushStatusInformation(_("Batch file created successfully!")); +} + + +void MainDialog::OnMenuCheckVersion(wxCommandEvent& event) +{ + ffs3::checkForUpdateNow(); +} + + +void MainDialog::OnRegularUpdateCheck(wxIdleEvent& event) +{ + //execute just once per startup! + Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnRegularUpdateCheck), NULL, this); + + ffs3::checkForUpdatePeriodically(globalSettings->gui.lastUpdateCheck); +} + + +void MainDialog::OnLayoutWindowAsync(wxIdleEvent& event) +{ + //execute just once per startup! + Disconnect(wxEVT_IDLE, wxIdleEventHandler(MainDialog::OnLayoutWindowAsync), NULL, this); + + wxWindowUpdateLocker dummy(this); //avoid display distortion + + //adjust folder pair distortion on startup + m_scrolledWindowFolderPairs->Fit(); + + Layout(); //strangely this layout call works if called in next idle event only + Refresh(); +} + + +void MainDialog::OnMenuAbout(wxCommandEvent& event) +{ + ffs3::showAboutDialog(); +} + + +void MainDialog::OnShowHelp(wxCommandEvent& event) +{ + ffs3::displayHelpEntry(); +} + + +void MainDialog::OnMenuQuit(wxCommandEvent& event) +{ + if (!saveOldConfig()) //notify user about changed settings + return; + + Destroy(); +} + +//######################################################################################################### + +//language selection +void MainDialog::switchProgramLanguage(const int langID) +{ + //create new dialog with respect to new language + CustomLocale::getInstance().setLanguage(langID); //language is a global attribute + + const xmlAccess::XmlGuiConfig currentGuiCfg = getCurrentConfiguration(); + + cleanUp(false); //destructor's code: includes updating global settings + + //create new main window and delete old one + MainDialog* frame = new MainDialog(currentGuiCfg, *globalSettings, false); + frame->Show(); + + Destroy(); +} + + +void MainDialog::OnMenuLanguageSwitch(wxCommandEvent& event) +{ + std::map::const_iterator it = languageMenuItemMap.find(event.GetId()); + + if (it != languageMenuItemMap.end()) + switchProgramLanguage(it->second); +} + +//######################################################################################################### + +MainDialog::SyncPreview::SyncPreview(MainDialog* mainDlg) : + mainDlg_(mainDlg), + syncPreviewEnabled(false), + synchronizationEnabled(false) {} + + +bool MainDialog::SyncPreview::previewIsEnabled() const +{ + return syncPreviewEnabled; +} + + +void MainDialog::SyncPreview::enablePreview(bool value) +{ + if (value) + { + syncPreviewEnabled = true; + + //toggle display of sync preview in middle grid + mainDlg_->m_gridMiddle->enableSyncPreview(true); + + mainDlg_->Refresh(); + } + else + { + syncPreviewEnabled = false; + + //toggle display of sync preview in middle grid + mainDlg_->m_gridMiddle->enableSyncPreview(false); + + mainDlg_->Refresh(); + } + + mainDlg_->updateGuiGrid(); +} + + +void MainDialog::SyncPreview::enableSynchronization(bool value) +{ + if (value) + { + synchronizationEnabled = true; + mainDlg_->m_buttonStartSync->SetForegroundColour(*wxBLACK); + mainDlg_->m_buttonStartSync->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("sync"))); + } + else + { + synchronizationEnabled = false; + mainDlg_->m_buttonStartSync->SetForegroundColour(wxColor(128, 128, 128)); //Some colors seem to have problems with 16Bit color depth, well this one hasn't! + mainDlg_->m_buttonStartSync->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("syncDisabled"))); + } +} + + +bool MainDialog::SyncPreview::synchronizationIsEnabled() const +{ + return synchronizationEnabled; +} diff --git a/ui/main_dlg.h b/ui/main_dlg.h new file mode 100644 index 00000000..3e62191f --- /dev/null +++ b/ui/main_dlg.h @@ -0,0 +1,337 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef MAINDIALOG_H +#define MAINDIALOG_H + +#include "gui_generated.h" +#include +#include "../library/process_xml.h" +#include +#include +#include + +class CompareStatusHandler; +class MainFolderDragDrop; +class CustomGrid; +class FFSCheckRowsEvent; +class FFSSyncDirectionEvent; +class IconUpdater; +class ManualDeletionHandler; +class FolderPairPanel; +class FirstFolderPairCfg; +class CompareStatus; + + +namespace ffs3 +{ +class CustomLocale; +class GridView; +class MouseMoveWindow; +} + + +class MainDialog : public MainDialogGenerated +{ +public: + MainDialog(const wxString& cfgFileName, + xmlAccess::XmlGlobalSettings& settings); + + MainDialog(const xmlAccess::XmlGuiConfig& guiCfg, + xmlAccess::XmlGlobalSettings& settings, + bool startComparison); + + ~MainDialog(); + +private: + friend class CompareStatusHandler; + friend class ManualDeletionHandler; + friend class MainFolderDragDrop; + template + friend class FolderPairCallback; + +//IDs for context menu items + enum ContextIDRim //context menu for left and right grids + { + CONTEXT_FILTER_TEMP = 10, + CONTEXT_EXCLUDE_EXT, + CONTEXT_EXCLUDE_OBJ, + CONTEXT_CLIPBOARD, + CONTEXT_EXTERNAL_APP, + CONTEXT_DELETE_FILES, + CONTEXT_SYNC_DIR_LEFT, + CONTEXT_SYNC_DIR_NONE, + CONTEXT_SYNC_DIR_RIGHT + }; + + enum ContextIDRimLabel//context menu for column settings + { + CONTEXT_CUSTOMIZE_COLUMN_LEFT, + CONTEXT_CUSTOMIZE_COLUMN_RIGHT, + CONTEXT_AUTO_ADJUST_COLUMN_LEFT, + CONTEXT_AUTO_ADJUST_COLUMN_RIGHT + }; + + enum ContextIDMiddle//context menu for middle grid + { + CONTEXT_CHECK_ALL = 20, + CONTEXT_UNCHECK_ALL + }; + + enum ContextIDMiddleLabel + { + CONTEXT_COMPARISON_RESULT = 30, + CONTEXT_SYNC_PREVIEW + }; + + MainDialog(); + + void init(const xmlAccess::XmlGuiConfig guiCfg, + xmlAccess::XmlGlobalSettings& settings, + bool startComparison); + + void cleanUp(bool saveLastUsedConfig); + + //configuration load/save + bool readConfigurationFromXml(const wxString& filename); + bool writeConfigurationToXml(const wxString& filename); + void setLastUsedConfig(const wxString& filename, const xmlAccess::XmlGuiConfig& guiConfig); + + xmlAccess::XmlGuiConfig getCurrentConfiguration() const; + void setCurrentConfiguration(const xmlAccess::XmlGuiConfig& newGuiCfg); + + static const wxString& lastConfigFileName(); + + xmlAccess::XmlGuiConfig lastConfigurationSaved; //support for: "Save changed configuration?" dialog + //used when saving configuration + wxString currentConfigFileName; + + void readGlobalSettings(); + void writeGlobalSettings(); + + void initViewFilterButtons(); + void updateFilterButtons(); + + void addFileToCfgHistory(const wxString& filename); + void addLeftFolderToHistory(const wxString& leftFolder); + void addRightFolderToHistory(const wxString& rightFolder); + + void addFolderPair(const std::vector& newPairs, bool addFront = false); + void removeAddFolderPair(size_t pos); + void clearAddFolderPairs(); + + void updateGuiForFolderPair(); //helper method: add usability by showing/hiding buttons related to folder pairs + + //main method for putting gridDataView on UI: updates data respecting current view settings + void updateGuiGrid(); + void updateGridViewData(); + + //context menu functions + std::set getSelectedRows(const CustomGrid* grid) const; + std::set getSelectedRows() const; + void setSyncDirManually(const std::set& rowsToSetOnUiTable, const ffs3::SyncDirection dir); + void filterRangeManually(const std::set& rowsToFilterOnUiTable, int leadingRow); + void copySelectionToClipboard(const CustomGrid* selectedGrid); + void deleteSelectedFiles(); + + void openExternalApplication(size_t rowNumber, bool leftSide, const wxString& commandline); + static const int externalAppIDFirst = 1000; //id of first external app item + + //work to be done in idle time + void OnIdleEvent(wxEvent& event); + + //delayed status information restore + void pushStatusInformation(const wxString& text); + void clearStatusBar(); + + void disableAllElements(); //dis-/enables all elements (except abort button) that might receive user input during long-running processes: comparison, deletion + void enableAllElements(); // + + //events + void onGridLeftButtonEvent( wxKeyEvent& event); + void onGridRightButtonEvent( wxKeyEvent& event); + void onGridMiddleButtonEvent( wxKeyEvent& event); + void OnContextRim( wxGridEvent& event); + void OnContextRimLabelLeft( wxGridEvent& event); + void OnContextRimLabelRight( wxGridEvent& event); + void OnContextMiddle( wxGridEvent& event); + void OnContextMiddleLabel( wxGridEvent& event); + + //context menu handler methods + void OnContextFilterTemp(wxCommandEvent& event); + void OnContextExcludeExtension(wxCommandEvent& event); + void OnContextExcludeObject(wxCommandEvent& event); + void OnContextCopyClipboard(wxCommandEvent& event); + void OnContextOpenWith(wxCommandEvent& event); + void OnContextDeleteFiles(wxCommandEvent& event); + void OnContextSyncDirLeft(wxCommandEvent& event); + void OnContextSyncDirNone(wxCommandEvent& event); + void OnContextSyncDirRight(wxCommandEvent& event); + void OnContextCustColumnLeft(wxCommandEvent& event); + void OnContextCustColumnRight(wxCommandEvent& event); + void OnContextAutoAdjustLeft(wxCommandEvent& event); + void OnContextAutoAdjustRight(wxCommandEvent& event); + void OnContextIncludeAll(wxCommandEvent& event); + void OnContextExcludeAll(wxCommandEvent& event); + void OnContextComparisonView(wxCommandEvent& event); + void OnContextSyncView(wxCommandEvent& event); + + void OnDirSelected(wxFileDirPickerEvent& event); + + void OnCheckRows(FFSCheckRowsEvent& event); + void OnSetSyncDirection(FFSSyncDirectionEvent& event); + + void OnLeftGridDoubleClick( wxGridEvent& event); + void OnRightGridDoubleClick(wxGridEvent& event); + void OnSortLeftGrid( wxGridEvent& event); + void OnSortMiddleGrid( wxGridEvent& event); + void OnSortRightGrid( wxGridEvent& event); + + void OnLeftOnlyFiles( wxCommandEvent& event); + void OnRightOnlyFiles( wxCommandEvent& event); + void OnLeftNewerFiles( wxCommandEvent& event); + void OnRightNewerFiles( wxCommandEvent& event); + void OnEqualFiles( wxCommandEvent& event); + void OnDifferentFiles( wxCommandEvent& event); + void OnConflictFiles( wxCommandEvent& event); + + void OnSyncCreateLeft( wxCommandEvent& event); + void OnSyncCreateRight( wxCommandEvent& event); + void OnSyncDeleteLeft( wxCommandEvent& event); + void OnSyncDeleteRight( wxCommandEvent& event); + void OnSyncDirLeft( wxCommandEvent& event); + void OnSyncDirRight( wxCommandEvent& event); + void OnSyncDirNone( wxCommandEvent& event); + + void OnNewConfig( wxCommandEvent& event); + void OnSaveConfig( wxCommandEvent& event); + void OnLoadConfig( wxCommandEvent& event); + void OnLoadFromHistory( wxCommandEvent& event); + bool trySaveConfig(); //return true if saved successfully + bool saveOldConfig(); //return false on user abort + + void loadConfiguration(const wxString& filename); + void OnCfgHistoryKeyEvent( wxKeyEvent& event); + void OnRegularUpdateCheck( wxIdleEvent& event); + void OnLayoutWindowAsync( wxIdleEvent& event); + + void refreshGridAfterFilterChange(const int delay); + + void OnResize( wxSizeEvent& event); + void OnResizeFolderPairs( wxSizeEvent& event); + void OnHideFilteredButton( wxCommandEvent& event); + void OnConfigureFilter( wxCommandEvent& event); + void OnSwapSides( wxCommandEvent& event); + void OnCompare( wxCommandEvent& event); + void OnSwitchView( wxCommandEvent& event); + void OnSyncSettings( wxCommandEvent& event); + void OnCmpSettings( wxCommandEvent& event); + void OnStartSync( wxCommandEvent& event); + void OnClose( wxCloseEvent& event); + void OnQuit( wxCommandEvent& event); + + void OnGlobalFilterOpenContext(wxCommandEvent& event); + void OnGlobalFilterRemConfirm(wxCommandEvent& event); + + void calculatePreview(); + + void OnAddFolderPair( wxCommandEvent& event); + void OnRemoveFolderPair( wxCommandEvent& event); + void OnRemoveTopFolderPair( wxCommandEvent& event); + + void updateFilterConfig(); + void updateSyncConfig(); + + //menu events + void OnMenuGlobalSettings( wxCommandEvent& event); + void OnMenuExportFileList( wxCommandEvent& event); + void OnMenuBatchJob( wxCommandEvent& event); + void OnMenuCheckVersion( wxCommandEvent& event); + void OnMenuAbout( wxCommandEvent& event); + void OnShowHelp( wxCommandEvent& event); + void OnMenuQuit( wxCommandEvent& event); + void OnMenuLanguageSwitch( wxCommandEvent& event); + + void switchProgramLanguage(const int langID); + + typedef int MenuItemID; + typedef int LanguageID; + std::map languageMenuItemMap; //needed to attach menu item events + +//*********************************************** + //application variables are stored here: + + //global settings used by GUI and batch mode + xmlAccess::XmlGlobalSettings* globalSettings; //always bound + + //UI view of FolderComparison structure + std::auto_ptr gridDataView; + +//------------------------------------- + //functional configuration + xmlAccess::XmlGuiConfig currentCfg; + + //folder pairs: + std::auto_ptr firstFolderPair; //always bound!!! + std::vector additionalFolderPairs; //additional pairs to the first pair + + //gui settings + int widthNotMaximized; + int heightNotMaximized; + int posXNotMaximized; + int posYNotMaximized; +//------------------------------------- + + +//*********************************************** + std::auto_ptr contextMenu; + + //status information + wxLongLong lastStatusChange; + std::stack stackObjects; + + //compare status panel (hidden on start, shown when comparing) + std::auto_ptr compareStatus; //always bound + + bool cleanedUp; + + //save the last used config filename history + std::vector cfgFileNames; + + + //remember last sort executed (for determination of sort order) + int lastSortColumn; + const wxGrid* lastSortGrid; + + //update icons periodically: one updater instance for both left and right grids + std::auto_ptr updateFileIcons; + +#ifdef FFS_WIN + //enable moving window by clicking on sub-windows instead of header line + std::auto_ptr moveWholeWindow; +#endif + + //encapsulation of handling of sync preview + class SyncPreview //encapsulates MainDialog functionality for synchronization preview (friend class) + { + public: + SyncPreview(MainDialog* mainDlg); + + void enablePreview(bool value); + bool previewIsEnabled() const; + + void enableSynchronization(bool value); + bool synchronizationIsEnabled() const; + + private: + MainDialog* mainDlg_; + bool syncPreviewEnabled; //toggle to display configuration preview instead of comparison result + bool synchronizationEnabled; //determines whether synchronization should be allowed + }; + std::auto_ptr syncPreview; //always bound +}; + +#endif // MAINDIALOG_H diff --git a/ui/messagePopup.cpp b/ui/messagePopup.cpp deleted file mode 100644 index 771df4f3..00000000 --- a/ui/messagePopup.cpp +++ /dev/null @@ -1,188 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "messagePopup.h" -#include "../library/resources.h" - - -ErrorDlg::ErrorDlg(wxWindow* parentWindow, const int activeButtons, const wxString messageText, bool& ignoreNextErrors) : - ErrorDlgGenerated(parentWindow), - ignoreErrors(ignoreNextErrors) -{ - m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("error"))); - m_textCtrl8->SetValue(messageText); - m_checkBoxIgnoreErrors->SetValue(ignoreNextErrors); - - if (~activeButtons & BUTTON_IGNORE) - { - m_buttonIgnore->Hide(); - m_checkBoxIgnoreErrors->Hide(); - } - - if (~activeButtons & BUTTON_RETRY) - m_buttonRetry->Hide(); - - if (~activeButtons & BUTTON_ABORT) - m_buttonAbort->Hide(); - - //set button focus precedence - if (activeButtons & BUTTON_RETRY) - m_buttonRetry->SetFocus(); - else if (activeButtons & BUTTON_IGNORE) - m_buttonIgnore->SetFocus(); - else if (activeButtons & BUTTON_ABORT) - m_buttonAbort->SetFocus(); -} - - -void ErrorDlg::OnClose(wxCloseEvent& event) -{ - ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); - EndModal(BUTTON_ABORT); -} - - -void ErrorDlg::OnIgnore(wxCommandEvent& event) -{ - ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); - EndModal(BUTTON_IGNORE); -} - - -void ErrorDlg::OnRetry(wxCommandEvent& event) -{ - ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); - EndModal(BUTTON_RETRY); -} - - -void ErrorDlg::OnAbort(wxCommandEvent& event) -{ - ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); - EndModal(BUTTON_ABORT); -} -//######################################################################################## - - -WarningDlg::WarningDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool& dontShowDlgAgain) : - WarningDlgGenerated(parentWindow), - dontShowAgain(dontShowDlgAgain) -{ - m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("warning"))); - m_textCtrl8->SetValue(messageText); - m_checkBoxDontShowAgain->SetValue(dontShowAgain); - - if (~activeButtons & BUTTON_IGNORE) - { - m_buttonIgnore->Hide(); - m_checkBoxDontShowAgain->Hide(); - } - - if (~activeButtons & BUTTON_SWITCH) - m_buttonSwitch->Hide(); - - if (~activeButtons & BUTTON_ABORT) - m_buttonAbort->Hide(); - - //set button focus precedence - if (activeButtons & BUTTON_IGNORE) - m_buttonIgnore->SetFocus(); - else if (activeButtons & BUTTON_ABORT) - m_buttonAbort->SetFocus(); -} - - -void WarningDlg::OnClose(wxCloseEvent& event) -{ - dontShowAgain = m_checkBoxDontShowAgain->GetValue(); - EndModal(BUTTON_ABORT); -} - - -void WarningDlg::OnIgnore(wxCommandEvent& event) -{ - dontShowAgain = m_checkBoxDontShowAgain->GetValue(); - EndModal(BUTTON_IGNORE); -} - - -void WarningDlg::OnSwitch(wxCommandEvent& event) -{ - dontShowAgain = m_checkBoxDontShowAgain->GetValue(); - EndModal(BUTTON_SWITCH); -} - - -void WarningDlg::OnAbort(wxCommandEvent& event) -{ - dontShowAgain = m_checkBoxDontShowAgain->GetValue(); - EndModal(BUTTON_ABORT); -} -//######################################################################################## - - -QuestionDlg::QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool* dontShowDlgAgain) : - QuestionDlgGenerated(parentWindow), - dontShowAgain(dontShowDlgAgain) -{ - m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("question"))); - m_textCtrl8->SetValue(messageText); - if (dontShowAgain) - m_checkBoxDontAskAgain->SetValue(*dontShowAgain); - else - m_checkBoxDontAskAgain->Hide(); - - if (~activeButtons & BUTTON_YES) - m_buttonYes->Hide(); - - if (~activeButtons & BUTTON_NO) - { - m_buttonNo->Hide(); - m_checkBoxDontAskAgain->Hide(); - } - - if (~activeButtons & BUTTON_CANCEL) - m_buttonCancel->Hide(); - - //set button focus precedence - if (activeButtons & BUTTON_YES) - m_buttonYes->SetFocus(); - else if (activeButtons & BUTTON_CANCEL) - m_buttonCancel->SetFocus(); - else if (activeButtons & BUTTON_NO) - m_buttonNo->SetFocus(); -} - - -void QuestionDlg::OnClose(wxCloseEvent& event) -{ - if (dontShowAgain) - *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); - EndModal(BUTTON_CANCEL); -} - - -void QuestionDlg::OnCancel(wxCommandEvent& event) -{ - if (dontShowAgain) - *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); - EndModal(BUTTON_CANCEL); -} - - -void QuestionDlg::OnYes(wxCommandEvent& event) -{ - if (dontShowAgain) - *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); - EndModal(BUTTON_YES); -} - -void QuestionDlg::OnNo(wxCommandEvent& event) -{ - if (dontShowAgain) - *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); - EndModal(BUTTON_NO); -} diff --git a/ui/messagePopup.h b/ui/messagePopup.h deleted file mode 100644 index d41594b5..00000000 --- a/ui/messagePopup.h +++ /dev/null @@ -1,78 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef MESSAGEPOPUP_H_INCLUDED -#define MESSAGEPOPUP_H_INCLUDED - -#include "guiGenerated.h" - - -class ErrorDlg : public ErrorDlgGenerated -{ -public: - ErrorDlg(wxWindow* parentWindow, const int activeButtons, const wxString messageText, bool& ignoreNextErrors); - - enum ReturnCodes - { - BUTTON_IGNORE = 1, - BUTTON_RETRY = 2, - BUTTON_ABORT = 4 - }; - -private: - void OnClose(wxCloseEvent& event); - void OnIgnore(wxCommandEvent& event); - void OnRetry(wxCommandEvent& event); - void OnAbort(wxCommandEvent& event); - - bool& ignoreErrors; -}; - - -class WarningDlg : public WarningDlgGenerated -{ -public: - WarningDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool& dontShowAgain); - - enum Response - { - BUTTON_IGNORE = 1, - BUTTON_SWITCH = 2, - BUTTON_ABORT = 4 - }; - -private: - void OnClose(wxCloseEvent& event); - void OnIgnore(wxCommandEvent& event); - void OnSwitch(wxCommandEvent& event); - void OnAbort(wxCommandEvent& event); - bool& dontShowAgain; -}; - - -class QuestionDlg : public QuestionDlgGenerated -{ -public: - QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool* dontShowAgain = NULL); - - enum - { - BUTTON_YES = 1, - BUTTON_NO = 2, - BUTTON_CANCEL = 4 - }; - -private: - void OnClose(wxCloseEvent& event); - void OnCancel(wxCommandEvent& event); - void OnYes(wxCommandEvent& event); - void OnNo(wxCommandEvent& event); - - bool* dontShowAgain; //optional -}; - - -#endif // MESSAGEPOPUP_H_INCLUDED diff --git a/ui/mouseMoveWindow.cpp b/ui/mouseMoveWindow.cpp deleted file mode 100644 index 86064141..00000000 --- a/ui/mouseMoveWindow.cpp +++ /dev/null @@ -1,26 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "mouseMoveWindow.h" -#include //includes "windows.h" - -using namespace FreeFileSync; - - -void MouseMoveWindow::connectSourceWindow(wxWindow* sourceWindow) -{ - sourceWindow->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); -} - - -void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) -{ - ::ReleaseCapture(); - //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); - ::SendMessage(static_cast(dialogToMove_->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); - - //event.Skip(); -> swallow event, to avoid other windows losing focus -} diff --git a/ui/mouseMoveWindow.h b/ui/mouseMoveWindow.h deleted file mode 100644 index bc7ee904..00000000 --- a/ui/mouseMoveWindow.h +++ /dev/null @@ -1,36 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef MOUSEMOVEWINDOW_H_INCLUDED -#define MOUSEMOVEWINDOW_H_INCLUDED - -#include - -namespace FreeFileSync -{ - -//move main dialog by mouse-dragging contained sub-windows: -//---------------------------------------------------------------------------------------- -//keep it as an attribute of the to-be-moved dialog and ensure that all connected source windows -//have a longer lifetime than the dialog which is moved (should be fulfilled naturally) -class MouseMoveWindow : private wxEvtHandler -{ -public: - MouseMoveWindow(wxWindow* dialogToMove) : - dialogToMove_(dialogToMove) {} - - void connectSourceWindow(wxWindow* sourceWindow); - -private: - void LeftButtonDown(wxMouseEvent& event); - - wxWindow* dialogToMove_; -}; - -} - - -#endif // MOUSEMOVEWINDOW_H_INCLUDED diff --git a/ui/mouse_move_dlg.cpp b/ui/mouse_move_dlg.cpp new file mode 100644 index 00000000..526408d4 --- /dev/null +++ b/ui/mouse_move_dlg.cpp @@ -0,0 +1,26 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "mouse_move_dlg.h" +#include //includes "windows.h" + +using namespace ffs3; + + +void MouseMoveWindow::connectSourceWindow(wxWindow* sourceWindow) +{ + sourceWindow->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); +} + + +void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) +{ + ::ReleaseCapture(); + //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); + ::SendMessage(static_cast(dialogToMove_->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); + + //event.Skip(); -> swallow event, to avoid other windows losing focus +} diff --git a/ui/mouse_move_dlg.h b/ui/mouse_move_dlg.h new file mode 100644 index 00000000..9d68845d --- /dev/null +++ b/ui/mouse_move_dlg.h @@ -0,0 +1,36 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef MOUSEMOVEWINDOW_H_INCLUDED +#define MOUSEMOVEWINDOW_H_INCLUDED + +#include + +namespace ffs3 +{ + +//move main dialog by mouse-dragging contained sub-windows: +//---------------------------------------------------------------------------------------- +//keep it as an attribute of the to-be-moved dialog and ensure that all connected source windows +//have a longer lifetime than the dialog which is moved (should be fulfilled naturally) +class MouseMoveWindow : private wxEvtHandler +{ +public: + MouseMoveWindow(wxWindow* dialogToMove) : + dialogToMove_(dialogToMove) {} + + void connectSourceWindow(wxWindow* sourceWindow); + +private: + void LeftButtonDown(wxMouseEvent& event); + + wxWindow* dialogToMove_; +}; + +} + + +#endif // MOUSEMOVEWINDOW_H_INCLUDED diff --git a/ui/msg_popup.cpp b/ui/msg_popup.cpp new file mode 100644 index 00000000..4024a541 --- /dev/null +++ b/ui/msg_popup.cpp @@ -0,0 +1,188 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "msg_popup.h" +#include "../library/resources.h" + + +ErrorDlg::ErrorDlg(wxWindow* parentWindow, const int activeButtons, const wxString messageText, bool& ignoreNextErrors) : + ErrorDlgGenerated(parentWindow), + ignoreErrors(ignoreNextErrors) +{ + m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("error"))); + m_textCtrl8->SetValue(messageText); + m_checkBoxIgnoreErrors->SetValue(ignoreNextErrors); + + if (~activeButtons & BUTTON_IGNORE) + { + m_buttonIgnore->Hide(); + m_checkBoxIgnoreErrors->Hide(); + } + + if (~activeButtons & BUTTON_RETRY) + m_buttonRetry->Hide(); + + if (~activeButtons & BUTTON_ABORT) + m_buttonAbort->Hide(); + + //set button focus precedence + if (activeButtons & BUTTON_RETRY) + m_buttonRetry->SetFocus(); + else if (activeButtons & BUTTON_IGNORE) + m_buttonIgnore->SetFocus(); + else if (activeButtons & BUTTON_ABORT) + m_buttonAbort->SetFocus(); +} + + +void ErrorDlg::OnClose(wxCloseEvent& event) +{ + ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); + EndModal(BUTTON_ABORT); +} + + +void ErrorDlg::OnIgnore(wxCommandEvent& event) +{ + ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); + EndModal(BUTTON_IGNORE); +} + + +void ErrorDlg::OnRetry(wxCommandEvent& event) +{ + ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); + EndModal(BUTTON_RETRY); +} + + +void ErrorDlg::OnAbort(wxCommandEvent& event) +{ + ignoreErrors = m_checkBoxIgnoreErrors->GetValue(); + EndModal(BUTTON_ABORT); +} +//######################################################################################## + + +WarningDlg::WarningDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool& dontShowDlgAgain) : + WarningDlgGenerated(parentWindow), + dontShowAgain(dontShowDlgAgain) +{ + m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("warning"))); + m_textCtrl8->SetValue(messageText); + m_checkBoxDontShowAgain->SetValue(dontShowAgain); + + if (~activeButtons & BUTTON_IGNORE) + { + m_buttonIgnore->Hide(); + m_checkBoxDontShowAgain->Hide(); + } + + if (~activeButtons & BUTTON_SWITCH) + m_buttonSwitch->Hide(); + + if (~activeButtons & BUTTON_ABORT) + m_buttonAbort->Hide(); + + //set button focus precedence + if (activeButtons & BUTTON_IGNORE) + m_buttonIgnore->SetFocus(); + else if (activeButtons & BUTTON_ABORT) + m_buttonAbort->SetFocus(); +} + + +void WarningDlg::OnClose(wxCloseEvent& event) +{ + dontShowAgain = m_checkBoxDontShowAgain->GetValue(); + EndModal(BUTTON_ABORT); +} + + +void WarningDlg::OnIgnore(wxCommandEvent& event) +{ + dontShowAgain = m_checkBoxDontShowAgain->GetValue(); + EndModal(BUTTON_IGNORE); +} + + +void WarningDlg::OnSwitch(wxCommandEvent& event) +{ + dontShowAgain = m_checkBoxDontShowAgain->GetValue(); + EndModal(BUTTON_SWITCH); +} + + +void WarningDlg::OnAbort(wxCommandEvent& event) +{ + dontShowAgain = m_checkBoxDontShowAgain->GetValue(); + EndModal(BUTTON_ABORT); +} +//######################################################################################## + + +QuestionDlg::QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool* dontShowDlgAgain) : + QuestionDlgGenerated(parentWindow), + dontShowAgain(dontShowDlgAgain) +{ + m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("question"))); + m_textCtrl8->SetValue(messageText); + if (dontShowAgain) + m_checkBoxDontAskAgain->SetValue(*dontShowAgain); + else + m_checkBoxDontAskAgain->Hide(); + + if (~activeButtons & BUTTON_YES) + m_buttonYes->Hide(); + + if (~activeButtons & BUTTON_NO) + { + m_buttonNo->Hide(); + m_checkBoxDontAskAgain->Hide(); + } + + if (~activeButtons & BUTTON_CANCEL) + m_buttonCancel->Hide(); + + //set button focus precedence + if (activeButtons & BUTTON_YES) + m_buttonYes->SetFocus(); + else if (activeButtons & BUTTON_CANCEL) + m_buttonCancel->SetFocus(); + else if (activeButtons & BUTTON_NO) + m_buttonNo->SetFocus(); +} + + +void QuestionDlg::OnClose(wxCloseEvent& event) +{ + if (dontShowAgain) + *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); + EndModal(BUTTON_CANCEL); +} + + +void QuestionDlg::OnCancel(wxCommandEvent& event) +{ + if (dontShowAgain) + *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); + EndModal(BUTTON_CANCEL); +} + + +void QuestionDlg::OnYes(wxCommandEvent& event) +{ + if (dontShowAgain) + *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); + EndModal(BUTTON_YES); +} + +void QuestionDlg::OnNo(wxCommandEvent& event) +{ + if (dontShowAgain) + *dontShowAgain = m_checkBoxDontAskAgain->GetValue(); + EndModal(BUTTON_NO); +} diff --git a/ui/msg_popup.h b/ui/msg_popup.h new file mode 100644 index 00000000..fee3c6ed --- /dev/null +++ b/ui/msg_popup.h @@ -0,0 +1,78 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef MESSAGEPOPUP_H_INCLUDED +#define MESSAGEPOPUP_H_INCLUDED + +#include "gui_generated.h" + + +class ErrorDlg : public ErrorDlgGenerated +{ +public: + ErrorDlg(wxWindow* parentWindow, const int activeButtons, const wxString messageText, bool& ignoreNextErrors); + + enum ReturnCodes + { + BUTTON_IGNORE = 1, + BUTTON_RETRY = 2, + BUTTON_ABORT = 4 + }; + +private: + void OnClose(wxCloseEvent& event); + void OnIgnore(wxCommandEvent& event); + void OnRetry(wxCommandEvent& event); + void OnAbort(wxCommandEvent& event); + + bool& ignoreErrors; +}; + + +class WarningDlg : public WarningDlgGenerated +{ +public: + WarningDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool& dontShowAgain); + + enum Response + { + BUTTON_IGNORE = 1, + BUTTON_SWITCH = 2, + BUTTON_ABORT = 4 + }; + +private: + void OnClose(wxCloseEvent& event); + void OnIgnore(wxCommandEvent& event); + void OnSwitch(wxCommandEvent& event); + void OnAbort(wxCommandEvent& event); + bool& dontShowAgain; +}; + + +class QuestionDlg : public QuestionDlgGenerated +{ +public: + QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxString messageText, bool* dontShowAgain = NULL); + + enum + { + BUTTON_YES = 1, + BUTTON_NO = 2, + BUTTON_CANCEL = 4 + }; + +private: + void OnClose(wxCloseEvent& event); + void OnCancel(wxCommandEvent& event); + void OnYes(wxCommandEvent& event); + void OnNo(wxCommandEvent& event); + + bool* dontShowAgain; //optional +}; + + +#endif // MESSAGEPOPUP_H_INCLUDED diff --git a/ui/progressIndicator.cpp b/ui/progressIndicator.cpp deleted file mode 100644 index 8a1f14f8..00000000 --- a/ui/progressIndicator.cpp +++ /dev/null @@ -1,970 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "progressIndicator.h" -#include -#include "guiGenerated.h" -#include -#include "../library/resources.h" -#include "../shared/stringConv.h" -#include "../shared/util.h" -#include "../library/statistics.h" -#include -#include "../shared/globalFunctions.h" -#include "trayIcon.h" -#include - -#ifdef FFS_WIN -#include "../shared/taskbar.h" -#endif - -using namespace FreeFileSync; - - -namespace -{ -void setNewText(const wxString& newText, wxTextCtrl& control, bool& updateLayout) -{ - if (control.GetValue().length() != newText.length()) - updateLayout = true; //avoid screen flicker: apply only when necessary - - if (control.GetValue() != newText) - control.ChangeValue(newText); -} - -void setNewText(const wxString& newText, wxStaticText& control, bool& updateLayout) -{ - if (control.GetLabel().length() != newText.length()) - updateLayout = true; //avoid screen flicker - - if (control.GetLabel() != newText) - control.SetLabel(newText); -} -} - - -class CompareStatus::CompareStatusImpl : public CompareStatusGenerated -{ -public: - CompareStatusImpl(wxTopLevelWindow& parentWindow); - - void init(); //make visible, initialize all status values - void finalize(); //hide again - - void switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess); - void incScannedObjects_NoUpdate(int number); - void incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); - void setStatusText_NoUpdate(const Zstring& text); - void updateStatusPanelNow(); - -private: - wxTopLevelWindow& parentWindow_; - wxString titleTextBackup; - - //status variables - size_t scannedObjects; - Zstring currentStatusText; - - wxStopWatch timeElapsed; - - //gauge variables - int totalObjects; - wxLongLong totalData; //each data element represents one byte for proper progress indicator scaling - int currentObjects; //each object represents a file or directory processed - wxLongLong currentData; - double scalingFactor; //nr of elements has to be normalized to smaller nr. because of range of int limitation - - void showProgressExternally(const wxString& progressText, float percent = 0); - - enum CurrentStatus - { - SCANNING, - COMPARING_CONTENT, - }; - - CurrentStatus status; - -#ifdef FFS_WIN - std::auto_ptr taskbar_; -#endif - - //remaining time - std::auto_ptr statistics; - long lastStatCallSpeed; //used for calculating intervals between statistics update - long lastStatCallRemTime; // -}; - -//redirect to implementation -CompareStatus::CompareStatus(wxTopLevelWindow& parentWindow) : - pimpl(new CompareStatusImpl(parentWindow)) {} - -CompareStatus::~CompareStatus() -{ - //DON'T delete pimpl! it relies on wxWidgets destruction (parent window destroys child windows!) -} - -wxWindow* CompareStatus::getAsWindow() -{ - return pimpl; -} - -void CompareStatus::init() -{ - pimpl->init(); -} - -void CompareStatus::finalize() -{ - pimpl->finalize(); -} - -void CompareStatus::switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess) -{ - pimpl->switchToCompareBytewise(totalObjectsToProcess, totalDataToProcess); -} - -void CompareStatus::incScannedObjects_NoUpdate(int number) -{ - pimpl->incScannedObjects_NoUpdate(number); -} - -void CompareStatus::incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) -{ - pimpl->incProcessedCmpData_NoUpdate(objectsProcessed, dataProcessed); -} - -void CompareStatus::setStatusText_NoUpdate(const Zstring& text) -{ - pimpl->setStatusText_NoUpdate(text); -} - -void CompareStatus::updateStatusPanelNow() -{ - pimpl->updateStatusPanelNow(); -} -//######################################################################################## - - -CompareStatus::CompareStatusImpl::CompareStatusImpl(wxTopLevelWindow& parentWindow) : - CompareStatusGenerated(&parentWindow), - parentWindow_(parentWindow), - scannedObjects(0), - totalObjects(0), - totalData(0), - currentObjects(0), - currentData(0), - scalingFactor(0), - status(SCANNING), - lastStatCallSpeed(-1000000), //some big number - lastStatCallRemTime(-1000000) -{ - init(); -} - - -void CompareStatus::CompareStatusImpl::init() -{ - titleTextBackup = parentWindow_.GetTitle(); - -#ifdef FFS_WIN - try //try to get access to Windows 7 Taskbar - { - taskbar_.reset(new Utility::TaskbarProgress(parentWindow_)); - } - catch (const Utility::TaskbarNotAvailable&) {} -#endif - - status = SCANNING; - - //initialize gauge - m_gauge2->SetRange(50000); - m_gauge2->SetValue(0); - - //initially hide status that's relevant for comparing bytewise only - bSizerFilesFound->Show(true); - bSizerFilesRemaining->Show(false); - sSizerSpeed->Show(false); - sSizerTimeRemaining->Show(false); - - m_gauge2->Hide(); - bSizer42->Layout(); - - scannedObjects = 0; - currentStatusText.clear(); - - totalObjects = 0; - totalData = 0; - currentObjects = 0; - currentData = 0; - scalingFactor = 0; - - statistics.reset(); - - timeElapsed.Start(); //measure total time - - updateStatusPanelNow(); - - Show(); //make visible -} - - -void CompareStatus::CompareStatusImpl::finalize() //hide again -{ -#ifdef FFS_WIN - taskbar_.reset(); -#endif - - Hide(); - parentWindow_.SetTitle(titleTextBackup); -} - - -void CompareStatus::CompareStatusImpl::switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess) -{ - status = COMPARING_CONTENT; - - currentData = 0; - totalData = totalDataToProcess; - - currentObjects = 0; - totalObjects = totalObjectsToProcess; - - if (totalData != 0) - scalingFactor = 50000 / totalData.ToDouble(); //let's normalize to 50000 - else - scalingFactor = 0; - - //set new statistics handler: 10 seconds "window" for remaining time, 5 seconds for speed - statistics.reset(new Statistics(totalObjectsToProcess, totalDataToProcess.ToDouble(), 10000, 5000)); - lastStatCallSpeed = -1000000; //some big number - lastStatCallRemTime = -1000000; - - //show status for comparing bytewise - bSizerFilesFound->Show(false); - bSizerFilesRemaining->Show(true); - sSizerSpeed->Show(true); - sSizerTimeRemaining->Show(true); - - m_gauge2->Show(); - bSizer42->Layout(); -} - - -void CompareStatus::CompareStatusImpl::incScannedObjects_NoUpdate(int number) -{ - scannedObjects += number; -} - - -void CompareStatus::CompareStatusImpl::incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) -{ - currentData += dataProcessed; - currentObjects += objectsProcessed; -} - - -void CompareStatus::CompareStatusImpl::setStatusText_NoUpdate(const Zstring& text) -{ - currentStatusText = text; -} - - -void CompareStatus::CompareStatusImpl::showProgressExternally(const wxString& progressText, float percent) -{ - if (parentWindow_.GetTitle() != progressText) - parentWindow_.SetTitle(progressText); - - //show progress on Windows 7 taskbar -#ifdef FFS_WIN - using namespace Utility; - - if (taskbar_.get()) - { - const size_t current = 100000 * percent / 100; - const size_t total = 100000; - switch (status) - { - case SCANNING: - taskbar_->setStatus(TaskbarProgress::STATUS_INDETERMINATE); - break; - case COMPARING_CONTENT: - taskbar_->setStatus(TaskbarProgress::STATUS_NORMAL); - taskbar_->setProgress(current, total); - break; - } - } -#endif -} - - -void CompareStatus::CompareStatusImpl::updateStatusPanelNow() -{ - //static RetrieveStatistics statistic; - //statistic.writeEntry(currentData, currentObjects); - { - //wxWindowUpdateLocker dummy(this) -> not needed - - const float percent = totalData == 0 ? 0 : currentData.ToDouble() * 100 / totalData.ToDouble(); - - //write status information to taskbar, parent title ect. - switch (status) - { - case SCANNING: - showProgressExternally(numberToStringSep(scannedObjects) + wxT(" - ") + _("Scanning...")); - break; - case COMPARING_CONTENT: - showProgressExternally(formatPercentage(currentData, totalData) + wxT(" - ") + _("Comparing content..."), percent); - break; - } - - - bool updateLayout = false; //avoid screen flicker by calling layout() only if necessary - - //remove linebreaks from currentStatusText - wxString formattedStatusText = zToWx(currentStatusText); - for (wxString::iterator i = formattedStatusText.begin(); i != formattedStatusText.end(); ++i) - if (*i == wxChar('\n')) - *i = wxChar(' '); - - //status texts - if (m_textCtrlStatus->GetValue() != formattedStatusText) //no layout update for status texts! - m_textCtrlStatus->ChangeValue(formattedStatusText); - - //nr of scanned objects - setNewText(numberToStringSep(scannedObjects), *m_staticTextScanned, updateLayout); - - //progress indicator for "compare file content" - m_gauge2->SetValue(int(currentData.ToDouble() * scalingFactor)); - - //remaining files left for file comparison - const wxString filesToCompareTmp = numberToStringSep(totalObjects - currentObjects); - setNewText(filesToCompareTmp, *m_staticTextFilesRemaining, updateLayout); - - //remaining bytes left for file comparison - const wxString remainingBytesTmp = FreeFileSync::formatFilesizeToShortString(totalData - currentData); - setNewText(remainingBytesTmp, *m_staticTextDataRemaining, updateLayout); - - if (statistics.get()) - { - if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms - { - lastStatCallSpeed = timeElapsed.Time(); - - statistics->addMeasurement(currentObjects, currentData.ToDouble()); - - //current speed - setNewText(statistics->getBytesPerSecond(), *m_staticTextSpeed, updateLayout); - - if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only - { - lastStatCallRemTime = timeElapsed.Time(); - - //remaining time - setNewText(statistics->getRemainingTime(), *m_staticTextTimeRemaining, updateLayout); - } - } - } - - //time elapsed - setNewText(wxTimeSpan::Milliseconds(timeElapsed.Time()).Format(), *m_staticTextTimeElapsed, updateLayout); - - //do the ui update - if (updateLayout) - bSizer42->Layout(); - } - updateUiNow(); -} -//######################################################################################## - - -class SyncStatus::SyncStatusImpl : public SyncStatusDlgGenerated -{ -public: - SyncStatusImpl(StatusHandler& updater, wxTopLevelWindow* parentWindow); - ~SyncStatusImpl(); - - void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess); - void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); - void incScannedObjects_NoUpdate(int number); - void setStatusText_NoUpdate(const Zstring& text); - void updateStatusDialogNow(); - - void setCurrentStatus(SyncStatus::SyncStatusID id); - void processHasFinished(SyncStatus::SyncStatusID id, const wxString& finalMessage); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater - - void minimizeToTray(); - -private: - void OnKeyPressed(wxKeyEvent& event); - virtual void OnOkay(wxCommandEvent& event); - virtual void OnPause(wxCommandEvent& event); - virtual void OnAbort(wxCommandEvent& event); - virtual void OnClose(wxCloseEvent& event); - virtual void OnIconize(wxIconizeEvent& event); - - void resumeFromSystray(); - bool currentProcessIsRunning(); - void showProgressExternally(const wxString& progressText, float percent = 0); //percent may already be included in progressText - - wxStopWatch timeElapsed; - - StatusHandler* processStatusHandler; - wxTopLevelWindow* mainDialog; - - //gauge variables - int totalObjects; - wxLongLong totalData; - int currentObjects; //each object represents a file or directory processed - wxLongLong currentData; //each data element represents one byte for proper progress indicator scaling - double scalingFactor; //nr of elements has to be normalized to smaller nr. because of range of int limitation - - //status variables - size_t scannedObjects; - Zstring currentStatusText; - - bool processPaused; - SyncStatus::SyncStatusID currentStatus; - -#ifdef FFS_WIN - std::auto_ptr taskbar_; -#endif - - //remaining time - std::auto_ptr statistics; - long lastStatCallSpeed; //used for calculating intervals between statistics update - long lastStatCallRemTime; // - - wxString titelTextBackup; - - boost::shared_ptr minimizedToSysTray; //optional: if filled, hides all visible windows, shows again if destroyed -}; - - -//redirect to implementation -SyncStatus::SyncStatus(StatusHandler& updater, wxTopLevelWindow* parentWindow, bool startSilent) : - pimpl(new SyncStatusImpl(updater, parentWindow)) -{ - if (startSilent) - pimpl->minimizeToTray(); - else - { - pimpl->Show(); - pimpl->updateStatusDialogNow(); //update visual statistics to get rid of "dummy" texts - } -} - -SyncStatus::~SyncStatus() -{ - //DON'T delete pimpl! it will be deleted by the user clicking "OK/Cancel" -> (wxWindow::Destroy()) -} - -wxWindow* SyncStatus::getAsWindow() -{ - return pimpl; -} - -void SyncStatus::closeWindowDirectly() //don't wait for user (silent mode) -{ - pimpl->Destroy(); -} - -void SyncStatus::resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess) -{ - pimpl->resetGauge(totalObjectsToProcess, totalDataToProcess); -} - -void SyncStatus::incScannedObjects_NoUpdate(int number) -{ - pimpl->incScannedObjects_NoUpdate(number); -} - -void SyncStatus::incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) -{ - pimpl->incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); -} - -void SyncStatus::setStatusText_NoUpdate(const Zstring& text) -{ - pimpl->setStatusText_NoUpdate(text); -} - -void SyncStatus::updateStatusDialogNow() -{ - pimpl->updateStatusDialogNow(); -} - -void SyncStatus::setCurrentStatus(SyncStatusID id) -{ - pimpl->setCurrentStatus(id); -} - -void SyncStatus::processHasFinished(SyncStatusID id, const wxString& finalMessage) -{ - pimpl->processHasFinished(id, finalMessage); -} -//######################################################################################## - - -SyncStatus::SyncStatusImpl::SyncStatusImpl(StatusHandler& updater, wxTopLevelWindow* parentWindow) : - SyncStatusDlgGenerated(parentWindow, - wxID_ANY, - parentWindow ? wxString(wxEmptyString) : (wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")), - wxDefaultPosition, wxSize(638, 376), - parentWindow ? - wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT : //wxTAB_TRAVERSAL is needed for standard button handling: wxID_OK/wxID_CANCEL - wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL), - processStatusHandler(&updater), - mainDialog(parentWindow), - totalObjects(0), - totalData(0), - currentObjects(0), - currentData(0), - scalingFactor(0), - scannedObjects(0), - processPaused(false), - currentStatus(SyncStatus::ABORTED), - lastStatCallSpeed(-1000000), //some big number - lastStatCallRemTime(-1000000) -{ - if (mainDialog) //save old title (will be used as progress indicator) - titelTextBackup = mainDialog->GetTitle(); - - m_animationControl1->SetAnimation(*GlobalResources::getInstance().animationSync); - m_animationControl1->Play(); - - m_staticTextSpeed->SetLabel(wxT("-")); - m_staticTextTimeRemaining->SetLabel(wxT("-")); - - //initialize gauge - m_gauge1->SetRange(50000); - m_gauge1->SetValue(0); - - if (IsShown()) //don't steal focus when starting in sys-tray! - m_buttonAbort->SetFocus(); - - if (mainDialog) //disable (main) window while this status dialog is shown - mainDialog->Disable(); - - timeElapsed.Start(); //measure total time - -#ifdef FFS_WIN - try //try to get access to Windows 7 Taskbar - { - taskbar_.reset(new Utility::TaskbarProgress(mainDialog != NULL ? *mainDialog : *this)); - } - catch (const Utility::TaskbarNotAvailable&) {} -#endif - - //hide "processed" statistics until end of process - bSizerObjectsProcessed->Show(false); - //bSizerDataProcessed->Show(false); - - SetIcon(*GlobalResources::getInstance().programIcon); //set application icon - - //register key event - Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(SyncStatusImpl::OnKeyPressed), NULL, this); -} - - -SyncStatus::SyncStatusImpl::~SyncStatusImpl() -{ - if (mainDialog) - { - //restore title text - mainDialog->SetTitle(titelTextBackup); - - mainDialog->Enable(); - mainDialog->Raise(); - mainDialog->SetFocus(); - } - - if (minimizedToSysTray.get()) - minimizedToSysTray->keepHidden(); //prevent window from flashing shortly before it is destroyed -} - - -void SyncStatus::SyncStatusImpl::OnKeyPressed(wxKeyEvent& event) -{ - const int keyCode = event.GetKeyCode(); - if (keyCode == WXK_ESCAPE) - Close(); //generate close event: do NOT destroy window unconditionally! - - event.Skip(); -} - - -void SyncStatus::SyncStatusImpl::resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess) -{ - currentData = 0; - totalData = totalDataToProcess; - - currentObjects = 0; - totalObjects = totalObjectsToProcess; - - if (totalData != 0) - scalingFactor = 50000 / totalData.ToDouble(); //let's normalize to 50000 - else - scalingFactor = 0; - - //set new statistics handler: 10 seconds "window" for remaining time, 5 seconds for speed - statistics.reset(new Statistics(totalObjectsToProcess, totalDataToProcess.ToDouble(), 10000, 5000)); - lastStatCallSpeed = -1000000; //some big number - lastStatCallRemTime = -1000000; -} - - -void SyncStatus::SyncStatusImpl::incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) -{ - currentData += dataProcessed; - currentObjects += objectsProcessed; -} - - -void SyncStatus::SyncStatusImpl::incScannedObjects_NoUpdate(int number) -{ - scannedObjects += number; -} - - -void SyncStatus::SyncStatusImpl::setStatusText_NoUpdate(const Zstring& text) -{ - currentStatusText = text; -} - - -void SyncStatus::SyncStatusImpl::showProgressExternally(const wxString& progressText, float percent) -{ - //write status information to systray, if window is minimized - if (minimizedToSysTray.get()) - minimizedToSysTray->setToolTip(progressText, percent); - //minimizedToSysTray may be a zombie... so set title text anyway - - if (mainDialog) //show percentage in maindialog title (and thereby in taskbar) - { - if (mainDialog->GetTitle() != progressText) - mainDialog->SetTitle(progressText); - } - else //show percentage in this dialog's title (and thereby in taskbar) - { - if (this->GetTitle() != progressText) - this->SetTitle(progressText); - } - -#ifdef FFS_WIN - using namespace Utility; - - //show progress on Windows 7 taskbar - if (taskbar_.get()) - { - const size_t current = 100000 * percent / 100; - const size_t total = 100000; - - switch (currentStatus) - { - case SyncStatus::SCANNING: - taskbar_->setStatus(TaskbarProgress::STATUS_INDETERMINATE); - break; - case SyncStatus::FINISHED_WITH_SUCCESS: - case SyncStatus::COMPARING_CONTENT: - case SyncStatus::SYNCHRONIZING: - taskbar_->setStatus(TaskbarProgress::STATUS_NORMAL); - taskbar_->setProgress(current, total); - break; - case SyncStatus::PAUSE: - taskbar_->setStatus(TaskbarProgress::STATUS_PAUSED); - taskbar_->setProgress(current, total); - break; - case SyncStatus::ABORTED: - case SyncStatus::FINISHED_WITH_ERROR: - taskbar_->setStatus(TaskbarProgress::STATUS_ERROR); - taskbar_->setProgress(current, total); - break; - } - } -#endif -} - - -void SyncStatus::SyncStatusImpl::updateStatusDialogNow() -{ - //static RetrieveStatistics statistic; - //statistic.writeEntry(currentData, currentObjects); - - const float percent = totalData == 0 ? 0 : currentData.ToDouble() * 100 / totalData.ToDouble(); - - //write status information to systray, taskbar, parent title ect. - switch (currentStatus) - { - case SyncStatus::SCANNING: - showProgressExternally(numberToStringSep(scannedObjects) + wxT(" - ") + _("Scanning...")); - break; - case SyncStatus::COMPARING_CONTENT: - showProgressExternally(formatPercentage(currentData, totalData) + wxT(" - ") + _("Comparing content..."), percent); - break; - case SyncStatus::SYNCHRONIZING: - showProgressExternally(formatPercentage(currentData, totalData) + wxT(" - ") + _("Synchronizing..."), percent); - break; - case SyncStatus::PAUSE: - showProgressExternally((totalData != 0 ? formatPercentage(currentData, totalData) + wxT(" - ") : wxString()) + _("Paused"), percent); - break; - case SyncStatus::ABORTED: - showProgressExternally(_("Aborted"), percent); - break; - case SyncStatus::FINISHED_WITH_SUCCESS: - case SyncStatus::FINISHED_WITH_ERROR: - showProgressExternally(_("Completed"), percent); - break; - } - - //write regular status information (whether dialog is visible or not) - { - //wxWindowUpdateLocker dummy(this); -> not needed - - bool updateLayout = false; //avoid screen flicker by calling layout() only if necessary - - //progress indicator - if (currentStatus == SyncStatus::SCANNING) - m_gauge1->Pulse(); - else - m_gauge1->SetValue(globalFunctions::round(currentData.ToDouble() * scalingFactor)); - - //status text - const wxString statusTxt = zToWx(currentStatusText); - if (m_textCtrlInfo->GetValue() != statusTxt) //no layout update for status texts! - m_textCtrlInfo->ChangeValue(statusTxt); - - //remaining objects - const wxString remainingObjTmp = numberToStringSep(totalObjects - currentObjects); - setNewText(remainingObjTmp, *m_staticTextRemainingObj, updateLayout); - - //remaining bytes left for copy - const wxString remainingBytesTmp = FreeFileSync::formatFilesizeToShortString(totalData - currentData); - setNewText(remainingBytesTmp, *m_staticTextDataRemaining, updateLayout); - - if (statistics.get()) - { - if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms - { - lastStatCallSpeed = timeElapsed.Time(); - - statistics->addMeasurement(currentObjects, currentData.ToDouble()); - - //current speed - setNewText(statistics->getBytesPerSecond(), *m_staticTextSpeed, updateLayout); - - if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only - { - lastStatCallRemTime = timeElapsed.Time(); - - //remaining time - setNewText(statistics->getRemainingTime(), *m_staticTextTimeRemaining, updateLayout); - } - } - } - - //time elapsed - setNewText(wxTimeSpan::Milliseconds(timeElapsed.Time()).Format(), *m_staticTextTimeElapsed, updateLayout); - - //do the ui update - if (updateLayout) - { - bSizer28->Layout(); - bSizer31->Layout(); - } - } - - //support for pause button - while (processPaused && currentProcessIsRunning()) - { - wxMilliSleep(UI_UPDATE_INTERVAL); - updateUiNow(); - } - - updateUiNow(); -} - - -bool SyncStatus::SyncStatusImpl::currentProcessIsRunning() -{ - return processStatusHandler != NULL; -} - - -void SyncStatus::SyncStatusImpl::setCurrentStatus(SyncStatus::SyncStatusID id) -{ - switch (id) - { - case SyncStatus::ABORTED: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusError"))); - m_staticTextStatus->SetLabel(_("Aborted")); - break; - - case SyncStatus::FINISHED_WITH_SUCCESS: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusSuccess"))); - m_staticTextStatus->SetLabel(_("Completed")); - break; - - case SyncStatus::FINISHED_WITH_ERROR: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusWarning"))); - m_staticTextStatus->SetLabel(_("Completed")); - break; - - case SyncStatus::PAUSE: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusPause"))); - m_staticTextStatus->SetLabel(_("Paused")); - break; - - case SyncStatus::SCANNING: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusScanning"))); - m_staticTextStatus->SetLabel(_("Scanning...")); - break; - - case SyncStatus::COMPARING_CONTENT: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusBinaryCompare"))); - m_staticTextStatus->SetLabel(_("Comparing content...")); - break; - - case SyncStatus::SYNCHRONIZING: - m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusSyncing"))); - m_staticTextStatus->SetLabel(_("Synchronizing...")); - break; - } - - currentStatus = id; - Layout(); -} - - -void SyncStatus::SyncStatusImpl::processHasFinished(SyncStatus::SyncStatusID id, const wxString& finalMessage) //essential to call this in StatusHandler derived class destructor -{ - //at the LATEST(!) to prevent access to currentStatusHandler - //enable okay and close events; may be set in this method ONLY - - processStatusHandler = NULL; //avoid callback to (maybe) deleted parent process - - setCurrentStatus(id); - - resumeFromSystray(); //if in tray mode... - - m_buttonAbort->Disable(); - m_buttonAbort->Hide(); - m_buttonPause->Disable(); - m_buttonPause->Hide(); - m_buttonOK->Show(); - m_buttonOK->Enable(); - - if (IsShown()) //don't steal focus when residing in sys-tray! - m_buttonOK->SetFocus(); - - m_animationControl1->Stop(); - m_animationControl1->Hide(); - - //hide speed and remaining time - bSizerSpeed ->Show(false); - bSizerRemTime->Show(false); - - //if everything was processed successfully, hide remaining statistics (is 0 anyway) - if ( totalObjects == currentObjects && - totalData == currentData) - { - bSizerObjectsRemaining->Show(false); - - bSizerObjectsProcessed->Show(true); - - m_staticTextProcessedObj->SetLabel(numberToStringSep(currentObjects)); - m_staticTextDataProcessed->SetLabel(FreeFileSync::formatFilesizeToShortString(currentData)); - } - - updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed - m_textCtrlInfo->SetValue(finalMessage); // - Layout(); // - - //Raise(); -> don't! user may be watching a movie in the meantime ;) -} - - -void SyncStatus::SyncStatusImpl::OnOkay(wxCommandEvent& event) -{ - Close(); //generate close event: do NOT destroy window unconditionally! -} - - -void SyncStatus::SyncStatusImpl::OnAbort(wxCommandEvent& event) -{ - Close(); //generate close event: do NOT destroy window unconditionally! -} - - -void SyncStatus::SyncStatusImpl::OnPause(wxCommandEvent& event) -{ - static SyncStatus::SyncStatusID previousStatus = SyncStatus::ABORTED; - - if (processPaused) - { - setCurrentStatus(previousStatus); - processPaused = false; - m_buttonPause->SetLabel(_("Pause")); - m_animationControl1->Play(); - - //resume timers - timeElapsed.Resume(); - if (statistics.get()) - statistics->resumeTimer(); - } - else - { - previousStatus = currentStatus; //save current status - - setCurrentStatus(SyncStatus::PAUSE); - processPaused = true; - m_buttonPause->SetLabel(_("Continue")); - m_animationControl1->Stop(); - - //pause timers - timeElapsed.Pause(); - if (statistics.get()) - statistics->pauseTimer(); - } -} - - -void SyncStatus::SyncStatusImpl::OnClose(wxCloseEvent& event) -{ - processPaused = false; - if (currentProcessIsRunning()) - { - m_buttonAbort->Disable(); - m_buttonAbort->Hide(); - m_buttonPause->Disable(); - m_buttonPause->Hide(); - - setStatusText_NoUpdate(wxToZ(_("Abort requested: Waiting for current operation to finish..."))); - //no Layout() or UI-update here to avoid cascaded Yield()-call - - processStatusHandler->requestAbortion(); - } - else - Destroy(); -} - - -void SyncStatus::SyncStatusImpl::OnIconize(wxIconizeEvent& event) -{ - if (event.Iconized()) //ATTENTION: iconize event is also triggered on "Restore"! (at least under Linux) - minimizeToTray(); -} - - -void SyncStatus::SyncStatusImpl::minimizeToTray() -{ - minimizedToSysTray.reset(new MinimizeToTray(this, mainDialog)); -} - - -void SyncStatus::SyncStatusImpl::resumeFromSystray() -{ - minimizedToSysTray.reset(); -} diff --git a/ui/progressIndicator.h b/ui/progressIndicator.h deleted file mode 100644 index b6964fe6..00000000 --- a/ui/progressIndicator.h +++ /dev/null @@ -1,77 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef PROGRESSINDICATOR_H_INCLUDED -#define PROGRESSINDICATOR_H_INCLUDED - -#include "../shared/zstring.h" -#include -#include "../library/statusHandler.h" - - -class CompareStatus -{ -public: - CompareStatus(wxTopLevelWindow& parentWindow); //CompareStatus will be owned by parentWindow! - ~CompareStatus(); - - wxWindow* getAsWindow(); //convenience! don't abuse! - - void init(); //make visible, initialize all status values - void finalize(); //hide again - - void switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess); - void incScannedObjects_NoUpdate(int number); - void incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); - void setStatusText_NoUpdate(const Zstring& text); - void updateStatusPanelNow(); - -private: - class CompareStatusImpl; - CompareStatusImpl* const pimpl; -}; - - -class SyncStatus -{ -public: - SyncStatus(StatusHandler& updater, - wxTopLevelWindow* parentWindow, //may be NULL - bool startSilent); - ~SyncStatus(); - - wxWindow* getAsWindow(); //convenience! don't abuse! - - enum SyncStatusID - { - ABORTED, - FINISHED_WITH_SUCCESS, - FINISHED_WITH_ERROR, - PAUSE, - SCANNING, - COMPARING_CONTENT, - SYNCHRONIZING - }; - - void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess); - void incScannedObjects_NoUpdate(int number); - void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); - void setStatusText_NoUpdate(const Zstring& text); - void updateStatusDialogNow(); - - void setCurrentStatus(SyncStatusID id); - - //essential to call one of these two methods in StatusUpdater derived class destructor at the LATEST(!) - //to prevent access to callback to updater (e.g. request abort) - void processHasFinished(SyncStatusID id, const wxString& finalMessage); - void closeWindowDirectly(); //don't wait for user - -private: - class SyncStatusImpl; - SyncStatusImpl* const pimpl; -}; - -#endif // PROGRESSINDICATOR_H_INCLUDED diff --git a/ui/progress_indicator.cpp b/ui/progress_indicator.cpp new file mode 100644 index 00000000..f41ccc36 --- /dev/null +++ b/ui/progress_indicator.cpp @@ -0,0 +1,970 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "progress_indicator.h" +#include +#include "gui_generated.h" +#include +#include "../library/resources.h" +#include "../shared/string_conv.h" +#include "../shared/util.h" +#include "../library/statistics.h" +#include +#include "../shared/global_func.h" +#include "tray_icon.h" +#include + +#ifdef FFS_WIN +#include "../shared/taskbar.h" +#endif + +using namespace ffs3; + + +namespace +{ +void setNewText(const wxString& newText, wxTextCtrl& control, bool& updateLayout) +{ + if (control.GetValue().length() != newText.length()) + updateLayout = true; //avoid screen flicker: apply only when necessary + + if (control.GetValue() != newText) + control.ChangeValue(newText); +} + +void setNewText(const wxString& newText, wxStaticText& control, bool& updateLayout) +{ + if (control.GetLabel().length() != newText.length()) + updateLayout = true; //avoid screen flicker + + if (control.GetLabel() != newText) + control.SetLabel(newText); +} +} + + +class CompareStatus::CompareStatusImpl : public CompareStatusGenerated +{ +public: + CompareStatusImpl(wxTopLevelWindow& parentWindow); + + void init(); //make visible, initialize all status values + void finalize(); //hide again + + void switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess); + void incScannedObjects_NoUpdate(int number); + void incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); + void setStatusText_NoUpdate(const Zstring& text); + void updateStatusPanelNow(); + +private: + wxTopLevelWindow& parentWindow_; + wxString titleTextBackup; + + //status variables + size_t scannedObjects; + Zstring currentStatusText; + + wxStopWatch timeElapsed; + + //gauge variables + int totalObjects; + wxLongLong totalData; //each data element represents one byte for proper progress indicator scaling + int currentObjects; //each object represents a file or directory processed + wxLongLong currentData; + double scalingFactor; //nr of elements has to be normalized to smaller nr. because of range of int limitation + + void showProgressExternally(const wxString& progressText, float percent = 0); + + enum CurrentStatus + { + SCANNING, + COMPARING_CONTENT, + }; + + CurrentStatus status; + +#ifdef FFS_WIN + std::auto_ptr taskbar_; +#endif + + //remaining time + std::auto_ptr statistics; + long lastStatCallSpeed; //used for calculating intervals between statistics update + long lastStatCallRemTime; // +}; + +//redirect to implementation +CompareStatus::CompareStatus(wxTopLevelWindow& parentWindow) : + pimpl(new CompareStatusImpl(parentWindow)) {} + +CompareStatus::~CompareStatus() +{ + //DON'T delete pimpl! it relies on wxWidgets destruction (parent window destroys child windows!) +} + +wxWindow* CompareStatus::getAsWindow() +{ + return pimpl; +} + +void CompareStatus::init() +{ + pimpl->init(); +} + +void CompareStatus::finalize() +{ + pimpl->finalize(); +} + +void CompareStatus::switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess) +{ + pimpl->switchToCompareBytewise(totalObjectsToProcess, totalDataToProcess); +} + +void CompareStatus::incScannedObjects_NoUpdate(int number) +{ + pimpl->incScannedObjects_NoUpdate(number); +} + +void CompareStatus::incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) +{ + pimpl->incProcessedCmpData_NoUpdate(objectsProcessed, dataProcessed); +} + +void CompareStatus::setStatusText_NoUpdate(const Zstring& text) +{ + pimpl->setStatusText_NoUpdate(text); +} + +void CompareStatus::updateStatusPanelNow() +{ + pimpl->updateStatusPanelNow(); +} +//######################################################################################## + + +CompareStatus::CompareStatusImpl::CompareStatusImpl(wxTopLevelWindow& parentWindow) : + CompareStatusGenerated(&parentWindow), + parentWindow_(parentWindow), + scannedObjects(0), + totalObjects(0), + totalData(0), + currentObjects(0), + currentData(0), + scalingFactor(0), + status(SCANNING), + lastStatCallSpeed(-1000000), //some big number + lastStatCallRemTime(-1000000) +{ + init(); +} + + +void CompareStatus::CompareStatusImpl::init() +{ + titleTextBackup = parentWindow_.GetTitle(); + +#ifdef FFS_WIN + try //try to get access to Windows 7 Taskbar + { + taskbar_.reset(new util::TaskbarProgress(parentWindow_)); + } + catch (const util::TaskbarNotAvailable&) {} +#endif + + status = SCANNING; + + //initialize gauge + m_gauge2->SetRange(50000); + m_gauge2->SetValue(0); + + //initially hide status that's relevant for comparing bytewise only + bSizerFilesFound->Show(true); + bSizerFilesRemaining->Show(false); + sSizerSpeed->Show(false); + sSizerTimeRemaining->Show(false); + + m_gauge2->Hide(); + bSizer42->Layout(); + + scannedObjects = 0; + currentStatusText.clear(); + + totalObjects = 0; + totalData = 0; + currentObjects = 0; + currentData = 0; + scalingFactor = 0; + + statistics.reset(); + + timeElapsed.Start(); //measure total time + + updateStatusPanelNow(); + + Show(); //make visible +} + + +void CompareStatus::CompareStatusImpl::finalize() //hide again +{ +#ifdef FFS_WIN + taskbar_.reset(); +#endif + + Hide(); + parentWindow_.SetTitle(titleTextBackup); +} + + +void CompareStatus::CompareStatusImpl::switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess) +{ + status = COMPARING_CONTENT; + + currentData = 0; + totalData = totalDataToProcess; + + currentObjects = 0; + totalObjects = totalObjectsToProcess; + + if (totalData != 0) + scalingFactor = 50000 / totalData.ToDouble(); //let's normalize to 50000 + else + scalingFactor = 0; + + //set new statistics handler: 10 seconds "window" for remaining time, 5 seconds for speed + statistics.reset(new Statistics(totalObjectsToProcess, totalDataToProcess.ToDouble(), 10000, 5000)); + lastStatCallSpeed = -1000000; //some big number + lastStatCallRemTime = -1000000; + + //show status for comparing bytewise + bSizerFilesFound->Show(false); + bSizerFilesRemaining->Show(true); + sSizerSpeed->Show(true); + sSizerTimeRemaining->Show(true); + + m_gauge2->Show(); + bSizer42->Layout(); +} + + +void CompareStatus::CompareStatusImpl::incScannedObjects_NoUpdate(int number) +{ + scannedObjects += number; +} + + +void CompareStatus::CompareStatusImpl::incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) +{ + currentData += dataProcessed; + currentObjects += objectsProcessed; +} + + +void CompareStatus::CompareStatusImpl::setStatusText_NoUpdate(const Zstring& text) +{ + currentStatusText = text; +} + + +void CompareStatus::CompareStatusImpl::showProgressExternally(const wxString& progressText, float percent) +{ + if (parentWindow_.GetTitle() != progressText) + parentWindow_.SetTitle(progressText); + + //show progress on Windows 7 taskbar +#ifdef FFS_WIN + using namespace util; + + if (taskbar_.get()) + { + const size_t current = 100000 * percent / 100; + const size_t total = 100000; + switch (status) + { + case SCANNING: + taskbar_->setStatus(TaskbarProgress::STATUS_INDETERMINATE); + break; + case COMPARING_CONTENT: + taskbar_->setStatus(TaskbarProgress::STATUS_NORMAL); + taskbar_->setProgress(current, total); + break; + } + } +#endif +} + + +void CompareStatus::CompareStatusImpl::updateStatusPanelNow() +{ + //static RetrieveStatistics statistic; + //statistic.writeEntry(currentData, currentObjects); + { + //wxWindowUpdateLocker dummy(this) -> not needed + + const float percent = totalData == 0 ? 0 : currentData.ToDouble() * 100 / totalData.ToDouble(); + + //write status information to taskbar, parent title ect. + switch (status) + { + case SCANNING: + showProgressExternally(numberToStringSep(scannedObjects) + wxT(" - ") + _("Scanning...")); + break; + case COMPARING_CONTENT: + showProgressExternally(formatPercentage(currentData, totalData) + wxT(" - ") + _("Comparing content..."), percent); + break; + } + + + bool updateLayout = false; //avoid screen flicker by calling layout() only if necessary + + //remove linebreaks from currentStatusText + wxString formattedStatusText = zToWx(currentStatusText); + for (wxString::iterator i = formattedStatusText.begin(); i != formattedStatusText.end(); ++i) + if (*i == wxChar('\n')) + *i = wxChar(' '); + + //status texts + if (m_textCtrlStatus->GetValue() != formattedStatusText) //no layout update for status texts! + m_textCtrlStatus->ChangeValue(formattedStatusText); + + //nr of scanned objects + setNewText(numberToStringSep(scannedObjects), *m_staticTextScanned, updateLayout); + + //progress indicator for "compare file content" + m_gauge2->SetValue(int(currentData.ToDouble() * scalingFactor)); + + //remaining files left for file comparison + const wxString filesToCompareTmp = numberToStringSep(totalObjects - currentObjects); + setNewText(filesToCompareTmp, *m_staticTextFilesRemaining, updateLayout); + + //remaining bytes left for file comparison + const wxString remainingBytesTmp = ffs3::formatFilesizeToShortString(totalData - currentData); + setNewText(remainingBytesTmp, *m_staticTextDataRemaining, updateLayout); + + if (statistics.get()) + { + if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms + { + lastStatCallSpeed = timeElapsed.Time(); + + statistics->addMeasurement(currentObjects, currentData.ToDouble()); + + //current speed + setNewText(statistics->getBytesPerSecond(), *m_staticTextSpeed, updateLayout); + + if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only + { + lastStatCallRemTime = timeElapsed.Time(); + + //remaining time + setNewText(statistics->getRemainingTime(), *m_staticTextTimeRemaining, updateLayout); + } + } + } + + //time elapsed + setNewText(wxTimeSpan::Milliseconds(timeElapsed.Time()).Format(), *m_staticTextTimeElapsed, updateLayout); + + //do the ui update + if (updateLayout) + bSizer42->Layout(); + } + updateUiNow(); +} +//######################################################################################## + + +class SyncStatus::SyncStatusImpl : public SyncStatusDlgGenerated +{ +public: + SyncStatusImpl(StatusHandler& updater, wxTopLevelWindow* parentWindow); + ~SyncStatusImpl(); + + void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess); + void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); + void incScannedObjects_NoUpdate(int number); + void setStatusText_NoUpdate(const Zstring& text); + void updateStatusDialogNow(); + + void setCurrentStatus(SyncStatus::SyncStatusID id); + void processHasFinished(SyncStatus::SyncStatusID id, const wxString& finalMessage); //essential to call this in StatusUpdater derived class destructor at the LATEST(!) to prevent access to currentStatusUpdater + + void minimizeToTray(); + +private: + void OnKeyPressed(wxKeyEvent& event); + virtual void OnOkay(wxCommandEvent& event); + virtual void OnPause(wxCommandEvent& event); + virtual void OnAbort(wxCommandEvent& event); + virtual void OnClose(wxCloseEvent& event); + virtual void OnIconize(wxIconizeEvent& event); + + void resumeFromSystray(); + bool currentProcessIsRunning(); + void showProgressExternally(const wxString& progressText, float percent = 0); //percent may already be included in progressText + + wxStopWatch timeElapsed; + + StatusHandler* processStatusHandler; + wxTopLevelWindow* mainDialog; + + //gauge variables + int totalObjects; + wxLongLong totalData; + int currentObjects; //each object represents a file or directory processed + wxLongLong currentData; //each data element represents one byte for proper progress indicator scaling + double scalingFactor; //nr of elements has to be normalized to smaller nr. because of range of int limitation + + //status variables + size_t scannedObjects; + Zstring currentStatusText; + + bool processPaused; + SyncStatus::SyncStatusID currentStatus; + +#ifdef FFS_WIN + std::auto_ptr taskbar_; +#endif + + //remaining time + std::auto_ptr statistics; + long lastStatCallSpeed; //used for calculating intervals between statistics update + long lastStatCallRemTime; // + + wxString titelTextBackup; + + boost::shared_ptr minimizedToSysTray; //optional: if filled, hides all visible windows, shows again if destroyed +}; + + +//redirect to implementation +SyncStatus::SyncStatus(StatusHandler& updater, wxTopLevelWindow* parentWindow, bool startSilent) : + pimpl(new SyncStatusImpl(updater, parentWindow)) +{ + if (startSilent) + pimpl->minimizeToTray(); + else + { + pimpl->Show(); + pimpl->updateStatusDialogNow(); //update visual statistics to get rid of "dummy" texts + } +} + +SyncStatus::~SyncStatus() +{ + //DON'T delete pimpl! it will be deleted by the user clicking "OK/Cancel" -> (wxWindow::Destroy()) +} + +wxWindow* SyncStatus::getAsWindow() +{ + return pimpl; +} + +void SyncStatus::closeWindowDirectly() //don't wait for user (silent mode) +{ + pimpl->Destroy(); +} + +void SyncStatus::resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess) +{ + pimpl->resetGauge(totalObjectsToProcess, totalDataToProcess); +} + +void SyncStatus::incScannedObjects_NoUpdate(int number) +{ + pimpl->incScannedObjects_NoUpdate(number); +} + +void SyncStatus::incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) +{ + pimpl->incProgressIndicator_NoUpdate(objectsProcessed, dataProcessed); +} + +void SyncStatus::setStatusText_NoUpdate(const Zstring& text) +{ + pimpl->setStatusText_NoUpdate(text); +} + +void SyncStatus::updateStatusDialogNow() +{ + pimpl->updateStatusDialogNow(); +} + +void SyncStatus::setCurrentStatus(SyncStatusID id) +{ + pimpl->setCurrentStatus(id); +} + +void SyncStatus::processHasFinished(SyncStatusID id, const wxString& finalMessage) +{ + pimpl->processHasFinished(id, finalMessage); +} +//######################################################################################## + + +SyncStatus::SyncStatusImpl::SyncStatusImpl(StatusHandler& updater, wxTopLevelWindow* parentWindow) : + SyncStatusDlgGenerated(parentWindow, + wxID_ANY, + parentWindow ? wxString(wxEmptyString) : (wxString(wxT("FreeFileSync - ")) + _("Folder Comparison and Synchronization")), + wxDefaultPosition, wxSize(638, 376), + parentWindow ? + wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL | wxFRAME_NO_TASKBAR | wxFRAME_FLOAT_ON_PARENT : //wxTAB_TRAVERSAL is needed for standard button handling: wxID_OK/wxID_CANCEL + wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL), + processStatusHandler(&updater), + mainDialog(parentWindow), + totalObjects(0), + totalData(0), + currentObjects(0), + currentData(0), + scalingFactor(0), + scannedObjects(0), + processPaused(false), + currentStatus(SyncStatus::ABORTED), + lastStatCallSpeed(-1000000), //some big number + lastStatCallRemTime(-1000000) +{ + if (mainDialog) //save old title (will be used as progress indicator) + titelTextBackup = mainDialog->GetTitle(); + + m_animationControl1->SetAnimation(*GlobalResources::getInstance().animationSync); + m_animationControl1->Play(); + + m_staticTextSpeed->SetLabel(wxT("-")); + m_staticTextTimeRemaining->SetLabel(wxT("-")); + + //initialize gauge + m_gauge1->SetRange(50000); + m_gauge1->SetValue(0); + + if (IsShown()) //don't steal focus when starting in sys-tray! + m_buttonAbort->SetFocus(); + + if (mainDialog) //disable (main) window while this status dialog is shown + mainDialog->Disable(); + + timeElapsed.Start(); //measure total time + +#ifdef FFS_WIN + try //try to get access to Windows 7 Taskbar + { + taskbar_.reset(new util::TaskbarProgress(mainDialog != NULL ? *mainDialog : *this)); + } + catch (const util::TaskbarNotAvailable&) {} +#endif + + //hide "processed" statistics until end of process + bSizerObjectsProcessed->Show(false); + //bSizerDataProcessed->Show(false); + + SetIcon(*GlobalResources::getInstance().programIcon); //set application icon + + //register key event + Connect(wxEVT_CHAR_HOOK, wxKeyEventHandler(SyncStatusImpl::OnKeyPressed), NULL, this); +} + + +SyncStatus::SyncStatusImpl::~SyncStatusImpl() +{ + if (mainDialog) + { + //restore title text + mainDialog->SetTitle(titelTextBackup); + + mainDialog->Enable(); + mainDialog->Raise(); + mainDialog->SetFocus(); + } + + if (minimizedToSysTray.get()) + minimizedToSysTray->keepHidden(); //prevent window from flashing shortly before it is destroyed +} + + +void SyncStatus::SyncStatusImpl::OnKeyPressed(wxKeyEvent& event) +{ + const int keyCode = event.GetKeyCode(); + if (keyCode == WXK_ESCAPE) + Close(); //generate close event: do NOT destroy window unconditionally! + + event.Skip(); +} + + +void SyncStatus::SyncStatusImpl::resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess) +{ + currentData = 0; + totalData = totalDataToProcess; + + currentObjects = 0; + totalObjects = totalObjectsToProcess; + + if (totalData != 0) + scalingFactor = 50000 / totalData.ToDouble(); //let's normalize to 50000 + else + scalingFactor = 0; + + //set new statistics handler: 10 seconds "window" for remaining time, 5 seconds for speed + statistics.reset(new Statistics(totalObjectsToProcess, totalDataToProcess.ToDouble(), 10000, 5000)); + lastStatCallSpeed = -1000000; //some big number + lastStatCallRemTime = -1000000; +} + + +void SyncStatus::SyncStatusImpl::incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed) +{ + currentData += dataProcessed; + currentObjects += objectsProcessed; +} + + +void SyncStatus::SyncStatusImpl::incScannedObjects_NoUpdate(int number) +{ + scannedObjects += number; +} + + +void SyncStatus::SyncStatusImpl::setStatusText_NoUpdate(const Zstring& text) +{ + currentStatusText = text; +} + + +void SyncStatus::SyncStatusImpl::showProgressExternally(const wxString& progressText, float percent) +{ + //write status information to systray, if window is minimized + if (minimizedToSysTray.get()) + minimizedToSysTray->setToolTip(progressText, percent); + //minimizedToSysTray may be a zombie... so set title text anyway + + if (mainDialog) //show percentage in maindialog title (and thereby in taskbar) + { + if (mainDialog->GetTitle() != progressText) + mainDialog->SetTitle(progressText); + } + else //show percentage in this dialog's title (and thereby in taskbar) + { + if (this->GetTitle() != progressText) + this->SetTitle(progressText); + } + +#ifdef FFS_WIN + using namespace util; + + //show progress on Windows 7 taskbar + if (taskbar_.get()) + { + const size_t current = 100000 * percent / 100; + const size_t total = 100000; + + switch (currentStatus) + { + case SyncStatus::SCANNING: + taskbar_->setStatus(TaskbarProgress::STATUS_INDETERMINATE); + break; + case SyncStatus::FINISHED_WITH_SUCCESS: + case SyncStatus::COMPARING_CONTENT: + case SyncStatus::SYNCHRONIZING: + taskbar_->setStatus(TaskbarProgress::STATUS_NORMAL); + taskbar_->setProgress(current, total); + break; + case SyncStatus::PAUSE: + taskbar_->setStatus(TaskbarProgress::STATUS_PAUSED); + taskbar_->setProgress(current, total); + break; + case SyncStatus::ABORTED: + case SyncStatus::FINISHED_WITH_ERROR: + taskbar_->setStatus(TaskbarProgress::STATUS_ERROR); + taskbar_->setProgress(current, total); + break; + } + } +#endif +} + + +void SyncStatus::SyncStatusImpl::updateStatusDialogNow() +{ + //static RetrieveStatistics statistic; + //statistic.writeEntry(currentData, currentObjects); + + const float percent = totalData == 0 ? 0 : currentData.ToDouble() * 100 / totalData.ToDouble(); + + //write status information to systray, taskbar, parent title ect. + switch (currentStatus) + { + case SyncStatus::SCANNING: + showProgressExternally(numberToStringSep(scannedObjects) + wxT(" - ") + _("Scanning...")); + break; + case SyncStatus::COMPARING_CONTENT: + showProgressExternally(formatPercentage(currentData, totalData) + wxT(" - ") + _("Comparing content..."), percent); + break; + case SyncStatus::SYNCHRONIZING: + showProgressExternally(formatPercentage(currentData, totalData) + wxT(" - ") + _("Synchronizing..."), percent); + break; + case SyncStatus::PAUSE: + showProgressExternally((totalData != 0 ? formatPercentage(currentData, totalData) + wxT(" - ") : wxString()) + _("Paused"), percent); + break; + case SyncStatus::ABORTED: + showProgressExternally(_("Aborted"), percent); + break; + case SyncStatus::FINISHED_WITH_SUCCESS: + case SyncStatus::FINISHED_WITH_ERROR: + showProgressExternally(_("Completed"), percent); + break; + } + + //write regular status information (whether dialog is visible or not) + { + //wxWindowUpdateLocker dummy(this); -> not needed + + bool updateLayout = false; //avoid screen flicker by calling layout() only if necessary + + //progress indicator + if (currentStatus == SyncStatus::SCANNING) + m_gauge1->Pulse(); + else + m_gauge1->SetValue(common::round(currentData.ToDouble() * scalingFactor)); + + //status text + const wxString statusTxt = zToWx(currentStatusText); + if (m_textCtrlInfo->GetValue() != statusTxt) //no layout update for status texts! + m_textCtrlInfo->ChangeValue(statusTxt); + + //remaining objects + const wxString remainingObjTmp = numberToStringSep(totalObjects - currentObjects); + setNewText(remainingObjTmp, *m_staticTextRemainingObj, updateLayout); + + //remaining bytes left for copy + const wxString remainingBytesTmp = ffs3::formatFilesizeToShortString(totalData - currentData); + setNewText(remainingBytesTmp, *m_staticTextDataRemaining, updateLayout); + + if (statistics.get()) + { + if (timeElapsed.Time() - lastStatCallSpeed >= 500) //call method every 500 ms + { + lastStatCallSpeed = timeElapsed.Time(); + + statistics->addMeasurement(currentObjects, currentData.ToDouble()); + + //current speed + setNewText(statistics->getBytesPerSecond(), *m_staticTextSpeed, updateLayout); + + if (timeElapsed.Time() - lastStatCallRemTime >= 2000) //call method every two seconds only + { + lastStatCallRemTime = timeElapsed.Time(); + + //remaining time + setNewText(statistics->getRemainingTime(), *m_staticTextTimeRemaining, updateLayout); + } + } + } + + //time elapsed + setNewText(wxTimeSpan::Milliseconds(timeElapsed.Time()).Format(), *m_staticTextTimeElapsed, updateLayout); + + //do the ui update + if (updateLayout) + { + bSizer28->Layout(); + bSizer31->Layout(); + } + } + + //support for pause button + while (processPaused && currentProcessIsRunning()) + { + wxMilliSleep(UI_UPDATE_INTERVAL); + updateUiNow(); + } + + updateUiNow(); +} + + +bool SyncStatus::SyncStatusImpl::currentProcessIsRunning() +{ + return processStatusHandler != NULL; +} + + +void SyncStatus::SyncStatusImpl::setCurrentStatus(SyncStatus::SyncStatusID id) +{ + switch (id) + { + case SyncStatus::ABORTED: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusError"))); + m_staticTextStatus->SetLabel(_("Aborted")); + break; + + case SyncStatus::FINISHED_WITH_SUCCESS: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusSuccess"))); + m_staticTextStatus->SetLabel(_("Completed")); + break; + + case SyncStatus::FINISHED_WITH_ERROR: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusWarning"))); + m_staticTextStatus->SetLabel(_("Completed")); + break; + + case SyncStatus::PAUSE: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusPause"))); + m_staticTextStatus->SetLabel(_("Paused")); + break; + + case SyncStatus::SCANNING: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusScanning"))); + m_staticTextStatus->SetLabel(_("Scanning...")); + break; + + case SyncStatus::COMPARING_CONTENT: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusBinaryCompare"))); + m_staticTextStatus->SetLabel(_("Comparing content...")); + break; + + case SyncStatus::SYNCHRONIZING: + m_bitmapStatus->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("statusSyncing"))); + m_staticTextStatus->SetLabel(_("Synchronizing...")); + break; + } + + currentStatus = id; + Layout(); +} + + +void SyncStatus::SyncStatusImpl::processHasFinished(SyncStatus::SyncStatusID id, const wxString& finalMessage) //essential to call this in StatusHandler derived class destructor +{ + //at the LATEST(!) to prevent access to currentStatusHandler + //enable okay and close events; may be set in this method ONLY + + processStatusHandler = NULL; //avoid callback to (maybe) deleted parent process + + setCurrentStatus(id); + + resumeFromSystray(); //if in tray mode... + + m_buttonAbort->Disable(); + m_buttonAbort->Hide(); + m_buttonPause->Disable(); + m_buttonPause->Hide(); + m_buttonOK->Show(); + m_buttonOK->Enable(); + + if (IsShown()) //don't steal focus when residing in sys-tray! + m_buttonOK->SetFocus(); + + m_animationControl1->Stop(); + m_animationControl1->Hide(); + + //hide speed and remaining time + bSizerSpeed ->Show(false); + bSizerRemTime->Show(false); + + //if everything was processed successfully, hide remaining statistics (is 0 anyway) + if ( totalObjects == currentObjects && + totalData == currentData) + { + bSizerObjectsRemaining->Show(false); + + bSizerObjectsProcessed->Show(true); + + m_staticTextProcessedObj->SetLabel(numberToStringSep(currentObjects)); + m_staticTextDataProcessed->SetLabel(ffs3::formatFilesizeToShortString(currentData)); + } + + updateStatusDialogNow(); //keep this sequence to avoid display distortion, if e.g. only 1 item is sync'ed + m_textCtrlInfo->SetValue(finalMessage); // + Layout(); // + + //Raise(); -> don't! user may be watching a movie in the meantime ;) +} + + +void SyncStatus::SyncStatusImpl::OnOkay(wxCommandEvent& event) +{ + Close(); //generate close event: do NOT destroy window unconditionally! +} + + +void SyncStatus::SyncStatusImpl::OnAbort(wxCommandEvent& event) +{ + Close(); //generate close event: do NOT destroy window unconditionally! +} + + +void SyncStatus::SyncStatusImpl::OnPause(wxCommandEvent& event) +{ + static SyncStatus::SyncStatusID previousStatus = SyncStatus::ABORTED; + + if (processPaused) + { + setCurrentStatus(previousStatus); + processPaused = false; + m_buttonPause->SetLabel(_("Pause")); + m_animationControl1->Play(); + + //resume timers + timeElapsed.Resume(); + if (statistics.get()) + statistics->resumeTimer(); + } + else + { + previousStatus = currentStatus; //save current status + + setCurrentStatus(SyncStatus::PAUSE); + processPaused = true; + m_buttonPause->SetLabel(_("Continue")); + m_animationControl1->Stop(); + + //pause timers + timeElapsed.Pause(); + if (statistics.get()) + statistics->pauseTimer(); + } +} + + +void SyncStatus::SyncStatusImpl::OnClose(wxCloseEvent& event) +{ + processPaused = false; + if (currentProcessIsRunning()) + { + m_buttonAbort->Disable(); + m_buttonAbort->Hide(); + m_buttonPause->Disable(); + m_buttonPause->Hide(); + + setStatusText_NoUpdate(wxToZ(_("Abort requested: Waiting for current operation to finish..."))); + //no Layout() or UI-update here to avoid cascaded Yield()-call + + processStatusHandler->requestAbortion(); + } + else + Destroy(); +} + + +void SyncStatus::SyncStatusImpl::OnIconize(wxIconizeEvent& event) +{ + if (event.IsIconized()) //ATTENTION: iconize event is also triggered on "Restore"! (at least under Linux) + minimizeToTray(); +} + + +void SyncStatus::SyncStatusImpl::minimizeToTray() +{ + minimizedToSysTray.reset(new MinimizeToTray(this, mainDialog)); +} + + +void SyncStatus::SyncStatusImpl::resumeFromSystray() +{ + minimizedToSysTray.reset(); +} diff --git a/ui/progress_indicator.h b/ui/progress_indicator.h new file mode 100644 index 00000000..4bd9861b --- /dev/null +++ b/ui/progress_indicator.h @@ -0,0 +1,77 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef PROGRESSINDICATOR_H_INCLUDED +#define PROGRESSINDICATOR_H_INCLUDED + +#include "../shared/zstring.h" +#include +#include "../library/status_handler.h" + + +class CompareStatus +{ +public: + CompareStatus(wxTopLevelWindow& parentWindow); //CompareStatus will be owned by parentWindow! + ~CompareStatus(); + + wxWindow* getAsWindow(); //convenience! don't abuse! + + void init(); //make visible, initialize all status values + void finalize(); //hide again + + void switchToCompareBytewise(int totalObjectsToProcess, wxLongLong totalDataToProcess); + void incScannedObjects_NoUpdate(int number); + void incProcessedCmpData_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); + void setStatusText_NoUpdate(const Zstring& text); + void updateStatusPanelNow(); + +private: + class CompareStatusImpl; + CompareStatusImpl* const pimpl; +}; + + +class SyncStatus +{ +public: + SyncStatus(StatusHandler& updater, + wxTopLevelWindow* parentWindow, //may be NULL + bool startSilent); + ~SyncStatus(); + + wxWindow* getAsWindow(); //convenience! don't abuse! + + enum SyncStatusID + { + ABORTED, + FINISHED_WITH_SUCCESS, + FINISHED_WITH_ERROR, + PAUSE, + SCANNING, + COMPARING_CONTENT, + SYNCHRONIZING + }; + + void resetGauge(int totalObjectsToProcess, wxLongLong totalDataToProcess); + void incScannedObjects_NoUpdate(int number); + void incProgressIndicator_NoUpdate(int objectsProcessed, wxLongLong dataProcessed); + void setStatusText_NoUpdate(const Zstring& text); + void updateStatusDialogNow(); + + void setCurrentStatus(SyncStatusID id); + + //essential to call one of these two methods in StatusUpdater derived class destructor at the LATEST(!) + //to prevent access to callback to updater (e.g. request abort) + void processHasFinished(SyncStatusID id, const wxString& finalMessage); + void closeWindowDirectly(); //don't wait for user + +private: + class SyncStatusImpl; + SyncStatusImpl* const pimpl; +}; + +#endif // PROGRESSINDICATOR_H_INCLUDED diff --git a/ui/search.cpp b/ui/search.cpp index 03a2e23b..3fdb4d8b 100644 --- a/ui/search.cpp +++ b/ui/search.cpp @@ -5,7 +5,7 @@ // ************************************************************************** // #include "search.h" -#include "guiGenerated.h" +#include "gui_generated.h" #include #include #include @@ -259,13 +259,13 @@ void executeSearch(bool forceShowDialog, //########################################################################################### -void FreeFileSync::startFind(wxWindow& parentWindow, wxGrid& leftGrid, wxGrid& rightGrid, bool& respectCase) //Strg + F +void ffs3::startFind(wxWindow& parentWindow, wxGrid& leftGrid, wxGrid& rightGrid, bool& respectCase) //Strg + F { executeSearch(true, respectCase, parentWindow, leftGrid, rightGrid); } -void FreeFileSync::findNext(wxWindow& parentWindow, wxGrid& leftGrid, wxGrid& rightGrid, bool& respectCase) //F3 +void ffs3::findNext(wxWindow& parentWindow, wxGrid& leftGrid, wxGrid& rightGrid, bool& respectCase) //F3 { executeSearch(false, respectCase, parentWindow, leftGrid, rightGrid); } diff --git a/ui/search.h b/ui/search.h index 51604b8d..22ef9bc9 100644 --- a/ui/search.h +++ b/ui/search.h @@ -11,7 +11,7 @@ class wxGrid; class wxWindow; -namespace FreeFileSync +namespace ffs3 { void startFind(wxWindow& parentWindow, wxGrid& leftGrid, wxGrid& rightGrid, bool& respectCase); //Strg + F void findNext( wxWindow& parentWindow, wxGrid& leftGrid, wxGrid& rightGrid, bool& respectCase); //F3 diff --git a/ui/small_dlgs.cpp b/ui/small_dlgs.cpp new file mode 100644 index 00000000..785dd793 --- /dev/null +++ b/ui/small_dlgs.cpp @@ -0,0 +1,1028 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "gui_generated.h" +#include "small_dlgs.h" +#include "msg_popup.h" +#include "../library/resources.h" +#include "../algorithm.h" +#include "../shared/string_conv.h" +#include "../shared/util.h" +#include "../synchronization.h" +#include "../library/custom_grid.h" +#include "../shared/custom_button.h" +#include "../shared/localization.h" +#include "../shared/global_func.h" +#include "../shared/build_info.h" +#include +#include + +using namespace ffs3; + + +class AboutDlg : public AboutDlgGenerated +{ +public: + AboutDlg(wxWindow* window); + +private: + void OnClose(wxCloseEvent& event); + void OnOK(wxCommandEvent& event); +}; + + +AboutDlg::AboutDlg(wxWindow* window) : AboutDlgGenerated(window) +{ + m_bitmap9->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("website"))); + m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("email"))); + m_bitmap11->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("logo"))); + m_bitmap13->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("gpl"))); + + //create language credits + for (std::vector::const_iterator i = LocalizationInfo::getMapping().begin(); i != LocalizationInfo::getMapping().end(); ++i) + { + //flag + wxStaticBitmap* staticBitmapFlag = new wxStaticBitmap(m_scrolledWindowTranslators, wxID_ANY, GlobalResources::getInstance().getImageByName(i->languageFlag), wxDefaultPosition, wxSize(-1,11), 0 ); + fgSizerTranslators->Add(staticBitmapFlag, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + //language name + wxStaticText* staticTextLanguage = new wxStaticText(m_scrolledWindowTranslators, wxID_ANY, i->languageName, wxDefaultPosition, wxDefaultSize, 0 ); + staticTextLanguage->Wrap( -1 ); + fgSizerTranslators->Add(staticTextLanguage, 0, wxALIGN_CENTER_VERTICAL, 5); + + //translator name + wxStaticText* staticTextTranslator = new wxStaticText(m_scrolledWindowTranslators, wxID_ANY, i->translatorName, wxDefaultPosition, wxDefaultSize, 0 ); + staticTextTranslator->Wrap( -1 ); + fgSizerTranslators->Add(staticTextTranslator, 0, wxALIGN_CENTER_VERTICAL, 5); + } + + bSizerTranslators->Fit(m_scrolledWindowTranslators); + + + //build information + wxString build = __TDATE__; +#if wxUSE_UNICODE + build += wxT(" - Unicode"); +#else + build += wxT(" - ANSI"); +#endif //wxUSE_UNICODE + + //compile time info about 32/64-bit build + if (util::is64BitBuild) + build += wxT(" x64"); + else + build += wxT(" x86"); + assert_static(util::is32BitBuild || util::is64BitBuild); + + wxString buildFormatted = _("(Build: %x)"); + buildFormatted.Replace(wxT("%x"), build); + + m_build->SetLabel(buildFormatted); + + m_animationControl1->SetAnimation(*GlobalResources::getInstance().animationMoney); + m_animationControl1->Play(); + + m_buttonOkay->SetFocus(); + Fit(); +} + + +void AboutDlg::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void AboutDlg::OnOK(wxCommandEvent& event) +{ + EndModal(0); +} + + +void ffs3::showAboutDialog() +{ + AboutDlg* aboutDlg = new AboutDlg(NULL); + aboutDlg->ShowModal(); + aboutDlg->Destroy(); +} +//######################################################################################## + + +class HelpDlg : public HelpDlgGenerated +{ +public: + HelpDlg(wxWindow* window); + +private: + void OnClose(wxCloseEvent& event); + void OnOK(wxCommandEvent& event); +}; + + +HelpDlg::HelpDlg(wxWindow* window) : HelpDlgGenerated(window) +{ + m_notebook1->SetFocus(); + + m_bitmap25->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("help"))); + + //populate decision trees: "compare by date" + wxTreeItemId treeRoot = m_treeCtrl1->AddRoot(_("DECISION TREE")); + wxTreeItemId treeBothSides = m_treeCtrl1->AppendItem(treeRoot, _("file exists on both sides")); + wxTreeItemId treeOneSide = m_treeCtrl1->AppendItem(treeRoot, _("on one side only")); + + m_treeCtrl1->AppendItem(treeOneSide, _("- left")); + m_treeCtrl1->AppendItem(treeOneSide, _("- right")); + + m_treeCtrl1->AppendItem(treeBothSides, _("- equal")); + wxTreeItemId treeDifferent = m_treeCtrl1->AppendItem(treeBothSides, _("different")); + + m_treeCtrl1->AppendItem(treeDifferent, _("- left newer")); + m_treeCtrl1->AppendItem(treeDifferent, _("- right newer")); + m_treeCtrl1->AppendItem(treeDifferent, _("- conflict (same date, different size)")); + + m_treeCtrl1->ExpandAll(); + + //populate decision trees: "compare by content" + wxTreeItemId tree2Root = m_treeCtrl2->AddRoot(_("DECISION TREE")); + wxTreeItemId tree2BothSides = m_treeCtrl2->AppendItem(tree2Root, _("file exists on both sides")); + wxTreeItemId tree2OneSide = m_treeCtrl2->AppendItem(tree2Root, _("on one side only")); + + m_treeCtrl2->AppendItem(tree2OneSide, _("- left")); + m_treeCtrl2->AppendItem(tree2OneSide, _("- right")); + + m_treeCtrl2->AppendItem(tree2BothSides, _("- equal")); + m_treeCtrl2->AppendItem(tree2BothSides, _("- different")); + + m_treeCtrl2->ExpandAll(); +} + + +void HelpDlg::OnClose(wxCloseEvent& event) +{ + Destroy(); +} + + +void HelpDlg::OnOK(wxCommandEvent& event) +{ + Destroy(); +} + + +void ffs3::showHelpDialog() +{ + HelpDlg* helpDlg = new HelpDlg(NULL); + helpDlg->ShowModal(); + helpDlg->Destroy(); +} +//######################################################################################## + + +class FilterDlg : public FilterDlgGenerated +{ +public: + FilterDlg(wxWindow* window, + bool isGlobalFilter, + Zstring& filterIncl, + Zstring& filterExcl); + ~FilterDlg() {} + + enum + { + BUTTON_APPLY = 1 + }; + +private: + void OnHelp(wxCommandEvent& event); + void OnDefault(wxCommandEvent& event); + void OnApply(wxCommandEvent& event); + void OnCancel(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + + const bool isGlobalFilter_; + Zstring& includeFilter; + Zstring& excludeFilter; +}; + + +FilterDlg::FilterDlg(wxWindow* window, + bool isGlobalFilter, //global or local filter dialog? + Zstring& filterIncl, + Zstring& filterExcl) : + FilterDlgGenerated(window), + isGlobalFilter_(isGlobalFilter), + includeFilter(filterIncl), + excludeFilter(filterExcl) +{ + m_bitmap8->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("include"))); + m_bitmap9->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("exclude"))); + m_bitmap26->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("filterOn"))); + m_bpButtonHelp->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("help"))); + + m_textCtrlInclude->SetValue(zToWx(includeFilter)); + m_textCtrlExclude->SetValue(zToWx(excludeFilter)); + + m_panel13->Hide(); + m_button10->SetFocus(); + + //adapt header for global/local dialog + if (isGlobalFilter_) + m_staticTexHeader->SetLabel(_("Filter: All pairs")); + else + m_staticTexHeader->SetLabel(_("Filter: Single pair")); + + Fit(); +} + + +void FilterDlg::OnHelp(wxCommandEvent& event) +{ + m_bpButtonHelp->Hide(); + m_panel13->Show(); + Fit(); + Refresh(); + + event.Skip(); +} + + +void FilterDlg::OnDefault(wxCommandEvent& event) +{ + const FilterConfig nullFilter; + + if (isGlobalFilter_) + { + m_textCtrlInclude->SetValue(zToWx(nullFilter.includeFilter)); + //exclude various recycle bin directories with global filter + m_textCtrlExclude->SetValue(zToWx(standardExcludeFilter())); + } + else + { + m_textCtrlInclude->SetValue(zToWx(nullFilter.includeFilter)); + m_textCtrlExclude->SetValue(zToWx(nullFilter.excludeFilter)); + } + + //changes to mainDialog are only committed when the OK button is pressed + Fit(); +} + + +void FilterDlg::OnApply(wxCommandEvent& event) +{ + //only if user presses ApplyFilter, he wants the changes to be committed + includeFilter = wxToZ(m_textCtrlInclude->GetValue()); + excludeFilter = wxToZ(m_textCtrlExclude->GetValue()); + + //when leaving dialog: filter and redraw grid, if filter is active + EndModal(BUTTON_APPLY); +} + + +void FilterDlg::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void FilterDlg::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + + +DefaultReturnCode::Response ffs3::showFilterDialog(bool isGlobalFilter, + Zstring& filterIncl, + Zstring& filterExcl) +{ + DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; + FilterDlg* filterDlg = new FilterDlg(NULL, + isGlobalFilter, //is main filter dialog + filterIncl, + filterExcl); + if (filterDlg->ShowModal() == FilterDlg::BUTTON_APPLY) + rv = DefaultReturnCode::BUTTON_OKAY; + + filterDlg->Destroy(); + return rv; +} +//######################################################################################## + + +class DeleteDialog : public DeleteDlgGenerated +{ +public: + DeleteDialog(wxWindow* main, + const std::vector& rowsOnLeft, + const std::vector& rowsOnRight, + bool& deleteOnBothSides, + bool& useRecycleBin, + int& totalDeleteCount); + + enum + { + BUTTON_OKAY = 1, + BUTTON_CANCEL + }; + +private: + void OnOK(wxCommandEvent& event); + void OnCancel(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + void OnDelOnBothSides(wxCommandEvent& event); + void OnUseRecycler(wxCommandEvent& event); + + void updateTexts(); + + const std::vector& rowsToDeleteOnLeft; + const std::vector& rowsToDeleteOnRight; + bool& m_deleteOnBothSides; + bool& m_useRecycleBin; + int& totalDelCount; +}; + + +DeleteDialog::DeleteDialog(wxWindow* main, + const std::vector& rowsOnLeft, + const std::vector& rowsOnRight, + bool& deleteOnBothSides, + bool& useRecycleBin, + int& totalDeleteCount) : + DeleteDlgGenerated(main), + rowsToDeleteOnLeft(rowsOnLeft), + rowsToDeleteOnRight(rowsOnRight), + m_deleteOnBothSides(deleteOnBothSides), + m_useRecycleBin(useRecycleBin), + totalDelCount(totalDeleteCount) +{ + m_checkBoxDeleteBothSides->SetValue(deleteOnBothSides); + m_checkBoxUseRecycler->SetValue(useRecycleBin); + updateTexts(); + + m_buttonOK->SetFocus(); +} + + +void DeleteDialog::updateTexts() +{ + if (m_checkBoxUseRecycler->GetValue()) + { + m_staticTextHeader->SetLabel(_("Do you really want to move the following object(s) to the Recycle Bin?")); + m_bitmap12->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("recycler"))); + } + else + { + m_staticTextHeader->SetLabel(_("Do you really want to delete the following object(s)?")); + m_bitmap12->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("deleteFile"))); + } + + const std::pair delInfo = ffs3::deleteFromGridAndHDPreview( + rowsToDeleteOnLeft, + rowsToDeleteOnRight, + m_checkBoxDeleteBothSides->GetValue()); + + const wxString filesToDelete = delInfo.first; + totalDelCount = delInfo.second; + + m_textCtrlMessage->SetValue(filesToDelete); + + Layout(); +} + + +void DeleteDialog::OnOK(wxCommandEvent& event) +{ + EndModal(BUTTON_OKAY); +} + +void DeleteDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(BUTTON_CANCEL); +} + +void DeleteDialog::OnClose(wxCloseEvent& event) +{ + EndModal(BUTTON_CANCEL); +} + +void DeleteDialog::OnDelOnBothSides(wxCommandEvent& event) +{ + m_deleteOnBothSides = m_checkBoxDeleteBothSides->GetValue(); + updateTexts(); +} + +void DeleteDialog::OnUseRecycler(wxCommandEvent& event) +{ + m_useRecycleBin = m_checkBoxUseRecycler->GetValue(); + updateTexts(); +} + + +DefaultReturnCode::Response ffs3::showDeleteDialog(const std::vector& rowsOnLeft, + const std::vector& rowsOnRight, + bool& deleteOnBothSides, + bool& useRecycleBin, + int& totalDeleteCount) +{ + DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; + + DeleteDialog* confirmDeletion = new DeleteDialog(NULL, + rowsOnLeft, + rowsOnRight, + deleteOnBothSides, + useRecycleBin, + totalDeleteCount); + if (confirmDeletion->ShowModal() == DeleteDialog::BUTTON_OKAY) + rv = DefaultReturnCode::BUTTON_OKAY; + + confirmDeletion->Destroy(); + return rv; +} +//######################################################################################## + + +class CustomizeColsDlg : public CustomizeColsDlgGenerated +{ +public: + CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr); + + enum + { + BUTTON_OKAY = 10 + }; + +private: + void OnOkay(wxCommandEvent& event); + void OnDefault(wxCommandEvent& event); + void OnCancel(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + + void OnMoveUp(wxCommandEvent& event); + void OnMoveDown(wxCommandEvent& event); + + xmlAccess::ColumnAttributes& output; +}; + + +CustomizeColsDlg::CustomizeColsDlg(wxWindow* window, xmlAccess::ColumnAttributes& attr) : + CustomizeColsDlgGenerated(window), + output(attr) +{ + m_bpButton29->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("moveUp"))); + m_bpButton30->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("moveDown"))); + + xmlAccess::ColumnAttributes columnSettings = attr; + + sort(columnSettings.begin(), columnSettings.end(), xmlAccess::sortByPositionOnly); + + for (xmlAccess::ColumnAttributes::const_iterator i = columnSettings.begin(); i != columnSettings.end(); ++i) //love these iterators! + { + m_checkListColumns->Append(CustomGridRim::getTypeName(i->type)); + m_checkListColumns->Check(i - columnSettings.begin(), i->visible); + } + + m_checkListColumns->SetSelection(0); + Fit(); +} + + +void CustomizeColsDlg::OnOkay(wxCommandEvent& event) +{ + for (int i = 0; i < int(m_checkListColumns->GetCount()); ++i) + { + const wxString label = m_checkListColumns->GetString(i); + for (xmlAccess::ColumnAttributes::iterator j = output.begin(); j != output.end(); ++j) + { + if (CustomGridRim::getTypeName(j->type) == label) //not nice but short and no performance issue + { + j->position = i; + j->visible = m_checkListColumns->IsChecked(i);; + break; + } + } + } + + EndModal(BUTTON_OKAY); +} + + +void CustomizeColsDlg::OnDefault(wxCommandEvent& event) +{ + xmlAccess::ColumnAttributes defaultColumnAttr = CustomGridRim::getDefaultColumnAttributes(); + + m_checkListColumns->Clear(); + for (xmlAccess::ColumnAttributes::const_iterator i = defaultColumnAttr.begin(); i != defaultColumnAttr.end(); ++i) + { + m_checkListColumns->Append(CustomGridRim::getTypeName(i->type)); + m_checkListColumns->Check(i - defaultColumnAttr.begin(), i->visible); + } +} + + +void CustomizeColsDlg::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void CustomizeColsDlg::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void CustomizeColsDlg::OnMoveUp(wxCommandEvent& event) +{ + const int pos = m_checkListColumns->GetSelection(); + if (1 <= pos && pos < int(m_checkListColumns->GetCount())) + { + const bool checked = m_checkListColumns->IsChecked(pos); + const wxString label = m_checkListColumns->GetString(pos); + + m_checkListColumns->SetString(pos, m_checkListColumns->GetString(pos - 1)); + m_checkListColumns->Check(pos, m_checkListColumns->IsChecked(pos - 1)); + m_checkListColumns->SetString(pos - 1, label); + m_checkListColumns->Check(pos - 1, checked); + m_checkListColumns->Select(pos - 1); + } +} + + +void CustomizeColsDlg::OnMoveDown(wxCommandEvent& event) +{ + const int pos = m_checkListColumns->GetSelection(); + if (0 <= pos && pos < int(m_checkListColumns->GetCount()) - 1) + { + const bool checked = m_checkListColumns->IsChecked(pos); + const wxString label = m_checkListColumns->GetString(pos); + + m_checkListColumns->SetString(pos, m_checkListColumns->GetString(pos + 1)); + m_checkListColumns->Check(pos, m_checkListColumns->IsChecked(pos + 1)); + m_checkListColumns->SetString(pos + 1, label); + m_checkListColumns->Check(pos + 1, checked); + m_checkListColumns->Select(pos + 1); + } +} + + +DefaultReturnCode::Response ffs3::showCustomizeColsDlg(xmlAccess::ColumnAttributes& attr) +{ + DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; + + CustomizeColsDlg* customizeDlg = new CustomizeColsDlg(NULL, attr); + if (customizeDlg->ShowModal() == CustomizeColsDlg::BUTTON_OKAY) + rv = DefaultReturnCode::BUTTON_OKAY; + customizeDlg->Destroy(); + + return rv; +} +//######################################################################################## + + +class SyncPreviewDlg : public SyncPreviewDlgGenerated +{ +public: + SyncPreviewDlg(wxWindow* parentWindow, + const wxString& variantName, + const ffs3::SyncStatistics& statistics, + bool& dontShowAgain); + enum + { + BUTTON_START = 1, + BUTTON_CANCEL = 2 + }; + +private: + void OnClose(wxCloseEvent& event); + void OnCancel(wxCommandEvent& event); + void OnStartSync(wxCommandEvent& event); + + bool& m_dontShowAgain; +}; + + + +SyncPreviewDlg::SyncPreviewDlg(wxWindow* parentWindow, + const wxString& variantName, + const ffs3::SyncStatistics& statistics, + bool& dontShowAgain) : + SyncPreviewDlgGenerated(parentWindow), + m_dontShowAgain(dontShowAgain) +{ + using ffs3::numberToStringSep; + + m_buttonStartSync->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("startSync"))); + m_bitmapCreate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("create"))); + m_bitmapUpdate->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("update"))); + m_bitmapDelete->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("delete"))); + m_bitmapData->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("data"))); + + m_staticTextVariant->SetLabel(variantName); + m_textCtrlData->SetValue(ffs3::formatFilesizeToShortString(statistics.getDataToProcess())); + + m_textCtrlCreateL->SetValue(numberToStringSep(statistics.getCreate( true, false))); + m_textCtrlUpdateL->SetValue(numberToStringSep(statistics.getOverwrite(true, false))); + m_textCtrlDeleteL->SetValue(numberToStringSep(statistics.getDelete( true, false))); + + m_textCtrlCreateR->SetValue(numberToStringSep(statistics.getCreate( false, true))); + m_textCtrlUpdateR->SetValue(numberToStringSep(statistics.getOverwrite(false, true))); + m_textCtrlDeleteR->SetValue(numberToStringSep(statistics.getDelete( false, true))); + + m_checkBoxDontShowAgain->SetValue(dontShowAgain); + + m_buttonStartSync->SetFocus(); + Fit(); +} + + +void SyncPreviewDlg::OnClose(wxCloseEvent& event) +{ + EndModal(BUTTON_CANCEL); +} + + +void SyncPreviewDlg::OnCancel(wxCommandEvent& event) +{ + EndModal(BUTTON_CANCEL); +} + + +void SyncPreviewDlg::OnStartSync(wxCommandEvent& event) +{ + m_dontShowAgain = m_checkBoxDontShowAgain->GetValue(); + EndModal(BUTTON_START); +} + + +DefaultReturnCode::Response ffs3::showSyncPreviewDlg( + const wxString& variantName, + const ffs3::SyncStatistics& statistics, + bool& dontShowAgain) +{ + DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; + + SyncPreviewDlg* preview = new SyncPreviewDlg(NULL, + variantName, + statistics, + dontShowAgain); + + if (preview->ShowModal() == SyncPreviewDlg::BUTTON_START) + rv = DefaultReturnCode::BUTTON_OKAY; + + preview->Destroy(); + + return rv; +} +//######################################################################################## + + +class CompareCfgDialog : public CmpCfgDlgGenerated +{ +public: + CompareCfgDialog(wxWindow* parentWindow, + const wxPoint& position, + ffs3::CompareVariant& cmpVar, + SymLinkHandling& handleSymlinks); + + enum + { + BUTTON_OKAY = 10 + }; + +private: + void OnOkay(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + void OnCancel(wxCommandEvent& event); + void OnTimeSize(wxCommandEvent& event); + void OnContent(wxCommandEvent& event); + void OnShowHelp(wxCommandEvent& event); + + void updateView(); + + ffs3::CompareVariant& cmpVarOut; + SymLinkHandling& handleSymlinksOut; +}; + + +namespace +{ +void setValue(wxChoice& choiceCtrl, ffs3::SymLinkHandling value) +{ + choiceCtrl.Clear(); + choiceCtrl.Append(_("Ignore")); + choiceCtrl.Append(_("Direct")); + choiceCtrl.Append(_("Follow")); + + //default + choiceCtrl.SetSelection(0); + + switch (value) + { + case ffs3::SYMLINK_IGNORE: + choiceCtrl.SetSelection(0); + break; + case ffs3::SYMLINK_USE_DIRECTLY: + choiceCtrl.SetSelection(1); + break; + case ffs3::SYMLINK_FOLLOW_LINK: + choiceCtrl.SetSelection(2); + break; + } +} + + +ffs3::SymLinkHandling getValue(const wxChoice& choiceCtrl) +{ + switch (choiceCtrl.GetSelection()) + { + case 0: + return ffs3::SYMLINK_IGNORE; + case 1: + return ffs3::SYMLINK_USE_DIRECTLY; + case 2: + return ffs3::SYMLINK_FOLLOW_LINK; + default: + assert(false); + return ffs3::SYMLINK_IGNORE; + } +} +} + +CompareCfgDialog::CompareCfgDialog(wxWindow* parentWindow, + const wxPoint& position, + CompareVariant& cmpVar, + SymLinkHandling& handleSymlinks) : + CmpCfgDlgGenerated(parentWindow), + cmpVarOut(cmpVar), + handleSymlinksOut(handleSymlinks) +{ + //move dialog up so that compare-config button and first config-variant are on same level + Move(wxPoint(position.x, std::max(0, position.y - (m_buttonTimeSize->GetScreenPosition() - GetScreenPosition()).y))); + + m_bpButtonHelp->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("help"))); + m_bitmapByTime->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("cmpByTime"))); + m_bitmapByContent->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("cmpByContent"))); + + switch (cmpVar) + { + case CMP_BY_TIME_SIZE: + m_radioBtnSizeDate->SetValue(true); + m_buttonContent->SetFocus(); //set focus on the other button + break; + case CMP_BY_CONTENT: + m_radioBtnContent->SetValue(true); + m_buttonTimeSize->SetFocus(); //set focus on the other button + break; + } + + + setValue(*m_choiceHandleSymlinks, handleSymlinks); + + updateView(); +} + +void CompareCfgDialog::updateView() +{ + Fit(); +} + +void CompareCfgDialog::OnOkay(wxCommandEvent& event) +{ + if (m_radioBtnContent->GetValue()) + cmpVarOut = CMP_BY_CONTENT; + else + cmpVarOut = CMP_BY_TIME_SIZE; + + handleSymlinksOut = getValue(*m_choiceHandleSymlinks);; + + EndModal(BUTTON_OKAY); +} + + +void CompareCfgDialog::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void CompareCfgDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void CompareCfgDialog::OnTimeSize(wxCommandEvent& event) +{ + m_radioBtnSizeDate->SetValue(true); + OnOkay(event); +} + + +void CompareCfgDialog::OnContent(wxCommandEvent& event) +{ + m_radioBtnContent->SetValue(true); + OnOkay(event); +} + + +void CompareCfgDialog::OnShowHelp(wxCommandEvent& event) +{ + HelpDlg* helpDlg = new HelpDlg(this); + helpDlg->ShowModal(); +} + + +DefaultReturnCode::Response ffs3::showCompareCfgDialog( + const wxPoint& position, + CompareVariant& cmpVar, + SymLinkHandling& handleSymlinks) +{ + CompareCfgDialog syncDlg(NULL, position, cmpVar, handleSymlinks); + + return syncDlg.ShowModal() == CompareCfgDialog::BUTTON_OKAY ? + DefaultReturnCode::BUTTON_OKAY : + DefaultReturnCode::BUTTON_CANCEL; +} +//######################################################################################## + + +class GlobalSettingsDlg : public GlobalSettingsDlgGenerated +{ +public: + GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings); + + enum + { + BUTTON_OKAY = 10 + }; + +private: + void OnOkay(wxCommandEvent& event); + void OnResetDialogs(wxCommandEvent& event); + void OnDefault(wxCommandEvent& event); + void OnCancel(wxCommandEvent& event); + void OnClose(wxCloseEvent& event); + void OnAddRow(wxCommandEvent& event); + void OnRemoveRow(wxCommandEvent& event); + + void set(const xmlAccess::ExternalApps& extApp); + xmlAccess::ExternalApps getExtApp(); + + xmlAccess::XmlGlobalSettings& settings; +}; + + +GlobalSettingsDlg::GlobalSettingsDlg(wxWindow* window, xmlAccess::XmlGlobalSettings& globalSettings) : + GlobalSettingsDlgGenerated(window), + settings(globalSettings) +{ + m_bitmapSettings->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("settings"))); + m_buttonResetDialogs->setBitmapFront(GlobalResources::getInstance().getImageByName(wxT("warningSmall")), 5); + m_bpButtonAddRow->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("addFolderPair"))); + m_bpButtonRemoveRow->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("removeFolderPair"))); + + m_checkBoxIgnoreOneHour->SetValue(globalSettings.ignoreOneHourDiff); + m_checkBoxCopyLocked->SetValue(globalSettings.copyLockedFiles); + m_checkBoxCopyPermissions->SetValue(globalSettings.copyFilePermissions); + +#ifndef FFS_WIN + m_checkBoxCopyLocked->Hide(); +#endif + + set(globalSettings.gui.externelApplications); + + const wxString toolTip = wxString(_("Integrate external applications into context menu. The following macros are available:")) + wxT("\n\n") + + wxT("%name \t") + _("- full file or directory name") + wxT("\n") + + wxT("%dir \t") + _("- directory part only") + wxT("\n") + + wxT("%nameCo \t") + _("- Other side's counterpart to %name") + wxT("\n") + + wxT("%dirCo \t") + _("- Other side's counterpart to %dir"); + + m_gridCustomCommand->GetGridWindow()->SetToolTip(toolTip); + m_gridCustomCommand->GetGridColLabelWindow()->SetToolTip(toolTip); + + m_buttonOkay->SetFocus(); + + Fit(); +} + + +void GlobalSettingsDlg::OnOkay(wxCommandEvent& event) +{ + //write global settings only when okay-button is pressed! + settings.ignoreOneHourDiff = m_checkBoxIgnoreOneHour->GetValue(); + settings.copyLockedFiles = m_checkBoxCopyLocked->GetValue(); + settings.copyFilePermissions = m_checkBoxCopyPermissions->GetValue(); + settings.gui.externelApplications = getExtApp(); + + EndModal(BUTTON_OKAY); +} + + +void GlobalSettingsDlg::OnResetDialogs(wxCommandEvent& event) +{ + QuestionDlg* messageDlg = new QuestionDlg(this, + QuestionDlg::BUTTON_YES | QuestionDlg::BUTTON_CANCEL, + _("Re-enable all hidden dialogs?")); + + if (messageDlg->ShowModal() == QuestionDlg::BUTTON_YES) + settings.optDialogs.resetDialogs(); +} + + +void GlobalSettingsDlg::OnDefault(wxCommandEvent& event) +{ + xmlAccess::XmlGlobalSettings defaultCfg; + + m_checkBoxIgnoreOneHour-> SetValue(defaultCfg.ignoreOneHourDiff); + m_checkBoxCopyLocked-> SetValue(defaultCfg.copyLockedFiles); + m_checkBoxCopyPermissions->SetValue(defaultCfg.copyFilePermissions); + set(defaultCfg.gui.externelApplications); +} + + +void GlobalSettingsDlg::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void GlobalSettingsDlg::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void GlobalSettingsDlg::set(const xmlAccess::ExternalApps& extApp) +{ + const int rowCount = m_gridCustomCommand->GetNumberRows(); + if (rowCount > 0) + m_gridCustomCommand->DeleteRows(0, rowCount); + + m_gridCustomCommand->AppendRows(static_cast(extApp.size())); + for (xmlAccess::ExternalApps::const_iterator i = extApp.begin(); i != extApp.end(); ++i) + { + const int row = i - extApp.begin(); + m_gridCustomCommand->SetCellValue(row, 0, i->first); //description + m_gridCustomCommand->SetCellValue(row, 1, i->second); //commandline + } + Fit(); +} + + +xmlAccess::ExternalApps GlobalSettingsDlg::getExtApp() +{ + xmlAccess::ExternalApps output; + for (int i = 0; i < m_gridCustomCommand->GetNumberRows(); ++i) + output.push_back( + std::make_pair(m_gridCustomCommand->GetCellValue(i, 0), //description + m_gridCustomCommand->GetCellValue(i, 1))); //commandline + return output; +} + + +void GlobalSettingsDlg::OnAddRow(wxCommandEvent& event) +{ + wxWindowUpdateLocker dummy(this); //avoid display distortion + + const int selectedRow = m_gridCustomCommand->GetGridCursorRow(); + if (0 <= selectedRow && selectedRow < m_gridCustomCommand->GetNumberRows()) + m_gridCustomCommand->InsertRows(selectedRow); + else + m_gridCustomCommand->AppendRows(); + + Fit(); +} + + +void GlobalSettingsDlg::OnRemoveRow(wxCommandEvent& event) +{ + if (m_gridCustomCommand->GetNumberRows() > 0) + { + wxWindowUpdateLocker dummy(this); //avoid display distortion + + const int selectedRow = m_gridCustomCommand->GetGridCursorRow(); + if (0 <= selectedRow && selectedRow < m_gridCustomCommand->GetNumberRows()) + m_gridCustomCommand->DeleteRows(selectedRow); + else + m_gridCustomCommand->DeleteRows(m_gridCustomCommand->GetNumberRows() - 1); + + Fit(); + } +} + + +DefaultReturnCode::Response ffs3::showGlobalSettingsDlg(xmlAccess::XmlGlobalSettings& globalSettings) +{ + DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; + + wxDialog* settingsDlg = new GlobalSettingsDlg(NULL, globalSettings); + if (settingsDlg->ShowModal() == GlobalSettingsDlg::BUTTON_OKAY) + rv = DefaultReturnCode::BUTTON_OKAY; + + settingsDlg->Destroy(); + + return rv; +} diff --git a/ui/small_dlgs.h b/ui/small_dlgs.h new file mode 100644 index 00000000..57a5f542 --- /dev/null +++ b/ui/small_dlgs.h @@ -0,0 +1,59 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef SMALLDIALOGS_H_INCLUDED +#define SMALLDIALOGS_H_INCLUDED + +#include "../file_hierarchy.h" +#include "../library/process_xml.h" + +namespace ffs3 +{ +class SyncStatistics; + + +struct DefaultReturnCode +{ + enum Response + { + BUTTON_OKAY, + BUTTON_CANCEL + }; +}; + +void showAboutDialog(); + +void showHelpDialog(); + +DefaultReturnCode::Response showFilterDialog(bool isGlobalFilter, + Zstring& filterIncl, + Zstring& filterExcl); + +DefaultReturnCode::Response showDeleteDialog( + const std::vector& rowsOnLeft, + const std::vector& rowsOnRight, + bool& deleteOnBothSides, + bool& useRecycleBin, + int& totalDeleteCount); + +DefaultReturnCode::Response showCustomizeColsDlg(xmlAccess::ColumnAttributes& attr); + +DefaultReturnCode::Response showSyncPreviewDlg( + const wxString& variantName, + const SyncStatistics& statistics, + bool& dontShowAgain); + +DefaultReturnCode::Response showCompareCfgDialog( + const wxPoint& position, + CompareVariant& cmpVar, + SymLinkHandling& handleSymlinks); + +DefaultReturnCode::Response showGlobalSettingsDlg(xmlAccess::XmlGlobalSettings& globalSettings); +} + +#endif // SMALLDIALOGS_H_INCLUDED + + diff --git a/ui/sorting.h b/ui/sorting.h index 1a77ff02..94ac6f6d 100644 --- a/ui/sorting.h +++ b/ui/sorting.h @@ -7,13 +7,13 @@ #ifndef SORTING_H_INCLUDED #define SORTING_H_INCLUDED -#include "../fileHierarchy.h" -#include "../shared/systemConstants.h" +#include "../file_hierarchy.h" +#include "../shared/system_constants.h" #include "../synchronization.h" -#include "../shared/staticAssert.h" +#include "../shared/assert_static.h" -namespace FreeFileSync +namespace ffs3 { namespace { @@ -31,12 +31,6 @@ bool isDirectoryMapping(const FileSystemObject& fsObj) return dynamic_cast(&fsObj) != NULL; } -inline -int compareString(const Zstring& stringA, const Zstring& stringB) -{ - return stringA.cmpFileName(stringB); -} - template struct Compare @@ -60,13 +54,6 @@ struct Compare }; -inline -bool stringSmallerThan(const Zstring& stringA, const Zstring& stringB) -{ - return compareString(stringA, stringB) < 0; -} - - template inline bool sortByFileName(const FileSystemObject& a, const FileSystemObject& b) @@ -81,7 +68,7 @@ bool sortByFileName(const FileSystemObject& a, const FileSystemObject& b) if (isDirectoryMapping(a)) //sort directories by relative name { if (isDirectoryMapping(b)) - return stringSmallerThan(a.getRelativeName(), b.getRelativeName()); + return cmpFileName(a.getRelativeName(), b.getRelativeName()) < 0; else return false; } @@ -91,7 +78,7 @@ bool sortByFileName(const FileSystemObject& a, const FileSystemObject& b) return true; else return Compare().isSmallerThan( - compareString(a.getShortName(), b.getShortName()), 0); + cmpFileName(a.getShortName(), b.getShortName()), 0); } } @@ -116,7 +103,7 @@ bool sortByRelativeName(const FileSystemObject& a, const FileSystemObject& b) //compare relative names without filenames first - const int rv = compareString(relDirNameA, relDirNameB); + const int rv = cmpFileName(relDirNameA, relDirNameB); if (rv != 0) return Compare().isSmallerThan(rv, 0); else //compare the filenames @@ -126,7 +113,7 @@ bool sortByRelativeName(const FileSystemObject& a, const FileSystemObject& b) else if (isDirectoryA) return true; - return stringSmallerThan(a.getShortName(), b.getShortName()); + return cmpFileName(a.getShortName(), b.getShortName()) < 0; } } @@ -135,18 +122,29 @@ template inline bool sortByFileSize(const FileSystemObject& a, const FileSystemObject& b) { + //empty rows always last if (a.isEmpty()) - return false; //empty rows always last + return false; else if (b.isEmpty()) - return true; //empty rows always last + return true; + + const bool isDirA = dynamic_cast(&a) != NULL; + const bool isDirB = dynamic_cast(&b) != NULL; + + //directories second last + if (isDirA) + return false; + else if (isDirB) + return true; const FileMapping* fileObjA = dynamic_cast(&a); const FileMapping* fileObjB = dynamic_cast(&b); + //then symlinks if (fileObjA == NULL) - return false; //directories last + return false; else if (fileObjB == NULL) - return true; //directories last + return true; //return list beginning with largest files first return Compare().isSmallerThan(fileObjA->getFileSize(), fileObjB->getFileSize()); diff --git a/ui/switchToGui.cpp b/ui/switchToGui.cpp deleted file mode 100644 index ed678dd1..00000000 --- a/ui/switchToGui.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "switchToGui.h" -#include "mainDialog.h" - -using FreeFileSync::SwitchToGui; - - -SwitchToGui::SwitchToGui(const xmlAccess::XmlBatchConfig& batchCfg, - xmlAccess::XmlGlobalSettings& globalSettings) : //prepare - globalSettings_(globalSettings), - guiCfg(xmlAccess::convertBatchToGui(batchCfg)) {} - - -void SwitchToGui::execute() const //throw() -{ - try - { - MainDialog* frame = new MainDialog(guiCfg, globalSettings_, true); - frame->Show(); - } - catch(...) {} -} diff --git a/ui/switchToGui.h b/ui/switchToGui.h deleted file mode 100644 index 7970534a..00000000 --- a/ui/switchToGui.h +++ /dev/null @@ -1,29 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef SWITCHTOGUI_H_INCLUDED -#define SWITCHTOGUI_H_INCLUDED - -#include "../library/processXml.h" - - -namespace FreeFileSync -{ - -//switch from FreeFileSync Batch to GUI modus: opens a new FreeFileSync GUI session asynchronously -class SwitchToGui -{ -public: - SwitchToGui(const xmlAccess::XmlBatchConfig& batchCfg, xmlAccess::XmlGlobalSettings& globalSettings); //prepare - void execute() const; //throw() - -private: - xmlAccess::XmlGlobalSettings& globalSettings_; - const xmlAccess::XmlGuiConfig guiCfg; -}; -} - -#endif // SWITCHTOGUI_H_INCLUDED diff --git a/ui/switch_to_gui.cpp b/ui/switch_to_gui.cpp new file mode 100644 index 00000000..121047e6 --- /dev/null +++ b/ui/switch_to_gui.cpp @@ -0,0 +1,27 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "switch_to_gui.h" +#include "main_dlg.h" + +using ffs3::SwitchToGui; + + +SwitchToGui::SwitchToGui(const xmlAccess::XmlBatchConfig& batchCfg, + xmlAccess::XmlGlobalSettings& globalSettings) : //prepare + globalSettings_(globalSettings), + guiCfg(xmlAccess::convertBatchToGui(batchCfg)) {} + + +void SwitchToGui::execute() const //throw() +{ + try + { + MainDialog* frame = new MainDialog(guiCfg, globalSettings_, true); + frame->Show(); + } + catch(...) {} +} diff --git a/ui/switch_to_gui.h b/ui/switch_to_gui.h new file mode 100644 index 00000000..b39354f8 --- /dev/null +++ b/ui/switch_to_gui.h @@ -0,0 +1,29 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef SWITCHTOGUI_H_INCLUDED +#define SWITCHTOGUI_H_INCLUDED + +#include "../library/process_xml.h" + + +namespace ffs3 +{ + +//switch from FreeFileSync Batch to GUI modus: opens a new FreeFileSync GUI session asynchronously +class SwitchToGui +{ +public: + SwitchToGui(const xmlAccess::XmlBatchConfig& batchCfg, xmlAccess::XmlGlobalSettings& globalSettings); //prepare + void execute() const; //throw() + +private: + xmlAccess::XmlGlobalSettings& globalSettings_; + const xmlAccess::XmlGuiConfig guiCfg; +}; +} + +#endif // SWITCHTOGUI_H_INCLUDED diff --git a/ui/syncConfig.cpp b/ui/syncConfig.cpp deleted file mode 100644 index a2d821ff..00000000 --- a/ui/syncConfig.cpp +++ /dev/null @@ -1,477 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "syncConfig.h" - -#include "../library/resources.h" -#include "../shared/dragAndDrop.h" -#include - -using namespace FreeFileSync; - - -SyncCfgDialog::SyncCfgDialog(wxWindow* window, - const CompareVariant compareVar, - SyncConfiguration& syncConfiguration, - DeletionPolicy& handleDeletion, - wxString& customDeletionDirectory, - bool* ignoreErrors) : - SyncCfgDlgGenerated(window), - cmpVariant(compareVar), - currentSyncConfig(syncConfiguration), //make working copy of syncConfiguration - refSyncConfiguration(syncConfiguration), - refHandleDeletion(handleDeletion), - refCustomDeletionDirectory(customDeletionDirectory), - refIgnoreErrors(ignoreErrors), - dragDropCustomDelFolder(new DragDropOnDlg(m_panelCustomDeletionDir, m_dirPickerCustomDelFolder, m_textCtrlCustomDelFolder)) -{ - setDeletionHandling(handleDeletion); - m_textCtrlCustomDelFolder->SetValue(customDeletionDirectory); - - //error handling - if (ignoreErrors) - setErrorHandling(*ignoreErrors); - else - { - sbSizerErrorHandling->Show(false); - Layout(); - } - - //set sync config icons - updateConfigIcons(cmpVariant, currentSyncConfig); - - //set icons for this dialog - m_bitmapLeftOnly->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("leftOnly"))); - m_bitmapRightOnly->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("rightOnly"))); - m_bitmapLeftNewer->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("leftNewer"))); - m_bitmapRightNewer->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("rightNewer"))); - m_bitmapDifferent->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("different"))); - m_bitmapConflict->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("conflictGrey"))); - - bSizer201->Layout(); //wxButtonWithImage size might have changed - - m_buttonOK->SetFocus(); - - Fit(); -} - -//################################################################################################################# - -SyncCfgDialog::~SyncCfgDialog() {} //non-inline destructor for std::auto_ptr to work with forward declaration - - -void SyncCfgDialog::updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig) -{ - //wxWindowUpdateLocker dummy(this); //avoid display distortion - wxWindowUpdateLocker dummy2(m_panelCustomDeletionDir); //avoid display distortion - wxWindowUpdateLocker dummy3(m_bpButtonLeftOnly); - wxWindowUpdateLocker dummy4(m_bpButtonRightOnly); - wxWindowUpdateLocker dummy5(m_bpButtonLeftNewer); - wxWindowUpdateLocker dummy6(m_bpButtonRightNewer); - wxWindowUpdateLocker dummy7(m_bpButtonDifferent); - wxWindowUpdateLocker dummy8(m_bpButtonConflict); - - - updateConfigIcons(cmpVar, - syncConfig, - m_bpButtonLeftOnly, - m_bpButtonRightOnly, - m_bpButtonLeftNewer, - m_bpButtonRightNewer, - m_bpButtonDifferent, - m_bpButtonConflict, - m_bitmapLeftOnly, - m_bitmapRightOnly, - m_bitmapLeftNewer, - m_bitmapRightNewer, - m_bitmapDifferent, - m_bitmapConflict, - sbSizerSyncDirections); - - //set radiobuttons -> have no parameter-ownership at all! - switch (FreeFileSync::getVariant(currentSyncConfig)) - { - case SyncConfiguration::AUTOMATIC: - m_radioBtnAutomatic->SetValue(true); //automatic mode - break; - case SyncConfiguration::MIRROR: - m_radioBtnMirror->SetValue(true); //one way -> - break; - case SyncConfiguration::UPDATE: - m_radioBtnUpdate->SetValue(true); //Update -> - break; - case SyncConfiguration::CUSTOM: - m_radioBtnCustom->SetValue(true); //custom - break; - } - - GetSizer()->SetSizeHints(this); //this works like a charm for GTK2 with window resizing problems!!! (includes call to Fit()) -} - - -void SyncCfgDialog::updateConfigIcons(const CompareVariant compareVar, - const SyncConfiguration& syncConfig, - wxBitmapButton* buttonLeftOnly, - wxBitmapButton* buttonRightOnly, - wxBitmapButton* buttonLeftNewer, - wxBitmapButton* buttonRightNewer, - wxBitmapButton* buttonDifferent, - wxBitmapButton* buttonConflict, - wxStaticBitmap* bitmapLeftOnly, - wxStaticBitmap* bitmapRightOnly, - wxStaticBitmap* bitmapLeftNewer, - wxStaticBitmap* bitmapRightNewer, - wxStaticBitmap* bitmapDifferent, - wxStaticBitmap* bitmapConflict, - wxSizer* syncDirections) //sizer containing all sync-directions -{ - //display only relevant sync options - syncDirections->Show(true); - - buttonLeftOnly ->Show(); // - buttonRightOnly ->Show(); // - buttonLeftNewer ->Show(); // - buttonRightNewer->Show(); // enable everything by default - buttonDifferent ->Show(); // - buttonConflict ->Show(); // - - bitmapLeftOnly ->Show(); // - bitmapRightOnly ->Show(); // - bitmapLeftNewer ->Show(); // - bitmapRightNewer->Show(); // - bitmapDifferent ->Show(); // - bitmapConflict ->Show(); // - - switch (compareVar) - { - case CMP_BY_TIME_SIZE: - buttonDifferent ->Hide(); - - bitmapDifferent ->Hide(); - break; - - case CMP_BY_CONTENT: - buttonLeftNewer ->Hide(); - buttonRightNewer->Hide(); - - bitmapLeftNewer ->Hide(); - bitmapRightNewer->Hide(); - break; - } - - if (syncConfig.automatic) //automatic mode needs no sync-directions - syncDirections->Show(false); - - switch (syncConfig.exLeftSideOnly) - { - case SYNC_DIR_RIGHT: - buttonLeftOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRightCr"))); - buttonLeftOnly->SetToolTip(getDescription(SO_CREATE_NEW_RIGHT)); - break; - case SYNC_DIR_LEFT: - buttonLeftOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("deleteLeft"))); - buttonLeftOnly->SetToolTip(getDescription(SO_DELETE_LEFT)); - break; - case SYNC_DIR_NONE: - buttonLeftOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); - buttonLeftOnly->SetToolTip(getDescription(SO_DO_NOTHING)); - break; - } - - switch (syncConfig.exRightSideOnly) - { - case SYNC_DIR_RIGHT: - buttonRightOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("deleteRight"))); - buttonRightOnly->SetToolTip(getDescription(SO_DELETE_RIGHT)); - break; - case SYNC_DIR_LEFT: - buttonRightOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeftCr"))); - buttonRightOnly->SetToolTip(getDescription(SO_CREATE_NEW_LEFT)); - break; - case SYNC_DIR_NONE: - buttonRightOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); - buttonRightOnly->SetToolTip(getDescription(SO_DO_NOTHING)); - break; - } - - switch (syncConfig.leftNewer) - { - case SYNC_DIR_RIGHT: - buttonLeftNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); - buttonLeftNewer->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); - break; - case SYNC_DIR_LEFT: - buttonLeftNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); - buttonLeftNewer->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); - break; - case SYNC_DIR_NONE: - buttonLeftNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); - buttonLeftNewer->SetToolTip(getDescription(SO_DO_NOTHING)); - break; - } - - switch (syncConfig.rightNewer) - { - case SYNC_DIR_RIGHT: - buttonRightNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); - buttonRightNewer->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); - break; - case SYNC_DIR_LEFT: - buttonRightNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); - buttonRightNewer->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); - break; - case SYNC_DIR_NONE: - buttonRightNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); - buttonRightNewer->SetToolTip(getDescription(SO_DO_NOTHING)); - break; - } - - switch (syncConfig.different) - { - case SYNC_DIR_RIGHT: - buttonDifferent->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); - buttonDifferent->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); - break; - case SYNC_DIR_LEFT: - buttonDifferent->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); - buttonDifferent->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); - break; - case SYNC_DIR_NONE: - buttonDifferent->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); - buttonDifferent->SetToolTip(getDescription(SO_DO_NOTHING)); - break; - } - - switch (syncConfig.conflict) - { - case SYNC_DIR_RIGHT: - buttonConflict->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); - buttonConflict->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); - break; - case SYNC_DIR_LEFT: - buttonConflict->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); - buttonConflict->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); - break; - case SYNC_DIR_NONE: - buttonConflict->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("conflict"))); - buttonConflict->SetToolTip(_("Leave as unresolved conflict")); - break; - } -} - - -void SyncCfgDialog::OnClose(wxCloseEvent& event) -{ - EndModal(0); -} - - -void SyncCfgDialog::OnCancel(wxCommandEvent& event) -{ - EndModal(0); -} - - -void SyncCfgDialog::OnApply(wxCommandEvent& event) -{ - //write configuration to main dialog - refSyncConfiguration = currentSyncConfig; - refHandleDeletion = getDeletionHandling(); - refCustomDeletionDirectory = m_textCtrlCustomDelFolder->GetValue(); - if (refIgnoreErrors) - *refIgnoreErrors = getErrorHandling(); - - EndModal(BUTTON_APPLY); -} - - -void SyncCfgDialog::updateToolTipErrorHandling(bool ignoreErrors) -{ - if (ignoreErrors) - m_choiceHandleError->SetToolTip(_("Hide all error and warning messages")); - else - m_choiceHandleError->SetToolTip(_("Show popup on errors or warnings")); -} - - -bool SyncCfgDialog::getErrorHandling() -{ - if (m_choiceHandleError->GetSelection() == 1) //Ignore errors - return true; - else - return false; // Show popup -} - - -void SyncCfgDialog::setErrorHandling(bool ignoreErrors) -{ - m_choiceHandleError->Clear(); - m_choiceHandleError->Append(_("Show popup")); - m_choiceHandleError->Append(_("Ignore errors")); - - if (ignoreErrors) - m_choiceHandleError->SetSelection(1); - else - m_choiceHandleError->SetSelection(0); - - updateToolTipErrorHandling(ignoreErrors); -} - - -void SyncCfgDialog::OnChangeErrorHandling(wxCommandEvent& event) -{ - updateToolTipErrorHandling(getErrorHandling()); -} - -//------------------- - -void updateToolTipDeletionHandling(wxChoice* choiceHandleError, wxPanel* customDir, const FreeFileSync::DeletionPolicy value) -{ - customDir->Disable(); - - switch (value) - { - case FreeFileSync::DELETE_PERMANENTLY: - choiceHandleError->SetToolTip(_("Delete or overwrite files permanently")); - break; - - case FreeFileSync::MOVE_TO_RECYCLE_BIN: - choiceHandleError->SetToolTip(_("Use Recycle Bin when deleting or overwriting files")); - break; - - case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: - choiceHandleError->SetToolTip(_("Move files into a time-stamped subdirectory")); - customDir->Enable(); - break; - } -} - - -FreeFileSync::DeletionPolicy SyncCfgDialog::getDeletionHandling() -{ - switch (m_choiceHandleDeletion->GetSelection()) - { - case 0: - return FreeFileSync::DELETE_PERMANENTLY; - case 1: - return FreeFileSync::MOVE_TO_RECYCLE_BIN; - case 2: - return FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY; - default: - assert(false); - return FreeFileSync::MOVE_TO_RECYCLE_BIN; - } -} - - -void SyncCfgDialog::setDeletionHandling(FreeFileSync::DeletionPolicy newValue) -{ - m_choiceHandleDeletion->Clear(); - m_choiceHandleDeletion->Append(_("Delete permanently")); - m_choiceHandleDeletion->Append(_("Use Recycle Bin")); - m_choiceHandleDeletion->Append(_("User-defined directory")); - - switch (newValue) - { - case FreeFileSync::DELETE_PERMANENTLY: - m_choiceHandleDeletion->SetSelection(0); - break; - case FreeFileSync::MOVE_TO_RECYCLE_BIN: - m_choiceHandleDeletion->SetSelection(1); - break; - case FreeFileSync::MOVE_TO_CUSTOM_DIRECTORY: - m_choiceHandleDeletion->SetSelection(2); - break; - } - - updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, newValue); -} - - -void SyncCfgDialog::OnChangeDeletionHandling(wxCommandEvent& event) -{ - updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, getDeletionHandling()); -} - - -void SyncCfgDialog::OnSyncAutomatic(wxCommandEvent& event) -{ - FreeFileSync::setVariant(currentSyncConfig, SyncConfiguration::AUTOMATIC); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnSyncLeftToRight(wxCommandEvent& event) -{ - FreeFileSync::setVariant(currentSyncConfig, SyncConfiguration::MIRROR); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnSyncUpdate(wxCommandEvent& event) -{ - FreeFileSync::setVariant(currentSyncConfig, SyncConfiguration::UPDATE); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void toggleSyncDirection(SyncDirection& current) -{ - switch (current) - { - case SYNC_DIR_RIGHT: - current = SYNC_DIR_LEFT; - break; - case SYNC_DIR_LEFT: - current = SYNC_DIR_NONE; - break; - case SYNC_DIR_NONE: - current = SYNC_DIR_RIGHT; - break; - } -} - - -void SyncCfgDialog::OnExLeftSideOnly(wxCommandEvent& event ) -{ - toggleSyncDirection(currentSyncConfig.exLeftSideOnly); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnExRightSideOnly(wxCommandEvent& event ) -{ - toggleSyncDirection(currentSyncConfig.exRightSideOnly); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnLeftNewer(wxCommandEvent& event ) -{ - toggleSyncDirection(currentSyncConfig.leftNewer); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnRightNewer(wxCommandEvent& event ) -{ - toggleSyncDirection(currentSyncConfig.rightNewer); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnDifferent(wxCommandEvent& event ) -{ - toggleSyncDirection(currentSyncConfig.different); - updateConfigIcons(cmpVariant, currentSyncConfig); -} - - -void SyncCfgDialog::OnConflict(wxCommandEvent& event) -{ - toggleSyncDirection(currentSyncConfig.conflict); - updateConfigIcons(cmpVariant, currentSyncConfig); -} diff --git a/ui/syncConfig.h b/ui/syncConfig.h deleted file mode 100644 index dc76325c..00000000 --- a/ui/syncConfig.h +++ /dev/null @@ -1,99 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef SYNCCONFIG_H_INCLUDED -#define SYNCCONFIG_H_INCLUDED - -#include -#include "guiGenerated.h" -#include "../structures.h" - - -namespace FreeFileSync -{ -class DragDropOnDlg; -} - - -class SyncCfgDialog : public SyncCfgDlgGenerated -{ -public: - SyncCfgDialog(wxWindow* window, - const FreeFileSync::CompareVariant compareVar, - FreeFileSync::SyncConfiguration& syncConfiguration, - FreeFileSync::DeletionPolicy& handleDeletion, - wxString& customDeletionDirectory, - bool* ignoreErrors); //optional input parameter - - ~SyncCfgDialog(); - - enum - { - BUTTON_APPLY = 10 - }; - - static void updateConfigIcons(const FreeFileSync::CompareVariant compareVar, - const FreeFileSync::SyncConfiguration& syncConfig, - wxBitmapButton* buttonLeftOnly, - wxBitmapButton* buttonRightOnly, - wxBitmapButton* buttonLeftNewer, - wxBitmapButton* buttonRightNewer, - wxBitmapButton* buttonDifferent, - wxBitmapButton* buttonConflict, - wxStaticBitmap* bitmapLeftOnly, - wxStaticBitmap* bitmapRightOnly, - wxStaticBitmap* bitmapLeftNewer, - wxStaticBitmap* bitmapRightNewer, - wxStaticBitmap* bitmapDifferent, - wxStaticBitmap* bitmapConflict, - wxSizer* syncDirections); - //some syntax relaxation - void updateConfigIcons(const FreeFileSync::CompareVariant cmpVar, const FreeFileSync::SyncConfiguration& syncConfig); - -private: - virtual void OnSyncAutomatic( wxCommandEvent& event); - virtual void OnSyncLeftToRight( wxCommandEvent& event); - virtual void OnSyncUpdate( wxCommandEvent& event); - - virtual void OnExLeftSideOnly( wxCommandEvent& event); - virtual void OnExRightSideOnly( wxCommandEvent& event); - virtual void OnLeftNewer( wxCommandEvent& event); - virtual void OnRightNewer( wxCommandEvent& event); - virtual void OnDifferent( wxCommandEvent& event); - virtual void OnConflict( wxCommandEvent& event); - - virtual void OnClose( wxCloseEvent& event); - virtual void OnCancel( wxCommandEvent& event); - virtual void OnApply( wxCommandEvent& event); - - //set tooltip - void updateToolTipErrorHandling(bool ignoreErrors); - - //error handling - bool getErrorHandling(); - void setErrorHandling(bool ignoreErrors); - void OnChangeErrorHandling(wxCommandEvent& event); - - //deletion handling - FreeFileSync::DeletionPolicy getDeletionHandling(); - void setDeletionHandling(FreeFileSync::DeletionPolicy newValue); - void OnChangeDeletionHandling(wxCommandEvent& event); - - const FreeFileSync::CompareVariant cmpVariant; - - //temporal copy of maindialog.cfg.syncConfiguration - FreeFileSync::SyncConfiguration currentSyncConfig; - - //changing data - FreeFileSync::SyncConfiguration& refSyncConfiguration; - FreeFileSync::DeletionPolicy& refHandleDeletion; - wxString& refCustomDeletionDirectory; - bool* refIgnoreErrors; - - std::auto_ptr dragDropCustomDelFolder; -}; - -#endif // SYNCCONFIG_H_INCLUDED diff --git a/ui/sync_cfg.cpp b/ui/sync_cfg.cpp new file mode 100644 index 00000000..c7dd58a5 --- /dev/null +++ b/ui/sync_cfg.cpp @@ -0,0 +1,477 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "sync_cfg.h" + +#include "../library/resources.h" +#include "../shared/drag_n_drop.h" +#include + +using namespace ffs3; + + +SyncCfgDialog::SyncCfgDialog(wxWindow* window, + const CompareVariant compareVar, + SyncConfiguration& syncConfiguration, + DeletionPolicy& handleDeletion, + wxString& customDeletionDirectory, + bool* ignoreErrors) : + SyncCfgDlgGenerated(window), + cmpVariant(compareVar), + currentSyncConfig(syncConfiguration), //make working copy of syncConfiguration + refSyncConfiguration(syncConfiguration), + refHandleDeletion(handleDeletion), + refCustomDeletionDirectory(customDeletionDirectory), + refIgnoreErrors(ignoreErrors), + dragDropCustomDelFolder(new DragDropOnDlg(m_panelCustomDeletionDir, m_dirPickerCustomDelFolder, m_textCtrlCustomDelFolder)) +{ + setDeletionHandling(handleDeletion); + m_textCtrlCustomDelFolder->SetValue(customDeletionDirectory); + + //error handling + if (ignoreErrors) + setErrorHandling(*ignoreErrors); + else + { + sbSizerErrorHandling->Show(false); + Layout(); + } + + //set sync config icons + updateConfigIcons(cmpVariant, currentSyncConfig); + + //set icons for this dialog + m_bitmapLeftOnly->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("leftOnly"))); + m_bitmapRightOnly->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("rightOnly"))); + m_bitmapLeftNewer->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("leftNewer"))); + m_bitmapRightNewer->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("rightNewer"))); + m_bitmapDifferent->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("different"))); + m_bitmapConflict->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("conflictGrey"))); + + bSizer201->Layout(); //wxButtonWithImage size might have changed + + m_buttonOK->SetFocus(); + + Fit(); +} + +//################################################################################################################# + +SyncCfgDialog::~SyncCfgDialog() {} //non-inline destructor for std::auto_ptr to work with forward declaration + + +void SyncCfgDialog::updateConfigIcons(const ffs3::CompareVariant cmpVar, const ffs3::SyncConfiguration& syncConfig) +{ + //wxWindowUpdateLocker dummy(this); //avoid display distortion + wxWindowUpdateLocker dummy2(m_panelCustomDeletionDir); //avoid display distortion + wxWindowUpdateLocker dummy3(m_bpButtonLeftOnly); + wxWindowUpdateLocker dummy4(m_bpButtonRightOnly); + wxWindowUpdateLocker dummy5(m_bpButtonLeftNewer); + wxWindowUpdateLocker dummy6(m_bpButtonRightNewer); + wxWindowUpdateLocker dummy7(m_bpButtonDifferent); + wxWindowUpdateLocker dummy8(m_bpButtonConflict); + + + updateConfigIcons(cmpVar, + syncConfig, + m_bpButtonLeftOnly, + m_bpButtonRightOnly, + m_bpButtonLeftNewer, + m_bpButtonRightNewer, + m_bpButtonDifferent, + m_bpButtonConflict, + m_bitmapLeftOnly, + m_bitmapRightOnly, + m_bitmapLeftNewer, + m_bitmapRightNewer, + m_bitmapDifferent, + m_bitmapConflict, + sbSizerSyncDirections); + + //set radiobuttons -> have no parameter-ownership at all! + switch (ffs3::getVariant(currentSyncConfig)) + { + case SyncConfiguration::AUTOMATIC: + m_radioBtnAutomatic->SetValue(true); //automatic mode + break; + case SyncConfiguration::MIRROR: + m_radioBtnMirror->SetValue(true); //one way -> + break; + case SyncConfiguration::UPDATE: + m_radioBtnUpdate->SetValue(true); //Update -> + break; + case SyncConfiguration::CUSTOM: + m_radioBtnCustom->SetValue(true); //custom + break; + } + + GetSizer()->SetSizeHints(this); //this works like a charm for GTK2 with window resizing problems!!! (includes call to Fit()) +} + + +void SyncCfgDialog::updateConfigIcons(const CompareVariant compareVar, + const SyncConfiguration& syncConfig, + wxBitmapButton* buttonLeftOnly, + wxBitmapButton* buttonRightOnly, + wxBitmapButton* buttonLeftNewer, + wxBitmapButton* buttonRightNewer, + wxBitmapButton* buttonDifferent, + wxBitmapButton* buttonConflict, + wxStaticBitmap* bitmapLeftOnly, + wxStaticBitmap* bitmapRightOnly, + wxStaticBitmap* bitmapLeftNewer, + wxStaticBitmap* bitmapRightNewer, + wxStaticBitmap* bitmapDifferent, + wxStaticBitmap* bitmapConflict, + wxSizer* syncDirections) //sizer containing all sync-directions +{ + //display only relevant sync options + syncDirections->Show(true); + + buttonLeftOnly ->Show(); // + buttonRightOnly ->Show(); // + buttonLeftNewer ->Show(); // + buttonRightNewer->Show(); // enable everything by default + buttonDifferent ->Show(); // + buttonConflict ->Show(); // + + bitmapLeftOnly ->Show(); // + bitmapRightOnly ->Show(); // + bitmapLeftNewer ->Show(); // + bitmapRightNewer->Show(); // + bitmapDifferent ->Show(); // + bitmapConflict ->Show(); // + + switch (compareVar) + { + case CMP_BY_TIME_SIZE: + buttonDifferent ->Hide(); + + bitmapDifferent ->Hide(); + break; + + case CMP_BY_CONTENT: + buttonLeftNewer ->Hide(); + buttonRightNewer->Hide(); + + bitmapLeftNewer ->Hide(); + bitmapRightNewer->Hide(); + break; + } + + if (syncConfig.automatic) //automatic mode needs no sync-directions + syncDirections->Show(false); + + switch (syncConfig.exLeftSideOnly) + { + case SYNC_DIR_RIGHT: + buttonLeftOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRightCr"))); + buttonLeftOnly->SetToolTip(getDescription(SO_CREATE_NEW_RIGHT)); + break; + case SYNC_DIR_LEFT: + buttonLeftOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("deleteLeft"))); + buttonLeftOnly->SetToolTip(getDescription(SO_DELETE_LEFT)); + break; + case SYNC_DIR_NONE: + buttonLeftOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); + buttonLeftOnly->SetToolTip(getDescription(SO_DO_NOTHING)); + break; + } + + switch (syncConfig.exRightSideOnly) + { + case SYNC_DIR_RIGHT: + buttonRightOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("deleteRight"))); + buttonRightOnly->SetToolTip(getDescription(SO_DELETE_RIGHT)); + break; + case SYNC_DIR_LEFT: + buttonRightOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeftCr"))); + buttonRightOnly->SetToolTip(getDescription(SO_CREATE_NEW_LEFT)); + break; + case SYNC_DIR_NONE: + buttonRightOnly->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); + buttonRightOnly->SetToolTip(getDescription(SO_DO_NOTHING)); + break; + } + + switch (syncConfig.leftNewer) + { + case SYNC_DIR_RIGHT: + buttonLeftNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); + buttonLeftNewer->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); + break; + case SYNC_DIR_LEFT: + buttonLeftNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); + buttonLeftNewer->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); + break; + case SYNC_DIR_NONE: + buttonLeftNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); + buttonLeftNewer->SetToolTip(getDescription(SO_DO_NOTHING)); + break; + } + + switch (syncConfig.rightNewer) + { + case SYNC_DIR_RIGHT: + buttonRightNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); + buttonRightNewer->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); + break; + case SYNC_DIR_LEFT: + buttonRightNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); + buttonRightNewer->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); + break; + case SYNC_DIR_NONE: + buttonRightNewer->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); + buttonRightNewer->SetToolTip(getDescription(SO_DO_NOTHING)); + break; + } + + switch (syncConfig.different) + { + case SYNC_DIR_RIGHT: + buttonDifferent->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); + buttonDifferent->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); + break; + case SYNC_DIR_LEFT: + buttonDifferent->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); + buttonDifferent->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); + break; + case SYNC_DIR_NONE: + buttonDifferent->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowNone"))); + buttonDifferent->SetToolTip(getDescription(SO_DO_NOTHING)); + break; + } + + switch (syncConfig.conflict) + { + case SYNC_DIR_RIGHT: + buttonConflict->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowRight"))); + buttonConflict->SetToolTip(getDescription(SO_OVERWRITE_RIGHT)); + break; + case SYNC_DIR_LEFT: + buttonConflict->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("arrowLeft"))); + buttonConflict->SetToolTip(getDescription(SO_OVERWRITE_LEFT)); + break; + case SYNC_DIR_NONE: + buttonConflict->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("conflict"))); + buttonConflict->SetToolTip(_("Leave as unresolved conflict")); + break; + } +} + + +void SyncCfgDialog::OnClose(wxCloseEvent& event) +{ + EndModal(0); +} + + +void SyncCfgDialog::OnCancel(wxCommandEvent& event) +{ + EndModal(0); +} + + +void SyncCfgDialog::OnApply(wxCommandEvent& event) +{ + //write configuration to main dialog + refSyncConfiguration = currentSyncConfig; + refHandleDeletion = getDeletionHandling(); + refCustomDeletionDirectory = m_textCtrlCustomDelFolder->GetValue(); + if (refIgnoreErrors) + *refIgnoreErrors = getErrorHandling(); + + EndModal(BUTTON_APPLY); +} + + +void SyncCfgDialog::updateToolTipErrorHandling(bool ignoreErrors) +{ + if (ignoreErrors) + m_choiceHandleError->SetToolTip(_("Hide all error and warning messages")); + else + m_choiceHandleError->SetToolTip(_("Show popup on errors or warnings")); +} + + +bool SyncCfgDialog::getErrorHandling() +{ + if (m_choiceHandleError->GetSelection() == 1) //Ignore errors + return true; + else + return false; // Show popup +} + + +void SyncCfgDialog::setErrorHandling(bool ignoreErrors) +{ + m_choiceHandleError->Clear(); + m_choiceHandleError->Append(_("Show popup")); + m_choiceHandleError->Append(_("Ignore errors")); + + if (ignoreErrors) + m_choiceHandleError->SetSelection(1); + else + m_choiceHandleError->SetSelection(0); + + updateToolTipErrorHandling(ignoreErrors); +} + + +void SyncCfgDialog::OnChangeErrorHandling(wxCommandEvent& event) +{ + updateToolTipErrorHandling(getErrorHandling()); +} + +//------------------- + +void updateToolTipDeletionHandling(wxChoice* choiceHandleError, wxPanel* customDir, const ffs3::DeletionPolicy value) +{ + customDir->Disable(); + + switch (value) + { + case ffs3::DELETE_PERMANENTLY: + choiceHandleError->SetToolTip(_("Delete or overwrite files permanently")); + break; + + case ffs3::MOVE_TO_RECYCLE_BIN: + choiceHandleError->SetToolTip(_("Use Recycle Bin when deleting or overwriting files")); + break; + + case ffs3::MOVE_TO_CUSTOM_DIRECTORY: + choiceHandleError->SetToolTip(_("Move files into a time-stamped subdirectory")); + customDir->Enable(); + break; + } +} + + +ffs3::DeletionPolicy SyncCfgDialog::getDeletionHandling() +{ + switch (m_choiceHandleDeletion->GetSelection()) + { + case 0: + return ffs3::DELETE_PERMANENTLY; + case 1: + return ffs3::MOVE_TO_RECYCLE_BIN; + case 2: + return ffs3::MOVE_TO_CUSTOM_DIRECTORY; + default: + assert(false); + return ffs3::MOVE_TO_RECYCLE_BIN; + } +} + + +void SyncCfgDialog::setDeletionHandling(ffs3::DeletionPolicy newValue) +{ + m_choiceHandleDeletion->Clear(); + m_choiceHandleDeletion->Append(_("Delete permanently")); + m_choiceHandleDeletion->Append(_("Use Recycle Bin")); + m_choiceHandleDeletion->Append(_("User-defined directory")); + + switch (newValue) + { + case ffs3::DELETE_PERMANENTLY: + m_choiceHandleDeletion->SetSelection(0); + break; + case ffs3::MOVE_TO_RECYCLE_BIN: + m_choiceHandleDeletion->SetSelection(1); + break; + case ffs3::MOVE_TO_CUSTOM_DIRECTORY: + m_choiceHandleDeletion->SetSelection(2); + break; + } + + updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, newValue); +} + + +void SyncCfgDialog::OnChangeDeletionHandling(wxCommandEvent& event) +{ + updateToolTipDeletionHandling(m_choiceHandleDeletion, m_panelCustomDeletionDir, getDeletionHandling()); +} + + +void SyncCfgDialog::OnSyncAutomatic(wxCommandEvent& event) +{ + ffs3::setVariant(currentSyncConfig, SyncConfiguration::AUTOMATIC); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnSyncLeftToRight(wxCommandEvent& event) +{ + ffs3::setVariant(currentSyncConfig, SyncConfiguration::MIRROR); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnSyncUpdate(wxCommandEvent& event) +{ + ffs3::setVariant(currentSyncConfig, SyncConfiguration::UPDATE); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void toggleSyncDirection(SyncDirection& current) +{ + switch (current) + { + case SYNC_DIR_RIGHT: + current = SYNC_DIR_LEFT; + break; + case SYNC_DIR_LEFT: + current = SYNC_DIR_NONE; + break; + case SYNC_DIR_NONE: + current = SYNC_DIR_RIGHT; + break; + } +} + + +void SyncCfgDialog::OnExLeftSideOnly(wxCommandEvent& event ) +{ + toggleSyncDirection(currentSyncConfig.exLeftSideOnly); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnExRightSideOnly(wxCommandEvent& event ) +{ + toggleSyncDirection(currentSyncConfig.exRightSideOnly); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnLeftNewer(wxCommandEvent& event ) +{ + toggleSyncDirection(currentSyncConfig.leftNewer); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnRightNewer(wxCommandEvent& event ) +{ + toggleSyncDirection(currentSyncConfig.rightNewer); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnDifferent(wxCommandEvent& event ) +{ + toggleSyncDirection(currentSyncConfig.different); + updateConfigIcons(cmpVariant, currentSyncConfig); +} + + +void SyncCfgDialog::OnConflict(wxCommandEvent& event) +{ + toggleSyncDirection(currentSyncConfig.conflict); + updateConfigIcons(cmpVariant, currentSyncConfig); +} diff --git a/ui/sync_cfg.h b/ui/sync_cfg.h new file mode 100644 index 00000000..b738111a --- /dev/null +++ b/ui/sync_cfg.h @@ -0,0 +1,99 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef SYNCCONFIG_H_INCLUDED +#define SYNCCONFIG_H_INCLUDED + +#include +#include "gui_generated.h" +#include "../structures.h" + + +namespace ffs3 +{ +class DragDropOnDlg; +} + + +class SyncCfgDialog : public SyncCfgDlgGenerated +{ +public: + SyncCfgDialog(wxWindow* window, + const ffs3::CompareVariant compareVar, + ffs3::SyncConfiguration& syncConfiguration, + ffs3::DeletionPolicy& handleDeletion, + wxString& customDeletionDirectory, + bool* ignoreErrors); //optional input parameter + + ~SyncCfgDialog(); + + enum + { + BUTTON_APPLY = 10 + }; + + static void updateConfigIcons(const ffs3::CompareVariant compareVar, + const ffs3::SyncConfiguration& syncConfig, + wxBitmapButton* buttonLeftOnly, + wxBitmapButton* buttonRightOnly, + wxBitmapButton* buttonLeftNewer, + wxBitmapButton* buttonRightNewer, + wxBitmapButton* buttonDifferent, + wxBitmapButton* buttonConflict, + wxStaticBitmap* bitmapLeftOnly, + wxStaticBitmap* bitmapRightOnly, + wxStaticBitmap* bitmapLeftNewer, + wxStaticBitmap* bitmapRightNewer, + wxStaticBitmap* bitmapDifferent, + wxStaticBitmap* bitmapConflict, + wxSizer* syncDirections); + //some syntax relaxation + void updateConfigIcons(const ffs3::CompareVariant cmpVar, const ffs3::SyncConfiguration& syncConfig); + +private: + virtual void OnSyncAutomatic( wxCommandEvent& event); + virtual void OnSyncLeftToRight( wxCommandEvent& event); + virtual void OnSyncUpdate( wxCommandEvent& event); + + virtual void OnExLeftSideOnly( wxCommandEvent& event); + virtual void OnExRightSideOnly( wxCommandEvent& event); + virtual void OnLeftNewer( wxCommandEvent& event); + virtual void OnRightNewer( wxCommandEvent& event); + virtual void OnDifferent( wxCommandEvent& event); + virtual void OnConflict( wxCommandEvent& event); + + virtual void OnClose( wxCloseEvent& event); + virtual void OnCancel( wxCommandEvent& event); + virtual void OnApply( wxCommandEvent& event); + + //set tooltip + void updateToolTipErrorHandling(bool ignoreErrors); + + //error handling + bool getErrorHandling(); + void setErrorHandling(bool ignoreErrors); + void OnChangeErrorHandling(wxCommandEvent& event); + + //deletion handling + ffs3::DeletionPolicy getDeletionHandling(); + void setDeletionHandling(ffs3::DeletionPolicy newValue); + void OnChangeDeletionHandling(wxCommandEvent& event); + + const ffs3::CompareVariant cmpVariant; + + //temporal copy of maindialog.cfg.syncConfiguration + ffs3::SyncConfiguration currentSyncConfig; + + //changing data + ffs3::SyncConfiguration& refSyncConfiguration; + ffs3::DeletionPolicy& refHandleDeletion; + wxString& refCustomDeletionDirectory; + bool* refIgnoreErrors; + + std::auto_ptr dragDropCustomDelFolder; +}; + +#endif // SYNCCONFIG_H_INCLUDED diff --git a/ui/trayIcon.cpp b/ui/trayIcon.cpp deleted file mode 100644 index 554309ca..00000000 --- a/ui/trayIcon.cpp +++ /dev/null @@ -1,213 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#include "trayIcon.h" -#include "../library/resources.h" -#include "smallDialogs.h" -#include -#include -#include -#include -#include //req. by Linux - -namespace -{ -inline -int roundNum(double d) //little rounding function -{ - return static_cast(d < 0 ? d - .5 : d + .5); -} - - -wxIcon generateIcon(size_t percent) //generate icon with progress indicator -{ - percent = std::min(percent, static_cast(100u)); //handle invalid input - -#ifdef FFS_WIN - static const wxBitmap trayIcon = GlobalResources::getInstance().getImageByName(wxT("FFS_tray_win.png")); -#elif defined FFS_LINUX - static const wxBitmap trayIcon = GlobalResources::getInstance().getImageByName(wxT("FFS_tray_linux.png")); -#endif - - const int indicatorHeight = roundNum((trayIcon.GetHeight() * percent) / 100.0); - - //minor optimization - static std::pair buffer = std::make_pair(-1, wxNullIcon); - if (buffer.first == indicatorHeight) - return buffer.second; - - if ( trayIcon.GetWidth() > 0 && - trayIcon.GetHeight() > 0) - { - static const int indicatorWidth = trayIcon.GetWidth() * .25; - const int indicatorXBegin = ceil((trayIcon.GetWidth() - indicatorWidth) / 2.0); - const int indicatorYBegin = trayIcon.GetHeight() - indicatorHeight; - - wxImage genImage(trayIcon.ConvertToImage()); - - //draw progress indicator: do NOT use wxDC::DrawRectangle! Doesn't respect alpha in Windows, but does in Linux! - //We need a simple, working solution: - unsigned char* const data = genImage.GetData(); - for (int row = indicatorYBegin; row < genImage.GetHeight(); ++row) - { - for (int col = indicatorXBegin; col < indicatorXBegin + indicatorWidth; ++col) - { - unsigned char* const pixelBegin = data + (row * genImage.GetWidth() + col) * 3; - pixelBegin[0] = 255; //red - pixelBegin[1] = 255; //green - pixelBegin[2] = 0; //blue - } - } - - if (genImage.HasAlpha()) - { - unsigned char* const alpha = genImage.GetAlpha(); - //make progress indicator fully opaque: - for (int row = indicatorYBegin; row < genImage.GetHeight(); ++row) - ::memset(alpha + row * genImage.GetWidth() + indicatorXBegin, wxIMAGE_ALPHA_OPAQUE, indicatorWidth); - } - - wxIcon genIcon; - genIcon.CopyFromBitmap(wxBitmap(genImage)); - - //fill buffer - buffer.first = indicatorHeight; - buffer.second = genIcon; - - return genIcon; - } - - //fallback - wxIcon defaultIcon; - defaultIcon.CopyFromBitmap(trayIcon); - - //fill buffer - buffer.first = indicatorHeight; - buffer.second = defaultIcon; - - return defaultIcon; -} -} - - -//------------------------------------------------------------------------------------------------ -enum Selection -{ - CONTEXT_RESTORE, - CONTEXT_ABOUT -}; - - -class MinimizeToTray::TaskBarImpl : public wxTaskBarIcon -{ -public: - TaskBarImpl(MinimizeToTray* parent) : parent_(parent) {} - - void parentHasDied() - { - parent_ = NULL; - } -private: - virtual wxMenu* CreatePopupMenu() - { - if (!parent_) - return NULL; - - wxMenu* contextMenu = new wxMenu; - contextMenu->Append(CONTEXT_ABOUT, _("&About...")); - contextMenu->AppendSeparator(); - contextMenu->Append(CONTEXT_RESTORE, _("&Restore")); - //event handling - contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MinimizeToTray::OnContextMenuSelection), NULL, parent_); - - return contextMenu; //ownership transferred to caller - } - - MinimizeToTray* parent_; -}; - - -MinimizeToTray::MinimizeToTray(wxTopLevelWindow* callerWnd, wxWindow* secondWnd) : - callerWnd_(callerWnd), - secondWnd_(secondWnd), - trayIcon(new TaskBarImpl(this)) -{ - trayIcon->SetIcon(generateIcon(0), wxT("FreeFileSync")); - trayIcon->Connect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(MinimizeToTray::OnDoubleClick), NULL, this); //register double-click - - if (callerWnd_) - callerWnd_->Hide(); - if (secondWnd_) - secondWnd_->Hide(); -} - - -MinimizeToTray::~MinimizeToTray() -{ - resumeFromTray(); -} - - -void MinimizeToTray::resumeFromTray() //remove trayIcon and restore windows: MinimizeToTray is now a zombie object... -{ - if (trayIcon) - { - if (secondWnd_) - secondWnd_->Show(); - - if (callerWnd_) //usecase: avoid dialog flashing in batch silent mode - { - callerWnd_->Iconize(false); - callerWnd_->Show(); - callerWnd_->Raise(); - callerWnd_->SetFocus(); - } - trayIcon->RemoveIcon(); //hide icon until final deletion takes place - trayIcon->Disconnect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(MinimizeToTray::OnDoubleClick), NULL, this); - trayIcon->parentHasDied(); //TaskBarImpl (potentially) has longer lifetime than MinimizeToTray: avoid callback! - - //use wxWidgets delayed destruction: delete during next idle loop iteration (handle late window messages, e.g. when double-clicking) - if (!wxPendingDelete.Member(trayIcon)) - wxPendingDelete.Append(trayIcon); - - trayIcon = NULL; //avoid reentrance - } -} - - -void MinimizeToTray::setToolTip(const wxString& toolTipText, size_t percent) -{ - if (trayIcon) - trayIcon->SetIcon(generateIcon(percent), toolTipText); -} - - -void MinimizeToTray::keepHidden() -{ - callerWnd_ = NULL; - secondWnd_ = NULL; -} - - -void MinimizeToTray::OnContextMenuSelection(wxCommandEvent& event) -{ - const Selection eventId = static_cast(event.GetId()); - switch (eventId) - { - case CONTEXT_ABOUT: - FreeFileSync::showAboutDialog(); - break; - case CONTEXT_RESTORE: - resumeFromTray(); - } -} - - -void MinimizeToTray::OnDoubleClick(wxCommandEvent& event) -{ - resumeFromTray(); -} - diff --git a/ui/trayIcon.h b/ui/trayIcon.h deleted file mode 100644 index b351dfc8..00000000 --- a/ui/trayIcon.h +++ /dev/null @@ -1,34 +0,0 @@ -// ************************************************************************** -// * This file is part of the FreeFileSync project. It is distributed under * -// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * -// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * -// ************************************************************************** -// -#ifndef TRAYICON_H_INCLUDED -#define TRAYICON_H_INCLUDED - -#include -#include - - -class MinimizeToTray : private wxEvtHandler -{ -public: - MinimizeToTray(wxTopLevelWindow* callerWnd, wxWindow* secondWnd = NULL); //ensure callerWind has longer lifetime! - ~MinimizeToTray(); //show windows again - - void setToolTip(const wxString& toolTipText, size_t percent = 0); //percent (optional), number between [0, 100], for small progress indicator - void keepHidden(); //do not show windows again: avoid window flashing shortly before it is destroyed - -private: - void OnContextMenuSelection(wxCommandEvent& event); - void OnDoubleClick(wxCommandEvent& event); - void resumeFromTray(); - - wxTopLevelWindow* callerWnd_; - wxWindow* secondWnd_; - class TaskBarImpl; - TaskBarImpl* trayIcon; //actual tray icon (don't use inheritance to enable delayed deletion) -}; - -#endif // TRAYICON_H_INCLUDED diff --git a/ui/tray_icon.cpp b/ui/tray_icon.cpp new file mode 100644 index 00000000..464bf7ef --- /dev/null +++ b/ui/tray_icon.cpp @@ -0,0 +1,213 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#include "tray_icon.h" +#include "../library/resources.h" +#include "small_dlgs.h" +#include +#include +#include +#include +#include //req. by Linux + +namespace +{ +inline +int roundNum(double d) //little rounding function +{ + return static_cast(d < 0 ? d - .5 : d + .5); +} + + +wxIcon generateIcon(size_t percent) //generate icon with progress indicator +{ + percent = std::min(percent, static_cast(100u)); //handle invalid input + +#ifdef FFS_WIN + static const wxBitmap trayIcon = GlobalResources::getInstance().getImageByName(wxT("FFS_tray_win.png")); +#elif defined FFS_LINUX + static const wxBitmap trayIcon = GlobalResources::getInstance().getImageByName(wxT("FFS_tray_linux.png")); +#endif + + const int indicatorHeight = roundNum((trayIcon.GetHeight() * percent) / 100.0); + + //minor optimization + static std::pair buffer = std::make_pair(-1, wxNullIcon); + if (buffer.first == indicatorHeight) + return buffer.second; + + if ( trayIcon.GetWidth() > 0 && + trayIcon.GetHeight() > 0) + { + static const int indicatorWidth = trayIcon.GetWidth() * .25; + const int indicatorXBegin = ceil((trayIcon.GetWidth() - indicatorWidth) / 2.0); + const int indicatorYBegin = trayIcon.GetHeight() - indicatorHeight; + + wxImage genImage(trayIcon.ConvertToImage()); + + //draw progress indicator: do NOT use wxDC::DrawRectangle! Doesn't respect alpha in Windows, but does in Linux! + //We need a simple, working solution: + unsigned char* const data = genImage.GetData(); + for (int row = indicatorYBegin; row < genImage.GetHeight(); ++row) + { + for (int col = indicatorXBegin; col < indicatorXBegin + indicatorWidth; ++col) + { + unsigned char* const pixelBegin = data + (row * genImage.GetWidth() + col) * 3; + pixelBegin[0] = 255; //red + pixelBegin[1] = 255; //green + pixelBegin[2] = 0; //blue + } + } + + if (genImage.HasAlpha()) + { + unsigned char* const alpha = genImage.GetAlpha(); + //make progress indicator fully opaque: + for (int row = indicatorYBegin; row < genImage.GetHeight(); ++row) + ::memset(alpha + row * genImage.GetWidth() + indicatorXBegin, wxIMAGE_ALPHA_OPAQUE, indicatorWidth); + } + + wxIcon genIcon; + genIcon.CopyFromBitmap(wxBitmap(genImage)); + + //fill buffer + buffer.first = indicatorHeight; + buffer.second = genIcon; + + return genIcon; + } + + //fallback + wxIcon defaultIcon; + defaultIcon.CopyFromBitmap(trayIcon); + + //fill buffer + buffer.first = indicatorHeight; + buffer.second = defaultIcon; + + return defaultIcon; +} +} + + +//------------------------------------------------------------------------------------------------ +enum Selection +{ + CONTEXT_RESTORE, + CONTEXT_ABOUT +}; + + +class MinimizeToTray::TaskBarImpl : public wxTaskBarIcon +{ +public: + TaskBarImpl(MinimizeToTray* parent) : parent_(parent) {} + + void parentHasDied() + { + parent_ = NULL; + } +private: + virtual wxMenu* CreatePopupMenu() + { + if (!parent_) + return NULL; + + wxMenu* contextMenu = new wxMenu; + contextMenu->Append(CONTEXT_ABOUT, _("&About...")); + contextMenu->AppendSeparator(); + contextMenu->Append(CONTEXT_RESTORE, _("&Restore")); + //event handling + contextMenu->Connect(wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MinimizeToTray::OnContextMenuSelection), NULL, parent_); + + return contextMenu; //ownership transferred to caller + } + + MinimizeToTray* parent_; +}; + + +MinimizeToTray::MinimizeToTray(wxTopLevelWindow* callerWnd, wxWindow* secondWnd) : + callerWnd_(callerWnd), + secondWnd_(secondWnd), + trayIcon(new TaskBarImpl(this)) +{ + trayIcon->SetIcon(generateIcon(0), wxT("FreeFileSync")); + trayIcon->Connect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(MinimizeToTray::OnDoubleClick), NULL, this); //register double-click + + if (callerWnd_) + callerWnd_->Hide(); + if (secondWnd_) + secondWnd_->Hide(); +} + + +MinimizeToTray::~MinimizeToTray() +{ + resumeFromTray(); +} + + +void MinimizeToTray::resumeFromTray() //remove trayIcon and restore windows: MinimizeToTray is now a zombie object... +{ + if (trayIcon) + { + if (secondWnd_) + secondWnd_->Show(); + + if (callerWnd_) //usecase: avoid dialog flashing in batch silent mode + { + callerWnd_->Iconize(false); + callerWnd_->Show(); + callerWnd_->Raise(); + callerWnd_->SetFocus(); + } + trayIcon->RemoveIcon(); //hide icon until final deletion takes place + trayIcon->Disconnect(wxEVT_TASKBAR_LEFT_DCLICK, wxCommandEventHandler(MinimizeToTray::OnDoubleClick), NULL, this); + trayIcon->parentHasDied(); //TaskBarImpl (potentially) has longer lifetime than MinimizeToTray: avoid callback! + + //use wxWidgets delayed destruction: delete during next idle loop iteration (handle late window messages, e.g. when double-clicking) + if (!wxPendingDelete.Member(trayIcon)) + wxPendingDelete.Append(trayIcon); + + trayIcon = NULL; //avoid reentrance + } +} + + +void MinimizeToTray::setToolTip(const wxString& toolTipText, size_t percent) +{ + if (trayIcon) + trayIcon->SetIcon(generateIcon(percent), toolTipText); +} + + +void MinimizeToTray::keepHidden() +{ + callerWnd_ = NULL; + secondWnd_ = NULL; +} + + +void MinimizeToTray::OnContextMenuSelection(wxCommandEvent& event) +{ + const Selection eventId = static_cast(event.GetId()); + switch (eventId) + { + case CONTEXT_ABOUT: + ffs3::showAboutDialog(); + break; + case CONTEXT_RESTORE: + resumeFromTray(); + } +} + + +void MinimizeToTray::OnDoubleClick(wxCommandEvent& event) +{ + resumeFromTray(); +} + diff --git a/ui/tray_icon.h b/ui/tray_icon.h new file mode 100644 index 00000000..b351dfc8 --- /dev/null +++ b/ui/tray_icon.h @@ -0,0 +1,34 @@ +// ************************************************************************** +// * This file is part of the FreeFileSync project. It is distributed under * +// * GNU General Public License: http://www.gnu.org/licenses/gpl.html * +// * Copyright (C) 2008-2010 ZenJu (zhnmju123 AT gmx.de) * +// ************************************************************************** +// +#ifndef TRAYICON_H_INCLUDED +#define TRAYICON_H_INCLUDED + +#include +#include + + +class MinimizeToTray : private wxEvtHandler +{ +public: + MinimizeToTray(wxTopLevelWindow* callerWnd, wxWindow* secondWnd = NULL); //ensure callerWind has longer lifetime! + ~MinimizeToTray(); //show windows again + + void setToolTip(const wxString& toolTipText, size_t percent = 0); //percent (optional), number between [0, 100], for small progress indicator + void keepHidden(); //do not show windows again: avoid window flashing shortly before it is destroyed + +private: + void OnContextMenuSelection(wxCommandEvent& event); + void OnDoubleClick(wxCommandEvent& event); + void resumeFromTray(); + + wxTopLevelWindow* callerWnd_; + wxWindow* secondWnd_; + class TaskBarImpl; + TaskBarImpl* trayIcon; //actual tray icon (don't use inheritance to enable delayed deletion) +}; + +#endif // TRAYICON_H_INCLUDED -- cgit