Running astyle.
This commit is contained in:
@@ -21,8 +21,8 @@
|
||||
#include <QtCore>
|
||||
|
||||
#ifdef ANDROID
|
||||
#include <QPlatformNativeInterface>
|
||||
#include <jni.h>
|
||||
#include <QPlatformNativeInterface>
|
||||
#include <jni.h>
|
||||
#endif
|
||||
|
||||
aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
@@ -39,11 +39,11 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
QPalette myPalette = textBrowser_licence->palette();
|
||||
#ifdef GUI_800x480
|
||||
#ifdef ANDROID
|
||||
myPalette.setColor(QPalette::Base, QColor(255,255,255,255));
|
||||
myPalette.setColor(QPalette::Text, QColor(0,0,0,255));
|
||||
myPalette.setColor(QPalette::Base, QColor(255,255,255,255));
|
||||
myPalette.setColor(QPalette::Text, QColor(0,0,0,255));
|
||||
#else
|
||||
myPalette.setColor(QPalette::Base, QColor(0,0,0,255));
|
||||
myPalette.setColor(QPalette::Text, QColor(255,255,255,255));
|
||||
myPalette.setColor(QPalette::Base, QColor(0,0,0,255));
|
||||
myPalette.setColor(QPalette::Text, QColor(255,255,255,255));
|
||||
#endif
|
||||
#else
|
||||
QColor myColor = myPalette.color(QPalette::Window);
|
||||
@@ -52,7 +52,7 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
textBrowser_licence->setPalette(myPalette);
|
||||
textBrowser_2->setPalette(myPalette);
|
||||
textBrowser_3->setPalette(myPalette);
|
||||
textBrowser_4->setPalette(myPalette);
|
||||
textBrowser_4->setPalette(myPalette);
|
||||
|
||||
QFile gplFile(QDir::toNativeSeparators(myAppDataPath+"misc/agpl.html"));
|
||||
QString gplString;
|
||||
@@ -68,32 +68,31 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
label_logo->setPixmap(QPixmap(":/gfx/logoChip3D.png"));
|
||||
|
||||
#ifdef GUI_800x480
|
||||
label_pokerthVersion->setStyleSheet("QLabel { font-size: 30px; font-weight: bold;}");
|
||||
label_pokerthVersion->setStyleSheet("QLabel { font-size: 30px; font-weight: bold;}");
|
||||
#else
|
||||
label_pokerthVersion->setStyleSheet("QLabel { font-size: 16px; font-weight: bold;}");
|
||||
#endif
|
||||
|
||||
#ifdef ANDROID
|
||||
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
|
||||
JNIEnv* env;
|
||||
int api = -2;
|
||||
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
||||
qCritical()<<"AttachCurrentThread failed";
|
||||
}
|
||||
else {
|
||||
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
|
||||
if (jclassApplicationClass) {
|
||||
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
|
||||
}
|
||||
currVM->DetachCurrentThread();
|
||||
}
|
||||
label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api)));
|
||||
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
|
||||
JNIEnv* env;
|
||||
int api = -2;
|
||||
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
||||
qCritical()<<"AttachCurrentThread failed";
|
||||
} else {
|
||||
jclass jclassApplicationClass = env->FindClass("android/os/Build$VERSION");
|
||||
if (jclassApplicationClass) {
|
||||
api = env->GetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"SDK_INT", "I"));
|
||||
}
|
||||
currVM->DetachCurrentThread();
|
||||
}
|
||||
label_pokerthVersion->setText(QString(tr("PokerTH %1 for Android (API%2)").arg(POKERTH_BETA_RELEASE_STRING).arg(api)));
|
||||
#else
|
||||
label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
label_pokerthVersion->setText(QString(tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
#endif
|
||||
this->setWindowTitle(QString(tr("About PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
|
||||
//add text to lables and textbrowsers
|
||||
//add text to lables and textbrowsers
|
||||
QString thxToInfos;
|
||||
thxToInfos.append(tr("- Wikimedia Commons: for different popular avatar picture resources")+"<br>");
|
||||
thxToInfos.append(tr("- Benedikt, Erhard, Felix, Florian, Linus, Lothar, Steffi, Caro: for people avatar pictures")+"<br>");
|
||||
@@ -102,36 +101,36 @@ aboutPokerthImpl::aboutPokerthImpl(QWidget *parent, ConfigFile *c)
|
||||
thxToInfos.append(tr("- doc_dos: for self recorded chip sounds")+"<br>");
|
||||
thxToInfos.append(tr("- thiger, dunkanx, BerndA, coldz, drull: for different patches")+"<br>");
|
||||
thxToInfos.append(tr("- kraut: for internet-game-server hosting and administration")+"<br>");
|
||||
thxToInfos.append(tr("- danuxi: for startwindow background gfx and danuxi1 table background")+"<br>");
|
||||
thxToInfos.append(tr("- danuxi: for startwindow background gfx and danuxi1 table background")+"<br>");
|
||||
thxToInfos.append(tr("- heyn: for moderating forum and organise bugtracker and feature requests")+"<br>");
|
||||
thxToInfos.append(tr("- texas_outlaw: for new table sounds")+"<br>");
|
||||
textBrowser_3->setHtml(thxToInfos);
|
||||
|
||||
QString infoText;
|
||||
infoText.append(tr("- Poker engine for the popular Texas Hold'em Poker")+"\n");
|
||||
infoText.append(tr("- Singleplayer games with up to 9 computer-opponents")+"\n");
|
||||
infoText.append(tr("- Multiplayer network games")+"\n");
|
||||
infoText.append(tr("- Internet online games")+"\n");
|
||||
infoText.append(tr("- Changeable gui with online style gallery")+"\n");
|
||||
infoText.append(tr("- Online ranking website with result tables")+"\n");
|
||||
infoText.append("\n");
|
||||
QString thisYear = QDate::currentDate().toString("yyyy");
|
||||
infoText.append("(c)2006-"+thisYear+", Felix Hammer, Florian Thauer, Lothar May");
|
||||
label_infotext->setText(infoText);
|
||||
QString infoText;
|
||||
infoText.append(tr("- Poker engine for the popular Texas Hold'em Poker")+"\n");
|
||||
infoText.append(tr("- Singleplayer games with up to 9 computer-opponents")+"\n");
|
||||
infoText.append(tr("- Multiplayer network games")+"\n");
|
||||
infoText.append(tr("- Internet online games")+"\n");
|
||||
infoText.append(tr("- Changeable gui with online style gallery")+"\n");
|
||||
infoText.append(tr("- Online ranking website with result tables")+"\n");
|
||||
infoText.append("\n");
|
||||
QString thisYear = QDate::currentDate().toString("yyyy");
|
||||
infoText.append("(c)2006-"+thisYear+", Felix Hammer, Florian Thauer, Lothar May");
|
||||
label_infotext->setText(infoText);
|
||||
|
||||
QString projectText;
|
||||
projectText.append("<b>"+tr("Project page:")+"</b><br>");
|
||||
projectText.append(" <a href='http://www.pokerth.net'>http://www.pokerth.net</a><br>");
|
||||
projectText.append("<b>IRC:</b><br>");
|
||||
projectText.append(" #pokerth (irc.freenode.net)<br>");
|
||||
projectText.append("<b>"+tr("Authors:")+"</b><br>");
|
||||
projectText.append(" Felix Hammer (<a href=mailto:doitux@pokerth.net>doitux@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("initial idea, basic architecture, gui implementation, gui graphics editing, linux package")+"<br>");
|
||||
projectText.append(" Florian Thauer (<a href=mailto:floty@pokerth.net>floty@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("initial idea, basic architecture, engine development")+"<br>");
|
||||
projectText.append(" Lothar May (<a href=mailto:lotodore@pokerth.net>lotodore@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("basic architecture, network development, windows package, MacOS package")+"<br>");
|
||||
projectText.append(" Oskar Lindqvist (<a href=mailto:tranberry@pokerth.net>tranberry@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("initial gui graphics design")+"<br>");
|
||||
textBrowser_2->setHtml(projectText);
|
||||
QString projectText;
|
||||
projectText.append("<b>"+tr("Project page:")+"</b><br>");
|
||||
projectText.append(" <a href='http://www.pokerth.net'>http://www.pokerth.net</a><br>");
|
||||
projectText.append("<b>IRC:</b><br>");
|
||||
projectText.append(" #pokerth (irc.freenode.net)<br>");
|
||||
projectText.append("<b>"+tr("Authors:")+"</b><br>");
|
||||
projectText.append(" Felix Hammer (<a href=mailto:doitux@pokerth.net>doitux@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("initial idea, basic architecture, gui implementation, gui graphics editing, linux package")+"<br>");
|
||||
projectText.append(" Florian Thauer (<a href=mailto:floty@pokerth.net>floty@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("initial idea, basic architecture, engine development")+"<br>");
|
||||
projectText.append(" Lothar May (<a href=mailto:lotodore@pokerth.net>lotodore@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("basic architecture, network development, windows package, MacOS package")+"<br>");
|
||||
projectText.append(" Oskar Lindqvist (<a href=mailto:tranberry@pokerth.net>tranberry@pokerth.net</a>)<br>");
|
||||
projectText.append(" - "+tr("initial gui graphics design")+"<br>");
|
||||
textBrowser_2->setHtml(projectText);
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ changeCompleteBlindsDialogImpl::changeCompleteBlindsDialogImpl(QWidget *parent,
|
||||
setWindowModality(Qt::ApplicationModal);
|
||||
setWindowFlags(Qt::WindowSystemMenuHint | Qt::CustomizeWindowHint | Qt::Dialog);
|
||||
#endif
|
||||
setupUi(this);
|
||||
setupUi(this);
|
||||
this->installEventFilter(this);
|
||||
|
||||
connect( pushButton_add, SIGNAL( clicked() ), this, SLOT( addBlindValueToList() ) );
|
||||
@@ -54,8 +54,8 @@ void changeCompleteBlindsDialogImpl::addBlindValueToList()
|
||||
|
||||
if(listWidget_blinds->count() == 30) {
|
||||
MyMessageBox::warning(this, tr("Manual Blinds Order"),
|
||||
tr("You cannot set more than 30 manual blinds."),
|
||||
QMessageBox::Close);
|
||||
tr("You cannot set more than 30 manual blinds."),
|
||||
QMessageBox::Close);
|
||||
} else {
|
||||
listWidget_blinds->addItem(QString::number(spinBox_input->value(),10));
|
||||
sortBlindsList();
|
||||
@@ -119,12 +119,10 @@ bool changeCompleteBlindsDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
this->reject();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ class changeCompleteBlindsDialogImpl: public QDialog, public Ui::changeCompleteB
|
||||
public:
|
||||
changeCompleteBlindsDialogImpl(QWidget *parent = 0, ConfigFile *c = 0);
|
||||
|
||||
void exec();
|
||||
void exec();
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
public slots:
|
||||
|
||||
@@ -123,12 +123,10 @@ bool changeContentDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
this->reject();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ using namespace std;
|
||||
ChatTools::ChatTools(QLineEdit* l, ConfigFile *c, ChatType ct, QTextBrowser *b, QStandardItemModel *m, gameLobbyDialogImpl *lo) : nickAutoCompletitionCounter(0), myLineEdit(l), myNickListModel(m), myNickStringList(NULL), myTextBrowser(b), myChatType(ct), myConfig(c), myNick(""), myLobby(lo)
|
||||
{
|
||||
myNick = QString::fromUtf8(myConfig->readConfigString("MyName").c_str());
|
||||
ignoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
ignoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
}
|
||||
|
||||
ChatTools::~ChatTools()
|
||||
@@ -83,7 +83,7 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
|
||||
tempMsg = QString("<span style=\"font-weight:bold; color:red;\">"+message+"</span>");
|
||||
//play beep sound only in INET-lobby-chat
|
||||
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
}
|
||||
} else if(message.contains(myNick, Qt::CaseInsensitive)) {
|
||||
|
||||
@@ -93,7 +93,7 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
|
||||
//play beep sound only in INET-lobby-chat
|
||||
// TODO dont play when message is from yourself
|
||||
if(myLobby->isVisible() && myConfig->readConfigInt("PlayLobbyChatNotification")) {
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
myLobby->getMyW()->getMySoundEventHandler()->playSound("lobbychatnotify",0);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -154,14 +154,14 @@ void ChatTools::receiveMessage(QString playerName, QString message, bool pm)
|
||||
|
||||
if(!nickFoundOnIgnoreList) {
|
||||
|
||||
tempMsg = checkForEmotes(tempMsg);
|
||||
tempMsg = checkForEmotes(tempMsg);
|
||||
|
||||
if(message.indexOf(QString("/me "))==0) {
|
||||
myTextBrowser->append(tempMsg.replace("/me ","<i>*"+playerName+" ")+"</i>");
|
||||
} else if(pm == true) {
|
||||
myTextBrowser->append("<i>"+playerName+"(pm): " + tempMsg+"</i>");
|
||||
} else {
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
myTextBrowser->append(playerName + ": " + tempMsg);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -315,39 +315,40 @@ unsigned ChatTools::parsePrivateMessageTarget(QString &chatText)
|
||||
return playerId;
|
||||
}
|
||||
|
||||
QString ChatTools::checkForEmotes(QString msg) {
|
||||
QString ChatTools::checkForEmotes(QString msg)
|
||||
{
|
||||
|
||||
msg.replace("0:-)", "<img src=\":emotes/emotes/face-angel.png\" />");
|
||||
msg.replace("X-(", "<img src=\":emotes/emotes/face-angry.png\" />");
|
||||
msg.replace("B-)", "<img src=\":emotes/emotes/face-cool.png\" />");
|
||||
msg.replace("8-)", "<img src=\":emotes/emotes/face-cool.png\" />");
|
||||
msg.replace(":'(", "<img src=\":emotes/emotes/face-crying.png\" />");
|
||||
msg.replace(">:-)", "<img src=\":emotes/emotes/face-devilish.png\" />");
|
||||
msg.replace(":-[", "<img src=\":emotes/emotes/face-embarrassed.png\" />");
|
||||
msg.replace(":-*", "<img src=\":emotes/emotes/face-kiss.png\" />");
|
||||
msg.replace(":-))", "<img src=\":emotes/emotes/face-laugh.png\" />");
|
||||
msg.replace(":))", "<img src=\":emotes/emotes/face-laugh.png\" />");
|
||||
msg.replace(":-|", "<img src=\":emotes/emotes/face-plain.png\" />");
|
||||
msg.replace(":-P", "<img src=\":emotes/emotes/face-raspberry.png\" />");
|
||||
msg.replace(":-p", "<img src=\":emotes/emotes/face-raspberry.png\" />");
|
||||
msg.replace(":-(", "<img src=\":emotes/emotes/face-sad.png\" />");
|
||||
msg.replace(":(", "<img src=\":emotes/emotes/face-sad.png\" />");
|
||||
msg.replace(":-&", "<img src=\":emotes/emotes/face-sick.png\" />");
|
||||
msg.replace(":-D", "<img src=\":emotes/emotes/face-smile-big.png\" />");
|
||||
msg.replace(":D", "<img src=\":emotes/emotes/face-smile-big.png\" />");
|
||||
msg.replace(":-!", "<img src=\":emotes/emotes/face-smirk.png\" />");
|
||||
msg.replace(":-0", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-O", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-o", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-/", "<img src=\":emotes/emotes/face-uncertain.png\" />");
|
||||
msg.replace(":/", "<img src=\":emotes/emotes/face-uncertain.png\" />");
|
||||
msg.replace(";-)", "<img src=\":emotes/emotes/face-wink.png\" />");
|
||||
msg.replace(";)", "<img src=\":emotes/emotes/face-wink.png\" />");
|
||||
msg.replace(":-S", "<img src=\":emotes/emotes/face-worried.png\" />");
|
||||
msg.replace(":-s", "<img src=\":emotes/emotes/face-worried.png\" />");
|
||||
msg.replace(":-)", "<img src=\":emotes/emotes/face-smile.png\" />");
|
||||
msg.replace(":)", "<img src=\":emotes/emotes/face-smile.png\" />");
|
||||
msg.replace("0:-)", "<img src=\":emotes/emotes/face-angel.png\" />");
|
||||
msg.replace("X-(", "<img src=\":emotes/emotes/face-angry.png\" />");
|
||||
msg.replace("B-)", "<img src=\":emotes/emotes/face-cool.png\" />");
|
||||
msg.replace("8-)", "<img src=\":emotes/emotes/face-cool.png\" />");
|
||||
msg.replace(":'(", "<img src=\":emotes/emotes/face-crying.png\" />");
|
||||
msg.replace(">:-)", "<img src=\":emotes/emotes/face-devilish.png\" />");
|
||||
msg.replace(":-[", "<img src=\":emotes/emotes/face-embarrassed.png\" />");
|
||||
msg.replace(":-*", "<img src=\":emotes/emotes/face-kiss.png\" />");
|
||||
msg.replace(":-))", "<img src=\":emotes/emotes/face-laugh.png\" />");
|
||||
msg.replace(":))", "<img src=\":emotes/emotes/face-laugh.png\" />");
|
||||
msg.replace(":-|", "<img src=\":emotes/emotes/face-plain.png\" />");
|
||||
msg.replace(":-P", "<img src=\":emotes/emotes/face-raspberry.png\" />");
|
||||
msg.replace(":-p", "<img src=\":emotes/emotes/face-raspberry.png\" />");
|
||||
msg.replace(":-(", "<img src=\":emotes/emotes/face-sad.png\" />");
|
||||
msg.replace(":(", "<img src=\":emotes/emotes/face-sad.png\" />");
|
||||
msg.replace(":-&", "<img src=\":emotes/emotes/face-sick.png\" />");
|
||||
msg.replace(":-D", "<img src=\":emotes/emotes/face-smile-big.png\" />");
|
||||
msg.replace(":D", "<img src=\":emotes/emotes/face-smile-big.png\" />");
|
||||
msg.replace(":-!", "<img src=\":emotes/emotes/face-smirk.png\" />");
|
||||
msg.replace(":-0", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-O", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-o", "<img src=\":emotes/emotes/face-surprise.png\" />");
|
||||
msg.replace(":-/", "<img src=\":emotes/emotes/face-uncertain.png\" />");
|
||||
msg.replace(":/", "<img src=\":emotes/emotes/face-uncertain.png\" />");
|
||||
msg.replace(";-)", "<img src=\":emotes/emotes/face-wink.png\" />");
|
||||
msg.replace(";)", "<img src=\":emotes/emotes/face-wink.png\" />");
|
||||
msg.replace(":-S", "<img src=\":emotes/emotes/face-worried.png\" />");
|
||||
msg.replace(":-s", "<img src=\":emotes/emotes/face-worried.png\" />");
|
||||
msg.replace(":-)", "<img src=\":emotes/emotes/face-smile.png\" />");
|
||||
msg.replace(":)", "<img src=\":emotes/emotes/face-smile.png\" />");
|
||||
|
||||
return msg;
|
||||
return msg;
|
||||
}
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ public slots:
|
||||
myStyle = theValue;
|
||||
}
|
||||
void refreshIgnoreList();
|
||||
QString checkForEmotes(QString);
|
||||
QString checkForEmotes(QString);
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
@@ -260,12 +260,10 @@ bool createInternetGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
this->reject();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -151,12 +151,10 @@ bool createNetworkGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
this->reject();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -164,8 +164,8 @@ private:
|
||||
CountryStringMap countryStringMap;
|
||||
|
||||
QString myAppDataPath;
|
||||
MyMessageBox *waitStartGameMsgBox;
|
||||
MyMessageBox *waitRejoinStartGameMsgBox;
|
||||
MyMessageBox *waitStartGameMsgBox;
|
||||
MyMessageBox *waitRejoinStartGameMsgBox;
|
||||
myMessageDialogImpl *inviteOnlyInfoMsgBox;
|
||||
QTimer *waitStartGameMsgBoxTimer;
|
||||
QTimer *blinkingButtonAnimationTimer;
|
||||
|
||||
@@ -20,40 +20,40 @@
|
||||
#include <QtCore>
|
||||
|
||||
MyGameListSortFilterProxyModel::MyGameListSortFilterProxyModel(QObject *parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
: QSortFilterProxyModel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
bool MyGameListSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
|
||||
{
|
||||
|
||||
QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent);
|
||||
QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent);
|
||||
QModelIndex index3 = sourceModel()->index(sourceRow, 3, sourceParent);
|
||||
QModelIndex index4 = sourceModel()->index(sourceRow, 4, sourceParent);
|
||||
QModelIndex index5 = sourceModel()->index(sourceRow, 5, sourceParent);
|
||||
QModelIndex index0 = sourceModel()->index(sourceRow, 0, sourceParent);
|
||||
QModelIndex index1 = sourceModel()->index(sourceRow, 1, sourceParent);
|
||||
QModelIndex index2 = sourceModel()->index(sourceRow, 2, sourceParent);
|
||||
QModelIndex index3 = sourceModel()->index(sourceRow, 3, sourceParent);
|
||||
QModelIndex index4 = sourceModel()->index(sourceRow, 4, sourceParent);
|
||||
QModelIndex index5 = sourceModel()->index(sourceRow, 5, sourceParent);
|
||||
|
||||
return ((sourceModel()->data(index1, 16).toString().contains(column1RegExp)
|
||||
&& sourceModel()->data(index2, 16).toString().contains(column2RegExp)
|
||||
&& sourceModel()->data(index3, 16).toString().contains(column3RegExp)
|
||||
&& sourceModel()->data(index4, 16).toString().contains(column4RegExp)
|
||||
&& sourceModel()->data(index5, 16).toString().contains(column5RegExp)) || sourceModel()->data(index0, 16) == "MeInThisGame");
|
||||
return ((sourceModel()->data(index1, 16).toString().contains(column1RegExp)
|
||||
&& sourceModel()->data(index2, 16).toString().contains(column2RegExp)
|
||||
&& sourceModel()->data(index3, 16).toString().contains(column3RegExp)
|
||||
&& sourceModel()->data(index4, 16).toString().contains(column4RegExp)
|
||||
&& sourceModel()->data(index5, 16).toString().contains(column5RegExp)) || sourceModel()->data(index0, 16) == "MeInThisGame");
|
||||
}
|
||||
|
||||
bool MyGameListSortFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &right) const
|
||||
{
|
||||
switch(sortColumn()) {
|
||||
switch(sortColumn()) {
|
||||
|
||||
case 5: {
|
||||
return sourceModel()->data(left, 16).toString() < sourceModel()->data(right, 16).toString();
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
return QSortFilterProxyModel::lessThan(left, right);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
return sourceModel()->data(left, 16).toString() < sourceModel()->data(right, 16).toString();
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
return QSortFilterProxyModel::lessThan(left, right);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -38,20 +38,20 @@ public:
|
||||
void setColumn4RegExp(QRegExp column4) {
|
||||
column4RegExp = column4;
|
||||
}
|
||||
void setColumn5RegExp(QRegExp column5) {
|
||||
column5RegExp = column5;
|
||||
}
|
||||
void setColumn5RegExp(QRegExp column5) {
|
||||
column5RegExp = column5;
|
||||
}
|
||||
|
||||
protected:
|
||||
bool filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const;
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
bool lessThan(const QModelIndex &left, const QModelIndex &right) const;
|
||||
|
||||
private:
|
||||
QRegExp column1RegExp;
|
||||
QRegExp column2RegExp;
|
||||
QRegExp column3RegExp;
|
||||
QRegExp column4RegExp;
|
||||
QRegExp column5RegExp;
|
||||
QRegExp column5RegExp;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -74,7 +74,7 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
|
||||
setupUi(this);
|
||||
|
||||
//Sound
|
||||
//Sound
|
||||
mySoundEventHandler = new SoundEvents(myConfig);
|
||||
|
||||
// Init game table style
|
||||
@@ -92,10 +92,10 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
//set myStyle to widgets wich needs it
|
||||
#ifdef GUI_800x480
|
||||
tabsDiag = new QDialog(this);
|
||||
tabs.setupUi(tabsDiag);
|
||||
tabs.setupUi(tabsDiag);
|
||||
textLabel_handLabel->hide();
|
||||
#ifdef ANDROID
|
||||
tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
tabsDiag->setStyleSheet("QObject { font: 26px; } QDialog { background-image: url(:/android/android-data/gfx/gui/table/default_800x480/table_dark.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
#endif
|
||||
tabs.label_chance->setMyStyle(myGameTableStyle);
|
||||
#else
|
||||
@@ -303,13 +303,13 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
playerTipLabelArray[9] = label_playerTip9;
|
||||
|
||||
#ifdef GUI_800x480
|
||||
int j;
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; ++i) {
|
||||
for (j=1; j<=5; ++j) {
|
||||
playerStarsArray[j][i]->hide();
|
||||
}
|
||||
playerTipLabelArray[i]->hide();
|
||||
}
|
||||
int j;
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; ++i) {
|
||||
for (j=1; j<=5; ++j) {
|
||||
playerStarsArray[j][i]->hide();
|
||||
}
|
||||
playerTipLabelArray[i]->hide();
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -389,8 +389,8 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
|
||||
textLabel_Status0->setMyW(this);
|
||||
|
||||
//check position depending on card deck type
|
||||
checkActionLabelPosition();
|
||||
//check position depending on card deck type
|
||||
checkActionLabelPosition();
|
||||
|
||||
|
||||
// GroupBoxArray init
|
||||
@@ -496,12 +496,12 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
// Dialogs
|
||||
#ifdef GUI_800x480
|
||||
myChat = new ChatTools(tabs.lineEdit_ChatInput, myConfig, INGAME_CHAT, tabs.textBrowser_Chat);
|
||||
myChat->setMyStyle(myGameTableStyle);
|
||||
tabs.lineEdit_ChatInput->installEventFilter(this);
|
||||
myChat->setMyStyle(myGameTableStyle);
|
||||
tabs.lineEdit_ChatInput->installEventFilter(this);
|
||||
#else
|
||||
myChat = new ChatTools(lineEdit_ChatInput, myConfig, INGAME_CHAT, textBrowser_Chat);
|
||||
myChat->setMyStyle(myGameTableStyle);
|
||||
lineEdit_ChatInput->installEventFilter(this);
|
||||
myChat->setMyStyle(myGameTableStyle);
|
||||
lineEdit_ChatInput->installEventFilter(this);
|
||||
#endif
|
||||
|
||||
this->installEventFilter(this);
|
||||
@@ -510,10 +510,10 @@ gameTableImpl::gameTableImpl(ConfigFile *c, QMainWindow *parent)
|
||||
myUniversalMessageDialog = new myMessageDialogImpl(myConfig, this);
|
||||
myUniversalMessageDialog->setParent(this);
|
||||
|
||||
//hide left and right icon and menubar from maemo gui for ANDROID
|
||||
//hide left and right icon and menubar from maemo gui for ANDROID
|
||||
#ifdef ANDROID
|
||||
fullscreenButton->hide();
|
||||
menubar->hide();
|
||||
fullscreenButton->hide();
|
||||
menubar->hide();
|
||||
// tabsButton->hide();
|
||||
#endif
|
||||
|
||||
@@ -683,9 +683,9 @@ void gameTableImpl::callSettingsDialog()
|
||||
|
||||
void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog)
|
||||
{
|
||||
//apply card deck style
|
||||
//apply card deck style
|
||||
myCardDeckStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentCardDeckStyle").c_str()));
|
||||
checkActionLabelPosition();
|
||||
checkActionLabelPosition();
|
||||
//apply game table style
|
||||
myGameTableStyle->readStyleFile(QString::fromUtf8(myConfig->readConfigString("CurrentGameTableStyle").c_str()));
|
||||
|
||||
@@ -837,75 +837,75 @@ void gameTableImpl::applySettings(settingsDialogImpl* mySettingsDialog)
|
||||
provideMyActions();
|
||||
}
|
||||
|
||||
mySoundEventHandler->reInitSoundEngine();
|
||||
mySoundEventHandler->reInitSoundEngine();
|
||||
}
|
||||
|
||||
void gameTableImpl::initGui(int speed)
|
||||
{
|
||||
//kill running Singleshots!!!
|
||||
stopTimer();
|
||||
{
|
||||
//kill running Singleshots!!!
|
||||
stopTimer();
|
||||
|
||||
label_handNumber->setText(HandString+":");
|
||||
label_gameNumber->setText(GameString+":");
|
||||
label_handNumber->setText(HandString+":");
|
||||
label_gameNumber->setText(GameString+":");
|
||||
|
||||
//set WindowTitle dynamically
|
||||
QString titleString = "";
|
||||
assert(myStartWindow->getSession());
|
||||
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) {
|
||||
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
|
||||
titleString = QString::fromUtf8(info.name.c_str())+" - ";
|
||||
}
|
||||
//set WindowTitle dynamically
|
||||
QString titleString = "";
|
||||
assert(myStartWindow->getSession());
|
||||
if(myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK) {
|
||||
GameInfo info(myStartWindow->getSession()->getClientGameInfo(myStartWindow->getSession()->getClientCurrentGameId()));
|
||||
titleString = QString::fromUtf8(info.name.c_str())+" - ";
|
||||
}
|
||||
|
||||
//show human player buttons
|
||||
for(int i=0; i<6; i++) {
|
||||
userWidgetsArray[i]->show();
|
||||
}
|
||||
//show human player buttons
|
||||
for(int i=0; i<6; i++) {
|
||||
userWidgetsArray[i]->show();
|
||||
}
|
||||
|
||||
//set speeds for local game and for first network game
|
||||
if( !myStartWindow->getSession()->isNetworkClientRunning() || (myStartWindow->getSession()->isNetworkClientRunning() && !myStartWindow->getSession()->getCurrentGame()) ) {
|
||||
guiGameSpeed = speed;
|
||||
setSpeeds();
|
||||
}
|
||||
//set speeds for local game and for first network game
|
||||
if( !myStartWindow->getSession()->isNetworkClientRunning() || (myStartWindow->getSession()->isNetworkClientRunning() && !myStartWindow->getSession()->getCurrentGame()) ) {
|
||||
guiGameSpeed = speed;
|
||||
setSpeeds();
|
||||
}
|
||||
|
||||
//set session for chat
|
||||
myChat->setSession(this->getSession());
|
||||
//set session for chat
|
||||
myChat->setSession(this->getSession());
|
||||
|
||||
#ifdef GUI_800x480
|
||||
tabsDiag->setWindowTitle("Tabs");
|
||||
this->setWindowTitle(QString(titleString + tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
tabsDiag->setWindowTitle("Tabs");
|
||||
this->setWindowTitle(QString(titleString + tr("PokerTH %1").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
|
||||
label_Sets->setText(BetsString);
|
||||
label_Total->setText(TotalString);
|
||||
tabs.groupBox_RightToolBox->setDisabled(FALSE);
|
||||
tabs.groupBox_LeftToolBox->setDisabled(FALSE);
|
||||
label_Sets->setText(BetsString);
|
||||
label_Total->setText(TotalString);
|
||||
tabs.groupBox_RightToolBox->setDisabled(FALSE);
|
||||
tabs.groupBox_LeftToolBox->setDisabled(FALSE);
|
||||
|
||||
//set minimum gui speed to prevent gui lags on fast inet games
|
||||
if( myStartWindow->getSession()->isNetworkClientRunning() ) {
|
||||
tabs.horizontalSlider_speed->setMinimum(speed);
|
||||
} else {
|
||||
tabs.horizontalSlider_speed->setMinimum(1);
|
||||
}
|
||||
//set minimum gui speed to prevent gui lags on fast inet games
|
||||
if( myStartWindow->getSession()->isNetworkClientRunning() ) {
|
||||
tabs.horizontalSlider_speed->setMinimum(speed);
|
||||
} else {
|
||||
tabs.horizontalSlider_speed->setMinimum(1);
|
||||
}
|
||||
|
||||
//positioning Slider
|
||||
tabs.horizontalSlider_speed->setValue(guiGameSpeed);
|
||||
//positioning Slider
|
||||
tabs.horizontalSlider_speed->setValue(guiGameSpeed);
|
||||
|
||||
#else
|
||||
this->setWindowTitle(QString(titleString + tr("PokerTH %1 - The Open-Source Texas Holdem Engine").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
this->setWindowTitle(QString(titleString + tr("PokerTH %1 - The Open-Source Texas Holdem Engine").arg(POKERTH_BETA_RELEASE_STRING)));
|
||||
|
||||
label_Pot->setText(PotString);
|
||||
label_Total->setText(TotalString+":");
|
||||
label_Sets->setText(BetsString+":");
|
||||
groupBox_RightToolBox->setDisabled(FALSE);
|
||||
groupBox_LeftToolBox->setDisabled(FALSE);
|
||||
label_Pot->setText(PotString);
|
||||
label_Total->setText(TotalString+":");
|
||||
label_Sets->setText(BetsString+":");
|
||||
groupBox_RightToolBox->setDisabled(FALSE);
|
||||
groupBox_LeftToolBox->setDisabled(FALSE);
|
||||
|
||||
//set minimum gui speed to prevent gui lags on fast inet games
|
||||
if( myStartWindow->getSession()->isNetworkClientRunning() ) {
|
||||
horizontalSlider_speed->setMinimum(speed);
|
||||
} else {
|
||||
horizontalSlider_speed->setMinimum(1);
|
||||
}
|
||||
//set minimum gui speed to prevent gui lags on fast inet games
|
||||
if( myStartWindow->getSession()->isNetworkClientRunning() ) {
|
||||
horizontalSlider_speed->setMinimum(speed);
|
||||
} else {
|
||||
horizontalSlider_speed->setMinimum(1);
|
||||
}
|
||||
|
||||
horizontalSlider_speed->setValue(guiGameSpeed);
|
||||
horizontalSlider_speed->setValue(guiGameSpeed);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1164,7 +1164,7 @@ void gameTableImpl::refreshAction(int playerID, int playerAction)
|
||||
|
||||
//play sounds if exist
|
||||
if(myConfig->readConfigInt("PlayGameActions"))
|
||||
mySoundEventHandler->playSound(actionArray[playerAction].toStdString(), playerID);
|
||||
mySoundEventHandler->playSound(actionArray[playerAction].toStdString(), playerID);
|
||||
}
|
||||
|
||||
if (playerAction == 1) { // FOLD
|
||||
@@ -1878,13 +1878,13 @@ void gameTableImpl::meInAction()
|
||||
myActionIsRaise = 0;
|
||||
myActionIsBet = 0;
|
||||
|
||||
/* if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
||||
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
||||
} else {
|
||||
// statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
|
||||
}
|
||||
}*/
|
||||
/* if(myConfig->readConfigInt("ShowStatusbarMessages")) {
|
||||
if ( myConfig->readConfigInt("AlternateFKeysUserActionMode") == 0 ) {
|
||||
// // statusBar()->showMessage(tr("F1 - Fold | F2 - Check/Call | F3 - Bet/Raise | F4 - All-In"), 15000);
|
||||
} else {
|
||||
// statusBar()->showMessage(tr("F1 - All-In | F2 - Bet/Raise | F3 - Check/Call | F4 - Fold"), 15000);
|
||||
}
|
||||
}*/
|
||||
|
||||
QString lastPushButtonFoldString = pushButton_Fold->text();
|
||||
|
||||
@@ -3232,11 +3232,11 @@ bool gameTableImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
if (/*obj == lineEdit_ChatInput && lineEdit_ChatInput->text() != "" && */event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Tab) {
|
||||
myChat->nickAutoCompletition();
|
||||
return true;
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
event->ignore();
|
||||
closeGameTable();
|
||||
return true;
|
||||
} else if (event->type() == QEvent::Close) {
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
event->ignore();
|
||||
closeGameTable();
|
||||
return true;
|
||||
} else if (event->type() == QEvent::Close) {
|
||||
event->ignore();
|
||||
closeGameTable();
|
||||
return true;
|
||||
@@ -3707,8 +3707,8 @@ void gameTableImpl::closeGameTable()
|
||||
|
||||
if (myStartWindow->getMyServerGuiInterface() && myStartWindow->getMyServerGuiInterface()->getSession()->isNetworkServerRunning()) {
|
||||
|
||||
MyMessageBox msgBox(QMessageBox::Warning, tr("Closing PokerTH during network game"),
|
||||
tr("You are the hosting server. Do you want to close PokerTH anyway?"), QMessageBox::Yes | QMessageBox::No, this);
|
||||
MyMessageBox msgBox(QMessageBox::Warning, tr("Closing PokerTH during network game"),
|
||||
tr("You are the hosting server. Do you want to close PokerTH anyway?"), QMessageBox::Yes | QMessageBox::No, this);
|
||||
|
||||
if (msgBox.exec() == QMessageBox::Yes ) {
|
||||
myStartWindow->getSession()->terminateNetworkClient();
|
||||
@@ -3722,8 +3722,8 @@ void gameTableImpl::closeGameTable()
|
||||
|
||||
bool close = true;
|
||||
|
||||
if(myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(CLOSE_GAMETABLE_QUESTION ) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) {
|
||||
if (myUniversalMessageDialog->exec(CLOSE_GAMETABLE_QUESTION , tr("Really want to exit?"), tr("PokerTH - Close Table?"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Rejected) {
|
||||
if(myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(CLOSE_GAMETABLE_QUESTION ) && (myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_INTERNET || myStartWindow->getSession()->getGameType() == Session::GAME_TYPE_NETWORK ) && this->isVisible()) {
|
||||
if (myUniversalMessageDialog->exec(CLOSE_GAMETABLE_QUESTION , tr("Really want to exit?"), tr("PokerTH - Close Table?"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Rejected) {
|
||||
close = false;
|
||||
}
|
||||
}
|
||||
@@ -3741,61 +3741,59 @@ void gameTableImpl::closeGameTable()
|
||||
|
||||
void gameTableImpl::changeSpinBoxBetValue(int value)
|
||||
{
|
||||
if(betSliderChangedByInput) {
|
||||
//prevent interval cutting of spinBox_betValue input from code below
|
||||
betSliderChangedByInput = FALSE;
|
||||
}
|
||||
else {
|
||||
if(betSliderChangedByInput) {
|
||||
//prevent interval cutting of spinBox_betValue input from code below
|
||||
betSliderChangedByInput = FALSE;
|
||||
} else {
|
||||
|
||||
if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) {
|
||||
if(horizontalSlider_bet->value() == horizontalSlider_bet->maximum()) {
|
||||
|
||||
spinBox_betValue->setValue(horizontalSlider_bet->value());
|
||||
}
|
||||
else {
|
||||
spinBox_betValue->setValue(horizontalSlider_bet->value());
|
||||
} else {
|
||||
|
||||
int temp;
|
||||
if(horizontalSlider_bet->maximum() <= 1000 ) {
|
||||
temp = (int)((value/10)*10);
|
||||
} else if(horizontalSlider_bet->maximum() > 1000 && horizontalSlider_bet->maximum() <= 10000) {
|
||||
temp = (int)((value/50)*50);
|
||||
} else if(horizontalSlider_bet->maximum() > 10000 && horizontalSlider_bet->maximum() <= 100000) {
|
||||
temp = (int)((value/500)*500);
|
||||
} else {
|
||||
temp = (int)((value/5000)*5000);
|
||||
}
|
||||
int temp;
|
||||
if(horizontalSlider_bet->maximum() <= 1000 ) {
|
||||
temp = (int)((value/10)*10);
|
||||
} else if(horizontalSlider_bet->maximum() > 1000 && horizontalSlider_bet->maximum() <= 10000) {
|
||||
temp = (int)((value/50)*50);
|
||||
} else if(horizontalSlider_bet->maximum() > 10000 && horizontalSlider_bet->maximum() <= 100000) {
|
||||
temp = (int)((value/500)*500);
|
||||
} else {
|
||||
temp = (int)((value/5000)*5000);
|
||||
}
|
||||
|
||||
if(temp < horizontalSlider_bet->minimum())
|
||||
spinBox_betValue->setValue(horizontalSlider_bet->minimum());
|
||||
else
|
||||
spinBox_betValue->setValue(temp);
|
||||
}
|
||||
}
|
||||
if(temp < horizontalSlider_bet->minimum())
|
||||
spinBox_betValue->setValue(horizontalSlider_bet->minimum());
|
||||
else
|
||||
spinBox_betValue->setValue(temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gameTableImpl::spinBoxBetValueChanged(int value)
|
||||
{
|
||||
|
||||
if(horizontalSlider_bet->isEnabled()) {
|
||||
if(horizontalSlider_bet->isEnabled()) {
|
||||
|
||||
QString betRaise = pushButton_BetRaise->text().section("\n",0 ,0);
|
||||
QString betRaise = pushButton_BetRaise->text().section("\n",0 ,0);
|
||||
|
||||
if(value >= horizontalSlider_bet->minimum()) {
|
||||
if(value >= horizontalSlider_bet->minimum()) {
|
||||
|
||||
if(value > horizontalSlider_bet->maximum()) { // print the 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$" + QString("%L1").arg(value));
|
||||
betSliderChangedByInput = TRUE;
|
||||
horizontalSlider_bet->setValue(value);
|
||||
}
|
||||
} else { // print the minimum
|
||||
pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->minimum()));
|
||||
betSliderChangedByInput = TRUE;
|
||||
horizontalSlider_bet->setValue(horizontalSlider_bet->minimum());
|
||||
}
|
||||
}
|
||||
if(value > horizontalSlider_bet->maximum()) { // print the 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$" + QString("%L1").arg(value));
|
||||
betSliderChangedByInput = TRUE;
|
||||
horizontalSlider_bet->setValue(value);
|
||||
}
|
||||
} else { // print the minimum
|
||||
pushButton_BetRaise->setText(betRaise + "\n$" + QString("%L1").arg(horizontalSlider_bet->minimum()));
|
||||
betSliderChangedByInput = TRUE;
|
||||
horizontalSlider_bet->setValue(horizontalSlider_bet->minimum());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void gameTableImpl::leaveCurrentNetworkGame()
|
||||
@@ -3803,12 +3801,12 @@ void gameTableImpl::leaveCurrentNetworkGame()
|
||||
|
||||
if (myStartWindow->getSession()->isNetworkClientRunning()) {
|
||||
|
||||
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) {
|
||||
if(!myUniversalMessageDialog->checkIfMesssageWillBeDisplayed(BACKTO_LOBBY_QUESTION)) {
|
||||
|
||||
assert(myStartWindow->getSession());
|
||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||
} else {
|
||||
if (myUniversalMessageDialog->exec(BACKTO_LOBBY_QUESTION, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), tr("PokerTH - Internet Game Message"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) {
|
||||
if (myUniversalMessageDialog->exec(BACKTO_LOBBY_QUESTION, tr("Attention! Do you really want to leave the current game\nand go back to the lobby?"), tr("PokerTH - Internet Game Message"), QPixmap(":/gfx/logoChip3D.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, true) == QDialog::Accepted) {
|
||||
assert(myStartWindow->getSession());
|
||||
myStartWindow->getSession()->sendLeaveCurrentGame();
|
||||
}
|
||||
@@ -4040,7 +4038,7 @@ void gameTableImpl::refreshGameTableStyle()
|
||||
myGameTableStyle->setWindowsGeometry(this);
|
||||
#ifdef GUI_800x480
|
||||
#ifdef ANDROID
|
||||
myGameTableStyle->setChatLogStyle(tabs.textBrowser_Log);
|
||||
myGameTableStyle->setChatLogStyle(tabs.textBrowser_Log);
|
||||
#endif
|
||||
myGameTableStyle->setChatLogStyle(tabs.textBrowser_Chat);
|
||||
myGameTableStyle->setChatLogStyle(tabs.textEdit_tipInput);
|
||||
@@ -4061,8 +4059,8 @@ void gameTableImpl::refreshGameTableStyle()
|
||||
}
|
||||
|
||||
#ifdef GUI_800x480
|
||||
myGameTableStyle->setBigFontBoardStyle(label_Sets);
|
||||
myGameTableStyle->setBigFontBoardStyle(label_Total);
|
||||
myGameTableStyle->setBigFontBoardStyle(label_Sets);
|
||||
myGameTableStyle->setBigFontBoardStyle(label_Total);
|
||||
myGameTableStyle->setBigFontBoardStyle(textLabel_Sets);
|
||||
myGameTableStyle->setBigFontBoardStyle(textLabel_Pot);
|
||||
myGameTableStyle->setBigFontBoardStyle(label_handNumber);
|
||||
@@ -4071,8 +4069,8 @@ void gameTableImpl::refreshGameTableStyle()
|
||||
myGameTableStyle->setBigFontBoardStyle(label_gameNumberValue);
|
||||
myGameTableStyle->setBigFontBoardStyle(textLabel_handLabel);
|
||||
#else
|
||||
myGameTableStyle->setSmallFontBoardStyle(label_Sets);
|
||||
myGameTableStyle->setSmallFontBoardStyle(label_Total);
|
||||
myGameTableStyle->setSmallFontBoardStyle(label_Sets);
|
||||
myGameTableStyle->setSmallFontBoardStyle(label_Total);
|
||||
myGameTableStyle->setSmallFontBoardStyle(textLabel_Sets);
|
||||
myGameTableStyle->setSmallFontBoardStyle(textLabel_Pot);
|
||||
myGameTableStyle->setSmallFontBoardStyle(label_handNumber);
|
||||
@@ -4261,12 +4259,12 @@ void gameTableImpl::saveGameTableGeometry()
|
||||
void gameTableImpl::restoreGameTableGeometry()
|
||||
{
|
||||
#ifdef ANDROID
|
||||
this->showFullScreen();
|
||||
this->showFullScreen();
|
||||
#else
|
||||
if(myConfig->readConfigInt("GameTableFullScreenSave")) {
|
||||
#ifndef GUI_800x480
|
||||
#ifndef GUI_800x480
|
||||
if(actionFullScreen->isEnabled()) this->showFullScreen();
|
||||
#endif
|
||||
#endif
|
||||
} else {
|
||||
//resize only if style size allow this and if NOT fixed windows size
|
||||
if(!myGameTableStyle->getIfFixedWindowSize().toInt() && myConfig->readConfigInt("GameTableHeightSave") <= myGameTableStyle->getMaximumWindowHeight().toInt() && myConfig->readConfigInt("GameTableHeightSave") >= myGameTableStyle->getMinimumWindowHeight().toInt() && myConfig->readConfigInt("GameTableWidthSave") <= myGameTableStyle->getMaximumWindowWidth().toInt() && myConfig->readConfigInt("GameTableWidthSave") >= myGameTableStyle->getMinimumWindowWidth().toInt()) {
|
||||
@@ -4337,7 +4335,7 @@ void gameTableImpl::hide()
|
||||
//clear log
|
||||
#ifdef GUI_800x480
|
||||
tabs.textBrowser_Log->clear();
|
||||
tabsDiag->hide();
|
||||
tabsDiag->hide();
|
||||
#else
|
||||
textBrowser_Log->clear();
|
||||
#endif
|
||||
@@ -4377,7 +4375,7 @@ void gameTableImpl::enableCallCheckPushButton()
|
||||
void gameTableImpl::tabsButtonClicked()
|
||||
{
|
||||
tabsDiag->setParent(this, Qt::Dialog);
|
||||
tabsDiag->showFullScreen();
|
||||
tabsDiag->showFullScreen();
|
||||
tabsDiag->show();
|
||||
tabsDiag->raise();
|
||||
tabsDiag->activateWindow();
|
||||
@@ -4390,36 +4388,34 @@ void gameTableImpl::tabsButtonClose()
|
||||
#endif
|
||||
|
||||
|
||||
void gameTableImpl::checkActionLabelPosition() {
|
||||
void gameTableImpl::checkActionLabelPosition()
|
||||
{
|
||||
#ifndef GUI_800x480
|
||||
int i;
|
||||
if(myCardDeckStyle->getBigIndexesActionBottom() == "1") {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(i>=3 && i<=7) {
|
||||
if(actionLabelArray[i]->y() == 56) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 80);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(actionLabelArray[i]->y() == 43) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 67);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(i>=3 && i<=7) {
|
||||
if(actionLabelArray[i]->y() == 80) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 56);
|
||||
}
|
||||
}
|
||||
else {
|
||||
if(actionLabelArray[i]->y() == 67) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 43);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
int i;
|
||||
if(myCardDeckStyle->getBigIndexesActionBottom() == "1") {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(i>=3 && i<=7) {
|
||||
if(actionLabelArray[i]->y() == 56) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 80);
|
||||
}
|
||||
} else {
|
||||
if(actionLabelArray[i]->y() == 43) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 67);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (i=0; i<MAX_NUMBER_OF_PLAYERS; i++) {
|
||||
if(i>=3 && i<=7) {
|
||||
if(actionLabelArray[i]->y() == 80) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 56);
|
||||
}
|
||||
} else {
|
||||
if(actionLabelArray[i]->y() == 67) {
|
||||
actionLabelArray[i]->move(actionLabelArray[i]->x(), 43);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -341,10 +341,10 @@ public slots:
|
||||
void sendShowMyCardsSignal();
|
||||
|
||||
void closeMessageBoxes();
|
||||
void hide();
|
||||
void hide();
|
||||
void soundEvent_blindsWereSet(int);
|
||||
void enableCallCheckPushButton();
|
||||
void checkActionLabelPosition();
|
||||
void enableCallCheckPushButton();
|
||||
void checkActionLabelPosition();
|
||||
|
||||
#ifdef GUI_800x480
|
||||
void tabsButtonClicked();
|
||||
|
||||
@@ -412,7 +412,7 @@ void MyAvatarLabel::putPlayerOnIgnoreList()
|
||||
if(!playerIsOnIgnoreList(list.at(myId))) {
|
||||
|
||||
myMessageDialogImpl dialog(myW->getMyConfig(), this);
|
||||
if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.<br>Do you really want to put player <b>%1</b> on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
|
||||
if(dialog.exec(INGNORE_PLAYER_QUESTION, tr("You will no longer receive chat messages or game invitations from this user.<br>Do you really want to put player <b>%1</b> on ignore list?").arg(list.at(myId)), tr("PokerTH - Question"), QPixmap(":/gfx/im-ban-user_64.png"), QDialogButtonBox::Yes|QDialogButtonBox::No, false ) == QDialog::Accepted) {
|
||||
|
||||
std::list<std::string> playerIgnoreList = myW->getMyConfig()->readConfigStringList("PlayerIgnoreList");
|
||||
playerIgnoreList.push_back(list.at(myId).toUtf8().constData());
|
||||
@@ -440,7 +440,7 @@ void MyAvatarLabel::reportBadAvatar()
|
||||
|
||||
QString nick = QString::fromUtf8((*it_c)->getMyName().c_str());
|
||||
int ret = MyMessageBox::question(this, tr("PokerTH - Question"),
|
||||
tr("Are you sure you want to report the avatar of \"%1\" as inappropriate?").arg(nick), QMessageBox::Yes | QMessageBox::No);
|
||||
tr("Are you sure you want to report the avatar of \"%1\" as inappropriate?").arg(nick), QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
if(ret == QMessageBox::Yes) {
|
||||
QFileInfo fi(avatar);
|
||||
|
||||
@@ -108,7 +108,7 @@ void MyCardsPixmapLabel::startFlipCards(int speed, const QPixmap &frontPix, cons
|
||||
QLabel::setPixmap(frontPix);
|
||||
|
||||
frameFlipCardsAction1Size = 1.0;
|
||||
frameFlipCardsAction2Size = 0.0;
|
||||
frameFlipCardsAction2Size = 0.0;
|
||||
|
||||
front = frontPix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
|
||||
flipside = flipsidePix.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
|
||||
@@ -124,7 +124,7 @@ void MyCardsPixmapLabel::startFlipCards(int speed, const QPixmap &frontPix, cons
|
||||
}
|
||||
if(speed > 8 && speed <= 10) {
|
||||
flipCardsScaleIntervall = 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
if(speed != 11) {
|
||||
flipCardsAction1 = TRUE;
|
||||
@@ -146,7 +146,7 @@ void MyCardsPixmapLabel::stopFlipCardsAnimation()
|
||||
void MyCardsPixmapLabel::nextFlipCardsFrame()
|
||||
{
|
||||
|
||||
if (frameFlipCardsAction1Size > 0.1 ) {
|
||||
if (frameFlipCardsAction1Size > 0.1 ) {
|
||||
//erst flipside verkleinern
|
||||
frameFlipCardsAction1Size -= flipCardsScaleIntervall;
|
||||
update();
|
||||
@@ -156,9 +156,9 @@ void MyCardsPixmapLabel::nextFlipCardsFrame()
|
||||
flipCardsAction2 = TRUE;
|
||||
} else {
|
||||
//dann front vergrößern
|
||||
if (frameFlipCardsAction2Size < 0.95 ) {
|
||||
if (frameFlipCardsAction2Size < 0.95 ) {
|
||||
frameFlipCardsAction2Size += flipCardsScaleIntervall;
|
||||
update();
|
||||
update();
|
||||
} else {
|
||||
flipCardsAction2 = FALSE;
|
||||
flipCardsTimer->stop();
|
||||
@@ -264,8 +264,8 @@ void MyCardsPixmapLabel::mouseReleaseEvent(QMouseEvent * event)
|
||||
void MyCardsPixmapLabel::setFront ( const QPixmap& theValue )
|
||||
{
|
||||
#ifdef GUI_800x480
|
||||
front = theValue.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
|
||||
front = theValue.scaled(width(), height(), Qt::IgnoreAspectRatio, Qt::SmoothTransformation);;
|
||||
#else
|
||||
front = theValue;
|
||||
front = theValue;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public slots:
|
||||
void mousePressEvent ( QMouseEvent *);
|
||||
void mouseReleaseEvent ( QMouseEvent *);
|
||||
|
||||
void setFront ( const QPixmap& theValue );
|
||||
void setFront ( const QPixmap& theValue );
|
||||
|
||||
|
||||
private:
|
||||
|
||||
@@ -26,7 +26,7 @@ class MyLeftTabWidget : public QTabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyLeftTabWidget(QGroupBox*);
|
||||
MyLeftTabWidget(QGroupBox*);
|
||||
|
||||
~MyLeftTabWidget();
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ class MyRightTabWidget : public QTabWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyRightTabWidget(QGroupBox*);
|
||||
MyRightTabWidget(QGroupBox*);
|
||||
|
||||
~MyRightTabWidget();
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ void MyTimeoutLabel::nextTimeOutAnimationFrame()
|
||||
if(timeOutFrame > waitFrames) {
|
||||
//play beep after waitFrames one time
|
||||
if(isBeep && !isBeepPlayed) {
|
||||
myW->getMySoundEventHandler()->playSound("yourturn",0);
|
||||
myW->getMySoundEventHandler()->playSound("yourturn",0);
|
||||
isBeepPlayed = TRUE;
|
||||
}
|
||||
//save gfx ressources and never play more the 10 pps
|
||||
|
||||
@@ -25,11 +25,11 @@ internetGameLoginDialogImpl::internetGameLoginDialogImpl(QWidget *parent, Config
|
||||
QDialog(parent), myConfig(c)
|
||||
{
|
||||
setupUi(this);
|
||||
this->installEventFilter(this);
|
||||
this->installEventFilter(this);
|
||||
|
||||
//html stuff
|
||||
QString createAccount(QString("<a href='http://create-gaming-account.pokerth.net'>%1</a>").arg(tr("Create new user account")));
|
||||
label_createAnAccount->setText(createAccount);
|
||||
//html stuff
|
||||
QString createAccount(QString("<a href='http://create-gaming-account.pokerth.net'>%1</a>").arg(tr("Create new user account")));
|
||||
label_createAnAccount->setText(createAccount);
|
||||
|
||||
|
||||
connect(groupBox_reguser, SIGNAL(toggled(bool)), this, SLOT(regUserToggled(bool)));
|
||||
@@ -152,24 +152,24 @@ void internetGameLoginDialogImpl::okButtonCheck()
|
||||
|
||||
bool internetGameLoginDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
{
|
||||
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)
|
||||
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
|
||||
if(lineEdit_username->hasFocus()) {
|
||||
lineEdit_password->setFocus();
|
||||
}
|
||||
if(lineEdit_password->hasFocus()) {
|
||||
QTimer::singleShot(1000, this, SLOT(clickLoginButton()));
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Return) {
|
||||
if(lineEdit_username->hasFocus()) {
|
||||
lineEdit_password->setFocus();
|
||||
}
|
||||
if(lineEdit_password->hasFocus()) {
|
||||
QTimer::singleShot(1000, this, SLOT(clickLoginButton()));
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
#else
|
||||
return QDialog::eventFilter(obj, event);
|
||||
return QDialog::eventFilter(obj, event);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -35,13 +35,15 @@ public:
|
||||
|
||||
void exec();
|
||||
void accept();
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
public slots:
|
||||
void regUserToggled(bool);
|
||||
void guestUserToggled(bool);
|
||||
void okButtonCheck();
|
||||
void clickLoginButton() { pushButton_login->click(); }
|
||||
void clickLoginButton() {
|
||||
pushButton_login->click();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
|
||||
@@ -120,8 +120,8 @@ void joinNetworkGameDialogImpl::fillServerProfileList()
|
||||
TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString());
|
||||
if(!doc.LoadFile()) {
|
||||
MyMessageBox::warning(this, tr("Load Server-Profile-File Error"),
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
TiXmlHandle docHandle( &doc );
|
||||
|
||||
@@ -171,8 +171,8 @@ void joinNetworkGameDialogImpl::itemFillForm (QTreeWidgetItem* item, int /*colum
|
||||
TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString());
|
||||
if(!doc.LoadFile()) {
|
||||
MyMessageBox::warning(this, tr("Load Server-Profile-File Error"),
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
TiXmlHandle docHandle( &doc );
|
||||
|
||||
@@ -198,8 +198,8 @@ void joinNetworkGameDialogImpl::saveServerProfile()
|
||||
TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString());
|
||||
if(!doc.LoadFile()) {
|
||||
MyMessageBox::warning(this, tr("Load Server-Profile-File Error"),
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
TiXmlHandle docHandle( &doc );
|
||||
|
||||
@@ -210,8 +210,8 @@ void joinNetworkGameDialogImpl::saveServerProfile()
|
||||
|
||||
if( testProfile ) {
|
||||
// Wenn der Name schon existiert --> Überschreiben?
|
||||
MyMessageBox msgBox(QMessageBox::Warning, tr("Save Server Profile Error"),
|
||||
QString(tr("A profile with the name: %1 already exists.\nWould you like to overwrite ?")).arg(lineEdit_profileName->text()), QMessageBox::Yes | QMessageBox::No, this);
|
||||
MyMessageBox msgBox(QMessageBox::Warning, tr("Save Server Profile Error"),
|
||||
QString(tr("A profile with the name: %1 already exists.\nWould you like to overwrite ?")).arg(lineEdit_profileName->text()), QMessageBox::Yes | QMessageBox::No, this);
|
||||
switch (msgBox.exec()) {
|
||||
|
||||
case QMessageBox::Yes: {
|
||||
@@ -249,14 +249,14 @@ void joinNetworkGameDialogImpl::saveServerProfile()
|
||||
}
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Read Server-Profile List Error"),
|
||||
tr("Could not read server-profiles list"),
|
||||
QMessageBox::Close);
|
||||
tr("Could not read server-profiles list"),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
|
||||
if(!doc.SaveFile()) {
|
||||
MyMessageBox::warning(this, tr("Save Server-Profile-File Error"),
|
||||
tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
|
||||
fillServerProfileList();
|
||||
@@ -268,8 +268,8 @@ void joinNetworkGameDialogImpl::deleteServerProfile()
|
||||
TiXmlDocument doc(QString::fromUtf8(myServerProfilesFile.c_str()).toStdString());
|
||||
if(!doc.LoadFile()) {
|
||||
MyMessageBox::warning(this, tr("Load Server-Profile-File Error"),
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
tr("Could not load server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
} else {
|
||||
TiXmlHandle docHandle( &doc );
|
||||
|
||||
@@ -281,8 +281,8 @@ void joinNetworkGameDialogImpl::deleteServerProfile()
|
||||
|
||||
if(!doc.SaveFile()) {
|
||||
MyMessageBox::warning(this, tr("Save Server-Profile-File Error"),
|
||||
tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
tr("Could not save server-profiles-file:\n"+QString::fromUtf8(myServerProfilesFile.c_str()).toAscii()),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
|
||||
//Liste Füllen
|
||||
|
||||
@@ -30,21 +30,21 @@
|
||||
#include <net/uploaderthread.h>
|
||||
|
||||
LogFileDialog::LogFileDialog(QWidget *parent, ConfigFile *c) :
|
||||
QDialog(parent), myConfig(c),
|
||||
ui(new Ui::LogFileDialog)
|
||||
QDialog(parent), myConfig(c),
|
||||
ui(new Ui::LogFileDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->label_animation->setMaximumWidth(0);
|
||||
ui->horizontalLayout_animation->setSpacing(0);
|
||||
ui->label_animation->setMaximumWidth(0);
|
||||
ui->horizontalLayout_animation->setSpacing(0);
|
||||
|
||||
connect( ui->pushButton_deleteLog, SIGNAL(clicked()), this, SLOT (deleteLogFile()));
|
||||
connect( ui->pushButton_exportLogHtml, SIGNAL(clicked()), this, SLOT (exportLogToHtml()));
|
||||
connect( ui->pushButton_exportLogTxt, SIGNAL(clicked()), this, SLOT (exportLogToTxt()));
|
||||
connect( ui->pushButton_saveLogAs, SIGNAL(clicked()), this, SLOT (saveLogFileAs()));
|
||||
connect( ui->treeWidget_logFiles, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showLogFilePreviewInit()));
|
||||
connect( ui->pushButton_analyseLogfile, SIGNAL(clicked()), this, SLOT (uploadFile()));
|
||||
connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(showLogFilePreviewSelected()));
|
||||
connect( ui->treeWidget_logFiles, SIGNAL(currentItemChanged(QTreeWidgetItem*, QTreeWidgetItem*)), this, SLOT(showLogFilePreviewInit()));
|
||||
connect( ui->pushButton_analyseLogfile, SIGNAL(clicked()), this, SLOT (uploadFile()));
|
||||
connect( ui->comboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(showLogFilePreviewSelected()));
|
||||
connect( this, SIGNAL(signalUploadCompleted(QString,QString)), this, SLOT(showLogAnalysis(QString,QString)));
|
||||
connect( this, SIGNAL(signalUploadError(QString,QString)), this, SLOT(showUploadError(QString,QString)));
|
||||
|
||||
@@ -85,16 +85,16 @@ void LogFileDialog::refreshLogFileList()
|
||||
|
||||
QFileInfo currentSqliteLogFile(QString::fromStdString(myGuiLog->getMySqliteLogFileName()));
|
||||
|
||||
ui->treeWidget_logFiles->blockSignals(TRUE);
|
||||
ui->treeWidget_logFiles->blockSignals(TRUE);
|
||||
ui->treeWidget_logFiles->clear();
|
||||
int i;
|
||||
for (i=0; i < dbFilesList.size(); i++) {
|
||||
|
||||
QTreeWidgetItem *item = new QTreeWidgetItem;
|
||||
#ifdef GUI_800x480
|
||||
item->setText(0, dbFilesList.at(i).fileName().remove("pokerth-log-"));
|
||||
item->setText(0, dbFilesList.at(i).fileName().remove("pokerth-log-"));
|
||||
#else
|
||||
item->setText(0, dbFilesList.at(i).fileName());
|
||||
item->setText(0, dbFilesList.at(i).fileName());
|
||||
#endif
|
||||
item->setData(0, Qt::UserRole, dbFilesList.at(i).absoluteFilePath());
|
||||
if(currentSqliteLogFile.fileName() == dbFilesList.at(i).fileName()) {
|
||||
@@ -105,8 +105,8 @@ void LogFileDialog::refreshLogFileList()
|
||||
ui->treeWidget_logFiles->addTopLevelItem(item);
|
||||
}
|
||||
ui->treeWidget_logFiles->sortItems(0, Qt::DescendingOrder);
|
||||
ui->treeWidget_logFiles->blockSignals(FALSE);
|
||||
ui->treeWidget_logFiles->setCurrentItem(ui->treeWidget_logFiles->topLevelItem(0));
|
||||
ui->treeWidget_logFiles->blockSignals(FALSE);
|
||||
ui->treeWidget_logFiles->setCurrentItem(ui->treeWidget_logFiles->topLevelItem(0));
|
||||
}
|
||||
|
||||
void LogFileDialog::deleteLogFile()
|
||||
@@ -116,8 +116,8 @@ void LogFileDialog::deleteLogFile()
|
||||
if(!selectedItemsList.isEmpty() && !( selectedItemsList.size() == 1 && selectedItemsList.front()->data(0, Qt::UserRole+1).toString() == "current" )) {
|
||||
|
||||
int ret = MyMessageBox::warning(this, tr("PokerTH - Delete log files"),
|
||||
tr("Do you really want to delete the selected log files?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
tr("Do you really want to delete the selected log files?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
|
||||
if(ret == QMessageBox::Yes) {
|
||||
for (int i = 0; i < selectedItemsList.size(); ++i) {
|
||||
@@ -138,7 +138,7 @@ void LogFileDialog::exportLogToHtml()
|
||||
QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem();
|
||||
|
||||
if(selectedItem) {
|
||||
QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to HTML"),
|
||||
QDir::homePath()+"/"+fi.baseName()+".html",
|
||||
tr("PokerTH HTML log (*.html)"));
|
||||
@@ -154,7 +154,7 @@ void LogFileDialog::exportLogToTxt()
|
||||
QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem();
|
||||
|
||||
if(selectedItem) {
|
||||
QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Export PokerTH log file to plain text"),
|
||||
QDir::homePath()+"/"+fi.baseName()+".txt",
|
||||
tr("PokerTH plain text log (*.txt)"));
|
||||
@@ -170,7 +170,7 @@ void LogFileDialog::saveLogFileAs()
|
||||
QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem();
|
||||
|
||||
if(selectedItem) {
|
||||
QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QFileInfo fi(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QString fileName = QFileDialog::getSaveFileName(this, tr("Save PokerTH log file"),
|
||||
QDir::homePath()+"/"+fi.baseName()+".pdb",
|
||||
tr("PokerTH SQL log (*.pdb)"));
|
||||
@@ -185,19 +185,19 @@ void LogFileDialog::showLogFilePreview(ShowLogMode mode)
|
||||
{
|
||||
QTreeWidgetItem* selectedItem = ui->treeWidget_logFiles->currentItem();
|
||||
|
||||
if(mode == INIT_VIEW) {
|
||||
ui->comboBox->blockSignals(TRUE);
|
||||
ui->comboBox->clear();
|
||||
QList<int> gameIds = myGuiLog->getGameList(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QList<int>::const_iterator it;
|
||||
for (it = gameIds.constBegin(); it != gameIds.constEnd(); ++it) {
|
||||
ui->comboBox->addItem(QString::number(*it));
|
||||
}
|
||||
ui->comboBox->blockSignals(FALSE);
|
||||
}
|
||||
if(mode == INIT_VIEW) {
|
||||
ui->comboBox->blockSignals(TRUE);
|
||||
ui->comboBox->clear();
|
||||
QList<int> gameIds = myGuiLog->getGameList(selectedItem->data(0, Qt::UserRole).toString());
|
||||
QList<int>::const_iterator it;
|
||||
for (it = gameIds.constBegin(); it != gameIds.constEnd(); ++it) {
|
||||
ui->comboBox->addItem(QString::number(*it));
|
||||
}
|
||||
ui->comboBox->blockSignals(FALSE);
|
||||
}
|
||||
|
||||
if(selectedItem) {
|
||||
myGuiLog->showLog(selectedItem->data(0, Qt::UserRole).toString(), ui->textBrowser_logPreview, ui->comboBox->itemText(ui->comboBox->currentIndex()).toInt());
|
||||
myGuiLog->showLog(selectedItem->data(0, Qt::UserRole).toString(), ui->textBrowser_logPreview, ui->comboBox->itemText(ui->comboBox->currentIndex()).toInt());
|
||||
}
|
||||
|
||||
QTextCursor cursor(ui->textBrowser_logPreview->textCursor());
|
||||
@@ -209,9 +209,9 @@ void LogFileDialog::keyPressEvent ( QKeyEvent * event )
|
||||
{
|
||||
if (event->key() == Qt::Key_Delete ) { /*Delete*/
|
||||
if(ui->treeWidget_logFiles->hasFocus()) {
|
||||
ui->pushButton_deleteLog->click();
|
||||
ui->pushButton_deleteLog->click();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LogFileDialog::uploadFile()
|
||||
@@ -237,21 +237,21 @@ void LogFileDialog::uploadInProgressAnimationStart()
|
||||
//const QString buttonText(tr("Upload in progress"));
|
||||
ui->pushButton_analyseLogfile->setDisabled(TRUE);
|
||||
|
||||
QMovie *movie = new QMovie(":/gfx/loader.gif");
|
||||
ui->label_animation->setMovie(movie);
|
||||
ui->label_animation->setMaximumWidth(32);
|
||||
ui->horizontalLayout_animation->setSpacing(-1);
|
||||
ui->label_animation->setGeometry(0,0,32,32);
|
||||
movie->start();
|
||||
QMovie *movie = new QMovie(":/gfx/loader.gif");
|
||||
ui->label_animation->setMovie(movie);
|
||||
ui->label_animation->setMaximumWidth(32);
|
||||
ui->horizontalLayout_animation->setSpacing(-1);
|
||||
ui->label_animation->setGeometry(0,0,32,32);
|
||||
movie->start();
|
||||
}
|
||||
|
||||
void LogFileDialog::uploadInProgressAnimationStop()
|
||||
{
|
||||
ui->pushButton_analyseLogfile->setDisabled(FALSE);
|
||||
ui->pushButton_analyseLogfile->setDisabled(FALSE);
|
||||
|
||||
ui->label_animation->setMaximumWidth(0);
|
||||
ui->horizontalLayout_animation->setSpacing(0);
|
||||
ui->label_animation->setGeometry(0,0,0,0);
|
||||
ui->label_animation->setMaximumWidth(0);
|
||||
ui->horizontalLayout_animation->setSpacing(0);
|
||||
ui->label_animation->setGeometry(0,0,0,0);
|
||||
}
|
||||
|
||||
void LogFileDialog::showLogAnalysis(QString /*filename*/, QString returnMessage)
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
|
||||
class UploaderThread;
|
||||
|
||||
namespace Ui {
|
||||
class LogFileDialog;
|
||||
namespace Ui
|
||||
{
|
||||
class LogFileDialog;
|
||||
}
|
||||
|
||||
enum ShowLogMode { INIT_VIEW, SELECTED_GAME };
|
||||
@@ -39,12 +40,14 @@ class Callback;
|
||||
class LogFileDialog : public QDialog, public UploadCallback
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
||||
public:
|
||||
explicit LogFileDialog(QWidget *parent = 0, ConfigFile *c = 0);
|
||||
~LogFileDialog();
|
||||
|
||||
void setGuiLog(guiLog *g) { myGuiLog = g; }
|
||||
void setGuiLog(guiLog *g) {
|
||||
myGuiLog = g;
|
||||
}
|
||||
void exec();
|
||||
|
||||
virtual void UploadCompleted(const std::string &filename, const std::string &returnMessage);
|
||||
@@ -60,25 +63,29 @@ public slots:
|
||||
void exportLogToHtml();
|
||||
void exportLogToTxt();
|
||||
void saveLogFileAs();
|
||||
void showLogFilePreviewInit() {showLogFilePreview(INIT_VIEW); }
|
||||
void showLogFilePreviewSelected() {showLogFilePreview(SELECTED_GAME); }
|
||||
void showLogFilePreview(ShowLogMode);
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
void uploadFile();
|
||||
void uploadInProgressAnimationStart();
|
||||
void uploadInProgressAnimationStop();
|
||||
void showLogFilePreviewInit() {
|
||||
showLogFilePreview(INIT_VIEW);
|
||||
}
|
||||
void showLogFilePreviewSelected() {
|
||||
showLogFilePreview(SELECTED_GAME);
|
||||
}
|
||||
void showLogFilePreview(ShowLogMode);
|
||||
void keyPressEvent ( QKeyEvent * event );
|
||||
void uploadFile();
|
||||
void uploadInProgressAnimationStart();
|
||||
void uploadInProgressAnimationStop();
|
||||
|
||||
void showLogAnalysis(QString filename, QString returnMessage);
|
||||
void showUploadError(QString filename, QString errorMessage);
|
||||
|
||||
private:
|
||||
private:
|
||||
ConfigFile *myConfig;
|
||||
guiLog *myGuiLog;
|
||||
Ui::LogFileDialog *ui;
|
||||
int writer(char *data, size_t size, size_t nmemb,std::string *buffer);
|
||||
QFile file;
|
||||
QString id;
|
||||
boost::shared_ptr<UploaderThread> uploader;
|
||||
Ui::LogFileDialog *ui;
|
||||
int writer(char *data, size_t size, size_t nmemb,std::string *buffer);
|
||||
QFile file;
|
||||
QString id;
|
||||
boost::shared_ptr<UploaderThread> uploader;
|
||||
};
|
||||
|
||||
#endif // LOGFILEDIALOG_H
|
||||
|
||||
@@ -2,22 +2,22 @@
|
||||
#include <QMessageBox>
|
||||
|
||||
MyMessageBox::MyMessageBox(QWidget *parent) :
|
||||
QMessageBox(parent)
|
||||
QMessageBox(parent)
|
||||
{
|
||||
#ifdef ANDROID
|
||||
this->setWindowModality(Qt::WindowModal);
|
||||
this->setWindowFlags(Qt::ToolTip);
|
||||
this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
this->setWindowModality(Qt::WindowModal);
|
||||
this->setWindowFlags(Qt::ToolTip);
|
||||
this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
}
|
||||
|
||||
MyMessageBox::MyMessageBox(Icon icon, const QString &title, const QString &text, QFlags<QMessageBox::StandardButton> buttons, QWidget *parent, Qt::WindowFlags flags) :
|
||||
QMessageBox(icon, title, text, buttons, parent, flags)
|
||||
QMessageBox(icon, title, text, buttons, parent, flags)
|
||||
{
|
||||
#ifdef ANDROID
|
||||
this->setWindowModality(Qt::WindowModal);
|
||||
this->setWindowFlags(Qt::ToolTip);
|
||||
this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
this->setWindowModality(Qt::WindowModal);
|
||||
this->setWindowFlags(Qt::ToolTip);
|
||||
this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -28,49 +28,49 @@ MyMessageBox::~MyMessageBox()
|
||||
|
||||
QMessageBox::StandardButton MyMessageBox::information(QWidget *parent, const QString &title, const QString &text, QFlags<QMessageBox::StandardButton> buttons, QMessageBox::StandardButton defaultButton)
|
||||
{
|
||||
QMessageBox box(QMessageBox::Information, title, text, buttons, parent);
|
||||
QMessageBox box(QMessageBox::Information, title, text, buttons, parent);
|
||||
#ifdef ANDROID
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton MyMessageBox::question(QWidget *parent, const QString &title, const QString &text, QFlags<QMessageBox::StandardButton> buttons, QMessageBox::StandardButton defaultButton)
|
||||
{
|
||||
QMessageBox box(QMessageBox::Question, title, text, buttons, parent);
|
||||
QMessageBox box(QMessageBox::Question, title, text, buttons, parent);
|
||||
#ifdef ANDROID
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton MyMessageBox::warning(QWidget *parent, const QString &title, const QString &text, QFlags<QMessageBox::StandardButton> buttons, QMessageBox::StandardButton defaultButton)
|
||||
{
|
||||
QMessageBox box(QMessageBox::Warning, title, text, buttons, parent);
|
||||
QMessageBox box(QMessageBox::Warning, title, text, buttons, parent);
|
||||
#ifdef ANDROID
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
}
|
||||
|
||||
QMessageBox::StandardButton MyMessageBox::critical(QWidget *parent, const QString &title, const QString &text, QFlags<QMessageBox::StandardButton> buttons, QMessageBox::StandardButton defaultButton)
|
||||
{
|
||||
QMessageBox box(QMessageBox::Critical, title, text, buttons, parent);
|
||||
QMessageBox box(QMessageBox::Critical, title, text, buttons, parent);
|
||||
#ifdef ANDROID
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
box.setWindowModality(Qt::WindowModal);
|
||||
box.setWindowFlags(Qt::ToolTip);
|
||||
box.setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
box.setDefaultButton(defaultButton);
|
||||
return static_cast<QMessageBox::StandardButton>(box.exec());
|
||||
}
|
||||
|
||||
|
||||
@@ -5,27 +5,27 @@
|
||||
|
||||
class MyMessageBox : public QMessageBox
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
MyMessageBox(QWidget *parent = 0);
|
||||
MyMessageBox(QWidget *parent = 0);
|
||||
|
||||
MyMessageBox(Icon icon, const QString &title, const QString &text,
|
||||
QFlags<QMessageBox::StandardButton> buttons = QMessageBox::NoButton, QWidget *parent = 0,
|
||||
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||
MyMessageBox(Icon icon, const QString &title, const QString &text,
|
||||
QFlags<QMessageBox::StandardButton> buttons = QMessageBox::NoButton, QWidget *parent = 0,
|
||||
Qt::WindowFlags flags = Qt::Dialog | Qt::MSWindowsFixedSizeDialogHint);
|
||||
|
||||
~MyMessageBox();
|
||||
~MyMessageBox();
|
||||
|
||||
static QMessageBox::StandardButton information(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
static QMessageBox::StandardButton information(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
|
||||
static QMessageBox::StandardButton question(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
static QMessageBox::StandardButton question(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
|
||||
static QMessageBox::StandardButton warning(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
static QMessageBox::StandardButton warning(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
|
||||
static QMessageBox::StandardButton critical(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
static QMessageBox::StandardButton critical(QWidget *parent, const QString &title,
|
||||
const QString &text, QFlags<QMessageBox::StandardButton> buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
|
||||
|
||||
signals:
|
||||
|
||||
|
||||
@@ -25,18 +25,18 @@
|
||||
#endif
|
||||
|
||||
enum MESSAGE_CONTENT {
|
||||
NONE=0, //0: not set ;)
|
||||
BACKTO_LOBBY_QUESTION, //1: leave lobby during online game: Question(Do you really wanna leave?)
|
||||
INFO_AFTER_JOIN_INVITE_GAME, //2: join invite only game: Info(You can invite people with right click ...)
|
||||
JOIN_INVITE_GAME_QUESTION, //3: reciev invite to game: Question(You've been invited to the game <b>%1</b> by <b>%2</b>.<br>Do you want to join this game?)
|
||||
INGNORE_PLAYER_QUESTION, //4: click ignore player: Question(Do you really want to put this player on ignore List?)
|
||||
GT_VALUES_MISSING, //5: Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing.
|
||||
CLOSE_GAMETABLE_QUESTION, //6: close gametable: Do you really wanna quit?
|
||||
GT_PICS_MISSING, //7: One or more pictures from current game table style \"%1\" were not found:
|
||||
GT_OUTDATED, //8: Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is
|
||||
CD_VALUES_MISSING, //9:
|
||||
CD_PICS_MISSING, //10:
|
||||
CD_OUTDATED //11:
|
||||
NONE=0, //0: not set ;)
|
||||
BACKTO_LOBBY_QUESTION, //1: leave lobby during online game: Question(Do you really wanna leave?)
|
||||
INFO_AFTER_JOIN_INVITE_GAME, //2: join invite only game: Info(You can invite people with right click ...)
|
||||
JOIN_INVITE_GAME_QUESTION, //3: reciev invite to game: Question(You've been invited to the game <b>%1</b> by <b>%2</b>.<br>Do you want to join this game?)
|
||||
INGNORE_PLAYER_QUESTION, //4: click ignore player: Question(Do you really want to put this player on ignore List?)
|
||||
GT_VALUES_MISSING, //5: Selected game table style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing.
|
||||
CLOSE_GAMETABLE_QUESTION, //6: close gametable: Do you really wanna quit?
|
||||
GT_PICS_MISSING, //7: One or more pictures from current game table style \"%1\" were not found:
|
||||
GT_OUTDATED, //8: Selected game table style \"%1\" seems to be outdated. \nThe current PokerTH game table style version is
|
||||
CD_VALUES_MISSING, //9:
|
||||
CD_PICS_MISSING, //10:
|
||||
CD_OUTDATED //11:
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -100,12 +100,10 @@ bool newGameDialogImpl::eventFilter(QObject *obj, QEvent *event)
|
||||
}
|
||||
event->ignore();
|
||||
return false;
|
||||
}
|
||||
else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
} else if (event->type() == QEvent::KeyPress && keyEvent->key() == Qt::Key_Back) {
|
||||
this->reject();
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
// pass the event on to the parent class
|
||||
return QDialog::eventFilter(obj, event);
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
return myChangeCompleteBlindsDialog;
|
||||
}
|
||||
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
bool eventFilter(QObject *obj, QEvent *event);
|
||||
|
||||
public slots:
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ void manualBlindsOrderDialogImpl::addBlindValueToList()
|
||||
|
||||
if(listWidget_blinds->count() == 30) {
|
||||
MyMessageBox::warning(this, tr("Manual Blinds Order"),
|
||||
tr("You cannot set more than 30 manual blinds."),
|
||||
QMessageBox::Close);
|
||||
tr("You cannot set more than 30 manual blinds."),
|
||||
QMessageBox::Close);
|
||||
} else {
|
||||
listWidget_blinds->addItem(QString::number(spinBox_input->value(),10));
|
||||
sortBlindsList();
|
||||
|
||||
@@ -239,8 +239,8 @@ void selectAvatarDialogImpl::isAccepted()
|
||||
if(groupBox->isChecked()) {
|
||||
if(myItemList.size() == 0) {
|
||||
MyMessageBox::warning(this, tr("Avatar File Error"),
|
||||
tr("Please select an avatar from the list!"),
|
||||
QMessageBox::Ok);
|
||||
tr("Please select an avatar from the list!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
} else settingsCorrect = TRUE;;
|
||||
}
|
||||
@@ -254,18 +254,18 @@ void selectAvatarDialogImpl::isAccepted()
|
||||
settingsCorrect = TRUE;
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Avatar File Error"),
|
||||
tr("The file size of the chosen picture is too big. (max. 30KB)\n"
|
||||
"Please choose a smaller picture!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The file size of the chosen picture is too big. (max. 30KB)\n"
|
||||
"Please choose a smaller picture!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
externalAvatar = "";
|
||||
|
||||
}
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Avatar File Error"),
|
||||
tr("The entered avatar picture doesn't exist.\n"
|
||||
"Please enter an valid picture!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The entered avatar picture doesn't exist.\n"
|
||||
"Please enter an valid picture!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
externalAvatar = "";
|
||||
}
|
||||
|
||||
@@ -37,11 +37,11 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
|
||||
setupUi(this);
|
||||
|
||||
#ifdef ANDROID
|
||||
stackedWidget->removeWidget(page_styles);
|
||||
listWidget->takeItem(1);
|
||||
label_soundvol->hide();
|
||||
label_soundVolume->hide();
|
||||
horizontalSlider_soundVolume->hide();
|
||||
stackedWidget->removeWidget(page_styles);
|
||||
listWidget->takeItem(1);
|
||||
label_soundvol->hide();
|
||||
label_soundVolume->hide();
|
||||
horizontalSlider_soundVolume->hide();
|
||||
#endif
|
||||
|
||||
myManualBlindsOrderDialog = new manualBlindsOrderDialogImpl;
|
||||
@@ -131,8 +131,8 @@ settingsDialogImpl::settingsDialogImpl(QWidget *parent, ConfigFile *c, selectAva
|
||||
connect( pushButton_internetGameRemoveIgnoredPlayer, SIGNAL( clicked()), this, SLOT( removePlayerFromIgnoredPlayersList()));
|
||||
|
||||
#ifdef GUI_800x480
|
||||
//make the scrollbar touchable for mobile guis
|
||||
comboBox_switchLanguage->setStyleSheet("QObject {font: 30px} QScrollBar:vertical { border: 1px solid grey; background: white; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 3px; border: 2px solid grey; background: LightGrey ; min-height: 60px; } QScrollBar::add-line:vertical { background: none; } QScrollBar::sub-line:vertical { background: none; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { background: none; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
|
||||
//make the scrollbar touchable for mobile guis
|
||||
comboBox_switchLanguage->setStyleSheet("QObject {font: 30px} QScrollBar:vertical { border: 1px solid grey; background: white; width: 60px; margin: 0px -1px 0px 0px; } QScrollBar::handle:vertical { border-radius: 3px; border: 2px solid grey; background: LightGrey ; min-height: 60px; } QScrollBar::add-line:vertical { background: none; } QScrollBar::sub-line:vertical { background: none; } QScrollBar:up-arrow:vertical, QScrollBar::down-arrow:vertical { background: none; } QScrollBar::add-page:vertical, QScrollBar::sub-page:vertical { background: none; }");
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -211,10 +211,10 @@ void settingsDialogImpl::prepareDialog()
|
||||
checkBox_useIpv6->setChecked(myConfig->readConfigInt("ServerUseIpv6"));
|
||||
checkBox_useSctp->setChecked(myConfig->readConfigInt("ServerUseSctp"));
|
||||
|
||||
//Internet Game Settings
|
||||
//Internet Game Settings
|
||||
|
||||
checkBox_InternetServerUseSctp->hide(); //temporarely disabled until sctp support is back
|
||||
label_whatIsSctp->hide();
|
||||
checkBox_InternetServerUseSctp->hide(); //temporarely disabled until sctp support is back
|
||||
label_whatIsSctp->hide();
|
||||
|
||||
lineEdit_InternetServerListAddress->setText(QString::fromUtf8(myConfig->readConfigString("InternetServerListAddress").c_str()));
|
||||
lineEdit_InternetServerAddress->setText(QString::fromUtf8(myConfig->readConfigString("InternetServerAddress").c_str()));
|
||||
@@ -237,11 +237,11 @@ void settingsDialogImpl::prepareDialog()
|
||||
checkBox_InetGane_AutoLeaveTheTableAfterGameFinished->setChecked(myConfig->readConfigInt("NetAutoLeaveGameAfterFinish"));
|
||||
comboBox_internetGameType->setCurrentIndex(myConfig->readConfigInt("InternetGameType"));
|
||||
lineEdit_internetGameName->setText(QString::fromUtf8(myConfig->readConfigString("InternetGameName").c_str()));
|
||||
if(myConfig->readConfigInt("InternetServerConfigMode")) {
|
||||
groupBox_manualServerConfig->setChecked(TRUE);
|
||||
} else {
|
||||
groupBox_automaticServerConfig->setChecked(TRUE);
|
||||
}
|
||||
if(myConfig->readConfigInt("InternetServerConfigMode")) {
|
||||
groupBox_manualServerConfig->setChecked(TRUE);
|
||||
} else {
|
||||
groupBox_automaticServerConfig->setChecked(TRUE);
|
||||
}
|
||||
|
||||
std::list<std::string> playerIgnoreList = myConfig->readConfigStringList("PlayerIgnoreList");
|
||||
std::list<std::string>::iterator it5;
|
||||
@@ -275,21 +275,21 @@ void settingsDialogImpl::prepareDialog()
|
||||
#ifdef GUI_800x480
|
||||
// define PokerTH default GameTableStyle for Maemo
|
||||
treeWidget_gameTableStyles->clear();
|
||||
QString filename;
|
||||
QString filename;
|
||||
#ifdef MAEMO
|
||||
filename = "defaulttablestyle_800x480.xml";
|
||||
filename = "defaulttablestyle_800x480.xml";
|
||||
#elif ANDROID
|
||||
filename = "android_tablestyle_800x480.xml";
|
||||
filename = "android_tablestyle_800x480.xml";
|
||||
#endif
|
||||
GameTableStyleReader defaultTableStyle(myConfig, this);
|
||||
defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename);
|
||||
defaultTableStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename);
|
||||
if(defaultTableStyle.getLoadedSuccessfull()) {
|
||||
QStringList tempStringList1;
|
||||
tempStringList1 << defaultTableStyle.getStyleDescription() << defaultTableStyle.getStyleMaintainerName();
|
||||
MyStyleListItem *defaultTableItem = new MyStyleListItem(tempStringList1, treeWidget_gameTableStyles);
|
||||
defaultTableItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename);
|
||||
defaultTableItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename);
|
||||
defaultTableItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
|
||||
defaultTableItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename);
|
||||
defaultTableItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/gui/table/default_800x480/"+filename);
|
||||
defaultTableItem->setData(2, Qt::ToolTipRole, defaultTableStyle.getMyStateToolTipInfo());
|
||||
if(defaultTableStyle.getState()) defaultTableItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else defaultTableItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
@@ -383,23 +383,23 @@ void settingsDialogImpl::prepareDialog()
|
||||
showCurrentGameTableStylePreview();
|
||||
|
||||
//CARDS
|
||||
// define PokerTH 1.0 default carddeck
|
||||
treeWidget_cardDeckStyles->clear();
|
||||
CardDeckStyleReader defaultCardStyle10(myConfig, this);
|
||||
defaultCardStyle10.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml");
|
||||
if(defaultCardStyle10.getLoadedSuccessfull()) {
|
||||
QStringList tempStringList1;
|
||||
tempStringList1 << defaultCardStyle10.getStyleDescription() << defaultCardStyle10.getStyleMaintainerName();
|
||||
MyStyleListItem *defaultCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
|
||||
defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml");
|
||||
defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
|
||||
defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml");
|
||||
defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle10.getMyStateToolTipInfo());
|
||||
if(defaultCardStyle10.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
}
|
||||
// define PokerTH 1.0 default carddeck
|
||||
treeWidget_cardDeckStyles->clear();
|
||||
CardDeckStyleReader defaultCardStyle10(myConfig, this);
|
||||
defaultCardStyle10.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml");
|
||||
if(defaultCardStyle10.getLoadedSuccessfull()) {
|
||||
QStringList tempStringList1;
|
||||
tempStringList1 << defaultCardStyle10.getStyleDescription() << defaultCardStyle10.getStyleMaintainerName();
|
||||
MyStyleListItem *defaultCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
|
||||
defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml");
|
||||
defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
|
||||
defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml");
|
||||
defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle10.getMyStateToolTipInfo());
|
||||
if(defaultCardStyle10.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
}
|
||||
#ifndef GUI_800x480
|
||||
//define PokerTH old default CardDeck
|
||||
//define PokerTH old default CardDeck
|
||||
CardDeckStyleReader defaultCardStyle(myConfig, this);
|
||||
defaultCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
|
||||
if(defaultCardStyle.getLoadedSuccessfull()) {
|
||||
@@ -409,11 +409,11 @@ void settingsDialogImpl::prepareDialog()
|
||||
defaultCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
|
||||
defaultCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
|
||||
defaultCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default/defaultdeckstyle.xml");
|
||||
defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle.getMyStateToolTipInfo());
|
||||
if(defaultCardStyle.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
defaultCardItem->setData(2, Qt::ToolTipRole, defaultCardStyle.getMyStateToolTipInfo());
|
||||
if(defaultCardStyle.getState()) defaultCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else defaultCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
}
|
||||
//define PokerTH old default CardDeck4c
|
||||
//define PokerTH old default CardDeck4c
|
||||
CardDeckStyleReader default4cCardStyle(myConfig, this);
|
||||
default4cCardStyle.readStyleFile(QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
|
||||
if(default4cCardStyle.getLoadedSuccessfull()) {
|
||||
@@ -421,11 +421,11 @@ void settingsDialogImpl::prepareDialog()
|
||||
tempStringList1 << default4cCardStyle.getStyleDescription() << default4cCardStyle.getStyleMaintainerName();
|
||||
MyStyleListItem *default4cCardItem = new MyStyleListItem(tempStringList1, treeWidget_cardDeckStyles);
|
||||
default4cCardItem->setData(0, 15, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
|
||||
default4cCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
|
||||
default4cCardItem->setData(0, 16, POKERTH_DISTRIBUTED_STYLE);
|
||||
default4cCardItem->setData(0, Qt::ToolTipRole, QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default4c/default4cdeckstyle.xml");
|
||||
default4cCardItem->setData(2, Qt::ToolTipRole, default4cCardStyle.getMyStateToolTipInfo());
|
||||
if(default4cCardStyle.getState()) default4cCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else default4cCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
default4cCardItem->setData(2, Qt::ToolTipRole, default4cCardStyle.getMyStateToolTipInfo());
|
||||
if(default4cCardStyle.getState()) default4cCardItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else default4cCardItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
}
|
||||
#endif
|
||||
//load secondary card styles into list (if fallback no entry)
|
||||
@@ -441,9 +441,9 @@ void settingsDialogImpl::prepareDialog()
|
||||
nextItem->setData(0, 15,QString::fromUtf8(it2->c_str()));
|
||||
nextItem->setData(0, 16, ADDITIONAL_STYLE);
|
||||
nextItem->setData(0, Qt::ToolTipRole,QString::fromUtf8(it2->c_str()));
|
||||
nextItem->setData(2, Qt::ToolTipRole, nextStyle.getMyStateToolTipInfo());
|
||||
if(nextStyle.getState()) nextItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else nextItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
nextItem->setData(2, Qt::ToolTipRole, nextStyle.getMyStateToolTipInfo());
|
||||
if(nextStyle.getState()) nextItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else nextItem->setIcon(2, QIcon(":/gfx/dialog_ok_apply.png"));
|
||||
treeWidget_cardDeckStyles->addTopLevelItem(nextItem);
|
||||
}
|
||||
}
|
||||
@@ -579,9 +579,9 @@ void settingsDialogImpl::isAccepted()
|
||||
|
||||
if(checkSetPlayerNicks.count() != 10) {
|
||||
MyMessageBox::warning(this, tr("Settings Error"),
|
||||
tr("The opponent names are not unique.\n"
|
||||
"Please choose different names for each Opponent!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The opponent names are not unique.\n"
|
||||
"Please choose different names for each Opponent!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
} else {
|
||||
//save nicks and avatars
|
||||
@@ -660,9 +660,9 @@ void settingsDialogImpl::isAccepted()
|
||||
myConfig->writeConfigString("InternetServerListAddress", lineEdit_InternetServerListAddress->text().toUtf8().constData());
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Settings Error"),
|
||||
tr("The entered server list address is not a valid URL.\n"
|
||||
"Please enter a valid server list address!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The entered server list address is not a valid URL.\n"
|
||||
"Please enter a valid server list address!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -722,9 +722,9 @@ void settingsDialogImpl::isAccepted()
|
||||
myConfig->writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toUtf8().constData());
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Settings Error"),
|
||||
tr("The entered flipside picture doesn't exist.\n"
|
||||
"Please enter an valid picture!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The entered flipside picture doesn't exist.\n"
|
||||
"Please enter an valid picture!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
}
|
||||
}
|
||||
@@ -782,9 +782,9 @@ void settingsDialogImpl::isAccepted()
|
||||
myConfig->writeConfigString("LogDir", lineEdit_logDir->text().toUtf8().constData());
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Settings Error"),
|
||||
tr("The log file directory doesn't exist.\n"
|
||||
"Please select an valid directory!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The log file directory doesn't exist.\n"
|
||||
"Please select an valid directory!"),
|
||||
QMessageBox::Ok);
|
||||
settingsCorrect = FALSE;
|
||||
}
|
||||
|
||||
@@ -812,8 +812,8 @@ void settingsDialogImpl::isAccepted()
|
||||
|
||||
if(languageIsChanged) {
|
||||
MyMessageBox::information(this, tr("Language Changed"),
|
||||
tr("You have changed application language to %1.\nPlease restart PokerTH to load new language!").arg(comboBox_switchLanguage->itemText(changedLanguageIndex)),
|
||||
QMessageBox::Ok);
|
||||
tr("You have changed application language to %1.\nPlease restart PokerTH to load new language!").arg(comboBox_switchLanguage->itemText(changedLanguageIndex)),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
|
||||
//Wenn alles richtig eingegeben wurde --> Dialog schließen
|
||||
@@ -951,14 +951,14 @@ void settingsDialogImpl::setLogDir()
|
||||
if(logDir.exists()) {
|
||||
lineEdit_logDir->setText(dir);
|
||||
MyMessageBox::information(this, tr("Settings Information"),
|
||||
tr("You have changed the log file directory.\n"
|
||||
"Please restart PokerTH to use the new directory for the log files!"),
|
||||
QMessageBox::Ok);
|
||||
tr("You have changed the log file directory.\n"
|
||||
"Please restart PokerTH to use the new directory for the log files!"),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Settings Error"),
|
||||
tr("The log file directory doesn't exist.\n"
|
||||
"Please select an valid directory!"),
|
||||
QMessageBox::Ok);
|
||||
tr("The log file directory doesn't exist.\n"
|
||||
"Please select an valid directory!"),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1059,8 +1059,8 @@ void settingsDialogImpl::setFirstSmallBlindMargin()
|
||||
if(radioButton_manualBlindsOrder->isChecked() && !myManualBlindsList.empty()) {
|
||||
if(spinBox_firstSmallBlind->value() > myManualBlindsList.front()) {
|
||||
MyMessageBox::warning(this, tr("Blinds Error"),
|
||||
tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."),
|
||||
QMessageBox::Close);
|
||||
tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
spinBox_firstSmallBlind->setMaximum(myManualBlindsList.front());
|
||||
} else {
|
||||
@@ -1069,8 +1069,8 @@ void settingsDialogImpl::setFirstSmallBlindMargin()
|
||||
if(radioButton_netManualBlindsOrder->isChecked() && !myNetManualBlindsList.empty()) {
|
||||
if(spinBox_netFirstSmallBlind->value() > myNetManualBlindsList.front()) {
|
||||
MyMessageBox::warning(this, tr("Blinds Error"),
|
||||
tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."),
|
||||
QMessageBox::Close);
|
||||
tr("The first element in your manual-blinds-list \nis smaller than current first-small-blind!\nThis first-small-blind-value will be set to maximum allowed value."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
spinBox_netFirstSmallBlind->setMaximum(myNetManualBlindsList.front());
|
||||
} else {
|
||||
@@ -1187,8 +1187,8 @@ void settingsDialogImpl::addGameTableStyle()
|
||||
|
||||
if(fileNameAlreadyFound) {
|
||||
MyMessageBox::warning(this, tr("Game Table Style Error"),
|
||||
tr("Selected game table style file is already in the list. \nPlease select another one to add!"),
|
||||
QMessageBox::Ok);
|
||||
tr("Selected game table style file is already in the list. \nPlease select another one to add!"),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
GameTableStyleReader newStyle(myConfig, this);
|
||||
newStyle.readStyleFile(fileName);
|
||||
@@ -1210,8 +1210,8 @@ void settingsDialogImpl::addGameTableStyle()
|
||||
if(newStyle.getState() != GT_STYLE_OK) newStyle.showErrorMessage();
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Game Table Style File Error"),
|
||||
tr("Could not load game table style file correctly. \nStyle will not be placed into list!"),
|
||||
QMessageBox::Ok);
|
||||
tr("Could not load game table style file correctly. \nStyle will not be placed into list!"),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
//save current filepath
|
||||
@@ -1313,8 +1313,8 @@ void settingsDialogImpl::addCardDeckStyle()
|
||||
|
||||
if(fileNameAlreadyFound) {
|
||||
MyMessageBox::warning(this, tr("Card Deck Style Error"),
|
||||
tr("Selected card deck style file is already in the list. \nPlease select another one to add!"),
|
||||
QMessageBox::Ok);
|
||||
tr("Selected card deck style file is already in the list. \nPlease select another one to add!"),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
CardDeckStyleReader newStyle(myConfig, this);
|
||||
newStyle.readStyleFile(fileName);
|
||||
@@ -1325,21 +1325,21 @@ void settingsDialogImpl::addCardDeckStyle()
|
||||
newItem->setData(0, 15,fileName);
|
||||
newItem->setData(0, 16, ADDITIONAL_STYLE);
|
||||
newItem->setData(0, Qt::ToolTipRole,fileName);
|
||||
newItem->setData(2, Qt::ToolTipRole, newStyle.getMyStateToolTipInfo());
|
||||
if(newStyle.getState() != CD_STYLE_OK) newItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else newItem->setIcon(2, QIcon(":/gfx/dialog-ok-apply.png"));
|
||||
newItem->setData(2, Qt::ToolTipRole, newStyle.getMyStateToolTipInfo());
|
||||
if(newStyle.getState() != CD_STYLE_OK) newItem->setIcon(2, QIcon(":/gfx/emblem-important.png"));
|
||||
else newItem->setIcon(2, QIcon(":/gfx/dialog-ok-apply.png"));
|
||||
|
||||
qDebug() << "settings: " << newStyle.getStyleDescription() << newStyle.getState();
|
||||
if(newStyle.getState() != CD_STYLE_OK) newStyle.showErrorMessage();
|
||||
qDebug() << "settings: " << newStyle.getStyleDescription() << newStyle.getState();
|
||||
if(newStyle.getState() != CD_STYLE_OK) newStyle.showErrorMessage();
|
||||
|
||||
treeWidget_cardDeckStyles->addTopLevelItem(newItem);
|
||||
treeWidget_cardDeckStyles->addTopLevelItem(newItem);
|
||||
treeWidget_cardDeckStyles->setCurrentItem(newItem);
|
||||
treeWidget_cardDeckStyles->sortItems(0, Qt::AscendingOrder);
|
||||
|
||||
} else {
|
||||
MyMessageBox::warning(this, tr("Card Deck Style File Error"),
|
||||
tr("Could not load card deck style file correctly. \nStyle will not be placed into list!"),
|
||||
QMessageBox::Ok);
|
||||
tr("Could not load card deck style file correctly. \nStyle will not be placed into list!"),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
//save current filepath
|
||||
@@ -1376,9 +1376,9 @@ void settingsDialogImpl::removePlayerFromIgnoredPlayersList()
|
||||
void settingsDialogImpl::resetSettings()
|
||||
{
|
||||
int ret = MyMessageBox::warning(this, tr("PokerTH - Settings"),
|
||||
tr("Attention: this will delete all your personal settings and close PokerTH!\n"
|
||||
"Do you really want to reset factory settings?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
tr("Attention: this will delete all your personal settings and close PokerTH!\n"
|
||||
"Do you really want to reset factory settings?"),
|
||||
QMessageBox::Yes | QMessageBox::No);
|
||||
if(ret == QMessageBox::Yes) {
|
||||
myConfig->deleteConfigFile();
|
||||
exit(0);
|
||||
|
||||
@@ -143,7 +143,7 @@ private:
|
||||
bool calledIngame;
|
||||
int changedLanguageIndex;
|
||||
guiLog *myGuiLog;
|
||||
FlickCharm *fc;
|
||||
FlickCharm *fc;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#include "androidapi8dummy.h"
|
||||
|
||||
AndroidApi8Dummy::AndroidApi8Dummy(ConfigFile *c, QObject *parent) :
|
||||
QObject(parent), myConfig(c)
|
||||
QObject(parent), myConfig(c)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@@ -6,24 +6,24 @@ class ConfigFile;
|
||||
|
||||
class AndroidApi8Dummy : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AndroidApi8Dummy(ConfigFile *c, QObject *parent = 0);
|
||||
~AndroidApi8Dummy();
|
||||
explicit AndroidApi8Dummy(ConfigFile *c, QObject *parent = 0);
|
||||
~AndroidApi8Dummy();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
void registerSound(const QString&, const QString&){}
|
||||
void reallyPlaySound(const QString&){}
|
||||
void playSound(const std::string&, int){}
|
||||
void initAudio(){}
|
||||
void closeAudio(){}
|
||||
void reInit(){}
|
||||
void registerSound(const QString&, const QString&) {}
|
||||
void reallyPlaySound(const QString&) {}
|
||||
void playSound(const std::string&, int) {}
|
||||
void initAudio() {}
|
||||
void closeAudio() {}
|
||||
void reInit() {}
|
||||
|
||||
private:
|
||||
ConfigFile *myConfig;
|
||||
ConfigFile *myConfig;
|
||||
|
||||
};
|
||||
|
||||
|
||||
+116
-115
@@ -5,103 +5,103 @@
|
||||
#include <QDebug>
|
||||
|
||||
AndroidAudio::AndroidAudio(ConfigFile *c, QObject *parent) :
|
||||
QObject(parent), mEngineObject(NULL), mEngineEngine(NULL), mOutputMixObject(NULL), mSounds(), mSoundCount(0), mPlayerObject(NULL), myConfig(c), audioEnabled(FALSE)
|
||||
QObject(parent), mEngineObject(NULL), mEngineEngine(NULL), mOutputMixObject(NULL), mSounds(), mSoundCount(0), mPlayerObject(NULL), myConfig(c), audioEnabled(FALSE)
|
||||
{
|
||||
initAudio();
|
||||
initAudio();
|
||||
}
|
||||
|
||||
AndroidAudio::~AndroidAudio()
|
||||
{
|
||||
closeAudio();
|
||||
closeAudio();
|
||||
}
|
||||
|
||||
void AndroidAudio::initAudio()
|
||||
{
|
||||
if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
createEngine();
|
||||
startSoundPlayer();
|
||||
audioEnabled = TRUE;
|
||||
}
|
||||
if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
createEngine();
|
||||
startSoundPlayer();
|
||||
audioEnabled = TRUE;
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidAudio::closeAudio()
|
||||
{
|
||||
|
||||
if(audioEnabled) {
|
||||
destroyEngine();
|
||||
if(audioEnabled) {
|
||||
destroyEngine();
|
||||
|
||||
for (int32_t i = 0; i < mSoundCount; ++i) {
|
||||
qDeleteAll(mSounds);
|
||||
}
|
||||
audioEnabled = FALSE;
|
||||
}
|
||||
for (int32_t i = 0; i < mSoundCount; ++i) {
|
||||
qDeleteAll(mSounds);
|
||||
}
|
||||
audioEnabled = FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidAudio::reInit()
|
||||
{
|
||||
initAudio();
|
||||
initAudio();
|
||||
}
|
||||
|
||||
// create the engine and output mix objects
|
||||
void AndroidAudio::createEngine()
|
||||
{
|
||||
SLresult result;
|
||||
SLresult result;
|
||||
|
||||
// create engine
|
||||
result = slCreateEngine(&mEngineObject, 0, NULL, 0, NULL, NULL);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
// create engine
|
||||
result = slCreateEngine(&mEngineObject, 0, NULL, 0, NULL, NULL);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
// realize the engine
|
||||
result = (*mEngineObject)->Realize(mEngineObject, SL_BOOLEAN_FALSE);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
// realize the engine
|
||||
result = (*mEngineObject)->Realize(mEngineObject, SL_BOOLEAN_FALSE);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
// get the engine interface, which is needed in order to create other objects
|
||||
result = (*mEngineObject)->GetInterface(mEngineObject, SL_IID_ENGINE, &mEngineEngine);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
// get the engine interface, which is needed in order to create other objects
|
||||
result = (*mEngineObject)->GetInterface(mEngineObject, SL_IID_ENGINE, &mEngineEngine);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
// create output mix
|
||||
const SLInterfaceID ids[] = {};
|
||||
const SLboolean req[] = {};
|
||||
result = (*mEngineEngine)->CreateOutputMix(mEngineEngine, &mOutputMixObject, 0, ids, req);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
// create output mix
|
||||
const SLInterfaceID ids[] = {};
|
||||
const SLboolean req[] = {};
|
||||
result = (*mEngineEngine)->CreateOutputMix(mEngineEngine, &mOutputMixObject, 0, ids, req);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
// realize the output mix
|
||||
result = (*mOutputMixObject)->Realize(mOutputMixObject, SL_BOOLEAN_FALSE);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
// realize the output mix
|
||||
result = (*mOutputMixObject)->Realize(mOutputMixObject, SL_BOOLEAN_FALSE);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == result);
|
||||
|
||||
qDebug() << "Created Android Audio Engine";
|
||||
qDebug() << "Created Android Audio Engine";
|
||||
}
|
||||
|
||||
void AndroidAudio::destroyEngine()
|
||||
{
|
||||
if (mOutputMixObject != NULL) {
|
||||
(*mOutputMixObject)->Destroy(mOutputMixObject);
|
||||
}
|
||||
if (mOutputMixObject != NULL) {
|
||||
(*mOutputMixObject)->Destroy(mOutputMixObject);
|
||||
}
|
||||
|
||||
if (mEngineObject != NULL) {
|
||||
(*mEngineObject)->Destroy(mEngineObject);
|
||||
}
|
||||
if (mEngineObject != NULL) {
|
||||
(*mEngineObject)->Destroy(mEngineObject);
|
||||
}
|
||||
|
||||
if (mPlayerObject != NULL) {
|
||||
(*mPlayerObject)->Destroy(mPlayerObject);
|
||||
}
|
||||
if (mPlayerObject != NULL) {
|
||||
(*mPlayerObject)->Destroy(mPlayerObject);
|
||||
}
|
||||
|
||||
for (int32_t i = 0; i < mSoundCount; ++i) {
|
||||
mSounds.values().at(i)->unload();
|
||||
}
|
||||
for (int32_t i = 0; i < mSoundCount; ++i) {
|
||||
mSounds.values().at(i)->unload();
|
||||
}
|
||||
|
||||
qDebug() << "Destroyed Android Audio Engine";
|
||||
qDebug() << "Destroyed Android Audio Engine";
|
||||
}
|
||||
|
||||
void AndroidAudio::registerSound(const QString& path, const QString& name)
|
||||
{
|
||||
// qDebug() << "registerSound:" << path << name;
|
||||
AndroidSoundEffect *lSound = new AndroidSoundEffect(path, this);
|
||||
AndroidSoundEffect *lSound = new AndroidSoundEffect(path, this);
|
||||
// qDebug() << "registerSound:created";
|
||||
mSounds[name] = lSound;
|
||||
mSounds[name] = lSound;
|
||||
|
||||
// qDebug() << "registerSound:loading";
|
||||
lSound->load();
|
||||
lSound->load();
|
||||
// qDebug() << "registerSound:loaded";
|
||||
}
|
||||
|
||||
@@ -109,98 +109,99 @@ void AndroidAudio::startSoundPlayer()
|
||||
{
|
||||
// qDebug() << "Starting Sound Player";
|
||||
|
||||
SLresult lRes;
|
||||
SLresult lRes;
|
||||
|
||||
//Configure the sound player input/output
|
||||
SLDataLocator_AndroidSimpleBufferQueue lDataLocatorIn;
|
||||
lDataLocatorIn.locatorType = SL_DATALOCATOR_BUFFERQUEUE;
|
||||
lDataLocatorIn.numBuffers = 1;
|
||||
//Configure the sound player input/output
|
||||
SLDataLocator_AndroidSimpleBufferQueue lDataLocatorIn;
|
||||
lDataLocatorIn.locatorType = SL_DATALOCATOR_BUFFERQUEUE;
|
||||
lDataLocatorIn.numBuffers = 1;
|
||||
|
||||
//Set the data format as mono-pcm-16bit-44100
|
||||
SLDataFormat_PCM lDataFormat;
|
||||
lDataFormat.formatType = SL_DATAFORMAT_PCM;
|
||||
lDataFormat.numChannels = 2;
|
||||
lDataFormat.samplesPerSec = SL_SAMPLINGRATE_44_1;
|
||||
lDataFormat.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16;
|
||||
lDataFormat.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16;
|
||||
lDataFormat.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;
|
||||
lDataFormat.endianness = SL_BYTEORDER_LITTLEENDIAN;
|
||||
//Set the data format as mono-pcm-16bit-44100
|
||||
SLDataFormat_PCM lDataFormat;
|
||||
lDataFormat.formatType = SL_DATAFORMAT_PCM;
|
||||
lDataFormat.numChannels = 2;
|
||||
lDataFormat.samplesPerSec = SL_SAMPLINGRATE_44_1;
|
||||
lDataFormat.bitsPerSample = SL_PCMSAMPLEFORMAT_FIXED_16;
|
||||
lDataFormat.containerSize = SL_PCMSAMPLEFORMAT_FIXED_16;
|
||||
lDataFormat.channelMask = SL_SPEAKER_FRONT_LEFT | SL_SPEAKER_FRONT_RIGHT;
|
||||
lDataFormat.endianness = SL_BYTEORDER_LITTLEENDIAN;
|
||||
|
||||
SLDataSource lDataSource;
|
||||
lDataSource.pLocator = &lDataLocatorIn;
|
||||
lDataSource.pFormat = &lDataFormat;
|
||||
SLDataSource lDataSource;
|
||||
lDataSource.pLocator = &lDataLocatorIn;
|
||||
lDataSource.pFormat = &lDataFormat;
|
||||
|
||||
SLDataLocator_OutputMix lDataLocatorOut;
|
||||
lDataLocatorOut.locatorType = SL_DATALOCATOR_OUTPUTMIX;
|
||||
lDataLocatorOut.outputMix = mOutputMixObject;
|
||||
SLDataLocator_OutputMix lDataLocatorOut;
|
||||
lDataLocatorOut.locatorType = SL_DATALOCATOR_OUTPUTMIX;
|
||||
lDataLocatorOut.outputMix = mOutputMixObject;
|
||||
|
||||
SLDataSink lDataSink;
|
||||
lDataSink.pLocator = &lDataLocatorOut;
|
||||
lDataSink.pFormat = NULL;
|
||||
SLDataSink lDataSink;
|
||||
lDataSink.pLocator = &lDataLocatorOut;
|
||||
lDataSink.pFormat = NULL;
|
||||
|
||||
//Create the sound player
|
||||
const SLuint32 lSoundPlayerIIDCount = 2;
|
||||
const SLInterfaceID lSoundPlayerIIDs[] = { SL_IID_PLAY, SL_IID_BUFFERQUEUE };
|
||||
const SLboolean lSoundPlayerReqs[] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE };
|
||||
//Create the sound player
|
||||
const SLuint32 lSoundPlayerIIDCount = 2;
|
||||
const SLInterfaceID lSoundPlayerIIDs[] = { SL_IID_PLAY, SL_IID_BUFFERQUEUE };
|
||||
const SLboolean lSoundPlayerReqs[] = { SL_BOOLEAN_TRUE, SL_BOOLEAN_TRUE };
|
||||
|
||||
// qDebug() << "Configured Sound Player";
|
||||
|
||||
lRes = (*mEngineEngine)->CreateAudioPlayer(mEngineEngine, &mPlayerObject, &lDataSource, &lDataSink, lSoundPlayerIIDCount, lSoundPlayerIIDs, lSoundPlayerReqs);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
lRes = (*mEngineEngine)->CreateAudioPlayer(mEngineEngine, &mPlayerObject, &lDataSource, &lDataSink, lSoundPlayerIIDCount, lSoundPlayerIIDs, lSoundPlayerReqs);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
|
||||
// qDebug() << "Created Sound Player";
|
||||
|
||||
lRes = (*mPlayerObject)->Realize(mPlayerObject, SL_BOOLEAN_FALSE);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
lRes = (*mPlayerObject)->Realize(mPlayerObject, SL_BOOLEAN_FALSE);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
|
||||
qDebug() << "Realised Sound Player";
|
||||
lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_PLAY, &mPlayerPlay);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
qDebug() << "Realised Sound Player";
|
||||
lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_PLAY, &mPlayerPlay);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
|
||||
lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_BUFFERQUEUE, &mPlayerQueue);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
lRes = (*mPlayerObject)->GetInterface(mPlayerObject, SL_IID_BUFFERQUEUE, &mPlayerQueue);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
|
||||
lRes = (*mPlayerPlay)->SetPlayState(mPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
lRes = (*mPlayerPlay)->SetPlayState(mPlayerPlay, SL_PLAYSTATE_PLAYING);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
|
||||
// qDebug() << "Created Buffer Player";
|
||||
}
|
||||
|
||||
void AndroidAudio::playSound(const std::string& name, int i) {
|
||||
void AndroidAudio::playSound(const std::string& name, int i)
|
||||
{
|
||||
|
||||
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
|
||||
this->registerSound(QString(":/android/android-data/sounds/default/"+QString::fromStdString(name)+".wav"), QString::fromStdString(name));
|
||||
this->reallyPlaySound(QString::fromStdString(name));
|
||||
}
|
||||
this->registerSound(QString(":/android/android-data/sounds/default/"+QString::fromStdString(name)+".wav"), QString::fromStdString(name));
|
||||
this->reallyPlaySound(QString::fromStdString(name));
|
||||
}
|
||||
}
|
||||
|
||||
void AndroidAudio::reallyPlaySound(const QString& name)
|
||||
{
|
||||
SLresult lRes;
|
||||
SLuint32 lPlayerState;
|
||||
SLresult lRes;
|
||||
SLuint32 lPlayerState;
|
||||
|
||||
AndroidSoundEffect* sound = mSounds[name];
|
||||
AndroidSoundEffect* sound = mSounds[name];
|
||||
|
||||
if (!sound) {
|
||||
qDebug() << "No such sound:" << name;
|
||||
return;
|
||||
}
|
||||
//Get the current state of the player
|
||||
(*mPlayerObject)->GetState(mPlayerObject, &lPlayerState);
|
||||
if (!sound) {
|
||||
qDebug() << "No such sound:" << name;
|
||||
return;
|
||||
}
|
||||
//Get the current state of the player
|
||||
(*mPlayerObject)->GetState(mPlayerObject, &lPlayerState);
|
||||
|
||||
//If the player is realised
|
||||
if (lPlayerState == SL_OBJECT_STATE_REALIZED) {
|
||||
//Get the buffer and length of the effect
|
||||
int16_t* lBuffer = (int16_t *)sound->mBuffer;
|
||||
off_t lLength = sound->mLength;
|
||||
//If the player is realised
|
||||
if (lPlayerState == SL_OBJECT_STATE_REALIZED) {
|
||||
//Get the buffer and length of the effect
|
||||
int16_t* lBuffer = (int16_t *)sound->mBuffer;
|
||||
off_t lLength = sound->mLength;
|
||||
|
||||
//Remove any sound from the queue
|
||||
lRes = (*mPlayerQueue)->Clear(mPlayerQueue);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
//Remove any sound from the queue
|
||||
lRes = (*mPlayerQueue)->Clear(mPlayerQueue);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
|
||||
//Play the new sound
|
||||
(*mPlayerQueue)->Enqueue(mPlayerQueue, lBuffer, lLength);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
}
|
||||
//Play the new sound
|
||||
(*mPlayerQueue)->Enqueue(mPlayerQueue, lBuffer, lLength);
|
||||
Q_ASSERT(SL_RESULT_SUCCESS == lRes);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,44 +17,44 @@ class ConfigFile;
|
||||
|
||||
class AndroidAudio : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AndroidAudio(ConfigFile *c, QObject *parent = 0);
|
||||
~AndroidAudio();
|
||||
explicit AndroidAudio(ConfigFile *c, QObject *parent = 0);
|
||||
~AndroidAudio();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
void registerSound(const QString& path, const QString &name);
|
||||
void reallyPlaySound(const QString& name);
|
||||
void playSound(const std::string& name, int i);
|
||||
void initAudio();
|
||||
void closeAudio();
|
||||
void reInit();
|
||||
void registerSound(const QString& path, const QString &name);
|
||||
void reallyPlaySound(const QString& name);
|
||||
void playSound(const std::string& name, int i);
|
||||
void initAudio();
|
||||
void closeAudio();
|
||||
void reInit();
|
||||
|
||||
private:
|
||||
void createEngine();
|
||||
void destroyEngine();
|
||||
void startSoundPlayer();
|
||||
void createEngine();
|
||||
void destroyEngine();
|
||||
void startSoundPlayer();
|
||||
|
||||
// engine interfaces
|
||||
SLObjectItf mEngineObject;
|
||||
SLEngineItf mEngineEngine;
|
||||
// engine interfaces
|
||||
SLObjectItf mEngineObject;
|
||||
SLEngineItf mEngineEngine;
|
||||
|
||||
// output mix interfaces
|
||||
SLObjectItf mOutputMixObject;
|
||||
// output mix interfaces
|
||||
SLObjectItf mOutputMixObject;
|
||||
|
||||
// buffer queue player interfaces - Effects
|
||||
SLObjectItf mPlayerObject;
|
||||
SLPlayItf mPlayerPlay;
|
||||
SLBufferQueueItf mPlayerQueue;
|
||||
// buffer queue player interfaces - Effects
|
||||
SLObjectItf mPlayerObject;
|
||||
SLPlayItf mPlayerPlay;
|
||||
SLBufferQueueItf mPlayerQueue;
|
||||
|
||||
QMap<QString, AndroidSoundEffect*> mSounds;
|
||||
int32_t mSoundCount;
|
||||
QMap<QString, AndroidSoundEffect*> mSounds;
|
||||
int32_t mSoundCount;
|
||||
|
||||
ConfigFile *myConfig;
|
||||
bool audioEnabled;
|
||||
ConfigFile *myConfig;
|
||||
bool audioEnabled;
|
||||
};
|
||||
|
||||
#endif // ANDROIDAUDIO_H
|
||||
|
||||
@@ -6,110 +6,110 @@
|
||||
#include <QFile>
|
||||
|
||||
AndroidSoundEffect::AndroidSoundEffect(const QString& path, QObject *parent) :
|
||||
QObject(parent), mBuffer(NULL), mLength(0), mPath(path)
|
||||
QObject(parent), mBuffer(NULL), mLength(0), mPath(path)
|
||||
{
|
||||
}
|
||||
|
||||
AndroidSoundEffect::~AndroidSoundEffect()
|
||||
{
|
||||
this->unload();
|
||||
this->unload();
|
||||
}
|
||||
|
||||
bool AndroidSoundEffect::load()
|
||||
{
|
||||
QFile lSoundFile(mPath);
|
||||
QFile lSoundFile(mPath);
|
||||
|
||||
// qDebug() << "opening:" << mPath;
|
||||
|
||||
if (!lSoundFile.open(QIODevice::ReadOnly)) {
|
||||
qDebug() << "Could not open: " << mPath;
|
||||
return false;
|
||||
}
|
||||
if (!lSoundFile.open(QIODevice::ReadOnly)) {
|
||||
qDebug() << "Could not open: " << mPath;
|
||||
return false;
|
||||
}
|
||||
|
||||
// parse WAV file
|
||||
// parse WAV file
|
||||
// qDebug() << " reading header:";
|
||||
|
||||
char id[4];
|
||||
lSoundFile.read(id, 4);
|
||||
if( strncmp(id, "RIFF", 4) != 0 ) {
|
||||
qDebug() << "not a WAV file - header not RIFF";
|
||||
lSoundFile.close();
|
||||
return false;
|
||||
}
|
||||
char id[4];
|
||||
lSoundFile.read(id, 4);
|
||||
if( strncmp(id, "RIFF", 4) != 0 ) {
|
||||
qDebug() << "not a WAV file - header not RIFF";
|
||||
lSoundFile.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
int size = 0;
|
||||
lSoundFile.read((char *)&size, 4);
|
||||
int size = 0;
|
||||
lSoundFile.read((char *)&size, 4);
|
||||
// qDebug() << " size:" << size;
|
||||
|
||||
lSoundFile.read(id, 4);
|
||||
if( strncmp(id, "WAVE", 4) != 0 ) {
|
||||
qDebug() << "not a WAV file - header not WAVE";
|
||||
lSoundFile.close();
|
||||
return false;
|
||||
}
|
||||
lSoundFile.read(id, 4);
|
||||
if( strncmp(id, "WAVE", 4) != 0 ) {
|
||||
qDebug() << "not a WAV file - header not WAVE";
|
||||
lSoundFile.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
lSoundFile.read(id, 4); // "fmt "
|
||||
lSoundFile.read(id, 4); // "fmt "
|
||||
|
||||
int format_length = 0;
|
||||
lSoundFile.read((char *)&format_length, 4);
|
||||
int format_length = 0;
|
||||
lSoundFile.read((char *)&format_length, 4);
|
||||
// qDebug() << " format_length:" << format_length;
|
||||
|
||||
short format_tag = 0;
|
||||
lSoundFile.read((char *)&format_tag, 2);
|
||||
short format_tag = 0;
|
||||
lSoundFile.read((char *)&format_tag, 2);
|
||||
|
||||
short n_channels = 0;
|
||||
lSoundFile.read((char *)&n_channels, 2);
|
||||
short n_channels = 0;
|
||||
lSoundFile.read((char *)&n_channels, 2);
|
||||
// qDebug() << " n_channels:" << n_channels;
|
||||
|
||||
int sample_rate = 0;
|
||||
lSoundFile.read((char *)&sample_rate, 4);
|
||||
int sample_rate = 0;
|
||||
lSoundFile.read((char *)&sample_rate, 4);
|
||||
// qDebug() << " sample_rate:" << sample_rate;
|
||||
|
||||
int avg_bytes_sec = 0;
|
||||
lSoundFile.read((char *)&avg_bytes_sec, 4);
|
||||
int avg_bytes_sec = 0;
|
||||
lSoundFile.read((char *)&avg_bytes_sec, 4);
|
||||
// qDebug() << " avg_bytes_sec:" << avg_bytes_sec;
|
||||
|
||||
short block_align = 0;
|
||||
lSoundFile.read((char *)&block_align, 2);
|
||||
short block_align = 0;
|
||||
lSoundFile.read((char *)&block_align, 2);
|
||||
|
||||
short bits_per_sample = 0;
|
||||
lSoundFile.read((char *)&bits_per_sample, 2);
|
||||
short bits_per_sample = 0;
|
||||
lSoundFile.read((char *)&bits_per_sample, 2);
|
||||
// qDebug() << " bits_per_sample:" << bits_per_sample;
|
||||
|
||||
lSoundFile.read(id, 4);
|
||||
if( strncmp(id, "data", 4) != 0 ) {
|
||||
qDebug() << "not a WAV file - didn't find data";
|
||||
lSoundFile.close();
|
||||
return false;
|
||||
}
|
||||
lSoundFile.read(id, 4);
|
||||
if( strncmp(id, "data", 4) != 0 ) {
|
||||
qDebug() << "not a WAV file - didn't find data";
|
||||
lSoundFile.close();
|
||||
return false;
|
||||
}
|
||||
|
||||
lSoundFile.read((char *)&mLength, 4);
|
||||
lSoundFile.read((char *)&mLength, 4);
|
||||
|
||||
// qDebug() << " reading data:" << mLength;
|
||||
|
||||
mBuffer = (char*)malloc((mLength));
|
||||
mBuffer = (char*)malloc((mLength));
|
||||
|
||||
int dataRead = lSoundFile.read(mBuffer, mLength);
|
||||
if (dataRead != mLength) {
|
||||
qDebug() << "didn't read correct amount of data' :" << mPath;
|
||||
lSoundFile.close();
|
||||
delete [] mBuffer;
|
||||
mBuffer = NULL;
|
||||
return false;
|
||||
}
|
||||
int dataRead = lSoundFile.read(mBuffer, mLength);
|
||||
if (dataRead != mLength) {
|
||||
qDebug() << "didn't read correct amount of data' :" << mPath;
|
||||
lSoundFile.close();
|
||||
delete [] mBuffer;
|
||||
mBuffer = NULL;
|
||||
return false;
|
||||
}
|
||||
|
||||
// qDebug() << " closing:";
|
||||
lSoundFile.close();
|
||||
return true;
|
||||
lSoundFile.close();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool AndroidSoundEffect::unload()
|
||||
{
|
||||
delete[] mBuffer;
|
||||
mBuffer = NULL;
|
||||
mLength = 0;
|
||||
return true;
|
||||
delete[] mBuffer;
|
||||
mBuffer = NULL;
|
||||
mLength = 0;
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,26 +12,26 @@
|
||||
|
||||
class AndroidSoundEffect : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit AndroidSoundEffect(const QString& pPath, QObject *parent = 0);
|
||||
~AndroidSoundEffect();
|
||||
explicit AndroidSoundEffect(const QString& pPath, QObject *parent = 0);
|
||||
~AndroidSoundEffect();
|
||||
|
||||
const char* getPath();
|
||||
bool load();
|
||||
bool unload();
|
||||
const char* getPath();
|
||||
bool load();
|
||||
bool unload();
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
private:
|
||||
char* mBuffer;
|
||||
off_t mLength;
|
||||
char* mBuffer;
|
||||
off_t mLength;
|
||||
|
||||
QString mPath;
|
||||
QString mPath;
|
||||
|
||||
friend class AndroidAudio;
|
||||
friend class AndroidAudio;
|
||||
};
|
||||
|
||||
#endif // ANDROIDSOUNDEFFECT_H
|
||||
|
||||
@@ -26,128 +26,128 @@
|
||||
using namespace std;
|
||||
|
||||
SDLPlayer::SDLPlayer(ConfigFile *c)
|
||||
: sound(NULL), soundData(NULL), currentChannel(0), audioEnabled(FALSE), myConfig(c)
|
||||
: sound(NULL), soundData(NULL), currentChannel(0), audioEnabled(FALSE), myConfig(c)
|
||||
{
|
||||
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
|
||||
SDL_Init(SDL_INIT_AUDIO);
|
||||
initAudio();
|
||||
myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
|
||||
SDL_Init(SDL_INIT_AUDIO);
|
||||
initAudio();
|
||||
}
|
||||
|
||||
|
||||
SDLPlayer::~SDLPlayer()
|
||||
{
|
||||
closeAudio();
|
||||
SDL_Quit();
|
||||
closeAudio();
|
||||
SDL_Quit();
|
||||
}
|
||||
|
||||
void SDLPlayer::initAudio()
|
||||
{
|
||||
if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
int audio_rate = 44100;
|
||||
Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */
|
||||
int audio_channels = 2;
|
||||
int audio_buffers = 4096;
|
||||
sound = NULL;
|
||||
if (!audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
int audio_rate = 44100;
|
||||
Uint16 audio_format = AUDIO_S16; /* 16-bit stereo */
|
||||
int audio_channels = 2;
|
||||
int audio_buffers = 4096;
|
||||
sound = NULL;
|
||||
|
||||
if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) {
|
||||
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
||||
audioEnabled = 1;
|
||||
}
|
||||
else {
|
||||
qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :(";
|
||||
}
|
||||
}
|
||||
if( Mix_OpenAudio(audio_rate, audio_format, audio_channels, audio_buffers) == 0) {
|
||||
Mix_QuerySpec(&audio_rate, &audio_format, &audio_channels);
|
||||
audioEnabled = 1;
|
||||
} else {
|
||||
qDebug() << "Mix_OpenAudio() was not successfull, no sound possible :(";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SDLPlayer::playSound(string audioString, int playerID)
|
||||
{
|
||||
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
if(audioEnabled && myConfig->readConfigInt("PlaySoundEffects")) {
|
||||
|
||||
QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav");
|
||||
QFile myFile(myAppDataPath + "sounds/default/" + QString::fromStdString(audioString)+".wav");
|
||||
|
||||
if(myFile.open(QIODevice::ReadOnly)) {
|
||||
if(myFile.open(QIODevice::ReadOnly)) {
|
||||
|
||||
//set 3d position for player
|
||||
int position = 0;
|
||||
int distance = 0;
|
||||
//set 3d position for player
|
||||
int position = 0;
|
||||
int distance = 0;
|
||||
|
||||
switch (playerID) {
|
||||
switch (playerID) {
|
||||
|
||||
case 0: {
|
||||
position = 180;
|
||||
distance = 10;
|
||||
}
|
||||
break;
|
||||
case 1: {
|
||||
position = 281;
|
||||
distance = 50;
|
||||
}
|
||||
break;
|
||||
case 2: {
|
||||
position = 315;
|
||||
distance = 120;
|
||||
}
|
||||
break;
|
||||
case 3: {
|
||||
position = 338;
|
||||
distance = 160;
|
||||
}
|
||||
break;
|
||||
case 4: {
|
||||
position = 23;
|
||||
distance = 160;
|
||||
}
|
||||
break;
|
||||
case 5: {
|
||||
position = 45;
|
||||
distance = 120;
|
||||
}
|
||||
break;
|
||||
case 6: {
|
||||
position = 79;
|
||||
distance = 50;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
position = 0;
|
||||
distance = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case 0: {
|
||||
position = 180;
|
||||
distance = 10;
|
||||
}
|
||||
break;
|
||||
case 1: {
|
||||
position = 281;
|
||||
distance = 50;
|
||||
}
|
||||
break;
|
||||
case 2: {
|
||||
position = 315;
|
||||
distance = 120;
|
||||
}
|
||||
break;
|
||||
case 3: {
|
||||
position = 338;
|
||||
distance = 160;
|
||||
}
|
||||
break;
|
||||
case 4: {
|
||||
position = 23;
|
||||
distance = 160;
|
||||
}
|
||||
break;
|
||||
case 5: {
|
||||
position = 45;
|
||||
distance = 120;
|
||||
}
|
||||
break;
|
||||
case 6: {
|
||||
position = 79;
|
||||
distance = 50;
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
position = 0;
|
||||
distance = 0;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
QDataStream in(&myFile);
|
||||
soundData = new Uint8[(int)myFile.size()];
|
||||
in.readRawData( (char*)soundData, (int)myFile.size() );
|
||||
sound = Mix_QuickLoad_WAV(soundData);
|
||||
QDataStream in(&myFile);
|
||||
soundData = new Uint8[(int)myFile.size()];
|
||||
in.readRawData( (char*)soundData, (int)myFile.size() );
|
||||
sound = Mix_QuickLoad_WAV(soundData);
|
||||
|
||||
// set channel 0 to settings volume
|
||||
Mix_Volume(-1,myConfig->readConfigInt("SoundVolume")*10);
|
||||
// set channel 0 to settings volume
|
||||
Mix_Volume(-1,myConfig->readConfigInt("SoundVolume")*10);
|
||||
|
||||
// set 3d effect
|
||||
if(!Mix_SetPosition(0, position, distance)) {
|
||||
printf("Mix_SetPosition: %s\n", Mix_GetError());
|
||||
// no position effect, is it ok?
|
||||
}
|
||||
currentChannel = Mix_PlayChannel(-1, sound,0);
|
||||
}
|
||||
}
|
||||
// set 3d effect
|
||||
if(!Mix_SetPosition(0, position, distance)) {
|
||||
printf("Mix_SetPosition: %s\n", Mix_GetError());
|
||||
// no position effect, is it ok?
|
||||
}
|
||||
currentChannel = Mix_PlayChannel(-1, sound,0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SDLPlayer::closeAudio()
|
||||
{ if(audioEnabled) {
|
||||
Mix_HaltChannel(currentChannel);
|
||||
Mix_FreeChunk(sound);
|
||||
sound = NULL;
|
||||
delete[] soundData;
|
||||
soundData = NULL;
|
||||
Mix_CloseAudio();
|
||||
qDebug() << "Mix_CloseAudio()";
|
||||
audioEnabled = false;
|
||||
}
|
||||
{
|
||||
if(audioEnabled) {
|
||||
Mix_HaltChannel(currentChannel);
|
||||
Mix_FreeChunk(sound);
|
||||
sound = NULL;
|
||||
delete[] soundData;
|
||||
soundData = NULL;
|
||||
Mix_CloseAudio();
|
||||
qDebug() << "Mix_CloseAudio()";
|
||||
audioEnabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
void SDLPlayer::reInit()
|
||||
{
|
||||
closeAudio();
|
||||
initAudio();
|
||||
closeAudio();
|
||||
initAudio();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
#include <SDL/SDL_mixer.h>
|
||||
#endif
|
||||
|
||||
struct Mix_Chunk;
|
||||
struct Mix_Chunk;
|
||||
|
||||
/**
|
||||
@author FThauer FHammer <webmaster@pokerth.net>
|
||||
@@ -46,13 +46,13 @@ public:
|
||||
void initAudio();
|
||||
void playSound(std::string, int playerID);
|
||||
void closeAudio();
|
||||
void reInit();
|
||||
void reInit();
|
||||
|
||||
private:
|
||||
Mix_Chunk *sound;
|
||||
Mix_Chunk *sound;
|
||||
unsigned char *soundData;
|
||||
int currentChannel;
|
||||
bool audioEnabled;
|
||||
bool audioEnabled;
|
||||
ConfigFile *myConfig;
|
||||
QString myAppDataPath;
|
||||
};
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
#include "soundevents.h"
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
#include "androidapi8dummy.h"
|
||||
#else
|
||||
#include "androidaudio.h"
|
||||
#endif
|
||||
#ifdef ANDROID_API8
|
||||
#include "androidapi8dummy.h"
|
||||
#else
|
||||
#include "sdlplayer.h"
|
||||
#include "androidaudio.h"
|
||||
#endif
|
||||
#else
|
||||
#include "sdlplayer.h"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -22,25 +22,25 @@ SoundEvents::SoundEvents(ConfigFile *c): myConfig(c), lastSBValue(0), lastSBLeve
|
||||
{
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
myPlayer = new AndroidApi8Dummy(myConfig);
|
||||
#else
|
||||
myPlayer = new AndroidAudio(myConfig);
|
||||
#endif
|
||||
#ifdef ANDROID_API8
|
||||
myPlayer = new AndroidApi8Dummy(myConfig);
|
||||
#else
|
||||
myPlayer = new SDLPlayer(myConfig);
|
||||
myPlayer = new AndroidAudio(myConfig);
|
||||
#endif
|
||||
#else
|
||||
myPlayer = new SDLPlayer(myConfig);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
SoundEvents::~SoundEvents()
|
||||
{
|
||||
myPlayer->deleteLater();
|
||||
myPlayer->deleteLater();
|
||||
}
|
||||
|
||||
void SoundEvents::reInitSoundEngine()
|
||||
{
|
||||
myPlayer->reInit();
|
||||
myPlayer->reInit();
|
||||
}
|
||||
|
||||
void SoundEvents::blindsWereSet(int sB)
|
||||
@@ -58,13 +58,13 @@ void SoundEvents::blindsWereSet(int sB)
|
||||
|
||||
if(myConfig->readConfigInt("PlayBlindRaiseNotification")) {
|
||||
if(lastSBLevel == 1 || lastSBLevel == 2) {
|
||||
myPlayer->playSound("blinds_raises_level1", 0);
|
||||
myPlayer->playSound("blinds_raises_level1", 0);
|
||||
}
|
||||
if(lastSBLevel == 3 || lastSBLevel == 4) {
|
||||
myPlayer->playSound("blinds_raises_level2", 0);
|
||||
myPlayer->playSound("blinds_raises_level2", 0);
|
||||
}
|
||||
if(lastSBLevel >= 5) {
|
||||
myPlayer->playSound("blinds_raises_level3", 0);
|
||||
myPlayer->playSound("blinds_raises_level3", 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -78,5 +78,5 @@ void SoundEvents::newGameStarts()
|
||||
//HACK until playSound is done by events
|
||||
void SoundEvents::playSound(std::string audioString, int playerID)
|
||||
{
|
||||
myPlayer->playSound(audioString, playerID);
|
||||
myPlayer->playSound(audioString, playerID);
|
||||
}
|
||||
|
||||
@@ -4,13 +4,13 @@
|
||||
#include <string>
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
class AndroidApi8Dummy;
|
||||
#else
|
||||
class AndroidAudio;
|
||||
#endif
|
||||
#ifdef ANDROID_API8
|
||||
class AndroidApi8Dummy;
|
||||
#else
|
||||
class SDLPlayer;
|
||||
class AndroidAudio;
|
||||
#endif
|
||||
#else
|
||||
class SDLPlayer;
|
||||
#endif
|
||||
|
||||
|
||||
@@ -23,8 +23,8 @@ public:
|
||||
|
||||
void blindsWereSet(int sB);
|
||||
void newGameStarts();
|
||||
void playSound(std::string audioString, int playerID);
|
||||
void reInitSoundEngine();
|
||||
void playSound(std::string audioString, int playerID);
|
||||
void reInitSoundEngine();
|
||||
|
||||
protected:
|
||||
// Prevent copy construction.
|
||||
@@ -34,13 +34,13 @@ protected:
|
||||
private:
|
||||
|
||||
#ifdef ANDROID
|
||||
#ifdef ANDROID_API8
|
||||
AndroidApi8Dummy *myPlayer;
|
||||
#else
|
||||
AndroidAudio *myPlayer;
|
||||
#endif
|
||||
#ifdef ANDROID_API8
|
||||
AndroidApi8Dummy *myPlayer;
|
||||
#else
|
||||
SDLPlayer *myPlayer;
|
||||
AndroidAudio *myPlayer;
|
||||
#endif
|
||||
#else
|
||||
SDLPlayer *myPlayer;
|
||||
#endif
|
||||
ConfigFile *myConfig;
|
||||
int lastSBValue;
|
||||
|
||||
@@ -94,9 +94,9 @@ void startNetworkGameDialogImpl::addConnectedPlayer(unsigned playerId, QString p
|
||||
|
||||
if(this->isVisible() && myConfig->readConfigInt("PlayNetworkGameNotification")) {
|
||||
if(treeWidget->topLevelItemCount() < info.data.maxNumberOfPlayers) {
|
||||
myW->getMySoundEventHandler()->playSound("playerconnected", 0);
|
||||
myW->getMySoundEventHandler()->playSound("playerconnected", 0);
|
||||
} else {
|
||||
myW->getMySoundEventHandler()->playSound("onlinegameready", 0);
|
||||
myW->getMySoundEventHandler()->playSound("onlinegameready", 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -161,8 +161,8 @@ void startNetworkGameDialogImpl::kickPlayer()
|
||||
if(playerName == QString::fromUtf8(myConfig->readConfigString("MyName").c_str())) {
|
||||
{
|
||||
MyMessageBox::warning(this, tr("Server Error"),
|
||||
tr("You should not kick yourself from this game!"),
|
||||
QMessageBox::Close);
|
||||
tr("You should not kick yourself from this game!"),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
} else {
|
||||
assert(mySession);
|
||||
|
||||
@@ -70,53 +70,51 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||
this->installEventFilter(this);
|
||||
|
||||
//Widgets Grafiken per Stylesheets setzen
|
||||
QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
|
||||
QString myAppDataPath = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str());
|
||||
this->setWindowIcon(QIcon(myAppDataPath+"gfx/gui/misc/windowicon.png"));
|
||||
|
||||
this->setStatusBar(0);
|
||||
|
||||
#ifdef GUI_800x480
|
||||
#ifdef ANDROID
|
||||
this->menubar->hide();
|
||||
#ifdef ANDROID
|
||||
this->menubar->hide();
|
||||
|
||||
//check if custom background picture for the resolution is there. Otherwise create it!
|
||||
QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str());
|
||||
QDesktopWidget dw;
|
||||
int screenWidth = dw.screenGeometry().width();
|
||||
int screenHeight = dw.screenGeometry().height();
|
||||
QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png");
|
||||
QFile customStartWindowBgFile(customStartWindowBgFileString);
|
||||
if(customStartWindowBgFile.exists()) {
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
}
|
||||
else {
|
||||
QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png");
|
||||
pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
if(pix.save(customStartWindowBgFileString)) {
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
}
|
||||
else {
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
}
|
||||
//check if custom background picture for the resolution is there. Otherwise create it!
|
||||
QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str());
|
||||
QDesktopWidget dw;
|
||||
int screenWidth = dw.screenGeometry().width();
|
||||
int screenHeight = dw.screenGeometry().height();
|
||||
QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png");
|
||||
QFile customStartWindowBgFile(customStartWindowBgFileString);
|
||||
if(customStartWindowBgFile.exists()) {
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
} else {
|
||||
QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_800x480.png");
|
||||
pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
||||
if(pix.save(customStartWindowBgFileString)) {
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
} else {
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_800x480.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
}
|
||||
|
||||
}
|
||||
this->showFullScreen();
|
||||
#else
|
||||
}
|
||||
this->showFullScreen();
|
||||
#else
|
||||
// this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:20px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }");
|
||||
this->menubar->hide();
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
#endif
|
||||
pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_about->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_configure->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
this->menubar->hide();
|
||||
centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_800x480.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}");
|
||||
#endif
|
||||
pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_about->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_configure->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:22px; border-width: 0px;}");
|
||||
|
||||
connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||
connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||
connect( pushButton_Logs, SIGNAL( clicked() ), this, SLOT( callLogFileDialog() ) );
|
||||
connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||
connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||
connect( pushButton_Logs, SIGNAL( clicked() ), this, SLOT( callLogFileDialog() ) );
|
||||
#else
|
||||
this->menubar->setStyleSheet("QMenuBar { background-color: #4B4B4B; font-size:12px; border-width: 0px;} QMenuBar::item { color: #F0F0F0; }");
|
||||
|
||||
@@ -127,8 +125,8 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
||||
pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}");
|
||||
pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #4B4B4B; color: #F0F0F0; font-size:12px; border-width: 0px;}");
|
||||
|
||||
connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||
connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||
|
||||
#endif
|
||||
|
||||
@@ -243,7 +241,7 @@ void startWindowImpl::callNewGameDialog()
|
||||
if(myConfig->readConfigInt("ShowGameSettingsDialogOnNewGame")) {
|
||||
|
||||
#ifdef ANDROID
|
||||
myGuiInterface->getMyW()->hide();
|
||||
myGuiInterface->getMyW()->hide();
|
||||
#endif
|
||||
myNewGameDialog->exec();
|
||||
if (myNewGameDialog->result() == QDialog::Accepted ) {
|
||||
@@ -440,7 +438,7 @@ void startWindowImpl::callRejoinPossibleDialog(unsigned gameId)
|
||||
assert(mySession);
|
||||
GameInfo info(mySession->getClientGameInfo(gameId));*/
|
||||
|
||||
MyMessageBox msgBox;
|
||||
MyMessageBox msgBox;
|
||||
msgBox.setIcon(QMessageBox::Question);
|
||||
msgBox.setWindowTitle("Rejoin possible!");
|
||||
// msgBox.setText(QString("There is an existing session with the game: %1").arg(QString::fromUtf8(info.name.c_str())));
|
||||
@@ -684,165 +682,165 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/)
|
||||
hideTimeoutDialog();
|
||||
switch (errorID) {
|
||||
case ERR_SOCK_SERVERADDR_NOT_SET: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Server address was not set."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Server address was not set."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_INVALID_PORT: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An invalid port was set (ports 0-1023 are not allowed)."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An invalid port was set (ports 0-1023 are not allowed)."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_CREATION_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not create a socket for TCP communication."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not create a socket for TCP communication."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_SET_ADDR_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not set the IP address."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not set the IP address."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_SET_PORT_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not set the port for this type of address."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not set the port for this type of address."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_RESOLVE_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The server name could not be resolved."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The server name could not be resolved."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_BIND_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Bind failed - please choose a different port."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Bind failed - please choose a different port."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_LISTEN_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: \"listen\" failed."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: \"listen\" failed."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_ACCEPT_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Server execution was terminated."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Server execution was terminated."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_CONNECT_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not connect to the server."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not connect to the server."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_CONNECT_TIMEOUT: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Connection timed out.\nPlease check the server address.\n\nIf the server is behind a NAT-Router, make sure port forwarding has been set up on server side."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Connection timed out.\nPlease check the server address.\n\nIf the server is behind a NAT-Router, make sure port forwarding has been set up on server side."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_SELECT_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: \"select\" failed."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: \"select\" failed."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_SEND_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: \"send\" failed."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: \"send\" failed."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_RECV_FAILED: // Sometimes windows reports recv failed on close.
|
||||
case ERR_SOCK_CONN_RESET: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The connection to the server was lost."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The connection to the server was lost."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_CONN_EXISTS: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: Duplicate TCP connection."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal network error: Duplicate TCP connection."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_INVALID_PACKET: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An invalid network packet was received.\nPlease make sure that all players use the same version of PokerTH."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An invalid network packet was received.\nPlease make sure that all players use the same version of PokerTH."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_INVALID_STATE: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal state error.\nPlease make sure that all players use the same version of PokerTH."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal state error.\nPlease make sure that all players use the same version of PokerTH."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_INVALID_SERVERLIST_URL:
|
||||
case ERR_SOCK_TRANSFER_INVALID_URL: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Invalid server list URL.\nPlease correct the address in the settings."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Invalid server list URL.\nPlease correct the address in the settings."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_INVALID_SERVERLIST_XML: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The PokerTH internet server list contains invalid data.\nIf you use a custom server list, please make sure its format is correct."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The PokerTH internet server list contains invalid data.\nIf you use a custom server list, please make sure its format is correct."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_UNZIP_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not unzip the PokerTH internet server list."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not unzip the PokerTH internet server list."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_TRANSFER_INIT_FAILED:
|
||||
case ERR_SOCK_TRANSFER_SELECT_FAILED:
|
||||
case ERR_SOCK_TRANSFER_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not download the PokerTH internet server list.\nPlease make sure you are directly connected to the internet."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not download the PokerTH internet server list.\nPlease make sure you are directly connected to the internet."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_SOCK_TRANSFER_OPEN_FAILED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not open the target file when downloading the server list."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not open the target file when downloading the server list."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_VERSION_NOT_SUPPORTED: {
|
||||
MyMessageBox msgBox(QMessageBox::Warning, tr("Network Error"),
|
||||
tr("The PokerTH server does not support this version of the game.<br>Please go to <a href=\"http://www.pokerth.net/\" target=\"_blank\">http://www.pokerth.net</a> and download the latest version."),
|
||||
QMessageBox::Close, this);
|
||||
MyMessageBox msgBox(QMessageBox::Warning, tr("Network Error"),
|
||||
tr("The PokerTH server does not support this version of the game.<br>Please go to <a href=\"http://www.pokerth.net/\" target=\"_blank\">http://www.pokerth.net</a> and download the latest version."),
|
||||
QMessageBox::Close, this);
|
||||
msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.exec();
|
||||
}
|
||||
break;
|
||||
case ERR_NET_SERVER_FULL: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Sorry, this server is already full."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Sorry, this server is already full."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_PASSWORD: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Invalid login.\nPlease check your username and password."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Invalid login.\nPlease check your username and password."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_PASSWORD_STR: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The password is too long. Please choose another one."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The password is too long. Please choose another one."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_PLAYER_NAME_IN_USE: {
|
||||
@@ -856,122 +854,122 @@ void startWindowImpl::networkError(int errorID, int /*osErrorID*/)
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_GAME_NAME: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The game name is either too short or too long. Please choose another one."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The game name is either too short or too long. Please choose another one."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_UNKNOWN_GAME: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The game could not be found."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The game could not be found."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_CHAT_TEXT: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The chat text is invalid."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The chat text is invalid."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_UNKNOWN_PLAYER_ID: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The server referred to an unknown player. Aborting."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The server referred to an unknown player. Aborting."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_NO_CURRENT_PLAYER: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal error: The current player could not be found."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal error: The current player could not be found."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_PLAYER_NOT_ACTIVE: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal error: The current player is not active."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Internal error: The current player is not active."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_PLAYER_KICKED: {
|
||||
mySession->terminateNetworkClient();
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("You were kicked from the server."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("You were kicked from the server."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_PLAYER_BANNED: {
|
||||
mySession->terminateNetworkClient();
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("You were temporarily banned from the server."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("You were temporarily banned from the server."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_PLAYER_BLOCKED: {
|
||||
mySession->terminateNetworkClient();
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Your account is blocked indefinitely."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Your account is blocked indefinitely."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_SESSION_TIMED_OUT: {
|
||||
mySession->terminateNetworkClient();
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Your server connection timed out due to inactivity. You are very welcome to reconnect!"),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Your server connection timed out due to inactivity. You are very welcome to reconnect!"),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_PLAYER_COUNT: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The client player count is invalid."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The client player count is invalid."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_TOO_MANY_MANUAL_BLINDS: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Too many manual blinds were set. Please reconfigure the manual blinds."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Too many manual blinds were set. Please reconfigure the manual blinds."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_AVATAR_FILE:
|
||||
case ERR_NET_WRONG_AVATAR_SIZE: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An invalid avatar file was configured. Please choose a different avatar."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An invalid avatar file was configured. Please choose a different avatar."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_AVATAR_TOO_LARGE: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The selected avatar file is too large. Please choose a different avatar."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The selected avatar file is too large. Please choose a different avatar."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INIT_BLOCKED: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("You cannot login at this time. Please try again in a few seconds."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("You cannot login at this time. Please try again in a few seconds."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_INVALID_REQUEST_ID: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An internal avatar error occured. Please report this to an admin in the lobby chat."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An internal avatar error occured. Please report this to an admin in the lobby chat."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_START_TIMEOUT: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not start game: Synchronization failed."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("Could not start game: Synchronization failed."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case ERR_NET_SERVER_MAINTENANCE: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The server is down for maintenance. Please try again later."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("The server is down for maintenance. Please try again later."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
default: {
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An internal error occured."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Error"),
|
||||
tr("An internal error occured."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
}
|
||||
// close dialogs
|
||||
@@ -988,44 +986,44 @@ void startWindowImpl::networkNotification(int notificationId)
|
||||
hideTimeoutDialog();
|
||||
switch (notificationId) {
|
||||
case NTF_NET_JOIN_IP_BLOCKED: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("You cannot join this game, because another player in that game has your network address."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("You cannot join this game, because another player in that game has your network address."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_REMOVED_START_FAILED: {
|
||||
myGameLobbyDialog->stopWaitStartGameMsgBoxTimer();
|
||||
if(MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Your connection to the server is very slow, the game had to start without you."),
|
||||
QMessageBox::Close) == QMessageBox::Close) {
|
||||
if(MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Your connection to the server is very slow, the game had to start without you."),
|
||||
QMessageBox::Close) == QMessageBox::Close) {
|
||||
myGameLobbyDialog->hideWaitStartGameMsgBox();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case NTF_NET_REMOVED_KICKED: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("You were kicked from the game."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("You were kicked from the game."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_REMOVED_GAME_FULL:
|
||||
case NTF_NET_JOIN_GAME_FULL: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Sorry, this game is already full."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Sorry, this game is already full."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_REMOVED_ALREADY_RUNNING:
|
||||
case NTF_NET_JOIN_ALREADY_RUNNING: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Unable to join - the server has already started the game."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Unable to join - the server has already started the game."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_JOIN_NOT_INVITED: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("This game is of type invite-only. You cannot join this game without being invited."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("This game is of type invite-only. You cannot join this game without being invited."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_JOIN_GAME_NAME_IN_USE: {
|
||||
@@ -1045,27 +1043,27 @@ void startWindowImpl::networkNotification(int notificationId)
|
||||
}
|
||||
break;
|
||||
case NTF_NET_REMOVED_TIMEOUT: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Your admin state timed out due to inactivity. Feel free to create a new game!"),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Your admin state timed out due to inactivity. Feel free to create a new game!"),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_JOIN_INVALID_PASSWORD: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Invalid password when joining the game.\nPlease reenter the password and try again."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("Invalid password when joining the game.\nPlease reenter the password and try again."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_JOIN_GUEST_FORBIDDEN: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("You cannot join this type of game as guest."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("You cannot join this type of game as guest."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_JOIN_INVALID_SETTINGS: {
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("The settings are invalid for this type of game."),
|
||||
QMessageBox::Close);
|
||||
MyMessageBox::warning(this, tr("Network Notification"),
|
||||
tr("The settings are invalid for this type of game."),
|
||||
QMessageBox::Close);
|
||||
}
|
||||
break;
|
||||
case NTF_NET_NEW_RELEASE_AVAILABLE: {
|
||||
@@ -1095,8 +1093,8 @@ void startWindowImpl::networkNotification(int notificationId)
|
||||
|
||||
void startWindowImpl::networkMessage(QString msg)
|
||||
{
|
||||
MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msg, QMessageBox::Close, this);
|
||||
MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msg, QMessageBox::Close, this);
|
||||
msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.exec();
|
||||
}
|
||||
@@ -1136,8 +1134,8 @@ void startWindowImpl::networkMessage(unsigned msgId)
|
||||
break;
|
||||
}
|
||||
|
||||
MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msgText, QMessageBox::Close, this);
|
||||
MyMessageBox msgBox(QMessageBox::Information, tr("Server Message"),
|
||||
msgText, QMessageBox::Close, this);
|
||||
// msgBox.setTextFormat(Qt::RichText);
|
||||
msgBox.exec();
|
||||
}
|
||||
|
||||
@@ -38,204 +38,202 @@ CardDeckStyleReader::~CardDeckStyleReader()
|
||||
|
||||
void CardDeckStyleReader::readStyleFile(QString file)
|
||||
{
|
||||
BigIndexesActionBottom = "";
|
||||
BigIndexesActionBottom = "";
|
||||
|
||||
#ifdef ANDROID
|
||||
//on Android we use just the defaul style packed with the binary via qrc
|
||||
currentFileName = ":/android/android-data/gfx/cards/default_800x480/defaultdeckstyle_800x480.xml";
|
||||
currentDir = ":/android/android-data/gfx/cards/default_800x480/";
|
||||
//on Android we use just the defaul style packed with the binary via qrc
|
||||
currentFileName = ":/android/android-data/gfx/cards/default_800x480/defaultdeckstyle_800x480.xml";
|
||||
currentDir = ":/android/android-data/gfx/cards/default_800x480/";
|
||||
#else
|
||||
//if style file failed --> default style fallback
|
||||
if(QFile(file).exists()) {
|
||||
currentFileName = file;
|
||||
} else {
|
||||
currentFileName = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml";
|
||||
fallBack = 1;
|
||||
}
|
||||
//if style file failed --> default style fallback
|
||||
if(QFile(file).exists()) {
|
||||
currentFileName = file;
|
||||
} else {
|
||||
currentFileName = QString::fromUtf8(myConfig->readConfigString("AppDataDir").c_str())+"gfx/cards/default_800x480/defaultdeckstyle_800x480.xml";
|
||||
fallBack = 1;
|
||||
}
|
||||
|
||||
QFileInfo info(currentFileName);
|
||||
currentDir = info.absolutePath()+"/";
|
||||
QFileInfo info(currentFileName);
|
||||
currentDir = info.absolutePath()+"/";
|
||||
#endif
|
||||
QFile myFile(currentFileName);
|
||||
myFile.open(QIODevice::ReadOnly);
|
||||
fileContent = myFile.readAll();
|
||||
QFile myFile(currentFileName);
|
||||
myFile.open(QIODevice::ReadOnly);
|
||||
fileContent = myFile.readAll();
|
||||
|
||||
//start reading the file and fill vars
|
||||
string tempString1("");
|
||||
//start reading the file and fill vars
|
||||
string tempString1("");
|
||||
|
||||
TiXmlDocument doc;
|
||||
doc.Parse(fileContent.constData());
|
||||
TiXmlDocument doc;
|
||||
doc.Parse(fileContent.constData());
|
||||
|
||||
if(doc.RootElement()) {
|
||||
TiXmlHandle docHandle( &doc );
|
||||
TiXmlElement *GameTableElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).ToElement();
|
||||
if(GameTableElement) {
|
||||
MyMessageBox::warning(myW, tr("Card Deck Style Error"),
|
||||
tr("A game table style was selected instead of a card deck style.\nPlease select a card deck style and try again!"),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
if(doc.RootElement()) {
|
||||
TiXmlHandle docHandle( &doc );
|
||||
TiXmlElement *GameTableElement = docHandle.FirstChild( "PokerTH" ).FirstChild( "TableStyle" ).ToElement();
|
||||
if(GameTableElement) {
|
||||
MyMessageBox::warning(myW, tr("Card Deck Style Error"),
|
||||
tr("A game table style was selected instead of a card deck style.\nPlease select a card deck style and try again!"),
|
||||
QMessageBox::Ok);
|
||||
} else {
|
||||
|
||||
TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement();
|
||||
for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
|
||||
const char *tmpStr1 = itemsList->Attribute("value");
|
||||
if (tmpStr1) {
|
||||
tempString1 = tmpStr1;
|
||||
TiXmlElement* itemsList = docHandle.FirstChild( "PokerTH" ).FirstChild( "CardDeck" ).FirstChild().ToElement();
|
||||
for( ; itemsList; itemsList=itemsList->NextSiblingElement()) {
|
||||
const char *tmpStr1 = itemsList->Attribute("value");
|
||||
if (tmpStr1) {
|
||||
tempString1 = tmpStr1;
|
||||
|
||||
if(itemsList->ValueStr() == "StyleDescription") {
|
||||
StyleDescription = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "StyleMaintainerName") {
|
||||
StyleMaintainerName = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "StyleMaintainerEMail") {
|
||||
StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "StyleCreateDate") {
|
||||
StyleCreateDate = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") {
|
||||
PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str());
|
||||
} else if (itemsList->ValueStr() == "Preview") {
|
||||
Preview = currentDir+QString::fromUtf8(tempString1.c_str());
|
||||
} else if (itemsList->ValueStr() == "BigIndexesActionBottom") {
|
||||
BigIndexesActionBottom = QString::fromUtf8(tempString1.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
//check if style items are left and show warning
|
||||
leftItems.clear();
|
||||
if(itemsList->ValueStr() == "StyleDescription") {
|
||||
StyleDescription = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "StyleMaintainerName") {
|
||||
StyleMaintainerName = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "StyleMaintainerEMail") {
|
||||
StyleMaintainerEMail = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "StyleCreateDate") {
|
||||
StyleCreateDate = QString::fromUtf8(tempString1.c_str());
|
||||
} else if(itemsList->ValueStr() == "PokerTHStyleFileVersion") {
|
||||
PokerTHStyleFileVersion = QString::fromUtf8(tempString1.c_str());
|
||||
} else if (itemsList->ValueStr() == "Preview") {
|
||||
Preview = currentDir+QString::fromUtf8(tempString1.c_str());
|
||||
} else if (itemsList->ValueStr() == "BigIndexesActionBottom") {
|
||||
BigIndexesActionBottom = QString::fromUtf8(tempString1.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
//check if style items are left and show warning
|
||||
leftItems.clear();
|
||||
|
||||
if(StyleDescription == "") {
|
||||
leftItems << "StyleDescription";
|
||||
}
|
||||
if(StyleMaintainerName == "") {
|
||||
leftItems << "StyleMaintainerName";
|
||||
}
|
||||
if(StyleMaintainerEMail == "") {
|
||||
leftItems << "StyleMaintainerEMail";
|
||||
}
|
||||
if(StyleCreateDate == "") {
|
||||
leftItems << "StyleCreateDate";
|
||||
}
|
||||
if(PokerTHStyleFileVersion == "") {
|
||||
leftItems << "PokerTHStyleFileVersion";
|
||||
}
|
||||
if(BigIndexesActionBottom == "") {
|
||||
//ATTENTION: no fallback action here because default position is mostly CENTER
|
||||
BigIndexesActionBottom = "0";
|
||||
leftItems << "BigIndexesActionBottom";
|
||||
}
|
||||
if(StyleDescription == "") {
|
||||
leftItems << "StyleDescription";
|
||||
}
|
||||
if(StyleMaintainerName == "") {
|
||||
leftItems << "StyleMaintainerName";
|
||||
}
|
||||
if(StyleMaintainerEMail == "") {
|
||||
leftItems << "StyleMaintainerEMail";
|
||||
}
|
||||
if(StyleCreateDate == "") {
|
||||
leftItems << "StyleCreateDate";
|
||||
}
|
||||
if(PokerTHStyleFileVersion == "") {
|
||||
leftItems << "PokerTHStyleFileVersion";
|
||||
}
|
||||
if(BigIndexesActionBottom == "") {
|
||||
//ATTENTION: no fallback action here because default position is mostly CENTER
|
||||
BigIndexesActionBottom = "0";
|
||||
leftItems << "BigIndexesActionBottom";
|
||||
}
|
||||
|
||||
//check if all files are there
|
||||
cardsLeft.clear();
|
||||
int i;
|
||||
for(i=0; i<52; i++) {
|
||||
QString cardString(QString::number(i)+".png");
|
||||
if(!QDir(currentDir).exists(cardString)) {
|
||||
cardsLeft << cardString;
|
||||
}
|
||||
}
|
||||
if(!QDir(currentDir).exists("flipside.png")) {
|
||||
cardsLeft << "flipside.png";
|
||||
}
|
||||
//check if all files are there
|
||||
cardsLeft.clear();
|
||||
int i;
|
||||
for(i=0; i<52; i++) {
|
||||
QString cardString(QString::number(i)+".png");
|
||||
if(!QDir(currentDir).exists(cardString)) {
|
||||
cardsLeft << cardString;
|
||||
}
|
||||
}
|
||||
if(!QDir(currentDir).exists("flipside.png")) {
|
||||
cardsLeft << "flipside.png";
|
||||
}
|
||||
|
||||
// set loadedSuccessfull TRUE if everything works
|
||||
if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) {
|
||||
myState = CD_STYLE_OK;
|
||||
}
|
||||
else {
|
||||
//check for style file version
|
||||
if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) {
|
||||
myState = CD_STYLE_OUTDATED;
|
||||
} else {
|
||||
//if one or more items are left
|
||||
if(!leftItems.isEmpty() && myW != 0) myState = CD_STYLE_FIELDS_EMPTY;
|
||||
// set loadedSuccessfull TRUE if everything works
|
||||
if(leftItems.isEmpty() && cardsLeft.isEmpty() && PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() == POKERTH_CD_STYLE_FILE_VERSION) {
|
||||
myState = CD_STYLE_OK;
|
||||
} else {
|
||||
//check for style file version
|
||||
if(PokerTHStyleFileVersion != "" && PokerTHStyleFileVersion.toInt() != POKERTH_CD_STYLE_FILE_VERSION) {
|
||||
myState = CD_STYLE_OUTDATED;
|
||||
} else {
|
||||
//if one or more items are left
|
||||
if(!leftItems.isEmpty() && myW != 0) myState = CD_STYLE_FIELDS_EMPTY;
|
||||
|
||||
//if one or more pictures where not found
|
||||
if(!cardsLeft.isEmpty() && myW != 0) myState = CD_STYLE_PICTURES_MISSING;
|
||||
}
|
||||
}
|
||||
loadedSuccessfull = 1;
|
||||
}
|
||||
}
|
||||
else {
|
||||
loadedSuccessfull = 0;
|
||||
MyMessageBox::warning(myW, tr("Card Deck Style Error"),
|
||||
tr("Cannot load card deck style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
//if one or more pictures where not found
|
||||
if(!cardsLeft.isEmpty() && myW != 0) myState = CD_STYLE_PICTURES_MISSING;
|
||||
}
|
||||
}
|
||||
loadedSuccessfull = 1;
|
||||
}
|
||||
} else {
|
||||
loadedSuccessfull = 0;
|
||||
MyMessageBox::warning(myW, tr("Card Deck Style Error"),
|
||||
tr("Cannot load card deck style file: %1 \n\nPlease check the style file or choose another style!").arg(currentFileName),
|
||||
QMessageBox::Ok);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CardDeckStyleReader::showErrorMessage()
|
||||
{
|
||||
switch (myState) {
|
||||
case CD_STYLE_PICTURES_MISSING:
|
||||
showCardsLeftErrorMessage();
|
||||
break;
|
||||
case CD_STYLE_FIELDS_EMPTY:
|
||||
showLeftItemsErrorMessage();
|
||||
break;
|
||||
case CD_STYLE_OUTDATED:
|
||||
showOutdatedErrorMessage();
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
switch (myState) {
|
||||
case CD_STYLE_PICTURES_MISSING:
|
||||
showCardsLeftErrorMessage();
|
||||
break;
|
||||
case CD_STYLE_FIELDS_EMPTY:
|
||||
showLeftItemsErrorMessage();
|
||||
break;
|
||||
case CD_STYLE_OUTDATED:
|
||||
showOutdatedErrorMessage();
|
||||
break;
|
||||
default:
|
||||
;
|
||||
}
|
||||
}
|
||||
|
||||
QString CardDeckStyleReader::getMyStateToolTipInfo()
|
||||
{
|
||||
switch (myState) {
|
||||
case CD_STYLE_OK:
|
||||
return QString(tr("Everything OK!"));
|
||||
break;
|
||||
case CD_STYLE_PICTURES_MISSING:
|
||||
return QString(tr("Some cards pictures are missing, please contact style maintainer for this issue."));
|
||||
break;
|
||||
case CD_STYLE_FIELDS_EMPTY:
|
||||
return QString(tr("Some style fields are missing, please contact style maintainer for this issue."));
|
||||
break;
|
||||
case CD_STYLE_OUTDATED:
|
||||
return QString(tr("This style is outdated, please contact style maintainer for this issue."));
|
||||
break;
|
||||
default:
|
||||
return QString("");
|
||||
}
|
||||
switch (myState) {
|
||||
case CD_STYLE_OK:
|
||||
return QString(tr("Everything OK!"));
|
||||
break;
|
||||
case CD_STYLE_PICTURES_MISSING:
|
||||
return QString(tr("Some cards pictures are missing, please contact style maintainer for this issue."));
|
||||
break;
|
||||
case CD_STYLE_FIELDS_EMPTY:
|
||||
return QString(tr("Some style fields are missing, please contact style maintainer for this issue."));
|
||||
break;
|
||||
case CD_STYLE_OUTDATED:
|
||||
return QString(tr("This style is outdated, please contact style maintainer for this issue."));
|
||||
break;
|
||||
default:
|
||||
return QString("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void CardDeckStyleReader::showLeftItemsErrorMessage()
|
||||
{
|
||||
QString items = leftItems.join("\n");
|
||||
QString EMail;
|
||||
if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
|
||||
QString items = leftItems.join("\n");
|
||||
QString EMail;
|
||||
if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
|
||||
|
||||
myMessageDialogImpl dialog(myConfig, myW);
|
||||
myMessageDialogImpl dialog(myConfig, myW);
|
||||
|
||||
if(dialog.checkIfMesssageWillBeDisplayed(CD_VALUES_MISSING)) {
|
||||
dialog.exec(CD_VALUES_MISSING, tr("Selected card deck style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Card Deck Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
|
||||
}
|
||||
if(dialog.checkIfMesssageWillBeDisplayed(CD_VALUES_MISSING)) {
|
||||
dialog.exec(CD_VALUES_MISSING, tr("Selected card deck style \"%1\" seems to be incomplete or defective. \n\nThe value(s) of: \n%2 \nis/are missing. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(items).arg(EMail), tr("Card Deck Style Error - Fields content missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void CardDeckStyleReader::showCardsLeftErrorMessage()
|
||||
{
|
||||
QString pics = cardsLeft.join("\n");
|
||||
QString EMail;
|
||||
if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
|
||||
QString pics = cardsLeft.join("\n");
|
||||
QString EMail;
|
||||
if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
|
||||
|
||||
myMessageDialogImpl dialog(myConfig, myW);
|
||||
myMessageDialogImpl dialog(myConfig, myW);
|
||||
|
||||
if(dialog.checkIfMesssageWillBeDisplayed(CD_PICS_MISSING)) {
|
||||
dialog.exec(CD_PICS_MISSING, tr("One or more pictures from current card deck style \"%1\" were not found: \n\n%2 \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Card Deck Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
|
||||
}
|
||||
if(dialog.checkIfMesssageWillBeDisplayed(CD_PICS_MISSING)) {
|
||||
dialog.exec(CD_PICS_MISSING, tr("One or more pictures from current card deck style \"%1\" were not found: \n\n%2 \n\nPlease contact the card deck style builder via \"%3\".").arg(StyleDescription).arg(pics).arg(EMail), tr("Card Deck Style Error - Pictures missing"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
|
||||
}
|
||||
}
|
||||
|
||||
void CardDeckStyleReader::showOutdatedErrorMessage()
|
||||
{
|
||||
QString EMail;
|
||||
if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
|
||||
QString EMail;
|
||||
if(StyleMaintainerEMail != "NULL") EMail = StyleMaintainerEMail;
|
||||
|
||||
myMessageDialogImpl dialog(myConfig, myW);
|
||||
myMessageDialogImpl dialog(myConfig, myW);
|
||||
|
||||
if(dialog.checkIfMesssageWillBeDisplayed(CD_OUTDATED)) {
|
||||
dialog.exec(CD_OUTDATED, tr("Selected card deck style \"%1\" seems to be outdated. \nThe current PokerTH card deck style version is \"%2\", but this deck has version \"%3\" set. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_CD_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Card Deck Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
|
||||
}
|
||||
if(dialog.checkIfMesssageWillBeDisplayed(CD_OUTDATED)) {
|
||||
dialog.exec(CD_OUTDATED, tr("Selected card deck style \"%1\" seems to be outdated. \nThe current PokerTH card deck style version is \"%2\", but this deck has version \"%3\" set. \n\nAnyway you can play with this deck, because the missing content will be filled up by PokerTH default card deck. \n\nPlease contact the card deck style builder via \"%4\".").arg(StyleDescription).arg(POKERTH_CD_STYLE_FILE_VERSION).arg(PokerTHStyleFileVersion).arg(EMail), tr("Card Deck Style Error - Outdated"), QPixmap(":/gfx/emblem-important-64.png"), QDialogButtonBox::Ok, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@ enum CdStyleState {
|
||||
CD_STYLE_OUTDATED,
|
||||
CD_STYLE_FIELDS_EMPTY,
|
||||
CD_STYLE_PICTURES_MISSING,
|
||||
CD_STYLE_UNDEFINED
|
||||
CD_STYLE_UNDEFINED
|
||||
};
|
||||
|
||||
class CardDeckStyleReader : public QObject
|
||||
@@ -67,26 +67,26 @@ public:
|
||||
return Preview;
|
||||
}
|
||||
|
||||
QString getBigIndexesActionBottom() const {
|
||||
return BigIndexesActionBottom;
|
||||
}
|
||||
QString getBigIndexesActionBottom() const {
|
||||
return BigIndexesActionBottom;
|
||||
}
|
||||
|
||||
bool getFallBack() const {
|
||||
return fallBack;
|
||||
}
|
||||
bool getLoadedSuccessfull() const {
|
||||
return loadedSuccessfull;
|
||||
}
|
||||
}
|
||||
|
||||
CdStyleState getState() const {
|
||||
return myState;
|
||||
}
|
||||
CdStyleState getState() const {
|
||||
return myState;
|
||||
}
|
||||
|
||||
QString getMyStateToolTipInfo();
|
||||
void showErrorMessage();
|
||||
void showLeftItemsErrorMessage();
|
||||
void showCardsLeftErrorMessage();
|
||||
void showOutdatedErrorMessage();
|
||||
QString getMyStateToolTipInfo();
|
||||
void showErrorMessage();
|
||||
void showLeftItemsErrorMessage();
|
||||
void showCardsLeftErrorMessage();
|
||||
void showOutdatedErrorMessage();
|
||||
|
||||
private:
|
||||
|
||||
@@ -96,7 +96,7 @@ private:
|
||||
QString StyleCreateDate;
|
||||
QString PokerTHStyleFileVersion;
|
||||
QString Preview;
|
||||
QString BigIndexesActionBottom;
|
||||
QString BigIndexesActionBottom;
|
||||
|
||||
QString currentFileName;
|
||||
QString currentDir;
|
||||
@@ -109,9 +109,9 @@ private:
|
||||
QWidget *myW;
|
||||
|
||||
bool fallBack;
|
||||
bool loadedSuccessfull;
|
||||
bool loadedSuccessfull;
|
||||
|
||||
CdStyleState myState;
|
||||
CdStyleState myState;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+1417
-1418
File diff suppressed because it is too large
Load Diff
@@ -87,9 +87,9 @@ public:
|
||||
QString getHandRanking() const {
|
||||
return HandRanking;
|
||||
}
|
||||
QString getTable() const {
|
||||
return Table;
|
||||
}
|
||||
QString getTable() const {
|
||||
return Table;
|
||||
}
|
||||
|
||||
QString getActionPic(int);
|
||||
|
||||
|
||||
@@ -27,9 +27,9 @@ timeoutMsgBoxImpl::timeoutMsgBoxImpl(QMainWindow *parent)
|
||||
this->setIcon(QMessageBox::Warning);
|
||||
this->setInformativeText(tr("Please click \"OK\" to stop the countdown!"));
|
||||
#ifdef ANDROID
|
||||
this->setWindowModality(Qt::WindowModal);
|
||||
this->setWindowFlags(Qt::ToolTip);
|
||||
this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
this->setWindowModality(Qt::WindowModal);
|
||||
this->setWindowFlags(Qt::ToolTip);
|
||||
this->setStyleSheet("QDialog{ border: 1px solid black; border-style: solid; border-radius: 4px; }");
|
||||
#endif
|
||||
timeOutTimer = new QTimer;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user