Commit c58c388a authored by Wayne Stambaugh's avatar Wayne Stambaugh

Add PCBNew setting to remember last net list read and other minor fixes.

* PCBNew remembers last net list read during the current editing session
  as well as between project editing sessions.  Closes bug 576902.
* Separate PCBNew application settings from project file settings and
  allocate them dynamically instead of statically to make it easier to
  eliminate global variables.
parent 5849675a
......@@ -78,8 +78,9 @@ GerbView
* Add excellon2 drill file support (small good library)
* Fix the polygon bug.
* Switch to use ZONE instead of SEGZONE for polygons.
* Separate application settings and project configuration settings by converting
static list of parameters in gerbview_config.h to dynamically created lists of
settings. See eeschema/eeschema_config.cpp for an example.
......
......@@ -8,6 +8,7 @@
#include "wxstruct.h"
#include "base_struct.h"
#include "param_config.h"
#ifndef PCB_INTERNAL_UNIT
#define PCB_INTERNAL_UNIT 10000
......@@ -39,8 +40,7 @@ class PCB_LAYER_WIDGET;
/**
* @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and
*gerbview
* @info see also class WinEDA_BasePcbFrame: Basic class for pcbnew and gerbview.
*/
......@@ -57,6 +57,11 @@ protected:
DRC* m_drc; ///< the DRC controller, see drc.cpp
PARAM_CFG_ARRAY m_projectFileParams; ///< List of PCBNew project file settings.
PARAM_CFG_ARRAY m_configSettings; ///< List of PCBNew configuration settings.
wxString m_lastNetListRead; ///< Last net list read with relative path.
// we'll use lower case function names for private member functions.
void createPopUpMenuForZones( ZONE_CONTAINER* edge_zone, wxMenu* aPopMenu );
void createPopUpMenuForFootprints( MODULE* aModule, wxMenu* aPopMenu );
......@@ -157,7 +162,7 @@ public:
*/
virtual void PrintPage( wxDC* aDC, bool aPrint_Sheet_Ref,
int aPrintMask, bool aPrintMirrorMode,
void * aData = NULL);
void * aData = NULL );
void GetKicadAbout( wxCommandEvent& event );
......@@ -168,7 +173,7 @@ public:
/** Function SetGridVisibility() , virtual
* It may be overloaded by derived classes
* if you want to store/retrieve the grid visiblity in configuration.
* if you want to store/retrieve the grid visibility in configuration.
* @param aVisible = true if the grid must be shown
*/
virtual void SetGridVisibility(bool aVisible);
......@@ -186,16 +191,67 @@ public:
// Configurations:
void InstallConfigFrame( const wxPoint& pos );
void Process_Config( wxCommandEvent& event );
void Update_config( wxWindow* displayframe );
/** Function Read_Config
* Read the project configuration file
* @param projectFileName = the config filename
* if not found use kicad.pro
* if not found : initialize default values
* @return true if the current config is modified, false if no change
PARAM_CFG_ARRAY& GetProjectFileParameters();
void SaveProjectSettings();
/**
* Load the project file configuration settings.
*
* @param aProjectFileName = The project filename.
* if not found use kicad.pro and initialize default values
* @return always returns true.
*/
bool LoadProjectSettings( const wxString& aProjectFileName );
/**
* Get the list of application specific settings.
*
* @return - Reference to the list of applications settings.
*/
PARAM_CFG_ARRAY& GetConfigurationSettings();
/**
* Load applications settings specific to PCBNew.
*
* This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to
* handle settings specific common to the PCB layout application. It
* calls down to the base class to load settings common to all PCB type
* drawing frames. Please put your application settings for PCBNew here
* to avoid having application settings loaded all over the place.
*/
virtual void LoadSettings();
/**
* Save applications settings common to PCBNew.
*
* This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to
* save settings specific to the PCB layout application main window. It
* calls down to the base class to save settings common to all PCB type
* drawing frames. Please put your application settings for PCBNew here
* to avoid having application settings saved all over the place.
*/
bool Read_Config( const wxString& projectFileName );
virtual void SaveSettings();
/**
* Get the last net list read with the net list dialog box.
*
* @return - Absolute path and file name of the last net list file successfully read.
*/
wxString GetLastNetListRead();
/**
* Set the last net list successfully read by the net list dialog box.
*
* Note: the file path is converted to a path relative to the project file path. If
* the path cannot be made relative, than m_lastNetListRead is set to and empty
* string. This could happen when the net list file is on a different drive than
* the project file. The advantage of relative paths is that is more likely to
* work when opening the same project from both Windows and Linux.
*
* @param aNetListFile - The last net list file with full path successfully read.
*/
void SetLastNetListRead( const wxString& aNetListFile );
void OnHotKey( wxDC* DC,
int hotkey,
......@@ -287,7 +343,7 @@ public:
* Function OnRightClick
* populates a popup menu with the choices appropriate for the current
*context.
* The caller will add the ZOOM menu choices afterwards.
* The caller will add the ZOOM menu choices afterward.
* @param aMousePos The current mouse position
* @param aPopMenu The menu to add to.
*/
......@@ -331,7 +387,7 @@ public:
* @param aRedoCommand = a bool: true for redo, false for undo
* @param aRebuildRatsnet = a bool: true to rebuild ratsnet (normal use),
* false
* to just retrieve las state (used in abort commands that do not need to
* to just retrieve last state (used in abort commands that do not need to
* rebuild ratsnest)
*/
void PutDataInPreviousState( PICKED_ITEMS_LIST* aList,
......@@ -420,7 +476,7 @@ public:
void SetToolbars();
void Process_Settings( wxCommandEvent& event );
void InstallPcbOptionsFrame( int id );
void OnConfigurePcbOptions( wxCommandEvent& aEvent );
void InstallDisplayOptionsDialog( wxCommandEvent& aEvent );
void InstallPcbGlobalDeleteFrame( const wxPoint& pos );
......@@ -963,28 +1019,6 @@ public:
void Begin_Self( wxDC* DC );
MODULE* Genere_Self( wxDC* DC );
/**
* Load applications settings specific to the PCBNew.
*
* This overrides the base class WinEDA_BasePcbFrame::LoadSettings() to
* handle settings specific common to the PCB layout application. It
* calls down to the base class to load settings common to all PCB type
* drawing frames. Please put your application settings for PCBNew here
* to avoid having application settings loaded all over the place.
*/
virtual void LoadSettings();
/**
* Save applications settings common to PCB draw frame objects.
*
* This overrides the base class WinEDA_BasePcbFrame::SaveSettings() to
* save settings specific to the PCB layout application main window. It
* calls down to the base class to save settings common to all PCB type
* drawing frames. Please put your application settings for PCBNew here
* to avoid having application settings saved all over the place.
*/
virtual void SaveSettings();
/** function SetLanguage
* called on a language menu selection
*/
......
......@@ -99,7 +99,7 @@ void Dialog_GeneralOptions::OnOkClick( wxCommandEvent& event )
g_MagneticPadOption = m_MagneticPadOptCtrl->GetSelection();
g_MagneticTrackOption = m_MagneticTrackOptCtrl->GetSelection();
EndModal( 1 );
EndModal( wxID_OK );
}
......
......@@ -16,21 +16,11 @@
extern int g_DrawDefaultLineThickness;
void WinEDA_PcbFrame::InstallPcbOptionsFrame( int id )
void WinEDA_PcbFrame::OnConfigurePcbOptions( wxCommandEvent& aEvent )
{
switch( id )
{
case ID_PCB_DRAWINGS_WIDTHS_SETUP:
{
DIALOG_GRAPHIC_ITEMS_OPTIONS dlg( this );
dlg.ShowModal();
}
break;
default:
wxMessageBox( wxT( "InstallPcbOptionsFrame() id error" ) );
break;
}
dlg.ShowModal();
}
......@@ -143,7 +133,7 @@ void DIALOG_GRAPHIC_ITEMS_OPTIONS::OnOkClick( wxCommandEvent& event )
if( g_DrawDefaultLineThickness < 0 )
g_DrawDefaultLineThickness = 0;
EndModal( 1 );
EndModal( wxID_OK );
}
......
......@@ -18,14 +18,18 @@ extern void TestFor_Duplicate_Missing_And_Extra_Footprints( wxWindow* fram
/*************************************************************************/
void WinEDA_PcbFrame::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
/*************************************************************************/
{
/* Setup the default netlist file name according to the board file name */
wxFileName fn = GetScreen()->m_FileName;
/* Setup the netlist file name to the last net list file read or the board file
* name if no last file read is not set.
*/
wxFileName fn = GetLastNetListRead();
if( !fn.FileExists() )
{
fn = GetScreen()->m_FileName;
fn.SetExt( NetExtBuffer );
}
DIALOG_NETLIST frame( this, DC, fn.GetFullPath() );
......@@ -33,12 +37,13 @@ void WinEDA_PcbFrame::InstallNetlistFrame( wxDC* DC, const wxPoint& pos )
}
DIALOG_NETLIST::DIALOG_NETLIST( WinEDA_PcbFrame* aParent, wxDC * aDC, const wxString & aNetlistFull_Filename )
: DIALOG_NETLIST_FBP(aParent)
DIALOG_NETLIST::DIALOG_NETLIST( WinEDA_PcbFrame* aParent, wxDC * aDC,
const wxString & aNetlistFull_Filename )
: DIALOG_NETLIST_FBP( aParent )
{
m_Parent = aParent;
m_DC = aDC;
m_NetlistFilenameCtrl->SetValue(aNetlistFull_Filename);
m_NetlistFilenameCtrl->SetValue( aNetlistFull_Filename );
Init();
......@@ -54,18 +59,30 @@ void DIALOG_NETLIST::Init()
void DIALOG_NETLIST::OnOpenNelistClick( wxCommandEvent& event )
{
wxString fullfilename;
wxFileDialog FilesDialog( this, _( "Netlist Selection:" ), wxGetCwd(),
wxEmptyString, NetlistFileWildcard,
wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
wxString lastPath = wxFileName::GetCwd();
wxString lastNetlistRead = m_Parent->GetLastNetListRead();
if( !lastNetlistRead.IsEmpty() && !wxFileName::FileExists( lastNetlistRead ) )
{
lastNetlistRead = wxEmptyString;
}
else
{
wxFileName fn = lastNetlistRead;
lastPath = fn.GetPath();
lastNetlistRead = fn.GetName();
}
wxLogDebug( wxT( "Last net list read path <%s>, file name <%s>." ),
GetChars( lastPath ), GetChars( lastNetlistRead ) );
wxFileDialog FilesDialog( this, _( "Select Netlist" ), lastPath, lastNetlistRead,
NetlistFileWildcard, wxFD_DEFAULT_STYLE | wxFD_FILE_MUST_EXIST );
if( FilesDialog.ShowModal() != wxID_OK )
return;
fullfilename = FilesDialog.GetPath( );
m_NetlistFilenameCtrl->SetValue( fullfilename );
m_NetlistFilenameCtrl->SetValue( FilesDialog.GetPath() );
}
......@@ -85,7 +102,8 @@ void DIALOG_NETLIST::OnReadNetlistFileClick( wxCommandEvent& event )
void DIALOG_NETLIST::OnTestFootprintsClick( wxCommandEvent& event )
{
TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(), m_Parent->GetBoard() );
TestFor_Duplicate_Missing_And_Extra_Footprints( this, m_NetlistFilenameCtrl->GetValue(),
m_Parent->GetBoard() );
}
......
......@@ -97,11 +97,10 @@ DIALOG_PAD_PROPERTIES::DIALOG_PAD_PROPERTIES( WinEDA_BasePcbFrame* parent, D_PAD
}
/*************************************************************/
void WinEDA_BasePcbFrame::InstallPadOptionsFrame( D_PAD* Pad )
/*************************************************************/
{
DIALOG_PAD_PROPERTIES dlg( this, Pad );
dlg.ShowModal();
}
......@@ -441,9 +440,12 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
g_Pad_Master.m_PadShape = CodeShape[m_PadShape->GetSelection()];
// Read pad clearances values:
g_Pad_Master.m_LocalClearance = ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl, internalUnits );
g_Pad_Master.m_LocalSolderMaskMargin = ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl, internalUnits );
g_Pad_Master.m_LocalSolderPasteMargin = ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl, internalUnits );
g_Pad_Master.m_LocalClearance = ReturnValueFromTextCtrl( *m_NetClearanceValueCtrl,
internalUnits );
g_Pad_Master.m_LocalSolderMaskMargin = ReturnValueFromTextCtrl( *m_SolderMaskMarginCtrl,
internalUnits );
g_Pad_Master.m_LocalSolderPasteMargin = ReturnValueFromTextCtrl( *m_SolderPasteMarginCtrl,
internalUnits );
double dtmp = 0.0;
msg = m_SolderPasteMarginRatioCtrl->GetValue();
msg.ToDouble( &dtmp );
......@@ -664,7 +666,7 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
m_Parent->OnModify();
}
EndModal(1);
EndModal( wxID_OK );
if( RastnestIsChanged ) // The net ratsnest must be recalculated
m_Parent->GetBoard()->m_Status_Pcb = 0;
......@@ -674,6 +676,6 @@ void DIALOG_PAD_PROPERTIES::PadPropertiesAccept( wxCommandEvent& event )
void DIALOG_PAD_PROPERTIES::OnCancelButtonClick( wxCommandEvent& event )
/*********************************************************************/
{
EndModal(0);
EndModal( wxID_CANCEL );
}
......@@ -128,7 +128,7 @@ void DIALOG_PCBNEW_CONFIG_LIBS::OnOkClick( wxCommandEvent& event )
g_LibName_List.Add(m_ListLibr->GetString(ii) );
}
m_Parent->Update_config( this );
m_Parent->SaveProjectSettings();
EndModal( wxID_OK );
}
......
......@@ -31,17 +31,14 @@ void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
}
}
/****************************************************/
void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
/****************************************************/
/* Handle the read/write file commands
*/
void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
{
int id = event.GetId();
wxString msg;
// If an edition is in progress, stop it
DrawPanel->UnManageCursor( 0, wxCURSOR_ARROW );
......@@ -69,13 +66,13 @@ void WinEDA_PcbFrame::Files_io( wxCommandEvent& event )
if( !fn.FileExists() )
{
msg = _( "Recovery file " ) + fn.GetFullPath() + _( " not found" );
msg = _( "Recovery file " ) + fn.GetFullPath() + _( " not found." );
DisplayInfoMessage( this, msg );
break;
}
else
{
msg = _( "Ok to load Recovery file " ) + fn.GetFullPath();
msg = _( "OK to load recovery file " ) + fn.GetFullPath();
if( !IsOK( this, msg ) )
break;
}
......@@ -209,7 +206,7 @@ this file again."));
ReadPcbFile( source, true );
else
{
Read_Config( GetScreen()->m_FileName );
LoadProjectSettings( GetScreen()->m_FileName );
// Update the option toolbar
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
......@@ -228,11 +225,11 @@ this file again."));
/* If append option: change the initial board name to <oldname>-append.brd */
if( Append )
{
wxString new_filename = GetScreen()->m_FileName.BeforeLast('.');
if ( ! new_filename.EndsWith(wxT("-append")) )
new_filename += wxT("-append");
wxString new_filename = GetScreen()->m_FileName.BeforeLast( '.' );
if ( ! new_filename.EndsWith( wxT( "-append" ) ) )
new_filename += wxT( "-append" );
new_filename += wxT(".") + PcbExtBuffer;
new_filename += wxT( "." ) + PcbExtBuffer;
OnModify();
GetScreen()->m_FileName = new_filename;
......@@ -251,11 +248,11 @@ this file again."));
* if board items are not visible after loading a board...
* Grid and ratsnest can be left to their previous state
*/
bool showGrid = IsElementVisible(GRID_VISIBLE);
bool showRats = IsElementVisible(RATSNEST_VISIBLE);
SetVisibleAlls( );
SetElementVisibility(GRID_VISIBLE, showGrid);
SetElementVisibility(RATSNEST_VISIBLE, showRats);
bool showGrid = IsElementVisible( GRID_VISIBLE );
bool showRats = IsElementVisible( RATSNEST_VISIBLE );
SetVisibleAlls();
SetElementVisibility( GRID_VISIBLE, showGrid );
SetElementVisibility( RATSNEST_VISIBLE, showRats );
// Update info shown by the horizontal toolbars
GetBoard()->SetCurrentNetClass( NETCLASS::Default );
......@@ -265,7 +262,7 @@ this file again."));
ReCreateLayerBox( NULL );
AuxiliaryToolBar_Update_UI();
syncLayerWidget( );
syncLayerWidget();
// Display the loaded board:
Zoom_Automatique( false );
......@@ -294,12 +291,9 @@ this file again."));
}
/***********************************************************/
bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
/************************************************************/
/* Write the board file
*/
bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
{
wxFileName backupFileName;
wxFileName pcbFileName;
......
......@@ -116,8 +116,7 @@ FILE * OpenNetlistFile( const wxString& aFullFileName )
if( netfile == NULL )
{
wxString msg;
msg.Printf( _( "Netlist file %s not found" ),
GetChars( aFullFileName ) );
msg.Printf( _( "Netlist file %s not found" ), GetChars( aFullFileName ) );
DisplayError( NULL, msg );
}
......@@ -149,8 +148,7 @@ FILE * OpenNetlistFile( const wxString& aFullFileName )
* }
* #End
*/
bool WinEDA_PcbFrame::ReadPcbNetlist(
const wxString& aNetlistFullFilename,
bool WinEDA_PcbFrame::ReadPcbNetlist( const wxString& aNetlistFullFilename,
const wxString& aCmpFullFileName,
wxTextCtrl* aMessageWindow,
bool aChangeFootprint,
......@@ -168,11 +166,12 @@ bool WinEDA_PcbFrame::ReadPcbNetlist(
if( !netfile )
return false;
SetLastNetListRead( aNetlistFullFilename );
if( aMessageWindow )
{
wxString msg;
msg.Printf( _( "Reading Netlist \"%s\"" ),
GetChars( aNetlistFullFilename ) );
msg.Printf( _( "Reading Netlist \"%s\"" ), GetChars( aNetlistFullFilename ) );
aMessageWindow->AppendText( msg + wxT( "\n" ) );
}
......@@ -181,7 +180,8 @@ bool WinEDA_PcbFrame::ReadPcbNetlist(
OnModify();
GetBoard()->m_Status_Pcb = 0;
State = 0; Comment = 0;
State = 0;
Comment = 0;
s_NbNewModules = 0;
wxBusyCursor dummy; // Shows an hourglass while calculating
......
......@@ -47,6 +47,8 @@
#include "dialog_design_rules.h"
#include "class_pcb_layer_widget.h"
#include "hotkeys.h"
#include "pcbnew_config.h"
extern int g_DrawDefaultLineThickness;
......@@ -109,30 +111,24 @@ BEGIN_EVENT_TABLE( WinEDA_PcbFrame, WinEDA_BasePcbFrame )
EVT_MENU( wxID_EXIT, WinEDA_PcbFrame::OnQuit )
// menu Config
EVT_MENU( ID_CONFIG_REQ,
WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_CONFIG_SAVE,
WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_CONFIG_READ,
WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, WinEDA_PcbFrame::OnConfigurePcbOptions )
EVT_MENU( ID_CONFIG_REQ, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_CONFIG_SAVE, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_CONFIG_READ, WinEDA_PcbFrame::Process_Config )
EVT_MENU_RANGE( ID_PREFERENCES_HOTKEY_START,
ID_PREFERENCES_HOTKEY_END,
WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_MENU_PCB_SHOW_HIDE_LAYERS_MANAGER_DIALOG,
WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_OPTIONS_SETUP, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_PCB_LAYERS_SETUP, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_PCB_MASK_CLEARANCE, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_PCB_DRAWINGS_WIDTHS_SETUP, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_PCB_PAD_SETUP, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_CONFIG_SAVE, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_CONFIG_READ, WinEDA_PcbFrame::Process_Config )
EVT_MENU( ID_PCB_DISPLAY_OPTIONS_SETUP,
WinEDA_PcbFrame::InstallDisplayOptionsDialog )
EVT_MENU( ID_PCB_USER_GRID_SETUP,
WinEDA_PcbFrame::Process_Special_Functions )
EVT_MENU( ID_PCB_USER_GRID_SETUP, WinEDA_PcbFrame::Process_Special_Functions )
EVT_MENU_RANGE( ID_LANGUAGE_CHOICE, ID_LANGUAGE_CHOICE_END,
WinEDA_PcbFrame::SetLanguage )
......@@ -390,9 +386,6 @@ WinEDA_PcbFrame::WinEDA_PcbFrame( wxWindow* father,
WinEDA_PcbFrame::~WinEDA_PcbFrame()
{
extern PARAM_CFG_BASE* ParamCfgList[];
wxGetApp().SaveCurrentSetupValues( ParamCfgList );
delete m_drc;
}
......@@ -417,7 +410,7 @@ void WinEDA_PcbFrame::ReFillLayerWidget()
void WinEDA_PcbFrame::OnQuit( wxCommandEvent & WXUNUSED(event) )
{
Close(true);
Close( true );
}
void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
......@@ -450,6 +443,13 @@ void WinEDA_PcbFrame::OnCloseWindow( wxCloseEvent& Event )
}
}
if( !GetScreen()->m_FileName.IsEmpty() )
{
wxFileName fn = GetScreen()->m_FileName;
fn.SetExt( ProjectFileExtension );
wxGetApp().WriteProjectConfig( fn.GetFullPath(), GROUP, GetProjectFileParameters() );
}
SaveSettings();
// do not show the window because ScreenPcb will be deleted and we do not
......@@ -499,6 +499,11 @@ void WinEDA_PcbFrame::LoadSettings()
if( config == NULL )
return;
/* The configuration setting that used to be mixed in with the project
* file settings.
*/
wxGetApp().ReadCurrentSetupValues( GetConfigurationSettings() );
WinEDA_BasePcbFrame::LoadSettings();
long tmp;
......@@ -519,6 +524,11 @@ void WinEDA_PcbFrame::SaveSettings()
if( config == NULL )
return;
/* The configuration setting that used to be mixed in with the project
* file settings.
*/
wxGetApp().SaveCurrentSetupValues( GetConfigurationSettings() );
WinEDA_BasePcbFrame::SaveSettings();
wxRealPoint GridSize = GetScreen()->GetGridSize();
......@@ -639,3 +649,32 @@ void WinEDA_PcbFrame::SetLanguage( wxCommandEvent& event )
if( m_ModuleEditFrame )
m_ModuleEditFrame->WinEDA_DrawFrame::SetLanguage( event );
}
wxString WinEDA_PcbFrame::GetLastNetListRead()
{
wxFileName absoluteFileName = m_lastNetListRead;
wxFileName pcbFileName = GetScreen()->m_FileName;
if( !absoluteFileName.MakeAbsolute( pcbFileName.GetPath() )
|| !absoluteFileName.FileExists() )
{
absoluteFileName.Clear();
m_lastNetListRead = wxEmptyString;
}
return absoluteFileName.GetFullPath();
}
void WinEDA_PcbFrame::SetLastNetListRead( const wxString& aLastNetListRead )
{
wxFileName relativeFileName = aLastNetListRead;
wxFileName pcbFileName = GetScreen()->m_FileName;
if( relativeFileName.MakeRelativeTo( pcbFileName.GetPath() )
&& relativeFileName.GetFullPath() != aLastNetListRead )
{
m_lastNetListRead = relativeFileName.GetFullPath();
}
}
......@@ -63,8 +63,7 @@ wxPoint g_Offset_Module; /* Offset de trace du modul en depl
wxString g_Current_PadName; // Last used pad name (pad num)
// Wildcard for footprint libraries filesnames
const wxString g_FootprintLibFileWildcard( wxT(
"Kicad footprint library file (*.mod)|*.mod" ) );
const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library file (*.mod)|*.mod" ) );
/* Name of the document footprint list
* usually located in share/modules/footprints_doc
......@@ -126,10 +125,8 @@ bool WinEDA_App::OnInit()
if( fn.GetExt() != BoardFileExtension )
{
wxLogDebug( wxT(
"PcbNew file <%s> has the wrong extension.\
Changing extension to .brd." ),
GetChars( fn.GetFullPath() ) );
wxLogDebug( wxT( "PcbNew file <%s> has the wrong extension. \
Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
fn.SetExt( BoardFileExtension );
}
......@@ -137,7 +134,6 @@ Changing extension to .brd."
wxSetWorkingDirectory( fn.GetPath() );
}
wxGetApp().ReadCurrentSetupValues( ParamCfgList );
g_DrawBgColor = BLACK;
Read_Hotkey_Config( frame, false ); /* Must be called before creating the
* main frame in order to display the
......@@ -157,7 +153,7 @@ Changing extension to .brd."
SetupServerFunction( RemoteCommand );
}
frame->Read_Config( fn.GetFullPath() );
frame->LoadProjectSettings( fn.GetFullPath() );
frame->Zoom_Automatique( true );
......
This diff is collapsed.
This diff is collapsed.
......@@ -38,7 +38,7 @@ void WinEDA_PcbFrame::ToolOnRightClick( wxCommandEvent& event )
case ID_PCB_ADD_LINE_BUTT:
case ID_PCB_DIMENSION_BUTT:
case ID_PCB_ADD_TEXT_BUTT:
InstallPcbOptionsFrame( ID_PCB_DRAWINGS_WIDTHS_SETUP );
OnConfigurePcbOptions( event );
break;
default:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment