IndirectSettingsView.cpp 2.58 KB
Newer Older
1
2
3
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2019 ISIS Rutherford Appleton Laboratory UKRI,
4
5
//   NScD Oak Ridge National Laboratory, European Spallation Source,
//   Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6
7
8
// SPDX - License - Identifier: GPL - 3.0 +
#include "IndirectSettingsView.h"

9
10
#include "MantidQtWidgets/Common/HelpWindow.h"

11
12
13
namespace MantidQt {
namespace CustomInterfaces {

Robert Applin's avatar
Robert Applin committed
14
IndirectSettingsView::IndirectSettingsView(QWidget *parent)
15
16
17
    : IIndirectSettingsView(parent),
      m_uiForm(std::make_unique<Ui::IndirectInterfaceSettings>()) {
  m_uiForm->setupUi(this);
18

19
20
21
  connect(m_uiForm->pbOk, SIGNAL(clicked()), this, SLOT(emitOkClicked()));
  connect(m_uiForm->pbApply, SIGNAL(clicked()), this, SLOT(emitApplyClicked()));
  connect(m_uiForm->pbCancel, SIGNAL(clicked()), this,
22
          SLOT(emitCancelClicked()));
23

24
  connect(m_uiForm->pbHelp, SIGNAL(clicked()), this, SLOT(openHelp()));
25
26
27
28
29
30
31
32
}

void IndirectSettingsView::emitOkClicked() { emit okClicked(); }

void IndirectSettingsView::emitApplyClicked() { emit applyClicked(); }

void IndirectSettingsView::emitCancelClicked() { emit cancelClicked(); }

33
34
void IndirectSettingsView::openHelp() {
  MantidQt::API::HelpWindow::showCustomInterface(nullptr,
35
                                                 QString("Indirect Settings"), QString("indirect"));
36
37
}

38
void IndirectSettingsView::setSelectedFacility(QString const &text) {
39
40
  auto const index = m_uiForm->cbFacility->findText(text);
  m_uiForm->cbFacility->setCurrentIndex(index != -1 ? index : 0);
41
42
43
}

QString IndirectSettingsView::getSelectedFacility() const {
44
  return m_uiForm->cbFacility->currentText();
45
46
47
}

void IndirectSettingsView::setRestrictInputByNameChecked(bool check) {
48
  m_uiForm->ckRestrictInputDataNames->setChecked(check);
49
50
51
}

bool IndirectSettingsView::isRestrictInputByNameChecked() const {
52
  return m_uiForm->ckRestrictInputDataNames->isChecked();
53
54
}

55
void IndirectSettingsView::setPlotErrorBarsChecked(bool check) {
56
  m_uiForm->ckPlotErrorBars->setChecked(check);
57
58
59
}

bool IndirectSettingsView::isPlotErrorBarsChecked() const {
60
  return m_uiForm->ckPlotErrorBars->isChecked();
61
62
}

63
void IndirectSettingsView::setApplyText(QString const &text) {
64
  m_uiForm->pbApply->setText(text);
65
66
67
}

void IndirectSettingsView::setApplyEnabled(bool enable) {
68
  m_uiForm->pbApply->setEnabled(enable);
69
70
71
}

void IndirectSettingsView::setOkEnabled(bool enable) {
72
  m_uiForm->pbOk->setEnabled(enable);
73
74
75
}

void IndirectSettingsView::setCancelEnabled(bool enable) {
76
  m_uiForm->pbCancel->setEnabled(enable);
77
78
79
80
}

} // namespace CustomInterfaces
} // namespace MantidQt