diff options
author | Tobias Lippert <drtl@fastmail.fm> | 2014-02-09 00:53:28 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-21 17:23:50 +0000 |
commit | 076a7eacca48f203f0a8b9aa537e88fea9a88409 (patch) | |
tree | cd95446ac0b80b29658fa2a44030dacb5304a63d /framework | |
parent | 1ec263e25d8606c70ac2089d5ceea22750d25daf (diff) |
Bug #63962 Dynamically scan the config directory for icon themes
The hard-coded icon themes have been replaced by a dynamic list
which is filled by scanning the config directory
Conflicts:
include/vcl/settings.hxx
vcl/source/app/settings.cxx
vcl/source/window/window.cxx
Change-Id: Ie3680ffe27d06e375acf22753e036cb6ddabc4ed
Reviewed-on: https://gerrit.libreoffice.org/7935
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/uielement/menubarmanager.hxx | 2 | ||||
-rw-r--r-- | framework/inc/uielement/toolbarmanager.hxx | 2 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.cxx | 9 | ||||
-rw-r--r-- | framework/source/uiconfiguration/imagemanagerimpl.hxx | 2 | ||||
-rw-r--r-- | framework/source/uielement/menubarmanager.cxx | 12 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 12 |
6 files changed, 20 insertions, 19 deletions
diff --git a/framework/inc/uielement/menubarmanager.hxx b/framework/inc/uielement/menubarmanager.hxx index ce61dda63f7c..88ef560c91fd 100644 --- a/framework/inc/uielement/menubarmanager.hxx +++ b/framework/inc/uielement/menubarmanager.hxx @@ -246,7 +246,7 @@ class MenuBarManager : public com::sun::star::frame::XStatusListener ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::com::sun::star::uno::Reference< ::com::sun::star::util::XURLTransformer > m_xURLTransformer; ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > m_xDeferedItemContainer; - sal_Int16 m_nSymbolsStyle; + OUString m_sIconTheme; Timer m_aAsyncSettingsTimer; }; diff --git a/framework/inc/uielement/toolbarmanager.hxx b/framework/inc/uielement/toolbarmanager.hxx index 7542b2950206..14462bba0648 100644 --- a/framework/inc/uielement/toolbarmanager.hxx +++ b/framework/inc/uielement/toolbarmanager.hxx @@ -210,7 +210,7 @@ class ToolBarManager : public ToolbarManager_Base, CommandToInfoMap m_aCommandMap; SubToolBarToSubToolBarControllerMap m_aSubToolBarControllerMap; Timer m_aAsyncUpdateControllersTimer; - sal_Int16 m_nSymbolsStyle; + OUString m_sIconTheme; MenuDescriptionMap m_aMenuMap; sal_Bool m_bAcceleratorCfg; ::com::sun::star::uno::Reference< ::com::sun::star::ui::XAcceleratorConfiguration > m_xDocAcceleratorManager; diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx b/framework/source/uiconfiguration/imagemanagerimpl.cxx index 7cf71e82addf..b83766c41fb7 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.cxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx @@ -153,7 +153,7 @@ CmdImageList::CmdImageList( const uno::Reference< uno::XComponentContext >& rxCo m_bVectorInit( sal_False ), m_aModuleIdentifier( aModuleIdentifier ), m_xContext( rxContext ), - m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() ) + m_sIconTheme( SvtMiscOptions().GetIconTheme() ) { for ( sal_Int32 n=0; n < ImageType_COUNT; n++ ) m_pImageList[n] = 0; @@ -260,10 +260,10 @@ ImageList* CmdImageList::impl_getImageList( sal_Int16 nImageType ) { SvtMiscOptions aMiscOptions; - sal_Int16 nSymbolsStyle = aMiscOptions.GetCurrentSymbolsStyle(); - if ( nSymbolsStyle != m_nSymbolsStyle ) + const OUString& rIconTheme = aMiscOptions.GetIconTheme(); + if ( rIconTheme != m_sIconTheme ) { - m_nSymbolsStyle = nSymbolsStyle; + m_sIconTheme = rIconTheme; for ( sal_Int32 n=0; n < ImageType_COUNT; n++ ) delete m_pImageList[n], m_pImageList[n] = NULL; } @@ -647,6 +647,7 @@ sal_Bool ImageManagerImpl::implts_storeUserImages( return sal_False; } + const rtl::Reference< GlobalImageList >& ImageManagerImpl::implts_getGlobalImageList() { ResetableGuard aGuard( m_aLock ); diff --git a/framework/source/uiconfiguration/imagemanagerimpl.hxx b/framework/source/uiconfiguration/imagemanagerimpl.hxx index 2040dbea6222..b8888d2a0b8e 100644 --- a/framework/source/uiconfiguration/imagemanagerimpl.hxx +++ b/framework/source/uiconfiguration/imagemanagerimpl.hxx @@ -81,7 +81,7 @@ namespace framework ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; ::std::vector< OUString > m_aImageNameVector; ::std::vector< OUString > m_aImageCommandNameVector; - sal_Int16 m_nSymbolsStyle; + OUString m_sIconTheme; }; class GlobalImageList : public CmdImageList, public rtl::IReference diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx index ec6e8469257e..aca7a24becaf 100644 --- a/framework/source/uielement/menubarmanager.cxx +++ b/framework/source/uielement/menubarmanager.cxx @@ -178,7 +178,7 @@ MenuBarManager::MenuBarManager( , m_aListenerContainer( m_aLock.getShareableOslMutex() ) , m_xContext(rxContext) , m_xURLTransformer(_xURLTransformer) - , m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() ) + , m_sIconTheme( SvtMiscOptions().GetIconTheme() ) { m_xPopupMenuControllerFactory = frame::thePopupMenuControllerFactory::get(m_xContext); FillMenuManager( pMenu, rFrame, rDispatchProvider, rModuleIdentifier, bDelete, bDeleteChildren ); @@ -200,7 +200,7 @@ MenuBarManager::MenuBarManager( , m_aListenerContainer( m_aLock.getShareableOslMutex() ) , m_xContext(rxContext) , m_xURLTransformer(_xURLTransformer) - , m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() ) + , m_sIconTheme( SvtMiscOptions().GetIconTheme() ) { Init(rFrame,pAddonMenu,bDelete,bDeleteChildren); } @@ -221,7 +221,7 @@ MenuBarManager::MenuBarManager( , m_aListenerContainer( m_aLock.getShareableOslMutex() ) , m_xContext(rxContext) , m_xURLTransformer(_xURLTransformer) - , m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() ) + , m_sIconTheme( SvtMiscOptions().GetIconTheme() ) { Init(rFrame,pAddonPopupMenu,bDelete,bDeleteChildren,true); } @@ -821,15 +821,15 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu ) MenuManager::UpdateSpecialWindowMenu( pMenu, m_xContext, m_aLock ); // Check if some modes have changed so we have to update our menu images - sal_Int16 nSymbolsStyle = SvtMiscOptions().GetCurrentSymbolsStyle(); + OUString sIconTheme = SvtMiscOptions().GetIconTheme(); if ( m_bRetrieveImages || bShowMenuImages != m_bShowMenuImages || - nSymbolsStyle != m_nSymbolsStyle ) + sIconTheme != m_sIconTheme ) { m_bShowMenuImages = bShowMenuImages; m_bRetrieveImages = sal_False; - m_nSymbolsStyle = nSymbolsStyle; + m_sIconTheme = sIconTheme; MenuManager::FillMenuImages( m_xFrame, pMenu, bShowMenuImages ); } diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index cecbb66ab78e..a1afbab0d253 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -201,7 +201,7 @@ ToolBarManager::ToolBarManager( const Reference< XComponentContext >& rxContext, m_xFrame( rFrame ), m_aListenerContainer( m_aLock.getShareableOslMutex() ), m_xContext( rxContext ), - m_nSymbolsStyle( SvtMiscOptions().GetCurrentSymbolsStyle() ), + m_sIconTheme( SvtMiscOptions().GetIconTheme() ), m_bAcceleratorCfg( sal_False ) { OSL_ASSERT( m_xContext.is() ); @@ -318,15 +318,15 @@ void ToolBarManager::CheckAndUpdateImages() bool bCurrentSymbolsSmall = !aMiscOptions.AreCurrentSymbolsLarge(); if ( m_bSmallSymbols != bCurrentSymbolsSmall ) { - bRefreshImages = sal_True; + bRefreshImages = true; m_bSmallSymbols = bCurrentSymbolsSmall; } - sal_Int16 nCurrentSymbolsStyle = aMiscOptions.GetCurrentSymbolsStyle(); - if ( m_nSymbolsStyle != nCurrentSymbolsStyle ) + const OUString& sCurrentIconTheme = aMiscOptions.GetIconTheme(); + if ( m_sIconTheme != sCurrentIconTheme ) { - bRefreshImages = sal_True; - m_nSymbolsStyle = nCurrentSymbolsStyle; + bRefreshImages = true; + m_sIconTheme = sCurrentIconTheme; } // Refresh images if requested |