diff options
author | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-11-11 08:21:19 +0000 |
---|---|---|
committer | Tobias Madl <tobias.madl.dev@gmail.com> | 2014-12-09 12:34:54 +0000 |
commit | f62c45f3aff7b5ee1438e0d2c5d975ecc06c6950 (patch) | |
tree | f2fded8ff42dad7296f64acb96895d254957d2ab | |
parent | 9d5db8287b69ee74b0a4182740969e1372ec8f10 (diff) |
changed timers to Idle
Change-Id: Ic7e795702618d1c623a2deeba1a86f804a249508
-rw-r--r-- | sc/source/ui/inc/tphfedit.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/pagedlg/tphfedit.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/doc/DocumentTimerManager.cxx | 16 | ||||
-rw-r--r-- | sw/source/core/inc/DocumentTimerManager.hxx | 2 |
4 files changed, 18 insertions, 18 deletions
diff --git a/sc/source/ui/inc/tphfedit.hxx b/sc/source/ui/inc/tphfedit.hxx index d304ebd68f97..500e62d68c73 100644 --- a/sc/source/ui/inc/tphfedit.hxx +++ b/sc/source/ui/inc/tphfedit.hxx @@ -100,7 +100,7 @@ class SC_DLLPUBLIC ScExtIButton : public ImageButton { private: - Timer aTimer; + Idle aIdle; PopupMenu* pPopupMenu; Link aMLink; sal_uInt16 nSelected; diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 1fca515a8c79..f3a0f96266d8 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -331,7 +331,7 @@ ScExtIButton::ScExtIButton(vcl::Window* pParent, WinBits nBits ) : ImageButton(pParent,nBits), pPopupMenu(NULL) { nSelected=0; - aTimer.SetTimeout(600); + aIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST); SetDropDown(PUSHBUTTON_DROPDOWN_TOOLBOX); } @@ -347,10 +347,10 @@ void ScExtIButton::SetPopupMenu(PopupMenu* pPopUp) void ScExtIButton::MouseButtonDown( const MouseEvent& rMEvt ) { - if(!aTimer.IsActive()) + if(!aIdle.IsActive()) { - aTimer.Start(); - aTimer.SetTimeoutHdl(LINK( this, ScExtIButton, TimerHdl)); + aIdle.SetIdleHdl(LINK( this, ScExtIButton, TimerHdl)); + aIdle.Start(); } ImageButton::MouseButtonDown(rMEvt ); @@ -358,15 +358,15 @@ void ScExtIButton::MouseButtonDown( const MouseEvent& rMEvt ) void ScExtIButton::MouseButtonUp( const MouseEvent& rMEvt) { - aTimer.Stop(); - aTimer.SetTimeoutHdl(Link()); + aIdle.Stop(); + aIdle.SetIdleHdl(Link()); ImageButton::MouseButtonUp(rMEvt ); } void ScExtIButton::Click() { - aTimer.Stop(); - aTimer.SetTimeoutHdl(Link()); + aIdle.Stop(); + aIdle.SetIdleHdl(Link()); ImageButton::Click(); } diff --git a/sw/source/core/doc/DocumentTimerManager.cxx b/sw/source/core/doc/DocumentTimerManager.cxx index 0e90c8c6e2a9..5c97d2c60c46 100644 --- a/sw/source/core/doc/DocumentTimerManager.cxx +++ b/sw/source/core/doc/DocumentTimerManager.cxx @@ -42,39 +42,39 @@ DocumentTimerManager::DocumentTimerManager( SwDoc& i_rSwdoc ) : m_rDoc( i_rSwdoc mbStartIdleTimer( false ), mIdleBlockCount( 0 ) { - maIdleTimer.SetTimeout( 600 ); - maIdleTimer.SetTimeoutHdl( LINK( this, DocumentTimerManager, DoIdleJobs) ); + maIdle.SetPriority( VCL_IDLE_PRIORITY_LOWEST ); + maIdle.SetIdleHdl( LINK( this, DocumentTimerManager, DoIdleJobs) ); } void DocumentTimerManager::StartIdling() { mbStartIdleTimer = true; if( !mIdleBlockCount ) - maIdleTimer.Start(); + maIdle.Start(); } void DocumentTimerManager::StopIdling() { mbStartIdleTimer = false; - maIdleTimer.Stop(); + maIdle.Stop(); } void DocumentTimerManager::BlockIdling() { - maIdleTimer.Stop(); + maIdle.Stop(); ++mIdleBlockCount; } void DocumentTimerManager::UnblockIdling() { --mIdleBlockCount; - if( !mIdleBlockCount && mbStartIdleTimer && !maIdleTimer.IsActive() ) - maIdleTimer.Start(); + if( !mIdleBlockCount && mbStartIdleTimer && !maIdle.IsActive() ) + maIdle.Start(); } void DocumentTimerManager::StartBackgroundJobs() { // Trigger DoIdleJobs(), asynchronously. - maIdleTimer.Start(); + maIdle.Start(); } IMPL_LINK( DocumentTimerManager, DoIdleJobs, Timer *, pTimer ) diff --git a/sw/source/core/inc/DocumentTimerManager.hxx b/sw/source/core/inc/DocumentTimerManager.hxx index b591b70f094e..878c39b20751 100644 --- a/sw/source/core/inc/DocumentTimerManager.hxx +++ b/sw/source/core/inc/DocumentTimerManager.hxx @@ -60,7 +60,7 @@ private: bool mbStartIdleTimer; //< idle timer mode start/stop sal_Int32 mIdleBlockCount; - Timer maIdleTimer; + Idle maIdle; }; } |