35 tie(
m_uiForm.investigationNumberCb,
"InvestigationNumber");
36 tie(
m_uiForm.descriptionInput,
"DataFileDescription");
40 connect(
m_uiForm.cancelBtn, SIGNAL(clicked()),
this, SLOT(
reject()));
69 if (!session.empty()) {
72 auto catalogInfoService = std::dynamic_pointer_cast<Mantid::API::ICatalogInfoService>(
75 if (!catalogInfoService)
76 throw std::runtime_error(
"The catalog that you are using does not support publishing.");
79 workspace = catalogInfoService->getPublishInvestigations();
81 }
catch (std::runtime_error &e) {
87 for (
size_t row = 0; row <
workspace->rowCount(); row++) {
88 m_uiForm.investigationNumberCb->addItem(
89 QString::fromStdString(
workspace->getRef<std::string>(
"InvestigationID", row)));
91 m_uiForm.investigationNumberCb->setItemData(
92 static_cast<int>(row),
93 QString::fromStdString(
94 "The title of the investigation is: \"" +
workspace->getRef<std::string>(
"Title", row) +
95 "\".\nThe instrument of the investigation is: \"" +
workspace->getRef<std::string>(
"Instrument", row)) +
99 m_uiForm.investigationNumberCb->setItemData(
100 static_cast<int>(row), QString::fromStdString(
workspace->getRef<std::string>(
"SessionID", row)),
140 m_uiForm.scrollArea->setDisabled(
true);
156 if (!
m_uiForm.dataSelector->isValid()) {
157 if (
m_uiForm.dataSelector->getFullFilePath().isEmpty()) {
158 QMessageBox::critical(
this,
"Error in catalog publishing.",
"No file specified.");
160 QMessageBox::critical(
this,
"Error in catalog publishing.",
m_uiForm.dataSelector->getProblem());
163 AlgorithmDialog::accept();
#define DECLARE_DIALOG(classname)
IPeaksWorkspace_sptr workspace
std::map< DeltaEMode::Type, std::string > index
void setOptionalMessage(const QString &message)
Set an optional message to be displayed at the top of the dialog.
bool setPropertyValue(const QString &pName, bool validateOthers)
Sets the value of a single property, using the value previously stored using storePropertyValue()
void reject() override
A default slot that can be used for a rejected button.
QString m_algName
The name of the algorithm.
virtual void helpClicked()
Help button clicked;.
void storePropertyValue(const QString &name, const QString &value)
Adds a property (name,value) pair to the stored map.
QWidget * tie(QWidget *widget, const QString &property, QLayout *parent_layout=nullptr, bool readHistory=true)
Tie a widget to a property.
const QString & getOptionalMessage() const
Get the message string.
This class gives specialised dialog for the CatalogPublish algorithm.
void workspaceSelected(const QString &wsName)
When the "browse" button is clicked open a file browser.
void initLayout() override
Create the inital layout.
void disableDialog()
Diables fields on dialog to improve usability.
void populateUserInvestigations()
Populate the investigation number combo-box with investigations that the user can publish to.
void accept() override
Overridden to enable dataselector validators.
Ui::CatalogPublishDialog m_uiForm
The form generated by QT Designer.
void setSessionProperty(int index)
Set session property when user selects an investigation to publish to.
void fileSelected()
Set the "FileName" property when a file is selected from the file browser.
static T & Instance()
Return a reference to the Singleton instance, creating it if it does not already exist Creation is do...