Commit 07ddb9cb authored by charras's avatar charras

Kicad: fixed: zip archive command does not work.

parent 1f01cd50
...@@ -115,7 +115,7 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event ) ...@@ -115,7 +115,7 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event )
wxFileName fileName = m_ProjectFileName; wxFileName fileName = m_ProjectFileName;
wxString oldPath = wxGetCwd(); wxString oldPath = wxGetCwd();
fileName.SetExt( wxT( ".zip" ) ); fileName.SetExt( wxT( "zip" ) );
wxFileDialog dlg( this, _( "Archive Project Files" ), wxFileDialog dlg( this, _( "Archive Project Files" ),
fileName.GetPath(), fileName.GetFullName(), fileName.GetPath(), fileName.GetFullName(),
...@@ -131,12 +131,12 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event ) ...@@ -131,12 +131,12 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event )
static const wxChar* extList[] = { static const wxChar* extList[] = {
wxT( "*.sch" ), wxT( "*.lib" ), wxT( "*.cmp" ), wxT( "*.brd" ), wxT( "*.sch" ), wxT( "*.lib" ), wxT( "*.cmp" ), wxT( "*.brd" ),
wxT( "*.net" ), wxT( "*.pro" ), wxT( "*.pho" ), wxT( "*.py" ), wxT( "*.net" ), wxT( "*.pro" ), wxT( "*.pho" ), wxT( "*.py" ),
wxT( "*.pdf" ), wxT( "*.txt" ), wxT( "*.pdf" ), wxT( "*.txt" ), wxT( "*.dcm" ),
NULL NULL
}; };
wxString cmd = wxT( "-O " ); wxString cmd = wxT( "-o " ); // run minizip with option -o (overwrite)
cmd += zip.GetPathSeparator() + zip.GetFullName(); cmd += zip.GetFullPath();
wxString currdirname = wxT( "." ); wxString currdirname = wxT( "." );
currdirname += zip.GetPathSeparator(); currdirname += zip.GetPathSeparator();
...@@ -154,9 +154,8 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event ) ...@@ -154,9 +154,8 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event )
while( cont ) while( cont )
{ {
wxFileName fn( f ); wxFileName fn( f );
cmd += wxT( " " );
cmd += wxT( " ." ); cmd += fn.GetFullName();
cmd += zip.GetPathSeparator() + fn.GetFullName();
PrintMsg( _( "Compress file " ) + fn.GetFullName() + wxT( "\n" ) ); PrintMsg( _( "Compress file " ) + fn.GetFullName() + wxT( "\n" ) );
cont = dir.GetNext( &f ); cont = dir.GetNext( &f );
} }
...@@ -169,7 +168,9 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event ) ...@@ -169,7 +168,9 @@ void WinEDA_MainFrame::OnArchiveFiles( wxCommandEvent& event )
#endif #endif
if( ExecuteFile( this, ZIPPER, cmd ) >= 0 ) if( ExecuteFile( this, ZIPPER, cmd ) >= 0 )
{ {
PrintMsg( _( "\nCreate Zip Archive " ) + zip.GetFullName() ); wxString msg;
msg.Printf( _("\nCreate Zip Archive <%s>" ), zip.GetFullName().GetData() );
PrintMsg( msg );
PrintMsg( wxT( "\n** end **\n" ) ); PrintMsg( wxT( "\n** end **\n" ) );
} }
else else
......
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