diff --git a/cpdctrl_gui/ui/main_window.py b/cpdctrl_gui/ui/main_window.py index 849a937..46140f3 100644 --- a/cpdctrl_gui/ui/main_window.py +++ b/cpdctrl_gui/ui/main_window.py @@ -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): diff --git a/cpdctrl_gui/ui/widgets/app_settings.py b/cpdctrl_gui/ui/widgets/app_settings.py new file mode 100644 index 0000000..d120b66 --- /dev/null +++ b/cpdctrl_gui/ui/widgets/app_settings.py @@ -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()