22#include <wx/filedlg.h>
40 if( !filename.IsEmpty() )
57 wxFileDialog zipfiledlg(
this,
_(
"Unzip Project" ), fn.GetPath(), fn.GetFullName(),
62 if( zipfiledlg.ShowModal() == wxID_CANCEL )
65 wxString msg = wxString::Format(
_(
"\nOpen '%s'\n" ), zipfiledlg.GetPath() );
68 wxDirDialog dirDlg(
this,
_(
"Target Directory" ), fn.GetPath(), wxDD_DEFAULT_STYLE );
70 if( dirDlg.ShowModal() == wxID_CANCEL )
73 wxString unzipDir = dirDlg.GetPath() + wxT(
"/" );
74 msg.Printf(
_(
"Unzipping project in '%s'.\n" ), unzipDir );
77 if( unzipDir ==
Prj().GetProjectPath() )
79 if( !
Kiway().PlayersClose(
false ) )
87 wxArrayString projectFiles;
88 wxDir::GetAllFiles( unzipDir, &projectFiles,
92 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 OnFileHistory(wxCommandEvent &event)
bool LoadProject(const wxFileName &aProjectFileName)
Loads a new project.
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()
IbisParser parser & reporter
Definition of file extensions used in Kicad.