1 /* -*- c++ -*- */
2 /*
3  * Gqrx SDR: Software defined radio receiver powered by GNU Radio and Qt
4  *           https://gqrx.dk/
5  *
6  * Copyright 2013 Alexandru Csete OZ9AEC.
7  *
8  * Gqrx is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3, or (at your option)
11  * any later version.
12  *
13  * Gqrx is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with Gqrx; see the file COPYING.  If not, write to
20  * the Free Software Foundation, Inc., 51 Franklin Street,
21  * Boston, MA 02110-1301, USA.
22  */
23 #include "nb_options.h"
24 #include "ui_nb_options.h"
25 
CNbOptions(QWidget * parent)26 CNbOptions::CNbOptions(QWidget *parent) :
27     QDialog(parent),
28     ui(new Ui::CNbOptions)
29 {
30     ui->setupUi(this);
31 }
32 
~CNbOptions()33 CNbOptions::~CNbOptions()
34 {
35     delete ui;
36 }
37 
38 /*! \brief Catch window close events.
39  *
40  * This method is called when the user closes the dialog window using the
41  * window close icon. We catch the event and hide the dialog but keep it
42  * around for later use.
43  */
closeEvent(QCloseEvent * event)44 void CNbOptions::closeEvent(QCloseEvent *event)
45 {
46     hide();
47     event->ignore();
48 }
49 
nbThreshold(int nbid)50 double CNbOptions::nbThreshold(int nbid)
51 {
52     if (nbid == 1)
53         return ui->nb1Threshold->value();
54     else
55         return ui->nb2Threshold->value();
56 }
57 
on_nb1Threshold_valueChanged(double val)58 void CNbOptions::on_nb1Threshold_valueChanged(double val)
59 {
60     emit thresholdChanged(1, val);
61 }
62 
on_nb2Threshold_valueChanged(double val)63 void CNbOptions::on_nb2Threshold_valueChanged(double val)
64 {
65     emit thresholdChanged(2, val);
66 }
67