diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-20 11:38:00 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-09-20 15:06:55 +0200 |
commit | 5110beb7f0821b7c63f9947a6df7256da559b6c9 (patch) | |
tree | 15ca37bd1eb25e23500ef4ed080736887b82cc56 /desktop | |
parent | 9bfaf79db2f0207192fac32a46fbd657c860b04d (diff) |
Related: tdf#127645 update dialog has a slave extension dialog
when the update dialog is shown, the extension dialog was created but not
executed, so there isn't a dialog execution context to end, just the unexecuted
dialog to "close"
Change-Id: If4b522ca5f880d3ece8403b5350c846bd14a2992
Reviewed-on: https://gerrit.libreoffice.org/79281
Tested-by: Jenkins
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_theextmgr.cxx | 58 | ||||
-rw-r--r-- | desktop/source/deployment/gui/dp_gui_theextmgr.hxx | 3 |
2 files changed, 50 insertions, 11 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx index 0b6ab74848ad..9498f6fec7a9 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx @@ -59,7 +59,8 @@ TheExtensionManager::TheExtensionManager( const uno::Reference< awt::XWindow > & const uno::Reference< uno::XComponentContext > &xContext ) : m_xContext( xContext ), m_xParent( xParent ), - m_bModified(false) + m_bModified(false), + m_bExtMgrDialogExecuting(false) { m_xExtensionManager = deployment::ExtensionManager::get( xContext ); m_xExtensionManager->addModifyListener( this ); @@ -106,7 +107,15 @@ TheExtensionManager::~TheExtensionManager() m_xUpdReqDialog->response(RET_CANCEL); assert(!m_xUpdReqDialog); if (m_xExtMgrDialog) - m_xExtMgrDialog->response(RET_CANCEL); + { + if (m_bExtMgrDialogExecuting) + m_xExtMgrDialog->response(RET_CANCEL); + else + { + m_xExtMgrDialog->Close(); + m_xExtMgrDialog.reset(); + } + } assert(!m_xExtMgrDialog); } @@ -136,7 +145,10 @@ void TheExtensionManager::Show() { const SolarMutexGuard guard; + m_bExtMgrDialogExecuting = true; + weld::DialogController::runAsync(m_xExtMgrDialog, [this](sal_Int32 /*nResult*/) { + m_bExtMgrDialogExecuting = false; auto xExtMgrDialog = m_xExtMgrDialog; m_xExtMgrDialog.reset(); xExtMgrDialog->Close(); @@ -158,17 +170,19 @@ void TheExtensionManager::ToTop() getDialog()->present(); } - -bool TheExtensionManager::Close() +void TheExtensionManager::Close() { if (m_xExtMgrDialog) - m_xExtMgrDialog->response(RET_CANCEL); + { + if (m_bExtMgrDialogExecuting) + m_xExtMgrDialog->response(RET_CANCEL); + else + m_xExtMgrDialog->Close(); + } else if (m_xUpdReqDialog) m_xUpdReqDialog->response(RET_CANCEL); - return true; } - sal_Int16 TheExtensionManager::execute() { sal_Int16 nRet = 0; @@ -255,7 +269,15 @@ void TheExtensionManager::terminateDialog() { const SolarMutexGuard guard; if (m_xExtMgrDialog) - m_xExtMgrDialog->response(RET_CANCEL); + { + if (m_bExtMgrDialogExecuting) + m_xExtMgrDialog->response(RET_CANCEL); + else + { + m_xExtMgrDialog->Close(); + m_xExtMgrDialog.reset(); + } + } assert(!m_xExtMgrDialog); if (m_xUpdReqDialog) m_xUpdReqDialog->response(RET_CANCEL); @@ -423,7 +445,15 @@ void TheExtensionManager::disposing( lang::EventObject const & rEvt ) { const SolarMutexGuard guard; if (m_xExtMgrDialog) - m_xExtMgrDialog->response(RET_CANCEL); + { + if (m_bExtMgrDialogExecuting) + m_xExtMgrDialog->response(RET_CANCEL); + else + { + m_xExtMgrDialog->Close(); + m_xExtMgrDialog.reset(); + } + } assert(!m_xExtMgrDialog); if (m_xUpdReqDialog) m_xUpdReqDialog->response(RET_CANCEL); @@ -449,7 +479,15 @@ void TheExtensionManager::queryTermination( ::lang::EventObject const & ) { clearModified(); if (m_xExtMgrDialog) - m_xExtMgrDialog->response(RET_CANCEL); + { + if (m_bExtMgrDialogExecuting) + m_xExtMgrDialog->response(RET_CANCEL); + else + { + m_xExtMgrDialog->Close(); + m_xExtMgrDialog.reset(); + } + } if (m_xUpdReqDialog) m_xUpdReqDialog->response(RET_CANCEL); } diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx index c75ec34872b0..db862a5f388d 100644 --- a/desktop/source/deployment/gui/dp_gui_theextmgr.hxx +++ b/desktop/source/deployment/gui/dp_gui_theextmgr.hxx @@ -57,6 +57,7 @@ private: OUString m_sGetExtensionsURL; bool m_bModified; + bool m_bExtMgrDialogExecuting; public: static ::rtl::Reference<TheExtensionManager> s_ExtMgr; @@ -90,7 +91,7 @@ public: void SetText( const OUString &rTitle ); void Show(); void ToTop(); - bool Close(); + void Close(); bool isVisible(); |