1 /*****************************************************************************
2 * PokerTH - The open source texas holdem engine *
3 * Copyright (C) 2006-2012 Felix Hammer, Florian Thauer, Lothar May *
4 * *
5 * This program is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU Affero General Public License as *
7 * published by the Free Software Foundation, either version 3 of the *
8 * License, or (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU Affero General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU Affero General Public License *
16 * along with this program. If not, see <http://www.gnu.org/licenses/>. *
17 * *
18 * *
19 * Additional permission under GNU AGPL version 3 section 7 *
20 * *
21 * If you modify this program, or any covered work, by linking or *
22 * combining it with the OpenSSL project's OpenSSL library (or a *
23 * modified version of that library), containing parts covered by the *
24 * terms of the OpenSSL or SSLeay licenses, the authors of PokerTH *
25 * (Felix Hammer, Florian Thauer, Lothar May) grant you additional *
26 * permission to convey the resulting work. *
27 * Corresponding Source for a non-source form of such a combination *
28 * shall include the source code for the parts of OpenSSL used as well *
29 * as that of the covered work. *
30 *****************************************************************************/
31 #include "gametablestylereader.h"
32 #include <cstdlib>
33
34 using namespace std;
35
GameTableStyleReader(ConfigFile * c,QWidget * w)36 GameTableStyleReader::GameTableStyleReader(ConfigFile *c, QWidget *w)
37 : myConfig(c), myW(w), fallBack(0), loadedSuccessfull(0), myState(GT_STYLE_UNDEFINED)
38 {
39
40 //set fonts and font sizes
41 #ifdef _WIN32
42 font1String = "font-family: \"Arial\";";
43 font2String = "font-family: \"DejaVu Sans\";";
44 cashFontSize = "11";
45 setLabelFontSize = "11";
46 playerNameLabelFontSize = "11";
47 smallBoardFontSize = "13";
48 bigBoardFontSize = "18";
49 humanPlayerButtonFontSize = "14";
50 betValueFontSize = "11";
51 tabBarPaddingTop = "2";
52 tabBarPaddingSide = "10";
53 #elif __APPLE__
54 font1String = "font-family: \"Lucida Grande\";";
55 font2String = "font-family: \"Lucida Grande\";";
56 tabBarPaddingTop = "1";
57 tabBarPaddingSide = "9";
58 textBrowserFontsize= "10";
59 cashFontSize = "10";
60 setLabelFontSize = "10";
61 playerNameLabelFontSize = "11";
62 smallBoardFontSize = "13";
63 bigBoardFontSize = "17";
64 humanPlayerButtonFontSize = "12";
65 betValueFontSize = "10";
66 #elif MAEMO
67 font1String = "font-family: \"Nimbus Sans L\";";
68 font2String = "font-family: \"DejaVu Sans\";";
69 tabBarPaddingTop = "0";
70 tabBarPaddingSide = "9";
71 textBrowserFontsize= "10";
72 cashFontSize = "12";
73 setLabelFontSize = "13";
74 playerNameLabelFontSize = "11";
75 smallBoardFontSize = "13";
76 bigBoardFontSize = "17";
77 humanPlayerButtonFontSize = "12";
78 betValueFontSize = "10";
79 #elif ANDROID
80 font1String = "font-family: \"Nimbus Sans L\";";
81 font2String = "font-family: \"DejaVu Sans\";";
82 tabBarPaddingTop = "0";
83 tabBarPaddingSide = "9";
84 textBrowserFontsize= "10";
85 cashFontSize = "12";
86 setLabelFontSize = "13";
87 playerNameLabelFontSize = "11";
88 smallBoardFontSize = "13";
89 bigBoardFontSize = "17";
90 humanPlayerButtonFontSize = "12";
91 betValueFontSize = "15";
92 #else //Linux
93 font1String = "font-family: \"Nimbus Sans L\";";
94 font2String = "font-family: \"DejaVu Sans\";";
95 tabBarPaddingTop = "0";
96 tabBarPaddingSide = "9";
97 textBrowserFontsize= "10";
98 cashFontSize = "10";
99 setLabelFontSize = "10";
100 playerNameLabelFontSize = "11";
101 smallBoardFontSize = "13";
102 bigBoardFontSize = "17";
103 humanPlayerButtonFontSize = "12";
104 betValueFontSize = "10";
105 #endif
106 }
107
108
~GameTableStyleReader()109 GameTableStyleReader::~GameTableStyleReader()
110 {
111 }
112
readStyleFile(QString file)113 void GameTableStyleReader::readStyleFile(QString file)
114 {
115 #ifdef ANDROID
116 //on Android we currently just use the defaul style packed with the binary via qrc
117 currentFileName = ":/android/android-data/gfx/gui/table/default_800x480/android_tablestyle_800x480.xml";
118 currentDir = ":/android/android-data/gfx/gui/table/default_800x480/";
119 #else
120 //if style file failed --> default style fallback
121 if(QFile(file).exists()) {
122 currentFileName = QFile(file).fileName();
123 } else {
124 currentFileName = QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml").fileName();
125 fallBack = 1;
126 }
127
128 QFileInfo info(currentFileName);
129 currentDir = info.absolutePath()+"/";
130 #endif
131
132 QFile myFile(currentFileName);
133 myFile.open(QIODevice::ReadOnly);
134 fileContent = myFile.readAll();
135
136 //start reading the file and fill vars
137 string tempString1("");
138 TiXmlDocument doc;
139 doc.Parse(fileContent.constData());
140
141 if(doc.RootElement()) {
142 TiXmlHandle docHandle( &doc );
143 TiXmlElement *CardDeckElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).ToElement();
144 if(CardDeckElement) {
145 MyMessageBox::warning(myW, tr("Game Table Style Error"),
146 tr("A card deck style was selected instead of a game table style.\nPlease select a game table style and try again!"),
147 QMessageBox::Ok);
148 } else {
149 //in case of rereading clear old variables:
150 StyleDescription.clear();
151 StyleMaintainerName.clear();
152 StyleMaintainerEMail.clear();
153 StyleCreateDate.clear();
154 PokerTHStyleFileVersion.clear();
155 IfFixedWindowSize.clear();
156 FixedWindowWidth.clear();
157 FixedWindowHeight.clear();
158 MinimumWindowWidth.clear();
159 MinimumWindowHeight.clear();
160 MaximumWindowWidth.clear();
161 MaximumWindowHeight.clear();
162 Preview.clear();
163 ActionAllInI18NPic.clear();
164 ActionRaiseI18NPic.clear();
165 ActionBetI18NPic.clear();
166 ActionCallI18NPic.clear();
167 ActionCheckI18NPic.clear();
168 ActionFoldI18NPic.clear();
169 ActionWinnerI18NPic.clear();
170 BigBlindPuck.clear();
171 SmallBlindPuck.clear();
172 DealerPuck.clear();
173 DefaultAvatar.clear();
174 CardHolderFlop.clear();
175 CardHolderTurn.clear();
176 CardHolderRiver.clear();
177 FoldButtonDefault.clear();
178 FoldButtonHover.clear();
179 FoldButtonChecked.clear();
180 FoldButtonCheckedHover.clear();
181 CheckCallButtonDefault.clear();
182 CheckCallButtonHover.clear();
183 CheckCallButtonChecked.clear();
184 CheckCallButtonCheckedHover.clear();
185 BetRaiseButtonDefault.clear();
186 BetRaiseButtonHover.clear();
187 BetRaiseButtonChecked.clear();
188 BetRaiseButtonCheckedHover.clear();
189 AllInButtonDefault.clear();
190 AllInButtonHover.clear();
191 AllInButtonChecked.clear();
192 AllInButtonCheckedHover.clear();
193 RadioButtonPressed.clear();
194 RadioButtonChecked.clear();
195 RadioButtonCheckedHover.clear();
196 RadioButtonUnchecked.clear();
197 RadioButtonUncheckedHover.clear();
198 PlayerTopSeatInactive.clear();
199 PlayerTopSeatActive.clear();
200 PlayerBottomSeatInactive.clear();
201 PlayerBottomSeatActive.clear();
202 Table.clear();
203 HandRanking.clear();
204 ToolBoxBackground.clear();
205 ShowMyCardsButtonDefault.clear();
206 ShowMyCardsButtonHover.clear();
207 ActionAllInI18NString.clear();
208 ActionRaiseI18NString.clear();
209 ActionBetI18NString.clear();
210 ActionCallI18NString.clear();
211 ActionCheckI18NString.clear();
212 ActionFoldI18NString.clear();
213 PotI18NString.clear();
214 TotalI18NString.clear();
215 BetsI18NString.clear();
216 GameI18NString.clear();
217 HandI18NString.clear();
218 PreflopI18NString.clear();
219 FlopI18NString.clear();
220 TurnI18NString.clear();
221 RiverI18NString.clear();
222 FKeyIndicatorColor.clear();
223 ChanceLabelPossibleColor.clear();
224 ChanceLabelImpossibleColor.clear();
225 ChatTextNickNotifyColor.clear();
226 ChatLogTextColor.clear();
227 ChatLogBgColor.clear();
228 ChatLogScrollBarBorderColor.clear();
229 ChatLogScrollBarBgColor.clear();
230 ChatLogScrollBarHandleBorderColor.clear();
231 ChatLogScrollBarHandleBgColor.clear();
232 ChatLogScrollBarArrowBorderColor.clear();
233 ChatLogScrollBarArrowBgColor.clear();
234 LogWinnerMainPotColor.clear();
235 LogWinnerSidePotColor.clear();
236 LogPlayerSitsOutColor.clear();
237 LogNewGameAdminColor.clear();
238 TabWidgetBorderColor.clear();
239 TabWidgetBgColor.clear();
240 TabWidgetTextColor.clear();
241 MenuBgColor.clear();
242 MenuTextColor.clear();
243 BreakLobbyButtonBgColor.clear();
244 BreakLobbyButtonTextColor.clear();
245 BreakLobbyButtonBgDisabledColor.clear();
246 BreakLobbyButtonTextDisabledColor.clear();
247 BreakLobbyButtonBgBlinkColor.clear();
248 BreakLobbyButtonTextBlinkColor.clear();
249 PlayerCashTextColor.clear();
250 PlayerBetTextColor.clear();
251 PlayerNickTextColor.clear();
252 BoardBigTextColor.clear();
253 BoardSmallTextColor.clear();
254 SpeedTextColor.clear();
255 VoteButtonBgColor.clear();
256 VoteButtonTextColor.clear();
257 BetInputTextColor.clear();
258 BetInputBgColor.clear();
259 BetInputDisabledTextColor.clear();
260 BetInputDisabledBgColor.clear();
261 FoldButtonTextColor.clear();
262 FoldButtonCheckableTextColor.clear();
263 CheckCallButtonTextColor.clear();
264 CheckCallButtonCheckableTextColor.clear();
265 BetRaiseButtonTextColor.clear();
266 BetRaiseButtonCheckableTextColor.clear();
267 AllInButtonTextColor.clear();
268 AllInButtonCheckableTextColor.clear();
269 BetSpeedSliderGrooveBgColor.clear();
270 BetSpeedSliderGrooveBorderColor.clear();
271 BetSpeedSliderHandleBgColor.clear();
272 BetSpeedSliderHandleBorderColor.clear();
273 ShowMyCardsButtonTextColor.clear();
274 RatingStarsColor.clear();
275 PlayerInfoHintTextColor.clear();
276 ChatLogTextSize.clear();
277
278 //now reading!
279 TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement();
280 for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
281 const char *tmpStr1 = itemsList->Attribute("value");
282 if (tmpStr1) {
283 tempString1 = tmpStr1;
284
285 // INFOS
286 if(itemsList->ValueStr() == "StyleDescription") {
287 StyleDescription = QString::fromUtf8(tempString1.c_str());
288 } else if(itemsList->ValueStr() == "StyleMaintainerName") {
289 StyleMaintainerName = QString::fromUtf8(tempString1.c_str());
290 } else if(itemsList->ValueStr() == "StyleMaintainerEMail") {
291 StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str());
292 } else if(itemsList->ValueStr() == "StyleCreateDate") {
293 StyleCreateDate = QString::fromUtf8(tempString1.c_str());
294 } else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") {
295 PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str());
296 }
297 // WINDOWS SETTINGS
298 else if (itemsList->ValueStr() == "IfFixedWindowSize") {
299 IfFixedWindowSize = QString::fromUtf8(tempString1.c_str());
300 } else if (itemsList->ValueStr() == "FixedWindowWidth") {
301 FixedWindowWidth = QString::fromUtf8(tempString1.c_str());
302 } else if (itemsList->ValueStr() == "FixedWindowHeight") {
303 FixedWindowHeight = QString::fromUtf8(tempString1.c_str());
304 } else if (itemsList->ValueStr() == "MinimumWindowWidth") {
305 MinimumWindowWidth = QString::fromUtf8(tempString1.c_str());
306 } else if (itemsList->ValueStr() == "MinimumWindowHeight") {
307 MinimumWindowHeight = QString::fromUtf8(tempString1.c_str());
308 } else if (itemsList->ValueStr() == "MaximumWindowWidth") {
309 MaximumWindowWidth = QString::fromUtf8(tempString1.c_str());
310 } else if (itemsList->ValueStr() == "MaximumWindowHeight") {
311 MaximumWindowHeight = QString::fromUtf8(tempString1.c_str());
312 }
313 // PICS
314 else if (itemsList->ValueStr() == "Preview") {
315 Preview = currentDir+QString::fromUtf8(tempString1.c_str());
316 } else if (itemsList->ValueStr() == "ActionAllInI18NPic") {
317 ActionAllInI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
318 } else if (itemsList->ValueStr() == "ActionRaiseI18NPic") {
319 ActionRaiseI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
320 } else if (itemsList->ValueStr() == "ActionBetI18NPic") {
321 ActionBetI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
322 } else if (itemsList->ValueStr() == "ActionCallI18NPic") {
323 ActionCallI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
324 } else if (itemsList->ValueStr() == "ActionCheckI18NPic") {
325 ActionCheckI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
326 } else if (itemsList->ValueStr() == "ActionFoldI18NPic") {
327 ActionFoldI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
328 } else if (itemsList->ValueStr() == "ActionWinnerI18NPic") {
329 ActionWinnerI18NPic = currentDir+QString::fromUtf8(tempString1.c_str());
330 } else if (itemsList->ValueStr() == "BigBlindPuck") {
331 BigBlindPuck = currentDir+QString::fromUtf8(tempString1.c_str());
332 } else if (itemsList->ValueStr() == "SmallBlindPuck") {
333 SmallBlindPuck = currentDir+QString::fromUtf8(tempString1.c_str());
334 } else if (itemsList->ValueStr() == "DealerPuck") {
335 DealerPuck = currentDir+QString::fromUtf8(tempString1.c_str());
336 } else if (itemsList->ValueStr() == "DefaultAvatar") {
337 DefaultAvatar = currentDir+QString::fromUtf8(tempString1.c_str());
338 } else if (itemsList->ValueStr() == "CardHolderFlop") {
339 CardHolderFlop = currentDir+QString::fromUtf8(tempString1.c_str());
340 } else if (itemsList->ValueStr() == "CardHolderTurn") {
341 CardHolderTurn = currentDir+QString::fromUtf8(tempString1.c_str());
342 } else if (itemsList->ValueStr() == "CardHolderRiver") {
343 CardHolderRiver = currentDir+QString::fromUtf8(tempString1.c_str());
344 } else if (itemsList->ValueStr() == "FoldButtonDefault") {
345 FoldButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str());
346 } else if (itemsList->ValueStr() == "FoldButtonHover") {
347 FoldButtonHover = currentDir+QString::fromUtf8(tempString1.c_str());
348 } else if (itemsList->ValueStr() == "FoldButtonChecked") {
349 FoldButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str());
350 } else if (itemsList->ValueStr() == "FoldButtonCheckedHover") {
351 FoldButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str());
352 } else if (itemsList->ValueStr() == "CheckCallButtonDefault") {
353 CheckCallButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str());
354 } else if (itemsList->ValueStr() == "CheckCallButtonHover") {
355 CheckCallButtonHover = currentDir+QString::fromUtf8(tempString1.c_str());
356 } else if (itemsList->ValueStr() == "CheckCallButtonChecked") {
357 CheckCallButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str());
358 } else if (itemsList->ValueStr() == "CheckCallButtonCheckedHover") {
359 CheckCallButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str());
360 } else if (itemsList->ValueStr() == "BetRaiseButtonDefault") {
361 BetRaiseButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str());
362 } else if (itemsList->ValueStr() == "BetRaiseButtonHover") {
363 BetRaiseButtonHover = currentDir+QString::fromUtf8(tempString1.c_str());
364 } else if (itemsList->ValueStr() == "BetRaiseButtonChecked") {
365 BetRaiseButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str());
366 } else if (itemsList->ValueStr() == "BetRaiseButtonCheckedHover") {
367 BetRaiseButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str());
368 } else if (itemsList->ValueStr() == "AllInButtonDefault") {
369 AllInButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str());
370 } else if (itemsList->ValueStr() == "AllInButtonHover") {
371 AllInButtonHover = currentDir+QString::fromUtf8(tempString1.c_str());
372 } else if (itemsList->ValueStr() == "AllInButtonChecked") {
373 AllInButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str());
374 } else if (itemsList->ValueStr() == "AllInButtonCheckedHover") {
375 AllInButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str());
376 } else if (itemsList->ValueStr() == "RadioButtonPressed") {
377 RadioButtonPressed = currentDir+QString::fromUtf8(tempString1.c_str());
378 } else if (itemsList->ValueStr() == "RadioButtonChecked") {
379 RadioButtonChecked = currentDir+QString::fromUtf8(tempString1.c_str());
380 } else if (itemsList->ValueStr() == "RadioButtonCheckedHover") {
381 RadioButtonCheckedHover = currentDir+QString::fromUtf8(tempString1.c_str());
382 } else if (itemsList->ValueStr() == "RadioButtonUnchecked") {
383 RadioButtonUnchecked = currentDir+QString::fromUtf8(tempString1.c_str());
384 } else if (itemsList->ValueStr() == "RadioButtonUncheckedHover") {
385 RadioButtonUncheckedHover = currentDir+QString::fromUtf8(tempString1.c_str());
386 } else if (itemsList->ValueStr() == "PlayerTopSeatInactive") {
387 PlayerTopSeatInactive = currentDir+QString::fromUtf8(tempString1.c_str());
388 } else if (itemsList->ValueStr() == "PlayerTopSeatActive") {
389 PlayerTopSeatActive = currentDir+QString::fromUtf8(tempString1.c_str());
390 } else if (itemsList->ValueStr() == "PlayerBottomSeatInactive") {
391 PlayerBottomSeatInactive = currentDir+QString::fromUtf8(tempString1.c_str());
392 } else if (itemsList->ValueStr() == "PlayerBottomSeatActive") {
393 PlayerBottomSeatActive = currentDir+QString::fromUtf8(tempString1.c_str());
394 } else if (itemsList->ValueStr() == "Table") {
395 Table = currentDir+QString::fromUtf8(tempString1.c_str());
396 } else if (itemsList->ValueStr() == "HandRanking") {
397 HandRanking = currentDir+QString::fromUtf8(tempString1.c_str());
398 } else if (itemsList->ValueStr() == "ToolBoxBackground") {
399 ToolBoxBackground = currentDir+QString::fromUtf8(tempString1.c_str());
400 } else if (itemsList->ValueStr() == "ShowMyCardsButtonDefault") {
401 ShowMyCardsButtonDefault = currentDir+QString::fromUtf8(tempString1.c_str());
402 } else if (itemsList->ValueStr() == "ShowMyCardsButtonHover") {
403 ShowMyCardsButtonHover = currentDir+QString::fromUtf8(tempString1.c_str());
404 }
405
406 //I18N ACTION STRINGS
407 else if (itemsList->ValueStr() == "ActionAllInI18NString") {
408 ActionAllInI18NString = QString::fromUtf8(tempString1.c_str());
409 } else if (itemsList->ValueStr() == "ActionRaiseI18NString") {
410 ActionRaiseI18NString = QString::fromUtf8(tempString1.c_str());
411 } else if (itemsList->ValueStr() == "ActionBetI18NString") {
412 ActionBetI18NString = QString::fromUtf8(tempString1.c_str());
413 } else if (itemsList->ValueStr() == "ActionCallI18NString") {
414 ActionCallI18NString = QString::fromUtf8(tempString1.c_str());
415 } else if (itemsList->ValueStr() == "ActionCheckI18NString") {
416 ActionCheckI18NString = QString::fromUtf8(tempString1.c_str());
417 } else if (itemsList->ValueStr() == "ActionFoldI18NString") {
418 ActionFoldI18NString = QString::fromUtf8(tempString1.c_str());
419 } else if (itemsList->ValueStr() == "PotI18NString") {
420 PotI18NString = QString::fromUtf8(tempString1.c_str());
421 } else if (itemsList->ValueStr() == "TotalI18NString") {
422 TotalI18NString = QString::fromUtf8(tempString1.c_str());
423 } else if (itemsList->ValueStr() == "BetsI18NString") {
424 BetsI18NString = QString::fromUtf8(tempString1.c_str());
425 } else if (itemsList->ValueStr() == "GameI18NString") {
426 GameI18NString = QString::fromUtf8(tempString1.c_str());
427 } else if (itemsList->ValueStr() == "HandI18NString") {
428 HandI18NString = QString::fromUtf8(tempString1.c_str());
429 } else if (itemsList->ValueStr() == "PreflopI18NString") {
430 PreflopI18NString = QString::fromUtf8(tempString1.c_str());
431 } else if (itemsList->ValueStr() == "FlopI18NString") {
432 FlopI18NString = QString::fromUtf8(tempString1.c_str());
433 } else if (itemsList->ValueStr() == "TurnI18NString") {
434 TurnI18NString = QString::fromUtf8(tempString1.c_str());
435 } else if (itemsList->ValueStr() == "RiverI18NString") {
436 RiverI18NString = QString::fromUtf8(tempString1.c_str());
437 }
438
439 // COLORS
440 if (itemsList->ValueStr() == "FKeyIndicatorColor") {
441 FKeyIndicatorColor = QString::fromUtf8(tempString1.c_str());
442 } else if (itemsList->ValueStr() == "ChanceLabelPossibleColor") {
443 ChanceLabelPossibleColor = QString::fromUtf8(tempString1.c_str());
444 } else if (itemsList->ValueStr() == "ChanceLabelImpossibleColor") {
445 ChanceLabelImpossibleColor = QString::fromUtf8(tempString1.c_str());
446 } else if (itemsList->ValueStr() == "ChatTextNickNotifyColor") {
447 ChatTextNickNotifyColor = QString::fromUtf8(tempString1.c_str());
448 } else if (itemsList->ValueStr() == "ChatLogTextColor") {
449 ChatLogTextColor = QString::fromUtf8(tempString1.c_str());
450 } else if (itemsList->ValueStr() == "ChatLogBgColor") {
451 ChatLogBgColor = QString::fromUtf8(tempString1.c_str());
452 } else if (itemsList->ValueStr() == "ChatLogScrollBarBorderColor") {
453 ChatLogScrollBarBorderColor = QString::fromUtf8(tempString1.c_str());
454 } else if (itemsList->ValueStr() == "ChatLogScrollBarBgColor") {
455 ChatLogScrollBarBgColor = QString::fromUtf8(tempString1.c_str());
456 } else if (itemsList->ValueStr() == "ChatLogScrollBarHandleBorderColor") {
457 ChatLogScrollBarHandleBorderColor = QString::fromUtf8(tempString1.c_str());
458 } else if (itemsList->ValueStr() == "ChatLogScrollBarHandleBgColor") {
459 ChatLogScrollBarHandleBgColor = QString::fromUtf8(tempString1.c_str());
460 } else if (itemsList->ValueStr() == "ChatLogScrollBarArrowBorderColor") {
461 ChatLogScrollBarArrowBorderColor = QString::fromUtf8(tempString1.c_str());
462 } else if (itemsList->ValueStr() == "ChatLogScrollBarArrowBgColor") {
463 ChatLogScrollBarArrowBgColor = QString::fromUtf8(tempString1.c_str());
464 } else if (itemsList->ValueStr() == "LogWinnerMainPotColor") {
465 LogWinnerMainPotColor = QString::fromUtf8(tempString1.c_str());
466 } else if (itemsList->ValueStr() == "LogWinnerSidePotColor") {
467 LogWinnerSidePotColor = QString::fromUtf8(tempString1.c_str());
468 } else if (itemsList->ValueStr() == "LogPlayerSitsOutColor") {
469 LogPlayerSitsOutColor = QString::fromUtf8(tempString1.c_str());
470 } else if (itemsList->ValueStr() == "LogNewGameAdminColor") {
471 LogNewGameAdminColor = QString::fromUtf8(tempString1.c_str());
472 } else if (itemsList->ValueStr() == "TabWidgetBorderColor") {
473 TabWidgetBorderColor = QString::fromUtf8(tempString1.c_str());
474 } else if (itemsList->ValueStr() == "TabWidgetBgColor") {
475 TabWidgetBgColor = QString::fromUtf8(tempString1.c_str());
476 } else if (itemsList->ValueStr() == "TabWidgetTextColor") {
477 TabWidgetTextColor = QString::fromUtf8(tempString1.c_str());
478 } else if (itemsList->ValueStr() == "MenuBgColor") {
479 MenuBgColor = QString::fromUtf8(tempString1.c_str());
480 } else if (itemsList->ValueStr() == "MenuTextColor") {
481 MenuTextColor = QString::fromUtf8(tempString1.c_str());
482 } else if (itemsList->ValueStr() == "BreakLobbyButtonBgColor") {
483 BreakLobbyButtonBgColor = QString::fromUtf8(tempString1.c_str());
484 } else if (itemsList->ValueStr() == "BreakLobbyButtonTextColor") {
485 BreakLobbyButtonTextColor = QString::fromUtf8(tempString1.c_str());
486 } else if (itemsList->ValueStr() == "BreakLobbyButtonBgDisabledColor") {
487 BreakLobbyButtonBgDisabledColor = QString::fromUtf8(tempString1.c_str());
488 } else if (itemsList->ValueStr() == "BreakLobbyButtonTextDisabledColor") {
489 BreakLobbyButtonTextDisabledColor = QString::fromUtf8(tempString1.c_str());
490 } else if (itemsList->ValueStr() == "BreakLobbyButtonBgBlinkColor") {
491 BreakLobbyButtonBgBlinkColor = QString::fromUtf8(tempString1.c_str());
492 } else if (itemsList->ValueStr() == "BreakLobbyButtonTextBlinkColor") {
493 BreakLobbyButtonTextBlinkColor = QString::fromUtf8(tempString1.c_str());
494 } else if (itemsList->ValueStr() == "PlayerCashTextColor") {
495 PlayerCashTextColor = QString::fromUtf8(tempString1.c_str());
496 } else if (itemsList->ValueStr() == "PlayerBetTextColor") {
497 PlayerBetTextColor = QString::fromUtf8(tempString1.c_str());
498 } else if (itemsList->ValueStr() == "PlayerNickTextColor") {
499 PlayerNickTextColor = QString::fromUtf8(tempString1.c_str());
500 } else if (itemsList->ValueStr() == "BoardBigTextColor") {
501 BoardBigTextColor = QString::fromUtf8(tempString1.c_str());
502 } else if (itemsList->ValueStr() == "BoardSmallTextColor") {
503 BoardSmallTextColor = QString::fromUtf8(tempString1.c_str());
504 } else if (itemsList->ValueStr() == "SpeedTextColor") {
505 SpeedTextColor = QString::fromUtf8(tempString1.c_str());
506 } else if (itemsList->ValueStr() == "VoteButtonBgColor") {
507 VoteButtonBgColor = QString::fromUtf8(tempString1.c_str());
508 } else if (itemsList->ValueStr() == "VoteButtonTextColor") {
509 VoteButtonTextColor = QString::fromUtf8(tempString1.c_str());
510 } else if (itemsList->ValueStr() == "BetInputTextColor") {
511 BetInputTextColor = QString::fromUtf8(tempString1.c_str());
512 } else if (itemsList->ValueStr() == "BetInputBgColor") {
513 BetInputBgColor = QString::fromUtf8(tempString1.c_str());
514 } else if (itemsList->ValueStr() == "BetInputDisabledTextColor") {
515 BetInputDisabledTextColor = QString::fromUtf8(tempString1.c_str());
516 } else if (itemsList->ValueStr() == "BetInputDisabledBgColor") {
517 BetInputDisabledBgColor = QString::fromUtf8(tempString1.c_str());
518 } else if (itemsList->ValueStr() == "FoldButtonTextColor") {
519 FoldButtonTextColor = QString::fromUtf8(tempString1.c_str());
520 } else if (itemsList->ValueStr() == "FoldButtonCheckableTextColor") {
521 FoldButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str());
522 } else if (itemsList->ValueStr() == "CheckCallButtonTextColor") {
523 CheckCallButtonTextColor = QString::fromUtf8(tempString1.c_str());
524 } else if (itemsList->ValueStr() == "CheckCallButtonCheckableTextColor") {
525 CheckCallButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str());
526 } else if (itemsList->ValueStr() == "BetRaiseButtonTextColor") {
527 BetRaiseButtonTextColor = QString::fromUtf8(tempString1.c_str());
528 } else if (itemsList->ValueStr() == "BetRaiseButtonCheckableTextColor") {
529 BetRaiseButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str());
530 } else if (itemsList->ValueStr() == "AllInButtonTextColor") {
531 AllInButtonTextColor = QString::fromUtf8(tempString1.c_str());
532 } else if (itemsList->ValueStr() == "AllInButtonCheckableTextColor") {
533 AllInButtonCheckableTextColor = QString::fromUtf8(tempString1.c_str());
534 } else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBgColor") {
535 BetSpeedSliderGrooveBgColor = QString::fromUtf8(tempString1.c_str());
536 } else if (itemsList->ValueStr() == "BetSpeedSliderGrooveBorderColor") {
537 BetSpeedSliderGrooveBorderColor = QString::fromUtf8(tempString1.c_str());
538 } else if (itemsList->ValueStr() == "BetSpeedSliderHandleBgColor") {
539 BetSpeedSliderHandleBgColor = QString::fromUtf8(tempString1.c_str());
540 } else if (itemsList->ValueStr() == "BetSpeedSliderHandleBorderColor") {
541 BetSpeedSliderHandleBorderColor = QString::fromUtf8(tempString1.c_str());
542 } else if (itemsList->ValueStr() == "ShowMyCardsButtonTextColor") {
543 ShowMyCardsButtonTextColor = QString::fromUtf8(tempString1.c_str());
544 } else if (itemsList->ValueStr() == "RatingStarsColor") {
545 RatingStarsColor = QString::fromUtf8(tempString1.c_str());
546 } else if (itemsList->ValueStr() == "PlayerInfoHintTextColor") {
547 PlayerInfoHintTextColor = QString::fromUtf8(tempString1.c_str());
548 }
549 // SIZES
550 else if (itemsList->ValueStr() == "ChatLogTextSize") {
551 ChatLogTextSize = QString::fromUtf8(tempString1.c_str());
552 }
553 }
554 }
555
556 //check if style items are left and if pictures where not found
557 leftItems.clear();
558 itemPicsLeft.clear();
559
560 // INFOS
561 if(StyleDescription == "") {
562 leftItems << "StyleDescription";
563 }
564 if(StyleMaintainerName == "") {
565 leftItems << "StyleMaintainerName";
566 }
567 if(StyleMaintainerEMail == "") {
568 leftItems << "StyleMaintainerEMail";
569 }
570 if(StyleCreateDate == "") {
571 leftItems << "StyleCreateDate";
572 }
573 if(PokerTHStyleFileVersion == "") {
574 leftItems << "PokerTHStyleFileVersion";
575 }
576 // WINDOWS SETTINGS
577 if(IfFixedWindowSize == "") {
578 IfFixedWindowSize = getFallBackFieldContent("IfFixedWindowSize", 0);
579 leftItems << "IfFixedWindowSize";
580 }
581 if(FixedWindowWidth == "") {
582 FixedWindowWidth = getFallBackFieldContent("FixedWindowWidth", 0);
583 leftItems << "FixedWindowWidth";
584 }
585 if(FixedWindowHeight == "") {
586 FixedWindowHeight = getFallBackFieldContent("FixedWindowHeight", 0);
587 leftItems << "FixedWindowHeight";
588 }
589 if(MinimumWindowWidth == "") {
590 MinimumWindowWidth = getFallBackFieldContent("MinimumWindowWidth", 0);
591 leftItems << "MinimumWindowWidth";
592 }
593 if(MinimumWindowHeight == "") {
594 MinimumWindowHeight = getFallBackFieldContent("MinimumWindowHeight", 0);
595 leftItems << "MinimumWindowHeight";
596 }
597 if(MaximumWindowWidth == "") {
598 MaximumWindowWidth = getFallBackFieldContent("MaximumWindowWidth", 0);
599 leftItems << "MaximumWindowWidth";
600 }
601 if(MaximumWindowHeight == "") {
602 MaximumWindowHeight = getFallBackFieldContent("MaximumWindowHeight", 0);
603 leftItems << "MaximumWindowHeight";
604 }
605 // P I C S
606
607 // I18N Pics
608 if(ActionAllInI18NPic == "") {
609 ActionAllInI18NPic = getFallBackFieldContent("ActionAllInI18NPic", 1);
610 leftItems << "ActionAllInI18NPic";
611 } else if(ActionAllInI18NPic != QString(currentDir+"NULL") && !QFile(ActionAllInI18NPic).exists()) {
612 itemPicsLeft << "ActionAllInI18NPic = "+ActionAllInI18NPic;
613 ActionAllInI18NPic = getFallBackFieldContent("ActionAllInI18NPic", 1);
614 }
615
616 if(ActionRaiseI18NPic == "") {
617 ActionRaiseI18NPic = getFallBackFieldContent("ActionRaiseI18NPic", 1);
618 leftItems << "ActionRaiseI18NPic";
619 } else if(ActionRaiseI18NPic != QString(currentDir+"NULL") && !QFile(ActionRaiseI18NPic).exists()) {
620 itemPicsLeft << "ActionRaiseI18NPic = "+ActionRaiseI18NPic;
621 ActionRaiseI18NPic = getFallBackFieldContent("ActionRaiseI18NPic", 1);
622 }
623
624 if(ActionBetI18NPic == "") {
625 ActionBetI18NPic = getFallBackFieldContent("ActionBetI18NPic", 1);
626 leftItems << "ActionBetI18NPic";
627 } else if(ActionBetI18NPic != QString(currentDir+"NULL") && !QFile(ActionBetI18NPic).exists()) {
628 itemPicsLeft << "ActionBetI18NPic = "+ActionBetI18NPic;
629 ActionBetI18NPic = getFallBackFieldContent("ActionBetI18NPic", 1);
630 }
631
632 if(ActionCallI18NPic == "") {
633 ActionCallI18NPic = getFallBackFieldContent("ActionCallI18NPic", 1);
634 leftItems << "ActionCallI18NPic";
635 } else if(ActionCallI18NPic != QString(currentDir+"NULL") && !QFile(ActionCallI18NPic).exists()) {
636 itemPicsLeft << "ActionCallI18NPic = "+ActionCallI18NPic;
637 ActionCallI18NPic = getFallBackFieldContent("ActionCallI18NPic", 1);
638 }
639
640 if(ActionCheckI18NPic == "") {
641 ActionCheckI18NPic = getFallBackFieldContent("ActionCheckI18NPic", 1);
642 leftItems << "ActionCheckI18NPic";
643 } else if(ActionCheckI18NPic != QString(currentDir+"NULL") && !QFile(ActionCheckI18NPic).exists()) {
644 itemPicsLeft << "ActionCheckI18NPic = "+ActionCheckI18NPic;
645 ActionCheckI18NPic = getFallBackFieldContent("ActionCheckI18NPic", 1);
646 }
647
648 if(ActionFoldI18NPic == "") {
649 ActionFoldI18NPic = getFallBackFieldContent("ActionFoldI18NPic", 1);
650 leftItems << "ActionFoldI18NPic";
651 } else if(ActionFoldI18NPic != QString(currentDir+"NULL") && !QFile(ActionFoldI18NPic).exists()) {
652 itemPicsLeft << "ActionFoldI18NPic = "+ActionFoldI18NPic;
653 ActionFoldI18NPic = getFallBackFieldContent("ActionFoldI18NPic", 1);
654 }
655
656 if(ActionWinnerI18NPic == "") {
657 ActionWinnerI18NPic = getFallBackFieldContent(" ActionWinnerI18NPic", 1);
658 leftItems << "ActionWinnerI18NPic";
659 } else if(ActionWinnerI18NPic != QString(currentDir+"NULL") && !QFile(ActionWinnerI18NPic).exists()) {
660 itemPicsLeft << "ActionWinnerI18NPic = "+ActionWinnerI18NPic;
661 ActionWinnerI18NPic = getFallBackFieldContent(" ActionWinnerI18NPic", 1);
662 }
663
664 // Other Pics
665 if(BigBlindPuck == "") {
666 BigBlindPuck = getFallBackFieldContent("BigBlindPuck", 1);
667 leftItems << "BigBlindPuck";
668 } else if(BigBlindPuck != QString(currentDir+"NULL") && !QFile(BigBlindPuck).exists()) {
669 itemPicsLeft << "BigBlindPuck = "+BigBlindPuck;
670 BigBlindPuck = getFallBackFieldContent("BigBlindPuck", 1);
671 }
672
673 if(SmallBlindPuck == "") {
674 SmallBlindPuck = getFallBackFieldContent("SmallBlindPuck", 1);
675 leftItems << "SmallBlindPuck";
676 } else if(SmallBlindPuck != QString(currentDir+"NULL") && !QFile(SmallBlindPuck).exists()) {
677 itemPicsLeft << "SmallBlindPuck = "+SmallBlindPuck;
678 SmallBlindPuck = getFallBackFieldContent("SmallBlindPuck", 1);
679 }
680
681 if(DealerPuck == "") {
682 DealerPuck = getFallBackFieldContent("DealerPuck", 1);
683 leftItems << "DealerPuck";
684 } else if(DealerPuck != QString(currentDir+"NULL") && !QFile(DealerPuck).exists()) {
685 itemPicsLeft << "DealerPuck = "+DealerPuck;
686 DealerPuck = getFallBackFieldContent("DealerPuck", 1);
687 }
688
689 if(DefaultAvatar == "") {
690 DefaultAvatar = getFallBackFieldContent("DefaultAvatar", 1);
691 leftItems << "DefaultAvatar";
692 } else if(DefaultAvatar != QString(currentDir+"NULL") && !QFile(DefaultAvatar).exists()) {
693 itemPicsLeft << "DefaultAvatar = "+DefaultAvatar;
694 DefaultAvatar = getFallBackFieldContent("DefaultAvatar", 1);
695 }
696
697 if(CardHolderFlop == "") {
698 CardHolderFlop = getFallBackFieldContent("CardHolderFlop", 1);
699 leftItems << "CardHolderFlop";
700 } else if(CardHolderFlop != QString(currentDir+"NULL") && !QFile(CardHolderFlop).exists()) {
701 itemPicsLeft << "CardHolderFlop = "+CardHolderFlop;
702 CardHolderFlop = getFallBackFieldContent("CardHolderFlop", 1);
703 }
704
705 if(CardHolderTurn == "") {
706 CardHolderTurn = getFallBackFieldContent("CardHolderTurn", 1);
707 leftItems << "CardHolderTurn";
708 } else if(CardHolderTurn != QString(currentDir+"NULL") && !QFile(CardHolderTurn).exists()) {
709 itemPicsLeft << "CardHolderTurn = "+CardHolderTurn;
710 CardHolderTurn = getFallBackFieldContent("CardHolderTurn", 1);
711 }
712
713 if(CardHolderRiver == "") {
714 CardHolderRiver = getFallBackFieldContent("CardHolderRiver", 1);
715 leftItems << "CardHolderRiver";
716 } else if(CardHolderRiver != QString(currentDir+"NULL") && !QFile(CardHolderRiver).exists()) {
717 itemPicsLeft << "CardHolderRiver = "+CardHolderRiver;
718 CardHolderRiver = getFallBackFieldContent("CardHolderRiver", 1);
719 }
720
721 if(FoldButtonDefault == "") {
722 FoldButtonDefault = getFallBackFieldContent("FoldButtonDefault", 1);
723 leftItems << "FoldButtonDefault";
724 } else if(FoldButtonDefault != QString(currentDir+"NULL") && !QFile(FoldButtonDefault).exists()) {
725 itemPicsLeft << "FoldButtonDefault = "+FoldButtonDefault;
726 FoldButtonDefault = getFallBackFieldContent("FoldButtonDefault", 1);
727 }
728
729 if(FoldButtonHover == "") {
730 FoldButtonHover = getFallBackFieldContent("FoldButtonHover", 1);
731 leftItems << "FoldButtonHover";
732 } else if(FoldButtonHover != QString(currentDir+"NULL") && !QFile(FoldButtonHover).exists()) {
733 itemPicsLeft << "FoldButtonHover = "+FoldButtonHover;
734 FoldButtonHover = getFallBackFieldContent("FoldButtonHover", 1);
735 }
736
737 if(FoldButtonChecked == "") {
738 FoldButtonChecked = getFallBackFieldContent("FoldButtonChecked", 1);
739 leftItems << "FoldButtonChecked";
740 } else if(FoldButtonChecked != QString(currentDir+"NULL") && !QFile(FoldButtonChecked).exists()) {
741 itemPicsLeft << "FoldButtonChecked = "+FoldButtonChecked;
742 FoldButtonChecked = getFallBackFieldContent("FoldButtonChecked", 1);
743 }
744
745 if(FoldButtonCheckedHover == "") {
746 FoldButtonCheckedHover = getFallBackFieldContent("FoldButtonCheckedHover", 1);
747 leftItems << "FoldButtonCheckedHover";
748 } else if(FoldButtonCheckedHover != QString(currentDir+"NULL") && !QFile(FoldButtonCheckedHover).exists()) {
749 itemPicsLeft << "FoldButtonCheckedHover = "+FoldButtonCheckedHover;
750 FoldButtonCheckedHover = getFallBackFieldContent("FoldButtonCheckedHover", 1);
751 }
752
753 if(CheckCallButtonDefault == "") {
754 CheckCallButtonDefault = getFallBackFieldContent("CheckCallButtonDefault", 1);
755 leftItems << "CheckCallButtonDefault";
756 } else if(CheckCallButtonDefault != QString(currentDir+"NULL") && !QFile(CheckCallButtonDefault).exists()) {
757 itemPicsLeft << "CheckCallButtonDefault = "+CheckCallButtonDefault;
758 CheckCallButtonDefault = getFallBackFieldContent("CheckCallButtonDefault", 1);
759 }
760
761 if(CheckCallButtonHover == "") {
762 CheckCallButtonHover = getFallBackFieldContent("CheckCallButtonHover", 1);
763 leftItems << "CheckCallButtonHover";
764 } else if(CheckCallButtonHover != QString(currentDir+"NULL") && !QFile(CheckCallButtonHover).exists()) {
765 itemPicsLeft << "CheckCallButtonHover = "+CheckCallButtonHover;
766 CheckCallButtonHover = getFallBackFieldContent("CheckCallButtonHover", 1);
767 }
768
769 if(CheckCallButtonChecked == "") {
770 CheckCallButtonChecked = getFallBackFieldContent("CheckCallButtonChecked", 1);
771 leftItems << "CheckCallButtonChecked";
772 } else if(CheckCallButtonChecked != QString(currentDir+"NULL") && !QFile(CheckCallButtonChecked).exists()) {
773 itemPicsLeft << "CheckCallButtonChecked = "+CheckCallButtonChecked;
774 CheckCallButtonChecked = getFallBackFieldContent("CheckCallButtonChecked", 1);
775 }
776
777 if(CheckCallButtonCheckedHover == "") {
778 CheckCallButtonCheckedHover = getFallBackFieldContent("CheckCallButtonCheckedHover", 1);
779 leftItems << "CheckCallButtonCheckedHover";
780 } else if(CheckCallButtonCheckedHover != QString(currentDir+"NULL") && !QFile(CheckCallButtonCheckedHover).exists()) {
781 itemPicsLeft << "CheckCallButtonCheckedHover = "+CheckCallButtonCheckedHover;
782 CheckCallButtonCheckedHover = getFallBackFieldContent("CheckCallButtonCheckedHover", 1);
783 }
784
785 if(BetRaiseButtonDefault == "") {
786 BetRaiseButtonDefault = getFallBackFieldContent("BetRaiseButtonDefault", 1);
787 leftItems << "BetRaiseButtonDefault";
788 } else if(BetRaiseButtonDefault != QString(currentDir+"NULL") && !QFile(BetRaiseButtonDefault).exists()) {
789 itemPicsLeft << "BetRaiseButtonDefault = "+BetRaiseButtonDefault;
790 BetRaiseButtonDefault = getFallBackFieldContent("BetRaiseButtonDefault", 1);
791 }
792
793 if(BetRaiseButtonHover == "") {
794 BetRaiseButtonHover = getFallBackFieldContent("BetRaiseButtonHover", 1);
795 leftItems << "BetRaiseButtonHover";
796 } else if(BetRaiseButtonHover != QString(currentDir+"NULL") && !QFile(BetRaiseButtonHover).exists()) {
797 itemPicsLeft << "BetRaiseButtonHover = "+BetRaiseButtonHover;
798 BetRaiseButtonHover = getFallBackFieldContent("BetRaiseButtonHover", 1);
799 }
800
801 if(BetRaiseButtonChecked == "") {
802 BetRaiseButtonChecked = getFallBackFieldContent("BetRaiseButtonChecked", 1);
803 leftItems << "BetRaiseButtonChecked";
804 } else if(BetRaiseButtonChecked != QString(currentDir+"NULL") && !QFile(BetRaiseButtonChecked).exists()) {
805 itemPicsLeft << "BetRaiseButtonChecked = "+BetRaiseButtonChecked;
806 BetRaiseButtonChecked = getFallBackFieldContent("BetRaiseButtonChecked", 1);
807 }
808
809 if(BetRaiseButtonCheckedHover == "") {
810 BetRaiseButtonCheckedHover = getFallBackFieldContent("BetRaiseButtonCheckedHover", 1);
811 leftItems << "BetRaiseButtonCheckedHover";
812 } else if(BetRaiseButtonCheckedHover != QString(currentDir+"NULL") && !QFile(BetRaiseButtonCheckedHover).exists()) {
813 itemPicsLeft << "BetRaiseButtonCheckedHover = "+BetRaiseButtonCheckedHover;
814 BetRaiseButtonCheckedHover = getFallBackFieldContent("BetRaiseButtonCheckedHover", 1);
815 }
816
817 if(AllInButtonDefault == "") {
818 AllInButtonDefault = getFallBackFieldContent("AllInButtonDefault", 1);
819 leftItems << "AllInButtonDefault";
820 } else if(AllInButtonDefault != QString(currentDir+"NULL") && !QFile(AllInButtonDefault).exists()) {
821 itemPicsLeft << "AllInButtonDefault = "+AllInButtonDefault;
822 AllInButtonDefault = getFallBackFieldContent("AllInButtonDefault", 1);
823 }
824
825 if(AllInButtonHover == "") {
826 AllInButtonHover = getFallBackFieldContent("AllInButtonHover", 1);
827 leftItems << "AllInButtonHover";
828 } else if(AllInButtonHover != QString(currentDir+"NULL") && !QFile(AllInButtonHover).exists()) {
829 itemPicsLeft << "AllInButtonHover = "+AllInButtonHover;
830 AllInButtonHover = getFallBackFieldContent("AllInButtonHover", 1);
831 }
832
833 if(AllInButtonChecked == "") {
834 AllInButtonChecked = getFallBackFieldContent("AllInButtonChecked", 1);
835 leftItems << "AllInButtonChecked";
836 } else if(AllInButtonChecked != QString(currentDir+"NULL") && !QFile(AllInButtonChecked).exists()) {
837 itemPicsLeft << "AllInButtonChecked = "+AllInButtonChecked;
838 AllInButtonChecked = getFallBackFieldContent("AllInButtonChecked", 1);
839 }
840
841 if(AllInButtonCheckedHover == "") {
842 AllInButtonCheckedHover = getFallBackFieldContent("AllInButtonCheckedHover", 1);
843 leftItems << "AllInButtonCheckedHover";
844 } else if(AllInButtonCheckedHover != QString(currentDir+"NULL") && !QFile(AllInButtonCheckedHover).exists()) {
845 itemPicsLeft << "AllInButtonCheckedHover = "+AllInButtonCheckedHover;
846 AllInButtonCheckedHover = getFallBackFieldContent("AllInButtonCheckedHover", 1);
847 }
848
849 if(RadioButtonPressed == "") {
850 RadioButtonPressed = getFallBackFieldContent("RadioButtonPressed", 1);
851 leftItems << "RadioButtonPressed";
852 } else if(RadioButtonPressed != QString(currentDir+"NULL") && !QFile(RadioButtonPressed).exists()) {
853 itemPicsLeft << "RadioButtonPressed = "+RadioButtonPressed;
854 RadioButtonPressed = getFallBackFieldContent("RadioButtonPressed", 1);
855 }
856
857 if(RadioButtonChecked == "") {
858 RadioButtonChecked = getFallBackFieldContent("RadioButtonChecked", 1);
859 leftItems << "RadioButtonChecked";
860 } else if(RadioButtonChecked != QString(currentDir+"NULL") && !QFile(RadioButtonChecked).exists()) {
861 itemPicsLeft << "RadioButtonChecked = "+RadioButtonChecked;
862 RadioButtonChecked = getFallBackFieldContent("RadioButtonChecked", 1);
863 }
864
865 if(RadioButtonCheckedHover == "") {
866 RadioButtonCheckedHover = getFallBackFieldContent("RadioButtonCheckedHover", 1);
867 leftItems << "RadioButtonCheckedHover";
868 } else if(RadioButtonCheckedHover != QString(currentDir+"NULL") && !QFile(RadioButtonCheckedHover).exists()) {
869 itemPicsLeft << "RadioButtonCheckedHover = "+RadioButtonCheckedHover;
870 RadioButtonCheckedHover = getFallBackFieldContent("RadioButtonCheckedHover", 1);
871 }
872
873 if(RadioButtonUnchecked == "") {
874 RadioButtonUnchecked = getFallBackFieldContent("RadioButtonUnchecked", 1);
875 leftItems << "RadioButtonUnchecked";
876 } else if(RadioButtonUnchecked != QString(currentDir+"NULL") && !QFile(RadioButtonUnchecked).exists()) {
877 itemPicsLeft << "RadioButtonUnchecked = "+RadioButtonUnchecked;
878 RadioButtonUnchecked = getFallBackFieldContent("RadioButtonUnchecked", 1);
879 }
880
881 if(RadioButtonUncheckedHover == "") {
882 RadioButtonUncheckedHover = getFallBackFieldContent("RadioButtonUncheckedHover", 1);
883 leftItems << "RadioButtonUncheckedHover";
884 } else if(RadioButtonUncheckedHover != QString(currentDir+"NULL") && !QFile(RadioButtonUncheckedHover).exists()) {
885 itemPicsLeft << "RadioButtonUncheckedHover = "+RadioButtonUncheckedHover;
886 RadioButtonUncheckedHover = getFallBackFieldContent("RadioButtonUncheckedHover", 1);
887 }
888
889 if(PlayerTopSeatActive == "") {
890 PlayerTopSeatActive = getFallBackFieldContent("PlayerTopSeatActive", 1);
891 leftItems << "PlayerTopSeatActive";
892 } else if(PlayerTopSeatActive != QString(currentDir+"NULL") && !QFile(PlayerTopSeatActive).exists()) {
893 itemPicsLeft << "PlayerTopSeatActive = "+PlayerTopSeatActive;
894 PlayerTopSeatActive = getFallBackFieldContent("PlayerTopSeatActive", 1);
895 }
896
897 if(PlayerTopSeatInactive == "") {
898 PlayerTopSeatInactive = getFallBackFieldContent("PlayerTopSeatInactive", 1);
899 leftItems << "PlayerTopSeatInactive";
900 } else if(PlayerTopSeatInactive != QString(currentDir+"NULL") && !QFile(PlayerTopSeatInactive).exists()) {
901 itemPicsLeft << "PlayerTopSeatInactive = "+PlayerTopSeatInactive;
902 PlayerTopSeatInactive = getFallBackFieldContent("PlayerTopSeatInactive", 1);
903 }
904
905 if(PlayerBottomSeatActive == "") {
906 PlayerBottomSeatActive = getFallBackFieldContent("PlayerBottomSeatActive", 1);
907 leftItems << "PlayerBottomSeatActive";
908 } else if(PlayerBottomSeatActive != QString(currentDir+"NULL") && !QFile(PlayerBottomSeatActive).exists()) {
909 itemPicsLeft << "PlayerBottomSeatActive = "+PlayerBottomSeatActive;
910 PlayerBottomSeatActive = getFallBackFieldContent("PlayerBottomSeatActive", 1);
911 }
912
913 if(PlayerBottomSeatInactive == "") {
914 PlayerBottomSeatInactive = getFallBackFieldContent("PlayerBottomSeatInactive", 1);
915 leftItems << "PlayerBottomSeatInactive";
916 } else if(PlayerBottomSeatInactive != QString(currentDir+"NULL") && !QFile(PlayerBottomSeatInactive).exists()) {
917 itemPicsLeft << "PlayerBottomSeatInactive = "+PlayerBottomSeatInactive;
918 PlayerBottomSeatInactive = getFallBackFieldContent("PlayerBottomSeatInactive", 1);
919 }
920
921 if(Table == "") {
922 Table = getFallBackFieldContent("Table", 1);
923 leftItems << "Table";
924 } else if(Table != QString(currentDir+"NULL") && !QFile(Table).exists()) {
925 itemPicsLeft << "Table = "+Table;
926 Table = getFallBackFieldContent("Table", 1);
927 }
928
929 if(HandRanking == "") {
930 HandRanking = getFallBackFieldContent("HandRanking", 1);
931 leftItems << "HandRanking";
932 } else if(HandRanking != QString(currentDir+"NULL") && !QFile(HandRanking).exists()) {
933 itemPicsLeft << "HandRanking = "+HandRanking;
934 HandRanking = getFallBackFieldContent("HandRanking", 1);
935 }
936
937 if(ToolBoxBackground == "") {
938 ToolBoxBackground = getFallBackFieldContent("ToolBoxBackground", 1);
939 leftItems << "ToolBoxBackground";
940 } else if(ToolBoxBackground != QString(currentDir+"NULL") && !QFile(ToolBoxBackground).exists()) {
941 itemPicsLeft << "ToolBoxBackground = "+ToolBoxBackground;
942 ToolBoxBackground = getFallBackFieldContent("ToolBoxBackground", 1);
943 }
944
945 if(ShowMyCardsButtonDefault == "") {
946 ShowMyCardsButtonDefault = getFallBackFieldContent("ShowMyCardsButtonDefault", 1);
947 leftItems << "ShowMyCardsButtonDefault";
948 } else if(ShowMyCardsButtonDefault != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonDefault).exists()) {
949 itemPicsLeft << "ShowMyCardsButtonDefault = "+ShowMyCardsButtonDefault;
950 ShowMyCardsButtonDefault = getFallBackFieldContent("ShowMyCardsButtonDefault", 1);
951 }
952
953 if(ShowMyCardsButtonHover == "") {
954 ShowMyCardsButtonHover = getFallBackFieldContent("ShowMyCardsButtonHover", 1);
955 leftItems << "ShowMyCardsButtonHover";
956 } else if(ShowMyCardsButtonHover != QString(currentDir+"NULL") && !QFile(ShowMyCardsButtonHover).exists()) {
957 itemPicsLeft << "ShowMyCardsButtonHover = "+ShowMyCardsButtonHover;
958 ShowMyCardsButtonHover = getFallBackFieldContent("ShowMyCardsButtonHover", 1);
959 }
960
961
962 //I18N ACTION STRINGS
963 if(ActionAllInI18NString == "") {
964 ActionAllInI18NString = "NULL";
965 leftItems << "ActionAllInI18NString";
966 }
967 if(ActionRaiseI18NString == "") {
968 ActionRaiseI18NString = "NULL";
969 leftItems << "ActionRaiseI18NString";
970 }
971 if(ActionBetI18NString == "") {
972 ActionBetI18NString = "NULL";
973 leftItems << "ActionBetI18NString";
974 }
975 if(ActionCallI18NString == "") {
976 ActionCallI18NString = "NULL";
977 leftItems << "ActionCallI18NString";
978 }
979 if(ActionCheckI18NString == "") {
980 ActionCheckI18NString = "NULL";
981 leftItems << "ActionCheckI18NString";
982 }
983 if(ActionFoldI18NString == "") {
984 ActionFoldI18NString = "NULL";
985 leftItems << "ActionFoldI18NString";
986 }
987 if(PotI18NString == "") {
988 PotI18NString = "NULL";
989 leftItems << "PotI18NString";
990 }
991 if(TotalI18NString == "") {
992 TotalI18NString = "NULL";
993 leftItems << "TotalI18NString";
994 }
995 if(BetsI18NString == "") {
996 BetsI18NString = "NULL";
997 leftItems << "BetsI18NString";
998 }
999 if(GameI18NString == "") {
1000 GameI18NString = "NULL";
1001 leftItems << "GameI18NString";
1002 }
1003 if(HandI18NString == "") {
1004 HandI18NString = "NULL";
1005 leftItems << "HandI18NString";
1006 }
1007 if(PreflopI18NString == "") {
1008 PreflopI18NString = "NULL";
1009 leftItems << "PreflopI18NString";
1010 }
1011 if(FlopI18NString == "") {
1012 FlopI18NString = "NULL";
1013 leftItems << "FlopI18NString";
1014 }
1015 if(TurnI18NString == "") {
1016 TurnI18NString = "NULL";
1017 leftItems << "TurnI18NString";
1018 }
1019 if(RiverI18NString == "") {
1020 RiverI18NString = "NULL";
1021 leftItems << "RiverI18NString";
1022 }
1023
1024 // COLORS
1025 if(FKeyIndicatorColor == "") {
1026 FKeyIndicatorColor = getFallBackFieldContent("FKeyIndicatorColor", 0);
1027 leftItems << "FKeyIndicatorColor";
1028 }
1029 if(ChanceLabelPossibleColor == "") {
1030 ChanceLabelPossibleColor = getFallBackFieldContent("ChanceLabelPossibleColor", 0);
1031 leftItems << "ChanceLabelPossibleColor";
1032 }
1033 if(ChanceLabelImpossibleColor == "") {
1034 ChanceLabelImpossibleColor = getFallBackFieldContent("ChanceLabelImpossibleColor", 0);
1035 leftItems << "ChanceLabelImpossibleColor";
1036 }
1037 if(ChatLogTextColor == "") {
1038 ChatLogTextColor = getFallBackFieldContent("ChatLogTextColor", 0);
1039 leftItems << "ChatLogTextColor";
1040 }
1041 if(ChatTextNickNotifyColor == "") {
1042 ChatTextNickNotifyColor = getFallBackFieldContent("ChatTextNickNotifyColor", 0);
1043 leftItems << "ChatTextNickNotifyColor";
1044 }
1045 if(ChatLogBgColor == "") {
1046 ChatLogBgColor = getFallBackFieldContent("ChatLogBgColor", 0);
1047 leftItems << "ChatLogBgColor";
1048 }
1049 if(ChatLogScrollBarBorderColor == "") {
1050 ChatLogScrollBarBorderColor = getFallBackFieldContent("ChatLogScrollBarBorderColor", 0);
1051 leftItems << "ChatLogScrollBarBorderColor";
1052 }
1053 if(ChatLogScrollBarBgColor == "") {
1054 ChatLogScrollBarBgColor = getFallBackFieldContent("ChatLogScrollBarBgColor", 0);
1055 leftItems << "ChatLogScrollBarBgColor";
1056 }
1057 if(ChatLogScrollBarHandleBorderColor == "") {
1058 ChatLogScrollBarHandleBorderColor = getFallBackFieldContent("ChatLogScrollBarHandleBorderColor", 0);
1059 leftItems << "ChatLogScrollBarHandleBorderColor";
1060 }
1061 if(ChatLogScrollBarHandleBgColor == "") {
1062 ChatLogScrollBarHandleBgColor = getFallBackFieldContent("ChatLogScrollBarHandleBgColor", 0);
1063 leftItems << "ChatLogScrollBarHandleBgColor";
1064 }
1065 if(ChatLogScrollBarArrowBorderColor == "") {
1066 ChatLogScrollBarArrowBorderColor = getFallBackFieldContent("ChatLogScrollBarArrowBorderColor", 0);
1067 leftItems << "ChatLogScrollBarArrowBorderColor";
1068 }
1069 if(ChatLogScrollBarArrowBgColor == "") {
1070 ChatLogScrollBarArrowBgColor = getFallBackFieldContent("ChatLogScrollBarArrowBgColor", 0);
1071 leftItems << "ChatLogScrollBarArrowBgColor";
1072 }
1073 if(LogWinnerMainPotColor == "") {
1074 LogWinnerMainPotColor = getFallBackFieldContent("LogWinnerMainPotColor", 0);
1075 leftItems << "LogWinnerMainPotColor";
1076 }
1077 if(LogWinnerSidePotColor == "") {
1078 LogWinnerSidePotColor = getFallBackFieldContent("LogWinnerSidePotColor", 0);
1079 leftItems << "LogWinnerSidePotColor";
1080 }
1081 if(LogPlayerSitsOutColor == "") {
1082 LogPlayerSitsOutColor = getFallBackFieldContent("LogPlayerSitsOutColor", 0);
1083 leftItems << "LogPlayerSitsOutColor";
1084 }
1085 if(LogNewGameAdminColor == "") {
1086 LogNewGameAdminColor = getFallBackFieldContent("LogNewGameAdminColor", 0);
1087 leftItems << "LogNewGameAdminColor";
1088 }
1089 if(TabWidgetBorderColor == "") {
1090 TabWidgetBorderColor = getFallBackFieldContent("TabWidgetBorderColor", 0);
1091 leftItems << "TabWidgetBorderColor";
1092 }
1093 if(TabWidgetBgColor == "") {
1094 TabWidgetBgColor = getFallBackFieldContent("TabWidgetBgColor", 0);
1095 leftItems << "TabWidgetBgColor";
1096 }
1097 if(TabWidgetTextColor == "") {
1098 TabWidgetTextColor = getFallBackFieldContent("TabWidgetTextColor", 0);
1099 leftItems << "TabWidgetTextColor";
1100 }
1101 if(MenuBgColor == "") {
1102 MenuBgColor = getFallBackFieldContent("MenuBgColor", 0);
1103 leftItems << "MenuBgColor";
1104 }
1105 if(MenuTextColor == "") {
1106 MenuTextColor = getFallBackFieldContent("MenuTextColor", 0);
1107 leftItems << "MenuTextColor";
1108 }
1109 if(BreakLobbyButtonBgColor == "") {
1110 BreakLobbyButtonBgColor = getFallBackFieldContent("BreakLobbyButtonBgColor", 0);
1111 leftItems << "BreakLobbyButtonBgColor";
1112 }
1113 if(BreakLobbyButtonTextColor == "") {
1114 BreakLobbyButtonTextColor = getFallBackFieldContent("BreakLobbyButtonTextColor", 0);
1115 leftItems << "BreakLobbyButtonTextColor";
1116 }
1117 if(BreakLobbyButtonBgDisabledColor == "") {
1118 BreakLobbyButtonBgDisabledColor = getFallBackFieldContent("BreakLobbyButtonBgDisabledColor", 0);
1119 leftItems << "BreakLobbyButtonBgDisabledColor";
1120 }
1121 if(BreakLobbyButtonTextDisabledColor == "") {
1122 BreakLobbyButtonTextDisabledColor = getFallBackFieldContent("BreakLobbyButtonTextDisabledColor", 0);
1123 leftItems << "BreakLobbyButtonTextDisabledColor";
1124 }
1125 if(BreakLobbyButtonBgBlinkColor == "") {
1126 BreakLobbyButtonBgBlinkColor = getFallBackFieldContent("BreakLobbyButtonBgBlinkColor", 0);
1127 leftItems << "BreakLobbyButtonBgBlinkColor";
1128 }
1129 if(BreakLobbyButtonTextBlinkColor == "") {
1130 BreakLobbyButtonTextBlinkColor = getFallBackFieldContent("BreakLobbyButtonTextBlinkColor", 0);
1131 leftItems << "BreakLobbyButtonTextBlinkColor";
1132 }
1133 if(PlayerCashTextColor == "") {
1134 PlayerCashTextColor = getFallBackFieldContent("PlayerCashTextColor", 0);
1135 leftItems << "PlayerCashTextColor";
1136 }
1137 if(PlayerBetTextColor == "") {
1138 PlayerBetTextColor = getFallBackFieldContent("PlayerBetTextColor", 0);
1139 leftItems << "PlayerBetTextColor";
1140 }
1141 if(PlayerNickTextColor == "") {
1142 PlayerNickTextColor = getFallBackFieldContent("PlayerNickTextColor", 0);
1143 leftItems << "PlayerNickTextColor";
1144 }
1145 if(BoardBigTextColor == "") {
1146 BoardBigTextColor = getFallBackFieldContent("BoardBigTextColor", 0);
1147 leftItems << "BoardBigTextColor";
1148 }
1149 if(BoardSmallTextColor == "") {
1150 BoardSmallTextColor = getFallBackFieldContent("BoardSmallTextColor", 0);
1151 leftItems << "BoardSmallTextColor";
1152 }
1153 if(SpeedTextColor == "") {
1154 SpeedTextColor = getFallBackFieldContent("SpeedTextColor", 0);
1155 leftItems << "SpeedTextColor";
1156 }
1157 if(VoteButtonBgColor == "") {
1158 VoteButtonBgColor = getFallBackFieldContent("VoteButtonBgColor", 0);
1159 leftItems << "VoteButtonBgColor";
1160 }
1161 if(VoteButtonTextColor == "") {
1162 VoteButtonTextColor = getFallBackFieldContent("VoteButtonTextColor", 0);
1163 leftItems << "VoteButtonTextColor";
1164 }
1165 if(BetInputTextColor == "") {
1166 BetInputTextColor = getFallBackFieldContent("BetInputTextColor", 0);
1167 leftItems << "BetInputTextColor";
1168 }
1169 if(BetInputBgColor == "") {
1170 BetInputBgColor = getFallBackFieldContent("BetInputBgColor", 0);
1171 leftItems << "BetInputBgColor";
1172 }
1173 if(BetInputDisabledTextColor == "") {
1174 BetInputDisabledTextColor = getFallBackFieldContent("BetInputDisabledTextColor", 0);
1175 leftItems << "BetInputDisabledTextColor";
1176 }
1177 if(BetInputDisabledBgColor == "") {
1178 BetInputDisabledBgColor = getFallBackFieldContent("BetInputDisabledBgColor", 0);
1179 leftItems << "BetInputDisabledBgColor";
1180 }
1181 if(FoldButtonTextColor == "") {
1182 FoldButtonTextColor = getFallBackFieldContent("FoldButtonTextColor", 0);
1183 leftItems << "FoldButtonTextColor";
1184 }
1185 if(FoldButtonCheckableTextColor == "") {
1186 FoldButtonCheckableTextColor = getFallBackFieldContent("FoldButtonCheckableTextColor", 0);
1187 leftItems << "FoldButtonCheckableTextColor";
1188 }
1189 if(CheckCallButtonTextColor == "") {
1190 CheckCallButtonTextColor = getFallBackFieldContent("CheckCallButtonTextColor", 0);
1191 leftItems << "CheckCallButtonTextColor";
1192 }
1193 if(CheckCallButtonCheckableTextColor == "") {
1194 CheckCallButtonCheckableTextColor = getFallBackFieldContent("CheckCallButtonCheckableTextColor", 0);
1195 leftItems << "CheckCallButtonCheckableTextColor";
1196 }
1197 if(BetRaiseButtonTextColor == "") {
1198 BetRaiseButtonTextColor = getFallBackFieldContent("BetRaiseButtonTextColor", 0);
1199 leftItems << "BetRaiseButtonTextColor";
1200 }
1201 if(BetRaiseButtonCheckableTextColor == "") {
1202 BetRaiseButtonCheckableTextColor = getFallBackFieldContent("BetRaiseButtonCheckableTextColor", 0);
1203 leftItems << "BetRaiseButtonCheckableTextColor";
1204 }
1205 if(AllInButtonTextColor == "") {
1206 AllInButtonTextColor = getFallBackFieldContent("AllInButtonTextColor", 0);
1207 leftItems << "AllInButtonTextColor";
1208 }
1209 if(AllInButtonCheckableTextColor == "") {
1210 AllInButtonCheckableTextColor = getFallBackFieldContent("AllInButtonCheckableTextColor", 0);
1211 leftItems << "AllInButtonCheckableTextColor";
1212 }
1213 if(BetSpeedSliderGrooveBgColor == "") {
1214 BetSpeedSliderGrooveBgColor = getFallBackFieldContent("BetSpeedSliderGrooveBgColor", 0);
1215 leftItems << "BetSpeedSliderGrooveBgColor";
1216 }
1217 if(BetSpeedSliderGrooveBorderColor == "") {
1218 BetSpeedSliderGrooveBorderColor = getFallBackFieldContent("BetSpeedSliderGrooveBorderColor", 0);
1219 leftItems << "BetSpeedSliderGrooveBorderColor";
1220 }
1221 if(BetSpeedSliderHandleBgColor == "") {
1222 BetSpeedSliderHandleBgColor = getFallBackFieldContent("BetSpeedSliderHandleBgColor", 0);
1223 leftItems << "BetSpeedSliderHandleBgColor";
1224 }
1225 if(BetSpeedSliderHandleBorderColor == "") {
1226 BetSpeedSliderHandleBorderColor = getFallBackFieldContent("BetSpeedSliderHandleBorderColor", 0);
1227 leftItems << "BetSpeedSliderHandleBorderColor";
1228 }
1229 if(ShowMyCardsButtonTextColor == "") {
1230 ShowMyCardsButtonTextColor = getFallBackFieldContent("ShowMyCardsButtonTextColor", 0);
1231 leftItems << "ShowMyCardsButtonTextColor";
1232 }
1233 if(RatingStarsColor == "") {
1234 RatingStarsColor = getFallBackFieldContent("RatingStarsColor", 0);
1235 leftItems << "RatingStarsColor";
1236 }
1237 if(PlayerInfoHintTextColor == "") {
1238 PlayerInfoHintTextColor = getFallBackFieldContent("PlayerInfoHintTextColor", 0);
1239 leftItems << "PlayerInfoHintTextColor";
1240 }
1241
1242 // SIZE
1243 if(ChatLogTextSize == "") {
1244 ChatLogTextSize = getFallBackFieldContent("ChatLogTextSize", 0);
1245 leftItems << "ChatLogTextSize";
1246 }
1247
1248 //set loadedSuccessfull true if everything works
1249 // qDebug() << "leftitem is empty: " << leftItems.isEmpty() << "pics left is empty: " << itemPicsLeft.isEmpty() << "stylefileversion is: " << PokerTHStyleFileVersion;
1250 if(leftItems.isEmpty() && itemPicsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_GT_STYLE_FILE_VERSION) {
1251 myState = GT_STYLE_OK;
1252 // qDebug() << "myState of: " << StyleDescription << "is now: " << myState;
1253 } else {
1254 //check for style file version
1255 if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_GT_STYLE_FILE_VERSION) {
1256 myState = GT_STYLE_OUTDATED;
1257 } else {
1258 //if one or more items are left
1259 if(!leftItems.isEmpty() && myW != 0) myState = GT_STYLE_FIELDS_EMPTY;
1260
1261 //if one or more pictures where not found
1262 if(!itemPicsLeft.isEmpty() && myW != 0) myState = GT_STYLE_PICTURES_MISSING;
1263 }
1264
1265 // qDebug() << "myState of: " << StyleDescription << "is now: " << myState;
1266 }
1267 loadedSuccessfull = 1;
1268 }
1269 } else {
1270 loadedSuccessfull = 0;
1271 MyMessageBox::warning(myW, tr("Game Table Style Error"),
1272 tr("Cannot load game table style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
1273 QMessageBox::Ok);
1274 }
1275 }
1276
showErrorMessage()1277 void GameTableStyleReader::showErrorMessage()
1278 {
1279 switch (myState) {
1280 case GT_STYLE_PICTURES_MISSING:
1281 showItemPicsLeftErrorMessage();
1282 break;
1283 case GT_STYLE_FIELDS_EMPTY:
1284 showLeftItemsErrorMessage();
1285 break;
1286 case GT_STYLE_OUTDATED:
1287 showOutdatedErrorMessage();
1288 break;
1289 default:
1290 ;
1291 }
1292 }
1293
showLeftItemsErrorMessage()1294 void GameTableStyleReader::showLeftItemsErrorMessage()
1295 {
1296 QString items = leftItems.join("\n");
1297 QString EMail;
1298 if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
1299
1300 myMessageDialogImpl dialog(myConfig, myW);
1301
1302 if(dialog.checkIfMesssageWillBeDisplayed(GT_VALUES_MISSING)) {
1303 dialog.exec(GT_VALUES_MISSING, tr("Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Game Table Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
1304 }
1305
1306 }
1307
showItemPicsLeftErrorMessage()1308 void GameTableStyleReader::showItemPicsLeftErrorMessage()
1309 {
1310 QString pics = itemPicsLeft.join("\n");
1311 QString EMail;
1312 if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
1313
1314 myMessageDialogImpl dialog(myConfig, myW);
1315
1316 if(dialog.checkIfMesssageWillBeDisplayed(GT_PICS_MISSING)) {
1317 dialog.exec(GT_PICS_MISSING, tr("One or more pictures from current game table style \"%1\" were not found: \n\n%2 \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Game Table Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
1318 }
1319 }
1320
showOutdatedErrorMessage()1321 void GameTableStyleReader::showOutdatedErrorMessage()
1322 {
1323 QString EMail;
1324 if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
1325
1326 myMessageDialogImpl dialog(myConfig, myW);
1327
1328 if(dialog.checkIfMesssageWillBeDisplayed(GT_OUTDATED)) {
1329 dialog.exec(GT_OUTDATED, tr("Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is \"%2\", but this style has version \"%3\" set. \n\nAnyway you can play with this style, because the missing content will be filled up by PokerTH default style. \n\nPlease contact the game table style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_GT_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Game Table Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
1330 }
1331 }
1332
setTableBackground(gameTableImpl * gt)1333 void GameTableStyleReader::setTableBackground(gameTableImpl *gt)
1334 {
1335 gt->setStyleSheet("QMainWindow { background-image: url(\""+Table+"\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
1336 }
1337
setChatLogStyle(QTextBrowser * tb)1338 void GameTableStyleReader::setChatLogStyle(QTextBrowser *tb)
1339 {
1340 #ifdef GUI_800x480
1341 //make the scrollbar touchable for mobile guis
1342 tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 60px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical, QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
1343 #else
1344 tb->setStyleSheet("QTextBrowser { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #"+ChatLogScrollBarArrowBorderColor+"; height: 3px; width: 3px; background: #"+ChatLogScrollBarArrowBgColor+"; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
1345 #endif
1346 }
1347
setChatLogStyle(QPlainTextEdit * pte)1348 void GameTableStyleReader::setChatLogStyle(QPlainTextEdit* pte)
1349 {
1350 #ifdef GUI_800x480
1351 //make the scrollbar touchable for mobile guis
1352 pte->setStyleSheet("QPlainTextEdit { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 4px; border: 3px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 60px; } QScrollBar::add-line:vertical, QScrollBar::sub-line:vertical, QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical, QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
1353 #else
1354 pte->setStyleSheet("QPlainTextEdit { "+ font1String +" font-size: "+ChatLogTextSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border:none; } QScrollBar:vertical { border: 1px solid #"+ChatLogScrollBarBorderColor+"; background: #"+ChatLogScrollBarBgColor+"; width: 15px; margin: 17px -1px 17px 0px; } QScrollBar::handle:vertical { border-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; min-height: 20px; } QScrollBar::add-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 2px; border-bottom-left-radius: 2px; border-top-right-radius: 1px; border-top-left-radius: 1px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: bottom; subcontrol-origin: margin; } QScrollBar::sub-line:vertical { margin-right: 0px; margin-left: 1px; border-bottom-right-radius: 1px; border-bottom-left-radius: 1px; border-top-right-radius: 2px; border-top-left-radius: 2px; border: 1px solid #"+ChatLogScrollBarHandleBorderColor+"; background: #"+ChatLogScrollBarHandleBgColor+"; height: 15px; subcontrol-position: top; subcontrol-origin: margin; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { border: 1px solid #"+ChatLogScrollBarArrowBorderColor+"; height: 3px; width: 3px; background: #"+ChatLogScrollBarArrowBgColor+"; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
1355 #endif
1356 }
1357
1358
setChatInputStyle(QLineEdit * ci)1359 void GameTableStyleReader::setChatInputStyle(QLineEdit *ci)
1360 {
1361 QString myFontSize;
1362 #ifdef GUI_800x480
1363 myFontSize="28";
1364 #else
1365 myFontSize=ChatLogTextSize;
1366 #endif
1367 ci->setStyleSheet("QLineEdit { "+ font1String +" font-size: "+myFontSize+"px; color: #"+ChatLogTextColor+"; background-color: #"+ChatLogBgColor+"; border-top: 2px solid #"+TabWidgetBorderColor+"; }");
1368 }
1369
setCashLabelStyle(QLabel * cl)1370 void GameTableStyleReader::setCashLabelStyle(QLabel *cl)
1371 {
1372 cl->setStyleSheet("QLabel { "+ font2String +" font-size: "+cashFontSize+"px; font-weight: bold; color: #"+PlayerCashTextColor+"; }");
1373 }
1374
setSpectatorNumberLabelStyle(QLabel * snl)1375 void GameTableStyleReader::setSpectatorNumberLabelStyle(QLabel *snl)
1376 {
1377 snl->setStyleSheet("QLabel { "+ font2String +" font-size: 12px; font-weight: bold; color: #"+MenuTextColor+"; }");
1378 snl->setAlignment(Qt::AlignHCenter);
1379 }
1380
setSetLabelStyle(QLabel * sl)1381 void GameTableStyleReader::setSetLabelStyle(QLabel *sl)
1382 {
1383 sl->setStyleSheet("QLabel { "+ font2String +" font-size: "+setLabelFontSize+"px; font-weight: bold; color: #"+PlayerBetTextColor+"; }");
1384 }
1385
setPlayerNameLabelStyle(QLabel * pnl)1386 void GameTableStyleReader::setPlayerNameLabelStyle(QLabel *pnl)
1387 {
1388 pnl->setStyleSheet("QLabel { "+ font2String +" font-size: "+playerNameLabelFontSize+"px; font-weight: bold; color: #"+PlayerNickTextColor+"; }");
1389 }
1390
setSmallFontBoardStyle(QLabel * l)1391 void GameTableStyleReader::setSmallFontBoardStyle(QLabel *l)
1392 {
1393 l->setStyleSheet("QLabel { "+ font2String +" font-size: "+smallBoardFontSize+"px; font-weight: bold; color: #"+BoardSmallTextColor+"; }");
1394 }
1395
setBigFontBoardStyle(QLabel * l)1396 void GameTableStyleReader::setBigFontBoardStyle(QLabel *l)
1397 {
1398 l->setStyleSheet("QLabel { "+ font2String +" font-size: "+bigBoardFontSize+"px; font-weight: bold; color: #"+BoardBigTextColor+"; }");
1399 }
1400
setCardHolderStyle(QLabel * l,int bero)1401 void GameTableStyleReader::setCardHolderStyle(QLabel *l, int bero)
1402 {
1403 switch(bero) {
1404 case 0:
1405 l->setPixmap(CardHolderFlop);
1406 break;
1407 case 1:
1408 l->setPixmap(CardHolderTurn);
1409 break;
1410 case 2:
1411 l->setPixmap(CardHolderRiver);
1412 break;
1413 }
1414 }
1415
setMenuBarStyle(QMenuBar * mb)1416 void GameTableStyleReader::setMenuBarStyle(QMenuBar *mb)
1417 {
1418 mb->setAttribute(Qt::WA_TranslucentBackground);
1419 mb->setStyleSheet("QMenuBar { background-color: #"+MenuBgColor+"; font-size:12px; border-width: 0px;} QMenuBar::item { background: transparent; color: #"+MenuTextColor+"; } QMenuBar::item:selected { background: #"+MenuTextColor+"; color: #"+MenuBgColor+"; } QMenuBar::item:pressed { background: #"+MenuTextColor+"; color: #"+MenuBgColor+"; }");
1420 }
1421
setBreakButtonStyle(QPushButton * bb,int state)1422 void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state)
1423 {
1424 switch(state) {
1425 // default
1426 case 0:
1427 #ifdef GUI_800x480
1428 bb->setStyleSheet("QPushButton:enabled { padding: 10px; background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+"; font-size: 26px} QPushButton:disabled { padding: 10px; background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900; font-size: 26px}");
1429 #else
1430 bb->setStyleSheet("QPushButton:enabled { background-color: #"+BreakLobbyButtonBgColor+"; color: #"+BreakLobbyButtonTextColor+";} QPushButton:disabled { background-color: #"+BreakLobbyButtonBgDisabledColor+"; color: #"+BreakLobbyButtonTextDisabledColor+"; font-weight: 900;}");
1431 #endif
1432 break;
1433 // blink
1434 case 1:
1435 #ifdef GUI_800x480
1436 bb->setStyleSheet("QPushButton { padding: 10px; background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+"; font-size: 26px}");
1437 #else
1438 bb->setStyleSheet("QPushButton { background-color: #"+BreakLobbyButtonBgBlinkColor+"; color: "+BreakLobbyButtonTextBlinkColor+";}");
1439 #endif
1440 break;
1441 }
1442 }
1443
setSpeedStringStyle(QLabel * l)1444 void GameTableStyleReader::setSpeedStringStyle(QLabel *l)
1445 {
1446 #ifdef GUI_800x480
1447 l->setStyleSheet("QLabel { color: #"+SpeedTextColor+"; font-size: 24px}");
1448 #else
1449 l->setStyleSheet("QLabel { color: #"+SpeedTextColor+";}");
1450 #endif
1451 }
1452
setVoteButtonStyle(QPushButton * b)1453 void GameTableStyleReader::setVoteButtonStyle(QPushButton *b)
1454 {
1455 b->setStyleSheet("QPushButton:enabled { background-color: #"+VoteButtonBgColor+"; color: #"+VoteButtonTextColor+";} ");
1456 }
1457
setVoteStringsStyle(QLabel * l)1458 void GameTableStyleReader::setVoteStringsStyle(QLabel *l)
1459 {
1460 l->setStyleSheet("QLabel { color: #"+TabWidgetTextColor+"; font-size: 11px;}");
1461 }
1462
setPlayerSeatInactiveStyle(QGroupBox * ps)1463 void GameTableStyleReader::setPlayerSeatInactiveStyle(QGroupBox *ps)
1464 {
1465 // check if seat is on top or bottom line
1466 if(ps->objectName() == "groupBox2" || ps->objectName() == "groupBox1" || ps->objectName() == "groupBox0" || ps->objectName() == "groupBox9" || ps->objectName() == "groupBox8") {
1467 ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerBottomSeatInactive+"\") }");
1468 } else {
1469 ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerTopSeatInactive+"\") }");
1470 }
1471 }
1472
setPlayerSeatActiveStyle(QGroupBox * ps)1473 void GameTableStyleReader::setPlayerSeatActiveStyle(QGroupBox *ps)
1474 {
1475 // check if seat is on top or bottom line
1476 if(ps->objectName() == "groupBox2" || ps->objectName() == "groupBox1" || ps->objectName() == "groupBox0" || ps->objectName() == "groupBox9" || ps->objectName() == "groupBox8") {
1477 ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerBottomSeatActive+"\") }");
1478 } else {
1479 ps->setStyleSheet("QGroupBox { border:none; background-image: url(\""+PlayerTopSeatActive+"\") }");
1480 }
1481 }
1482
setBetValueInputStyle(QSpinBox * bv)1483 void GameTableStyleReader::setBetValueInputStyle(QSpinBox *bv)
1484 {
1485 bv->setStyleSheet("QSpinBox { "+ font2String +" font-size: "+betValueFontSize+"px; font-weight: bold; background-color: #"+BetInputBgColor+"; color: #"+BetInputTextColor+"; } QSpinBox:disabled { background-color: #"+BetInputDisabledBgColor+"; color: #"+BetInputDisabledTextColor+" }");
1486 }
1487
setAwayRadioButtonsStyle(QRadioButton * rb)1488 void GameTableStyleReader::setAwayRadioButtonsStyle(QRadioButton *rb)
1489 {
1490 rb->setStyleSheet("QRadioButton { color: #"+TabWidgetTextColor+"; } QRadioButton::indicator { width: 13px; height: 13px;} QRadioButton::indicator::checked { image: url(\""+RadioButtonChecked+"\");} QRadioButton::indicator::unchecked { image: url(\""+RadioButtonUnchecked+"\");} QRadioButton::indicator:unchecked:hover { image: url(\""+RadioButtonUncheckedHover+"\");} QRadioButton::indicator:unchecked:pressed { image: url(\""+RadioButtonPressed+"\");} QRadioButton::indicator::checked { image: url(\""+RadioButtonChecked+"\");} QRadioButton::indicator:checked:hover { image: url(\""+RadioButtonCheckedHover+"\");} QRadioButton::indicator:checked:pressed { image: url(\""+RadioButtonPressed+"\");}");
1491
1492 }
1493
getActionPic(int action)1494 QString GameTableStyleReader::getActionPic(int action)
1495 {
1496 QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
1497
1498 // 1 = fold, 2 = check, 3 = call, 4 = bet, 5 = raise, 6 = allin, 7 = winner
1499 switch(action) {
1500 case 1: {
1501 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionFoldI18NPic.endsWith("NULL"))
1502 return myAppDataPath+"gfx/gui/misc/actionpics/action_fold.png";
1503 else
1504 return ActionFoldI18NPic;
1505 }
1506 break;
1507 case 2: {
1508 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionCheckI18NPic.endsWith("NULL"))
1509 return myAppDataPath+"gfx/gui/misc/actionpics/action_check.png";
1510 else
1511 return ActionCheckI18NPic;
1512 }
1513 break;
1514 case 3: {
1515 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionCallI18NPic.endsWith("NULL"))
1516 return myAppDataPath+"gfx/gui/misc/actionpics/action_call.png";
1517 else
1518 return ActionCallI18NPic;
1519 }
1520 break;
1521 case 4: {
1522 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionBetI18NPic.endsWith("NULL"))
1523 return myAppDataPath+"gfx/gui/misc/actionpics/action_bet.png";
1524 else
1525 return ActionBetI18NPic;
1526 }
1527 break;
1528 case 5: {
1529 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionRaiseI18NPic.endsWith("NULL"))
1530 return myAppDataPath+"gfx/gui/misc/actionpics/action_raise.png";
1531 else
1532 return ActionRaiseI18NPic;
1533 }
1534 break;
1535 case 6: {
1536 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionAllInI18NPic.endsWith("NULL"))
1537 return myAppDataPath+"gfx/gui/misc/actionpics/action_allin.png";
1538 else
1539 return ActionAllInI18NPic;
1540 }
1541 break;
1542 case 7: {
1543 if(myConfig->readConfigInt("DontTranslateInternationalPokerStringsFromStyle") || ActionWinnerI18NPic.endsWith("NULL"))
1544 return myAppDataPath+"gfx/gui/misc/actionpics/action_winner.png";
1545 else
1546 return ActionWinnerI18NPic;
1547 }
1548 break;
1549 }
1550 return QString("");
1551 }
1552
setButtonsStyle(MyActionButton * br,MyActionButton * cc,MyActionButton * f,MyActionButton * a,int state)1553 void GameTableStyleReader::setButtonsStyle(MyActionButton *br, MyActionButton *cc, MyActionButton *f, MyActionButton *a, int state)
1554 {
1555 br->setMyStyle(this);
1556 cc->setMyStyle(this);
1557 f->setMyStyle(this);
1558 a->setMyStyle(this);
1559
1560 switch(state) {
1561 //default
1562 case 0: {
1563 br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}");
1564
1565 cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonCheckedHover+"\");}");
1566
1567 f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonCheckedHover+"\");}");
1568
1569 a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonCheckedHover+"\");}");
1570 }
1571 break;
1572 //no hover
1573 case 1: {
1574 br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");}");
1575
1576 cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");}");
1577
1578 f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");}");
1579
1580 a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");}");
1581 }
1582 break;
1583 //checkable
1584 case 2: {
1585 br->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+BetRaiseButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonCheckedHover+"\");}");
1586
1587 cc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+CheckCallButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+CheckCallButtonCheckedHover+"\");}");
1588
1589 f->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+FoldButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+FoldButtonCheckedHover+"\");}");
1590
1591 a->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+AllInButtonCheckableTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonChecked+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+AllInButtonCheckedHover+"\");}");
1592 }
1593 break;
1594 }
1595
1596 }
1597
setShowMyCardsButtonStyle(MyActionButton * sc)1598 void GameTableStyleReader::setShowMyCardsButtonStyle( MyActionButton *sc)
1599 {
1600 sc->setMyStyle(this);
1601
1602 //Show My Cards Button has same look and feel all the time
1603 sc->setStyleSheet("QPushButton { border:none; background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonDefault+"\"); "+ font2String +" font-size: "+humanPlayerButtonFontSize+"px; font-weight: bold; color: #"+ShowMyCardsButtonTextColor+";} QPushButton:unchecked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonDefault+"\"); } QPushButton:checked { background-repeat: no-repeat; background-position: center center; background-image: url(\""+BetRaiseButtonDefault+"\");} QPushButton:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonHover+"\"); } QPushButton:checked:hover { background-repeat: no-repeat; background-position: center center; background-image: url(\""+ShowMyCardsButtonHover+"\");}");
1604
1605 }
1606
setToolBoxBackground(QGroupBox * gb)1607 void GameTableStyleReader::setToolBoxBackground(QGroupBox* gb)
1608 {
1609 #ifndef ANDROID
1610 gb->setStyleSheet("QGroupBox { border:none; background-image: url(\""+ToolBoxBackground+"\") }");
1611 #endif
1612 }
1613
setTabWidgetStyle(QTabWidget * tw,QTabBar * tb)1614 void GameTableStyleReader::setTabWidgetStyle(QTabWidget *tw, QTabBar *tb)
1615 {
1616 tw->setStyleSheet("QTabWidget::pane { border: 2px solid #"+TabWidgetBorderColor+"; border-radius: 2px; background-color: #"+TabWidgetBgColor+"; } QTabWidget::tab-bar { left: 5px; } ");
1617
1618 QString bottomPadding("");
1619
1620 #ifdef _WIN32
1621 bottomPadding = " padding-bottom: 3px;";
1622 #endif
1623
1624 QString tabTextFontSize;
1625 #ifndef ANDROID
1626 tabTextFontSize = "font-size: 11px; ";
1627 #endif
1628
1629 #ifndef MAEMO
1630 tb->setStyleSheet("QTabBar::tab{ "+ font1String + tabTextFontSize +" color: #"+TabWidgetTextColor+"; background-color: #"+TabWidgetBgColor+"; border: 2px solid #"+TabWidgetBorderColor+"; border-bottom-color: #"+TabWidgetBorderColor+"; border-top-left-radius: 4px; border-top-right-radius: 4px; padding-top: "+tabBarPaddingTop+"px;"+bottomPadding+" padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected, QTabBar::tab:hover { background-color: #"+TabWidgetBgColor+"; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected { border-color: #"+TabWidgetBorderColor+"; border-bottom-color: #"+TabWidgetBgColor+"; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:!selected { margin-top: 2px; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:selected { margin-left: -4px; margin-right: -4px; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:first:selected { margin-left: 0; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:last:selected { margin-right: 0; padding-top: "+tabBarPaddingTop+"px; padding-left:"+tabBarPaddingSide+"px; padding-right:"+tabBarPaddingSide+"px;} QTabBar::tab:only-one { margin: 0; } ");
1631 #endif
1632
1633 }
1634
setWindowsGeometry(gameTableImpl * gt)1635 void GameTableStyleReader::setWindowsGeometry(gameTableImpl *gt)
1636 {
1637 if(IfFixedWindowSize.toInt()) {
1638 #ifndef GUI_800x480
1639 QDesktopWidget dw;
1640 int availableWidth = dw.screenGeometry().width();
1641 int availableHeight = dw.screenGeometry().height();
1642 if(availableWidth == FixedWindowWidth.toInt() && availableHeight == FixedWindowHeight.toInt()) {
1643 gt->actionFullScreen->setEnabled(true);
1644 } else {
1645 gt->actionFullScreen->setDisabled(true);
1646 if(gt->isFullScreen()) {
1647 gt->showNormal();
1648 gt->move(50,50);
1649 }
1650 }
1651 gt->setMinimumSize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt());
1652 gt->setMaximumSize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt());
1653 gt->resize(FixedWindowWidth.toInt(), FixedWindowHeight.toInt());
1654 #endif
1655 } else {
1656 #ifndef GUI_800x480
1657 QDesktopWidget dw;
1658 int availableWidth = dw.screenGeometry().width();
1659 int availableHeight = dw.screenGeometry().height();
1660 if(availableWidth <= MaximumWindowWidth.toInt() && availableHeight <= MaximumWindowHeight.toInt()) {
1661 gt->actionFullScreen->setEnabled(true);
1662 } else {
1663 gt->actionFullScreen->setDisabled(true);
1664 if(gt->isFullScreen()) {
1665 gt->showNormal();
1666 gt->move(50,50);
1667 }
1668 }
1669 gt->setMinimumSize(MinimumWindowWidth.toInt(), MinimumWindowHeight.toInt());
1670 gt->setMaximumSize(MaximumWindowWidth.toInt(), MaximumWindowHeight.toInt());
1671 #endif
1672 }
1673
1674 }
1675
setSliderStyle(QSlider * s)1676 void GameTableStyleReader::setSliderStyle(QSlider *s)
1677 {
1678
1679 QString height("");
1680
1681 #ifdef GUI_800x480
1682 height = " height: 10px;";
1683 #else
1684 height = " height: 3px;";
1685 #endif
1686
1687 #if QT_VERSION >= 0x040700
1688 #ifdef GUI_800x480
1689 s->setStyleSheet("QSlider::groove:horizontal { border: 2px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 2px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 2px solid #"+BetSpeedSliderHandleBorderColor+"; width: 58px; margin: -24px 0; border-radius: 4px;}");
1690 #else
1691 s->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 4px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 1px solid #"+BetSpeedSliderHandleBorderColor+"; width: 12px; margin: -7px 0; border-radius: 4px;}");
1692 #endif
1693 #else
1694 s->setStyleSheet("QSlider::groove:horizontal { border: 1px solid #"+BetSpeedSliderGrooveBorderColor+";"+height+" background: #"+BetSpeedSliderGrooveBgColor+"; margin: 4px 0; border-radius: 2px; } QSlider::handle:horizontal { background: #"+BetSpeedSliderHandleBgColor+"; border: 1px solid #"+BetSpeedSliderHandleBorderColor+"; width: 12px; margin: -2px 0; border-radius: 4px;}");
1695 #endif
1696
1697 }
1698
getFallBackFieldContent(QString field,int type)1699 QString GameTableStyleReader::getFallBackFieldContent(QString field, int type)
1700 {
1701 QFile myFile(QFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/defaulttablestyle.xml").fileName());
1702 myFile.open(QIODevice::ReadOnly);
1703 QByteArray thisContent = myFile.readAll();
1704
1705 //start reading the file and fill vars
1706 string tempString1("");
1707 TiXmlDocument doc;
1708 doc.Parse(thisContent.constData());
1709
1710 if(doc.RootElement()) {
1711 TiXmlHandle docHandle( &doc );
1712 TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).FirstChild().ToElement();
1713 for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
1714 const char *tmpStr1 = itemsList->Attribute("value");
1715 if (tmpStr1) {
1716 tempString1 = tmpStr1;
1717 if(itemsList->ValueStr() == field.toStdString()) {
1718 if(type == 1) return QString(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default/"+QString::fromUtf8(tempString1.c_str()));
1719 else return QString::fromUtf8(tempString1.c_str());
1720 }
1721 }
1722 }
1723 }
1724 return QString("");
1725 }
1726
getMyStateToolTipInfo()1727 QString GameTableStyleReader::getMyStateToolTipInfo()
1728 {
1729 switch (myState) {
1730 case GT_STYLE_OK:
1731 return QString(tr("Everything OK!"));
1732 break;
1733 case GT_STYLE_PICTURES_MISSING:
1734 return QString(tr("Some pictures are missing, please contact style maintainer for this issue."));
1735 break;
1736 case GT_STYLE_FIELDS_EMPTY:
1737 return QString(tr("Some style fields are missing, please contact style maintainer for this issue."));
1738 break;
1739 case GT_STYLE_OUTDATED:
1740 return QString(tr("This style is outdated, please contact style maintainer for this issue."));
1741 break;
1742 default:
1743 return QString("");
1744 }
1745 }
1746