Commit 51a1e06d authored by Cyril Rossi's avatar Cyril Rossi

KCM KWinTabBox manage KCModule states

Following D27323, manage KCModule states for reinitialize/defaults/apply

Also, this should solve :

BUG: 414567
BUG: 387160
FIXED-IN: 5.19

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

Reviewed By: #kwin, ervin, meven, zzag

Subscribers: kwin

Tags: #kwin

Differential Revision:
parent d876dde0
......@@ -10,6 +10,7 @@ set(kcm_kwintabbox_PART_SRCS
ki18n_wrap_ui(kcm_kwintabbox_PART_SRCS main.ui)
This diff is collapsed.
KWin - the KDE window manager
This file is part of the KDE project.
Copyright (C) 2009 Martin Gräßlin <>
Copyright (C) 2020 Cyril Rossi <>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <>.
#include <QWidget>
#include <QStandardItemModel>
#include "tabboxconfig.h"
class KShortcutsEditor;
class KActionCollection;
namespace Ui
class KWinTabBoxConfigForm;
namespace KWin
class KWinTabBoxConfigForm : public QWidget
enum class TabboxType
enum EffectComboRole
LayoutPath = Qt::UserRole + 1,
AddonEffect, // i.e not builtin effects
explicit KWinTabBoxConfigForm(TabboxType type, QWidget *parent = nullptr);
~KWinTabBoxConfigForm() override;
bool highlightWindows() const;
bool showTabBox() const;
int filterScreen() const;
int filterDesktop() const;
int filterActivities() const;
int filterMinimization() const;
int applicationMode() const;
int showDesktopMode() const;
int switchingMode() const;
QString layoutName() const;
void setFilterScreen(TabBox::TabBoxConfig::ClientMultiScreenMode mode);
void setFilterDesktop(TabBox::TabBoxConfig::ClientDesktopMode mode);
void setFilterActivities(TabBox::TabBoxConfig::ClientActivitiesMode mode);
void setFilterMinimization(TabBox::TabBoxConfig::ClientMinimizedMode mode);
void setApplicationMode(TabBox::TabBoxConfig::ClientApplicationsMode mode);
void setShowDesktopMode(TabBox::TabBoxConfig::ShowDesktopMode mode);
void setSwitchingModeChanged(TabBox::TabBoxConfig::ClientSwitchingMode mode);
void setLayoutName(const QString &layoutName);
// EffectCombo Data Model
void setEffectComboModel(QStandardItemModel *model);
QVariant effectComboCurrentData(int role = Qt::UserRole) const;
void loadShortcuts();
void resetShortcuts();
void filterScreenChanged(int value);
void filterDesktopChanged(int value);
void filterActivitiesChanged(int value);
void filterMinimizationChanged(int value);
void applicationModeChanged(int value);
void showDesktopModeChanged(int value);
void switchingModeChanged(int value);
void layoutNameChanged(const QString &layoutName);
void effectConfigButtonClicked();
private Q_SLOTS:
void tabBoxToggled(bool on);
void onFilterScreen();
void onFilterDesktop();
void onFilterActivites();
void onFilterMinimization();
void onApplicationMode();
void onShowDesktopMode();
void onSwitchingMode();
void onEffectCombo();
void shortcutChanged(const QKeySequence &seq);
KActionCollection *m_actionCollection = nullptr;
KShortcutsEditor *m_editor = nullptr;
TabboxType m_type;
Ui::KWinTabBoxConfigForm *ui;
} // namespace
This diff is collapsed.
......@@ -24,14 +24,11 @@ along with this program. If not, see <>.
#include <kcmodule.h>
#include <ksharedconfig.h>
#include "ui_main.h"
class KShortcutsEditor;
class KActionCollection;
#include "tabboxconfig.h"
namespace KWin
class KWinTabBoxConfigForm;
enum class BuiltInEffect;
namespace TabBox
......@@ -41,15 +38,6 @@ class PluginsSettings;
class KWinTabBoxConfigForm : public QWidget, public Ui::KWinTabBoxConfigForm
explicit KWinTabBoxConfigForm(QWidget* parent);
class KWinTabBoxConfig : public KCModule
......@@ -64,33 +52,33 @@ public Q_SLOTS:
void defaults() override;
private Q_SLOTS:
void effectSelectionChanged(int index);
void updateUnmanagedState();
void configureEffectClicked();
void tabBoxToggled(bool on);
void shortcutChanged(const QKeySequence &seq);
void slotGHNS();
void updateUiFromConfig(KWinTabBoxConfigForm *ui, const TabBox::TabBoxSettings *config);
void updateConfigFromUi(const KWinTabBoxConfigForm *ui, TabBox::TabBoxSettings *config);
void updateUiFromConfig(KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
void updateConfigFromUi(const KWinTabBoxConfigForm *form, TabBox::TabBoxSettings *config);
void updateUiFromDefaultConfig(KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
void initLayoutLists();
void createConnections(KWinTabBoxConfigForm *form, TabBox::TabBoxSettings *config);
bool updateUnmanagedIsNeedSave(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
bool updateUnmanagedIsDefault(const KWinTabBoxConfigForm *form, const TabBox::TabBoxSettings *config);
enum Mode {
CoverSwitch = 0,
FlipSwitch = 1,
Layout = 2
KWinTabBoxConfigForm* m_primaryTabBoxUi;
KWinTabBoxConfigForm* m_alternativeTabBoxUi;
KWinTabBoxConfigForm *m_primaryTabBoxUi = nullptr;
KWinTabBoxConfigForm *m_alternativeTabBoxUi = nullptr;
KSharedConfigPtr m_config;
KActionCollection* m_actionCollection;
KShortcutsEditor* m_editor;
TabBox::TabBoxSettings *m_tabBoxConfig;
TabBox::TabBoxSettings *m_tabBoxAlternativeConfig;
TabBox::SwitchEffectSettings *m_coverSwitchConfig;
TabBox::SwitchEffectSettings *m_flipSwitchConfig;
TabBox::PluginsSettings *m_pluginsConfig;
// Builtin effects' names
QString m_coverSwitch;
QString m_flipSwitch;
} // namespace
......@@ -534,7 +534,7 @@
<item row="1" column="0">
<widget class="QCheckBox" name="showTabBox">
<widget class="QCheckBox" name="kcfg_ShowTabBox">
<property name="text">
......@@ -544,7 +544,7 @@
<item row="0" column="0" colspan="2">
<widget class="QCheckBox" name="highlightWindowCheck">
<widget class="QCheckBox" name="kcfg_HighlightWindows">
<property name="toolTip">
<string>The currently selected window will be highlighted by fading out all other windows. This option requires desktop effects to be active.</string>
......@@ -593,8 +593,8 @@
......@@ -680,7 +680,7 @@
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