Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 5bf8aee

Browse files
committed
Public method to request opening of Progress Dialog
1 parent 3a7d25f commit 5bf8aee

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
lines changed

Libs/libActivities/Manager.cpp

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,4 +337,20 @@ namespace Activities
337337
return result;
338338
}
339339

340+
void Manager::requestProgressDialog()
341+
{
342+
bool requireModal;
343+
344+
{
345+
std::unique_lock<std::mutex> lock(ManagerData::getLock());
346+
ManagerData* d = ManagerData::instance();
347+
348+
// this ought to be false, if this method is used correctly. But timing could interfere
349+
// here.
350+
requireModal = d->isModalityRequired();
351+
}
352+
353+
emit showProgressDialog(requireModal);
354+
}
355+
340356
}

Libs/libActivities/Manager.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ namespace Activities
5656
Activity createActivity(const QString& display);
5757

5858
public:
59+
void requestProgressDialog();
5960
Activity::Vector activities() const;
6061

6162
signals:

Libs/libActivities/ManagerPrivate.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ namespace Activities
103103
static quint32 nextGeneration();
104104

105105
public:
106+
bool isModalityRequired() const;
106107
Activity newActivity(const QString &display);
107108

108109
public:
@@ -121,7 +122,6 @@ namespace Activities
121122
private:
122123
bool maybeStartEventSending();
123124
void updateGlobalState();
124-
bool isModalityRequired() const;
125125

126126
public:
127127
Manager* mOwner;

0 commit comments

Comments
 (0)