From e05ae157961f675c7e6a0e015c3c7e5371361321 Mon Sep 17 00:00:00 2001 From: Jon Date: Tue, 2 Jan 2018 19:08:32 +1100 Subject: [PATCH 1/2] Add ability to clean out all settings saved by OD. --- CMakeLists.txt | 4 +- Forms/ODPropertiesDialog.fbp | 88 ++++++++++++++++++++++++++++++++ Forms/ODPropertiesDialogDef.cpp | 5 ++ Forms/ODPropertiesDialogDef.h | 4 +- include/ODPropertiesDialogDef.h | 4 +- include/ODPropertiesDialogImpl.h | 1 + include/ocpn_draw_pi.h | 3 +- src/ODPropertiesDialogDef.cpp | 5 ++ src/ODPropertiesDialogImpl.cpp | 5 ++ src/ocpn_draw_pi.cpp | 8 +++ 10 files changed, 122 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d68597e4..3348cf6d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,8 @@ SET(CPACK_PACKAGE_CONTACT "Jon Gough") SET(VERSION_MAJOR "1") SET(VERSION_MINOR "4") -SET(VERSION_PATCH "44") -SET(VERSION_DATE "30/12/2017") +SET(VERSION_PATCH "45") +SET(VERSION_DATE "02/01/2018") SET(BUNDLE_DATA FALSE) SET( CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" ) diff --git a/Forms/ODPropertiesDialog.fbp b/Forms/ODPropertiesDialog.fbp index f9089b5c..ceb48ac0 100644 --- a/Forms/ODPropertiesDialog.fbp +++ b/Forms/ODPropertiesDialog.fbp @@ -1292,6 +1292,94 @@ + + 5 + wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + &Recreate Config File Entries + + 0 + + + 0 + + 1 + m_buttonConfigFileEntries + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + wxFILTER_NONE + wxDefaultValidator + + + + + OnClickConfigFileEntries + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Forms/ODPropertiesDialogDef.cpp b/Forms/ODPropertiesDialogDef.cpp index 1823b900..994f685f 100644 --- a/Forms/ODPropertiesDialogDef.cpp +++ b/Forms/ODPropertiesDialogDef.cpp @@ -76,6 +76,9 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_choiceToolbar->SetSelection( 1 ); fgSizer4->Add( m_choiceToolbar, 0, wxALL, 5 ); + m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("&Recreate Config File Entries"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer4->Add( m_buttonConfigFileEntries, 0, wxALL, 5 ); + bSizerGeneral->Add( fgSizer4, 1, wxEXPAND, 5 ); @@ -1400,6 +1403,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c this->Layout(); // Connect Events + m_buttonConfigFileEntries->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this ); m_buttonTextFont->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this ); m_checkBoxRotateWithBoat->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this ); m_checkBoxEBLFixedEndPosition->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this ); @@ -1413,6 +1417,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c ODPropertiesDialogDef::~ODPropertiesDialogDef() { // Disconnect Events + m_buttonConfigFileEntries->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this ); m_buttonTextFont->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this ); m_checkBoxRotateWithBoat->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this ); m_checkBoxEBLFixedEndPosition->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this ); diff --git a/Forms/ODPropertiesDialogDef.h b/Forms/ODPropertiesDialogDef.h index ab64c3c8..993a9dae 100644 --- a/Forms/ODPropertiesDialogDef.h +++ b/Forms/ODPropertiesDialogDef.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -61,6 +61,7 @@ class ODPropertiesDialogDef : public wxDialog wxStaticText* m_staticTextInitialEdgePan; wxSlider* m_sliderInitialEdgePan; wxStaticText* m_staticTextToolbar; + wxButton* m_buttonConfigFileEntries; wxPanel* m_panelBoundary; wxStaticText* m_staticTextActiveBoundayLineColour; wxColourPickerCtrl* m_colourPickerActiveBoundaryLineColour; @@ -281,6 +282,7 @@ class ODPropertiesDialogDef : public wxDialog wxButton* m_buttonApply; // Virtual event handlers, overide them in your derived class + virtual void OnClickConfigFileEntries( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonClickFonts( wxCommandEvent& event ) { event.Skip(); } virtual void OnEBLRotateWithBoat( wxCommandEvent& event ) { event.Skip(); } virtual void OnEBLFixedEndPosition( wxCommandEvent& event ) { event.Skip(); } diff --git a/include/ODPropertiesDialogDef.h b/include/ODPropertiesDialogDef.h index ab64c3c8..993a9dae 100644 --- a/include/ODPropertiesDialogDef.h +++ b/include/ODPropertiesDialogDef.h @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -30,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -61,6 +61,7 @@ class ODPropertiesDialogDef : public wxDialog wxStaticText* m_staticTextInitialEdgePan; wxSlider* m_sliderInitialEdgePan; wxStaticText* m_staticTextToolbar; + wxButton* m_buttonConfigFileEntries; wxPanel* m_panelBoundary; wxStaticText* m_staticTextActiveBoundayLineColour; wxColourPickerCtrl* m_colourPickerActiveBoundaryLineColour; @@ -281,6 +282,7 @@ class ODPropertiesDialogDef : public wxDialog wxButton* m_buttonApply; // Virtual event handlers, overide them in your derived class + virtual void OnClickConfigFileEntries( wxCommandEvent& event ) { event.Skip(); } virtual void OnButtonClickFonts( wxCommandEvent& event ) { event.Skip(); } virtual void OnEBLRotateWithBoat( wxCommandEvent& event ) { event.Skip(); } virtual void OnEBLFixedEndPosition( wxCommandEvent& event ) { event.Skip(); } diff --git a/include/ODPropertiesDialogImpl.h b/include/ODPropertiesDialogImpl.h index 0f3bbe49..4d5537c1 100644 --- a/include/ODPropertiesDialogImpl.h +++ b/include/ODPropertiesDialogImpl.h @@ -44,6 +44,7 @@ class ODPropertiesDialogImpl : public ODPropertiesDialogDef { protected: // Handlers for ODPropertiesForm events. + void OnClickConfigFileEntries( wxCommandEvent& event ); void OnODPointComboboxSelected( wxCommandEvent& event ); void OnTextPointIconComboboxSelected( wxCommandEvent& event ); void OnEBLEndIconComboboxSelected( wxCommandEvent& event ); diff --git a/include/ocpn_draw_pi.h b/include/ocpn_draw_pi.h index 663e650d..5c3e652d 100644 --- a/include/ocpn_draw_pi.h +++ b/include/ocpn_draw_pi.h @@ -381,7 +381,8 @@ class ocpn_draw_pi : public opencpn_plugin_113 void ProcessTimerEvent(wxTimerEvent& ev); void PopupMenuHandler(wxCommandEvent& ev); - void SaveConfig(); + void SaveConfig( void ); + void RecreateConfig( void ); void AlphaBlending( ODDC &dc, int x, int y, int size_x, int size_y, float radius, wxColour color, unsigned char transparency ); diff --git a/src/ODPropertiesDialogDef.cpp b/src/ODPropertiesDialogDef.cpp index 1823b900..994f685f 100644 --- a/src/ODPropertiesDialogDef.cpp +++ b/src/ODPropertiesDialogDef.cpp @@ -76,6 +76,9 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_choiceToolbar->SetSelection( 1 ); fgSizer4->Add( m_choiceToolbar, 0, wxALL, 5 ); + m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("&Recreate Config File Entries"), wxDefaultPosition, wxDefaultSize, 0 ); + fgSizer4->Add( m_buttonConfigFileEntries, 0, wxALL, 5 ); + bSizerGeneral->Add( fgSizer4, 1, wxEXPAND, 5 ); @@ -1400,6 +1403,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c this->Layout(); // Connect Events + m_buttonConfigFileEntries->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this ); m_buttonTextFont->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this ); m_checkBoxRotateWithBoat->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this ); m_checkBoxEBLFixedEndPosition->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this ); @@ -1413,6 +1417,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c ODPropertiesDialogDef::~ODPropertiesDialogDef() { // Disconnect Events + m_buttonConfigFileEntries->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnClickConfigFileEntries ), NULL, this ); m_buttonTextFont->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnButtonClickFonts ), NULL, this ); m_checkBoxRotateWithBoat->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLRotateWithBoat ), NULL, this ); m_checkBoxEBLFixedEndPosition->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( ODPropertiesDialogDef::OnEBLFixedEndPosition ), NULL, this ); diff --git a/src/ODPropertiesDialogImpl.cpp b/src/ODPropertiesDialogImpl.cpp index 693697ed..22c169ef 100644 --- a/src/ODPropertiesDialogImpl.cpp +++ b/src/ODPropertiesDialogImpl.cpp @@ -1053,3 +1053,8 @@ void ODPropertiesDialogImpl::SetTableCellBackgroundColours() return; } + +void ODPropertiesDialogImpl::OnClickConfigFileEntries( wxCommandEvent& event ) +{ + g_ocpn_draw_pi->RecreateConfig(); +} diff --git a/src/ocpn_draw_pi.cpp b/src/ocpn_draw_pi.cpp index daeef66b..4727eda1 100644 --- a/src/ocpn_draw_pi.cpp +++ b/src/ocpn_draw_pi.cpp @@ -1215,6 +1215,14 @@ void ocpn_draw_pi::OnToolbarToolUpCallback(int id) m_pODicons->SetScaleFactor(); return; } +void ocpn_draw_pi::RecreateConfig() +{ + wxFileConfig *pConf = m_pODConfig; + if(pConf) { + pConf->SetPath( wxS( "/Settings/ocpn_draw_pi" ) ); + pConf->DeleteGroup( "/Settings/ocpn_draw_pi" ); + } +} void ocpn_draw_pi::SaveConfig() { #ifndef __WXMSW__ From 6e4d09b83b145fbc89c7c8c88d3618cac5a2b2d0 Mon Sep 17 00:00:00 2001 From: Jon Date: Wed, 3 Jan 2018 08:41:00 +1100 Subject: [PATCH 2/2] Corrected delete of config settings Re worked wording to make clearer what is happening Allow user to undo change if OCPN has not been closed --- CMakeLists.txt | 4 +- Forms/ODPropertiesDialog.fbp | 91 +++++++++- Forms/ODPropertiesDialogDef.cpp | 10 +- Forms/ODPropertiesDialogDef.h | 3 +- include/ODPropertiesDialogDef.h | 3 +- include/ODPropertiesDialogImpl.h | 1 - include/ocpn_draw_pi.h | 4 +- src/ODPropertiesDialogDef.cpp | 10 +- src/ODPropertiesDialogImpl.cpp | 17 +- src/ocpn_draw_pi.cpp | 285 +++++++++++++++---------------- 10 files changed, 265 insertions(+), 163 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 3348cf6d..e67e046a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,8 +21,8 @@ SET(CPACK_PACKAGE_CONTACT "Jon Gough") SET(VERSION_MAJOR "1") SET(VERSION_MINOR "4") -SET(VERSION_PATCH "45") -SET(VERSION_DATE "02/01/2018") +SET(VERSION_PATCH "46") +SET(VERSION_DATE "03/01/2018") SET(BUNDLE_DATA FALSE) SET( CMAKE_BUILD_TYPE "Release" CACHE STRING "Choose the type of build" ) diff --git a/Forms/ODPropertiesDialog.fbp b/Forms/ODPropertiesDialog.fbp index ceb48ac0..d3c4f800 100644 --- a/Forms/ODPropertiesDialog.fbp +++ b/Forms/ODPropertiesDialog.fbp @@ -45,7 +45,7 @@ ODPropertiesDialogDef 591,607 - wxDEFAULT_DIALOG_STYLE + wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP OCPN Draw Properties @@ -178,7 +178,7 @@ General - 0 + 1 1 1 @@ -1292,6 +1292,89 @@ + + 5 + wxALIGN_CENTER_VERTICAL|wxALL + 0 + + 1 + 1 + 1 + 1 + + + + + + + + 1 + 0 + 1 + + 1 + 0 + Dock + 0 + Left + 1 + + 1 + + 0 + 0 + wxID_ANY + Delete current OCPN_Draw config entries (No) + + 0 + + + 0 + + 1 + m_staticTextConfigFileEntriesMsg + 1 + + + protected + 1 + + Resizable + 1 + + + + 0 + + + + + -1 + + + + + + + + + + + + + + + + + + + + + + + + + 5 wxALL @@ -1325,7 +1408,7 @@ 0 0 wxID_ANY - &Recreate Config File Entries + Yes 0 @@ -7429,7 +7512,7 @@ EBL - 1 + 0 1 1 diff --git a/Forms/ODPropertiesDialogDef.cpp b/Forms/ODPropertiesDialogDef.cpp index 994f685f..935cd36a 100644 --- a/Forms/ODPropertiesDialogDef.cpp +++ b/Forms/ODPropertiesDialogDef.cpp @@ -76,7 +76,11 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_choiceToolbar->SetSelection( 1 ); fgSizer4->Add( m_choiceToolbar, 0, wxALL, 5 ); - m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("&Recreate Config File Entries"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextConfigFileEntriesMsg = new wxStaticText( m_panelGeneral, wxID_ANY, _("Delete current OCPN_Draw config entries (No)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextConfigFileEntriesMsg->Wrap( -1 ); + fgSizer4->Add( m_staticTextConfigFileEntriesMsg, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer4->Add( m_buttonConfigFileEntries, 0, wxALL, 5 ); @@ -86,7 +90,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_panelGeneral->SetSizer( bSizerGeneral ); m_panelGeneral->Layout(); bSizerGeneral->Fit( m_panelGeneral ); - m_notebookProperties->AddPage( m_panelGeneral, _("General"), false ); + m_notebookProperties->AddPage( m_panelGeneral, _("General"), true ); m_panelBoundary = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxFlexGridSizer* fgSizerBoundarySettings; fgSizerBoundarySettings = new wxFlexGridSizer( 0, 1, 0, 0 ); @@ -608,7 +612,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_panelEBL->SetSizer( m_fgSizerEBLSettings ); m_panelEBL->Layout(); m_fgSizerEBLSettings->Fit( m_panelEBL ); - m_notebookProperties->AddPage( m_panelEBL, _("EBL"), true ); + m_notebookProperties->AddPage( m_panelEBL, _("EBL"), false ); m_panelDR = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxFlexGridSizer* fgSizerDRSettings; fgSizerDRSettings = new wxFlexGridSizer( 0, 1, 0, 0 ); diff --git a/Forms/ODPropertiesDialogDef.h b/Forms/ODPropertiesDialogDef.h index 993a9dae..d3360d6f 100644 --- a/Forms/ODPropertiesDialogDef.h +++ b/Forms/ODPropertiesDialogDef.h @@ -61,6 +61,7 @@ class ODPropertiesDialogDef : public wxDialog wxStaticText* m_staticTextInitialEdgePan; wxSlider* m_sliderInitialEdgePan; wxStaticText* m_staticTextToolbar; + wxStaticText* m_staticTextConfigFileEntriesMsg; wxButton* m_buttonConfigFileEntries; wxPanel* m_panelBoundary; wxStaticText* m_staticTextActiveBoundayLineColour; @@ -296,7 +297,7 @@ class ODPropertiesDialogDef : public wxDialog wxChoice* m_choiceToolbar; wxGrid* m_gridODWDInteractions; - ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE ); + ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP ); ~ODPropertiesDialogDef(); }; diff --git a/include/ODPropertiesDialogDef.h b/include/ODPropertiesDialogDef.h index 993a9dae..d3360d6f 100644 --- a/include/ODPropertiesDialogDef.h +++ b/include/ODPropertiesDialogDef.h @@ -61,6 +61,7 @@ class ODPropertiesDialogDef : public wxDialog wxStaticText* m_staticTextInitialEdgePan; wxSlider* m_sliderInitialEdgePan; wxStaticText* m_staticTextToolbar; + wxStaticText* m_staticTextConfigFileEntriesMsg; wxButton* m_buttonConfigFileEntries; wxPanel* m_panelBoundary; wxStaticText* m_staticTextActiveBoundayLineColour; @@ -296,7 +297,7 @@ class ODPropertiesDialogDef : public wxDialog wxChoice* m_choiceToolbar; wxGrid* m_gridODWDInteractions; - ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE ); + ODPropertiesDialogDef( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("OCPN Draw Properties"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 591,607 ), long style = wxDEFAULT_DIALOG_STYLE|wxSTAY_ON_TOP ); ~ODPropertiesDialogDef(); }; diff --git a/include/ODPropertiesDialogImpl.h b/include/ODPropertiesDialogImpl.h index 4d5537c1..00f57443 100644 --- a/include/ODPropertiesDialogImpl.h +++ b/include/ODPropertiesDialogImpl.h @@ -94,7 +94,6 @@ class ODPropertiesDialogImpl : public ODPropertiesDialogDef int m_iCOGValidator; wxColour m_cRed; wxColour m_cGreen; - }; #endif // __ODPropertiesDialogImpl__ diff --git a/include/ocpn_draw_pi.h b/include/ocpn_draw_pi.h index 5c3e652d..52fc2371 100644 --- a/include/ocpn_draw_pi.h +++ b/include/ocpn_draw_pi.h @@ -382,7 +382,6 @@ class ocpn_draw_pi : public opencpn_plugin_113 void PopupMenuHandler(wxCommandEvent& ev); void SaveConfig( void ); - void RecreateConfig( void ); void AlphaBlending( ODDC &dc, int x, int y, int size_x, int size_y, float radius, wxColour color, unsigned char transparency ); @@ -461,7 +460,8 @@ class ocpn_draw_pi : public opencpn_plugin_113 double m_view_scale; ODicons *m_pODicons; - + + bool m_bRecreateConfig; private: void OnTimer(wxTimerEvent& ev); diff --git a/src/ODPropertiesDialogDef.cpp b/src/ODPropertiesDialogDef.cpp index 994f685f..935cd36a 100644 --- a/src/ODPropertiesDialogDef.cpp +++ b/src/ODPropertiesDialogDef.cpp @@ -76,7 +76,11 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_choiceToolbar->SetSelection( 1 ); fgSizer4->Add( m_choiceToolbar, 0, wxALL, 5 ); - m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("&Recreate Config File Entries"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextConfigFileEntriesMsg = new wxStaticText( m_panelGeneral, wxID_ANY, _("Delete current OCPN_Draw config entries (No)"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticTextConfigFileEntriesMsg->Wrap( -1 ); + fgSizer4->Add( m_staticTextConfigFileEntriesMsg, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5 ); + + m_buttonConfigFileEntries = new wxButton( m_panelGeneral, wxID_ANY, _("Yes"), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer4->Add( m_buttonConfigFileEntries, 0, wxALL, 5 ); @@ -86,7 +90,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_panelGeneral->SetSizer( bSizerGeneral ); m_panelGeneral->Layout(); bSizerGeneral->Fit( m_panelGeneral ); - m_notebookProperties->AddPage( m_panelGeneral, _("General"), false ); + m_notebookProperties->AddPage( m_panelGeneral, _("General"), true ); m_panelBoundary = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxFlexGridSizer* fgSizerBoundarySettings; fgSizerBoundarySettings = new wxFlexGridSizer( 0, 1, 0, 0 ); @@ -608,7 +612,7 @@ ODPropertiesDialogDef::ODPropertiesDialogDef( wxWindow* parent, wxWindowID id, c m_panelEBL->SetSizer( m_fgSizerEBLSettings ); m_panelEBL->Layout(); m_fgSizerEBLSettings->Fit( m_panelEBL ); - m_notebookProperties->AddPage( m_panelEBL, _("EBL"), true ); + m_notebookProperties->AddPage( m_panelEBL, _("EBL"), false ); m_panelDR = new wxPanel( m_notebookProperties, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL ); wxFlexGridSizer* fgSizerDRSettings; fgSizerDRSettings = new wxFlexGridSizer( 0, 1, 0, 0 ); diff --git a/src/ODPropertiesDialogImpl.cpp b/src/ODPropertiesDialogImpl.cpp index 22c169ef..d399a8d6 100644 --- a/src/ODPropertiesDialogImpl.cpp +++ b/src/ODPropertiesDialogImpl.cpp @@ -1014,8 +1014,13 @@ void ODPropertiesDialogImpl::UpdateProperties( void ) m_textCtrlDRPointInterval->SetValue( wxString::Format( _T("%.3f"), g_dDRPointInterval ) ); + if(g_ocpn_draw_pi->m_bRecreateConfig) { + m_buttonConfigFileEntries->SetLabel(_("No")); + m_staticTextConfigFileEntriesMsg->SetLabel("Delete current OCPN_Draw config entries (Yes)"); + } + SetDialogSize(); - + ResetGlobalLocale(); return; @@ -1056,5 +1061,13 @@ void ODPropertiesDialogImpl::SetTableCellBackgroundColours() void ODPropertiesDialogImpl::OnClickConfigFileEntries( wxCommandEvent& event ) { - g_ocpn_draw_pi->RecreateConfig(); + if(!g_ocpn_draw_pi->m_bRecreateConfig) { + g_ocpn_draw_pi->m_bRecreateConfig = true; + m_buttonConfigFileEntries->SetLabel(_("No")); + m_staticTextConfigFileEntriesMsg->SetLabel("Delete current OCPN_Draw config entries (Yes)"); + } else { + g_ocpn_draw_pi->m_bRecreateConfig = false; + m_buttonConfigFileEntries->SetLabel(_("Yes")); + m_staticTextConfigFileEntriesMsg->SetLabel("Delete current OCPN_Draw config entries (No)"); + } } diff --git a/src/ocpn_draw_pi.cpp b/src/ocpn_draw_pi.cpp index 4727eda1..f51e41f4 100644 --- a/src/ocpn_draw_pi.cpp +++ b/src/ocpn_draw_pi.cpp @@ -389,6 +389,8 @@ ocpn_draw_pi::ocpn_draw_pi(void *ppimgr) #endif m_pODicons = new ODicons(); + + m_bRecreateConfig = false; } ocpn_draw_pi::~ocpn_draw_pi() @@ -446,6 +448,7 @@ int ocpn_draw_pi::Init(void) g_pfFix.valid = false; g_iLocaleDepth = 0; g_ODlocale = NULL; + m_bRecreateConfig = false; // Drawing modes from toolbar m_Mode = 0; @@ -891,7 +894,6 @@ void ocpn_draw_pi::ShowPreferencesDialog( wxWindow* parent ) delete g_pOCPNDrawPropDialog; g_pOCPNDrawPropDialog = NULL; - } void ocpn_draw_pi::SetPositionFixEx( PlugIn_Position_Fix_Ex &pfix ) @@ -1215,14 +1217,6 @@ void ocpn_draw_pi::OnToolbarToolUpCallback(int id) m_pODicons->SetScaleFactor(); return; } -void ocpn_draw_pi::RecreateConfig() -{ - wxFileConfig *pConf = m_pODConfig; - if(pConf) { - pConf->SetPath( wxS( "/Settings/ocpn_draw_pi" ) ); - pConf->DeleteGroup( "/Settings/ocpn_draw_pi" ); - } -} void ocpn_draw_pi::SaveConfig() { #ifndef __WXMSW__ @@ -1237,144 +1231,147 @@ void ocpn_draw_pi::SaveConfig() wxFileConfig *pConf = m_pODConfig; - if(pConf) - { + if(pConf) { pConf->SetPath( wxS( "/Settings/ocpn_draw_pi" ) ); - pConf->Write( wxS( "DefaultActivePathLineColour" ), g_colourActivePathLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultInActivePathLineColour" ), g_colourInActivePathLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultActiveBoundaryLineColour" ), g_colourActiveBoundaryLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultInActiveBoundaryLineColour" ), g_colourInActiveBoundaryLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultActiveBoundaryFillColour" ), g_colourActiveBoundaryFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - int l_BoundaryType; - if(g_bExclusionBoundary && !g_bInclusionBoundary) l_BoundaryType = ID_BOUNDARY_EXCLUSION; - else if(!g_bExclusionBoundary && g_bInclusionBoundary) l_BoundaryType = ID_BOUNDARY_INCLUSION; - else if(!g_bExclusionBoundary && !g_bInclusionBoundary) l_BoundaryType = ID_BOUNDARY_NIETHER; - else l_BoundaryType = ID_BOUNDARY_EXCLUSION; - pConf->Write( wxS( "DefaultBoundaryODPointsVisible"), g_bBoundaryODPointsVisible ); - pConf->Write( wxS( "DefaultBoundaryType" ), l_BoundaryType ); - long l_longFillTransparency = g_uiFillTransparency; - pConf->Write( wxS( "DefaultBoundaryFillTransparency" ), l_longFillTransparency ); - pConf->Write( wxS( "DefaultInclusionBoundarySize" ), g_iInclusionBoundarySize ); - pConf->Write( wxS( "DefaultInActiveBoundaryFillColour" ), g_colourInActiveBoundaryFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultGZFirstIcon" ), g_sGZFirstIconName ); - pConf->Write( wxS( "DefaultGZSecondIcon" ), g_sGZSecondIconName ); - pConf->Write( wxS( "DefaultActiveGZLineColour" ), g_colourActiveGZLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultInActiveGZLineColour" ), g_colourInActiveGZLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultActiveGZFillColour" ), g_colourActiveGZFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultInActiveGZFillColour" ), g_colourInActiveGZFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultGZLineWidth" ), g_GZLineWidth ); - pConf->Write( wxS( "DefaultGZLineStyle" ), g_GZLineStyle ); - long l_longGZFillTransparency = g_uiGZFillTransparency; - pConf->Write( wxS( "DefaultGZFillTransparency" ), l_longGZFillTransparency ); - pConf->Write( wxS( "DefaultGZRotateWithBoat" ), g_bGZRotateWithBoat ); - pConf->Write( wxS( "DefaultGZMaintainWith" ), g_iGZMaintainWith ); - pConf->Write( wxS( "DefaultGZPersistenceType" ), g_iGZPersistenceType ); - pConf->Write( wxS( "DefaultEBLStartIcon" ), g_sEBLStartIconName ); - pConf->Write( wxS( "DefaultEBLEndIcon" ), g_sEBLEndIconName ); - pConf->Write( wxS( "DefaultEBLLineColour" ), g_colourEBLLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultBoundaryLineWidth" ), g_BoundaryLineWidth ); - pConf->Write( wxS( "DefaultBoundaryLineStyle" ), g_BoundaryLineStyle ); - pConf->Write( wxS( "DefaultEBLLineWidth" ), g_EBLLineWidth ); - pConf->Write( wxS( "DefaultEBLLineStyle" ), g_EBLLineStyle ); - pConf->Write( wxS( "DefaultEBLShowArrow" ), g_bEBLShowArrow ); - pConf->Write( wxS( "DefaultEBLVRM" ), g_bEBLVRM ); - pConf->Write( wxS( "DefaultEBLAlwaysShowInfo" ), g_bEBLAlwaysShowInfo ); - pConf->Write( wxS( "DefaultEBLPerpLine" ), g_bEBLPerpLine ); - pConf->Write( wxS( "DefaultEBLPersistenceType" ), g_iEBLPersistenceType ); - pConf->Write( wxS( "DefaultEBLFixedEndPosition" ), g_bEBLFixedEndPosition ); - pConf->Write( wxS( "DefaultEBLRotateWithBoat" ), g_bEBLRotateWithBoat ); - pConf->Write( wxS( "DefaultEBLMaintainWith" ), g_iEBLMaintainWith ); - pConf->Write( wxS( "DefaultPILStartIcon" ), g_sPILStartIconName ); - pConf->Write( wxS( "DefaultPILEndIcon" ), g_sPILEndIconName ); - pConf->Write( wxS( "DefaultPILActiveCentreLineColour" ), g_colourPILActiveCentreLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultPILInActiveCentreLineColour" ), g_colourPILInActiveCentreLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultPILActiveOffsetLine1Colour" ), g_colourPILActiveOffsetLine1Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultPILInActiveOffsetLine1Colour" ), g_colourPILInActiveOffsetLine1Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultPILActiveOffsetLine2Colour" ), g_colourPILActiveOffsetLine2Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultPILInActiveOffsetLine2Colour" ), g_colourPILInActiveOffsetLine2Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultPILCentreLineWidth" ), g_PILCentreLineWidth ); - pConf->Write( wxS( "DefaultPILCentreLineStyle" ), g_PILCentreLineStyle ); - pConf->Write( wxS( "DefaultPILOffsetLine1Width" ), g_PILOffsetLine1Width ); - pConf->Write( wxS( "DefaultPILOffsetLine1Style" ), g_PILOffsetLine1Style ); - pConf->Write( wxS( "DefaultPILOffsetLine2Width" ), g_PILOffsetLine2Width ); - pConf->Write( wxS( "DefaultPILOffsetLine2Style" ), g_PILOffsetLine2Style ); - pConf->Write( wxS( "DefaultPILPersistenceType" ), g_iPILPersistenceType ); - pConf->Write( wxS( "DefaultPILNumIndexLines" ), g_PILDefaultNumIndexLines ); - pConf->Write( wxS( "DefaultPILOffset"), g_dPILOffset ); - pConf->Write( wxS( "DefaultDRPointIcon" ), g_sDRPointIconName ); - pConf->Write( wxS( "DefaultShowDRPointRangeRings"), g_bDRPointShowRangeRings ); - pConf->Write( wxS( "DefaultDRPointRangeRingsNumber" ), g_iDRPointRangeRingsNumber ); - pConf->Write( wxS( "DefaultDRPointRangeRingsStep" ), g_fDRPointRangeRingsStep ); - pConf->Write( wxS( "DefaultDRPointRangeRingsStepUnits" ), g_iDRPointRangeRingsStepUnits ); - pConf->Write( wxS( "DefaultDRPointRangeRingsColour" ), g_colourDRPointRangeRingsColour.GetAsString( wxC2S_CSS_SYNTAX) ); - pConf->Write( wxS( "DefaultDRPointRangeRingLineWidth" ), g_iDRPointRangeRingLineWidth ); - pConf->Write( wxS( "DefaultDRPointRangeRingLineStyle" ), g_iDRPointRangeRingLineStyle ); - pConf->Write( wxS( "DefaultDRLineColour" ), g_colourDRLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultInActiveDRLineColour" ), g_colourInActiveDRLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultDRLineWidth" ), g_DRLineWidth ); - pConf->Write( wxS( "DefaultDRLineStyle" ), g_DRLineStyle ); - pConf->Write( wxS( "DefaultDRSOG" ), g_dDRSOG ); - pConf->Write( wxS( "DefaultDRCOG" ), g_iDRCOG ); - pConf->Write( wxS( "DefaultDRLength" ), g_dDRLength ); - pConf->Write( wxS( "DefaultDRPointInterval" ), g_dDRPointInterval ); - pConf->Write( wxS( "DefaultDRLengthType" ), g_iDRLengthType ); - pConf->Write( wxS( "DefaultDRIntervalType" ), g_iDRIntervalType ); - pConf->Write( wxS( "DefaultDRDistanceUnits" ), g_iDRDistanceUnits ); - pConf->Write( wxS( "DefaultDRTimeUnits" ), g_iDRTimeUnits ); - pConf->Write( wxS( "DefaultDRPersistenceType" ), g_iDRPersistenceType ); - pConf->Write( wxS( "DefaultPathLineWidth" ), g_PathLineWidth ); - pConf->Write( wxS( "DefaultPathLineStyle" ), g_PathLineStyle ); - pConf->Write( wxS( "ShowLOGIcon" ), m_bLOGShowIcon ); - pConf->Write( wxS( "PathLineWidth" ), g_path_line_width ); - pConf->Write( wxS( "DefaultODPointIcon" ), g_sODPointIconName ); - pConf->Write( wxS( "ODPointRangeRingsNumber" ), g_iODPointRangeRingsNumber ); - pConf->Write( wxS( "ODPointRangeRingsStep" ), g_fODPointRangeRingsStep ); - pConf->Write( wxS( "ODPointRangeRingsStepUnits" ), g_iODPointRangeRingsStepUnits ); - pConf->Write( wxS( "ODPointRangeRingsColour" ), g_colourODPointRangeRingsColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - long l_longBoundaryPointFillTransparency = g_uiBoundaryPointFillTransparency; - pConf->Write( wxS( "DefaultBoundaryPointFillTransparency" ), l_longBoundaryPointFillTransparency ); - pConf->Write( wxS( "DefaultBoundaryPointRangeRingLineWidth" ), g_iBoundaryPointRangeRingLineWidth ); - pConf->Write( wxS( "DefaultBoundaryPointRangeRingLineStyle" ), g_iBoundaryPointRangeRingLineStyle ); - pConf->Write( wxS( "DefaultInclusionBoundaryPointSize" ), g_iInclusionBoundaryPointSize ); - pConf->Write( wxS( "ShowMag" ), g_bShowMag ); - pConf->Write( wxS( "AllowLeftDrag" ), g_bAllowLeftDrag ); - pConf->Write( wxS( "UserMagVariation" ), wxString::Format( _T("%.2f"), g_UserVar ) ); - pConf->Write( wxS( "KeepODNavobjBackups" ), g_navobjbackups ); - pConf->Write( wxS( "CurrentDrawMode" ), m_Mode ); - pConf->Write( wxS( "ConfirmObjectDelete" ), g_bConfirmObjectDelete ); - pConf->Write( wxS( "InitialEdgePanSensitivity" ), g_InitialEdgePanSensitivity ); - pConf->Write( wxS( "EdgePanSensitivity" ), g_EdgePanSensitivity ); - pConf->Write( wxS( "ToolBarPosX" ), g_iToolbarPosX ); - pConf->Write( wxS( "ToolBarPosY" ), g_iToolbarPosY ); - pConf->Write( wxS( "DisplayToolbar"), g_iDisplayToolbar ); - pConf->Write( wxS( "DefaultTextPointIcon" ), g_sTextPointIconName ); - pConf->Write( wxS( "DefaultTextColour" ), g_colourDefaultTextColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultTextBackgroundColour" ), g_colourDefaultTextBackgroundColour.GetAsString( wxC2S_CSS_SYNTAX ) ); - pConf->Write( wxS( "DefaultTextBackgroundTransparency" ), g_iTextBackgroundTransparency ); - pConf->Write( wxS( "DefaultTextPosition" ), g_iTextPosition ); - pConf->Write( wxS( "DefaultTextTopOffsetX" ), g_iTextTopOffsetX ); - pConf->Write( wxS( "DefaultTextTopOffsetY" ), g_iTextTopOffsetY ); - pConf->Write( wxS( "DefaultTextBottomffsetX" ), g_iTextBottomOffsetX ); - pConf->Write( wxS( "DefaultTextBottomOffsetY" ), g_iTextBottomOffsetY ); - pConf->Write( wxS( "DefaultTextBottomNameExtraOffsetY"), g_iTextBottomNameExtraOffsetY ); - pConf->Write( wxS( "DefaultTextCenterOffsetX" ), g_iTextCentreOffsetX ); - pConf->Write( wxS( "DefaultTextCentreOffsetY" ), g_iTextCentreOffsetY ); - pConf->Write( wxS( "DefaultTextRightOffsetX" ), g_iTextRightOffsetX ); - pConf->Write( wxS( "DefaultTextRightOffsetY" ), g_iTextRightOffsetY ); - pConf->Write( wxS( "DefaultTextLeftOffsetX" ), g_iTextLeftOffsetX ); - pConf->Write( wxS( "DefaultTextLeftOffsetY" ), g_iTextLeftOffsetY ); - pConf->Write( wxS( "DefaultTextPointPointSize" ), g_DisplayTextFont.GetPointSize() ); - pConf->Write( wxS( "DefaultTextPointFontFamily" ), (int)g_DisplayTextFont.GetFamily() ); - pConf->Write( wxS( "DefaultTextPointFontStyle" ), (int)g_DisplayTextFont.GetStyle() ); - pConf->Write( wxS( "DefaultTextPointFontWeight" ), (int)g_DisplayTextFont.GetWeight() ); - pConf->Write( wxS( "DefaultTextPointFontUnderline" ), g_DisplayTextFont.GetUnderlined() ); + if(m_bRecreateConfig) { + pConf->DeleteGroup( "/Settings/ocpn_draw_pi" ); + } else { + pConf->Write( wxS( "DefaultActivePathLineColour" ), g_colourActivePathLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultInActivePathLineColour" ), g_colourInActivePathLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultActiveBoundaryLineColour" ), g_colourActiveBoundaryLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultInActiveBoundaryLineColour" ), g_colourInActiveBoundaryLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultActiveBoundaryFillColour" ), g_colourActiveBoundaryFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + int l_BoundaryType; + if(g_bExclusionBoundary && !g_bInclusionBoundary) l_BoundaryType = ID_BOUNDARY_EXCLUSION; + else if(!g_bExclusionBoundary && g_bInclusionBoundary) l_BoundaryType = ID_BOUNDARY_INCLUSION; + else if(!g_bExclusionBoundary && !g_bInclusionBoundary) l_BoundaryType = ID_BOUNDARY_NIETHER; + else l_BoundaryType = ID_BOUNDARY_EXCLUSION; + pConf->Write( wxS( "DefaultBoundaryODPointsVisible"), g_bBoundaryODPointsVisible ); + pConf->Write( wxS( "DefaultBoundaryType" ), l_BoundaryType ); + long l_longFillTransparency = g_uiFillTransparency; + pConf->Write( wxS( "DefaultBoundaryFillTransparency" ), l_longFillTransparency ); + pConf->Write( wxS( "DefaultInclusionBoundarySize" ), g_iInclusionBoundarySize ); + pConf->Write( wxS( "DefaultInActiveBoundaryFillColour" ), g_colourInActiveBoundaryFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultGZFirstIcon" ), g_sGZFirstIconName ); + pConf->Write( wxS( "DefaultGZSecondIcon" ), g_sGZSecondIconName ); + pConf->Write( wxS( "DefaultActiveGZLineColour" ), g_colourActiveGZLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultInActiveGZLineColour" ), g_colourInActiveGZLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultActiveGZFillColour" ), g_colourActiveGZFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultInActiveGZFillColour" ), g_colourInActiveGZFillColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultGZLineWidth" ), g_GZLineWidth ); + pConf->Write( wxS( "DefaultGZLineStyle" ), g_GZLineStyle ); + long l_longGZFillTransparency = g_uiGZFillTransparency; + pConf->Write( wxS( "DefaultGZFillTransparency" ), l_longGZFillTransparency ); + pConf->Write( wxS( "DefaultGZRotateWithBoat" ), g_bGZRotateWithBoat ); + pConf->Write( wxS( "DefaultGZMaintainWith" ), g_iGZMaintainWith ); + pConf->Write( wxS( "DefaultGZPersistenceType" ), g_iGZPersistenceType ); + pConf->Write( wxS( "DefaultEBLStartIcon" ), g_sEBLStartIconName ); + pConf->Write( wxS( "DefaultEBLEndIcon" ), g_sEBLEndIconName ); + pConf->Write( wxS( "DefaultEBLLineColour" ), g_colourEBLLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultBoundaryLineWidth" ), g_BoundaryLineWidth ); + pConf->Write( wxS( "DefaultBoundaryLineStyle" ), g_BoundaryLineStyle ); + pConf->Write( wxS( "DefaultEBLLineWidth" ), g_EBLLineWidth ); + pConf->Write( wxS( "DefaultEBLLineStyle" ), g_EBLLineStyle ); + pConf->Write( wxS( "DefaultEBLShowArrow" ), g_bEBLShowArrow ); + pConf->Write( wxS( "DefaultEBLVRM" ), g_bEBLVRM ); + pConf->Write( wxS( "DefaultEBLAlwaysShowInfo" ), g_bEBLAlwaysShowInfo ); + pConf->Write( wxS( "DefaultEBLPerpLine" ), g_bEBLPerpLine ); + pConf->Write( wxS( "DefaultEBLPersistenceType" ), g_iEBLPersistenceType ); + pConf->Write( wxS( "DefaultEBLFixedEndPosition" ), g_bEBLFixedEndPosition ); + pConf->Write( wxS( "DefaultEBLRotateWithBoat" ), g_bEBLRotateWithBoat ); + pConf->Write( wxS( "DefaultEBLMaintainWith" ), g_iEBLMaintainWith ); + pConf->Write( wxS( "DefaultPILStartIcon" ), g_sPILStartIconName ); + pConf->Write( wxS( "DefaultPILEndIcon" ), g_sPILEndIconName ); + pConf->Write( wxS( "DefaultPILActiveCentreLineColour" ), g_colourPILActiveCentreLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultPILInActiveCentreLineColour" ), g_colourPILInActiveCentreLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultPILActiveOffsetLine1Colour" ), g_colourPILActiveOffsetLine1Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultPILInActiveOffsetLine1Colour" ), g_colourPILInActiveOffsetLine1Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultPILActiveOffsetLine2Colour" ), g_colourPILActiveOffsetLine2Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultPILInActiveOffsetLine2Colour" ), g_colourPILInActiveOffsetLine2Colour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultPILCentreLineWidth" ), g_PILCentreLineWidth ); + pConf->Write( wxS( "DefaultPILCentreLineStyle" ), g_PILCentreLineStyle ); + pConf->Write( wxS( "DefaultPILOffsetLine1Width" ), g_PILOffsetLine1Width ); + pConf->Write( wxS( "DefaultPILOffsetLine1Style" ), g_PILOffsetLine1Style ); + pConf->Write( wxS( "DefaultPILOffsetLine2Width" ), g_PILOffsetLine2Width ); + pConf->Write( wxS( "DefaultPILOffsetLine2Style" ), g_PILOffsetLine2Style ); + pConf->Write( wxS( "DefaultPILPersistenceType" ), g_iPILPersistenceType ); + pConf->Write( wxS( "DefaultPILNumIndexLines" ), g_PILDefaultNumIndexLines ); + pConf->Write( wxS( "DefaultPILOffset"), g_dPILOffset ); + pConf->Write( wxS( "DefaultDRPointIcon" ), g_sDRPointIconName ); + pConf->Write( wxS( "DefaultShowDRPointRangeRings"), g_bDRPointShowRangeRings ); + pConf->Write( wxS( "DefaultDRPointRangeRingsNumber" ), g_iDRPointRangeRingsNumber ); + pConf->Write( wxS( "DefaultDRPointRangeRingsStep" ), g_fDRPointRangeRingsStep ); + pConf->Write( wxS( "DefaultDRPointRangeRingsStepUnits" ), g_iDRPointRangeRingsStepUnits ); + pConf->Write( wxS( "DefaultDRPointRangeRingsColour" ), g_colourDRPointRangeRingsColour.GetAsString( wxC2S_CSS_SYNTAX) ); + pConf->Write( wxS( "DefaultDRPointRangeRingLineWidth" ), g_iDRPointRangeRingLineWidth ); + pConf->Write( wxS( "DefaultDRPointRangeRingLineStyle" ), g_iDRPointRangeRingLineStyle ); + pConf->Write( wxS( "DefaultDRLineColour" ), g_colourDRLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultInActiveDRLineColour" ), g_colourInActiveDRLineColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultDRLineWidth" ), g_DRLineWidth ); + pConf->Write( wxS( "DefaultDRLineStyle" ), g_DRLineStyle ); + pConf->Write( wxS( "DefaultDRSOG" ), g_dDRSOG ); + pConf->Write( wxS( "DefaultDRCOG" ), g_iDRCOG ); + pConf->Write( wxS( "DefaultDRLength" ), g_dDRLength ); + pConf->Write( wxS( "DefaultDRPointInterval" ), g_dDRPointInterval ); + pConf->Write( wxS( "DefaultDRLengthType" ), g_iDRLengthType ); + pConf->Write( wxS( "DefaultDRIntervalType" ), g_iDRIntervalType ); + pConf->Write( wxS( "DefaultDRDistanceUnits" ), g_iDRDistanceUnits ); + pConf->Write( wxS( "DefaultDRTimeUnits" ), g_iDRTimeUnits ); + pConf->Write( wxS( "DefaultDRPersistenceType" ), g_iDRPersistenceType ); + pConf->Write( wxS( "DefaultPathLineWidth" ), g_PathLineWidth ); + pConf->Write( wxS( "DefaultPathLineStyle" ), g_PathLineStyle ); + pConf->Write( wxS( "ShowLOGIcon" ), m_bLOGShowIcon ); + pConf->Write( wxS( "PathLineWidth" ), g_path_line_width ); + pConf->Write( wxS( "DefaultODPointIcon" ), g_sODPointIconName ); + pConf->Write( wxS( "ODPointRangeRingsNumber" ), g_iODPointRangeRingsNumber ); + pConf->Write( wxS( "ODPointRangeRingsStep" ), g_fODPointRangeRingsStep ); + pConf->Write( wxS( "ODPointRangeRingsStepUnits" ), g_iODPointRangeRingsStepUnits ); + pConf->Write( wxS( "ODPointRangeRingsColour" ), g_colourODPointRangeRingsColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + long l_longBoundaryPointFillTransparency = g_uiBoundaryPointFillTransparency; + pConf->Write( wxS( "DefaultBoundaryPointFillTransparency" ), l_longBoundaryPointFillTransparency ); + pConf->Write( wxS( "DefaultBoundaryPointRangeRingLineWidth" ), g_iBoundaryPointRangeRingLineWidth ); + pConf->Write( wxS( "DefaultBoundaryPointRangeRingLineStyle" ), g_iBoundaryPointRangeRingLineStyle ); + pConf->Write( wxS( "DefaultInclusionBoundaryPointSize" ), g_iInclusionBoundaryPointSize ); + pConf->Write( wxS( "ShowMag" ), g_bShowMag ); + pConf->Write( wxS( "AllowLeftDrag" ), g_bAllowLeftDrag ); + pConf->Write( wxS( "UserMagVariation" ), wxString::Format( _T("%.2f"), g_UserVar ) ); + pConf->Write( wxS( "KeepODNavobjBackups" ), g_navobjbackups ); + pConf->Write( wxS( "CurrentDrawMode" ), m_Mode ); + pConf->Write( wxS( "ConfirmObjectDelete" ), g_bConfirmObjectDelete ); + pConf->Write( wxS( "InitialEdgePanSensitivity" ), g_InitialEdgePanSensitivity ); + pConf->Write( wxS( "EdgePanSensitivity" ), g_EdgePanSensitivity ); + pConf->Write( wxS( "ToolBarPosX" ), g_iToolbarPosX ); + pConf->Write( wxS( "ToolBarPosY" ), g_iToolbarPosY ); + pConf->Write( wxS( "DisplayToolbar"), g_iDisplayToolbar ); + pConf->Write( wxS( "DefaultTextPointIcon" ), g_sTextPointIconName ); + pConf->Write( wxS( "DefaultTextColour" ), g_colourDefaultTextColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultTextBackgroundColour" ), g_colourDefaultTextBackgroundColour.GetAsString( wxC2S_CSS_SYNTAX ) ); + pConf->Write( wxS( "DefaultTextBackgroundTransparency" ), g_iTextBackgroundTransparency ); + pConf->Write( wxS( "DefaultTextPosition" ), g_iTextPosition ); + pConf->Write( wxS( "DefaultTextTopOffsetX" ), g_iTextTopOffsetX ); + pConf->Write( wxS( "DefaultTextTopOffsetY" ), g_iTextTopOffsetY ); + pConf->Write( wxS( "DefaultTextBottomffsetX" ), g_iTextBottomOffsetX ); + pConf->Write( wxS( "DefaultTextBottomOffsetY" ), g_iTextBottomOffsetY ); + pConf->Write( wxS( "DefaultTextBottomNameExtraOffsetY"), g_iTextBottomNameExtraOffsetY ); + pConf->Write( wxS( "DefaultTextCenterOffsetX" ), g_iTextCentreOffsetX ); + pConf->Write( wxS( "DefaultTextCentreOffsetY" ), g_iTextCentreOffsetY ); + pConf->Write( wxS( "DefaultTextRightOffsetX" ), g_iTextRightOffsetX ); + pConf->Write( wxS( "DefaultTextRightOffsetY" ), g_iTextRightOffsetY ); + pConf->Write( wxS( "DefaultTextLeftOffsetX" ), g_iTextLeftOffsetX ); + pConf->Write( wxS( "DefaultTextLeftOffsetY" ), g_iTextLeftOffsetY ); + pConf->Write( wxS( "DefaultTextPointPointSize" ), g_DisplayTextFont.GetPointSize() ); + pConf->Write( wxS( "DefaultTextPointFontFamily" ), (int)g_DisplayTextFont.GetFamily() ); + pConf->Write( wxS( "DefaultTextPointFontStyle" ), (int)g_DisplayTextFont.GetStyle() ); + pConf->Write( wxS( "DefaultTextPointFontWeight" ), (int)g_DisplayTextFont.GetWeight() ); + pConf->Write( wxS( "DefaultTextPointFontUnderline" ), g_DisplayTextFont.GetUnderlined() ); #if wxCHECK_VERSION(3,0,0) - pConf->Write( wxS( "DefaultTextPointFontStrikethrough" ), g_DisplayTextFont.GetStrikethrough() ); + pConf->Write( wxS( "DefaultTextPointFontStrikethrough" ), g_DisplayTextFont.GetStrikethrough() ); #endif - pConf->Write( wxS( "DefaultTextPointFaceName" ), g_DisplayTextFont.GetFaceName() ); - pConf->Write( wxS( "DefaultTextPointFontEncoding" ), (int)g_DisplayTextFont.GetEncoding() ); - pConf->Write( wxS( "DefaultTextPointDisplayTextWhen"), g_iTextPointDisplayTextWhen ); - + pConf->Write( wxS( "DefaultTextPointFaceName" ), g_DisplayTextFont.GetFaceName() ); + pConf->Write( wxS( "DefaultTextPointFontEncoding" ), (int)g_DisplayTextFont.GetEncoding() ); + pConf->Write( wxS( "DefaultTextPointDisplayTextWhen"), g_iTextPointDisplayTextWhen ); + + } } #ifndef __WXMSW__