]> sigrok.org Git - pulseview.git/blobdiff - pv/dialogs/connect.h
Use libsigrok C++ bindings (patch version 7).
[pulseview.git] / pv / dialogs / connect.h
index 862184b87326566415b2a142f59baef523dc6b6b..fbac9e3ecf23f51f8c71267b269a2011a43f9e91 100644 (file)
@@ -21,6 +21,8 @@
 #ifndef PULSEVIEW_PV_CONNECT_H
 #define PULSEVIEW_PV_CONNECT_H
 
+#include <memory>
+
 #include <QComboBox>
 #include <QDialog>
 #include <QDialogButtonBox>
 #include <QPushButton>
 #include <QVBoxLayout>
 
-struct sr_config;
+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
@@ -40,7 +51,9 @@ 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();
@@ -49,15 +62,14 @@ private:
 
        void set_serial_connection();
 
-private slots:
+private Q_SLOTS:
        void device_selected(int index);
 
        void scan_pressed();
 
 private:
-       static void free_drvopts(sr_config *src);
+       pv::DeviceManager &_device_manager;
 
-private:
        QVBoxLayout _layout;
 
        QWidget _form;