LibrePCB Developers Documentation
Loading...
Searching...
No Matches
ProjectEditor Class Referencefinal

The ProjectEditor class. More...

#include <projecteditor.h>

Inherits QObject.

+ Collaboration diagram for ProjectEditor:

Signals

void uiIndexChanged ()
 
void manualModificationsMade ()
 
void projectAboutToBeSaved ()
 
void projectSavedToDisk ()
 
void ercUnapprovedCountChanged ()
 
void highlightedNetSignalsChanged ()
 
void projectLibraryUpdaterRequested (const FilePath &fp)
 
void statusBarMessageChanged (const QString &message, int timeoutMs)
 
void abortBlockingToolsInOtherEditors (const void *source)
 Abort any active (blocking) tools in other editors.
 

Public Member Functions

 ProjectEditor ()=delete
 
 ProjectEditor (const ProjectEditor &other)=delete
 
 ProjectEditor (GuiApplication &app, std::unique_ptr< Project > project, int uiIndex, const std::optional< QList< FileFormatMigration::Message > > &upgradeMessages, QObject *parent=nullptr) noexcept
 
 ~ProjectEditor () noexcept
 
GuiApplicationgetApp () noexcept
 
WorkspacegetWorkspace () noexcept
 
ProjectgetProject () noexcept
 
UndoStackgetUndoStack () noexcept
 
const QVector< std::shared_ptr< SchematicEditor > > & getSchematics () noexcept
 
const QVector< std::shared_ptr< BoardEditor > > & getBoards () noexcept
 
int getUiIndex () const noexcept
 
void setUiIndex (int index) noexcept
 
ui::ProjectData getUiData () const noexcept
 
void setUiData (const ui::ProjectData &data) noexcept
 
void trigger (ui::ProjectAction a) noexcept
 
bool getUseIeee315Symbols () const noexcept
 
std::shared_ptr< const QSet< const NetSignal * > > getHighlightedNetSignals () const noexcept
 
void setHighlightedNetSignals (const QSet< const NetSignal * > &netSignals) noexcept
 
bool requestClose () noexcept
 Request to close the project.
 
bool saveProject () noexcept
 Save the whole project to the harddisc.
 
bool autosaveProject () noexcept
 Make a automatic backup of the project (save to temporary files)
 
void setManualModificationsMade () noexcept
 Set the flag that manual modifications (no undo stack) are made.
 
void execSetupDialog () noexcept
 
void execOutputJobsDialog () noexcept
 
void execBomGeneratorDialog (const Board *board) noexcept
 
void execLppzExportDialog (QWidget *parent) noexcept
 Execute the *.lppz export dialog (blocking)
 
std::shared_ptr< SchematicEditorexecNewSheetDialog () noexcept
 
void execRenameSheetDialog (int index) noexcept
 
void execDeleteSheetDialog (int index) noexcept
 
std::shared_ptr< BoardEditorexecNewBoardDialog (std::optional< int > copyFromIndex) noexcept
 
void execDeleteBoardDialog (int index) noexcept
 
void registerActiveSchematicTab (SchematicTab *tab) noexcept
 
void unregisterActiveSchematicTab (SchematicTab *tab) noexcept
 
ProjectEditoroperator= (const ProjectEditor &rhs)=delete
 

Public Attributes

Signal< ProjectEditoronUiDataChanged
 

Private Member Functions

void showUpgradeMessages () noexcept
 Show a dialog with all project file format upgrade messages.
 
void scheduleErcRun () noexcept
 
void runErc () noexcept
 
void projectSettingsChanged () noexcept
 

Private Attributes

GuiApplicationmApp
 
WorkspacemWorkspace
 
std::unique_ptr< ProjectmProject
 
int mUiIndex
 
bool mUseIeee315Symbols
 
QList< FileFormatMigration::MessagemUpgradeMessages
 
std::shared_ptr< UiObjectList< SchematicEditor, ui::SchematicData > > mSchematics
 
std::shared_ptr< UiObjectList< BoardEditor, ui::BoardData > > mBoards
 
std::unique_ptr< UndoStackmUndoStack
 
std::shared_ptr< QSet< const NetSignal * > > mHighlightedNetSignals
 
QVector< QPointer< SchematicTab > > mActiveSchematicTabs
 
std::shared_ptr< RuleCheckMessagesModelmErcMessages
 
QSet< SExpressionmSupportedErcApprovals
 
QSet< SExpressionmDisappearedErcApprovals
 
QString mErcExecutionError
 
