Server Config madness. Not done yet.

widgets
Elliott Liggett 2023-02-21 22:54:15 -08:00
rodzic d2770b13fa
commit 43d8ecdd11
7 zmienionych plików z 314 dodań i 119 usunięć

Wyświetl plik

@ -105,6 +105,16 @@ void settingswidget::acceptUdpPreferencesPtr(udpPreferences *upptr)
}
}
void settingswidget::acceptServerConfig(SERVERCONFIG *sc)
{
if(sc != NULL)
{
qDebug(logGui()) << "Accepting ServerConfig pointer into settings widget.";
serverConfig = sc;
haveServerConfig = true;
}
}
void settingswidget::copyClusterList(QList<clusterSettings> c)
{
this->clusters = c;
@ -219,6 +229,24 @@ void settingswidget::updateCtPrefs(int items)
}
}
void settingswidget::updateServerConfigs(int items)
{
serverItems si;
if(items & (int)s_all)
{
items = 0xffffffff;
}
for(int i=1; i < (int)s_all; i = i << 1)
{
if(items & i)
{
qDebug(logGui()) << "Updating ServerConfig" << (int)i;
si = (serverItems)i;
updateServerConfig(si);
}
}
}
void settingswidget::updateLanPrefs(int items)
{
prefLanItem plan;
@ -257,6 +285,9 @@ void settingswidget::updateClusterPrefs(int items)
void settingswidget::updateIfPref(prefIfItem pif)
{
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(pif)
{
@ -329,6 +360,9 @@ void settingswidget::updateIfPref(prefIfItem pif)
void settingswidget::updateRaPref(prefRaItem pra)
{
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(pra)
{
@ -441,8 +475,10 @@ void settingswidget::updateRaPref(prefRaItem pra)
void settingswidget::updateCtPref(prefCtItem pct)
{
updatingUIFromPrefs = true;
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(pct)
{
case ct_enablePTT:
@ -469,6 +505,9 @@ void settingswidget::updateCtPref(prefCtItem pct)
void settingswidget::updateLanPref(prefLanItem plan)
{
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(plan)
{
@ -497,6 +536,9 @@ void settingswidget::updateLanPref(prefLanItem plan)
void settingswidget::updateClusterPref(prefClusterItem pcl)
{
if(prefs==NULL)
return;
updatingUIFromPrefs = true;
switch(pcl)
{
@ -535,6 +577,55 @@ void settingswidget::updateClusterPref(prefClusterItem pcl)
updatingUIFromPrefs = false;
}
void settingswidget::updateServerConfig(serverItems si)
{
if(serverConfig == NULL)
{
qCritical(logGui()) << "serverConfig is NULL, cannot set preferences!";
return;
}
updatingUIFromPrefs = true;
switch(si)
{
case s_enabled:
quietlyUpdateCheckbox(ui->serverEnableCheckbox, serverConfig->enabled);
break;
case s_lan:
// Not used here
break;
case s_controlPort:
quietlyUpdateLineEdit(ui->serverControlPortText, QString::number(serverConfig->civPort));
break;
case s_civPort:
quietlyUpdateLineEdit(ui->serverCivPortText, QString::number(serverConfig->civPort));
break;
case s_audioPort:
quietlyUpdateLineEdit(ui->serverAudioPortText, QString::number(serverConfig->audioPort));
break;
case s_audioOutput:
break;
case s_audioInput:
break;
case s_resampleQuality:
// Not used here
break;
case s_baudRate:
// Not used here
break;
case s_users:
// This is fairly complex
populateServerUsers();
break;
case s_rigs:
// Not used here
break;
default:
qWarning(logGui()) << "Did not find matching UI element for ServerConfig " << (int)si;
}
updatingUIFromPrefs = false;
}
void settingswidget::updateUdpPrefs(int items)
{
udpPrefsItem upi;
@ -762,6 +853,78 @@ void settingswidget::updateDataModSourceList(QStringList deviceNames, QVector<ri
ui->modInputDataCombo->blockSignals(false);
}
void settingswidget::populateServerUsers()
{
// Copy data from serverConfig.users into the server UI table
// We will assume the data are safe to use.
bool blank = false;
int row=0;
QList<SERVERUSER>::iterator user = serverConfig->users.begin();
while (user != serverConfig->users.end())
{
serverAddUserLine(user->username, user->password, user->userType);
row++;
user++;
// TODO: CRASH!! Cannot evaluate username if users are blank/empty.
// if((user->username == "") && !blank)
// blank = true;
}
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)
{
// migration TODO: Review these signals/slots
ui->serverUsersTable->blockSignals(true);
ui->serverUsersTable->insertRow(ui->serverUsersTable->rowCount());
ui->serverUsersTable->setItem(ui->serverUsersTable->rowCount() - 1, 0, new QTableWidgetItem());
ui->serverUsersTable->setItem(ui->serverUsersTable->rowCount() - 1, 1, new QTableWidgetItem());
ui->serverUsersTable->setItem(ui->serverUsersTable->rowCount() - 1, 2, new QTableWidgetItem());
ui->serverUsersTable->setItem(ui->serverUsersTable->rowCount() - 1, 3, new QTableWidgetItem());
QLineEdit* username = new QLineEdit();
username->setProperty("row", (int)ui->serverUsersTable->rowCount() - 1);
username->setProperty("col", (int)0);
username->setText(user);
connect(username, SIGNAL(editingFinished()), this, SLOT(onServerUserFieldChanged()));
ui->serverUsersTable->setCellWidget(ui->serverUsersTable->rowCount() - 1, 0, username);
QLineEdit* password = new QLineEdit();
password->setProperty("row", (int)ui->serverUsersTable->rowCount() - 1);
password->setProperty("col", (int)1);
password->setEchoMode(QLineEdit::PasswordEchoOnEdit);
password->setText(pass);
connect(password, SIGNAL(editingFinished()), this, SLOT(onServerUserFieldChanged()));
ui->serverUsersTable->setCellWidget(ui->serverUsersTable->rowCount() - 1, 1, password);
QComboBox* comboBox = new QComboBox();
comboBox->insertItems(0, { "Full User","Full with no TX","Monitor only" });
comboBox->setProperty("row", (int)ui->serverUsersTable->rowCount() - 1);
comboBox->setProperty("col", (int)2);
comboBox->setCurrentIndex(type);
connect(comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onServerUserFieldChanged()));
ui->serverUsersTable->setCellWidget(ui->serverUsersTable->rowCount() - 1, 2, comboBox);
QPushButton* button = new QPushButton();
button->setText("Delete");
button->setProperty("row", (int)ui->serverUsersTable->rowCount() - 1);
button->setProperty("col", (int)3);
connect(button, SIGNAL(clicked()), this, SLOT(onServerUserFieldChanged()));
ui->serverUsersTable->setCellWidget(ui->serverUsersTable->rowCount() - 1, 3, button);
ui->serverUsersTable->blockSignals(false);
}
// Utility Functions:
void settingswidget::updateUnderlayMode()
{
@ -823,6 +986,13 @@ void settingswidget::quietlyUpdateRadiobutton(QRadioButton *rb, bool isChecked)
rb->blockSignals(false);
}
void settingswidget::quietlyUpdateLineEdit(QLineEdit *le, const QString text)
{
le->blockSignals(true);
le->setText(text);
le->blockSignals(false);
}
// Resulting from User Interaction
void settingswidget::on_debugBtn_clicked()
@ -1309,7 +1479,6 @@ void settingswidget::on_clusterSkimmerSpotsEnable_clicked(bool checked)
emit changedClusterPref(cl_clusterSkimmerSpotsEnable);
}
void settingswidget::on_ipAddressTxt_textChanged(const QString &arg1)
{
udpPrefs->ipAddress = arg1;
@ -1344,3 +1513,29 @@ void settingswidget::on_audioDuplexCombo_currentIndexChanged(int index)
udpPrefs->halfDuplex = (bool)index;
emit changedUdpPref(u_halfDuplex);
}
void settingswidget::on_audioOutputCombo_currentIndexChanged(int index)
{
emit changedAudioOutputCombo(index);
}
void settingswidget::on_audioInputCombo_currentIndexChanged(int index)
{
emit changedAudioInputCombo(index);
}
void settingswidget::on_serverRXAudioInputCombo_currentIndexChanged(int index)
{
emit changedServerRXAudioInputCombo(index);
}
void settingswidget::on_serverTXAudioOutputCombo_currentIndexChanged(int index)
{
emit changedServerTXAudioOutputCombo(index);
}
void settingswidget::on_serverEnableCheckbox_clicked(bool checked)
{
serverConfig->enabled = checked;
emit changedServerConfig(s_enabled);
}

Wyświetl plik

@ -10,6 +10,7 @@
#include <QSpinBox>
#include <QCheckBox>
#include <QRadioButton>
#include <QLineEdit>
#include <QStringList>
#include "logcategories.h"
@ -18,6 +19,7 @@
#include "udpbase.h" // for udp preferences
#include "cluster.h" // for clusterSettings
#include "rigidentities.h" // for rigInputs
#include "udpserver.h" // for SERVERCONFIG
namespace Ui {
class settingswidget;
@ -35,6 +37,7 @@ public:
public slots:
void acceptPreferencesPtr(preferences *pptr);
void acceptUdpPreferencesPtr(udpPreferences *upptr);
void acceptServerConfig(SERVERCONFIG *serverConfig);
void copyClusterList(QList<clusterSettings> c);
void insertClusterOutputText(QString text);
@ -44,12 +47,14 @@ public slots:
void updateCtPrefs(int items);
void updateLanPrefs(int items);
void updateClusterPrefs(int items);
void updateServerConfigs(int items);
void updateIfPref(prefIfItem pif);
void updateRaPref(prefRaItem pra);
void updateCtPref(prefCtItem pct);
void updateLanPref(prefLanItem plan);
void updateClusterPref(prefClusterItem pcl);
void updateServerConfig(serverItems si);
void updateUdpPref(udpPrefsItem upi);
void updateUdpPrefs(int items);
@ -65,19 +70,19 @@ public slots:
void updateModSourceList(QStringList deviceNames, QVector<rigInput> data);
void updateDataModSourceList(QStringList deviceNames, QVector<rigInput> data);
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 changedIfPrefs(int items);
void changedRaPrefs(int items);
void changedCtPrefs(int items);
void changedLanPrefs(int items);
void changedClusterPrefs(int items);
void changedUdpPrefs(int items);
void changedServerConfigs(int i);
void changedAudioOutputCombo(int index);
void changedAudioInputCombo(int index);
void changedServerTXAudioOutputCombo(int index);
void changedServerRXAudioInputCombo(int index);
void changedIfPref(prefIfItem i);
void changedRaPref(prefRaItem i);
@ -85,6 +90,7 @@ signals:
void changedLanPref(prefLanItem i);
void changedClusterPref(prefClusterItem i);
void changedUdpPref(udpPrefsItem i);
void changedServerConfig(serverItems i);
void showUSBControllerSetup();
@ -136,6 +142,11 @@ private slots:
void on_controlPortTxt_textChanged(const QString &arg1);
void on_passwordTxt_textChanged(const QString &arg1);
void on_audioDuplexCombo_currentIndexChanged(int index);
void on_audioOutputCombo_currentIndexChanged(int index);
void on_audioInputCombo_currentIndexChanged(int index);
void on_serverRXAudioInputCombo_currentIndexChanged(int index);
void on_serverTXAudioOutputCombo_currentIndexChanged(int index);
void on_serverEnableCheckbox_clicked(bool checked);
private:
Ui::settingswidget *ui;
@ -144,15 +155,23 @@ private:
void updateAllPrefs();
void updateUnderlayMode();
void setUItoClustersList();
// Utility:
void quietlyUpdateSlider(QSlider* sl, int val);
void quietlyUpdateSpinbox(QSpinBox *sb, int val);
void quietlyUpdateCheckbox(QCheckBox *cb, bool isChecked);
void quietlyUpdateRadiobutton(QRadioButton *rb, bool isChecked);
void quietlyUpdateLineEdit(QLineEdit *le, const QString text);
void populateServerUsers();
void serverAddUserLine(const QString& user, const QString& pass, const int& type);
preferences *prefs = NULL;
udpPreferences *udpPrefs = NULL;
SERVERCONFIG *serverConfig = NULL;
bool havePrefs = false;
bool haveUdpPrefs = false;
bool haveServerConfig = false;
bool haveSerialDevices = false;
bool haveVspDevices = false;
bool haveAudioInputs = false;

Wyświetl plik

@ -41,7 +41,7 @@
<item>
<widget class="QStackedWidget" name="settingsStack">
<property name="currentIndex">
<number>0</number>
<number>3</number>
</property>
<widget class="QWidget" name="radioAccess">
<layout class="QVBoxLayout" name="verticalLayout_21">

Wyświetl plik

@ -94,6 +94,21 @@ struct SERVERCONFIG {
QList <RIGCONFIG*> rigs;
};
enum serverItems {
s_enabled = 1 << 0,
s_lan = 1 << 1,
s_controlPort = 1 << 2,
s_civPort = 1 << 3,
s_audioPort = 1 << 4,
s_audioOutput = 1 << 5,
s_audioInput = 1 << 6,
s_resampleQuality = 1 << 7,
s_baudRate = 1 << 8,
s_users = 1 << 9,
s_rigs = 1 << 10,
s_all = 1 << 11
};
class udpServer : public QObject
{

Wyświetl plik

@ -114,7 +114,9 @@ wfmain::wfmain(const QString settingsFile, const QString logFile, bool debugMode
loadSettings(); // Look for saved preferences
audioDev = new audioDevices(prefs.audioSystem, QFontMetrics(ui->audioInputCombo->font()));
// TODO: How to tell this thing how big the font is...? There isn't a UI anymore for this...
// Fake it for now assuming the button has the same font as a combo box
audioDev = new audioDevices(prefs.audioSystem, QFontMetrics(ui->connectBtn->font()));
connect(audioDev, SIGNAL(updated()), this, SLOT(setAudioDevicesUI()));
audioDev->enumerate();
//setAudioDevicesUI(); // no need to call this as it will be called by the updated() signal
@ -1252,7 +1254,14 @@ void wfmain::connectSettingsWidget()
if(shut != Q_NULLPTR)
showAndRaiseWidget(shut);
});
connect(this, SIGNAL(haveClusterList(QList<clusterSettings>)), setupui, SLOT(copyClusterList(QList<clusterSettings>)));
connect(setupui, SIGNAL(changedAudioInputCombo(int)), this, SLOT(changedAudioInput(int)));
connect(setupui, SIGNAL(changedAudioOutputCombo(int)), this, SLOT(changedAudioOutput(int)));
connect(setupui, SIGNAL(changedServerRXAudioInputCombo(int)), this, SLOT(changedServerRXAudioInput(int)));
connect(setupui, SIGNAL(changedServerTXAudioOutputCombo(int)), this, SLOT(changedServerTXAudioOutput(int)));
}
void wfmain::prepareSettingsWindow()
@ -2001,6 +2010,7 @@ void wfmain::setDefPrefs()
void wfmain::loadSettings()
{
qInfo(logSystem()) << "Loading settings from " << settings->fileName();
setupui->acceptServerConfig(&serverConfig);
QString currentVersionString = QString(WFVIEW_VERSION);
float currentVersionFloat = currentVersionString.toFloat();
@ -2180,8 +2190,9 @@ void wfmain::loadSettings()
prefs.enableLAN = settings->value("EnableLAN", defPrefs.enableLAN).toBool();
// If LAN is enabled, server gets its audio straight from the LAN
ui->serverRXAudioInputCombo->setEnabled(!prefs.enableLAN);
ui->serverTXAudioOutputCombo->setEnabled(!prefs.enableLAN);
// migrated, remove these
//ui->serverRXAudioInputCombo->setEnabled(!prefs.enableLAN);
//ui->serverTXAudioOutputCombo->setEnabled(!prefs.enableLAN);
ui->audioSystemServerCombo->setEnabled(!prefs.enableLAN);
ui->baudRateCombo->setEnabled(!prefs.enableLAN);
@ -2298,6 +2309,11 @@ void wfmain::loadSettings()
serverConfig.civPort = settings->value("ServerCivPort", 50002).toInt();
serverConfig.audioPort = settings->value("ServerAudioPort", 50003).toInt();
setupui->updateServerConfigs((int)(s_enabled |
s_controlPort |
s_civPort |
s_audioPort));
serverConfig.users.clear();
int numUsers = settings->beginReadArray("Users");
@ -2335,6 +2351,7 @@ void wfmain::loadSettings()
ui->serverCivPortText->setText(QString::number(serverConfig.civPort));
ui->serverAudioPortText->setText(QString::number(serverConfig.audioPort));
RIGCONFIG* rigTemp = new RIGCONFIG();
rigTemp->rxAudioSetup.isinput = true;
rigTemp->txAudioSetup.isinput = false;
@ -2391,6 +2408,10 @@ void wfmain::loadSettings()
ui->serverAddUserBtn->setEnabled(false);
}
// At this point, the users list has exactly one empty user.
setupui->updateServerConfig(s_users);
settings->endGroup();
// Memory channels
@ -2604,6 +2625,7 @@ void wfmain::loadSettings()
setupui->acceptUdpPreferencesPtr(&udpPrefs);
setupui->updateUdpPrefs((int)u_all);
}
void wfmain::extChangedIfPrefs(int items)
@ -2958,6 +2980,7 @@ void wfmain::extChangedUdpPref(udpPrefsItem i)
void wfmain::serverAddUserLine(const QString& user, const QString& pass, const int& type)
{
// migrated
ui->serverUsersTable->blockSignals(true);
ui->serverUsersTable->insertRow(ui->serverUsersTable->rowCount());
@ -3089,7 +3112,7 @@ void wfmain::on_serverAudioPortText_textChanged(QString text)
serverConfig.audioPort = text.toInt();
}
void wfmain::on_serverRXAudioInputCombo_currentIndexChanged(int value)
void wfmain::changedServerRXAudioInput(int value)
{
if (!serverConfig.rigs.isEmpty() && value>=0)
@ -3106,7 +3129,7 @@ void wfmain::on_serverRXAudioInputCombo_currentIndexChanged(int value)
}
void wfmain::on_serverTXAudioOutputCombo_currentIndexChanged(int value)
void wfmain::changedServerTXAudioOutput(int value)
{
if (!serverConfig.rigs.isEmpty() && value>=0)
@ -6561,7 +6584,7 @@ void wfmain::receiveATUStatus(unsigned char atustatus)
void wfmain::on_serialEnableBtn_clicked(bool checked)
{
// migrated
// migrated, can be removed entirely
prefs.enableLAN = !checked;
ui->serialDeviceListCombo->setEnabled(checked);
@ -6577,18 +6600,18 @@ void wfmain::on_serialEnableBtn_clicked(bool checked)
ui->txLatencySlider->setEnabled(!checked);
ui->rxLatencyValue->setEnabled(!checked);
ui->txLatencyValue->setEnabled(!checked);
ui->audioOutputCombo->setEnabled(!checked);
ui->audioInputCombo->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->serverRXAudioInputCombo->setEnabled(checked);
//ui->serverTXAudioOutputCombo->setEnabled(checked);
}
void wfmain::on_lanEnableBtn_clicked(bool checked)
{
// Migrated
// Migrated, can be removed entirely
prefs.enableLAN = checked;
ui->connectBtn->setEnabled(true);
ui->ipAddressTxt->setEnabled(checked);
@ -6602,12 +6625,12 @@ void wfmain::on_lanEnableBtn_clicked(bool checked)
ui->txLatencySlider->setEnabled(checked);
ui->rxLatencyValue->setEnabled(checked);
ui->txLatencyValue->setEnabled(checked);
ui->audioOutputCombo->setEnabled(checked);
ui->audioInputCombo->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->serverRXAudioInputCombo->setEnabled(!checked);
//ui->serverTXAudioOutputCombo->setEnabled(!checked);
if(checked)
{
showStatusBarText("After filling in values, press Save Settings.");
@ -6644,7 +6667,7 @@ void wfmain::on_audioDuplexCombo_currentIndexChanged(int value)
udpPrefs.halfDuplex = (bool)value;
}
void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
void wfmain::changedAudioInput(int value)
{
// TODO: Change function name, send value from setupui to here.
@ -6661,7 +6684,7 @@ void wfmain::on_audioOutputCombo_currentIndexChanged(int value)
qDebug(logGui()) << "Changed audio output to:" << rxSetup.name;
}
void wfmain::on_audioInputCombo_currentIndexChanged(int value)
void wfmain::changedAudioOutput(int value)
{
if (value >=0) {
if (prefs.audioSystem == qtAudio) {
@ -7772,44 +7795,45 @@ void wfmain::on_radioStatusBtn_clicked()
void wfmain::setAudioDevicesUI()
{
// ready for cleaning
qInfo() << "Looking for inputs";
// got these:
ui->audioInputCombo->blockSignals(true);
ui->audioInputCombo->clear();
ui->audioInputCombo->addItems(audioDev->getInputs());
ui->audioInputCombo->setCurrentIndex(-1);
ui->audioInputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsIn() + 30));
ui->audioInputCombo->blockSignals(false);
ui->audioInputCombo->setCurrentIndex(audioDev->findInput("Client", txSetup.name));
// ui->audioInputCombo->blockSignals(true);
// ui->audioInputCombo->clear();
// ui->audioInputCombo->addItems(audioDev->getInputs());
// ui->audioInputCombo->setCurrentIndex(-1);
// ui->audioInputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsIn() + 30));
// ui->audioInputCombo->blockSignals(false);
// ui->audioInputCombo->setCurrentIndex(audioDev->findInput("Client", txSetup.name));
setupui->updateAudioInputs(audioDev->getInputs(), audioDev->findInput("Client", txSetup.name), audioDev->getNumCharsIn());
qInfo() << "Looking for outputs";
// done:
ui->audioOutputCombo->blockSignals(true);
ui->audioOutputCombo->clear();
ui->audioOutputCombo->addItems(audioDev->getOutputs());
ui->audioOutputCombo->setCurrentIndex(-1);
ui->audioOutputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsOut() + 30));
ui->audioOutputCombo->blockSignals(false);
ui->audioOutputCombo->setCurrentIndex(audioDev->findOutput("Client", rxSetup.name));
// ui->audioOutputCombo->blockSignals(true);
// ui->audioOutputCombo->clear();
// ui->audioOutputCombo->addItems(audioDev->getOutputs());
// ui->audioOutputCombo->setCurrentIndex(-1);
// ui->audioOutputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsOut() + 30));
// ui->audioOutputCombo->blockSignals(false);
// ui->audioOutputCombo->setCurrentIndex(audioDev->findOutput("Client", rxSetup.name));
setupui->updateAudioOutputs(audioDev->getOutputs(), audioDev->findOutput("Client", rxSetup.name), audioDev->getNumCharsOut());
ui->serverTXAudioOutputCombo->blockSignals(true);
ui->serverTXAudioOutputCombo->clear();
ui->serverTXAudioOutputCombo->addItems(audioDev->getOutputs());
ui->serverTXAudioOutputCombo->setCurrentIndex(-1);
ui->serverTXAudioOutputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsOut() + 30));
ui->serverTXAudioOutputCombo->blockSignals(false);
// ui->serverTXAudioOutputCombo->blockSignals(true);
// ui->serverTXAudioOutputCombo->clear();
// ui->serverTXAudioOutputCombo->addItems(audioDev->getOutputs());
// ui->serverTXAudioOutputCombo->setCurrentIndex(-1);
// ui->serverTXAudioOutputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsOut() + 30));
// ui->serverTXAudioOutputCombo->blockSignals(false);
int serverOutputIndex = -1;
ui->serverRXAudioInputCombo->blockSignals(true);
ui->serverRXAudioInputCombo->clear();
ui->serverRXAudioInputCombo->addItems(audioDev->getInputs());
ui->serverRXAudioInputCombo->setCurrentIndex(-1);
ui->serverRXAudioInputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsIn()+30));
ui->serverRXAudioInputCombo->blockSignals(false);
// ui->serverRXAudioInputCombo->blockSignals(true);
// ui->serverRXAudioInputCombo->clear();
// ui->serverRXAudioInputCombo->addItems(audioDev->getInputs());
// ui->serverRXAudioInputCombo->setCurrentIndex(-1);
// ui->serverRXAudioInputCombo->setStyleSheet(QString("QComboBox QAbstractItemView {min-width: %1px;}").arg(audioDev->getNumCharsIn()+30));
// ui->serverRXAudioInputCombo->blockSignals(false);
int serverInputIndex = -1;
rxSetup.type = prefs.audioSystem;
@ -7820,9 +7844,9 @@ void wfmain::setAudioDevicesUI()
serverConfig.rigs.first()->rxAudioSetup.type = prefs.audioSystem;
serverConfig.rigs.first()->txAudioSetup.type = prefs.audioSystem;
ui->serverRXAudioInputCombo->setCurrentIndex(audioDev->findInput("Server", serverConfig.rigs.first()->rxAudioSetup.name));
//ui->serverRXAudioInputCombo->setCurrentIndex(audioDev->findInput("Server", serverConfig.rigs.first()->rxAudioSetup.name));
serverOutputIndex = audioDev->findOutput("Server", serverConfig.rigs.first()->txAudioSetup.name);
ui->serverTXAudioOutputCombo->setCurrentIndex(audioDev->findOutput("Server", serverConfig.rigs.first()->txAudioSetup.name));
//ui->serverTXAudioOutputCombo->setCurrentIndex(audioDev->findOutput("Server", serverConfig.rigs.first()->txAudioSetup.name));
serverInputIndex = audioDev->findOutput("Server", serverConfig.rigs.first()->txAudioSetup.name);
}

Wyświetl plik

@ -415,8 +415,8 @@ private slots:
void on_usernameTxt_textChanged(QString text);
void on_passwordTxt_textChanged(QString text);
void on_audioDuplexCombo_currentIndexChanged(int value);
void on_audioOutputCombo_currentIndexChanged(int value);
void on_audioInputCombo_currentIndexChanged(int value);
void changedAudioInput(int value);
void changedAudioOutput(int value);
void on_toFixedBtn_clicked();
void on_connectBtn_clicked();
void on_rxLatencySlider_valueChanged(int value);
@ -471,8 +471,8 @@ private slots:
void on_serverControlPortText_textChanged(QString text);
void on_serverCivPortText_textChanged(QString text);
void on_serverAudioPortText_textChanged(QString text);
void on_serverTXAudioOutputCombo_currentIndexChanged(int value);
void on_serverRXAudioInputCombo_currentIndexChanged(int value);
void changedServerTXAudioOutput(int value);
void changedServerRXAudioInput(int value);
void onServerUserFieldChanged();
void on_serverAddUserBtn_clicked();
void on_radioStatusBtn_clicked();

Wyświetl plik

@ -1266,7 +1266,7 @@
<item>
<widget class="QStackedWidget" name="settingsStack">
<property name="currentIndex">
<number>4</number>
<number>3</number>
</property>
<widget class="QWidget" name="radioAccess">
<layout class="QVBoxLayout" name="verticalLayout_21">
@ -1868,19 +1868,6 @@
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="audioOutputCombo">
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="accessibleName">
<string>Audio Output Selector</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_18">
<property name="text">
@ -1888,19 +1875,6 @@
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="audioInputCombo">
<property name="maximumSize">
<size>
<width>200</width>
<height>16777215</height>
</size>
</property>
<property name="accessibleName">
<string>Audio Input Selector</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_37">
<property name="orientation">
@ -2215,8 +2189,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>570</width>
<height>254</height>
<width>818</width>
<height>324</height>
</rect>
</property>
<layout class="QGridLayout" name="gridLayout_2">
@ -3342,22 +3316,6 @@
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="serverRXAudioInputCombo">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_34">
<property name="text">
@ -3365,22 +3323,6 @@
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="serverTXAudioOutputCombo">
<property name="minimumSize">
<size>
<width>100</width>
<height>0</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>100</width>
<height>16777215</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_44">
<property name="text">