MCPcopy Create free account
hub / github.com/aethersdr/AetherSDR / adoptApplet

Method adoptApplet

src/gui/PanFloatingWindow.cpp:33–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33void PanFloatingWindow::adoptApplet(PanadapterApplet* applet)
34{
35 if (!applet) return;
36 m_applet = applet;
37
38 // Use the user-facing slice title (e.g. "Slice A") instead of raw hex pan ID
39 QString title = applet->sliceTitle();
40 if (title.isEmpty())
41 title = QString("Pan %1").arg(applet->panId());
42 setWindowTitle(QString("AetherSDR — %1").arg(title));
43
44 // Reparent directly into this window — addWidget() calls setParent()
45 // internally, so the widget goes straight from the splitter to the
46 // floating window without an intermediate nullptr/top-level state.
47 // This avoids corrupting the main window's NSResponder chain on macOS.
48 m_layout->addWidget(m_applet, 1);
49
50 // Show dock icon in the applet's title bar
51 m_applet->setFloatingState(true);
52 connect(m_applet, &PanadapterApplet::dockClicked, this, [this]() {
53 emit dockRequested(panId());
54 });
55}
56
57QString PanFloatingWindow::panId() const
58{

Callers 1

floatPanadapterMethod · 0.80

Calls 4

sliceTitleMethod · 0.80
isEmptyMethod · 0.45
panIdMethod · 0.45
setFloatingStateMethod · 0.45

Tested by

no test coverage detected