The ProjectEditor class.
More...
#include <projecteditor.h>
Inherits QObject.
◆ ProjectEditor() [1/3]
◆ ProjectEditor() [2/3]
◆ ProjectEditor() [3/3]
◆ ~ProjectEditor()
◆ getWorkspace()
◆ getProject()
◆ getUpgradeMessageLabelText()
const QString & getUpgradeMessageLabelText |
( |
| ) |
const |
|
inlinenoexcept |
◆ getDefaultLengthUnit()
◆ getUndoStack()
Get a reference to the undo stack of the project.
- Returns
- A reference to the UndoStack object
◆ getComponentResources()
◆ addResourcesToMenu()
void addResourcesToMenu |
( |
MenuBuilder & |
mb, |
|
|
const ComponentInstance & |
cmp, |
|
|
const tl::optional< Uuid > & |
filterDev, |
|
|
QPointer< QWidget > |
editor, |
|
|
QMenu * |
root |
|
) |
| const |
|
noexcept |
◆ abortBlockingToolsInOtherEditors()
void abortBlockingToolsInOtherEditors |
( |
QWidget * |
editor | ) |
|
|
noexcept |
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
-
editor | The calling editor, which will not be aborted. |
◆ windowIsAboutToClose()
bool windowIsAboutToClose |
( |
QMainWindow & |
window | ) |
|
|
noexcept |
Inform the editor that a project related window is about to close.
The project must be closed and destroyed automatically after the last opened window of the project is closed, because without a window the user is no longer able to close the project himself. So, every project related window have to "ask" the librepcb::editor::ProjectEditor object whether it is allowed to close or not. If the last opened window wants to close, the editor will first ask the user if unsaved changes should be written to the harddisc. Only if the user accepts this question and the project is saved successfully, the method will return true to allow the last window to close. Then it will also close the whole project.
- Parameters
-
window | A reference to the window which is about to close |
- Returns
- true if the window can be closed, false if closing the window is denied
◆ operator=()
◆ showUpgradeMessages
void showUpgradeMessages |
( |
QWidget * |
parent | ) |
|
|
slotnoexcept |
Show a dialog with all project file format upgrade messages.
- Parameters
-
◆ showAllRequiredEditors
void showAllRequiredEditors |
( |
| ) |
|
|
slotnoexcept |
Open the schematic and/or the board editor window.
Which editors this will open depends on whether the project has schematics and/or boards. If there aren't any boards or schematics, the schematic editor will be shown anyway (otherwise the whole project editor would be invisible).
◆ showSchematicEditor
void showSchematicEditor |
( |
| ) |
|
|
slotnoexcept |
Open the schematic editor window and bring it to the front.
◆ showBoardEditor
Open the board editor window and bring it to the front.
◆ execLppzExportDialog
void execLppzExportDialog |
( |
QWidget * |
parent = nullptr | ) |
|
|
slotnoexcept |
Execute the *.lppz export dialog (blocking!)
- Parameters
-
parent | parent widget of the dialog (optional) |
◆ execOrderPcbDialog
void execOrderPcbDialog |
( |
QWidget * |
parent = nullptr | ) |
|
|
slotnoexcept |
Execute the PCB order dialog (blocking!)
- Parameters
-
parent | Parent widget of the dialog (optional) |
◆ saveProject
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
◆ autosaveProject
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
◆ closeAndDestroy
bool closeAndDestroy |
( |
bool |
askForSave, |
|
|
QWidget * |
msgBoxParent = 0 |
|
) |
| |
|
slotnoexcept |
Close the project (this will destroy this object!)
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 was no such error, this method will call QObject::deleteLater() which means that this object will be deleted in the Qt's event loop.
- Warning
- This method can be called both from within this class and from outside this class (for example from the control panel). But if you call this method from outside this class, you may have to delete the object yourself afterwards! In special cases, the deleteLater() mechanism could lead in fatal errors otherwise!
- Parameters
-
askForSave | If true and there are unsaved changes, this method shows a message box to ask whether the project should be saved or not. If false, the project will NOT be saved. |
msgBoxParent | Here you can specify a parent window for the message box |
- Returns
- true on success (project closed), false on failure (project stays open)
◆ setManualModificationsMade
void setManualModificationsMade |
( |
| ) |
|
|
inlineslotnoexcept |
Set the flag that manual modifications (no undo stack) are made.
◆ setErcMessageApproved
Approve/unapprove an ERC message.
- Parameters
-
msg | The message to modify |
approve | The new approval state |
◆ getHighlightedNetSignals
std::shared_ptr< const QSet< const NetSignal * > > getHighlightedNetSignals |
( |
| ) |
const |
|
inlineslotnoexcept |
◆ setHighlightedNetSignals
void setHighlightedNetSignals |
( |
const QSet< const NetSignal * > & |
netSignals | ) |
|
|
slotnoexcept |
◆ clearHighlightedNetSignals
void clearHighlightedNetSignals |
( |
| ) |
|
|
slotnoexcept |
◆ ercFinished
◆ highlightedNetSignalsChanged
void highlightedNetSignalsChanged |
( |
| ) |
|
|
signal |
◆ projectAboutToBeSaved
void projectAboutToBeSaved |
( |
| ) |
|
|
signal |
◆ projectSavedToDisk
void projectSavedToDisk |
( |
| ) |
|
|
signal |
◆ showControlPanelClicked
void showControlPanelClicked |
( |
| ) |
|
|
signal |
◆ openProjectLibraryUpdaterClicked
void openProjectLibraryUpdaterClicked |
( |
const FilePath & |
fp | ) |
|
|
signal |
◆ projectEditorClosed
void projectEditorClosed |
( |
| ) |
|
|
signal |
◆ showTemporaryStatusBarMessage
void showTemporaryStatusBarMessage |
( |
const QString & |
message, |
|
|
int |
timeoutMs |
|
) |
| |
|
signal |
◆ runErc()
◆ saveErcMessageApprovals()
void saveErcMessageApprovals |
( |
const QSet< SExpression > & |
approvals | ) |
|
|
privatenoexcept |
◆ getCountOfVisibleEditorWindows()
int getCountOfVisibleEditorWindows |
( |
| ) |
const |
|
privatenoexcept |
◆ searchAndOpenDatasheet()
void searchAndOpenDatasheet |
( |
const QString & |
mpn, |
|
|
const QString & |
manufacturer, |
|
|
QPointer< QWidget > |
parent |
|
) |
| const |
|
privatenoexcept |
◆ mWorkspace
◆ mProject
◆ mUpgradeMessages
◆ mUpgradeMessageLabelText
QString mUpgradeMessageLabelText |
|
private |
◆ mAutoSaveTimer
◆ mSupportedErcApprovals
◆ mDisappearedErcApprovals
◆ mErcMessages
◆ mHighlightedNetSignals
std::shared_ptr<QSet<const NetSignal*> > mHighlightedNetSignals |
|
private |
◆ mUndoStack
◆ mSchematicEditor
The schematic editor (GUI)
◆ mBoardEditor
◆ mLastAutosaveStateId
uint mLastAutosaveStateId |
|
private |
The UndoStack state ID of the last successful project (auto)save.
◆ mManualModificationsMade
bool mManualModificationsMade |
|
private |
Modifications bypassing the undo stack.
The documentation for this class was generated from the following files: