From b7cd2c432aa5ee9212da6b7e6a1bd10e72a4085f Mon Sep 17 00:00:00 2001 From: Elliott Liggett Date: Sat, 18 Feb 2023 19:25:02 -0800 Subject: [PATCH] Lots of pref loading code. Added Settings button! --- prefs.h | 71 +- settingswidget.cpp | 614 +++++++++ settingswidget.h | 83 ++ settingswidget.ui | 3207 ++++++++++++++++++++++++++++++++++++++++++++ udpbase.h | 12 + wfmain.cpp | 36 +- wfmain.h | 5 +- wfmain.ui | 9 +- wfview.pro | 3 + 9 files changed, 4028 insertions(+), 12 deletions(-) create mode 100644 settingswidget.cpp create mode 100644 settingswidget.h create mode 100644 settingswidget.ui diff --git a/prefs.h b/prefs.h index c5d9fd0..d485492 100644 --- a/prefs.h +++ b/prefs.h @@ -5,6 +5,74 @@ #include "wfviewtypes.h" +enum prefIfItem { + if_useFullScreen = 1 << 0, + if_useSystemTheme = 1 << 1, + if_drawPeaks = 1 << 2, + if_underlayMode = 1 << 3, + if_underlayBufferSize = 1 << 4, + if_wfAntiAlias = 1 << 5, + if_wfInterpolate = 1 << 6, + if_wftheme = 1 << 7, + if_plotFloor = 1 << 8, + if_plotCeiling = 1 << 9, + if_stylesheetPath = 1 << 10, + if_wflength = 1 << 11, + if_confirmExit = 1 << 12, + if_confirmPowerOff = 1 << 13, + if_meterKind = 1 << 14, + if_clickDragTuningEnable = 1 << 15, + if_currentColorPresetNumber = 1 << 16, + if_all = 1 << 17 +}; + +enum prefRaItem { + + ra_radioCIVAddr = 1 << 0, + ra_CIVisRadioModel = 1 << 1, + ra_forceRTSasPTT = 1 << 2, + ra_polling_ms = 1 << 3, + ra_serialPortRadio = 1 << 4, + ra_serialPortBaud = 1 << 5, + ra_virtualSerialPort = 1 << 6, + ra_localAFgain = 1 << 7, + ra_audioSystem = 1 << 8, + ra_all = 1 << 9 +}; + +enum prefCtItem { + ct_enablePTT = 1 << 0, + ct_niceTS = 1 << 1, + ct_automaticSidebandSwitching = 1 << 2, + ct_enableUSBControllers = 1 << 3, + ct_usbSensitivity = 1 << 4, + ct_all = 1 << 5 +}; + +enum prefLanItem { + + l_enableLAN = 1 << 1, + l_enableRigCtlD = 1 << 2, + l_rigCtlPort = 1 << 3, + l_tcpPort = 1 << 4, + l_waterfallFormat = 1 << 5, + l_all = 1 << 6 +}; + +enum prefClusterItem { + cl_clusterUdpEnable = 1 << 1, + cl_clusterTcpEnable = 1 << 2, + cl_clusterUdpPort = 1 << 3, + cl_clusterTcpServerName = 1 << 4, + cl_clusterTcpUserName = 1 << 5, + cl_clusterTcpPassword = 1 << 6, + cl_clusterTimeout = 1 << 7, + cl_clusterSkimmerSpotsEnable = 1 << 8, + cl_all = 1 << 9 +}; + + + struct preferences { // Program: QString version; @@ -29,6 +97,8 @@ struct preferences { bool confirmPowerOff; meterKind meter2Type; bool clickDragTuningEnable; + int currentColorPresetNumber = 0; + // Radio: unsigned char radioCIVAddr; @@ -52,7 +122,6 @@ struct preferences { bool enableLAN; bool enableRigCtlD; quint16 rigCtlPort; - int currentColorPresetNumber = 0; quint16 tcpPort; quint8 waterfallFormat; diff --git a/settingswidget.cpp b/settingswidget.cpp new file mode 100644 index 0000000..23e7004 --- /dev/null +++ b/settingswidget.cpp @@ -0,0 +1,614 @@ +#include "settingswidget.h" +#include "ui_settingswidget.h" + +#define setchk(a,b) quietlyUpdateCheckbox(a,b) + +settingswidget::settingswidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::settingswidget) +{ + ui->setupUi(this); + createSettingsListItems(); + populateComboBoxes(); +} + +settingswidget::~settingswidget() +{ + delete ui; +} + +void settingswidget::createSettingsListItems() +{ + // Add items to the settings tab list widget + ui->settingsList->addItem("Radio Access"); // 0 + ui->settingsList->addItem("User Interface"); // 1 + ui->settingsList->addItem("Radio Settings"); // 2 + ui->settingsList->addItem("Radio Server"); // 3 + ui->settingsList->addItem("External Control"); // 4 + ui->settingsList->addItem("DX Cluster"); // 5 + ui->settingsList->addItem("Experimental"); // 6 + //ui->settingsList->addItem("Audio Processing"); // 7 + ui->settingsStack->setCurrentIndex(0); +} + +void settingswidget::populateComboBoxes() +{ + + ui->baudRateCombo->insertItem(0, QString("115200"), 115200); + ui->baudRateCombo->insertItem(1, QString("57600"), 57600); + ui->baudRateCombo->insertItem(2, QString("38400"), 38400); + ui->baudRateCombo->insertItem(3, QString("28800"), 28800); + ui->baudRateCombo->insertItem(4, QString("19200"), 19200); + ui->baudRateCombo->insertItem(5, QString("9600"), 9600); + ui->baudRateCombo->insertItem(6, QString("4800"), 4800); + ui->baudRateCombo->insertItem(7, QString("2400"), 2400); + ui->baudRateCombo->insertItem(8, QString("1200"), 1200); + ui->baudRateCombo->insertItem(9, QString("300"), 300); + + ui->meter2selectionCombo->addItem("None", meterNone); + ui->meter2selectionCombo->addItem("SWR", meterSWR); + ui->meter2selectionCombo->addItem("ALC", meterALC); + ui->meter2selectionCombo->addItem("Compression", meterComp); + ui->meter2selectionCombo->addItem("Voltage", meterVoltage); + ui->meter2selectionCombo->addItem("Current", meterCurrent); + ui->meter2selectionCombo->addItem("Center", meterCenter); + ui->meter2selectionCombo->addItem("TxRxAudio", meterAudio); + ui->meter2selectionCombo->addItem("RxAudio", meterRxAudio); + ui->meter2selectionCombo->addItem("TxAudio", meterTxMod); + + + ui->meter2selectionCombo->show(); + // prefs not valid yet ui->meter2selectionCombo->setCurrentIndex((int)prefs.meter2Type); + + ui->secondaryMeterSelectionLabel->show(); + + + + + ui->controlPortTxt->setValidator(new QIntValidator(this)); +} + +void settingswidget::on_settingsList_currentRowChanged(int currentRow) +{ + ui->settingsStack->setCurrentIndex(currentRow); +} + +void settingswidget::acceptPreferencesPtr(preferences *pptr) +{ + if(pptr != NULL) + { + qDebug(logGui()) << "Accepting general preferences pointer into settings widget."; + prefs = pptr; + havePrefs = true; + } +} + +void settingswidget::acceptUdpPreferencesPtr(udpPreferences *upptr) +{ + if(upptr != NULL) + { + qDebug(logGui()) << "Accepting UDP preferences pointer into settings widget."; + udpPrefs = upptr; + haveUdpPrefs = true; + } +} + +void settingswidget::updateIfPrefs(int items) +{ + prefIfItem pif; + if(items & (int)if_all) + { + items = 0xffffffff; + } + for(int i=1; i < (int)if_all; i = i << 1) + { + if(items & i) + { + qDebug(logGui()) << "Updating If pref" << (int)i; + pif = (prefIfItem)i; + updateIfPref(pif); + } + } + + +// for(int i=0; 0x1 << i < (int)if_all; i++) +// { +// if(items & (0x1 << i)) +// { +// qDebug(logGui()) << "Updating If pref" << (int)0; +// pif = (prefIfItem)(0x1 << i); +// updateIfPref(pif); +// } +// } +} + +void settingswidget::updateRaPrefs(int items) +{ + prefRaItem pra; + if(items & (int)ra_all) + { + items = 0xffffffff; + } + for(int i=1; i < (int)ra_all; i = i << 1) + { + if(items & i) + { + qDebug(logGui()) << "Updating Ra pref" << (int)i; + pra = (prefRaItem)i; + updateRaPref(pra); + } + } +} + +void settingswidget::updateCtPrefs(int items) +{ + prefCtItem pct; + if(items & (int)ct_all) + { + items = 0xffffffff; + } + for(int i=1; i < (int)ct_all; i = i << 1) + { + if(items & i) + { + qDebug(logGui()) << "Updating Ct pref" << (int)i; + pct = (prefCtItem)i; + updateCtPref(pct); + } + } +} + +void settingswidget::updateLanPrefs(int items) +{ + prefLanItem plan; + if(items & (int)l_all) + { + items = 0xffffffff; + } + for(int i=1; i < (int)l_all; i = i << 1) + { + if(items & i) + { + qDebug(logGui()) << "Updating Lan pref" << (int)i; + plan = (prefLanItem)i; + updateLanPref(plan); + } + } +} + +void settingswidget::updateClusterPrefs(int items) +{ + prefClusterItem pcl; + if(items & (int)cl_all) + { + items = 0xffffffff; + } + for(int i=0; i < (int)cl_all; i++) + { + if(items & (0x1 << i)) + { + qDebug(logGui()) << "Updating Cluster pref" << (int)i; + pcl = (prefClusterItem)i; + updateClusterPref(pcl); + } + } +} + +void settingswidget::updateIfPref(prefIfItem pif) +{ + updatingUIFromPrefs = true; + switch(pif) + { + case if_useFullScreen: + quietlyUpdateCheckbox(ui->fullScreenChk, prefs->useFullScreen); + break; + case if_useSystemTheme: + quietlyUpdateCheckbox(ui->useSystemThemeChk, prefs->useSystemTheme); + break; + case if_drawPeaks: + // depreciated; + break; + case if_underlayMode: + updateUnderlayMode(); + break; + case if_underlayBufferSize: + quietlyUpdateSlider(ui->underlayBufferSlider, prefs->underlayBufferSize); + break; + case if_wfAntiAlias: + quietlyUpdateCheckbox(ui->wfAntiAliasChk, prefs->wfAntiAlias); + break; + case if_wfInterpolate: + quietlyUpdateCheckbox(ui->wfInterpolateChk, prefs->wfInterpolate); + break; + case if_wftheme: + // Not handled in settings. + break; + case if_plotFloor: + // Not handled in settings. + break; + case if_plotCeiling: + // Not handled in settings. + break; + case if_stylesheetPath: + // No UI element for this. + break; + case if_wflength: + // Not handled in settings. + break; + case if_confirmExit: + // No UI element for this. + break; + case if_confirmPowerOff: + // No UI element for this. + break; + case if_meterKind: + { + int m = ui->meter2selectionCombo->findData(prefs->meter2Type); + ui->meter2selectionCombo->setCurrentIndex(m); + break; + } + case if_clickDragTuningEnable: + quietlyUpdateCheckbox(ui->clickDragTuningEnableChk, prefs->clickDragTuningEnable); + break; + case if_currentColorPresetNumber: + ui->colorPresetCombo->setCurrentIndex(prefs->currentColorPresetNumber); + // activate? or done when prefs load? Maybe some of each? + // TODO + break; + default: + qWarning(logGui()) << "Did not understand if pref update item " << (int)pif; + break; + } + updatingUIFromPrefs = false; +} + +void settingswidget::updateRaPref(prefRaItem pra) +{ + updatingUIFromPrefs = true; + switch(pra) + { + case ra_radioCIVAddr: + // It may be possible to ignore this value at this time. + // TODO + if(prefs->radioCIVAddr == 0) + { + ui->rigCIVaddrHexLine->setText("auto"); + ui->rigCIVaddrHexLine->setEnabled(false); + } else { + ui->rigCIVaddrHexLine->setEnabled(true); + ui->rigCIVaddrHexLine->setText(QString("%1").arg(prefs->radioCIVAddr, 2, 16)); + } + break; + case ra_CIVisRadioModel: + quietlyUpdateCheckbox(ui->useCIVasRigIDChk, prefs->CIVisRadioModel); + break; + case ra_forceRTSasPTT: + quietlyUpdateCheckbox(ui->useRTSforPTTchk, prefs->forceRTSasPTT); + break; + case ra_polling_ms: + if(prefs->polling_ms == 0) + { + // Automatic + ui->pollingButtonGroup->blockSignals(true); + ui->autoPollBtn->setChecked(true); + ui->manualPollBtn->setChecked(false); + ui->pollingButtonGroup->blockSignals(false); + ui->pollTimeMsSpin->setEnabled(false); + } else { + // Manual + ui->pollingButtonGroup->blockSignals(true); + ui->autoPollBtn->setChecked(false); + ui->manualPollBtn->setChecked(true); + ui->pollingButtonGroup->blockSignals(false); + ui->pollTimeMsSpin->blockSignals(true); + ui->pollTimeMsSpin->setValue(prefs->polling_ms); + ui->pollTimeMsSpin->blockSignals(false); + ui->pollTimeMsSpin->setEnabled(true); + } + break; + case ra_serialPortRadio: + { + int serialIndex = ui->serialDeviceListCombo->findText(prefs->serialPortRadio); + if (serialIndex != -1) { + ui->serialDeviceListCombo->setCurrentIndex(serialIndex); + } else { + // TODO + qWarning(logGui()) << "Cannot find serial port in serial combo box."; + } + break; + } + case ra_serialPortBaud: + ui->baudRateCombo->blockSignals(true); + ui->baudRateCombo->setCurrentIndex(ui->baudRateCombo->findData(prefs->serialPortBaud)); + ui->baudRateCombo->blockSignals(false); + break; + case ra_virtualSerialPort: + { + int vspIndex = ui->vspCombo->findText(prefs->virtualSerialPort); + if (vspIndex != -1) { + ui->vspCombo->setCurrentIndex(vspIndex); + } + else + { + ui->vspCombo->addItem(prefs->virtualSerialPort); + ui->vspCombo->setCurrentIndex(ui->vspCombo->count() - 1); + } + break; + } + case ra_localAFgain: + // Not handled here. + break; + case ra_audioSystem: + ui->audioSystemCombo->blockSignals(true); + ui->audioSystemServerCombo->blockSignals(true); + ui->audioSystemCombo->setCurrentIndex(prefs->audioSystem); + ui->audioSystemServerCombo->setCurrentIndex(prefs->audioSystem); + ui->audioSystemServerCombo->blockSignals(false); + ui->audioSystemCombo->blockSignals(false); + break; + default: + qWarning(logGui()) << "Cannot update ra pref" << (int)pra; + } + updatingUIFromPrefs = false; +} + +void settingswidget::updateCtPref(prefCtItem pct) +{ + updatingUIFromPrefs = true; + + switch(pct) + { + case ct_enablePTT: + quietlyUpdateCheckbox(ui->pttEnableChk, prefs->enablePTT); + break; + case ct_niceTS: + quietlyUpdateCheckbox(ui->tuningFloorZerosChk, prefs->niceTS); + break; + case ct_automaticSidebandSwitching: + quietlyUpdateCheckbox(ui->autoSSBchk, prefs->automaticSidebandSwitching); + break; + case ct_enableUSBControllers: + quietlyUpdateCheckbox(ui->enableUsbChk, prefs->enableUSBControllers); + break; + case ct_usbSensitivity: + // No UI element for this. + break; + default: + qWarning(logGui()) << "No UI element matches setting" << (int)pct; + break; + } + updatingUIFromPrefs = false; +} + +void settingswidget::updateLanPref(prefLanItem plan) +{ + updatingUIFromPrefs = true; + switch(plan) + { + case l_enableLAN: + quietlyUpdateRadiobutton(ui->lanEnableBtn, prefs->enableLAN); + break; + case l_enableRigCtlD: + quietlyUpdateCheckbox(ui->enableRigctldChk, prefs->enableRigCtlD); + break; + case l_rigCtlPort: + ui->rigctldPortTxt->setText(QString::number(prefs->rigCtlPort)); + break; + case l_tcpPort: + ui->tcpServerPortTxt->setText(QString::number(prefs->tcpPort)); + break; + case l_waterfallFormat: + ui->waterfallFormatCombo->blockSignals(true); + ui->waterfallFormatCombo->setCurrentIndex(prefs->waterfallFormat); + ui->waterfallFormatCombo->blockSignals(false); + break; + default: + qWarning(logGui()) << "Did not find matching preference for ui update:" << (int)plan; + } + updatingUIFromPrefs = false; +} + +void settingswidget::updateClusterPref(prefClusterItem pcl) +{ + updatingUIFromPrefs = true; + // TODO, lots of work here.... + switch(pcl) + { + case cl_clusterUdpEnable: + quietlyUpdateCheckbox(ui->clusterUdpEnable, prefs->clusterUdpEnable); + break; + case cl_clusterTcpEnable: + quietlyUpdateCheckbox(ui->clusterTcpEnable, prefs->clusterTcpEnable); + break; + case cl_clusterUdpPort: + ui->clusterUdpPortLineEdit->setText(QString::number(prefs->clusterUdpPort)); + break; + case cl_clusterTcpServerName: + break; + case cl_clusterTcpUserName: + break; + case cl_clusterTcpPassword: + break; + case cl_clusterTimeout: + break; + case cl_clusterSkimmerSpotsEnable: + quietlyUpdateCheckbox(ui->clusterSkimmerSpotsEnable, prefs->clusterSkimmerSpotsEnable); + break; + default: + qWarning(logGui()) << "Did not find matching UI element for cluster preference " << (int)pcl; + break; + } + updatingUIFromPrefs = false; +} + +void settingswidget::updateUdpPrefs(int items) +{ + udpPrefsItem upi; + if(items & (int)u_all) + { + items = 0xffffffff; + } + for(int i=0; i < (int)u_all; i++) + { + if(items & i) + { + qDebug(logGui()) << "Updating UDP preference " << i; + upi = (udpPrefsItem)i; + updateUdpPref(upi); + } + } +} + +void settingswidget::updateUdpPref(udpPrefsItem upi) +{ + updatingUIFromPrefs = true; + switch(upi) + { + case u_ipAddress: + ui->ipAddressTxt->setEnabled(ui->lanEnableBtn->isChecked()); + ui->ipAddressTxt->setText(udpPrefs->ipAddress); + break; + case u_controlLANPort: + ui->controlPortTxt->setEnabled(ui->lanEnableBtn->isChecked()); + ui->controlPortTxt->setText(QString("%1").arg(udpPrefs->controlLANPort)); + break; + case u_serialLANPort: + // Not used in the UI. + break; + case u_audioLANPort: + // Not used in the UI. + break; + case u_username: + ui->usernameTxt->setEnabled(ui->lanEnableBtn->isChecked()); + ui->usernameTxt->setText(QString("%1").arg(udpPrefs->username)); + break; + case u_password: + ui->passwordTxt->setEnabled(ui->lanEnableBtn->isChecked()); + ui->passwordTxt->setText(QString("%1").arg(udpPrefs->password)); + break; + case u_clientName: + // Not used in the UI. + break; + case u_waterfallFormat: + // Not used in the UI. + break; + case u_halfDuplex: + ui->audioDuplexCombo->setCurrentIndex((int)udpPrefs->halfDuplex); + break; + default: + qWarning(logGui()) << "Did not find matching UI element for UDP pref item " << (int)upi; + break; + } + updatingUIFromPrefs = false; +} + +void settingswidget::updateUnderlayMode() +{ + + quietlyUpdateRadiobutton(ui->underlayNone, false); + quietlyUpdateRadiobutton(ui->underlayPeakHold, false); + quietlyUpdateRadiobutton(ui->underlayPeakBuffer, false); + quietlyUpdateRadiobutton(ui->underlayAverageBuffer, false); + + switch(prefs->underlayMode) { + case underlayNone: + quietlyUpdateRadiobutton(ui->underlayNone, true); + break; + case underlayPeakHold: + quietlyUpdateRadiobutton(ui->underlayPeakHold, true); + break; + case underlayPeakBuffer: + quietlyUpdateRadiobutton(ui->underlayPeakBuffer, true); + break; + case underlayAverageBuffer: + quietlyUpdateRadiobutton(ui->underlayAverageBuffer, true); + break; + default: + qWarning() << "Do not understand underlay mode: " << (unsigned int) prefs->underlayMode; + } +} + +void settingswidget::updateAllPrefs() +{ + // DEPRECIATED + + + // Review all the preferences. This is intended to be called + // after new settings are loaded in. + updatingUIFromPrefs = true; + ui->fullScreenChk->setChecked(prefs->useFullScreen); + ui->useSystemThemeChk->setChecked(prefs->useSystemTheme); + //drawPeaks not used + switch(prefs->underlayMode) { + case underlayNone: + ui->underlayNone->setChecked(true); + break; + case underlayPeakHold: + ui->underlayPeakHold->setChecked(true); + break; + case underlayPeakBuffer: + ui->underlayPeakBuffer->setChecked(true); + break; + case underlayAverageBuffer: + ui->underlayAverageBuffer->setChecked(true); + break; + default: + qWarning() << "Do not understand underlay mode: " << (unsigned int) prefs->underlayMode; + } + quietlyUpdateSlider(ui->underlayBufferSlider, prefs->underlayBufferSize); + ui->wfAntiAliasChk->setChecked(prefs->wfAntiAlias); + ui->wfInterpolateChk->setChecked(prefs->wfInterpolate); + + updatingUIFromPrefs = false; +} + +void settingswidget::quietlyUpdateSlider(QSlider *sl, int val) +{ + sl->blockSignals(true); + if( (val >= sl->minimum()) && (val <= sl->maximum()) ) + sl->setValue(val); + sl->blockSignals(false); +} + +void settingswidget::quietlyUpdateCheckbox(QCheckBox *cb, bool isChecked) +{ + cb->blockSignals(true); + cb->setChecked(isChecked); + cb->blockSignals(false); +} + +void settingswidget::quietlyUpdateRadiobutton(QRadioButton *rb, bool isChecked) +{ + rb->blockSignals(true); + rb->setChecked(isChecked); + rb->blockSignals(false); +} + +void settingswidget::on_lanEnableBtn_clicked(bool checked) +{ + // TODO: prefs.enableLAN = checked; + // TOTO? ui->connectBtn->setEnabled(true); + ui->ipAddressTxt->setEnabled(checked); + ui->controlPortTxt->setEnabled(checked); + ui->usernameTxt->setEnabled(checked); + ui->passwordTxt->setEnabled(checked); + ui->audioRXCodecCombo->setEnabled(checked); + ui->audioTXCodecCombo->setEnabled(checked); + ui->audioSampleRateCombo->setEnabled(checked); + ui->rxLatencySlider->setEnabled(checked); + ui->txLatencySlider->setEnabled(checked); + ui->rxLatencyValue->setEnabled(checked); + ui->txLatencyValue->setEnabled(checked); + ui->audioOutputCombo->setEnabled(checked); + ui->audioInputCombo->setEnabled(checked); + ui->baudRateCombo->setEnabled(!checked); + ui->serialDeviceListCombo->setEnabled(!checked); + ui->serverRXAudioInputCombo->setEnabled(!checked); + ui->serverTXAudioOutputCombo->setEnabled(!checked); + if(checked) + { + //showStatusBarText("After filling in values, press Save Settings."); + } + prefs->enableLAN = checked; + // TODO: emit widgetChangedPrefs(l_enableLAN); +} diff --git a/settingswidget.h b/settingswidget.h new file mode 100644 index 0000000..a5b93f2 --- /dev/null +++ b/settingswidget.h @@ -0,0 +1,83 @@ +#ifndef SETTINGSWIDGET_H +#define SETTINGSWIDGET_H + +#include +#include +#include +#include + +#include "logcategories.h" +#include "prefs.h" +#include "colorprefs.h" +#include "udpbase.h" // for udp preferences + +namespace Ui { +class settingswidget; +} + +class settingswidget : public QWidget +{ + Q_OBJECT + +public: + explicit settingswidget(QWidget *parent = nullptr); + + ~settingswidget(); + +public slots: + void acceptPreferencesPtr(preferences *pptr); + void acceptUdpPreferencesPtr(udpPreferences *upptr); + + void updateIfPrefs(int items); + void updateRaPrefs(int items); + void updateCtPrefs(int items); + void updateLanPrefs(int items); + void updateClusterPrefs(int items); + + void updateIfPref(prefIfItem pif); + void updateRaPref(prefRaItem pra); + void updateCtPref(prefCtItem pct); + void updateLanPref(prefLanItem plan); + void updateClusterPref(prefClusterItem pcl); + + // depreciated: + //void externalChangedPreferences(prefItem pi); + void updateUdpPref(udpPrefsItem upi); + //void externalChangedMultiplePreferences(uint64_t items); + void updateUdpPrefs(int items); + + +signals: + // Not sure if we should do it this way, + // since many of these changes are not thought + // of as merely "preferences"... although they generally are... + // ...hmm + void changedIfPref(int items); + void changedRaPref(int items); + void changedCtPrefs(int items); + void changedLanPrefs(int items); + void changedClusterPrefs(int items); + +private slots: + void on_settingsList_currentRowChanged(int currentRow); + + void on_lanEnableBtn_clicked(bool checked); + +private: + Ui::settingswidget *ui; + void createSettingsListItems(); + void populateComboBoxes(); + void updateAllPrefs(); + void updateUnderlayMode(); + void quietlyUpdateSlider(QSlider* sl, int val); + void quietlyUpdateCheckbox(QCheckBox *cb, bool isChecked); + void quietlyUpdateRadiobutton(QRadioButton *rb, bool isChecked); + + preferences *prefs = NULL; + udpPreferences *udpPrefs = NULL; + bool havePrefs = false; + bool haveUdpPrefs = false; + bool updatingUIFromPrefs = false; +}; + +#endif // SETTINGSWIDGET_H diff --git a/settingswidget.ui b/settingswidget.ui new file mode 100644 index 0000000..a47eb72 --- /dev/null +++ b/settingswidget.ui @@ -0,0 +1,3207 @@ + + + settingswidget + + + + 0 + 0 + 1118 + 561 + + + + Settings + + + + + + 0 + + + 0 + + + + + + 150 + 0 + + + + + 150 + 16777215 + + + + + + + + 1 + + + + + + + + + + 140 + 0 + + + + Radio Connection + + + + + + Serial (USB) + + + + + + + Network + + + + + + + + + + + 300 + 0 + + + + + 300 + 16777215 + + + + CI-V and Model + + + + + + <html><head/><body><p>If you are using an older (year 2010) radio, you may need to enable this option to manually specify the CI-V address. This option is also useful for radios that do not have CI-V Transceive enabled and thus will not answer our broadcast query for connected rigs on the CI-V bus.</p><p>If you have a modern radio with CI-V Transceive enabled, you should not need to check this box. </p><p>You will need to Save Settings and re-launch wfview for this to take effect. </p></body></html> + + + Manual Radio CI-V Address: + + + + + + + <html><head/><body><p>Only check for older radios!</p><p>This checkbox forces wfview to trust that the CI-V address is also the model number of the radio. This is only useful for older radios that do not reply to our Rig ID requests (0x19 0x00). Do not check this box unless you have an older radio. </p></body></html> + + + Use CI-V address as Model ID too + + + + + + + false + + + + 50 + 0 + + + + + 50 + 16777215 + + + + <html><head/><body><p>Enter the address in as hexadecimal, without any prefix, just as the radio presents the address in the menu. </p><p>Here are some common examples:</p> +<p>IC-706: 58 +<br/>IC-756: 50 +<br/>IC-756 Pro: 5C +<br/>IC-756 Pro II: 64 +<br/>IC-756 Pro III: 6E +<br/>IC-7000: 70 +<br/>IC-7100: 88 +<br/>IC-7200: 76 +<br/>IC-7300: 94 +</p><p>This setting is typically needed for older radios and for radios that do not have CI-V Transceive enabled. </p> +<p>After changing, press Save Settings and re-launch wfview.</p></body></html> + + + auto + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + + Serial Connected Radios + + + + 3 + + + 5 + + + 3 + + + 5 + + + + + Serial Device: + + + + + + + + 180 + 0 + + + + + 180 + 16777215 + + + + + + + + Baud Rate + + + + + + + + 120 + 16777215 + + + + + + + + <html><head/><body><p>This feature is for older radios that respond best to an RTS serial port signal than a PTT command.</p><p><br/>For radios lacking PTT commands, this is automatic and transparent, but for radios which have a PTT command, you can check this box to override and force the PTT to be done using RTS. Do not check this box unless you really need this and have an appropriate adapter with RTS connected to the PTT line of the transceiver. </p></body></html> + + + Send RTS for PTT + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + Network Connected Radios + + + + 6 + + + 3 + + + 5 + + + 3 + + + 5 + + + + + 0 + + + 0 + + + 0 + + + + + Hostname + + + + + + + + 256 + 0 + + + + + 256 + 16777215 + + + + + + + + Control Port + + + + + + + + 75 + 16777215 + + + + 50001 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 0 + + + 0 + + + + + Username + + + + + + + + 256 + 0 + + + + + 256 + 16777215 + + + + + + + + Password + + + + + + + + 180 + 0 + + + + + 180 + 16777215 + + + + QLineEdit::PasswordEchoOnEdit + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + RX Latency (ms) + + + + + + + + 0 + 0 + + + + 30 + + + 500 + + + Qt::Horizontal + + + + + + + 0 + + + + + + + TX Latency (ms) + + + + + + + 30 + + + 500 + + + Qt::Horizontal + + + + + + + 0 + + + + + + + RX Codec + + + + + + + Receive Audio Codec Selector + + + + + + + TX Codec + + + + + + + Transmit Audio Codec Selector + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Sample Rate + + + + + + + Audio Sample Rate Selector + + + + 48000 + + + + + 24000 + + + + + 16000 + + + + + 8000 + + + + + + + + Duplex + + + + + + + + Full Duplex + + + + + Half Duplex + + + + + + + + Audio System + + + + + + + + Qt Audio + + + + + PortAudio + + + + + RT Audio + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Audio Output + + + + + + + + 200 + 16777215 + + + + Audio Output Selector + + + + + + + Audio Input + + + + + + + + 200 + 16777215 + + + + Audio Input Selector + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + When tuning, set lower digits to zero + + + true + + + + + + + When using SSB, automatically switch to the standard sideband for a given band. + + + Auto SSB Switching + + + When using SSB, automatically switch to the standard sideband for a given band. + + + Auto SSB + + + + + + + Allow tuning via click and drag (experimental) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Enables interpolation between pixels. Note that this will increase CPU usage. + + + Interpolate Waterfall + + + true + + + + + + + Anti-Alias Waterfall + + + + + + + Use System Theme + + + + + + + Show full screen + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Underlay Mode + + + + + + + No underlay graphics + + + None + + + true + + + + + + + Indefinite peak hold + + + Peak Hold + + + + + + + Peak value within the buffer + + + Peak + + + + + + + Average value within the buffer + + + Average + + + + + + + Underlay Buffer Size: + + + + + + + + 100 + 16777215 + + + + Size of buffer for spectrum data. Shorter values are more responsive. + + + 8 + + + 128 + + + 64 + + + Qt::Horizontal + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Enable PTT Controls + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 20 + 20 + + + + + + + + Secondary Meter Selection: + + + + + + + + + + wfview will automatically calculate command polling. Recommended. + + + AutoPolling + + + true + + + pollingButtonGroup + + + + + + + Manual (user-defined) command polling + + + Manual Polling Inteval: + + + pollingButtonGroup + + + + + + + Sets the polling interval, in ms. Automatic polling is recommended. Serial port and USB port radios should not poll quicker than about 75ms. + + + 1 + + + 250 + + + + + + + ms + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + 0 + + + + + Color scheme + + + + + + + Preset: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 90 + 0 + + + + + 90 + 16777215 + + + + Select a color preset here. + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + 5 + + + + + + + + Saves the current preset to the settings file. + + + Save Preset + + + + + + + Revert the selected color preset to the default. + + + Revert + + + + + + + Rename the selected color preset. Max length is 10 characters. + + + Rename Preset + + + + + + + <html><head/><body><p>Pop out (or pop back in) the entire Settings tab. </p><p>NOTE: Press this button again to re-insert the tab when finished. </p></body></html> + + + Pop-Out + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + 0 + 1 + + + + + 0 + 250 + + + + + 0 + 0 + + + + User-defined Color Editor + + + + 0 + + + 4 + + + 0 + + + 0 + + + + + QAbstractScrollArea::AdjustIgnored + + + true + + + + + 0 + 0 + 916 + 311 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + 0 + + + 6 + + + + + + 10 + 0 + + + + + + + + + 10 + 0 + + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + Meter Text + + + + + + + Grid + + + + + + + Text + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + + 10 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 10 + 0 + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + Meter Scale + + + + + + + + 90 + 16777215 + + + + Color text format is #AARRGGBB, where AA is the "alpha" channel, and value "00" is totally transparent, and "ff" is totally opaque. + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Waterfall Back + + + + + + + Axis + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + Plot Background + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + Spectrum Line + + + + + + + Spectrum Fill + + + + + + + Underlay Line + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + + 10 + 0 + + + + + + + + + 10 + 0 + + + + + + + + + 10 + 0 + + + + + + + + Underlay Fill + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Tuning Line + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Passband + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + PBT Indicator + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Meter Level + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Meter Average + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Meter Peak Level + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Meter High Scale + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Waterfall Grid + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Waterfall Axis + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Waterfall Text + + + + + + + + 90 + 16777215 + + + + #AARRGGBB + + + + + + + + 10 + 0 + + + + + + + + Cluster Spots + + + + + + + + 0 + 0 + + + + + 90 + 16777215 + + + + + + + + + 10 + 0 + + + + + + + + + + + + + + + + + Qt::Vertical + + + + 20 + 20 + + + + + + + + + + + + + + Modulation Input: + + + + + + + Modulation Input + + + Transmit modulation source + + + QComboBox::AdjustToContents + + + + + + + Data Mod Input: + + + + + + + Data Modulation Input + + + Transmit Data-mode modulation input source + + + QComboBox::AdjustToContents + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Press here to set the clock of the radio. The command will be sent to the radio when the seconds go to zero. + + + Set Clock + + + + + + + Check this box to set the radio's clock to UTC. Otherwise, the clock will be set to the local timezone of this computer. + + + Use UTC + + + + + + + Satellite Ops + + + + + + + <html><head/><body><p>Click here to adjust the frequency reference on the IC-9700.</p></body></html> + + + Adjust Reference + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + 0 + + + + + Manual PTT Toggle + + + + + + + PTT On + + + Ctrl+S + + + + + + + PTT Off + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 279 + + + + + + + + + + QLayout::SetDefaultConstraint + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + Enable + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Server Setup + + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + Control Port + + + + + + + + 0 + 0 + + + + + 130 + 25 + + + + + 130 + 25 + + + + 99999 + + + 50001 + + + true + + + + + + + + 0 + 0 + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + Civ Port + + + + + + + + 130 + 25 + + + + + 130 + 25 + + + + 99999 + + + 50002 + + + + + + + + 0 + 20 + + + + + 16777215 + 20 + + + + Audio Port + + + + + + + + 130 + 25 + + + + + 130 + 25 + + + + 99999 + + + 50003 + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + RX Audio Input + + + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + + + + + TX Audio Output + + + + + + + + 100 + 0 + + + + + 100 + 16777215 + + + + + + + + Audio System + + + + + + + + Qt Audio + + + + + PortAudio + + + + + RT Audio + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 0 + 0 + + + + + 400 + 160 + + + + + 750 + 330 + + + + QFrame::StyledPanel + + + 1 + + + 0 + + + 4 + + + false + + + 100 + + + false + + + true + + + false + + + true + + + false + + + + Username + + + + + Password + + + + + Admin + + + + + Delete? + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Add User + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + + + + + + 0 + + + 0 + + + + + Qt::LeftToRight + + + Enable RigCtld + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Port + + + + + + + + 75 + 0 + + + + + 75 + 16777215 + + + + + + + + Qt::Horizontal + + + + 422 + 20 + + + + + + + + + + + + Virtual Serial Port + + + + + + + + 250 + 0 + + + + + 250 + 16777215 + + + + <html><head/><body><p>Use this to define a virtual serial port. </p><p><br/></p><p>On Windows, the virtual serial port can be used to connect to a serial port loopback device, through which other programs can connect to the radio. </p><p><br/></p><p>On Linux and macOS, the port defined here is a pseudo-terminal device, which may be connected to directly by any program designed for a serial connection. </p></body></html> + + + Virtual Serial Port Selector + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + TCP Server Port + + + + + + + true + + + + 0 + 0 + + + + + + + + Enter port for TCP server, 0 = disabled (restart required if changed) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Waterfall Format + + + + + + + + Default + + + + + Single (network) + + + + + Multi (serial) + + + + + + + + Only change this if you are absolutely sure you need it (connecting to N1MM+ or similar) + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Enable USB Controllers + + + + + + + + + + Setup USB Controller + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Reset Buttons + + + + + + + Reset Commands + + + + + + + Only reset buttons/commands if you have issues. + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + true + + + + + 0 + 10 + 831 + 21 + + + + + + + This page contains configuration for DX Cluster, either UDP style broadcast (from N1MM+/DXlog) or TCP connection to your favourite cluster + + + + + + + + + 10 + 50 + 201 + 181 + + + + UDP Broadcast Connection + + + + + 20 + 40 + 161 + 121 + + + + + + + UDP Port + + + + + + + 00000 + + + + + + + Enable + + + + + + + + + + 330 + 50 + 311 + 241 + + + + TCP Cluster Connection + + + + + 20 + 40 + 271 + 186 + + + + + + + Server Name + + + + + + + Username + + + + + + + + + + Password + + + + + + + QLineEdit::PasswordEchoOnEdit + + + + + + + Enable + + + + + + + true + + + true + + + + + + + Spot Timeout (minutes) + + + + + + + 0000 + + + + + + + + + + Server Port + + + + + + + 00000 + + + + + + + + + + 10 + 320 + 811 + 141 + + + + QFrame::Raised + + + QAbstractScrollArea::AdjustIgnored + + + + + + 10 + 280 + 75 + 23 + + + + <html><head/><body><p>Pop out (or pop back in) the entire Settings tab. </p><p>NOTE: Press this button again to re-insert the tab when finished. </p></body></html> + + + Pop-Out + + + + + + 10 + 470 + 801 + 24 + + + + + + + Show Skimmer Spots + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + groupBox_9 + horizontalLayoutWidget + groupBox_10 + clusterOutputTextEdit + clusterPopOutBtn + horizontalLayoutWidget_2 + + + + + + + + + This page contains experimental features. Use at your own risk. + + + + + + + + + + + <html><head/><body><p>This button runs debug functions, and is provided as a convenience for programmers. The functions executed are under:</p><p><span style=" color:#ffff55;">void</span><span style=" color:#55ff55;">wfmain</span><span style=" color:#aaaaaa;">::</span><span style=" font-weight:600;">on_debugBtn_clicked</span><span style=" color:#aaaaaa;">()</span></p><p>in wfmain.cpp.</p></body></html> + + + Debug + + + Ctrl+Alt+D + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + Qt::Vertical + + + + 20 + 320 + + + + + + + + + true + + + + + + + + + + + QLedLabel + QWidget +
qledlabel.h
+ 1 +
+
+ + + + + +
diff --git a/udpbase.h b/udpbase.h index 24ce4be..de13019 100644 --- a/udpbase.h +++ b/udpbase.h @@ -24,6 +24,18 @@ #include "packettypes.h" +enum udpPrefsItem { + u_ipAddress = 1 << 0, + u_controlLANPort = 1 << 1, + u_serialLANPort = 1 << 2, + u_audioLANPort = 1 << 3, + u_username = 1 << 4, + u_password = 1 << 5, + u_clientName = 1 << 6, + u_waterfallFormat = 1 << 7, + u_halfDuplex = 1 << 8, + u_all = 1 << 9 +}; struct udpPreferences { diff --git a/wfmain.cpp b/wfmain.cpp index 32ab8d8..df57c24 100644 --- a/wfmain.cpp +++ b/wfmain.cpp @@ -5,7 +5,7 @@ #include "rigidentities.h" #include "logcategories.h" -// This code is copyright 2017-2022 Elliott H. Liggett +// This code is copyright 2017-2023 Elliott H. Liggett // All rights reserved // Log support: @@ -54,6 +54,7 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode selRad = new selectRadio(); bandbtns = new bandbuttons(); finputbtns = new frequencyinputwidget(); + setupui = new settingswidget(); qRegisterMetaType(); // Needs to be registered early. qRegisterMetaType(); @@ -304,6 +305,7 @@ void wfmain::openRig() } +// Migrated void wfmain::createSettingsListItems() { // Add items to the settings tab list widget @@ -318,18 +320,12 @@ void wfmain::createSettingsListItems() ui->settingsStack->setCurrentIndex(0); } +// Migrated void wfmain::on_settingsList_currentRowChanged(int currentRow) { ui->settingsStack->setCurrentIndex(currentRow); } - -void wfmain::connectSettingsList() -{ - -} - - void wfmain::rigConnections() { connect(this, SIGNAL(setCIVAddr(unsigned char)), rig, SLOT(setCIVAddr(unsigned char))); @@ -1120,6 +1116,7 @@ void wfmain::setupMainUI() ui->controlPortTxt->setValidator(new QIntValidator(this)); + // Keep this code when the rest is removed from this function: qDebug(logSystem()) << "Running with debugging options enabled."; #ifdef QT_DEBUG ui->debugBtn->setVisible(true); @@ -1239,6 +1236,7 @@ void wfmain::prepareSettingsWindow() // TODO: Capture an event when the window closes and handle accordingly. } +// NOT Migrated, EHL TODO, carefully remove this function void wfmain::updateSizes(int tabIndex) { @@ -2573,6 +2571,15 @@ void wfmain::loadSettings() settings->endGroup(); #endif + + setupui->acceptPreferencesPtr(&prefs); + setupui->updateIfPrefs((int)if_all); + setupui->updateRaPrefs((int)ra_all); + setupui->updateCtPrefs((int)ct_all); + setupui->updateClusterPrefs((int)cl_all); + + setupui->acceptUdpPreferencesPtr(&udpPrefs); + setupui->updateUdpPrefs((int)u_all); } void wfmain::serverAddUserLine(const QString& user, const QString& pass, const int& type) @@ -6198,6 +6205,7 @@ void wfmain::on_serialEnableBtn_clicked(bool checked) } +// Migrated void wfmain::on_lanEnableBtn_clicked(bool checked) { prefs.enableLAN = checked; @@ -7600,7 +7608,12 @@ void wfmain::on_underlayAverageBuffer_toggled(bool checked) void wfmain::on_debugBtn_clicked() { qInfo(logSystem()) << "Debug button pressed."; - mem.dumpMemory(); + //showAndRaiseWidget(setupui); + setupui->updateIfPrefs((int)if_all); + setupui->updateRaPrefs((int)ra_all); + setupui->updateCtPrefs((int)ct_all); + setupui->updateClusterPrefs((int)cl_all); + setupui->updateUdpPrefs((int)u_all); } // ---------- color helper functions: ---------- // @@ -8985,3 +8998,8 @@ void wfmain::on_showFreqBtn_clicked() { showAndRaiseWidget(finputbtns); } + +void wfmain::on_showSettingsBtn_clicked() +{ + showAndRaiseWidget(setupui); +} diff --git a/wfmain.h b/wfmain.h index bb75d57..a311f80 100644 --- a/wfmain.h +++ b/wfmain.h @@ -38,6 +38,7 @@ #include "cwsender.h" #include "bandbuttons.h" #include "frequencyinputwidget.h" +#include "settingswidget.h" #include "udpserver.h" #include "qledlabel.h" #include "rigctld.h" @@ -560,6 +561,8 @@ private slots: void on_showFreqBtn_clicked(); + void on_showSettingsBtn_clicked(); + private: Ui::wfmain *ui; void closeEvent(QCloseEvent *event); @@ -571,7 +574,6 @@ private: void saveSettings(); void createSettingsListItems(); - void connectSettingsList(); void initLogging(); QTimer logCheckingTimer; @@ -904,6 +906,7 @@ private: loggingWindow *logWindow; bandbuttons *bandbtns; frequencyinputwidget *finputbtns; + settingswidget *setupui; udpServer* udp = Q_NULLPTR; rigCtlD* rigCtl = Q_NULLPTR; diff --git a/wfmain.ui b/wfmain.ui index cc57861..a2dc0fa 100644 --- a/wfmain.ui +++ b/wfmain.ui @@ -4454,6 +4454,13 @@ + + + + Settings + + + @@ -4574,7 +4581,7 @@ - + diff --git a/wfview.pro b/wfview.pro index 06705e6..d5276a5 100644 --- a/wfview.pro +++ b/wfview.pro @@ -221,6 +221,7 @@ SOURCES += main.cpp\ cwsender.cpp \ frequencyinputwidget.cpp \ loggingwindow.cpp \ + settingswidget.cpp \ wfmain.cpp \ commhandler.cpp \ rigcommander.cpp \ @@ -266,6 +267,7 @@ HEADERS += wfmain.h \ rigcommander.h \ freqmemory.h \ rigidentities.h \ + settingswidget.h \ sidebandchooser.h \ udpbase.h \ udphandler.h \ @@ -312,6 +314,7 @@ FORMS += wfmain.ui \ satellitesetup.ui \ selectradio.ui \ repeatersetup.ui \ + settingswidget.ui \ transceiveradjustments.ui \ controllersetup.ui \ aboutbox.ui