File indexing completed on 2024-05-12 04:52:18
0001 /* 0002 * dvbscandialog.h 0003 * 0004 * Copyright (C) 2008-2011 Christoph Pfister <christophpfister@gmail.com> 0005 * 0006 * This program is free software; you can redistribute it and/or modify 0007 * it under the terms of the GNU General Public License as published by 0008 * the Free Software Foundation; either version 2 of the License, or 0009 * (at your option) any later version. 0010 * 0011 * This program is distributed in the hope that it will be useful, 0012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 0013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0014 * GNU General Public License for more details. 0015 * 0016 * You should have received a copy of the GNU General Public License along 0017 * with this program; if not, write to the Free Software Foundation, Inc., 0018 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 0019 */ 0020 0021 #ifndef DVBSCANDIALOG_H 0022 #define DVBSCANDIALOG_H 0023 0024 #include <QLabel> 0025 #include <QTimer> 0026 #include <QDialog> 0027 0028 #include "dvbbackenddevice.h" 0029 0030 class QCheckBox; 0031 class QProgressBar; 0032 class QTreeView; 0033 class QComboBox; 0034 class KLed; 0035 class DvbChannelModel; 0036 class DvbDevice; 0037 class DvbGradProgress; 0038 class DvbManager; 0039 class DvbPreviewChannel; 0040 class DvbPreviewChannelTableModel; 0041 class DvbScan; 0042 0043 class DvbScanDialog : public QDialog 0044 { 0045 Q_OBJECT 0046 public: 0047 DvbScanDialog(DvbManager *manager_, QWidget *parent); 0048 ~DvbScanDialog(); 0049 0050 private slots: 0051 void scanButtonClicked(bool checked); 0052 void dialogAccepted(); 0053 0054 void foundChannels(const QList<DvbPreviewChannel> &channels); 0055 void scanFinished(); 0056 0057 void updateStatus(); 0058 0059 void addSelectedChannels(); 0060 void addFilteredChannels(); 0061 0062 private: 0063 void setDevice(DvbDevice *newDevice); 0064 0065 DvbManager *manager; 0066 DvbChannelModel *channelModel; 0067 QComboBox *sourceBox; 0068 QPushButton *scanButton; 0069 QProgressBar *progressBar; 0070 DvbGradProgress *signalWidget; 0071 DvbGradProgress *snrWidget; 0072 KLed *tunedLed; 0073 QCheckBox *otherNitCheckBox; 0074 QCheckBox *ftaCheckBox; 0075 QCheckBox *radioCheckBox; 0076 QCheckBox *tvCheckBox; 0077 QCheckBox *providerCheckBox; 0078 QStringList providers; 0079 QComboBox *providerBox; 0080 DvbPreviewChannelTableModel *previewModel; 0081 QTreeView *scanResultsView; 0082 0083 DvbDevice *device; 0084 QTimer statusTimer; 0085 bool isLive; 0086 0087 DvbScan *internal; 0088 }; 0089 0090 class DvbGradProgress : public QLabel 0091 { 0092 public: 0093 explicit DvbGradProgress(QWidget *parent); 0094 ~DvbGradProgress(); 0095 0096 void setValue(float value_, DvbBackendDevice::Scale scale); 0097 0098 protected: 0099 void paintEvent(QPaintEvent *event) override; 0100 0101 private: 0102 float value, max, min; 0103 }; 0104 0105 #endif /* DVBSCANDIALOG_H */