|
wiRedPanda
Logic Circuit Simulator
|
The top-level application window hosting the tab bar, menus, element palette, and editor. More...
#include <MainWindow.h>
Public Member Functions | |
| void | createNewTab () |
| Creates a new empty circuit tab. | |
| QDir | currentDir () const override |
| Returns the directory of the currently active .panda file. | |
| QFileInfo | currentFile () const override |
| Returns the QFileInfo of the currently active .panda file. | |
| WorkSpace * | currentTab () const override |
| Returns the currently visible WorkSpace tab, or nullptr. | |
| QString | dolphinFileName () override |
| Returns the BeWavedDolphin file name associated with the current tab. | |
| DolphinHost * | dolphinHost () override |
| bool | event (QEvent *event) override |
| void | exportToArduino (QString fileName) |
| Generates Arduino sketch code for the current circuit. | |
| void | exportToSystemVerilog (QString fileName) |
| Generates SystemVerilog code for the current circuit. | |
| void | exportToWaveFormFile (const QString &fileName) |
| Saves the BeWavedDolphin waveform session to fileName. | |
| void | exportToWaveFormTerminal () |
| Exports the current waveform simulation to standard output (terminal). | |
| bool | hasModifiedFiles () |
| Returns true if any open workspace has unsaved changes or is a recovered autosave. | |
| void | loadPandaFile (const QString &fileName) |
| Loads a .panda circuit file into the current or a new tab. | |
| void | loadTranslation (const QString &language) |
| Loads and installs the Qt translation for language. | |
| MainWindow (const QString &fileName={}, QWidget *parent=nullptr) | |
| Constructs the MainWindow and optionally opens fileName on start. | |
| void | openICInTab (const QString &blobName, int icElementId, const QByteArray &blob) |
| Opens an embedded IC blob for editing in a new tab. | |
| ElementPalette * | palette () const override |
| void | populateLanguageMenu () |
| Populates the Language submenu with available translations. | |
| void | refreshICButtonsEnabled () override |
| void | requestSave () override |
| void | retranslateUi () |
| Re-applies all translatable strings to the UI after a language change. | |
| void | save (const QString &fileName={}) override |
| Saves the current circuit to fileName (or prompts if empty). | |
| void | setDolphinFileName (const QString &fileName) override |
| Associates fileName as the BeWavedDolphin file for the current tab. | |
| void | setFastMode (const bool fastMode) |
| Enables or disables fast (non-antialiased) rendering for all views. | |
| void | setICButtonsVisible (bool visible) override |
| QString | shortcutsHelpHtml () const |
| void | show () |
| Shows the window and initializes child widget state. | |
| void | showStatusMessage (const QString &message, int timeout) override |
| QWidget * | widget () override |
| ~MainWindow () override | |
| Public Member Functions inherited from DolphinHost | |
| virtual | ~DolphinHost ()=default |
| Public Member Functions inherited from MainWindowHost | |
| virtual | ~MainWindowHost ()=default |
Protected Member Functions | |
| void | closeEvent (QCloseEvent *event) override |
Friends | |
| class | TestMainWindowGui |
The top-level application window hosting the tab bar, menus, element palette, and editor.
MainWindow orchestrates the full editing workflow: it owns the tab widget (each tab is a WorkSpace), connects undo/redo stacks, handles file open/save/export, manages translations, and integrates the element palette, element editor, and IC list panel.
Definition at line 45 of file MainWindow.h.
|
explicit |
Constructs the MainWindow and optionally opens fileName on start.
| fileName | Optional .panda file to load at startup. |
| parent | Optional parent widget. |
Definition at line 85 of file MainWindow.cpp.
References createNewTab(), AppVersion::current, currentTab(), WorkspaceManager::currentTabChanged(), Settings::fileName(), SceneUiBinder::loadFileRequested(), loadPandaFile(), WorkspaceManager::loadPandaFile(), Settings::minimapVisible(), WorkspaceManager::openICInTab(), SceneUiBinder::openICRequested(), ExerciseTourResources::preferredContentDir(), qCDebug, WorkSpace::setMinimapVisible(), and WorkspaceManager::titleChanged().
|
override |
Definition at line 458 of file MainWindow.cpp.
|
overrideprotected |
| void MainWindow::createNewTab | ( | ) |
Creates a new empty circuit tab.
Definition at line 469 of file MainWindow.cpp.
Referenced by MainWindow().
|
overridevirtual |
Returns the directory of the currently active .panda file.
Implements DolphinHost.
Definition at line 736 of file MainWindow.cpp.
|
overridevirtual |
Returns the QFileInfo of the currently active .panda file.
Implements DolphinHost.
Definition at line 726 of file MainWindow.cpp.
|
overridevirtual |
Returns the currently visible WorkSpace tab, or nullptr.
Implements MainWindowHost.
Definition at line 783 of file MainWindow.cpp.
Referenced by main(), MainWindow(), refreshICButtonsEnabled(), and setFastMode().
|
overridevirtual |
Returns the BeWavedDolphin file name associated with the current tab.
Implements DolphinHost.
Definition at line 1276 of file MainWindow.cpp.
|
overridevirtual |
Implements MainWindowHost.
Definition at line 746 of file MainWindow.cpp.
|
override |
Definition at line 1341 of file MainWindow.cpp.
References event().
Referenced by closeEvent(), and event().
| void MainWindow::exportToArduino | ( | QString | fileName | ) |
Generates Arduino sketch code for the current circuit.
| fileName | Output .ino file path. |
Definition at line 878 of file MainWindow.cpp.
Referenced by main().
| void MainWindow::exportToSystemVerilog | ( | QString | fileName | ) |
Generates SystemVerilog code for the current circuit.
| fileName | Output .sv file path. |
Definition at line 883 of file MainWindow.cpp.
| void MainWindow::exportToWaveFormFile | ( | const QString & | fileName | ) |
Saves the BeWavedDolphin waveform session to fileName.
| fileName | Output .dolphin file path. |
Definition at line 888 of file MainWindow.cpp.
Referenced by main().
| void MainWindow::exportToWaveFormTerminal | ( | ) |
Exports the current waveform simulation to standard output (terminal).
Definition at line 893 of file MainWindow.cpp.
Referenced by main().
| bool MainWindow::hasModifiedFiles | ( | ) |
Returns true if any open workspace has unsaved changes or is a recovered autosave.
Definition at line 731 of file MainWindow.cpp.
| void MainWindow::loadPandaFile | ( | const QString & | fileName | ) |
Loads a .panda circuit file into the current or a new tab.
| fileName | Absolute path to the .panda file. |
Definition at line 565 of file MainWindow.cpp.
Referenced by main(), and MainWindow().
| void MainWindow::loadTranslation | ( | const QString & | language | ) |
Loads and installs the Qt translation for language.
| language | BCP-47 language code. |
Definition at line 1038 of file MainWindow.cpp.
| void MainWindow::openICInTab | ( | const QString & | blobName, |
| int | icElementId, | ||
| const QByteArray & | blob ) |
Opens an embedded IC blob for editing in a new tab.
Definition at line 570 of file MainWindow.cpp.
|
overridevirtual |
Implements MainWindowHost.
Definition at line 751 of file MainWindow.cpp.
| void MainWindow::populateLanguageMenu | ( | ) |
Populates the Language submenu with available translations.
Definition at line 1043 of file MainWindow.cpp.
References Settings::language().
|
overridevirtual |
Implements MainWindowHost.
Definition at line 717 of file MainWindow.cpp.
References currentTab(), and WorkSpace::fileInfo().
|
overridevirtual |
Implements MainWindowHost.
Definition at line 756 of file MainWindow.cpp.
| void MainWindow::retranslateUi | ( | ) |
Re-applies all translatable strings to the UI after a language change.
Definition at line 990 of file MainWindow.cpp.
|
overridevirtual |
Saves the current circuit to fileName (or prompts if empty).
| fileName | Absolute path; empty triggers a Save-As dialog. |
Implements DolphinHost.
Definition at line 490 of file MainWindow.cpp.
|
overridevirtual |
Associates fileName as the BeWavedDolphin file for the current tab.
| fileName | Path to the .dolphin file. |
Implements DolphinHost.
Definition at line 1281 of file MainWindow.cpp.
| void MainWindow::setFastMode | ( | const bool | fastMode | ) |
Enables or disables fast (non-antialiased) rendering for all views.
| fastMode | true to use fast rendering. |
Definition at line 474 of file MainWindow.cpp.
References currentTab(), GraphicsView::setFastMode(), and WorkSpace::view().
|
overridevirtual |
Implements MainWindowHost.
Definition at line 710 of file MainWindow.cpp.
| QString MainWindow::shortcutsHelpHtml | ( | ) | const |
Rich-text body of the "Shortcuts and Tips" dialog, generated from this window's actions so the list can never drift from the real key bindings and picks up any action added later. Public so GUI tests can assert its completeness without opening a modal dialog.
Definition at line 598 of file MainWindow.cpp.
| void MainWindow::show | ( | ) |
Shows the window and initializes child widget state.
Definition at line 495 of file MainWindow.cpp.
References Application::interactiveMode, qCDebug, Settings::setWelcomeTourShown(), and Settings::welcomeTourShown().
|
overridevirtual |
Implements MainWindowHost.
Definition at line 761 of file MainWindow.cpp.
|
overridevirtual |
Implements MainWindowHost.
Definition at line 741 of file MainWindow.cpp.
|
friend |
Definition at line 48 of file MainWindow.h.
References TestMainWindowGui.
Referenced by TestMainWindowGui.