gametable adjustments for 1.000.000 number style. transparent menubars.

This commit is contained in:
doitux
2009-05-13 09:31:13 +00:00
parent 41ab1ff83d
commit b677da1ae6
8 changed files with 200 additions and 133 deletions
@@ -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;
}
+121 -87
View File
@@ -1597,6 +1597,9 @@
</item>
<item row="2" column="1">
<layout class="QHBoxLayout" name="horizontalLayout_6">
<property name="spacing">
<number>0</number>
</property>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
@@ -1620,13 +1623,13 @@
</property>
<property name="minimumSize">
<size>
<width>580</width>
<width>600</width>
<height>94</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>535</width>
<width>600</width>
<height>94</height>
</size>
</property>
@@ -1640,90 +1643,6 @@
<property name="spacing">
<number>0</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<item>
<widget class="QLabel" name="label_Pot">
<property name="minimumSize">
<size>
<width>145</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QGridLayout" name="grid2">
<property name="horizontalSpacing">
<number>3</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="1" column="1">
<widget class="QLabel" name="textLabel_Sets">
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_Total">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textLabel_Pot">
<property name="minimumSize">
<size>
<width>75</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Sets">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<spacer name="horizontalSpacer_3">
<property name="orientation">
@@ -1981,6 +1900,121 @@
<bool>true</bool>
</property>
</widget>
<zorder>pixmapLabel_cardBoard4</zorder>
<zorder>pixmapLabel_cardBoard1</zorder>
<zorder>label_CardHolder1</zorder>
<zorder>label_CardHolder0</zorder>
<zorder>pixmapLabel_cardBoard0</zorder>
<zorder>label_CardHolder4</zorder>
<zorder>label_CardHolder2</zorder>
<zorder>pixmapLabel_cardBoard2</zorder>
<zorder>label_CardHolder3</zorder>
<zorder>pixmapLabel_cardBoard3</zorder>
<zorder>frame_2</zorder>
</widget>
</item>
<item row="0" column="0">
<widget class="QFrame" name="frame_2">
<layout class="QVBoxLayout" name="verticalLayout_4">
<property name="spacing">
<number>0</number>
</property>
<property name="leftMargin">
<number>0</number>
</property>
<property name="topMargin">
<number>8</number>
</property>
<property name="rightMargin">
<number>0</number>
</property>
<property name="bottomMargin">
<number>8</number>
</property>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<property name="spacing">
<number>0</number>
</property>
<item>
<widget class="QLabel" name="label_Pot">
<property name="minimumSize">
<size>
<width>144</width>
<height>0</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_5">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>17</width>
<height>17</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QGridLayout" name="grid2">
<property name="horizontalSpacing">
<number>3</number>
</property>
<property name="verticalSpacing">
<number>2</number>
</property>
<property name="margin">
<number>0</number>
</property>
<item row="1" column="1">
<widget class="QLabel" name="textLabel_Sets">
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="0">
<widget class="QLabel" name="label_Total">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="QLabel" name="textLabel_Pot">
<property name="minimumSize">
<size>
<width>90</width>
<height>0</height>
</size>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
</property>
</widget>
</item>
<item row="1" column="0">
<widget class="QLabel" name="label_Sets">
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
</layout>
@@ -3538,7 +3572,7 @@
<x>0</x>
<y>0</y>
<width>1024</width>
<height>25</height>
<height>27</height>
</rect>
</property>
<widget class="QMenu" name="menuView">
+38 -38
View File
@@ -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());
}
+2 -1
View File
@@ -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) {
+32 -1
View File
@@ -60,6 +60,12 @@
</property>
<item>
<widget class="QPushButton" name="pushButtonStart_Local_Game">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@@ -80,6 +86,12 @@
</item>
<item>
<widget class="QPushButton" name="pushButtonInternet_Game">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@@ -100,6 +112,12 @@
</item>
<item>
<widget class="QPushButton" name="pushButton_Create_Network_Game">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@@ -120,6 +138,12 @@
</item>
<item>
<widget class="QPushButton" name="pushButton_Join_Network_Game">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
</property>
@@ -168,7 +192,7 @@
</item>
</layout>
</widget>
<widget class="QMenuBar" name="menubar">
<widget class="MyMenuBar" name="menubar">
<property name="geometry">
<rect>
<x>0</x>
@@ -273,6 +297,13 @@
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>MyMenuBar</class>
<extends>QMenuBar</extends>
<header>mymenubar.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="resources/pokerth.qrc"/>
</resources>
+2 -1
View File
@@ -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;}");
+2 -2
View File
@@ -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);
}
+1 -1
View File
@@ -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)