diff --git a/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp b/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp index 3eadfac8..ce3e29f6 100644 --- a/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp +++ b/src/gui/qt/mymessagedialog/mymessagedialogimpl.cpp @@ -79,6 +79,48 @@ int myMessageDialogImpl::exec(int messageId, QString msg, QString title, QPixmap return -1; } +void myMessageDialogImpl::show(int messageId, QString msg, QString title, QPixmap pix, QDialogButtonBox::StandardButtons buttons, bool showCheckBox) +{ + if(showCheckBox) checkBox->show(); + else checkBox->hide(); + + bool show = false; + bool found = false; + + currentMsgId = messageId; + + currentMsgShowList = myConfig->readConfigStringList("IfInfoMessageShowList"); + list::iterator it1; + for(it1= currentMsgShowList.begin(); it1 != currentMsgShowList.end(); ++it1) { + + QString tmpString = QString::fromUtf8(it1->c_str()); + if(QString("%1").arg(messageId) == tmpString.split(",").at(1)) { + + found = true; + show = tmpString.split(",").at(0).toInt(); + + break; + } + } + + if(!found) { + currentMsgShowList.push_back(QString("1,%1").arg(messageId).toUtf8().constData()); + myConfig->writeConfigStringList("IfInfoMessageShowList", currentMsgShowList); + myConfig->writeBuffer(); + } + + if(!found || show) { + + setWindowTitle(title); + label_icon->setPixmap(pix.scaled(50,50,Qt::KeepAspectRatio,Qt::SmoothTransformation)); + label->setText(msg); + buttonBox->setStandardButtons(buttons); + + QDialog::show(); + } +} + + void myMessageDialogImpl::accept() { writeConfig(); diff --git a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h index 2a8c568d..bcafb9a5 100644 --- a/src/gui/qt/mymessagedialog/mymessagedialogimpl.h +++ b/src/gui/qt/mymessagedialog/mymessagedialogimpl.h @@ -33,6 +33,7 @@ public slots: bool checkIfMesssageWillBeDisplayed(int id); int exec(int messageId, QString msg, QString title, QPixmap pix, QDialogButtonBox::StandardButtons buttons, bool showCheckBox = false); + void show(int messageId, QString msg, QString title, QPixmap pix, QDialogButtonBox::StandardButtons buttons, bool showCheckBox = false); void accept(); void reject(); void writeConfig();