diff options
Diffstat (limited to 'sb_builder')
| -rw-r--r-- | sb_builder/__init__.py | 2 | ||||
| -rw-r--r-- | sb_builder/mainwindow.py | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/sb_builder/__init__.py b/sb_builder/__init__.py index c845154..267ce94 100644 --- a/sb_builder/__init__.py +++ b/sb_builder/__init__.py @@ -16,4 +16,4 @@ """sb-builder: Qt6 GUI driving the SlackBuild tooling on a build VM.""" -VERSION = "0.9.0" # must match remote/sbb-remote VERSION +VERSION = "0.10.0" # must match remote/sbb-remote VERSION diff --git a/sb_builder/mainwindow.py b/sb_builder/mainwindow.py index 5ebe869..4b0aca2 100644 --- a/sb_builder/mainwindow.py +++ b/sb_builder/mainwindow.py @@ -19,7 +19,7 @@ import os import time -from PyQt6.QtCore import QSettings, QMetaType, QObject, QSize, Qt, QTimer, pyqtSignal, pyqtSlot +from PyQt6.QtCore import QFileSystemWatcher, QSettings, QMetaType, QObject, QSize, Qt, QTimer, pyqtSignal, pyqtSlot from PyQt6.QtDBus import QDBusArgument, QDBusConnection, QDBusInterface, QDBusMessage from PyQt6.QtGui import QIcon, QKeySequence, QShortcut from PyQt6.QtWidgets import (QHeaderView, QLabel, QMainWindow, QMessageBox, QPushButton, QSplitter, @@ -90,6 +90,10 @@ class MainWindow(QMainWindow): self.state = QSettings(state or os.path.join(os.path.dirname(config.path()), "state.conf"), QSettings.Format.IniFormat) self.cfg, self.remote = cfg, remote + # Keystone's settings page saves here: apply it live (File > Reload config stays) + # ponytail: watches the file only, so one created after startup needs a reload by hand + self.config_watch = QFileSystemWatcher([config.path()], self) + self.config_watch.fileChanged.connect(self._config_changed) self.notifier = notifier or Notifier(self) self.notifier.clicked.connect(self.open_job) self.hint_dialogs = [] # open HintResultDialogs, kept alive while shown @@ -439,6 +443,11 @@ class MainWindow(QMainWindow): self.state.sync() super().closeEvent(event) + def _config_changed(self, path): + if os.path.exists(path): + self.config_watch.addPath(path) # an atomic write replaced the inode, dropping the watch + self.reload_config() + def reload_config(self): cfg, err = config.load() if err: |
