Merge remote-tracking branch 'origin/master'

This commit is contained in:
doitux
2012-12-23 00:04:41 +01:00
22 changed files with 152 additions and 90 deletions
+16 -15
View File
@@ -1,20 +1,21 @@
2012-12-22 version 1.0-beta1 2012-12-22 version 1.0-beta1
- Support for bigger android screen resolutions enhancement(#160) - Support for higher android screen resolutions (enhancement #160)
- Android sound support enhancement (#156) - Android sound support (enhancement #156)
- Online log file analyse tool (#146) - Online log file analysis tool (enhancement #146)
- game name in window title enhancement (#155) - Game name in window title (enhancement #155)
- new card deck version for bottom action label possibility enhancement (#154) - New card deck version which supports changes of the action label position (enhancement #154)
- Emoticons for the chat enhancement (#153) - Emoticons for the chat (enhancement #153)
- Show only one game in log preview enhancement (#145) - Show only one game in the log preview (enhancement #145)
- Extra column in lobby game list for timeouts enhancement (#140) - Extra column in lobby game list for timeouts (enhancement #140)
- Update flags enhancement (#137) - Updated country flags (enhancement #137)
- Enable Activate the "accidentally call after big raise" blocker by default enhancement (#131) - Enable activating the "accidentally call after big raise" blocker by default (enhancement #131)
- Server refactoring for libprotobuf usage which basically enables html5 clients - Server refactoring using google protocol buffers which basically enables use of html5 clients
- Chatbot whitelist for poker expressions - Chatbot whitelist for poker expressions
- BUGFIX: Rich AI players raise although opponents are all-in bug (#4) - BUGFIX: Rich AI players raise although opponents are all-in (bug #4)
- BUGFIX: In rare case, winner doesn't win, money disappears (#3) - BUGFIX: In rare case, winner doesn't win, money disappears (bug #3)
- BUGFIX: Chip Miscalculation bug (#152) - BUGFIX: Chip Miscalculation fixed (bug #152)
- BUGFIX: IPv6 setting grayed out bug (#148) - BUGFIX: IPv6 settings are now correctly grayed out (bug #148)
- BUGFIX: Fixing rejoin after synchronization error (bug #147)
2012-06-21 version 0.9.5 2012-06-21 version 0.9.5
- First experimental Android release (#80) - First experimental Android release (#80)
+4
View File
@@ -578,6 +578,7 @@ mac {
-lssl \ -lssl \
-lsqlite3 \ -lsqlite3 \
-ltinyxml \ -ltinyxml \
-lprotobuf \
-lz \ -lz \
-framework \ -framework \
Carbon Carbon
@@ -657,4 +658,7 @@ maemo{
android_test{ android_test{
DEFINES += ANDROID DEFINES += ANDROID
DEFINES += ANDROID_TEST DEFINES += ANDROID_TEST
DEFINES += ANDROID_API8
HEADERS += src/gui/qt/sound/androidapi8dummy.h
SOURCES += src/gui/qt/sound/androidapi8dummy.cpp
} }
+3 -3
View File
@@ -490,7 +490,7 @@ void LocalHand::setBlinds()
(*it_c)->setMySet((*it_c)->getMyCash()); (*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this // 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1); (*it_c)->setMyAction(PLAYER_ACTION_ALLIN);
} else { } else {
(*it_c)->setMySet(smallBlind); (*it_c)->setMySet(smallBlind);
@@ -510,7 +510,7 @@ void LocalHand::setBlinds()
(*it_c)->setMySet((*it_c)->getMyCash()); (*it_c)->setMySet((*it_c)->getMyCash());
// 1 to do not log this // 1 to do not log this
(*it_c)->setMyAction(PLAYER_ACTION_ALLIN,1); (*it_c)->setMyAction(PLAYER_ACTION_ALLIN);
} else { } else {
(*it_c)->setMySet(2*smallBlind); (*it_c)->setMySet(2*smallBlind);
@@ -526,7 +526,7 @@ void LocalHand::switchRounds()
// logging last player action // logging last player action
PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID); PlayerListConstIterator previousPlayerIt = getRunningPlayerIt(previousPlayerID);
if(previousPlayerIt != runningPlayerList->end()) { if(previousPlayerIt != runningPlayerList->end()) {
if(myLog) myLog->logPlayerAction((*previousPlayerIt)->getMyName(),myLog->transformPlayerActionLog((*previousPlayerIt)->getMyAction()),(*previousPlayerIt)->getMySet()); if(myLog) myLog->logPlayerAction((*previousPlayerIt)->getMyName(),myLog->transformPlayerActionLog((*previousPlayerIt)->getMyAction()),(*previousPlayerIt)->getMyLastRelativeSet());
} }
PlayerListIterator it, it_1; PlayerListIterator it, it_1;
+11 -21
View File
@@ -1068,7 +1068,7 @@ void LocalPlayer::action()
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(myID); currentHand->setPreviousPlayerID(myID);
currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, myLastRelativeSet);
currentHand->getGuiInterface()->nextPlayerAnimation(); currentHand->getGuiInterface()->nextPlayerAnimation();
// cout << "playerID in action(): " << (*(currentHand->getCurrentBeRo()->getCurrentPlayersTurnIt()))->getMyID() << endl; // cout << "playerID in action(): " << (*(currentHand->getCurrentBeRo()->getCurrentPlayersTurnIt()))->getMyID() << endl;
@@ -3230,14 +3230,12 @@ void LocalPlayer::evaluation(int bet, int raise)
case 3: { case 3: {
// all in // all in
if(highestSet >= myCash + mySet) { if(highestSet >= myCash + mySet) {
mySet += myCash; setMySet(myCash);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - highestSet + mySet; setMySet(highestSet-mySet);
mySet = highestSet;
} }
} }
break; break;
@@ -3250,16 +3248,14 @@ void LocalPlayer::evaluation(int bet, int raise)
currentHand->getCurrentBeRo()->setFullBetRule(true); currentHand->getCurrentBeRo()->setFullBetRule(true);
} }
currentHand->getCurrentBeRo()->setMinimumRaise(myCash); currentHand->getCurrentBeRo()->setMinimumRaise(myCash);
mySet = myCash; setMySet(myCash);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
} }
// sonst // sonst
else { else {
currentHand->getCurrentBeRo()->setMinimumRaise(bet); currentHand->getCurrentBeRo()->setMinimumRaise(bet);
myCash = myCash - bet; setMySet(bet);
mySet = bet;
highestSet = mySet; highestSet = mySet;
} }
@@ -3272,14 +3268,12 @@ void LocalPlayer::evaluation(int bet, int raise)
if(currentHand->getCurrentBeRo()->getFullBetRule()) { // full bet rule -> only call possible if(currentHand->getCurrentBeRo()->getFullBetRule()) { // full bet rule -> only call possible
// all in // all in
if(highestSet >= myCash + mySet) { if(highestSet >= myCash + mySet) {
mySet += myCash; setMySet(myCash);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} }
// sonst // sonst
else { else {
myCash = myCash - highestSet + mySet; setMySet(highestSet-mySet);
mySet = highestSet;
myAction = PLAYER_ACTION_CALL; myAction = PLAYER_ACTION_CALL;
} }
} else { } else {
@@ -3292,8 +3286,7 @@ void LocalPlayer::evaluation(int bet, int raise)
// perhaps full bet rule // perhaps full bet rule
if(highestSet >= myCash + mySet) { if(highestSet >= myCash + mySet) {
// only call all-in // only call all-in
mySet += myCash; setMySet(myCash);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
} else { } else {
// raise, but not enough --> full bet rule // raise, but not enough --> full bet rule
@@ -3301,9 +3294,8 @@ void LocalPlayer::evaluation(int bet, int raise)
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash; setMySet(myCash);
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
} }
@@ -3311,9 +3303,8 @@ void LocalPlayer::evaluation(int bet, int raise)
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
mySet += myCash; setMySet(myCash);
currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet); currentHand->getCurrentBeRo()->setMinimumRaise(mySet-highestSet);
myCash = 0;
myAction = PLAYER_ACTION_ALLIN; myAction = PLAYER_ACTION_ALLIN;
highestSet = mySet; highestSet = mySet;
} }
@@ -3321,8 +3312,7 @@ void LocalPlayer::evaluation(int bet, int raise)
// sonst // sonst
else { else {
currentHand->getCurrentBeRo()->setMinimumRaise(raise); currentHand->getCurrentBeRo()->setMinimumRaise(raise);
myCash = myCash + mySet - highestSet - raise; setMySet(highestSet+raise-mySet);
mySet = highestSet + raise;
highestSet = mySet; highestSet = mySet;
// lastPlayerAction für Karten umblättern reihenfolge setzrn // lastPlayerAction für Karten umblättern reihenfolge setzrn
currentHand->setLastActionPlayerID(myUniqueID); currentHand->setLastActionPlayerID(myUniqueID);
+3 -3
View File
@@ -113,10 +113,10 @@ public:
return myLastRelativeSet; return myLastRelativeSet;
} }
void setMyAction(PlayerAction theValue, bool blind = 0) { void setMyAction(PlayerAction theValue, bool human = 0) {
myAction = theValue; myAction = theValue;
// logging for human player // logging for seat 0
if(myAction && !blind) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); if(myAction && human) currentHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, myLastRelativeSet);
} }
PlayerAction getMyAction() const { PlayerAction getMyAction() const {
return myAction; return myAction;
+1 -1
View File
@@ -195,7 +195,7 @@ ClientPlayer::getMyLastRelativeSet() const
} }
void void
ClientPlayer::setMyAction(PlayerAction theValue, bool /*blind*/) ClientPlayer::setMyAction(PlayerAction theValue, bool /*human*/)
{ {
boost::recursive_mutex::scoped_lock lock(m_syncMutex); boost::recursive_mutex::scoped_lock lock(m_syncMutex);
myAction = theValue; myAction = theValue;
+1 -1
View File
@@ -64,7 +64,7 @@ public:
int getMySet() const; int getMySet() const;
int getMyLastRelativeSet() const; int getMyLastRelativeSet() const;
void setMyAction(PlayerAction theValue, bool blind); void setMyAction(PlayerAction theValue, bool human);
PlayerAction getMyAction() const; PlayerAction getMyAction() const;
void setMyButton(int theValue); void setMyButton(int theValue);
+2 -2
View File
@@ -62,8 +62,8 @@ public:
virtual int getMySet() const =0; virtual int getMySet() const =0;
virtual int getMyLastRelativeSet() const =0; virtual int getMyLastRelativeSet() const =0;
virtual void setMyAction(PlayerAction theValue, bool blind=0) =0; virtual void setMyAction(PlayerAction theValue, bool human=0) =0;
virtual PlayerAction getMyAction() const =0; virtual PlayerAction getMyAction() const =0;
virtual void setMyButton(int theValue) =0; virtual void setMyButton(int theValue) =0;
virtual int getMyButton() const =0; virtual int getMyButton() const =0;
+15
View File
@@ -103,6 +103,21 @@ enum PlayerActionLog {
LOG_ACTION_JOIN // has joined the game LOG_ACTION_JOIN // has joined the game
}; };
#define LOG_UPLOAD_ID_SIZE 40
enum LogUploadErrorCode {
LOG_UPLOAD_ERROR_NO_FILE = 1,
LOG_UPLOAD_ERROR_OPEN_DB = 2,
LOG_UPLOAD_ERROR_MAX_NUM_TOTAL = 3,
LOG_UPLOAD_ERROR_MAX_NUM_IP = 4,
LOG_UPLOAD_ERROR_FILE_SIZE = 5,
LOG_UPLOAD_ERROR_FILE_EXT = 6,
LOG_UPLOAD_ERROR_FILE_HEAD = 7,
LOG_UPLOAD_ERROR_ID = 8,
LOG_UPLOAD_ERROR_FILE_MOVE = 9,
LOG_UPLOAD_ERROR_INSERT_DB = 10
};
enum DenyKickPlayerReason { enum DenyKickPlayerReason {
KICK_DENIED_INVALID_STATE = 0, KICK_DENIED_INVALID_STATE = 0,
KICK_DENIED_TOO_FEW_PLAYERS, KICK_DENIED_TOO_FEW_PLAYERS,
+4 -2
View File
@@ -21,8 +21,10 @@
#include <QtCore> #include <QtCore>
#ifdef ANDROID #ifdef ANDROID
#include <QPlatformNativeInterface> #ifndef ANDROID_TEST
#include <jni.h> #include <QPlatformNativeInterface>
#include <jni.h>
#endif
#endif #endif
aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c) aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
@@ -97,9 +97,9 @@ void changeCompleteBlindsDialogImpl::sortBlindsList()
bool changeCompleteBlindsDialogImpl::eventFilter(QObject *obj, QEvent *event) bool changeCompleteBlindsDialogImpl::eventFilter(QObject *obj, QEvent *event)
{ {
#ifdef ANDROID
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi changes for return key behavior (hopefully useless from necessitas beta2) //androi changes for return key behavior (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(spinBox_afterThisAlwaysRaiseValue->hasFocus()) { if(spinBox_afterThisAlwaysRaiseValue->hasFocus()) {
@@ -113,9 +113,9 @@ void changeContentDialogImpl::saveContent()
bool changeContentDialogImpl::eventFilter(QObject *obj, QEvent *event) bool changeContentDialogImpl::eventFilter(QObject *obj, QEvent *event)
{ {
#ifdef ANDROID
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi changes for return key behavior (hopefully useless from necessitas beta2) //androi changes for return key behavior (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(lineEdit->hasFocus()) { if(lineEdit->hasFocus()) {
@@ -235,9 +235,9 @@ void createInternetGameDialogImpl::gameTypeChanged()
bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event) bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
{ {
#ifdef ANDROID
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi changes for return key behavior (hopefully useless from necessitas beta2) //androi changes for return key behavior (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(spinBox_startCash->hasFocus()) { if(spinBox_startCash->hasFocus()) {
@@ -132,9 +132,9 @@ void createNetworkGameDialogImpl::callChangeBlindsDialog(bool show)
bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event) bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
{ {
#ifdef ANDROID
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi changes for return key behavior (hopefully useless from necessitas beta2) //androi changes for return key behavior (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(spinBox_startCash ->hasFocus()) { if(spinBox_startCash ->hasFocus()) {
+8 -8
View File
@@ -1990,7 +1990,7 @@ void gameTableImpl::myFold()
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front(); boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front();
humanPlayer->setMyAction(PLAYER_ACTION_FOLD); humanPlayer->setMyAction(PLAYER_ACTION_FOLD,true);
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
@@ -2009,7 +2009,7 @@ void gameTableImpl::myCheck()
boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand(); boost::shared_ptr<HandInterface> currentHand = myStartWindow->getSession()->getCurrentGame()->getCurrentHand();
boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front(); boost::shared_ptr<PlayerInterface> humanPlayer = currentHand->getSeatsList()->front();
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
humanPlayer->setMyAction(PLAYER_ACTION_CHECK); humanPlayer->setMyAction(PLAYER_ACTION_CHECK,true);
//set that i was the last active player. need this for unhighlighting groupbox //set that i was the last active player. need this for unhighlighting groupbox
currentHand->setPreviousPlayerID(0); currentHand->setPreviousPlayerID(0);
@@ -2072,10 +2072,10 @@ void gameTableImpl::myCall()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN,true);
} else { } else {
humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet()); humanPlayer->setMySet(tempHighestSet - humanPlayer->getMySet());
humanPlayer->setMyAction(PLAYER_ACTION_CALL); humanPlayer->setMyAction(PLAYER_ACTION_CALL,true);
} }
humanPlayer->setMyTurn(0); humanPlayer->setMyTurn(0);
@@ -2108,7 +2108,7 @@ void gameTableImpl::mySet()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN,true);
// full bet rule // full bet rule
if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) {
@@ -2119,7 +2119,7 @@ void gameTableImpl::mySet()
if(myActionIsRaise) { if(myActionIsRaise) {
//do not if allIn //do not if allIn
if(humanPlayer->getMyAction() != 6) { if(humanPlayer->getMyAction() != 6) {
humanPlayer->setMyAction(PLAYER_ACTION_RAISE); humanPlayer->setMyAction(PLAYER_ACTION_RAISE,true);
} }
myActionIsRaise = 0; myActionIsRaise = 0;
@@ -2129,7 +2129,7 @@ void gameTableImpl::mySet()
if(myActionIsBet) { if(myActionIsBet) {
//do not if allIn //do not if allIn
if(humanPlayer->getMyAction() != 6) { if(humanPlayer->getMyAction() != 6) {
humanPlayer->setMyAction(PLAYER_ACTION_BET); humanPlayer->setMyAction(PLAYER_ACTION_BET,true);
} }
myActionIsBet = 0; myActionIsBet = 0;
@@ -2166,7 +2166,7 @@ void gameTableImpl::myAllIn()
humanPlayer->setMySet(humanPlayer->getMyCash()); humanPlayer->setMySet(humanPlayer->getMyCash());
humanPlayer->setMyCash(0); humanPlayer->setMyCash(0);
humanPlayer->setMyAction(PLAYER_ACTION_ALLIN); humanPlayer->setMyAction(PLAYER_ACTION_ALLIN,true);
// full bet rule // full bet rule
if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) { if(currentHand->getCurrentBeRo()->getHighestSet() + currentHand->getCurrentBeRo()->getMinimumRaise() > humanPlayer->getMySet()) {
+1 -1
View File
@@ -21,9 +21,9 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <sqlite3.h>
#include "configfile.h" #include "configfile.h"
#include <sqlite3.h>
#include <QtCore> #include <QtCore>
#include <QtGui> #include <QtGui>
@@ -152,9 +152,9 @@ void internetGameLoginDialogImpl::okButtonCheck()
bool internetGameLoginDialogImpl::eventFilter(QObject *obj, QEvent *event) bool internetGameLoginDialogImpl::eventFilter(QObject *obj, QEvent *event)
{ {
#ifdef ANDROID
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi changes for return key behavior (hopefully useless from necessitas beta2) //androi changes for return key behavior (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(lineEdit_username->hasFocus()) { if(lineEdit_username->hasFocus()) {
+32 -5
View File
@@ -27,6 +27,7 @@
#include "guilog.h" #include "guilog.h"
#include "configfile.h" #include "configfile.h"
#include "mymessagebox.h" #include "mymessagebox.h"
#include <game_defs.h>
#include <net/uploaderthread.h> #include <net/uploaderthread.h>
LogFileDialog::LogFileDialog(QWidget *parent, ConfigFile *c) : LogFileDialog::LogFileDialog(QWidget *parent, ConfigFile *c) :
@@ -223,7 +224,7 @@ void LogFileDialog::uploadFile()
uploadInProgressAnimationStart(); uploadInProgressAnimationStart();
uploader->QueueUpload( uploader->QueueUpload(
"http://pokerth.net/log_file_analysis/upload.php", "http://pokerth.net/log_file_analysis/upload.php",
"", "",
"", "",
file.fileName().toStdString(), file.fileName().toStdString(),
@@ -260,16 +261,42 @@ void LogFileDialog::showLogAnalysis(QString /*filename*/, QString returnMessage)
QString id = returnMessage.trimmed(); QString id = returnMessage.trimmed();
if(id.length() == 40 && !id.contains("ERROR")) { if(id.length() == LOG_UPLOAD_ID_SIZE && id.at(0) != '<') {
qDebug() << id << endl; qDebug() << id << endl;
QDesktopServices::openUrl(QUrl("http://logfile-analysis.pokerth.net/?ID="+id)); QDesktopServices::openUrl(QUrl("http://logfile-analysis.pokerth.net/?ID="+id));
} else { } else {
qDebug() << returnMessage << endl; qDebug() << returnMessage << endl;
QString serverMsg(tr("Processing of the log file on the web server failed.\nPlease verify that you are uploading a valid PokerTH log file.")); QString serverMsg(tr("Processing of the log file on the web server failed.\nPlease verify that you are uploading a valid PokerTH log file."));
// if there is a readable message, display it. // if there is an error code, display a corresponding message.
if (!returnMessage.isEmpty() && returnMessage.size() < 128) { if (returnMessage.at(0).isDigit()) {
serverMsg += "\n" + tr("Failure reason: ") + returnMessage; serverMsg += "\n" + tr("Failure reason: ");
switch (returnMessage.toInt())
{
case LOG_UPLOAD_ERROR_NO_FILE :
serverMsg += tr("No file received.");
break;
case LOG_UPLOAD_ERROR_MAX_NUM_TOTAL :
serverMsg += tr("File rejected because of too many uploads.");
break;
case LOG_UPLOAD_ERROR_MAX_NUM_IP :
serverMsg += tr("File rejected because of too many recent uploads. Please try again later.");
break;
case LOG_UPLOAD_ERROR_FILE_SIZE :
serverMsg += tr("The file is too large.");
break;
case LOG_UPLOAD_ERROR_FILE_EXT :
case LOG_UPLOAD_ERROR_FILE_HEAD :
serverMsg += tr("This file is not a valid and current PokerTH log file.");
break;
case LOG_UPLOAD_ERROR_OPEN_DB :
case LOG_UPLOAD_ERROR_ID :
case LOG_UPLOAD_ERROR_FILE_MOVE :
case LOG_UPLOAD_ERROR_INSERT_DB :
default :
serverMsg += tr("Internal error. Please try again later. ID: ") + returnMessage;
break;
}
} }
MyMessageBox::warning( MyMessageBox::warning(
this, tr("Uploading log file"), serverMsg, QMessageBox::Close ); this, tr("Uploading log file"), serverMsg, QMessageBox::Close );
@@ -84,9 +84,9 @@ void newGameDialogImpl::callChangeBlindsDialog(bool show)
bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event) bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
{ {
#ifdef ANDROID
QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event); QKeyEvent *keyEvent = static_cast<QKeyEvent*>(event);
#ifdef ANDROID
//androi changes for return key behavior (hopefully useless from necessitas beta2) //androi changes for return key behavior (hopefully useless from necessitas beta2)
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) { if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
if(spinBox_gameSpeed->hasFocus()) { if(spinBox_gameSpeed->hasFocus()) {
+11 -11
View File
@@ -1,13 +1,13 @@
#include "soundevents.h" #include "soundevents.h"
#ifdef ANDROID #ifdef ANDROID
#ifdef ANDROID_API8 #ifdef ANDROID_API8
#include "androidapi8dummy.h" #include "androidapi8dummy.h"
#else
#include "androidaudio.h"
#endif
#else #else
#include "androidaudio.h" #include "sdlplayer.h"
#endif
#else
#include "sdlplayer.h"
#endif #endif
@@ -22,11 +22,11 @@ SoundEvents::SoundEvents(ConfigFile *c): myConfig(c), lastSBValue(0), lastSBLeve
{ {
#ifdef ANDROID #ifdef ANDROID
#ifdef ANDROID_API8 #ifdef ANDROID_API8
myPlayer = new AndroidApi8Dummy(myConfig); myPlayer = new AndroidApi8Dummy(myConfig);
#else #else
myPlayer = new AndroidAudio(myConfig); myPlayer = new AndroidAudio(myConfig);
#endif #endif
#else #else
myPlayer = new SDLPlayer(myConfig); myPlayer = new SDLPlayer(myConfig);
#endif #endif
+12 -11
View File
@@ -4,13 +4,13 @@
#include <string> #include <string>
#ifdef ANDROID #ifdef ANDROID
#ifdef ANDROID_API8 #ifdef ANDROID_API8
class AndroidApi8Dummy; class AndroidApi8Dummy;
#else
class AndroidAudio;
#endif
#else #else
class AndroidAudio; class SDLPlayer;
#endif
#else
class SDLPlayer;
#endif #endif
@@ -34,14 +34,15 @@ protected:
private: private:
#ifdef ANDROID #ifdef ANDROID
#ifdef ANDROID_API8 #ifdef ANDROID_API8
AndroidApi8Dummy *myPlayer; AndroidApi8Dummy *myPlayer;
#else #else
AndroidAudio *myPlayer; AndroidAudio *myPlayer;
#endif #endif
#else #else
SDLPlayer *myPlayer; SDLPlayer *myPlayer;
#endif #endif
ConfigFile *myConfig; ConfigFile *myConfig;
int lastSBValue; int lastSBValue;
unsigned int lastSBLevel; unsigned int lastSBLevel;
@@ -46,6 +46,13 @@
#include "logfiledialog.h" #include "logfiledialog.h"
#include "guilog.h" #include "guilog.h"
#ifdef ANDROID
#ifndef ANDROID_TEST
#include <QPlatformNativeInterface>
#include <jni.h>
#endif
#endif
using namespace std; using namespace std;
startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
@@ -99,6 +106,21 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
} }
this->showFullScreen(); this->showFullScreen();
//TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(TRUE)
#ifndef ANDROID_TEST
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
JNIEnv* env;
if (currVM->AttachCurrentThread(&env, NULL)<0) {
qCritical()<<"AttachCurrentThread failed";
} else {
// jclass jclassApplicationClass = env->FindClass("android/view/View");
// if (jclassApplicationClass) {
// env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1);
// }
currVM->DetachCurrentThread();
}
#endif
#else #else
// this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }"); // this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }");
this->menubar->hide(); this->menubar->hide();