diff -r f001beefdec2 -r 717b20c56358 warningdialog.cpp --- a/warningdialog.cpp Mon Feb 19 12:01:54 2007 +0000 +++ b/warningdialog.cpp Wed Mar 21 11:51:38 2007 +0000 @@ -1,6 +1,8 @@ #include "warningdialog.h" +#include "settings.h" extern QString iconPath; +extern Settings settings; WarningDialog::WarningDialog(QWidget* parent):QDialog (parent) { @@ -9,12 +11,30 @@ ui.okButton->setText(tr("Proceed")); /* ui.warningSign->setPixmap (QPixmap(iconPath + "icons/vym.png")); + */ ui.showAgainBox->setText (tr("Show this message again")); - */ useShowAgain=false; ui.showAgainBox->hide(); } +int WarningDialog::exec() +{ + int result; + if (settings.value ("/warningDialog/"+showAgainName+"/showAgain",true).toBool() ) + { + result=QDialog::exec(); + if (result==QDialog::Accepted ) + { + settings.setValue ("/warningDialog/"+showAgainName+"/value",result); + settings.setValue ("/warningDialog/"+showAgainName+"/showAgain",ui.showAgainBox->isChecked() ); + } + } else + { + result=settings.value ("/warningDialog/"+showAgainName+"/value",0).toInt(); + } + return result; +} + void WarningDialog::showCancelButton (bool b) { if (b) @@ -27,11 +47,9 @@ void WarningDialog::setShowAgainName (const QString &s) //FIXME not implemented yet { -/* showAgainName=s; useShowAgain=true; ui.showAgainBox->show(); -*/ } void WarningDialog::setText (const QString &s)