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