]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/connect.h
Use libsigrok C++ bindings (patch version 7).
[pulseview.git] / pv / dialogs / connect.h
index 443f6e07fde6c3a94dca2e28f8ac563aece77898..fbac9e3ecf23f51f8c71267b269a2011a43f9e91 100644 (file)
 #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
@@ -36,19 +51,25 @@ 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:
+       pv::DeviceManager &_device_manager;
+
        QVBoxLayout _layout;
 
        QWidget _form;
@@ -58,6 +79,9 @@ private:
 
        QLineEdit _serial_device;
 
+       QPushButton _scan_button;
+       QListWidget _device_list;
+
        QDialogButtonBox _button_box;
 };