#ifndef PULSEVIEW_PV_CONNECT_H
#define PULSEVIEW_PV_CONNECT_H
+#include <memory>
+
#include <QComboBox>
#include <QDialog>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QLineEdit>
+#include <QListWidget>
+#include <QPushButton>
#include <QVBoxLayout>
+namespace sigrok {
+ class Driver;
+ class HardwareDevice;
+}
+
+Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Driver>);
+Q_DECLARE_METATYPE(std::shared_ptr<sigrok::HardwareDevice>);
+
namespace pv {
+
+class DeviceManager;
+
namespace dialogs {
class Connect : public QDialog
Q_OBJECT
public:
- Connect(QWidget *parent);
+ Connect(QWidget *parent, pv::DeviceManager &device_manager);
+
+ std::shared_ptr<sigrok::HardwareDevice> get_selected_device() const;
private:
void populate_drivers();
-private slots:
- void device_selected(int index);
-
void unset_connection();
void set_serial_connection();
+private Q_SLOTS:
+ void device_selected(int index);
+
+ void scan_pressed();
+
private:
- QVBoxLayout _layout;
+ pv::DeviceManager &device_manager_;
+
+ QVBoxLayout layout_;
+
+ QWidget form_;
+ QFormLayout form_layout_;
- QWidget _form;
- QFormLayout _form_layout;
+ QComboBox drivers_;
- QComboBox _drivers;
+ QLineEdit serial_device_;
- QLineEdit _serial_device;
+ QPushButton scan_button_;
+ QListWidget device_list_;
- QDialogButtonBox _button_box;
+ QDialogButtonBox button_box_;
};
} // namespace dialogs