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

Method buildDisplayTab

src/gui/DxClusterDialog.cpp:1991–2686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1989}
1990
1991void DxClusterDialog::buildDisplayTab(QTabWidget* tabs)
1992{
1993 auto* page = new QWidget;
1994 auto* layout = new QVBoxLayout(page);
1995 layout->setSpacing(8);
1996
1997 auto& s = AppSettings::instance();
1998 bool spotsEnabled = s.value("IsSpotsEnabled", "True").toString() == "True";
1999 bool passiveSpots = SpotCommandPolicy::passiveModeFromSetting(
2000 s.value(SpotCommandPolicy::kPassiveSpotsModeKey, "False"));
2001 bool memoriesEnabled = s.value("IsMemorySpotsEnabled", "False").toString() == "True";
2002 bool autoMode = s.value("SpotAutoSwitchMode", "True").toString() == "True";
2003 bool sHistorySignals = s.value("SHistoryMarkersEnabled", "False").toString() == "True";
2004 bool sHistoryQrm = s.value("SHistoryQrmEnabled", "False").toString() == "True";
2005 bool overrideColors = s.value("IsSpotsOverrideColorsEnabled", "False").toString() == "True";
2006 bool overrideBg = s.value("IsSpotsOverrideBackgroundColorsEnabled", "True").toString() == "True";
2007 bool overrideBgAuto = s.value("IsSpotsOverrideToAutoBackgroundColorEnabled", "True").toString() == "True";
2008 bool spotLines = s.value("IsSpotsLinesEnabled", "True").toString() == "True";
2009 int levels = s.value("SpotsMaxLevel", 3).toInt();
2010 int position = s.value("SpotsStartingHeightPercentage", 50).toInt();
2011 int fontSize = s.value("SpotFontSize", 16).toInt();
2012 int lifetimeSec = s.value("DxClusterSpotLifetimeSec", 0).toInt();
2013 if (lifetimeSec <= 0)
2014 lifetimeSec = s.value("DxClusterSpotLifetime", 30).toInt() * 60;
2015 QColor spotColor(s.value("SpotsOverrideColor", "#FFFF00").toString());
2016 QColor bgColor(s.value("SpotsOverrideBgColor", "#000000").toString());
2017 int bgOpacity = s.value("SpotsBackgroundOpacity", 48).toInt();
2018
2019 auto* grid = new QGridLayout;
2020 grid->setColumnStretch(1, 1);
2021 int row = 0;
2022
2023 auto save = [this](const QString& key, const QVariant& val) {
2024 auto& s = AppSettings::instance();
2025 s.setValue(key, val);
2026 s.save();
2027 emit settingsChanged();
2028 };
2029
2030 auto updateSwatch = [](QPushButton* btn, const QColor& color) {
2031 btn->setStyleSheet(QString(
2032 "QPushButton { background: %1; border: 2px solid #405060; border-radius: 3px; }"
2033 "QPushButton:hover { border-color: #c8d8e8; }").arg(color.name()));
2034 };
2035
2036 // ── Compact toggle cluster: Spots / Passive / Memories / Auto ─────
2037 // One row of name-on-button toggles replaces four label+button rows.
2038 // Visual state (green checked / red unchecked) carries the on/off
2039 // signal — no separate "Enabled"/"Disabled" text needed.
2040 {
2041 // Use the shared kSpotHubToggle style (matches VfoWidget's
2042 // kDspToggle) — see top of this file.
2043 auto makeToggle = [](const QString& label, bool checked,
2044 const QString& tooltip = {}) {
2045 auto* btn = new QPushButton(label);
2046 btn->setCheckable(true);
2047 btn->setChecked(checked);
2048 btn->setFixedWidth(90);

Callers

nothing calls this directly

Calls 15

passiveModeFromSettingFunction · 0.85
makeToggleFunction · 0.85
applyStyleSheetMethod · 0.80
qsoCountMethod · 0.80
importAdifFileMethod · 0.80
setAutoReloadMethod · 0.80
setResetValueMethod · 0.80
toStringMethod · 0.45
valueMethod · 0.45
setValueMethod · 0.45
saveMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected