59 explicit MainWindow(
const QString &fileName = {}, QWidget *parent =
nullptr);
79 void save(
const QString &fileName = {})
override;
88 void openICInTab(
const QString &blobName,
int icElementId,
const QByteArray &blob);
100 QWidget *
widget()
override;
106 ElementPalette *
palette()
const override;
181 void populateMenu(QSpacerItem *spacer,
const QStringList &names, QLayout *layout);
211 void onCurrentTabChanged(WorkSpace *newTab);
215 void updateWindowTitle();
221 void connectSceneAction(QAction *action,
void (Scene::*method)());
225 void createRecentFileActions();
226 void updateRecentFileActions();
227 void openRecentFile();
231 void updateSettings();
233 void aboutThisVersion();
237 void startExercise(
const QString &resourcePath);
238 void startTour(
const QString &resourcePath);
239 QRect resolveTourTarget(
const QString &
id)
const;
241 void clickTarget(
const QString &
id);
243 static void on_actionDarkTheme_triggered();
244 static void on_actionLightTheme_triggered();
245 static void on_actionSystemTheme_triggered();
246 void on_actionAboutQt_triggered();
247 void on_actionAbout_triggered();
248 void on_actionExit_triggered();
249 void on_actionFastMode_triggered(
const bool checked);
250 void on_actionFlipHorizontally_triggered();
251 void on_actionFlipVertically_triggered();
252 void on_actionAlignLeft_triggered();
253 void on_actionAlignRight_triggered();
254 void on_actionAlignTop_triggered();
255 void on_actionAlignBottom_triggered();
256 void on_actionAlignHorizontalCenter_triggered();
257 void on_actionAlignVerticalCenter_triggered();
258 void on_actionDistributeHorizontally_triggered();
259 void on_actionDistributeVertically_triggered();
260 void on_actionFullscreen_triggered();
261 void on_actionGates_triggered(
const bool checked);
262 void on_actionLabelsUnderIcons_triggered(
const bool checked);
263 void on_actionICPreview_triggered(
const bool checked);
264 void on_actionCheckForUpdates_triggered(
const bool checked);
265 void on_actionMute_triggered(
const bool checked);
266 void on_actionPlay_toggled(
const bool checked);
267 void on_actionReportTranslationError_triggered();
268 void on_actionResetZoom_triggered()
const;
269 void on_actionZoomToFit_triggered()
const;
270 void on_actionRestart_triggered();
271 void on_actionRotateLeft_triggered();
272 void on_actionRotateRight_triggered();
273 void on_actionSelectAll_triggered();
274 void on_actionShortcuts_and_Tips_triggered();
275 void on_actionShowMinimap_triggered(
const bool checked);
276 void on_actionWaveform_triggered();
277 void on_actionWires_triggered(
const bool checked);
278 void on_actionZoomIn_triggered()
const;
279 void on_actionZoomOut_triggered()
const;
283 static const char *onBeforeUnload(
int eventType,
const void *reserved,
void *userData);
289 void setupLanguage();
291 void setupGeometry();
295 void setupRecentFiles();
297 void setupExamplesMenu();
299 void setupExercisesMenu();
301 void setupToursMenu();
304 void populateContentMenu(QMenu *menu,
const QString &categoryKey,
305 const QString &openFolderText,
const QString &openFolderFailureText,
306 const QStringList &completed,
const std::function<
void(
const QString &)> &onSelect);
308 void setupShortcuts();
310 void setupConnections();
314 std::unique_ptr<MainWindowUi> m_ui;
316 ElementPalette *m_palette =
nullptr;
317 LanguageManager *m_languageManager =
nullptr;
318 RecentFiles *m_recentFiles =
nullptr;
319 ExportController *m_exportController =
nullptr;
320 ICController *m_icController =
nullptr;
321 SceneUiBinder *m_binder =
nullptr;
322 WorkspaceManager *m_workspaceManager =
nullptr;
324 ExerciseEngine *m_exerciseEngine =
nullptr;
325 ExerciseOverlay *m_exerciseOverlay =
nullptr;
327 TourEngine *m_tourEngine =
nullptr;
330 QPointer<TourOverlay> m_tourOverlay;
332 QPointer<BewavedDolphin> m_bwd;
338 QPointer<WorkSpace> m_previousTab;
342 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.
Icon and name widget shown in the left-panel element palette.
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 populateMenu(QSpacerItem *spacer, const QStringList &names, QLayout *layout)
Fills layout with ElementLabel buttons from names, preceded by spacer.
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/...