diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-04-21 17:23:26 +0900 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2015-04-21 17:26:00 +0900 |
commit | 0e8218d9d880fa4be972de3decd9cd42f55472c3 (patch) | |
tree | 6c77718db24af385e529e1ef3c941dd66d1e3c33 | |
parent | ef968e133f8da87b960ab0f0627cc8bcc691d9cb (diff) |
sidebar panel or deck can now be marked as experimental
.. so they show up only when experimental mode is enabled.
Change-Id: Ib89b8b03290b7c04edc4da48ed328f03cd88d02c
-rw-r--r-- | officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs | 16 | ||||
-rw-r--r-- | sfx2/source/sidebar/DeckDescriptor.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/sidebar/DeckDescriptor.hxx | 17 | ||||
-rw-r--r-- | sfx2/source/sidebar/PanelDescriptor.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/sidebar/PanelDescriptor.hxx | 15 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.cxx | 15 | ||||
-rw-r--r-- | sfx2/source/sidebar/ResourceManager.hxx | 3 |
7 files changed, 57 insertions, 23 deletions
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs index 1039becc45c3..d5b90e022ca3 100644 --- a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs @@ -97,8 +97,8 @@ DrawImpress WriterVariants These shortcuts exist for even more convenience and handle the frequent case of Draw - and Impress as well as different variants of the Writer where they have otherwise - identical context descriptions. + and Impress as well as different variants of the Writer where they have otherwise + identical context descriptions. Special values: any @@ -128,6 +128,12 @@ </info> <value>10000</value> </prop> + <prop oor:name="IsExperimental" oor:type="xs:boolean"> + <info> + <desc>This flag controls whether the deck is experimental and is shown only when experimental mode is enabled.</desc> + </info> + <value>false</value> + </prop> </group> <group oor:name="Panel"> <info> @@ -214,6 +220,12 @@ </info> <value>false</value> </prop> + <prop oor:name="IsExperimental" oor:type="xs:boolean"> + <info> + <desc>This flag controls whether the panel is experimental and is shown only when experimental mode is enabled.</desc> + </info> + <value>false</value> + </prop> </group> </templates> <component> diff --git a/sfx2/source/sidebar/DeckDescriptor.cxx b/sfx2/source/sidebar/DeckDescriptor.cxx index 9981b79fe1da..2f431e525315 100644 --- a/sfx2/source/sidebar/DeckDescriptor.cxx +++ b/sfx2/source/sidebar/DeckDescriptor.cxx @@ -32,7 +32,8 @@ DeckDescriptor::DeckDescriptor() msHelpText(), maContextList(), mbIsEnabled(true), - mnOrderIndex(10000) // Default value as defined in Sidebar.xcs + mnOrderIndex(10000), // Default value as defined in Sidebar.xcs + mbExperimental(false) { } @@ -46,8 +47,9 @@ DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther) msHelpURL(rOther.msHelpURL), msHelpText(rOther.msHelpText), maContextList(rOther.maContextList), - mbIsEnabled(rOther.mbIsEnabled), - mnOrderIndex(rOther.mnOrderIndex) + mbIsEnabled(rOther.mbIsEnabled), + mnOrderIndex(rOther.mnOrderIndex), + mbExperimental(rOther.mbExperimental) { } diff --git a/sfx2/source/sidebar/DeckDescriptor.hxx b/sfx2/source/sidebar/DeckDescriptor.hxx index 3ea1db1cf4dc..77f811e77bf7 100644 --- a/sfx2/source/sidebar/DeckDescriptor.hxx +++ b/sfx2/source/sidebar/DeckDescriptor.hxx @@ -28,17 +28,18 @@ namespace sfx2 { namespace sidebar { class DeckDescriptor { public: - ::rtl::OUString msTitle; - ::rtl::OUString msId; - ::rtl::OUString msIconURL; - ::rtl::OUString msHighContrastIconURL; - ::rtl::OUString msTitleBarIconURL; - ::rtl::OUString msHighContrastTitleBarIconURL; - ::rtl::OUString msHelpURL; - ::rtl::OUString msHelpText; + OUString msTitle; + OUString msId; + OUString msIconURL; + OUString msHighContrastIconURL; + OUString msTitleBarIconURL; + OUString msHighContrastTitleBarIconURL; + OUString msHelpURL; + OUString msHelpText; ContextList maContextList; bool mbIsEnabled; sal_Int32 mnOrderIndex; + bool mbExperimental; DeckDescriptor(); DeckDescriptor (const DeckDescriptor& rOther); diff --git a/sfx2/source/sidebar/PanelDescriptor.cxx b/sfx2/source/sidebar/PanelDescriptor.cxx index c7837bf36d41..c88f21b48294 100644 --- a/sfx2/source/sidebar/PanelDescriptor.cxx +++ b/sfx2/source/sidebar/PanelDescriptor.cxx @@ -33,7 +33,8 @@ PanelDescriptor::PanelDescriptor() msImplementationURL(), mnOrderIndex(10000), // Default value as defined in Sidebar.xcs mbShowForReadOnlyDocuments(false), - mbWantsCanvas(false) + mbWantsCanvas(false), + mbExperimental(false) { } @@ -49,7 +50,8 @@ PanelDescriptor::PanelDescriptor (const PanelDescriptor& rOther) msImplementationURL(rOther.msImplementationURL), mnOrderIndex(rOther.mnOrderIndex), mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments), - mbWantsCanvas(rOther.mbWantsCanvas) + mbWantsCanvas(rOther.mbWantsCanvas), + mbExperimental(rOther.mbExperimental) { } diff --git a/sfx2/source/sidebar/PanelDescriptor.hxx b/sfx2/source/sidebar/PanelDescriptor.hxx index d1a20d253967..f67a12805471 100644 --- a/sfx2/source/sidebar/PanelDescriptor.hxx +++ b/sfx2/source/sidebar/PanelDescriptor.hxx @@ -28,18 +28,19 @@ namespace sfx2 { namespace sidebar { class PanelDescriptor { public: - ::rtl::OUString msTitle; + OUString msTitle; bool mbIsTitleBarOptional; - ::rtl::OUString msId; - ::rtl::OUString msDeckId; - ::rtl::OUString msTitleBarIconURL; - ::rtl::OUString msHighContrastTitleBarIconURL; - ::rtl::OUString msHelpURL; + OUString msId; + OUString msDeckId; + OUString msTitleBarIconURL; + OUString msHighContrastTitleBarIconURL; + OUString msHelpURL; ContextList maContextList; - ::rtl::OUString msImplementationURL; + OUString msImplementationURL; sal_Int32 mnOrderIndex; bool mbShowForReadOnlyDocuments; bool mbWantsCanvas; + bool mbExperimental; PanelDescriptor(); PanelDescriptor (const PanelDescriptor& rPanelDescriptor); diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx index c5bfa88359bd..b998e249a6ac 100644 --- a/sfx2/source/sidebar/ResourceManager.cxx +++ b/sfx2/source/sidebar/ResourceManager.cxx @@ -47,7 +47,8 @@ ResourceManager& ResourceManager::Instance() ResourceManager::ResourceManager() : maDecks(), maPanels(), - maProcessedApplications() + maProcessedApplications(), + maMiscOptions() { ReadDeckList(); ReadPanelList(); @@ -68,6 +69,8 @@ const DeckDescriptor* ResourceManager::GetDeckDescriptor ( iDeck!=iEnd; ++iDeck) { + if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode()) + continue; if (iDeck->msId.equals(rsDeckId)) return &*iDeck; } @@ -99,6 +102,8 @@ void ResourceManager::SetIsDeckEnabled ( iDeck!=iEnd; ++iDeck) { + if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode()) + continue; if (iDeck->msId.equals(rsDeckId)) { iDeck->mbIsEnabled = bIsEnabled; @@ -122,6 +127,8 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch iDeck!=iEnd; ++iDeck) { + if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode()) + continue; const DeckDescriptor& rDeckDescriptor (*iDeck); if (rDeckDescriptor.maContextList.GetMatch(rContext) == NULL) continue; @@ -163,6 +170,8 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc ++iPanel) { const PanelDescriptor& rPanelDescriptor (*iPanel); + if (rPanelDescriptor.mbExperimental && !maMiscOptions.IsExperimentalMode()) + continue; if ( ! rPanelDescriptor.msDeckId.equals(rsDeckId)) continue; @@ -231,6 +240,8 @@ void ResourceManager::ReadDeckList() rDeckDescriptor.mbIsEnabled = true; rDeckDescriptor.mnOrderIndex = ::comphelper::getINT32( aDeckNode.getNodeValue("OrderIndex")); + rDeckDescriptor.mbExperimental = ::comphelper::getBOOL( + aDeckNode.getNodeValue("IsExperimental")); ReadContextList( aDeckNode, @@ -287,6 +298,8 @@ void ResourceManager::ReadPanelList() aPanelNode.getNodeValue("ShowForReadOnlyDocument")); rPanelDescriptor.mbWantsCanvas = ::comphelper::getBOOL( aPanelNode.getNodeValue("WantsCanvas")); + rPanelDescriptor.mbExperimental = ::comphelper::getBOOL( + aPanelNode.getNodeValue("IsExperimental")); const OUString sDefaultMenuCommand (::comphelper::getString( aPanelNode.getNodeValue("DefaultMenuCommand"))); diff --git a/sfx2/source/sidebar/ResourceManager.hxx b/sfx2/source/sidebar/ResourceManager.hxx index 57fc5beaf993..a358271128e5 100644 --- a/sfx2/source/sidebar/ResourceManager.hxx +++ b/sfx2/source/sidebar/ResourceManager.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/frame/XFrame.hpp> #include <set> #include <boost/shared_ptr.hpp> +#include <svtools/miscopt.hxx> namespace sfx2 { namespace sidebar { @@ -105,6 +106,8 @@ private: PanelContainer maPanels; mutable ::std::set<rtl::OUString> maProcessedApplications; + SvtMiscOptions maMiscOptions; + void ReadDeckList(); void ReadPanelList(); void ReadContextList ( |