summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-11-03 09:26:02 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-11-03 12:20:11 +0000
commit291d8d4f9460f8d5292cab2ef706fd8b501641b4 (patch)
treee6f8a794a91332ad1ce5bcb9a0b6a6ea000fa447
parente509c22863b5184421e710cf8ae81e2ddc961623 (diff)
SafeMode: Add indicator to window title when in Safe Mode
Change-Id: I1d8350315768093b4c4af1cd8b732602c5217edb Reviewed-on: https://gerrit.libreoffice.org/30518 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r--framework/inc/classes/resource.hrc1
-rw-r--r--framework/source/classes/resource.src5
-rw-r--r--framework/source/fwe/helper/titlehelper.cxx8
-rw-r--r--include/framework/titlehelper.hxx1
4 files changed, 15 insertions, 0 deletions
diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc
index 49c051c3ea8d..f3ad7e64981b 100644
--- a/framework/inc/classes/resource.hrc
+++ b/framework/inc/classes/resource.hrc
@@ -51,6 +51,7 @@
#define STR_CLEAR_RECENT_FILES_HELP (RID_STR_START+24)
#define STR_LANGSTATUS_HINT (RID_STR_START+25)
#define STR_REMOTE_TITLE (RID_STR_START+26)
+#define STR_SAFEMODE_TITLE (RID_STR_START+27)
#define IMG_SAVEMODIFIED_SMALL (RID_IMAGE_START+0)
#define IMG_SAVEMODIFIED_LARGE (RID_IMAGE_START+1)
diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index dd5d8772031b..a95149f7ffcf 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -118,6 +118,11 @@ String STR_REMOTE_TITLE
Text [ en-US ] = " (Remote)";
};
+String STR_SAFEMODE_TITLE
+{
+ Text [ en-US ] = " (Safe Mode)";
+};
+
String STR_TOOLBAR_TITLE_ADDON
{
Text [ en-US ] = "Add-On %num%";
diff --git a/framework/source/fwe/helper/titlehelper.cxx b/framework/source/fwe/helper/titlehelper.cxx
index cbd18f96af17..1e7e797590f8 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -37,6 +37,7 @@
#include <osl/mutex.hxx>
#include <tools/urlobj.hxx>
#include <vcl/opengl/OpenGLWrapper.hxx>
+#include <vcl/svapp.hxx>
namespace framework{
@@ -492,6 +493,7 @@ void TitleHelper::impl_updateTitleForFrame (const css::uno::Reference< css::fram
impl_appendModuleName (sTitle);
impl_appendDebugVersion (sTitle);
#endif
+ impl_appendSafeMode (sTitle);
// SYNCHRONIZED ->
aLock.reset ();
@@ -579,6 +581,12 @@ void TitleHelper::impl_appendDebugVersion (OUStringBuffer&)
}
#endif
+void TitleHelper::impl_appendSafeMode (OUStringBuffer& sTitle)
+{
+ if (Application::IsSafeModeEnabled())
+ sTitle.append(FwkResId (STR_SAFEMODE_TITLE));
+}
+
void TitleHelper::impl_startListeningForModel (const css::uno::Reference< css::frame::XModel >& xModel)
{
css::uno::Reference< css::document::XDocumentEventBroadcaster > xBroadcaster(xModel, css::uno::UNO_QUERY);
diff --git a/include/framework/titlehelper.hxx b/include/framework/titlehelper.hxx
index 48c05c92bf93..5fe23b7d46d9 100644
--- a/include/framework/titlehelper.hxx
+++ b/include/framework/titlehelper.hxx
@@ -160,6 +160,7 @@ class FWE_DLLPUBLIC TitleHelper : private ::cppu::BaseMutex
void impl_appendProductName (OUStringBuffer& sTitle);
void impl_appendModuleName (OUStringBuffer& sTitle);
void impl_appendDebugVersion (OUStringBuffer& sTitle);
+ void impl_appendSafeMode (OUStringBuffer& sTitle);
void impl_setSubTitle (const css::uno::Reference< css::frame::XTitle >& xSubTitle);