2013-07-31 13:43:58 -08:00
|
|
|
/*
|
2021-05-20 21:53:47 -08:00
|
|
|
SPDX-FileCopyrightText: 2013 Alexander Mezin <mezin.alexander@gmail.com>
|
|
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
|
*/
|
2013-07-31 13:43:58 -08:00
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
#include "touchpadconfigxlib.h"
|
2013-07-14 08:03:02 -08:00
|
|
|
|
2013-09-18 12:52:31 -08:00
|
|
|
#include <QDBusInterface>
|
2013-07-28 18:02:46 -08:00
|
|
|
#include <QScrollArea>
|
2014-09-15 08:58:14 -08:00
|
|
|
#include <QTabWidget>
|
2013-07-14 08:03:02 -08:00
|
|
|
|
2013-08-01 15:55:48 -08:00
|
|
|
#include <KAboutData>
|
2014-09-15 08:58:14 -08:00
|
|
|
#include <KConfigGroup>
|
2013-07-14 08:03:02 -08:00
|
|
|
#include <KLocalizedString>
|
|
|
|
|
#include <KMessageWidget>
|
2014-01-25 05:10:39 -09:00
|
|
|
#include <KNotifyConfigWidget>
|
2013-12-24 12:22:27 -09:00
|
|
|
#include <KShortcutsDialog>
|
2014-09-15 08:58:14 -08:00
|
|
|
#include <QAction>
|
2013-07-14 08:03:02 -08:00
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
#include "../touchpadconfigcontainer.h"
|
2023-06-09 05:39:54 -08:00
|
|
|
#include "actions.h"
|
2013-12-21 08:35:06 -09:00
|
|
|
#include "customconfigdialogmanager.h"
|
2013-07-28 18:02:46 -08:00
|
|
|
#include "customslider.h"
|
2013-07-21 12:11:10 -08:00
|
|
|
#include "sliderpair.h"
|
2013-07-14 08:03:02 -08:00
|
|
|
#include "touchpadbackend.h"
|
2013-12-19 03:03:16 -09:00
|
|
|
#include "touchpadinterface.h"
|
2013-07-14 08:03:02 -08:00
|
|
|
|
2021-03-04 11:58:52 -09:00
|
|
|
#include "plasma_version.h"
|
2014-09-15 08:58:14 -08:00
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::kcmInit()
|
2013-12-18 11:24:54 -09:00
|
|
|
{
|
2017-01-11 01:41:05 -09:00
|
|
|
TouchpadParameters::setSystemDefaults();
|
|
|
|
|
touchpadApplySavedConfig();
|
2013-12-18 11:24:54 -09:00
|
|
|
}
|
|
|
|
|
|
2013-09-16 21:05:28 -08:00
|
|
|
static void copyHelpFromBuddy(QObject *root)
|
|
|
|
|
{
|
|
|
|
|
QLabel *asLabel = qobject_cast<QLabel *>(root);
|
|
|
|
|
if (asLabel && asLabel->buddy()) {
|
|
|
|
|
if (asLabel->toolTip().isEmpty()) {
|
|
|
|
|
asLabel->setToolTip(asLabel->buddy()->toolTip());
|
|
|
|
|
}
|
|
|
|
|
if (asLabel->statusTip().isEmpty()) {
|
|
|
|
|
asLabel->setStatusTip(asLabel->buddy()->statusTip());
|
|
|
|
|
}
|
|
|
|
|
if (asLabel->whatsThis().isEmpty()) {
|
|
|
|
|
asLabel->setWhatsThis(asLabel->buddy()->whatsThis());
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-10-21 05:22:06 -08:00
|
|
|
const auto childList = root->children();
|
|
|
|
|
for (QObject *child : childList) {
|
2013-09-16 21:05:28 -08:00
|
|
|
copyHelpFromBuddy(child);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2014-09-15 08:58:14 -08:00
|
|
|
template<typename T>
|
|
|
|
|
QWidget *addTab(QTabWidget *tabs, T &form)
|
2013-07-28 18:02:46 -08:00
|
|
|
{
|
|
|
|
|
QScrollArea *container = new QScrollArea(tabs);
|
|
|
|
|
container->setWidgetResizable(true);
|
|
|
|
|
container->setFrameStyle(QFrame::NoFrame);
|
|
|
|
|
container->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
|
2013-07-21 12:08:59 -08:00
|
|
|
|
2013-07-28 18:02:46 -08:00
|
|
|
QWidget *widget = new QWidget(container);
|
|
|
|
|
form.setupUi(widget);
|
2013-09-16 21:05:28 -08:00
|
|
|
copyHelpFromBuddy(widget);
|
2013-12-24 09:36:17 -09:00
|
|
|
widget->setContentsMargins(20, 20, 20, 20);
|
|
|
|
|
widget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
|
2013-07-28 18:02:46 -08:00
|
|
|
|
|
|
|
|
container->setWidget(widget);
|
|
|
|
|
tabs->addTab(container, widget->windowTitle());
|
2013-12-24 12:22:27 -09:00
|
|
|
|
|
|
|
|
return widget;
|
2013-07-28 18:02:46 -08:00
|
|
|
}
|
|
|
|
|
|
2023-06-09 05:39:54 -08:00
|
|
|
TouchpadConfigXlib::TouchpadConfigXlib(TouchpadConfigContainer *parent, TouchpadBackend *backend)
|
[libinput-touchpad-kcm] Use wayland specific touchpad KCM UI when libinput is used on X11
Summary:
Earlier when libinput was used on X11, XInput specific UI was shown, due to which most of the options were grayed out.
Now we show libinput specific UI that is already used on wayland if libinput driver is used on X11.
- loaded all libinput properties that are available on X11.
- exposed all Q_PROPERTY to Libinput specific UI.
FEATURE: 387153
FEATURE: 392709
FIXED-IN: 5.16.0
Reviewers: ngraham, romangg, davidedmundson, #plasma
Reviewed By: ngraham, romangg, #plasma
Subscribers: GB_2, jriddell, knambiar, plasma-devel
Tags: #plasma
Differential Revision: https://phabricator.kde.org/D20186
2019-05-14 06:38:40 -08:00
|
|
|
: TouchpadConfigPlugin(parent, backend)
|
2013-12-22 11:05:29 -09:00
|
|
|
, m_configOutOfSync(false)
|
2013-07-14 08:03:02 -08:00
|
|
|
{
|
2013-09-15 09:42:03 -08:00
|
|
|
QGridLayout *layout = new QGridLayout(this);
|
2013-12-22 11:05:29 -09:00
|
|
|
QVBoxLayout *messageLayout = new QVBoxLayout();
|
|
|
|
|
layout->addLayout(messageLayout, 0, 0, 1, 2);
|
2013-07-28 18:02:46 -08:00
|
|
|
|
2013-12-26 18:37:17 -09:00
|
|
|
// Messages
|
|
|
|
|
|
2013-07-28 18:02:46 -08:00
|
|
|
m_errorMessage = new KMessageWidget(this);
|
|
|
|
|
m_errorMessage->setMessageType(KMessageWidget::Error);
|
|
|
|
|
m_errorMessage->setVisible(false);
|
2020-03-27 08:28:05 -08:00
|
|
|
m_errorMessage->setWordWrap(true);
|
2013-12-22 11:05:29 -09:00
|
|
|
messageLayout->addWidget(m_errorMessage);
|
|
|
|
|
|
|
|
|
|
m_configOutOfSyncMessage = new KMessageWidget(this);
|
|
|
|
|
m_configOutOfSyncMessage->setMessageType(KMessageWidget::Warning);
|
|
|
|
|
m_configOutOfSyncMessage->setText(
|
|
|
|
|
i18n("Active settings don't match saved settings.\n"
|
|
|
|
|
"You currently see saved settings."));
|
|
|
|
|
m_configOutOfSyncMessage->setVisible(false);
|
|
|
|
|
messageLayout->addWidget(m_configOutOfSyncMessage);
|
|
|
|
|
|
2014-09-15 08:58:14 -08:00
|
|
|
m_loadActiveConfiguration = new QAction(m_configOutOfSyncMessage);
|
2013-12-22 11:05:29 -09:00
|
|
|
m_loadActiveConfiguration->setText(i18n("Show active settings"));
|
|
|
|
|
connect(m_loadActiveConfiguration, SIGNAL(triggered()), SLOT(loadActiveConfig()));
|
|
|
|
|
m_configOutOfSyncMessage->addAction(m_loadActiveConfiguration);
|
2013-07-28 18:02:46 -08:00
|
|
|
|
2013-12-15 09:49:38 -09:00
|
|
|
layout->setColumnStretch(0, 3);
|
|
|
|
|
layout->setColumnStretch(1, 1);
|
2013-07-28 18:02:46 -08:00
|
|
|
|
2013-12-26 18:37:17 -09:00
|
|
|
// Main UI
|
|
|
|
|
|
2014-09-15 08:58:14 -08:00
|
|
|
m_tabs = new QTabWidget(this);
|
2013-12-26 18:37:17 -09:00
|
|
|
layout->addWidget(m_tabs, 1, 0, 1, 1);
|
2013-12-24 12:22:27 -09:00
|
|
|
|
|
|
|
|
addTab(m_tabs, m_tapping);
|
|
|
|
|
addTab(m_tabs, m_scrolling);
|
|
|
|
|
addTab(m_tabs, m_pointerMotion);
|
|
|
|
|
addTab(m_tabs, m_sensitivity);
|
|
|
|
|
|
2013-09-15 12:58:39 -08:00
|
|
|
static const CustomSlider::SqrtInterpolator interpolator;
|
2013-07-28 18:02:46 -08:00
|
|
|
m_pointerMotion.kcfg_MinSpeed->setInterpolator(&interpolator);
|
|
|
|
|
m_pointerMotion.kcfg_MaxSpeed->setInterpolator(&interpolator);
|
|
|
|
|
m_pointerMotion.kcfg_AccelFactor->setInterpolator(&interpolator);
|
2013-07-15 14:46:31 -08:00
|
|
|
|
2013-07-28 18:02:46 -08:00
|
|
|
new SliderPair(m_pointerMotion.kcfg_MinSpeed, m_pointerMotion.kcfg_MaxSpeed, this);
|
2013-07-29 20:33:22 -08:00
|
|
|
new SliderPair(m_sensitivity.kcfg_FingerLow, m_sensitivity.kcfg_FingerHigh, this);
|
2013-07-31 17:54:00 -08:00
|
|
|
new SliderPair(m_pointerMotion.kcfg_PressureMotionMinZ, m_pointerMotion.kcfg_PressureMotionMaxZ, this);
|
2013-07-21 12:11:10 -08:00
|
|
|
|
2013-12-21 08:35:06 -09:00
|
|
|
m_manager = new CustomConfigDialogManager(this, &m_config, m_backend->supportedParameters());
|
2014-02-26 10:58:18 -09:00
|
|
|
connect(m_manager, SIGNAL(widgetModified()), SLOT(checkChanges()), Qt::QueuedConnection);
|
2013-12-22 11:05:29 -09:00
|
|
|
|
2013-12-26 18:37:17 -09:00
|
|
|
// KDED settings
|
|
|
|
|
|
|
|
|
|
m_kdedTab = addTab(m_tabs, m_kded);
|
2017-01-11 01:41:05 -09:00
|
|
|
m_daemonConfigManager = m_parent->addConfig(&m_daemonSettings, m_kdedTab);
|
2013-12-26 18:37:17 -09:00
|
|
|
|
|
|
|
|
KMessageWidget *kdedMessage = new KMessageWidget(m_kdedTab);
|
|
|
|
|
kdedMessage->setMessageType(KMessageWidget::Information);
|
|
|
|
|
kdedMessage->setCloseButtonVisible(false);
|
|
|
|
|
kdedMessage->setText(i18n("These settings won't take effect in the testing area"));
|
|
|
|
|
qobject_cast<QVBoxLayout *>(m_kdedTab->layout())->insertWidget(0, kdedMessage);
|
2021-01-20 11:58:28 -09:00
|
|
|
|
2014-01-25 05:10:39 -09:00
|
|
|
connect(m_kded.configureNotificationsButton, SIGNAL(clicked()), SLOT(showConfigureNotificationsDialog()));
|
2013-12-26 18:37:17 -09:00
|
|
|
m_shortcutsDialog.reset(new KShortcutsDialog(KShortcutsEditor::GlobalAction, KShortcutsEditor::LetterShortcutsDisallowed));
|
2015-01-24 04:59:15 -09:00
|
|
|
m_shortcutsDialog->addCollection(new TouchpadGlobalActions(true, this), i18n("Enable/Disable Touchpad"));
|
2021-06-28 13:36:41 -08:00
|
|
|
connect(m_kded.configureShortcutsButton, &QPushButton::clicked, this, [this]() {
|
2021-06-24 05:59:53 -08:00
|
|
|
m_shortcutsDialog->configure(true);
|
|
|
|
|
});
|
2013-12-26 18:37:17 -09:00
|
|
|
|
2013-12-25 10:12:57 -09:00
|
|
|
m_mouseCombo = new KComboBox(true, m_kded.kcfg_MouseBlacklist);
|
|
|
|
|
m_kded.kcfg_MouseBlacklist->setCustomEditor(m_mouseCombo);
|
|
|
|
|
connect(m_backend, SIGNAL(mousesChanged()), SLOT(updateMouseList()));
|
|
|
|
|
m_backend->watchForEvents(false);
|
|
|
|
|
updateMouseList();
|
2013-12-19 03:03:16 -09:00
|
|
|
|
2023-06-27 12:06:29 -08:00
|
|
|
m_daemon = new OrgKdeTouchpadInterface("org.kde.kded6", "/modules/kded_touchpad", QDBusConnection::sessionBus(), this);
|
2014-03-01 10:17:44 -09:00
|
|
|
m_kdedTab->setEnabled(false);
|
|
|
|
|
QDBusPendingCallWatcher *watch;
|
|
|
|
|
watch = new QDBusPendingCallWatcher(m_daemon->workingTouchpadFound(), this);
|
2021-01-19 01:43:51 -09:00
|
|
|
// clang-format off
|
|
|
|
|
connect(watch, SIGNAL(finished(QDBusPendingCallWatcher*)), SLOT(gotReplyFromDaemon(QDBusPendingCallWatcher*)));
|
|
|
|
|
// clang-format on
|
2013-12-26 18:37:17 -09:00
|
|
|
|
|
|
|
|
// Testing area
|
|
|
|
|
|
|
|
|
|
m_testArea = new TestArea(this);
|
|
|
|
|
layout->addWidget(m_testArea, 1, 1);
|
|
|
|
|
connect(m_testArea, SIGNAL(enter()), SLOT(beginTesting()));
|
|
|
|
|
connect(m_testArea, SIGNAL(leave()), SLOT(endTesting()));
|
|
|
|
|
connect(m_tabs, SIGNAL(currentChanged(int)), SLOT(updateTestAreaEnabled()));
|
|
|
|
|
updateTestAreaEnabled();
|
2013-07-14 08:03:02 -08:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::gotReplyFromDaemon(QDBusPendingCallWatcher *watch)
|
2014-03-01 10:17:44 -09:00
|
|
|
{
|
|
|
|
|
QDBusPendingReply<bool> reply = *watch;
|
|
|
|
|
if (reply.isValid() && reply.value()) {
|
|
|
|
|
m_kdedTab->setEnabled(true);
|
|
|
|
|
}
|
|
|
|
|
watch->deleteLater();
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::updateMouseList()
|
2013-12-25 10:12:57 -09:00
|
|
|
{
|
2020-10-21 05:22:06 -08:00
|
|
|
const QStringList mouses(m_backend->listMouses(m_daemonSettings.mouseBlacklist()));
|
2013-12-25 10:12:57 -09:00
|
|
|
|
|
|
|
|
for (int i = 0; i < m_mouseCombo->count();) {
|
|
|
|
|
if (!mouses.contains(m_mouseCombo->itemText(i))) {
|
|
|
|
|
m_mouseCombo->removeItem(i);
|
|
|
|
|
} else {
|
|
|
|
|
i++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-21 05:22:06 -08:00
|
|
|
for (const QString &device : mouses) {
|
|
|
|
|
if (!m_mouseCombo->contains(device)) {
|
|
|
|
|
m_mouseCombo->addItem(device);
|
2013-12-25 10:12:57 -09:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
QVariantHash TouchpadConfigXlib::getActiveConfig()
|
2013-12-22 11:05:29 -09:00
|
|
|
{
|
|
|
|
|
if (m_prevConfig) {
|
|
|
|
|
return *m_prevConfig;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
QVariantHash activeConfig;
|
|
|
|
|
if (!m_backend->getConfig(activeConfig)) {
|
|
|
|
|
m_errorMessage->setText(m_backend->errorString());
|
2014-02-26 10:58:18 -09:00
|
|
|
QMetaObject::invokeMethod(m_errorMessage, "animatedShow", Qt::QueuedConnection);
|
2013-12-22 11:05:29 -09:00
|
|
|
}
|
|
|
|
|
return activeConfig;
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::loadActiveConfig()
|
2013-12-22 11:05:29 -09:00
|
|
|
{
|
|
|
|
|
m_manager->setWidgetProperties(getActiveConfig());
|
2014-02-26 10:58:18 -09:00
|
|
|
m_configOutOfSync = false;
|
2014-02-26 11:26:11 -09:00
|
|
|
m_configOutOfSyncMessage->animatedHide();
|
2013-12-22 11:05:29 -09:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::load()
|
2013-12-21 08:35:06 -09:00
|
|
|
{
|
|
|
|
|
m_manager->updateWidgets();
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
m_parent->kcmLoad();
|
2013-12-22 11:05:29 -09:00
|
|
|
|
2014-02-26 10:58:18 -09:00
|
|
|
m_configOutOfSync = !m_manager->compareWidgetProperties(getActiveConfig());
|
2013-12-21 08:35:06 -09:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::save()
|
2013-07-14 08:03:02 -08:00
|
|
|
{
|
2013-12-21 08:35:06 -09:00
|
|
|
m_manager->updateSettings();
|
|
|
|
|
|
2014-02-26 10:58:18 -09:00
|
|
|
m_configOutOfSync = false;
|
|
|
|
|
m_configOutOfSyncMessage->animatedHide();
|
2013-12-22 11:05:29 -09:00
|
|
|
|
2013-12-24 12:28:24 -09:00
|
|
|
bool daemonSettingsChanged = m_daemonConfigManager->hasChanged();
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
m_parent->kcmSave();
|
2013-07-14 08:03:02 -08:00
|
|
|
|
2013-12-18 11:24:54 -09:00
|
|
|
if (m_backend->applyConfig(m_config.values())) {
|
2013-07-28 18:02:46 -08:00
|
|
|
m_errorMessage->animatedHide();
|
|
|
|
|
} else {
|
|
|
|
|
m_errorMessage->setText(m_backend->errorString());
|
|
|
|
|
m_errorMessage->animatedShow();
|
2013-07-19 03:30:46 -08:00
|
|
|
}
|
2013-09-18 12:52:31 -08:00
|
|
|
|
2013-12-24 12:28:24 -09:00
|
|
|
if (daemonSettingsChanged) {
|
|
|
|
|
m_daemon->reloadSettings();
|
2013-12-25 10:12:57 -09:00
|
|
|
updateMouseList();
|
2013-12-24 12:28:24 -09:00
|
|
|
}
|
2013-07-19 03:30:46 -08:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::defaults()
|
2013-12-21 08:35:06 -09:00
|
|
|
{
|
|
|
|
|
m_manager->updateWidgetsDefault();
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
m_parent->kcmDefaults();
|
2013-12-21 08:35:06 -09:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::checkChanges()
|
2013-12-21 08:35:06 -09:00
|
|
|
{
|
2017-01-11 01:41:05 -09:00
|
|
|
if (!m_backend->touchpadCount()) {
|
2016-11-10 04:20:41 -09:00
|
|
|
return;
|
|
|
|
|
}
|
2017-01-11 01:41:05 -09:00
|
|
|
m_parent->unmanagedWidgetChangeState(m_manager->hasChangedFuzzy() || m_configOutOfSync);
|
2014-02-26 10:58:18 -09:00
|
|
|
if (m_configOutOfSync) {
|
|
|
|
|
m_configOutOfSyncMessage->animatedShow();
|
|
|
|
|
} else {
|
|
|
|
|
m_configOutOfSyncMessage->animatedHide();
|
|
|
|
|
}
|
2013-12-21 08:35:06 -09:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::hideEvent(QHideEvent *e)
|
2013-09-15 09:42:03 -08:00
|
|
|
{
|
2017-01-11 01:41:05 -09:00
|
|
|
Q_UNUSED(e);
|
2013-09-15 09:42:03 -08:00
|
|
|
endTesting();
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
TouchpadConfigXlib::~TouchpadConfigXlib()
|
2013-09-16 20:57:03 -08:00
|
|
|
{
|
|
|
|
|
endTesting();
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::onChanged()
|
2013-09-16 20:57:03 -08:00
|
|
|
{
|
|
|
|
|
if (m_testArea->underMouse()) {
|
|
|
|
|
beginTesting();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::beginTesting()
|
2013-09-15 09:42:03 -08:00
|
|
|
{
|
2013-09-16 20:57:03 -08:00
|
|
|
if (!m_prevConfig) {
|
2013-12-18 11:24:54 -09:00
|
|
|
m_prevConfig.reset(new QVariantHash());
|
2022-05-31 07:51:15 -08:00
|
|
|
m_backend->getConfig(*m_prevConfig.get());
|
2013-09-16 20:57:03 -08:00
|
|
|
}
|
2013-12-21 08:35:06 -09:00
|
|
|
m_backend->applyConfig(m_manager->currentWidgetProperties());
|
2013-09-15 09:42:03 -08:00
|
|
|
}
|
|
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::endTesting()
|
2013-09-15 09:42:03 -08:00
|
|
|
{
|
|
|
|
|
if (!m_prevConfig) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-05-31 07:51:15 -08:00
|
|
|
m_backend->applyConfig(*m_prevConfig.get());
|
2013-09-15 09:42:03 -08:00
|
|
|
m_prevConfig.reset();
|
|
|
|
|
}
|
2013-12-24 12:22:27 -09:00
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::updateTestAreaEnabled()
|
2013-12-24 12:22:27 -09:00
|
|
|
{
|
|
|
|
|
bool enable = true;
|
|
|
|
|
for (QWidget *i = m_kdedTab; i; i = i->parentWidget()) {
|
|
|
|
|
if (i == m_tabs->currentWidget()) {
|
|
|
|
|
enable = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
m_testArea->setEnabled(enable);
|
|
|
|
|
m_testArea->setMouseTracking(enable);
|
|
|
|
|
if (!enable) {
|
|
|
|
|
endTesting();
|
|
|
|
|
}
|
|
|
|
|
}
|
2014-01-25 05:10:39 -09:00
|
|
|
|
2017-01-11 01:41:05 -09:00
|
|
|
void TouchpadConfigXlib::showConfigureNotificationsDialog()
|
2014-01-25 05:10:39 -09:00
|
|
|
{
|
2022-10-08 05:38:29 -08:00
|
|
|
KNotifyConfigWidget *widget = KNotifyConfigWidget::configure(nullptr, QStringLiteral("kcm_touchpad"));
|
2014-09-15 08:58:14 -08:00
|
|
|
QDialog *dialog = qobject_cast<QDialog *>(widget->topLevelWidget());
|
2014-01-25 05:10:39 -09:00
|
|
|
connect(dialog, SIGNAL(finished()), dialog, SLOT(deleteLater()));
|
|
|
|
|
}
|