Fix Bug #1499788 ( Kicad manager unarchive files to home directory instead selected )
Fix a very minor issue about accelerator key in help menu: for "Eeschema Manual" of library browser it was "H". It is now "M" like in other help menus.
This commit is contained in:
parent
dd41260c2c
commit
be8b0b4823
|
@ -247,7 +247,7 @@ void LIB_VIEW_FRAME::ReCreateMenuBar( void )
|
||||||
|
|
||||||
// Contents
|
// Contents
|
||||||
AddMenuItem( helpMenu, wxID_HELP,
|
AddMenuItem( helpMenu, wxID_HELP,
|
||||||
_( "Eesc&hema Manual" ),
|
_( "Eeschema &Manual" ),
|
||||||
_( "Open Eeschema manual" ),
|
_( "Open Eeschema manual" ),
|
||||||
KiBitmap( online_help_xpm ) );
|
KiBitmap( online_help_xpm ) );
|
||||||
|
|
||||||
|
|
|
@ -75,14 +75,14 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
|
||||||
|
|
||||||
fn.SetExt( ZipFileExtension );
|
fn.SetExt( ZipFileExtension );
|
||||||
|
|
||||||
wxFileDialog dlg( this, _( "Unzip Project" ), fn.GetPath(),
|
wxFileDialog zipfiledlg( this, _( "Unzip Project" ), fn.GetPath(),
|
||||||
fn.GetFullName(), ZipFileWildcard,
|
fn.GetFullName(), ZipFileWildcard,
|
||||||
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
wxFD_OPEN | wxFD_FILE_MUST_EXIST );
|
||||||
|
|
||||||
if( dlg.ShowModal() == wxID_CANCEL )
|
if( zipfiledlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
wxString msg = wxString::Format( _("\nOpen '%s'\n" ), GetChars( dlg.GetPath() ) );
|
wxString msg = wxString::Format( _("\nOpen '%s'\n" ), GetChars( zipfiledlg.GetPath() ) );
|
||||||
PrintMsg( msg );
|
PrintMsg( msg );
|
||||||
|
|
||||||
wxDirDialog dirDlg( this, _( "Target Directory" ), fn.GetPath(),
|
wxDirDialog dirDlg( this, _( "Target Directory" ), fn.GetPath(),
|
||||||
|
@ -91,13 +91,14 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
|
||||||
if( dirDlg.ShowModal() == wxID_CANCEL )
|
if( dirDlg.ShowModal() == wxID_CANCEL )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
msg.Printf( _( "Unzipping project in '%s'\n" ), GetChars( dirDlg.GetPath() ) );
|
wxString unzipDir = dirDlg.GetPath() + wxT( "/" );
|
||||||
|
msg.Printf( _( "Unzipping project in '%s'\n" ), GetChars( unzipDir ) );
|
||||||
PrintMsg( msg );
|
PrintMsg( msg );
|
||||||
|
|
||||||
wxFileSystem zipfilesys;
|
wxFileSystem zipfilesys;
|
||||||
|
|
||||||
zipfilesys.AddHandler( new wxZipFSHandler );
|
zipfilesys.AddHandler( new wxZipFSHandler );
|
||||||
zipfilesys.ChangePathTo( dlg.GetPath() + wxT( "#zip:" ) );
|
zipfilesys.ChangePathTo( zipfiledlg.GetPath() + wxT( "#zip:" ), true );
|
||||||
|
|
||||||
wxFSFile* zipfile = NULL;
|
wxFSFile* zipfile = NULL;
|
||||||
wxString localfilename = zipfilesys.FindFirst( wxT( "*.*" ) );
|
wxString localfilename = zipfilesys.FindFirst( wxT( "*.*" ) );
|
||||||
|
@ -111,13 +112,14 @@ void KICAD_MANAGER_FRAME::OnUnarchiveFiles( wxCommandEvent& event )
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString unzipfilename = localfilename.AfterLast( ':' );
|
wxFileName uzfn = localfilename.AfterLast( ':' );
|
||||||
|
uzfn.MakeAbsolute( unzipDir );
|
||||||
|
wxString unzipfilename = uzfn.GetFullPath();
|
||||||
|
|
||||||
msg.Printf( _( "Extract file '%s'" ), GetChars( unzipfilename ) );
|
msg.Printf( _( "Extract file '%s'" ), GetChars( unzipfilename ) );
|
||||||
PrintMsg( msg );
|
PrintMsg( msg );
|
||||||
|
|
||||||
wxInputStream* stream = zipfile->GetStream();
|
wxInputStream* stream = zipfile->GetStream();
|
||||||
|
|
||||||
wxFFileOutputStream* ofile = new wxFFileOutputStream( unzipfilename );
|
wxFFileOutputStream* ofile = new wxFFileOutputStream( unzipfilename );
|
||||||
|
|
||||||
if( ofile->Ok() )
|
if( ofile->Ok() )
|
||||||
|
|
Loading…
Reference in New Issue