diff options
author | Heiko Tietze <tietze.heiko@gmail.com> | 2021-05-19 13:21:00 +0200 |
---|---|---|
committer | Heiko Tietze <heiko.tietze@documentfoundation.org> | 2021-06-08 15:28:56 +0200 |
commit | 086fa727cabf46eacfec1a0fd4f6dfe916aa2f04 (patch) | |
tree | d17d263a3f2eef1b9c0d39ffd08e751c3f2fa105 /framework | |
parent | a2d8a737f41cbb0ed8a51a99b1c233b25e433d1c (diff) |
Resolves tdf#131817 - Option to globally switch toolbar locking on/off
Reverts 6993d5d0f1079fe720a7da004b70b57361c99fc6 and
sets Locked in GlobalSettings to true
New UNO command ToolbarLock to toggle the state added to
the toolbars menu
Change-Id: I246280b2b7930f2bf686e6fc26383da4799b5028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115797
Tested-by: Jenkins
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/inc/strings.hrc | 1 | ||||
-rw-r--r-- | framework/source/uielement/toolbarmanager.cxx | 3 | ||||
-rw-r--r-- | framework/source/uielement/toolbarsmenucontroller.cxx | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/framework/inc/strings.hrc b/framework/inc/strings.hrc index 8216bb623eb3..796517bdc130 100644 --- a/framework/inc/strings.hrc +++ b/framework/inc/strings.hrc @@ -41,6 +41,7 @@ #define STR_FULL_DISC_RETRY_BUTTON NC_("STR_FULL_DISC_RETRY_BUTTON", "Retry" ) #define STR_FULL_DISC_MSG NC_("STR_FULL_DISC_MSG", "%PRODUCTNAME could not save important internal information due to insufficient free disk space at the following location:\n%PATH\n\nYou will not be able to continue working with %PRODUCTNAME without allocating more free disk space at that location.\n\nPress the 'Retry' button after you have allocated more free disk space to retry saving the data.\n\n" ) #define STR_RESTORE_TOOLBARS NC_("STR_RESTORE_TOOLBARS", "~Reset" ) +#define STR_LOCK_TOOLBARS NC_("STR_LOCK_TOOLBARS", "~Lock Toolbars" ) #define STR_CORRUPT_UICFG_SHARE NC_("STR_CORRUPT_UICFG_SHARE", "An error occurred while loading the user interface configuration data. The application will be terminated now.\nPlease try to reinstall the application." ) #define STR_CORRUPT_UICFG_USER NC_("STR_CORRUPT_UICFG_USER", "An error occurred while loading the user interface configuration data. The application will be terminated now.\nPlease try to remove your user profile for the application." ) #define STR_CORRUPT_UICFG_GENERAL NC_("STR_CORRUPT_UICFG_GENERAL", "An error occurred while loading the user interface configuration data. The application will be terminated now.\nPlease try to remove your user profile for the application first or try to reinstall the application." ) diff --git a/framework/source/uielement/toolbarmanager.cxx b/framework/source/uielement/toolbarmanager.cxx index 2d88db04ae67..ad52608c5b0c 100644 --- a/framework/source/uielement/toolbarmanager.cxx +++ b/framework/source/uielement/toolbarmanager.cxx @@ -1943,10 +1943,7 @@ void ToolBarManager::AddCustomizeMenuItems(ToolBox const * pToolBar) pMenu->EnableItem(MENUITEM_TOOLBAR_DOCKALLTOOLBAR, false); Reference< XDockableWindow > xDockable( VCLUnoHelper::GetInterface( m_pToolBar ), UNO_QUERY ); if( xDockable.is() ) - { pMenu->CheckItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, xDockable->isLocked()); - pMenu->EnableItem(MENUITEM_TOOLBAR_UNDOCKTOOLBAR, !xDockable->isLocked()); - } } else pMenu->EnableItem(MENUITEM_TOOLBAR_LOCKTOOLBARPOSITION, false); diff --git a/framework/source/uielement/toolbarsmenucontroller.cxx b/framework/source/uielement/toolbarsmenucontroller.cxx index 1498cb1ed3e6..83816bc64bdb 100644 --- a/framework/source/uielement/toolbarsmenucontroller.cxx +++ b/framework/source/uielement/toolbarsmenucontroller.cxx @@ -69,6 +69,7 @@ using namespace ::com::sun::star::container; using namespace ::com::sun::star::ui; constexpr OUStringLiteral CMD_RESTOREVISIBILITY = u".cmd:RestoreVisibility"; +constexpr OUStringLiteral CMD_LOCKTOOLBARS = u".uno:ToolbarLock"; constexpr OUStringLiteral STATIC_CMD_PART = u".uno:AvailableToolbars?Toolbar:string="; const char STATIC_INTERNAL_CMD_PART[] = ".cmd:"; @@ -461,6 +462,8 @@ void ToolbarsMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu > co OUString aLabelStr(FwkResId(STR_RESTORE_TOOLBARS)); addCommand( m_xPopupMenu, CMD_RESTOREVISIBILITY, aLabelStr ); + aLabelStr = FwkResId(STR_LOCK_TOOLBARS); + addCommand( m_xPopupMenu, CMD_LOCKTOOLBARS, aLabelStr ); } // XEventListener |