summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-01-10 10:44:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-01-11 14:09:25 +0100
commit71fad56863301f47f19fdd47ab93099ad098474e (patch)
tree6b55287b924215cec427b43046b15547c24b2e0d /desktop
parentd8d148c96d7cdd96948240ac30b3aeacfb5aa7ca (diff)
Resolves: tdf#122404 unlock just the toplevels that were locked
push what toplevels got locked to just unlock those ones. otherwise the just dismissed toplevel may still be present in the Application toplevel list. merge all the similar examples of this. Change-Id: I77c0d55d1e4b3bcc3b8d88fef00ba289edd1e831 Reviewed-on: https://gerrit.libreoffice.org/66080 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'desktop')
-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 fc0f955f2afd..4fa481a6272b 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -339,7 +339,6 @@ DialogHelper::DialogHelper(const uno::Reference< uno::XComponentContext > &xCont
Dialog *pWindow)
: m_xVCLWindow(pWindow)
, m_nEventID(nullptr)
- , m_nBusy(0)
{
m_xContext = xContext;
}
@@ -461,34 +460,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
{