Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
MainWindow Class Reference

The MainWindow class is the main window of the application. More...

#include <main_window.h>

Inheritance diagram for MainWindow:
MainWindowLayout

Public Member Functions

 MainWindow (QApplication *app, oclero::qlementine::ThemeManager *themeManager, QWidget *parent=nullptr)
 Constructs a new MainWindow object.
 ~MainWindow ()
 Destroys the MainWindow object.
VoidResult start ()
 Starts the application.
Public Member Functions inherited from MainWindowLayout
 MainWindowLayout (QWidget *parent=nullptr)
 Constructs a new MainWindowLayout object.

Private Slots

void onNodeSelected (NodeItem *node, bool selected)
 Handles node selection events.
void onNodeAdded (NodeItem *node)
 Handles node addition events.
void onNodeRemoved (const QString &nodeId, const QString &parentId)
 Handles node removal events.
void onNodeModified (NodeItem *node)
 Handles node modification events.
void onOpenFlow (Flow *flow, const QString &nodeId, const maki::FocusProperties &properties)
 Handles open flow events.
void onFlowAdded (Flow *flow, NodeItem *node)
 Handles flow addition events.
void onFlowRemoved (const QString &flowId, NodeItem *node)
 Handles flow removal events.
void changeEvent (QEvent *event) override
 Handles change events.

Private Member Functions

Canvas * canvas () const
 Pointer to the QApplication instance.
Canvas * rootCanvas () const
 Returns the root canvas.
VoidResult loadElements ()
 Loads elements into the application.
VoidResult loadLibrary (const JSON &config, bool dataOnly)
 Loads a library based on the provided configuration.
VoidResult loadElementLibrary (const QString &name, const JSON &config, bool dataOnly)
 Loads an element library based on the provided name and configuration.
void bind ()
 Binds signals and slots for the application.
void bindCanvas ()
 Binds signals and slots for the canvas.
void unbindCanvas ()
 Unbinds signals and slots for the canvas.
void bindShortcuts ()
 Binds shortcuts to actions.
void startUI ()
 Starts the user interface.
void onCanvasTabChanged (int index)
 Handles changes in the canvas tab.
void closeCanvasTab (int index)
 Closes a canvas tab at the specified index.
int libraryTypeToIndex (Types::LibraryTypes type) const
 Converts a library type to its corresponding index.
void onThemeChanged (const AppearanceSettings &themeName, bool intialConfig)
 Handles theme change events.
void onSettingsChanged ()
 Handles settings change events.
void showAboutDialog ()
 Shows the about dialog.
void addBrowserTab ()
 Adds a browser tab to the application.
void addPluginTab (const QString &name, PluginView *view)
 Adds a plugin tab with the specified name and view.
void removePluginTab (PluginView *view)
 Removes a plugin tab with the specified name.
void addEditorTab (QPlainTextEdit *view)
 Adds an editor tab with the specified view.
void onActionLoad (const QString &filename, bool fromTemplate=false)
 Handles new action.
VoidResult onActionSave ()
 Handles load action with a specified file name.
void onActionExit ()
 Handles save action.
void onActionRestart ()
 Handles exit action.
void onActionSaveAs ()
 Handles restart action.
void onActionGenerate (const QString &pipelineId, bool fromScratch)
 Handles save as action.
void onActionDeletePipeline (const QString &pipelineId)
 Handles generate action.
void onActionEditPipeline (const QString &pipelineId)
 Handles pipeline deletion.
void onActionRenamePipeline (const QString &pipelineId)
 Handles generate action.
void onActionLogLevelChanged ()
 Handles generate action.
void onFileLoaded (const QString &file, const SaveInfo &info, const QString &error, bool fromTemplate)
 Handles log level change action.

Private Attributes

std::unique_ptr< PluginManager > mPluginManager
 Handler for saving data.
std::shared_ptr< ConfigurationTable > mConfigTable
 Manager for plugins.
std::shared_ptr< SettingsManager > mSettingsManager
 Configuration table shared pointer.
std::shared_ptr< LanguageManager > mLanguageManager
 Settings manager shared pointer.
Pipeline * mPipeline = nullptr
 Language manager shared pointer.
Generator * mGenerator = nullptr
 Pointer to the pipeline.
HostServices * mHostServices = nullptr
 Pointer to the generator.
Canvas * mActiveCanvas = nullptr
 Pointer to the host services.
PluginTab * mPluginTab = nullptr
 Pointer to the active canvas.
NotificationManager * mNotificationManager = nullptr
 Pointer to the plugin tab.
Logger * mLogger = nullptr
 Pointer to the notification manager.
maki::PluginPipeline * mPluginPipeline = nullptr
 Pointer to the logger.
std::shared_ptr< SaveInfo > mStorage
 Pointer to the theme manager.
std::shared_ptr< EdgeRouter > mRouter
 Shared pointer to save information.

Additional Inherited Members

