Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
// Mantid Repository : https://github.com/mantidproject/mantid
//
// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
// NScD Oak Ridge National Laboratory, European Spallation Source
// & Institut Laue - Langevin
// SPDX - License - Identifier: GPL - 3.0 +
#include "ItemState.h"
namespace MantidQt {
namespace CustomInterfaces {
ItemState::ItemState() : m_state(State::NOT_STARTED), m_message(boost::none) {}
std::string ItemState::message() const {
if (m_message)
return m_message.get();
return "";
}
void ItemState::setProgress(double progress, std::string const &message) {
m_progress = progress;
m_message = message;
}
void ItemState::setStarting() { m_state = State::STARTING; }
void ItemState::setRunning() { m_state = State::RUNNING; }
void ItemState::setSuccess() { m_state = State::SUCCESS; }
void ItemState::setWarning(std::string const &message) {
m_state = State::WARNING;
m_message = message;
}
void ItemState::setError(std::string const &message) {
m_state = State::ERROR;
m_message = message;
}
} // namespace CustomInterfaces
} // namespace MantidQt