File indexing completed on 2024-11-10 04:56:49

0001 /*
0002     SPDX-FileCopyrightText: 1998 Matthias Ettrich <ettrich@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "mouse.h"
0008 #include "kwinoptions_settings.h"
0009 
0010 #include <QDBusConnection>
0011 #include <QDBusMessage>
0012 
0013 KWinMouseConfigForm::KWinMouseConfigForm(QWidget *parent)
0014     : QWidget(parent)
0015 {
0016     setupUi(parent);
0017 }
0018 
0019 KWinActionsConfigForm::KWinActionsConfigForm(QWidget *parent)
0020     : QWidget(parent)
0021 {
0022     setupUi(parent);
0023 }
0024 
0025 KTitleBarActionsConfig::KTitleBarActionsConfig(bool _standAlone, KWinOptionsSettings *settings, QWidget *parent)
0026     : KCModule(parent, KPluginMetaData())
0027     , standAlone(_standAlone)
0028     , m_ui(new KWinMouseConfigForm(widget()))
0029 {
0030     if (settings) {
0031         initialize(settings);
0032     }
0033 }
0034 
0035 void KTitleBarActionsConfig::initialize(KWinOptionsSettings *settings)
0036 {
0037     m_settings = settings;
0038     addConfig(m_settings, widget());
0039 }
0040 
0041 void KTitleBarActionsConfig::save()
0042 {
0043     KCModule::save();
0044 
0045     if (standAlone) {
0046         // Send signal to all kwin instances
0047         QDBusMessage message =
0048             QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
0049         QDBusConnection::sessionBus().send(message);
0050     }
0051 }
0052 
0053 KWindowActionsConfig::KWindowActionsConfig(bool _standAlone, KWinOptionsSettings *settings, QWidget *parent)
0054     : KCModule(parent, KPluginMetaData())
0055     , standAlone(_standAlone)
0056     , m_ui(new KWinActionsConfigForm(widget()))
0057 {
0058     if (settings) {
0059         initialize(settings);
0060     }
0061 }
0062 
0063 void KWindowActionsConfig::initialize(KWinOptionsSettings *settings)
0064 {
0065     m_settings = settings;
0066     addConfig(m_settings, widget());
0067 }
0068 
0069 void KWindowActionsConfig::save()
0070 {
0071     KCModule::save();
0072 
0073     if (standAlone) {
0074         // Send signal to all kwin instances
0075         QDBusMessage message =
0076             QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
0077         QDBusConnection::sessionBus().send(message);
0078     }
0079 }
0080 
0081 #include "moc_mouse.cpp"