QTimer mErcTimer
 
bool mManualModificationsMade
 Modifications bypassing the undo stack.
 
uint mLastAutosaveStateId
 The UndoStack state ID of the last successful project (auto)save.
 
QTimer mAutoSaveTimer
 

Detailed Description

The ProjectEditor class.

Constructor & Destructor Documentation

◆ ProjectEditor() [1/3]

ProjectEditor ( )
delete

◆ ProjectEditor() [2/3]

ProjectEditor ( const ProjectEditor other)
delete

◆ ProjectEditor() [3/3]

ProjectEditor ( GuiApplication app,
std::unique_ptr< Project project,
int  uiIndex,
const std::optional< QList< FileFormatMigration::Message > > &  upgradeMessages,
QObject *  parent = nullptr 
)
explicitnoexcept
+ Here is the call graph for this function:

◆ ~ProjectEditor()

~ProjectEditor ( )
noexcept

Member Function Documentation

◆ getApp()

GuiApplication & getApp ( )
inlinenoexcept

◆ getWorkspace()

Workspace & getWorkspace ( )
inlinenoexcept

◆ getProject()

Project & getProject ( )
inlinenoexcept

◆ getUndoStack()

UndoStack & getUndoStack ( )
inlinenoexcept
+ Here is the caller graph for this function:

◆ getSchematics()

const QVector< std::shared_ptr< SchematicEditor > > & getSchematics ( )
inlinenoexcept

◆ getBoards()

const QVector< std::shared_ptr< BoardEditor > > & getBoards ( )
inlinenoexcept

◆ getUiIndex()

int getUiIndex ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ setUiIndex()

void setUiIndex ( int  index)
noexcept

◆ getUiData()

ui::ProjectData getUiData ( ) const
noexcept
+ Here is the call graph for this function:

◆ setUiData()

void setUiData ( const ui::ProjectData &  data)
noexcept

◆ trigger()

void trigger ( ui::ProjectAction  a)
noexcept
+ Here is the call graph for this function:

◆ getUseIeee315Symbols()

bool getUseIeee315Symbols ( ) const
inlinenoexcept

◆ getHighlightedNetSignals()

std::shared_ptr< const QSet< const NetSignal * > > getHighlightedNetSignals ( ) const
inlinenoexcept
+ Here is the caller graph for this function:

◆ setHighlightedNetSignals()

void setHighlightedNetSignals ( const QSet< const NetSignal * > &  netSignals)
noexcept

◆ requestClose()

bool requestClose ( )
noexcept

Request to close the project.

If there are unsaved changes to the project, this method will ask the user whether the changes should be saved or not. If the user clicks on "cancel" or the project could not be saved successfully, this method will return false. If there were no unsaved changes or they were successfully saved, the method returns true.

Return values
trueProject is safe to be closed.
falseProject still has unsaved changes.

◆ saveProject()

bool saveProject ( )
noexcept

Save the whole project to the harddisc.

Note
The whole save procedere is described in Atomic Saving Procedure.
Returns
true on success, false on failure
+ Here is the call graph for this function:

◆ autosaveProject()

bool autosaveProject ( )
noexcept

Make a automatic backup of the project (save to temporary files)

Note
The whole save procedere is described in Atomic Saving Procedure.
Returns
true on success, false on failure
+ Here is the call graph for this function:

◆ setManualModificationsMade()

void setManualModificationsMade ( )
noexcept

Set the flag that manual modifications (no undo stack) are made.

◆ execSetupDialog()

void execSetupDialog ( )
noexcept

◆ execOutputJobsDialog()

void execOutputJobsDialog ( )
noexcept

◆ execBomGeneratorDialog()

void execBomGeneratorDialog ( const Board board)
noexcept

◆ execLppzExportDialog()

void execLppzExportDialog ( QWidget *  parent)
noexcept

Execute the *.lppz export dialog (blocking)

Parameters
parentparent widget of the dialog
+ Here is the call graph for this function:

◆ execNewSheetDialog()

std::shared_ptr< SchematicEditor > execNewSheetDialog ( )
noexcept
+ Here is the call graph for this function:

◆ execRenameSheetDialog()

void execRenameSheetDialog ( int  index)
noexcept
+ Here is the call graph for this function:

◆ execDeleteSheetDialog()

void execDeleteSheetDialog ( int  index)
noexcept
+ Here is the call graph for this function:

◆ execNewBoardDialog()

