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