diff --git a/discover/qml/DiscoverDrawer.qml b/discover/qml/DiscoverDrawer.qml index 4c47b9bd..32140bfc 100644 --- a/discover/qml/DiscoverDrawer.qml +++ b/discover/qml/DiscoverDrawer.qml @@ -1,193 +1,193 @@ /*************************************************************************** * Copyright © 2015 Aleix Pol Gonzalez * * * * 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) version 3 or any later version * * accepted by the membership of KDE e.V. (or its successor approved * * by the membership of KDE e.V.), which shall act as a proxy * * defined in Section 14 of version 3 of the license. * * * * 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, see . * ***************************************************************************/ import QtQuick 2.5 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.1 import org.kde.discover 2.0 import org.kde.discover.app 1.0 import org.kde.kirigami 2.0 as Kirigami import "navigation.js" as Navigation Kirigami.GlobalDrawer { id: drawer bannerImageSource: "qrc:/banners/banner.svg" //make the left and bottom margins for search field the same topPadding: -searchField.height - leftPadding bottomPadding: 0 resetMenuOnTriggered: false onBannerClicked: { Navigation.openHome(); } function clearSearch() { searchField.text = "" } onCurrentSubMenuChanged: { if (currentSubMenu) currentSubMenu.trigger() else if (searchField.text !== "") window.leftPage.category = null else Navigation.openHome() } topContent: TextField { id: searchField Layout.fillWidth: true enabled: window.leftPage && (window.leftPage.searchFor != null || window.leftPage.hasOwnProperty("search")) Keys.forwardTo: [window.pageStack] Component.onCompleted: { searchField.forceActiveFocus() } Shortcut { sequence: "Ctrl+F" onActivated: { searchField.forceActiveFocus() searchField.selectAll() } } placeholderText: (!enabled || !window.leftPage || window.leftPage.title.length === 0) ? i18n("Search...") : i18n("Search in '%1'...", window.leftPage.title) onTextChanged: { if(window.stack.depth > 0) searchTimer.running = true } Connections { ignoreUnknownSignals: true target: window.leftPage onClearSearch: { drawer.clearSearch() } } Timer { id: searchTimer running: false repeat: false interval: 200 onTriggered: { var curr = window.leftPage; if (!curr.hasOwnProperty("search")) { Navigation.clearStack() Navigation.openApplicationList( { search: parent.text }) } else curr.search = parent.text; } } } ColumnLayout { spacing: 0 Layout.fillWidth: true Layout.leftMargin: -drawer.leftPadding Layout.rightMargin: -drawer.rightPadding Kirigami.Separator { Layout.fillWidth: true } ProgressView { separatorVisible: false } ActionListItem { action: installedAction } ActionListItem { action: settingsAction } ActionListItem { objectName: "updateButton" action: updateAction - backgroundColor: action.enabled ? "orange" : Kirigami.Theme.viewBackgroundColor + backgroundColor: ResourcesModel.updatesCount>0 ? "orange" : Kirigami.Theme.viewBackgroundColor } states: [ State { name: "full" when: !Helpers.isCompact PropertyChanges { target: drawer; drawerOpen: true } }, State { name: "compact" when: Helpers.isCompact PropertyChanges { target: drawer; drawerOpen: false } } ] } function rootCategory(cat) { var ret = null while (cat) { ret = cat cat = cat.parent } return ret } Component { id: categoryActionComponent Kirigami.Action { property QtObject category readonly property bool itsMe: window.leftPage && window.leftPage.hasOwnProperty("category") && (window.leftPage.category == category) text: category.name checked: itsMe visible: (!window.leftPage || !window.leftPage.subcategories || window.leftPage.subcategories === undefined || searchField.text.length === 0 || (category && category.contains(window.leftPage.subcategories)) ) onTriggered: { if (!window.leftPage.canNavigate) Navigation.openCategory(category, searchField.text) else { window.leftPage.category = category pageStack.currentIndex = 0 } } } } function createCategoryActions(categories) { var actions = [] for(var i in categories) { var cat = categories[i]; var catAction = categoryActionComponent.createObject(drawer, {category: cat}); catAction.children = createCategoryActions(cat.subcategories); actions.push(catAction) } return actions; } actions: createCategoryActions(CategoryModel.rootCategories) modal: Helpers.isCompact handleVisible: Helpers.isCompact } diff --git a/discover/qml/DiscoverWindow.qml b/discover/qml/DiscoverWindow.qml index e43bff4b..426add84 100644 --- a/discover/qml/DiscoverWindow.qml +++ b/discover/qml/DiscoverWindow.qml @@ -1,178 +1,177 @@ import QtQuick 2.1 import QtQuick.Layouts 1.1 import QtQuick.Controls 1.1 import org.kde.discover 2.0 import org.kde.discover.app 1.0 import org.kde.kirigami 2.0 as Kirigami import "navigation.js" as Navigation Kirigami.ApplicationWindow { id: window readonly property string applicationListComp: ("qrc:/qml/ApplicationsListPage.qml") readonly property string applicationComp: ("qrc:/qml/ApplicationPage.qml") readonly property string reviewsComp: ("qrc:/qml/ReviewsPage.qml") //toplevels readonly property string topBrowsingComp: ("qrc:/qml/BrowsingPage.qml") readonly property string topInstalledComp: ("qrc:/qml/InstalledPage.qml") readonly property string topUpdateComp: ("qrc:/qml/UpdatesPage.qml") readonly property string topSourcesComp: ("qrc:/qml/SourcesPage.qml") readonly property string loadingComponent: ("qrc:/qml/LoadingPage.qml") readonly property QtObject stack: window.pageStack property string currentTopLevel: defaultStartup ? topBrowsingComp : loadingComponent property bool defaultStartup: true property bool navigationEnabled: true objectName: "DiscoverMainWindow" title: leftPage ? leftPage.title : "" header: null visible: true minimumWidth: 300 minimumHeight: 300 pageStack.defaultColumnWidth: Kirigami.Units.gridUnit * 25 readonly property var leftPage: window.stack.depth>0 ? window.stack.get(0) : null Component.onCompleted: { Helpers.mainWindow = window if (app.isRoot) showPassiveNotification(i18n("Running as root is discouraged and unnecessary.")); } TopLevelPageData { iconName: "tools-wizard" text: i18n("Discover") component: topBrowsingComp objectName: "discover" shortcut: "Alt+D" } TopLevelPageData { id: installedAction text: i18n("Installed") component: topInstalledComp objectName: "installed" shortcut: "Alt+I" } TopLevelPageData { id: updateAction iconName: enabled ? "update-low" : "update-none" - text: !enabled ? (ResourcesModel.isFetching ? i18n("Checking for updates...") : i18n("No Updates") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount) - enabled: ResourcesModel.updatesCount>0 + text: ResourcesModel.updatesCount<=0 ? (ResourcesModel.isFetching ? i18n("Checking for updates...") : i18n("No Updates") ) : i18nc("Update section name", "Update (%1)", ResourcesModel.updatesCount) component: topUpdateComp objectName: "update" shortcut: "Alt+U" } TopLevelPageData { id: settingsAction iconName: "settings" text: i18n("Settings") component: topSourcesComp objectName: "settings" shortcut: "Alt+S" } Connections { target: app onOpenApplicationInternal: { Navigation.clearStack() Navigation.openApplication(app) } onOpenUrl: { currentTopLevel = topBrowsingComp; Navigation.openUrlResources(url) } onListMimeInternal: { currentTopLevel = topBrowsingComp; Navigation.openApplicationMime(mime) } onListCategoryInternal: { currentTopLevel = topBrowsingComp; Navigation.openCategory(cat, "") } onPreventedClose: showPassiveNotification(i18n("Could not close the application, there are tasks that need to be done."), 3000) onUnableToFind: { showPassiveNotification(i18n("Unable to find resource: %1", resid)); Navigation.openHome() } } Connections { target: ResourcesModel onPassiveMessage: { showPassiveNotification(message, 3000) console.log("message:", message) } } Component { id: proceedDialog Kirigami.OverlaySheet { id: sheet property QtObject transaction property alias title: heading.text property alias description: desc.text property bool acted: false ColumnLayout { Kirigami.Heading { id: heading } Kirigami.Label { id: desc Layout.fillWidth: true wrapMode: Text.WordWrap } Button { Layout.alignment: Qt.AlignRight iconName: "dialog-ok" onClicked: { transaction.proceed() sheet.acted = true sheet.close() } } } onSheetOpenChanged: if(!sheetOpen) { sheet.destroy(1000) if (!sheet.acted) transaction.cancel() } } } Instantiator { model: TransactionModel delegate: Connections { target: model.transaction ? model.transaction : null onProceedRequest: { var dialog = proceedDialog.createObject(window, {transaction: transaction, title: title, description: description}) dialog.open() } onPassiveMessage: { window.showPassiveNotification(message) } } } globalDrawer: DiscoverDrawer { focus: true } onCurrentTopLevelChanged: { window.pageStack.clear() if (currentTopLevel) window.pageStack.push(currentTopLevel, {}, window.status!=Component.Ready) } UnityLauncher { launcherId: "org.kde.discover.desktop" progressVisible: TransactionModel.count > 0 progress: TransactionModel.progress } } diff --git a/notifier/plasmoid/metadata.desktop b/notifier/plasmoid/metadata.desktop index 367d9ee4..348f2583 100644 --- a/notifier/plasmoid/metadata.desktop +++ b/notifier/plasmoid/metadata.desktop @@ -1,103 +1,103 @@ [Desktop Entry] Name=Updates Name[ar]=التّحديثات Name[ca]=Actualitzacions Name[ca@valencia]=Actualitzacions Name[cs]=Aktualizace Name[da]=Opdateringer Name[de]=Aktualisierungen Name[el]=Ενημερώσεις Name[en_GB]=Updates Name[es]=Actualizaciones Name[et]=Uuendused Name[eu]=Eguneraketak Name[fi]=Päivitykset Name[fr]=Mises à jour Name[gl]=Actualizacións Name[he]=עדכונים Name[hu]=Frissítések Name[ia]=Actualisationes Name[id]=Pembaruan Name[it]=Aggiornamenti Name[ko]=업데이트 Name[nb]=Oppdateringer Name[nl]=Elementen voor bijwerken Name[nn]=Oppdateringar Name[pa]=ਅੱਪਡੇਟ Name[pl]=Uaktualnienia Name[pt]=Actualizações Name[pt_BR]=Atualizações Name[ru]=Обновления Name[sk]=Aktualizácie Name[sl]=Posodobitve Name[sr]=Допуне Name[sr@ijekavian]=Допуне Name[sr@ijekavianlatin]=Dopune Name[sr@latin]=Dopune Name[sv]=Uppdateringar Name[tr]=Güncellemeler Name[uk]=Оновлення Name[x-test]=xxUpdatesxx Name[zh_CN]=更新 Name[zh_TW]=更新 Comment=Helps you keep your system up to date Comment[ar]=يساعدك في إبقاء نظامك محدّثًا Comment[ca]=Us ajuda a mantenir el vostre sistema al dia Comment[ca@valencia]=Vos ajuda a mantindre el vostre sistema al dia Comment[cs]=Umožňuje vám zachovat systém aktuální Comment[da]=Hjælper dig med at holde dit system opdateret Comment[de]=Hilft Ihnen, Ihr System auf dem neusten Stand zu halten Comment[el]=Βοηθά να διατηρήσετε το σύστημά σας ενημερωμένο Comment[en_GB]=Helps you keep your system up to date Comment[es]=Le ayuda a mantener su sistema al día Comment[et]=Aitab hoida süsteemi värske Comment[eu]=Zure sistema egunean mantentzen laguntzen dizu Comment[fi]=Auttaa pitämään järjestelmäsi ajan tasalla Comment[fr]=Vous aide à maintenir le système à jour Comment[gl]=Axúdao a manter o seu sistema actualizado. Comment[he]=עוזר לך לשמור על המערכת מעודכנת Comment[hu]=Segít a rendszere naprakészen tartásában Comment[id]=Membantu kamu menjaga komputermu selalu terbaru Comment[it]=Ti aiuta a mantenere il sistema aggiornato Comment[ko]=시스템을 최신 상태로 유지합니다 Comment[nb]=Hjelper til å holde systemet oppdatert Comment[nl]=Helpt u om uw system bijgewerkt te houden Comment[nn]=Hjelper til å halda systemet oppdatert Comment[pa]=ਤੁਹਾਡੇ ਸਿਸਟਮ ਨੂੰ ਅੱਪਡੇਟ ਰੱਖਣ ਲਈ ਤੁਹਾਡੀ ਮਦਦ ਕਰਦਾ ਹੈ Comment[pl]=Pomaga utrzymać twój system aktualnym Comment[pt]=Ajuda-o a manter o seu sistema actualizado Comment[pt_BR]=Ajuda-o a manter seu sistema atualizado Comment[ru]=Помогает поддерживать систему в актуальном состоянии Comment[sk]=Pomôže vám udržiavať váš systém aktuálny Comment[sl]=Pomaga vam ohraniti posodobljen sistem Comment[sr]=Помаже вам да одржавате систем ажурним Comment[sr@ijekavian]=Помаже вам да одржавате систем ажурним Comment[sr@ijekavianlatin]=Pomaže vam da održavate sistem ažurnim Comment[sr@latin]=Pomaže vam da održavate sistem ažurnim Comment[sv]=Hjälper dig hålla systemet uppdaterat Comment[tr]=Sisteminizin güncel kalmasını sağlar Comment[uk]=Допомагає підтримувати актуальний стан вашої системи Comment[x-test]=xxHelps you keep your system up to datexx Comment[zh_CN]=帮助您保持系统更新 Comment[zh_TW]=協助您的系統更新到最新狀態 Encoding=UTF-8 Icon=update-none Type=Service X-KDE-ServiceTypes=Plasma/Applet X-KDE-PluginInfo-Author=The Plasma Team X-KDE-PluginInfo-Email=plasma-devel@kde.org X-KDE-PluginInfo-Name=org.kde.discovernotifier X-KDE-PluginInfo-Version=3.0 X-KDE-PluginInfo-Website=http://plasma.kde.org/ X-KDE-PluginInfo-Category=Online Services X-KDE-PluginInfo-Depends= -X-KDE-PluginInfo-License=GPL-2.0+ +X-KDE-PluginInfo-License=GPLv2+ X-KDE-PluginInfo-EnabledByDefault=true X-Plasma-API=declarativeappletscript X-Plasma-MainScript=ui/main.qml X-Plasma-NotificationArea=true X-Plasma-Requires-FileDialog=Unused X-Plasma-Requires-LaunchApp=Required