kopia lustrzana https://gitlab.com/eliggett/wfview
Move more settings and add some more UI features
rodzic
368c9a3281
commit
62171b227a
4
prefs.h
4
prefs.h
|
@ -7,7 +7,6 @@
|
|||
#include "audioconverter.h"
|
||||
#include "rigidentities.h"
|
||||
#include "wfviewtypes.h"
|
||||
#include "udpserver.h"
|
||||
|
||||
enum prefIfItem {
|
||||
if_useFullScreen = 1 << 0,
|
||||
|
@ -120,7 +119,7 @@ enum prefClusterItem {
|
|||
cl_all = 1 << 9
|
||||
};
|
||||
|
||||
enum udpPrefsItem {
|
||||
enum prefUDPItem {
|
||||
u_enabled = 1 << 0,
|
||||
u_ipAddress = 1 << 1,
|
||||
u_controlLANPort = 1 << 2,
|
||||
|
@ -207,7 +206,6 @@ struct preferences {
|
|||
QString clusterTcpUserName;
|
||||
QString clusterTcpPassword;
|
||||
|
||||
SERVERCONFIG server; // Contains server settings
|
||||
// Temporary settings
|
||||
inputTypes inputDataOff=inputNone;
|
||||
inputTypes inputData1=inputNone;
|
||||
|
|
|
@ -314,8 +314,8 @@ void settingswidget::updateCtPrefs(quint64 items)
|
|||
}
|
||||
|
||||
void settingswidget::updateServerConfigs(quint64 items)
|
||||
{
|
||||
serverItems si;
|
||||
{
|
||||
prefServerItem si;
|
||||
if(items & (int)s_all)
|
||||
{
|
||||
items = 0xffffffff;
|
||||
|
@ -325,7 +325,7 @@ void settingswidget::updateServerConfigs(quint64 items)
|
|||
if(items & i)
|
||||
{
|
||||
qDebug(logGui()) << "Updating ServerConfig" << (int)i;
|
||||
si = (serverItems)i;
|
||||
si = (prefServerItem)i;
|
||||
updateServerConfig(si);
|
||||
}
|
||||
}
|
||||
|
@ -832,6 +832,7 @@ void settingswidget::updateClusterPref(prefClusterItem pcl)
|
|||
ui->clusterUdpPortLineEdit->blockSignals(false);
|
||||
break;
|
||||
case cl_clusterTcpServerName:
|
||||
ui->clusterTcpAddBtn->setEnabled(false);
|
||||
// Take this from the clusters list
|
||||
break;
|
||||
case cl_clusterTcpUserName:
|
||||
|
@ -855,7 +856,7 @@ void settingswidget::updateClusterPref(prefClusterItem pcl)
|
|||
updatingUIFromPrefs = false;
|
||||
}
|
||||
|
||||
void settingswidget::updateServerConfig(serverItems si)
|
||||
void settingswidget::updateServerConfig(prefServerItem si)
|
||||
{
|
||||
if(serverConfig == NULL)
|
||||
{
|
||||
|
@ -872,7 +873,7 @@ void settingswidget::updateServerConfig(serverItems si)
|
|||
// Not used here
|
||||
break;
|
||||
case s_controlPort:
|
||||
quietlyUpdateLineEdit(ui->serverControlPortText, QString::number(serverConfig->civPort));
|
||||
quietlyUpdateLineEdit(ui->serverControlPortText, QString::number(serverConfig->controlPort));
|
||||
break;
|
||||
case s_civPort:
|
||||
quietlyUpdateLineEdit(ui->serverCivPortText, QString::number(serverConfig->civPort));
|
||||
|
@ -906,7 +907,7 @@ void settingswidget::updateServerConfig(serverItems si)
|
|||
|
||||
void settingswidget::updateUdpPrefs(int items)
|
||||
{
|
||||
udpPrefsItem upi;
|
||||
prefUDPItem upi;
|
||||
if(items & (int)u_all)
|
||||
{
|
||||
items = 0xffffffff;
|
||||
|
@ -916,13 +917,13 @@ void settingswidget::updateUdpPrefs(int items)
|
|||
if(items & i)
|
||||
{
|
||||
qDebug(logGui()) << "Updating UDP preference " << i;
|
||||
upi = (udpPrefsItem)i;
|
||||
upi = (prefUDPItem)i;
|
||||
updateUdpPref(upi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::updateUdpPref(udpPrefsItem upi)
|
||||
void settingswidget::updateUdpPref(prefUDPItem upi)
|
||||
{
|
||||
updatingUIFromPrefs = true;
|
||||
switch(upi)
|
||||
|
@ -1124,14 +1125,6 @@ void settingswidget::populateServerUsers()
|
|||
row++;
|
||||
user++;
|
||||
}
|
||||
if (row==1 && blank)
|
||||
{
|
||||
// There are no defined users. The only user present is the blank one.
|
||||
// The button is disabled, but it may be enabled
|
||||
// when the user enters valid information for a potential new
|
||||
// user account.
|
||||
ui->serverAddUserBtn->setEnabled(false);
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::serverAddUserLine(const QString &user, const QString &pass, const int &type)
|
||||
|
@ -1281,95 +1274,23 @@ void settingswidget::on_settingsList_currentRowChanged(int currentRow)
|
|||
ui->settingsStack->setCurrentIndex(currentRow);
|
||||
}
|
||||
|
||||
void settingswidget::onServerUserFieldChanged()
|
||||
{
|
||||
if(!haveServerConfig) {
|
||||
qCritical(logGui()) << "Do not have serverConfig, cannot edit users.";
|
||||
return;
|
||||
}
|
||||
int row = sender()->property("row").toInt();
|
||||
int col = sender()->property("col").toInt();
|
||||
qDebug() << "Server User field col" << col << "row" << row << "changed";
|
||||
|
||||
// This is a new user line so add to serverUsersTable
|
||||
if (serverConfig->users.length() <= row)
|
||||
{
|
||||
qInfo() << "Something bad has happened, serverConfig.users is shorter than table!";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (col == 0)
|
||||
{
|
||||
QLineEdit* username = (QLineEdit*)ui->serverUsersTable->cellWidget(row, 0);
|
||||
if (username->text() != serverConfig->users[row].username) {
|
||||
serverConfig->users[row].username = username->text();
|
||||
}
|
||||
}
|
||||
else if (col == 1)
|
||||
{
|
||||
QLineEdit* password = (QLineEdit*)ui->serverUsersTable->cellWidget(row, 1);
|
||||
QByteArray pass;
|
||||
passcode(password->text(), pass);
|
||||
if (QString(pass) != serverConfig->users[row].password) {
|
||||
serverConfig->users[row].password = pass;
|
||||
}
|
||||
}
|
||||
else if (col == 2)
|
||||
{
|
||||
QComboBox* comboBox = (QComboBox*)ui->serverUsersTable->cellWidget(row, 2);
|
||||
serverConfig->users[row].userType = comboBox->currentIndex();
|
||||
}
|
||||
else if (col == 3)
|
||||
{
|
||||
serverConfig->users.removeAt(row);
|
||||
ui->serverUsersTable->setRowCount(0);
|
||||
foreach(SERVERUSER user, serverConfig->users)
|
||||
{
|
||||
serverAddUserLine(user.username, user.password, user.userType);
|
||||
}
|
||||
}
|
||||
if (row == ui->serverUsersTable->rowCount() - 1) {
|
||||
ui->serverAddUserBtn->setEnabled(true);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::on_lanEnableBtn_clicked(bool checked)
|
||||
{
|
||||
// TODO: prefs.enableLAN = checked;
|
||||
// TOTO? ui->connectBtn->setEnabled(true); // move to other side
|
||||
ui->groupNetwork->setEnabled(checked);
|
||||
ui->groupSerial->setEnabled(!checked);
|
||||
/*
|
||||
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);
|
||||
ui->useRTSforPTTchk->setEnabled(!checked);
|
||||
*/
|
||||
|
||||
prefs->enableLAN = checked;
|
||||
emit changedLanPref(l_enableLAN);
|
||||
}
|
||||
|
||||
void settingswidget::on_serialEnableBtn_clicked(bool checked)
|
||||
{
|
||||
prefs->enableLAN = !checked;
|
||||
ui->groupSerial->setEnabled(checked);
|
||||
ui->groupNetwork->setEnabled(!checked);
|
||||
|
||||
prefs->enableLAN = !checked;
|
||||
emit changedLanPref(l_enableLAN);
|
||||
}
|
||||
|
||||
|
@ -1736,11 +1657,12 @@ void settingswidget::on_clusterTcpEnable_clicked(bool checked)
|
|||
emit changedClusterPref(cl_clusterTcpEnable);
|
||||
}
|
||||
|
||||
void settingswidget::on_clusterTcpSetNowBtn_clicked()
|
||||
void settingswidget::on_clusterTcpAddBtn_clicked()
|
||||
{
|
||||
// Maybe this will be easier than "hit enter" ?
|
||||
int index = ui->clusterServerNameCombo->currentIndex();
|
||||
on_clusterServerNameCombo_currentIndexChanged(index);
|
||||
ui->clusterTcpAddBtn->setEnabled(false);
|
||||
}
|
||||
|
||||
void settingswidget::on_clusterServerNameCombo_currentTextChanged(const QString &text)
|
||||
|
@ -1757,6 +1679,7 @@ void settingswidget::on_clusterServerNameCombo_currentTextChanged(const QString
|
|||
ui->clusterTimeoutLineEdit->setEnabled(false);
|
||||
}
|
||||
}
|
||||
ui->clusterTcpAddBtn->setEnabled(true);
|
||||
}
|
||||
|
||||
void settingswidget::on_clusterTcpPortLineEdit_editingFinished()
|
||||
|
@ -1768,7 +1691,7 @@ void settingswidget::on_clusterTcpPortLineEdit_editingFinished()
|
|||
//emit setClusterTcpPort(clusters[index].port);
|
||||
prefs->clusterTcpPort = clusters[index].port;
|
||||
emit changedClusterPref(cl_clusterTcpPort);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void settingswidget::on_clusterUsernameLineEdit_editingFinished()
|
||||
|
@ -2594,43 +2517,91 @@ void settingswidget::on_serverTXAudioOutputCombo_currentIndexChanged(int index)
|
|||
void settingswidget::on_serverEnableCheckbox_clicked(bool checked)
|
||||
{
|
||||
serverConfig->enabled = checked;
|
||||
emit changedServerConfig(s_enabled);
|
||||
emit changedServerPref(s_enabled);
|
||||
}
|
||||
|
||||
void settingswidget::on_serverAddUserBtn_clicked()
|
||||
void settingswidget::on_serverControlPortText_textChanged(QString text)
|
||||
{
|
||||
if(!haveServerConfig)
|
||||
{
|
||||
qCritical(logGui()) << "Cannot modify users without valid serverConfig.";
|
||||
return;
|
||||
}
|
||||
serverAddUserLine("", "", 0);
|
||||
SERVERUSER user;
|
||||
user.username = "";
|
||||
user.password = "";
|
||||
user.userType = 0;
|
||||
serverConfig->users.append(user);
|
||||
|
||||
ui->serverAddUserBtn->setEnabled(false);
|
||||
}
|
||||
|
||||
void settingswidget::on_serverControlPortText_textChanged(QString text)
|
||||
{
|
||||
serverConfig->controlPort = text.toInt();
|
||||
emit changedServerConfig(s_controlPort);
|
||||
emit changedServerPref(s_controlPort);
|
||||
}
|
||||
|
||||
void settingswidget::on_serverCivPortText_textChanged(QString text)
|
||||
{
|
||||
if(!haveServerConfig)
|
||||
{
|
||||
qCritical(logGui()) << "Cannot modify users without valid serverConfig.";
|
||||
return;
|
||||
}
|
||||
serverConfig->civPort = text.toInt();
|
||||
emit changedServerConfig(s_civPort);
|
||||
emit changedServerPref(s_civPort);
|
||||
}
|
||||
|
||||
void settingswidget::on_serverAudioPortText_textChanged(QString text)
|
||||
{
|
||||
if(!haveServerConfig)
|
||||
{
|
||||
qCritical(logGui()) << "Cannot modify users without valid serverConfig.";
|
||||
return;
|
||||
}
|
||||
serverConfig->audioPort = text.toInt();
|
||||
emit changedServerConfig(s_audioPort);
|
||||
emit changedServerPref(s_audioPort);
|
||||
}
|
||||
|
||||
|
||||
void settingswidget::onServerUserFieldChanged()
|
||||
{
|
||||
if(!haveServerConfig) {
|
||||
qCritical(logGui()) << "Do not have serverConfig, cannot edit users.";
|
||||
return;
|
||||
}
|
||||
int row = sender()->property("row").toInt();
|
||||
int col = sender()->property("col").toInt();
|
||||
qDebug() << "Server User field col" << col << "row" << row << "changed";
|
||||
|
||||
// This is a new user line so add to serverUsersTable
|
||||
if (serverConfig->users.length() <= row)
|
||||
{
|
||||
qInfo() << "Something bad has happened, serverConfig.users is shorter than table!";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (col == 0)
|
||||
{
|
||||
QLineEdit* username = (QLineEdit*)ui->serverUsersTable->cellWidget(row, 0);
|
||||
if (username->text() != serverConfig->users[row].username) {
|
||||
serverConfig->users[row].username = username->text();
|
||||
}
|
||||
}
|
||||
else if (col == 1)
|
||||
{
|
||||
QLineEdit* password = (QLineEdit*)ui->serverUsersTable->cellWidget(row, 1);
|
||||
QByteArray pass;
|
||||
passcode(password->text(), pass);
|
||||
if (QString(pass) != serverConfig->users[row].password) {
|
||||
serverConfig->users[row].password = pass;
|
||||
}
|
||||
}
|
||||
else if (col == 2)
|
||||
{
|
||||
QComboBox* comboBox = (QComboBox*)ui->serverUsersTable->cellWidget(row, 2);
|
||||
serverConfig->users[row].userType = comboBox->currentIndex();
|
||||
}
|
||||
else if (col == 3)
|
||||
{
|
||||
serverConfig->users.removeAt(row);
|
||||
ui->serverUsersTable->setRowCount(0);
|
||||
foreach(SERVERUSER user, serverConfig->users)
|
||||
{
|
||||
serverAddUserLine(user.username, user.password, user.userType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* End of UDP Server settings */
|
||||
|
||||
|
|
|
@ -61,9 +61,9 @@ public slots:
|
|||
void updateCtPref(prefCtItem pct);
|
||||
void updateLanPref(prefLanItem plan);
|
||||
void updateClusterPref(prefClusterItem pcl);
|
||||
void updateServerConfig(serverItems si);
|
||||
void updateServerConfig(prefServerItem si);
|
||||
|
||||
void updateUdpPref(udpPrefsItem upi);
|
||||
void updateUdpPref(prefUDPItem upi);
|
||||
void updateUdpPrefs(int items);
|
||||
|
||||
|
||||
|
@ -79,7 +79,7 @@ signals:
|
|||
void changedLanPrefs(quint64 items);
|
||||
void changedClusterPrefs(quint64 items);
|
||||
void changedUdpPrefs(quint64 items);
|
||||
void changedServerConfigs(quint64 items);
|
||||
void changedServerPrefs(quint64 items);
|
||||
|
||||
void changedAudioOutputCombo(int index);
|
||||
void changedAudioInputCombo(int index);
|
||||
|
@ -93,8 +93,8 @@ signals:
|
|||
void changedCtPref(prefCtItem i);
|
||||
void changedLanPref(prefLanItem i);
|
||||
void changedClusterPref(prefClusterItem i);
|
||||
void changedUdpPref(udpPrefsItem i);
|
||||
void changedServerConfig(serverItems i);
|
||||
void changedUdpPref(prefUDPItem i);
|
||||
void changedServerPref(prefServerItem i);
|
||||
|
||||
void changedModInput(uchar num, inputTypes input);
|
||||
|
||||
|
@ -137,7 +137,7 @@ private slots:
|
|||
void on_clusterServerNameCombo_currentIndexChanged(int index);
|
||||
void on_clusterUdpEnable_clicked(bool checked);
|
||||
void on_clusterTcpEnable_clicked(bool checked);
|
||||
void on_clusterTcpSetNowBtn_clicked();
|
||||
void on_clusterTcpAddBtn_clicked();
|
||||
void on_clusterServerNameCombo_currentTextChanged(const QString &arg1);
|
||||
void on_clusterTcpPortLineEdit_editingFinished();
|
||||
void on_clusterUsernameLineEdit_editingFinished();
|
||||
|
@ -160,8 +160,6 @@ private slots:
|
|||
void on_audioTXCodecCombo_currentIndexChanged(int value);
|
||||
void on_audioSampleRateCombo_currentIndexChanged(int value);
|
||||
|
||||
void on_serverAddUserBtn_clicked();
|
||||
|
||||
void on_modInputCombo_activated(int index);
|
||||
void on_modInputData1Combo_activated(int index);
|
||||
void on_modInputData2Combo_activated(int index);
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
<item>
|
||||
<widget class="QStackedWidget" name="settingsStack">
|
||||
<property name="currentIndex">
|
||||
<number>3</number>
|
||||
<number>5</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="radioAccess">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_21">
|
||||
|
@ -1235,8 +1235,8 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>925</width>
|
||||
<height>332</height>
|
||||
<width>453</width>
|
||||
<height>235</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
|
@ -2464,112 +2464,6 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_32">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="serverControlPortText_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>25</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="inputMask">
|
||||
<string>99999</string>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>50001</string>
|
||||
</property>
|
||||
<property name="frame">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="tableWidget" name="serverUsersTable_2">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>400</width>
|
||||
<height>160</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>750</width>
|
||||
<height>330</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="lineWidth">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<property name="midLineWidth">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="columnCount">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<attribute name="horizontalHeaderCascadingSectionResizes">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderDefaultSectionSize">
|
||||
<number>100</number>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="horizontalHeaderStretchLastSection">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderShowSortIndicator" stdset="0">
|
||||
<bool>true</bool>
|
||||
</attribute>
|
||||
<attribute name="verticalHeaderStretchLastSection">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Admin</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string>Delete?</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="tableWidget" name="serverUsersTable">
|
||||
<property name="sizePolicy">
|
||||
|
@ -2661,28 +2555,7 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6">
|
||||
<item>
|
||||
<widget class="QPushButton" name="serverAddUserBtn">
|
||||
<property name="text">
|
||||
<string>Add User</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer_33">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6"/>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer_7">
|
||||
|
@ -3022,8 +2895,8 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<rect>
|
||||
<x>10</x>
|
||||
<y>50</y>
|
||||
<width>201</width>
|
||||
<height>181</height>
|
||||
<width>221</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="title">
|
||||
|
@ -3034,8 +2907,8 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<rect>
|
||||
<x>20</x>
|
||||
<y>40</y>
|
||||
<width>161</width>
|
||||
<height>121</height>
|
||||
<width>181</width>
|
||||
<height>171</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout">
|
||||
|
@ -3066,9 +2939,9 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<widget class="QGroupBox" name="groupBox_10">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>330</x>
|
||||
<x>250</x>
|
||||
<y>50</y>
|
||||
<width>311</width>
|
||||
<width>391</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
|
@ -3078,44 +2951,13 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
<widget class="QWidget" name="formLayoutWidget_2">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>20</x>
|
||||
<y>40</y>
|
||||
<width>271</width>
|
||||
<height>186</height>
|
||||
<x>10</x>
|
||||
<y>30</y>
|
||||
<width>351</width>
|
||||
<height>192</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QFormLayout" name="formLayout_2">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_45">
|
||||
<property name="text">
|
||||
<string>Server Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_46">
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="clusterUsernameLineEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_47">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="clusterPasswordLineEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::PasswordEchoOnEdit</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="clusterTcpEnable">
|
||||
<property name="text">
|
||||
|
@ -3123,24 +2965,52 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="clusterServerNameCombo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="duplicatesEnabled">
|
||||
<bool>true</bool>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_49">
|
||||
<property name="text">
|
||||
<string>Server Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QLineEdit" name="clusterTcpPortLineEdit">
|
||||
<property name="inputMask">
|
||||
<string>00000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="label_46">
|
||||
<property name="text">
|
||||
<string>Username</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="QLineEdit" name="clusterUsernameLineEdit"/>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QLabel" name="label_47">
|
||||
<property name="text">
|
||||
<string>Password</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<widget class="QLineEdit" name="clusterPasswordLineEdit">
|
||||
<property name="echoMode">
|
||||
<enum>QLineEdit::PasswordEchoOnEdit</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="6" column="0">
|
||||
<widget class="QLabel" name="label_48">
|
||||
<property name="text">
|
||||
<string>Spot Timeout (minutes)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="1">
|
||||
<item row="6" column="1">
|
||||
<widget class="QLineEdit" name="clusterTimeoutLineEdit">
|
||||
<property name="inputMask">
|
||||
<string>0000</string>
|
||||
|
@ -3150,24 +3020,37 @@ ONLY use Manual CI-V when Transceive mode is not supported</string>
|
|||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_49">
|
||||
<property name="text">
|
||||
<string>Server Port</string>
|
||||
</property>
|
||||
</widget>
|
||||
<item row="1" column="1">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QComboBox" name="clusterServerNameCombo">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="duplicatesEnabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="clusterTcpAddBtn">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>50</width>
|
||||
<height>50</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Add</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="QLineEdit" name="clusterTcpPortLineEdit">
|
||||
<property name="inputMask">
|
||||
<string>00000</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="clusterTcpSetNowBtn">
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_45">
|
||||
<property name="text">
|
||||
<string>SetNow</string>
|
||||
<string>Server Name</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
|
@ -36,7 +36,15 @@ spectrumScope::spectrumScope(QWidget *parent)
|
|||
edgeButton->setToolTip("Define a custom (fixed) scope edge");
|
||||
toFixedButton = new QPushButton("To Fixed");
|
||||
toFixedButton->setToolTip("<html><head/><body><p>Press button to convert center mode spectrum to fixed mode, preserving the range. This allows you to tune without the spectrum moving, in the same currently-visible range that you see now. </p><p><br/></p><p>The currently-selected edge slot will be overridden.</p></body></html>");
|
||||
//themeLabel = new QLabel("Theme:");
|
||||
|
||||
holdButton = new QPushButton("HOLD");
|
||||
holdButton->setCheckable(true);
|
||||
holdButton->setFocusPolicy(Qt::NoFocus);
|
||||
speedCombo = new QComboBox();
|
||||
speedCombo->addItem("Speed Fast",QVariant::fromValue(uchar(0)));
|
||||
speedCombo->addItem("Speed Mid",QVariant::fromValue(uchar(1)));
|
||||
speedCombo->addItem("Speed Slow",QVariant::fromValue(uchar(2)));
|
||||
|
||||
controlSpacer = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed);
|
||||
midSpacer = new QSpacerItem(0,0,QSizePolicy::Expanding,QSizePolicy::Fixed);
|
||||
clearPeaksButton = new QPushButton("Clear Peaks");
|
||||
|
@ -66,15 +74,13 @@ spectrumScope::spectrumScope(QWidget *parent)
|
|||
|
||||
layout->addLayout(controlLayout);
|
||||
controlLayout->addWidget(enableCheckBox);
|
||||
//controlLayout->addWidget(scopeModeLabel);
|
||||
controlLayout->addWidget(scopeModeCombo);
|
||||
//controlLayout->addWidget(spanLabel);
|
||||
controlLayout->addWidget(spanCombo);
|
||||
//controlLayout->addWidget(edgeLabel);
|
||||
controlLayout->addWidget(edgeCombo);
|
||||
controlLayout->addWidget(edgeButton);
|
||||
controlLayout->addWidget(toFixedButton);
|
||||
//controlLayout->addWidget(themeLabel);
|
||||
controlLayout->addWidget(holdButton);
|
||||
controlLayout->addWidget(speedCombo);
|
||||
controlLayout->addSpacerItem(controlSpacer);
|
||||
controlLayout->addWidget(modeCombo);
|
||||
controlLayout->addWidget(dataCombo);
|
||||
|
@ -185,6 +191,9 @@ spectrumScope::spectrumScope(QWidget *parent)
|
|||
connect(edgeCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(updatedEdge(int)));
|
||||
connect(edgeButton,SIGNAL(pressed()), this, SLOT(customSpanPressed()));
|
||||
|
||||
connect(speedCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(updatedSpeed(int)));
|
||||
connect(holdButton,SIGNAL(toggled(bool)), this, SLOT(holdPressed(bool)));
|
||||
|
||||
connect(modeCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(updatedMode(int)));
|
||||
connect(filterCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(updatedMode(int)));
|
||||
connect(dataCombo,SIGNAL(currentIndexChanged(int)),this,SLOT(updatedMode(int)));
|
||||
|
@ -1250,3 +1259,21 @@ void spectrumScope::receivePassband(quint16 pass)
|
|||
emit showStatusBarText(QString("%0 IF filter width %1 Hz (%2 MHz)").arg(sub?"Sub":"Main").arg(pass).arg(passbandWidth));
|
||||
}
|
||||
}
|
||||
|
||||
void spectrumScope::selected(bool en)
|
||||
{
|
||||
if (en)
|
||||
this->setStyleSheet("QGroupBox { border:2px solid red;}");
|
||||
else
|
||||
this->setStyleSheet("QGroupBox { border:2px solid gray;}");
|
||||
}
|
||||
|
||||
void spectrumScope::updatedSpeed(int index)
|
||||
{
|
||||
queue->add(priorityImmediate,queueItem(sub?funcScopeSubSpeed:funcScopeMainSpeed,this->speedCombo->itemData(index),false,sub));
|
||||
}
|
||||
|
||||
void spectrumScope::holdPressed(bool en)
|
||||
{
|
||||
queue->add(priorityImmediate,queueItem(sub?funcScopeSubHold:funcScopeMainHold,QVariant::fromValue(en),false,sub));
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public:
|
|||
void addData(QString text, QVariant data) {dataCombo->blockSignals(true); dataCombo->addItem(text,data); dataCombo->blockSignals(false);}
|
||||
void addFilter(QString text, QVariant data) {filterCombo->blockSignals(true); filterCombo->addItem(text,data); filterCombo->blockSignals(false);}
|
||||
|
||||
|
||||
void selected(bool);
|
||||
|
||||
public slots: // Can be called directly or updated via signal/slot
|
||||
void selectScopeMode(spectrumMode_t m);
|
||||
|
@ -100,6 +100,8 @@ private slots:
|
|||
void updatedTheme(int index);
|
||||
void updatedEdge(int index);
|
||||
void updatedMode(int index);
|
||||
void updatedSpeed(int index);
|
||||
void holdPressed(bool en);
|
||||
void toFixedPressed();
|
||||
void customSpanPressed();
|
||||
|
||||
|
@ -143,6 +145,9 @@ private:
|
|||
QComboBox* dataCombo;
|
||||
QComboBox* filterCombo;
|
||||
QComboBox* antennaCombo;
|
||||
QPushButton* holdButton;
|
||||
QComboBox* speedCombo;
|
||||
|
||||
QCheckBox* rxCheckBox;
|
||||
QComboBox* themeCombo;
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ struct SERVERCONFIG {
|
|||
QList <RIGCONFIG*> rigs;
|
||||
};
|
||||
|
||||
enum serverItems {
|
||||
enum prefServerItem {
|
||||
s_enabled = 1 << 0,
|
||||
s_lan = 1 << 1,
|
||||
s_controlPort = 1 << 2,
|
||||
|
|
180
wfmain.cpp
180
wfmain.cpp
|
@ -1168,9 +1168,12 @@ void wfmain::connectSettingsWidget()
|
|||
connect(setupui, SIGNAL(changedRsPref(prefRsItem)), this, SLOT(extChangedRsPref(prefRsItem)));
|
||||
connect(setupui, SIGNAL(changedRsPrefs(quint64)), this, SLOT(extChangedRsPrefs(quint64)));
|
||||
|
||||
connect(setupui, SIGNAL(changedUdpPref(udpPrefsItem)), this, SLOT(extChangedUdpPref(udpPrefsItem)));
|
||||
connect(setupui, SIGNAL(changedUdpPref(prefUDPItem)), this, SLOT(extChangedUdpPref(prefUDPItem)));
|
||||
connect(setupui, SIGNAL(changedUdpPrefs(quint64)), this, SLOT(extChangedUdpPrefs(quint64)));
|
||||
|
||||
connect(setupui, SIGNAL(changedServerPref(prefServerItem)), this, SLOT(extChangedServerPref(prefServerItem)));
|
||||
connect(setupui, SIGNAL(changedServerPrefs(quint64)), this, SLOT(extChangedServerPrefs(quint64)));
|
||||
|
||||
connect(this, SIGNAL(haveClusterList(QList<clusterSettings>)), setupui, SLOT(copyClusterList(QList<clusterSettings>)));
|
||||
|
||||
connect(setupui, SIGNAL(changedAudioInputCombo(int)), this, SLOT(changedAudioInput(int)));
|
||||
|
@ -1288,7 +1291,7 @@ void wfmain::setServerToPrefs()
|
|||
{
|
||||
|
||||
// Start server if enabled in config
|
||||
ui->serverSetupGroup->setEnabled(serverConfig.enabled);
|
||||
//ui->serverSetupGroup->setEnabled(serverConfig.enabled);
|
||||
if (serverThread != Q_NULLPTR) {
|
||||
serverThread->quit();
|
||||
serverThread->wait();
|
||||
|
@ -2626,7 +2629,7 @@ void wfmain::extChangedClusterPrefs(quint64 items)
|
|||
|
||||
void wfmain::extChangedUdpPrefs(quint64 items)
|
||||
{
|
||||
udpPrefsItem upi;
|
||||
prefUDPItem upi;
|
||||
if(items & (int)u_all)
|
||||
{
|
||||
items = 0xffffffff;
|
||||
|
@ -2636,12 +2639,31 @@ void wfmain::extChangedUdpPrefs(quint64 items)
|
|||
if(items & i)
|
||||
{
|
||||
qDebug(logSystem()) << "Updating UDP preference in wfmain:" << i;
|
||||
upi = (udpPrefsItem)i;
|
||||
upi = (prefUDPItem)i;
|
||||
extChangedUdpPref(upi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void wfmain::extChangedServerPrefs(quint64 items)
|
||||
{
|
||||
prefServerItem svi;
|
||||
if(items & (int)u_all)
|
||||
{
|
||||
items = 0xffffffff;
|
||||
}
|
||||
for(int i=1; i < (int)u_all; i = i << 1)
|
||||
{
|
||||
if(items & i)
|
||||
{
|
||||
qDebug(logSystem()) << "Updating Server preference in wfmain:" << i;
|
||||
svi = (prefServerItem)i;
|
||||
extChangedServerPref(svi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::extChangedIfPref(prefIfItem i)
|
||||
{
|
||||
prefs.settingsChanged = true;
|
||||
|
@ -2989,7 +3011,7 @@ void wfmain::extChangedClusterPref(prefClusterItem i)
|
|||
}
|
||||
}
|
||||
|
||||
void wfmain::extChangedUdpPref(udpPrefsItem i)
|
||||
void wfmain::extChangedUdpPref(prefUDPItem i)
|
||||
{
|
||||
prefs.settingsChanged = true;
|
||||
switch(i)
|
||||
|
@ -3038,6 +3060,41 @@ void wfmain::extChangedUdpPref(udpPrefsItem i)
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
void wfmain::extChangedServerPref(prefServerItem i)
|
||||
{
|
||||
prefs.settingsChanged = true;
|
||||
switch(i)
|
||||
{
|
||||
case s_enabled:
|
||||
setServerToPrefs();
|
||||
break;
|
||||
case s_lan:
|
||||
break;
|
||||
case s_controlPort:
|
||||
break;
|
||||
case s_civPort:
|
||||
break;
|
||||
case s_audioPort:
|
||||
break;
|
||||
case s_audioOutput:
|
||||
break;
|
||||
case s_audioInput:
|
||||
break;
|
||||
case s_resampleQuality:
|
||||
break;
|
||||
case s_baudRate:
|
||||
break;
|
||||
case s_users:
|
||||
break;
|
||||
case s_rigs:
|
||||
break;
|
||||
default:
|
||||
qWarning(logGui()) << "Did not find matching pref element in wfmain for Server pref item " << (int)i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void wfmain::serverAddUserLine(const QString& user, const QString& pass, const int& type)
|
||||
{
|
||||
// migrated
|
||||
|
@ -4456,64 +4513,43 @@ void wfmain::initPeriodicCommands()
|
|||
// Can be run multiple times as it will remove all existing entries.
|
||||
|
||||
queue->clear();
|
||||
queue->add(priorityMedium,(rigCaps.commands.contains(funcSelectedFreq)?funcSelectedFreq:funcFreqGet),true,false);
|
||||
queue->add(priorityMedium,(rigCaps.commands.contains(funcSelectedMode)?funcSelectedMode:funcModeGet),true,false);
|
||||
queue->add(priorityMedium,(rigCaps.commands.contains(funcSelectedMode)?funcNone:funcDataModeWithFilter),true,false);
|
||||
queue->add(priorityMedium,(rigCaps.commands.contains(funcUnselectedFreq)?funcUnselectedFreq:funcNone),true,true);
|
||||
queue->add(priorityMedium,(rigCaps.commands.contains(funcUnselectedMode)?funcUnselectedMode:funcNone),true,true);
|
||||
|
||||
if(rigCaps.hasTransmit) {
|
||||
queue->add(priorityHigh,funcTransceiverStatus,true,false);
|
||||
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATAOffMod)?funcDATAOffMod:funcNone),true,false);
|
||||
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATA1Mod)?funcDATA1Mod:funcNone),true,false);
|
||||
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATA2Mod)?funcDATA2Mod:funcNone),true,false);
|
||||
queue->add(priorityMediumHigh,(rigCaps.commands.contains(funcDATA3Mod)?funcDATA3Mod:funcNone),true,false);
|
||||
}
|
||||
if (rigCaps.commands.contains(funcRFPower))
|
||||
queue->add(priorityMedium,funcRFPower,true,false);
|
||||
|
||||
if (rigCaps.commands.contains(funcRfGain))
|
||||
queue->add(priorityMedium,funcRfGain,true,false);
|
||||
|
||||
if (rigCaps.commands.contains(funcMonitorGain))
|
||||
queue->add(priorityMediumLow,funcMonitorGain,true,false);
|
||||
|
||||
if (rigCaps.commands.contains(funcMonitor))
|
||||
queue->add(priorityMediumLow,funcMonitor,true,false);
|
||||
|
||||
if(rigCaps.commands.contains(funcAttenuator))
|
||||
queue->add(priorityMediumLow,funcAttenuator,true,false);
|
||||
|
||||
if(rigCaps.commands.contains(funcPreamp))
|
||||
queue->add(priorityMediumLow,funcPreamp,true,false);
|
||||
|
||||
if (rigCaps.commands.contains(funcAntenna))
|
||||
queue->add(priorityMediumLow,funcAntenna,true,false);
|
||||
|
||||
if (rigCaps.commands.contains(funcSplitStatus))
|
||||
queue->add(priorityMediumLow,funcSplitStatus,true,false);
|
||||
|
||||
if(rigCaps.commands.contains(funcToneSquelchType))
|
||||
queue->add(priorityMediumLow,funcToneSquelchType,true,false);
|
||||
|
||||
if (rigCaps.commands.contains(funcSMeter))
|
||||
queue->add(priorityHighest,queueItem(funcSMeter,true,false));
|
||||
|
||||
if (rigCaps.commands.contains(funcOverflowStatus))
|
||||
queue->add(priorityHigh,queueItem(funcOverflowStatus,true,false));
|
||||
|
||||
queue->add(priorityMedium,funcSelectedFreq,true,false);
|
||||
queue->add(priorityMedium,funcSelectedMode,true,false);
|
||||
//queue->add(priorityMedium,(rigCaps.commands.contains(funcSelectedMode)?funcNone:funcDataModeWithFilter),true,false);
|
||||
queue->add(priorityMedium,funcUnselectedFreq,true,true);
|
||||
queue->add(priorityMedium,funcUnselectedMode,true,true);
|
||||
|
||||
if (rigCaps.hasSpectrum)
|
||||
{
|
||||
queue->add(priorityMediumHigh,queueItem(rigCaps.commands.contains(funcScopeMainMode)?funcScopeMainMode:funcNone,true,false));
|
||||
queue->add(priorityMediumHigh,queueItem(rigCaps.commands.contains(funcScopeSubMode)?funcScopeSubMode:funcNone,true,false));
|
||||
|
||||
queue->add(priorityMediumHigh,queueItem(rigCaps.commands.contains(funcScopeMainSpan)?funcScopeMainSpan:funcNone,true,false));
|
||||
queue->add(priorityMediumHigh,queueItem(rigCaps.commands.contains(funcScopeSubSpan)?funcScopeSubSpan:funcNone,true,false));
|
||||
|
||||
queue->add(priorityHigh,funcOverflowStatus,true,false);
|
||||
queue->add(priorityMediumHigh,funcScopeMainMode,true,false);
|
||||
queue->add(priorityMediumHigh,funcScopeSubMode,true,false);
|
||||
queue->add(priorityMediumHigh,funcScopeMainSpan,true,false);
|
||||
queue->add(priorityMediumHigh,funcScopeSubSpan,true,false);
|
||||
queue->add(priorityMediumHigh,queueItem(funcScopeSingleDual,true,false));
|
||||
queue->add(priorityMediumHigh,queueItem(funcScopeMainSub,true,false));
|
||||
}
|
||||
|
||||
if(rigCaps.hasTransmit) {
|
||||
queue->add(priorityHigh,funcTransceiverStatus,true,false);
|
||||
queue->add(priorityMediumHigh,funcDATAOffMod,true,false);
|
||||
queue->add(priorityMediumHigh,funcDATA1Mod,true,false);
|
||||
queue->add(priorityMediumHigh,funcDATA2Mod,true,false);
|
||||
queue->add(priorityMediumHigh,funcDATA3Mod,true,false);
|
||||
queue->add(priorityMedium,funcRFPower,true,false);
|
||||
queue->add(priorityMediumLow,funcMonitorGain,true,false);
|
||||
queue->add(priorityMediumLow,funcMonitor,true,false);
|
||||
}
|
||||
|
||||
queue->add(priorityMedium,funcRfGain,true,false);
|
||||
queue->add(priorityMediumLow,funcAttenuator,true,false);
|
||||
queue->add(priorityMediumLow,funcPreamp,true,false);
|
||||
queue->add(priorityMediumLow,funcAntenna,true,false);
|
||||
queue->add(priorityMediumLow,funcSplitStatus,true,false);
|
||||
queue->add(priorityMediumLow,funcToneSquelchType,true,false);
|
||||
|
||||
queue->add(priorityHighest,queueItem(funcSMeter,true,false));
|
||||
}
|
||||
|
||||
void wfmain::receiveFreq(freqt freqStruct)
|
||||
|
@ -7263,21 +7299,30 @@ void wfmain::receiveValue(cacheItem val){
|
|||
case funcScopeMainSub:
|
||||
{
|
||||
// This tells us whether we are receiving main or sub data
|
||||
bool sub = val.value.value<bool>();
|
||||
if (!sub && !ui->mainScope->isVisible()) {
|
||||
subScope = val.value.value<bool>();
|
||||
if (!subScope && !ui->mainScope->isVisible()) {
|
||||
ui->subScope->setVisible(false);
|
||||
ui->mainScope->setVisible(true);
|
||||
} else if (sub && !ui->subScope->isVisible()) {
|
||||
} else if (subScope && !ui->subScope->isVisible()) {
|
||||
ui->mainScope->setVisible(false);
|
||||
ui->subScope->setVisible(true);
|
||||
}
|
||||
|
||||
if (dualScope) {
|
||||
ui->mainScope->selected(!subScope);
|
||||
ui->subScope->selected(subScope);
|
||||
} else {
|
||||
ui->mainScope->selected(false);
|
||||
ui->subScope->selected(false);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case funcScopeSingleDual:
|
||||
{
|
||||
// This tells us whether we are receiving single or dual scopes
|
||||
bool dual = val.value.value<bool>();
|
||||
if (dual) {
|
||||
dualScope = val.value.value<bool>();
|
||||
if (dualScope) {
|
||||
if (!ui->subScope->isVisible())
|
||||
{
|
||||
ui->subScope->setVisible(true);
|
||||
|
@ -7364,6 +7409,19 @@ void wfmain::on_showSettingsBtn_clicked()
|
|||
showAndRaiseWidget(setupui);
|
||||
}
|
||||
|
||||
void wfmain::on_scopeMainSubBtn_clicked()
|
||||
{
|
||||
subScope = !subScope;
|
||||
queue->add(priorityImmediate,queueItem(funcScopeMainSub,QVariant::fromValue(subScope),false,false));
|
||||
}
|
||||
|
||||
void wfmain::on_scopeDualBtn_clicked()
|
||||
{
|
||||
dualScope = !dualScope;
|
||||
queue->add(priorityImmediate,queueItem(funcScopeSingleDual,QVariant::fromValue(dualScope),false,false));
|
||||
queue->add(priorityImmediate,funcScopeMainSub,false,false);
|
||||
}
|
||||
|
||||
|
||||
/* USB Hotplug support added at the end of the file for convenience */
|
||||
#ifdef USB_HOTPLUG
|
||||
|
|
10
wfmain.h
10
wfmain.h
|
@ -313,6 +313,7 @@ private slots:
|
|||
void extChangedLanPrefs(quint64 items);
|
||||
void extChangedClusterPrefs(quint64 items);
|
||||
void extChangedUdpPrefs(quint64 items);
|
||||
void extChangedServerPrefs(quint64 items);
|
||||
|
||||
void extChangedIfPref(prefIfItem i);
|
||||
void extChangedColPref(prefColItem i);
|
||||
|
@ -321,7 +322,8 @@ private slots:
|
|||
void extChangedCtPref(prefCtItem i);
|
||||
void extChangedLanPref(prefLanItem i);
|
||||
void extChangedClusterPref(prefClusterItem i);
|
||||
void extChangedUdpPref(udpPrefsItem i);
|
||||
void extChangedUdpPref(prefUDPItem i);
|
||||
void extChangedServerPref(prefServerItem i);
|
||||
|
||||
void enableUsbControllers(bool enabled);
|
||||
|
||||
|
@ -549,6 +551,9 @@ private slots:
|
|||
|
||||
void on_rigCreatorBtn_clicked();
|
||||
|
||||
void on_scopeMainSubBtn_clicked();
|
||||
void on_scopeDualBtn_clicked();
|
||||
|
||||
private:
|
||||
Ui::wfmain *ui;
|
||||
void closeEvent(QCloseEvent *event);
|
||||
|
@ -850,6 +855,9 @@ private:
|
|||
double pbtDefault = 0.0;
|
||||
quint16 cwPitch = 600;
|
||||
|
||||
bool subScope = false;
|
||||
bool dualScope = false;
|
||||
|
||||
availableBands lastRequestedBand=bandGen;
|
||||
|
||||
SERVERCONFIG serverConfig;
|
||||
|
|
73
wfmain.ui
73
wfmain.ui
|
@ -1371,6 +1371,79 @@
|
|||
<property name="bottomMargin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Scope Settings</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<property name="leftMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="topMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="rightMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<property name="bottomMargin">
|
||||
<number>4</number>
|
||||
</property>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<property name="spacing">
|
||||
<number>3</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QPushButton" name="scopeMainSubBtn">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Main/Sub</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="scopeDualBtn">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Minimum" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Dual</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_5">
|
||||
<property name="title">
|
||||
|
|
Ładowanie…
Reference in New Issue