This commit is contained in:
doitux
2007-02-04 00:34:44 +00:00
parent 27041becbf
commit ff6c1e5cbd
8 changed files with 30 additions and 15 deletions
+1 -1
View File
@@ -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;
+1 -1
View File
@@ -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); }
+1 -1
View File
@@ -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:
+11 -3
View File
@@ -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 << "<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();
}
@@ -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);
+1 -1
View File
@@ -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:
+5 -5
View File
@@ -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();
+9 -2
View File
@@ -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(); }
}