Commit d571457b authored by Méven Car's avatar Méven Car Committed by Méven Car

KCM/Kwinoptions: Port title bar and window actions tabs UI and conf to KConfigXT

Summary: Depends on D27463

Reviewers: crossi, bport, ervin, #kwin, zzag

Reviewed By: ervin, #kwin, zzag

Subscribers: zzag, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D27477
parent 9f3b817b
......@@ -5,7 +5,7 @@ set(PROJECT_VERSION "5.18.80")
set(PROJECT_VERSION_MAJOR 5)
set(QT_MIN_VERSION "5.12.0")
set(KF5_MIN_VERSION "5.66.0")
set(KF5_MIN_VERSION "5.68.0")
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
......
......@@ -29,12 +29,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coWin1</cstring>
<cstring>kcfg_CommandWindow1</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="coWin1">
<widget class="KComboBox" name="kcfg_CommandWindow1">
<property name="whatsThis">
<string>In this row you can customize left click behavior when clicking into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
......@@ -69,12 +69,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coWin2</cstring>
<cstring>kcfg_CommandWindow2</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="coWin2">
<widget class="KComboBox" name="kcfg_CommandWindow2">
<property name="whatsThis">
<string>In this row you can customize middle click behavior when clicking into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
......@@ -109,12 +109,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coWin3</cstring>
<cstring>kcfg_CommandWindow3</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="coWin3">
<widget class="KComboBox" name="kcfg_CommandWindow3">
<property name="whatsThis">
<string>In this row you can customize right click behavior when clicking into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
......@@ -149,12 +149,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coWinWheel</cstring>
<cstring>kcfg_CommandWindowWheel</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KComboBox" name="coWinWheel">
<widget class="KComboBox" name="kcfg_CommandWindowWheel">
<property name="whatsThis">
<string>In this row you can customize behavior when scrolling into an inactive inner window ('inner' means: not titlebar, not frame).</string>
</property>
......@@ -195,12 +195,12 @@
<string>Mo&amp;difier key:</string>
</property>
<property name="buddy">
<cstring>coAllKey</cstring>
<cstring>kcfg_CommandAllKey</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="coAllKey">
<widget class="KComboBox" name="kcfg_CommandAllKey">
<property name="whatsThis">
<string>Here you select whether holding the Meta key or Alt key will allow you to perform the following actions.</string>
</property>
......@@ -251,12 +251,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coAll1</cstring>
<cstring>kcfg_CommandAll1</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="coAll1">
<widget class="KComboBox" name="kcfg_CommandAll1">
<property name="whatsThis">
<string>In this row you can customize left click behavior when clicking into the titlebar or the frame.</string>
</property>
......@@ -321,12 +321,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coAll2</cstring>
<cstring>kcfg_CommandAll2</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="coAll2">
<widget class="KComboBox" name="kcfg_CommandAll2">
<property name="whatsThis">
<string>In this row you can customize middle click behavior when clicking into the titlebar or the frame.</string>
</property>
......@@ -391,12 +391,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coAll3</cstring>
<cstring>kcfg_CommandAll3</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="coAll3">
<widget class="KComboBox" name="kcfg_CommandAll3">
<property name="whatsThis">
<string>In this row you can customize right click behavior when clicking into the titlebar or the frame.</string>
</property>
......@@ -461,12 +461,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coAllW</cstring>
<cstring>kcfg_CommandAllWheel</cstring>
</property>
</widget>
</item>
<item row="3" column="1">
<widget class="KComboBox" name="coAllW">
<widget class="KComboBox" name="kcfg_CommandAllWheel">
<property name="whatsThis">
<string>Here you can customize KDE's behavior when scrolling with the mouse wheel in a window while pressing the modifier key.</string>
</property>
......
......@@ -78,15 +78,17 @@ KWinOptions::KWinOptions(QWidget *parent, const QVariantList &)
tab->addTab(mFocus, i18n("&Focus"));
connect(mFocus, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this);
mTitleBarActions = new KTitleBarActionsConfig(false, this);
mTitleBarActions->setObjectName(QLatin1String("KWin TitleBar Actions"));
tab->addTab(mTitleBarActions, i18n("Titlebar A&ctions"));
connect(mTitleBarActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mTitleBarActions, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
mWindowActions = new KWindowActionsConfig(false, mConfig, this);
mWindowActions = new KWindowActionsConfig(false, this);
mWindowActions->setObjectName(QLatin1String("KWin Window Actions"));
tab->addTab(mWindowActions, i18n("W&indow Actions"));
connect(mWindowActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mWindowActions, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
mMoving = new KMovingConfig(false, this);
mMoving->setObjectName(QLatin1String("KWin Moving"));
......@@ -149,8 +151,6 @@ void KWinOptions::save()
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
......@@ -173,11 +173,6 @@ QString KWinOptions::quickHelp() const
" for how to customize window behavior.</p>");
}
void KWinOptions::moduleChanged(bool state)
{
emit KCModule::changed(state);
}
KActionsOptions::KActionsOptions(QWidget *parent, const QVariantList &)
: KCModule(parent)
{
......@@ -188,15 +183,17 @@ KActionsOptions::KActionsOptions(QWidget *parent, const QVariantList &)
tab = new QTabWidget(this);
layout->addWidget(tab);
mTitleBarActions = new KTitleBarActionsConfig(false, mConfig, this);
mTitleBarActions = new KTitleBarActionsConfig(false, this);
mTitleBarActions->setObjectName(QLatin1String("KWin TitleBar Actions"));
tab->addTab(mTitleBarActions, i18n("&Titlebar Actions"));
connect(mTitleBarActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mTitleBarActions, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
mWindowActions = new KWindowActionsConfig(false, mConfig, this);
mWindowActions = new KWindowActionsConfig(false, this);
mWindowActions->setObjectName(QLatin1String("KWin Window Actions"));
tab->addTab(mWindowActions, i18n("Window Actio&ns"));
connect(mWindowActions, qOverload<bool>(&KCModule::changed), this, qOverload<bool>(&KCModule::changed));
connect(mWindowActions, qOverload<bool>(&KCModule::defaulted), this, qOverload<bool>(&KCModule::defaulted));
}
KActionsOptions::~KActionsOptions()
......@@ -208,10 +205,8 @@ void KActionsOptions::load()
{
mTitleBarActions->load();
mWindowActions->load();
emit KCModule::changed(false);
}
void KActionsOptions::save()
{
mTitleBarActions->save();
......@@ -224,16 +219,12 @@ void KActionsOptions::save()
QDBusMessage message =
QDBusMessage::createSignal("/KWin", "org.kde.KWin", "reloadConfig");
QDBusConnection::sessionBus().send(message);
}
void KActionsOptions::defaults()
{
mTitleBarActions->defaults();
mWindowActions->defaults();
emit defaulted(true);
}
void KActionsOptions::moduleChanged(bool state)
......
......@@ -49,12 +49,6 @@ public:
void defaults() override;
QString quickHelp() const override;
protected Q_SLOTS:
void moduleChanged(bool state);
private:
QTabWidget *tab;
......
This diff is collapsed.
......@@ -53,38 +53,20 @@ class KTitleBarActionsConfig : public KCModule
public:
KTitleBarActionsConfig(bool _standAlone, KConfig *_config, QWidget *parent);
~KTitleBarActionsConfig() override;
KTitleBarActionsConfig(bool _standAlone, QWidget *parent);
void load() override;
void save() override;
void defaults() override;
protected:
void showEvent(QShowEvent *ev) override;
void changeEvent(QEvent *ev) override;
public Q_SLOTS:
void changed() {
emit KCModule::changed(true);
}
private:
KConfig *config;
bool standAlone;
KWinMouseConfigForm *m_ui;
const char* functionTiDbl(int);
const char* functionTiAc(int);
const char* functionTiWAc(int);
const char* functionTiInAc(int);
const char* functionMax(int);
void setComboText(KComboBox* combo, const char* text);
void createMaximizeButtonTooltips(KComboBox* combo);
const char* fixup(const char* s);
private Q_SLOTS:
void paletteChanged();
......@@ -97,35 +79,17 @@ class KWindowActionsConfig : public KCModule
public:
KWindowActionsConfig(bool _standAlone, KConfig *_config, QWidget *parent);
~KWindowActionsConfig() override;
KWindowActionsConfig(bool _standAlone, QWidget *parent);
void load() override;
void save() override;
void defaults() override;
protected:
void showEvent(QShowEvent *ev) override;
public Q_SLOTS:
void changed() {
emit KCModule::changed(true);
}
private:
KConfig *config;
bool standAlone;
KWinActionsConfigForm *m_ui;
const char* functionWin(int);
const char* functionWinWheel(int);
const char* functionAllKey(int);
const char* functionAll(int);
const char* functionAllW(int);
void setComboText(KComboBox* combo, const char* text);
const char* fixup(const char* s);
};
#endif
......
......@@ -26,12 +26,12 @@
<string>&amp;Double-click:</string>
</property>
<property name="buddy">
<cstring>coTiDbl</cstring>
<cstring>kcfg_TitlebarDoubleClickCommand</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="coTiDbl">
<widget class="KComboBox" name="kcfg_TitlebarDoubleClickCommand">
<property name="whatsThis">
<string>Behavior on &lt;em&gt;double&lt;/em&gt; click into the titlebar.</string>
</property>
......@@ -88,12 +88,12 @@
<string>Mouse &amp;wheel:</string>
</property>
<property name="buddy">
<cstring>coTiAct4</cstring>
<cstring>kcfg_CommandTitlebarWheel</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="coTiAct4">
<widget class="KComboBox" name="kcfg_CommandTitlebarWheel">
<property name="whatsThis">
<string>Behavior on &lt;em&gt;mouse wheel&lt;/em&gt; scroll over the titlebar.</string>
</property>
......@@ -180,7 +180,7 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coTiAct1</cstring>
<cstring>kcfg_CommandActiveTitlebar1</cstring>
</property>
</widget>
</item>
......@@ -203,7 +203,7 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coTiAct2</cstring>
<cstring>kcfg_CommandActiveTitlebar2</cstring>
</property>
</widget>
</item>
......@@ -216,12 +216,12 @@
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>coTiAct3</cstring>
<cstring>kcfg_CommandActiveTitlebar3</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="coTiAct1">
<widget class="KComboBox" name="kcfg_CommandActiveTitlebar1">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -274,7 +274,7 @@
</widget>
</item>
<item row="1" column="2">
<widget class="KComboBox" name="coTiInAct1">
<widget class="KComboBox" name="kcfg_CommandInactiveTitlebar1">
<property name="whatsThis">
<string>Behavior on &lt;em&gt;left&lt;/em&gt; click into the titlebar or frame of an &lt;em&gt;inactive&lt;/em&gt; window.</string>
</property>
......@@ -336,7 +336,7 @@
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="coTiAct2">
<widget class="KComboBox" name="kcfg_CommandActiveTitlebar2">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -389,7 +389,7 @@
</widget>
</item>
<item row="2" column="2">
<widget class="KComboBox" name="coTiInAct2">
<widget class="KComboBox" name="kcfg_CommandInactiveTitlebar2">
<property name="whatsThis">
<string>Behavior on &lt;em&gt;left&lt;/em&gt; click into the titlebar or frame of an &lt;em&gt;inactive&lt;/em&gt; window.</string>
</property>
......@@ -451,7 +451,7 @@
</widget>
</item>
<item row="3" column="1">
<widget class="KComboBox" name="coTiAct3">
<widget class="KComboBox" name="kcfg_CommandActiveTitlebar3">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -504,7 +504,7 @@
</widget>
</item>
<item row="3" column="2">
<widget class="KComboBox" name="coTiInAct3">
<widget class="KComboBox" name="kcfg_CommandInactiveTitlebar3">
<property name="whatsThis">
<string>Behavior on &lt;em&gt;left&lt;/em&gt; click into the titlebar or frame of an &lt;em&gt;inactive&lt;/em&gt; window.</string>
</property>
......@@ -601,12 +601,12 @@
<string>L&amp;eft click:</string>
</property>
<property name="buddy">
<cstring>leftClickMaximizeButton</cstring>
<cstring>kcfg_MaximizeButtonLeftClickCommand</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KComboBox" name="leftClickMaximizeButton">
<widget class="KComboBox" name="kcfg_MaximizeButtonLeftClickCommand">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -627,12 +627,12 @@
<string>Middle c&amp;lick:</string>
</property>
<property name="buddy">
<cstring>middleClickMaximizeButton</cstring>
<cstring>kcfg_MaximizeButtonMiddleClickCommand</cstring>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="KComboBox" name="middleClickMaximizeButton">
<widget class="KComboBox" name="kcfg_MaximizeButtonMiddleClickCommand">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -653,12 +653,12 @@
<string>Right clic&amp;k:</string>
</property>
<property name="buddy">
<cstring>rightClickMaximizeButton</cstring>
<cstring>kcfg_MaximizeButtonRightClickCommand</cstring>
</property>
</widget>
</item>
<item row="2" column="1">
<widget class="KComboBox" name="rightClickMaximizeButton">
<widget class="KComboBox" name="kcfg_MaximizeButtonRightClickCommand">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
......@@ -696,17 +696,17 @@
</customwidget>
</customwidgets>
<tabstops>
<tabstop>coTiDbl</tabstop>
<tabstop>coTiAct4</tabstop>
<tabstop>coTiAct1</tabstop>
<tabstop>coTiInAct1</tabstop>
<tabstop>coTiAct2</tabstop>
<tabstop>coTiInAct2</tabstop>
<tabstop>coTiAct3</tabstop>
<tabstop>coTiInAct3</tabstop>
<tabstop>leftClickMaximizeButton</tabstop>
<tabstop>middleClickMaximizeButton</tabstop>
<tabstop>rightClickMaximizeButton</tabstop>
<tabstop>kcfg_TitlebarDoubleClickCommand</tabstop>
<tabstop>kcfg_CommandTitlebarWheel</tabstop>
<tabstop>kcfg_CommandActiveTitlebar1</tabstop>
<tabstop>kcfg_CommandInactiveTitlebar1</tabstop>
<tabstop>kcfg_CommandActiveTitlebar2</tabstop>
<tabstop>kcfg_CommandInactiveTitlebar2</tabstop>
<tabstop>kcfg_CommandActiveTitlebar3</tabstop>
<tabstop>kcfg_CommandInactiveTitlebar3</tabstop>
<tabstop>kcfg_MaximizeButtonLeftClickCommand</tabstop>
<tabstop>kcfg_MaximizeButtonMiddleClickCommand</tabstop>
<tabstop>kcfg_MaximizeButtonRightClickCommand</tabstop>
</tabstops>
<resources/>
<connections/>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment