Move settings into the main window

Replace the modal settings dialog with a shared Settings tab accessible from the main window and tray menu, with explicit Save and Cancel behavior. Improve changelog navigation from update notices and update usage, licensing, and implementation documentation.
This commit is contained in:
2026-11-26 22:03:28 -06:00
parent 8a7f4160db
commit 8dcb20f123
7 changed files with 156 additions and 54 deletions

View File

@@ -15,6 +15,54 @@ The hover monitor's own button controls pinning.
Windows and Linux machine headers report uptime from the existing local Windows and Linux machine headers report uptime from the existing local
sampling worker and SSH telemetry stream. sampling worker and SSH telemetry stream.
The supplied root license and the anonymous Gitea copy match SHA-256
`d5dde5498f5a81b4cc9ca1db3a1b53d6cc343053a080ceaefcf20a423984f215`.
Gitea's description identifies the current source as DC-ANCSA v1.0. The
repository retained its existing visibility and prior release tags.
The dependency review preserved the Qt, PySide, CPython, Paramiko and
other wheel notices. It added the BSD notice from the NVIDIA wrapper
source header and the OpenSSL and Tcl notices. The applications' own
license governs original material. Separate upstream terms for bundled
libraries are documented in the third-party notices.
The 39 regressions and final private native Windows suite passed. The
suite checked the offline license viewer and restored window placement,
the banner and completion marker, graph-body dragging, tray click and
pin behavior, and Windows uptime and Linux SSH fixture uptime. The
Linux probe passed Bash syntax validation in the existing Ubuntu WSL
environment.
Build and Archive #17 built and signed commit
`8079bf0ca626c7643e5cf3e928651f9c8e63c96a`. The Windows x64 installer,
portable package, Ed25519 signature, exact bundled license and signed
build identity verified. The Minor artifacts are staged locally and in
Jenkins. Publication and installation await authorization.
[Build #17](https://phantom.zapto.org:8080/jenkins/job/Adaptive-Resource-Monitor/job/Build-and-Archive/17/)
| Windows x64 package | Bytes | SHA-256 |
| --- | ---: | --- |
| Installer | 60,120,801 | `4360334e1c8123664bada615a57cdbed4b319cb0948ebd1040a3b74d0320a881` |
| Portable ZIP | 74,566,298 | `bec0c3656e65e0da8f12faebb585b27a186feca10b2981c090083904fa288a09` |
The disposable Inno Setup wizard displayed the complete agreement from
the archived payload. Declining disabled Next and canceling preserved the
prior executable and data. Accepting advanced Setup. The separate unattended
update-mode install and uninstall both returned 0. The installed license
matched its source, and the fixture profile, saved display preferences and
history remained identical. The wizard screenshot is retained in
`evidence/v0.8.3.3_beta-native/installer-license-agreement.png`.
The final private application check removed 242,695 bytes of test data.
The disposable Setup check removed 278,016,814 bytes of compiler staging,
test installers, installation files and fixture settings. The signed
candidate and evidence are retained.
A failed early disposable compiler stage left
`%TEMP%\arm-qa-upgrade-i_uxybxg`. Windows denied access to the child
compiler directory. Automatic command review rejected ownership and
cleanup operations for that path.
## v0.8.2.3_beta — Machine ordering and display selection ## v0.8.2.3_beta — Machine ordering and display selection
Two Feature increments combine drag-and-drop machine ordering and checkbox Two Feature increments combine drag-and-drop machine ordering and checkbox

View File

@@ -8,7 +8,8 @@ the icon's context menu. Windows may initially place the icon
in the taskbar overflow. Move it into the visible notification area for in the taskbar overflow. Move it into the visible notification area for
continuous access. continuous access.
Use Settings to switch between Overlay, Stacked and Composite, choose devices, Open the Settings tab in the main window or choose Settings from the tray
menu to switch between Overlay, Stacked and Composite, choose devices,
set sampling and graph options, or enable SQLite history. Use Manage Remote Targets set sampling and graph options, or enable SQLite history. Use Manage Remote Targets
to add a Linux machine. A confirmed SSH key and working authentication are to add a Linux machine. A confirmed SSH key and working authentication are
required. The default configuration monitors only the local machine and keeps required. The default configuration monitors only the local machine and keeps

View File

@@ -203,17 +203,22 @@ class AboutPage(QWidget):
def show_document(self, name): def show_document(self, name):
if name not in self.documents: if name not in self.documents:
return return False
path = document(name) path = document(name)
self.document_group.setTitle(self.documents[name]) self.document_group.setTitle(self.documents[name])
try: try:
self.browser.setMarkdown(path.read_text(encoding="utf-8")) self.browser.setMarkdown(path.read_text(encoding="utf-8"))
if name == "CHANGELOG.md" and self.isVisible():
self.updates.dismiss_success_notice()
except (OSError, UnicodeError) as exc: except (OSError, UnicodeError) as exc:
LOG.warning("Unable to read About document %s: %s", name, exc) LOG.warning("Unable to read About document %s: %s", name, exc)
self.browser.setPlainText(f"Unable to open {name}.") self.browser.setPlainText(f"Unable to open {name}.")
return False
self.browser.verticalScrollBar().setValue(0) self.browser.verticalScrollBar().setValue(0)
return True
def open_changelog(self):
if self.show_document("CHANGELOG.md"):
self.updates.dismiss_success_notice()
self.browser.setFocus()
def show_license(self): def show_license(self):
try: try:
@@ -226,7 +231,9 @@ class AboutPage(QWidget):
dialog.deleteLater() dialog.deleteLater()
def open_link(self, target): def open_link(self, target):
if target in self.documents: if target == "CHANGELOG.md":
self.open_changelog()
elif target in self.documents:
self.show_document(target) self.show_document(target)
elif QUrl(target).scheme() == "https": elif QUrl(target).scheme() == "https":
QDesktopServices.openUrl(QUrl(target)) QDesktopServices.openUrl(QUrl(target))

View File

@@ -27,7 +27,7 @@ from .branding import DARK, LIGHT, PUBLISHER, WEBSITE, application_icon, set_win
from .collect import Collectors from .collect import Collectors
from .config import STATIC_TRAY_MODE, ConfigStore, Target, data_path, machine_ids, monitor_choices from .config import STATIC_TRAY_MODE, ConfigStore, Target, data_path, machine_ids, monitor_choices
from .credentials import CredentialStore from .credentials import CredentialStore
from .dialogs import ConnectionsDialog, SettingsDialog, TargetDialog from .dialogs import ConnectionsDialog, SettingsPage, TargetDialog
from .graphs import Dashboard, tray_icon from .graphs import Dashboard, tray_icon
from .history_db import HistoryDb from .history_db import HistoryDb
from .model import ALL, LOCAL, TOTAL, Connection from .model import ALL, LOCAL, TOTAL, Connection
@@ -99,6 +99,8 @@ class Application(QObject):
self.about_page.updates.quit_requested.connect(self.close_for_update) self.about_page.updates.quit_requested.connect(self.close_for_update)
self.expanded = Monitor(self.dashboard, True, self.request_archive, self.open_expanded, self.expanded = Monitor(self.dashboard, True, self.request_archive, self.open_expanded,
self.set_pin, self.toggle_machine, self.reorder_machines, self.about_page) self.set_pin, self.toggle_machine, self.reorder_machines, self.about_page)
self.settings_page = SettingsPage(self)
self.expanded.tabs.insertTab(1, self.settings_page, "Settings")
self.expanded.setWindowIcon(self.brand_icon) self.expanded.setWindowIcon(self.brand_icon)
self.window_geometry = WindowGeometry(self.expanded, self.root / "monitor-window.bin") self.window_geometry = WindowGeometry(self.expanded, self.root / "monitor-window.bin")
self.popup = Monitor(self.dashboard, False, self.request_archive, self.open_expanded, self.set_pin, self.popup = Monitor(self.dashboard, False, self.request_archive, self.open_expanded, self.set_pin,
@@ -120,7 +122,6 @@ class Application(QObject):
self.view_timer.timeout.connect(self.refresh_views) self.view_timer.timeout.connect(self.refresh_views)
self.view_timer.start() self.view_timer.start()
self.manager = None self.manager = None
self.settings_dialog = None
self._closed = False self._closed = False
self.qt.styleHints().colorSchemeChanged.connect(self.change_brand_theme) self.qt.styleHints().colorSchemeChanged.connect(self.change_brand_theme)
self.change_brand_theme() self.change_brand_theme()
@@ -395,16 +396,7 @@ class Application(QObject):
self.process_message = message self.process_message = message
def open_settings(self): def open_settings(self):
if self.settings_dialog: self.expanded.show_page(self.settings_page)
self.settings_dialog.raise_()
return
dialog = SettingsDialog(self)
self.settings_dialog = dialog
try:
dialog.exec()
finally:
self.settings_dialog = None
dialog.deleteLater()
def manage(self): def manage(self):
if self.manager: if self.manager:
@@ -519,7 +511,7 @@ class Application(QObject):
QMessageBox.warning(self.expanded, "Start with Windows", str(exc)) QMessageBox.warning(self.expanded, "Start with Windows", str(exc))
def about(self): def about(self):
self.expanded.show_page(about=True) self.expanded.show_page(self.about_page)
def check_for_updates(self): def check_for_updates(self):
self.about() self.about()
@@ -530,8 +522,7 @@ class Application(QObject):
self.popup.hide() self.popup.hide()
self.about() self.about()
if changelog: if changelog:
self.about_page.show_document("CHANGELOG.md") self.about_page.open_changelog()
self.about_page.browser.setFocus()
else: else:
self.about_page.updates.buttons["Check for Updates"].setFocus() self.about_page.updates.buttons["Check for Updates"].setFocus()

View File

@@ -101,24 +101,31 @@ class DeviceChoices(Choices):
self.setVisible(False) self.setVisible(False)
class SettingsDialog(QDialog): class SettingsPage(QWidget):
def __init__(self, app): def __init__(self, app):
super().__init__() super().__init__()
self.app = app self.app = app
self.cfg = app.settings self.tabs = None
self.setWindowTitle("ARM Settings") layout = QVBoxLayout(self)
self.resize(610, 610) buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Save | QDialogButtonBox.StandardButton.Cancel)
buttons.accepted.connect(self.save)
buttons.rejected.connect(self.reload)
layout.addWidget(buttons)
self.timer = QTimer(self, interval=1500)
self.timer.timeout.connect(self.update_diagnostics)
def reload(self):
index = self.tabs.currentIndex() if self.tabs is not None else 0
if self.tabs is not None:
self.tabs.hide()
self.layout().removeWidget(self.tabs)
self.tabs.deleteLater()
self.cfg = self.app.settings
self.controls = {} self.controls = {}
self.tabs = QTabWidget() self.tabs = QTabWidget()
self.colors = dict(self.cfg.colors) self.colors = dict(self.cfg.colors)
self.network_colors = dict(self.cfg.network_colors) self.network_colors = dict(self.cfg.network_colors)
self.background = self.cfg.background self.background = self.cfg.background
layout = QVBoxLayout(self)
layout.addWidget(self.tabs)
buttons = QDialogButtonBox(QDialogButtonBox.StandardButton.Save | QDialogButtonBox.StandardButton.Cancel)
buttons.accepted.connect(self.save)
buttons.rejected.connect(self.reject)
layout.addWidget(buttons)
self.general() self.general()
self.tray() self.tray()
self.hover() self.hover()
@@ -126,12 +133,23 @@ class SettingsDialog(QDialog):
self.remote() self.remote()
self.history() self.history()
self.diagnostics() self.diagnostics()
self.timer = QTimer(self) self.tabs.setCurrentIndex(index)
self.timer.setInterval(1500) self.layout().insertWidget(0, self.tabs, 1)
self.timer.timeout.connect(self.update_diagnostics) self.tabs.currentChanged.connect(self.update_diagnostics)
self.initial = self.values()
self.initial_startup = self.startup.isChecked()
self.update_diagnostics()
def showEvent(self, event):
if self.tabs is None or (self.values() == self.initial and self.startup.isChecked() == self.initial_startup):
self.reload()
super().showEvent(event)
self.timer.start() self.timer.start()
self.update_diagnostics() self.update_diagnostics()
self.window_geometry = WindowGeometry(self, app.root / "settings-window.bin")
def hideEvent(self, event):
self.timer.stop()
super().hideEvent(event)
def section(self, title): def section(self, title):
page = QWidget() page = QWidget()
@@ -261,20 +279,26 @@ class SettingsDialog(QDialog):
form.addRow(self.diagnostic) form.addRow(self.diagnostic)
def update_diagnostics(self): def update_diagnostics(self):
self.diagnostic.setText(self.app.diagnostics()) if self.diagnostic.isVisible():
self.diagnostic.setText(self.app.diagnostics())
def values(self):
return {**{key: getter() for key, getter in self.controls.items()},
"background": self.background, "colors": dict(self.colors),
"network_colors": dict(self.network_colors)}
def save(self): def save(self):
updates = {key: getter() for key, getter in self.controls.items()} updates = {key: value for key, value in self.values().items() if value != self.initial[key]}
cfg = replace(self.app.settings, **updates, background=self.background, colors=self.colors, startup = self.startup.isChecked()
network_colors=self.network_colors)
try: try:
self.app.apply(cfg) if updates:
if self.startup.isChecked() != self.app.startup_enabled(): self.app.apply(replace(self.app.settings, **updates))
self.app.set_startup(self.startup.isChecked()) if startup != self.initial_startup and startup != self.app.startup_enabled():
self.app.set_startup(startup)
except (OSError, ValueError) as exc: except (OSError, ValueError) as exc:
QMessageBox.warning(self, "Settings", str(exc)) QMessageBox.warning(self, "Settings", str(exc))
return return
self.accept() self.reload()
class TargetDialog(QDialog): class TargetDialog(QDialog):

View File

@@ -304,10 +304,12 @@ class Monitor(QWidget):
def monitor_visible(self): def monitor_visible(self):
return self.isVisible() and (not self.expanded or self.tabs.currentWidget() is self.resource_page) return self.isVisible() and (not self.expanded or self.tabs.currentWidget() is self.resource_page)
def show_page(self, about=False): def show_page(self, page=None):
self.tabs.setCurrentWidget(self.about_page if about else self.resource_page) self.tabs.setCurrentWidget(self.resource_page if page is None else page)
self.ensurePolished() self.ensurePolished()
self.layout().activate() self.layout().activate()
if self.isMinimized():
self.setWindowState(self.windowState() & ~Qt.WindowState.WindowMinimized)
self.show() self.show()
fit_work_area(self) fit_work_area(self)
self.raise_() self.raise_()

View File

@@ -549,10 +549,16 @@ def verify_update_notices(session, wait_for, results, captures):
before = confirmation.read_bytes() before = confirmation.read_bytes()
assert hover.update_banner.label.text() and expanded.update_banner.label.text() assert hover.update_banner.label.text() and expanded.update_banner.label.text()
assert hover.update_banner.action.text() == "View Changelog" assert hover.update_banner.action.text() == "View Changelog"
session.hover.pin(True, LOCAL)
expanded.showMinimized()
session.qt.processEvents()
hover.update_banner.action.click() hover.update_banner.action.click()
assert not expanded.isMinimized() and expanded.tabs.currentWidget() is session.about_page
assert session.about_page.document_group.title() == "Change Log" assert session.about_page.document_group.title() == "Change Log"
assert hover.update_banner.isHidden() and expanded.update_banner.isHidden() assert hover.update_banner.isHidden() and expanded.update_banner.isHidden()
assert confirmation.read_bytes() == before assert confirmation.read_bytes() == before
session.hover.pin(False)
hover.hide()
expanded.close() expanded.close()
finally: finally:
fixture.doCleanups() fixture.doCleanups()
@@ -775,11 +781,11 @@ def evaluate_app(work, results, short=False, captures=None):
import psutil import psutil
from PySide6.QtCore import QEventLoop, QTimer from PySide6.QtCore import QEventLoop, QTimer
from PySide6.QtGui import QGuiApplication from PySide6.QtGui import QGuiApplication
from PySide6.QtWidgets import QApplication, QSystemTrayIcon from PySide6.QtWidgets import QApplication, QDialogButtonBox, QSystemTrayIcon
from arm.application import Application from arm.application import Application
from arm.branding import set_windows_identity from arm.branding import set_windows_identity
from arm.config import STATIC_TRAY_MODE, ConfigStore, Settings, Target from arm.config import STATIC_TRAY_MODE, ConfigStore, Settings, Target
from arm.dialogs import ConnectionsDialog, SettingsDialog from arm.dialogs import ConnectionsDialog
from arm.model import ALL, LOCAL, NETWORK, TOTAL, Connection, RESOURCES from arm.model import ALL, LOCAL, NETWORK, TOTAL, Connection, RESOURCES
from arm.providers.ssh import update_host_key from arm.providers.ssh import update_host_key
from ssh_fixture import Fixture, SECRET from ssh_fixture import Fixture, SECRET
@@ -912,17 +918,40 @@ def evaluate_app(work, results, short=False, captures=None):
assert app.primaryScreen().availableGeometry().contains(session.popup.frameGeometry()) assert app.primaryScreen().availableGeometry().contains(session.popup.frameGeometry())
if not short: if not short:
measure("expanded") measure("expanded")
prefs = session.settings_page
assert [session.expanded.tabs.tabText(index) for index in range(session.expanded.tabs.count())] == [
"Resource Monitor", "Settings", "About",
]
session.expanded.tabs.setCurrentWidget(prefs)
assert prefs.isVisible() and prefs.tabs.count() == 7
minimized = session.settings.minimized
control = prefs.controls["minimized"].__self__
control.setChecked(not minimized)
session.expanded.tabs.setCurrentWidget(session.expanded.resource_page)
session.expanded.showMinimized()
next(action for action in menu.actions() if action.text() == "Settings").trigger()
assert session.expanded.tabs.currentWidget() is prefs and not session.expanded.isMinimized()
assert prefs.controls["minimized"]() == (not minimized)
buttons = prefs.findChild(QDialogButtonBox)
buttons.button(QDialogButtonBox.StandardButton.Cancel).click()
assert prefs.controls["minimized"]() == minimized
prefs.controls["minimized"].__self__.setChecked(not minimized)
previous_range = session.settings.hover_range
changed_range = 300 if previous_range != 300 else 60
session.remember_monitor(changed_range)
buttons.button(QDialogButtonBox.StandardButton.Save).click()
saved = session.store.load()
assert saved.minimized == (not minimized) and saved.hover_range == changed_range
assert session.expanded.tabs.currentWidget() is prefs
session.remember_monitor(previous_range)
results["shared_settings_tab"] = "Main window and tray entry, draft retention, Cancel, and Save"
session.expanded.close() session.expanded.close()
assert not session.expanded.isVisible() and session.icons[LOCAL].isVisible() assert not session.expanded.isVisible() and session.icons[LOCAL].isVisible()
if not short: if not short:
prefs, connections = SettingsDialog(session), ConnectionsDialog(session) connections = ConnectionsDialog(session)
prefs.show()
connections.show() connections.show()
assert prefs.isVisible() and connections.isVisible() assert connections.isVisible() and connections.table.rowCount() == 0
assert prefs.tabs.count() == 7 and connections.table.rowCount() == 0
prefs.close()
connections.close() connections.close()
prefs.deleteLater()
connections.deleteLater() connections.deleteLater()
with ExitStack() as stack: with ExitStack() as stack:
servers = [stack.enter_context(Fixture()) for _ in range(2)] servers = [stack.enter_context(Fixture()) for _ in range(2)]
@@ -951,12 +980,12 @@ def evaluate_app(work, results, short=False, captures=None):
measure("two_loopback_ssh") measure("two_loopback_ssh")
from arm.graphs import tray_icon from arm.graphs import tray_icon
primary, other = (target.identifier for target in targets) primary, other = (target.identifier for target in targets)
prefs = SettingsDialog(session) session.open_settings()
tray_machine = prefs.controls["tray_machine"].__self__ tray_machine = prefs.controls["tray_machine"].__self__
assert [tray_machine.itemData(i) for i in range(tray_machine.count())] == [LOCAL, primary, other] assert [tray_machine.itemData(i) for i in range(tray_machine.count())] == [LOCAL, primary, other]
tray_machine.setCurrentIndex(tray_machine.findData(primary)) tray_machine.setCurrentIndex(tray_machine.findData(primary))
prefs.save() prefs.save()
prefs.deleteLater() session.expanded.close()
assert session.scopes() == [primary] and session.popup.displayed == (LOCAL,) assert session.scopes() == [primary] and session.popup.displayed == (LOCAL,)
menu = session.menus[primary] menu = session.menus[primary]
for choice in (ALL, other, LOCAL): for choice in (ALL, other, LOCAL):