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
......@@ -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>
......
......@@ -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)
{
}
......
......@@ -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);
......
......@@ -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)
{
}
......
......@@ -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);
......
......@@ -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")));
......
......@@ -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 (
......
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