58 explicit MainWindow(
const QString &fileName = {}, QWidget *parent =
nullptr);
78 void save(
const QString &fileName = {})
override;
87 void openICInTab(
const QString &blobName,
int icElementId,
const QByteArray &blob);
99 QWidget *
widget()
override;
105 ElementPalette *
palette()
const override;
200 void onCurrentTabChanged(WorkSpace *newTab);
204 void updateWindowTitle();
210 void connectSceneAction(QAction *action,
void (Scene::*method)());
214 void createRecentFileActions();
215 void updateRecentFileActions();
216 void openRecentFile();
220 void updateSettings();
222 void aboutThisVersion();
226 void startExercise(
const QString &resourcePath);
227 void startTour(
const QString &resourcePath);
228 QRect resolveTourTarget(
const QString &
id)
const;
230 void clickTarget(
const QString &
id);
232 static void on_actionDarkTheme_triggered();
233 static void on_actionLightTheme_triggered();
234 static void on_actionSystemTheme_triggered();
235 void on_actionAboutQt_triggered();
236 void on_actionAbout_triggered();
237 void on_actionExit_triggered();
238 void on_actionFastMode_triggered(
const bool checked);
239 void on_actionFlipHorizontally_triggered();
240 void on_actionFlipVertically_triggered();
241 void on_actionAlignLeft_triggered();
242 void on_actionAlignRight_triggered();
243 void on_actionAlignTop_triggered();
244 void on_actionAlignBottom_triggered();
245 void on_actionAlignHorizontalCenter_triggered();
246 void on_actionAlignVerticalCenter_triggered();
247 void on_actionDistributeHorizontally_triggered();
248 void on_actionDistributeVertically_triggered();
249 void on_actionFullscreen_triggered();
250 void on_actionGates_triggered(
const bool checked);
251 void on_actionLabelsUnderIcons_triggered(
const bool checked);
252 void on_actionICPreview_triggered(
const bool checked);
253 void on_actionCheckForUpdates_triggered(
const bool checked);
254 void on_actionMute_triggered(
const bool checked);
255 void on_actionPlay_toggled(
const bool checked);
256 void on_actionReportTranslationError_triggered();
257 void on_actionResetZoom_triggered()
const;
258 void on_actionZoomToFit_triggered()
const;
259 void on_actionRestart_triggered();
260 void on_actionRotateLeft_triggered();
261 void on_actionRotateRight_triggered();
262 void on_actionSelectAll_triggered();
263 void on_actionShortcuts_and_Tips_triggered();
264 void on_actionShowMinimap_triggered(
const bool checked);
265 void on_actionWaveform_triggered();
266 void on_actionWires_triggered(
const bool checked);
267 void on_actionZoomIn_triggered()
const;
268 void on_actionZoomOut_triggered()
const;
272 static const char *onBeforeUnload(
int eventType,
const void *reserved,
void *userData);
278 void setupLanguage();
280 void setupGeometry();
284 void setupRecentFiles();
286 void setupExamplesMenu();
288 void setupExercisesMenu();
290 void setupToursMenu();
293 void populateContentMenu(QMenu *menu,
const QString &categoryKey,
294 const QString &openFolderText,
const QString &openFolderFailureText,
295 const QStringList &completed,
const std::function<
void(
const QString &)> &onSelect);
297 void setupShortcuts();
299 void setupConnections();
303 std::unique_ptr<MainWindowUi> m_ui;
312 static inline std::optional<QString> s_testSystemLocaleNameOverride;
317 std::function<QString(
const QString &)> m_preferredContentDirForTesting;
319 ElementPalette *m_palette =
nullptr;
320 LanguageManager *m_languageManager =
nullptr;
321 RecentFiles *m_recentFiles =
nullptr;
322 ExportController *m_exportController =
nullptr;
323 ICController *m_icController =
nullptr;
324 SceneUiBinder *m_binder =
nullptr;
325 WorkspaceManager *m_workspaceManager =
nullptr;
327 ExerciseEngine *m_exerciseEngine =
nullptr;
328 ExerciseOverlay *m_exerciseOverlay =
nullptr;
330 TourEngine *m_tourEngine =
nullptr;
333 QPointer<TourOverlay> m_tourOverlay;
335 QPointer<BewavedDolphin> m_bwd;
339 QMetaObject::Connection m_bwdDestroyed;
345 QPointer<WorkSpace> m_previousTab;
349 QPointer<ICPreviewPopup> m_icPreviewPopup;
DolphinHost: the host-application context the beWavedDolphin editor depends on.
MainWindowHost: the application context that MainWindow's extracted controllers depend on.
MainWindowUi: hand-written UI class for the MainWindow.
Waveform editor main window for creating and analyzing digital signal sequences.
Interface the host application (MainWindow) provides to BewavedDolphin.
Controller for the left-panel element palette, IC list, and search tab.
Semi-transparent overlay displayed at the bottom of the canvas during a circuit exercise.
Owns the circuit-export workflow: Arduino / SystemVerilog code, PDF / PNG images, and beWavedDolphin ...
Owns the IC management workflow: importing file-based ICs into the project directory,...
Owns the application QTranslator instances and provides language metadata.
Interface MainWindow provides to its extracted controllers (export, IC, …).
virtual QFileInfo icListFile() const =0
File info used to populate the file-based IC palette (parent workspace for inline IC tabs).
void closeEvent(QCloseEvent *event) override
void exportToSystemVerilog(QString fileName)
Generates SystemVerilog code for the current circuit.
QFileInfo currentFile() const override
Returns the QFileInfo of the currently active .panda file.
QWidget * widget() override
void loadPandaFile(const QString &fileName)
Loads a .panda circuit file into the current or a new tab.
void retranslateUi()
Re-applies all translatable strings to the UI after a language change.
void setDolphinFileName(const QString &fileName) override
Associates fileName as the BeWavedDolphin file for the current tab.
ElementPalette * palette() const override
QString shortcutsHelpHtml() const
void createNewTab()
Creates a new empty circuit tab.
QDir currentDir() const override
Returns the directory of the currently active .panda file.
void save(const QString &fileName={}) override
Saves the current circuit to fileName (or prompts if empty).
friend class TestMainWindowGui
void exportToArduino(QString fileName)
Generates Arduino sketch code for the current circuit.
QString dolphinFileName() override
Returns the BeWavedDolphin file name associated with the current tab.
WorkSpace * currentTab() const override
Returns the currently visible WorkSpace tab, or nullptr.
void populateLanguageMenu()
Populates the Language submenu with available translations.
void showStatusMessage(const QString &message, int timeout) override
void setFastMode(const bool fastMode)
Enables or disables fast (non-antialiased) rendering for all views.
void requestSave() override
void openICInTab(const QString &blobName, int icElementId, const QByteArray &blob)
Opens an embedded IC blob for editing in a new tab.
MainWindow(const QString &fileName={}, QWidget *parent=nullptr)
Constructs the MainWindow and optionally opens fileName on start.
void refreshICButtonsEnabled() override
void loadTranslation(const QString &language)
Loads and installs the Qt translation for language.
void exportToWaveFormTerminal()
Exports the current waveform simulation to standard output (terminal).
bool event(QEvent *event) override
bool hasModifiedFiles()
Returns true if any open workspace has unsaved changes or is a recovered autosave.
void exportToWaveFormFile(const QString &fileName)
Saves the BeWavedDolphin waveform session to fileName.
void show()
Shows the window and initializes child widget state.
DolphinHost * dolphinHost() override
void setICButtonsVisible(bool visible) override
Manages the list of recently opened .panda files.
Binds and unbinds the active WorkSpace's scene to the single-instance editor chrome (element editor,...
A widget containing a complete circuit editing environment.
Owns the document/tab model: the current tab, tab creation/closing/switching, and the file open/save/...