summaryrefslogtreecommitdiff
path: root/desktop/source
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx29
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx13
2 files changed, 8 insertions, 34 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 28bfeee06b53..46649607e212 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -340,7 +340,6 @@ DialogHelper::DialogHelper(const uno::Reference< uno::XComponentContext > &xCont
Dialog *pWindow)
: m_xVCLWindow(pWindow)
, m_nEventID(nullptr)
- , m_nBusy(0)
{
m_xContext = xContext;
}
@@ -462,34 +461,6 @@ void DialogHelper::PostUserEvent( const Link<void*,void>& rLink, void* pCaller )
m_nEventID = Application::PostUserEvent( rLink, pCaller, true/*bReferenceLink*/ );
}
-void DialogHelper::incBusy()
-{
- ++m_nBusy;
- // lock any toplevel windows from being closed until busy is over
- // ensure any dialogs are reset before entering
- vcl::Window *xTopWin = Application::GetFirstTopLevelWindow();
- while (xTopWin)
- {
- if (xTopWin != m_xVCLWindow)
- xTopWin->IncModalCount();
- xTopWin = Application::GetNextTopLevelWindow(xTopWin);
- }
-}
-
-void DialogHelper::decBusy()
-{
- --m_nBusy;
- // unlock any toplevel windows from being closed until busy is over
- // ensure any dialogs are reset before entering
- vcl::Window *xTopWin = Application::GetFirstTopLevelWindow();
- while (xTopWin)
- {
- if (xTopWin != m_xVCLWindow)
- xTopWin->DecModalCount();
- xTopWin = Application::GetNextTopLevelWindow(xTopWin);
- }
-}
-
// ExtMgrDialog
ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager, Dialog::InitFlag eFlag)
: ModelessDialog(pParent, "ExtensionManagerDialog", "desktop/ui/extensionmanager.ui", eFlag)
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index dd0dc8bb8160..a2d88c0f458e 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -29,6 +29,7 @@
#include <vcl/prgsbar.hxx>
#include <vcl/timer.hxx>
#include <vcl/idle.hxx>
+#include <vcl/waitobj.hxx>
#include <vcl/weld.hxx>
#include <svtools/svmedit.hxx>
@@ -47,6 +48,9 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/util/XModifyListener.hpp>
+#include <stack>
+#include <vector>
+
namespace dp_gui {
@@ -60,7 +64,7 @@ class DialogHelper
css::uno::Reference< css::uno::XComponentContext > m_xContext;
VclPtr<Dialog> m_xVCLWindow;
ImplSVEvent * m_nEventID;
- int m_nBusy;
+ TopLevelWindowLocker m_aBusy;
public:
DialogHelper( const css::uno::Reference< css::uno::XComponentContext > &,
@@ -91,14 +95,13 @@ public:
const char* pResID,
bool &bHadWarning );
- void incBusy();
- void decBusy();
- bool isBusy() const { return m_nBusy > 0; }
+ void incBusy() { m_aBusy.incBusy(m_xVCLWindow); }
+ void decBusy() { m_aBusy.decBusy(); }
+ bool isBusy() const { return m_aBusy.isBusy(); }
bool installExtensionWarn(const OUString &rExtensionURL);
bool installForAllUsers(bool &bInstallForAll);
};
-
class ExtMgrDialog : public ModelessDialog,
public DialogHelper
{