summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/sfx2/infobar.hxx1
-rw-r--r--officecfg/files.mk1
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs53
-rw-r--r--postprocess/CustomTarget_registry.mk1
-rw-r--r--sfx2/source/dialog/infobar.cxx20
5 files changed, 76 insertions, 0 deletions
diff --git a/include/sfx2/infobar.hxx b/include/sfx2/infobar.hxx
index 08de31318517..dc016a53a60b 100644
--- a/include/sfx2/infobar.hxx
+++ b/include/sfx2/infobar.hxx
@@ -114,6 +114,7 @@ public:
VclPtr<SfxInfoBarWindow> getInfoBar(const OUString& sId);
bool hasInfoBarWithID(const OUString& sId);
void removeInfoBar(VclPtr<SfxInfoBarWindow> const& pInfoBar);
+ static bool isInfobarEnabled(const OUString& sId);
virtual void Resize() override;
};
diff --git a/officecfg/files.mk b/officecfg/files.mk
index 54b875ece4ac..5244654af01c 100644
--- a/officecfg/files.mk
+++ b/officecfg/files.mk
@@ -76,6 +76,7 @@ officecfg_XCSFILES := \
Office/UI/GenericCommands \
Office/UI/GlobalSettings \
Office/UI/ImpressWindowState \
+ Office/UI/Infobar \
Office/UI/MathCommands \
Office/UI/MathWindowState \
Office/UI/ReportCommands \
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs
new file mode 100644
index 000000000000..af0434046770
--- /dev/null
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Infobar.xcs
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+-->
+<!DOCTYPE oor:component-schema SYSTEM "../../../../../component-schema.dtd">
+<oor:component-schema xmlns:oor="http://openoffice.org/2001/registry" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" oor:name="Infobar" oor:package="org.openoffice.Office.UI" xml:lang="en-US">
+ <info>
+ <desc>Infobar configuration.</desc>
+ </info>
+ <template></template>
+ <component>
+ <group oor:name="Enabled">
+ <info>
+ <desc>Which Infobars are enabled.</desc>
+ </info>
+ <prop oor:name="Readonly" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Whether the Infobar shown in read-only docs is enabled</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Signature" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Whether the Infobar showing the Digital Signature state is enabled</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="Donate" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Whether the Infobar showing the call for donations is enabled</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="GetInvolved" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Whether the Infobar showing the call to 'Get Involved' is enabled</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ <prop oor:name="HyphenationMissing" oor:type="xs:boolean" oor:nillable="false">
+ <info>
+ <desc>Whether an Infobar is shown when Hyphenation Info is missing for a document</desc>
+ </info>
+ <value>true</value>
+ </prop>
+ </group>
+ </component>
+</oor:component-schema>
diff --git a/postprocess/CustomTarget_registry.mk b/postprocess/CustomTarget_registry.mk
index 0e2af975255f..a5b520992786 100644
--- a/postprocess/CustomTarget_registry.mk
+++ b/postprocess/CustomTarget_registry.mk
@@ -181,6 +181,7 @@ postprocess_FILES_main := \
$(postprocess_XCS)/Office/UI/GenericCategories.xcs \
$(postprocess_XCS)/Office/UI/GenericCommands.xcs \
$(postprocess_XCS)/Office/UI/GlobalSettings.xcs \
+ $(postprocess_XCS)/Office/UI/Infobar.xcs \
$(postprocess_XCS)/Office/UI/Sidebar.xcs \
$(postprocess_XCS)/Office/UI/StartModuleCommands.xcs \
$(postprocess_XCS)/Office/UI/StartModuleWindowState.xcs \
diff --git a/sfx2/source/dialog/infobar.cxx b/sfx2/source/dialog/infobar.cxx
index 2c8d18bc0f04..771bda8f4e6c 100644
--- a/sfx2/source/dialog/infobar.cxx
+++ b/sfx2/source/dialog/infobar.cxx
@@ -14,6 +14,7 @@
#include <drawinglayer/processor2d/baseprocessor2d.hxx>
#include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
#include <memory>
+#include <officecfg/Office/UI/Infobar.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/infobar.hxx>
@@ -393,6 +394,9 @@ SfxInfoBarContainerWindow::appendInfoBar(const OUString& sId, const OUString& sP
const OUString& sSecondaryMessage, InfobarType ibType,
WinBits nMessageStyle, bool bShowCloseButton)
{
+ if (!isInfobarEnabled(sId))
+ return nullptr;
+
auto pInfoBar = VclPtr<SfxInfoBarWindow>::Create(this, sId, sPrimaryMessage, sSecondaryMessage,
ibType, nMessageStyle, bShowCloseButton);
@@ -438,6 +442,22 @@ void SfxInfoBarContainerWindow::removeInfoBar(VclPtr<SfxInfoBarWindow> const& pI
m_pChildWin->Update();
}
+bool SfxInfoBarContainerWindow::isInfobarEnabled(const OUString& sId)
+{
+ if (sId == "readonly")
+ return officecfg::Office::UI::Infobar::Enabled::Readonly::get();
+ if (sId == "signature")
+ return officecfg::Office::UI::Infobar::Enabled::Signature::get();
+ if (sId == "donate")
+ return officecfg::Office::UI::Infobar::Enabled::Donate::get();
+ if (sId == "getinvolved")
+ return officecfg::Office::UI::Infobar::Enabled::GetInvolved::get();
+ if (sId == "hyphenationmissing")
+ return officecfg::Office::UI::Infobar::Enabled::HyphenationMissing::get();
+
+ return true;
+}
+
void SfxInfoBarContainerWindow::Resize()
{
long nWidth = GetSizePixel().getWidth();