eeschema: Use system-dependent default wildcard
wxWidgets provides a system-dependent string for "*" or "*.*" depending on the system. Unfortunately, wxFormBuilder does not use this and instead defaults to the Windows-only "*.*". This is an ugly work around. Fixes: lp:1810221 * https://bugs.launchpad.net/kicad/+bug/1810221
This commit is contained in:
parent
69fc301bf3
commit
02a1bf1de6
|
@ -1,170 +1,180 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dialog_global_sym_lib_table_config.h"
|
||||
|
||||
#include <confirm.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <kiface_i.h>
|
||||
#include <lib_table_grid.h>
|
||||
#include <lib_table_lexer.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <wx/filename.h>
|
||||
|
||||
#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 )
|
||||
{
|
||||
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_filePicker1->SetFileName( wxFileName( fileName ) );
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2017-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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "dialog_global_sym_lib_table_config.h"
|
||||
|
||||
#include <confirm.h>
|
||||
#include <grid_tricks.h>
|
||||
#include <kiface_i.h>
|
||||
#include <lib_table_grid.h>
|
||||
#include <lib_table_lexer.h>
|
||||
#include <macros.h>
|
||||
|
||||
#include <wx/filename.h>
|
||||
|
||||
#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 )
|
||||
{
|
||||
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()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateFilePicker( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
aEvent.Enable( m_customRb->GetValue() );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateDefaultSelection( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
aEvent.Enable( m_defaultFileFound );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
|
||||
{
|
||||
// Create an empty table if requested by the user.
|
||||
if( m_emptyRb->GetValue() )
|
||||
{
|
||||
SYMBOL_LIB_TABLE emptyTable;
|
||||
|
||||
try
|
||||
{
|
||||
emptyTable.Save( SYMBOL_LIB_TABLE::GetGlobalTableFileName() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Error occurred writing empty symbol library table "
|
||||
"file.\n\n%s" ),
|
||||
SYMBOL_LIB_TABLE::GetGlobalTableFileName(),
|
||||
ioe.What() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString fileName = m_filePicker1->GetPath();
|
||||
|
||||
if( fileName.IsEmpty() )
|
||||
{
|
||||
DisplayError( this, _( "Please select a symbol library table file." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
wxFileName fn = fileName;
|
||||
|
||||
// Make sure the symbol library table to copy actually exists.
|
||||
if( !fn.FileExists() )
|
||||
{
|
||||
DisplayError( this,
|
||||
|
||||
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 )
|
||||
{
|
||||
aEvent.Enable( m_customRb->GetValue() );
|
||||
}
|
||||
|
||||
|
||||
void DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::onUpdateDefaultSelection( wxUpdateUIEvent& aEvent )
|
||||
{
|
||||
aEvent.Enable( m_defaultFileFound );
|
||||
}
|
||||
|
||||
|
||||
bool DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG::TransferDataFromWindow()
|
||||
{
|
||||
// Create an empty table if requested by the user.
|
||||
if( m_emptyRb->GetValue() )
|
||||
{
|
||||
SYMBOL_LIB_TABLE emptyTable;
|
||||
|
||||
try
|
||||
{
|
||||
emptyTable.Save( SYMBOL_LIB_TABLE::GetGlobalTableFileName() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Error occurred writing empty symbol library table "
|
||||
"file.\n\n%s" ),
|
||||
SYMBOL_LIB_TABLE::GetGlobalTableFileName(),
|
||||
ioe.What() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
wxString fileName = m_filePicker_new->GetPath();
|
||||
|
||||
if( fileName.IsEmpty() )
|
||||
{
|
||||
DisplayError( this, _( "Please select a symbol library table file." ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
wxFileName fn = fileName;
|
||||
|
||||
// Make sure the symbol library table to copy actually exists.
|
||||
if( !fn.FileExists() )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "File \"%s\" not found." ), fn.GetFullPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure the symbol library table to copy is a valid symbol library table file.
|
||||
SYMBOL_LIB_TABLE tmpTable;
|
||||
|
||||
try
|
||||
{
|
||||
tmpTable.Load( fn.GetFullPath() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this,
|
||||
return false;
|
||||
}
|
||||
|
||||
// Make sure the symbol library table to copy is a valid symbol library table file.
|
||||
SYMBOL_LIB_TABLE tmpTable;
|
||||
|
||||
try
|
||||
{
|
||||
tmpTable.Load( fn.GetFullPath() );
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "File \"%s\" is not a valid symbol library table "
|
||||
"file.\n\n%s" ), fn.GetFullPath(), ioe.What() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the config path if it doesn't already exist.
|
||||
wxFileName symTableFileName = SYMBOL_LIB_TABLE::GetGlobalTableFileName();
|
||||
|
||||
if( !symTableFileName.DirExists() && !symTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
|
||||
{
|
||||
DisplayError( this,
|
||||
"file.\n\n%s" ), fn.GetFullPath(), ioe.What() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create the config path if it doesn't already exist.
|
||||
wxFileName symTableFileName = SYMBOL_LIB_TABLE::GetGlobalTableFileName();
|
||||
|
||||
if( !symTableFileName.DirExists() && !symTableFileName.Mkdir( 0x777, wxPATH_MKDIR_FULL ) )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Cannot create global library table path \"%s\"." ),
|
||||
symTableFileName.GetPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Copy the global symbol library table file to the user config.
|
||||
if( !::wxCopyFile( fn.GetFullPath(), symTableFileName.GetFullPath() ) )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Cannot copy global symbol library table "
|
||||
symTableFileName.GetPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Copy the global symbol library table file to the user config.
|
||||
if( !::wxCopyFile( fn.GetFullPath(), symTableFileName.GetFullPath() ) )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Cannot copy global symbol library table "
|
||||
"file:\n\n \"%s\"\n\n:to:\n\n\"%s\"." ),
|
||||
fn.GetFullPath(), symTableFileName.GetFullPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load the successfully copied symbol library table file. This should not fail
|
||||
// since the file was tested above. Check for failure anyway to keep the compiler
|
||||
// from complaining.
|
||||
try
|
||||
{
|
||||
if( !SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE::GetGlobalLibTable() ) )
|
||||
return false;
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Error occurred loading global symbol library table:"
|
||||
"\n\n%s" ), ioe.What() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
fn.GetFullPath(), symTableFileName.GetFullPath() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
// Load the successfully copied symbol library table file. This should not fail
|
||||
// since the file was tested above. Check for failure anyway to keep the compiler
|
||||
// from complaining.
|
||||
try
|
||||
{
|
||||
if( !SYMBOL_LIB_TABLE::LoadGlobalTable( SYMBOL_LIB_TABLE::GetGlobalLibTable() ) )
|
||||
return false;
|
||||
}
|
||||
catch( const IO_ERROR& ioe )
|
||||
{
|
||||
DisplayError( this,
|
||||
wxString::Format( _( "Error occurred loading global symbol library table:"
|
||||
"\n\n%s" ), ioe.What() ) );
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,42 +1,43 @@
|
|||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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"
|
||||
|
||||
class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG : public DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE
|
||||
{
|
||||
private:
|
||||
bool m_defaultFileFound;
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
#endif // _DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_H_
|
||||
/*
|
||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 2017 Wayne Stambaugh <stambaughw@gmail.com>
|
||||
* Copyright (C) 2017 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 <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#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"
|
||||
|
||||
class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG : public DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE
|
||||
{
|
||||
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;
|
||||
};
|
||||
|
||||
#endif // _DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_H_
|
||||
|
|
|
@ -1,88 +1,87 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jul 29 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_global_sym_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 )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizer1;
|
||||
bSizer1 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
wxBoxSizer* bSizer2;
|
||||
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->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->SetValue( true );
|
||||
m_defaultRb->SetToolTip( _("Select this option if you not sure about configuring the global symbol library table") );
|
||||
|
||||
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") );
|
||||
|
||||
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") );
|
||||
|
||||
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->Wrap( -1 );
|
||||
bSizer2->Add( m_staticText2, 0, wxALL, 5 );
|
||||
|
||||
m_filePicker1 = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a file"), wxT("*.*"), wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN );
|
||||
m_filePicker1->Enable( false );
|
||||
|
||||
bSizer2->Add( m_filePicker1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizer2->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
||||
m_sdbSizer1->Realize();
|
||||
|
||||
bSizer2->Add( m_sdbSizer1, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizer1->Add( bSizer2, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizer1 );
|
||||
this->Layout();
|
||||
bSizer1->Fit( this );
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::~DIALOG_GLOBAL_SYM_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 );
|
||||
|
||||
}
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 23 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "dialog_global_sym_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 )
|
||||
{
|
||||
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
|
||||
|
||||
wxBoxSizer* bSizer1;
|
||||
bSizer1 = new wxBoxSizer( wxHORIZONTAL );
|
||||
|
||||
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->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->SetValue( true );
|
||||
m_defaultRb->SetToolTip( _("Select this option if you not sure about configuring the global symbol library table") );
|
||||
|
||||
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") );
|
||||
|
||||
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") );
|
||||
|
||||
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->Wrap( -1 );
|
||||
bSizer2->Add( m_staticText2, 0, wxALL, 5 );
|
||||
|
||||
m_filePicker1 = new wxFilePickerCtrl( this, wxID_ANY, wxEmptyString, _("Select a file"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxFLP_DEFAULT_STYLE|wxFLP_FILE_MUST_EXIST|wxFLP_OPEN );
|
||||
m_filePicker1->Enable( false );
|
||||
|
||||
bSizer2->Add( m_filePicker1, 0, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
|
||||
|
||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
||||
bSizer2->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
||||
|
||||
m_sdbSizer1 = new wxStdDialogButtonSizer();
|
||||
m_sdbSizer1OK = new wxButton( this, wxID_OK );
|
||||
m_sdbSizer1->AddButton( m_sdbSizer1OK );
|
||||
m_sdbSizer1->Realize();
|
||||
|
||||
bSizer2->Add( m_sdbSizer1, 1, wxEXPAND, 5 );
|
||||
|
||||
|
||||
bSizer1->Add( bSizer2, 1, wxALL|wxEXPAND, 5 );
|
||||
|
||||
|
||||
this->SetSizer( bSizer1 );
|
||||
this->Layout();
|
||||
bSizer1->Fit( this );
|
||||
|
||||
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 );
|
||||
}
|
||||
|
||||
DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE::~DIALOG_GLOBAL_SYM_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 );
|
||||
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,63 +1,60 @@
|
|||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Jul 29 2017)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO "NOT" EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#ifndef __DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE_H__
|
||||
#define __DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE_H__
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
class DIALOG_SHIM;
|
||||
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxStaticText* m_staticText1;
|
||||
wxRadioButton* m_defaultRb;
|
||||
wxRadioButton* m_customRb;
|
||||
wxRadioButton* m_emptyRb;
|
||||
wxStaticText* m_staticText2;
|
||||
wxFilePickerCtrl* m_filePicker1;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void onUpdateDefaultSelection( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onUpdateFilePicker( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
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();
|
||||
|
||||
};
|
||||
|
||||
#endif //__DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE_H__
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
// C++ code generated with wxFormBuilder (version Nov 23 2018)
|
||||
// http://www.wxformbuilder.org/
|
||||
//
|
||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <wx/artprov.h>
|
||||
#include <wx/xrc/xmlres.h>
|
||||
#include <wx/intl.h>
|
||||
#include "dialog_shim.h"
|
||||
#include <wx/string.h>
|
||||
#include <wx/stattext.h>
|
||||
#include <wx/gdicmn.h>
|
||||
#include <wx/font.h>
|
||||
#include <wx/colour.h>
|
||||
#include <wx/settings.h>
|
||||
#include <wx/radiobut.h>
|
||||
#include <wx/filepicker.h>
|
||||
#include <wx/statline.h>
|
||||
#include <wx/sizer.h>
|
||||
#include <wx/button.h>
|
||||
#include <wx/dialog.h>
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
/// Class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
class DIALOG_GLOBAL_SYM_LIB_TABLE_CONFIG_BASE : public DIALOG_SHIM
|
||||
{
|
||||
private:
|
||||
|
||||
protected:
|
||||
wxBoxSizer* bSizer2;
|
||||
wxStaticText* m_staticText1;
|
||||
wxRadioButton* m_defaultRb;
|
||||
wxRadioButton* m_customRb;
|
||||
wxRadioButton* m_emptyRb;
|
||||
wxStaticText* m_staticText2;
|
||||
wxFilePickerCtrl* m_filePicker1;
|
||||
wxStaticLine* m_staticline1;
|
||||
wxStdDialogButtonSizer* m_sdbSizer1;
|
||||
wxButton* m_sdbSizer1OK;
|
||||
|
||||
// Virtual event handlers, overide them in your derived class
|
||||
virtual void onUpdateDefaultSelection( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
virtual void onUpdateFilePicker( wxUpdateUIEvent& event ) { event.Skip(); }
|
||||
|
||||
|
||||
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();
|
||||
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue