translation update ptbr and ru. backtolobby button more in foreground now. also warning window for leaving online-game

This commit is contained in:
doitux
2007-11-07 01:41:17 +00:00
parent 59ffc02872
commit e009f37df8
13 changed files with 750 additions and 521 deletions
-3
View File
@@ -3204,9 +3204,6 @@
<property name="focusPolicy" >
<enum>Qt::NoFocus</enum>
</property>
<property name="text" >
<string>Stop</string>
</property>
</widget>
</item>
</layout>
+105 -33
View File
@@ -21,6 +21,7 @@
#include "newgamedialogimpl.h"
#include "aboutpokerthimpl.h"
#include "mymessagedialogimpl.h"
#include "settingsdialogimpl.h"
#include "selectavatardialogimpl.h"
#include "joinnetworkgamedialogimpl.h"
@@ -77,6 +78,9 @@ mainWindowImpl::mainWindowImpl(ConfigFile *c, QMainWindow *parent)
setupUi(this);
//hide until he isnt really used TODO
pushButton_backToLobby->hide();
//Player0 pixmapCardsLabel needs Myw
pixmapLabel_card0b->setMyW(this);
pixmapLabel_card0a->setMyW(this);
@@ -923,6 +927,30 @@ void mainWindowImpl::joinGameLobby() {
// Clear Lobby dialog.
myGameLobbyDialog->clearDialog();
//set clean irc nick
QString myNick(QString::fromUtf8(myConfig->readConfigString("MyName").c_str()));
myNick.replace(QString::fromUtf8("é"),"e");
myNick.replace(QString::fromUtf8("è"),"e");
myNick.replace(QString::fromUtf8("á"),"a");
myNick.replace(QString::fromUtf8("à"),"a");
myNick.replace(QString::fromUtf8("ó"),"o");
myNick.replace(QString::fromUtf8("ò"),"o");
myNick.replace(QString::fromUtf8("ú"),"u");
myNick.replace(QString::fromUtf8("ù"),"u");
myNick.replace(QString::fromUtf8("É"),"E");
myNick.replace(QString::fromUtf8("È"),"E");
myNick.replace(QString::fromUtf8("Á"),"A");
myNick.replace(QString::fromUtf8("À"),"A");
myNick.replace(QString::fromUtf8("Ó"),"O");
myNick.replace(QString::fromUtf8("Ò"),"O");
myNick.replace(QString::fromUtf8("Ú"),"U");
myNick.replace(QString::fromUtf8("Ù"),"U");
myNick.remove(QRegExp("[^A-Z^a-z^0-9|\\-_\\\\^]*"));
myNick = myNick.mid(0,16);
mySession->setIrcNick(myNick.toUtf8().constData());
// Start client for dedicated server.
mySession->startInternetClient();
@@ -2742,14 +2770,16 @@ void mainWindowImpl::postRiverRunAnimation6() {
}
if( !DEBUG_MODE ) {
currentGameOver = TRUE;
pushButton_break->setDisabled(FALSE);
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Start"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Start"));
blinkingStartButtonAnimationTimer->start(500);
if(mySession->getGameType() == Session::GAME_TYPE_LOCAL) {
currentGameOver = TRUE;
pushButton_break->setDisabled(FALSE);
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Start"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Start"));
blinkingStartButtonAnimationTimer->start(500);
}
}
else {
callNewGameDialog();
@@ -2859,16 +2889,19 @@ void mainWindowImpl::startNewHand() {
mySession->getCurrentGame()->startHand();
}
else {
pushButton_break->setDisabled(FALSE);
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Start"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Start"));
breakAfterCurrentHand=FALSE;
blinkingStartButtonAnimationTimer->start(500);
if(mySession->getGameType() == Session::GAME_TYPE_LOCAL) {
pushButton_break->setDisabled(FALSE);
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Start"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Start"));
breakAfterCurrentHand=FALSE;
blinkingStartButtonAnimationTimer->start(500);
}
}
}
@@ -2915,7 +2948,7 @@ void mainWindowImpl::nextRoundCleanGui() {
flipHolecardsAllInAlreadyDone = FALSE;
//Wenn Pause zwischen den Hands in der Konfiguration steht den Stop Button drücken!
if (myConfig->readConfigInt("PauseBetweenHands") && blinkingStartButtonAnimationTimer->isActive() == FALSE ) {
if (myConfig->readConfigInt("PauseBetweenHands") && blinkingStartButtonAnimationTimer->isActive() == FALSE && mySession->getGameType() == Session::GAME_TYPE_LOCAL) {
pushButton_break->click();
}
else {
@@ -2925,14 +2958,15 @@ void mainWindowImpl::nextRoundCleanGui() {
}
//Clean breakbutton
blinkingStartButtonAnimationTimer->stop();
pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: white;}");
blinkingStartButtonAnimationTimer->stop();
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Stop"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Stop"));
if(mySession->getGameType() == Session::GAME_TYPE_LOCAL) {
blinkingStartButtonAnimationTimer->stop();
pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: white;}");
blinkingStartButtonAnimationTimer->stop();
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Stop"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_break->setText(tr("Stop"));
}
//Clear Statusbarmessage
statusBar()->clearMessage();
@@ -3006,7 +3040,11 @@ void mainWindowImpl::breakButtonClicked() {
pushButton_break->setDisabled(TRUE);
breakAfterCurrentHand=TRUE;
}
else {
else if (pushButton_break->text() == tr("Lobby")) {
leaveCurrentNetworkGame();
}
else if (pushButton_break->text() == tr("Start")) {
blinkingStartButtonAnimationTimer->stop();
//Set default Color
pushButton_break->setStyleSheet("QPushButton { background-color: #145300; color: white;}");
@@ -3336,8 +3374,10 @@ void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) {
if (event->key() == Qt::Key_F6) { radioButton_autoCheckFold->click(); }
if (event->key() == Qt::Key_F7) { radioButton_autoCheckCallAny->click(); }
if (event->key() == 16777249) { //CTRL
pushButton_break->click();
ctrlPressed = TRUE;
if(mySession->getGameType() == Session::GAME_TYPE_LOCAL) {
pushButton_break->click();
ctrlPressed = TRUE;
}
}
if (event->key() == Qt::Key_Escape && (myActionIsBet || myActionIsRaise)) {
meInAction();
@@ -3510,7 +3550,12 @@ void mainWindowImpl::localGameModification() {
setLabelArray[i]->stopTimeOutAnimation();
}
pushButton_break->show();
// pushButton_break->show();
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Stop"));
pushButton_break->setText(tr("Stop"));
pushButton_break->setMinimumSize(width+10,20);
pushButton_backToLobby->hide();
//Set the playing mode to "manual"
@@ -3528,8 +3573,13 @@ void mainWindowImpl::networkGameModification() {
tabWidget_Left->setCurrentIndex(1);
myChat->clearNewGame();
pushButton_break->hide();
// pushButton_break->hide();
pushButton_backToLobby->show();
QFontMetrics tempMetrics = this->fontMetrics();
int width = tempMetrics.width(tr("Lobby"));
pushButton_break->setText(tr("Lobby"));
pushButton_break->setMinimumSize(width+10,20);
//Set the playing mode to "manual"
radioButton_manualAction->click();
@@ -3666,6 +3716,28 @@ void mainWindowImpl::changeSpinBoxBetValue(int value) {
void mainWindowImpl::leaveCurrentNetworkGame() {
assert(mySession);
mySession->sendLeaveCurrentGame();
if (mySession->isNetworkClientRunning()) {
if(myConfig->readConfigInt("DisableBackToLobbyWarning")) {
assert(mySession);
mySession->sendLeaveCurrentGame();
}
else {
myMessageDialogImpl dialog(this);
dialog.setWindowTitle(tr("PokerTH - Internet Game Message"));
dialog.label_icon->setPixmap(QPixmap(myAppDataPath +"gfx/gui/misc/logoChip3D.png").scaled(50,50,Qt::KeepAspectRatio,Qt::SmoothTransformation));
dialog.label->setText(tr("Attention! Do you really want to leave the current game \nand go back to lobby?"));
if (dialog.exec() == QDialog::Accepted ) {
if(dialog.checkBox->isChecked()) {
myConfig->writeConfigInt("DisableBackToLobbyWarning",1);
myConfig->writeBuffer();
}
assert(mySession);
mySession->sendLeaveCurrentGame();
}
}
}
}
+123
View File
@@ -0,0 +1,123 @@
<ui version="4.0" >
<class>myMessageDialog</class>
<widget class="QDialog" name="myMessageDialog" >
<property name="geometry" >
<rect>
<x>0</x>
<y>0</y>
<width>275</width>
<height>118</height>
</rect>
</property>
<property name="windowTitle" >
<string>Dialog</string>
</property>
<layout class="QGridLayout" >
<property name="topMargin" >
<number>9</number>
</property>
<item row="0" column="0" >
<widget class="QLabel" name="label_icon" >
<property name="minimumSize" >
<size>
<width>50</width>
<height>50</height>
</size>
</property>
</widget>
</item>
<item rowspan="2" row="0" column="1" >
<layout class="QGridLayout" >
<item row="0" column="0" >
<widget class="QLabel" name="label" >
<property name="text" >
<string>MessageText</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeType" >
<enum>QSizePolicy::Fixed</enum>
</property>
<property name="sizeHint" >
<size>
<width>199</width>
<height>13</height>
</size>
</property>
</spacer>
</item>
<item row="2" column="0" >
<widget class="QCheckBox" name="checkBox" >
<property name="text" >
<string>Do not show this warning again.</string>
</property>
</widget>
</item>
<item row="3" column="0" >
<widget class="QDialogButtonBox" name="buttonBox" >
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons" >
<set>QDialogButtonBox::No|QDialogButtonBox::NoButton|QDialogButtonBox::Yes</set>
</property>
</widget>
</item>
</layout>
</item>
<item row="1" column="0" >
<spacer>
<property name="orientation" >
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" >
<size>
<width>20</width>
<height>81</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>myMessageDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel" >
<x>248</x>
<y>254</y>
</hint>
<hint type="destinationlabel" >
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>myMessageDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel" >
<x>316</x>
<y>260</y>
</hint>
<hint type="destinationlabel" >
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>
@@ -0,0 +1,27 @@
/***************************************************************************
* Copyright (C) 2006 by FThauer FHammer *
* f.thauer@web.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "mymessagedialogimpl.h"
myMessageDialogImpl::myMessageDialogImpl(QWidget *parent)
: QDialog(parent)
{
setupUi(this);
}
@@ -0,0 +1,32 @@
/***************************************************************************
* Copyright (C) 2006 by FThauer FHammer *
* f.thauer@web.de *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef MYMESSAGEDIALOGIMPL_H
#define MYMESSAGEDIALOGIMPL_H
#include "ui_mymessagedialog.h"
class myMessageDialogImpl: public QDialog, public Ui::myMessageDialog {
Q_OBJECT
public:
myMessageDialogImpl(QWidget *parent = 0);
};
#endif