diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-01-10 10:44:31 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-01-11 11:57:24 +0100 |
commit | e94dc6f63a05ab7744b720847c13bd0e2f674417 (patch) | |
tree | aaca480a3a2665a0e6eaa067cc61c5ce97225f34 /desktop/source | |
parent | d095a887a9b0cce81b4f828feed759b5d0b3ad3f (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/66076
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'desktop/source')
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.cxx | 29 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_dialog2.hxx | 13 |
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 { |