fix bug from launchpad
This commit is contained in:
commit
5f971428d6
|
@ -15,6 +15,7 @@
|
||||||
|
|
||||||
#define BACKUP_FILE_EXT wxT( "000" )
|
#define BACKUP_FILE_EXT wxT( "000" )
|
||||||
|
|
||||||
|
|
||||||
void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
|
void WinEDA_PcbFrame::OnFileHistory( wxCommandEvent& event )
|
||||||
{
|
{
|
||||||
wxString fn;
|
wxString fn;
|
||||||
|
@ -128,7 +129,8 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
|
||||||
|
|
||||||
if( GetScreen()->IsModify() && !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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -147,9 +149,8 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
|
||||||
{
|
{
|
||||||
wxFileName fn = GetScreen()->m_FileName;
|
wxFileName fn = GetScreen()->m_FileName;
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString,
|
wxFileDialog dlg( this, _( "Open Board File" ), wxEmptyString, fn.GetFullName(),
|
||||||
fn.GetFullName(), PcbFileWildcard,
|
PcbFileWildcard, wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( dlg.ShowModal() == wxID_CANCEL )
|
||||||
return false;
|
return false;
|
||||||
|
@ -170,8 +171,7 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
|
||||||
source = wxFopen( GetScreen()->m_FileName, wxT( "rt" ) );
|
source = wxFopen( GetScreen()->m_FileName, wxT( "rt" ) );
|
||||||
if( source == NULL )
|
if( source == NULL )
|
||||||
{
|
{
|
||||||
msg.Printf( _( "File <%s> not found" ),
|
msg.Printf( _( "File <%s> not found" ), GetChars( GetScreen()->m_FileName ) );
|
||||||
GetChars( GetScreen()->m_FileName ) );
|
|
||||||
DisplayError( this, msg );
|
DisplayError( this, msg );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -191,13 +191,13 @@ bool WinEDA_PcbFrame::LoadOnePcbFile( const wxString& FullFileName, bool Append
|
||||||
if ( ver > g_CurrentVersionPCB )
|
if ( ver > g_CurrentVersionPCB )
|
||||||
{
|
{
|
||||||
DisplayInfoMessage( this, _( "This file was created by a more recent \
|
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 )
|
else if ( ver < g_CurrentVersionPCB )
|
||||||
{
|
{
|
||||||
DisplayInfoMessage( this, _( "This file was created by an older \
|
DisplayInfoMessage( this, _( "This file was created by an older \
|
||||||
version of PCBnew. It will be stored in the new file format when you save \
|
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:
|
// Reload the corresponding configuration file:
|
||||||
|
@ -206,8 +206,6 @@ this file again."));
|
||||||
ReadPcbFile( source, true );
|
ReadPcbFile( source, true );
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LoadProjectSettings( GetScreen()->m_FileName );
|
|
||||||
|
|
||||||
// Update the option toolbar
|
// Update the option toolbar
|
||||||
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
|
m_DisplayPcbTrackFill = DisplayOpt.DisplayPcbTrackFill;
|
||||||
m_DisplayModText = DisplayOpt.DisplayModText;
|
m_DisplayModText = DisplayOpt.DisplayModText;
|
||||||
|
@ -216,6 +214,7 @@ this file again."));
|
||||||
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
m_DisplayViaFill = DisplayOpt.DisplayViaFill;
|
||||||
|
|
||||||
ReadPcbFile( source, false );
|
ReadPcbFile( source, false );
|
||||||
|
LoadProjectSettings( GetScreen()->m_FileName );
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose( source );
|
fclose( source );
|
||||||
|
@ -268,7 +267,7 @@ this file again."));
|
||||||
Zoom_Automatique( false );
|
Zoom_Automatique( false );
|
||||||
wxSafeYield(); // Needed if we want to see the board now.
|
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 );
|
Compile_Ratsnest( NULL, true );
|
||||||
GetBoard()->DisplayInfo( this );
|
GetBoard()->DisplayInfo( this );
|
||||||
|
|
||||||
|
@ -331,18 +330,16 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
||||||
backupFileName.SetExt( BACKUP_FILE_EXT );
|
backupFileName.SetExt( BACKUP_FILE_EXT );
|
||||||
|
|
||||||
/* If an old backup file exists, delete it.
|
/* 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() )
|
if( pcbFileName.FileExists() )
|
||||||
{
|
{
|
||||||
/* rename the "old" file" from xxx.brd to xxx.000 */
|
/* rename the "old" file" from xxx.brd to xxx.000 */
|
||||||
if( backupFileName.FileExists() ) /* Remove the old file xxx.000 (if exists) */
|
if( backupFileName.FileExists() ) /* Remove the old file xxx.000 (if exists) */
|
||||||
wxRemoveFile( backupFileName.GetFullPath() );
|
wxRemoveFile( backupFileName.GetFullPath() );
|
||||||
if( !wxRenameFile( pcbFileName.GetFullPath(),
|
if( !wxRenameFile( pcbFileName.GetFullPath(), backupFileName.GetFullPath() ) )
|
||||||
backupFileName.GetFullPath() ) )
|
|
||||||
{
|
{
|
||||||
msg = _( "Warning: unable to create backup file " ) +
|
msg = _( "Warning: unable to create backup file " ) + backupFileName.GetFullPath();
|
||||||
backupFileName.GetFullPath();
|
|
||||||
DisplayError( this, msg, 15 );
|
DisplayError( this, msg, 15 );
|
||||||
saveok = false;
|
saveok = false;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +383,8 @@ bool WinEDA_PcbFrame::SavePcbFile( const wxString& FileName )
|
||||||
lowerTxt = _( "Failed to create " );
|
lowerTxt = _( "Failed to create " );
|
||||||
lowerTxt += pcbFileName.GetFullPath();
|
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 */
|
g_SaveTime = time( NULL ); /* Reset timer for the automatic saving */
|
||||||
|
|
||||||
|
|
|
@ -47,7 +47,6 @@ bool Track_45_Only;
|
||||||
bool Segments_45_Only;
|
bool Segments_45_Only;
|
||||||
bool g_TwoSegmentTrackBuild = true;
|
bool g_TwoSegmentTrackBuild = true;
|
||||||
bool g_HighLight_Status;
|
bool g_HighLight_Status;
|
||||||
extern PARAM_CFG_BASE* ParamCfgList[];
|
|
||||||
|
|
||||||
int ModuleSegmentWidth;
|
int ModuleSegmentWidth;
|
||||||
int ModuleTextWidth;
|
int ModuleTextWidth;
|
||||||
|
@ -67,7 +66,7 @@ const wxString g_FootprintLibFileWildcard( wxT( "Kicad footprint library
|
||||||
|
|
||||||
/* Name of the document footprint list
|
/* Name of the document footprint list
|
||||||
* usually located in share/modules/footprints_doc
|
* 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
|
* if they want to have a list of footprints
|
||||||
*/
|
*/
|
||||||
wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" );
|
wxString g_DocModulesFileName = wxT( "footprints_doc/footprints.pdf" );
|
||||||
|
@ -89,9 +88,7 @@ void WinEDA_App::MacOpenFile( const wxString& fileName )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/****************************/
|
|
||||||
bool WinEDA_App::OnInit()
|
bool WinEDA_App::OnInit()
|
||||||
/****************************/
|
|
||||||
{
|
{
|
||||||
/* WXMAC application specific */
|
/* WXMAC application specific */
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
|
@ -140,8 +137,7 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
||||||
* real hotkeys in menus or tool tips */
|
* real hotkeys in menus or tool tips */
|
||||||
|
|
||||||
|
|
||||||
frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ),
|
frame = new WinEDA_PcbFrame( NULL, wxT( "PcbNew" ), wxPoint( 0, 0 ), wxSize( 600, 400 ) );
|
||||||
wxPoint( 0, 0 ), wxSize( 600, 400 ) );
|
|
||||||
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
|
frame->SetTitle( GetTitle() + wxT( " " ) + GetBuildVersion() );
|
||||||
ActiveScreen = ScreenPcb;
|
ActiveScreen = ScreenPcb;
|
||||||
|
|
||||||
|
@ -153,8 +149,6 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
||||||
SetupServerFunction( RemoteCommand );
|
SetupServerFunction( RemoteCommand );
|
||||||
}
|
}
|
||||||
|
|
||||||
frame->LoadProjectSettings( fn.GetFullPath() );
|
|
||||||
|
|
||||||
frame->Zoom_Automatique( true );
|
frame->Zoom_Automatique( true );
|
||||||
|
|
||||||
/* Load file specified in the command line. */
|
/* Load file specified in the command line. */
|
||||||
|
@ -166,6 +160,8 @@ Changing extension to .brd." ), GetChars( fn.GetFullPath() ) );
|
||||||
frame->ReCreateLayerBox( NULL );
|
frame->ReCreateLayerBox( NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
frame->LoadProjectSettings( fn.GetFullPath() );
|
||||||
|
|
||||||
/* For an obscure reason the focus is lost after loading a board file
|
/* For an obscure reason the focus is lost after loading a board file
|
||||||
* when starting (i.e. only at this point)
|
* when starting (i.e. only at this point)
|
||||||
* (seems due to the recreation of the layer manager after loading the file)
|
* (seems due to the recreation of the layer manager after loading the file)
|
||||||
|
|
Loading…
Reference in New Issue