author | unc0rr |
Fri, 27 Dec 2013 01:25:03 +0400 | |
branch | 0.9.20 |
changeset 9854 | 6c4dbe67fd7d |
parent 9080 | 9b42757d7e71 |
child 9998 | 736015b847e3 |
permissions | -rw-r--r-- |
8377 | 1 |
/* |
2 |
* Hedgewars, a free turn based strategy game |
|
9080 | 3 |
* Copyright (c) 2004-2013 Andrey Korotaev <unC0Rr@gmail.com> |
8377 | 4 |
* |
5 |
* This program is free software; you can redistribute it and/or modify |
|
6 |
* it under the terms of the GNU General Public License as published by |
|
7 |
* the Free Software Foundation; version 2 of the License |
|
8 |
* |
|
9 |
* This program is distributed in the hope that it will be useful, |
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 |
* GNU General Public License for more details. |
|
13 |
* |
|
14 |
* You should have received a copy of the GNU General Public License |
|
15 |
* along with this program; if not, write to the Free Software |
|
16 |
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
|
17 |
*/ |
|
18 |
||
19 |
#ifndef THEMEPROMPT_H |
|
20 |
#define THEMEPROMPT_H |
|
21 |
||
22 |
#include <QWidget> |
|
23 |
#include <QDialog> |
|
8475
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
24 |
#include <QListView> |
8377 | 25 |
|
8475
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
26 |
class QLineEdit; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
27 |
class QModelIndex; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
28 |
class QSortFilterProxyModel; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
29 |
class LineEditCursor; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
30 |
|
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
31 |
class ThemeListView : public QListView |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
32 |
{ |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
33 |
friend class ThemePrompt; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
34 |
|
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
35 |
public: |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
36 |
ThemeListView(QWidget* parent = 0) : QListView(parent){} |
8623 | 37 |
void moveUp(); |
38 |
void moveDown(); |
|
39 |
void moveLeft(); |
|
40 |
void moveRight(); |
|
8475
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
41 |
}; |
8377 | 42 |
|
43 |
class ThemePrompt : public QDialog |
|
44 |
{ |
|
45 |
Q_OBJECT |
|
46 |
||
47 |
public: |
|
8475
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
48 |
ThemePrompt(int currentIndex = 0, QWidget* parent = 0); |
8377 | 49 |
|
50 |
private: |
|
8475
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
51 |
LineEditCursor * txtFilter; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
52 |
ThemeListView * list; |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
53 |
QSortFilterProxyModel * filterModel; |
8377 | 54 |
|
55 |
private slots: |
|
8475
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
56 |
void onAccepted(); |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
57 |
void themeChosen(const QModelIndex & index); |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
58 |
void filterChanged(const QString & text); |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
59 |
void moveUp(); |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
60 |
void moveDown(); |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
61 |
void moveLeft(); |
f605bc59c603
Initial theme selection is now random. Theme prompt now has a search input and no longer uses FlowLayout. (Resolves issue 520)
dag10
parents:
8377
diff
changeset
|
62 |
void moveRight(); |
8377 | 63 |
}; |
64 |
||
65 |
#endif // THEMEPROMPT_H |