try {
Setup *su = getSelectedSetup();
if (!su) {
- throw new EmuFrontException(tr("Setup not selected"));
+ throw EmuFrontException(tr("Setup not selected"));
}
QString name = nameEdit->text().trimmed();
if (name.isEmpty()){
- throw new EmuFrontException(tr("Name is not set"));
+ throw EmuFrontException(tr("Name is not set"));
}
QString exec = execEdit->text().trimmed();
if (exec.isEmpty()){
- throw new EmuFrontException(tr("Executable is not set"));
+ throw EmuFrontException(tr("Executable is not set"));
}
QString opts = optEdit->text().trimmed();
if (opts.isEmpty()) {
- throw new EmuFrontException(tr("Options not set"));
+ throw EmuFrontException(tr("Options not set"));
}
bool change = false;
Setup *supTmp = ex->getSetup();
setupComBox->setSelected(su);
}
-Setup* ExecutableEditDialog::getSelectedSetup() const
+Setup* ExecutableEditDialog::getSelectedSetup()
{
- EmuFrontObject *o = setupComBox->getSelected();
+ EmuFrontObject *o = 0;
+ try { o = setupComBox->getSelected(); }
+ catch(EmuFrontException &e){ QMessageBox::warning(this, "Exception", e.what()); }
+
if (!o) return 0;
Setup *ex = dynamic_cast<Setup*>(o);
return ex;