From b677da1ae6dac9d659b13e1b7d9369e5e7182ea9 Mon Sep 17 00:00:00 2001 From: doitux Date: Wed, 13 May 2009 09:31:13 +0000 Subject: [PATCH] gametable adjustments for 1.000.000 number style. transparent menubars. --- .../gamelobbydialog/gamelobbydialogimpl.cpp | 4 +- src/gui/qt/gametable.ui | 208 ++++++++++-------- src/gui/qt/gametable/gametableimpl.cpp | 76 +++---- src/gui/qt/gametable/mymenubar.cpp | 3 +- src/gui/qt/startwindow.ui | 33 ++- src/gui/qt/startwindow/startwindowimpl.cpp | 3 +- src/gui/qt/styles/carddeckstylereader.cpp | 4 +- src/gui/qt/styles/gametablestylereader.cpp | 2 +- 8 files changed, 200 insertions(+), 133 deletions(-) diff --git a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp index 15220a7c..efc06c1d 100644 --- a/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp +++ b/src/gui/qt/gamelobbydialog/gamelobbydialogimpl.cpp @@ -186,7 +186,7 @@ void gameLobbyDialogImpl::joinAnyGame() { bool ok; int players = (*it)->data(1, Qt::DisplayRole).toString().section("/",0,0).toInt(&ok,10); int maxPlayers = (*it)->data(1, Qt::DisplayRole).toString().section("/",1,1).toInt(&ok,10); - if ((*it)->data(2, Qt::DisplayRole) == tr("open") && (*it)->data(3, Qt::UserRole) == 0 && players < maxPlayers) + if ((*it)->data(2, Qt::DisplayRole) == tr("open") && (*it)->data(3, Qt::DisplayRole) == "" && players < maxPlayers) { treeWidget_GameList->setCurrentItem((*it)); found = TRUE; @@ -765,7 +765,7 @@ void gameLobbyDialogImpl::joinAnyGameButtonRefresh() { bool ok; int players = (*it)->data(1, Qt::DisplayRole).toString().section("/",0,0).toInt(&ok,10); int maxPlayers = (*it)->data(1, Qt::DisplayRole).toString().section("/",1,1).toInt(&ok,10); - if ((*it)->data(2, Qt::DisplayRole) == tr("open") && (*it)->data(3, Qt::UserRole) == 0 && players < maxPlayers) { openNonPrivateNonFullGamesCounter++; } + if ((*it)->data(2, Qt::DisplayRole) == tr("open") && (*it)->data(3, Qt::DisplayRole) == "" && players < maxPlayers) { openNonPrivateNonFullGamesCounter++; } ++it; } diff --git a/src/gui/qt/gametable.ui b/src/gui/qt/gametable.ui index cdcf2a87..1a8f9e51 100644 --- a/src/gui/qt/gametable.ui +++ b/src/gui/qt/gametable.ui @@ -1597,6 +1597,9 @@ + + 0 + @@ -1620,13 +1623,13 @@ - 580 + 600 94 - 535 + 600 94 @@ -1640,90 +1643,6 @@ 0 - - - - - 0 - - - 0 - - - 8 - - - 0 - - - 8 - - - - - - 145 - 0 - - - - - - - Qt::AlignCenter - - - - - - - 3 - - - 2 - - - 0 - - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - 75 - 0 - - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - - - - - - @@ -1981,6 +1900,121 @@ true + pixmapLabel_cardBoard4 + pixmapLabel_cardBoard1 + label_CardHolder1 + label_CardHolder0 + pixmapLabel_cardBoard0 + label_CardHolder4 + label_CardHolder2 + pixmapLabel_cardBoard2 + label_CardHolder3 + pixmapLabel_cardBoard3 + frame_2 + + + + + + + 0 + + + 0 + + + 8 + + + 0 + + + 8 + + + + + 0 + + + + + + 144 + 0 + + + + + + + Qt::AlignCenter + + + + + + + Qt::Horizontal + + + + 17 + 17 + + + + + + + + + + 3 + + + 2 + + + 0 + + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 90 + 0 + + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + @@ -3538,7 +3572,7 @@ 0 0 1024 - 25 + 27 diff --git a/src/gui/qt/gametable/gametableimpl.cpp b/src/gui/qt/gametable/gametableimpl.cpp index f8337e8b..21ed4d75 100755 --- a/src/gui/qt/gametable/gametableimpl.cpp +++ b/src/gui/qt/gametable/gametableimpl.cpp @@ -711,7 +711,7 @@ void gameTableImpl::refreshSet() { if( (*it_c)->getMySet() == 0 ) setLabelArray[(*it_c)->getMyID()]->setText(""); else - setLabelArray[(*it_c)->getMyID()]->setText("$"+QString::number((*it_c)->getMySet(),10)); + setLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMySet())); } } @@ -929,7 +929,7 @@ void gameTableImpl::refreshCash() { for (it_c=currentHand->getSeatsList()->begin(); it_c!=currentHand->getSeatsList()->end(); it_c++) { if((*it_c)->getMyActiveStatus()) { - cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString::number((*it_c)->getMyCash(),10)); + cashLabelArray[(*it_c)->getMyID()]->setText("$"+QString("%L1").arg((*it_c)->getMyCash())); } else { cashLabelArray[(*it_c)->getMyID()]->setText(""); @@ -1081,8 +1081,8 @@ void gameTableImpl::refreshChangePlayer() { void gameTableImpl::refreshPot() { HandInterface *currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); - textLabel_Sets->setText("$"+QString::number(currentHand->getBoard()->getSets(),10)); - textLabel_Pot->setText("$"+QString::number(currentHand->getBoard()->getPot(),10)); + textLabel_Sets->setText("$"+QString("%L1").arg(currentHand->getBoard()->getSets())); + textLabel_Pot->setText("$"+QString("%L1").arg(currentHand->getBoard()->getPot())); } void gameTableImpl::guiUpdateDone() { @@ -1361,11 +1361,11 @@ void gameTableImpl::provideMyActions(int mode) { if(currentHand->getCurrentRound() == 0) { // preflop if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { - pushButtonBetRaiseString = RaiseString+"\n$"+QString::number(getMyBetAmount()); + pushButtonBetRaiseString = RaiseString+"\n$"+QString("%L1").arg(getMyBetAmount()); } if (currentGame->getSeatsList()->front()->getMySet()== currentHand->getCurrentBeRo()->getHighestSet() && currentGame->getSeatsList()->front()->getMyButton() == 3) { pushButtonCallCheckString = CheckString; } - else { pushButtonCallCheckString = CallString+"\n$"+QString::number(getMyCallAmount()); } + else { pushButtonCallCheckString = CallString+"\n$"+QString("%L1").arg(getMyCallAmount()); } pushButtonFoldString = FoldString; pushButtonAllInString = AllInString; @@ -1379,12 +1379,12 @@ void gameTableImpl::provideMyActions(int mode) { if (currentHand->getCurrentBeRo()->getHighestSet() == 0) { pushButtonCallCheckString = CheckString; - pushButtonBetRaiseString = BetString+"\n$"+QString::number(getMyBetAmount()); + pushButtonBetRaiseString = BetString+"\n$"+QString("%L1").arg(getMyBetAmount()); } if (currentHand->getCurrentBeRo()->getHighestSet() > 0 && currentHand->getCurrentBeRo()->getHighestSet() > currentGame->getSeatsList()->front()->getMySet()) { - pushButtonCallCheckString = CallString+"\n$"+QString::number(getMyCallAmount()); + pushButtonCallCheckString = CallString+"\n$"+QString("%L1").arg(getMyCallAmount()); if (currentGame->getSeatsList()->front()->getMyCash()+currentGame->getSeatsList()->front()->getMySet() > currentHand->getCurrentBeRo()->getHighestSet()) { - pushButtonBetRaiseString = RaiseString+"\n$"+QString::number(getMyBetAmount()); + pushButtonBetRaiseString = RaiseString+"\n$"+QString("%L1").arg(getMyBetAmount()); } } pushButtonAllInString = AllInString; @@ -1392,7 +1392,7 @@ void gameTableImpl::provideMyActions(int mode) { if(mode == 0) { if( currentHand->getSeatsList()->front()->getMyAction() != PLAYER_ACTION_FOLD ) { - pushButtonBetRaiseString = BetString+"\n$"+QString::number(getMyBetAmount()); + pushButtonBetRaiseString = BetString+"\n$"+QString("%L1").arg(getMyBetAmount()); pushButtonCallCheckString = CheckString; if( (currentGame->getActivePlayerList()->size() > 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_SMALL_BLIND ) || ( currentGame->getActivePlayerList()->size() <= 2 && currentGame->getSeatsList()->front()->getMyButton() == BUTTON_BIG_BLIND)) { pushButtonFoldString = FoldString; } else { pushButtonFoldString = CheckString+" /\n"+FoldString; } @@ -1628,7 +1628,7 @@ int gameTableImpl::getMyCallAmount() { int gameTableImpl::getBetRaisePushButtonValue() { - QString betValueString = pushButton_BetRaise->text().simplified(); + QString betValueString = pushButton_BetRaise->text().simplified().remove(QRegExp("[^0-9]")); int index = betValueString.indexOf("$"); betValueString.remove(0, index+1); bool ok; @@ -2986,32 +2986,32 @@ void gameTableImpl::changeLineEditBetValue(int value) { else { if(horizontalSlider_bet->maximum() <= 1000 ) { temp = (int)((value/10)*10); - if(temp < horizontalSlider_bet->minimum()) - lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); - else - lineEdit_betValue->setText(QString::number(temp)); + if(temp < horizontalSlider_bet->minimum()) + lineEdit_betValue->setText(QString("%L1").arg(horizontalSlider_bet->minimum())); + else + lineEdit_betValue->setText(QString("%L1").arg(temp)); } - else if(horizontalSlider_bet->maximum() > 1000 && horizontalSlider_bet->maximum() <= 10000) { + else if(horizontalSlider_bet->maximum() > 1000 && horizontalSlider_bet->maximum() <= 10000) { temp = (int)((value/50)*50); - if(temp < horizontalSlider_bet->minimum()) - lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); - else - lineEdit_betValue->setText(QString::number(temp)); + if(temp < horizontalSlider_bet->minimum()) + lineEdit_betValue->setText(QString("%L1").arg(horizontalSlider_bet->minimum())); + else + lineEdit_betValue->setText(QString("%L1").arg(temp)); + } + else if(horizontalSlider_bet->maximum() > 10000 && horizontalSlider_bet->maximum() <= 100000) { + temp = (int)((value/500)*500); + if(temp < horizontalSlider_bet->minimum()) + lineEdit_betValue->setText(QString("%L1").arg(horizontalSlider_bet->minimum())); + else + lineEdit_betValue->setText(QString("%L1").arg(temp)); + } + else { + temp = (int)((value/5000)*5000); + if(temp < horizontalSlider_bet->minimum()) + lineEdit_betValue->setText(QString("%L1").arg(horizontalSlider_bet->minimum())); + else + lineEdit_betValue->setText(QString("%L1").arg(temp)); } - else if(horizontalSlider_bet->maximum() > 10000 && horizontalSlider_bet->maximum() <= 100000) { - temp = (int)((value/500)*500); - if(temp < horizontalSlider_bet->minimum()) - lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); - else - lineEdit_betValue->setText(QString::number(temp)); - } - else { - temp = (int)((value/5000)*5000); - if(temp < horizontalSlider_bet->minimum()) - lineEdit_betValue->setText(QString::number(horizontalSlider_bet->minimum())); - else - lineEdit_betValue->setText(QString::number(temp)); - } } } @@ -3020,24 +3020,24 @@ void gameTableImpl::lineEditBetValueChanged(QString valueString) { if(horizontalSlider_bet->isEnabled()) { bool ok; - int betValue = QString(valueString).toInt(&ok, 10); + int betValue = QString(valueString.remove(QRegExp("[^0-9]"))).toInt(&ok, 10); QString betRaise = pushButton_BetRaise->text().section("\n",0 ,0); if(betValue >= horizontalSlider_bet->minimum()) { if(betValue > horizontalSlider_bet->maximum()) { // print the maximum - pushButton_BetRaise->setText(betRaise + "\n$" + QString::number(horizontalSlider_bet->maximum())); + pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->maximum())); betSliderChangedByInput = TRUE; horizontalSlider_bet->setValue(horizontalSlider_bet->maximum()); } else { // really print the value - pushButton_BetRaise->setText(betRaise + "\n$" + valueString); + pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(valueString.toInt())); betSliderChangedByInput = TRUE; horizontalSlider_bet->setValue(betValue); } } else { // print the minimum - pushButton_BetRaise->setText(betRaise + "\n$" + QString::number(horizontalSlider_bet->minimum())); + pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->minimum())); betSliderChangedByInput = TRUE; horizontalSlider_bet->setValue(horizontalSlider_bet->minimum()); } diff --git a/src/gui/qt/gametable/mymenubar.cpp b/src/gui/qt/gametable/mymenubar.cpp index fa1f408e..78048604 100644 --- a/src/gui/qt/gametable/mymenubar.cpp +++ b/src/gui/qt/gametable/mymenubar.cpp @@ -3,7 +3,8 @@ MyMenuBar::MyMenuBar(QMainWindow* parent) : QMenuBar(parent) { - //this->setAttribute(Qt::WA_TranslucentBackground); + this->setAttribute(Qt::WA_TranslucentBackground); + this->setStyleSheet("QMenuBar { border-width: 0px; border-style: none;} "); } void MyMenuBar::paintEvent(QPaintEvent *e) { diff --git a/src/gui/qt/startwindow.ui b/src/gui/qt/startwindow.ui index c5880bbd..6410449e 100644 --- a/src/gui/qt/startwindow.ui +++ b/src/gui/qt/startwindow.ui @@ -60,6 +60,12 @@ + + + 0 + 0 + + Qt::NoFocus @@ -80,6 +86,12 @@ + + + 0 + 0 + + Qt::NoFocus @@ -100,6 +112,12 @@ + + + 0 + 0 + + Qt::NoFocus @@ -120,6 +138,12 @@ + + + 0 + 0 + + Qt::NoFocus @@ -168,7 +192,7 @@ - + 0 @@ -273,6 +297,13 @@ + + + MyMenuBar + QMenuBar +
mymenubar.h
+
+
diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 3086f930..e3515ce8 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -76,7 +76,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c) this->setStatusBar(0); - centralwidget->setStyleSheet("QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + this->setStyleSheet("QMainWindow { 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 { padding-left: 3px; padding-right: 3px; text-align: left; font-weight: bold;}"); pushButtonInternet_Game->setStyleSheet("QPushButton { padding-left: 3px; padding-right: 3px; text-align: left; font-weight: bold;}"); diff --git a/src/gui/qt/styles/carddeckstylereader.cpp b/src/gui/qt/styles/carddeckstylereader.cpp index 469b7d81..311a3baa 100644 --- a/src/gui/qt/styles/carddeckstylereader.cpp +++ b/src/gui/qt/styles/carddeckstylereader.cpp @@ -121,7 +121,7 @@ void CardDeckStyleReader::readStyleFile(QString file) { QString EMail; if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail; QMessageBox::warning(myW, tr("Card Deck Style Error"), - tr("Selected card deck style \"%1\" seems to be outdated. \n The current PokerTH card deck style version is \"%2\", but this style has version \"%3\" set. \n\nPlease contact the game table style builder %4.").arg(StyleDescription).arg(POKERTH_CD_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), + tr("Selected card deck style \"%1\" seems to be outdated. \n The current PokerTH card deck style version is \"%2\", but this style has version \"%3\" set. \n\nPlease contact the card deck style builder %4.").arg(StyleDescription).arg(POKERTH_CD_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), QMessageBox::Ok); } } @@ -143,7 +143,7 @@ void CardDeckStyleReader::showLeftItemsErrorMessage(QString style, QStringList f if(email != "NULL") EMail = email; QMessageBox::warning(myW, tr("Card Deck Style Error"), - tr("Selected card deck style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of \"%2\" is/are missing. \n\nPlease contact the game table style builder %3.").arg(style).arg(items).arg(EMail), + tr("Selected card deck style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of \"%2\" is/are missing. \n\nPlease contact the card deck style builder %3.").arg(style).arg(items).arg(EMail), QMessageBox::Ok); } diff --git a/src/gui/qt/styles/gametablestylereader.cpp b/src/gui/qt/styles/gametablestylereader.cpp index 1c9c9908..7772f7f3 100644 --- a/src/gui/qt/styles/gametablestylereader.cpp +++ b/src/gui/qt/styles/gametablestylereader.cpp @@ -570,7 +570,7 @@ void GameTableStyleReader::setCardHolderStyle(QLabel *l, int bero) void GameTableStyleReader::setMenuBarStyle(QMenuBar *mb) { - mb->setStyleSheet("QMenuBar { background-color: #"+MenuBgColor+"; font-size:12px; } QMenuBar::item { color: #"+MenuTextColor+"; }"); + mb->setStyleSheet("QMenuBar { background-color: #"+MenuBgColor+"; font-size:12px; border-width: 0px;} QMenuBar::item { color: #"+MenuTextColor+"; }"); } void GameTableStyleReader::setBreakButtonStyle(QPushButton *bb, int state)