Advanced Settings Panel
[pierogi] / pirselectdeviceform.h
1 #ifndef PIRSELECTDEVICEFORM_H
2 #define PIRSELECTDEVICEFORM_H
3
4 #include <QWidget>
5
6 #include "pirmakenames.h"
7 #include "pirdevicetypenames.h"
8 #include "pirdeviceinfo.h"
9
10 class PIRKeysetWidgetItem;
11 class QListWidget;
12 class QKeyEvent;
13
14 namespace Ui {
15 class PIRSelectDeviceForm;
16 }
17
18 class PIRSelectDeviceForm : public QWidget
19 {
20   Q_OBJECT
21   
22 public:
23   explicit PIRSelectDeviceForm(
24     QWidget *parent = 0);
25
26   ~PIRSelectDeviceForm();
27
28 /*
29   void addNameToList(
30     QString name,
31     unsigned int index,
32     PIRMakeName make);
33 */
34
35   void addWidgetItem(
36     PIRKeysetWidgetItem *kwi);
37
38   // This is a bit of a hack, but not sure how to create a connection otherwise.
39   QListWidget *getDeviceListWidget();
40
41 protected:
42   void keyPressEvent(
43     QKeyEvent *event);
44
45 private slots:
46   void filterListByMake(
47     int make);
48
49   void filterListByDeviceType(
50     int deviceType);
51
52   void filterListByString(
53     QString string);
54
55   void on_searchStringLineEdit_textChanged(const QString &arg1);
56   void on_ssClosePushButton_clicked();
57
58 private:
59   void refilterList();
60
61   Ui::PIRSelectDeviceForm *ui;
62
63   PIRMakeName currentMake;
64   PIRDeviceTypeName currentDevice;
65   QString searchString;
66 };
67
68 #endif // PIRSELECTDEVICEFORM_H