From 462d99b83fe8c099bf842aca153aff71e96c9294 Mon Sep 17 00:00:00 2001 From: Devin Lin Date: Thu, 16 Mar 2023 19:44:36 -0700 Subject: [PATCH] quicksettings: Extract out from mobileshell into separate plugin --- components/CMakeLists.txt | 1 + components/mobileshell/CMakeLists.txt | 5 -- components/mobileshell/mobileshellplugin.cpp | 10 --- .../mobileshell/mobileshellsettings.cpp | 48 ------------ components/mobileshell/mobileshellsettings.h | 26 ------- .../LandscapeContentContainer.qml | 6 +- .../actiondrawer/PortraitContentContainer.qml | 3 +- .../quicksettings/QuickSettings.qml | 10 +-- .../quicksettings/QuickSettingsDrawer.qml | 4 +- .../QuickSettingsFullDelegate.qml | 3 +- .../quicksettings/QuickSettingsPanel.qml | 1 - .../mobileshell/qml/components/PopupMenu.qml | 1 - .../mobileshell/qml/homescreen/HomeScreen.qml | 6 +- .../navigationpanel/NavigationGestureArea.qml | 3 - .../qml/navigationpanel/NavigationPanel.qml | 6 +- .../statusbar/indicators/BatteryIndicator.qml | 4 +- components/mobileshell/shellutil.cpp | 1 - components/quicksettingsplugin/CMakeLists.txt | 32 ++++++++ .../paginatemodel.cpp | 0 .../paginatemodel.h | 0 components/quicksettingsplugin/qmldir | 8 ++ .../quicksetting.cpp | 0 .../quicksetting.h | 0 .../quicksettingsconfig.cpp | 76 +++++++++++++++++++ .../quicksettingsplugin/quicksettingsconfig.h | 60 +++++++++++++++ .../quicksettingsmodel.cpp | 0 .../quicksettingsmodel.h | 0 .../quicksettingsplugin.cpp | 23 ++++++ .../quicksettingsplugin/quicksettingsplugin.h | 18 +++++ .../savedquicksettings.cpp | 6 +- .../savedquicksettings.h | 4 +- .../savedquicksettingsmodel.cpp | 0 .../savedquicksettingsmodel.h | 1 - .../package/contents/ui/QuickSettingsForm.qml | 4 +- .../airplanemode/contents/ui/main.qml | 4 +- quicksettings/audio/contents/ui/main.qml | 3 +- quicksettings/battery/contents/ui/main.qml | 3 +- quicksettings/bluetooth/contents/ui/main.qml | 4 +- quicksettings/caffeine/contents/ui/main.qml | 4 +- .../donotdisturb/contents/ui/main.qml | 4 +- .../flashlight/package/contents/ui/main.qml | 5 +- quicksettings/hotspot/contents/ui/main.qml | 5 +- .../keyboardtoggle/contents/ui/main.qml | 3 +- quicksettings/mobiledata/contents/ui/main.qml | 3 +- .../nightcolor/package/contents/ui/main.qml | 4 +- .../powermenu/package/contents/ui/main.qml | 4 +- .../record/package/contents/ui/main.qml | 4 +- .../package/contents/ui/main.qml | 4 +- .../screenshot/package/contents/ui/main.qml | 4 +- .../settingsapp/contents/ui/main.qml | 4 +- quicksettings/wifi/contents/ui/main.qml | 4 +- 51 files changed, 284 insertions(+), 152 deletions(-) create mode 100644 components/quicksettingsplugin/CMakeLists.txt rename components/{mobileshell/quicksettings => quicksettingsplugin}/paginatemodel.cpp (100%) rename components/{mobileshell/quicksettings => quicksettingsplugin}/paginatemodel.h (100%) create mode 100644 components/quicksettingsplugin/qmldir rename components/{mobileshell/quicksettings => quicksettingsplugin}/quicksetting.cpp (100%) rename components/{mobileshell/quicksettings => quicksettingsplugin}/quicksetting.h (100%) create mode 100644 components/quicksettingsplugin/quicksettingsconfig.cpp create mode 100644 components/quicksettingsplugin/quicksettingsconfig.h rename components/{mobileshell/quicksettings => quicksettingsplugin}/quicksettingsmodel.cpp (100%) rename components/{mobileshell/quicksettings => quicksettingsplugin}/quicksettingsmodel.h (100%) create mode 100644 components/quicksettingsplugin/quicksettingsplugin.cpp create mode 100644 components/quicksettingsplugin/quicksettingsplugin.h rename components/{mobileshell/quicksettings => quicksettingsplugin}/savedquicksettings.cpp (96%) rename components/{mobileshell/quicksettings => quicksettingsplugin}/savedquicksettings.h (95%) rename components/{mobileshell/quicksettings => quicksettingsplugin}/savedquicksettingsmodel.cpp (100%) rename components/{mobileshell/quicksettings => quicksettingsplugin}/savedquicksettingsmodel.h (97%) diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index de93503c..3c6095af 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -5,4 +5,5 @@ add_subdirectory(mmplugin) add_subdirectory(mobileshell) add_subdirectory(mobileshellstate) +add_subdirectory(quicksettingsplugin) add_subdirectory(windowplugin) diff --git a/components/mobileshell/CMakeLists.txt b/components/mobileshell/CMakeLists.txt index ec203e26..077d0107 100644 --- a/components/mobileshell/CMakeLists.txt +++ b/components/mobileshell/CMakeLists.txt @@ -9,11 +9,6 @@ set(mobileshellplugin_SRCS mobileshellsettings.cpp shellutil.cpp components/direction.cpp - quicksettings/quicksetting.cpp - quicksettings/paginatemodel.cpp - quicksettings/quicksettingsmodel.cpp - quicksettings/savedquicksettings.cpp - quicksettings/savedquicksettingsmodel.cpp notifications/notificationthumbnailer.cpp notifications/notificationfilemenu.cpp taskswitcher/displaysmodel.cpp diff --git a/components/mobileshell/mobileshellplugin.cpp b/components/mobileshell/mobileshellplugin.cpp index dfebafb5..bfa2147f 100644 --- a/components/mobileshell/mobileshellplugin.cpp +++ b/components/mobileshell/mobileshellplugin.cpp @@ -16,10 +16,6 @@ #include "taskswitcher/displaysmodel.h" -#include "quicksettings/paginatemodel.h" -#include "quicksettings/quicksetting.h" -#include "quicksettings/quicksettingsmodel.h" - #include "mobileshellsettings.h" #include "shellutil.h" @@ -40,12 +36,6 @@ void MobileShellPlugin::registerTypes(const char *uri) return MobileShellSettings::self(); }); - qmlRegisterType(uri, 1, 0, "QuickSetting"); - qmlRegisterType(uri, 1, 0, "QuickSettingsModel"); - qmlRegisterType(uri, 1, 0, "PaginateModel"); - qmlRegisterType(uri, 1, 0, "SavedQuickSettings"); - qmlRegisterType(uri, 1, 0, "SavedQuickSettingsModel"); - // components qmlRegisterType(uri, 1, 0, "Direction"); diff --git a/components/mobileshell/mobileshellsettings.cpp b/components/mobileshell/mobileshellsettings.cpp index 1f0c0b49..ce41d2d0 100644 --- a/components/mobileshell/mobileshellsettings.cpp +++ b/components/mobileshell/mobileshellsettings.cpp @@ -10,7 +10,6 @@ const QString CONFIG_FILE = QStringLiteral("plasmamobilerc"); const QString GENERAL_CONFIG_GROUP = QStringLiteral("General"); -const QString QUICKSETTINGS_CONFIG_GROUP = QStringLiteral("QuickSettings"); MobileShellSettings *MobileShellSettings::self() { @@ -35,9 +34,6 @@ MobileShellSettings::MobileShellSettings(QObject *parent) Q_EMIT taskSwitcherPreviewsEnabledChanged(); Q_EMIT actionDrawerTopLeftModeChanged(); Q_EMIT actionDrawerTopRightModeChanged(); - } else if (group.name() == QUICKSETTINGS_CONFIG_GROUP) { - Q_EMIT enabledQuickSettingsChanged(); - Q_EMIT disabledQuickSettingsChanged(); } }); } @@ -145,47 +141,3 @@ void MobileShellSettings::setActionDrawerTopRightMode(ActionDrawerMode actionDra group.writeEntry("actionDrawerTopRightMode", (int)actionDrawerMode, KConfigGroup::Notify); m_config->sync(); } - -QList MobileShellSettings::enabledQuickSettings() const -{ - auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; - // TODO move defaults to file - // we aren't worried about quicksettings not showing up though, any that are not specified will be automatically added to the end - return group.readEntry("enabledQuickSettings", - QList{QStringLiteral("org.kde.plasma.quicksetting.wifi"), - QStringLiteral("org.kde.plasma.quicksetting.mobiledata"), - QStringLiteral("org.kde.plasma.quicksetting.bluetooth"), - QStringLiteral("org.kde.plasma.quicksetting.flashlight"), - QStringLiteral("org.kde.plasma.quicksetting.screenrotation"), - QStringLiteral("org.kde.plasma.quicksetting.settingsapp"), - QStringLiteral("org.kde.plasma.quicksetting.airplanemode"), - QStringLiteral("org.kde.plasma.quicksetting.audio"), - QStringLiteral("org.kde.plasma.quicksetting.battery"), - QStringLiteral("org.kde.plasma.quicksetting.record"), - QStringLiteral("org.kde.plasma.quicksetting.nightcolor"), - QStringLiteral("org.kde.plasma.quicksetting.screenshot"), - QStringLiteral("org.kde.plasma.quicksetting.powermenu"), - QStringLiteral("org.kde.plasma.quicksetting.donotdisturb"), - QStringLiteral("org.kde.plasma.quicksetting.caffeine"), - QStringLiteral("org.kde.plasma.quicksetting.keyboardtoggle")}); -} - -void MobileShellSettings::setEnabledQuickSettings(QList &list) -{ - auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; - group.writeEntry("enabledQuickSettings", list, KConfigGroup::Notify); - m_config->sync(); -} - -QList MobileShellSettings::disabledQuickSettings() const -{ - auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; - return group.readEntry("disabledQuickSettings", QList{}); -} - -void MobileShellSettings::setDisabledQuickSettings(QList &list) -{ - auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; - group.writeEntry("disabledQuickSettings", list, KConfigGroup::Notify); - m_config->sync(); -} diff --git a/components/mobileshell/mobileshellsettings.h b/components/mobileshell/mobileshellsettings.h index 469c9dc1..b48316f4 100644 --- a/components/mobileshell/mobileshellsettings.h +++ b/components/mobileshell/mobileshellsettings.h @@ -151,30 +151,6 @@ public: */ void setActionDrawerTopRightMode(ActionDrawerMode actionDrawerMode); - /** - * Get the list of IDs of quick settings that are enabled. - */ - QList enabledQuickSettings() const; - - /** - * Set the list of quick settings that are enabled. - * - * @param list A list of quick setting IDs. - */ - void setEnabledQuickSettings(QList &list); - - /** - * Get the list of IDs of quick settings that are disabled. - */ - QList disabledQuickSettings() const; - - /** - * Set the list of quick settings that are disabled. - * - * @param list A list of quick setting IDs. - */ - void setDisabledQuickSettings(QList &list); - Q_SIGNALS: void vibrationsEnabledChanged(); void vibrationIntensityChanged(); @@ -185,8 +161,6 @@ Q_SIGNALS: void taskSwitcherPreviewsEnabledChanged(); void actionDrawerTopLeftModeChanged(); void actionDrawerTopRightModeChanged(); - void enabledQuickSettingsChanged(); - void disabledQuickSettingsChanged(); private: KConfigWatcher::Ptr m_configWatcher; diff --git a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml index 5249a33b..47947e24 100644 --- a/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/LandscapeContentContainer.qml @@ -17,6 +17,8 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.mobileshell 1.0 as MobileShell import "../components" as Components +import "../widgets/mediacontrols" as MediaControls +import "../widgets/notifications" as Notifications import "quicksettings" /** @@ -80,7 +82,7 @@ PlasmaCore.ColorScope { } anchors.margins: minWidthHeight * 0.06 - MobileShell.NotificationsWidget { + Notifications.NotificationsWidget { id: notificationWidget historyModel: root.actionDrawer.notificationModel historyModelType: root.actionDrawer.notificationModelType @@ -143,7 +145,7 @@ PlasmaCore.ColorScope { font.weight: Font.Light } - MobileShell.MediaControlsWidget { + MediaControls.MediaControlsWidget { id: mediaWidget property real fullHeight: visible ? height + PlasmaCore.Units.smallSpacing * 6 : 0 diff --git a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml index bbcd8f08..50716cc6 100644 --- a/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml +++ b/components/mobileshell/qml/actiondrawer/PortraitContentContainer.qml @@ -14,6 +14,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.mobileshell 1.0 as MobileShell import "../components" as Components +import "../widgets/notifications" as Notifications import "quicksettings" /** @@ -94,7 +95,7 @@ PlasmaCore.ColorScope { } } - MobileShell.NotificationsWidget { + Notifications.NotificationsWidget { id: notificationWidget historyModel: root.actionDrawer.notificationModel historyModelType: root.actionDrawer.notificationModelType diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml index bc8ba93f..f997b41c 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettings.qml @@ -12,8 +12,8 @@ import QtQuick.Window 2.2 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 3.0 as PlasmaComponents -import org.kde.plasma.private.mobileshell 1.0 as MobileShell -import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS +import org.kde.plasma.private.mobileshell.state as MobileShellState import "../../components" as Components import "../../components/util.js" as Util @@ -48,7 +48,7 @@ Item { property real minimizedViewProgress: 0 property real fullViewProgress: 1 - readonly property MobileShell.QuickSettingsModel quickSettingsModel: MobileShell.QuickSettingsModel {} + readonly property QS.QuickSettingsModel quickSettingsModel: QS.QuickSettingsModel {} readonly property int columnCount: Math.floor(width/columnWidth) readonly property int rowCount: { @@ -131,7 +131,7 @@ Item { anchors.right: parent.right Repeater { - model: MobileShell.PaginateModel { + model: QS.PaginateModel { sourceModel: quickSettingsModel pageSize: minimizedColumns } @@ -183,7 +183,7 @@ Item { required property int index Repeater { - model: MobileShell.PaginateModel { + model: QS.PaginateModel { sourceModel: quickSettingsModel pageSize: root.pageSize firstItem: pageSize * flow.index diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml index ab414e99..8c25b43c 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsDrawer.qml @@ -13,11 +13,11 @@ import Qt5Compat.GraphicalEffects import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import "../../statusbar" as StatusBar import "../../components" as Components +import "../../widgets/mediacontrols" as MediaControls import "../" /** @@ -105,7 +105,7 @@ Components.BaseItem { width: parent.width } - MobileShell.MediaControlsWidget { + MediaControls.MediaControlsWidget { id: mediaWidget property real fullHeight: height + Layout.topMargin Layout.fillWidth: true diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml index fa6c7cc6..a862976b 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsFullDelegate.qml @@ -11,7 +11,6 @@ import QtQuick.Layouts 1.1 import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.nanoshell 2.0 as NanoShell import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.components 3.0 as PlasmaComponents @@ -55,7 +54,7 @@ QuickSettingsDelegate { } } - MobileShell.HapticsEffectLoader { + Components.HapticsEffectLoader { id: haptics } diff --git a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml index f5a48451..ad0f779c 100644 --- a/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml +++ b/components/mobileshell/qml/actiondrawer/quicksettings/QuickSettingsPanel.qml @@ -13,7 +13,6 @@ import Qt5Compat.GraphicalEffects import org.kde.kirigami 2.12 as Kirigami import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import "../../statusbar" as StatusBar import "../../components" as Components diff --git a/components/mobileshell/qml/components/PopupMenu.qml b/components/mobileshell/qml/components/PopupMenu.qml index 472d32ce..b2399590 100644 --- a/components/mobileshell/qml/components/PopupMenu.qml +++ b/components/mobileshell/qml/components/PopupMenu.qml @@ -9,7 +9,6 @@ import QtQuick.Layouts import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.private.nanoshell as NanoShell -import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.kirigami as Kirigami diff --git a/components/mobileshell/qml/homescreen/HomeScreen.qml b/components/mobileshell/qml/homescreen/HomeScreen.qml index 0dd939e2..8b0bfbfe 100644 --- a/components/mobileshell/qml/homescreen/HomeScreen.qml +++ b/components/mobileshell/qml/homescreen/HomeScreen.qml @@ -14,6 +14,8 @@ import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.state as MobileShellState import org.kde.plasma.private.mobileshell.windowplugin as WindowPlugin +import "../components" as Components + /** * The base homescreen component, implementing features that simplify * homescreen implementation. @@ -162,7 +164,7 @@ Item { } // homescreen visual component - MobileShell.BaseItem { + Components.BaseItem { id: itemContainer anchors.fill: parent @@ -233,7 +235,7 @@ Item { } // start app animation component - MobileShell.StartupFeedback { + Components.StartupFeedback { id: startupFeedback z: 999999 anchors.fill: parent diff --git a/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml b/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml index e08d9b95..e8ab2929 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationGestureArea.qml @@ -14,9 +14,6 @@ import org.kde.taskmanager 0.1 as TaskManager import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kquickcontrolsaddons 2.0 -import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell - Item { id: root diff --git a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml index ae8086a8..da55ccb4 100644 --- a/components/mobileshell/qml/navigationpanel/NavigationPanel.qml +++ b/components/mobileshell/qml/navigationpanel/NavigationPanel.qml @@ -14,10 +14,10 @@ import org.kde.taskmanager 0.1 as TaskManager import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.kquickcontrolsaddons 2.0 -import org.kde.plasma.private.nanoshell 2.0 as NanoShell -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import "../components" as Components + Item { id: root @@ -61,7 +61,7 @@ Item { property NavigationPanelButton activeButton - MobileShell.HapticsEffectLoader { + Components.HapticsEffectLoader { id: haptics } diff --git a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml index ba0aea97..40f67cbf 100644 --- a/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml +++ b/components/mobileshell/qml/statusbar/indicators/BatteryIndicator.qml @@ -13,8 +13,10 @@ import org.kde.plasma.components 3.0 as PlasmaComponents import org.kde.plasma.workspace.components 2.0 as PW import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import "../../dataproviders" as DataProviders + RowLayout { - readonly property var provider: MobileShell.BatteryInfo {} + readonly property var provider: DataProviders.BatteryInfo {} property real textPixelSize: PlasmaCore.Units.gridUnit * 0.6 visible: provider.isVisible diff --git a/components/mobileshell/shellutil.cpp b/components/mobileshell/shellutil.cpp index 7487bf1a..1aeb6ccb 100644 --- a/components/mobileshell/shellutil.cpp +++ b/components/mobileshell/shellutil.cpp @@ -7,7 +7,6 @@ */ #include "shellutil.h" -#include "mobileshellsettings.h" #include #include diff --git a/components/quicksettingsplugin/CMakeLists.txt b/components/quicksettingsplugin/CMakeLists.txt new file mode 100644 index 00000000..94af94fd --- /dev/null +++ b/components/quicksettingsplugin/CMakeLists.txt @@ -0,0 +1,32 @@ +# SPDX-FileCopyrightText: 2023 Devin Lin +# SPDX-License-Identifier: GPL-2.0-or-later + +add_library(quicksettingsplugin) +target_sources(quicksettingsplugin PRIVATE + paginatemodel.cpp + quicksetting.cpp + quicksettingsmodel.cpp + quicksettingsplugin.cpp + quicksettingsconfig.cpp + savedquicksettings.cpp + savedquicksettingsmodel.cpp +) + +target_link_libraries(quicksettingsplugin + Qt::Qml + Qt::DBus + Qt::Gui + Qt::Quick + KF6::WaylandClient + KF6::Service + KF6::ConfigWidgets + KF6::Package +) + +set_property(TARGET quicksettingsplugin PROPERTY LIBRARY_OUTPUT_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/quicksettingsplugin) +file(COPY qmldir DESTINATION ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/org/kde/plasma/private/mobileshell/quicksettingsplugin) + +install(TARGETS quicksettingsplugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/quicksettingsplugin) +install(FILES qmldir ${qml_SRC} DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/mobileshell/quicksettingsplugin) + + diff --git a/components/mobileshell/quicksettings/paginatemodel.cpp b/components/quicksettingsplugin/paginatemodel.cpp similarity index 100% rename from components/mobileshell/quicksettings/paginatemodel.cpp rename to components/quicksettingsplugin/paginatemodel.cpp diff --git a/components/mobileshell/quicksettings/paginatemodel.h b/components/quicksettingsplugin/paginatemodel.h similarity index 100% rename from components/mobileshell/quicksettings/paginatemodel.h rename to components/quicksettingsplugin/paginatemodel.h diff --git a/components/quicksettingsplugin/qmldir b/components/quicksettingsplugin/qmldir new file mode 100644 index 00000000..14490d59 --- /dev/null +++ b/components/quicksettingsplugin/qmldir @@ -0,0 +1,8 @@ +# SPDX-FileCopyrightText: 2021-2022 Devin Lin +# SPDX-License-Identifier: GPL-2.0-or-later + +module org.kde.plasma.private.mobileshell.quicksettingsplugin + +plugin quicksettingsplugin + + diff --git a/components/mobileshell/quicksettings/quicksetting.cpp b/components/quicksettingsplugin/quicksetting.cpp similarity index 100% rename from components/mobileshell/quicksettings/quicksetting.cpp rename to components/quicksettingsplugin/quicksetting.cpp diff --git a/components/mobileshell/quicksettings/quicksetting.h b/components/quicksettingsplugin/quicksetting.h similarity index 100% rename from components/mobileshell/quicksettings/quicksetting.h rename to components/quicksettingsplugin/quicksetting.h diff --git a/components/quicksettingsplugin/quicksettingsconfig.cpp b/components/quicksettingsplugin/quicksettingsconfig.cpp new file mode 100644 index 00000000..b1278692 --- /dev/null +++ b/components/quicksettingsplugin/quicksettingsconfig.cpp @@ -0,0 +1,76 @@ +/* + * SPDX-FileCopyrightText: 2022 Devin Lin + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#include "quicksettingsconfig.h" + +#include + +const QString CONFIG_FILE = QStringLiteral("plasmamobilerc"); +const QString QUICKSETTINGS_CONFIG_GROUP = QStringLiteral("QuickSettings"); + +QuickSettingsConfig *QuickSettingsConfig::self() +{ + static QuickSettingsConfig *singleton = new QuickSettingsConfig(); + return singleton; +} + +QuickSettingsConfig::QuickSettingsConfig(QObject *parent) + : QObject{parent} + , m_config{KSharedConfig::openConfig(CONFIG_FILE, KConfig::SimpleConfig)} +{ + m_configWatcher = KConfigWatcher::create(m_config); + + connect(m_configWatcher.data(), &KConfigWatcher::configChanged, this, [this](const KConfigGroup &group, const QByteArrayList &names) -> void { + if (group.name() == QUICKSETTINGS_CONFIG_GROUP) { + Q_EMIT enabledQuickSettingsChanged(); + Q_EMIT disabledQuickSettingsChanged(); + } + }); +} + +QList QuickSettingsConfig::enabledQuickSettings() const +{ + auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; + // TODO move defaults to file + // we aren't worried about quicksettings not showing up though, any that are not specified will be automatically added to the end + return group.readEntry("enabledQuickSettings", + QList{QStringLiteral("org.kde.plasma.quicksetting.wifi"), + QStringLiteral("org.kde.plasma.quicksetting.mobiledata"), + QStringLiteral("org.kde.plasma.quicksetting.bluetooth"), + QStringLiteral("org.kde.plasma.quicksetting.flashlight"), + QStringLiteral("org.kde.plasma.quicksetting.screenrotation"), + QStringLiteral("org.kde.plasma.quicksetting.settingsapp"), + QStringLiteral("org.kde.plasma.quicksetting.airplanemode"), + QStringLiteral("org.kde.plasma.quicksetting.audio"), + QStringLiteral("org.kde.plasma.quicksetting.battery"), + QStringLiteral("org.kde.plasma.quicksetting.record"), + QStringLiteral("org.kde.plasma.quicksetting.nightcolor"), + QStringLiteral("org.kde.plasma.quicksetting.screenshot"), + QStringLiteral("org.kde.plasma.quicksetting.powermenu"), + QStringLiteral("org.kde.plasma.quicksetting.donotdisturb"), + QStringLiteral("org.kde.plasma.quicksetting.caffeine"), + QStringLiteral("org.kde.plasma.quicksetting.keyboardtoggle")}); +} + +void QuickSettingsConfig::setEnabledQuickSettings(QList &list) +{ + auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; + group.writeEntry("enabledQuickSettings", list, KConfigGroup::Notify); + m_config->sync(); +} + +QList QuickSettingsConfig::disabledQuickSettings() const +{ + auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; + return group.readEntry("disabledQuickSettings", QList{}); +} + +void QuickSettingsConfig::setDisabledQuickSettings(QList &list) +{ + auto group = KConfigGroup{m_config, QUICKSETTINGS_CONFIG_GROUP}; + group.writeEntry("disabledQuickSettings", list, KConfigGroup::Notify); + m_config->sync(); +} diff --git a/components/quicksettingsplugin/quicksettingsconfig.h b/components/quicksettingsplugin/quicksettingsconfig.h new file mode 100644 index 00000000..1b008b04 --- /dev/null +++ b/components/quicksettingsplugin/quicksettingsconfig.h @@ -0,0 +1,60 @@ + +/* + * SPDX-FileCopyrightText: 2022 Devin Lin + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + +#pragma once + +#include +#include +#include +#include + +/** + * @short Wrapper class to access and control mobile shell specific settings. + * + * @author Devin Lin + */ +class QuickSettingsConfig : public QObject +{ + Q_OBJECT + +public: + static QuickSettingsConfig *self(); + + QuickSettingsConfig(QObject *parent = nullptr); + + /** + * Get the list of IDs of quick settings that are enabled. + */ + QList enabledQuickSettings() const; + + /** + * Set the list of quick settings that are enabled. + * + * @param list A list of quick setting IDs. + */ + void setEnabledQuickSettings(QList &list); + + /** + * Get the list of IDs of quick settings that are disabled. + */ + QList disabledQuickSettings() const; + + /** + * Set the list of quick settings that are disabled. + * + * @param list A list of quick setting IDs. + */ + void setDisabledQuickSettings(QList &list); + +Q_SIGNALS: + void enabledQuickSettingsChanged(); + void disabledQuickSettingsChanged(); + +private: + KConfigWatcher::Ptr m_configWatcher; + KSharedConfig::Ptr m_config; +}; diff --git a/components/mobileshell/quicksettings/quicksettingsmodel.cpp b/components/quicksettingsplugin/quicksettingsmodel.cpp similarity index 100% rename from components/mobileshell/quicksettings/quicksettingsmodel.cpp rename to components/quicksettingsplugin/quicksettingsmodel.cpp diff --git a/components/mobileshell/quicksettings/quicksettingsmodel.h b/components/quicksettingsplugin/quicksettingsmodel.h similarity index 100% rename from components/mobileshell/quicksettings/quicksettingsmodel.h rename to components/quicksettingsplugin/quicksettingsmodel.h diff --git a/components/quicksettingsplugin/quicksettingsplugin.cpp b/components/quicksettingsplugin/quicksettingsplugin.cpp new file mode 100644 index 00000000..e3005b1e --- /dev/null +++ b/components/quicksettingsplugin/quicksettingsplugin.cpp @@ -0,0 +1,23 @@ +// SPDX-FileCopyrightText: 2023 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later + +#include "quicksettingsplugin.h" +#include "paginatemodel.h" +#include "quicksetting.h" +#include "quicksettingsmodel.h" +#include "savedquicksettings.h" +#include "savedquicksettingsmodel.h" + +#include +#include + +void QuickSettingsPlugin::registerTypes(const char *uri) +{ + Q_ASSERT(QLatin1String(uri) == QLatin1String("org.kde.plasma.private.mobileshell.quicksettingsplugin")); + + qmlRegisterType(uri, 1, 0, "QuickSetting"); + qmlRegisterType(uri, 1, 0, "QuickSettingsModel"); + qmlRegisterType(uri, 1, 0, "PaginateModel"); + qmlRegisterType(uri, 1, 0, "SavedQuickSettings"); + qmlRegisterType(uri, 1, 0, "SavedQuickSettingsModel"); +} diff --git a/components/quicksettingsplugin/quicksettingsplugin.h b/components/quicksettingsplugin/quicksettingsplugin.h new file mode 100644 index 00000000..6bc8f9e0 --- /dev/null +++ b/components/quicksettingsplugin/quicksettingsplugin.h @@ -0,0 +1,18 @@ +// SPDX-FileCopyrightText: 2023 Devin Lin +// SPDX-License-Identifier: GPL-2.0-or-later + +#pragma once + +#include + +#include +#include + +class QuickSettingsPlugin : public QQmlExtensionPlugin +{ + Q_OBJECT + Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface") + +public: + void registerTypes(const char *uri) override; +}; diff --git a/components/mobileshell/quicksettings/savedquicksettings.cpp b/components/quicksettingsplugin/savedquicksettings.cpp similarity index 96% rename from components/mobileshell/quicksettings/savedquicksettings.cpp rename to components/quicksettingsplugin/savedquicksettings.cpp index 9fb22439..3800c476 100644 --- a/components/mobileshell/quicksettings/savedquicksettings.cpp +++ b/components/quicksettingsplugin/savedquicksettings.cpp @@ -9,7 +9,7 @@ SavedQuickSettings::SavedQuickSettings(QObject *parent) : QObject{parent} - , m_settings{new MobileShellSettings{this}} + , m_settings{new QuickSettingsConfig{this}} , m_validPackages{} , m_enabledPackages{} , m_disabledPackages{} @@ -45,10 +45,10 @@ SavedQuickSettings::SavedQuickSettings(QObject *parent) } // subscribe to config changes - connect(m_settings, &MobileShellSettings::enabledQuickSettingsChanged, this, [this]() { + connect(m_settings, &QuickSettingsConfig::enabledQuickSettingsChanged, this, [this]() { m_updateTimer->start(); }); - connect(m_settings, &MobileShellSettings::disabledQuickSettingsChanged, this, [this]() { + connect(m_settings, &QuickSettingsConfig::disabledQuickSettingsChanged, this, [this]() { m_updateTimer->start(); }); diff --git a/components/mobileshell/quicksettings/savedquicksettings.h b/components/quicksettingsplugin/savedquicksettings.h similarity index 95% rename from components/mobileshell/quicksettings/savedquicksettings.h rename to components/quicksettingsplugin/savedquicksettings.h index 6fdee436..4dfcf517 100644 --- a/components/mobileshell/quicksettings/savedquicksettings.h +++ b/components/quicksettingsplugin/savedquicksettings.h @@ -3,9 +3,9 @@ #pragma once -#include "mobileshellsettings.h" #include "qqml.h" #include "quicksetting.h" +#include "quicksettingsconfig.h" #include "savedquicksettingsmodel.h" #include @@ -41,7 +41,7 @@ private: void refreshModel(); void saveModel(); - MobileShellSettings *m_settings; + QuickSettingsConfig *m_settings; QList m_validPackages; QList m_enabledPackages; QList m_disabledPackages; diff --git a/components/mobileshell/quicksettings/savedquicksettingsmodel.cpp b/components/quicksettingsplugin/savedquicksettingsmodel.cpp similarity index 100% rename from components/mobileshell/quicksettings/savedquicksettingsmodel.cpp rename to components/quicksettingsplugin/savedquicksettingsmodel.cpp diff --git a/components/mobileshell/quicksettings/savedquicksettingsmodel.h b/components/quicksettingsplugin/savedquicksettingsmodel.h similarity index 97% rename from components/mobileshell/quicksettings/savedquicksettingsmodel.h rename to components/quicksettingsplugin/savedquicksettingsmodel.h index b76d0ee7..b1973dc6 100644 --- a/components/mobileshell/quicksettings/savedquicksettingsmodel.h +++ b/components/quicksettingsplugin/savedquicksettingsmodel.h @@ -3,7 +3,6 @@ #pragma once -#include "mobileshellsettings.h" #include "qqml.h" #include "quicksetting.h" diff --git a/kcms/mobileshell/package/contents/ui/QuickSettingsForm.qml b/kcms/mobileshell/package/contents/ui/QuickSettingsForm.qml index d501ab02..45af262b 100644 --- a/kcms/mobileshell/package/contents/ui/QuickSettingsForm.qml +++ b/kcms/mobileshell/package/contents/ui/QuickSettingsForm.qml @@ -9,8 +9,8 @@ import QtQuick.Controls 2.15 as QQC2 import org.kde.kirigami 2.19 as Kirigami import org.kde.kcm 1.3 as KCM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS Kirigami.ScrollablePage { id: root @@ -96,7 +96,7 @@ Kirigami.ScrollablePage { } } - MobileShell.SavedQuickSettings { + QS.SavedQuickSettings { id: savedQuickSettings } diff --git a/quicksettings/airplanemode/contents/ui/main.qml b/quicksettings/airplanemode/contents/ui/main.qml index eddf8f55..b677a6d2 100644 --- a/quicksettings/airplanemode/contents/ui/main.qml +++ b/quicksettings/airplanemode/contents/ui/main.qml @@ -5,10 +5,10 @@ * SPDX-License-Identifier: LGPL-2.0-or-later */ -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.networkmanagement 0.2 as PlasmaNM +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Airplane Mode") icon: "network-flightmode-on" status: "" diff --git a/quicksettings/audio/contents/ui/main.qml b/quicksettings/audio/contents/ui/main.qml index 099501ac..92a5dbe6 100644 --- a/quicksettings/audio/contents/ui/main.qml +++ b/quicksettings/audio/contents/ui/main.qml @@ -5,8 +5,9 @@ import QtQuick import org.kde.plasma.private.mobileshell as MobileShell import org.kde.plasma.private.mobileshell.state as MobileShellState +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Sound") icon: "audio-speakers-symbolic" status: i18n("%1%", MobileShellState.AudioProvider.volumeValue) diff --git a/quicksettings/battery/contents/ui/main.qml b/quicksettings/battery/contents/ui/main.qml index 4aa0295f..e5744a6a 100644 --- a/quicksettings/battery/contents/ui/main.qml +++ b/quicksettings/battery/contents/ui/main.qml @@ -3,9 +3,10 @@ import QtQuick 2.15 +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.plasma.private.mobileshell 1.0 as MobileShell -MobileShell.QuickSetting { +QS.QuickSetting { property var batteryInfo: MobileShell.BatteryInfo {} text: i18n("Battery") diff --git a/quicksettings/bluetooth/contents/ui/main.qml b/quicksettings/bluetooth/contents/ui/main.qml index 747a30bf..830babe1 100644 --- a/quicksettings/bluetooth/contents/ui/main.qml +++ b/quicksettings/bluetooth/contents/ui/main.qml @@ -4,9 +4,9 @@ import QtQuick 2.15 import org.kde.bluezqt 1.0 as BluezQt -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { property QtObject btManager: BluezQt.Manager property var connectedDevices: [] diff --git a/quicksettings/caffeine/contents/ui/main.qml b/quicksettings/caffeine/contents/ui/main.qml index 9ba6dacf..dbf8e703 100644 --- a/quicksettings/caffeine/contents/ui/main.qml +++ b/quicksettings/caffeine/contents/ui/main.qml @@ -4,11 +4,11 @@ * SPDX-License-Identifier: LGPL-2.0-or-later */ -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.plasma5support 2.0 as P5Support -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Caffeine") icon: "system-suspend-hibernate" status: enabled ? i18n("Tap to disable sleep suspension") : i18n("Tap to suspend sleep") diff --git a/quicksettings/donotdisturb/contents/ui/main.qml b/quicksettings/donotdisturb/contents/ui/main.qml index cf3ca567..c545c822 100644 --- a/quicksettings/donotdisturb/contents/ui/main.qml +++ b/quicksettings/donotdisturb/contents/ui/main.qml @@ -5,10 +5,10 @@ */ import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Do Not Disturb") icon: enabled ? "notifications-disabled" : "notifications" status: "" diff --git a/quicksettings/flashlight/package/contents/ui/main.qml b/quicksettings/flashlight/package/contents/ui/main.qml index aeb53ccf..a93db215 100644 --- a/quicksettings/flashlight/package/contents/ui/main.qml +++ b/quicksettings/flashlight/package/contents/ui/main.qml @@ -3,10 +3,11 @@ import QtQuick 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.quicksetting.flashlight 1.0 +import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Flashlight") icon: "flashlight-on" enabled: FlashlightUtil.torchEnabled diff --git a/quicksettings/hotspot/contents/ui/main.qml b/quicksettings/hotspot/contents/ui/main.qml index 9196909a..c2dfb02a 100644 --- a/quicksettings/hotspot/contents/ui/main.qml +++ b/quicksettings/hotspot/contents/ui/main.qml @@ -4,9 +4,9 @@ import QtQuick 2.15 import org.kde.plasma.networkmanagement 0.2 as PlasmaNM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { id: root PlasmaNM.Handler { @@ -17,7 +17,6 @@ MobileShell.QuickSetting { id: wirelessStatus } - text: i18n("Hotspot") icon: "network-wireless-hotspot" diff --git a/quicksettings/keyboardtoggle/contents/ui/main.qml b/quicksettings/keyboardtoggle/contents/ui/main.qml index 00a09a03..4a17427e 100644 --- a/quicksettings/keyboardtoggle/contents/ui/main.qml +++ b/quicksettings/keyboardtoggle/contents/ui/main.qml @@ -4,11 +4,12 @@ * SPDX-License-Identifier: GPL-2.0-or-later */ +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.workspace.keyboardlayout 1.0 as Keyboards -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Virtual Keyboard") icon: "input-keyboard-virtual" status: enabled ? i18n("On") : diff --git a/quicksettings/mobiledata/contents/ui/main.qml b/quicksettings/mobiledata/contents/ui/main.qml index 1ef45da2..6bf443db 100644 --- a/quicksettings/mobiledata/contents/ui/main.qml +++ b/quicksettings/mobiledata/contents/ui/main.qml @@ -5,8 +5,9 @@ import QtQuick 2.15 import org.kde.plasma.mm 1.0 as PlasmaMM import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Mobile Data") icon: "network-modem" status: { diff --git a/quicksettings/nightcolor/package/contents/ui/main.qml b/quicksettings/nightcolor/package/contents/ui/main.qml index 5b18b63c..6f6a06e1 100644 --- a/quicksettings/nightcolor/package/contents/ui/main.qml +++ b/quicksettings/nightcolor/package/contents/ui/main.qml @@ -7,10 +7,10 @@ */ import org.kde.colorcorrect 0.1 as CC -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.quicksetting.nightcolor 1.0 as NightColor +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Night Color") icon: "redshift-status-on" enabled: NightColor.NightColorUtil.enabled diff --git a/quicksettings/powermenu/package/contents/ui/main.qml b/quicksettings/powermenu/package/contents/ui/main.qml index ae0b37a3..6dfeba58 100644 --- a/quicksettings/powermenu/package/contents/ui/main.qml +++ b/quicksettings/powermenu/package/contents/ui/main.qml @@ -4,11 +4,11 @@ * SPDX-License-Identifier: LGPL-2.0-or-later */ -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.quicksetting.powermenu 1.0 as PowerMenu +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Shut Down") icon: "system-shutdown-symbolic" status: i18n("Open power menu") diff --git a/quicksettings/record/package/contents/ui/main.qml b/quicksettings/record/package/contents/ui/main.qml index b59135ab..60529dbd 100644 --- a/quicksettings/record/package/contents/ui/main.qml +++ b/quicksettings/record/package/contents/ui/main.qml @@ -4,13 +4,13 @@ import QtQuick 2.15 import QtQuick.Window 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.pipewire.record 0.1 as PWRec import org.kde.taskmanager 0.1 as TaskManager import org.kde.plasma.quicksetting.record 1.0 +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { id: root text: switch (record.state) { case PWRec.PipeWireRecord.Idle: diff --git a/quicksettings/screenrotation/package/contents/ui/main.qml b/quicksettings/screenrotation/package/contents/ui/main.qml index 05ff16c3..242dae7c 100644 --- a/quicksettings/screenrotation/package/contents/ui/main.qml +++ b/quicksettings/screenrotation/package/contents/ui/main.qml @@ -3,10 +3,10 @@ import QtQuick 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell import org.kde.plasma.quicksetting.screenrotation 1.0 +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Auto-rotate") icon: "rotation-allowed" settingsCommand: "plasma-open-settings kcm_kscreen" diff --git a/quicksettings/screenshot/package/contents/ui/main.qml b/quicksettings/screenshot/package/contents/ui/main.qml index a1775f40..c82529d6 100644 --- a/quicksettings/screenshot/package/contents/ui/main.qml +++ b/quicksettings/screenshot/package/contents/ui/main.qml @@ -3,11 +3,11 @@ import QtQuick 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS import org.kde.plasma.private.mobileshell.state 1.0 as MobileShellState import org.kde.plasma.quicksetting.screenshot 1.0 -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Screenshot") status: i18n("Tap to screenshot") icon: "spectacle" diff --git a/quicksettings/settingsapp/contents/ui/main.qml b/quicksettings/settingsapp/contents/ui/main.qml index 8ed607c8..29db63d3 100644 --- a/quicksettings/settingsapp/contents/ui/main.qml +++ b/quicksettings/settingsapp/contents/ui/main.qml @@ -3,9 +3,9 @@ import QtQuick 2.15 -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { text: i18n("Settings") status: i18n("Tap to open") icon: "configure" diff --git a/quicksettings/wifi/contents/ui/main.qml b/quicksettings/wifi/contents/ui/main.qml index 4f46023e..2f1f7784 100644 --- a/quicksettings/wifi/contents/ui/main.qml +++ b/quicksettings/wifi/contents/ui/main.qml @@ -4,9 +4,9 @@ import QtQuick 2.15 import org.kde.plasma.networkmanagement 0.2 as PlasmaNM -import org.kde.plasma.private.mobileshell 1.0 as MobileShell +import org.kde.plasma.private.mobileshell.quicksettingsplugin as QS -MobileShell.QuickSetting { +QS.QuickSetting { PlasmaNM.Handler { id: nmHandler }