1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
|
#ifndef DEVICESDIALOG_H
#define DEVICESDIALOG_H
#include <QDialog>
#include <mtp/ptp/Device.h>
#include <mtp/usb/DeviceBusyException.h>
#include <vector>
namespace Ui {
class DevicesDialog;
}
class QListWidgetItem;
class DevicesDialog : public QDialog
{
Q_OBJECT
private:
struct Row
{
mtp::usb::DeviceDescriptorPtr Descriptor;
mtp::DevicePtr Device;
std::vector<mtp::usb::DeviceBusyException::ProcessDescriptor> Processes;
};
bool _resetDevice;
std::vector<Row> _devices;
public:
explicit DevicesDialog(bool resetDevice, QWidget *parent = nullptr);
~DevicesDialog();
mtp::DevicePtr getDevice();
int exec();
private slots:
void scan();
void kill();
void itemClicked(QListWidgetItem *);
void itemDoubleClicked(QListWidgetItem *);
void updateButtons();
private:
Ui::DevicesDialog * ui;
QPushButton * _buttonScan;
QPushButton * _buttonKill;
};
#endif // DEVICESDIALOG_H
|