From 26c106a5aeca3e50d1e3c3d37e622b2743a23bca Mon Sep 17 00:00:00 2001 From: Szymon Kłos Date: Thu, 30 Jul 2015 12:41:38 +0200 Subject: append '(Remote)' in the titlebar when remote file is opened Change-Id: Idf0a9594406601154319ae17e42ece4bf2d56dc9 --- framework/inc/classes/resource.hrc | 1 + framework/source/classes/resource.src | 5 +++++ framework/source/fwe/helper/titlehelper.cxx | 13 +++++++++++++ 3 files changed, 19 insertions(+) (limited to 'framework') diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc index 2b1ea1c56f31..c7fc3946aa78 100644 --- a/framework/inc/classes/resource.hrc +++ b/framework/inc/classes/resource.hrc @@ -52,6 +52,7 @@ #define STR_LANGSTATUS_HINT (RID_STR_START+25) #define STR_OPEN_REMOTE (RID_STR_START+26) #define STR_REMOTE_FILE (RID_STR_START+27) +#define STR_REMOTE_TITLE (RID_STR_START+28) #define POPUPMENU_TOOLBAR_QUICKCUSTOMIZATION (RID_MENU_START+0) diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src index 44e0c70cb193..570e2884b713 100644 --- a/framework/source/classes/resource.src +++ b/framework/source/classes/resource.src @@ -124,6 +124,11 @@ String STR_REMOTE_FILE Text [ en-US ] = "Save Remote File..."; }; +String STR_REMOTE_TITLE +{ + Text [ en-US ] = " (Remote)"; +}; + 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 d8c44d37b74b..64d547ee4fd6 100644 --- a/framework/source/fwe/helper/titlehelper.cxx +++ b/framework/source/fwe/helper/titlehelper.cxx @@ -18,6 +18,8 @@ */ #include +#include +#include #include #include @@ -409,6 +411,7 @@ void TitleHelper::impl_updateTitleForController (const css::uno::Reference< css: nLeasedNumber = xNumbers->leaseNumber (xOwner); css::uno::Reference< css::frame::XTitle > xModelTitle(xController->getModel (), css::uno::UNO_QUERY); + css::uno::Reference< css::frame::XModel > xModel(xController->getModel (), css::uno::UNO_QUERY); if (!xModelTitle.is ()) xModelTitle.set(xController, css::uno::UNO_QUERY); if (xModelTitle.is ()) @@ -419,6 +422,16 @@ void TitleHelper::impl_updateTitleForController (const css::uno::Reference< css: sTitle.appendAscii (" : "); sTitle.append ((::sal_Int32)nLeasedNumber); } + if (xModel.is ()) + { + INetURLObject aURL (xModel->getURL ()); + if (aURL.GetProtocol () != INetProtocol::File + && aURL.GetProtocol () != INetProtocol::NotValid) + { + OUString sRemoteText (FwkResId (STR_REMOTE_TITLE)); + sTitle.append (sRemoteText); + } + } } else { -- cgit