From 492939cccf6927bc021d73bd7cc4d472fc7e1e6b Mon Sep 17 00:00:00 2001 From: doitux Date: Sun, 24 May 2009 13:30:10 +0000 Subject: [PATCH] qt 4.5.1 startwindow font-lenght fixes. localized cash value bugfix --- INSTALL | 2 +- src/gui/qt/gametable/gametableimpl.cpp | 13 ++-------- src/gui/qt/gametable/mymenubar.cpp | 6 +++-- src/gui/qt/startwindow.ui | 28 +++++++++++++++------- src/gui/qt/startwindow/startwindowimpl.cpp | 6 ----- 5 files changed, 27 insertions(+), 28 deletions(-) diff --git a/INSTALL b/INSTALL index 9f46d9d5..8427f4f6 100644 --- a/INSTALL +++ b/INSTALL @@ -4,7 +4,7 @@ Requirements To compile PokerTH you need following libs: Linux: -- Qt version >= 4.4.3 --> http://trolltech.com/ +- Qt version >= 4.4.3, 4.5.1 recommended --> http://qtsoftware.com/ - zlib version 1.2.3 --> http://www.zlib.net/ - libcurl version >= 7.16 --> http://curl.haxx.se/ - gnutls (e.g. version 2.2.2) --> http://www.gnu.org/software/gnutls/ diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index 66c34040..8d0fcaf4 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -1454,11 +1454,7 @@ void gameTableImpl::provideMyActions(int mode) { //if value changed on bet/raise button --> uncheck to prevent unwanted actions - QString lastBetValueString = lastPushButtonBetRaiseString.simplified(); - int index = lastBetValueString.indexOf("$"); - lastBetValueString.remove(0, index+1); - bool ok; - int lastBetValue = lastBetValueString.toInt(&ok,10); + int lastBetValue = lastPushButtonBetRaiseString.simplified().remove(QRegExp("[^0-9]")).toInt(); if(lastBetValue < horizontalSlider_bet->minimum() && pushButton_BetRaise->isChecked()) { @@ -1628,12 +1624,7 @@ int gameTableImpl::getMyCallAmount() { int gameTableImpl::getBetRaisePushButtonValue() { - QString betValueString = pushButton_BetRaise->text().simplified().remove(QRegExp("[^0-9]")); - int index = betValueString.indexOf("$"); - betValueString.remove(0, index+1); - bool ok; - int betValue = betValueString.toInt(&ok,10); - + int betValue = pushButton_BetRaise->text().simplified().remove(QRegExp("[^0-9]")).toInt(); return betValue; } diff --git a/src/gui/qt/gametable/mymenubar.cpp b/src/gui/qt/gametable/mymenubar.cpp index 78048604..e35a4ef3 100644 --- a/src/gui/qt/gametable/mymenubar.cpp +++ b/src/gui/qt/gametable/mymenubar.cpp @@ -3,8 +3,10 @@ MyMenuBar::MyMenuBar(QMainWindow* parent) : QMenuBar(parent) { - this->setAttribute(Qt::WA_TranslucentBackground); - this->setStyleSheet("QMenuBar { border-width: 0px; border-style: none;} "); +#if (QT_VERSION >= 0x040501) + this->setAttribute(Qt::WA_TranslucentBackground); + this->setStyleSheet("QMenuBar { border-width: 0px; border-style: none;} "); +#endif } void MyMenuBar::paintEvent(QPaintEvent *e) { diff --git a/src/gui/qt/startwindow.ui b/src/gui/qt/startwindow.ui index 18a38ed3..89991e6c 100644 --- a/src/gui/qt/startwindow.ui +++ b/src/gui/qt/startwindow.ui @@ -58,7 +58,7 @@ - + 0 0 @@ -66,6 +66,9 @@ Qt::NoFocus + + QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px;} + &1 Start Local Game @@ -75,7 +78,7 @@ - 32 + 37 32 @@ -84,7 +87,7 @@ - + 0 0 @@ -92,6 +95,9 @@ Qt::NoFocus + + QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px;} + &2 Internet Game @@ -101,7 +107,7 @@ - 32 + 37 32 @@ -110,7 +116,7 @@ - + 0 0 @@ -118,6 +124,9 @@ Qt::NoFocus + + QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px;} + &3 Create Network Game @@ -127,7 +136,7 @@ - 32 + 37 32 @@ -136,7 +145,7 @@ - + 0 0 @@ -144,6 +153,9 @@ Qt::NoFocus + + QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px;} + &4 Join Network Game @@ -153,7 +165,7 @@ - 32 + 37 32 diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 880e20d8..a66ab85c 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -78,12 +78,6 @@ startWindowImpl::startWindowImpl(ConfigFile *c) centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - - pushButtonStart_Local_Game->setStyleSheet("QPushButton { font-weight: 900; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; text-align: left;}"); - pushButtonInternet_Game->setStyleSheet("QPushButton { font-weight: 900; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; text-align: left; }"); - pushButton_Create_Network_Game->setStyleSheet("QPushButton { font-weight: 900; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; text-align: left; }"); - pushButton_Join_Network_Game->setStyleSheet("QPushButton { font-weight: 900; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; text-align: left; }"); - // Dialogs myNewGameDialog = new newGameDialogImpl(this, myConfig); mySelectAvatarDialog = new selectAvatarDialogImpl(this, myConfig);