Protected Member Functions inherited from MainWindowLayout
void onLanguageChanged ()
 Index of the process tab.
void toggleGenerationButton (bool running)
 Toggles the generation button state.
Protected Attributes inherited from MainWindowLayout
QSplitter * mMainSplitter
 Pointer to the central widget.
QTabWidget * mPalette
 Pointer to the main splitter.
StyledFrame * mStructureTab
 Pointer to the palette tab widget.
QScrollArea * mStructureScrollArea
 Pointer to the structure tab frame.
StyledFrame * mBehaviourTab
 Pointer to the structure scroll area.
QScrollArea * mBehaviourScrollArea
 Pointer to the behaviour tab frame.
StyledFrame * mPipelineTab
 Pointer to the behaviour scroll area.
QScrollArea * mPipelineScrollArea
 Pointer to the pipeline tab frame.
maki::SearchWidget * mPaletteSearch
 Pointer to the pipeline scroll area.
QSplitter * mLeftPanel
 Pointer to the palette search widget.
ExecuteButton * mPipelineRun
 Pointer to the left panel splitter.
oclero::qlementine::LoadingSpinner * mGenerationSpinner
 Pointer to the generator option combo box.
QSplitter * mCentralSplitter
 Pointer to the generation spinner.
QTabWidget * mCanvasPanel
 Pointer to the central splitter.
QPushButton * mBrowserTabButton
 Pointer to the canvas panel tab widget.
QWidget * mBottomContainer
 Pointer to the browser tab button.
oclero::qlementine::NavigationBar * mBottomNavigation
 Pointer to the bottom panel stacked widget.
LogTableWidget * mLogTable
 Pointer to the bottom navigation bar.
QTextBrowser * mInfoText
 Pointer to the log table widget.
ProcessTab * mProcessTab
 Pointer to the info text browser.
maki::MissionParameterWidget * mMissionParameters
 Pointer to the process tab.
QTabWidget * mNavigationTab
 Pointer to the right panel splitter.
SystemMenu * mSystemMenu
 Pointer to the navigation tab widget.
GeneratedFilesPanel * mFileMenu
 Pointer to the system menu.
QTabWidget * mPropertiesTab
 Pointer to the file menu.
PropertiesMenu * mPropertiesMenu
 Pointer to the properties tab widget.
QMenuBar * mMenuBar
 Pointer to the properties menu.
QAction * mActionNew
 Pointer to the menu bar.
QAction * mActionNewFromTemplate
 Pointer to the new action.
QAction * mActionOpen
 Pointer to the new from template action.
QMenu * mActionOpenRecent
 Pointer to the open action.
QAction * mActionSave
 Pointer to the open recent menu.
QAction * mActionSaveAs
 Pointer to the save action.
QAction * mActionImportLibrary
 Pointer to the save as action.
QAction * mActionInstallPlugin
 Pointer to the import library action.
QAction * mActionExit
 Pointer to the install plugin action.
QUndoGroup * mUndoGroup
 Pointer to the exit action.
QAction * mActionUndo
 Pointer to the undo group.
QAction * mActionRedo
 Pointer to the undo action.
QAction * mActionCopy
 Pointer to the redo action.
QAction * mActionPaste
 Pointer to the copy action.
QAction * mActionCut
 Pointer to the paste action.
QAction * mActionDelete
 Pointer to the cut action.
QAction * mActionZoomIn
 Pointer to the delete action.
QAction * mActionZoomOut
 Pointer to the zoom in action.
QAction * mActionResetZoom
 Pointer to the zoom out action.
QAction * mActionFitToScreen
 Pointer to the reset zoom action.
QAction * mActionToggleToasts
 Pointer to the fit to screen action.
QAction * mOpenComponentsPanel
 Pointer to the minimize notification toasts action.
QAction * mOpenPropertiesPanel
 Pointer to the open components panel action.
QAction * mOpenInfoPanel
 Pointer to the open properties panel action.
QMenu * mSpecialTabsMenu
 Pointer to the open info panel action.
QMenu * mGeneratorMenu
 Pointer to the special tabs menu.
QAction * mActionAutoRoute
 Pointer to the generator menu.
QAction * mActionSimulate
 Pointer to the generate action.
QAction * mActionToggleGrid
 Pointer to the simulate action.
QAction * mActionQuickStartGuide
 Pointer to the documentation action.
QAction * mOpenAllSettings
 Pointer to the quick start guide action.
QAction * mActionShortcuts
 Pointer to the open all settings action.
QAction * mActionReportIssue
 Pointer to the shortcuts action.
QAction * mAboutAction
 Pointer to the report issue action.
int LOG_TAB_INDEX = 0
 Pointer to the about action.
int PROCESS_TAB_INDEX = 0
 Index of the log tab.

Detailed Description

The MainWindow class is the main window of the application.

Constructor & Destructor Documentation

◆ MainWindow()

