Mantid
Loading...
Searching...
No Matches
NotificationService.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2019 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#include "DllOption.h"
10#include <QObject>
11#include <QSystemTrayIcon>
12
13// namespace Mantid
14namespace Mantid {
15namespace Kernel {
16// forward declaration
17class Timer;
18} // namespace Kernel
19} // namespace Mantid
20
24namespace MantidQt {
25namespace MantidWidgets {
31 Q_OBJECT
32
33public:
34 // Our Notification icons are the same as Qt's.
35 using MessageIcon = QSystemTrayIcon::MessageIcon;
36
38 NotificationService() : QObject() {}
39
41 static void showMessage(const QString &title, const QString &message, MessageIcon icon = MessageIcon::Information,
42 int millisecondsTimeoutHint = 5000);
43
45 static bool isEnabled();
46
47 static const std::string NOTIFICATIONS_ENABLED_KEY;
49
51 static bool isSupportedByOS();
52
53private:
54 static QString g_lastMessage;
55 static QString g_lastTitle;
57};
58} // namespace MantidWidgets
59} // namespace MantidQt
#define EXPORT_OPT_MANTIDQT_COMMON
Definition: DllOption.h:15
This is a singleton providing a notification service for the Mantid Qt based applications.
A simple class that provides a wall-clock (not processor time) timer.
Definition: Timer.h:27
The AlgorithmProgressDialogPresenter keeps track of the running algorithms and displays a progress ba...
Helper class which provides the Collimation Length for SANS instruments.