Skip to content

feat(gui): add PersistentDialog base class + migrate Profile Manager (#2605)#2644

Merged
ten9876 merged 4 commits into
mainfrom
aetherclaude/issue-2605
May 14, 2026
Merged

feat(gui): add PersistentDialog base class + migrate Profile Manager (#2605)#2644
ten9876 merged 4 commits into
mainfrom
aetherclaude/issue-2605

Conversation

@aethersdr-agent

Copy link
Copy Markdown
Contributor

Summary

Fixes #2605

What was changed

feat(gui): add PersistentDialog base class + migrate Profile Manager (#2605)

Files modified

  • CMakeLists.txt
  • src/gui/MainWindow.cpp
  • src/gui/MainWindow.h
  • src/gui/PersistentDialog.cpp
  • src/gui/PersistentDialog.h
  • src/gui/ProfileManagerDialog.cpp
  • src/gui/ProfileManagerDialog.h
 src/gui/PersistentDialog.cpp     | 141 +++++++++++++++++++++++++++++++++++++++
 src/gui/PersistentDialog.h       |  74 ++++++++++++++++++++
 src/gui/ProfileManagerDialog.cpp |  99 ++-------------------------
 src/gui/ProfileManagerDialog.h   |  27 ++------
 7 files changed, 276 insertions(+), 128 deletions(-)

Generated by AetherClaude (automated agent for AetherSDR)

…2605)

Collapses the lazy-construct + non-modal + geometry-persist + frameless-
chrome boilerplate shared by every persistent dialog in MainWindow into a
single base class.  Subclasses fill in their content via bodyWidget() and
the base owns:

  * The outer (titleBar + bodyWidget) layout and frameless title-bar widget.
  * FramelessResizer installation (8-axis resize on the top-level window).
  * setFramelessMode(bool) — flips Qt::FramelessWindowHint while preserving
    geometry and toggles the custom title bar / body margins.
  * Geometry persistence under an AppSettings key.  Save fires on close
    (canonical, disk-flushed) AND on move/resize (in-memory, crash-resilient
    — matches ProfileManagerDialog's existing contract).  Restore deferred
    to first showEvent() so subclasses can call setMinimumSize() in their
    ctor without the just-restored geometry being clipped.

MainWindow gains a showOrRaisePersistent<T>(slot, ctorArgs...) template
that collapses the ~10-line menu-callback boilerplate to one line and
auto-registers each dialog in m_persistentDialogs.  setFramelessWindow()
walks that list instead of carrying an explicit qobject_cast branch per
dialog — new persistent dialogs propagate automatically.

Migrates ProfileManagerDialog as the pilot per the issue's migration plan:
-95 LOC of removed boilerplate, the explicit setFramelessWindow() branch
gone, behavior preserved (the same "ProfileManagerDialogGeometry" key
keeps prior sessions' saved geometry intact).

Principle V.
ten9876 and others added 3 commits May 13, 2026 23:20
The header refactor in 137da71 introduced an inline forward declaration
"class QTabWidget* m_tabs;" inside namespace AetherSDR — which declares
AetherSDR::QTabWidget (a new incomplete type) rather than referencing
the global ::QTabWidget.  The .cpp then used operations on the
incomplete type, breaking the build on every platform.

Move the forward declaration outside the namespace alongside the other
Qt class forward-decls (QLineEdit, QListWidget, QPushButton, QCheckBox).

Co-Authored-By: AetherClaude <aethersdr-agent@users.noreply.github.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Resolves MainWindow.cpp conflict in setFramelessWindow().  The PR
removes the m_profileManagerDialog->setFramelessMode(on) call (Profile
Manager is now a PersistentDialog subclass and auto-propagates via
m_persistentDialogs).  Main added m_profileImportExportDialog->
setFramelessMode(on) from PR #2641 — Profile Import/Export is NOT yet
migrated to PersistentDialog, so its explicit cast stays.

@ten9876 ten9876 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved. PersistentDialog base class consolidates the lazy-construct + non-modal + geometry-persist + frameless-chrome boilerplate that's been hand-rolled across 7+ dialogs. Architecture clean — base owns the FramelessWindowTitleBar / FramelessResizer / setFramelessMode / move-resize-close events / base64 geometry round-trip / deferred-restore lifecycle, subclasses just install their content via bodyWidget(). m_persistentDialogs registry + showOrRaisePersistent template helper eliminate per-dialog qobject_cast branches in setFramelessWindow. Profile Manager migration is strictly subtractive — 99 LOC removed. All CI green including check-windows after the merges with main.

@ten9876 ten9876 merged commit 00422de into main May 14, 2026
5 checks passed
@ten9876 ten9876 deleted the aetherclaude/issue-2605 branch May 14, 2026 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add PersistentDialog base class to eliminate dialog-conversion boilerplate

1 participant