Commit c9d6d1f9 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Fixed solder mask clearance not getting loaded properly.

* Closes bug report 570021.
* Removed unused variable from pcbnew.cpp
* Use new message box methods when saving board file.
* Minor code cleaning.
parent 61cf3762
......@@ -15,6 +15,7 @@
#define BACKUP_FILE_EXT wxT( "000" )
void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
{
wxString fn;
......@@ -128,7 +129,8 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
if( GetScreen()->IsModify() && !Append )
{
if( !IsOK( this, _( "Board Modified: Continue ?" ) ) )
if( !IsOK( this, _( "The current board has been modified. Do you wish to discard \
the changes?" ) ) )
return false;
}
......@@ -147,9 +149,8 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
{
wxFileName fn = GetScreen()->m_FileName;
wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString,
fn.GetFullName(), PcbFileWildcard,
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString, fn.GetFullName(),
PcbFileWildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST );
if( dlg.ShowModal() == wxID_CANCEL )
return false;
......@@ -170,8 +171,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
source = wxFopen( GetScreen()->m_FileName, wxT( "rt" ) );
if( source == NULL )
{
msg.Printf( _( "File <%s> not found" ),
GetChars( GetScreen()->m_FileName ) );
msg.Printf( _( "File <%s> not found" ), GetChars( GetScreen()->m_FileName ) );
DisplayError( this, msg );
return false;
}
......@@ -191,13 +191,13 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
if ( ver > g_CurrentVersionPCB )
{
DisplayInfoMessage( this, _( "This file was created by a more recent \
version of PCBnew and may not load correctly. Please consider updating!"));
version of PCBnew and may not load correctly. Please consider updating!" ) );
}
else if ( ver < g_CurrentVersionPCB )
{
DisplayInfoMessage( this, _( "This file was created by an older \
version of PCBnew. It will be stored in the new file format when you save \
this file again."));
this file again." ) );
}
// Reload the corresponding configuration file:
......@@ -206,8 +206,6 @@ this file again."));
ReadPcbFile( source, true );
else
{
LoadProjectSettings( GetScreen()->m_FileName );
// Update the option toolbar
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
m_DisplayModText = DisplayOpt.DisplayModText;
......@@ -216,6 +214,7 @@ this file again."));
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
ReadPcbFile( source, false );
LoadProjectSettings( GetScreen()->m_FileName );
}
fclose( source );
......@@ -268,7 +267,7 @@ this file again."));
Zoom_Automatique( false );
wxSafeYield(); // Needed if we want to see the board now.
// Compile rastnest and displays net info
// Compile ratsnest and displays net info
Compile_Ratsnest( NULL, true );
GetBoard()->DisplayInfo( this );
......@@ -331,18 +330,16 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
backupFileName.SetExt( BACKUP_FILE_EXT );
/* If an old backup file exists, delete it.
if an old board file existes, rename it to the backup file name
if an old board file exists, rename it to the backup file name
*/
if( pcbFileName.FileExists() )
{
/* rename the "old" file" from xxx.brd to xxx.000 */
if( backupFileName.FileExists() ) /* Remove the old file xxx.000 (if exists) */
wxRemoveFile( backupFileName.GetFullPath() );
if( !wxRenameFile( pcbFileName.GetFullPath(),
backupFileName.GetFullPath() ) )
if( !wxRenameFile( pcbFileName.GetFullPath(), backupFileName.GetFullPath() ) )
{
msg = _( "Warning: unable to create backup file " ) +
backupFileName.GetFullPath();
msg = _( "Warning: unable to create backup file " ) + backupFileName.GetFullPath();
DisplayError( this, msg, 15 );
saveok = false;
}
......@@ -386,7 +383,8 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
lowerTxt = _( "Failed to create " );
lowerTxt += pcbFileName.GetFullPath();
Affiche_1_Parametre( this, 1, upperTxt, lowerTxt, CYAN );
ClearMsgPanel();
AppendMsgPanel( upperTxt, lowerTxt, CYAN );
g_SaveTime = time( NULL ); /* Reset timer for the automatic saving */
......
......@@ -37,37 +37,36 @@ int g_DrawDefaultLineThickness = 60; /* Default line thickness in PCBNEW units u
* default thickness line value (Frame references)
* (i.e. = 0 ). 0 = single pixel line width */
bool Drc_On = true;
bool g_AutoDeleteOldTrack = true;
bool g_Drag_Pistes_On;
bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = true;
bool g_Raccord_45_Auto = true;
bool Track_45_Only;
bool Segments_45_Only;
bool g_TwoSegmentTrackBuild = true;
bool g_HighLight_Status;
extern PARAM_CFG_BASE* ParamCfgList[];
int ModuleSegmentWidth;
int ModuleTextWidth;
int Route_Layer_TOP;
int Route_Layer_BOTTOM;
int g_MaxLinksShowed;
int g_MagneticPadOption = capture_cursor_in_track_tool;
int g_MagneticTrackOption = capture_cursor_in_track_tool;
int g_HighLight_NetCode = -1;
wxSize ModuleTextSize; /* Default footprint texts size */
wxPoint g_Offset_Module; /* Offset de trace du modul en depl */
wxString g_Current_PadName; // Last used pad name (pad num)
bool Drc_On = true;
bool g_AutoDeleteOldTrack = true;
bool g_Drag_Pistes_On;
bool g_Show_Module_Ratsnest;
bool g_Show_Pads_Module_in_Move = true;
bool g_Raccord_45_Auto = true;
bool Track_45_Only;
bool Segments_45_Only;
bool g_TwoSegmentTrackBuild = true;
bool g_HighLight_Status;
int ModuleSegmentWidth;
int ModuleTextWidth;
int Route_Layer_TOP;
int Route_Layer_BOTTOM;
int g_MaxLinksShowed;
int g_MagneticPadOption = capture_cursor_in_track_tool;
int g_MagneticTrackOption = capture_cursor_in_track_tool;
int g_HighLight_NetCode = -1;
wxSize ModuleTextSize; /* Default footprint texts size */
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
* this is of the responsability to users to create this file
* this is of the responsibility to users to create this file
* if they want to have a list of footprints
*/
wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" );
......@@ -89,9 +88,7 @@ void WinEDA_App::MacOpenFile( const wxString& fileName )
}
/****************************/
bool WinEDA_App::OnInit()
/****************************/
{
/* WXMAC application specific */
#ifdef __WXMAC__
......@@ -140,8 +137,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
* real hotkeys in menus or tool tips */
frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ),
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
ActiveScreen = ScreenPcb;
......@@ -153,8 +149,6 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
SetupServerFunction( RemoteCommand );
}
frame->LoadProjectSettings( fn.GetFullPath() );
frame->Zoom_Automatique( true );
/* Load file specified in the command line. */
......@@ -166,6 +160,8 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
frame->ReCreateLayerBox( NULL );
}
frame->LoadProjectSettings( fn.GetFullPath() );
/* For an obscure reason the focus is lost after loading a board file
* when starting (i.e. only at this point)
* (seems due to the recreation of the layer manager after loading the file)
......
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