public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] gentoo-x86 commit in app-office/libreoffice/files: libreoffice-4.4.1.2-improve-KDE4FilePicker.patch libreoffice-4.4.1.2-add-kde4-open-url-script.patch
@ 2015-02-26 20:02 Andreas HAttel (dilfridge)
  0 siblings, 0 replies; only message in thread
From: Andreas HAttel (dilfridge) @ 2015-02-26 20:02 UTC (permalink / raw
  To: gentoo-commits

dilfridge    15/02/26 20:02:58

  Added:                libreoffice-4.4.1.2-improve-KDE4FilePicker.patch
                        libreoffice-4.4.1.2-add-kde4-open-url-script.patch
  Log:
  Version bump
  
  (Portage version: 2.2.14/cvs/Linux x86_64, signed Manifest commit with key 94BFDF4484AD142F)

Revision  Changes    Path
1.1                  app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.1.2-improve-KDE4FilePicker.patch?rev=1.1&content-type=text/plain

Index: libreoffice-4.4.1.2-improve-KDE4FilePicker.patch
===================================================================
Merged upstream commits:

6fc55b9abd783b624241d56e34751ea495adbd7d	"KDE4: actually apply file dialog operation mode"
b613270a730ace29dd1b16b29be2222b34f34a5d	"KDE4: improve default load and save dialog titles"


diff -u b/vcl/unx/kde4/KDE4FilePicker.cxx b/vcl/unx/kde4/KDE4FilePicker.cxx
--- b/vcl/unx/kde4/KDE4FilePicker.cxx
+++ b/vcl/unx/kde4/KDE4FilePicker.cxx
@@ -58,6 +58,8 @@
 
 #include "generic/geninst.h"
 
+#include "svids.hrc"
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::ui::dialogs;
 using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
@@ -109,7 +111,6 @@
 
 KDE4FilePicker::KDE4FilePicker( const uno::Reference<uno::XComponentContext>& )
     : KDE4FilePicker_Base(_helperMutex)
-    , _resMgr( ResMgr::CreateResMgr("fps_office") )
     , allowRemoteUrls( false )
 {
     _extraControls = new QWidget();
@@ -128,8 +129,7 @@
 #endif
 
     setMultiSelectionMode( false );
-    //default mode
-    _dialog->setOperationMode(KFileDialog::Opening);
+    _dialog->setConfirmOverwrite( true );
 
     // XExecutableDialog functions
     connect( this, SIGNAL( setTitleSignal( const OUString & ) ),
@@ -202,7 +202,6 @@
         SalYieldMutexReleaser aReleaser;
         return Q_EMIT cleanupProxySignal();
     }
-    delete _resMgr;
     delete _dialog;
 }
 
@@ -524,6 +523,24 @@
     return toOUString(label);
 }
 
+QString KDE4FilePicker::getResString( sal_Int16 aRedId )
+{
+    QString aResString;
+
+    if( aRedId < 0 )
+        return aResString;
+
+    try
+    {
+        aResString = toQString(ResId(aRedId, *ImplGetResMgr()).toString());
+    }
+    catch(...)
+    {
+    }
+
+    return aResString.replace('~', '&');
+}
+
 void KDE4FilePicker::addCustomControl(sal_Int16 controlId)
 {
     QWidget* widget = 0;
@@ -532,37 +549,37 @@
     switch (controlId)
     {
         case CHECKBOX_AUTOEXTENSION:
-            resId = STR_SVT_FILEPICKER_AUTO_EXTENSION;
+            resId = STR_FPICKER_AUTO_EXTENSION;
             break;
         case CHECKBOX_PASSWORD:
-            resId = STR_SVT_FILEPICKER_PASSWORD;
+            resId = STR_FPICKER_PASSWORD;
             break;
         case CHECKBOX_FILTEROPTIONS:
-            resId = STR_SVT_FILEPICKER_FILTER_OPTIONS;
+            resId = STR_FPICKER_FILTER_OPTIONS;
             break;
         case CHECKBOX_READONLY:
-            resId = STR_SVT_FILEPICKER_READONLY;
+            resId = STR_FPICKER_READONLY;
             break;
         case CHECKBOX_LINK:
-            resId = STR_SVT_FILEPICKER_INSERT_AS_LINK;
+            resId = STR_FPICKER_INSERT_AS_LINK;
             break;
         case CHECKBOX_PREVIEW:
-            resId = STR_SVT_FILEPICKER_SHOW_PREVIEW;
+            resId = STR_FPICKER_SHOW_PREVIEW;
             break;
         case CHECKBOX_SELECTION:
-            resId = STR_SVT_FILEPICKER_SELECTION;
+            resId = STR_FPICKER_SELECTION;
             break;
         case PUSHBUTTON_PLAY:
-            resId = STR_SVT_FILEPICKER_PLAY;
+            resId = STR_FPICKER_PLAY;
             break;
         case LISTBOX_VERSION:
-            resId = STR_SVT_FILEPICKER_VERSION;
+            resId = STR_FPICKER_VERSION;
             break;
         case LISTBOX_TEMPLATE:
-            resId = STR_SVT_FILEPICKER_TEMPLATES;
+            resId = STR_FPICKER_TEMPLATES;
             break;
         case LISTBOX_IMAGE_TEMPLATE:
-            resId = STR_SVT_FILEPICKER_IMAGE_TEMPLATE;
+            resId = STR_FPICKER_IMAGE_TEMPLATE;
             break;
         case LISTBOX_VERSION_LABEL:
         case LISTBOX_TEMPLATE_LABEL:
@@ -581,16 +598,7 @@
         case CHECKBOX_PREVIEW:
         case CHECKBOX_SELECTION:
         {
-            QString label;
-
-            if (_resMgr && resId != -1)
-            {
-                OUString s(ResId(resId, *_resMgr).toString());
-                label = toQString(s);
-                label.replace("~", "&");
-            }
-
-            widget = new QCheckBox(label, _extraControls);
+            widget = new QCheckBox(getResString(resId), _extraControls);
 
             // the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
             // code, but the checkbox is hidden and ignored
@@ -719,8 +727,22 @@
                     1 );
     }
 
-    _dialog->setOperationMode(operationMode);
-    _dialog->setConfirmOverwrite(true);
+    _dialog->setOperationMode( operationMode );
+
+    sal_Int16 resId = -1;
+    switch (_dialog->operationMode())
+    {
+    case KFileDialog::Opening:
+        resId = STR_FPICKER_OPEN;
+        break;
+    case KFileDialog::Saving:
+        resId = STR_FPICKER_SAVE;
+        break;
+    default:
+        break;
+    }
+
+    _dialog->setCaption(getResString(resId));
 }
 
 void SAL_CALL KDE4FilePicker::cancel()
