eeschema: Simplify netlist dialog
The default filename textbox confusingly could not be edited and the checkbox for "Use default filename" would also use a default location. As the netlist export is no longer required in the workflow, we can simplify the layout to always show the user the file save dialog allowing them to choose the location and name of the exported netlist file.
This commit is contained in:
parent
419718b596
commit
31ab4e6c9a
|
@ -172,11 +172,6 @@ private:
|
||||||
*/
|
*/
|
||||||
void WriteCurrentNetlistSetup();
|
void WriteCurrentNetlistSetup();
|
||||||
|
|
||||||
bool GetUseDefaultNetlistName()
|
|
||||||
{
|
|
||||||
return m_cbUseDefaultNetlistName->IsChecked();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Function UserNetlistTypeName
|
* Function UserNetlistTypeName
|
||||||
* to retrieve user netlist type names
|
* to retrieve user netlist type names
|
||||||
|
@ -314,7 +309,6 @@ NETLIST_DIALOG::NETLIST_DIALOG( SCH_EDIT_FRAME* parent ) :
|
||||||
|
|
||||||
long tmp;
|
long tmp;
|
||||||
m_config->Read( NETLIST_USE_DEFAULT_NETNAME, &tmp, 0l );
|
m_config->Read( NETLIST_USE_DEFAULT_NETNAME, &tmp, 0l );
|
||||||
m_cbUseDefaultNetlistName->SetValue( tmp );
|
|
||||||
m_NetFmtName = m_Parent->GetNetListFormatName();
|
m_NetFmtName = m_Parent->GetNetListFormatName();
|
||||||
|
|
||||||
for( int ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
|
for( int ii = 0; ii < PANELCUSTOMBASE + CUSTOMPANEL_COUNTMAX; ii++ )
|
||||||
|
@ -508,18 +502,6 @@ void NETLIST_DIALOG::OnNetlistTypeSelection( wxNotebookEvent& event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
m_buttonDelPlugin->Enable( currPage->m_IdNetType >= NET_TYPE_CUSTOM1 );
|
m_buttonDelPlugin->Enable( currPage->m_IdNetType >= NET_TYPE_CUSTOM1 );
|
||||||
m_cbUseDefaultNetlistName->Enable( currPage->m_IdNetType < NET_TYPE_CUSTOM1 );
|
|
||||||
|
|
||||||
wxString fileExt;
|
|
||||||
|
|
||||||
if( FilenamePrms( currPage->m_IdNetType, &fileExt, NULL ) )
|
|
||||||
{
|
|
||||||
wxFileName fn = g_RootSheet->GetScreen()->GetFileName();
|
|
||||||
fn.SetExt( fileExt );
|
|
||||||
m_textCtrlDefaultFileName->SetValue( fn.GetFullName() );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
m_textCtrlDefaultFileName->Clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -597,9 +579,6 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
|
||||||
fn.SetPath( wxPathOnly( Prj().GetProjectFullName() ) );
|
fn.SetPath( wxPathOnly( Prj().GetProjectFullName() ) );
|
||||||
|
|
||||||
wxString fullpath = fn.GetFullPath();
|
wxString fullpath = fn.GetFullPath();
|
||||||
|
|
||||||
if( !GetUseDefaultNetlistName() || currPage->m_IdNetType >= NET_TYPE_CUSTOM1 )
|
|
||||||
{
|
|
||||||
wxString fullname = fn.GetFullName();
|
wxString fullname = fn.GetFullName();
|
||||||
wxString path = fn.GetPath();
|
wxString path = fn.GetPath();
|
||||||
|
|
||||||
|
@ -610,7 +589,6 @@ void NETLIST_DIALOG::GenNetlist( wxCommandEvent& event )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
fullpath = dlg.GetPath(); // directory + filename
|
fullpath = dlg.GetPath(); // directory + filename
|
||||||
}
|
|
||||||
|
|
||||||
m_Parent->ClearMsgPanel();
|
m_Parent->ClearMsgPanel();
|
||||||
|
|
||||||
|
@ -710,8 +688,6 @@ void NETLIST_DIALOG::WriteCurrentNetlistSetup()
|
||||||
|
|
||||||
NetlistUpdateOpt();
|
NetlistUpdateOpt();
|
||||||
|
|
||||||
m_config->Write( NETLIST_USE_DEFAULT_NETNAME, GetUseDefaultNetlistName() );
|
|
||||||
|
|
||||||
// Update existing custom pages
|
// Update existing custom pages
|
||||||
int jj = 0;
|
int jj = 0;
|
||||||
for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ )
|
for( int ii = 0; ii < CUSTOMPANEL_COUNTMAX; ii++ )
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
// C++ code generated with wxFormBuilder (version Nov 23 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
|
@ -55,11 +55,8 @@ NETLIST_DIALOG_BASE::NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const
|
||||||
m_buttonDelPlugin = new wxButton( this, ID_DEL_PLUGIN, _("Remove Plugin..."), wxDefaultPosition, wxDefaultSize, 0 );
|
m_buttonDelPlugin = new wxButton( this, ID_DEL_PLUGIN, _("Remove Plugin..."), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
bLeftSizer->Add( m_buttonDelPlugin, 0, wxALL|wxEXPAND, 5 );
|
bLeftSizer->Add( m_buttonDelPlugin, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
|
|
||||||
bLeftSizer->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
|
|
||||||
|
|
||||||
m_cbUseDefaultNetlistName = new wxCheckBox( this, wxID_ANY, _("Use default netname"), wxDefaultPosition, wxDefaultSize, 0 );
|
bLeftSizer->Add( 0, 0, 1, wxBOTTOM, 10 );
|
||||||
bLeftSizer->Add( m_cbUseDefaultNetlistName, 0, wxALL, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 );
|
bUpperSizer->Add( bLeftSizer, 2, wxEXPAND, 5 );
|
||||||
|
@ -67,13 +64,6 @@ NETLIST_DIALOG_BASE::NETLIST_DIALOG_BASE( wxWindow* parent, wxWindowID id, const
|
||||||
|
|
||||||
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
bMainSizer->Add( bUpperSizer, 1, wxEXPAND, 5 );
|
||||||
|
|
||||||
m_staticTextDefaultFN = new wxStaticText( this, wxID_ANY, _("Default Netlist Filename:"), wxDefaultPosition, wxDefaultSize, 0 );
|
|
||||||
m_staticTextDefaultFN->Wrap( -1 );
|
|
||||||
bMainSizer->Add( m_staticTextDefaultFN, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
|
|
||||||
|
|
||||||
m_textCtrlDefaultFileName = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY );
|
|
||||||
bMainSizer->Add( m_textCtrlDefaultFileName, 0, wxEXPAND|wxBOTTOM|wxRIGHT|wxLEFT, 5 );
|
|
||||||
|
|
||||||
|
|
||||||
this->SetSizer( bMainSizer );
|
this->SetSizer( bMainSizer );
|
||||||
this->Layout();
|
this->Layout();
|
||||||
|
@ -125,6 +115,7 @@ NETLIST_DIALOG_ADD_PLUGIN_BASE::NETLIST_DIALOG_ADD_PLUGIN_BASE( wxWindow* parent
|
||||||
bSizerRight = new wxBoxSizer( wxVERTICAL );
|
bSizerRight = new wxBoxSizer( wxVERTICAL );
|
||||||
|
|
||||||
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
m_buttonOK = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
|
||||||
|
|
||||||
m_buttonOK->SetDefault();
|
m_buttonOK->SetDefault();
|
||||||
bSizerRight->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 );
|
bSizerRight->Add( m_buttonOK, 0, wxALL|wxEXPAND, 5 );
|
||||||
|
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,12 +1,11 @@
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
// C++ code generated with wxFormBuilder (version Dec 30 2017)
|
// C++ code generated with wxFormBuilder (version Nov 23 2018)
|
||||||
// http://www.wxformbuilder.org/
|
// http://www.wxformbuilder.org/
|
||||||
//
|
//
|
||||||
// PLEASE DO *NOT* EDIT THIS FILE!
|
// PLEASE DO *NOT* EDIT THIS FILE!
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
#ifndef __DIALOG_NETLIST_BASE_H__
|
#pragma once
|
||||||
#define __DIALOG_NETLIST_BASE_H__
|
|
||||||
|
|
||||||
#include <wx/artprov.h>
|
#include <wx/artprov.h>
|
||||||
#include <wx/xrc/xmlres.h>
|
#include <wx/xrc/xmlres.h>
|
||||||
|
@ -19,12 +18,13 @@
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <wx/string.h>
|
#include <wx/string.h>
|
||||||
#include <wx/sizer.h>
|
#include <wx/sizer.h>
|
||||||
|
#include <wx/bitmap.h>
|
||||||
|
#include <wx/image.h>
|
||||||
|
#include <wx/icon.h>
|
||||||
#include <wx/button.h>
|
#include <wx/button.h>
|
||||||
#include <wx/statline.h>
|
#include <wx/dialog.h>
|
||||||
#include <wx/checkbox.h>
|
|
||||||
#include <wx/stattext.h>
|
#include <wx/stattext.h>
|
||||||
#include <wx/textctrl.h>
|
#include <wx/textctrl.h>
|
||||||
#include <wx/dialog.h>
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
@ -58,10 +58,6 @@ class NETLIST_DIALOG_BASE : public DIALOG_SHIM
|
||||||
wxButton* m_buttonCancel;
|
wxButton* m_buttonCancel;
|
||||||
wxButton* m_buttonAddPlugin;
|
wxButton* m_buttonAddPlugin;
|
||||||
wxButton* m_buttonDelPlugin;
|
wxButton* m_buttonDelPlugin;
|
||||||
wxStaticLine* m_staticline1;
|
|
||||||
wxCheckBox* m_cbUseDefaultNetlistName;
|
|
||||||
wxStaticText* m_staticTextDefaultFN;
|
|
||||||
wxTextCtrl* m_textCtrlDefaultFileName;
|
|
||||||
|
|
||||||
// Virtual event handlers, overide them in your derived class
|
// Virtual event handlers, overide them in your derived class
|
||||||
virtual void OnNetlistTypeSelection( wxNotebookEvent& event ) { event.Skip(); }
|
virtual void OnNetlistTypeSelection( wxNotebookEvent& event ) { event.Skip(); }
|
||||||
|
@ -119,4 +115,3 @@ class NETLIST_DIALOG_ADD_PLUGIN_BASE : public DIALOG_SHIM
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif //__DIALOG_NETLIST_BASE_H__
|
|
||||||
|
|
Loading…
Reference in New Issue