Kaydet (Commit) 18102201 authored tarafından Jennifer Liebel's avatar Jennifer Liebel Kaydeden (comit) Tobias Madl

changed some timer to idle

Change-Id: If137dbd80f7260d9507e48709d3f0f14b60a25f6
üst 93f5b9be
...@@ -709,14 +709,14 @@ ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager) ...@@ -709,14 +709,14 @@ ExtMgrDialog::ExtMgrDialog(vcl::Window *pParent, TheExtensionManager *pManager)
m_pUpdateBtn->Enable(false); m_pUpdateBtn->Enable(false);
m_aTimeoutTimer.SetTimeout( 500 ); // mSec m_aIdle.SetPriority(VCL_IDLE_PRIORITY_LOWEST);
m_aTimeoutTimer.SetTimeoutHdl( LINK( this, ExtMgrDialog, TimeOutHdl ) ); m_aIdle.SetIdleHdl( LINK( this, ExtMgrDialog, TimeOutHdl ) );
} }
ExtMgrDialog::~ExtMgrDialog() ExtMgrDialog::~ExtMgrDialog()
{ {
m_aTimeoutTimer.Stop(); m_aIdle.Stop();
} }
...@@ -951,7 +951,7 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface ) ...@@ -951,7 +951,7 @@ IMPL_LINK( ExtMgrDialog, startProgress, void*, _bLockInterface )
bool bLockInterface = (bool) _bLockInterface; bool bLockInterface = (bool) _bLockInterface;
if ( m_bStartProgress && !m_bHasProgress ) if ( m_bStartProgress && !m_bHasProgress )
m_aTimeoutTimer.Start(); m_aIdle.Start();
if ( m_bStopProgress ) if ( m_bStopProgress )
{ {
...@@ -1096,7 +1096,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, TimeOutHdl) ...@@ -1096,7 +1096,7 @@ IMPL_LINK_NOARG(ExtMgrDialog, TimeOutHdl)
if ( m_pProgressBar->IsVisible() ) if ( m_pProgressBar->IsVisible() )
m_pProgressBar->SetValue( (sal_uInt16) m_nProgress ); m_pProgressBar->SetValue( (sal_uInt16) m_nProgress );
m_aTimeoutTimer.Start(); m_aIdle.Start();
} }
return 1; return 1;
...@@ -1191,13 +1191,13 @@ UpdateRequiredDialog::UpdateRequiredDialog(vcl::Window *pParent, TheExtensionMan ...@@ -1191,13 +1191,13 @@ UpdateRequiredDialog::UpdateRequiredDialog(vcl::Window *pParent, TheExtensionMan
m_pUpdateBtn->Enable( false ); m_pUpdateBtn->Enable( false );
m_pCloseBtn->GrabFocus(); m_pCloseBtn->GrabFocus();
m_aTimeoutTimer.SetTimeout( 50 ); // mSec m_aIdle.SetPriority( VCL_IDLE_PRIORITY_MEDIUM );
m_aTimeoutTimer.SetTimeoutHdl( LINK( this, UpdateRequiredDialog, TimeOutHdl ) ); m_aIdle.SetIdleHdl( LINK( this, UpdateRequiredDialog, TimeOutHdl ) );
} }
UpdateRequiredDialog::~UpdateRequiredDialog() UpdateRequiredDialog::~UpdateRequiredDialog()
{ {
m_aTimeoutTimer.Stop(); m_aIdle.Stop();
} }
long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage, long UpdateRequiredDialog::addPackageToList( const uno::Reference< deployment::XPackage > &xPackage,
...@@ -1266,7 +1266,7 @@ IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface ) ...@@ -1266,7 +1266,7 @@ IMPL_LINK( UpdateRequiredDialog, startProgress, void*, _bLockInterface )
bool bLockInterface = (bool) _bLockInterface; bool bLockInterface = (bool) _bLockInterface;
if ( m_bStartProgress && !m_bHasProgress ) if ( m_bStartProgress && !m_bHasProgress )
m_aTimeoutTimer.Start(); m_aIdle.Start();
if ( m_bStopProgress ) if ( m_bStopProgress )
{ {
...@@ -1427,7 +1427,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, TimeOutHdl) ...@@ -1427,7 +1427,7 @@ IMPL_LINK_NOARG(UpdateRequiredDialog, TimeOutHdl)
if ( m_pProgressBar->IsVisible() ) if ( m_pProgressBar->IsVisible() )
m_pProgressBar->SetValue( (sal_uInt16) m_nProgress ); m_pProgressBar->SetValue( (sal_uInt16) m_nProgress );
m_aTimeoutTimer.Start(); m_aIdle.Start();
} }
return 1; return 1;
......
...@@ -121,7 +121,7 @@ class ExtMgrDialog : public ModelessDialog, ...@@ -121,7 +121,7 @@ class ExtMgrDialog : public ModelessDialog,
bool m_bDisableWarning; bool m_bDisableWarning;
bool m_bDeleteWarning; bool m_bDeleteWarning;
long m_nProgress; long m_nProgress;
Timer m_aTimeoutTimer; Idle m_aIdle;
TheExtensionManager *m_pManager; TheExtensionManager *m_pManager;
::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel; ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel;
...@@ -191,7 +191,7 @@ class UpdateRequiredDialog : public ModalDialog, ...@@ -191,7 +191,7 @@ class UpdateRequiredDialog : public ModalDialog,
bool m_bDisableWarning; bool m_bDisableWarning;
bool m_bHasLockedEntries; bool m_bHasLockedEntries;
long m_nProgress; long m_nProgress;
Timer m_aTimeoutTimer; Idle m_aIdle;
TheExtensionManager *m_pManager; TheExtensionManager *m_pManager;
::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel; ::com::sun::star::uno::Reference< ::com::sun::star::task::XAbortChannel > m_xAbortChannel;
......
...@@ -309,8 +309,8 @@ namespace framework ...@@ -309,8 +309,8 @@ namespace framework
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState; css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowState;
css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowStateSupplier; css::uno::Reference< ::com::sun::star::container::XNameAccess > m_xPersistentWindowStateSupplier;
GlobalSettings* m_pGlobalSettings; GlobalSettings* m_pGlobalSettings;
OUString m_aModuleIdentifier; OUString m_aModuleIdentifier;
Timer m_aAsyncLayoutTimer; Idle m_aAsyncLayoutIdle;
::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; // container for ALL Listener ::cppu::OMultiTypeInterfaceContainerHelper m_aListenerContainer; // container for ALL Listener
ToolbarLayoutManager* m_pToolbarManager; ToolbarLayoutManager* m_pToolbarManager;
css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener > m_xToolbarManager; css::uno::Reference< ::com::sun::star::ui::XUIConfigurationListener > m_xToolbarManager;
......
...@@ -208,7 +208,7 @@ class ToolBarManager : public ToolbarManager_Base ...@@ -208,7 +208,7 @@ class ToolBarManager : public ToolbarManager_Base
CommandToInfoMap m_aCommandMap; CommandToInfoMap m_aCommandMap;
SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap; SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap;
Timer m_aAsyncUpdateControllersTimer; Idle m_aAsyncUpdateControllersIdle;
OUString m_sIconTheme; OUString m_sIconTheme;
MenuDescriptionMap m_aMenuMap; MenuDescriptionMap m_aMenuMap;
bool m_bAcceleratorCfg; bool m_bAcceleratorCfg;
......
...@@ -144,8 +144,8 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : ...@@ -144,8 +144,8 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) :
Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) ); Application::AddEventListener( LINK( this, LayoutManager, SettingsChanged ) );
m_aAsyncLayoutTimer.SetTimeout( 50 ); m_aAsyncLayoutIdle.SetPriority( VCL_IDLE_PRIORITY_RESIZE );
m_aAsyncLayoutTimer.SetTimeoutHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) ); m_aAsyncLayoutIdle.SetIdleHdl( LINK( this, LayoutManager, AsyncLayoutHdl ) );
registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, css::beans::PropertyAttribute::TRANSIENT, &m_bAutomaticToolbars, ::getCppuType( &m_bAutomaticToolbars ) ); registerProperty( LAYOUTMANAGER_PROPNAME_AUTOMATICTOOLBARS, LAYOUTMANAGER_PROPHANDLE_AUTOMATICTOOLBARS, css::beans::PropertyAttribute::TRANSIENT, &m_bAutomaticToolbars, ::getCppuType( &m_bAutomaticToolbars ) );
registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, beans::PropertyAttribute::TRANSIENT, &m_bHideCurrentUI, ::getCppuType( &m_bHideCurrentUI ) ); registerProperty( LAYOUTMANAGER_PROPNAME_HIDECURRENTUI, LAYOUTMANAGER_PROPHANDLE_HIDECURRENTUI, beans::PropertyAttribute::TRANSIENT, &m_bHideCurrentUI, ::getCppuType( &m_bHideCurrentUI ) );
...@@ -158,7 +158,7 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) : ...@@ -158,7 +158,7 @@ LayoutManager::LayoutManager( const Reference< XComponentContext >& xContext ) :
LayoutManager::~LayoutManager() LayoutManager::~LayoutManager()
{ {
Application::RemoveEventListener( LINK( this, LayoutManager, SettingsChanged ) ); Application::RemoveEventListener( LINK( this, LayoutManager, SettingsChanged ) );
m_aAsyncLayoutTimer.Stop(); m_aAsyncLayoutIdle.Stop();
setDockingAreaAcceptor(NULL); setDockingAreaAcceptor(NULL);
delete m_pGlobalSettings; delete m_pGlobalSettings;
} }
...@@ -1256,7 +1256,7 @@ throw ( RuntimeException, std::exception ) ...@@ -1256,7 +1256,7 @@ throw ( RuntimeException, std::exception )
// IMPORTANT: Be sure to stop layout timer if don't have a docking area acceptor! // IMPORTANT: Be sure to stop layout timer if don't have a docking area acceptor!
if ( !xDockingAreaAcceptor.is() ) if ( !xDockingAreaAcceptor.is() )
m_aAsyncLayoutTimer.Stop(); m_aAsyncLayoutIdle.Stop();
bool bAutomaticToolbars( m_bAutomaticToolbars ); bool bAutomaticToolbars( m_bAutomaticToolbars );
std::vector< Reference< awt::XWindow > > oldDockingAreaWindows; std::vector< Reference< awt::XWindow > > oldDockingAreaWindows;
...@@ -1264,7 +1264,7 @@ throw ( RuntimeException, std::exception ) ...@@ -1264,7 +1264,7 @@ throw ( RuntimeException, std::exception )
ToolbarLayoutManager* pToolbarManager = m_pToolbarManager; ToolbarLayoutManager* pToolbarManager = m_pToolbarManager;
if ( !xDockingAreaAcceptor.is() ) if ( !xDockingAreaAcceptor.is() )
m_aAsyncLayoutTimer.Stop(); m_aAsyncLayoutIdle.Stop();
// Remove listener from old docking area acceptor // Remove listener from old docking area acceptor
if ( m_xDockingAreaAcceptor.is() ) if ( m_xDockingAreaAcceptor.is() )
...@@ -2265,7 +2265,7 @@ throw (RuntimeException, std::exception) ...@@ -2265,7 +2265,7 @@ throw (RuntimeException, std::exception)
SolarMutexClearableGuard aWriteLock; SolarMutexClearableGuard aWriteLock;
if ( bDoLayout ) if ( bDoLayout )
m_aAsyncLayoutTimer.Stop(); m_aAsyncLayoutIdle.Stop();
aWriteLock.clear(); aWriteLock.clear();
Any a( nLockCount ); Any a( nLockCount );
...@@ -2664,14 +2664,14 @@ throw( uno::RuntimeException, std::exception ) ...@@ -2664,14 +2664,14 @@ throw( uno::RuntimeException, std::exception )
// application modules need this. So we have to check if this is the first // application modules need this. So we have to check if this is the first
// call after the async layout time expired. // call after the async layout time expired.
m_bMustDoLayout = true; m_bMustDoLayout = true;
if ( !m_aAsyncLayoutTimer.IsActive() ) if ( !m_aAsyncLayoutIdle.IsActive() )
{ {
const Link& aLink = m_aAsyncLayoutTimer.GetTimeoutHdl(); const Link& aLink = m_aAsyncLayoutIdle.GetTimeoutHdl();
if ( aLink.IsSet() ) if ( aLink.IsSet() )
aLink.Call( &m_aAsyncLayoutTimer ); aLink.Call( &m_aAsyncLayoutIdle );
} }
if ( m_nLockCount == 0 ) if ( m_nLockCount == 0 )
m_aAsyncLayoutTimer.Start(); m_aAsyncLayoutIdle.Start();
} }
else if ( m_xFrame.is() && aEvent.Source == m_xFrame->getContainerWindow() ) else if ( m_xFrame.is() && aEvent.Source == m_xFrame->getContainerWindow() )
{ {
...@@ -2741,7 +2741,7 @@ void SAL_CALL LayoutManager::windowHidden( const lang::EventObject& aEvent ) thr ...@@ -2741,7 +2741,7 @@ void SAL_CALL LayoutManager::windowHidden( const lang::EventObject& aEvent ) thr
IMPL_LINK_NOARG(LayoutManager, AsyncLayoutHdl) IMPL_LINK_NOARG(LayoutManager, AsyncLayoutHdl)
{ {
SolarMutexClearableGuard aReadLock; SolarMutexClearableGuard aReadLock;
m_aAsyncLayoutTimer.Stop(); m_aAsyncLayoutIdle.Stop();
if( !m_xContainerWindow.is() ) if( !m_xContainerWindow.is() )
return 0; return 0;
......
...@@ -235,8 +235,8 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext, ...@@ -235,8 +235,8 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext,
aHelpIdAsString += OUStringToOString( aToolbarName, RTL_TEXTENCODING_UTF8 );; aHelpIdAsString += OUStringToOString( aToolbarName, RTL_TEXTENCODING_UTF8 );;
m_pToolBar->SetHelpId( aHelpIdAsString ); m_pToolBar->SetHelpId( aHelpIdAsString );
m_aAsyncUpdateControllersTimer.SetTimeout( 50 ); m_aAsyncUpdateControllersIdle.SetPriority( VCL_IDLE_PRIORITY_MEDIUM );
m_aAsyncUpdateControllersTimer.SetTimeoutHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) ); m_aAsyncUpdateControllersIdle.SetIdleHdl( LINK( this, ToolBarManager, AsyncUpdateControllersHdl ) );
SvtMiscOptions().AddListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) ); SvtMiscOptions().AddListenerLink( LINK( this, ToolBarManager, MiscOptionsChanged ) );
} }
...@@ -476,9 +476,7 @@ throw ( RuntimeException, std::exception ) ...@@ -476,9 +476,7 @@ throw ( RuntimeException, std::exception )
{ {
SolarMutexGuard g; SolarMutexGuard g;
if ( Action.Action == FrameAction_CONTEXT_CHANGED ) if ( Action.Action == FrameAction_CONTEXT_CHANGED )
{ m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
} }
void SAL_CALL ToolBarManager::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event ) void SAL_CALL ToolBarManager::statusChanged( const ::com::sun::star::frame::FeatureStateEvent& Event )
...@@ -1416,9 +1414,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine ...@@ -1416,9 +1414,7 @@ void ToolBarManager::FillToolbar( const Reference< XIndexAccess >& rItemContaine
if( m_pToolBar->WillUsePopupMode() ) if( m_pToolBar->WillUsePopupMode() )
UpdateControllers(); UpdateControllers();
else if ( m_pToolBar->IsReallyVisible() ) else if ( m_pToolBar->IsReallyVisible() )
{ m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
// Try to retrieve UIName from the container property set and set it as the title // Try to retrieve UIName from the container property set and set it as the title
// if it is not empty. // if it is not empty.
...@@ -2052,13 +2048,11 @@ IMPL_LINK( ToolBarManager, StateChanged, StateChangedType*, pStateChangedType ) ...@@ -2052,13 +2048,11 @@ IMPL_LINK( ToolBarManager, StateChanged, StateChangedType*, pStateChangedType )
else if ( *pStateChangedType == StateChangedType::VISIBLE ) else if ( *pStateChangedType == StateChangedType::VISIBLE )
{ {
if ( m_pToolBar->IsReallyVisible() ) if ( m_pToolBar->IsReallyVisible() )
{ m_aAsyncUpdateControllersIdle.Start();
m_aAsyncUpdateControllersTimer.Start();
}
} }
else if ( *pStateChangedType == StateChangedType::INITSHOW ) else if ( *pStateChangedType == StateChangedType::INITSHOW )
{ {
m_aAsyncUpdateControllersTimer.Start(); m_aAsyncUpdateControllersIdle.Start();
} }
return 1; return 1;
} }
...@@ -2113,7 +2107,7 @@ IMPL_LINK_NOARG(ToolBarManager, AsyncUpdateControllersHdl) ...@@ -2113,7 +2107,7 @@ IMPL_LINK_NOARG(ToolBarManager, AsyncUpdateControllersHdl)
return 1; return 1;
// Request to update our controllers // Request to update our controllers
m_aAsyncUpdateControllersTimer.Stop(); m_aAsyncUpdateControllersIdle.Stop();
UpdateControllers(); UpdateControllers();
return 0; return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment