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

9
#include "MantidQtWidgets/Common/HelpWindow.h"
10
#include "MantidQtWidgets/Common/InterfaceManager.h"
11
12
13

using namespace MantidQt::API;

14
15
16
17
namespace MantidQt {
namespace CustomInterfaces {

IndirectInterface::IndirectInterface(QWidget *parent)
18
    : UserSubWindow(parent),
19
20
      m_settings(dynamic_cast<IndirectSettings *>(
          InterfaceManager().createSubWindow("Settings"))) {
21
22
23
24
25
26
27
28
29
30
31
32
33

  connect(m_settings.get(), SIGNAL(applySettings()), this,
          SLOT(applySettings()));
}

void IndirectInterface::help() {
  HelpWindow::showCustomInterface(nullptr,
                                  QString::fromStdString(documentationPage()));
}

void IndirectInterface::settings() {
  m_settings->loadSettings();
  m_settings->show();
34
  m_settings->setFocus();
35
  m_settings->setWindowModality(Qt::ApplicationModal);
36
37
38
39
40
41
42
}

void IndirectInterface::applySettings() {
  applySettings(getInterfaceSettings());
}

void IndirectInterface::applySettings(
Robert Applin's avatar
Robert Applin committed
43
    std::map<std::string, QVariant> const &settings) {
44
45
46
47
48
49
50
51
52
  UNUSED_ARG(settings);
}

std::map<std::string, QVariant>
IndirectInterface::getInterfaceSettings() const {
  return m_settings->getSettings();
}

void IndirectInterface::manageUserDirectories() {
53
54
55
56
57
  if (!m_manageUserDirectories) {
    m_manageUserDirectories = std::make_unique<ManageUserDirectories>(this);
    m_manageUserDirectories->setAttribute(Qt::WA_DeleteOnClose, false);
  }
  m_manageUserDirectories->setModal(true);
Robert Applin's avatar
Robert Applin committed
58
  m_manageUserDirectories->show();
59
60
61
62
63
}

void IndirectInterface::showMessageBox(QString const &message) {
  showInformationBox(message);
}
64
65
66

} // namespace CustomInterfaces
} // namespace MantidQt