Initial commit
This commit is contained in:
commit
b7d90b9afe
16245 files changed
+3396666
No files matched your search
+77
@@ -0,0 +1,77 @@
|
||||
/**
|
||||
* @RDE_HEADER@
|
||||
* Frameless Dialog, modal, exists exactly once per - a global/static wait dlg which counts for all compontens that are waiting for their operation to be done but don't want to own a progress dialog !
|
||||
* $Id$
|
||||
* $HeadURL$
|
||||
* $Author$
|
||||
*
|
||||
* Created by Mike Wille, SLSE, 2017-03-17
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "lts_widgets_export.h"
|
||||
|
||||
#include <QObject>
|
||||
|
||||
|
||||
class QTimer;
|
||||
class QWidget;
|
||||
|
||||
|
||||
namespace LtsWidgets
|
||||
{
|
||||
class LtsDialog;
|
||||
class LtsOverlayLoading;
|
||||
class LtsProgressDialogHelper;
|
||||
/**
|
||||
* @brief The LtsGlobalWaitDialog class is a global/static wait dlg which counts for all compontens that are waiting for their operation to be done but don't want to own a progress dialog !
|
||||
*/
|
||||
class LTSWIDGETS_EXPORT LtsGlobalWaitDialog : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
static LtsGlobalWaitDialog* getInstance();
|
||||
void wait(QWidget *parent, const QString &customText = QString()); // shows the Progress Dialog
|
||||
void wait(const QString &customText = QString()) { wait(nullptr, customText); }
|
||||
void done(); // hides the Progress Dialog IF all wait()s were canceled with done() !
|
||||
void setVisible(bool visible = true);
|
||||
void setCustomText(const QString &customText = QString()); // call with empty string to reset text to default text "waiting for server"
|
||||
void unarm(); // deactivate the global wait dialog from showing up (e.g. wait dialog should not be recorded while recording a script in the script editor)
|
||||
void rearm(); // undo the unarm (re-activate global wait dialog)
|
||||
|
||||
private:
|
||||
friend struct LtsGlobalWaitDialogHandler;
|
||||
|
||||
LtsGlobalWaitDialog();
|
||||
~LtsGlobalWaitDialog();
|
||||
static void cleanupGwdInstance();
|
||||
|
||||
void showIt();
|
||||
void hideIt();
|
||||
|
||||
int m_waitingCount;
|
||||
bool m_visible;
|
||||
bool m_armed { true };
|
||||
LtsProgressDialogHelper *m_progressDialog;
|
||||
QTimer *m_hideTimer;
|
||||
};
|
||||
|
||||
} // namespace LtsWidgets
|
||||
|
||||
|
||||
|
||||
// 'hyper-global' stuff into main namespace
|
||||
class LTSWIDGETS_EXPORT Waiter
|
||||
{
|
||||
public:
|
||||
explicit Waiter(const QString &customText = {});
|
||||
explicit Waiter(LtsWidgets::LtsDialog *parent, const QString &customText = {});
|
||||
~Waiter();
|
||||
|
||||
private:
|
||||
LtsWidgets::LtsOverlayLoading *m_loadingOverlay { nullptr };
|
||||
LtsWidgets::LtsDialog *m_parent { nullptr };
|
||||
bool m_oldClosableState { false };
|
||||
};
|
||||
Reference in new issue
Block a user