27 #include <wx/snglinst.h> 54 int aCtlBits = 0 )
override 92 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
93 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
94 const wxString& aSrcFilePath, wxString& aErrors )
override;
148 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
149 const wxString& aSrcFilePath, wxString& aErrors )
151 wxFileName destFile( aSrcFilePath );
152 wxString destPath = destFile.GetPathWithSep();
153 wxUniChar pathSep = wxFileName::GetPathSeparator();
154 wxString ext = destFile.GetExt();
156 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
158 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
159 destFile.SetPath( destPath );
162 if( ext ==
"kicad_wks" )
164 if( destFile.GetName() == aSrcProjectName )
165 destFile.SetName( aNewProjectName );
167 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
171 wxFAIL_MSG(
"Unexpected filetype for Pcbnew::SaveFileAs()" );
virtual SETTINGS_MANAGER & GetSettingsManager() const
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Takes ownership of the pointer passed in.
IFACE(const char *aName, KIWAY::FACE_T aType)
This file is part of the common library.
Container for data for KiCad programs.
The main window used in the drawing sheet editor.
MY_API(KIFACE *) KIFACE_GETTER(int *aKIFACEversion
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
PGE::IFACE KIFACE_BASE kiface("pl_editor", KIWAY::FACE_PL_EDITOR)
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
void InitSettings(APP_SETTINGS_BASE *aSettings)
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
void SaveFileAs(const wxString &aProjectBasePath, const wxString &aSrcProjectName, const wxString &aNewProjectBasePath, const wxString &aNewProjectName, const wxString &aSrcFilePath, wxString &aErrors) override
Saving a file under a different name is delegated to the various KIFACEs because the project doesn't ...
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
static PGM_BASE * process
FACE_T
Known KIFACE implementations.
wxWindow * CreateWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
Implement a participant in the KIWAY alchemy.
APP_SETTINGS_BASE * KifaceSettings() const
PGM_BASE & Pgm()
The global Program "get" accessor.
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.