32#include <wx/filedlg.h>
46 const wxString& aFilesWildcard,
47 const wxString& aSchFileExtension,
48 const wxString& aPcbFileExtension,
49 int aSchFileType,
int aPcbFileType )
53 int style = wxFD_OPEN | wxFD_FILE_MUST_EXIST;
55 wxFileDialog schdlg(
this, aWindowTitle, default_dir, wxEmptyString, aFilesWildcard, style );
57 if( schdlg.ShowModal() == wxID_CANCEL )
66 IMPORT_PROJ_HELPER importProj(
this, schdlg.GetPath(), aSchFileExtension, aPcbFileExtension );
68 wxString protitle =
_(
"KiCad Project Destination" );
72 wxDirDialog prodlg(
this, protitle, importProj.
GetProjPath(), wxDD_DEFAULT_STYLE );
74 if( prodlg.ShowModal() == wxID_CANCEL )
84 msg =
_(
"The selected directory is not empty. We recommend you "
85 "create projects in their own clean directory.\n\nDo you "
86 "want to create a new empty directory for the project?" );
88 KIDIALOG dlg(
this, msg,
_(
"Confirmation" ), wxYES_NO | wxICON_WARNING );
99 msg =
_(
"Error creating new directory. Please try a different path. The "
100 "project cannot be imported." );
102 wxMessageDialog dirErrorDlg(
this, msg,
_(
"Error" ), wxOK_DEFAULT | wxICON_ERROR );
103 dirErrorDlg.ShowModal();
wxString GetMruPath() const
A helper class to import non Kicad project.
void AssociateFilesWithProj(int aImportedSchFileType, int aImportedPcbFileType)
Converts imported files to kicad type files.
wxString GetProjFullPath()
const wxFileName & GetProj()
void SetProjPath(const wxString aPath)
void CreateEmptyDirForProject()
Appends a new directory with the name of the project file Keep iterating until an empty directory is ...
void SetProjAbsolutePath()
bool CopyImportedFiles(bool displayError=true)
Copies project files to the destination directory.
void CreateNewProject(const wxFileName &aProjectFileName, bool aCreateStubFiles=true)
Creates a new project by setting up and initial project, schematic, and board files.
void OnImportEagleFiles(wxCommandEvent &event)
Open dialog to import Eagle schematic and board files.
void LoadProject(const wxFileName &aProjectFileName)
void ImportNonKiCadProject(const wxString &aWindowTitle, const wxString &aFilesWildcard, const wxString &aSchFileExtension, const wxString &aPcbFileExtension, int aSchFileType, int aPcbFileType)
Creates a project and imports a non-KiCad Schematic and PCB.
bool CloseProject(bool aSave)
Closes the project, and saves it if aSave is true;.
void OnImportCadstarArchiveFiles(wxCommandEvent &event)
Open dialog to import CADSTAR Schematic and PCB Archive files.
Helper class to create more flexible dialogs, including 'do not show again' checkbox handling.
void DoNotShowCheckbox(wxString file, int line)
Checks the 'do not show again' setting for the dialog.
This file is part of the common library.
const std::string LegacyPcbFileExtension
const std::string LegacySchematicFileExtension
wxString EagleFilesWildcard()
wxString CadstarArchiveFilesWildcard()
Definition of file extensions used in Kicad.