summaryrefslogtreecommitdiffstats
path: root/desktop
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2017-08-07 21:10:11 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2017-09-06 15:02:29 +0200
commitbc3e0121b47cc601575b0a49f6ba4959130cf96e (patch)
tree473949739a148f8bdcce05fd1e6f1a17e7b078ab /desktop
parenttdf#106867: Import target for commands in PPTX. (diff)
downloadcore-bc3e0121b47cc601575b0a49f6ba4959130cf96e.tar.gz
core-bc3e0121b47cc601575b0a49f6ba4959130cf96e.zip
Don't poll the extension install progress bar
Just start the Idle, if actually something changed. Quite probably we shouldn't rely on an Idle at all, but this fixes the busy loop while installing an extension waiting in a confirmation dialog. Change-Id: I3abbe2eb6651ce9320ef6e4d9c5251a23ab87216
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.cxx28
-rw-r--r--desktop/source/deployment/gui/dp_gui_dialog2.hxx4
2 files changed, 20 insertions, 12 deletions
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
index 80a46523557b..8b311528e7ce 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx
@@ -519,6 +519,7 @@ ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager,
}
m_aIdle.SetPriority(TaskPriority::LOWEST);
+ m_aIdle.SetDebugName( "ExtMgrDialog m_aIdle TimeOutHdl" );
m_aIdle.SetInvokeHandler( LINK( this, ExtMgrDialog, TimeOutHdl ) );
}
@@ -855,14 +856,18 @@ void ExtMgrDialog::showProgress( bool _bStart )
}
DialogHelper::PostUserEvent( LINK( this, ExtMgrDialog, startProgress ), reinterpret_cast<void*>(bStart) );
+ m_aIdle.Start();
}
void ExtMgrDialog::updateProgress( const long nProgress )
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- m_nProgress = nProgress;
+ if ( m_nProgress != nProgress )
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_nProgress = nProgress;
+ m_aIdle.Start();
+ }
}
@@ -874,6 +879,7 @@ void ExtMgrDialog::updateProgress( const OUString &rText,
m_xAbortChannel = xAbortChannel;
m_sProgressText = rText;
m_bProgressChanged = true;
+ m_aIdle.Start();
}
@@ -991,8 +997,6 @@ IMPL_LINK_NOARG(ExtMgrDialog, TimeOutHdl, Timer *, void)
if ( m_pProgressBar->IsVisible() )
m_pProgressBar->SetValue( (sal_uInt16) m_nProgress );
-
- m_aIdle.Start();
}
}
@@ -1079,6 +1083,7 @@ UpdateRequiredDialog::UpdateRequiredDialog(vcl::Window *pParent, TheExtensionMan
m_pCloseBtn->GrabFocus();
m_aIdle.SetPriority( TaskPriority::LOWEST );
+ m_aIdle.SetDebugName( "UpdateRequiredDialog m_aIdle TimeOutHdl" );
m_aIdle.SetInvokeHandler( LINK( this, UpdateRequiredDialog, TimeOutHdl ) );
}
@@ -1195,14 +1200,18 @@ void UpdateRequiredDialog::showProgress( bool _bStart )
}
DialogHelper::PostUserEvent( LINK( this, UpdateRequiredDialog, startProgress ), reinterpret_cast<void*>(bStart) );
+ m_aIdle.Start();
}
void UpdateRequiredDialog::updateProgress( const long nProgress )
{
- ::osl::MutexGuard aGuard( m_aMutex );
-
- m_nProgress = nProgress;
+ if ( m_nProgress != nProgress )
+ {
+ ::osl::MutexGuard aGuard( m_aMutex );
+ m_nProgress = nProgress;
+ m_aIdle.Start();
+ }
}
@@ -1214,6 +1223,7 @@ void UpdateRequiredDialog::updateProgress( const OUString &rText,
m_xAbortChannel = xAbortChannel;
m_sProgressText = rText;
m_bProgressChanged = true;
+ m_aIdle.Start();
}
@@ -1301,8 +1311,6 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, TimeOutHdl, Timer *, void)
if ( m_pProgressBar->IsVisible() )
m_pProgressBar->SetValue( (sal_uInt16) m_nProgress );
-
- m_aIdle.Start();
}
}
diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
index 60a87d75b6e5..cf4f423b83f7 100644
--- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx
+++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx
@@ -141,7 +141,7 @@ class ExtMgrDialog : public ModelessDialog,
DECL_LINK( HandleCancelBtn, Button*, void );
DECL_LINK( HandleCloseBtn, Button*, void );
DECL_LINK( HandleExtTypeCbx, Button*, void );
- DECL_LINK(TimeOutHdl, Timer *, void);
+ DECL_LINK( TimeOutHdl, Timer *, void );
DECL_LINK( startProgress, void *, void );
DECL_STATIC_LINK( ExtMgrDialog, Restart, void *, void );
@@ -214,7 +214,7 @@ class UpdateRequiredDialog : public ModalDialog,
DECL_LINK( HandleUpdateBtn, Button*, void );
DECL_LINK( HandleCloseBtn, Button*, void );
DECL_LINK( HandleCancelBtn, Button*, void );
- DECL_LINK(TimeOutHdl, Timer *, void);
+ DECL_LINK( TimeOutHdl, Timer *, void );
DECL_LINK( startProgress, void *, void );
static bool isEnabled( const css::uno::Reference< css::deployment::XPackage > &xPackage );