33 #include "hwconsts.h" |
33 #include "hwconsts.h" |
34 #include "mapContainer.h" |
34 #include "mapContainer.h" |
35 #include "igbox.h" |
35 #include "igbox.h" |
36 |
36 |
37 HWMapContainer::HWMapContainer(QWidget * parent) : |
37 HWMapContainer::HWMapContainer(QWidget * parent) : |
38 QWidget(parent), |
38 QWidget(parent), |
39 mainLayout(this), |
39 mainLayout(this), |
40 pMap(0) |
40 pMap(0) |
41 { |
41 { |
42 hhSmall.load(":/res/hh_small.png"); |
42 hhSmall.load(":/res/hh_small.png"); |
43 hhLimit = 18; |
43 hhLimit = 18; |
44 templateFilter = 0; |
44 templateFilter = 0; |
45 |
45 |
46 mainLayout.setContentsMargins(QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin), |
46 mainLayout.setContentsMargins(QApplication::style()->pixelMetric(QStyle::PM_LayoutLeftMargin), |
47 1, |
47 1, |
48 QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin), |
48 QApplication::style()->pixelMetric(QStyle::PM_LayoutRightMargin), |
49 QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); |
49 QApplication::style()->pixelMetric(QStyle::PM_LayoutBottomMargin)); |
50 |
50 |
51 imageButt = new QPushButton(this); |
51 imageButt = new QPushButton(this); |
52 imageButt->setObjectName("imageButt"); |
52 imageButt->setObjectName("imageButt"); |
53 imageButt->setFixedSize(256 + 6, 128 + 6); |
53 imageButt->setFixedSize(256 + 6, 128 + 6); |
54 imageButt->setFlat(true); |
54 imageButt->setFlat(true); |
55 imageButt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);//QSizePolicy::Minimum, QSizePolicy::Minimum); |
55 imageButt->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);//QSizePolicy::Minimum, QSizePolicy::Minimum); |
56 mainLayout.addWidget(imageButt, 0, 0, 1, 2); |
56 mainLayout.addWidget(imageButt, 0, 0, 1, 2); |
57 connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomSeed())); |
57 connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomSeed())); |
58 connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomTheme())); |
58 connect(imageButt, SIGNAL(clicked()), this, SLOT(setRandomTheme())); |
59 |
59 |
60 chooseMap = new QComboBox(this); |
60 chooseMap = new QComboBox(this); |
61 chooseMap->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
61 chooseMap->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); |
62 chooseMap->addItem(QComboBox::tr("generated map...")); |
62 chooseMap->addItem(QComboBox::tr("generated map...")); |
63 for (int i = 0; i < mapList->size(); ++i) { |
63 for (int i = 0; i < mapList->size(); ++i) { |
64 QString map = (*mapList)[i]; |
64 QString map = (*mapList)[i]; |
65 QFile mapCfgFile( |
65 QFile mapCfgFile( |
66 QString("%1/Maps/%2/map.cfg") |
66 QString("%1/Maps/%2/map.cfg") |
67 .arg(datadir->absolutePath()) |
67 .arg(datadir->absolutePath()) |
68 .arg(map)); |
68 .arg(map)); |
69 |
69 |
70 if (mapCfgFile.open(QFile::ReadOnly)) { |
70 if (mapCfgFile.open(QFile::ReadOnly)) { |
71 QString theme; |
71 QString theme; |
72 quint32 limit = 0; |
72 quint32 limit = 0; |
73 QList<QVariant> mapInfo; |
73 QList<QVariant> mapInfo; |
74 QTextStream input(&mapCfgFile); |
74 QTextStream input(&mapCfgFile); |
75 input >> theme; |
75 input >> theme; |
76 input >> limit; |
76 input >> limit; |
77 mapInfo.push_back(theme); |
77 mapInfo.push_back(theme); |
78 if (limit) |
78 if (limit) |
79 mapInfo.push_back(limit); |
79 mapInfo.push_back(limit); |
80 else |
80 else |
81 mapInfo.push_back(18); |
81 mapInfo.push_back(18); |
82 chooseMap->addItem(map, mapInfo); |
82 chooseMap->addItem(map, mapInfo); |
83 mapCfgFile.close(); |
83 mapCfgFile.close(); |
84 } |
84 } |
85 } |
85 } |
86 |
86 |
87 connect(chooseMap, SIGNAL(currentIndexChanged(int)), this, SLOT(mapChanged(int))); |
87 connect(chooseMap, SIGNAL(currentIndexChanged(int)), this, SLOT(mapChanged(int))); |
88 mainLayout.addWidget(chooseMap, 1, 1); |
88 mainLayout.addWidget(chooseMap, 1, 1); |
89 |
89 |
90 QLabel * lblMap = new QLabel(tr("Map"), this); |
90 QLabel * lblMap = new QLabel(tr("Map"), this); |
91 mainLayout.addWidget(lblMap, 1, 0); |
91 mainLayout.addWidget(lblMap, 1, 0); |
92 |
92 |
93 lblFilter = new QLabel(tr("Filter"), this); |
93 lblFilter = new QLabel(tr("Filter"), this); |
94 mainLayout.addWidget(lblFilter, 2, 0); |
94 mainLayout.addWidget(lblFilter, 2, 0); |
95 |
95 |
96 CB_TemplateFilter = new QComboBox(this); |
96 CB_TemplateFilter = new QComboBox(this); |
97 CB_TemplateFilter->addItem(tr("All"), 0); |
97 CB_TemplateFilter->addItem(tr("All"), 0); |
98 CB_TemplateFilter->addItem(tr("Small"), 1); |
98 CB_TemplateFilter->addItem(tr("Small"), 1); |
99 CB_TemplateFilter->addItem(tr("Medium"), 2); |
99 CB_TemplateFilter->addItem(tr("Medium"), 2); |
100 CB_TemplateFilter->addItem(tr("Large"), 3); |
100 CB_TemplateFilter->addItem(tr("Large"), 3); |
101 CB_TemplateFilter->addItem(tr("Cavern"), 4); |
101 CB_TemplateFilter->addItem(tr("Cavern"), 4); |
102 CB_TemplateFilter->addItem(tr("Wacky"), 5); |
102 CB_TemplateFilter->addItem(tr("Wacky"), 5); |
103 mainLayout.addWidget(CB_TemplateFilter, 2, 1); |
103 mainLayout.addWidget(CB_TemplateFilter, 2, 1); |
104 |
104 |
105 connect(CB_TemplateFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(templateFilterChanged(int))); |
105 connect(CB_TemplateFilter, SIGNAL(currentIndexChanged(int)), this, SLOT(templateFilterChanged(int))); |
106 |
106 |
107 gbThemes = new IconedGroupBox(this); |
107 gbThemes = new IconedGroupBox(this); |
108 gbThemes->setTitleTextPadding(60); |
108 gbThemes->setTitleTextPadding(60); |
109 gbThemes->setContentTopPadding(6); |
109 gbThemes->setContentTopPadding(6); |
110 gbThemes->setTitle(tr("Themes")); |
110 gbThemes->setTitle(tr("Themes")); |
111 |
111 |
112 //gbThemes->setStyleSheet("padding: 0px"); // doesn't work - stylesheet is set with icon |
112 //gbThemes->setStyleSheet("padding: 0px"); // doesn't work - stylesheet is set with icon |
113 mainLayout.addWidget(gbThemes, 0, 2, 3, 1); |
113 mainLayout.addWidget(gbThemes, 0, 2, 3, 1); |
114 |
114 |
115 QVBoxLayout * gbTLayout = new QVBoxLayout(gbThemes); |
115 QVBoxLayout * gbTLayout = new QVBoxLayout(gbThemes); |
116 gbTLayout->setContentsMargins(0, 0, 0 ,0); |
116 gbTLayout->setContentsMargins(0, 0, 0 ,0); |
117 gbTLayout->setSpacing(0); |
117 gbTLayout->setSpacing(0); |
118 lwThemes = new QListWidget(this); |
118 lwThemes = new QListWidget(this); |
119 lwThemes->setMinimumHeight(30); |
119 lwThemes->setMinimumHeight(30); |
120 lwThemes->setFixedWidth(120); |
120 lwThemes->setFixedWidth(120); |
121 for (int i = 0; i < Themes->size(); ++i) { |
121 for (int i = 0; i < Themes->size(); ++i) { |
122 QListWidgetItem * lwi = new QListWidgetItem(); |
122 QListWidgetItem * lwi = new QListWidgetItem(); |
123 lwi->setText(Themes->at(i)); |
123 lwi->setText(Themes->at(i)); |
124 lwi->setTextAlignment(Qt::AlignHCenter); |
124 lwi->setTextAlignment(Qt::AlignHCenter); |
125 lwThemes->addItem(lwi); |
125 lwThemes->addItem(lwi); |
126 } |
126 } |
127 connect(lwThemes, SIGNAL(currentRowChanged(int)), this, SLOT(themeSelected(int))); |
127 connect(lwThemes, SIGNAL(currentRowChanged(int)), this, SLOT(themeSelected(int))); |
128 |
128 |
129 // override default style to tighten up theme scroller |
129 // override default style to tighten up theme scroller |
130 lwThemes->setStyleSheet(QString( |
130 lwThemes->setStyleSheet(QString( |
131 "QListWidget{" |
131 "QListWidget{" |
132 "border: solid;" |
132 "border: solid;" |
133 "border-width: 0px;" |
133 "border-width: 0px;" |
134 "border-radius: 0px;" |
134 "border-radius: 0px;" |
135 "border-color: transparent;" |
135 "border-color: transparent;" |
136 "background-color: #0d0544;" |
136 "background-color: #0d0544;" |
137 "color: #ffcc00;" |
137 "color: #ffcc00;" |
138 "font: bold 14px;" |
138 "font: bold 14px;" |
139 "}" |
139 "}" |
140 ) |
140 ) |
141 ); |
141 ); |
142 |
142 |
143 gbTLayout->addWidget(lwThemes); |
143 gbTLayout->addWidget(lwThemes); |
144 lwThemes->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); |
144 lwThemes->setSizePolicy(QSizePolicy::Maximum, QSizePolicy::Minimum); |
145 |
145 |
146 mainLayout.setSizeConstraint(QLayout::SetFixedSize);//SetMinimumSize |
146 mainLayout.setSizeConstraint(QLayout::SetFixedSize);//SetMinimumSize |
147 |
147 |
148 setRandomSeed(); |
148 setRandomSeed(); |
149 setRandomTheme(); |
149 setRandomTheme(); |
150 } |
150 } |
151 |
151 |
152 void HWMapContainer::setImage(const QImage newImage) |
152 void HWMapContainer::setImage(const QImage newImage) |
153 { |
153 { |
154 QPixmap px(256, 128); |
154 QPixmap px(256, 128); |
155 QPixmap pxres(256, 128); |
155 QPixmap pxres(256, 128); |
156 QPainter p(&pxres); |
156 QPainter p(&pxres); |
157 |
157 |
158 px.fill(Qt::yellow); |
158 px.fill(Qt::yellow); |
159 QBitmap bm = QBitmap::fromImage(newImage); |
159 QBitmap bm = QBitmap::fromImage(newImage); |
160 px.setMask(bm); |
160 px.setMask(bm); |
161 |
161 |
162 QLinearGradient linearGrad(QPoint(128, 0), QPoint(128, 128)); |
162 QLinearGradient linearGrad(QPoint(128, 0), QPoint(128, 128)); |
163 linearGrad.setColorAt(1, QColor(0, 0, 192)); |
163 linearGrad.setColorAt(1, QColor(0, 0, 192)); |
164 linearGrad.setColorAt(0, QColor(66, 115, 225)); |
164 linearGrad.setColorAt(0, QColor(66, 115, 225)); |
165 p.fillRect(QRect(0, 0, 256, 128), linearGrad); |
165 p.fillRect(QRect(0, 0, 256, 128), linearGrad); |
166 p.drawPixmap(QPoint(0, 0), px); |
166 p.drawPixmap(QPoint(0, 0), px); |
167 |
167 |
168 addInfoToPreview(pxres); |
168 addInfoToPreview(pxres); |
169 chooseMap->setCurrentIndex(0); |
169 chooseMap->setCurrentIndex(0); |
170 pMap = 0; |
170 pMap = 0; |
171 } |
171 } |
172 |
172 |
173 void HWMapContainer::setHHLimit(int newHHLimit) |
173 void HWMapContainer::setHHLimit(int newHHLimit) |
174 { |
174 { |
175 hhLimit = newHHLimit; |
175 hhLimit = newHHLimit; |
176 } |
176 } |
177 |
177 |
178 void HWMapContainer::mapChanged(int index) |
178 void HWMapContainer::mapChanged(int index) |
179 { |
179 { |
180 if(!index) { |
180 if(!index) { |
181 changeImage(); |
181 changeImage(); |
182 gbThemes->show(); |
182 gbThemes->show(); |
183 lblFilter->show(); |
183 lblFilter->show(); |
184 CB_TemplateFilter->show(); |
184 CB_TemplateFilter->show(); |
185 emit mapChanged("+rnd+"); |
185 emit mapChanged("+rnd+"); |
186 emit themeChanged(chooseMap->itemData(0).toList()[0].toString()); |
186 emit themeChanged(chooseMap->itemData(0).toList()[0].toString()); |
187 } else |
187 } else |
188 { |
188 { |
189 loadMap(index); |
189 loadMap(index); |
190 gbThemes->hide(); |
190 gbThemes->hide(); |
191 lblFilter->hide(); |
191 lblFilter->hide(); |
192 CB_TemplateFilter->hide(); |
192 CB_TemplateFilter->hide(); |
193 emit mapChanged(chooseMap->currentText()); |
193 emit mapChanged(chooseMap->currentText()); |
194 } |
194 } |
195 } |
195 } |
196 |
196 |
197 void HWMapContainer::loadMap(int index) |
197 void HWMapContainer::loadMap(int index) |
198 { |
198 { |
199 QPixmap mapImage; |
199 QPixmap mapImage; |
200 if(!mapImage.load(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/preview.png")) { |
200 if(!mapImage.load(datadir->absolutePath() + "/Maps/" + chooseMap->currentText() + "/preview.png")) { |
201 changeImage(); |
201 changeImage(); |
202 chooseMap->setCurrentIndex(0); |
202 chooseMap->setCurrentIndex(0); |
203 return; |
203 return; |
204 } |
204 } |
205 |
205 |
206 hhLimit = chooseMap->itemData(index).toList()[1].toInt(); |
206 hhLimit = chooseMap->itemData(index).toList()[1].toInt(); |
207 addInfoToPreview(mapImage); |
207 addInfoToPreview(mapImage); |
208 } |
208 } |
209 |
209 |
210 // Should this add text to identify map size? |
210 // Should this add text to identify map size? |
211 void HWMapContainer::addInfoToPreview(QPixmap image) |
211 void HWMapContainer::addInfoToPreview(QPixmap image) |
212 { |
212 { |
213 QPixmap finalImage = QPixmap(image.size()); |
213 QPixmap finalImage = QPixmap(image.size()); |
214 finalImage.fill(QColor(0, 0, 0, 0)); |
214 finalImage.fill(QColor(0, 0, 0, 0)); |
215 |
215 |
216 QPainter p(&finalImage); |
216 QPainter p(&finalImage); |
217 p.drawPixmap(image.rect(), image); |
217 p.drawPixmap(image.rect(), image); |
218 //p.setPen(QColor(0xf4,0x9e,0xe9)); |
218 //p.setPen(QColor(0xf4,0x9e,0xe9)); |
219 p.setPen(QColor(0xff,0xcc,0x00)); |
219 p.setPen(QColor(0xff,0xcc,0x00)); |
220 p.setBrush(QColor(0, 0, 0)); |
220 p.setBrush(QColor(0, 0, 0)); |
221 p.drawRect(image.rect().width() - hhSmall.rect().width() - 28, 3, 40, 20); |
221 p.drawRect(image.rect().width() - hhSmall.rect().width() - 28, 3, 40, 20); |
222 p.setFont(QFont("MS Shell Dlg", 10)); |
222 p.setFont(QFont("MS Shell Dlg", 10)); |
223 p.drawText(image.rect().width() - hhSmall.rect().width() - 14 - (hhLimit > 9 ? 10 : 0), 18, QString::number(hhLimit)); |
223 p.drawText(image.rect().width() - hhSmall.rect().width() - 14 - (hhLimit > 9 ? 10 : 0), 18, QString::number(hhLimit)); |
224 p.drawPixmap(image.rect().width() - hhSmall.rect().width() - 5, 5, hhSmall.rect().width(), hhSmall.rect().height(), hhSmall); |
224 p.drawPixmap(image.rect().width() - hhSmall.rect().width() - 5, 5, hhSmall.rect().width(), hhSmall.rect().height(), hhSmall); |
225 |
225 |
226 imageButt->setIcon(finalImage); |
226 imageButt->setIcon(finalImage); |
227 imageButt->setIconSize(image.size()); |
227 imageButt->setIconSize(image.size()); |
228 } |
228 } |
229 |
229 |
230 void HWMapContainer::changeImage() |
230 void HWMapContainer::changeImage() |
231 { |
231 { |
232 if (pMap) |
232 if (pMap) |
233 { |
233 { |
234 disconnect(pMap, 0, this, SLOT(setImage(const QImage))); |
234 disconnect(pMap, 0, this, SLOT(setImage(const QImage))); |
235 disconnect(pMap, 0, this, SLOT(setHHLimit(int))); |
235 disconnect(pMap, 0, this, SLOT(setHHLimit(int))); |
236 pMap = 0; |
236 pMap = 0; |
237 } |
237 } |
238 |
238 |
239 pMap = new HWMap(); |
239 pMap = new HWMap(); |
240 connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage))); |
240 connect(pMap, SIGNAL(ImageReceived(const QImage)), this, SLOT(setImage(const QImage))); |
241 connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int))); |
241 connect(pMap, SIGNAL(HHLimitReceived(int)), this, SLOT(setHHLimit(int))); |
242 pMap->getImage(m_seed.toStdString(), getTemplateFilter()); |
242 pMap->getImage(m_seed.toStdString(), getTemplateFilter()); |
243 } |
243 } |
244 |
244 |
245 void HWMapContainer::themeSelected(int currentRow) |
245 void HWMapContainer::themeSelected(int currentRow) |
246 { |
246 { |
247 QString theme = Themes->at(currentRow); |
247 QString theme = Themes->at(currentRow); |
248 QList<QVariant> mapInfo; |
248 QList<QVariant> mapInfo; |
249 mapInfo.push_back(theme); |
249 mapInfo.push_back(theme); |
250 mapInfo.push_back(18); |
250 mapInfo.push_back(18); |
251 chooseMap->setItemData(0, mapInfo); |
251 chooseMap->setItemData(0, mapInfo); |
252 gbThemes->setIcon(QIcon(QString("%1/Themes/%2/icon.png").arg(datadir->absolutePath()).arg(theme))); |
252 gbThemes->setIcon(QIcon(QString("%1/Themes/%2/icon.png").arg(datadir->absolutePath()).arg(theme))); |
253 emit themeChanged(theme); |
253 emit themeChanged(theme); |
254 } |
254 } |
255 |
255 |
256 QString HWMapContainer::getCurrentSeed() const |
256 QString HWMapContainer::getCurrentSeed() const |
257 { |
257 { |
258 return m_seed; |
258 return m_seed; |
259 } |
259 } |
260 |
260 |
261 QString HWMapContainer::getCurrentMap() const |
261 QString HWMapContainer::getCurrentMap() const |
262 { |
262 { |
263 if(!chooseMap->currentIndex()) return QString(); |
263 if(!chooseMap->currentIndex()) return QString(); |
264 return chooseMap->currentText(); |
264 return chooseMap->currentText(); |
265 } |
265 } |
266 |
266 |
267 QString HWMapContainer::getCurrentTheme() const |
267 QString HWMapContainer::getCurrentTheme() const |
268 { |
268 { |
269 return chooseMap->itemData(chooseMap->currentIndex()).toList()[0].toString(); |
269 return chooseMap->itemData(chooseMap->currentIndex()).toList()[0].toString(); |
270 } |
270 } |
271 |
271 |
272 int HWMapContainer::getCurrentHHLimit() const |
272 int HWMapContainer::getCurrentHHLimit() const |
273 { |
273 { |
274 return hhLimit; |
274 return hhLimit; |
275 } |
275 } |
276 |
276 |
277 quint32 HWMapContainer::getTemplateFilter() const |
277 quint32 HWMapContainer::getTemplateFilter() const |
278 { |
278 { |
279 return CB_TemplateFilter->itemData(CB_TemplateFilter->currentIndex()).toInt(); |
279 return CB_TemplateFilter->itemData(CB_TemplateFilter->currentIndex()).toInt(); |
280 } |
280 } |
281 |
281 |
282 void HWMapContainer::resizeEvent ( QResizeEvent * event ) |
282 void HWMapContainer::resizeEvent ( QResizeEvent * event ) |
283 { |
283 { |
284 //imageButt->setIconSize(imageButt->size()); |
284 //imageButt->setIconSize(imageButt->size()); |
285 } |
285 } |
286 |
286 |
287 void HWMapContainer::setSeed(const QString & seed) |
287 void HWMapContainer::setSeed(const QString & seed) |
288 { |
288 { |
289 m_seed = seed; |
289 m_seed = seed; |
290 changeImage(); |
290 changeImage(); |
291 } |
291 } |
292 |
292 |
293 void HWMapContainer::setMap(const QString & map) |
293 void HWMapContainer::setMap(const QString & map) |
294 { |
294 { |
295 if(map == "+rnd+") |
295 if(map == "+rnd+") |
296 { |
296 { |
297 changeImage(); |
297 changeImage(); |
298 return; |
298 return; |
299 } |
299 } |
300 |
300 |
301 int id = chooseMap->findText(map); |
301 int id = chooseMap->findText(map); |
302 if(id > 0) { |
302 if(id > 0) { |
303 if (pMap) |
303 if (pMap) |
304 { |
304 { |
305 disconnect(pMap, 0, this, SLOT(setImage(const QImage))); |
305 disconnect(pMap, 0, this, SLOT(setImage(const QImage))); |
306 disconnect(pMap, 0, this, SLOT(setHHLimit(int))); |
306 disconnect(pMap, 0, this, SLOT(setHHLimit(int))); |
307 pMap = 0; |
307 pMap = 0; |
308 } |
308 } |
309 chooseMap->setCurrentIndex(id); |
309 chooseMap->setCurrentIndex(id); |
310 loadMap(id); |
310 loadMap(id); |
311 } |
311 } |
312 } |
312 } |
313 |
313 |
314 void HWMapContainer::setTheme(const QString & theme) |
314 void HWMapContainer::setTheme(const QString & theme) |
315 { |
315 { |
316 QList<QListWidgetItem *> items = lwThemes->findItems(theme, Qt::MatchExactly); |
316 QList<QListWidgetItem *> items = lwThemes->findItems(theme, Qt::MatchExactly); |
317 if(items.size()) |
317 if(items.size()) |
318 lwThemes->setCurrentItem(items.at(0)); |
318 lwThemes->setCurrentItem(items.at(0)); |
319 } |
319 } |
320 |
320 |
321 void HWMapContainer::setRandomSeed() |
321 void HWMapContainer::setRandomSeed() |
322 { |
322 { |
323 m_seed = QUuid::createUuid().toString(); |
323 m_seed = QUuid::createUuid().toString(); |
324 emit seedChanged(m_seed); |
324 emit seedChanged(m_seed); |
325 changeImage(); |
325 changeImage(); |
326 } |
326 } |
327 |
327 |
328 void HWMapContainer::setRandomTheme() |
328 void HWMapContainer::setRandomTheme() |
329 { |
329 { |
330 if(!Themes->size()) return; |
330 if(!Themes->size()) return; |
331 quint32 themeNum = rand() % Themes->size(); |
331 quint32 themeNum = rand() % Themes->size(); |
332 lwThemes->setCurrentRow(themeNum); |
332 lwThemes->setCurrentRow(themeNum); |
333 } |
333 } |
334 |
334 |
335 void HWMapContainer::setTemplateFilter(int filter) |
335 void HWMapContainer::setTemplateFilter(int filter) |
336 { |
336 { |
337 CB_TemplateFilter->setCurrentIndex(filter); |
337 CB_TemplateFilter->setCurrentIndex(filter); |
338 } |
338 } |
339 |
339 |
340 void HWMapContainer::templateFilterChanged(int filter) |
340 void HWMapContainer::templateFilterChanged(int filter) |
341 { |
341 { |
342 emit newTemplateFilter(filter); |
342 emit newTemplateFilter(filter); |
343 changeImage(); |
343 changeImage(); |
344 } |
344 } |
345 |
345 |