diff --git a/templates/cpp-plasmoid/CMakeLists.txt b/templates/cpp-plasmoid/CMakeLists.txt --- a/templates/cpp-plasmoid/CMakeLists.txt +++ b/templates/cpp-plasmoid/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) @@ -8,20 +8,18 @@ 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 --- 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 --- a/templates/cpp-plasmoid/README +++ b/templates/cpp-plasmoid/README @@ -1,6 +1,23 @@ 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 diff --git a/templates/cpp-plasmoid/src/CMakeLists.txt b/templates/cpp-plasmoid/src/CMakeLists.txt --- a/templates/cpp-plasmoid/src/CMakeLists.txt +++ b/templates/cpp-plasmoid/src/CMakeLists.txt @@ -1,4 +1,5 @@ -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 @@ -16,4 +17,4 @@ 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 --- a/templates/cpp-plasmoid/src/package/metadata.desktop +++ b/templates/cpp-plasmoid/src/package/metadata.desktop @@ -85,14 +85,13 @@ 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 --- a/templates/plasma-wallpaper-with-qml-extension/CMakeLists.txt +++ b/templates/plasma-wallpaper-with-qml-extension/CMakeLists.txt @@ -22,6 +22,7 @@ ) # 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 diff --git a/templates/plasma-wallpaper-with-qml-extension/README b/templates/plasma-wallpaper-with-qml-extension/README --- a/templates/plasma-wallpaper-with-qml-extension/README +++ b/templates/plasma-wallpaper-with-qml-extension/README @@ -1,6 +1,23 @@ 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 diff --git a/templates/plasma-wallpaper/CMakeLists.txt b/templates/plasma-wallpaper/CMakeLists.txt --- 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 --- a/templates/plasma-wallpaper/README +++ b/templates/plasma-wallpaper/README @@ -1,6 +1,23 @@ 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 diff --git a/templates/plasma-wallpaper/package/contents/ui/main.qml b/templates/plasma-wallpaper/package/contents/ui/main.qml --- a/templates/plasma-wallpaper/package/contents/ui/main.qml +++ b/templates/plasma-wallpaper/package/contents/ui/main.qml @@ -32,8 +32,7 @@ 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 --- a/templates/qml-plasmoid-with-qml-extension/CMakeLists.txt +++ b/templates/qml-plasmoid-with-qml-extension/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.0) project(plasma-%{APPNAMELC}) @@ -8,6 +8,7 @@ include(KDEInstallDirs) include(KDECMakeSettings) include(KDECompilerSettings NO_POLICY_SCOPE) +include(FeatureSummary) find_package(KF5 REQUIRED COMPONENTS Plasma @@ -21,7 +22,10 @@ ) # 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 --- 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 --- a/templates/qml-plasmoid-with-qml-extension/README +++ b/templates/qml-plasmoid-with-qml-extension/README @@ -1,6 +1,23 @@ 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 diff --git a/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop b/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop --- a/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop +++ b/templates/qml-plasmoid-with-qml-extension/package/metadata.desktop @@ -83,14 +83,13 @@ 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 --- a/templates/qml-plasmoid-with-qml-extension/plugin/%{APPNAMELC}plugin.cpp +++ b/templates/qml-plasmoid-with-qml-extension/plugin/%{APPNAMELC}plugin.cpp @@ -18,6 +18,9 @@ #include "%{APPNAMELC}plugin.h" +// KF +#include +// Qt #include #include #include @@ -27,7 +30,7 @@ Q_UNUSED(engine) QJSValue helloWorld = scriptEngine->newObject(); - helloWorld.setProperty("text", QStringLiteral("Hello world!")); + helloWorld.setProperty("text", i18n("Hello world!")); return helloWorld; } diff --git a/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt b/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt --- a/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt +++ b/templates/qml-plasmoid-with-qml-extension/plugin/CMakeLists.txt @@ -1,10 +1,13 @@ +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 ) diff --git a/templates/qml-plasmoid/CMakeLists.txt b/templates/qml-plasmoid/CMakeLists.txt --- 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 --- 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 --- a/templates/qml-plasmoid/README +++ b/templates/qml-plasmoid/README @@ -1,6 +1,23 @@ 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 diff --git a/templates/qml-plasmoid/package/metadata.desktop b/templates/qml-plasmoid/package/metadata.desktop --- a/templates/qml-plasmoid/package/metadata.desktop +++ b/templates/qml-plasmoid/package/metadata.desktop @@ -83,14 +83,13 @@ 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