diff options
author | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:09:45 +0200 |
---|---|---|
committer | Daniel Wilhelm <daniel@wili.li> | 2014-04-18 17:09:45 +0200 |
commit | 88c8801298cbf6fec9cdce254c7b3cb9e066a421 (patch) | |
tree | 35a35acf48eb227bac30abc8f87ea9b1c3c57b68 /ui | |
parent | 3.12 (diff) | |
download | FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.tar.gz FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.tar.bz2 FreeFileSync-88c8801298cbf6fec9cdce254c7b3cb9e066a421.zip |
3.13
Diffstat (limited to 'ui')
-rw-r--r-- | ui/batch_config.cpp | 18 | ||||
-rw-r--r-- | ui/batch_config.h | 2 | ||||
-rw-r--r-- | ui/batch_status_handler.cpp | 2 | ||||
-rw-r--r-- | ui/batch_status_handler.h | 2 | ||||
-rw-r--r-- | ui/check_version.cpp | 2 | ||||
-rw-r--r-- | ui/check_version.h | 2 | ||||
-rw-r--r-- | ui/folder_pair.h | 2 | ||||
-rw-r--r-- | ui/grid_view.cpp | 6 | ||||
-rw-r--r-- | ui/grid_view.h | 2 | ||||
-rw-r--r-- | ui/gui_generated.cpp | 389 | ||||
-rw-r--r-- | ui/gui_generated.h | 59 | ||||
-rw-r--r-- | ui/gui_status_handler.cpp | 33 | ||||
-rw-r--r-- | ui/gui_status_handler.h | 2 | ||||
-rw-r--r-- | ui/is_null_filter.h | 2 | ||||
-rw-r--r-- | ui/main_dlg.cpp | 771 | ||||
-rw-r--r-- | ui/main_dlg.h | 92 | ||||
-rw-r--r-- | ui/mouse_move_dlg.cpp | 39 | ||||
-rw-r--r-- | ui/mouse_move_dlg.h | 11 | ||||
-rw-r--r-- | ui/msg_popup.cpp | 8 | ||||
-rw-r--r-- | ui/msg_popup.h | 2 | ||||
-rw-r--r-- | ui/progress_indicator.cpp | 112 | ||||
-rw-r--r-- | ui/progress_indicator.h | 2 | ||||
-rw-r--r-- | ui/search.cpp | 4 | ||||
-rw-r--r-- | ui/search.h | 2 | ||||
-rw-r--r-- | ui/small_dlgs.cpp | 26 | ||||
-rw-r--r-- | ui/small_dlgs.h | 2 | ||||
-rw-r--r-- | ui/sorting.h | 10 | ||||
-rw-r--r-- | ui/switch_to_gui.cpp | 2 | ||||
-rw-r--r-- | ui/switch_to_gui.h | 2 | ||||
-rw-r--r-- | ui/sync_cfg.cpp | 2 | ||||
-rw-r--r-- | ui/sync_cfg.h | 2 | ||||
-rw-r--r-- | ui/tray_icon.cpp | 4 | ||||
-rw-r--r-- | ui/tray_icon.h | 2 |
33 files changed, 906 insertions, 712 deletions
diff --git a/ui/batch_config.cpp b/ui/batch_config.cpp index 5aca5d67..9b32ee35 100644 --- a/ui/batch_config.cpp +++ b/ui/batch_config.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "batch_config.h" @@ -159,11 +159,11 @@ public: //prepare drag & drop dirNameLeft(batchDialog.m_panelLeft, - batchDialog.m_dirPickerLeft, - batchDialog.m_directoryLeft), + batchDialog.m_dirPickerLeft, + batchDialog.m_directoryLeft), dirNameRight(batchDialog.m_panelRight, - batchDialog.m_dirPickerRight, - batchDialog.m_directoryRight) {} + batchDialog.m_dirPickerRight, + batchDialog.m_directoryRight) {} void setValues(const Zstring& leftDir, const Zstring& rightDir, AltSyncCfgPtr syncCfg, const FilterConfig& filter) { @@ -213,10 +213,10 @@ void BatchDialog::init() new MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... this, m_panelOverview, - m_panelLogging, - m_staticText56, - m_staticText44, - m_bitmap27); //ownership passed to "this" + m_panelLogging, + m_staticText56, + m_staticText44, + m_bitmap27); //ownership passed to "this" #endif wxWindowUpdateLocker dummy(this); //avoid display distortion diff --git a/ui/batch_config.h b/ui/batch_config.h index 62645c78..cc4e014f 100644 --- a/ui/batch_config.h +++ b/ui/batch_config.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef BATCHCONFIG_H_INCLUDED diff --git a/ui/batch_status_handler.cpp b/ui/batch_status_handler.cpp index 1bcc4b33..ba70de39 100644 --- a/ui/batch_status_handler.cpp +++ b/ui/batch_status_handler.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "batch_status_handler.h" diff --git a/ui/batch_status_handler.h b/ui/batch_status_handler.h index ca32aa81..2d3b4cda 100644 --- a/ui/batch_status_handler.h +++ b/ui/batch_status_handler.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef BATCHSTATUSHANDLER_H_INCLUDED diff --git a/ui/check_version.cpp b/ui/check_version.cpp index cd1d4c48..4fb74c49 100644 --- a/ui/check_version.cpp +++ b/ui/check_version.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "check_version.h" diff --git a/ui/check_version.h b/ui/check_version.h index 023e5023..f7fb409d 100644 --- a/ui/check_version.h +++ b/ui/check_version.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef UPDATEVERSION_H_INCLUDED diff --git a/ui/folder_pair.h b/ui/folder_pair.h index 5dc016ef..6c633fce 100644 --- a/ui/folder_pair.h +++ b/ui/folder_pair.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef FOLDERPAIR_H_INCLUDED diff --git a/ui/grid_view.cpp b/ui/grid_view.cpp index 24e558fc..8ff8762d 100644 --- a/ui/grid_view.cpp +++ b/ui/grid_view.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "grid_view.h" @@ -120,6 +120,7 @@ GridView::StatusCmpResult GridView::updateCmpResult(bool hideFiltered, //maps so if (!equalFilesActive) continue; break; case FILE_CONFLICT: + case FILE_DIFFERENT_METADATA: //no extra button on screen output.existsConflict = true; if (!conflictFilesActive) continue; break; @@ -177,7 +178,6 @@ GridView::StatusSyncPreview GridView::updateSyncPreview(bool hideFiltered, //map if (hideFiltered && !fsObj->isActive()) continue; - switch (fsObj->getSyncOperation()) //evaluate comparison result and sync direction { case SO_CREATE_NEW_LEFT: @@ -197,10 +197,12 @@ GridView::StatusSyncPreview GridView::updateSyncPreview(bool hideFiltered, //map if (!syncDeleteRightActive) continue; break; case SO_OVERWRITE_RIGHT: + case SO_COPY_METADATA_TO_RIGHT: //no extra button on screen output.existsSyncDirRight = true; if (!syncDirOverwRightActive) continue; break; case SO_OVERWRITE_LEFT: + case SO_COPY_METADATA_TO_LEFT: //no extra button on screen output.existsSyncDirLeft = true; if (!syncDirOverwLeftActive) continue; break; diff --git a/ui/grid_view.h b/ui/grid_view.h index 0307d758..acc63ea5 100644 --- a/ui/grid_view.h +++ b/ui/grid_view.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef GRIDVIEW_H_INCLUDED diff --git a/ui/gui_generated.cpp b/ui/gui_generated.cpp index b830b0be..27e6ddd2 100644 --- a/ui/gui_generated.cpp +++ b/ui/gui_generated.cpp @@ -90,20 +90,20 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const this->SetMenuBar( m_menubar1 ); - bSizer1 = new wxBoxSizer( wxVERTICAL ); + bSizerPanelHolder = new wxBoxSizer( wxVERTICAL ); - m_panel71 = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL ); - bSizer6 = new wxBoxSizer( wxHORIZONTAL ); + m_panelTopButtons = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxRAISED_BORDER|wxTAB_TRAVERSAL ); + bSizerTopButtons = new wxBoxSizer( wxHORIZONTAL ); - bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerTopButtons->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 = new wxStaticText( m_panelTopButtons, 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 ) ); @@ -116,33 +116,33 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const wxBoxSizer* bSizer30; bSizer30 = new wxBoxSizer( wxHORIZONTAL ); - m_buttonCompare = new wxButtonWithImage( m_panel71, wxID_OK, _("Compare"), wxDefaultPosition, wxSize( 180,42 ), 0 ); + m_buttonCompare = new wxButtonWithImage( m_panelTopButtons, 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 = new wxButton( m_panelTopButtons, 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 ); + bSizer30->Add( m_buttonAbort, 0, wxALIGN_CENTER_VERTICAL, 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 = new wxBitmapButton( m_panelTopButtons, 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 ); + bSizerTopButtons->Add( fgSizer121, 0, wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( 0, 0, 1, 0, 5 ); + bSizerTopButtons->Add( 0, 0, 1, 0, 5 ); wxFlexGridSizer* fgSizer12; fgSizer12 = new wxFlexGridSizer( 2, 2, 0, 0 ); @@ -152,45 +152,46 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const fgSizer12->Add( 0, 0, 1, wxEXPAND, 5 ); - m_staticTextSyncVariant = new wxStaticText( m_panel71, wxID_ANY, _("dummy"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextSyncVariant = new wxStaticText( m_panelTopButtons, 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 = new wxBitmapButton( m_panelTopButtons, 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 = new wxButtonWithImage( m_panelTopButtons, 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 ); + bSizerTopButtons->Add( fgSizer12, 0, wxBOTTOM|wxALIGN_CENTER_VERTICAL, 5 ); - bSizer6->Add( 15, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerTopButtons->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 ); + m_panelTopButtons->SetSizer( bSizerTopButtons ); + m_panelTopButtons->Layout(); + bSizerTopButtons->Fit( m_panelTopButtons ); + bSizerPanelHolder->Add( m_panelTopButtons, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_panelDirectoryPairs = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + wxBoxSizer* bSizer1601; + bSizer1601 = new wxBoxSizer( wxVERTICAL ); wxBoxSizer* bSizer91; bSizer91 = new wxBoxSizer( wxHORIZONTAL ); - m_panelTopLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelTopLeft = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelTopLeft->SetMinSize( wxSize( 1,1 ) ); - wxBoxSizer* bSizer92; - bSizer92 = new wxBoxSizer( wxVERTICAL ); - sbSizerDirLeft = 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 ); @@ -201,30 +202,24 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const sbSizerDirLeft->Add( m_dirPickerLeft, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer92->Add( sbSizerDirLeft, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); - - m_panelTopLeft->SetSizer( bSizer92 ); + m_panelTopLeft->SetSizer( sbSizerDirLeft ); m_panelTopLeft->Layout(); - bSizer92->Fit( m_panelTopLeft ); - bSizer91->Add( m_panelTopLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + sbSizerDirLeft->Fit( m_panelTopLeft ); + bSizer91->Add( m_panelTopLeft, 1, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); - m_panelTopMiddle = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelTopMiddle = new wxPanel( m_panelDirectoryPairs, 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 ); + bSizer93->Add( m_bpButtonSwapSides, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); wxBoxSizer* bSizer160; bSizer160 = new wxBoxSizer( wxHORIZONTAL ); @@ -251,15 +246,9 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const 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 = new wxPanel( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); m_panelTopRight->SetMinSize( wxSize( 1,1 ) ); - wxBoxSizer* bSizer94; - bSizer94 = new wxBoxSizer( wxVERTICAL ); - - wxBoxSizer* bSizer77; - bSizer77 = new wxBoxSizer( wxHORIZONTAL ); - sbSizerDirRight = 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 ); @@ -284,18 +273,14 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const sbSizerDirRight->Add( m_dirPickerRight, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer77->Add( sbSizerDirRight, 1, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT, 3 ); - - bSizer94->Add( bSizer77, 0, wxEXPAND|wxLEFT, 3 ); - - m_panelTopRight->SetSizer( bSizer94 ); + m_panelTopRight->SetSizer( sbSizerDirRight ); m_panelTopRight->Layout(); - bSizer94->Fit( m_panelTopRight ); + sbSizerDirRight->Fit( m_panelTopRight ); bSizer91->Add( m_panelTopRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); - bSizer1->Add( bSizer91, 0, wxEXPAND|wxALIGN_CENTER_HORIZONTAL, 5 ); + bSizer1601->Add( bSizer91, 0, wxEXPAND, 5 ); - m_scrolledWindowFolderPairs = new wxScrolledWindow( this, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); + m_scrolledWindowFolderPairs = new wxScrolledWindow( m_panelDirectoryPairs, wxID_ANY, wxDefaultPosition, wxSize( -1,-1 ), wxHSCROLL|wxVSCROLL ); m_scrolledWindowFolderPairs->SetScrollRate( 5, 5 ); m_scrolledWindowFolderPairs->SetMinSize( wxSize( -1,0 ) ); @@ -304,11 +289,19 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_scrolledWindowFolderPairs->SetSizer( bSizerAddFolderPairs ); m_scrolledWindowFolderPairs->Layout(); bSizerAddFolderPairs->Fit( m_scrolledWindowFolderPairs ); - bSizer1->Add( m_scrolledWindowFolderPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer1601->Add( m_scrolledWindowFolderPairs, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + m_panelDirectoryPairs->SetSizer( bSizer1601 ); + m_panelDirectoryPairs->Layout(); + bSizer1601->Fit( m_panelDirectoryPairs ); + bSizerPanelHolder->Add( m_panelDirectoryPairs, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + + m_panelGrids = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelGrids->SetBackgroundColour( wxSystemSettings::GetColour( wxSYS_COLOUR_APPWORKSPACE ) ); bSizerGridHolder = new wxBoxSizer( wxHORIZONTAL ); - m_panelLeft = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelLeft = new wxPanel( m_panelGrids, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer7; bSizer7 = new wxBoxSizer( wxVERTICAL ); @@ -338,14 +331,14 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_gridLeft->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); m_gridLeft->SetMinSize( wxSize( 1,1 ) ); - bSizer7->Add( m_gridLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + bSizer7->Add( m_gridLeft, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxRIGHT, 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 ); + m_panelMiddle = new wxPanel( m_panelGrids, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer18; bSizer18 = new wxBoxSizer( wxVERTICAL ); @@ -375,14 +368,14 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const // 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 ); + bSizer18->Add( m_gridMiddle, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); m_panelMiddle->SetSizer( bSizer18 ); m_panelMiddle->Layout(); bSizer18->Fit( m_panelMiddle ); - bSizerGridHolder->Add( m_panelMiddle, 0, wxRIGHT|wxLEFT|wxEXPAND, 5 ); + bSizerGridHolder->Add( m_panelMiddle, 0, wxEXPAND, 5 ); - m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + m_panelRight = new wxPanel( m_panelGrids, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer10; bSizer10 = new wxBoxSizer( wxVERTICAL ); @@ -412,55 +405,61 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_gridRight->SetDefaultCellAlignment( wxALIGN_LEFT, wxALIGN_CENTRE ); m_gridRight->SetMinSize( wxSize( 1,1 ) ); - bSizer10->Add( m_gridRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxALL, 5 ); + bSizer10->Add( m_gridRight, 1, wxALIGN_CENTER_VERTICAL|wxEXPAND|wxLEFT, 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_panelGrids->SetSizer( bSizerGridHolder ); + m_panelGrids->Layout(); + bSizerGridHolder->Fit( m_panelGrids ); + bSizerPanelHolder->Add( m_panelGrids, 1, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - m_panelBottom = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); - bSizer3 = new wxBoxSizer( wxHORIZONTAL ); + m_panelConfig = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizerConfig = 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 ); + bSizerConfig->Add( 10, 0, 0, 0, 5 ); - m_bpButtonSave = new wxBitmapButton( m_panel30, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + wxBoxSizer* bSizer151; + bSizer151 = new wxBoxSizer( wxHORIZONTAL ); + + m_bpButtonSave = new wxBitmapButton( m_panelConfig, 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 ); + bSizer151->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 = new wxBitmapButton( m_panelConfig, 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 ); + bSizer151->Add( m_bpButtonLoad, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + bSizerConfig->Add( bSizer151, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 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)") ); + m_listBoxHistory = new wxListBox( m_panelConfig, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, NULL, wxLB_NEEDED_SB|wxLB_SINGLE|wxLB_SORT ); + m_listBoxHistory->SetToolTip( _("Load configuration history (press DEL to delete items)") ); + m_listBoxHistory->SetMinSize( wxSize( -1,40 ) ); - bSizer139->Add( m_choiceHistory, 0, wxALIGN_CENTER_VERTICAL, 5 ); + bSizerConfig->Add( m_listBoxHistory, 1, wxEXPAND|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 ); + m_panelConfig->SetSizer( bSizerConfig ); + m_panelConfig->Layout(); + bSizerConfig->Fit( m_panelConfig ); + bSizerPanelHolder->Add( m_panelConfig, 0, 0, 5 ); + + m_panelFilter = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer140; bSizer140 = new wxBoxSizer( wxHORIZONTAL ); + + bSizer140->Add( 10, 0, 0, 0, 5 ); + 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 ); @@ -477,171 +476,139 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const 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 ); + bSizerPanelHolder->Add( m_panelFilter, 0, 0, 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 ); + m_panelStatistics = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizerStatistics = 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 ); + bSizerStatistics->Add( 0, 0, 1, wxEXPAND, 5 ); 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 = new wxStaticBitmap( m_panelStatistics, 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 = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); m_textCtrlCreate->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); m_textCtrlCreate->SetBackgroundColour( wxColour( 208, 208, 208 ) ); 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 = new wxStaticBitmap( m_panelStatistics, 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 = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); m_textCtrlDelete->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); m_textCtrlDelete->SetBackgroundColour( wxColour( 208, 208, 208 ) ); 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 ); + bSizerStatistics->Add( fgSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 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 = new wxStaticBitmap( m_panelStatistics, 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 = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); m_textCtrlUpdate->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); m_textCtrlUpdate->SetBackgroundColour( wxColour( 208, 208, 208 ) ); 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 = new wxStaticBitmap( m_panelStatistics, 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 = new wxTextCtrl( m_panelStatistics, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize( 80,-1 ), wxTE_READONLY ); m_textCtrlData->SetFont( wxFont( 8, 70, 90, 90, false, wxEmptyString ) ); m_textCtrlData->SetBackgroundColour( wxColour( 208, 208, 208 ) ); 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 ); + bSizerStatistics->Add( fgSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5 ); + + + bSizerStatistics->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_panelStatistics->SetSizer( bSizerStatistics ); + m_panelStatistics->Layout(); + bSizerStatistics->Fit( m_panelStatistics ); + bSizerPanelHolder->Add( m_panelStatistics, 0, wxALIGN_CENTER_VERTICAL, 5 ); + + m_panelViewFilter = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); + bSizerViewFilter = new wxBoxSizer( wxHORIZONTAL ); + + + bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_bpButtonSyncCreateLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncCreateLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonSyncDirOverwLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncDirOverwLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonSyncDeleteLeft = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncDeleteLeft, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonLeftOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonLeftOnly, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonLeftNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonLeftNewer, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonEqual = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonEqual, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizer121->Add( sbSizer161, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonDifferent = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonDifferent, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonSyncDirNone = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncDirNone, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonRightNewer = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonRightNewer, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonRightOnly = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonRightOnly, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); + + m_bpButtonSyncDeleteRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncDeleteRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_panelSyncPreview->SetSizer( bSizer121 ); - m_panelSyncPreview->Layout(); - bSizer121->Fit( m_panelSyncPreview ); - bSizerBottomRight->Add( m_panelSyncPreview, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonSyncDirOverwRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncDirOverwRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bpButton10 = new wxBitmapButton( m_panelBottom, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 50,50 ), wxBU_AUTODRAW ); - m_bpButton10->Hide(); - m_bpButton10->SetToolTip( _("Quit") ); + m_bpButtonSyncCreateRight = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonSyncCreateRight, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - m_bpButton10->Hide(); - m_bpButton10->SetToolTip( _("Quit") ); + m_bpButtonConflict = new ToggleButton( m_panelViewFilter, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 40,40 ), wxBU_AUTODRAW ); + bSizerViewFilter->Add( m_bpButtonConflict, 0, wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 ); - bSizerBottomRight->Add( m_bpButton10, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxTOP|wxLEFT, 5 ); - bSizer3->Add( bSizerBottomRight, 1, wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxRIGHT, 5 ); + bSizerViewFilter->Add( 0, 0, 1, wxEXPAND, 5 ); - m_panelBottom->SetSizer( bSizer3 ); - m_panelBottom->Layout(); - bSizer3->Fit( m_panelBottom ); - bSizer1->Add( m_panelBottom, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + m_panelViewFilter->SetSizer( bSizerViewFilter ); + m_panelViewFilter->Layout(); + bSizerViewFilter->Fit( m_panelViewFilter ); + bSizerPanelHolder->Add( m_panelViewFilter, 0, wxALIGN_CENTER_VERTICAL, 5 ); m_panelStatusBar = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxSTATIC_BORDER|wxTAB_TRAVERSAL ); wxBoxSizer* bSizer451; @@ -711,10 +678,11 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const m_panelStatusBar->SetSizer( bSizer451 ); m_panelStatusBar->Layout(); bSizer451->Fit( m_panelStatusBar ); - bSizer1->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); + bSizerPanelHolder->Add( m_panelStatusBar, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND, 5 ); - this->SetSizer( bSizer1 ); + this->SetSizer( bSizerPanelHolder ); this->Layout(); + bSizerPanelHolder->Fit( this ); // Connect Events this->Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler( MainDialogGenerated::OnClose ) ); @@ -753,8 +721,8 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const 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_listBoxHistory->Connect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); + m_listBoxHistory->Connect( wxEVT_COMMAND_LISTBOX_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 ); @@ -771,7 +739,6 @@ MainDialogGenerated::MainDialogGenerated( wxWindow* parent, wxWindowID id, const 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() @@ -813,8 +780,8 @@ MainDialogGenerated::~MainDialogGenerated() 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_listBoxHistory->Disconnect( wxEVT_CHAR, wxKeyEventHandler( MainDialogGenerated::OnCfgHistoryKeyEvent ), NULL, this ); + m_listBoxHistory->Disconnect( wxEVT_COMMAND_LISTBOX_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 ); @@ -831,7 +798,6 @@ MainDialogGenerated::~MainDialogGenerated() 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 ); } @@ -858,41 +824,28 @@ FolderPairGenerated::FolderPairGenerated( wxWindow* parent, wxWindowID id, const 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 ); + bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); - bSizer96->Add( 0, 0, 1, wxEXPAND, 5 ); + m_bpButtonLocalFilter = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer95->Add( m_bpButtonLocalFilter, 0, wxALIGN_CENTER_VERTICAL, 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 ); + bSizer95->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer96->Add( 5, 0, 0, wxALIGN_CENTER_VERTICAL, 5 ); + m_bpButtonAltSyncCfg = new wxBitmapButton( m_panel20, wxID_ANY, wxNullBitmap, wxDefaultPosition, wxSize( 20,20 ), wxBU_AUTODRAW ); + bSizer95->Add( m_bpButtonAltSyncCfg, 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 ); + bSizer95->Add( 0, 0, 1, wxEXPAND, 5 ); m_panel20->SetSizer( bSizer95 ); m_panel20->Layout(); bSizer95->Fit( m_panel20 ); - bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + bSizer74->Add( m_panel20, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxLEFT|wxEXPAND, 5 ); m_panelRight = new wxPanel( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxBoxSizer* bSizer135; @@ -1444,6 +1397,9 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, wxBoxSizer* bSizer40; bSizer40 = new wxBoxSizer( wxVERTICAL ); + + bSizer40->Add( 0, 0, 1, wxEXPAND, 5 ); + bSizer42 = new wxBoxSizer( wxHORIZONTAL ); wxBoxSizer* bSizer157; @@ -1564,7 +1520,7 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, bSizer42->Add( sSizerTimeElapsed, 0, wxALIGN_CENTER_VERTICAL, 5 ); - bSizer40->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 5 ); + bSizer40->Add( bSizer42, 0, wxALIGN_CENTER_HORIZONTAL|wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 ); wxBoxSizer* bSizer48; bSizer48 = new wxBoxSizer( wxHORIZONTAL ); @@ -1583,7 +1539,10 @@ CompareStatusGenerated::CompareStatusGenerated( wxWindow* parent, wxWindowID id, 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 ); + bSizer40->Add( m_gauge2, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 ); + + + bSizer40->Add( 0, 0, 1, wxEXPAND, 5 ); this->SetSizer( bSizer40 ); this->Layout(); diff --git a/ui/gui_generated.h b/ui/gui_generated.h index cbcce489..07531fb0 100644 --- a/ui/gui_generated.h +++ b/ui/gui_generated.h @@ -36,13 +36,14 @@ class wxButtonWithImage; #include <wx/statbox.h> #include <wx/scrolwin.h> #include <wx/grid.h> -#include <wx/choice.h> +#include <wx/listbox.h> #include <wx/checkbox.h> -#include <wx/notebook.h> #include <wx/statbmp.h> #include <wx/textctrl.h> #include <wx/statline.h> #include <wx/frame.h> +#include <wx/choice.h> +#include <wx/notebook.h> #include <wx/dialog.h> #include <wx/gauge.h> #include <wx/radiobut.h> @@ -77,9 +78,9 @@ class MainDialogGenerated : public wxFrame wxMenu* m_menuHelp; wxMenuItem* m_menuItemCheckVer; wxMenuItem* m_menuItemAbout; - wxBoxSizer* bSizer1; - wxPanel* m_panel71; - wxBoxSizer* bSizer6; + wxBoxSizer* bSizerPanelHolder; + wxPanel* m_panelTopButtons; + wxBoxSizer* bSizerTopButtons; wxStaticText* m_staticTextCmpVariant; @@ -92,10 +93,10 @@ class MainDialogGenerated : public wxFrame wxBitmapButton* m_bpButtonSyncConfig; wxButtonWithImage* m_buttonStartSync; + wxPanel* m_panelDirectoryPairs; wxStaticBoxSizer* sbSizerDirLeft; wxPanel* m_panelTopMiddle; - wxBoxSizer* bSizerMiddle; wxBitmapButton* m_bpButtonSwapSides; @@ -104,22 +105,36 @@ class MainDialogGenerated : public wxFrame wxBitmapButton* m_bpButtonAddPair; wxScrolledWindow* m_scrolledWindowFolderPairs; wxBoxSizer* bSizerAddFolderPairs; + wxPanel* m_panelGrids; 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; + wxPanel* m_panelConfig; + wxBoxSizer* bSizerConfig; + wxBitmapButton* m_bpButtonSave; wxBitmapButton* m_bpButtonLoad; - wxChoice* m_choiceHistory; + wxListBox* m_listBoxHistory; wxPanel* m_panelFilter; + wxBitmapButton* m_bpButtonFilter; wxCheckBox* m_checkBoxHideFilt; + wxPanel* m_panelStatistics; + wxBoxSizer* bSizerStatistics; + + wxStaticBitmap* m_bitmapCreate; + wxTextCtrl* m_textCtrlCreate; + wxStaticBitmap* m_bitmapDelete; + wxTextCtrl* m_textCtrlDelete; + wxStaticBitmap* m_bitmapUpdate; + wxTextCtrl* m_textCtrlUpdate; + wxStaticBitmap* m_bitmapData; + wxTextCtrl* m_textCtrlData; + wxPanel* m_panelViewFilter; + wxBoxSizer* bSizerViewFilter; ToggleButton* m_bpButtonSyncCreateLeft; ToggleButton* m_bpButtonSyncDirOverwLeft; @@ -136,18 +151,6 @@ class MainDialogGenerated : public wxFrame 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; @@ -211,7 +214,6 @@ class MainDialogGenerated : public wxFrame 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: @@ -227,7 +229,7 @@ class MainDialogGenerated : public wxFrame 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( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ); ~MainDialogGenerated(); @@ -241,7 +243,6 @@ class FolderPairGenerated : public wxPanel private: protected: - wxPanel* m_panel20; @@ -250,7 +251,7 @@ class FolderPairGenerated : public wxPanel wxPanel* m_panelLeft; wxTextCtrl* m_directoryLeft; wxDirPickerCtrl* m_dirPickerLeft; - wxPanel* m_panel21; + wxPanel* m_panel20; wxBitmapButton* m_bpButtonLocalFilter; wxBitmapButton* m_bpButtonAltSyncCfg; wxPanel* m_panelRight; @@ -382,6 +383,7 @@ class CompareStatusGenerated : public wxPanel private: protected: + wxBoxSizer* bSizer42; wxBoxSizer* bSizerFilesFound; wxStaticText* m_staticText321; @@ -406,10 +408,11 @@ class CompareStatusGenerated : public wxPanel 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( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( -1,-1 ), long style = wxRAISED_BORDER|wxTAB_TRAVERSAL ); ~CompareStatusGenerated(); }; diff --git a/ui/gui_status_handler.cpp b/ui/gui_status_handler.cpp index 218f5cdc..2be1e0db 100644 --- a/ui/gui_status_handler.cpp +++ b/ui/gui_status_handler.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "gui_status_handler.h" @@ -26,17 +26,14 @@ CompareStatusHandler::CompareStatusHandler(MainDialog* dlg) : //prevent user input during "compare", do not disable maindialog since abort-button would also be disabled mainDialog->disableAllElements(); + mainDialog->compareStatus->init(); //clear old values //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(); + mainDialog->auiMgr.GetPane(mainDialog->compareStatus->getAsWindow()).Show(); + mainDialog->auiMgr.Update(); //register abort button - mainDialog->m_buttonAbort->Connect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( CompareStatusHandler::OnAbortCompare ), NULL, this); - + 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); } @@ -48,21 +45,17 @@ CompareStatusHandler::~CompareStatusHandler() //reenable complete main dialog mainDialog->enableAllElements(); + mainDialog->compareStatus->finalize(); + + mainDialog->auiMgr.GetPane(mainDialog->compareStatus->getAsWindow()).Hide(); + mainDialog->auiMgr.Update(); 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 + //de-register keys 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); + mainDialog->m_buttonAbort->Disconnect(wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler(CompareStatusHandler::OnAbortCompare), NULL, this); } @@ -269,8 +262,8 @@ SyncStatusHandler::~SyncStatusHandler() inline void SyncStatusHandler::reportInfo(const Zstring& text) { - //if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING) - //errorLog.logInfo(zToWx(text)); -> don't spam with file copy info: visually identifying warning messages has priority! + //if (currentProcess == StatusHandler::PROCESS_SYNCHRONIZING) + //errorLog.logInfo(zToWx(text)); -> don't spam with file copy info: visually identifying warning messages has priority! syncStatusFrame.setStatusText_NoUpdate(text); } diff --git a/ui/gui_status_handler.h b/ui/gui_status_handler.h index c44e257b..f504270b 100644 --- a/ui/gui_status_handler.h +++ b/ui/gui_status_handler.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef GUISTATUSHANDLER_H_INCLUDED diff --git a/ui/is_null_filter.h b/ui/is_null_filter.h index aeb72533..7c8826d6 100644 --- a/ui/is_null_filter.h +++ b/ui/is_null_filter.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef ISNULLFILTER_H_INCLUDED diff --git a/ui/main_dlg.cpp b/ui/main_dlg.cpp index 5fa6aee7..c8106cf9 100644 --- a/ui/main_dlg.cpp +++ b/ui/main_dlg.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "main_dlg.h" @@ -54,11 +54,21 @@ #include <wx/app.h> #include <boost/bind.hpp> - using namespace ffs3; using ffs3::CustomLocale; +namespace +{ +struct wxClientDataString : public wxClientData //we need a wxClientData derived class to tell wxWidgets to take object ownership! +{ + wxClientDataString(const wxString& name) : name_(name) {} + + wxString name_; +}; +} + + class DirectoryNameMainImpl : public DirectoryNameMainDlg { public: @@ -318,8 +328,13 @@ struct DirNotFound { bool operator()(const FolderPairEnh& fp) const { - return !dirExists(ffs3::getFormattedDirectoryName(fp.leftDirectory)) || - !dirExists(ffs3::getFormattedDirectoryName(fp.rightDirectory)); + const Zstring dirFmtLeft = ffs3::getFormattedDirectoryName(fp.leftDirectory); + const Zstring dirFmtRight = ffs3::getFormattedDirectoryName(fp.rightDirectory); + + if (dirFmtLeft.empty() && dirFmtRight.empty()) + return false; + + return !dirExists(dirFmtLeft) || !dirExists(dirFmtRight); } }; @@ -334,10 +349,9 @@ MainDialog::MainDialog(const wxString& cfgFileName, xmlAccess::XmlGlobalSettings bool loadCfgSuccess = false; if (!cfgFileName.empty() || fileExists(wxToZ(lastConfigFileName()))) - { - //load XML try { + //load XML std::vector<wxString> filenames; filenames.push_back(currentConfigFile); @@ -352,16 +366,49 @@ MainDialog::MainDialog(const wxString& cfgFileName, xmlAccess::XmlGlobalSettings else wxMessageBox(error.msg(), _("Error"), wxOK | wxICON_ERROR); } - } + const bool startComparisonImmediately = loadCfgSuccess && !cfgFileName.empty(); init(guiCfg, settings, - !cfgFileName.empty() && loadCfgSuccess); + startComparisonImmediately); setLastUsedConfig(currentConfigFile, loadCfgSuccess ? guiCfg : xmlAccess::XmlGuiConfig()); //simulate changed config on parsing errors } +#ifdef FFS_WIN +class PanelMoveWindow : public MouseMoveWindow +{ +public: + PanelMoveWindow(MainDialog& mainDlg) : + MouseMoveWindow(mainDlg, + mainDlg.m_panelTopButtons, + //mainDlg.m_panelDirectoryPairs, + mainDlg.m_panelConfig, + mainDlg.m_panelFilter, + mainDlg.m_panelViewFilter, + mainDlg.m_panelStatistics, + mainDlg.m_panelStatusBar), + mainDlg_(mainDlg) {} + + virtual bool allowMove(const wxMouseEvent& event) + { + wxPanel* panel = dynamic_cast<wxPanel*>(event.GetEventObject()); + + const wxAuiPaneInfo& paneInfo = mainDlg_.auiMgr.GetPane(panel); + if ( paneInfo.IsOk() && + paneInfo.IsFloating()) + return false; //prevent main dialog move + + return true;; //allow dialog move + } + +private: + MainDialog& mainDlg_; +}; +#endif + + MainDialog::MainDialog(const xmlAccess::XmlGuiConfig& guiCfg, xmlAccess::XmlGlobalSettings& settings, bool startComparison) : @@ -378,6 +425,8 @@ 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 + + auiMgr.UnInit(); } @@ -390,23 +439,67 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, //--------- 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(); -//} -//------------------------------------------------------------------------------------------------------ + //------------------------------------------------------------------------------------------------------ + +//---------------- support for dockable gui style -------------------------------- + bSizerPanelHolder->Detach(m_panelTopButtons); + bSizerPanelHolder->Detach(m_panelDirectoryPairs); + bSizerPanelHolder->Detach(m_panelGrids); + bSizerPanelHolder->Detach(m_panelConfig); + bSizerPanelHolder->Detach(m_panelFilter); + bSizerPanelHolder->Detach(m_panelViewFilter); + bSizerPanelHolder->Detach(m_panelStatistics); + bSizerPanelHolder->Detach(m_panelStatusBar); + + auiMgr.SetManagedWindow(this); + auiMgr.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); + + //caption required for all panes that can be manipulated by the users => used by context menu + auiMgr.AddPane(m_panelTopButtons, + wxAuiPaneInfo().Name(wxT("Panel1")).Top().Caption(_("Main bar")).CaptionVisible(false).PaneBorder(false).Gripper().MinSize(-1, m_buttonCompare->GetSize().GetHeight() - 5)); + //note: min height is calculated incorrectly by wxAuiManager if panes with and without caption are in the same row => use smaller min-size + + compareStatus.reset(new CompareStatus(*this)); //integrate the compare status panel (in hidden state) + auiMgr.AddPane(compareStatus->getAsWindow(), + wxAuiPaneInfo().Name(wxT("Panel9")).Top().Row(1).CaptionVisible(false).PaneBorder(false).Hide()); //name "CmpStatus" used by context menu + + auiMgr.AddPane(m_panelDirectoryPairs, + wxAuiPaneInfo().Name(wxT("Panel2")).Top().Row(2).Caption(_("Folder pairs")).CaptionVisible(false).PaneBorder(false).Gripper()); + + auiMgr.AddPane(m_panelGrids, + wxAuiPaneInfo().Name(wxT("Panel3")).CenterPane().PaneBorder(false)); + + auiMgr.AddPane(m_panelConfig, + wxAuiPaneInfo().Name(wxT("Panel4")).Bottom().Row(1).Position(0).Caption(_("Configuration")).MinSize(m_listBoxHistory->GetSize().GetWidth(), m_panelConfig->GetSize().GetHeight())); + + auiMgr.AddPane(m_panelFilter, + wxAuiPaneInfo().Name(wxT("Panel5")).Bottom().Row(1).Position(1).Caption(_("Filter files")).MinSize(-1, m_panelFilter->GetSize().GetHeight())); + + auiMgr.AddPane(m_panelViewFilter, + wxAuiPaneInfo().Name(wxT("Panel6")).Bottom().Row(1).Position(2).Caption(_("Filter view")).MinSize(m_bpButtonSyncDirNone->GetSize().GetWidth(), m_panelViewFilter->GetSize().GetHeight())); + + auiMgr.AddPane(m_panelStatistics, + wxAuiPaneInfo().Name(wxT("Panel7")).Bottom().Row(1).Position(3).Caption(_("Statistics")).MinSize(m_panelStatistics->GetSize().GetWidth() / 2, m_panelStatistics->GetSize().GetHeight())); + + auiMgr.AddPane(m_panelStatusBar, + wxAuiPaneInfo().Name(wxT("Panel8")).Bottom().Row(0).CaptionVisible(false).PaneBorder(false).DockFixed()); + + auiMgr.Update(); + defaultPerspective = auiMgr.SavePerspective(); +//---------------------------------------------------------------------------------- +//register view layout context menu + m_panelTopButtons->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); + m_panelConfig ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); + m_panelFilter ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); + m_panelViewFilter->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); + m_panelStatistics->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); + m_panelStatusBar ->Connect(wxEVT_RIGHT_DOWN, wxMouseEventHandler(MainDialog::OnContextSetLayout), NULL, this); +//---------------------------------------------------------------------------------- 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; @@ -414,10 +507,7 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, updateFileIcons.reset(new IconUpdater(m_gridLeft, m_gridRight)); #ifdef FFS_WIN - new MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... - m_panel71, - m_panelBottom, - m_panelStatusBar); //ownership passed to "this" + new PanelMoveWindow(*this); //allow moving main dialog by clicking (nearly) anywhere... //ownership passed to "this" #endif syncPreview.reset(new SyncPreview(this)); @@ -426,7 +516,6 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, 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); @@ -440,7 +529,6 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, 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"))); @@ -454,7 +542,7 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, m_bitmapDelete->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("delete"))); m_bitmapData->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("data"))); - bSizer6->Layout(); //wxButtonWithImage size might have changed + m_panelTopButtons->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); @@ -491,21 +579,31 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, } //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_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); //register global hotkeys (without explicit menu entry) wxTheApp->Connect(wxEVT_KEY_DOWN, wxKeyEventHandler(MainDialog::OnGlobalKeyEvent), 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); + m_panelTopLeft->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeFolderPairs), NULL, this); + + //dynamically change sizer direction depending on size + m_panelConfig ->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeConfigPanel), NULL, this); + m_panelViewFilter->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeViewPanel), NULL, this); + m_panelStatistics->Connect(wxEVT_SIZE, wxEventHandler(MainDialog::OnResizeStatisticsPanel), NULL, this); + wxSizeEvent dummy3; + OnResizeConfigPanel (dummy3); //call once on window creation + OnResizeViewPanel (dummy3); // + OnResizeStatisticsPanel(dummy3); // //event handler for manual (un-)checking of rows and setting of sync direction m_gridMiddle->Connect(FFS_CHECK_ROWS_EVENT, FFSCheckRowsEventHandler(MainDialog::OnCheckRows), NULL, this); @@ -522,18 +620,6 @@ void MainDialog::init(const xmlAccess::XmlGuiConfig guiCfg, //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); @@ -620,8 +706,20 @@ void MainDialog::readGlobalSettings() m_gridLeft->enableFileIcons(globalSettings->gui.showFileIconsLeft); m_gridRight->enableFileIcons(globalSettings->gui.showFileIconsRight); - //set selected tab - m_notebookBottomLeft->ChangeSelection(globalSettings->gui.selectedTabBottomLeft); +//------------------------------------------------------------------------------------------------ + //wxAuiManager erroneously loads panel captions, we don't want that + typedef std::vector<std::pair<wxString, wxString> > CaptionNameMapping; + CaptionNameMapping captionNameMap; + const wxAuiPaneInfoArray& paneArray = auiMgr.GetAllPanes(); + for (size_t i = 0; i < paneArray.size(); ++i) + captionNameMap.push_back(std::make_pair(paneArray[i].caption, paneArray[i].name)); + + auiMgr.LoadPerspective(globalSettings->gui.guiPerspectiveLast); + + //restore original captions + for (CaptionNameMapping::const_iterator i = captionNameMap.begin(); i != captionNameMap.end(); ++i) + auiMgr.GetPane(i->second).Caption(i->first); + auiMgr.Update(); } @@ -639,7 +737,12 @@ void MainDialog::writeGlobalSettings() globalSettings->gui.columnAttribRight = m_gridRight->getColumnAttributes(); //write list of last used configuration files - globalSettings->gui.cfgFileHistory = cfgFileNames; + std::vector<wxString> cfgFileHistory; + for (int i = 0; i < static_cast<int>(m_listBoxHistory->GetCount()); ++i) + if (m_listBoxHistory->GetClientObject(i)) + cfgFileHistory.push_back(static_cast<wxClientDataString*>(m_listBoxHistory->GetClientObject(i))->name_); + + globalSettings->gui.cfgFileHistory = cfgFileHistory; //write list of last used folders globalSettings->gui.folderHistoryLeft.clear(); @@ -652,8 +755,7 @@ void MainDialog::writeGlobalSettings() for (unsigned i = 0; i < rightFolderHistory.GetCount(); ++i) globalSettings->gui.folderHistoryRight.push_back(rightFolderHistory[i]); - //get selected tab - globalSettings->gui.selectedTabBottomLeft = m_notebookBottomLeft->GetSelection(); + globalSettings->gui.guiPerspectiveLast = auiMgr.SavePerspective(); } @@ -885,7 +987,7 @@ void MainDialog::deleteSelectedFiles() int totalDeleteCount = 0; - wxWindow* oldFocus = wxWindow::FindFocus(); + wxWindow* oldFocus = wxWindow::FindFocus(); if (ffs3::showDeleteDialog(compRefLeft, compRefRight, @@ -924,7 +1026,7 @@ void MainDialog::deleteSelectedFiles() m_gridRight-> ClearSelection(); } - if (oldFocus) + if (oldFocus) oldFocus->SetFocus(); //restore focus before deletion } } @@ -967,6 +1069,21 @@ void exstractNames(const FileSystemObject& fsObj, wxString& name, wxString& dir) } +void MainDialog::openExternalApplication(const wxString& commandline) +{ + if (m_gridLeft->isLeadGrid() || m_gridRight->isLeadGrid()) + { + const CustomGrid* leadGrid = m_gridLeft->isLeadGrid() ? + static_cast<CustomGrid*>(m_gridLeft) : + static_cast<CustomGrid*>(m_gridRight); + std::set<size_t> selection = getSelectedRows(leadGrid); + + if (selection.size() == 1) + openExternalApplication(*selection.begin(), m_gridLeft->isLeadGrid(), commandline); + } +} + + void MainDialog::openExternalApplication(size_t rowNumber, bool leftSide, const wxString& commandline) { if (commandline.empty()) @@ -1052,76 +1169,54 @@ void MainDialog::clearStatusBar() 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_bpButtonCmpConfig ->Disable(); + m_panelFilter ->Disable(); + m_panelConfig ->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_buttonStartSync ->Disable(); + m_panelGrids ->Disable(); + m_panelDirectoryPairs->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_buttonAbort->SetFocus(); m_buttonCompare->Disable(); m_buttonCompare->Hide(); - m_buttonAbort->SetFocus(); + m_bpButtonCmpConfig ->Disable(); + m_bpButtonSyncConfig->Disable(); + m_buttonStartSync ->Disable(); + + m_panelTopButtons->Layout(); } void MainDialog::enableAllElements() { - m_bpButtonCmpConfig-> Enable(); - m_notebookBottomLeft->Enable(); - m_checkBoxHideFilt-> Enable(); + m_bpButtonCmpConfig ->Enable(); + m_panelFilter ->Enable(); + m_panelConfig ->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_buttonStartSync ->Enable(); + m_panelGrids ->Enable(); + m_panelDirectoryPairs->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(); + m_bpButtonCmpConfig ->Enable(); + m_bpButtonSyncConfig->Enable(); + m_buttonStartSync ->Enable(); + + m_panelTopButtons->Layout(); } @@ -1139,7 +1234,8 @@ void MainDialog::OnResize(wxSizeEvent& event) //test ALL parameters at once, since width/height are invalid if the window is minimized (eg x,y == -32000; height = 28, width = 160) //note: negative values for x and y are possible when using multiple monitors! - if (width > 0 && height > 0 && x >= -3360 && y >= -200) + if (width > 0 && height > 0 && x >= -3360 && y >= -200 && + wxDisplay::GetFromPoint(wxPoint(x, y)) != wxNOT_FOUND) //make sure upper left corner is in visible view { widthNotMaximized = width; //visible coordinates x < 0 and y < 0 are possible with dual monitors! heightNotMaximized = height; @@ -1153,16 +1249,57 @@ void MainDialog::OnResize(wxSizeEvent& event) } -void MainDialog::OnResizeFolderPairs(wxSizeEvent& event) +namespace { - //adapt left-shift display distortion caused by scrollbars for multiple folder pairs - if (additionalFolderPairs.size() > 0) +void updateSizerOrientation(wxBoxSizer& sizer, wxWindow& window) +{ + if (window.GetSize().GetWidth() > window.GetSize().GetHeight()) //check window NOT sizer width! { - const int width = m_panelTopLeft->GetSize().GetWidth(); - - for (std::vector<DirectoryPair*>::iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) - (*i)->m_panelLeft->SetMinSize(wxSize(width, -1)); + if (sizer.GetOrientation() != wxHORIZONTAL) + { + sizer.SetOrientation(wxHORIZONTAL); + window.Layout(); + } } + else + { + if (sizer.GetOrientation() != wxVERTICAL) + { + sizer.SetOrientation(wxVERTICAL); + window.Layout(); + } + } +} +} + + +void MainDialog::OnResizeConfigPanel(wxEvent& event) +{ + updateSizerOrientation(*bSizerConfig, *m_panelConfig); + event.Skip(); +} + + +void MainDialog::OnResizeViewPanel(wxEvent& event) +{ + updateSizerOrientation(*bSizerViewFilter, *m_panelViewFilter); + event.Skip(); +} + + +void MainDialog::OnResizeStatisticsPanel(wxEvent& event) +{ + updateSizerOrientation(*bSizerStatistics, *m_panelStatistics); + event.Skip(); +} + + +void MainDialog::OnResizeFolderPairs(wxEvent& event) +{ + //adapt left-shift display distortion caused by scrollbars for multiple folder pairs + const int width = m_panelTopLeft->GetSize().GetWidth(); + for (std::vector<DirectoryPair*>::iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + (*i)->m_panelLeft->SetMinSize(wxSize(width, -1)); event.Skip(); } @@ -1233,8 +1370,8 @@ void MainDialog::onGridLeftButtonEvent(wxKeyEvent& event) case WXK_RETURN: case WXK_NUMPAD_ENTER: { - wxCommandEvent dummy(wxEVT_NULL, externalAppIDFirst); //open with first external application - OnContextOpenWith(dummy); + if (!globalSettings->gui.externelApplications.empty()) + openExternalApplication(globalSettings->gui.externelApplications[0].second); //open with first external application } return; } @@ -1325,8 +1462,8 @@ void MainDialog::onGridRightButtonEvent(wxKeyEvent& event) case WXK_RETURN: case WXK_NUMPAD_ENTER: { - wxCommandEvent dummy(wxEVT_NULL, externalAppIDFirst); //open with first external application - OnContextOpenWith(dummy); + if (!globalSettings->gui.externelApplications.empty()) + openExternalApplication(globalSettings->gui.externelApplications[0].second); //open with first external application } return; } @@ -1362,7 +1499,13 @@ void MainDialog::OnGlobalKeyEvent(wxKeyEvent& event) //process key events withou //------------------------------------------------------------ -//temporal variables used by exclude via context menu +//temporal variables used by exclude via context menu, transport string object to context menu handler +struct CtxtSelectionString : public wxObject +{ + CtxtSelectionString(const wxString& name) : objName(name) {} + const wxString objName; +}; + struct SelectedExtension : public wxObject { SelectedExtension(const Zstring& ext) : extension(ext) {} @@ -1378,7 +1521,6 @@ struct FilterObject Zstring relativeName; bool isDir; }; - typedef std::vector<FilterObject> FilterObjList; struct FilterObjContainer : public wxObject @@ -1423,6 +1565,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) const FileSystemObject* fsObj = gridDataView->getObject(selectionBegin); + int contextItemID = 2000; //####################################################### //re-create context menu @@ -1434,25 +1577,28 @@ void MainDialog::OnContextRim(wxGridEvent& event) if (selectionLeft.size() + selectionRight.size() > 0) { //CONTEXT_SYNC_DIR_LEFT - wxMenuItem* menuItemSyncDirLeft = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_LEFT, wxString(_("Set direction:")) + + wxMenuItem* menuItemSyncDirLeft = new wxMenuItem(contextMenu.get(), ++contextItemID, 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); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirLeft), NULL, this); //CONTEXT_SYNC_DIR_NONE - wxMenuItem* menuItemSyncDirNone = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_NONE, wxString(_("Set direction:")) + + wxMenuItem* menuItemSyncDirNone = new wxMenuItem(contextMenu.get(), ++contextItemID, 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); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirNone), NULL, this); //CONTEXT_SYNC_DIR_RIGHT - wxMenuItem* menuItemSyncDirRight = new wxMenuItem(contextMenu.get(), CONTEXT_SYNC_DIR_RIGHT, wxString(_("Set direction:")) + + wxMenuItem* menuItemSyncDirRight = new wxMenuItem(contextMenu.get(), ++contextItemID, 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->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncDirRight), NULL, this); contextMenu->AppendSeparator(); } @@ -1464,22 +1610,24 @@ void MainDialog::OnContextRim(wxGridEvent& event) { if (fsObj->isActive()) { - wxMenuItem* menuItemExclTemp = new wxMenuItem(contextMenu.get(), CONTEXT_FILTER_TEMP, wxString(_("Exclude temporarily")) + wxT("\tSPACE")); + wxMenuItem* menuItemExclTemp = new wxMenuItem(contextMenu.get(), ++contextItemID, 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")); + wxMenuItem* menuItemInclTemp = new wxMenuItem(contextMenu.get(), ++contextItemID, 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); + contextMenu->Append(contextItemID, wxString(_("Exclude temporarily")) + wxT("\tSPACE")); //this element should always be visible + contextMenu->Enable(contextItemID, false); } + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextFilterTemp), NULL, this); + //############################################################################################### //get list of relative file/dir-names for filtering @@ -1530,12 +1678,12 @@ void MainDialog::OnContextRim(wxGridEvent& event) const Zstring extension = filename.AfterLast(Zchar('.')); //add context menu item - wxMenuItem* menuItemExclExt = new wxMenuItem(contextMenu.get(), CONTEXT_EXCLUDE_EXT, wxString(_("Exclude via filter:")) + wxT(" ") + wxT("*.") + zToWx(extension)); + wxMenuItem* menuItemExclExt = new wxMenuItem(contextMenu.get(), ++contextItemID, 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, + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextExcludeExtension), new SelectedExtension(extension), //ownership passed! @@ -1545,11 +1693,12 @@ void MainDialog::OnContextRim(wxGridEvent& event) //CONTEXT_EXCLUDE_OBJ + ++contextItemID; 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))); + menuItemExclObj = new wxMenuItem(contextMenu.get(), contextItemID, 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(" ") + _("<multiple selection>")); + menuItemExclObj = new wxMenuItem(contextMenu.get(), contextItemID, wxString(_("Exclude via filter:")) + wxT(" ") + _("<multiple selection>")); if (menuItemExclObj != NULL) { @@ -1557,7 +1706,7 @@ void MainDialog::OnContextRim(wxGridEvent& event) contextMenu->Append(menuItemExclObj); //connect event - contextMenu->Connect(CONTEXT_EXCLUDE_OBJ, + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextExcludeObject), new FilterObjContainer(exFilterCandidateObj), //ownership passed! @@ -1565,7 +1714,6 @@ void MainDialog::OnContextRim(wxGridEvent& event) } - //CONTEXT_EXTERNAL_APP if (!globalSettings->gui.externelApplications.empty()) { @@ -1574,57 +1722,51 @@ void MainDialog::OnContextRim(wxGridEvent& event) 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) + ++i) { //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 + ++contextItemID; if (i == globalSettings->gui.externelApplications.begin()) - contextMenu->Append(newID, description + wxT("\t") + wxString(_("D-Click")) + wxT("; ENTER")); + contextMenu->Append(contextItemID, description + wxT("\t") + wxString(_("D-Click")) + wxT("; ENTER")); else - contextMenu->Append(newID, description); + contextMenu->Append(contextItemID, description); + contextMenu->Enable(contextItemID, externalAppEnabled); - contextMenu->Enable(newID, externalAppEnabled); - - //register event - contextMenu->Connect(newID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextOpenWith), NULL, this); + contextMenu->Connect(contextItemID, + wxEVT_COMMAND_MENU_SELECTED, + wxCommandEventHandler(MainDialog::OnContextOpenWith), + new CtxtSelectionString(i->second), //ownership passed! + this); } } - contextMenu->AppendSeparator(); //CONTEXT_CLIPBOARD - contextMenu->Append(CONTEXT_CLIPBOARD, _("Copy to clipboard\tCTRL+C")); + contextMenu->Append(++contextItemID, _("Copy to clipboard\tCTRL+C")); if ( (m_gridLeft->isLeadGrid() && selectionLeft.size()) || (m_gridRight->isLeadGrid() && selectionRight.size())) - contextMenu->Enable(CONTEXT_CLIPBOARD, true); + contextMenu->Enable(contextItemID, true); else - contextMenu->Enable(CONTEXT_CLIPBOARD, false); + contextMenu->Enable(contextItemID, false); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCopyClipboard), NULL, this); //CONTEXT_DELETE_FILES - contextMenu->Append(CONTEXT_DELETE_FILES, _("Delete files\tDEL")); + contextMenu->Append(++contextItemID, _("Delete files\tDEL")); if (selectionLeft.size() + selectionRight.size() == 0) - contextMenu->Enable(CONTEXT_DELETE_FILES, false); - + contextMenu->Enable(contextItemID, 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); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextDeleteFiles), NULL, this); //show context menu PopupMenu(contextMenu.get()); @@ -1723,22 +1865,13 @@ void MainDialog::OnContextCopyClipboard(wxCommandEvent& event) void MainDialog::OnContextOpenWith(wxCommandEvent& event) { - if (m_gridLeft->isLeadGrid() || m_gridRight->isLeadGrid()) - { - const CustomGrid* leadGrid = m_gridLeft->isLeadGrid() ? - static_cast<CustomGrid*>(m_gridLeft) : - static_cast<CustomGrid*>(m_gridRight); - std::set<size_t> selection = getSelectedRows(leadGrid); - - const int index = event.GetId() - externalAppIDFirst; - - if ( selection.size() == 1 && - 0 <= index && static_cast<size_t>(index) < globalSettings->gui.externelApplications.size()) - openExternalApplication(*selection.begin(), m_gridLeft->isLeadGrid(), globalSettings->gui.externelApplications[index].second); - } + CtxtSelectionString* stringObj = dynamic_cast<CtxtSelectionString*>(event.m_callbackUserData); + if (stringObj) + openExternalApplication(stringObj->objName); } + void MainDialog::OnContextDeleteFiles(wxCommandEvent& event) { deleteSelectedFiles(); @@ -1771,17 +1904,18 @@ void MainDialog::OnContextSyncDirRight(wxCommandEvent& event) void MainDialog::OnContextRimLabelLeft(wxGridEvent& event) { + int ctxtElementId = 1000; + contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_LEFT, _("Customize...")); + contextMenu->Append(++ctxtElementId, _("Customize...")); + contextMenu->Connect(ctxtElementId, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCustColumnLeft), NULL, this); contextMenu->AppendSeparator(); - wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_LEFT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); + wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), ++ctxtElementId, _("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); + contextMenu->Connect(ctxtElementId, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextAutoAdjustLeft), NULL, this); PopupMenu(contextMenu.get()); //show context menu } @@ -1789,17 +1923,19 @@ void MainDialog::OnContextRimLabelLeft(wxGridEvent& event) void MainDialog::OnContextRimLabelRight(wxGridEvent& event) { + int ctxtElementId = 1000; + contextMenu.reset(new wxMenu); //re-create context menu - contextMenu->Append(CONTEXT_CUSTOMIZE_COLUMN_RIGHT, _("Customize...")); + + contextMenu->Append(++ctxtElementId, _("Customize...")); + contextMenu->Connect(ctxtElementId, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextCustColumnRight), NULL, this); contextMenu->AppendSeparator(); - wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), CONTEXT_AUTO_ADJUST_COLUMN_RIGHT, _("Auto-adjust columns"), wxEmptyString, wxITEM_CHECK); + wxMenuItem* itemAutoAdjust = new wxMenuItem(contextMenu.get(), ++ctxtElementId, _("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); + contextMenu->Connect(ctxtElementId, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextAutoAdjustRight), NULL, this); PopupMenu(contextMenu.get()); //show context menu } @@ -1851,19 +1987,20 @@ void MainDialog::OnContextAutoAdjustRight(wxCommandEvent& event) void MainDialog::OnContextMiddle(wxGridEvent& event) { - contextMenu.reset(new wxMenu); //re-create context menu + int contextItemID = 2000; - contextMenu->Append(CONTEXT_CHECK_ALL, _("Include all rows")); - contextMenu->Append(CONTEXT_UNCHECK_ALL, _("Exclude all rows")); + contextMenu.reset(new wxMenu); //re-create context menu + contextMenu->Append(++contextItemID, _("Include all rows")); if (gridDataView->rowsTotal() == 0) - { - contextMenu->Enable(CONTEXT_CHECK_ALL, false); - contextMenu->Enable(CONTEXT_UNCHECK_ALL, false); - } + contextMenu->Enable(contextItemID, false); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextIncludeAll), NULL, this); + - 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); + contextMenu->Append(++contextItemID, _("Exclude all rows")); + if (gridDataView->rowsTotal() == 0) + contextMenu->Enable(contextItemID, false); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextExcludeAll), NULL, this); PopupMenu(contextMenu.get()); //show context menu } @@ -1871,10 +2008,15 @@ void MainDialog::OnContextMiddle(wxGridEvent& event) void MainDialog::OnContextMiddleLabel(wxGridEvent& event) { + int contextItemID = 2000; + 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")); + wxMenuItem* itemSyncPreview = new wxMenuItem(contextMenu.get(), ++contextItemID, _("Synchronization Preview")); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSyncView), NULL, this); + + wxMenuItem* itemCmpResult = new wxMenuItem(contextMenu.get(), ++contextItemID, _("Comparison Result")); + contextMenu->Connect(contextItemID, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextComparisonView), NULL, this); if (syncPreview->previewIsEnabled()) itemSyncPreview->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("syncViewSmall"))); @@ -1884,13 +2026,66 @@ void MainDialog::OnContextMiddleLabel(wxGridEvent& event) 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::OnContextSetLayout(wxMouseEvent& event) +{ + int itemId = 1000; + + contextMenu.reset(new wxMenu); //re-create context menu + + contextMenu->Append(++itemId, _("Reset view")); + contextMenu->Connect(itemId, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MainDialog::OnContextSetLayoutReset), NULL, this); + + typedef std::vector<std::pair<wxString, wxString> > CaptionNameMapping; + CaptionNameMapping captionNameMap; + + const wxAuiPaneInfoArray& paneArray = auiMgr.GetAllPanes(); + for (size_t i = 0; i < paneArray.size(); ++i) + if (!paneArray[i].IsShown() && !paneArray[i].name.empty() && paneArray[i].window != compareStatus->getAsWindow()) + captionNameMap.push_back(std::make_pair(paneArray[i].caption, paneArray[i].name)); + + if (!captionNameMap.empty()) + { + contextMenu->AppendSeparator(); + + for (CaptionNameMapping::const_iterator i = captionNameMap.begin(); i != captionNameMap.end(); ++i) + { + wxString entry = _("Show \"%x\""); + entry.Replace(wxT("%x"), i->first); + + contextMenu->Append(++itemId, entry); + contextMenu->Connect(itemId, + wxEVT_COMMAND_MENU_SELECTED, + wxCommandEventHandler(MainDialog::OnContextSetLayoutShowPanel), + new CtxtSelectionString(i->second), //ownership passed! + this); + } + } PopupMenu(contextMenu.get()); //show context menu } +void MainDialog::OnContextSetLayoutReset(wxCommandEvent& event) +{ + auiMgr.LoadPerspective(defaultPerspective); +} + + +void MainDialog::OnContextSetLayoutShowPanel(wxCommandEvent& event) +{ + CtxtSelectionString* stringObj = dynamic_cast<CtxtSelectionString*>(event.m_callbackUserData); + if (stringObj) + { + auiMgr.GetPane(stringObj->objName).Show(); + auiMgr.Update(); + } +} + + void MainDialog::OnContextIncludeAll(wxCommandEvent& event) { ffs3::setActiveStatus(true, gridDataView->getDataTentative()); @@ -1941,54 +2136,47 @@ wxString getFormattedHistoryElement(const wxString& filename) } -//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<wxString>::const_iterator i = find_if(cfgFileNames.begin(), cfgFileNames.end(), FindDuplicates(wxToZ(filename))); - if (i != cfgFileNames.end()) + int posFound = -1; + + for (int i = 0; i < static_cast<int>(m_listBoxHistory->GetCount()); ++i) + if (m_listBoxHistory->GetClientObject(i)) + { + const wxString& filenameTmp = static_cast<wxClientDataString*>(m_listBoxHistory->GetClientObject(i))->name_; + + //tests if the same filenames are specified, even if they are relative to the current working directory/include symlinks or \\?\ prefix + if (util::sameFileSpecified(wxToZ(filename), wxToZ(filenameTmp))) + { + posFound = i; + break; + } + } + + if (posFound != -1) { //if entry is in the list, then jump to element - m_choiceHistory->SetSelection(i - cfgFileNames.begin()); + m_listBoxHistory->SetSelection(posFound); } else { - cfgFileNames.insert(cfgFileNames.begin(), filename); - + int newPos = -1; //the default config file should receive another name on GUI if (util::sameFileSpecified(wxToZ(lastConfigFileName()), wxToZ(filename))) - m_choiceHistory->Insert(_("<Last session>"), 0); //insert at beginning of list + newPos = m_listBoxHistory->Append(_("<Last session>"), new wxClientDataString(filename)); //insert at beginning of list else - m_choiceHistory->Insert(getFormattedHistoryElement(filename), 0); //insert at beginning of list + newPos = m_listBoxHistory->Append(getFormattedHistoryElement(filename), new wxClientDataString(filename)); //insert at beginning of list - m_choiceHistory->SetSelection(0); + m_listBoxHistory->SetSelection(newPos); } //keep maximal size of history list - if (cfgFileNames.size() > globalSettings->gui.cfgHistoryMax) - { - //delete last rows - cfgFileNames.pop_back(); - m_choiceHistory->Delete(globalSettings->gui.cfgHistoryMax); - } + //if (m_comboHistory->GetCount() > globalSettings->gui.cfgHistoryMax) + // m_comboHistory->Delete(globalSettings->gui.cfgHistoryMax); } @@ -2071,9 +2259,13 @@ void MainDialog::OnNewConfig(wxCommandEvent& event) void MainDialog::OnLoadFromHistory(wxCommandEvent& event) { - const int selectedItem = m_choiceHistory->GetSelection(); - if (0 <= selectedItem && unsigned(selectedItem) < cfgFileNames.size()) - loadConfiguration(cfgFileNames[selectedItem]); + const int selectedItem = m_listBoxHistory->GetSelection(); + if ( selectedItem != wxNOT_FOUND && + m_listBoxHistory->GetClientObject(selectedItem)) + { + const wxString filename = static_cast<wxClientDataString*>(m_listBoxHistory->GetClientObject(selectedItem))->name_; + loadConfiguration(filename); + } } @@ -2128,26 +2320,50 @@ void MainDialog::OnCfgHistoryKeyEvent(wxKeyEvent& event) 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())) + //const int selectedItem = m_listBoxHistory->GetCurrentSelection(); + const int selectedItem = m_listBoxHistory->GetSelection(); + if (selectedItem != wxNOT_FOUND) { - //delete selected row - cfgFileNames.erase(cfgFileNames.begin() + selectedItem); - m_choiceHistory->Delete(selectedItem); + m_listBoxHistory->Delete(selectedItem); + + //set selection on next element + if (m_listBoxHistory->GetCount() > 0) + { + int newSelection = selectedItem; + if (newSelection >= static_cast<int>(m_listBoxHistory->GetCount())) + newSelection = m_listBoxHistory->GetCount() - 1; + m_listBoxHistory->SetSelection(newSelection); + } } + + return; //"swallow" event } + event.Skip(); } -void MainDialog::OnClose(wxCloseEvent &event) +void MainDialog::OnClose(wxCloseEvent& event) { - if (!saveOldConfig()) //notify user about changed settings - return; + if (m_buttonAbort->IsShown()) //delegate to "abort" button if available + { + wxCommandEvent dummy(wxEVT_COMMAND_BUTTON_CLICKED); + m_buttonAbort->ProcessEvent(dummy); - Destroy(); + if (event.CanVeto()) event.Veto(); //that's what we want here + else Destroy(); //shouldn't be necessary + } + else + { + const bool cancelled = !saveOldConfig(); //notify user about changed settings + if (cancelled && event.CanVeto()) + { + event.Veto(); + return; + } + + Destroy(); + } } @@ -2261,16 +2477,14 @@ bool MainDialog::writeConfigurationToXml(const wxString& filename) try { xmlAccess::writeConfig(guiCfg, filename); + setLastUsedConfig(filename, guiCfg); + return true; } catch (const xmlAccess::XmlError& error) { wxMessageBox(error.msg().c_str(), _("Error"), wxOK | wxICON_ERROR); return false; } - - setLastUsedConfig(filename, guiCfg); - - return true; } @@ -2319,7 +2533,7 @@ void MainDialog::setCurrentConfiguration(const xmlAccess::XmlGuiConfig& newGuiCf //update sync variant name m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + currentCfg.mainCfg.getSyncVariantName() + wxT(")")); - bSizer6->Layout(); //adapt layout for variant text + m_panelTopButtons->Layout(); //adapt layout for variant text } @@ -2633,31 +2847,16 @@ void MainDialog::initViewFilterButtons() 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 @@ -2729,9 +2928,9 @@ void MainDialog::OnCompare(wxCommandEvent &event) m_buttonStartSync->SetFocus(); //hide sort direction indicator on GUI grids - m_gridLeft->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); + m_gridLeft ->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); m_gridMiddle->setSortMarker(CustomGrid::SortMarker(-1, CustomGrid::ASCENDING)); - m_gridRight->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; @@ -2749,10 +2948,8 @@ void MainDialog::OnCompare(wxCommandEvent &event) updateGuiGrid(); //prepare status information - wxString statusInfo; if (allElementsEqual(gridDataView->getDataTentative())) - statusInfo += _("All directories in sync!"); - pushStatusInformation(statusInfo); + pushStatusInformation(_("All directories in sync!")); } } @@ -2792,6 +2989,8 @@ void MainDialog::updateGuiGrid() //update sync preview statistics calculatePreview(); + auiMgr.Update(); //fix small display distortion, if view filter panel is empty + m_gridLeft ->Refresh(); m_gridMiddle->Refresh(); m_gridRight ->Refresh(); @@ -2852,7 +3051,7 @@ void MainDialog::OnCmpSettings(wxCommandEvent& event) { //update compare variant name m_staticTextCmpVariant->SetLabel(wxString(wxT("(")) + getVariantName(currentCfg.mainCfg.compareVar) + wxT(")")); - bSizer6->Layout(); //adapt layout for variant text + m_panelTopButtons->Layout(); //adapt layout for variant text //disable the sync button syncPreview->enableSynchronization(false); @@ -3278,13 +3477,9 @@ void MainDialog::updateGridViewData() m_panelViewFilter->Hide(); } - - bSizer3->Layout(); - - //update status information + //clear status information clearStatusBar(); - wxString statusLeftNew; wxString statusMiddleNew; wxString statusRightNew; @@ -3426,7 +3621,7 @@ void MainDialog::updateSyncConfig() { //update sync variant name m_staticTextSyncVariant->SetLabel(wxString(wxT("(")) + getCurrentConfiguration().mainCfg.getSyncVariantName() + wxT(")")); - bSizer6->Layout(); //adapt layout for variant text + m_panelTopButtons->Layout(); //adapt layout for variant text class RedetermineCallback : public DeterminationProblem @@ -3463,6 +3658,8 @@ void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) { if (additionalFolderPairs.size() > 0) { + wxWindowUpdateLocker dummy(this); //avoid display distortion + //get settings from second folder pair const FolderPairEnh cfgSecond = getEnahncedPair(additionalFolderPairs[0]); @@ -3487,6 +3684,8 @@ void MainDialog::OnRemoveTopFolderPair(wxCommandEvent& event) void MainDialog::OnRemoveFolderPair(wxCommandEvent& event) { + wxWindowUpdateLocker dummy(this); //avoid display distortion + const wxObject* const eventObj = event.GetEventObject(); //find folder pair originating the event for (std::vector<DirectoryPair*>::const_iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) if (eventObj == (*i)->m_bpButtonRemovePair) @@ -3512,7 +3711,6 @@ void MainDialog::updateGuiForFolderPair() m_bpButtonRemovePair->Hide(); else m_bpButtonRemovePair->Show(); - m_panelTopRight->Layout(); //adapt local filter and sync cfg for first folder pair @@ -3533,14 +3731,28 @@ void MainDialog::updateGuiForFolderPair() m_bpButtonSwapSides->SetBitmapLabel(GlobalResources::getInstance().getImageByName(wxT("swapSlim"))); } - m_panelTopMiddle->Layout(); + + + int addPairHeight = 0; + if (additionalFolderPairs.size() > 0) + addPairHeight = std::min<double>(1.5, additionalFolderPairs.size()) * //have 0.5 * height indicate that more folders are there + additionalFolderPairs[0]->GetSize().GetHeight(); + + //ensure additional folder pairs are at least partially visible + auiMgr.GetPane(m_panelDirectoryPairs).MinSize(-1, m_panelTopLeft->GetSize().GetHeight() + addPairHeight); + auiMgr.Update(); + + m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + + //m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + m_panelDirectoryPairs->Layout(); } void MainDialog::addFolderPair(const std::vector<FolderPairEnh>& newPairs, bool addFront) { - wxWindowUpdateLocker dummy(this); //avoid display distortion + wxWindowUpdateLocker dummy(m_panelDirectoryPairs); //avoid display distortion if (!newPairs.empty()) { @@ -3550,9 +3762,6 @@ void MainDialog::addFolderPair(const std::vector<FolderPairEnh>& newPairs, bool //add new folder pair DirectoryPair* newPair = new DirectoryPair(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)); @@ -3583,13 +3792,12 @@ void MainDialog::addFolderPair(const std::vector<FolderPairEnh>& newPairs, bool } //set size of scrolled window - const size_t visiblePairs = std::min(additionalFolderPairs.size(), globalSettings->gui.addFolderPairCountMax); //up to "addFolderPairCountMax" additional pairs shall be shown - m_scrolledWindowFolderPairs->SetMinSize(wxSize( -1, pairHeight * static_cast<int>(visiblePairs))); + //m_scrolledWindowFolderPairs->SetMinSize(wxSize( -1, pairHeight * static_cast<int>(visiblePairs))); //update controls - m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size - m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window - bSizer1->Layout(); +// m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + // m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + //bSizer1->Layout(); } updateGuiForFolderPair(); @@ -3598,27 +3806,27 @@ void MainDialog::addFolderPair(const std::vector<FolderPairEnh>& newPairs, bool void MainDialog::removeAddFolderPair(size_t pos) { - wxWindowUpdateLocker dummy(this); //avoid display distortion + wxWindowUpdateLocker dummy(m_panelDirectoryPairs); //avoid display distortion if (pos < additionalFolderPairs.size()) { //remove folder pairs from window DirectoryPair* pairToDelete = additionalFolderPairs[pos]; - const int pairHeight = pairToDelete->GetSize().GetHeight(); + //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 <= globalSettings->gui.addFolderPairCountMax) //up to "addFolderPairCountMax" additional pairs shall be shown - m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, pairHeight * static_cast<int>(additionalRows))); + //const size_t additionalRows = additionalFolderPairs.size(); + //if (additionalRows <= globalSettings->gui.addFolderPairCountMax) //up to "addFolderPairCountMax" additional pairs shall be shown + // m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, pairHeight * static_cast<int>(additionalRows))); //update controls - m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size - m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window - bSizer1->Layout(); + //m_scrolledWindowFolderPairs->Fit(); //adjust scrolled window size + //m_scrolledWindowFolderPairs->Layout(); //adjust stuff inside scrolled window + //bSizer1->Layout(); } updateGuiForFolderPair(); @@ -3627,13 +3835,14 @@ void MainDialog::removeAddFolderPair(size_t pos) void MainDialog::clearAddFolderPairs() { - wxWindowUpdateLocker dummy(this); //avoid display distortion + wxWindowUpdateLocker dummy(m_panelDirectoryPairs); //avoid display distortion additionalFolderPairs.clear(); bSizerAddFolderPairs->Clear(true); - m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, 0)); - bSizer1->Layout(); + updateGuiForFolderPair(); + //m_scrolledWindowFolderPairs->SetMinSize(wxSize(-1, 0)); + //bSizer1->Layout(); } //######################################################################################################## @@ -3793,10 +4002,12 @@ void MainDialog::OnLayoutWindowAsync(wxIdleEvent& event) wxWindowUpdateLocker dummy(this); //avoid display distortion //adjust folder pair distortion on startup - m_scrolledWindowFolderPairs->Fit(); + for (std::vector<DirectoryPair*>::iterator i = additionalFolderPairs.begin(); i != additionalFolderPairs.end(); ++i) + (*i)->Layout(); + m_panelTopButtons->Layout(); Layout(); //strangely this layout call works if called in next idle event only - Refresh(); + auiMgr.Update(); //fix view filter distortion } diff --git a/ui/main_dlg.h b/ui/main_dlg.h index 68310065..3559aff8 100644 --- a/ui/main_dlg.h +++ b/ui/main_dlg.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef MAINDIALOG_H @@ -13,6 +13,8 @@ #include <memory> #include <map> #include <set> +#include <wx/aui/aui.h> + class CustomGrid; class FFSCheckRowsEvent; @@ -21,6 +23,7 @@ class IconUpdater; class DirectoryPair; class DirectoryPairFirst; class CompareStatus; +class PanelMoveWindow; namespace ffs3 @@ -49,40 +52,7 @@ private: friend class DirectoryNameMainImpl; template <class GuiPanel> 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 - }; + friend class PanelMoveWindow; MainDialog(); @@ -134,8 +104,8 @@ private: void copySelectionToClipboard(const CustomGrid* selectedGrid); void deleteSelectedFiles(); + void openExternalApplication(const wxString& commandline); 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); @@ -156,26 +126,29 @@ private: void OnContextRimLabelRight( wxGridEvent& event); void OnContextMiddle( wxGridEvent& event); void OnContextMiddleLabel( wxGridEvent& event); + void OnContextSetLayout( wxMouseEvent& event); void OnGlobalKeyEvent( wxKeyEvent& 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 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 OnContextSetLayoutReset (wxCommandEvent& event); + void OnContextSetLayoutShowPanel(wxCommandEvent& event); void OnDirSelected(wxFileDirPickerEvent& event); @@ -219,7 +192,10 @@ private: void refreshGridAfterFilterChange(const int delay); void OnResize( wxSizeEvent& event); - void OnResizeFolderPairs( wxSizeEvent& event); + void OnResizeFolderPairs( wxEvent& event); + void OnResizeConfigPanel( wxEvent& event); + void OnResizeViewPanel( wxEvent& event); + void OnResizeStatisticsPanel(wxEvent& event); void OnHideFilteredButton( wxCommandEvent& event); void OnConfigureFilter( wxCommandEvent& event); void OnSwapSides( wxCommandEvent& event); @@ -296,10 +272,6 @@ private: bool cleanedUp; - //save the last used config filename history - std::vector<wxString> cfgFileNames; - - //remember last sort executed (for determination of sort order) int lastSortColumn; const wxGrid* lastSortGrid; @@ -325,6 +297,10 @@ private: bool synchronizationEnabled; //determines whether synchronization should be allowed }; std::auto_ptr<SyncPreview> syncPreview; //always bound + + wxAuiManager auiMgr; //implement dockable GUI design + + wxString defaultPerspective; }; #endif // MAINDIALOG_H diff --git a/ui/mouse_move_dlg.cpp b/ui/mouse_move_dlg.cpp index efaba5fc..abaa7ead 100644 --- a/ui/mouse_move_dlg.cpp +++ b/ui/mouse_move_dlg.cpp @@ -1,10 +1,11 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "mouse_move_dlg.h" +#include <vector> #include <wx/msw/wrapwin.h> //includes "windows.h" using namespace ffs3; @@ -18,26 +19,36 @@ MouseMoveWindow::MouseMoveWindow(wxWindow& parent, wxWindow* child5, wxWindow* child6) : wxWindow(&parent, wxID_ANY) { - if (child1) child1->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); - if (child2) child2->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); - if (child3) child3->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); - if (child4) child4->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); - if (child5) child5->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); - if (child6) child6->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); + std::vector<wxWindow*> windList; + + if (child1) windList.push_back(child1); + if (child2) windList.push_back(child2); + if (child3) windList.push_back(child3); + if (child4) windList.push_back(child4); + if (child5) windList.push_back(child5); + if (child6) windList.push_back(child6); + + for (std::vector<wxWindow*>::const_iterator i = windList.begin(); i != windList.end(); ++i) + (*i)->Connect(wxEVT_LEFT_DOWN, wxMouseEventHandler(MouseMoveWindow::LeftButtonDown), NULL, this); Hide(); //this is just a dummy window so that its parent can have ownership Disable(); } +MouseMoveWindow::~MouseMoveWindow() {} + + void MouseMoveWindow::LeftButtonDown(wxMouseEvent& event) { - if (!GetParent()) - return; - - ::ReleaseCapture(); - //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); - ::SendMessage(static_cast<HWND>(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); + if (GetParent() && allowMove(event)) + { + ::ReleaseCapture(); + //::SendMessage(GetHwndOf(dialogToMove_), WM_NCLBUTTONDOWN, HTCAPTION, 0); + ::SendMessage(static_cast<HWND>(GetParent()->GetHWND()), WM_NCLBUTTONDOWN, HTCAPTION, 0); - //event.Skip(); -> swallow event, to avoid other windows losing focus + return; + //event.Skip(); -> swallow event, to avoid other windows losing focus + } + event.Skip(); } diff --git a/ui/mouse_move_dlg.h b/ui/mouse_move_dlg.h index c7d07629..ccdf6c01 100644 --- a/ui/mouse_move_dlg.h +++ b/ui/mouse_move_dlg.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef MOUSEMOVEWINDOW_H_INCLUDED @@ -24,11 +24,16 @@ public: wxWindow* child5 = NULL, wxWindow* child6 = NULL); + virtual ~MouseMoveWindow(); + + virtual bool allowMove(const wxMouseEvent& event) + { + return true; + } + private: void LeftButtonDown(wxMouseEvent& event); }; - - } diff --git a/ui/msg_popup.cpp b/ui/msg_popup.cpp index adf5ac7f..0b6d3584 100644 --- a/ui/msg_popup.cpp +++ b/ui/msg_popup.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "msg_popup.h" @@ -15,7 +15,7 @@ ErrorDlg::ErrorDlg(wxWindow* parentWindow, const int activeButtons, const wxStri { #ifdef FFS_WIN new ffs3::MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... - this, m_bitmap10); //ownership passed to "this" + this, m_bitmap10); //ownership passed to "this" #endif m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("error"))); @@ -79,7 +79,7 @@ WarningDlg::WarningDlg(wxWindow* parentWindow, int activeButtons, const wxStrin { #ifdef FFS_WIN new ffs3::MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... - this, m_bitmap10); //ownership passed to "this" + this, m_bitmap10); //ownership passed to "this" #endif m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("warning"))); @@ -141,7 +141,7 @@ QuestionDlg::QuestionDlg(wxWindow* parentWindow, int activeButtons, const wxStri { #ifdef FFS_WIN new ffs3::MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... - this, m_bitmap10); //ownership passed to "this" + this, m_bitmap10); //ownership passed to "this" #endif m_bitmap10->SetBitmap(GlobalResources::getInstance().getImageByName(wxT("question"))); diff --git a/ui/msg_popup.h b/ui/msg_popup.h index fee3c6ed..44743c1b 100644 --- a/ui/msg_popup.h +++ b/ui/msg_popup.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef MESSAGEPOPUP_H_INCLUDED diff --git a/ui/progress_indicator.cpp b/ui/progress_indicator.cpp index e5cfa879..541e2694 100644 --- a/ui/progress_indicator.cpp +++ b/ui/progress_indicator.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "progress_indicator.h" @@ -27,6 +27,11 @@ using namespace ffs3; namespace { +//window size used for statistics in milliseconds +const int windowSizeRemainingTime = 60000; //some usecases have dropouts of 40 seconds -> 60 sec. window size handles them well +const int windowSizeBytesPerSec = 5000; // + + void setNewText(const wxString& newText, wxTextCtrl& control, bool& updateLayout) { if (control.GetValue().length() != newText.length()) @@ -208,7 +213,7 @@ void CompareStatus::CompareStatusImpl::init() updateStatusPanelNow(); - Show(); //make visible + Layout(); } @@ -218,7 +223,6 @@ void CompareStatus::CompareStatusImpl::finalize() //hide again taskbar_.reset(); #endif - Hide(); parentWindow_.SetTitle(titleTextBackup); } @@ -239,7 +243,7 @@ void CompareStatus::CompareStatusImpl::switchToCompareBytewise(int totalObjectsT 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)); + statistics.reset(new Statistics(totalObjectsToProcess, totalDataToProcess.ToDouble(), windowSizeRemainingTime, windowSizeBytesPerSec)); lastStatCallSpeed = -1000000; //some big number lastStatCallRemTime = -1000000; @@ -251,6 +255,7 @@ void CompareStatus::CompareStatusImpl::switchToCompareBytewise(int totalObjectsT m_gauge2->Show(); bSizer42->Layout(); + Layout(); } @@ -304,7 +309,7 @@ void CompareStatus::CompareStatusImpl::showProgressExternally(const wxString& pr void CompareStatus::CompareStatusImpl::updateStatusPanelNow() { //static RetrieveStatistics statistic; - //statistic.writeEntry(currentData, currentObjects); + //statistic.writeEntry(currentData.ToDouble(), currentObjects); { //wxWindowUpdateLocker dummy(this) -> not needed @@ -441,6 +446,10 @@ private: wxString titelTextBackup; + //save last used systray icon description + wxString progressTextLast; + float progressPercentLast; + boost::shared_ptr<MinimizeToTray> minimizedToSysTray; //optional: if filled, hides all visible windows, shows again if destroyed }; @@ -530,7 +539,8 @@ SyncStatus::SyncStatusImpl::SyncStatusImpl(StatusHandler& updater, wxTopLevelWin processPaused(false), currentStatus(SyncStatus::ABORTED), lastStatCallSpeed(-1000000), //some big number - lastStatCallRemTime(-1000000) + lastStatCallRemTime(-1000000), + progressPercentLast(0) { #ifdef FFS_WIN new ffs3::MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... @@ -618,7 +628,8 @@ void SyncStatus::SyncStatusImpl::resetGauge(int totalObjectsToProcess, wxLongLon 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)); + statistics.reset(new Statistics(totalObjectsToProcess, totalDataToProcess.ToDouble(), windowSizeRemainingTime, windowSizeBytesPerSec)); + lastStatCallSpeed = -1000000; //some big number lastStatCallRemTime = -1000000; } @@ -650,6 +661,11 @@ void SyncStatus::SyncStatusImpl::showProgressExternally(const wxString& progress minimizedToSysTray->setToolTip(progressText, percent); //minimizedToSysTray may be a zombie... so set title text anyway + //save progress text for later use (e.g. set systray icon tooltip in paused mode) + progressTextLast = progressText; + progressPercentLast = percent; + + if (mainDialog) //show percentage in maindialog title (and thereby in taskbar) { if (mainDialog->GetTitle() != progressText) @@ -699,13 +715,13 @@ void SyncStatus::SyncStatusImpl::showProgressExternally(const wxString& progress void SyncStatus::SyncStatusImpl::updateStatusDialogNow() { //static RetrieveStatistics statistic; - //statistic.writeEntry(currentData, currentObjects); + //statistic.writeEntry(currentData.ToDouble(), currentObjects); const float percent = totalData == 0 ? 0 : currentData.ToDouble() * 100 / totalData.ToDouble(); //write status information to systray, taskbar, parent title ect. - const wxString postFix = jobName_.empty() ? wxString() : (wxT(" - \"") + jobName_ + wxT("\"")); + const wxString postFix = jobName_.empty() ? wxString() : (wxT("\n\"") + jobName_ + wxT("\"")); switch (currentStatus) { case SyncStatus::SCANNING: @@ -786,13 +802,26 @@ void SyncStatus::SyncStatusImpl::updateStatusDialogNow() } } + //support for pause button - while (processPaused && currentProcessIsRunning()) + if(processPaused) { - wxMilliSleep(UI_UPDATE_INTERVAL); - updateUiNow(); + if (statistics.get()) statistics->pauseTimer(); + + while (processPaused && currentProcessIsRunning()) + { + wxMilliSleep(UI_UPDATE_INTERVAL); + updateUiNow(); + } + + if (statistics.get()) statistics->resumeTimer(); } + /* + /|\ + | keep this order to ensure one full statistics update before entering pause mode + \|/ + */ updateUiNow(); } @@ -904,7 +933,19 @@ void SyncStatus::SyncStatusImpl::OnOkay(wxCommandEvent& event) void SyncStatus::SyncStatusImpl::OnAbort(wxCommandEvent& event) { - Close(); //generate close event: do NOT destroy window unconditionally! + 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(); + } } @@ -912,49 +953,41 @@ 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(); + processPaused = !processPaused; - //resume timers - timeElapsed.Resume(); - if (statistics.get()) - statistics->resumeTimer(); - } - else + if (processPaused) { 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(); + } + else + { + setCurrentStatus(previousStatus); + + m_buttonPause->SetLabel(_("Pause")); + m_animationControl1->Play(); + + //resume timers + timeElapsed.Resume(); } } void SyncStatus::SyncStatusImpl::OnClose(wxCloseEvent& event) { - processPaused = false; - if (currentProcessIsRunning()) + if (m_buttonAbort->IsShown()) //delegate to "abort" button if available { - m_buttonAbort->Disable(); - m_buttonAbort->Hide(); - m_buttonPause->Disable(); - m_buttonPause->Hide(); + wxCommandEvent dummy(wxEVT_COMMAND_BUTTON_CLICKED); + m_buttonAbort->ProcessEvent(dummy); - setStatusText_NoUpdate(wxToZ(_("Abort requested: Waiting for current operation to finish..."))); - //no Layout() or UI-update here to avoid cascaded Yield()-call - - processStatusHandler->requestAbortion(); + if (event.CanVeto()) event.Veto(); //that's what we want here + else Destroy(); //shouldn't be necessary } else Destroy(); @@ -971,6 +1004,7 @@ void SyncStatus::SyncStatusImpl::OnIconize(wxIconizeEvent& event) void SyncStatus::SyncStatusImpl::minimizeToTray() { minimizedToSysTray.reset(new MinimizeToTray(this, mainDialog)); + minimizedToSysTray->setToolTip(progressTextLast, progressPercentLast); //set tooltip: in pause mode there is no statistics update, so this is the only chance } diff --git a/ui/progress_indicator.h b/ui/progress_indicator.h index bb5a287c..9e139ae5 100644 --- a/ui/progress_indicator.h +++ b/ui/progress_indicator.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef PROGRESSINDICATOR_H_INCLUDED diff --git a/ui/search.cpp b/ui/search.cpp index 23cf89b1..d27e3009 100644 --- a/ui/search.cpp +++ b/ui/search.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "search.h" @@ -40,7 +40,7 @@ SearchDlg::SearchDlg(wxWindow& parentWindow, wxString& searchText, bool& respect { #ifdef FFS_WIN new ffs3::MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... - this); //ownership passed to "this" + this); //ownership passed to "this" #endif m_checkBoxMatchCase->SetValue(respectCase_); diff --git a/ui/search.h b/ui/search.h index 22ef9bc9..4b1c0a81 100644 --- a/ui/search.h +++ b/ui/search.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef SEARCH_H_INCLUDED diff --git a/ui/small_dlgs.cpp b/ui/small_dlgs.cpp index e582142c..0e93337e 100644 --- a/ui/small_dlgs.cpp +++ b/ui/small_dlgs.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "gui_generated.h" @@ -452,11 +452,11 @@ DefaultReturnCode::Response ffs3::showDeleteDialog(const std::vector<ffs3::FileS DefaultReturnCode::Response rv = DefaultReturnCode::BUTTON_CANCEL; DeleteDialog confirmDeletion(NULL, - rowsOnLeft, - rowsOnRight, - deleteOnBothSides, - useRecycleBin, - totalDeleteCount); + rowsOnLeft, + rowsOnRight, + deleteOnBothSides, + useRecycleBin, + totalDeleteCount); if (confirmDeletion.ShowModal() == DeleteDialog::BUTTON_OKAY) rv = DefaultReturnCode::BUTTON_OKAY; return rv; @@ -639,7 +639,7 @@ SyncPreviewDlg::SyncPreviewDlg(wxWindow* parentWindow, { #ifdef FFS_WIN new ffs3::MouseMoveWindow(*this, //allow moving main dialog by clicking (nearly) anywhere... - this, m_staticTextVariant); //ownership passed to "this" + this, m_staticTextVariant); //ownership passed to "this" #endif using ffs3::numberToStringSep; @@ -653,13 +653,13 @@ SyncPreviewDlg::SyncPreviewDlg(wxWindow* parentWindow, 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_textCtrlCreateL->SetValue(numberToStringSep(statistics.getCreate <LEFT_SIDE>())); + m_textCtrlUpdateL->SetValue(numberToStringSep(statistics.getOverwrite<LEFT_SIDE>())); + m_textCtrlDeleteL->SetValue(numberToStringSep(statistics.getDelete <LEFT_SIDE>())); - 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_textCtrlCreateR->SetValue(numberToStringSep(statistics.getCreate <RIGHT_SIDE>())); + m_textCtrlUpdateR->SetValue(numberToStringSep(statistics.getOverwrite<RIGHT_SIDE>())); + m_textCtrlDeleteR->SetValue(numberToStringSep(statistics.getDelete <RIGHT_SIDE>())); m_checkBoxDontShowAgain->SetValue(dontShowAgain); diff --git a/ui/small_dlgs.h b/ui/small_dlgs.h index 57a5f542..73253b15 100644 --- a/ui/small_dlgs.h +++ b/ui/small_dlgs.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef SMALLDIALOGS_H_INCLUDED diff --git a/ui/sorting.h b/ui/sorting.h index 305cb916..ce3e4648 100644 --- a/ui/sorting.h +++ b/ui/sorting.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef SORTING_H_INCLUDED @@ -93,13 +93,13 @@ bool sortByRelativeName(const FileSystemObject& a, const FileSystemObject& b) const bool isDirectoryA = isDirectoryMapping(a); const Zstring& relDirNameA = isDirectoryA ? - a.getRelativeName<side>() : //directory - a.getParentRelativeName(); //file or symlink + a.getRelativeName<side>() : //directory + a.getParentRelativeName(); //file or symlink const bool isDirectoryB = isDirectoryMapping(b); const Zstring& relDirNameB = isDirectoryB ? - b.getRelativeName<side>() : //directory - b.getParentRelativeName(); //file or symlink + b.getRelativeName<side>() : //directory + b.getParentRelativeName(); //file or symlink //compare relative names without filenames first diff --git a/ui/switch_to_gui.cpp b/ui/switch_to_gui.cpp index 121047e6..87827c54 100644 --- a/ui/switch_to_gui.cpp +++ b/ui/switch_to_gui.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "switch_to_gui.h" diff --git a/ui/switch_to_gui.h b/ui/switch_to_gui.h index b39354f8..a938c7d8 100644 --- a/ui/switch_to_gui.h +++ b/ui/switch_to_gui.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef SWITCHTOGUI_H_INCLUDED diff --git a/ui/sync_cfg.cpp b/ui/sync_cfg.cpp index c0af4881..371f90cb 100644 --- a/ui/sync_cfg.cpp +++ b/ui/sync_cfg.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "sync_cfg.h" diff --git a/ui/sync_cfg.h b/ui/sync_cfg.h index 805bb03f..fb00136a 100644 --- a/ui/sync_cfg.h +++ b/ui/sync_cfg.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef SYNCCONFIG_H_INCLUDED diff --git a/ui/tray_icon.cpp b/ui/tray_icon.cpp index 71de676d..087ee9d3 100644 --- a/ui/tray_icon.cpp +++ b/ui/tray_icon.cpp @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #include "tray_icon.h" @@ -39,7 +39,7 @@ wxIcon generateIcon(size_t percent) //generate icon with progress indicator if (buffer.first == indicatorHeight) return buffer.second; - wxImage genImage(trayIcon.ConvertToImage()); + wxImage genImage(trayIcon.ConvertToImage()); if ( genImage.GetWidth() > 0 && genImage.GetHeight() > 0) diff --git a/ui/tray_icon.h b/ui/tray_icon.h index b351dfc8..1207d1fa 100644 --- a/ui/tray_icon.h +++ b/ui/tray_icon.h @@ -1,7 +1,7 @@ // ************************************************************************** // * 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) * +// * Copyright (C) 2008-2011 ZenJu (zhnmju123 AT gmx.de) * // ************************************************************************** // #ifndef TRAYICON_H_INCLUDED |