MainWindow::MainWindow ( QApplication * app,
oclero::qlementine::ThemeManager * themeManager,
QWidget * parent = nullptr )
explicit

Constructs a new MainWindow object.

Parameters
appPointer to the QApplication instance.
themeManagerPointer to the ThemeManager instance.
parentPointer to the parent widget, if any.

Member Function Documentation

◆ addEditorTab()

void MainWindow::addEditorTab ( QPlainTextEdit * view)
private

Adds an editor tab with the specified view.

Parameters
viewPointer to the QPlainTextEdit instance.

◆ addPluginTab()

void MainWindow::addPluginTab ( const QString & name,
PluginView * view )
private

Adds a plugin tab with the specified name and view.

Parameters
nameName of the plugin tab.
viewPointer to the PluginView instance.

◆ canvas()

Canvas * MainWindow::canvas ( ) const
private

Pointer to the QApplication instance.

Returns the active canvas.

Returns
Canvas* Pointer to the active canvas.

◆ changeEvent

void MainWindow::changeEvent ( QEvent * event)
overrideprivateslot

Handles change events.

Parameters
eventPointer to the QEvent object.

◆ closeCanvasTab()

void MainWindow::closeCanvasTab ( int index)
private

Closes a canvas tab at the specified index.

Parameters
indexIndex of the tab to close.

◆ libraryTypeToIndex()

int MainWindow::libraryTypeToIndex ( Types::LibraryTypes type) const
private

Converts a library type to its corresponding index.

Parameters
typeLibrary type to convert.
Returns
int Index corresponding to the library type.

◆ loadElementLibrary()

VoidResult MainWindow::loadElementLibrary ( const QString & name,
const JSON & config,
bool dataOnly )
private

Loads an element library based on the provided name and configuration.

Parameters
nameName of the library to load.
configJSON object containing the library configuration.
Returns
VoidResult indicating success or failure.

◆ loadElements()

VoidResult MainWindow::loadElements ( )
private

Loads elements into the application.

Returns
VoidResult indicating success or failure.

◆ loadLibrary()

VoidResult MainWindow::loadLibrary ( const JSON & config,
bool dataOnly )
private

Loads a library based on the provided configuration.

Parameters
configJSON object containing the library configuration.
Returns
VoidResult indicating success or failure.

◆ onCanvasTabChanged()

void MainWindow::onCanvasTabChanged ( int index)
private

Handles changes in the canvas tab.

Parameters
indexIndex of the changed tab.

◆ onFlowAdded

void MainWindow::onFlowAdded ( Flow * flow,
NodeItem * node )
privateslot

Handles flow addition events.

Parameters
flowPointer to the added Flow.
nodePointer to the associated NodeItem.

◆ onFlowRemoved

void MainWindow::onFlowRemoved ( const QString & flowId,
NodeItem * node )
privateslot

Handles flow removal events.

Parameters
flowIdID of the removed flow.
nodeIdID of the parent node.

◆ onNodeAdded

void MainWindow::onNodeAdded ( NodeItem * node)
privateslot

Handles node addition events.

Parameters
nodePointer to the added NodeItem.

◆ onNodeModified

void MainWindow::onNodeModified ( NodeItem * node)
privateslot

Handles node modification events.

Parameters
nodePointer to the modified NodeItem.

◆ onNodeRemoved

void MainWindow::onNodeRemoved ( const QString & nodeId,
const QString & parentId )
privateslot

Handles node removal events.

Parameters
nodeIdID of the removed node.
parentIdID of the parent node.

◆ onNodeSelected

void MainWindow::onNodeSelected ( NodeItem * node,
bool selected )
privateslot

Handles node selection events.

Parameters
nodePointer to the selected NodeItem.
selectedTrue if the node is selected, false otherwise.

◆ onOpenFlow

void MainWindow::onOpenFlow ( Flow * flow,
const QString & nodeId,
const maki::FocusProperties & properties )
privateslot

Handles open flow events.

Parameters
flowPointer to the opened Flow.
nodePointer to the associated NodeItem.

◆ onThemeChanged()

void MainWindow::onThemeChanged ( const AppearanceSettings & themeName,
bool intialConfig )
private

Handles theme change events.

Parameters
tName of the new theme.
atList of theme information.

◆ removePluginTab()

void MainWindow::removePluginTab ( PluginView * view)
private

Removes a plugin tab with the specified name.

Parameters
viewPointer to the PluginView instance to be removed;

◆ rootCanvas()

Canvas * MainWindow::rootCanvas ( ) const
private

Returns the root canvas.

Returns
Canvas* Pointer to the root canvas.

◆ start()

VoidResult MainWindow::start ( )

Starts the application.

Returns
VoidResult indicating success or failure.

The documentation for this class was generated from the following files:
  • /__w/maki/maki/app/system/main_window.h
  • /__w/maki/maki/app/system/main_window.cpp