Mantid
Loading...
Searching...
No Matches
Message.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
9//----------------------------------
10// Includes
11//----------------------------------
12#include "DllOption.h"
13#include "MantidKernel/Logger.h" // So we can match the Logger priority
14
15#include <QMetaType>
16#include <QObject>
17#include <QString>
18
19//----------------------------------------------------------
20// Forward declarations
21//----------------------------------------------------------
22
23namespace MantidQt {
24namespace MantidWidgets {
28class EXPORT_OPT_MANTIDQT_COMMON Message : public QObject {
29 // No Q_Object macro by design
30
31public:
34
36 Message();
38 Message(QString text, Priority priority = Priority::PRIO_NOTICE, const QString &scriptPath = "");
41 Message(const std::string &text, Priority priority = Priority::PRIO_NOTICE, const QString &scriptPath = "");
44 Message(const char *text, Priority priority = Priority::PRIO_NOTICE, const QString &scriptPath = "");
46 Message(const Message &msg);
48 Message &operator=(const Message &msg);
49
50public:
52 inline QString text() const { return m_text; }
54 inline Priority priority() const { return m_priority; }
56 inline QString scriptPath() const { return m_scriptPath; }
58 void setScriptPath(const QString &scriptPath) { m_scriptPath = scriptPath; }
59
60private:
61 QString m_text;
63 QString m_scriptPath;
64};
65} // namespace MantidWidgets
66} // namespace MantidQt
67
69Q_DECLARE_METATYPE(MantidQt::MantidWidgets::Message)
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
Provides a simple binding of a text message with a priority.
Definition: Message.h:28
Mantid::Kernel::Logger::Priority Priority
Priority matches Mantid Logger priority.
Definition: Message.h:33
void setScriptPath(const QString &scriptPath)
Set the script name. This is useful if a script is renamed.
Definition: Message.h:58
Priority priority() const
Definition: Message.h:54
QString scriptPath() const
Definition: Message.h:56
Poco::Message::Priority Priority
Definition: Logger.h:55
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...