Kaydet (Commit) 0e8218d9 authored tarafından Tomaž Vajngerl's avatar Tomaž Vajngerl

sidebar panel or deck can now be marked as experimental

.. so they show up only when experimental mode is enabled.

Change-Id: Ib89b8b03290b7c04edc4da48ed328f03cd88d02c
üst ef968e13
...@@ -128,6 +128,12 @@ ...@@ -128,6 +128,12 @@
</info> </info>
<value>10000</value> <value>10000</value>
</prop> </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>
<group oor:name="Panel"> <group oor:name="Panel">
<info> <info>
...@@ -214,6 +220,12 @@ ...@@ -214,6 +220,12 @@
</info> </info>
<value>false</value> <value>false</value>
</prop> </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> </group>
</templates> </templates>
<component> <component>
......
...@@ -32,7 +32,8 @@ DeckDescriptor::DeckDescriptor() ...@@ -32,7 +32,8 @@ DeckDescriptor::DeckDescriptor()
msHelpText(), msHelpText(),
maContextList(), maContextList(),
mbIsEnabled(true), mbIsEnabled(true),
mnOrderIndex(10000) // Default value as defined in Sidebar.xcs mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
mbExperimental(false)
{ {
} }
...@@ -47,7 +48,8 @@ DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther) ...@@ -47,7 +48,8 @@ DeckDescriptor::DeckDescriptor (const DeckDescriptor& rOther)
msHelpText(rOther.msHelpText), msHelpText(rOther.msHelpText),
maContextList(rOther.maContextList), maContextList(rOther.maContextList),
mbIsEnabled(rOther.mbIsEnabled), mbIsEnabled(rOther.mbIsEnabled),
mnOrderIndex(rOther.mnOrderIndex) mnOrderIndex(rOther.mnOrderIndex),
mbExperimental(rOther.mbExperimental)
{ {
} }
......
...@@ -28,17 +28,18 @@ namespace sfx2 { namespace sidebar { ...@@ -28,17 +28,18 @@ namespace sfx2 { namespace sidebar {
class DeckDescriptor class DeckDescriptor
{ {
public: public:
::rtl::OUString msTitle; OUString msTitle;
::rtl::OUString msId; OUString msId;
::rtl::OUString msIconURL; OUString msIconURL;
::rtl::OUString msHighContrastIconURL; OUString msHighContrastIconURL;
::rtl::OUString msTitleBarIconURL; OUString msTitleBarIconURL;
::rtl::OUString msHighContrastTitleBarIconURL; OUString msHighContrastTitleBarIconURL;
::rtl::OUString msHelpURL; OUString msHelpURL;
::rtl::OUString msHelpText; OUString msHelpText;
ContextList maContextList; ContextList maContextList;
bool mbIsEnabled; bool mbIsEnabled;
sal_Int32 mnOrderIndex; sal_Int32 mnOrderIndex;
bool mbExperimental;
DeckDescriptor(); DeckDescriptor();
DeckDescriptor (const DeckDescriptor& rOther); DeckDescriptor (const DeckDescriptor& rOther);
......
...@@ -33,7 +33,8 @@ PanelDescriptor::PanelDescriptor() ...@@ -33,7 +33,8 @@ PanelDescriptor::PanelDescriptor()
msImplementationURL(), msImplementationURL(),
mnOrderIndex(10000), // Default value as defined in Sidebar.xcs mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
mbShowForReadOnlyDocuments(false), mbShowForReadOnlyDocuments(false),
mbWantsCanvas(false) mbWantsCanvas(false),
mbExperimental(false)
{ {
} }
...@@ -49,7 +50,8 @@ PanelDescriptor::PanelDescriptor (const PanelDescriptor& rOther) ...@@ -49,7 +50,8 @@ PanelDescriptor::PanelDescriptor (const PanelDescriptor& rOther)
msImplementationURL(rOther.msImplementationURL), msImplementationURL(rOther.msImplementationURL),
mnOrderIndex(rOther.mnOrderIndex), mnOrderIndex(rOther.mnOrderIndex),
mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments), mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments),
mbWantsCanvas(rOther.mbWantsCanvas) mbWantsCanvas(rOther.mbWantsCanvas),
mbExperimental(rOther.mbExperimental)
{ {
} }
......
...@@ -28,18 +28,19 @@ namespace sfx2 { namespace sidebar { ...@@ -28,18 +28,19 @@ namespace sfx2 { namespace sidebar {
class PanelDescriptor class PanelDescriptor
{ {
public: public:
::rtl::OUString msTitle; OUString msTitle;
bool mbIsTitleBarOptional; bool mbIsTitleBarOptional;
::rtl::OUString msId; OUString msId;
::rtl::OUString msDeckId; OUString msDeckId;
::rtl::OUString msTitleBarIconURL; OUString msTitleBarIconURL;
::rtl::OUString msHighContrastTitleBarIconURL; OUString msHighContrastTitleBarIconURL;
::rtl::OUString msHelpURL; OUString msHelpURL;
ContextList maContextList; ContextList maContextList;
::rtl::OUString msImplementationURL; OUString msImplementationURL;
sal_Int32 mnOrderIndex; sal_Int32 mnOrderIndex;
bool mbShowForReadOnlyDocuments; bool mbShowForReadOnlyDocuments;
bool mbWantsCanvas; bool mbWantsCanvas;
bool mbExperimental;
PanelDescriptor(); PanelDescriptor();
PanelDescriptor (const PanelDescriptor& rPanelDescriptor); PanelDescriptor (const PanelDescriptor& rPanelDescriptor);
......
...@@ -47,7 +47,8 @@ ResourceManager& ResourceManager::Instance() ...@@ -47,7 +47,8 @@ ResourceManager& ResourceManager::Instance()
ResourceManager::ResourceManager() ResourceManager::ResourceManager()
: maDecks(), : maDecks(),
maPanels(), maPanels(),
maProcessedApplications() maProcessedApplications(),
maMiscOptions()
{ {
ReadDeckList(); ReadDeckList();
ReadPanelList(); ReadPanelList();
...@@ -68,6 +69,8 @@ const DeckDescriptor* ResourceManager::GetDeckDescriptor ( ...@@ -68,6 +69,8 @@ const DeckDescriptor* ResourceManager::GetDeckDescriptor (
iDeck!=iEnd; iDeck!=iEnd;
++iDeck) ++iDeck)
{ {
if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode())
continue;
if (iDeck->msId.equals(rsDeckId)) if (iDeck->msId.equals(rsDeckId))
return &*iDeck; return &*iDeck;
} }
...@@ -99,6 +102,8 @@ void ResourceManager::SetIsDeckEnabled ( ...@@ -99,6 +102,8 @@ void ResourceManager::SetIsDeckEnabled (
iDeck!=iEnd; iDeck!=iEnd;
++iDeck) ++iDeck)
{ {
if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode())
continue;
if (iDeck->msId.equals(rsDeckId)) if (iDeck->msId.equals(rsDeckId))
{ {
iDeck->mbIsEnabled = bIsEnabled; iDeck->mbIsEnabled = bIsEnabled;
...@@ -122,6 +127,8 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch ...@@ -122,6 +127,8 @@ const ResourceManager::DeckContextDescriptorContainer& ResourceManager::GetMatch
iDeck!=iEnd; iDeck!=iEnd;
++iDeck) ++iDeck)
{ {
if (iDeck->mbExperimental && !maMiscOptions.IsExperimentalMode())
continue;
const DeckDescriptor& rDeckDescriptor (*iDeck); const DeckDescriptor& rDeckDescriptor (*iDeck);
if (rDeckDescriptor.maContextList.GetMatch(rContext) == NULL) if (rDeckDescriptor.maContextList.GetMatch(rContext) == NULL)
continue; continue;
...@@ -163,6 +170,8 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc ...@@ -163,6 +170,8 @@ const ResourceManager::PanelContextDescriptorContainer& ResourceManager::GetMatc
++iPanel) ++iPanel)
{ {
const PanelDescriptor& rPanelDescriptor (*iPanel); const PanelDescriptor& rPanelDescriptor (*iPanel);
if (rPanelDescriptor.mbExperimental && !maMiscOptions.IsExperimentalMode())
continue;
if ( ! rPanelDescriptor.msDeckId.equals(rsDeckId)) if ( ! rPanelDescriptor.msDeckId.equals(rsDeckId))
continue; continue;
...@@ -231,6 +240,8 @@ void ResourceManager::ReadDeckList() ...@@ -231,6 +240,8 @@ void ResourceManager::ReadDeckList()
rDeckDescriptor.mbIsEnabled = true; rDeckDescriptor.mbIsEnabled = true;
rDeckDescriptor.mnOrderIndex = ::comphelper::getINT32( rDeckDescriptor.mnOrderIndex = ::comphelper::getINT32(
aDeckNode.getNodeValue("OrderIndex")); aDeckNode.getNodeValue("OrderIndex"));
rDeckDescriptor.mbExperimental = ::comphelper::getBOOL(
aDeckNode.getNodeValue("IsExperimental"));
ReadContextList( ReadContextList(
aDeckNode, aDeckNode,
...@@ -287,6 +298,8 @@ void ResourceManager::ReadPanelList() ...@@ -287,6 +298,8 @@ void ResourceManager::ReadPanelList()
aPanelNode.getNodeValue("ShowForReadOnlyDocument")); aPanelNode.getNodeValue("ShowForReadOnlyDocument"));
rPanelDescriptor.mbWantsCanvas = ::comphelper::getBOOL( rPanelDescriptor.mbWantsCanvas = ::comphelper::getBOOL(
aPanelNode.getNodeValue("WantsCanvas")); aPanelNode.getNodeValue("WantsCanvas"));
rPanelDescriptor.mbExperimental = ::comphelper::getBOOL(
aPanelNode.getNodeValue("IsExperimental"));
const OUString sDefaultMenuCommand (::comphelper::getString( const OUString sDefaultMenuCommand (::comphelper::getString(
aPanelNode.getNodeValue("DefaultMenuCommand"))); aPanelNode.getNodeValue("DefaultMenuCommand")));
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/frame/XFrame.hpp>
#include <set> #include <set>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
#include <svtools/miscopt.hxx>
namespace sfx2 { namespace sidebar { namespace sfx2 { namespace sidebar {
...@@ -105,6 +106,8 @@ private: ...@@ -105,6 +106,8 @@ private:
PanelContainer maPanels; PanelContainer maPanels;
mutable ::std::set<rtl::OUString> maProcessedApplications; mutable ::std::set<rtl::OUString> maProcessedApplications;
SvtMiscOptions maMiscOptions;
void ReadDeckList(); void ReadDeckList();
void ReadPanelList(); void ReadPanelList();
void ReadContextList ( void ReadContextList (
......
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