Files
NetBox-Import-Desktop/netbox_sync/ui/pages/__init__.py
T
MrBlakeandClaude Opus 5.5 4878275f2a feat: rebuild app with Qt UI, installer and safer switch sync
- Replace the Tkinter app with a PySide6 UI: sidebar navigation, central
  profile switcher, autosave, light/dark theme, background tasks with
  progress and cancel, toasts and a filterable activity log
- Split logic into netbox_sync.core (config, NetBox, VMware/Proxmox,
  VM import, switches) and netbox_sync.ui
- Replace the three-dialog import chain with a four-step import wizard;
  support the global VRF and match VMs per cluster
- Expose the previously unreachable VRF/prefix batch tool
- Switch sync: no silent LLDP config changes, TOFU host key checks,
  platform auto-detection, Comware name normalization, fixed AOS-S and
  Comware LLDP parsing, FQDN/management-IP cable matching, dry-run
  preview, interface types only set on create
- Add PyInstaller onedir spec, Inno Setup installer and build.ps1
- Add pytest suite with an in-memory NetBox fake
- Stop tracking the built exe

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-12 15:15:23 +02:00

47 lines
1.4 KiB
Python

"""Main window pages."""
from PySide6.QtWidgets import QFrame, QScrollArea, QVBoxLayout, QWidget
from netbox_sync.ui.widgets import PageHeader
class Page(QWidget):
"""Common page frame: header plus content area, optionally scrollable."""
title = ""
subtitle = ""
def __init__(self, window, scrollable=False):
super().__init__()
self.window = window
self.state = window.state
self.tasks = window.tasks
self.actions = window.actions
self.setObjectName("PageRoot")
outer = QVBoxLayout(self)
outer.setContentsMargins(0, 0, 0, 0)
if scrollable:
scroll = QScrollArea()
scroll.setWidgetResizable(True)
scroll.setFrameShape(QFrame.NoFrame)
inner = QWidget()
inner.setObjectName("PageRoot")
scroll.setWidget(inner)
outer.addWidget(scroll)
host = inner
else:
host = self
self.body = QVBoxLayout() if host is self else QVBoxLayout(host)
if host is self:
outer.addLayout(self.body)
self.body.setContentsMargins(32, 26, 32, 24)
self.body.setSpacing(18)
self.header = PageHeader(self.title, self.subtitle)
self.body.addWidget(self.header)
def on_show(self):
"""Called whenever the page becomes visible."""
def set_busy(self, busy):
"""Disable actions that would conflict with a running task."""