warningdialog.cpp
changeset 439 717b20c56358
parent 430 f001beefdec2
child 443 0a4b622d5dc3
     1.1 --- a/warningdialog.cpp	Mon Feb 19 12:01:54 2007 +0000
     1.2 +++ b/warningdialog.cpp	Wed Mar 21 11:51:38 2007 +0000
     1.3 @@ -1,6 +1,8 @@
     1.4  #include "warningdialog.h"
     1.5 +#include "settings.h"
     1.6  
     1.7  extern QString iconPath;
     1.8 +extern Settings settings;
     1.9  
    1.10  WarningDialog::WarningDialog(QWidget* parent):QDialog (parent)
    1.11  {
    1.12 @@ -9,12 +11,30 @@
    1.13  	ui.okButton->setText(tr("Proceed"));
    1.14  	/*
    1.15  	ui.warningSign->setPixmap (QPixmap(iconPath + "icons/vym.png"));
    1.16 +	*/
    1.17  	ui.showAgainBox->setText (tr("Show this message again"));
    1.18 -	*/
    1.19  	useShowAgain=false;
    1.20  	ui.showAgainBox->hide();
    1.21  }
    1.22  
    1.23 +int WarningDialog::exec()
    1.24 +{
    1.25 +	int result; 
    1.26 +	if (settings.value ("/warningDialog/"+showAgainName+"/showAgain",true).toBool()  )
    1.27 +	{
    1.28 +		result=QDialog::exec();
    1.29 +		if (result==QDialog::Accepted )
    1.30 +		{
    1.31 +			settings.setValue ("/warningDialog/"+showAgainName+"/value",result);
    1.32 +			settings.setValue ("/warningDialog/"+showAgainName+"/showAgain",ui.showAgainBox->isChecked() );
    1.33 +		}
    1.34 +	} else
    1.35 +	{
    1.36 +		result=settings.value ("/warningDialog/"+showAgainName+"/value",0).toInt();
    1.37 +	}
    1.38 +	return result;
    1.39 +}
    1.40 +
    1.41  void WarningDialog::showCancelButton (bool b)
    1.42  {
    1.43  	if (b)
    1.44 @@ -27,11 +47,9 @@
    1.45  
    1.46  void WarningDialog::setShowAgainName (const QString &s) //FIXME not implemented yet
    1.47  {
    1.48 -/*
    1.49  	showAgainName=s;
    1.50  	useShowAgain=true;
    1.51  	ui.showAgainBox->show();
    1.52 -*/	
    1.53  }
    1.54  
    1.55  void WarningDialog::setText (const QString &s)