Kaydet (Commit) c4461665 authored tarafından Michael Meeks's avatar Michael Meeks Kaydeden (comit) Jan Holesovsky

ui-desktop-integration.diff: Disable UI [toolbars, menus] customization.

üst 5eaf1951
...@@ -256,7 +256,7 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic ...@@ -256,7 +256,7 @@ ToolBarManager::ToolBarManager( const Reference< XMultiServiceFactory >& rServic
m_bUpdateControllers( sal_False ), m_bUpdateControllers( sal_False ),
m_bImageOrientationRegistered( sal_False ), m_bImageOrientationRegistered( sal_False ),
m_bImageMirrored( sal_False ), m_bImageMirrored( sal_False ),
m_bCanBeCustomized( sal_True ), m_bCanBeCustomized( !SvtMiscOptions().DisableUICustomization() ),
m_lImageRotation( 0 ), m_lImageRotation( 0 ),
m_pToolBar( pToolBar ), m_pToolBar( pToolBar ),
m_aResourceName( rResourceName ), m_aResourceName( rResourceName ),
...@@ -496,6 +496,24 @@ void ToolBarManager::UpdateControllers() ...@@ -496,6 +496,24 @@ void ToolBarManager::UpdateControllers()
{ {
RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ToolBarManager::UpdateControllers" ); RTL_LOGFILE_CONTEXT( aLog, "framework (cd100003) ::ToolBarManager::UpdateControllers" );
if( !m_bCanBeCustomized )
{
Any a;
Reference< XLayoutManager > xLayoutManager;
Reference< XPropertySet > xFramePropSet( m_xFrame, UNO_QUERY );
if ( xFramePropSet.is() )
a = xFramePropSet->getPropertyValue( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LayoutManager" )));
a >>= xLayoutManager;
Reference< XDockableWindow > xDockable( VCLUnoHelper::GetInterface( m_pToolBar ), UNO_QUERY );
if ( xLayoutManager.is() && xDockable.is() )
{
::com::sun::star::awt::Point aPoint;
aPoint.X = aPoint.Y = LONG_MAX;
xLayoutManager->dockWindow( m_aResourceName, DockingArea_DOCKINGAREA_DEFAULT, aPoint );
xLayoutManager->lockWindow( m_aResourceName );
}
}
if ( !m_bUpdateControllers ) if ( !m_bUpdateControllers )
{ {
m_bUpdateControllers = sal_True; m_bUpdateControllers = sal_True;
...@@ -1805,6 +1823,7 @@ PopupMenu * ToolBarManager::GetToolBarCustomMeun(ToolBox* pToolBar) ...@@ -1805,6 +1823,7 @@ PopupMenu * ToolBarManager::GetToolBarCustomMeun(ToolBox* pToolBar)
// Non-configurable toolbars should disable configuration menu items // Non-configurable toolbars should disable configuration menu items
aPopupMenu.EnableItem( MENUITEM_TOOLBAR_VISIBLEBUTTON, sal_False ); aPopupMenu.EnableItem( MENUITEM_TOOLBAR_VISIBLEBUTTON, sal_False );
aPopupMenu.EnableItem( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, sal_False ); aPopupMenu.EnableItem( MENUITEM_TOOLBAR_CUSTOMIZETOOLBAR, sal_False );
aPopupMenu.EnableItem( MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, sal_False );
} }
// Disable menu item CLOSE if the toolbar has no closer // Disable menu item CLOSE if the toolbar has no closer
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
#include <unotools/cmdoptions.hxx> #include <unotools/cmdoptions.hxx>
#include <dispatch/uieventloghelper.hxx> #include <dispatch/uieventloghelper.hxx>
#include <rtl/logfile.hxx> #include <rtl/logfile.hxx>
#include <svtools/miscopt.hxx>
//_________________________________________________________________________________________________________________ //_________________________________________________________________________________________________________________
// Defines // Defines
...@@ -376,6 +377,9 @@ sal_Bool ToolbarsMenuController::isContextSensitiveToolbarNonVisible() ...@@ -376,6 +377,9 @@ sal_Bool ToolbarsMenuController::isContextSensitiveToolbarNonVisible()
void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu ) void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >& rPopupMenu )
{ {
if( SvtMiscOptions().DisableUICustomization() )
return;
vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() ); vos::OGuard aSolarMutexGuard( Application::GetSolarMutex() );
resetPopupMenu( rPopupMenu ); resetPopupMenu( rPopupMenu );
......
...@@ -5774,6 +5774,13 @@ ...@@ -5774,6 +5774,13 @@
<desc>Determines whether to show the document creation and selection of the machine's default ODMA (Open Document Management Architecture) DMS (Document Management System). If true, and the machine has a DMS available, the DMS's dialog will be displayed. That dialog then gives the opportunity to use the application's dialog instead, which means the normal system file and folder pickers will be displayed. Relevant only on Windows.</desc> <desc>Determines whether to show the document creation and selection of the machine's default ODMA (Open Document Management Architecture) DMS (Document Management System). If true, and the machine has a DMS available, the DMS's dialog will be displayed. That dialog then gives the opportunity to use the application's dialog instead, which means the normal system file and folder pickers will be displayed. Relevant only on Windows.</desc>
</info> </info>
<value>false</value> <value>false</value>
</prop>
<prop oor:name="DisableUICustomization" oor:type="xs:boolean">
<info>
<author>RSiddhartha</author>
<desc>Disables the customization of the UI elements.</desc>
</info>
<value>false</value>
</prop> </prop>
<prop oor:name="SymbolSet" oor:type="xs:short"> <prop oor:name="SymbolSet" oor:type="xs:short">
<!-- UIHints: Tools Options General View --> <!-- UIHints: Tools Options General View -->
......
...@@ -177,6 +177,7 @@ interface Application ...@@ -177,6 +177,7 @@ interface Application
SID_AVAILABLE_TOOLBARS SID_AVAILABLE_TOOLBARS
[ [
ExecMethod = MiscExec_Impl ; ExecMethod = MiscExec_Impl ;
StateMethod = MiscState_Impl ;
] ]
SID_HELP_TUTORIALS SID_HELP_TUTORIALS
[ [
......
...@@ -79,6 +79,7 @@ ...@@ -79,6 +79,7 @@
#include <unotools/moduleoptions.hxx> #include <unotools/moduleoptions.hxx>
#include <unotools/regoptions.hxx> #include <unotools/regoptions.hxx>
#include <svtools/helpopt.hxx> #include <svtools/helpopt.hxx>
#include <svtools/miscopt.hxx>
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include <tools/shl.hxx> #include <tools/shl.hxx>
#include <unotools/bootstrap.hxx> #include <unotools/bootstrap.hxx>
...@@ -659,6 +660,18 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet) ...@@ -659,6 +660,18 @@ void SfxApplication::MiscState_Impl(SfxItemSet &rSet)
break; break;
} }
case SID_CONFIG:
case SID_TOOLBOXOPTIONS:
case SID_CONFIGSTATUSBAR:
case SID_CONFIGMENU:
case SID_CONFIGACCEL:
case SID_CONFIGEVENT:
{
if( SvtMiscOptions().DisableUICustomization() )
rSet.DisableItem(nWhich);
break;
}
case SID_BASICSTOP: case SID_BASICSTOP:
if ( !StarBASIC::IsRunning() ) if ( !StarBASIC::IsRunning() )
rSet.DisableItem(nWhich); rSet.DisableItem(nWhich);
......
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