[Libreoffice-commits] core.git: 27 commits - configure.ac vcl/CustomTarget_kde5_moc.mk vcl/Library_vclplug_kde5.mk vcl/unx
Katarina Behrens
Katarina.Behrens at cib.de
Mon Jun 18 13:29:00 UTC 2018
configure.ac | 2
vcl/CustomTarget_kde5_moc.mk | 1
vcl/Library_vclplug_kde5.mk | 11
vcl/unx/kde5/FPServiceInfo.hxx | 28 -
vcl/unx/kde5/KDE5FilePicker.hxx | 231 +++++++++++
vcl/unx/kde5/KDE5FilePicker2.cxx | 712 ++++++++++++++++++++++++++++++++++++
vcl/unx/kde5/KDE5SalDisplay.cxx | 93 ----
vcl/unx/kde5/KDE5SalDisplay.hxx | 45 --
vcl/unx/kde5/KDE5SalFrame.hxx | 2
vcl/unx/kde5/KDE5SalGraphics.hxx | 2
vcl/unx/kde5/KDE5SalInstance.cxx | 12
vcl/unx/kde5/KDE5SalInstance.hxx | 3
vcl/unx/kde5/VCLKDE5Application.cxx | 76 ---
vcl/unx/kde5/VCLKDE5Application.hxx | 41 --
14 files changed, 958 insertions(+), 301 deletions(-)
New commits:
commit 4bd93b662f5ad0556d573cb67ae7f4da5577ee23
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jun 18 11:24:36 2018 +0200
VCLKDE5Application is now unused as well
Change-Id: Ib11274b6039596246aa232b83fa4d85095a93e08
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 11fa740926e4..4d134d0fbf8b 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -84,7 +84,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
vcl/unx/kde5/KDE5SalFrame \
vcl/unx/kde5/KDE5SalGraphics \
vcl/unx/kde5/KDE5SalInstance \
- vcl/unx/kde5/VCLKDE5Application \
))
ifeq ($(OS),LINUX)
diff --git a/vcl/unx/kde5/VCLKDE5Application.cxx b/vcl/unx/kde5/VCLKDE5Application.cxx
deleted file mode 100644
index 2d9532f1def9..000000000000
--- a/vcl/unx/kde5/VCLKDE5Application.cxx
+++ /dev/null
@@ -1,75 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#include "VCLKDE5Application.hxx"
-
-#include <QtGui/QClipboard>
-#include <QtCore/QEvent>
-#include <assert.h>
-
-VCLKDE5Application::VCLKDE5Application(int argc, char** argv)
- : QApplication(argc, argv)
-{
-}
-
-// various hacks to be performed before re-entering Qt's event loop
-// because of showing a Qt dialog
-void VCLKDE5Application::preDialogSetup()
-{
- // KFileDialog integration requires using event loop with QClipboard.
- // Opening the KDE file dialog here can lead to QClipboard
- // asking for clipboard contents. If LO core is the owner of the clipboard
- // content, without event loop use this will block for 5 seconds and timeout,
- // since the clipboard thread will not be able to acquire SolarMutex
- // and thus won't be able to respond. If the event loops
- // are properly integrated and QClipboard can use a nested event loop
- // (see the KDE VCL plug), then this won't happen.
- // We cannot simply release SolarMutex here, because the event loop started
- // by the file dialog would also call back to LO code.
- assert(QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool());
-}
-
-// various hacks to be performed after a Qt dialog has been closed
-void VCLKDE5Application::postDialogCleanup()
-{
- // HACK: KFileDialog uses KConfig("kdeglobals") for saving some settings
- // (such as the auto-extension flag), but that doesn't update KGlobal::config()
- // (which is probably a KDE bug), so force reading the new configuration,
- // otherwise the next opening of the dialog would use the old settings.
- KConfig config;
- config.reparseConfiguration();
- // HACK: If Qt owns clipboard or selection, give up on their ownership now. Otherwise
- // LO core might ask for the contents, but it would block while doing so (i.e. it
- // doesn't seem to have an equivalent of QClipboard's "useEventLoopWhenWaiting"),
- // therefore QClipboard wouldn't be able to respond, and whole LO would block until
- // a timeout. Given that Klipper is most probably running, giving up clipboard/selection
- // ownership will not only avoid the blocking, but even pasting that content in LO
- // will in fact work, if Klipper can handle it.
- // Technically proper solution would be of course to allow Qt to process QClipboard
- // events while LO waits for clipboard contents, or short-circuit to QClipboard somehow
- // (it's a mystery why LO's clipboard handling has its own thread when whole LO can
- // get blocked by both trying to send and receive clipboard contents anyway).
- QClipboard* clipboard = QApplication::clipboard();
- if (clipboard->ownsSelection())
- clipboard->clear(QClipboard::Selection);
- if (clipboard->ownsClipboard())
- clipboard->clear();
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/VCLKDE5Application.hxx b/vcl/unx/kde5/VCLKDE5Application.hxx
deleted file mode 100644
index 5503db32c901..000000000000
--- a/vcl/unx/kde5/VCLKDE5Application.hxx
+++ /dev/null
@@ -1,41 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#ifndef INCLUDED_VCL_UNX_KDE5_VCLKDE5APPLICATION_HXX
-#define INCLUDED_VCL_UNX_KDE5_VCLKDE5APPLICATION_HXX
-
-#pragma once
-
-#include <QtWidgets/QApplication>
-#include <QtCore/QAbstractNativeEventFilter>
-#include <KConfigCore/kconfig.h>
-
-#undef Region
-
-class VCLKDE5Application : public QApplication, public QAbstractNativeEventFilter
-{
-public:
- VCLKDE5Application(int argc, char** argv);
- static void preDialogSetup();
- static void postDialogCleanup();
-};
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit a39e55c359b0d4d2a2f3f0766ac47c3aaa96fffd
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jun 18 11:15:02 2018 +0200
Drop cargo-cult FPServiceInfo
FILE_PICKER_SERVICE_NAME wasn't even used anywhere
Change-Id: Ie99de85175b8321948612c680c4e4d956a4c7efc
diff --git a/vcl/unx/kde5/FPServiceInfo.hxx b/vcl/unx/kde5/FPServiceInfo.hxx
deleted file mode 100644
index ec58684d4919..000000000000
--- a/vcl/unx/kde5/FPServiceInfo.hxx
+++ /dev/null
@@ -1,28 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#pragma once
-
-// the service names
-#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
-
-// the implementation names
-#define FILE_PICKER_IMPL_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 778608e1edb9..ce8af6a7eaf2 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -31,7 +31,6 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <osl/mutex.hxx>
-#include "FPServiceInfo.hxx"
#undef Region
@@ -664,7 +663,7 @@ void KDE5FilePicker::disposing(const lang::EventObject& rEvent)
OUString SAL_CALL KDE5FilePicker::getImplementationName()
{
- return OUString(FILE_PICKER_IMPL_NAME);
+ return OUString("com.sun.star.ui.dialogs.KDE5FilePicker");
}
sal_Bool SAL_CALL KDE5FilePicker::supportsService(const OUString& ServiceName)
commit f103d482ebc5611d00f0136d3f55aac34827e18b
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jun 18 10:36:50 2018 +0200
Fold all the rest into KDE5FilePicker2
Change-Id: Icbaa56057776ffcb981207ec30e5d94d6901e43c
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 655ae6b80d96..11fa740926e4 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -79,7 +79,6 @@ $(eval $(call gb_Library_add_libs,vclplug_kde5,\
))
$(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
- vcl/unx/kde5/KDE5FilePicker \
vcl/unx/kde5/KDE5FilePicker2 \
vcl/unx/kde5/KDE5SalData \
vcl/unx/kde5/KDE5SalFrame \
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
deleted file mode 100644
index 19bea46654a3..000000000000
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ /dev/null
@@ -1,59 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#include "KDE5FilePicker.hxx"
-
-#include <KWindowSystem>
-#include <KFileWidget>
-
-#include <QtCore/QDebug>
-#include <QtCore/QUrl>
-#include <QtGui/QClipboard>
-#include <QtGui/QWindow>
-#include <QtWidgets/QCheckBox>
-#include <QtWidgets/QFileDialog>
-#include <QtWidgets/QGridLayout>
-#include <QtWidgets/QWidget>
-#include <QtWidgets/QApplication>
-
-// KDE5FilePicker
-
-KDE5FilePicker::~KDE5FilePicker()
-{
- delete _extraControls;
- delete _dialog;
-}
-
-bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
-{
- if (e->type() == QEvent::Show && o->isWidgetType())
- {
- auto* w = static_cast<QWidget*>(o);
- if (!w->parentWidget() && w->isModal())
- {
- if (auto* fileWidget = w->findChild<KFileWidget*>({}, Qt::FindDirectChildrenOnly))
- fileWidget->setCustomWidget(_extraControls);
- }
- }
- return QObject::eventFilter(o, e);
-}
-
-#include <KDE5FilePicker.moc>
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index b7c3320344bf..778608e1edb9 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -48,6 +48,7 @@
#include <QtWidgets/QGridLayout>
#include <QtWidgets/QWidget>
#include <QtWidgets/QApplication>
+#include <KFileWidget>
#include <fpicker/strings.hrc>
#include <strings.hrc>
@@ -141,6 +142,12 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
qApp->installEventFilter(this);
}
+KDE5FilePicker::~KDE5FilePicker()
+{
+ delete _extraControls;
+ delete _dialog;
+}
+
void SAL_CALL
KDE5FilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener)
{
@@ -687,4 +694,20 @@ void KDE5FilePicker::selectionChanged()
m_xListener->fileSelectionChanged(aEvent);
}
+bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
+{
+ if (e->type() == QEvent::Show && o->isWidgetType())
+ {
+ auto* w = static_cast<QWidget*>(o);
+ if (!w->parentWidget() && w->isModal())
+ {
+ if (auto* fileWidget = w->findChild<KFileWidget*>({}, Qt::FindDirectChildrenOnly))
+ fileWidget->setCustomWidget(_extraControls);
+ }
+ }
+ return QObject::eventFilter(o, e);
+}
+
+#include <KDE5FilePicker.moc>
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 47b0285d7b37b2f646ae32ca1fe8cf6f1875997a
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jun 15 15:30:16 2018 +0200
Drop winId and KWindowSystem::setMainWindow
as fpicker isn't a separate binary anymore
Change-Id: I9c9c57a21f5dc79714f37f8bc65b998887c29e78
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 5d9acdcd7a50..19bea46654a3 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -40,8 +40,6 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; }
-
bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
{
if (e->type() == QEvent::Show && o->isWidgetType())
@@ -49,7 +47,6 @@ bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
auto* w = static_cast<QWidget*>(o);
if (!w->parentWidget() && w->isModal())
{
- KWindowSystem::setMainWindow(w, _winId);
if (auto* fileWidget = w->findChild<KFileWidget*>({}, Qt::FindDirectChildrenOnly))
fileWidget->setCustomWidget(_extraControls);
}
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 4b45052827c4..69d86c5107a9 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -78,8 +78,6 @@ protected:
//layout for extra custom controls
QGridLayout* _layout;
- sal_uIntPtr _winId;
-
bool allowRemoteUrls;
public:
@@ -140,8 +138,6 @@ public:
// XFilePicker2 functions
virtual css::uno::Sequence<OUString> SAL_CALL getSelectedFiles() override;
- void setWinId(sal_uIntPtr winId);
-
// XInitialization
virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index cebd2ee4f4f9..b7c3320344bf 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -82,7 +82,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
, _dialog(new QFileDialog(nullptr, {}, QDir::homePath()))
, _extraControls(new QWidget)
, _layout(new QGridLayout(_extraControls))
- , _winId(0)
, allowRemoteUrls(false)
{
_dialog->setSupportedSchemes({
commit 2d92d754aeb03da256cc617f15d1ae377aa2b651
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jun 15 14:35:20 2018 +0200
Fold enableFolderMode into ctor
Change-Id: I8674395271b83d9c50477bdf0242cd9f46af7a30
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 7a30359ef580..5d9acdcd7a50 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -34,12 +34,6 @@
// KDE5FilePicker
-void KDE5FilePicker::enableFolderMode()
-{
- _dialog->setOption(QFileDialog::ShowDirsOnly, true);
- _dialog->setFileMode(QFileDialog::Directory);
-}
-
KDE5FilePicker::~KDE5FilePicker()
{
delete _extraControls;
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 4fae59304fed..4b45052827c4 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -86,8 +86,6 @@ public:
explicit KDE5FilePicker(QFileDialog::FileMode);
virtual ~KDE5FilePicker() override;
- void enableFolderMode();
-
// XFilePickerNotifier
virtual void SAL_CALL addFilePickerListener(
const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index bc37f3c02127..cebd2ee4f4f9 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -94,8 +94,15 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
QStringLiteral("webdavs"),
QStringLiteral("smb"),
});
+
_dialog->setFileMode(eMode);
+ if (eMode == QFileDialog::Directory)
+ {
+ _dialog->setOption(QFileDialog::ShowDirsOnly, true);
+ _dialog->setWindowTitle(toQString(VclResId(STR_FPICKER_FOLDER_DEFAULT_TITLE)));
+ }
+
setMultiSelectionMode(false);
connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged);
commit d7fc00e1f7ab7a44e6102afdb371c999bda5f34f
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jun 15 13:14:34 2018 +0200
Fix suggesting file name (for new documents)
Change-Id: I39eb672f7dd097e12ddb323ce702c6c28235b5d9
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 72519f656bec..bc37f3c02127 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -190,7 +190,7 @@ void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name)
return Q_EMIT setDefaultNameSignal(name);
}
- _dialog->selectUrl(QUrl(toQString(name)));
+ _dialog->selectFile(toQString(name));
}
void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir)
commit 0527d831a5c49e0a52c7a72040ee1049dc34c3c7
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 14 17:09:45 2018 +0200
Fix copy&pasta
Change-Id: I493fa7a14557a919fab6bc6cf9f955507488af6d
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 3a6f2e9b94c4..4fae59304fed 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -197,7 +197,7 @@ private Q_SLOTS:
OUString getDisplayDirectorySlot() { return getDisplayDirectory(); }
void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue)
{
- return setValue(nControlAction, nControlAction, rValue);
+ return setValue(nControlId, nControlAction, rValue);
}
css::uno::Any getValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction)
commit c9e002799b4aae662265c723853342035e9dced0
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 14 17:08:17 2018 +0200
Implement get|setLabel, signal+slot
Change-Id: I0188f7609b7a934949ffdf0a6e64547b08ff03a8
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 95eb6a5c3ba7..7a30359ef580 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -46,33 +46,6 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-/*void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label)
-{
- if (_customWidgets.contains(controlId))
- {
- QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
- if (cb)
- cb->setText(label);
- }
- else
- qWarning() << "set label on unknown control" << controlId;
-}
-
-QString KDE5FilePicker::getLabel(sal_Int16 controlId) const
-{
- QString label;
- if (_customWidgets.contains(controlId))
- {
- QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
- if (cb)
- label = cb->text();
- }
- else
- qWarning() << "get label on unknown control" << controlId;
-
- return label;
-}*/
-
void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; }
bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index fd0ed95da27a..3a6f2e9b94c4 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -180,6 +180,8 @@ Q_SIGNALS:
const css::uno::Any& rValue);
css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction);
void enableControlSignal(sal_Int16 nControlId, sal_Bool bEnable);
+ void setLabelSignal(sal_Int16 nControlId, const OUString& rLabel);
+ OUString getLabelSignal(sal_Int16 nControlId);
void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
void appendFilterGroupSignal(const OUString& rTitle,
const css::uno::Sequence<css::beans::StringPair>& rFilters);
@@ -208,6 +210,13 @@ private Q_SLOTS:
return enableControl(nControlId, bEnable);
}
+ void setLabelSlot(sal_Int16 nControId, const OUString& rLabel)
+ {
+ return setLabel(nControId, rLabel);
+ }
+
+ OUString getLabelSlot(sal_Int16 nControlId) { return getLabel(nControlId); }
+
void appendFilterSlot(const OUString& rTitle, const OUString& rFilter)
{
return appendFilter(rTitle, rFilter);
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index ad229c880001..72519f656bec 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -115,6 +115,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::setLabelSignal, this, &KDE5FilePicker::setLabelSlot,
+ Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::getLabelSignal, this, &KDE5FilePicker::getLabelSlot,
+ Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot,
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot,
@@ -374,11 +378,42 @@ void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable
SAL_WARN("vcl.kde5", "enable on unknown control" << controlId);
}
-void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) {}
+void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setLabelSignal(controlId, label);
+ }
+
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ cb->setText(toQString(label));
+ }
+ else
+ SAL_WARN("vcl.kde5", "set label on unknown control" << controlId);
+}
OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId)
{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT getLabelSignal(controlId);
+ }
+
OUString label;
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ label = toOUString(cb->text());
+ }
+ else
+ SAL_WARN("vcl.kde5", "get label on unknown control" << controlId);
+
return label;
}
commit 6b052ccff871cac50a63119fe324930ace86f190
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 14 14:21:35 2018 +0200
Implement enableControl, signal+slot
Change-Id: I84f81f689167ec332772c706b0d0c6d7562b5ac8
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index f69eb3435aa0..95eb6a5c3ba7 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -46,15 +46,7 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-/*void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable)
-{
- if (_customWidgets.contains(controlId))
- _customWidgets.value(controlId)->setEnabled(enable);
- else
- qWarning() << "enable on unknown control" << controlId;
-}
-
-void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label)
+/*void KDE5FilePicker::setLabel(sal_Int16 controlId, const QString& label)
{
if (_customWidgets.contains(controlId))
{
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index da2dd7a09d16..fd0ed95da27a 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -179,6 +179,7 @@ Q_SIGNALS:
void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction,
const css::uno::Any& rValue);
css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction);
+ void enableControlSignal(sal_Int16 nControlId, sal_Bool bEnable);
void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
void appendFilterGroupSignal(const OUString& rTitle,
const css::uno::Sequence<css::beans::StringPair>& rFilters);
@@ -202,6 +203,11 @@ private Q_SLOTS:
return getValue(nControlId, nControlAction);
}
+ void enableControlSlot(sal_Int16 nControlId, sal_Bool bEnable)
+ {
+ return enableControl(nControlId, bEnable);
+ }
+
void appendFilterSlot(const OUString& rTitle, const OUString& rFilter)
{
return appendFilter(rTitle, rFilter);
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 75488e88041b..ad229c880001 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -115,6 +115,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::enableControlSignal, this, &KDE5FilePicker::enableControlSlot,
+ Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot,
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterGroupSignal, this,
@@ -358,7 +360,19 @@ uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nContr
return uno::Any(value);
}
-void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable) {}
+void SAL_CALL KDE5FilePicker::enableControl(sal_Int16 controlId, sal_Bool enable)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT enableControlSignal(controlId, enable);
+ }
+
+ if (_customWidgets.contains(controlId))
+ _customWidgets.value(controlId)->setEnabled(enable);
+ else
+ SAL_WARN("vcl.kde5", "enable on unknown control" << controlId);
+}
void SAL_CALL KDE5FilePicker::setLabel(sal_Int16 controlId, const OUString& label) {}
commit 4add71a161bde3870934d754ab397ec7c0e22a92
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 14 12:36:48 2018 +0200
Implement getValue, signal+slot
Change-Id: Ic009ea5dc3ca3bf791d3348fce8d007022598c49
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 231e045f4ef5..f69eb3435aa0 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -46,22 +46,7 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-/*bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
-{
- bool ret = false;
- if (_customWidgets.contains(controlId))
- {
- QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
- if (cb)
- ret = cb->isChecked();
- }
- else
- qWarning() << "get value on unknown control" << controlId;
-
- return ret;
-}
-
-void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable)
+/*void KDE5FilePicker::enableControl(sal_Int16 controlId, bool enable)
{
if (_customWidgets.contains(controlId))
_customWidgets.value(controlId)->setEnabled(enable);
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 8fbc24f73a63..da2dd7a09d16 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -178,6 +178,7 @@ Q_SIGNALS:
OUString getDisplayDirectorySignal();
void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction,
const css::uno::Any& rValue);
+ css::uno::Any getValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction);
void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
void appendFilterGroupSignal(const OUString& rTitle,
const css::uno::Sequence<css::beans::StringPair>& rFilters);
@@ -196,6 +197,11 @@ private Q_SLOTS:
return setValue(nControlAction, nControlAction, rValue);
}
+ css::uno::Any getValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction)
+ {
+ return getValue(nControlId, nControlAction);
+ }
+
void appendFilterSlot(const OUString& rTitle, const OUString& rFilter)
{
return appendFilter(rTitle, rFilter);
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 87119f9e6bc9..75488e88041b 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -113,6 +113,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
&KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::getValueSignal, this, &KDE5FilePicker::getValueSlot,
+ Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot,
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterGroupSignal, this,
@@ -329,6 +331,12 @@ void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAc
uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT getValueSignal(controlId, nControlAction);
+ }
+
if (CHECKBOX_AUTOEXTENSION == controlId)
// We ignore this one and rely on QFileDialog to provide the function.
// Always return false, to pretend we do not support this, otherwise
@@ -338,6 +346,14 @@ uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nContr
return uno::Any(false);
bool value = false;
+ if (_customWidgets.contains(controlId))
+ {
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ value = cb->isChecked();
+ }
+ else
+ SAL_WARN("vcl.kde5", "get value on unknown control" << controlId);
return uno::Any(value);
}
commit 29e5096f9979dcc258e063232255591963146417
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Jun 13 13:51:46 2018 +0200
Add 2 more file/dir methods, signal+slot
Change-Id: I0152e4e0fa72e27a144ca96f83fe6a282b272cbe
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 5d87022e36fb..231e045f4ef5 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -46,11 +46,7 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-/*void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); }
-
-QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); }
-
-bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
+/*bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
{
bool ret = false;
if (_customWidgets.contains(controlId))
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index f1bbcf7545df..8fbc24f73a63 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -173,7 +173,9 @@ protected:
Q_SIGNALS:
void setTitleSignal(const OUString& rTitle);
+ void setDefaultNameSignal(const OUString& rName);
void setDisplayDirectorySignal(const OUString& rDir);
+ OUString getDisplayDirectorySignal();
void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction,
const css::uno::Any& rValue);
void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
@@ -186,7 +188,9 @@ Q_SIGNALS:
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
+ void setDefaultNameSlot(const OUString& rName) { return setDefaultName(rName); }
void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); }
+ OUString getDisplayDirectorySlot() { return getDisplayDirectory(); }
void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue)
{
return setValue(nControlAction, nControlAction, rValue);
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index fd0fedd7c7ac..87119f9e6bc9 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -102,9 +102,13 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged);
connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this,
&KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::setDefaultNameSignal, this, &KDE5FilePicker::setDefaultNameSlot,
+ Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this,
&KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::getDisplayDirectorySignal, this,
+ &KDE5FilePicker::getDisplayDirectorySlot, Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::setMultiSelectionSignal, this,
&KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot,
@@ -170,7 +174,16 @@ void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect)
_dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
}
-void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) {}
+void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setDefaultNameSignal(name);
+ }
+
+ _dialog->selectUrl(QUrl(toQString(name)));
+}
void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir)
{
@@ -185,7 +198,13 @@ void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir)
OUString SAL_CALL KDE5FilePicker::getDisplayDirectory()
{
- OUString dir;
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT getDisplayDirectorySignal();
+ }
+
+ OUString dir = toOUString(_dialog->directoryUrl().url());
return dir;
}
commit 024f054e2d0473c3ae4e3679948396adba0c9037
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Jun 13 13:09:13 2018 +0200
Implement setMultiSelectionMode, signal+slot
Change-Id: Idc411dc87a84b60a22fe7b6e7bba50b2c5302128
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 2e9f3bd66752..5d87022e36fb 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -46,12 +46,7 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-/*void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
-{
- _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
-}
-
-void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); }
+/*void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); }
QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); }
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 36cfb4263a11..f1bbcf7545df 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -182,6 +182,7 @@ Q_SIGNALS:
void setCurrentFilterSignal(const OUString& rFilter);
OUString getCurrentFilterSignal();
css::uno::Sequence<OUString> getSelectedFilesSignal();
+ void setMultiSelectionSignal(bool bMulti);
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
@@ -205,6 +206,7 @@ private Q_SLOTS:
void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); }
OUString getCurrentFilterSlot() { return getCurrentFilter(); }
css::uno::Sequence<OUString> getSelectedFilesSlot() { return getFiles(); }
+ void setMultiSelectionSlot(bool bMulti) { return setMultiSelectionMode(bMulti); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index da068240a502..fd0fedd7c7ac 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -105,6 +105,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this,
&KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::setMultiSelectionSignal, this,
+ &KDE5FilePicker::setMultiSelectionSlot, Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot,
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot,
@@ -119,7 +121,6 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
&KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
- setMultiSelectionMode(false);
}
void SAL_CALL
@@ -158,7 +159,16 @@ sal_Int16 SAL_CALL KDE5FilePicker::execute()
return _dialog->exec() == QFileDialog::Accepted;
}
-void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) {}
+void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setMultiSelectionSignal(multiSelect);
+ }
+
+ _dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
+}
void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) {}
@@ -170,7 +180,7 @@ void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir)
return Q_EMIT setDisplayDirectorySignal(dir);
}
- _dialog->selectUrl(QUrl(toQString(dir)));
+ _dialog->setDirectory(toQString(dir));
}
OUString SAL_CALL KDE5FilePicker::getDisplayDirectory()
commit feffef60794a49f5e93ad27996d704538b762324
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Tue Jun 12 16:25:25 2018 +0200
Implement getSelectedFiles, signal+slot
this finally makes fpicker usable
Change-Id: Iedf7ed8de04947ffbc0e88348c95f2a937a8e69e
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index a8486bbcb6b2..2e9f3bd66752 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -55,8 +55,6 @@ void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QU
QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); }
-QList<QUrl> KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); }
-
bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
{
bool ret = false;
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index d4d6cae229cc..36cfb4263a11 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -181,6 +181,7 @@ Q_SIGNALS:
const css::uno::Sequence<css::beans::StringPair>& rFilters);
void setCurrentFilterSignal(const OUString& rFilter);
OUString getCurrentFilterSignal();
+ css::uno::Sequence<OUString> getSelectedFilesSignal();
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
@@ -203,6 +204,7 @@ private Q_SLOTS:
void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); }
OUString getCurrentFilterSlot() { return getCurrentFilter(); }
+ css::uno::Sequence<OUString> getSelectedFilesSlot() { return getFiles(); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 05e9c61976e2..da068240a502 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -115,6 +115,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
&KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::getCurrentFilterSignal, this,
&KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::getSelectedFilesSignal, this,
+ &KDE5FilePicker::getSelectedFilesSlot, Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
setMultiSelectionMode(false);
@@ -187,7 +189,21 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getFiles()
uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSelectedFiles()
{
- uno::Sequence<OUString> seq;
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT getSelectedFilesSignal();
+ }
+
+ QList<QUrl> aURLs = _dialog->selectedUrls();
+ uno::Sequence<OUString> seq(aURLs.size());
+
+ size_t i = 0;
+ for (auto& aURL : aURLs)
+ {
+ seq[i++] = toOUString(aURL.toString());
+ }
+
return seq;
}
commit db62a779d7ae9a2a321b6756b72064631af6aa04
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Tue Jun 12 12:54:59 2018 +0200
Implement get|setCurrentFilter, signal+slot
Change-Id: I1fb29b673e5cb474de7230407b7924844b1460e0
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index be8a6050426e..a8486bbcb6b2 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -57,22 +57,6 @@ QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryU
QList<QUrl> KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); }
-void KDE5FilePicker::setCurrentFilter(const QString& title)
-{
- _currentFilter = _titleToFilters.value(title);
-}
-
-QString KDE5FilePicker::getCurrentFilter() const
-{
- QString filter = _titleToFilters.key(_dialog->selectedNameFilter());
-
- //default if not found
- if (filter.isEmpty())
- filter = "ODF Text Document (.odt)";
-
- return filter;
-}
-
bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
{
bool ret = false;
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index a5ab496a289b..d4d6cae229cc 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -179,6 +179,8 @@ Q_SIGNALS:
void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
void appendFilterGroupSignal(const OUString& rTitle,
const css::uno::Sequence<css::beans::StringPair>& rFilters);
+ void setCurrentFilterSignal(const OUString& rFilter);
+ OUString getCurrentFilterSignal();
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
@@ -198,6 +200,9 @@ private Q_SLOTS:
{
return appendFilterGroup(rTitle, rFilters);
}
+
+ void setCurrentFilterSlot(const OUString& rFilter) { return setCurrentFilter(rFilter); }
+ OUString getCurrentFilterSlot() { return getCurrentFilter(); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index c75c56c21095..05e9c61976e2 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -111,6 +111,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::appendFilterGroupSignal, this,
&KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::setCurrentFilterSignal, this,
+ &KDE5FilePicker::setCurrentFilterSlot, Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::getCurrentFilterSignal, this,
+ &KDE5FilePicker::getCurrentFilterSlot, Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
setMultiSelectionMode(false);
@@ -211,11 +215,31 @@ void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString
_titleToFilters[t] = _filters.constLast();
}
-void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title) {}
+void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setCurrentFilterSignal(title);
+ }
+
+ _currentFilter = _titleToFilters.value(toQString(title));
+}
OUString SAL_CALL KDE5FilePicker::getCurrentFilter()
{
- OUString filter;
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT getCurrentFilterSignal();
+ }
+
+ OUString filter = toOUString(_titleToFilters.key(_dialog->selectedNameFilter()));
+
+ //default if not found
+ if (filter.isEmpty())
+ filter = "ODF Text Document (.odt)";
+
return filter;
}
commit a9d1eb47243ad736b463232b3ede82b3d87c9526
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jun 11 15:22:07 2018 +0200
Implement appendFilter[Group], signal+slot
Change-Id: I0a195de54a8631c2218f6704ca564c0c9f06becf
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index dd5f3c0ecc45..be8a6050426e 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -57,24 +57,6 @@ QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryU
QList<QUrl> KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); }
-void KDE5FilePicker::appendFilter(const QString& title, const QString& filter)
-{
- QString t = title;
- QString f = filter;
- // '/' need to be escaped else they are assumed to be mime types by kfiledialog
- //see the docs
- t.replace("/", "\\/");
-
- // openoffice gives us filters separated by ';' qt dialogs just want space separated
- f.replace(";", " ");
-
- // make sure "*.*" is not used as "all files"
- f.replace("*.*", "*");
-
- _filters << QStringLiteral("%1 (%2)").arg(t, f);
- _titleToFilters[t] = _filters.constLast();
-}
-
void KDE5FilePicker::setCurrentFilter(const QString& title)
{
_currentFilter = _titleToFilters.value(title);
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 675becf0bf68..a5ab496a289b 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -176,6 +176,9 @@ Q_SIGNALS:
void setDisplayDirectorySignal(const OUString& rDir);
void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction,
const css::uno::Any& rValue);
+ void appendFilterSignal(const OUString& rTitle, const OUString& rFilter);
+ void appendFilterGroupSignal(const OUString& rTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters);
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
@@ -184,6 +187,17 @@ private Q_SLOTS:
{
return setValue(nControlAction, nControlAction, rValue);
}
+
+ void appendFilterSlot(const OUString& rTitle, const OUString& rFilter)
+ {
+ return appendFilter(rTitle, rFilter);
+ }
+
+ void appendFilterGroupSlot(const OUString& rTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters)
+ {
+ return appendFilterGroup(rTitle, rFilters);
+ }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index ab3cc61191ed..c75c56c21095 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -107,6 +107,10 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
Qt::BlockingQueuedConnection);
connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::appendFilterSignal, this, &KDE5FilePicker::appendFilterSlot,
+ Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::appendFilterGroupSignal, this,
+ &KDE5FilePicker::appendFilterGroupSlot, Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
setMultiSelectionMode(false);
@@ -183,7 +187,29 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSelectedFiles()
return seq;
}
-void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter) {}
+void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT appendFilterSignal(title, filter);
+ }
+
+ QString t(toQString(title));
+ QString f(toQString(filter));
+ // '/' need to be escaped else they are assumed to be mime types by kfiledialog
+ //see the docs
+ t.replace("/", "\\/");
+
+ // libreoffice separates by filters by ';' qt dialogs by space
+ f.replace(";", " ");
+
+ // make sure "*.*" is not used as "all files"
+ f.replace("*.*", "*");
+
+ _filters << QStringLiteral("%1 (%2)").arg(t, f);
+ _titleToFilters[t] = _filters.constLast();
+}
void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title) {}
@@ -193,9 +219,15 @@ OUString SAL_CALL KDE5FilePicker::getCurrentFilter()
return filter;
}
-void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& /*rGroupTitle*/,
+void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& rGroupTitle,
const uno::Sequence<beans::StringPair>& filters)
{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT appendFilterGroupSignal(rGroupTitle, filters);
+ }
+
const sal_uInt16 length = filters.getLength();
for (sal_uInt16 i = 0; i < length; ++i)
{
commit 113b340f2728f8011d2812353f0b511ea2350eb8
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jun 8 22:49:26 2018 +0200
Distinguish between open vs. save file dialog
Change-Id: I1b9dee1a8cd4034f64c2c1b843cee1863a5dc1d9
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 02135eaa4a9a..dd5f3c0ecc45 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -141,21 +141,6 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const
return label;
}*/
-/*void KDE5FilePicker::initialize(bool saveDialog)
-{
- //default is opening
- QFileDialog::AcceptMode operationMode
- = saveDialog ? QFileDialog::AcceptSave : QFileDialog::AcceptOpen;
-
- _dialog->setAcceptMode(operationMode);
-
- if (saveDialog)
- {
- _dialog->setConfirmOverwrite(true);
- _dialog->setFileMode(QFileDialog::AnyFile);
- }
-}*/
-
void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; }
bool KDE5FilePicker::eventFilter(QObject* o, QEvent* e)
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index a920b9f3cbb7..ab3cc61191ed 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -452,6 +452,19 @@ void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args)
OSL_TRACE("Unknown templates %d", templateId);
return;
}
+
+ //default is opening
+ QFileDialog::AcceptMode operationMode
+ = saveDialog ? QFileDialog::AcceptSave : QFileDialog::AcceptOpen;
+
+ _dialog->setAcceptMode(operationMode);
+
+ if (saveDialog)
+ {
+ _dialog->setConfirmOverwrite(true);
+ _dialog->setFileMode(QFileDialog::AnyFile);
+ }
+
setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
}
commit c38e49e869c7f16713845e5ce1e71aeab643d2fb
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Fri Jun 8 22:40:45 2018 +0200
Implement setValue of fpicker checkboxes, signal+slot
Change-Id: I0d75ef9f5584935d05a0526a626145e00761efd9
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index d3939e1d7e1f..02135eaa4a9a 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -91,18 +91,6 @@ QString KDE5FilePicker::getCurrentFilter() const
return filter;
}
-void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, bool value)
-{
- if (_customWidgets.contains(controlId))
- {
- QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
- if (cb)
- cb->setChecked(value);
- }
- else
- qWarning() << "set value on unknown control" << controlId;
-}
-
bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
{
bool ret = false;
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index d303ba30a6ac..675becf0bf68 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -174,10 +174,16 @@ protected:
Q_SIGNALS:
void setTitleSignal(const OUString& rTitle);
void setDisplayDirectorySignal(const OUString& rDir);
+ void setValueSignal(sal_Int16 nControlId, sal_Int16 nControlAction,
+ const css::uno::Any& rValue);
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); }
+ void setValueSlot(sal_Int16 nControlId, sal_Int16 nControlAction, const css::uno::Any& rValue)
+ {
+ return setValue(nControlAction, nControlAction, rValue);
+ }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 96b6a0fe3c4f..a920b9f3cbb7 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -105,6 +105,8 @@ KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this,
&KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/,
Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::setValueSignal, this, &KDE5FilePicker::setValueSlot,
+ Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
setMultiSelectionMode(false);
@@ -205,6 +207,23 @@ void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& /*rGroupTitle*/,
void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
const uno::Any& value)
{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setValueSignal(controlId, nControlAction, value);
+ }
+
+ if (_customWidgets.contains(controlId))
+ {
+ bool bChecked = false;
+ value >>= bChecked;
+
+ QCheckBox* cb = dynamic_cast<QCheckBox*>(_customWidgets.value(controlId));
+ if (cb)
+ cb->setChecked(bChecked);
+ }
+ else
+ SAL_WARN("vcl.kde5", "set value on unknown control " << controlId);
}
uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
@@ -433,7 +452,6 @@ void SAL_CALL KDE5FilePicker::initialize(const uno::Sequence<uno::Any>& args)
OSL_TRACE("Unknown templates %d", templateId);
return;
}
-
setTitle(VclResId(saveDialog ? STR_FPICKER_SAVE : STR_FPICKER_OPEN));
}
commit d61f5db2129ed6fe0d412d6247be4dc237fee328
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 7 15:48:12 2018 +0200
Show LibO's custom checkboxes in native fpicker
Change-Id: I9cd6b0b393024957c3dec1bd7e381db62f711a24
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 9891439ae0ee..d3939e1d7e1f 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -153,20 +153,6 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const
return label;
}*/
-/*void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden)
-{
- auto resString = label;
- resString.replace('~', '&');
-
- auto widget = new QCheckBox(resString, _extraControls);
- widget->setHidden(hidden);
- if (!hidden)
- {
- _layout->addWidget(widget);
- }
- _customWidgets.insert(controlId, widget);
-}*/
-
/*void KDE5FilePicker::initialize(bool saveDialog)
{
//default is opening
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 759b2fccf790..96b6a0fe3c4f 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -303,6 +303,17 @@ void KDE5FilePicker::addCustomControl(sal_Int16 controlId)
// the checkbox is created even for CHECKBOX_AUTOEXTENSION to simplify
// code, but the checkbox is hidden and ignored
bool hidden = controlId == CHECKBOX_AUTOEXTENSION;
+ auto resString = toQString(VclResId(resId));
+ resString.replace('~', '&');
+
+ auto widget = new QCheckBox(resString, _extraControls);
+ widget->setHidden(hidden);
+ if (!hidden)
+ {
+ _layout->addWidget(widget);
+ }
+ _customWidgets.insert(controlId, widget);
+
break;
}
case PUSHBUTTON_PLAY:
commit 611346f3e222a923d2eeafa7cf7e18420fcfee5b
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 7 14:20:07 2018 +0200
Basic native folder picker
Change-Id: I1b77d7a1c8a4a3581554fb5c481b7d9039497ced
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 3a02c770eda6..d303ba30a6ac 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -25,6 +25,7 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <osl/conditn.hxx>
@@ -37,13 +38,15 @@
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QHash>
+#include <QtWidgets/QFileDialog>
class QFileDialog;
class QGridLayout;
class QWidget;
typedef ::cppu::WeakComponentImplHelper<css::ui::dialogs::XFilePicker3,
- css::ui::dialogs::XFilePickerControlAccess
+ css::ui::dialogs::XFilePickerControlAccess,
+ css::ui::dialogs::XFolderPicker2
// TODO css::ui::dialogs::XFilePreview
,
css::lang::XInitialization, css::lang::XServiceInfo>
@@ -80,7 +83,7 @@ protected:
bool allowRemoteUrls;
public:
- explicit KDE5FilePicker(const css::uno::Reference<css::uno::XComponentContext>&);
+ explicit KDE5FilePicker(QFileDialog::FileMode);
virtual ~KDE5FilePicker() override;
void enableFolderMode();
@@ -121,6 +124,10 @@ public:
virtual void SAL_CALL setLabel(sal_Int16 nControlId, const OUString& rLabel) override;
virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override;
+ // XFolderPicker stuff
+ virtual OUString SAL_CALL getDirectory() override;
+ virtual void SAL_CALL setDescription(const OUString& rDescription) override;
+
/* TODO XFilePreview
virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( );
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 93e6d503d32b..759b2fccf790 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -77,7 +77,7 @@ uno::Sequence<OUString> FilePicker_getSupportedServiceNames()
// KDE5FilePicker
-KDE5FilePicker::KDE5FilePicker(const uno::Reference<uno::XComponentContext>&)
+KDE5FilePicker::KDE5FilePicker(QFileDialog::FileMode eMode)
: KDE5FilePicker_Base(_helperMutex)
, _dialog(new QFileDialog(nullptr, {}, QDir::homePath()))
, _extraControls(new QWidget)
@@ -94,6 +94,7 @@ KDE5FilePicker::KDE5FilePicker(const uno::Reference<uno::XComponentContext>&)
QStringLiteral("webdavs"),
QStringLiteral("smb"),
});
+ _dialog->setFileMode(eMode);
setMultiSelectionMode(false);
@@ -231,6 +232,10 @@ OUString SAL_CALL KDE5FilePicker::getLabel(sal_Int16 controlId)
return label;
}
+OUString SAL_CALL KDE5FilePicker::getDirectory() { return OUString(); }
+
+void SAL_CALL KDE5FilePicker::setDescription(const OUString&) {}
+
void KDE5FilePicker::addCustomControl(sal_Int16 controlId)
{
const char* resId = nullptr;
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index ac6173e13550..37021cbe9315 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -49,9 +49,15 @@ SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nSt
}
uno::Reference<ui::dialogs::XFilePicker2>
-KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& xMSF)
+KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& /*xMSF*/)
{
- return uno::Reference<ui::dialogs::XFilePicker2>(new KDE5FilePicker(xMSF));
+ return uno::Reference<ui::dialogs::XFilePicker2>(new KDE5FilePicker(QFileDialog::ExistingFile));
+}
+
+uno::Reference<ui::dialogs::XFolderPicker2>
+KDE5SalInstance::createFolderPicker(const uno::Reference<uno::XComponentContext>& /*xMSF*/)
+{
+ return uno::Reference<ui::dialogs::XFolderPicker2>(new KDE5FilePicker(QFileDialog::Directory));
}
bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
diff --git a/vcl/unx/kde5/KDE5SalInstance.hxx b/vcl/unx/kde5/KDE5SalInstance.hxx
index cc7d7ad7cbce..0bf30ab8b235 100644
--- a/vcl/unx/kde5/KDE5SalInstance.hxx
+++ b/vcl/unx/kde5/KDE5SalInstance.hxx
@@ -36,6 +36,9 @@ public:
virtual css::uno::Reference<css::ui::dialogs::XFilePicker2>
createFilePicker(const css::uno::Reference<css::uno::XComponentContext>&) override;
+ virtual css::uno::Reference<css::ui::dialogs::XFolderPicker2>
+ createFolderPicker(const css::uno::Reference<css::uno::XComponentContext>&) override;
+
virtual bool IsMainThread() const override;
};
commit 14b7477f599fd740ddc62fea8acf3d234dc81234
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 7 13:26:59 2018 +0200
Implement setDisplayDirectory, signal+slot
Change-Id: Ieb3fb6bb9afa8cddbfd7f14ddfb36faebd524701
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 3968a0f686a6..9891439ae0ee 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -53,8 +53,6 @@ KDE5FilePicker::~KDE5FilePicker()
void KDE5FilePicker::setDefaultName(const QString& name) { _dialog->selectUrl(QUrl(name)); }
-void KDE5FilePicker::setDisplayDirectory(const QString& dir) { _dialog->selectUrl(QUrl(dir)); }
-
QString KDE5FilePicker::getDisplayDirectory() const { return _dialog->directoryUrl().url(); }
QList<QUrl> KDE5FilePicker::getSelectedFiles() const { return _dialog->selectedUrls(); }
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index 6078a53b0f98..3a02c770eda6 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -166,9 +166,11 @@ protected:
Q_SIGNALS:
void setTitleSignal(const OUString& rTitle);
+ void setDisplayDirectorySignal(const OUString& rDir);
private Q_SLOTS:
void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
+ void setDisplayDirectorySlot(const OUString& rDir) { return setDisplayDirectory(rDir); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 8df045b3aa59..93e6d503d32b 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -101,6 +101,9 @@ KDE5FilePicker::KDE5FilePicker(const uno::Reference<uno::XComponentContext>&)
connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged);
connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this,
&KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection);
+ connect(this, &KDE5FilePicker::setDisplayDirectorySignal /*(const OUString&)*/, this,
+ &KDE5FilePicker::setDisplayDirectorySlot /*(const OUString&)*/,
+ Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
setMultiSelectionMode(false);
@@ -146,7 +149,16 @@ void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) {}
void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) {}
-void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) {}
+void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setDisplayDirectorySignal(dir);
+ }
+
+ _dialog->selectUrl(QUrl(toQString(dir)));
+}
OUString SAL_CALL KDE5FilePicker::getDisplayDirectory()
{
commit e8a1115567e3292a8de8b6e26f443b8b2edcba74
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Thu Jun 7 12:47:35 2018 +0200
Add setTitle functionality, signal+slot
Change-Id: Ib79837ff08cabf8a27b6d154529399a5965ab148
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index 3e1387da7fd2..3968a0f686a6 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -46,8 +46,6 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-//void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); }
-
/*void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
{
_dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index ea18b3298ed4..6078a53b0f98 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -163,6 +163,12 @@ private:
protected:
bool eventFilter(QObject* watched, QEvent* event) override;
+
+Q_SIGNALS:
+ void setTitleSignal(const OUString& rTitle);
+
+private Q_SLOTS:
+ void setTitleSlot(const OUString& rTitle) { return setTitle(rTitle); }
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index e505791cad03..8df045b3aa59 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -31,16 +31,15 @@
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <osl/mutex.hxx>
-
-#include <fpicker/strings.hrc>
-
#include "FPServiceInfo.hxx"
#undef Region
#include <unx/geninst.h>
+#include <qt5/Qt5Tools.hxx>
#include <QtCore/QDebug>
+#include <QtCore/QThread>
#include <QtCore/QUrl>
#include <QtGui/QClipboard>
#include <QtGui/QWindow>
@@ -50,6 +49,7 @@
#include <QtWidgets/QWidget>
#include <QtWidgets/QApplication>
+#include <fpicker/strings.hrc>
#include <strings.hrc>
using namespace ::com::sun::star;
@@ -99,6 +99,8 @@ KDE5FilePicker::KDE5FilePicker(const uno::Reference<uno::XComponentContext>&)
connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged);
connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged);
+ connect(this, &KDE5FilePicker::setTitleSignal /*(const OUString&)*/, this,
+ &KDE5FilePicker::setTitleSlot /*(const OUString&)*/, Qt::BlockingQueuedConnection);
qApp->installEventFilter(this);
setMultiSelectionMode(false);
@@ -117,7 +119,16 @@ void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::Reference<XFil
m_xListener.clear();
}
-void SAL_CALL KDE5FilePicker::setTitle(const OUString& title) {}
+void SAL_CALL KDE5FilePicker::setTitle(const OUString& title)
+{
+ if (qApp->thread() != QThread::currentThread())
+ {
+ SolarMutexReleaser aReleaser;
+ return Q_EMIT setTitleSignal(title);
+ }
+
+ _dialog->setWindowTitle(toQString(title));
+}
sal_Int16 SAL_CALL KDE5FilePicker::execute()
{
commit 8c7984a3f93e143772de705555558c6cd1695c3c
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Jun 6 15:35:00 2018 +0200
We don't need to link X11 libs either
Change-Id: I01b9f897abda67b12ed6f05844dca05dabb185a2
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 5e9559c159f1..655ae6b80d96 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -61,13 +61,6 @@ $(eval $(call gb_Library_use_externals,vclplug_kde5,\
epoxy \
))
-$(eval $(call gb_Library_add_libs,vclplug_kde5,\
- -lX11 \
- -lXext \
- -lSM \
- -lICE \
-))
-
ifneq ($(QT5_HAVE_GLIB),)
$(eval $(call gb_Library_add_defs,vclplug_kde5,\
$(QT5_GLIB_CFLAGS) \
commit 3b3c700fabc0e4581f8dceff563cbc1fe3a69972
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Jun 6 13:32:47 2018 +0200
[Try to] get rid of dependency on X11
also kill KDE5SalDisplay with fire, it is not used anywhere
anymore
Change-Id: I4fe439b01322a6e3a809cf518e32d844c303daca
diff --git a/configure.ac b/configure.ac
index 724de9449c03..a3bfa9d3e65f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11199,7 +11199,7 @@ then
PKG_CHECK_MODULES(KF5_XCB,[xcb],,[AC_MSG_ERROR([XCB not installed])])
KF5_CFLAGS="-I$kf5_incdir -I$kf5_incdir/KCoreAddons -I$kf5_incdir/KI18n -I$kf5_incdir/KConfigCore -I$kf5_incdir/KWindowSystem -I$kf5_incdir/KIOCore -I$kf5_incdir/KIOWidgets -I$kf5_incdir/KIOFileWidgets -I$qt5_incdir -I$qt5_incdir/QtCore -I$qt5_incdir/QtGui -I$qt5_incdir/QtWidgets -I$qt5_incdir/QtNetwork -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT $KF5_XCB_CFLAGS"
- KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network -lQt5X11Extras $KF5_XCB_LIBS"
+ KF5_LIBS="-L$kf5_libdir -lKF5CoreAddons -lKF5I18n -lKF5ConfigCore -lKF5WindowSystem -lKF5KIOCore -lKF5KIOWidgets -lKF5KIOFileWidgets -L$qt5_libdir -lQt5Core -lQt5Gui -lQt5Widgets -lQt5Network $KF5_XCB_LIBS"
KF5_CFLAGS=$(printf '%s' "$KF5_CFLAGS" | sed -e "s/-I/${ISYSTEM?}/g")
AC_LANG_PUSH([C++])
diff --git a/vcl/Library_vclplug_kde5.mk b/vcl/Library_vclplug_kde5.mk
index 37a830b068dd..5e9559c159f1 100644
--- a/vcl/Library_vclplug_kde5.mk
+++ b/vcl/Library_vclplug_kde5.mk
@@ -34,7 +34,6 @@ $(eval $(call gb_Library_add_defs,vclplug_kde5,\
$(eval $(call gb_Library_use_sdk_api,vclplug_kde5))
$(eval $(call gb_Library_use_libraries,vclplug_kde5,\
- vclplug_gen \
vclplug_qt5 \
vcl \
tl \
@@ -90,7 +89,6 @@ $(eval $(call gb_Library_add_exception_objects,vclplug_kde5,\
vcl/unx/kde5/KDE5FilePicker \
vcl/unx/kde5/KDE5FilePicker2 \
vcl/unx/kde5/KDE5SalData \
- vcl/unx/kde5/KDE5SalDisplay \
vcl/unx/kde5/KDE5SalFrame \
vcl/unx/kde5/KDE5SalGraphics \
vcl/unx/kde5/KDE5SalInstance \
diff --git a/vcl/unx/kde5/KDE5SalDisplay.cxx b/vcl/unx/kde5/KDE5SalDisplay.cxx
deleted file mode 100644
index fa5e40f56ff9..000000000000
--- a/vcl/unx/kde5/KDE5SalDisplay.cxx
+++ /dev/null
@@ -1,93 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#include "VCLKDE5Application.hxx"
-#include "KDE5SalDisplay.hxx"
-
-#ifdef Bool
-#undef Bool
-#endif
-
-#include <assert.h>
-
-SalKDE5Display* SalKDE5Display::selfptr = nullptr;
-
-SalKDE5Display::SalKDE5Display(Display* pDisp)
- : SalX11Display(pDisp)
-{
- assert(selfptr == nullptr);
- selfptr = this;
- xim_protocol = XInternAtom(pDisp_, "_XIM_PROTOCOL", False);
-}
-
-SalKDE5Display::~SalKDE5Display()
-{
- // in case never a frame opened
- // clean up own members
- doDestruct();
- selfptr = nullptr;
- // prevent SalDisplay from closing KApplication's display
- pDisp_ = nullptr;
-}
-
-void SalKDE5Display::Yield()
-{
- if (DispatchInternalEvent())
- return;
-
- // Prevent blocking from Drag'n'Drop events, which may have already have processed the event
- if (XEventsQueued(pDisp_, QueuedAfterReading) == 0)
- return;
-
- DBG_ASSERT(GetSalData()->m_pInstance->GetYieldMutex()->IsCurrentThread(),
- "will crash soon since solar mutex not locked in SalKDE5Display::Yield");
-
- /*XEvent event;
- XNextEvent( pDisp_, &event );
- if( checkDirectInputEvent( &event ))
- return;
- qApp->x11ProcessEvent( &event );*/
-}
-
-// HACK: When using Qt event loop, input methods (japanese, etc.) will get broken because
-// of XFilterEvent() getting called twice, once by Qt, once by LO (bnc#665112).
-// This function is therefore called before any XEvent is passed to Qt event handling
-// and if it is a keyboard event and no Qt widget is the active window (i.e. we are
-// processing events for some LO window), then feed the event only to LO directly and skip Qt
-// completely. Skipped events are KeyPress, KeyRelease and also _XIM_PROTOCOL client message
-// (seems to be necessary too, hopefully there are not other internal XIM messages that
-// would need this handling).
-bool SalKDE5Display::checkDirectInputEvent(xcb_generic_event_t* ev)
-{
- switch (ev->response_type & ~0x80)
- {
- case XCB_CLIENT_MESSAGE:
- case XCB_KEY_PRESS:
- case XCB_KEY_RELEASE:
- if (QApplication::activeWindow() == nullptr)
- {
- // Dispatch(ev);
- return true;
- }
- break;
- }
- return false;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalDisplay.hxx b/vcl/unx/kde5/KDE5SalDisplay.hxx
deleted file mode 100644
index 640efdbc1e03..000000000000
--- a/vcl/unx/kde5/KDE5SalDisplay.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * 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 .
- */
-
-#pragma once
-
-#include <unx/saldisp.hxx>
-#include <xcb/xcb.h>
-
-#ifdef CursorShape
-#undef CursorShape
-#endif
-
-class SalKDE5Display : public SalX11Display
-{
-public:
- explicit SalKDE5Display(Display* pDisp);
- virtual ~SalKDE5Display() override;
- static SalKDE5Display* self();
- virtual void Yield() override;
- bool checkDirectInputEvent(xcb_generic_event_t* ev);
-
-private:
- Atom xim_protocol;
- static SalKDE5Display* selfptr;
-};
-
-inline SalKDE5Display* SalKDE5Display::self() { return selfptr; }
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5SalFrame.hxx b/vcl/unx/kde5/KDE5SalFrame.hxx
index 11a55b0aae29..58bdcd82f4c0 100644
--- a/vcl/unx/kde5/KDE5SalFrame.hxx
+++ b/vcl/unx/kde5/KDE5SalFrame.hxx
@@ -24,8 +24,6 @@
#undef Status
#include <qt5/Qt5Frame.hxx>
-#include <unx/saldisp.hxx>
-#include <unx/salgdi.h>
#include "KDE5SalGraphics.hxx"
diff --git a/vcl/unx/kde5/KDE5SalGraphics.hxx b/vcl/unx/kde5/KDE5SalGraphics.hxx
index 60870dd9d4af..77121459e8be 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.hxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.hxx
@@ -22,8 +22,6 @@
#include <memory>
#include <rtl/string.hxx>
-#include <unx/saldisp.hxx>
-#include <unx/salgdi.h>
#include <headless/svpgdi.hxx>
#include <QtGui/QImage>
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index b4e2b68e8045..ac6173e13550 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -30,7 +30,6 @@
#include "KDE5SalData.hxx"
#include "KDE5SalInstance.hxx"
#include "KDE5SalFrame.hxx"
-#include "KDE5SalDisplay.hxx"
using namespace com::sun::star;
diff --git a/vcl/unx/kde5/VCLKDE5Application.cxx b/vcl/unx/kde5/VCLKDE5Application.cxx
index 7ae9b5a4ee28..2d9532f1def9 100644
--- a/vcl/unx/kde5/VCLKDE5Application.cxx
+++ b/vcl/unx/kde5/VCLKDE5Application.cxx
@@ -21,8 +21,7 @@
#include <QtGui/QClipboard>
#include <QtCore/QEvent>
-
-#include "KDE5SalDisplay.hxx"
+#include <assert.h>
VCLKDE5Application::VCLKDE5Application(int argc, char** argv)
: QApplication(argc, argv)
commit 9199f5d4e971df0b2666226bb14845738bb4d266
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Wed Jun 6 12:20:13 2018 +0200
Basic KDE5 native file picker opens now
Change-Id: I3bb5d45f3337fbe26d80acb1fac7a433de904546
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index bfbe56304d0d..3e1387da7fd2 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -48,19 +48,7 @@ KDE5FilePicker::~KDE5FilePicker()
//void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); }
-/*bool KDE5FilePicker::execute()
-{
- if (!_filters.isEmpty())
- _dialog->setNameFilters(_filters);
- if (!_currentFilter.isEmpty())
- _dialog->selectNameFilter(_currentFilter);
-
- _dialog->show();
- //block and wait for user input
- return _dialog->exec() == QFileDialog::Accepted;
-}
-
-void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
+/*void KDE5FilePicker::setMultiSelectionMode(bool multiSelect)
{
_dialog->setFileMode(multiSelect ? QFileDialog::ExistingFiles : QFileDialog::ExistingFile);
}
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index 12a29c8d4d29..e505791cad03 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -119,7 +119,17 @@ void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::Reference<XFil
void SAL_CALL KDE5FilePicker::setTitle(const OUString& title) {}
-sal_Int16 SAL_CALL KDE5FilePicker::execute() { return 0; }
+sal_Int16 SAL_CALL KDE5FilePicker::execute()
+{
+ if (!_filters.isEmpty())
+ _dialog->setNameFilters(_filters);
+ if (!_currentFilter.isEmpty())
+ _dialog->selectNameFilter(_currentFilter);
+
+ _dialog->show();
+ //block and wait for user input
+ return _dialog->exec() == QFileDialog::Accepted;
+}
void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) {}
diff --git a/vcl/unx/kde5/KDE5SalInstance.cxx b/vcl/unx/kde5/KDE5SalInstance.cxx
index 120bf409b36c..b4e2b68e8045 100644
--- a/vcl/unx/kde5/KDE5SalInstance.cxx
+++ b/vcl/unx/kde5/KDE5SalInstance.cxx
@@ -26,6 +26,7 @@
#include <osl/process.h>
+#include "KDE5FilePicker.hxx"
#include "KDE5SalData.hxx"
#include "KDE5SalInstance.hxx"
#include "KDE5SalFrame.hxx"
@@ -51,7 +52,7 @@ SalFrame* KDE5SalInstance::CreateFrame(SalFrame* pParent, SalFrameStyleFlags nSt
uno::Reference<ui::dialogs::XFilePicker2>
KDE5SalInstance::createFilePicker(const uno::Reference<uno::XComponentContext>& xMSF)
{
- return SalInstance::createFilePicker(xMSF);
+ return uno::Reference<ui::dialogs::XFilePicker2>(new KDE5FilePicker(xMSF));
}
bool KDE5SalInstance::IsMainThread() const { return qApp->thread() == QThread::currentThread(); }
commit 6b8c90a370c197190491c1075a4e1a3f2967d48b
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jun 4 18:49:45 2018 +0200
Start folding KDE5FilePicker2 into KDE5FilePicker
Change-Id: I1004ccba52fb23549dd85c20068da5c62d7bc964
diff --git a/vcl/unx/kde5/KDE5FilePicker.cxx b/vcl/unx/kde5/KDE5FilePicker.cxx
index bda9de9b9ae3..bfbe56304d0d 100644
--- a/vcl/unx/kde5/KDE5FilePicker.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker.cxx
@@ -34,32 +34,6 @@
// KDE5FilePicker
-KDE5FilePicker::KDE5FilePicker(QObject* parent)
- : QObject(parent)
- , _dialog(new QFileDialog(nullptr, {}, QDir::homePath()))
- , _extraControls(new QWidget)
- , _layout(new QGridLayout(_extraControls))
- , _winId(0)
- , allowRemoteUrls(false)
-{
- _dialog->setSupportedSchemes({
- QStringLiteral("file"),
- QStringLiteral("ftp"),
- QStringLiteral("http"),
- QStringLiteral("https"),
- QStringLiteral("webdav"),
- QStringLiteral("webdavs"),
- QStringLiteral("smb"),
- });
-
- setMultiSelectionMode(false);
-
- connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged);
- connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged);
-
- qApp->installEventFilter(this);
-}
-
void KDE5FilePicker::enableFolderMode()
{
_dialog->setOption(QFileDialog::ShowDirsOnly, true);
@@ -72,9 +46,9 @@ KDE5FilePicker::~KDE5FilePicker()
delete _dialog;
}
-void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); }
+//void KDE5FilePicker::setTitle(const QString& title) { _dialog->setWindowTitle(title); }
-bool KDE5FilePicker::execute()
+/*bool KDE5FilePicker::execute()
{
if (!_filters.isEmpty())
_dialog->setNameFilters(_filters);
@@ -133,7 +107,7 @@ QString KDE5FilePicker::getCurrentFilter() const
return filter;
}
-void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/, bool value)
+void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction, bool value)
{
if (_customWidgets.contains(controlId))
{
@@ -145,7 +119,7 @@ void KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/,
qWarning() << "set value on unknown control" << controlId;
}
-bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 /*nControlAction*/) const
+bool KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction) const
{
bool ret = false;
if (_customWidgets.contains(controlId))
@@ -193,9 +167,9 @@ QString KDE5FilePicker::getLabel(sal_Int16 controlId) const
qWarning() << "get label on unknown control" << controlId;
return label;
-}
+}*/
-void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden)
+/*void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool hidden)
{
auto resString = label;
resString.replace('~', '&');
@@ -207,9 +181,9 @@ void KDE5FilePicker::addCheckBox(sal_Int16 controlId, const QString& label, bool
_layout->addWidget(widget);
}
_customWidgets.insert(controlId, widget);
-}
+}*/
-void KDE5FilePicker::initialize(bool saveDialog)
+/*void KDE5FilePicker::initialize(bool saveDialog)
{
//default is opening
QFileDialog::AcceptMode operationMode
@@ -222,7 +196,7 @@ void KDE5FilePicker::initialize(bool saveDialog)
_dialog->setConfirmOverwrite(true);
_dialog->setFileMode(QFileDialog::AnyFile);
}
-}
+}*/
void KDE5FilePicker::setWinId(sal_uIntPtr winId) { _winId = winId; }
diff --git a/vcl/unx/kde5/KDE5FilePicker.hxx b/vcl/unx/kde5/KDE5FilePicker.hxx
index d999f7bf7a09..ea18b3298ed4 100644
--- a/vcl/unx/kde5/KDE5FilePicker.hxx
+++ b/vcl/unx/kde5/KDE5FilePicker.hxx
@@ -19,21 +19,43 @@
#pragma once
+#include <cppuhelper/compbase.hxx>
+
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
+#include <com/sun/star/ui/dialogs/XFilePicker3.hpp>
+#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
+
+#include <osl/conditn.hxx>
+#include <osl/mutex.hxx>
+#include <rtl/ustrbuf.hxx>
+
+#include <functional>
+
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QStringList>
#include <QtCore/QHash>
-#include <sal/types.h>
-
class QFileDialog;
-class QWidget;
class QGridLayout;
+class QWidget;
+
+typedef ::cppu::WeakComponentImplHelper<css::ui::dialogs::XFilePicker3,
+ css::ui::dialogs::XFilePickerControlAccess
+ // TODO css::ui::dialogs::XFilePreview
+ ,
+ css::lang::XInitialization, css::lang::XServiceInfo>
+ KDE5FilePicker_Base;
-class KDE5FilePicker : public QObject
+class KDE5FilePicker : public QObject, public KDE5FilePicker_Base
{
Q_OBJECT
protected:
+ css::uno::Reference<css::ui::dialogs::XFilePickerListener> m_xListener;
+ osl::Mutex _helperMutex;
+
//the dialog to display
QFileDialog* _dialog;
@@ -58,53 +80,89 @@ protected:
bool allowRemoteUrls;
public:
- explicit KDE5FilePicker(QObject* parent = nullptr);
- ~KDE5FilePicker() override;
+ explicit KDE5FilePicker(const css::uno::Reference<css::uno::XComponentContext>&);
+ virtual ~KDE5FilePicker() override;
void enableFolderMode();
+ // XFilePickerNotifier
+ virtual void SAL_CALL addFilePickerListener(
+ const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
+ virtual void SAL_CALL removeFilePickerListener(
+ const css::uno::Reference<css::ui::dialogs::XFilePickerListener>& xListener) override;
+
// XExecutableDialog functions
- void setTitle(const QString& rTitle);
- bool execute();
+ virtual void SAL_CALL setTitle(const OUString& rTitle) override;
+ virtual sal_Int16 SAL_CALL execute() override;
// XFilePicker functions
- void setMultiSelectionMode(bool bMode);
- void setDefaultName(const QString& rName);
- void setDisplayDirectory(const QString& rDirectory);
- QString getDisplayDirectory() const;
+ virtual void SAL_CALL setMultiSelectionMode(sal_Bool bMode) override;
+ virtual void SAL_CALL setDefaultName(const OUString& rName) override;
+ virtual void SAL_CALL setDisplayDirectory(const OUString& rDirectory) override;
+ virtual OUString SAL_CALL getDisplayDirectory() override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getFiles() override;
// XFilterManager functions
- void appendFilter(const QString& rTitle, const QString& rFilter);
- void setCurrentFilter(const QString& rTitle);
- QString getCurrentFilter() const;
+ virtual void SAL_CALL appendFilter(const OUString& rTitle, const OUString& rFilter) override;
+ virtual void SAL_CALL setCurrentFilter(const OUString& rTitle) override;
+ virtual OUString SAL_CALL getCurrentFilter() override;
+
+ // XFilterGroupManager functions
+ virtual void SAL_CALL
+ appendFilterGroup(const OUString& rGroupTitle,
+ const css::uno::Sequence<css::beans::StringPair>& rFilters) override;
// XFilePickerControlAccess functions
- void setValue(sal_Int16 nControlId, sal_Int16 nControlAction, bool rValue);
- bool getValue(sal_Int16 nControlId, sal_Int16 nControlAction) const;
- void enableControl(sal_Int16 nControlId, bool bEnable);
- void setLabel(sal_Int16 nControlId, const QString& rLabel);
- QString getLabel(sal_Int16 nControlId) const;
+ virtual void SAL_CALL setValue(sal_Int16 nControlId, sal_Int16 nControlAction,
+ const css::uno::Any& rValue) override;
+ virtual css::uno::Any SAL_CALL getValue(sal_Int16 nControlId,
+ sal_Int16 nControlAction) override;
+ virtual void SAL_CALL enableControl(sal_Int16 nControlId, sal_Bool bEnable) override;
+ virtual void SAL_CALL setLabel(sal_Int16 nControlId, const OUString& rLabel) override;
+ virtual OUString SAL_CALL getLabel(sal_Int16 nControlId) override;
+
+ /* TODO XFilePreview
+
+ virtual css::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats( );
+ virtual sal_Int32 SAL_CALL getTargetColorDepth( );
+ virtual sal_Int32 SAL_CALL getAvailableWidth( );
+ virtual sal_Int32 SAL_CALL getAvailableHeight( );
+ virtual void SAL_CALL setImage( sal_Int16 aImageFormat, const css::uno::Any &rImage );
+ virtual sal_Bool SAL_CALL setShowState( sal_Bool bShowState );
+ virtual sal_Bool SAL_CALL getShowState( );
+ */
// XFilePicker2 functions
- QList<QUrl> getSelectedFiles() const;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSelectedFiles() override;
+
+ void setWinId(sal_uIntPtr winId);
// XInitialization
- void initialize(bool saveDialog);
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
- //add a custom control widget to the file dialog
- void addCheckBox(sal_Int16 nControlId, const QString& label, bool hidden);
+ // XCancellable
+ virtual void SAL_CALL cancel() override;
- void setWinId(sal_uIntPtr winId);
+ // XEventListener
+ virtual void disposing(const css::lang::EventObject& rEvent);
+ using cppu::WeakComponentImplHelperBase::disposing;
-private:
- Q_DISABLE_COPY(KDE5FilePicker)
+ // XServiceInfo
+ virtual OUString SAL_CALL getImplementationName() override;
+ virtual sal_Bool SAL_CALL supportsService(const OUString& rServiceName) override;
+ virtual css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
-protected:
- bool eventFilter(QObject* watched, QEvent* event) override;
+private:
+ //add a custom control widget to the file dialog
+ void addCustomControl(sal_Int16 controlId);
-Q_SIGNALS:
+ // emit XFilePickerListener controlStateChanged event
void filterChanged();
+ // emit XFilePickerListener fileSelectionChanged event
void selectionChanged();
+
+protected:
+ bool eventFilter(QObject* watched, QEvent* event) override;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/unx/kde5/KDE5FilePicker2.cxx b/vcl/unx/kde5/KDE5FilePicker2.cxx
index b2bafcdda95b..12a29c8d4d29 100644
--- a/vcl/unx/kde5/KDE5FilePicker2.cxx
+++ b/vcl/unx/kde5/KDE5FilePicker2.cxx
@@ -17,7 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include "KDE5FilePicker2.hxx"
+#include "KDE5FilePicker.hxx"
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -40,6 +40,16 @@
#include <unx/geninst.h>
+#include <QtCore/QDebug>
+#include <QtCore/QUrl>
+#include <QtGui/QClipboard>
+#include <QtGui/QWindow>
+#include <QtWidgets/QCheckBox>
+#include <QtWidgets/QFileDialog>
+#include <QtWidgets/QGridLayout>
+#include <QtWidgets/QWidget>
+#include <QtWidgets/QApplication>
+
#include <strings.hrc>
using namespace ::com::sun::star;
@@ -60,51 +70,70 @@ uno::Sequence<OUString> FilePicker_getSupportedServiceNames()
uno::Sequence<OUString> aRet(3);
aRet[0] = "com.sun.star.ui.dialogs.FilePicker";
aRet[1] = "com.sun.star.ui.dialogs.SystemFilePicker";
- aRet[2] = "com.sun.star.ui.dialogs.KDE5FilePicker2";
+ aRet[2] = "com.sun.star.ui.dialogs.KDE5FilePicker";
return aRet;
}
}
-// KDE5FilePicker2
+// KDE5FilePicker
-KDE5FilePicker2::KDE5FilePicker2(const uno::Reference<uno::XComponentContext>&)
- : KDE5FilePicker2_Base(_helperMutex)
+KDE5FilePicker::KDE5FilePicker(const uno::Reference<uno::XComponentContext>&)
+ : KDE5FilePicker_Base(_helperMutex)
+ , _dialog(new QFileDialog(nullptr, {}, QDir::homePath()))
+ , _extraControls(new QWidget)
+ , _layout(new QGridLayout(_extraControls))
+ , _winId(0)
+ , allowRemoteUrls(false)
{
+ _dialog->setSupportedSchemes({
+ QStringLiteral("file"),
+ QStringLiteral("ftp"),
+ QStringLiteral("http"),
+ QStringLiteral("https"),
+ QStringLiteral("webdav"),
+ QStringLiteral("webdavs"),
+ QStringLiteral("smb"),
+ });
+
setMultiSelectionMode(false);
-}
-KDE5FilePicker2::~KDE5FilePicker2() = default;
+ connect(_dialog, &QFileDialog::filterSelected, this, &KDE5FilePicker::filterChanged);
+ connect(_dialog, &QFileDialog::fileSelected, this, &KDE5FilePicker::selectionChanged);
+
+ qApp->installEventFilter(this);
+ setMultiSelectionMode(false);
+}
void SAL_CALL
-KDE5FilePicker2::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener)
+KDE5FilePicker::addFilePickerListener(const uno::Reference<XFilePickerListener>& xListener)
{
SolarMutexGuard aGuard;
m_xListener = xListener;
}
-void SAL_CALL KDE5FilePicker2::removeFilePickerListener(const uno::Reference<XFilePickerListener>&)
+void SAL_CALL KDE5FilePicker::removeFilePickerListener(const uno::Reference<XFilePickerListener>&)
{
SolarMutexGuard aGuard;
m_xListener.clear();
}
-void SAL_CALL KDE5FilePicker2::setTitle(const OUString& title) {}
+void SAL_CALL KDE5FilePicker::setTitle(const OUString& title) {}
-sal_Int16 SAL_CALL KDE5FilePicker2::execute() { return 0; }
+sal_Int16 SAL_CALL KDE5FilePicker::execute() { return 0; }
-void SAL_CALL KDE5FilePicker2::setMultiSelectionMode(sal_Bool multiSelect) {}
+void SAL_CALL KDE5FilePicker::setMultiSelectionMode(sal_Bool multiSelect) {}
-void SAL_CALL KDE5FilePicker2::setDefaultName(const OUString& name) {}
+void SAL_CALL KDE5FilePicker::setDefaultName(const OUString& name) {}
-void SAL_CALL KDE5FilePicker2::setDisplayDirectory(const OUString& dir) {}
+void SAL_CALL KDE5FilePicker::setDisplayDirectory(const OUString& dir) {}
-OUString SAL_CALL KDE5FilePicker2::getDisplayDirectory()
+OUString SAL_CALL KDE5FilePicker::getDisplayDirectory()
{
OUString dir;
return dir;
}
-uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getFiles()
+uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getFiles()
{
uno::Sequence<OUString> seq = getSelectedFiles();
if (seq.getLength() > 1)
@@ -112,24 +141,24 @@ uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getFiles()
return seq;
}
-uno::Sequence<OUString> SAL_CALL KDE5FilePicker2::getSelectedFiles()
+uno::Sequence<OUString> SAL_CALL KDE5FilePicker::getSelectedFiles()
{
uno::Sequence<OUString> seq;
return seq;
}
-void SAL_CALL KDE5FilePicker2::appendFilter(const OUString& title, const OUString& filter) {}
+void SAL_CALL KDE5FilePicker::appendFilter(const OUString& title, const OUString& filter) {}
-void SAL_CALL KDE5FilePicker2::setCurrentFilter(const OUString& title) {}
+void SAL_CALL KDE5FilePicker::setCurrentFilter(const OUString& title) {}
-OUString SAL_CALL KDE5FilePicker2::getCurrentFilter()
+OUString SAL_CALL KDE5FilePicker::getCurrentFilter()
{
OUString filter;
return filter;
}
-void SAL_CALL KDE5FilePicker2::appendFilterGroup(const OUString& /*rGroupTitle*/,
- const uno::Sequence<beans::StringPair>& filters)
+void SAL_CALL KDE5FilePicker::appendFilterGroup(const OUString& /*rGroupTitle*/,
+ const uno::Sequence<beans::StringPair>& filters)
{
const sal_uInt16 length = filters.getLength();
for (sal_uInt16 i = 0; i < length; ++i)
@@ -139,12 +168,12 @@ void SAL_CALL KDE5FilePicker2::appendFilterGroup(const OUString& /*rGroupTitle*/
}
}
-void SAL_CALL KDE5FilePicker2::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
- const uno::Any& value)
+void SAL_CALL KDE5FilePicker::setValue(sal_Int16 controlId, sal_Int16 nControlAction,
+ const uno::Any& value)
{
}
-uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
+uno::Any SAL_CALL KDE5FilePicker::getValue(sal_Int16 controlId, sal_Int16 nControlAction)
{
if (CHECKBOX_AUTOEXTENSION == controlId)
// We ignore this one and rely on QFileDialog to provide the function.
@@ -159,17 +188,17 @@ uno::Any SAL_CALL KDE5FilePicker2::getValue(sal_Int16 controlId, sal_Int16 nCont
return uno::Any(value);
}
-void SAL_CALL KDE5FilePicker2::enableControl(sal_Int16 controlId, sal_Bool enable) {}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list