mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 00:34:45 +00:00
panel & taskpanel: Port to use plasma_add_applet
Use plasma_add_applet to deploy the applets as a module: https://invent.kde.org/plasma/libplasma/-/merge_requests/1116 We eventually need to do this for Halcyon and Folio homescreens too, but they also have a bunch of C++ classes to be ported to declarative type registration.
This commit is contained in:
parent
1d3ceb5801
commit
5e3fa11be7
9 changed files with 19 additions and 28 deletions
|
|
@ -3,22 +3,17 @@
|
||||||
# SPDX-FileCopyrightText: 2020-2021 Nicolas Fella <nicolas.fella@kde.org>
|
# SPDX-FileCopyrightText: 2020-2021 Nicolas Fella <nicolas.fella@kde.org>
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
set(phonepanel_SRCS
|
plasma_add_applet(org.kde.plasma.mobile.panel
|
||||||
|
QML_SOURCES
|
||||||
|
qml/main.qml
|
||||||
|
CPP_SOURCES
|
||||||
phonepanel.cpp
|
phonepanel.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_library(org.kde.plasma.mobile.panel MODULE ${phonepanel_SRCS})
|
target_link_libraries(org.kde.plasma.mobile.panel PRIVATE
|
||||||
|
|
||||||
target_link_libraries(org.kde.plasma.mobile.panel
|
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
Plasma::Plasma
|
Plasma::Plasma
|
||||||
KF6::I18n
|
KF6::I18n
|
||||||
KF6::Service
|
KF6::Service
|
||||||
)
|
)
|
||||||
|
|
||||||
install(TARGETS org.kde.plasma.mobile.panel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
|
||||||
#install(FILES plasma-phonepanel-default.desktop DESTINATION ${KDE_INSTALL_KSERVICES5DIR})
|
|
||||||
|
|
||||||
plasma_install_package(package org.kde.plasma.mobile.panel)
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"KPackageStructure": "Plasma/Applet",
|
|
||||||
"KPlugin": {
|
"KPlugin": {
|
||||||
"Authors": [
|
"Authors": [
|
||||||
{
|
{
|
||||||
|
|
@ -83,7 +82,6 @@
|
||||||
"Description[x-test]": "xxTop panel for Plasma Mobilexx",
|
"Description[x-test]": "xxTop panel for Plasma Mobilexx",
|
||||||
"Description[zh_CN]": "Plasma Mobile 的顶部面板",
|
"Description[zh_CN]": "Plasma Mobile 的顶部面板",
|
||||||
"Description[zh_TW]": "Plasma 行動的頂部面板",
|
"Description[zh_TW]": "Plasma 行動的頂部面板",
|
||||||
"Id": "org.kde.plasma.mobile.panel",
|
|
||||||
"License": "GPLv2+",
|
"License": "GPLv2+",
|
||||||
"Name": "Phone Panel",
|
"Name": "Phone Panel",
|
||||||
"Name[ar]": "لوحة الهاتف",
|
"Name[ar]": "لوحة الهاتف",
|
||||||
|
|
@ -7,6 +7,8 @@
|
||||||
|
|
||||||
#include "phonepanel.h"
|
#include "phonepanel.h"
|
||||||
|
|
||||||
|
K_PLUGIN_CLASS_WITH_JSON(PhonePanel, "metadata.json")
|
||||||
|
|
||||||
PhonePanel::PhonePanel(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
|
PhonePanel::PhonePanel(QObject *parent, const KPluginMetaData &data, const QVariantList &args)
|
||||||
: Plasma::Containment(parent, data, args)
|
: Plasma::Containment(parent, data, args)
|
||||||
{
|
{
|
||||||
|
|
@ -14,6 +16,4 @@ PhonePanel::PhonePanel(QObject *parent, const KPluginMetaData &data, const QVari
|
||||||
|
|
||||||
PhonePanel::~PhonePanel() = default;
|
PhonePanel::~PhonePanel() = default;
|
||||||
|
|
||||||
K_PLUGIN_CLASS(PhonePanel)
|
|
||||||
|
|
||||||
#include "phonepanel.moc"
|
#include "phonepanel.moc"
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,15 @@
|
||||||
# SPDX-FileCopyrightText: 2021 Nicolas Fella <nicolas.fella@kde.org>
|
# SPDX-FileCopyrightText: 2021 Nicolas Fella <nicolas.fella@kde.org>
|
||||||
# SPDX-License-Identifier: GPL-2.0-or-later
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
|
||||||
add_library(org.kde.plasma.mobile.taskpanel MODULE taskpanel.cpp ${DBUS_SRCS})
|
plasma_add_applet(org.kde.plasma.mobile.taskpanel
|
||||||
|
QML_SOURCES
|
||||||
|
qml/main.qml
|
||||||
|
qml/NavigationPanelComponent.qml
|
||||||
|
CPP_SOURCES
|
||||||
|
taskpanel.cpp
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(org.kde.plasma.mobile.taskpanel
|
target_link_libraries(org.kde.plasma.mobile.taskpanel PRIVATE
|
||||||
Qt::Gui
|
Qt::Gui
|
||||||
Qt::DBus
|
Qt::DBus
|
||||||
Qt::Qml
|
Qt::Qml
|
||||||
|
|
@ -14,9 +20,3 @@ target_link_libraries(org.kde.plasma.mobile.taskpanel
|
||||||
Plasma::Plasma
|
Plasma::Plasma
|
||||||
KF6::Screen
|
KF6::Screen
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
install(TARGETS org.kde.plasma.mobile.taskpanel DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets)
|
|
||||||
|
|
||||||
plasma_install_package(package org.kde.plasma.mobile.taskpanel)
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"KPackageStructure": "Plasma/Applet",
|
|
||||||
"KPlugin": {
|
"KPlugin": {
|
||||||
"Authors": [
|
"Authors": [
|
||||||
{
|
{
|
||||||
|
|
@ -83,7 +82,6 @@
|
||||||
"Description[x-test]": "xxNavigation panel for Plasma Mobilexx",
|
"Description[x-test]": "xxNavigation panel for Plasma Mobilexx",
|
||||||
"Description[zh_CN]": "Plasma 移动版导航面板",
|
"Description[zh_CN]": "Plasma 移动版导航面板",
|
||||||
"Description[zh_TW]": "Plasma 行動的導覽面板",
|
"Description[zh_TW]": "Plasma 行動的導覽面板",
|
||||||
"Id": "org.kde.plasma.mobile.taskpanel",
|
|
||||||
"License": "GPLv2+",
|
"License": "GPLv2+",
|
||||||
"Name": "Phone Task panel",
|
"Name": "Phone Task panel",
|
||||||
"Name[ar]": "لوحة مهمة الهاتف",
|
"Name[ar]": "لوحة مهمة الهاتف",
|
||||||
|
|
@ -11,6 +11,8 @@
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QGuiApplication>
|
#include <QGuiApplication>
|
||||||
|
|
||||||
|
K_PLUGIN_CLASS_WITH_JSON(TaskPanel, "metadata.json")
|
||||||
|
|
||||||
// register type for Keyboards.KWinVirtualKeyboard.forceActivate();
|
// register type for Keyboards.KWinVirtualKeyboard.forceActivate();
|
||||||
Q_DECLARE_METATYPE(QDBusPendingReply<>)
|
Q_DECLARE_METATYPE(QDBusPendingReply<>)
|
||||||
|
|
||||||
|
|
@ -29,6 +31,4 @@ void TaskPanel::triggerTaskSwitcher() const
|
||||||
QDBusConnection::sessionBus().send(message);
|
QDBusConnection::sessionBus().send(message);
|
||||||
}
|
}
|
||||||
|
|
||||||
K_PLUGIN_CLASS(TaskPanel)
|
|
||||||
|
|
||||||
#include "taskpanel.moc"
|
#include "taskpanel.moc"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue