diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-14 14:21:35 +0200 |
---|---|---|
committer | Katarina Behrens <Katarina.Behrens@cib.de> | 2018-06-18 15:28:00 +0200 |
commit | 6b052ccff871cac50a63119fe324930ace86f190 (patch) | |
tree | f5410a6bb0ec453b2871f3ab0812074b0d1612f9 /vcl | |
parent | 4add71a161bde3870934d754ab397ec7c0e22a92 (diff) |
Implement enableControl, signal+slot
Change-Id: I84f81f689167ec332772c706b0d0c6d7562b5ac8
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.cxx | 10 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker.hxx | 6 | ||||
-rw-r--r-- | vcl/unx/kde5/KDE5FilePicker2.cxx | 16 |
3 files changed, 22 insertions, 10 deletions
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) {} |