author | Wuzzy <Wuzzy2@mail.ru> |
Fri, 11 Oct 2019 18:41:56 +0200 | |
changeset 15470 | a18f7e4681b8 |
parent 12250 | 5206f9a803d1 |
permissions | -rw-r--r-- |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
1 |
/* |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
2 |
* Hedgewars, a free turn based strategy game |
11046 | 3 |
* Copyright (c) 2004-2015 Andrey Korotaev <unC0Rr@gmail.com> |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
4 |
* |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
5 |
* This program is free software; you can redistribute it and/or modify |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
6 |
* it under the terms of the GNU General Public License as published by |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
7 |
* the Free Software Foundation; version 2 of the License |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
8 |
* |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
9 |
* This program is distributed in the hope that it will be useful, |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
12 |
* GNU General Public License for more details. |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
13 |
* |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
14 |
* You should have received a copy of the GNU General Public License |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
15 |
* along with this program; if not, write to the Free Software |
10108
c68cf030eded
update FSF address. note: two sdl include files (by Sam Lantinga) still have the old FSF address in their copyright - but I ain't gonna touch their copyright headers
sheepluva
parents:
9998
diff
changeset
|
16 |
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
17 |
*/ |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
18 |
|
6200 | 19 |
/** |
20 |
* @file |
|
21 |
* @brief AbstractPage class implementation |
|
22 |
*/ |
|
23 |
||
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
24 |
#include "AbstractPage.h" |
6477 | 25 |
#include <QLabel> |
26 |
#include <QSize> |
|
27 |
#include <QFontMetricsF> |
|
8385
9e8924ff9813
Convert feedback page to dialog (+some fixes from unC0Rr)
dag10
parents:
8384
diff
changeset
|
28 |
#include <QDebug> |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
29 |
|
7779 | 30 |
#include "qpushbuttonwithsound.h" |
31 |
||
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
32 |
AbstractPage::AbstractPage(QWidget* parent) |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
33 |
{ |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
34 |
Q_UNUSED(parent); |
6477 | 35 |
defautDesc = new QString(); |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
36 |
|
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
37 |
font14 = new QFont("MS Shell Dlg", 14); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
38 |
} |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
39 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
40 |
void AbstractPage::initPage() |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
41 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
42 |
QGridLayout * pageLayout = new QGridLayout(this); |
8408
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
43 |
QHBoxLayout * bottomLeftLayout = new QHBoxLayout(); |
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
44 |
pageLayout->addLayout(bottomLeftLayout, 1, 0); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
45 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
46 |
// stretch grid space for body and footer |
8408
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
47 |
pageLayout->setColumnStretch(0,1); |
11819
8eccc307ca1e
Frontend: Increase space for help text in the footer
Wuzzy <almikes@aol.com>
parents:
11046
diff
changeset
|
48 |
pageLayout->setColumnStretch(1,8); |
8149
237802cf4610
Google Code-in: Center help text field
Mitchell Kember <mk12360@gmail.com>
parents:
7794
diff
changeset
|
49 |
pageLayout->setColumnStretch(2,1); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
50 |
pageLayout->setRowStretch(0,1); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
51 |
pageLayout->setRowStretch(1,0); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
52 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
53 |
// add back/exit button |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
54 |
btnBack = formattedButton(":/res/Exit.png", true); |
6699
83dd3447a212
exploit the new setWhatsThis feature in our desktop frontend
koda
parents:
6577
diff
changeset
|
55 |
btnBack->setWhatsThis(tr("Go back")); |
8622
2045bdf1b11b
Resolves issue 528. Fixed platform-specific order of buttons on seed prompt and new room prompt. Fixed height of back button on all pages -- now aligns to bottom. On pagemain, feedback and dlc buttons no longer fixed size.
dag10
parents:
8408
diff
changeset
|
56 |
bottomLeftLayout->addWidget(btnBack, 0, Qt::AlignBottom); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
57 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
58 |
// add body layout as defined by the subclass |
8408
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
59 |
pageLayout->addLayout(bodyLayoutDefinition(), 0, 0, 1, 3); |
8377 | 60 |
|
61 |
// add left footer layout |
|
62 |
QLayout * flld = footerLayoutLeftDefinition(); |
|
63 |
if (flld != NULL) |
|
8408
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
64 |
bottomLeftLayout->addLayout(flld, 0); |
6477 | 65 |
|
66 |
descLabel = new QLabel(); |
|
67 |
descLabel->setAlignment(Qt::AlignCenter); |
|
68 |
descLabel->setWordWrap(true); |
|
69 |
descLabel->setOpenExternalLinks(true); |
|
9833
1957c7f92460
Pick random tip from the tip file each time front page is viewed.
nemo
parents:
9080
diff
changeset
|
70 |
descLabel->setFixedHeight(60); |
6477 | 71 |
descLabel->setStyleSheet("font-size: 16px"); |
8408
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
72 |
bottomLeftLayout->addWidget(descLabel); |
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
73 |
pageLayout->addWidget(descLabel, 1, 1); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
74 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
75 |
// add footer layout |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
76 |
QLayout * fld = footerLayoutDefinition(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
77 |
if (fld != NULL) |
8408
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
78 |
pageLayout->addLayout(fld, 1, 2); |
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
79 |
|
286823b10f35
Centered desc label. (Fixes issue 461)
dag10 <gottlieb.drew@gmail.com>
parents:
8385
diff
changeset
|
80 |
bottomLeftLayout->addStretch(1); |
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
81 |
|
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
82 |
// connect signals |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
83 |
connect(btnBack, SIGNAL(clicked()), this, SIGNAL(goBack())); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
84 |
connectSignals(); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
85 |
} |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
86 |
|
6577 | 87 |
QPushButtonWithSound * AbstractPage::formattedButton(const QString & name, bool hasIcon) |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
88 |
{ |
6572 | 89 |
QPushButtonWithSound * btn = new QPushButtonWithSound(this); |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
90 |
|
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
91 |
if (hasIcon) |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
92 |
{ |
6200 | 93 |
const QIcon& lp=QIcon(name); |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
94 |
QSize sz = lp.actualSize(QSize(65535, 65535)); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
95 |
btn->setIcon(lp); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
96 |
btn->setFixedSize(sz); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
97 |
btn->setIconSize(sz); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
98 |
btn->setFlat(true); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
99 |
btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
100 |
} |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
101 |
else |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
102 |
{ |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
103 |
btn->setFont(*font14); |
6200 | 104 |
btn->setText(name); |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
105 |
} |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
106 |
return btn; |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
107 |
} |
7781
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
108 |
QPushButton* AbstractPage::formattedSoundlessButton(const QString & name, bool hasIcon) |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
109 |
{ |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
110 |
QPushButton* btn = new QPushButton(this); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
111 |
|
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
112 |
if (hasIcon) |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
113 |
{ |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
114 |
const QIcon& lp=QIcon(name); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
115 |
QSize sz = lp.actualSize(QSize(65535, 65535)); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
116 |
btn->setIcon(lp); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
117 |
btn->setFixedSize(sz); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
118 |
btn->setIconSize(sz); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
119 |
btn->setFlat(true); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
120 |
btn->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
121 |
} |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
122 |
else |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
123 |
{ |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
124 |
btn->setFont(*font14); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
125 |
btn->setText(name); |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
126 |
} |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
127 |
return btn; |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
128 |
} |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
129 |
|
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11819
diff
changeset
|
130 |
QPushButtonWithSound * AbstractPage::addButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon, Qt::Alignment alignment) |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
131 |
{ |
6577 | 132 |
QPushButtonWithSound * btn = formattedButton(name, hasIcon); |
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11819
diff
changeset
|
133 |
grid->addWidget(btn, row, column, rowSpan, columnSpan, alignment); |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
134 |
return btn; |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
135 |
} |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
136 |
|
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11819
diff
changeset
|
137 |
QPushButtonWithSound * AbstractPage::addButton(const QString & name, QBoxLayout * box, int where, bool hasIcon, Qt::Alignment alignment) |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
138 |
{ |
6577 | 139 |
QPushButtonWithSound * btn = formattedButton(name, hasIcon); |
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11819
diff
changeset
|
140 |
box->addWidget(btn, where, alignment); |
6038
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
141 |
return btn; |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
142 |
} |
58d9badf3e7f
wow, somebody was smoking some reaaally good sh!t right there, man!
sheepluva
parents:
diff
changeset
|
143 |
|
12250
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
144 |
QPushButton* AbstractPage::addSoundlessButton(const QString & name, QGridLayout * grid, int row, int column, int rowSpan, int columnSpan, bool hasIcon, Qt::Alignment alignment) |
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
145 |
{ |
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
146 |
QPushButton * btn = formattedSoundlessButton(name, hasIcon); |
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
147 |
grid->addWidget(btn, row, column, rowSpan, columnSpan, alignment); |
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
148 |
return btn; |
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
149 |
} |
5206f9a803d1
Allow to randomize team name, flag, grave, voice and fort seperately
Wuzzy <almikes@aol.com>
parents:
11823
diff
changeset
|
150 |
|
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11819
diff
changeset
|
151 |
QPushButton* AbstractPage::addSoundlessButton(const QString & name, QBoxLayout * box, int where, bool hasIcon, Qt::Alignment alignment) |
7781
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
152 |
{ |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
153 |
QPushButton* btn = formattedSoundlessButton(name, hasIcon); |
11823
b421923c2577
Neatly align all the bottom buttons on the same height
Wuzzy <almikes@aol.com>
parents:
11819
diff
changeset
|
154 |
box->addWidget(btn, where, alignment); |
7781
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
155 |
return btn; |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
156 |
} |
6505805e7f98
crude workaround for problem inu reported with sound button
nemo
parents:
7779
diff
changeset
|
157 |
|
6042
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
158 |
void AbstractPage::setBackButtonVisible(bool visible) |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
159 |
{ |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
160 |
btnBack->setVisible(visible); |
8b5345758f62
some more cleanups/refactoring/blahblah, some button positions may are a bit off atm. also I added a new picture for one of the buttons
sheepluva
parents:
6038
diff
changeset
|
161 |
} |
6477 | 162 |
|
163 |
void AbstractPage::setButtonDescription(QString desc) |
|
164 |
{ |
|
165 |
descLabel->setText(desc); |
|
166 |
} |
|
167 |
||
8729 | 168 |
void AbstractPage::setDefaultDescription(QString text) |
6477 | 169 |
{ |
170 |
*defautDesc = text; |
|
171 |
descLabel->setText(text); |
|
172 |
} |
|
173 |
||
8729 | 174 |
QString * AbstractPage::getDefaultDescription() |
6477 | 175 |
{ |
176 |
return defautDesc; |
|
177 |
} |
|
8384 | 178 |
|
179 |
void AbstractPage::triggerPageEnter() |
|
180 |
{ |
|
181 |
emit pageEnter(); |
|
182 |
} |
|
183 |
||
184 |
void AbstractPage::triggerPageLeave() |
|
185 |
{ |
|
186 |
emit pageLeave(); |
|
187 |
} |