summaryrefslogtreecommitdiffstats
path: root/desktop/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-09-20 11:38:00 +0100
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>2019-10-08 11:44:58 +0200
commitcb5be6961e071ea2b9efd66cd62b98ffda5a058f (patch)
treec399e90c68ee028210eeecc87419e0ff06835e20 /desktop/source
parentmissing treeview model (diff)
downloadcore-cb5be6961e071ea2b9efd66cd62b98ffda5a058f.tar.gz
core-cb5be6961e071ea2b9efd66cd62b98ffda5a058f.zip
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/79283 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'desktop/source')
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.cxx58
-rw-r--r--desktop/source/deployment/gui/dp_gui_theextmgr.hxx3
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 65b4e1c0592c..0ee63dabc400 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);
@@ -424,7 +446,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);
@@ -450,7 +480,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();