@@ -34,7 +34,7 @@ ApplicationDialog::ApplicationDialog(const QString &title,
3434 mUI .setupUi (this );
3535
3636 connect (mUI .mButtonBrowse , SIGNAL (clicked ()), this , SLOT (Browse ()));
37- connect (mUI .mButtons , SIGNAL (accepted ()), this , SLOT (accept ()));
37+ connect (mUI .mButtons , SIGNAL (accepted ()), this , SLOT (Ok ()));
3838 connect (mUI .mButtons , SIGNAL (rejected ()), this , SLOT (reject ()));
3939 mUI .mPath ->setText (app.getPath ());
4040 mUI .mName ->setText (app.getName ());
@@ -70,21 +70,22 @@ void ApplicationDialog::Browse()
7070
7171void ApplicationDialog::Ok ()
7272{
73- if (mUI .mName ->text ().isEmpty () || mUI .mPath ->text ().isEmpty () ||
74- mUI .mParameters ->text ().isEmpty ()) {
73+ if (mUI .mName ->text ().isEmpty () || mUI .mPath ->text ().isEmpty ()) {
7574 QMessageBox msg (QMessageBox::Warning,
7675 tr (" Cppcheck" ),
77- tr (" You must specify a name, a path and parameters for the application!" ),
76+ tr (" You must specify a name, a path and optionally parameters for the application!" ),
7877 QMessageBox::Ok,
7978 this );
8079
8180 msg.exec ();
8281
82+ reject ();
8383 } else {
8484 // Convert possible native (Windows) path to internal presentation format
8585 mApplication .setName (mUI .mName ->text ());
8686 mApplication .setPath (QDir::fromNativeSeparators (mUI .mPath ->text ()));
8787 mApplication .setParameters (mUI .mParameters ->text ());
88+
8889 accept ();
8990 }
9091}
0 commit comments