From af093bbbfd74a200398e0ff5eb5161a2686805aa Mon Sep 17 00:00:00 2001 From: Mikko Ahlroth Date: Mon, 14 Jul 2014 21:56:04 +0300 Subject: [PATCH] Fix wrong percentage in swap and memory usage, add about section on loads Fixes #7 --- qml/pages/AboutPage.qml | 32 +++++++++++++++++++++++++++++++- qml/pages/FirstPage.qml | 6 +++--- rpm/harbour-sailtime.spec | 4 ++-- rpm/harbour-sailtime.yaml | 4 ++-- 4 files changed, 38 insertions(+), 8 deletions(-) diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml index 121a605..6778b44 100644 --- a/qml/pages/AboutPage.qml +++ b/qml/pages/AboutPage.qml @@ -29,7 +29,7 @@ Page { Label { anchors.horizontalCenter: parent.horizontalCenter - text: "SailTime 1.1.2" + text: "SailTime 1.2.0" color: Theme.highlightColor font.pixelSize: Theme.fontSizeLarge } @@ -62,6 +62,36 @@ Page { anchors.horizontalCenter: parent.horizontalCenter onClicked: Qt.openUrlExternally("https://bitbucket.org/Nicd/sailtime"); } + + Separator { + x: Theme.paddingLarge + width: parent.width - Theme.paddingLarge * 2 + horizontalAlignment: Qt.AlignCenter + color: Theme.highlightColor + } + + PageHeader { + title: "What are load averages?" + } + + + Label { + anchors.horizontalCenter: parent.horizontalCenter + text: "In UNIX computing, the system load is a measure of the amount of \ +computational work that a computer system performs. The load average represents the average \ +system load over a period of time. It conventionally appears in the form of three numbers \ +which represent the system load during the last one-, five-, and fifteen-minute periods." + color: Theme.primaryColor + font.pixelSize: Theme.fontSizeMedium + wrapMode: Text.WordWrap + width: parent.width - Theme.paddingLarge * 2 + } + + Button { + text: "Open Wikipedia description" + anchors.horizontalCenter: parent.horizontalCenter + onClicked: Qt.openUrlExternally("http://en.wikipedia.org/wiki/Load_average"); + } } } } diff --git a/qml/pages/FirstPage.qml b/qml/pages/FirstPage.qml index 1659f80..6a29544 100644 --- a/qml/pages/FirstPage.qml +++ b/qml/pages/FirstPage.qml @@ -52,7 +52,7 @@ Page { memlegend.text = usedram[0].toFixed(2) + " " + usedram[1] + "B/" + totalram[0].toFixed(2) + " " + totalram[1] + "B (" - + (usedram[0] / totalram[0] * 100).toFixed(2) + " %)"; + + (meminuse / sysinfo.totalram * 100).toFixed(2) + " %)"; // Swap bar @@ -67,7 +67,7 @@ Page { swaplegend.text = usedswap_scale[0].toFixed(2) + " " + usedswap_scale[1] + "B/" + totalswap_scale[0].toFixed(2) + " " + totalswap_scale[1] + "B (" - + (usedswap_scale[0] / totalswap_scale[0] * 100).toFixed(2) + " %)"; + + (swapinuse / sysinfo.totalswap * 100).toFixed(2) + " %)"; // Processes amount @@ -112,7 +112,7 @@ Page { // PullDownMenu and PushUpMenu must be declared in SilicaFlickable, SilicaListView or SilicaGridView PullDownMenu { MenuItem { - text: "About..." + text: "About SailTime" onClicked: pageStack.push(aboutpage); } diff --git a/rpm/harbour-sailtime.spec b/rpm/harbour-sailtime.spec index 3bf2c37..dbead43 100644 --- a/rpm/harbour-sailtime.spec +++ b/rpm/harbour-sailtime.spec @@ -13,11 +13,11 @@ Name: harbour-sailtime %{!?qtc_make:%define qtc_make make} %{?qtc_builddir:%define _builddir %qtc_builddir} Summary: SailTime -Version: 1.1.2 +Version: 1.2.0 Release: 1 Group: Qt/Qt License: MIT Expat licence -URL: http://example.org/ +URL: https://bitbucket.org/Nicd/sailtime/ Source0: %{name}-%{version}.tar.bz2 Source100: harbour-sailtime.yaml Requires: sailfishsilica-qt5 >= 0.10.9 diff --git a/rpm/harbour-sailtime.yaml b/rpm/harbour-sailtime.yaml index a96a5bd..f2d34f7 100644 --- a/rpm/harbour-sailtime.yaml +++ b/rpm/harbour-sailtime.yaml @@ -1,9 +1,9 @@ Name: harbour-sailtime Summary: SailTime -Version: 1.1.2 +Version: 1.2.0 Release: 1 Group: Qt/Qt -URL: http://example.org/ +URL: https://bitbucket.org/Nicd/sailtime/ License: "MIT Expat licence" Sources: - '%{name}-%{version}.tar.bz2'