Skip to content

Commit

Permalink
Validate dataSelector. Refs #8938.
Browse files Browse the repository at this point in the history
- Although there is a dataSelector specific validator class (`UserInputValidator`), it is not possible to access it from `MantidQtCustomDialogs`.
  • Loading branch information
jawrainey committed Mar 13, 2014
1 parent 7c51efc commit b5e930c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
Expand Up @@ -53,6 +53,10 @@ namespace MantidQt
/// Set the "FileName" property when a file is selected from the file browser.
void fileSelected();

protected:
/// Overridden to enable dataselector validators
void accept();

protected:
/// The form generated by QT Designer.
Ui::CatalogPublishDialog m_uiForm;
Expand Down
12 changes: 12 additions & 0 deletions Code/Mantid/MantidQt/CustomDialogs/src/CatalogPublishDialog.cpp
Expand Up @@ -110,5 +110,17 @@ namespace MantidQt
setPropertyValue("FileName", true);
}

/**
* Overridden to enable dataselector validators.
*/
void CatalogPublishDialog::accept()
{
if (!m_uiForm.dataSelector->isValid())
{
QMessageBox::critical(this,"Error in catalog publishing.",m_uiForm.dataSelector->getProblem());
return;
}
AlgorithmDialog::accept();
}
}
}

0 comments on commit b5e930c

Please sign in to comment.