diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 458c6ce..732731b 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -115,6 +115,7 @@ set(HEADER_FILES SeerParallelStacksVisualizerWidget.h SeerParallelStacksGraphicsView.h SeerParallelStacksCommon.h + SeerParallelStacksSettingsDialog.h SeerGdbMonitorWidget.h SeerRegisterValuesBrowserWidget.h SeerRegisterEditValueDialog.h @@ -233,6 +234,7 @@ set(SOURCE_FILES SeerParallelStacksVisualizerWidget.cpp SeerParallelStacksGraphicsView.cpp SeerParallelStacksCommon.cpp + SeerParallelStacksSettingsDialog.cpp SeerGdbMonitorWidget.cpp SeerRegisterValuesBrowserWidget.cpp SeerRegisterEditValueDialog.cpp diff --git a/src/SeerParallelStacksSettingsDialog.cpp b/src/SeerParallelStacksSettingsDialog.cpp new file mode 100644 index 0000000..79a0fc5 --- /dev/null +++ b/src/SeerParallelStacksSettingsDialog.cpp @@ -0,0 +1,83 @@ +// SPDX-FileCopyrightText: 2026 Ernie Pasveer +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#include "SeerParallelStacksSettingsDialog.h" +#include +#include +#include + +SeerParallelStacksSettingsDialog::SeerParallelStacksSettingsDialog (QWidget* parent) : QDialog(parent) { + + // Set up the UI. + setupUi(this); + + // Setup the widgets + + // Connect things. + + // Restore window settings. + readSettings(); +} + +SeerParallelStacksSettingsDialog::~SeerParallelStacksSettingsDialog () { +} + +void SeerParallelStacksSettingsDialog::setShowMinimap (const QString& when) { +} + +QString SeerParallelStacksSettingsDialog::showMinimap () const { +} + +void SeerParallelStacksSettingsDialog::setShowFullFunctionName (bool flag) { +} + +bool SeerParallelStacksSettingsDialog::showFullFunctionName () const { +} + +void SeerParallelStacksSettingsDialog::setFunctionNameLenght (int length) { +} + +int SeerParallelStacksSettingsDialog::functionNameLenght () const { +} + +void SeerParallelStacksSettingsDialog::setShowFullStackSize (bool flag) { +} + +bool SeerParallelStacksSettingsDialog::showFullStackSize () const { +} + +void SeerParallelStacksSettingsDialog::setStackSize (int size) { +} + +int SeerParallelStacksSettingsDialog::stackSize () const { +} + +void SeerParallelStacksSettingsDialog::writeSettings() { + + QSettings settings; + + settings.beginGroup("parallelstackssettingsdialog"); { + settings.setValue("size", size()); + }settings.endGroup(); +} + +void SeerParallelStacksSettingsDialog::readSettings() { + + QSettings settings; + + settings.beginGroup("parallelstackssettingsdialog"); { + if (settings.contains("size")) { + resize(settings.value("size", QSize(400, 225)).toSize()); + } + } settings.endGroup(); +} + +void SeerParallelStacksSettingsDialog::resizeEvent (QResizeEvent* event) { + + // Write window settings. + writeSettings(); + + QWidget::resizeEvent(event); +} + diff --git a/src/SeerParallelStacksSettingsDialog.h b/src/SeerParallelStacksSettingsDialog.h new file mode 100644 index 0000000..dd75d08 --- /dev/null +++ b/src/SeerParallelStacksSettingsDialog.h @@ -0,0 +1,45 @@ +// SPDX-FileCopyrightText: 2026 Ernie Pasveer +// +// SPDX-License-Identifier: GPL-3.0-or-later + +#pragma once + +#include +#include +#include + +#include "ui_SeerParallelStacksSettingsDialog.h" + +class SeerParallelStacksSettingsDialog : public QDialog, protected Ui::SeerParallelStacksSettingsDialogForm { + + Q_OBJECT + + public: + explicit SeerParallelStacksSettingsDialog (QWidget* parent = 0); + ~SeerParallelStacksSettingsDialog (); + + void setShowMinimap (const QString& when); + QString showMinimap () const; + + void setShowFullFunctionName (bool flag); + bool showFullFunctionName () const; + void setFunctionNameLenght (int length); + int functionNameLenght () const; + + void setShowFullStackSize (bool flag); + bool showFullStackSize () const; + void setStackSize (int size); + int stackSize () const; + + public slots: + + private slots: + + protected: + void writeSettings (); + void readSettings (); + void resizeEvent (QResizeEvent* event); + + private: +}; + diff --git a/src/SeerParallelStacksSettingsDialog.ui b/src/SeerParallelStacksSettingsDialog.ui new file mode 100644 index 0000000..8ec79bf --- /dev/null +++ b/src/SeerParallelStacksSettingsDialog.ui @@ -0,0 +1,201 @@ + + + SeerParallelStacksSettingsDialogForm + + + + 0 + 0 + 373 + 200 + + + + Seer - ParallelStacks Settings + + + + + + ParallelStacks Settings + + + + + + + + Show Minimap + + + + + + + Only show the minimap if the contents exceeds the display area. + + + When needed + + + minimapbuttonGroup + + + + + + + Keep N frames of the stack. Omit the middle frames. + + + 1 + + + 999 + + + 5 + + + 10 + + + + + + + Function Name Length + + + + + + + Keep the full length of function names. + + + Full + + + + + + + Always show the minimap. + + + Always + + + minimapbuttonGroup + + + + + + + Keep all frames of the stack. + + + All + + + + + + + Stack Frame Size + + + + + + + Keep N characters of the function name. Omit the middle characters. + + + 1 + + + 999 + + + 5 + + + 10 + + + + + + + + + + + + Qt::Vertical + + + + 20 + 4 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + groupBox + buttonBox + verticalSpacer + + + + + buttonBox + accepted() + SeerParallelStacksSettingsDialogForm + accept() + + + 227 + 179 + + + 157 + 199 + + + + + buttonBox + rejected() + SeerParallelStacksSettingsDialogForm + reject() + + + 295 + 185 + + + 286 + 199 + + + + + + + + diff --git a/src/SeerParallelStacksVisualizerWidget.cpp b/src/SeerParallelStacksVisualizerWidget.cpp index 41afc82..60fe10d 100644 --- a/src/SeerParallelStacksVisualizerWidget.cpp +++ b/src/SeerParallelStacksVisualizerWidget.cpp @@ -3,6 +3,7 @@ // SPDX-License-Identifier: GPL-3.0-or-later #include "SeerParallelStacksVisualizerWidget.h" +#include "SeerParallelStacksSettingsDialog.h" #include "SeerParallelStacksCommon.h" #include "SeerHelpPageDialog.h" #include "SeerUtl.h" @@ -40,6 +41,7 @@ SeerParallelStacksVisualizerWidget::SeerParallelStacksVisualizerWidget (QWidget* QObject::connect(helpToolButton, &QToolButton::clicked, this, &SeerParallelStacksVisualizerWidget::handleHelpButton); QObject::connect(printToolButton, &QToolButton::clicked, this, &SeerParallelStacksVisualizerWidget::handlePrintButton); QObject::connect(saveToolButton, &QToolButton::clicked, this, &SeerParallelStacksVisualizerWidget::handleSaveButton); + QObject::connect(settingsToolButton, &QToolButton::clicked, this, &SeerParallelStacksVisualizerWidget::handleSettingsButton); #if QT_VERSION >= QT_VERSION_CHECK(6, 6, 3) QObject::connect(QGuiApplication::styleHints(), &QStyleHints::colorSchemeChanged, this, &SeerParallelStacksVisualizerWidget::handleThemeChanged); #endif @@ -238,6 +240,19 @@ void SeerParallelStacksVisualizerWidget::handleSaveButton () { QMessageBox::information(this, "Done", "Scene saved to:\n" + fileName); } +void SeerParallelStacksVisualizerWidget::handleSettingsButton () { + + // Bring up the settings dialog. + SeerParallelStacksSettingsDialog dlg(this); + + // Set dialog things. + + // Execute the dialog. + if (dlg.exec()) { + // Set things. + } +} + void SeerParallelStacksVisualizerWidget::handleThemeChanged () { // Colorize icons for theme. diff --git a/src/SeerParallelStacksVisualizerWidget.h b/src/SeerParallelStacksVisualizerWidget.h index 0b1996a..613b8c5 100644 --- a/src/SeerParallelStacksVisualizerWidget.h +++ b/src/SeerParallelStacksVisualizerWidget.h @@ -28,6 +28,7 @@ class SeerParallelStacksVisualizerWidget : public QWidget, protected Ui::SeerPar void handleHelpButton (); void handlePrintButton (); void handleSaveButton (); + void handleSettingsButton (); void handleThemeChanged (); protected: diff --git a/src/SeerParallelStacksVisualizerWidget.ui b/src/SeerParallelStacksVisualizerWidget.ui index e8c0323..af1c5a5 100644 --- a/src/SeerParallelStacksVisualizerWidget.ui +++ b/src/SeerParallelStacksVisualizerWidget.ui @@ -68,6 +68,20 @@ + + + + Settings. + + + + + + + :/seer/resources/RelaxLightIcons/application-menu.svg:/seer/resources/RelaxLightIcons/application-menu.svg + + +