diff --git a/IMPLEMENTATION_REPORT.md b/IMPLEMENTATION_REPORT.md index 2bd30c2..2a9984b 100644 --- a/IMPLEMENTATION_REPORT.md +++ b/IMPLEMENTATION_REPORT.md @@ -15,6 +15,54 @@ The hover monitor's own button controls pinning. Windows and Linux machine headers report uptime from the existing local 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 Two Feature increments combine drag-and-drop machine ordering and checkbox diff --git a/README.md b/README.md index b400cfa..c6e7087 100644 --- a/README.md +++ b/README.md @@ -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 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 to add a Linux machine. A confirmed SSH key and working authentication are required. The default configuration monitors only the local machine and keeps diff --git a/arm/about.py b/arm/about.py index 2528945..d966131 100644 --- a/arm/about.py +++ b/arm/about.py @@ -203,17 +203,22 @@ class AboutPage(QWidget): def show_document(self, name): if name not in self.documents: - return + return False path = document(name) self.document_group.setTitle(self.documents[name]) try: 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: LOG.warning("Unable to read About document %s: %s", name, exc) self.browser.setPlainText(f"Unable to open {name}.") + return False 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): try: @@ -226,7 +231,9 @@ class AboutPage(QWidget): dialog.deleteLater() 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) elif QUrl(target).scheme() == "https": QDesktopServices.openUrl(QUrl(target)) diff --git a/arm/application.py b/arm/application.py index 6a541e5..c62c197 100644 --- a/arm/application.py +++ b/arm/application.py @@ -27,7 +27,7 @@ from .branding import DARK, LIGHT, PUBLISHER, WEBSITE, application_icon, set_win from .collect import Collectors from .config import STATIC_TRAY_MODE, ConfigStore, Target, data_path, machine_ids, monitor_choices from .credentials import CredentialStore -from .dialogs import ConnectionsDialog, SettingsDialog, TargetDialog +from .dialogs import ConnectionsDialog, SettingsPage, TargetDialog from .graphs import Dashboard, tray_icon from .history_db import HistoryDb 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.expanded = Monitor(self.dashboard, True, self.request_archive, self.open_expanded, 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.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, @@ -120,7 +122,6 @@ class Application(QObject): self.view_timer.timeout.connect(self.refresh_views) self.view_timer.start() self.manager = None - self.settings_dialog = None self._closed = False self.qt.styleHints().colorSchemeChanged.connect(self.change_brand_theme) self.change_brand_theme() @@ -395,16 +396,7 @@ class Application(QObject): self.process_message = message def open_settings(self): - if self.settings_dialog: - self.settings_dialog.raise_() - return - dialog = SettingsDialog(self) - self.settings_dialog = dialog - try: - dialog.exec() - finally: - self.settings_dialog = None - dialog.deleteLater() + self.expanded.show_page(self.settings_page) def manage(self): if self.manager: @@ -519,7 +511,7 @@ class Application(QObject): QMessageBox.warning(self.expanded, "Start with Windows", str(exc)) def about(self): - self.expanded.show_page(about=True) + self.expanded.show_page(self.about_page) def check_for_updates(self): self.about() @@ -530,8 +522,7 @@ class Application(QObject): self.popup.hide() self.about() if changelog: - self.about_page.show_document("CHANGELOG.md") - self.about_page.browser.setFocus() + self.about_page.open_changelog() else: self.about_page.updates.buttons["Check for Updates"].setFocus() diff --git a/arm/dialogs.py b/arm/dialogs.py index d3eb335..739107e 100644 --- a/arm/dialogs.py +++ b/arm/dialogs.py @@ -101,24 +101,31 @@ class DeviceChoices(Choices): self.setVisible(False) -class SettingsDialog(QDialog): +class SettingsPage(QWidget): def __init__(self, app): super().__init__() self.app = app - self.cfg = app.settings - self.setWindowTitle("ARM Settings") - self.resize(610, 610) + self.tabs = None + layout = QVBoxLayout(self) + 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.tabs = QTabWidget() self.colors = dict(self.cfg.colors) self.network_colors = dict(self.cfg.network_colors) 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.tray() self.hover() @@ -126,12 +133,23 @@ class SettingsDialog(QDialog): self.remote() self.history() self.diagnostics() - self.timer = QTimer(self) - self.timer.setInterval(1500) - self.timer.timeout.connect(self.update_diagnostics) + self.tabs.setCurrentIndex(index) + self.layout().insertWidget(0, self.tabs, 1) + 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.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): page = QWidget() @@ -261,20 +279,26 @@ class SettingsDialog(QDialog): form.addRow(self.diagnostic) 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): - updates = {key: getter() for key, getter in self.controls.items()} - cfg = replace(self.app.settings, **updates, background=self.background, colors=self.colors, - network_colors=self.network_colors) + updates = {key: value for key, value in self.values().items() if value != self.initial[key]} + startup = self.startup.isChecked() try: - self.app.apply(cfg) - if self.startup.isChecked() != self.app.startup_enabled(): - self.app.set_startup(self.startup.isChecked()) + if updates: + self.app.apply(replace(self.app.settings, **updates)) + if startup != self.initial_startup and startup != self.app.startup_enabled(): + self.app.set_startup(startup) except (OSError, ValueError) as exc: QMessageBox.warning(self, "Settings", str(exc)) return - self.accept() + self.reload() class TargetDialog(QDialog): diff --git a/arm/views.py b/arm/views.py index 0f79f5a..b8a2fb0 100644 --- a/arm/views.py +++ b/arm/views.py @@ -304,10 +304,12 @@ class Monitor(QWidget): def monitor_visible(self): return self.isVisible() and (not self.expanded or self.tabs.currentWidget() is self.resource_page) - def show_page(self, about=False): - self.tabs.setCurrentWidget(self.about_page if about else self.resource_page) + def show_page(self, page=None): + self.tabs.setCurrentWidget(self.resource_page if page is None else page) self.ensurePolished() self.layout().activate() + if self.isMinimized(): + self.setWindowState(self.windowState() & ~Qt.WindowState.WindowMinimized) self.show() fit_work_area(self) self.raise_() diff --git a/tests/windows_gui.py b/tests/windows_gui.py index 7c51756..30d8628 100644 --- a/tests/windows_gui.py +++ b/tests/windows_gui.py @@ -549,10 +549,16 @@ def verify_update_notices(session, wait_for, results, captures): before = confirmation.read_bytes() assert hover.update_banner.label.text() and expanded.update_banner.label.text() assert hover.update_banner.action.text() == "View Changelog" + session.hover.pin(True, LOCAL) + expanded.showMinimized() + session.qt.processEvents() 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 hover.update_banner.isHidden() and expanded.update_banner.isHidden() assert confirmation.read_bytes() == before + session.hover.pin(False) + hover.hide() expanded.close() finally: fixture.doCleanups() @@ -775,11 +781,11 @@ def evaluate_app(work, results, short=False, captures=None): import psutil from PySide6.QtCore import QEventLoop, QTimer 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.branding import set_windows_identity 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.providers.ssh import update_host_key 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()) if not short: 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() assert not session.expanded.isVisible() and session.icons[LOCAL].isVisible() if not short: - prefs, connections = SettingsDialog(session), ConnectionsDialog(session) - prefs.show() + connections = ConnectionsDialog(session) connections.show() - assert prefs.isVisible() and connections.isVisible() - assert prefs.tabs.count() == 7 and connections.table.rowCount() == 0 - prefs.close() + assert connections.isVisible() and connections.table.rowCount() == 0 connections.close() - prefs.deleteLater() connections.deleteLater() with ExitStack() as stack: 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") from arm.graphs import tray_icon primary, other = (target.identifier for target in targets) - prefs = SettingsDialog(session) + session.open_settings() tray_machine = prefs.controls["tray_machine"].__self__ assert [tray_machine.itemData(i) for i in range(tray_machine.count())] == [LOCAL, primary, other] tray_machine.setCurrentIndex(tray_machine.findData(primary)) prefs.save() - prefs.deleteLater() + session.expanded.close() assert session.scopes() == [primary] and session.popup.displayed == (LOCAL,) menu = session.menus[primary] for choice in (ALL, other, LOCAL):