diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-07 12:47:35 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-18 15:27:58 +0200 |
commit | e8a1115567e3292a8de8b6e26f443b8b2edcba74 (patch) | |
tree | 75ca540c0e84f9c22b8adbecf550ad0ab1eb554f | |
parent | 8c7984a3f93e143772de705555558c6cd1695c3c (diff) |
Add setTitle functionality, signal+slot
Change-Id: Ib79837ff08cabf8a27b6d154529399a5965ab148
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.cxx | 2 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.hxx | 6 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker2.cxx | 19 |
3 files changed, 21 insertions, 6 deletions
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() { |