mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-25 09:18:54 -05:00
KiwiSDR: analyze address on input to accept fully formed urls like http://host:port/ found on the web directory
This commit is contained in:
parent
79b7e16c29
commit
edab4f0b33
@ -150,7 +150,15 @@ void KiwiSDRGui::on_serverAddress_returnPressed()
|
||||
|
||||
void KiwiSDRGui::on_serverAddressApplyButton_clicked()
|
||||
{
|
||||
m_settings.m_serverAddress = ui->serverAddress->text();
|
||||
QString serverAddress = ui->serverAddress->text();
|
||||
QUrl url(serverAddress);
|
||||
|
||||
if (QStringList{"ws", "wss", "http", "https"}.contains(url.scheme())) {
|
||||
m_settings.m_serverAddress = QString("%1:%2").arg(url.host()).arg(url.port());
|
||||
} else {
|
||||
m_settings.m_serverAddress = serverAddress;
|
||||
}
|
||||
|
||||
sendSettings();
|
||||
}
|
||||
|
||||
|
@ -139,8 +139,10 @@ void KiwiSDRWorker::onGainChanged(quint32 gain, bool useAGC)
|
||||
|
||||
void KiwiSDRWorker::onServerAddressChanged(QString serverAddress)
|
||||
{
|
||||
if (m_serverAddress == serverAddress)
|
||||
if (m_serverAddress == serverAddress) {
|
||||
return;
|
||||
}
|
||||
|
||||
m_serverAddress = serverAddress;
|
||||
|
||||
m_status = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user