Add app settings window

This commit is contained in:
CPD 2025-03-10 14:54:20 +01:00
parent 0ca1407ceb
commit 748f383dee
2 changed files with 23 additions and 1 deletions

View File

@ -11,6 +11,7 @@ from .widgets.menubar import MenuBar
from .widgets.toolbar import ToolBar
from .widgets.metadata_input import MetadataInput
from .widgets.measurement_settings import MeasurementSettings, ScriptSelection
from .widgets.app_settings import AppSettings
from .widgets.plot import Plot
from .widgets.device_select import ListChoice
from .widgets.about import MarkdownView
@ -129,6 +130,7 @@ class MainWindow(QMainWindow):
self.topbar.add_button("meas_stop", "Stop", QIcon.fromTheme(QIcon.ThemeIcon.MediaPlaybackStop), self.measure_stop)
self.topbar.add_button("meas_save", "Save", QIcon.fromTheme(QIcon.ThemeIcon.DocumentSaveAs), self.measurement_save)
self.topbar.add_separator()
self.topbar.add_button("app_settings", "Settings", QIcon.fromTheme(QIcon.ThemeIcon.DocumentProperties), self.app_open_settings)
self.topbar.addAction(self.a_open_help)
self.topbar.addAction(self.a_open_about)
self.topbar.add_button("app_exit", "Exit", QIcon.fromTheme(QIcon.ThemeIcon.ApplicationExit), self.app_exit)
@ -368,8 +370,19 @@ class MainWindow(QMainWindow):
buttons.accepted.connect(dialog.accept)
dialog.setLayout(QVBoxLayout())
# show help.md
dialog.layout().addWidget(MarkdownView("troubleshooting.md"))
#dialog.layout().addWidget(MarkdownView("troubleshooting.md"))
dialog.layout().addWidget(MarkdownView("user_guide.md"))
dialog.layout().addWidget(buttons)
# set larger window size
dialog.resize(800, 600)
dialog.exec()
def app_open_settings(self) -> None:
dialog = QDialog()
w_settings = AppSettings()
layout = QVBoxLayout()
layout.addWidget(w_settings)
dialog.setLayout(layout)
dialog.exec()
def closeEvent(self, event):

View File

@ -0,0 +1,9 @@
from PyQt6.QtWidgets import QWidget, QVBoxLayout, QFormLayout
from ...utility.config import AppConfig
class AppSettings(QWidget):
def __init__(self):
super().__init__()
self.setLayout(QVBoxLayout())
self.l_form = QFormLayout()