#ifndef PULSEVIEW_PV_CONNECT_H
#define PULSEVIEW_PV_CONNECT_H
-#include <boost/shared_ptr.hpp>
+#include <memory>
#include <QComboBox>
#include <QDialog>
#include <QPushButton>
#include <QVBoxLayout>
-struct sr_config;
-struct sr_dev_inst;
+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 device {
-class DevInst;
-}
-
namespace dialogs {
class Connect : public QDialog
public:
Connect(QWidget *parent, pv::DeviceManager &device_manager);
- boost::shared_ptr<device::DevInst> get_selected_device() const;
+ std::shared_ptr<sigrok::HardwareDevice> get_selected_device() const;
private:
void populate_drivers();
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);
-
-private:
- pv::DeviceManager &_device_manager;
+ pv::DeviceManager &device_manager_;
- QVBoxLayout _layout;
+ 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;
- std::map<const sr_dev_inst*, boost::shared_ptr<pv::device::DevInst> >
- _device_map;
+ QPushButton scan_button_;
+ QListWidget device_list_;
- QDialogButtonBox _button_box;
+ QDialogButtonBox button_box_;
};
} // namespace dialogs