gsplash
Loading...
Searching...
No Matches
gsplash.h
Go to the documentation of this file.
1#pragma once
2
3// gemc
4#include "gbase.h"
5
6// Qt
7#include <QtWidgets>
8#include <QTimer>
9
10#define GSPLASHENVIRONMENT "GSPLASH"
11#define NOSPLASHIMAGESELECTED "NOSPLASHIMAGESELECTED"
12
13// exit codes: 190s
14#define ERR_NOSPLASHENVFOUND 191
15
21constexpr const char* GSPLASH_LOGGER = "gsplash";
22
27namespace gsplash {
28
42
43} // namespace gsplash
44
45
65class GSplash : public GBase<GSplash> {
66public:
81 static std::unique_ptr<GSplash>
82 create(const std::shared_ptr<GOptions>& gopts,
83 const std::string& imageName = "gemcArchitecture");
84
94 void message(const std::string& msg);
95
107 void messageAfter(int delay, const std::string& msg);
108
117 void finish(QWidget* callingWindow) const { if (splash != nullptr) { splash->finish(callingWindow); } }
118
119private:
129 GSplash(const std::shared_ptr<GOptions>& gopts,
130 const std::string& imageName);
131
137 std::unique_ptr<QSplashScreen> splash;
138
139};
Splash screen utility for GUI runs.
Definition gsplash.h:65
void finish(QWidget *callingWindow) const
Finishes the splash screen and returns focus to the calling window.
Definition gsplash.h:117
void message(const std::string &msg)
Displays a message on the splash screen immediately.
Definition gsplash.cc:67
static std::unique_ptr< GSplash > create(const std::shared_ptr< GOptions > &gopts, const std::string &imageName="gemcArchitecture")
Factory method for creating a GSplash instance.
Definition gsplash.cc:8
void messageAfter(int delay, const std::string &msg)
Displays a message on the splash screen after a delay.
Definition gsplash.cc:54
constexpr const char * GSPLASH_LOGGER
Default logger name used by this module.
Definition gsplash.h:21
Namespace utilities for the GSplash module.
Definition gsplash.h:27
GOptions defineOptions()
Defines the module options for GSplash.
Definition gsplash.h:41