diff --git a/kcms/ksplash/kcm.cpp b/kcms/ksplash/kcm.cpp index 7b17a6e7e..f156e737e 100644 --- a/kcms/ksplash/kcm.cpp +++ b/kcms/ksplash/kcm.cpp @@ -1,210 +1,210 @@ /* This file is part of the KDE Project Copyright (c) 2014 Marco Martin Copyright (c) 2014 Vishesh Handa This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library 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 library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "kcm.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include K_PLUGIN_FACTORY_WITH_JSON(KCMSplashScreenFactory, "kcm_splashscreen.json", registerPlugin();) KCMSplashScreen::KCMSplashScreen(QObject* parent, const QVariantList& args) : KQuickAddons::ConfigModule(parent, args) , m_config(QStringLiteral("ksplashrc")) , m_configGroup(m_config.group("KSplash")) { qmlRegisterType(); - KAboutData* about = new KAboutData(QStringLiteral("kcm_splashscreen"), i18n("Configure Splash screen details"), + KAboutData* about = new KAboutData(QStringLiteral("kcm_splashscreen"), i18n("Choose the splash screen theme"), QStringLiteral("0.1"), QString(), KAboutLicense::LGPL); about->addAuthor(i18n("Marco Martin"), QString(), QStringLiteral("mart@kde.org")); setAboutData(about); setButtons(Help | Apply | Default); m_model = new QStandardItemModel(this); QHash roles = m_model->roleNames(); roles[PluginNameRole] = "pluginName"; roles[ScreenhotRole] = "screenshot"; roles[DescriptionRole] = "description"; m_model->setItemRoleNames(roles); loadModel(); } QList KCMSplashScreen::availablePackages(const QString &component) { QList packages; QStringList paths; const QStringList dataPaths = QStandardPaths::standardLocations(QStandardPaths::GenericDataLocation); for (const QString &path : dataPaths) { QDir dir(path + QStringLiteral("/plasma/look-and-feel")); paths << dir.entryList(QDir::AllDirs | QDir::NoDotAndDotDot); } for (const QString &path : paths) { Plasma::Package pkg = Plasma::PluginLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel")); pkg.setPath(path); pkg.setFallbackPackage(Plasma::Package()); if (component.isEmpty() || !pkg.filePath(component.toUtf8()).isEmpty()) { packages << pkg; } } return packages; } QStandardItemModel *KCMSplashScreen::splashModel() { return m_model; } QString KCMSplashScreen::selectedPlugin() const { return m_selectedPlugin; } void KCMSplashScreen::setSelectedPlugin(const QString &plugin) { if (m_selectedPlugin == plugin) { return; } if (!m_selectedPlugin.isEmpty()) { setNeedsSave(true); } m_selectedPlugin = plugin; emit selectedPluginChanged(); emit selectedPluginIndexChanged(); } void KCMSplashScreen::getNewClicked() { KNS3::DownloadDialog dialog("ksplash.knsrc", nullptr); if (dialog.exec()) { KNS3::Entry::List list = dialog.changedEntries(); if (!list.isEmpty()) { loadModel(); } } } void KCMSplashScreen::loadModel() { m_model->clear(); QStandardItem* row = new QStandardItem(i18n("None")); row->setData("None", PluginNameRole); row->setData(i18n("No splash screen will be shown"), DescriptionRole); m_model->appendRow(row); const QList pkgs = availablePackages(QStringLiteral("splashmainscript")); for (const Plasma::Package &pkg : pkgs) { QStandardItem* row = new QStandardItem(pkg.metadata().name()); row->setData(pkg.metadata().pluginName(), PluginNameRole); row->setData(pkg.filePath("previews", QStringLiteral("splash.png")), ScreenhotRole); row->setData(pkg.metadata().comment(), DescriptionRole); m_model->appendRow(row); } emit selectedPluginIndexChanged(); } void KCMSplashScreen::load() { m_package = Plasma::PluginLoader::self()->loadPackage(QStringLiteral("Plasma/LookAndFeel")); KConfigGroup cg(KSharedConfig::openConfig(QStringLiteral("kdeglobals")), "KDE"); const QString packageName = cg.readEntry("LookAndFeelPackage", QString()); if (!packageName.isEmpty()) { m_package.setPath(packageName); } QString currentPlugin = m_configGroup.readEntry("Theme", QString()); if (currentPlugin.isEmpty()) { currentPlugin = m_package.metadata().pluginName(); } setSelectedPlugin(currentPlugin); setNeedsSave(false); } void KCMSplashScreen::save() { if (m_selectedPlugin.isEmpty()) { return; } else if (m_selectedPlugin == QLatin1String("None")) { m_configGroup.writeEntry("Theme", m_selectedPlugin); m_configGroup.writeEntry("Engine", "none"); } else { m_configGroup.writeEntry("Theme", m_selectedPlugin); m_configGroup.writeEntry("Engine", "KSplashQML"); } m_configGroup.sync(); setNeedsSave(false); } void KCMSplashScreen::defaults() { if (!m_package.metadata().isValid()) { return; } setSelectedPlugin(m_package.metadata().pluginName()); } int KCMSplashScreen::selectedPluginIndex() const { for (int i = 0; i < m_model->rowCount(); ++i) { if (m_model->data(m_model->index(i, 0), PluginNameRole).toString() == m_selectedPlugin) { return i; } } return -1; } void KCMSplashScreen::test(const QString &plugin) { if (plugin.isEmpty() || plugin == QLatin1String("None")) { return; } QProcess proc; QStringList arguments; arguments << plugin << QStringLiteral("--test"); if (proc.execute(QStringLiteral("ksplashqml"), arguments)) { QMessageBox::critical(nullptr, i18n("Error"), i18n("Failed to successfully test the splash screen.")); } } #include "kcm.moc" diff --git a/kcms/ksplash/kcm_splashscreen.desktop b/kcms/ksplash/kcm_splashscreen.desktop index d0ce4e567..3c3b0b43e 100644 --- a/kcms/ksplash/kcm_splashscreen.desktop +++ b/kcms/ksplash/kcm_splashscreen.desktop @@ -1,142 +1,142 @@ [Desktop Entry] Icon=preferences-system-splash Exec=kcmshell5 kcm_splashscreen X-DocPath=kcontrol/splashscreen/index.html Type=Service X-KDE-ServiceTypes=KCModule X-KDE-Library=kcm_splashscreen X-KDE-ParentApp=kcontrol X-KDE-System-Settings-Parent-Category=workspacetheme X-KDE-Weight=100 Name=Splash Screen Name[bs]=Čuvar ekrana Name[ca]=Pantalla de presentació Name[ca@valencia]=Pantalla de presentació Name[cs]=Úvodní obrazovka Name[da]=Splashskærm Name[de]=Startbildschirm Name[el]=Αρχική οθόνη Name[en_GB]=Splash Screen Name[es]=Pantalla de bienvenida Name[et]=Tiitelkuva Name[eu]=Plast pantaila Name[fi]=Tervetuloruutu Name[fr]=Écran de démarrage Name[gl]=Pantalla de benvida Name[he]=מסך פתיחה Name[hu]=Nyitóképernyő Name[id]=Layar Splash Name[is]=Upphafsskjár Name[it]=Schermata iniziale Name[ko]=시작 화면 Name[lt]=Pasveikinimo ekranas Name[nb]=Velkomstbilde Name[nds]=Startschirm Name[nl]=Opstartscherm Name[nn]=Velkomst­bilete Name[pa]=ਸਵਾਗਤੀ ਸਕਰੀਨ Name[pl]=Ekran powitalny Name[pt]=Ecrã Inicial Name[pt_BR]=Tela de apresentação Name[ru]=Заставка Name[se]=Álgošearbma Name[sk]=Úvodná obrazovka Name[sl]=Pozdravno okno Name[sr]=Уводни екран Name[sr@ijekavian]=Уводни екран Name[sr@ijekavianlatin]=Uvodni ekran Name[sr@latin]=Uvodni ekran Name[sv]=Startskärm Name[tr]=Açılış Ekranı Name[uk]=Вікно вітання Name[vi]=Màn hình chào mừng Name[x-test]=xxSplash Screenxx Name[zh_CN]=欢迎屏幕 Name[zh_TW]=啟動畫面 -Comment=Splash Screen Theme +Comment=Choose the splash screen theme Comment[bs]=Tema čuvara ekrana Comment[ca]=Tema de la pantalla de presentació Comment[ca@valencia]=Tema de la pantalla de presentació Comment[cs]=Motiv úvodní obrazovky Comment[da]=Tema for opstartsskærmen Comment[de]=Startbildschirm-Design Comment[el]=Θέμα αρχικής οθόνης Comment[en_GB]=Splash Screen Theme Comment[es]=Tema de la pantalla de bienvenida Comment[et]=Tiitelkuva teema Comment[eu]=Plasta pantailaren gaia Comment[fi]=Tervetuloruudun teema Comment[fr]=Thème de l'écran de démarrage Comment[gl]=Tema da pantalla de benvida Comment[he]=ערכת הנושא של מסך הפתיחה Comment[hu]=Nyitókép téma Comment[id]=Tema Layar Splash Comment[is]=Þemai ræsiskjás Comment[it]=Tema della schermata iniziale Comment[ko]=시작 화면 테마 Comment[lt]=Pasveikinimo ekrano apipavidalinimas Comment[nb]=Velkomstbilde-tema Comment[nds]=Startschirm-Muster Comment[nl]=Opstartschermthema Comment[nn]=Tema for velkomstbilete Comment[pa]=ਸਵਾਗਤੀ ਸਕਰੀਨ ਥੀਮ Comment[pl]=Wygląd ekranu powitalnego Comment[pt]=Tema do Ecrã Inicial Comment[pt_BR]=Tema da tela de apresentação Comment[ru]=Управление темами экрана-заставки Comment[sk]=Téma úvodnej obrazovky Comment[sl]=Tema pozdravnega okna Comment[sr]=Тема уводног екрана Comment[sr@ijekavian]=Тема уводног екрана Comment[sr@ijekavianlatin]=Tema uvodnog ekrana Comment[sr@latin]=Tema uvodnog ekrana Comment[sv]=Tema för startskärm Comment[tr]=Açılış Ekranı Teması Comment[uk]=Тема вікна вітання Comment[x-test]=xxSplash Screen Themexx Comment[zh_CN]=欢迎屏幕主题 Comment[zh_TW]=啟動畫面主題 X-KDE-Keywords=splash screen,splash theme,startup X-KDE-Keywords[bs]=čuvar ekrana,blijesak teme,pokretanje X-KDE-Keywords[ca]=pantalla de presentació,tema de presentació,engegar X-KDE-Keywords[ca@valencia]=pantalla de presentació,tema de presentació,engegar X-KDE-Keywords[da]=opstartsbillede,opstartsskærm,splash,opstartstema,opstart X-KDE-Keywords[de]=Startbildschirm,Design X-KDE-Keywords[el]=οθόνης εκκίνησης,θέμα εκκίνησης,έναρξη X-KDE-Keywords[en_GB]=splash screen,splash theme,startup X-KDE-Keywords[es]=pantalla de bienvenida,tema de bienvenida,inicio X-KDE-Keywords[et]=tiitelkuva,tiitelkuva teema,käivitamine X-KDE-Keywords[eu]=plasta pantaila,plasta gaia,abiaraztea X-KDE-Keywords[fi]=aloitusruutu,aloitusteema,käynnistys,käynnistysruutu,käynnistysteema,tervetuloruutu,tervetuloikkuna,tervetuloteema X-KDE-Keywords[fr]=écran de démarrage, thème de l'écran de démarrage, démarrage X-KDE-Keywords[gl]=pantalla de benvida, tema de benvida, inicio X-KDE-Keywords[hu]=indítóképernyő,indítótéma,indulás X-KDE-Keywords[id]=screen splash,tema splash,pemulaian X-KDE-Keywords[it]=schermata iniziale,tema della schermata iniziale,avvio X-KDE-Keywords[ko]=splash screen,splash theme,startup,시작 화면,시작 테마,시작 X-KDE-Keywords[nb]=velkomstbilde,velkomstbildetema,oppstart X-KDE-Keywords[nds]=Startschirm,Startschirm-Muster,Hoochfohren X-KDE-Keywords[nl]=splash-scherm,splash-thema,opstarten X-KDE-Keywords[nn]=velkomstbilete,velkomstbilettema,oppstart X-KDE-Keywords[pa]=ਸਵਾਗਤੀ ਸਕਰੀਨ,ਸਪਲੈਸ਼ ਥੀਮ,ਸ਼ੁਰੂ,ਸ਼ੁਰੂਆਤ X-KDE-Keywords[pl]=ekran powitalny,wystrój ekranu powitalnego,uruchamianie X-KDE-Keywords[pt]=ecrã inicial,tema do ecrã inicial,arranque X-KDE-Keywords[pt_BR]=tela inicial,tema inicial,inicialização X-KDE-Keywords[ru]=splash screen,splash theme,startup,заставка,экран-заставка,тема заставки,запуск,приветствие X-KDE-Keywords[sk]=splash screen,splash theme,spustenie X-KDE-Keywords[sl]=pozdravno okno,pozdravni zaslon,tema pozdravnega zaslona,zagon X-KDE-Keywords[sr]=splash screen,splash theme,startup,уводни екран,уводна тема,покретање X-KDE-Keywords[sr@ijekavian]=splash screen,splash theme,startup,уводни екран,уводна тема,покретање X-KDE-Keywords[sr@ijekavianlatin]=splash screen,splash theme,startup,uvodni ekran,uvodna tema,pokretanje X-KDE-Keywords[sr@latin]=splash screen,splash theme,startup,uvodni ekran,uvodna tema,pokretanje X-KDE-Keywords[sv]=startskärm,starttema,start X-KDE-Keywords[tr]=açılış ekranı,açılış ekranı teması,açılış X-KDE-Keywords[uk]=splash screen,splash theme,startup,вікно,вітання,тема,запуск X-KDE-Keywords[x-test]=xxsplash screenxx,xxsplash themexx,xxstartupxx X-KDE-Keywords[zh_CN]=splash screen,splash theme,startup,飞溅屏幕,启动画面,启动画面主题,飞溅屏幕主题,启动 X-KDE-Keywords[zh_TW]=splash screen,splash theme,startup Categories=Qt;KDE;X-KDE-settings-looknfeel; diff --git a/kcms/ksplash/package/contents/ui/main.qml b/kcms/ksplash/package/contents/ui/main.qml index bd82a2428..f7d85cda4 100644 --- a/kcms/ksplash/package/contents/ui/main.qml +++ b/kcms/ksplash/package/contents/ui/main.qml @@ -1,68 +1,68 @@ /* Copyright (c) 2014 Marco Martin This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License version 2 as published by the Free Software Foundation. This library 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 library; see the file COPYING.LIB. 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 QtQuick.Controls 1.0 as QtControls import org.kde.kirigami 2.4 as Kirigami import org.kde.kconfig 1.0 // for KAuthorized import org.kde.kcm 1.1 as KCM KCM.GridViewKCM { - KCM.ConfigModule.quickHelp: i18n("This module lets you configure the splash screen theme.") + KCM.ConfigModule.quickHelp: i18n("This module lets you choose the splash screen theme.") view.model: kcm.splashModel //NOTE: pay attention to never break this binding view.currentIndex: kcm.selectedPluginIndex view.delegate: KCM.GridDelegate { id: delegate text: model.display toolTip: model.description thumbnailAvailable: !!model.screenshot thumbnail: Image { anchors.fill: parent source: model.screenshot || "" } actions: [ Kirigami.Action { visible: model.pluginName != "None" iconName: "media-playback-start" - tooltip: i18n("Test Splashscreen") + tooltip: i18n("Test Splash Screen") onTriggered: kcm.test(model.pluginName) } ] onClicked: { kcm.selectedPlugin = model.pluginName; view.forceActiveFocus(); } } footer: RowLayout { Item { Layout.fillWidth: true } QtControls.Button { iconName: "get-hot-new-stuff" text: i18n("&Get New Splash Screens...") onClicked: kcm.getNewClicked(); visible: KAuthorized.authorize("ghns") } } } diff --git a/kcms/ksplash/package/metadata.desktop b/kcms/ksplash/package/metadata.desktop index afae78295..874d561f0 100644 --- a/kcms/ksplash/package/metadata.desktop +++ b/kcms/ksplash/package/metadata.desktop @@ -1,103 +1,103 @@ [Desktop Entry] Name=Splash Screen Name[bs]=Čuvar ekrana Name[ca]=Pantalla de presentació Name[ca@valencia]=Pantalla de presentació Name[cs]=Úvodní obrazovka Name[da]=Splashskærm Name[de]=Startbildschirm Name[el]=Αρχική οθόνη Name[en_GB]=Splash Screen Name[es]=Pantalla de bienvenida Name[et]=Tiitelkuva Name[eu]=Plast pantaila Name[fi]=Tervetuloruutu Name[fr]=Écran de démarrage Name[gl]=Pantalla de benvida Name[he]=מסך פתיחה Name[hu]=Nyitóképernyő Name[id]=Layar Splash Name[is]=Upphafsskjár Name[it]=Schermata iniziale Name[ko]=시작 화면 Name[lt]=Pasveikinimo ekranas Name[nb]=Velkomstbilde Name[nds]=Startschirm Name[nl]=Opstartscherm Name[nn]=Velkomst­bilete Name[pa]=ਸਵਾਗਤੀ ਸਕਰੀਨ Name[pl]=Ekran powitalny Name[pt]=Ecrã Inicial Name[pt_BR]=Tela de apresentação Name[ru]=Заставка Name[se]=Álgošearbma Name[sk]=Úvodná obrazovka Name[sl]=Pozdravno okno Name[sr]=Уводни екран Name[sr@ijekavian]=Уводни екран Name[sr@ijekavianlatin]=Uvodni ekran Name[sr@latin]=Uvodni ekran Name[sv]=Startskärm Name[tr]=Açılış Ekranı Name[uk]=Вікно вітання Name[vi]=Màn hình chào mừng Name[x-test]=xxSplash Screenxx Name[zh_CN]=欢迎屏幕 Name[zh_TW]=啟動畫面 -Comment=Splash Screen Theme +Comment=Choose the splash screen theme Comment[bs]=Tema čuvara ekrana Comment[ca]=Tema de la pantalla de presentació Comment[ca@valencia]=Tema de la pantalla de presentació Comment[cs]=Motiv úvodní obrazovky Comment[da]=Tema for opstartsskærmen Comment[de]=Startbildschirm-Design Comment[el]=Θέμα αρχικής οθόνης Comment[en_GB]=Splash Screen Theme Comment[es]=Tema de la pantalla de bienvenida Comment[et]=Tiitelkuva teema Comment[eu]=Plasta pantailaren gaia Comment[fi]=Tervetuloruudun teema Comment[fr]=Thème de l'écran de démarrage Comment[gl]=Tema da pantalla de benvida Comment[he]=ערכת הנושא של מסך הפתיחה Comment[hu]=Nyitókép téma Comment[id]=Tema Layar Splash Comment[is]=Þemai ræsiskjás Comment[it]=Tema della schermata iniziale Comment[ko]=시작 화면 테마 Comment[lt]=Pasveikinimo ekrano apipavidalinimas Comment[nb]=Velkomstbilde-tema Comment[nds]=Startschirm-Muster Comment[nl]=Opstartschermthema Comment[nn]=Tema for velkomstbilete Comment[pa]=ਸਵਾਗਤੀ ਸਕਰੀਨ ਥੀਮ Comment[pl]=Wygląd ekranu powitalnego Comment[pt]=Tema do Ecrã Inicial Comment[pt_BR]=Tema da tela de apresentação Comment[ru]=Управление темами экрана-заставки Comment[sk]=Téma úvodnej obrazovky Comment[sl]=Tema pozdravnega okna Comment[sr]=Тема уводног екрана Comment[sr@ijekavian]=Тема уводног екрана Comment[sr@ijekavianlatin]=Tema uvodnog ekrana Comment[sr@latin]=Tema uvodnog ekrana Comment[sv]=Tema för startskärm Comment[tr]=Açılış Ekranı Teması Comment[uk]=Тема вікна вітання Comment[x-test]=xxSplash Screen Themexx Comment[zh_CN]=欢迎屏幕主题 Comment[zh_TW]=啟動畫面主題 Icon=preferences-system-splash Keywords= Type=Service X-KDE-ParentApp= X-KDE-PluginInfo-Author=Marco Martin X-KDE-PluginInfo-Email=mart@kde.org X-KDE-PluginInfo-License=GPLv2 X-KDE-PluginInfo-Name=kcm_splashscreen X-KDE-PluginInfo-Version= X-KDE-PluginInfo-Website=https://www.kde.org/plasma-desktop X-KDE-ServiceTypes=Plasma/Generic X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml