diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/MainDialog.cpp | 22 | ||||
-rw-r--r-- | ui/guiGenerated.cpp | 37 | ||||
-rw-r--r-- | ui/guiGenerated.h | 4 |
3 files changed, 38 insertions, 25 deletions
diff --git a/ui/MainDialog.cpp b/ui/MainDialog.cpp index 7b7a5c37..186126e2 100644 --- a/ui/MainDialog.cpp +++ b/ui/MainDialog.cpp @@ -14,6 +14,7 @@ #include <wx/clipbrd.h> #include <wx/file.h> #include "../library/customGrid.h" +#include <algorithm> using namespace globalFunctions; @@ -262,9 +263,9 @@ MainDialog::~MainDialog() writeConfigurationToHD(FreeFileSync::FfsLastConfigFile); //don't trow exceptions in destructors - if (restartOnExit) //needed so that restart is scheduled AFTER configuration was written! + if (restartOnExit) //this is needed so that restart happens AFTER configuration was written! { //create new dialog - MainDialog* frame = new MainDialog(0L, FreeFileSync::FfsLastConfigFile, programLanguage); + MainDialog* frame = new MainDialog(NULL, FreeFileSync::FfsLastConfigFile, programLanguage); frame->SetIcon(*GlobalResources::programIcon); //set application icon frame->Show(); } @@ -987,6 +988,9 @@ void MainDialog::addCfgFileToHistory(const wxString& filename) if (sameFileSpecified(FreeFileSync::FfsLastConfigFile, filename)) return; + //only still existing files should be included in the list + if (!wxFileExists(filename)) + return; bool duplicateEntry = false; unsigned int duplicatePos = 0; @@ -998,8 +1002,7 @@ void MainDialog::addCfgFileToHistory(const wxString& filename) break; } - - if (duplicateEntry) //if entry is in the list, then jump to element + if (duplicateEntry) //if entry is in the list, then jump to element { m_choiceLoad->SetSelection(duplicatePos + 1); } @@ -1057,10 +1060,9 @@ bool FileDropEvent::OnDropFiles(wxCoord x, wxCoord y, const wxArrayString& filen const wxString droppedFileName = filenames[0]; //test if ffs config file has been dropped - if (wxFileExists(droppedFileName) && FreeFileSync::isFFS_ConfigFile(droppedFileName)) + if (FreeFileSync::isFFS_ConfigFile(droppedFileName)) { mainDlg->readConfigurationFromHD(droppedFileName); - mainDlg->pushStatusInformation(_("Configuration loaded!")); } @@ -1148,7 +1150,6 @@ void MainDialog::OnLoadConfiguration(wxCommandEvent& event) else { readConfigurationFromHD(newCfgFile); - pushStatusInformation(_("Configuration loaded!")); } } @@ -1162,11 +1163,10 @@ void MainDialog::OnChoiceKeyEvent(wxKeyEvent& event) if (event.GetKeyCode() == WXK_DELETE) { //try to delete the currently selected config history item int selectedItem; - if ((selectedItem = m_choiceLoad->GetSelection()) != wxNOT_FOUND) + if ((selectedItem = m_choiceLoad->GetCurrentSelection()) != wxNOT_FOUND) if (1 <= selectedItem && unsigned(selectedItem) < m_choiceLoad->GetCount()) if (unsigned(selectedItem - 1) < cfgFileNames.size()) - { - //delete selected row + { //delete selected row cfgFileNames.erase(cfgFileNames.begin() + selectedItem - 1); m_choiceLoad->Delete(selectedItem); } @@ -2268,7 +2268,7 @@ CompareStatusUpdater::CompareStatusUpdater(MainDialog* dlg) : //display status panel during compare statusPanel = new CompareStatus(mainDialog); - mainDialog->bSizer1->Insert(1, statusPanel, 0, wxEXPAND | wxALL, 5 ); + mainDialog->bSizer1->Insert(1, statusPanel, 0, wxEXPAND | wxBOTTOM, 5 ); //show abort button diff --git a/ui/guiGenerated.cpp b/ui/guiGenerated.cpp index b851d4b4..d1a1c183 100644 --- a/ui/guiGenerated.cpp +++ b/ui/guiGenerated.cpp @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 18 2008) +// C++ code generated with wxFormBuilder (version Apr 16 2008) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -356,11 +356,11 @@ GuiGenerated::GuiGenerated( wxWindow* parent, wxWindowID id, const wxString& tit sbSizer16->Add( m_bpButton201, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 5 ); - wxString m_choiceLoadChoices[] = { _("Load configuration...") }; + wxString m_choiceLoadChoices[] = { _("Load from file...") }; int m_choiceLoadNChoices = sizeof( m_choiceLoadChoices ) / sizeof( wxString ); m_choiceLoad = new wxChoice( m_panel4, wxID_ANY, wxDefaultPosition, wxSize( 140,-1 ), m_choiceLoadNChoices, m_choiceLoadChoices, 0 ); m_choiceLoad->SetSelection( 0 ); - m_choiceLoad->SetToolTip( _("Load configuration from file:\n - use this choice box\n - drag & drop config file to this window\n - specify config file as first commandline parameter") ); + m_choiceLoad->SetToolTip( _("Load configuration via...\n - this list (press DEL to delete items)\n - drag & drop to this window\n - startup parameter") ); sbSizer16->Add( m_choiceLoad, 0, wxALIGN_CENTER_VERTICAL, 5 ); @@ -787,27 +787,27 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr fgSizer1->Add( m_radioBtn1, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonOneWay = new wxButton( this, wxID_ANY, _("One way ->"), wxDefaultPosition, wxSize( 130,-1 ), 0 ); + m_buttonOneWay = new wxButton( this, wxID_ANY, _("One way ->"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_buttonOneWay->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_buttonOneWay, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_staticText8 = new wxStaticText( this, wxID_ANY, _("Mirror backup of left folder: Right folder will be overwritten and exactly match left folder after synchronization."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText8->Wrap( 260 ); - fgSizer1->Add( m_staticText8, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); + m_staticText8->Wrap( 300 ); + fgSizer1->Add( m_staticText8, 0, wxLEFT|wxALIGN_CENTER_VERTICAL, 5 ); m_radioBtn2 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); m_radioBtn2->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); fgSizer1->Add( m_radioBtn2, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_buttonTwoWay = new wxButton( this, wxID_ANY, _("Two way <->"), wxDefaultPosition, wxSize( 130,-1 ), 0 ); + m_buttonTwoWay = new wxButton( this, wxID_ANY, _("Two way <->"), wxDefaultPosition, wxSize( -1,-1 ), 0 ); m_buttonTwoWay->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_buttonTwoWay, 0, wxALIGN_CENTER_VERTICAL, 5 ); + fgSizer1->Add( m_buttonTwoWay, 0, wxEXPAND|wxALIGN_CENTER_VERTICAL, 5 ); m_staticText10 = new wxStaticText( this, wxID_ANY, _("Synchronize both sides simultaneously: Copy new or updated files in both directions."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText10->Wrap( 250 ); + m_staticText10->Wrap( 300 ); fgSizer1->Add( m_staticText10, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); m_radioBtn3 = new wxRadioButton( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 ); @@ -815,14 +815,25 @@ SyncDlgGenerated::SyncDlgGenerated( wxWindow* parent, wxWindowID id, const wxStr fgSizer1->Add( m_radioBtn3, 0, wxALIGN_CENTER_VERTICAL, 5 ); - m_staticText23 = new wxStaticText( this, wxID_ANY, _("Custom"), wxDefaultPosition, wxSize( 130,-1 ), wxALIGN_CENTRE|wxSTATIC_BORDER ); + wxBoxSizer* bSizer65; + bSizer65 = new wxBoxSizer( wxVERTICAL ); + + + bSizer65->Add( 0, 0, 1, wxEXPAND, 5 ); + + m_staticText23 = new wxStaticText( this, wxID_ANY, _("Custom"), wxDefaultPosition, wxSize( -1,-1 ), wxALIGN_CENTRE|wxSTATIC_BORDER ); m_staticText23->Wrap( -1 ); m_staticText23->SetFont( wxFont( 11, 74, 90, 92, false, wxT("Tahoma") ) ); - fgSizer1->Add( m_staticText23, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5 ); + bSizer65->Add( m_staticText23, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); + + + bSizer65->Add( 0, 0, 1, wxEXPAND, 5 ); + + fgSizer1->Add( bSizer65, 0, wxALIGN_CENTER_VERTICAL|wxEXPAND, 5 ); m_staticText9 = new wxStaticText( this, wxID_ANY, _("Configure your own synchronization rules."), wxDefaultPosition, wxDefaultSize, 0 ); - m_staticText9->Wrap( 250 ); + m_staticText9->Wrap( 300 ); fgSizer1->Add( m_staticText9, 0, wxALIGN_CENTER_VERTICAL|wxLEFT, 5 ); sbSizer7->Add( fgSizer1, 0, 0, 5 ); diff --git a/ui/guiGenerated.h b/ui/guiGenerated.h index c2665539..a606fc7a 100644 --- a/ui/guiGenerated.h +++ b/ui/guiGenerated.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Oct 18 2008) +// C++ code generated with wxFormBuilder (version Apr 16 2008) // http://www.wxformbuilder.org/ // // PLEASE DO "NOT" EDIT THIS FILE! @@ -216,7 +216,9 @@ class SyncDlgGenerated : public wxDialog wxButton* m_buttonTwoWay; wxStaticText* m_staticText10; wxRadioButton* m_radioBtn3; + wxStaticText* m_staticText23; + wxStaticText* m_staticText9; wxButton* m_button6; |