only in patch2:
unchanged:
--- a/vcl/unx/kde4/KDE4FilePicker.hxx
+++ b/vcl/unx/kde4/KDE4FilePicker.hxx
@@ -41,8 +41,6 @@ class KFileDialog;
 class QWidget;
 class QLayout;
 
-class ResMgr;
-
 typedef ::cppu::WeakComponentImplHelper5
 <   ::com::sun::star::ui::dialogs::XFilePicker2
 ,   ::com::sun::star::ui::dialogs::XFilePicker3
@@ -61,8 +59,6 @@ protected:
 
     ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
 
-    ResMgr *_resMgr;
-
     //the dialog to display
     KFileDialog* _dialog;
 
@@ -225,6 +221,8 @@ private:
     //add a custom control widget to the file dialog
     void addCustomControl(sal_Int16 controlId);
 
+    QString getResString( sal_Int16 aRedId );
+
 private Q_SLOTS:
     void cleanupProxy();
     void checkProtocol();



1.1                  app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch

file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch?rev=1.1&view=markup
plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-office/libreoffice/files/libreoffice-4.4.1.2-add-kde4-open-url-script.patch?rev=1.1&content-type=text/plain

Index: libreoffice-4.4.1.2-add-kde4-open-url-script.patch
===================================================================
From f7db2461292be3e23f5b3af47e488eaa8105d8db Mon Sep 17 00:00:00 2001
From: Jan-Marek Glogowski <glogow@fbihome.de>
Date: Wed, 26 Nov 2014 13:35:42 +0100
Subject: Add kde4-open-url script

Adds a KDE4 specific URL processing script.

Change-Id: I0116fa95f076a5772e88c616e93de542fe4fe4e4

diff --git a/shell/Package_scripts_kde.mk b/shell/Package_scripts_kde.mk
index c5e4978..162bcc5 100644
--- a/shell/Package_scripts_kde.mk
+++ b/shell/Package_scripts_kde.mk
@@ -9,6 +9,12 @@
 
 $(eval $(call gb_Package_Package,shell_scripts_kde,$(SRCDIR)/shell/source/unix/misc))
 
+ifeq ($(ENABLE_KDE),TRUE)
 $(eval $(call gb_Package_add_file,shell_scripts_kde,$(LIBO_BIN_FOLDER)/kde-open-url,kde-open-url.sh))
+endif
+
+ifeq ($(ENABLE_KDE4),TRUE)
+$(eval $(call gb_Package_add_file,shell_scripts_kde,$(LIBO_BIN_FOLDER)/kde4-open-url,kde4-open-url.sh))
+endif
 
 # vim: set shiftwidth=4 tabstop=4 noexpandtab:
diff --git a/shell/source/unix/misc/kde4-open-url.sh b/shell/source/unix/misc/kde4-open-url.sh
new file mode 100755
index 0000000..e5b8125
--- /dev/null
+++ b/shell/source/unix/misc/kde4-open-url.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+#
+# 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/.
+#
+# This file incorporates work covered by the following license notice:
+#
+#   Licensed to the Apache Software Foundation (ASF) under one or more
+#   contributor license agreements. See the NOTICE file distributed
+#   with this work for additional information regarding copyright
+#   ownership. The ASF licenses this file to you under the Apache
+#   License, Version 2.0 (the "License"); you may not use this file
+#   except in compliance with the License. You may obtain a copy of
+#   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+#
+
+# use kde-open or xdg-open if available, falling back to our own open-url
+kde-open "$1" 2>/dev/null || xdg-open "$1" 2>/dev/null || `dirname "$0"`/open-url "$1" 2>/dev/null
+exit 0
-- 
cgit v0.10.2





^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2015-02-26 20:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-26 20:02 [gentoo-commits] gentoo-x86 commit in app-office/libreoffice/files: libreoffice-4.4.1.2-improve-KDE4FilePicker.patch libreoffice-4.4.1.2-add-kde4-open-url-script.patch Andreas HAttel (dilfridge)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox