Commit ea990230 authored by Felix Morgner's avatar Felix Morgner Committed by Dick Hollenbeck

Fixes implementation of MacOpenFile( const wxString& ) in KiCad.

Adds "kicad_pcb" to the list of file-extensions for PCBnew in its Info.plist 
to make Launch Services recognize the file associations.

Change 8 bit string to UTF8 so fancy mew in "um" can be shown. 
parents 91674347 625e8b06
...@@ -95,7 +95,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar() ...@@ -95,7 +95,7 @@ void CVPCB_MAINFRAME::ReCreateMenuBar()
// Save as the .cmp file // Save as the .cmp file
AddMenuItem( filesMenu, AddMenuItem( filesMenu,
wxID_SAVEAS, wxID_SAVEAS,
_( "Save &As..." ), SAVE_AS_HLP_MSG, KiBitmap( save_xpm ) ); _( "Save &As...\tCtrl+Shift+S" ), SAVE_AS_HLP_MSG, KiBitmap( save_xpm ) );
// Separator // Separator
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
......
...@@ -166,8 +166,8 @@ int CVPCB_MAINFRAME::SaveCmpLinkFile( const wxString& aFullFileName ) ...@@ -166,8 +166,8 @@ int CVPCB_MAINFRAME::SaveCmpLinkFile( const wxString& aFullFileName )
} }
else else
{ {
wxFileDialog dlg( this, _( "Save Component Footprint Link File" ), wxGetCwd(), wxFileDialog dlg( this, _( "Save Component Footprint Link File" ), wxEmptyString,
wxEmptyString, ComponentFileWildcard, wxFD_SAVE ); _( "Unnamed file" ), ComponentFileWildcard, wxFD_SAVE );
if( dlg.ShowModal() == wxID_CANCEL ) if( dlg.ShowModal() == wxID_CANCEL )
return -1; return -1;
......
...@@ -56,21 +56,17 @@ void EDA_APP::MacOpenFile( const wxString &fileName ) ...@@ -56,21 +56,17 @@ void EDA_APP::MacOpenFile( const wxString &fileName )
frame->m_ProjectFileName = fn; frame->m_ProjectFileName = fn;
if( m_fileHistory.GetCount() ) if( !frame->m_ProjectFileName.FileExists() && m_fileHistory.GetCount() )
{ {
frame->m_ProjectFileName = m_fileHistory.GetHistoryFile( 0 ); m_fileHistory.RemoveFileFromHistory( 0 );
return;
if( !frame->m_ProjectFileName.FileExists() )
{
m_fileHistory.RemoveFileFromHistory( 0 );
}
else
{
wxCommandEvent cmd( 0, wxID_FILE1 );
frame->OnFileHistory( cmd );
}
} }
wxCommandEvent loadEvent;
loadEvent.SetId( wxID_ANY );
frame->OnLoadProject( loadEvent );
wxString title = GetTitle() + wxT( " " ) + GetBuildVersion() + wxString title = GetTitle() + wxT( " " ) + GetBuildVersion() +
wxT( " " ) + frame->m_ProjectFileName.GetFullPath(); wxT( " " ) + frame->m_ProjectFileName.GetFullPath();
......
...@@ -869,7 +869,7 @@ void C_MICROSTRIP::show_results() ...@@ -869,7 +869,7 @@ void C_MICROSTRIP::show_results()
setResult( 4, atten_dielectric_e, "dB" ); setResult( 4, atten_dielectric_e, "dB" );
setResult( 5, atten_dielectric_o, "dB" ); setResult( 5, atten_dielectric_o, "dB" );
setResult( 6, skindepth / UNIT_MICRON, "m" ); setResult( 6, skindepth / UNIT_MICRON, "µm" );
} }
......
...@@ -184,7 +184,7 @@ void COPLANAR::show_results() ...@@ -184,7 +184,7 @@ void COPLANAR::show_results()
setResult( 1, atten_cond, "dB" ); setResult( 1, atten_cond, "dB" );
setResult( 2, atten_dielectric, "dB" ); setResult( 2, atten_dielectric, "dB" );
setResult( 3, skindepth / UNIT_MICRON, "m" ); setResult( 3, skindepth / UNIT_MICRON, "µm" );
} }
......
...@@ -511,7 +511,7 @@ void MICROSTRIP::show_results() ...@@ -511,7 +511,7 @@ void MICROSTRIP::show_results()
setResult( 1, atten_cond, "dB" ); setResult( 1, atten_cond, "dB" );
setResult( 2, atten_dielectric, "dB" ); setResult( 2, atten_dielectric, "dB" );
setResult( 3, skindepth/UNIT_MICRON, "m" ); setResult( 3, skindepth/UNIT_MICRON, "µm" );
} }
......
...@@ -123,7 +123,7 @@ void STRIPLINE::show_results() ...@@ -123,7 +123,7 @@ void STRIPLINE::show_results()
setResult( 1, atten_cond, "dB" ); setResult( 1, atten_cond, "dB" );
setResult( 2, atten_dielectric, "dB" ); setResult( 2, atten_dielectric, "dB" );
setResult( 3, skindepth / UNIT_MICRON, "m" ); setResult( 3, skindepth / UNIT_MICRON, "µm" );
} }
......
...@@ -84,7 +84,7 @@ void TWISTEDPAIR::show_results() ...@@ -84,7 +84,7 @@ void TWISTEDPAIR::show_results()
setResult( 1, atten_cond, "dB" ); setResult( 1, atten_cond, "dB" );
setResult( 2, atten_dielectric, "dB" ); setResult( 2, atten_dielectric, "dB" );
setResult( 3, skindepth / UNIT_MICRON, "m" ); setResult( 3, skindepth / UNIT_MICRON, "µm" );
} }
......
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
<string>pcbnew_doc.icns</string> <string>pcbnew_doc.icns</string>
<key>CFBundleTypeExtensions</key> <key>CFBundleTypeExtensions</key>
<array> <array>
<string>kicad_pcb</string>
<string>brd</string> <string>brd</string>
</array> </array>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
......
...@@ -445,12 +445,17 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF ...@@ -445,12 +445,17 @@ bool PCB_EDIT_FRAME::SavePcbFile( const wxString& aFileName, bool aCreateBackupF
pcbFileName = GetBoard()->GetFileName(); pcbFileName = GetBoard()->GetFileName();
if( pcbFileName.GetName() == wxEmptyString )
{
pcbFileName.SetName( _( "Unnamed file" ) );
}
// Match the default wildcard filter choice, with the inital file extension shown. // Match the default wildcard filter choice, with the inital file extension shown.
// That'll be the extension unless user changes filter dropdown listbox. // That'll be the extension unless user changes filter dropdown listbox.
pcbFileName.SetExt( KiCadPcbFileExtension ); pcbFileName.SetExt( KiCadPcbFileExtension );
wxFileDialog dlg( this, _( "Save Board File As" ), wxEmptyString, wxFileDialog dlg( this, _( "Save Board File As" ), pcbFileName.GetPath(),
pcbFileName.GetFullPath(), pcbFileName.GetFullName(),
wildcard, wxFD_SAVE wildcard, wxFD_SAVE
/* wxFileDialog is not equipped to handle multiple wildcards and /* wxFileDialog is not equipped to handle multiple wildcards and
wxFD_OVERWRITE_PROMPT both together. wxFD_OVERWRITE_PROMPT both together.
......
...@@ -106,8 +106,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar() ...@@ -106,8 +106,8 @@ void PCB_EDIT_FRAME::ReCreateMenuBar()
// Save As // Save As
AddMenuItem( filesMenu, ID_SAVE_BOARD_AS, AddMenuItem( filesMenu, ID_SAVE_BOARD_AS,
_( "Sa&ve As..." ), _( "Sa&ve As...\tCtrl+Shift+S" ),
_( "Save the current board as.." ), _( "Save the current board as..." ),
KiBitmap( save_as_xpm ) ); KiBitmap( save_as_xpm ) );
filesMenu->AppendSeparator(); filesMenu->AppendSeparator();
......
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