[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - framework/inc framework/source

Szymon Kłos eszkadev at gmail.com
Thu Jul 30 03:43:55 PDT 2015


 framework/inc/classes/resource.hrc          |    1 +
 framework/source/classes/resource.src       |    5 +++++
 framework/source/fwe/helper/titlehelper.cxx |   13 +++++++++++++
 3 files changed, 19 insertions(+)

New commits:
commit e4b6dae384a3a53ad19aea707c92f96846834a89
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Thu Jul 30 12:41:38 2015 +0200

    append '(Remote)' in the titlebar when remote file is opened
    
    Change-Id: Idf0a9594406601154319ae17e42ece4bf2d56dc9

diff --git a/framework/inc/classes/resource.hrc b/framework/inc/classes/resource.hrc
index 2b1ea1c..c7fc394 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 44e0c70..570e288 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 d8c44d3..64d547e 100644
--- a/framework/source/fwe/helper/titlehelper.cxx
+++ b/framework/source/fwe/helper/titlehelper.cxx
@@ -18,6 +18,8 @@
  */
 
 #include <framework/titlehelper.hxx>
+#include <classes/fwkresid.hxx>
+#include <classes/resource.hrc>
 #include <services.h>
 #include <properties.h>
 
@@ -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
     {


More information about the Libreoffice-commits mailing list