[-]
[+]
|
Changed |
_service:tar_git:install-history.changes
|
|
[-]
[+]
|
Changed |
_service:tar_git:install-history.spec
^
|
|
[-]
[+]
|
Changed |
_service
^
|
@@ -2,7 +2,7 @@
<service name="tar_git">
<param name="url">https://codeberg.org/nephros/install-history</param>
<param name="branch"></param>
- <param name="revision">0.9.11-1</param>
+ <param name="revision">0.9.12</param>
<param name="token"/>
<param name="debian">N</param>
<param name="dumb">N</param>
|
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/Screenshot_001.png
^
|
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/Screenshot_003.png
^
|
[-]
[+]
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/install-history.pro
^
|
@@ -7,10 +7,12 @@
CONFIG += sailfishapp sailfishapp_i18n
lupdate_only {
- SOURCES += qml/pages/MainPage.qml
+ SOURCES += qml/pages/MainPage.qml \
+ qml/pages/StatsPage.qml
}
# Input
TRANSLATIONS += translations/settings-install-history-de.ts \
translations/settings-install-history-en.ts \
+ translations/settings-install-history-ru.ts \
translations/settings-install-history-sv.ts
|
[-]
[+]
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/qml/pages/MainPage.qml
^
|
@@ -30,6 +30,11 @@
property bool unclutter: false
+ onStatusChanged: {
+ if ( status === PageStatus.Active && pageStack.nextPage() === null ) { pageStack.pushAttached(statsPage) }
+ }
+ Component { id: statsPage; StatsPage{ } }
+
DockedPanel { id: detailInfo
property var date
@@ -47,7 +52,6 @@
animationDuration : 250
height: content.height
width: parent.width
- //background: Rectangle {
Rectangle {
clip: true
opacity: 1.0
@@ -115,6 +119,7 @@
}
}
}
+
SilicaFlickable { id: flick
anchors.fill: parent
PageHeader { id: header ; title: qsTr("Install History") ; description: qsTr("%Ln event(s)", "very, very unlikely to have only one, still, plurals please!", appHistoryModel.count)}
@@ -124,6 +129,7 @@
width: parent.width
SearchField { id: dateSearch
//canHide: true;
+ width: parent.width - Theme.horizontalPageMargin
visible: false
readOnly: true
placeholderText: view.jumpDate != null ? view.jumpDate.toISOString().substr(0,10) : qsTr("Date")
@@ -136,6 +142,7 @@
SearchField { id: nameSearch
//canHide: true;
visible: false
+ width: parent.width - Theme.horizontalPageMargin
placeholderText: qsTr("Name")
inputMethodHints: Qt.ImhNoAutoUppercase
EnterKey.enabled: text.length > 3
|
[-]
[+]
|
Added |
_service:tar_git:install-history-0.9.12.tar.gz/qml/pages/StatsPage.qml
^
|
@@ -0,0 +1,209 @@
+/*
+ * MIT License
+ *
+ * Copyright 2022 Peter G. (nephros) <sailfish@nephros.org>
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
+ * of this software and associated documentation files (the "Software"), to
+ * deal in the Software without restriction, including without limitation the
+ * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+ * sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+*/
+
+import QtQuick 2.6
+import Sailfish.Silica 1.0
+
+Page {
+ id: statsPage
+
+ states: [
+ State { name: "pkgs"
+ PropertyChanges { target: menu1
+ text: qsTr("View repositories")
+ }
+ PropertyChanges { target: sheader
+ text: qsTr("Active packages")
+ }
+ PropertyChanges { target: statsView
+ model: packageModel
+ viewRepos: false
+ }
+ }
+ ]
+
+ BusyLabel {
+ running: packageModel.loading || repoModel.loading
+ text: qsTr("Crunching Numbers…")
+ }
+
+ PullDownMenu { id: pdp
+ flickable: flick
+ MenuItem { id: menu1; text: qsTr("View packages")
+ onClicked: statsPage.state = (statsPage.state == "") ? "pkgs" : ""
+ }
+ }
+ ListModel { id: packageModel
+ property bool loading: true
+ property int max: 0
+ property int sum: 0
+ }
+ ListModel { id: repoModel
+ property bool loading: true
+ property int max: 0
+ property int sum: 0
+ }
+
+ onStatusChanged: {
+ if ( status === PageStatus.Active) {
+ if( repoModel.count <= 0 ) { fillModel(repoModel, "install", "repo", 10)}
+ if( packageModel.count <= 0 ) { fillModel(packageModel, "install", "appName", 10)}
+ }
+ }
+
+ SilicaFlickable { id: flick
+ anchors.fill: parent
+ contentHeight: mainColumn.height
+ Column{ id: mainColumn
+ width: parent.width
+ spacing: Theme.paddingSmall
+
+ PageHeader { id: header ; title: qsTr("Install History") ; description: qsTr("Statistics")}
+
+ Label {
+ width: parent.width - Theme.horizontalPageMargin
+ color: Theme.secondaryHighlightColor
+ anchors.horizontalCenter: parent.horizontalCenter
+ text: qsTr("Percentages are relative to all recorded installation events. Bars are relative to the item with the highest event count.")
+ horizontalAlignment: Text.AlignJustify
+ wrapMode: Text.WordWrap
+ }
+
+ SectionHeader { id: sheader ; text: qsTr("Repositories") }
+
+ ColumnView { id: statsView
+ width: parent.width - Theme.itemSizeSmall
+ anchors.horizontalCenter: parent.horizontalCenter
+ itemHeight: Theme.itemSizeMedium
+ property int max: model.max
+ property int sum: model.sum
+ property bool viewRepos: true
+ model: viewRepos ? repoModel : packageModel
+ onViewReposChanged: model = viewRepos ? repoModel : packageModel
+ delegate: SilicaItem { id: statsDelegate
+ height: Theme.itemSizeMedium
+ width: parent.width
+ property bool viewRepos: statsView.viewRepos
+ property double factor: ( statsView.max - installations ) / statsView.max
+ property double perc: ( installations / statsView.sum * 100).toPrecision(2)
+ property double cutoff: viewRepos ? 1.0 : 0.1
+ property color barColor: viewRepos ? Theme.highlightBackgroundColor : Theme.secondaryHighlightColor
+ Row { width: parent.width
+ Label { text: ((name === "__OTHERS") ? qsTr("others", "things that don't fit in a category") : name) + ": "; color: Theme.secondaryColor }
+ Label { text: qsTr("%L1", "number of events").arg(installations) + " " + qsTr("(%L1%)", "percentage in parentheses, best translate as '(%L1%)'" ).arg(perc)}
+ }
+ Rectangle{ id: bar
+ height: Theme.paddingLarge * 1.5
+ anchors.verticalCenter: parent.verticalCenter
+ color: parent.perc > parent.cutoff ? parent.barColor : Theme.secondaryColor
+ gradient: Gradient {
+ GradientStop { position: 0.0; color: "transparent" }
+ GradientStop { position: 0.5; color: bar.color }
+ GradientStop { position: 1.0; color: "transparent" }
+ }
+ width: !visible ? 0 : Math.max(Theme.paddingSmall, (name === "__OTHERS") ? parent.width * perc /100 : parent.width - parent.width * parent.factor)
+ Behavior on width { NumberAnimation{ from: 0; duration: 750 } }
+ }
+ }
+ }
+ }
+ }
+ /*
+ * transform the history data model into a sorted model containing count and name
+ *
+ * ex: fillModel(myListModel, "install", "appName", 10)
+ *
+ * ListModel myListModel: the model to fill
+ * string action: the key in the original model to count
+ * string modelProperty: the key in the original model to set as name
+ * int cutoff: number of actions to sum up as "others"
+ *
+ */
+ function fillModel(listModel, action, modelProperty, cutoff) {
+ console.debug("Filling statistics model");
+ console.time("Filling model took");
+ const sum = 0;
+ const cutoffCount = 0;
+ if (cutoff === undefined) { cutoff = 10; }
+ // get the source values from historymodel
+ var arr = [];
+ for (var i = 0; i < appHistoryModel.count; i++) {
+ if (appHistoryModel.get(i).action == action)
+ arr.push(appHistoryModel.get(i)[modelProperty]);
+ }
+ // we get an obj of objs which we can not sort
+ const model = {};
+ model = statsPage.countUnique(arr);
+ // so push it into something sortable
+ const sortable = [];
+ for (var key in model) { sortable.push([key, model[key]]); }
+ // sort descending ;)
+ sortable.sort(function(a, b) { return - ( a[1] - b[1]); });
+ // gather values
+ for (var i=0; i < sortable.length ; i++) {
+ var e = sortable[i]; // e is a tuple
+ if (e[0] === "") continue; // uninstall events have empty repo names
+ sum += e[1] // count, TODO: move to array.reduce()
+ if ( e[1] > cutoff) {
+ listModel.append({ "installations": e[1], "name": e[0]});
+ } else {
+ cutoffCount++;
+ }
+ }
+ // special string to use later for translations
+ listModel.append({ "installations": cutoffCount, "name": "__OTHERS"});
+ listModel.sum = sum;
+ listModel.max = sortable[0][1]; // should be the highest value, right?
+ listModel.loading = false;
+ console.timeEnd("Filling model took");
+ }
+
+
+ /*
+ // https://www.tutorialspoint.com/unique-sort-removing-duplicates-and-sorting-an-array-in-javascript
+ function uniqSort(arr){
+ const map = {};
+ const res = [];
+ for (i = 0; i < arr.length; i++) {
+ if (!map[arr[i]]) {
+ map[arr[i]] = true;
+ res.push(arr[i]);
+ }
+ }
+ return res.sort(function(a,b) { return a - b } );
+ }
+ */
+
+ // https://www.tutorialspoint.com/counting-unique-elements-in-an-array-in-javascript
+ function countUnique(arr) {
|
[-]
[+]
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/translations/settings-install-history-de.ts
^
|
@@ -106,4 +106,85 @@
</translation>
</message>
</context>
+<context>
+ <name>StatsPage</name>
+ <message>
+ <source>Install History</source>
+ <translation>Installationsverlauf</translation>
+ </message>
+ <message>
+ <source>Statistics</source>
+ <translation>Statistiken</translation>
+ </message>
+ <message>
+ <source>Installations: %L1</source>
+ <translation type="vanished">Installationen: %L1</translation>
+ </message>
+ <message>
+ <source>(%L1%)</source>
+ <translation type="vanished">(L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%)</source>
+ <comment>percentage in parentheses</comment>
+ <translation type="vanished">(L1%)</translation>
+ </message>
+ <message numerus="yes">
+ <source>Installation(s): %Ln</source>
+ <comment>very, very unlikely to have one or less, still, plurals please!</comment>
+ <translation type="vanished">
+ <numerusform>Installation</numerusform>
+ <numerusform>Installationen</numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>View repositories</source>
+ <translation>Quellen anzeigen</translation>
+ </message>
+ <message>
+ <source>Active packages</source>
+ <translation>Paketaktivitäten</translation>
+ </message>
+ <message>
+ <source>View packages</source>
+ <translation>Pakete anzeigen</translation>
+ </message>
+ <message>
+ <source>Percentages are relative to all recorded installation events. Bars are relative to the item with the highest event count.</source>
+ <translation>Prozentangaben relativ zu allen Installationsereignissen. Balken relativ zum Element mit der höchsten Anzahl an Ereignissen.</translation>
+ </message>
+ <message>
+ <source>Repositories</source>
+ <translation>Quellen</translation>
+ </message>
+ <message>
+ <source>others</source>
+ <comment>things that don't fit in a category</comment>
+ <translation>sonstige</translation>
+ </message>
+ <message>
+ <source>%L1</source>
+ <comment>number of events</comment>
+ <translation>%L1</translation>
+ </message>
+ <message>
+ <source>Crunching Numbers…</source>
+ <translation>Berechne…</translation>
+ </message>
+ <message>
+ <source>(%L1%%)</source>
+ <comment>percentage in parentheses</comment>
+ <translation type="vanished">(%L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation type="vanished">(%L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation type="unfinished">(L1%)</translation>
+ </message>
+</context>
</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/translations/settings-install-history-en.ts
^
|
@@ -58,7 +58,7 @@
<message numerus="yes">
<source>%Ln event(s)</source>
<comment>very, very unlikely to have only one, still, plurals please!</comment>
- <translation type="unfinished">
+ <translation>
<numerusform>%Ln event</numerusform>
<numerusform>%Ln events</numerusform>
</translation>
@@ -82,4 +82,72 @@
<translation type="unfinished"></translation>
</message>
</context>
+<context>
+ <name>StatsPage</name>
+ <message>
+ <source>Install History</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message numerus="yes">
+ <source>Installation(s): %Ln</source>
+ <comment>very, very unlikely to have one or less, still, plurals please!</comment>
+ <translation type="obsolete">
+ <numerusform>Installation: %Ln</numerusform>
+ <numerusform>Installations: %Ln</numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>View repositories</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Active packages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>View packages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Percentages are relative to all recorded installation events. Bars are relative to the item with the highest event count.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Repositories</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>others</source>
+ <comment>things that don't fit in a category</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%L1</source>
+ <comment>number of events</comment>
+ <translation>%L1</translation>
+ </message>
+ <message>
+ <source>Crunching Numbers…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(%L1%%)</source>
+ <comment>percentage in parentheses</comment>
+ <translation type="vanished">(%L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation type="vanished">(%L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation>(%L1%)</translation>
+ </message>
+</context>
</TS>
|
[-]
[+]
|
Added |
_service:tar_git:install-history-0.9.12.tar.gz/translations/settings-install-history-ru.ts
^
|
@@ -0,0 +1,155 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.1" language="ru">
+<context>
+ <name>MainPage</name>
+ <message>
+ <source>Package</source>
+ <translation>Пакет</translation>
+ </message>
+ <message>
+ <source>Version</source>
+ <translation>Версия</translation>
+ </message>
+ <message>
+ <source>Installed</source>
+ <translation>Установлен</translation>
+ </message>
+ <message>
+ <source>Removed</source>
+ <translation>Удалён</translation>
+ </message>
+ <message>
+ <source>Repository</source>
+ <translation>Репозиторий</translation>
+ </message>
+ <message>
+ <source>n/a</source>
+ <translation>нет</translation>
+ </message>
+ <message>
+ <source>Hide search</source>
+ <translation>Скрыть поиск</translation>
+ </message>
+ <message>
+ <source>Search by Date</source>
+ <translation>Искать по дате</translation>
+ </message>
+ <message>
+ <source>Search by Name</source>
+ <translation>Искать по названию</translation>
+ </message>
+ <message>
+ <source>Install History</source>
+ <translation>История установки приложений</translation>
+ </message>
+ <message>
+ <source>Date</source>
+ <translation>Дата</translation>
+ </message>
+ <message>
+ <source>Name</source>
+ <translation>Название</translation>
+ </message>
+ <message>
+ <source>Search on %1</source>
+ <translation>Поиск в %1</translation>
+ </message>
+ <message numerus="yes">
+ <source>%Ln event(s)</source>
+ <comment>very, very unlikely to have only one, still, plurals please!</comment>
+ <translation>
+ <numerusform>%Ln действие</numerusform>
+ <numerusform>%Ln действий</numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>Verbose Display</source>
+ <translation>Обычный список</translation>
+ </message>
+ <message>
+ <source>Reduced Display</source>
+ <translation>Компактный список</translation>
+ </message>
+ <message>
+ <source>local</source>
+ <comment>name for a local repo</comment>
+ <translation>local</translation>
+ </message>
+ <message>
+ <source>local</source>
+ <comment>type of a local repo</comment>
+ <translation>локальный</translation>
+ </message>
+</context>
+<context>
+ <name>StatsPage</name>
+ <message>
+ <source>Install History</source>
+ <translation>История установки приложений</translation>
+ </message>
+ <message>
+ <source>Statistics</source>
+ <translation>Статистика</translation>
+ </message>
+ <message numerus="yes">
+ <source>Installation(s): %Ln</source>
+ <comment>very, very unlikely to have one or less, still, plurals please!</comment>
+ <translation type="obsolete">
+ <numerusform>Установлен: %Ln</numerusform>
+ <numerusform>Установлено: %Ln</numerusform>
+ <numerusform></numerusform>
+ </translation>
+ </message>
+ <message>
+ <source>View repositories</source>
+ <translation>Просмотр репозиториев</translation>
+ </message>
+ <message>
+ <source>Active packages</source>
+ <translation>Активные пакеты</translation>
+ </message>
+ <message>
+ <source>View packages</source>
+ <translation>Просмотр пакетов</translation>
+ </message>
+ <message>
+ <source>Percentages are relative to all recorded installation events. Bars are relative to the item with the highest event count.</source>
+ <translation>Процент считается от числа всех действий по установке пакетов. Полоски соотносятся с данными пакета, с которым совершено наибольшее число действий.</translation>
+ </message>
+ <message>
+ <source>Repositories</source>
+ <translation>Репозитории</translation>
+ </message>
+ <message>
+ <source>others</source>
+ <comment>things that don't fit in a category</comment>
+ <translation>прочее</translation>
+ </message>
+ <message>
+ <source>%L1</source>
+ <comment>number of events</comment>
+ <translation>%L1</translation>
+ </message>
+ <message>
+ <source>Crunching Numbers…</source>
+ <translation>Идёт подсчет_</translation>
+ </message>
+ <message>
+ <source>(%L1%%)</source>
+ <comment>percentage in parentheses</comment>
+ <translation type="vanished">(%L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation type="vanished">(%L1%)</translation>
+ </message>
+ <message>
+ <source>(%L1%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation>%L1%</translation>
+ </message>
+</context>
+</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:install-history-0.9.12.tar.gz/translations/settings-install-history-sv.ts
^
|
@@ -102,4 +102,54 @@
</translation>
</message>
</context>
+<context>
+ <name>StatsPage</name>
+ <message>
+ <source>Install History</source>
+ <translation type="unfinished">Installationshistorik</translation>
+ </message>
+ <message>
+ <source>Statistics</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>View repositories</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Active packages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>View packages</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Percentages are relative to all recorded installation events. Bars are relative to the item with the highest event count.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Repositories</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>others</source>
+ <comment>things that don't fit in a category</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>%L1</source>
+ <comment>number of events</comment>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Crunching Numbers…</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>(%L1%)</source>
+ <comment>percentage in parentheses, best translate as '(%L1%)'</comment>
+ <translation>(%L1%)</translation>
+ </message>
+</context>
</TS>
|
[-]
[+]
|
Changed |
_service:tar_git:install-history.yaml
^
|
@@ -1,6 +1,6 @@
Name: install-history
Summary: Shows when packages have been installed or uninstalled
-Version: 0.9.11
+Version: 0.9.12
Release: 1
Group: Applications
License: MIT
|