diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index 1ef0850b62..33c98c74bc 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -186,6 +186,8 @@ set( COMMON_DLG_SRCS dialogs/dialog_edit_library_tables.cpp dialogs/dialog_exit_base.cpp dialogs/dialog_file_dir_picker.cpp + dialogs/dialog_global_lib_table_config.cpp + dialogs/dialog_global_lib_table_config_base.cpp dialogs/dialog_hotkey_list.cpp dialogs/dialog_image_editor.cpp dialogs/dialog_image_editor_base.cpp diff --git a/common/dialogs/dialog_global_lib_table_config.cpp b/common/dialogs/dialog_global_lib_table_config.cpp new file mode 100644 index 0000000000..b37d37fa1a --- /dev/null +++ b/common/dialogs/dialog_global_lib_table_config.cpp @@ -0,0 +1,117 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2019 Wayne Stambaugh + * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#include "dialog_global_lib_table_config.h" + +#include + + +DIALOG_GLOBAL_LIB_TABLE_CONFIG::DIALOG_GLOBAL_LIB_TABLE_CONFIG( wxWindow* aParent, + const wxString& aTableName ) : + DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE( aParent ) +{ + m_tableName = aTableName; + + wxString tmp; + + tmp.Printf( _( "Configure Global %s Library Table" ), aTableName.Capitalize() ); + SetTitle( tmp ); + + tmp.Printf( _( "KiCad has been run for the first time using the new %s library table for\n" + "accessing symbol libraries. In order for KiCad to access %s libraries,\n" + "you must configure your global %s library table. Please select from one\n" + "of the options below. If you are not sure which option to select, please\n" + "use the default selection." ), aTableName, aTableName, aTableName ); + m_staticText1->SetLabel( tmp ); + + tmp.Printf( _( "Copy default global %s library table (recommended)"), aTableName ); + m_defaultRb->SetLabel( tmp ); + tmp.Printf( _( "Select this option if you not sure about configuring the global %s library " + "table" ), aTableName ); + m_defaultRb->SetToolTip( tmp ); + + tmp.Printf( _( "Copy custom global %s library table" ), aTableName ); + m_customRb->SetLabel( tmp ); + tmp.Printf( _( "Select this option to copy a %s library table file other than the default" ), + aTableName ); + m_customRb->SetToolTip( tmp ); + + tmp.Printf( _( "Create an empty global %s library table" ), aTableName ); + m_emptyRb->SetLabel( tmp ); + tmp.Printf( _( "Select this option to define %s libraries in project specific library tables" ), + aTableName ); + m_emptyRb->SetToolTip( tmp ); + + tmp.Printf( _( "Select global %symbol library table file:" ), aTableName ); + m_staticText2->SetLabel( tmp ); + + m_filePicker1->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_LIB_TABLE_CONFIG::onUpdateFilePicker ), NULL, this ); + + wxButton* okButton = (wxButton *) FindWindowById( wxID_OK ); + + if( okButton ) + okButton->SetDefault(); + + FinishDialogSettings(); +} + + +DIALOG_GLOBAL_LIB_TABLE_CONFIG::~DIALOG_GLOBAL_LIB_TABLE_CONFIG() +{ + m_filePicker1->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_LIB_TABLE_CONFIG::onUpdateFilePicker ), NULL, this ); +} + + +void DIALOG_GLOBAL_LIB_TABLE_CONFIG::onUpdateFilePicker( wxUpdateUIEvent& aEvent ) +{ + aEvent.Enable( m_customRb->GetValue() ); +} + + +void DIALOG_GLOBAL_LIB_TABLE_CONFIG::onUpdateDefaultSelection( wxUpdateUIEvent& aEvent ) +{ + aEvent.Enable( m_defaultFileFound ); +} + + +bool DIALOG_GLOBAL_LIB_TABLE_CONFIG::TransferDataToWindow() +{ + if( !wxDialog::TransferDataToWindow() ) + return false; + + wxFileName fn = GetGlobalTableFileName(); + + // Attempt to find the default global file table from the KiCad template folder. + wxString fileName = Kiface().KifaceSearch().FindValidPath( fn.GetName() ); + + m_defaultFileFound = wxFileName::FileExists( fileName ); + + if( m_defaultFileFound ) + { + m_filePicker1->SetFileName( wxFileName( fileName ) ); + m_filePicker1->Enable( false ); + } + else + { + m_customRb->SetValue( true ); + } + + return true; +} diff --git a/common/dialogs/dialog_global_lib_table_config.h b/common/dialogs/dialog_global_lib_table_config.h new file mode 100644 index 0000000000..b75ff9e945 --- /dev/null +++ b/common/dialogs/dialog_global_lib_table_config.h @@ -0,0 +1,47 @@ +/* + * This program source code file is part of KiCad, a free EDA CAD application. + * + * Copyright (C) 2019 Wayne Stambaugh + * Copyright (C) 2019 KiCad Developers, see AUTHORS.txt for contributors. + * + * This program is free software: you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the + * Free Software Foundation, either version 3 of the License, or (at your + * option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program. If not, see . + */ + +#ifndef _DIALOG_GLOBAL_LIB_TABLE_CONFIG_H_ +#define _DIALOG_GLOBAL_LIB_TABLE_CONFIG_H_ + +#include "dialog_global_lib_table_config_base.h" + +#include + + +class DIALOG_GLOBAL_LIB_TABLE_CONFIG : public DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE +{ +public: + DIALOG_GLOBAL_LIB_TABLE_CONFIG( wxWindow* aParent, const wxString& aTableName ); + virtual ~DIALOG_GLOBAL_LIB_TABLE_CONFIG(); + + virtual wxFileName GetGlobalTableFileName() = 0; + + virtual bool TransferDataToWindow() override; + +protected: + virtual void onUpdateFilePicker( wxUpdateUIEvent& aEvent ) override; + virtual void onUpdateDefaultSelection( wxUpdateUIEvent& aEvent ) override; + + wxString m_tableName; + bool m_defaultFileFound; +}; + +#endif // _DIALOG_GLOBAL_LIB_TABLE_CONFIG_H_ diff --git a/eeschema/dialogs/dialog_global_sym_lib_table_config_base.cpp b/common/dialogs/dialog_global_lib_table_config_base.cpp similarity index 50% rename from eeschema/dialogs/dialog_global_sym_lib_table_config_base.cpp rename to common/dialogs/dialog_global_lib_table_config_base.cpp index fa3c8e6df9..c6875128bd 100644 --- a/eeschema/dialogs/dialog_global_sym_lib_table_config_base.cpp +++ b/common/dialogs/dialog_global_lib_table_config_base.cpp @@ -1,15 +1,15 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 23 2018) +// C++ code generated with wxFormBuilder (version Jan 5 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! /////////////////////////////////////////////////////////////////////////// -#include "dialog_global_sym_lib_table_config_base.h" +#include "dialog_global_lib_table_config_base.h" /////////////////////////////////////////////////////////////////////////// -DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) +DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE::DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : DIALOG_SHIM( parent, id, title, pos, size, style ) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); @@ -18,33 +18,33 @@ DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE bSizer2 = new wxBoxSizer( wxVERTICAL ); - m_staticText1 = new wxStaticText( this, wxID_ANY, _("KiCad has been run for the first time using the new symbol library table for accessing symbol libraries. In order for KiCad to access symbol libraries, you must configure your global symbol library table. Please select from one of the options below. If you are not sure which option to select, please use the default selection."), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText1 = new wxStaticText( this, wxID_ANY, _("Temp"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText1->Wrap( 500 ); bSizer2->Add( m_staticText1, 0, wxALL, 5 ); bSizer2->Add( 0, 0, 0, wxALL|wxEXPAND, 5 ); - m_defaultRb = new wxRadioButton( this, wxID_ANY, _("Copy default global symbol library table (recommended)"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); + m_defaultRb = new wxRadioButton( this, wxID_ANY, _("temp1"), wxDefaultPosition, wxDefaultSize, wxRB_GROUP ); m_defaultRb->SetValue( true ); - m_defaultRb->SetToolTip( _("Select this option if you not sure about configuring the global symbol library table") ); + m_defaultRb->SetToolTip( _("Temp") ); bSizer2->Add( m_defaultRb, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - m_customRb = new wxRadioButton( this, wxID_ANY, _("Copy custom global symbol library table"), wxDefaultPosition, wxDefaultSize, 0 ); - m_customRb->SetToolTip( _("Select this option to copy a symbol library table file other than the default") ); + m_customRb = new wxRadioButton( this, wxID_ANY, _("temp2"), wxDefaultPosition, wxDefaultSize, 0 ); + m_customRb->SetToolTip( _("Temp") ); bSizer2->Add( m_customRb, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); - m_emptyRb = new wxRadioButton( this, wxID_ANY, _("Create an empty global symbol library table"), wxDefaultPosition, wxDefaultSize, 0 ); - m_emptyRb->SetToolTip( _("Select this option to define symbol libraries in project specific library tables") ); + m_emptyRb = new wxRadioButton( this, wxID_ANY, _("temp3"), wxDefaultPosition, wxDefaultSize, 0 ); + m_emptyRb->SetToolTip( _("Temp") ); bSizer2->Add( m_emptyRb, 0, wxBOTTOM|wxLEFT|wxRIGHT, 5 ); bSizer2->Add( 0, 0, 0, wxALL|wxEXPAND, 5 ); - m_staticText2 = new wxStaticText( this, wxID_ANY, _("Select global symbol library table file:"), wxDefaultPosition, wxDefaultSize, 0 ); + m_staticText2 = new wxStaticText( this, wxID_ANY, _("temp"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText2->Wrap( -1 ); bSizer2->Add( m_staticText2, 0, wxALL, 5 ); @@ -74,14 +74,14 @@ DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE this->Centre( wxBOTH ); // Connect Events - m_defaultRb->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::onUpdateDefaultSelection ), NULL, this ); - m_filePicker1->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::onUpdateFilePicker ), NULL, this ); + m_defaultRb->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE::onUpdateDefaultSelection ), NULL, this ); + m_filePicker1->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE::onUpdateFilePicker ), NULL, this ); } -DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::~DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE() +DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE::~DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE() { // Disconnect Events - m_defaultRb->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::onUpdateDefaultSelection ), NULL, this ); - m_filePicker1->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::onUpdateFilePicker ), NULL, this ); + m_defaultRb->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE::onUpdateDefaultSelection ), NULL, this ); + m_filePicker1->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE::onUpdateFilePicker ), NULL, this ); } diff --git a/eeschema/dialogs/dialog_global_sym_lib_table_config_base.fbp b/common/dialogs/dialog_global_lib_table_config_base.fbp similarity index 93% rename from eeschema/dialogs/dialog_global_sym_lib_table_config_base.fbp rename to common/dialogs/dialog_global_lib_table_config_base.fbp index ecafff4bc3..a231f0f4dc 100644 --- a/eeschema/dialogs/dialog_global_sym_lib_table_config_base.fbp +++ b/common/dialogs/dialog_global_lib_table_config_base.fbp @@ -11,12 +11,12 @@ res UTF-8 connect - dialog_global_sym_lib_table_config_base + dialog_global_lib_table_config_base 1000 none 1 - DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE + DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE . @@ -43,12 +43,12 @@ wxID_ANY - DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE + DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE wxCAPTION|wxRESIZE_BORDER DIALOG_SHIM; dialog_shim.h - Configure Global Symbol Library Table + Configure Global Library Table @@ -58,20 +58,20 @@ bSizer1 wxHORIZONTAL none - + 5 wxALL|wxEXPAND 1 - + bSizer2 wxVERTICAL protected - + 5 wxALL 0 - + 1 1 1 @@ -99,7 +99,7 @@ 0 0 wxID_ANY - KiCad has been run for the first time using the new symbol library table for accessing symbol libraries. In order for KiCad to access symbol libraries, you must configure your global symbol library table. Please select from one of the options below. If you are not sure which option to select, please use the default selection. + Temp 0 0 @@ -128,21 +128,21 @@ 500 - + 5 wxALL|wxEXPAND 0 - + 0 protected 0 - + 5 wxBOTTOM|wxLEFT|wxRIGHT 0 - + 1 1 1 @@ -170,7 +170,7 @@ 0 0 wxID_ANY - Copy default global symbol library table (recommended) + temp1 0 @@ -191,7 +191,7 @@ wxRB_GROUP 0 - Select this option if you not sure about configuring the global symbol library table + Temp wxFILTER_NONE wxDefaultValidator @@ -203,11 +203,11 @@ onUpdateDefaultSelection - + 5 wxBOTTOM|wxLEFT|wxRIGHT 0 - + 1 1 1 @@ -235,7 +235,7 @@ 0 0 wxID_ANY - Copy custom global symbol library table + temp2 0 @@ -256,7 +256,7 @@ 0 - Select this option to copy a symbol library table file other than the default + Temp wxFILTER_NONE wxDefaultValidator @@ -267,11 +267,11 @@ - + 5 wxBOTTOM|wxLEFT|wxRIGHT 0 - + 1 1 1 @@ -299,7 +299,7 @@ 0 0 wxID_ANY - Create an empty global symbol library table + temp3 0 @@ -320,7 +320,7 @@ 0 - Select this option to define symbol libraries in project specific library tables + Temp wxFILTER_NONE wxDefaultValidator @@ -331,21 +331,21 @@ - + 5 wxALL|wxEXPAND 0 - + 0 protected 0 - + 5 wxALL 0 - + 1 1 1 @@ -373,7 +373,7 @@ 0 0 wxID_ANY - Select global symbol library table file: + temp 0 0 @@ -402,11 +402,11 @@ -1 - + 5 wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT 0 - + 1 1 1 @@ -468,11 +468,11 @@ onUpdateFilePicker - + 5 wxEXPAND | wxALL 0 - + 1 1 1 @@ -526,11 +526,11 @@ - + 5 wxEXPAND 1 - + 0 0 0 diff --git a/eeschema/dialogs/dialog_global_sym_lib_table_config_base.h b/common/dialogs/dialog_global_lib_table_config_base.h similarity index 74% rename from eeschema/dialogs/dialog_global_sym_lib_table_config_base.h rename to common/dialogs/dialog_global_lib_table_config_base.h index 4029392dd6..4d9a6c6afc 100644 --- a/eeschema/dialogs/dialog_global_sym_lib_table_config_base.h +++ b/common/dialogs/dialog_global_lib_table_config_base.h @@ -1,5 +1,5 @@ /////////////////////////////////////////////////////////////////////////// -// C++ code generated with wxFormBuilder (version Nov 23 2018) +// C++ code generated with wxFormBuilder (version Jan 5 2019) // http://www.wxformbuilder.org/ // // PLEASE DO *NOT* EDIT THIS FILE! @@ -28,9 +28,9 @@ /////////////////////////////////////////////////////////////////////////////// -/// Class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE +/// Class DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE /////////////////////////////////////////////////////////////////////////////// -class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE : public DIALOG_SHIM +class DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE : public DIALOG_SHIM { private: @@ -53,8 +53,8 @@ class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE : public DIALOG_SHIM public: - DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure Global Symbol Library Table"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER ); - ~DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE(); + DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("Configure Global Library Table"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxCAPTION|wxRESIZE_BORDER ); + ~DIALOG_GLOBAL_LIB_TABLE_CONFIG_BASE(); }; diff --git a/eeschema/CMakeLists.txt b/eeschema/CMakeLists.txt index 20ecae6ad1..d79f95c60f 100644 --- a/eeschema/CMakeLists.txt +++ b/eeschema/CMakeLists.txt @@ -54,7 +54,6 @@ set( EESCHEMA_DLGS dialogs/dialog_erc.cpp dialogs/dialog_erc_base.cpp dialogs/dialog_global_sym_lib_table_config.cpp - dialogs/dialog_global_sym_lib_table_config_base.cpp dialogs/dialog_lib_edit_draw_item.cpp dialogs/dialog_lib_edit_draw_item_base.cpp dialogs/dialog_lib_edit_pin.cpp diff --git a/eeschema/dialogs/dialog_global_sym_lib_table_config.cpp b/eeschema/dialogs/dialog_global_sym_lib_table_config.cpp index 7c31d1d880..a2965d9635 100644 --- a/eeschema/dialogs/dialog_global_sym_lib_table_config.cpp +++ b/eeschema/dialogs/dialog_global_sym_lib_table_config.cpp @@ -21,64 +21,26 @@ #include "dialog_global_sym_lib_table_config.h" #include -#include #include -#include -#include #include -#include - #include "symbol_lib_table.h" DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG( wxWindow* aParent ) : - DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE( aParent ) + DIALOG_GLOBAL_LIB_TABLE_CONFIG( aParent, "symbol" ) { - wxFileName fn = SYMBOL_LIB_TABLE::GetGlobalTableFileName(); - - // Attempt to find the default global file table from the KiCad template folder. - wxString fileName = Kiface().KifaceSearch().FindValidPath( fn.GetName() ); - - m_defaultFileFound = wxFileName::FileExists( fileName ); - - m_filePicker_new = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _( "Select a file" ), - wxFileSelectorDefaultWildcardStr, wxDefaultPosition, wxDefaultSize, - wxFLP_DEFAULT_STYLE | wxFLP_FILE_MUST_EXIST | wxFLP_OPEN ); - m_filePicker_new->SetFileName( wxFileName( fileName ) ); - m_filePicker_new->Enable( false ); - m_filePicker_new->Connect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateFilePicker ), NULL, this ); - - bSizer2->Replace( m_filePicker1, m_filePicker_new, true ); - bSizer2->Layout(); - - if( !m_defaultFileFound ) - m_customRb->SetValue( true ); - - wxButton* okButton = (wxButton *) FindWindowById( wxID_OK ); - - if( okButton ) - okButton->SetDefault(); - - FinishDialogSettings(); } DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::~DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG() { - m_filePicker_new->Disconnect( wxEVT_UPDATE_UI, wxUpdateUIEventHandler( DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateFilePicker ), NULL, this ); } -void DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateFilePicker( wxUpdateUIEvent& aEvent ) +wxFileName DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::GetGlobalTableFileName() { - aEvent.Enable( m_customRb->GetValue() ); -} - - -void DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateDefaultSelection( wxUpdateUIEvent& aEvent ) -{ - aEvent.Enable( m_defaultFileFound ); + return SYMBOL_LIB_TABLE::GetGlobalTableFileName(); } @@ -106,7 +68,7 @@ bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow() return true; } - wxString fileName = m_filePicker_new->GetPath(); + wxString fileName = m_filePicker1->GetPath(); if( fileName.IsEmpty() ) { diff --git a/eeschema/dialogs/dialog_global_sym_lib_table_config.h b/eeschema/dialogs/dialog_global_sym_lib_table_config.h index 431e8c4366..86aeec0f24 100644 --- a/eeschema/dialogs/dialog_global_sym_lib_table_config.h +++ b/eeschema/dialogs/dialog_global_sym_lib_table_config.h @@ -21,23 +21,18 @@ #ifndef _DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_H_ #define _DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_H_ -#include "dialog_global_sym_lib_table_config_base.h" +#include "dialog_global_lib_table_config.h" -class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG : public DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE + +class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG : public DIALOG_GLOBAL_LIB_TABLE_CONFIG { -private: - bool m_defaultFileFound; - wxFilePickerCtrl* m_filePicker_new; - public: DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG( wxWindow* aParent ); virtual ~DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG(); bool TransferDataFromWindow() override; -protected: - virtual void onUpdateFilePicker( wxUpdateUIEvent& aEvent ) override; - virtual void onUpdateDefaultSelection( wxUpdateUIEvent& aEvent ) override; + virtual wxFileName GetGlobalTableFileName() override; }; #endif // _DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_H_