This commit is contained in:
@@ -92,7 +92,7 @@ void LocalPlayer::action() {
|
|||||||
myTurn = 0;
|
myTurn = 0;
|
||||||
// cout << "jetzt" << endl;
|
// cout << "jetzt" << endl;
|
||||||
|
|
||||||
actualHand->getGuiInterface()->showPlayerActionLogMsg(myName, myAction, mySet);
|
actualHand->getGuiInterface()->logPlayerActionMsg(myName, myAction, mySet);
|
||||||
actualHand->getGuiInterface()->nextPlayerAnimation();
|
actualHand->getGuiInterface()->nextPlayerAnimation();
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
//log.cpp
|
//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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ void GuiWrapper::nextRoundCleanGui() const { myW->nextRoundCleanGui(); }
|
|||||||
|
|
||||||
void GuiWrapper::meInAction() const { myW->meInAction(); }
|
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); }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ public:
|
|||||||
|
|
||||||
void meInAction() const;
|
void meInAction() const;
|
||||||
|
|
||||||
void showPlayerActionLogMsg(std::string playerName, int action, int setValue) const;
|
void logPlayerActionMsg(std::string playerName, int action, int setValue) const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|||||||
+11
-3
@@ -31,11 +31,19 @@ Log::Log(mainWindowImpl* w) : myW(w)
|
|||||||
if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))).exists()) {
|
if(myConfig->readConfigString("LogDir") != "" && QDir::QDir(QString::fromStdString(myConfig->readConfigString("LogDir"))).exists()) {
|
||||||
|
|
||||||
myLogDir = new QDir(QString::fromStdString(myConfig->readConfigString("LogDir")));
|
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 );
|
myLogFile->open( QIODevice::WriteOnly );
|
||||||
QTextStream stream( myLogFile );
|
QTextStream stream( myLogFile );
|
||||||
stream << "### This is a Log File for PokerTH ### \n";
|
stream << "<html>";
|
||||||
|
stream << "<body>";
|
||||||
|
stream << "<img src='logo.png'>";
|
||||||
|
stream << "<h3><b>Log-File for PokerTH Session started on "+QDate::currentDate().toString("yyyy-MM-dd")+" at "+QTime::currentTime().toString("hh:mm:ss")+"</b></h3>";
|
||||||
|
stream << "</body>";
|
||||||
|
stream << "</html>";
|
||||||
myLogFile->close();
|
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;
|
QString msg;
|
||||||
msg = QString::fromStdString(playerName);
|
msg = QString::fromStdString(playerName);
|
||||||
|
|||||||
+1
-1
@@ -40,7 +40,7 @@ public:
|
|||||||
~Log();
|
~Log();
|
||||||
|
|
||||||
|
|
||||||
void showPlayerActionLogMsg(std::string playName, int action, int setValue) const;
|
void logPlayerActionMsg(std::string playName, int action, int setValue) const;
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -1035,7 +1035,7 @@ void mainWindowImpl::myFold(){
|
|||||||
actualHand->getPlayerArray()[0]->setMyTurn(0);
|
actualHand->getPlayerArray()[0]->setMyTurn(0);
|
||||||
|
|
||||||
//Action in LogWindow
|
//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();
|
disableMyButtons();
|
||||||
|
|
||||||
@@ -1049,7 +1049,7 @@ void mainWindowImpl::myCheck() {
|
|||||||
actualHand->getPlayerArray()[0]->setMyTurn(0);
|
actualHand->getPlayerArray()[0]->setMyTurn(0);
|
||||||
|
|
||||||
//Action in LogWindow
|
//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();
|
disableMyButtons();
|
||||||
|
|
||||||
@@ -1089,7 +1089,7 @@ void mainWindowImpl::myCall(){
|
|||||||
refreshPot();
|
refreshPot();
|
||||||
|
|
||||||
//Action in LogWindow
|
//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();
|
disableMyButtons();
|
||||||
|
|
||||||
@@ -1192,7 +1192,7 @@ void mainWindowImpl::mySet(){
|
|||||||
refreshPot();
|
refreshPot();
|
||||||
|
|
||||||
//Action in LogWindow
|
//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();
|
disableMyButtons();
|
||||||
|
|
||||||
@@ -1225,7 +1225,7 @@ void mainWindowImpl::myAllIn(){
|
|||||||
refreshPot();
|
refreshPot();
|
||||||
|
|
||||||
//Action in LogWindow
|
//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();
|
disableMyButtons();
|
||||||
|
|
||||||
|
|||||||
@@ -109,14 +109,20 @@ void settingsDialogImpl::isAccepted() {
|
|||||||
myConfig.writeConfigInt("ShowFlipCardsAnimation", checkBox_showFlipCardsAnimation->isChecked());
|
myConfig.writeConfigInt("ShowFlipCardsAnimation", checkBox_showFlipCardsAnimation->isChecked());
|
||||||
myConfig.writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());
|
myConfig.writeConfigInt("FlipsideTux", radioButton_flipsideTux->isChecked());
|
||||||
myConfig.writeConfigInt("FlipsideOwn", radioButton_flipsideOwn->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
|
// Log
|
||||||
if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig.writeConfigString("LogDir", lineEdit_logDir->text().toStdString()); }
|
if(QDir::QDir(lineEdit_logDir->text()).exists() && lineEdit_logDir->text() != "") { myConfig.writeConfigString("LogDir", lineEdit_logDir->text().toStdString()); }
|
||||||
else {
|
else {
|
||||||
QMessageBox::warning(this, tr("Settings Error"),
|
QMessageBox::warning(this, tr("Settings Error"),
|
||||||
tr("The Log File Directory doesn't exists.\n"
|
tr("The Log File Directory doesn't exists.\n"
|
||||||
"Please select an existing Directory!"),
|
"Please select an valid Directory!"),
|
||||||
QMessageBox::Ok);
|
QMessageBox::Ok);
|
||||||
settingsCorrect = FALSE;
|
settingsCorrect = FALSE;
|
||||||
}
|
}
|
||||||
@@ -124,6 +130,7 @@ void settingsDialogImpl::isAccepted() {
|
|||||||
myConfig.writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
|
myConfig.writeConfigInt("LogStoreDuration", spinBox_logStoreDuration->value());
|
||||||
|
|
||||||
|
|
||||||
|
//Wenn alles richtig eingegeben wurde --> Dialog schließen
|
||||||
if(settingsCorrect) { this->hide(); }
|
if(settingsCorrect) { this->hide(); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user