27#include <wx/snglinst.h>
56 int aCtlBits = 0 )
override
101 void SaveFileAs(
const wxString& aProjectBasePath,
const wxString& aSrcProjectName,
102 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
103 const wxString& aSrcFilePath, wxString& aErrors )
override;
157 const wxString& aNewProjectBasePath,
const wxString& aNewProjectName,
158 const wxString& aSrcFilePath, wxString& aErrors )
160 wxFileName destFile( aSrcFilePath );
161 wxString destPath = destFile.GetPathWithSep();
162 wxUniChar pathSep = wxFileName::GetPathSeparator();
163 wxString ext = destFile.GetExt();
165 if( destPath.StartsWith( aProjectBasePath + pathSep ) )
167 destPath.Replace( aProjectBasePath, aNewProjectBasePath,
false );
168 destFile.SetPath( destPath );
171 if( ext ==
"kicad_wks" )
173 if( destFile.GetName() == aSrcProjectName )
174 destFile.SetName( aNewProjectName );
176 KiCopyFile( aSrcFilePath, destFile.GetFullPath(), aErrors );
180 wxFAIL_MSG(
"Unexpected filetype for Pcbnew::SaveFileAs()" );
APP_SETTINGS_BASE is a settings class that should be derived for each standalone KiCad application.
void InitSettings(APP_SETTINGS_BASE *aSettings)
void end_common()
Common things to do for a top program module, during OnKifaceEnd();.
APP_SETTINGS_BASE * KifaceSettings() const
bool start_common(int aCtlBits)
Common things to do for a top program module, during OnKifaceStart().
A minimalistic software bus for communications between various DLLs/DSOs (DSOs) within the same KiCad...
FACE_T
Known KIFACE implementations.
Container for data for KiCad programs.
virtual SETTINGS_MANAGER & GetSettingsManager() const
The main window used in the drawing sheet editor.
T * GetAppSettings(bool aLoadNow=true)
Returns a handle to the a given settings by type If the settings have already been loaded,...
T * RegisterSettings(T *aSettings, bool aLoadNow=true)
Takes ownership of the pointer passed in.
This file is part of the common library.
@ PANEL_DS_DISPLAY_OPTIONS
void KiCopyFile(const wxString &aSrcPath, const wxString &aDestPath, wxString &aErrors)
PGE::IFACE KIFACE_BASE kiface("pl_editor", KIWAY::FACE_PL_EDITOR)
MY_API(KIFACE *) KIFACE_GETTER(int *aKIFACEversion
static PGM_BASE * process
PGM_BASE & Pgm()
The global Program "get" accessor.
KIFACE_BASE & Kiface()
Global KIFACE_BASE "get" accessor.
PGM_BASE * PgmOrNull()
similar to PGM_BASE& Pgm(), but return a reference that can be nullptr when running a shared lib from...
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
Implement a participant in the KIWAY alchemy.
IFACE(const char *aName, KIWAY::FACE_T aType)
bool OnKifaceStart(PGM_BASE *aProgram, int aCtlBits) override
Typically start_common() is called from here.
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 ...
void * IfaceOrAddress(int aDataId) override
Return a pointer to the requested object.
wxWindow * CreateKiWindow(wxWindow *aParent, int aClassId, KIWAY *aKiway, int aCtlBits=0) override
Create a wxWindow for the current project.
void OnKifaceEnd() override
Called just once just before the DSO is to be unloaded.