diff --git a/applets/CMakeLists.txt b/applets/CMakeLists.txt index 9c80f571..ca6d9d10 100644 --- a/applets/CMakeLists.txt +++ b/applets/CMakeLists.txt @@ -1,4 +1,5 @@ plasma_install_package(clock org.kde.phone.clock) plasma_install_package(notifications org.kde.phone.notifications) -plasma_install_package(quicksettings org.kde.phone.quicksettings) + +add_subdirectory(quicksettings) diff --git a/applets/quicksettings/CMakeLists.txt b/applets/quicksettings/CMakeLists.txt new file mode 100644 index 00000000..595a1f47 --- /dev/null +++ b/applets/quicksettings/CMakeLists.txt @@ -0,0 +1,19 @@ +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 ${PLUGIN_INSTALL_DIR}) +#install(FILES plasma-quicksettings-default.desktop DESTINATION ${SERVICES_INSTALL_DIR}) + +plasma_install_package(package org.kde.phone.quicksettings) + diff --git a/applets/quicksettings/contents/ui/Delegate.qml b/applets/quicksettings/package/contents/ui/Delegate.qml similarity index 89% rename from applets/quicksettings/contents/ui/Delegate.qml rename to applets/quicksettings/package/contents/ui/Delegate.qml index 1464bc5e..3e504b1e 100644 --- a/applets/quicksettings/contents/ui/Delegate.qml +++ b/applets/quicksettings/package/contents/ui/Delegate.qml @@ -61,7 +61,13 @@ RowLayout { MouseArea { id: labelMouseArea anchors.fill: parent - onClicked: print("execute active-settings -m " + model.settingsModule) + onClicked: { + var command = "active-settings"; + if (model.settingsModule) { + command += " -m " + model.settingsModule; + } + plasmoid.nativeInterface.executeCommand(command) + } } } } diff --git a/applets/quicksettings/contents/ui/main.qml b/applets/quicksettings/package/contents/ui/main.qml similarity index 100% rename from applets/quicksettings/contents/ui/main.qml rename to applets/quicksettings/package/contents/ui/main.qml diff --git a/applets/quicksettings/metadata.desktop b/applets/quicksettings/package/metadata.desktop similarity index 92% rename from applets/quicksettings/metadata.desktop rename to applets/quicksettings/package/metadata.desktop index a205c922..fb11f66a 100644 --- a/applets/quicksettings/metadata.desktop +++ b/applets/quicksettings/package/metadata.desktop @@ -11,6 +11,7 @@ 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 diff --git a/applets/quicksettings/quicksettings.cpp b/applets/quicksettings/quicksettings.cpp new file mode 100644 index 00000000..f82e0a61 --- /dev/null +++ b/applets/quicksettings/quicksettings.cpp @@ -0,0 +1,43 @@ +/*************************************************************************** + * 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 diff --git a/containments/panel/contents/ui/main.qml b/containments/panel/contents/ui/main.qml index fc1000c6..7b0b75ea 100644 --- a/containments/panel/contents/ui/main.qml +++ b/containments/panel/contents/ui/main.qml @@ -239,6 +239,7 @@ PlasmaCore.ColorScope { PlasmaComponents.TabBar { id: tabBar + visible: plasmoid.applets.count > 1 anchors { left: parent.left top: parent.top @@ -251,7 +252,7 @@ PlasmaCore.ColorScope { id: tabGroup anchors { left: parent.left - top: tabBar.bottom + top: plasmoid.applets.count > 1 ? tabBar.bottom : parent.top right: parent.right bottom: parent.bottom margins: units.smallSpacing