std::shared_ptr< BoardEditor > execNewBoardDialog ( std::optional< int >  copyFromIndex)
noexcept
+ Here is the call graph for this function:

◆ execDeleteBoardDialog()

void execDeleteBoardDialog ( int  index)
noexcept
+ Here is the call graph for this function:

◆ registerActiveSchematicTab()

void registerActiveSchematicTab ( SchematicTab tab)
noexcept
+ Here is the caller graph for this function:

◆ unregisterActiveSchematicTab()

void unregisterActiveSchematicTab ( SchematicTab tab)
noexcept
+ Here is the caller graph for this function:

◆ operator=()

ProjectEditor & operator= ( const ProjectEditor rhs)
delete

◆ uiIndexChanged

void uiIndexChanged ( )
signal
+ Here is the caller graph for this function:

◆ manualModificationsMade

void manualModificationsMade ( )
signal
+ Here is the caller graph for this function:

◆ projectAboutToBeSaved

void projectAboutToBeSaved ( )
signal

◆ projectSavedToDisk

void projectSavedToDisk ( )
signal

◆ ercUnapprovedCountChanged

void ercUnapprovedCountChanged ( )
signal

◆ highlightedNetSignalsChanged

void highlightedNetSignalsChanged ( )
signal
+ Here is the caller graph for this function:

◆ projectLibraryUpdaterRequested

void projectLibraryUpdaterRequested ( const FilePath fp)
signal

◆ statusBarMessageChanged

void statusBarMessageChanged ( const QString &  message,
int  timeoutMs 
)
signal

◆ abortBlockingToolsInOtherEditors

void abortBlockingToolsInOtherEditors ( const void *  source)
signal

Abort any active (blocking) tools in other editors.

If an undo command group is already active while starting a new tool, try to abort any active tool in other editors since it is annoying to block one editor by another editor (an error message would appear). However, do NOT abort tools in the own editor since this could lead to unexpected/wrong behavior (e.g. recursion)!

Parameters
sourceThe calling editor (any kind of type), which will not be aborted. Typically, a librepcb::editor::WindowTab pointer is passed. Pass nullptr to abort in all editors.
+ Here is the caller graph for this function:

◆ showUpgradeMessages()

void showUpgradeMessages ( )
privatenoexcept

Show a dialog with all project file format upgrade messages.

+ Here is the call graph for this function:

◆ scheduleErcRun()

void scheduleErcRun ( )
privatenoexcept

◆ runErc()

void runErc ( )
privatenoexcept
+ Here is the call graph for this function:

◆ projectSettingsChanged()

void projectSettingsChanged ( )
privatenoexcept

Member Data Documentation

◆ onUiDataChanged

Signal<ProjectEditor> onUiDataChanged

◆ mApp

GuiApplication& mApp
private

◆ mWorkspace

Workspace& mWorkspace
private

◆ mProject

std::unique_ptr<Project> mProject
private

◆ mUiIndex

int mUiIndex
private

◆ mUseIeee315Symbols

bool mUseIeee315Symbols
private

◆ mUpgradeMessages

QList<FileFormatMigration::Message> mUpgradeMessages
private

◆ mSchematics

std::shared_ptr<UiObjectList<SchematicEditor, ui::SchematicData> > mSchematics
private

◆ mBoards

std::shared_ptr<UiObjectList<BoardEditor, ui::BoardData> > mBoards
private

◆ mUndoStack

std::unique_ptr<UndoStack> mUndoStack
private

◆ mHighlightedNetSignals

std::shared_ptr<QSet<const NetSignal*> > mHighlightedNetSignals
private

◆ mActiveSchematicTabs

QVector<QPointer<SchematicTab> > mActiveSchematicTabs
private

◆ mErcMessages

std::shared_ptr<RuleCheckMessagesModel> mErcMessages
private

◆ mSupportedErcApprovals

QSet<SExpression> mSupportedErcApprovals
private

◆ mDisappearedErcApprovals

QSet<SExpression> mDisappearedErcApprovals
private

◆ mErcExecutionError

QString mErcExecutionError
private

◆ mErcTimer

QTimer mErcTimer
private

◆ mManualModificationsMade

bool mManualModificationsMade
private

Modifications bypassing the undo stack.

◆ mLastAutosaveStateId

uint mLastAutosaveStateId
private

The UndoStack state ID of the last successful project (auto)save.

◆ mAutoSaveTimer

QTimer mAutoSaveTimer
private

The timer for the periodically automatic saving functionality (see also Atomic Saving Procedure)


The documentation for this class was generated from the following files: