Skip to content

Commit

Permalink
Fixes device settings dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
PTDreamer committed Apr 16, 2018
1 parent 1c88e0a commit 89a40ef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
6 changes: 5 additions & 1 deletion devicesettings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ DeviceSettings::DeviceSettings(QWidget *parent) :
ui(new Ui::DeviceSettings)
{
ui->setupUi(this);
ui->devMinimumFreq->setReadOnly(true);
ui->devMaximumFreq->setReadOnly(true);
loadSettings(true);
}

Expand All @@ -21,6 +23,8 @@ DeviceSettings::~DeviceSettings()

void DeviceSettings::on_pushButton_clicked()
{
qDeleteAll(availableAmplificationElements);
availableAmplificationElements.clear();
foreach (QObject *w, this->children()) {
QComboBox *cb = qobject_cast<QComboBox*>(w);
if(cb)
Expand Down Expand Up @@ -110,7 +114,7 @@ void DeviceSettings::loadSettings(bool savedValuesOnly)
dsb->setValue(settings.value(setting).toDouble());
else if(chb)
chb->setChecked(settings.value(setting).toBool());
else if(le && !(le->isReadOnly() && settings.value(setting).toString().isEmpty()))
else if((le && !le->isReadOnly()) || (le && le->isReadOnly() && savedValuesOnly))
le->setText(settings.value(setting).toString());
}
}
Expand Down
1 change: 1 addition & 0 deletions main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include "mainwindow.h"
#include <QApplication>
//./linuxdeployqt-continuous-x86_64.AppImage /home/jose/code/qSdrSwr/build/Release/sdrSwr.desktop -verbose=3 -appimage -qmake=/home/jose/Qt/5.8/gcc_64/bin/qmake

int main(int argc, char *argv[])
{
Expand Down
4 changes: 2 additions & 2 deletions mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,8 +421,8 @@ void MainWindow::on_actionCapture_Device_triggered()
if(res == QDialog::Accepted) {
double max, min;
m_settings->getMaxMinFrequency(max, min);
max = max * 1000000;
min = min * 1000000;
max = convertFrequencyValue(max, MHZ, (frequencyUnits)ui->scanConfigScanUnits_CB->currentIndex());
min = convertFrequencyValue(min, MHZ, (frequencyUnits)ui->scanConfigScanUnits_CB->currentIndex());
if(max) {
ui->scanConfigStartFrequency_DS->setMaximum(max);
ui->scanConfigStopFrequency_SB->setMaximum(max);
Expand Down

0 comments on commit 89a40ef

Please sign in to comment.