diff --git a/templates/cpp-plasmoid/CMakeLists.txt b/templates/cpp-plasmoid/CMakeLists.txt index c6881d4e4..f63e36333 100644 --- a/templates/cpp-plasmoid/CMakeLists.txt +++ b/templates/cpp-plasmoid/CMakeLists.txt @@ -1,27 +1,25 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) find_package(ECM 1.4.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) -include(ECMInstallIcons) -include(ECMMarkAsTest) -include(ECMMarkNonGuiExecutable) include(FeatureSummary) -include(CheckIncludeFiles) find_package(KF5 REQUIRED COMPONENTS Plasma I18n ) -find_package(Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS +find_package(Qt5 CONFIG REQUIRED COMPONENTS Quick Core ) add_subdirectory(src) + +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/templates/cpp-plasmoid/Messages.sh b/templates/cpp-plasmoid/Messages.sh index 2f6056b84..8bfc20562 100644 --- a/templates/cpp-plasmoid/Messages.sh +++ b/templates/cpp-plasmoid/Messages.sh @@ -1,3 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.qml` -o $podir/plasma_applet_%{APPNAMELC}.pot -$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_%{APPNAMELC}.pot +$XGETTEXT `find . -name \*.js -o -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.%{APPNAMELC}.pot diff --git a/templates/cpp-plasmoid/README b/templates/cpp-plasmoid/README index 2985196f9..05724a598 100644 --- a/templates/cpp-plasmoid/README +++ b/templates/cpp-plasmoid/README @@ -1,29 +1,46 @@ Plasma Applet mixed C++/QML Template ---------------------- +-- Namespace adaption -- + +Each Plasma plugin has a unique identifier, which is also used to find related +resources (like the translation catalogs). +To avoid naming collisions, Plasma plugins use a reverse domain name notation +for that identifier: + +* org.kde.plasma.* - plugins coming from Plasma modules +* org.kde.* - plugins coming from other software from KDE +* $(my.domain).* - plugins of your 3rd-party + +The generated code uses the "org.kde.plasma" namespace for the plugin identifier. +As this namespace is reserved for use by plugins part of Plasma modules, you will +need to adapt this namespace if you are writing a plugin which is not intended to +end up in the Plasma modules. + + -- Build instructions -- cd /where/your/applet/is/generated mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. make make install (MYPREFIX is where you install your Plasma setup, replace it accordingly) Restart plasma to load the applet (in a terminal type: kquitapp plasmashell and then plasmashell) or view it with plasmoidviewer -a YourAppletName -- Tutorials and resources -- The explanation of the template https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted Plasma QML API explained https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API diff --git a/templates/cpp-plasmoid/src/CMakeLists.txt b/templates/cpp-plasmoid/src/CMakeLists.txt index 36ab39dd6..548e77732 100644 --- a/templates/cpp-plasmoid/src/CMakeLists.txt +++ b/templates/cpp-plasmoid/src/CMakeLists.txt @@ -1,19 +1,20 @@ -add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.%{APPNAMELC}\") +# TODO: adapt "org.kde.plasma" here & elsewhere if needed (see README) +add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.%{APPNAMELC}\") set(%{APPNAMELC}_SRCS %{APPNAMELC}.cpp ) add_library(plasma_applet_%{APPNAMELC} MODULE ${%{APPNAMELC}_SRCS}) kcoreaddons_desktop_to_json(plasma_applet_%{APPNAMELC} package/metadata.desktop SERVICE_TYPES plasma-applet.desktop) target_link_libraries(plasma_applet_%{APPNAMELC} Qt5::Gui KF5::Plasma KF5::I18n) install(TARGETS plasma_applet_%{APPNAMELC} DESTINATION ${KDE_INSTALL_PLUGINDIR}/plasma/applets) -plasma_install_package(package org.kde.%{APPNAMELC}) +plasma_install_package(package org.kde.plasma.%{APPNAMELC}) diff --git a/templates/cpp-plasmoid/src/package/metadata.desktop b/templates/cpp-plasmoid/src/package/metadata.desktop index 2e4dab9e1..852b16786 100644 --- a/templates/cpp-plasmoid/src/package/metadata.desktop +++ b/templates/cpp-plasmoid/src/package/metadata.desktop @@ -1,99 +1,98 @@ [Desktop Entry] Name=%{APPNAME} Name[ar]=%{APPNAME} Name[ast]=%{APPNAME} Name[ca]=%{APPNAME} Name[ca@valencia]=%{APPNAME} Name[cs]=%{APPNAME} Name[da]=%{APPNAME} Name[de]=%{APPNAME} Name[en_GB]=%{APPNAME} Name[es]=%{APPNAME} Name[et]=%{APPNAME} Name[eu]=%{APPNAME} Name[fi]=%{APPNAME} Name[fr]=%{APPNAME} Name[gd]=%{APPNAME} Name[gl]=%{APPNAME} Name[ia]=%{APPNAME} Name[id]=%{APPNAME} Name[it]=%{APPNAME} Name[ko]=%{APPNAME} Name[nb]=%{APPNAME} Name[nl]=%{APPNAME} Name[nn]=%{APPNAME} Name[pl]=%{APPNAME} Name[pt]=%{APPNAME} Name[pt_BR]=%{APPNAME} Name[ru]=%{APPNAME} Name[sk]=%{APPNAME} Name[sl]=%{APPNAME} Name[sr]=%{APPNAME} Name[sr@ijekavian]=%{APPNAME} Name[sr@ijekavianlatin]=%{APPNAME} Name[sr@latin]=%{APPNAME} Name[sv]=%{APPNAME} Name[tr]=%{APPNAME} Name[uk]=%{APPNAME} Name[x-test]=xx%{APPNAME}xx Name[zh_CN]=%{APPNAME} Name[zh_TW]=%{APPNAME} Comment=what your app does in a few words Comment[ar]=ما يفعله تطبيقك ببضع كلمات Comment[ast]=lo que fai la to aplicación nunes pallabres Comment[ca]=Què fa aquesta aplicació en poques paraules Comment[ca@valencia]=Què fa aquesta aplicació en poques paraules Comment[da]=nogle få ord om hvad din app gør Comment[de]=In ein paar Worten, was Ihre Anwendung tut Comment[en_GB]=what your app does in a few words Comment[es]=lo que hace su aplicación, en pocas palabras Comment[et]=Mõne sõnaga, mida rakendus teeb Comment[eu]=zure aplikazioak egiten duena hitz gutxitan Comment[fi]=ohjelmasi toiminta muutamalla sanalla Comment[fr]=que fait votre application en quelques mots Comment[gd]=na nì an aplacaid agad ann am beagan fhaclan Comment[gl]=o que fai o seu aplicativo en poucas palabras Comment[ia]=cosa tu app face in pauc parolas Comment[id]=app apa yang kamu lakukan dalam beberapa kata Comment[it]=Cosa fa la tua applicazione in poche parole Comment[ko]=프로그램이 하는 일에 대한 간단한 설명 Comment[nb]=hva programmet gjør, med noen få ord Comment[nl]=wat uw app doet in een paar woorden Comment[nn]=nokre få ord om kva programmet gjer Comment[pl]=w kilku słowach opis co robi twój program Comment[pt]=o que faz a sua aplicação, em poucas palavras Comment[pt_BR]=breve descrição do que o seu aplicativo faz Comment[ru]=Несколько слов о том, что делает ваша программа Comment[sk]=čo vaša aplikácia robí v niekoľkých slovách Comment[sl]=kaj vaš program dela, v nekaj besedah Comment[sr]=Укратко о томе шта ваш програм ради Comment[sr@ijekavian]=Укратко о томе шта ваш програм ради Comment[sr@ijekavianlatin]=Ukratko o tome šta vaš program radi Comment[sr@latin]=Ukratko o tome šta vaš program radi Comment[sv]=vad programmet gör med några få ord Comment[tr]=uygulamanızın yaptığı şey, birkaç sözcükte Comment[uk]=призначення вашої програми у декількох словах Comment[x-test]=xxwhat your app does in a few wordsxx Comment[zh_CN]=简单几个词概括您的小程序的功能 Comment[zh_TW]=以數個字描述您的應用程式的用途 Icon=applications-system Type=Service X-KDE-ServiceTypes=Plasma/Applet X-KDE-Library=plasma_applet_%{APPNAMELC} X-KDE-PluginInfo-Author=%{AUTHOR} X-KDE-PluginInfo-Email=%{EMAIL} -X-KDE-PluginInfo-Name=%{APPNAMELC} +X-KDE-PluginInfo-Name=org.kde.plasma.%{APPNAMELC} X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-Category=Utilities X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Name=org.kde.%{APPNAMELC} X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml diff --git a/templates/plasma-wallpaper-with-qml-extension/CMakeLists.txt b/templates/plasma-wallpaper-with-qml-extension/CMakeLists.txt index 52940e531..3830662a8 100644 --- a/templates/plasma-wallpaper-with-qml-extension/CMakeLists.txt +++ b/templates/plasma-wallpaper-with-qml-extension/CMakeLists.txt @@ -1,30 +1,31 @@ cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) find_package(ECM 1.4.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) include(FeatureSummary) find_package(KF5 REQUIRED COMPONENTS Plasma I18n ) find_package(Qt5 CONFIG REQUIRED COMPONENTS Qml Gui Core ) # wallpaper applet +# TODO: adapt "org.kde.plasma" here & elsewhere if needed (see README) plasma_install_package(package org.kde.plasma.%{APPNAMELC} wallpapers wallpaper) # qml extension plugin add_subdirectory(plugin) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/templates/plasma-wallpaper-with-qml-extension/README b/templates/plasma-wallpaper-with-qml-extension/README index e6c4ed0cd..a130ef27c 100644 --- a/templates/plasma-wallpaper-with-qml-extension/README +++ b/templates/plasma-wallpaper-with-qml-extension/README @@ -1,24 +1,41 @@ Plasma Wallpaper Template ---------------------- +-- Namespace adaption -- + +Each Plasma plugin has a unique identifier, which is also used to find related +resources (like the translation catalogs). +To avoid naming collisions, Plasma plugins use a reverse domain name notation +for that identifier: + +* org.kde.plasma.* - plugins coming from Plasma modules +* org.kde.* - plugins coming from other software from KDE +* $(my.domain).* - plugins of your 3rd-party + +The generated code uses the "org.kde.plasma" namespace for the plugin identifier. +As this namespace is reserved for use by plugins part of Plasma modules, you will +need to adapt this namespace if you are writing a plugin which is not intended to +end up in the Plasma modules. + + -- Build instructions -- cd /where/your/wallpaper/is/generated mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. make make install (MYPREFIX is where you install your Plasma setup, replace it accordingly) Restart plasma to load the wallpaper (in a terminal or in krunner type: kquitapp plasmashell and then plasmashell) then go to wallpaper settings and select it -- Tutorials and resources -- Plasma QML API explained https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API diff --git a/templates/plasma-wallpaper/CMakeLists.txt b/templates/plasma-wallpaper/CMakeLists.txt index ff772e51e..1b9957dfc 100644 --- a/templates/plasma-wallpaper/CMakeLists.txt +++ b/templates/plasma-wallpaper/CMakeLists.txt @@ -1,10 +1,11 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) find_package(ECM 1.4.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) find_package(KF5Plasma REQUIRED) +# TODO: adapt "org.kde.plasma" here & elsewhere if needed (see README) plasma_install_package(package org.kde.plasma.%{APPNAMELC} wallpapers wallpaper) diff --git a/templates/plasma-wallpaper/README b/templates/plasma-wallpaper/README index e6c4ed0cd..a130ef27c 100644 --- a/templates/plasma-wallpaper/README +++ b/templates/plasma-wallpaper/README @@ -1,24 +1,41 @@ Plasma Wallpaper Template ---------------------- +-- Namespace adaption -- + +Each Plasma plugin has a unique identifier, which is also used to find related +resources (like the translation catalogs). +To avoid naming collisions, Plasma plugins use a reverse domain name notation +for that identifier: + +* org.kde.plasma.* - plugins coming from Plasma modules +* org.kde.* - plugins coming from other software from KDE +* $(my.domain).* - plugins of your 3rd-party + +The generated code uses the "org.kde.plasma" namespace for the plugin identifier. +As this namespace is reserved for use by plugins part of Plasma modules, you will +need to adapt this namespace if you are writing a plugin which is not intended to +end up in the Plasma modules. + + -- Build instructions -- cd /where/your/wallpaper/is/generated mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. make make install (MYPREFIX is where you install your Plasma setup, replace it accordingly) Restart plasma to load the wallpaper (in a terminal or in krunner type: kquitapp plasmashell and then plasmashell) then go to wallpaper settings and select it -- Tutorials and resources -- Plasma QML API explained https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API diff --git a/templates/plasma-wallpaper/package/contents/ui/main.qml b/templates/plasma-wallpaper/package/contents/ui/main.qml index 30d9743ae..ae12574aa 100644 --- a/templates/plasma-wallpaper/package/contents/ui/main.qml +++ b/templates/plasma-wallpaper/package/contents/ui/main.qml @@ -1,39 +1,38 @@ /* * Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> * * 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 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 org.kde.plasma.core 2.0 import org.kde.plasma.extras 2.0 as PlasmaExtras Item { id: root Rectangle { anchors.fill: parent color: Theme.backgroundColor } PlasmaExtras.Title { anchors.centerIn: parent - // use i18nd in wallpaper QML, as the default textdomain is not setup at least in Plasma 5.7 text: wallpaper.configuration.DisplayText || - i18nd("plasma_wallpaper_org.kde.plasma.%{APPNAMELC}", "") + i18n("") } } diff --git a/templates/qml-plasmoid-with-qml-extension/CMakeLists.txt b/templates/qml-plasmoid-with-qml-extension/CMakeLists.txt index 3969d9b7c..ba0ff4aa9 100644 --- a/templates/qml-plasmoid-with-qml-extension/CMakeLists.txt +++ b/templates/qml-plasmoid-with-qml-extension/CMakeLists.txt @@ -1,27 +1,31 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) find_package(ECM 1.4.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) +include(FeatureSummary) find_package(KF5 REQUIRED COMPONENTS Plasma I18n ) find_package(Qt5 CONFIG REQUIRED COMPONENTS Qml Gui Core ) # plasmoid -plasma_install_package(package org.kde.%{APPNAMELC}) +# TODO: adapt "org.kde.plasma" here & elsewhere if needed (see README) +plasma_install_package(package org.kde.plasma.%{APPNAMELC}) # qml extension plugin add_subdirectory(plugin) + +feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/templates/qml-plasmoid-with-qml-extension/Messages.sh b/templates/qml-plasmoid-with-qml-extension/Messages.sh index b8af9a77e..a8a1548aa 100644 --- a/templates/qml-plasmoid-with-qml-extension/Messages.sh +++ b/templates/qml-plasmoid-with-qml-extension/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.qml` -o $podir/plasma_applet_%{APPNAMELC}.pot \ No newline at end of file +$XGETTEXT `find . -name \*.qml -o -name \*.cpp` -o $podir/plasma_applet_org.kde.plasma.%{APPNAMELC}.pot diff --git a/templates/qml-plasmoid-with-qml-extension/README b/templates/qml-plasmoid-with-qml-extension/README index 727fa943b..8d1e5d72d 100644 --- a/templates/qml-plasmoid-with-qml-extension/README +++ b/templates/qml-plasmoid-with-qml-extension/README @@ -1,29 +1,46 @@ Plasma Applet Template ---------------------- +-- Namespace adaption -- + +Each Plasma plugin has a unique identifier, which is also used to find related +resources (like the translation catalogs). +To avoid naming collisions, Plasma plugins use a reverse domain name notation +for that identifier: + +* org.kde.plasma.* - plugins coming from Plasma modules +* org.kde.* - plugins coming from other software from KDE +* $(my.domain).* - plugins of your 3rd-party + +The generated code uses the "org.kde.plasma" namespace for the plugin identifier. +As this namespace is reserved for use by plugins part of Plasma modules, you will +need to adapt this namespace if you are writing a plugin which is not intended to +end up in the Plasma modules. + + -- Build instructions -- cd /where/your/applet/is/generated mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. make make install (MYPREFIX is where you install your Plasma setup, replace it accordingly) Restart plasma to load the applet (in a terminal type: kquitapp plasmashell and then plasmashell) or view it with plasmoidviewer -a YourAppletName -- Tutorials and resources -- The explanation of the QML part of the template https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted Plasma QML API explained https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API diff --git a/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop b/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop index 314696d92..925dd84a6 100644 --- a/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop +++ b/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop @@ -1,96 +1,95 @@ [Desktop Entry] Name=%{APPNAME} Name[ar]=%{APPNAME} Name[ast]=%{APPNAME} Name[ca]=%{APPNAME} Name[ca@valencia]=%{APPNAME} Name[cs]=%{APPNAME} Name[da]=%{APPNAME} Name[de]=%{APPNAME} Name[en_GB]=%{APPNAME} Name[es]=%{APPNAME} Name[et]=%{APPNAME} Name[eu]=%{APPNAME} Name[fi]=%{APPNAME} Name[fr]=%{APPNAME} Name[gd]=%{APPNAME} Name[gl]=%{APPNAME} Name[ia]=%{APPNAME} Name[id]=%{APPNAME} Name[it]=%{APPNAME} Name[ko]=%{APPNAME} Name[nb]=%{APPNAME} Name[nl]=%{APPNAME} Name[nn]=%{APPNAME} Name[pl]=%{APPNAME} Name[pt]=%{APPNAME} Name[pt_BR]=%{APPNAME} Name[ru]=%{APPNAME} Name[sk]=%{APPNAME} Name[sl]=%{APPNAME} Name[sr]=%{APPNAME} Name[sr@ijekavian]=%{APPNAME} Name[sr@ijekavianlatin]=%{APPNAME} Name[sr@latin]=%{APPNAME} Name[sv]=%{APPNAME} Name[tr]=%{APPNAME} Name[uk]=%{APPNAME} Name[x-test]=xx%{APPNAME}xx Name[zh_CN]=%{APPNAME} Name[zh_TW]=%{APPNAME} Comment=what your app does in a few words Comment[ar]=ما يفعله تطبيقك ببضع كلمات Comment[ast]=lo que fai la to aplicación nunes pallabres Comment[ca]=Què fa aquesta aplicació en poques paraules Comment[ca@valencia]=Què fa aquesta aplicació en poques paraules Comment[da]=nogle få ord om hvad din app gør Comment[de]=In ein paar Worten, was Ihre Anwendung tut Comment[en_GB]=what your app does in a few words Comment[es]=lo que hace su aplicación, en pocas palabras Comment[et]=Mõne sõnaga, mida rakendus teeb Comment[eu]=zure aplikazioak egiten duena hitz gutxitan Comment[fi]=ohjelmasi toiminta muutamalla sanalla Comment[fr]=que fait votre application en quelques mots Comment[gd]=na nì an aplacaid agad ann am beagan fhaclan Comment[gl]=o que fai o seu aplicativo en poucas palabras Comment[ia]=cosa tu app face in pauc parolas Comment[id]=app apa yang kamu lakukan dalam beberapa kata Comment[it]=Cosa fa la tua applicazione in poche parole Comment[ko]=프로그램이 하는 일에 대한 간단한 설명 Comment[nb]=hva programmet gjør, med noen få ord Comment[nl]=wat uw app doet in een paar woorden Comment[nn]=nokre få ord om kva programmet gjer Comment[pl]=w kilku słowach opis co robi twój program Comment[pt]=o que faz a sua aplicação, em poucas palavras Comment[pt_BR]=breve descrição do que o seu aplicativo faz Comment[ru]=Несколько слов о том, что делает ваша программа Comment[sk]=čo vaša aplikácia robí v niekoľkých slovách Comment[sl]=kaj vaš program dela, v nekaj besedah Comment[sr]=Укратко о томе шта ваш програм ради Comment[sr@ijekavian]=Укратко о томе шта ваш програм ради Comment[sr@ijekavianlatin]=Ukratko o tome šta vaš program radi Comment[sr@latin]=Ukratko o tome šta vaš program radi Comment[sv]=vad programmet gör med några få ord Comment[tr]=uygulamanızın yaptığı şey, birkaç sözcükte Comment[uk]=призначення вашої програми у декількох словах Comment[x-test]=xxwhat your app does in a few wordsxx Comment[zh_CN]=简单几个词概括您的小程序的功能 Comment[zh_TW]=以數個字描述您的應用程式的用途 Icon=applications-system Type=Service X-KDE-ServiceTypes=Plasma/Applet X-KDE-PluginInfo-Author=%{AUTHOR} X-KDE-PluginInfo-Email=%{EMAIL} -X-KDE-PluginInfo-Name=%{APPNAMELC} +X-KDE-PluginInfo-Name=org.kde.plasma.%{APPNAMELC} X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-Category=Utilities X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Name=org.kde.%{APPNAMELC} X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml diff --git a/templates/qml-plasmoid-with-qml-extension/plugin/%{APPNAMELC}plugin.cpp b/templates/qml-plasmoid-with-qml-extension/plugin/%{APPNAMELC}plugin.cpp index dfd85ae4a..b60e768b2 100644 --- a/templates/qml-plasmoid-with-qml-extension/plugin/%{APPNAMELC}plugin.cpp +++ b/templates/qml-plasmoid-with-qml-extension/plugin/%{APPNAMELC}plugin.cpp @@ -1,40 +1,43 @@ /* * Copyright (C) %{CURRENT_YEAR} by %{AUTHOR} <%{EMAIL}> * 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 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. */ #include "%{APPNAMELC}plugin.h" +// KF +#include +// Qt #include #include #include static QJSValue singletonTypeExampleProvider(QQmlEngine* engine, QJSEngine* scriptEngine) { Q_UNUSED(engine) QJSValue helloWorld = scriptEngine->newObject(); - helloWorld.setProperty("text", QStringLiteral("Hello world!")); + helloWorld.setProperty("text", i18n("Hello world!")); return helloWorld; } void %{APPNAME}Plugin::registerTypes(const char* uri) { Q_ASSERT(uri == QLatin1String("org.kde.plasma.private.%{APPNAMELC}")); qmlRegisterSingletonType(uri, 1, 0, "HelloWorld", singletonTypeExampleProvider); } diff --git a/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt b/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt index ac2e237c1..46cdf13ab 100644 --- a/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt +++ b/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt @@ -1,12 +1,15 @@ +add_definitions(-DTRANSLATION_DOMAIN=\"plasma_applet_org.kde.plasma.%{APPNAMELC}\") + set(%{APPNAMELC}plugin_SRCS %{APPNAMELC}plugin.cpp ) add_library(%{APPNAMELC}plugin SHARED ${%{APPNAMELC}plugin_SRCS}) target_link_libraries(%{APPNAMELC}plugin + KF5::I18n Qt5::Gui Qt5::Qml ) install(TARGETS %{APPNAMELC}plugin DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/%{APPNAMELC}) install(FILES qmldir DESTINATION ${KDE_INSTALL_QMLDIR}/org/kde/plasma/private/%{APPNAMELC}) diff --git a/templates/qml-plasmoid/CMakeLists.txt b/templates/qml-plasmoid/CMakeLists.txt index d9cbb7fe5..31b6f6456 100644 --- a/templates/qml-plasmoid/CMakeLists.txt +++ b/templates/qml-plasmoid/CMakeLists.txt @@ -1,10 +1,11 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) find_package(ECM 1.4.0 REQUIRED NO_MODULE) set(CMAKE_MODULE_PATH ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR}) find_package(KF5Plasma REQUIRED) -plasma_install_package(package org.kde.%{APPNAMELC}) +# TODO: adapt "org.kde.plasma" here & elsewhere if needed (see README) +plasma_install_package(package org.kde.plasma.%{APPNAMELC}) diff --git a/templates/qml-plasmoid/Messages.sh b/templates/qml-plasmoid/Messages.sh index b8af9a77e..b7b1d793f 100644 --- a/templates/qml-plasmoid/Messages.sh +++ b/templates/qml-plasmoid/Messages.sh @@ -1,2 +1,2 @@ #! /usr/bin/env bash -$XGETTEXT `find . -name \*.qml` -o $podir/plasma_applet_%{APPNAMELC}.pot \ No newline at end of file +$XGETTEXT `find . -name \*.qml` -o $podir/plasma_applet_org.kde.plasma.%{APPNAMELC}.pot diff --git a/templates/qml-plasmoid/README b/templates/qml-plasmoid/README index 8deeea58d..38c59a56c 100644 --- a/templates/qml-plasmoid/README +++ b/templates/qml-plasmoid/README @@ -1,29 +1,46 @@ Plasma Applet Template ---------------------- +-- Namespace adaption -- + +Each Plasma plugin has a unique identifier, which is also used to find related +resources (like the translation catalogs). +To avoid naming collisions, Plasma plugins use a reverse domain name notation +for that identifier: + +* org.kde.plasma.* - plugins coming from Plasma modules +* org.kde.* - plugins coming from other software from KDE +* $(my.domain).* - plugins of your 3rd-party + +The generated code uses the "org.kde.plasma" namespace for the plugin identifier. +As this namespace is reserved for use by plugins part of Plasma modules, you will +need to adapt this namespace if you are writing a plugin which is not intended to +end up in the Plasma modules. + + -- Build instructions -- cd /where/your/applet/is/generated mkdir build cd build cmake -DCMAKE_INSTALL_PREFIX=MYPREFIX .. make make install (MYPREFIX is where you install your Plasma setup, replace it accordingly) Restart plasma to load the applet (in a terminal type: kquitapp plasmashell and then plasmashell) or view it with plasmoidviewer -a YourAppletName -- Tutorials and resources -- The explanation of the template https://techbase.kde.org/Development/Tutorials/Plasma5/QML2/GettingStarted Plasma QML API explained https://techbase.kde.org/Development/Tutorials/Plasma2/QML2/API diff --git a/templates/qml-plasmoid/package/metadata.desktop b/templates/qml-plasmoid/package/metadata.desktop index 314696d92..925dd84a6 100644 --- a/templates/qml-plasmoid/package/metadata.desktop +++ b/templates/qml-plasmoid/package/metadata.desktop @@ -1,96 +1,95 @@ [Desktop Entry] Name=%{APPNAME} Name[ar]=%{APPNAME} Name[ast]=%{APPNAME} Name[ca]=%{APPNAME} Name[ca@valencia]=%{APPNAME} Name[cs]=%{APPNAME} Name[da]=%{APPNAME} Name[de]=%{APPNAME} Name[en_GB]=%{APPNAME} Name[es]=%{APPNAME} Name[et]=%{APPNAME} Name[eu]=%{APPNAME} Name[fi]=%{APPNAME} Name[fr]=%{APPNAME} Name[gd]=%{APPNAME} Name[gl]=%{APPNAME} Name[ia]=%{APPNAME} Name[id]=%{APPNAME} Name[it]=%{APPNAME} Name[ko]=%{APPNAME} Name[nb]=%{APPNAME} Name[nl]=%{APPNAME} Name[nn]=%{APPNAME} Name[pl]=%{APPNAME} Name[pt]=%{APPNAME} Name[pt_BR]=%{APPNAME} Name[ru]=%{APPNAME} Name[sk]=%{APPNAME} Name[sl]=%{APPNAME} Name[sr]=%{APPNAME} Name[sr@ijekavian]=%{APPNAME} Name[sr@ijekavianlatin]=%{APPNAME} Name[sr@latin]=%{APPNAME} Name[sv]=%{APPNAME} Name[tr]=%{APPNAME} Name[uk]=%{APPNAME} Name[x-test]=xx%{APPNAME}xx Name[zh_CN]=%{APPNAME} Name[zh_TW]=%{APPNAME} Comment=what your app does in a few words Comment[ar]=ما يفعله تطبيقك ببضع كلمات Comment[ast]=lo que fai la to aplicación nunes pallabres Comment[ca]=Què fa aquesta aplicació en poques paraules Comment[ca@valencia]=Què fa aquesta aplicació en poques paraules Comment[da]=nogle få ord om hvad din app gør Comment[de]=In ein paar Worten, was Ihre Anwendung tut Comment[en_GB]=what your app does in a few words Comment[es]=lo que hace su aplicación, en pocas palabras Comment[et]=Mõne sõnaga, mida rakendus teeb Comment[eu]=zure aplikazioak egiten duena hitz gutxitan Comment[fi]=ohjelmasi toiminta muutamalla sanalla Comment[fr]=que fait votre application en quelques mots Comment[gd]=na nì an aplacaid agad ann am beagan fhaclan Comment[gl]=o que fai o seu aplicativo en poucas palabras Comment[ia]=cosa tu app face in pauc parolas Comment[id]=app apa yang kamu lakukan dalam beberapa kata Comment[it]=Cosa fa la tua applicazione in poche parole Comment[ko]=프로그램이 하는 일에 대한 간단한 설명 Comment[nb]=hva programmet gjør, med noen få ord Comment[nl]=wat uw app doet in een paar woorden Comment[nn]=nokre få ord om kva programmet gjer Comment[pl]=w kilku słowach opis co robi twój program Comment[pt]=o que faz a sua aplicação, em poucas palavras Comment[pt_BR]=breve descrição do que o seu aplicativo faz Comment[ru]=Несколько слов о том, что делает ваша программа Comment[sk]=čo vaša aplikácia robí v niekoľkých slovách Comment[sl]=kaj vaš program dela, v nekaj besedah Comment[sr]=Укратко о томе шта ваш програм ради Comment[sr@ijekavian]=Укратко о томе шта ваш програм ради Comment[sr@ijekavianlatin]=Ukratko o tome šta vaš program radi Comment[sr@latin]=Ukratko o tome šta vaš program radi Comment[sv]=vad programmet gör med några få ord Comment[tr]=uygulamanızın yaptığı şey, birkaç sözcükte Comment[uk]=призначення вашої програми у декількох словах Comment[x-test]=xxwhat your app does in a few wordsxx Comment[zh_CN]=简单几个词概括您的小程序的功能 Comment[zh_TW]=以數個字描述您的應用程式的用途 Icon=applications-system Type=Service X-KDE-ServiceTypes=Plasma/Applet X-KDE-PluginInfo-Author=%{AUTHOR} X-KDE-PluginInfo-Email=%{EMAIL} -X-KDE-PluginInfo-Name=%{APPNAMELC} +X-KDE-PluginInfo-Name=org.kde.plasma.%{APPNAMELC} X-KDE-PluginInfo-Version=1.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-Category=Utilities X-KDE-PluginInfo-Depends= X-KDE-PluginInfo-License=GPL X-KDE-PluginInfo-EnabledByDefault=true -X-KDE-PluginInfo-Name=org.kde.%{APPNAMELC} X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml