39 const wxString& aSrcProjectDirPath,
40 const wxString& aSrcProjectName,
41 const wxString& aNewProjectDirPath,
42 const wxString& aNewProjectName ) :
56 return wxDIR_CONTINUE;
58 wxFileName destFile( aSrcFilePath );
59 wxString ext = destFile.GetExt();
66 wxString destPath = destFile.GetPath();
71 destFile.SetPath( destPath );
91 projectFile.
SaveAs( destFile.GetPath(), destFile.GetName() );
97 projectLocalSettings.
SaveAs( destFile.GetPath(), destFile.GetName() );
149 wxString destPath = destFile.GetPathWithSep();
150 wxString destName = destFile.GetName();
151 wxUniChar pathSep = wxFileName::GetPathSeparator();
153 wxString srcProjectFootprintLib = pathSep +
m_projectName +
".pretty" + pathSep;
154 wxString newProjectFootprintLib = pathSep +
m_newProjectName +
".pretty" + pathSep;
159 destPath.Replace( srcProjectFootprintLib, newProjectFootprintLib,
true );
164 destFile.SetPath( destPath );
169 return wxDIR_CONTINUE;
176 wxFileName srcDir = wxFileName::DirName( aSrcDirPath );
177 wxArrayString dirs = srcDir.GetDirs();
179 if( !dirs.IsEmpty() && dirs.Last() == wxS(
".history" ) )
184 return wxDIR_CONTINUE;
186 wxFileName destDir( aSrcDirPath );
187 wxString destDirPath = destDir.GetPathWithSep();
188 wxUniChar pathSep = wxFileName::GetPathSeparator();
194 destDir.SetPath( destDirPath );
199 if( destDir.GetExt() ==
"pretty" )
204 else if( destDir.GetExt() ==
"sym_lib_dir_extension" )
209 if( !wxMkdir( destDir.GetFullPath() ) )
216 msg.Printf(
_(
"Cannot copy folder '%s'." ), destDir.GetFullPath() );
220 return wxDIR_CONTINUE;
virtual bool LoadFromFile(const wxString &aDirectory="")
Loads the backing file from disk and then calls Load()
The main KiCad project manager frame.
The backing store for a PROJECT, in JSON format.
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
bool LoadFromFile(const wxString &aDirectory="") override
Loads the backing file from disk and then calls Load()
The project local settings are things that are attached to a particular project, but also might be pa...
bool SaveAs(const wxString &aDirectory, const wxString &aFile)
wxString m_newProjectDirPath
KICAD_MANAGER_FRAME * m_frame
wxString m_projectDirPath
virtual wxDirTraverseResult OnFile(const wxString &aSrcFilePath) override
PROJECT_TREE_TRAVERSER(KICAD_MANAGER_FRAME *aFrame, const wxString &aSrcProjectDirPath, const wxString &aSrcProjectName, const wxString &aNewProjectDirPath, const wxString &aNewProjectName)
wxString m_newProjectName
virtual wxDirTraverseResult OnDir(const wxString &aSrcDirPath) override
wxFileName m_newProjectFile
This file is part of the common library.
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
static const std::string LegacySchematicFileExtension
static const std::string NetlistFileExtension
static const std::string SymbolLibraryTableFileName
static const std::string GerberJobFileExtension
static const std::string LockFileExtension
static const std::string ProjectFileExtension
static const std::string LegacyPcbFileExtension
static const std::string SchematicSymbolFileExtension
static const std::string LegacyProjectFileExtension
static const std::string ProjectLocalSettingsFileExtension
static const std::string KiCadSchematicFileExtension
static const std::string LegacySymbolLibFileExtension
static const std::string LockFilePrefix
static const std::string KiCadSymbolLibFileExtension
static const std::string FootprintLibraryTableFileName
static const std::string DrawingSheetFileExtension
static const std::string BackupFileSuffix
static const std::string LegacyFootprintLibPathExtension
static const std::string LegacySymbolDocumentFileExtension
static const std::string FootprintAssignmentFileExtension
static const std::string DrillFileExtension
static const std::string KiCadFootprintFileExtension
static const std::string KiCadPcbFileExtension
static bool IsGerberFileExtension(const wxString &ext)
#define PROJECT_BACKUPS_DIR_SUFFIX
Project settings path will be <projectname> + this.
Implement a participant in the KIWAY alchemy.
virtual void SaveFileAs(const wxString &srcProjectBasePath, const wxString &srcProjectName, const wxString &newProjectBasePath, const wxString &newProjectName, const wxString &srcFilePath, wxString &aErrors)
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't ...
Definition of file extensions used in Kicad.