diff --git a/src/engine/local_engine/localplayer.cpp b/src/engine/local_engine/localplayer.cpp index 63721a02..0093c53a 100755 --- a/src/engine/local_engine/localplayer.cpp +++ b/src/engine/local_engine/localplayer.cpp @@ -92,7 +92,7 @@ void LocalPlayer::action() { myTurn = 0; // cout << "jetzt" << endl; - actualHand->getGuiInterface()->showPlayerActionLogMsg(myName, myAction, mySet); + actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet); actualHand->getGuiInterface()->nextPlayerAnimation(); diff --git a/src/gui/guiinterface.h b/src/gui/guiinterface.h index 2b1ca600..10e8585e 100644 --- a/src/gui/guiinterface.h +++ b/src/gui/guiinterface.h @@ -92,7 +92,7 @@ public: //log.cpp - virtual void showPlayerActionLogMsg(std::string playName, int action, int setValue) const=0; + virtual void logPlayerActionMsg(std::string playName, int action, int setValue) const=0; diff --git a/src/gui/qt/guiwrapper.cpp b/src/gui/qt/guiwrapper.cpp index 121aef0a..000c1f82 100644 --- a/src/gui/qt/guiwrapper.cpp +++ b/src/gui/qt/guiwrapper.cpp @@ -86,7 +86,7 @@ void GuiWrapper::nextRoundCleanGui() const { myW->nextRoundCleanGui(); } void GuiWrapper::meInAction() const { myW->meInAction(); } -void GuiWrapper::showPlayerActionLogMsg(string playerName, int action, int setValue) const { myLog->showPlayerActionLogMsg(playerName, action, setValue); } +void GuiWrapper::logPlayerActionMsg(string playerName, int action, int setValue) const { myLog->logPlayerActionMsg(playerName, action, setValue); } diff --git a/src/gui/qt/guiwrapper.h b/src/gui/qt/guiwrapper.h index 002cf7e3..c6fbbdf1 100644 --- a/src/gui/qt/guiwrapper.h +++ b/src/gui/qt/guiwrapper.h @@ -83,7 +83,7 @@ public: void meInAction() const; - void showPlayerActionLogMsg(std::string playerName, int action, int setValue) const; + void logPlayerActionMsg(std::string playerName, int action, int setValue) const; private: diff --git a/src/gui/qt/log.cpp b/src/gui/qt/log.cpp index fc6bdabb..9b6bf696 100644 --- a/src/gui/qt/log.cpp +++ b/src/gui/qt/log.cpp @@ -31,11 +31,19 @@ Log::Log(mainWindowImpl* w) : myW(w) if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))).exists()) { myLogDir = new QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))); - myLogFile = new QFile(myLogDir->absolutePath()+"/pokerth-log-"+QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss")+".log"); + myLogFile = new QFile(myLogDir->absolutePath()+"/pokerth-log-"+QDateTime::currentDateTime().toString("yyyy-MM-dd_hh:mm:ss")+".html"); + + //Logo-Pixmap extrahieren + QPixmap::QPixmap(":graphics/graphics/logo-140-100.png").save(myLogDir->absolutePath()+"/logo.png"); myLogFile->open( QIODevice::WriteOnly ); QTextStream stream( myLogFile ); - stream << "### This is a Log File for PokerTH ### \n"; + stream << ""; + stream << ""; + stream << ""; + stream << "

Log-File for PokerTH Session started on "+QDate::currentDate().toString("yyyy-MM-dd")+" at "+QTime::currentTime().toString("hh:mm:ss")+"

"; + stream << ""; + stream << ""; myLogFile->close(); } @@ -49,7 +57,7 @@ Log::~Log() { } -void Log::showPlayerActionLogMsg(string playerName, int action, int setValue) const { +void Log::logPlayerActionMsg(string playerName, int action, int setValue) const { QString msg; msg = QString::fromStdString(playerName); diff --git a/src/gui/qt/log.h b/src/gui/qt/log.h index dc77e705..d74cd785 100644 --- a/src/gui/qt/log.h +++ b/src/gui/qt/log.h @@ -40,7 +40,7 @@ public: ~Log(); - void showPlayerActionLogMsg(std::string playName, int action, int setValue) const; + void logPlayerActionMsg(std::string playName, int action, int setValue) const; private: diff --git a/src/gui/qt/mainwindow/mainwindowimpl.cpp b/src/gui/qt/mainwindow/mainwindowimpl.cpp index 63cd1fd8..c5b51bc5 100755 --- a/src/gui/qt/mainwindow/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindow/mainwindowimpl.cpp @@ -1035,7 +1035,7 @@ void mainWindowImpl::myFold(){ actualHand->getPlayerArray()[0]->setMyTurn(0); //Action in LogWindow - myLog->showPlayerActionLogMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); + myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); disableMyButtons(); @@ -1049,7 +1049,7 @@ void mainWindowImpl::myCheck() { actualHand->getPlayerArray()[0]->setMyTurn(0); //Action in LogWindow - myLog->showPlayerActionLogMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); + myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); disableMyButtons(); @@ -1089,7 +1089,7 @@ void mainWindowImpl::myCall(){ refreshPot(); //Action in LogWindow - myLog->showPlayerActionLogMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); + myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); disableMyButtons(); @@ -1192,7 +1192,7 @@ void mainWindowImpl::mySet(){ refreshPot(); //Action in LogWindow - myLog->showPlayerActionLogMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); + myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); disableMyButtons(); @@ -1225,7 +1225,7 @@ void mainWindowImpl::myAllIn(){ refreshPot(); //Action in LogWindow - myLog->showPlayerActionLogMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); + myLog->logPlayerActionMsg(actualHand->getPlayerArray()[0]->getMyName(), actualHand->getPlayerArray()[0]->getMyAction(), actualHand->getPlayerArray()[0]->getMySet()); disableMyButtons(); diff --git a/src/gui/qt/settingsdialogimpl.cpp b/src/gui/qt/settingsdialogimpl.cpp index 74513c5a..b7f683ef 100644 --- a/src/gui/qt/settingsdialogimpl.cpp +++ b/src/gui/qt/settingsdialogimpl.cpp @@ -109,14 +109,20 @@ void settingsDialogImpl::isAccepted() { myConfig.writeConfigInt("ShowFlipCardsAnimation", checkBox_showFlipCardsAnimation->isChecked()); myConfig.writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked()); myConfig.writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->isChecked()); - myConfig.writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toStdString()); + + if(QFile::QFile(lineEdit_OwnFlipsideFilename->text()).exists() && lineEdit_OwnFlipsideFilename->text() != "") {myConfig.writeConfigString("FlipsideOwnFile", lineEdit_OwnFlipsideFilename->text().toStdString()); } + else { QMessageBox::warning(this, tr("Settings Error"), + tr("The entered Flipside Picture doesn't exists.\n" + "Please enter an valid Picture!"), + QMessageBox::Ok); + settingsCorrect = FALSE; } // Log if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig.writeConfigString("LogDir", lineEdit_logDir->text().toStdString()); } else { QMessageBox::warning(this, tr("Settings Error"), tr("The Log File Directory doesn't exists.\n" - "Please select an existing Directory!"), + "Please select an valid Directory!"), QMessageBox::Ok); settingsCorrect = FALSE; } @@ -124,6 +130,7 @@ void settingsDialogImpl::isAccepted() { myConfig.writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value()); + //Wenn alles richtig eingegeben wurde --> Dialog schließen if(settingsCorrect) { this->hide(); } }