26#include <wx/filedlg.h>
44 if( !filename.IsEmpty() )
61 wxFileDialog zipfiledlg(
this,
_(
"Unzip Project" ), fn.GetPath(), fn.GetFullName(),
66 if( zipfiledlg.ShowModal() == wxID_CANCEL )
69 wxString msg = wxString::Format(
_(
"\nOpen '%s'\n" ), zipfiledlg.GetPath() );
72 wxDirDialog dirDlg(
this,
_(
"Target Directory" ), fn.GetPath(), wxDD_DEFAULT_STYLE );
74 if( dirDlg.ShowModal() == wxID_CANCEL )
77 wxString unzipDir = dirDlg.GetPath() + wxT(
"/" );
78 msg.Printf(
_(
"Unzipping project in '%s'.\n" ), unzipDir );
81 if( unzipDir ==
Prj().GetProjectPath() )
83 if( !
Kiway().PlayersClose(
false ) )
91 wxArrayString projectFiles;
92 wxDir::GetAllFiles( unzipDir, &projectFiles,
96 if( projectFiles.size() == 1 )
void PrintMsg(const wxString &text)
virtual void ClearFileHistory()
Remove all files from the file history.
wxString GetFileFromHistory(int cmdId, const wxString &type, FILE_HISTORY *aFileHistory=nullptr)
Fetch the file name from the file history list.
void RestoreLocalHistory()
void LoadProject(const wxFileName &aProjectFileName)
void OnFileHistory(wxCommandEvent &event)
void OnClearFileHistory(wxCommandEvent &aEvent)
PROJECT & Prj() const
Return a reference to the PROJECT associated with this KIWAY.
KIWAY & Kiway() const
Return a reference to the KIWAY that this object has an opportunity to participate in.
LOCAL_HISTORY & LocalHistory()
Return the LOCAL_HISTORY associated with this KIWAY.
void ShowRestoreDialog(const wxString &aProjectPath, wxWindow *aParent)
Show a dialog allowing the user to choose a snapshot to restore.
static bool Unarchive(const wxString &aSrcFile, const wxString &aDestDir, REPORTER &aReporter)
Extract an archive of the current project over existing files.
virtual const wxString GetProjectFullName() const
Return the full path and name of the project.
A wrapper for reporting to a specific text location in a statusbar.
static const std::string ProjectFileExtension
static const std::string ArchiveFileExtension
static wxString ZipFileWildcard()
Definition of file extensions used in Kicad.