diff --git a/applets/CMakeLists.txt b/applets/CMakeLists.txt index 2656bbee8b0cf3e56f2b9f17c11414dbd9fd5ef6..a8d424e18eeb51231b33eeab3289a5cee60703d8 100644 --- a/applets/CMakeLists.txt +++ b/applets/CMakeLists.txt @@ -3,4 +3,3 @@ plasma_install_package(clock org.kde.phone.clock) plasma_install_package(notifications org.kde.phone.notifications) add_subdirectory(battery) -add_subdirectory(quicksettings) diff --git a/applets/quicksettings/CMakeLists.txt b/applets/quicksettings/CMakeLists.txt deleted file mode 100644 index bcd38f12f972a4197326c2e8222e6af730b889bc..0000000000000000000000000000000000000000 --- a/applets/quicksettings/CMakeLists.txt +++ /dev/null @@ -1,19 +0,0 @@ -set(quicksettings_SRCS - quicksettings.cpp -) - -add_library(plasma_applet_quicksettings MODULE ${quicksettings_SRCS}) - -kcoreaddons_desktop_to_json(plasma_applet_quicksettings package/metadata.desktop) - -target_link_libraries(plasma_applet_quicksettings - Qt5::Gui - KF5::Plasma - KF5::I18n) - - -install(TARGETS plasma_applet_quicksettings DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets) -#install(FILES plasma-quicksettings-default.desktop DESTINATION ${SERVICES_INSTALL_DIR}) - -plasma_install_package(package org.kde.phone.quicksettings) - diff --git a/applets/quicksettings/Messages.sh b/applets/quicksettings/Messages.sh deleted file mode 100755 index 83683e2152d24646b05b1cf8663b7fd88ec800c4..0000000000000000000000000000000000000000 --- a/applets/quicksettings/Messages.sh +++ /dev/null @@ -1,4 +0,0 @@ -#! /usr/bin/env bash -$EXTRACTRC `find . -name \*.rc -o -name \*.ui -o -name \*.kcfg` >> rc.cpp -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.phone.quicksettings.pot -rm -f rc.cpp diff --git a/applets/quicksettings/package/contents/ui/BrightnessDelegate.qml b/applets/quicksettings/package/contents/ui/BrightnessDelegate.qml deleted file mode 100644 index 0e592700420ced76984efaf21419f478ab71a7bc..0000000000000000000000000000000000000000 --- a/applets/quicksettings/package/contents/ui/BrightnessDelegate.qml +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.4 -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents - -Item { - id: delegateRoot - implicitWidth: delegate.implicitWidth - implicitHeight: delegate.implicitHeight + (slider.opacity > 0 ? slider.height : 0) - - property int screenBrightness - readonly property int maximumScreenBrightness: pmSource.data["PowerDevil"] ? pmSource.data["PowerDevil"]["Maximum Screen Brightness"] || 0 : 0 - - PlasmaCore.DataSource { - id: pmSource - engine: "powermanagement" - connectedSources: ["PowerDevil"] - - onDataChanged: { - delegateRoot.screenBrightness = source.data["PowerDevil"]["Screen Brightness"]; - } - } - - Delegate { - id: delegate - toggled: slider.opacity > 0 - function toggle() { - slider.opacity = slider.opacity > 0 ? 0 : 1; - } - } - PlasmaComponents.Slider { - id: slider - anchors.top: delegate.bottom - width: flow.width - opacity: 0 - x: -delegateRoot.parent.x - value: screenBrightness - minimumValue: maximumValue > 100 ? 1 : 0 - maximumValue: delegateRoot.maximumScreenBrightness - Behavior on opacity { - OpacityAnimator { - duration: units.shortDuration - easing.type: Easing.InOutQuad - } - } - } - - onScreenBrightnessChanged: { - var service = pmSource.serviceForSource("PowerDevil"); - var operation = service.operationDescription("setBrightness"); - operation.brightness = slider.value; - operation.silent = true - service.startOperationCall(operation); - } -} - diff --git a/applets/quicksettings/package/contents/ui/Delegate.qml b/applets/quicksettings/package/contents/ui/Delegate.qml deleted file mode 100644 index 5752de392ed3f41f24e70c34fae7e96ae2fb02db..0000000000000000000000000000000000000000 --- a/applets/quicksettings/package/contents/ui/Delegate.qml +++ /dev/null @@ -1,85 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.1 -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents - -RowLayout { - id: delegateRoot - property bool toggled: model.enabled - spacing: units.smallSpacing - implicitWidth: flow.width / 2 - units.largeSpacing / 2 - Rectangle { - Layout.minimumWidth: units.iconSizes.large - Layout.minimumHeight: width - color: toggled ? - Qt.rgba(PlasmaCore.ColorScope.highlightColor.r, PlasmaCore.ColorScope.highlightColor.g, PlasmaCore.ColorScope.highlightColor.b, iconMouseArea.pressed ? 0.5 : 0.3) : - Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, iconMouseArea.pressed ? 0.5 : 0.2) - - PlasmaCore.IconItem { - colorGroup: PlasmaCore.ColorScope.colorGroup - anchors { - fill: parent - margins: units.smallSpacing - } - source: model.icon - MouseArea { - id: iconMouseArea - anchors.fill: parent - onClicked: { - if (delegateRoot.toggle) { - delegateRoot.toggle(); - } else if (model.toggleFunction) { - root[model.toggleFunction](); - } else if (model.settingsCommand) { - plasmoid.nativeInterface.executeCommand(model.settingsCommand); - } - } - } - } - } - Rectangle { - Layout.fillWidth: true - Layout.fillHeight: true - color: Qt.rgba(PlasmaCore.ColorScope.textColor.r, PlasmaCore.ColorScope.textColor.g, PlasmaCore.ColorScope.textColor.b, labelMouseArea.pressed ? 0.5 : 0.2) - PlasmaComponents.Label { - anchors { - fill: parent - margins: units.smallSpacing - } - text: model.text - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - MouseArea { - id: labelMouseArea - anchors.fill: parent - onClicked: { - if (model.settingsCommand) { - plasmoid.nativeInterface.executeCommand(model.settingsCommand); - } else if (model.toggleFunction) { - root[model.toggleFunction](); - } - } - } - } - } -} - diff --git a/applets/quicksettings/package/contents/ui/main.qml b/applets/quicksettings/package/contents/ui/main.qml deleted file mode 100644 index d7cd163a54b3ed0de83cb41eac937f3b64192df4..0000000000000000000000000000000000000000 --- a/applets/quicksettings/package/contents/ui/main.qml +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright 2015 Marco Martin - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Library General Public License as - * published by the Free Software Foundation; either version 2, 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 - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Library General Public License for more details - * - * You should have received a copy of the GNU Library General Public - * License along with this program; if not, write to the - * Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. - */ - -import QtQuick 2.1 -import QtQuick.Layouts 1.1 -import org.kde.plasma.core 2.0 as PlasmaCore -import org.kde.plasma.components 2.0 as PlasmaComponents -import org.kde.plasma.plasmoid 2.0 - - -Item { - id: root - - function toggleAirplane() { - print("toggle airplane mode") - } - - Plasmoid.preferredRepresentation: plasmoid.fullRepresentation - - Layout.minimumHeight: flow.implicitHeight + units.largeSpacing*2 - - ListModel { - id: settingsModel - - ListElement { - text: "Settings" - icon: "configure" - enabled: false - settingsCommand: "active-settings" - toggleFunction: "" - delegate: "" - } - ListElement { - text: "Mobile network" - icon: "network-mobile-80" - enabled: true - settingsCommand: "" - } - ListElement { - text: "Airplane mode" - icon: "flightmode-on" - enabled: false - settingsCommand: "" - toggleFunction: "toggleAirplane" - } - ListElement { - text: "Bluetooth" - icon: "preferences-system-bluetooth" - enabled: false - settingsCommand: "" - } - ListElement { - text: "Wireless" - icon: "network-wireless-on" - enabled: true - settingsCommand: "active-settings -m org.kde.plasma.phone.settings.wifi" - } - ListElement { - text: "Alarms" - icon: "korgac" - enabled: false - settingsCommand: "" - } - ListElement { - text: "Notifications" - icon: "preferences-desktop-notification" - enabled: true - settingsCommand: "" - } - ListElement { - text: "Brightness" - icon: "video-display-brightness" - enabled: false - settingsCommand: "active-settings -m org.kde.active.settings.powermanagement" - delegate: "BrightnessDelegate" - } - ListElement { - text: "Flashlight" - icon: "package_games_puzzle" - enabled: false - settingsCommand: "" - } - ListElement { - text: "Location" - icon: "plasmaapplet-location" - enabled: false - settingsCommand: "" - } - } - - Flow { - id: flow - anchors { - fill: parent - margins: units.largeSpacing - } - spacing: units.largeSpacing - Repeater { - model: settingsModel - delegate: Loader { - width: item ? item.implicitWidth : 0 - height: item ? item.implicitHeight : 0 - source: Qt.resolvedUrl((model.delegate ? model.delegate : "Delegate") + ".qml") - } - } - move: Transition { - NumberAnimation { - duration: units.shortDuration - easing.type: Easing.InOutQuad - properties: "x,y" - } - } - } -} diff --git a/applets/quicksettings/package/metadata.desktop b/applets/quicksettings/package/metadata.desktop deleted file mode 100644 index fb11f66a3a35332f599c1f448c0925ac5042fc4a..0000000000000000000000000000000000000000 --- a/applets/quicksettings/package/metadata.desktop +++ /dev/null @@ -1,22 +0,0 @@ -[Desktop Entry] -Encoding=UTF-8 -Name=Quick Settings - -Comment=A panel to quickly access most important settings - -Icon=systemsettings -Type=Service -X-KDE-ParentApp= -X-KDE-PluginInfo-Author=Marco Martin -X-KDE-PluginInfo-Email=mart@kde.org -X-KDE-PluginInfo-License=GPL -X-KDE-PluginInfo-Name=org.kde.phone.quicksettings -X-KDE-Library=plasma_applet_quicksettings -X-KDE-PluginInfo-Version=1.0 -X-KDE-PluginInfo-Website=plasma.kde.org -X-KDE-ServiceTypes=Plasma/Applet -X-Plasma-API=declarativeappletscript -X-KDE-PluginInfo-Category=Settings - -X-Plasma-MainScript=ui/main.qml -X-Plasma-RemoteLocation= diff --git a/applets/quicksettings/quicksettings.cpp b/applets/quicksettings/quicksettings.cpp deleted file mode 100644 index f82e0a61cbdc3cf5c46b48413857af350a4daaa5..0000000000000000000000000000000000000000 --- a/applets/quicksettings/quicksettings.cpp +++ /dev/null @@ -1,43 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2015 Marco Martin * - * * - * 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 * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * 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, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#include "quicksettings.h" - -#include -#include - -QuickSettings::QuickSettings(QObject *parent, const QVariantList &args) - : Plasma::Applet(parent, args) -{ - setHasConfigurationInterface(true); -} - -QuickSettings::~QuickSettings() -{ -} - -void QuickSettings::executeCommand(const QString &command) -{ - qWarning()<<"Executing"< * - * - * * - * 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 * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * 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, write to the * - * Free Software Foundation, Inc., * - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * - ***************************************************************************/ - -#ifndef QUICKSETTINGS_H -#define QUICKSETTINGS_H - - -#include - - -class QuickSettings : public Plasma::Applet -{ - Q_OBJECT - -public: - QuickSettings( QObject *parent, const QVariantList &args ); - ~QuickSettings(); - -public Q_SLOTS: - void executeCommand(const QString &command); - -private: - -}; - -#endif