GPL V2. Added settings to documentation
1 #include "warningdialog.h"
4 extern QString iconPath;
5 extern Settings settings;
7 WarningDialog::WarningDialog(QWidget* parent):QDialog (parent)
10 //TODO proper icon for proceed needed
11 ui.okButton->setText(tr("Proceed"));
13 ui.warningSign->setPixmap (QPixmap(iconPath + "icons/vym.png"));
15 ui.showAgainBox->setText (tr("Show this message again"));
17 ui.showAgainBox->hide();
20 int WarningDialog::exec()
23 if (settings.value ("/warningDialog/"+showAgainName+"/showAgain",true).toBool() )
25 result=QDialog::exec();
26 if (result==QDialog::Accepted )
28 settings.setValue ("/warningDialog/"+showAgainName+"/value",result);
29 settings.setValue ("/warningDialog/"+showAgainName+"/showAgain",ui.showAgainBox->isChecked() );
33 result=settings.value ("/warningDialog/"+showAgainName+"/value",0).toInt();
38 void WarningDialog::showCancelButton (bool b)
42 ui.cancelButton->show();
43 ui.cancelButton->setText(tr("Cancel"));
45 ui.cancelButton->hide();
48 void WarningDialog::setShowAgainName (const QString &s)
52 ui.showAgainBox->show();
55 void WarningDialog::setText (const QString &s)
57 ui.warningTE->setText(s);
60 void WarningDialog::setCaption(const QString &s)
62 QDialog::setCaption("VYM - "+s);