Update to UI
[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 QListWidgetItem;
11 class PIRKeysetWidgetItem;
12 class QKeyEvent;
13 class PIREditKeysetDialog;
14 class MainWindow;
15
16 namespace Ui {
17 class PIRSelectKeysetForm;
18 }
19
20 class PIRSelectKeysetForm : public QWidget
21 {
22   Q_OBJECT
23   
24 public:
25 //  explicit PIRSelectKeysetForm(QWidget *parent = 0);
26
27   PIRSelectKeysetForm(
28     MainWindow *mw);
29
30   ~PIRSelectKeysetForm();
31
32 /*
33   void addNameToList(
34     QString name,
35     unsigned int index,
36     PIRMakeName make);
37 */
38
39   void addWidgetItem(
40     PIRKeysetWidgetItem *kwi);
41
42   // This is a bit of a hack, but not sure how to create a connection otherwise.
43   QListWidget *getKeysetListWidget();
44
45 protected:
46   void keyPressEvent(
47     QKeyEvent *event);
48
49 private slots:
50   void filterListByMake(
51     int make);
52
53   void filterListByString(
54     QString string);
55
56   void openKeysetDialog(
57     QListWidgetItem *);
58   
59   void on_searchStringLineEdit_textChanged(const QString &arg1);
60   void on_ssClosePushButton_clicked();
61   void on_showFavoritesCheckBox_toggled(bool checked);
62
63 private:
64   void refilterList();
65
66   Ui::PIRSelectKeysetForm *ui;
67
68   MainWindow *mainWindow;
69   PIREditKeysetDialog *editDialog;
70
71   bool showOnlyFavorites;
72   PIRMakeName currentMake;
73   QString searchString;
74 };
75
76 #endif // PIRSELECTKEYSETFORM_H