2007-04-29 17:35:43 +00:00
|
|
|
/*
|
2020-08-02 22:22:19 +00:00
|
|
|
SPDX-FileCopyrightText: 1998 Matthias Ettrich <ettrich@kde.org>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2008-05-30 17:47:24 +00:00
|
|
|
#include "mouse.h"
|
|
|
|
|
2013-11-01 11:29:05 +00:00
|
|
|
#include <QDebug>
|
2018-06-05 10:52:57 +00:00
|
|
|
#include <QtDBus>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2019-07-09 19:19:26 +00:00
|
|
|
#include <cstdlib>
|
2007-04-29 17:35:43 +00:00
|
|
|
|
2020-03-19 11:30:22 +00:00
|
|
|
#include "kwinoptions_settings.h"
|
|
|
|
|
2012-09-24 02:28:33 +00:00
|
|
|
KWinMouseConfigForm::KWinMouseConfigForm(QWidget *parent)
|
|
|
|
: QWidget(parent)
|
|
|
|
{
|
2012-10-27 21:11:22 +00:00
|
|
|
setupUi(parent);
|
2012-09-24 02:28:33 +00:00
|
|
|
}
|
|
|
|
|
2012-09-24 03:02:12 +00:00
|
|
|
KWinActionsConfigForm::KWinActionsConfigForm(QWidget *parent)
|
|
|
|
: QWidget(parent)
|
|
|
|
{
|
2012-10-27 21:11:22 +00:00
|
|
|
setupUi(parent);
|
2012-09-24 03:02:12 +00:00
|
|
|
}
|
2012-09-24 02:28:33 +00:00
|
|
|
|
2020-03-30 07:54:09 +00:00
|
|
|
KTitleBarActionsConfig::KTitleBarActionsConfig(bool _standAlone, KWinOptionsSettings *settings, QWidget *parent)
|
2020-03-19 11:30:22 +00:00
|
|
|
: KCModule(parent), standAlone(_standAlone)
|
2012-09-24 02:28:33 +00:00
|
|
|
, m_ui(new KWinMouseConfigForm(this))
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
2020-06-18 10:03:04 +00:00
|
|
|
if (settings) {
|
|
|
|
initialize(settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void KTitleBarActionsConfig::initialize(KWinOptionsSettings *settings)
|
|
|
|
{
|
|
|
|
m_settings = settings;
|
2020-03-30 07:54:09 +00:00
|
|
|
addConfig(m_settings, this);
|
2011-01-30 14:34:42 +00:00
|
|
|
load();
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void KTitleBarActionsConfig::showEvent(QShowEvent *ev)
|
2009-12-14 03:18:43 +00:00
|
|
|
{
|
2011-01-30 14:34:42 +00:00
|
|
|
if (!standAlone) {
|
2009-12-14 03:18:43 +00:00
|
|
|
// Workaround KCModule::showEvent() calling load(), see bug 163817
|
2011-01-30 14:34:42 +00:00
|
|
|
QWidget::showEvent(ev);
|
2009-12-14 03:18:43 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
KCModule::showEvent(ev);
|
2009-12-14 03:18:43 +00:00
|
|
|
}
|
|
|
|
|
2014-02-15 18:57:22 +00:00
|
|
|
void KTitleBarActionsConfig::changeEvent(QEvent *ev)
|
|
|
|
{
|
|
|
|
ev->accept();
|
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
void KTitleBarActionsConfig::save()
|
|
|
|
{
|
2020-03-19 11:30:22 +00:00
|
|
|
KCModule::save();
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
if (standAlone) {
|
|
|
|
// Send signal to all kwin instances
|
|
|
|
QDBusMessage message =
|
|
|
|
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
|
|
|
|
QDBusConnection::sessionBus().send(message);
|
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
2020-03-30 07:54:09 +00:00
|
|
|
KWindowActionsConfig::KWindowActionsConfig(bool _standAlone, KWinOptionsSettings *settings, QWidget *parent)
|
2020-03-19 11:30:22 +00:00
|
|
|
: KCModule(parent), standAlone(_standAlone)
|
2012-09-24 03:02:12 +00:00
|
|
|
, m_ui(new KWinActionsConfigForm(this))
|
2007-04-29 17:35:43 +00:00
|
|
|
{
|
2020-06-18 10:03:04 +00:00
|
|
|
if (settings) {
|
|
|
|
initialize(settings);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void KWindowActionsConfig::initialize(KWinOptionsSettings *settings)
|
|
|
|
{
|
|
|
|
m_settings = settings;
|
2020-03-30 07:54:09 +00:00
|
|
|
addConfig(m_settings, this);
|
2011-01-30 14:34:42 +00:00
|
|
|
load();
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|
|
|
|
|
2011-01-30 14:34:42 +00:00
|
|
|
void KWindowActionsConfig::showEvent(QShowEvent *ev)
|
2009-12-14 03:18:43 +00:00
|
|
|
{
|
2011-01-30 14:34:42 +00:00
|
|
|
if (!standAlone) {
|
|
|
|
QWidget::showEvent(ev);
|
2009-12-14 03:18:43 +00:00
|
|
|
return;
|
|
|
|
}
|
2011-01-30 14:34:42 +00:00
|
|
|
KCModule::showEvent(ev);
|
2009-12-14 03:18:43 +00:00
|
|
|
}
|
|
|
|
|
2007-04-29 17:35:43 +00:00
|
|
|
void KWindowActionsConfig::save()
|
|
|
|
{
|
2020-03-19 11:30:22 +00:00
|
|
|
KCModule::save();
|
2011-01-30 14:34:42 +00:00
|
|
|
|
|
|
|
if (standAlone) {
|
|
|
|
// Send signal to all kwin instances
|
|
|
|
QDBusMessage message =
|
|
|
|
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
|
|
|
|
QDBusConnection::sessionBus().send(message);
|
|
|
|
}
|
2007-04-29 17:35:43 +00:00
|
|
|
}
|