1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-03 23:41:16 -05:00
sdrangel/sdrgui/gui/deviceuserargsdialog.h

80 lines
3.0 KiB
C
Raw Normal View History

2019-06-12 02:39:25 -04:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2019 Edouard Griffiths, F4EXB //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// (at your option) any later version. //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
2019-06-12 12:50:53 -04:00
#ifndef SDRGUI_GUI_DEVICEUSERARGSDIALOG_H
#define SDRGUI_GUI_DEVICEUSERARGSDIALOG_H
2019-06-12 02:39:25 -04:00
#include <QDialog>
2019-06-12 12:50:53 -04:00
#include <QSet>
2019-06-12 02:39:25 -04:00
2019-06-12 12:50:53 -04:00
#include "plugin/plugininterface.h"
2019-06-13 11:28:21 -04:00
#include "device/deviceuserargs.h"
2019-06-12 02:39:25 -04:00
#include "export.h"
class QTreeWidgetItem;
class DeviceEnumerator;
namespace Ui {
2019-06-12 12:50:53 -04:00
class DeviceUserArgsDialog;
2019-06-12 02:39:25 -04:00
}
2019-06-12 12:50:53 -04:00
class SDRGUI_API DeviceUserArgsDialog : public QDialog {
2019-06-12 02:39:25 -04:00
Q_OBJECT
public:
2019-06-12 12:50:53 -04:00
explicit DeviceUserArgsDialog(
DeviceEnumerator* deviceEnumerator,
DeviceUserArgs& hardwareDeviceUserArgs,
QWidget* parent = 0);
~DeviceUserArgsDialog();
2019-06-12 02:39:25 -04:00
private:
2019-06-12 12:50:53 -04:00
struct HWDeviceReference {
QString m_hardwareId;
int m_sequence;
QString m_description;
bool operator==(const HWDeviceReference& rhs) {
return (m_hardwareId == rhs.m_hardwareId) && (m_sequence == rhs.m_sequence);
}
};
Ui::DeviceUserArgsDialog* ui;
2019-06-12 02:39:25 -04:00
DeviceEnumerator* m_deviceEnumerator;
2019-06-12 12:50:53 -04:00
DeviceUserArgs& m_hardwareDeviceUserArgs;
std::vector<HWDeviceReference> m_availableHWDevices;
2019-06-13 11:28:21 -04:00
DeviceUserArgs m_deviceUserArgsCopy;
QString m_xDeviceHardwareId;
unsigned int m_xDeviceSequence;
2019-06-12 12:50:53 -04:00
void pushHWDeviceReference(const PluginInterface::SamplingDevice *samplingDevice);
2019-06-12 19:23:05 -04:00
void displayArgsByDevice();
2019-06-12 02:39:25 -04:00
private slots:
void accept();
void reject();
2020-11-14 05:13:32 -05:00
void on_importDevice_clicked();
void on_deleteArgs_clicked();
2019-06-13 11:28:21 -04:00
void on_argsTree_currentItemChanged(QTreeWidgetItem* currentItem, QTreeWidgetItem* previousItem);
void on_argStringEdit_editingFinished();
void on_addDeviceHwIDEdit_editingFinished();
void on_addDeviceSeqEdit_editingFinished();
2020-11-14 05:13:32 -05:00
void on_addDevice_clicked();
2019-06-12 02:39:25 -04:00
};
2020-11-14 05:13:32 -05:00
#endif // SDRGUI_GUI_DEVICEUSERARGSDIALOG_H