Fix blanking screen and first localization

This commit is contained in:
Claudio Maradonna 2019-08-27 13:07:07 +02:00
parent fcd87e366b
commit 23d2f8aa0c
Signed by: claudiomaradonna
GPG Key ID: 57175942B4134838
11 changed files with 215 additions and 143 deletions

View File

@ -10,6 +10,10 @@ Designers
--------- ---------
- Stefano Amandonico (info@grafixprint.it) - Stefano Amandonico (info@grafixprint.it)
Externals
---------
A grateful thanks to [jgibbon/slumber](https://github.com/jgibbon/slumber) for SleepBlank.qml to help fix ScreenBlanking issue.
License License
------- -------
Licensed under GPLv3 (see COPYING). Licensed under GPLv3 (see COPYING).

View File

@ -4,8 +4,9 @@ DEFINES += APP_VERSION=\\\"$$VERSION\\\"
DEFINES += APP_RELEASE=\\\"$$RELEASE\\\" DEFINES += APP_RELEASE=\\\"$$RELEASE\\\"
CONFIG += sailfishapp CONFIG += sailfishapp
CONFIG += sailfishapp_i18n
QT += multimedia QT += core qml multimedia dbus
SOURCES += src/harbour-boxing-timer.cpp \ SOURCES += src/harbour-boxing-timer.cpp \
src/boxingtimer.cpp \ src/boxingtimer.cpp \
@ -15,10 +16,10 @@ OTHER_FILES += qml/harbour-boxing-timer.qml \
qml/cover/CoverPage.qml \ qml/cover/CoverPage.qml \
rpm/harbour-boxing-timer.spec \ rpm/harbour-boxing-timer.spec \
rpm/harbour-boxing-timer.yaml \ rpm/harbour-boxing-timer.yaml \
translations/*.ts \ harbour-boxing-timer.desktop \
harbour-boxing-timer.desktop translations/*.ts
SAILFISHAPP_ICONS += 86x86 108x108 128x128 256x256 SAILFISHAPP_ICONS += 86x86 108x108 128x128 172x172 256x256
# to disable building translations every time, comment out the # to disable building translations every time, comment out the
# following CONFIG line # following CONFIG line
@ -31,6 +32,7 @@ SAILFISHAPP_ICONS += 86x86 108x108 128x128 256x256
# TRANSLATIONS += translations/harbour-boxing-timer-de.ts # TRANSLATIONS += translations/harbour-boxing-timer-de.ts
DISTFILES += \ DISTFILES += \
qml/ScreenBlank.qml \
qml/pages/TimerPage.qml \ qml/pages/TimerPage.qml \
qml/pages/SettingsPage.qml \ qml/pages/SettingsPage.qml \
qml/pages/js/converter.js \ qml/pages/js/converter.js \
@ -43,6 +45,7 @@ DISTFILES += \
icons/86x86/harbour-boxing-timer.png \ icons/86x86/harbour-boxing-timer.png \
icons/108x108/harbour-boxing-timer.png \ icons/108x108/harbour-boxing-timer.png \
icons/128x128/harbour-boxing-timer.png \ icons/128x128/harbour-boxing-timer.png \
icons/172x172/harbour-boxing-timer.png \
icons/256x256/harbour-boxing-timer.png icons/256x256/harbour-boxing-timer.png
HEADERS += \ HEADERS += \
@ -51,3 +54,6 @@ HEADERS += \
RESOURCES += \ RESOURCES += \
harbour-boxing-timer.qrc harbour-boxing-timer.qrc
TRANSLATIONS += \
translations/harbour-boxing-timer.ts

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

41
qml/ScreenBlank.qml Normal file
View File

@ -0,0 +1,41 @@
import QtQuick 2.0
import Nemo.DBus 2.0
Item {
property bool enabled: false
function request(){
var method = "req_display"+(enabled?"":"_cancel")+"_blanking_pause";
console.log('screen blank:', enabled, method);
dbif.call(method, [])
}
onEnabledChanged: {
request();
}
DBusInterface {
id: dbif
service: "com.nokia.mce"
path: "/com/nokia/mce/request"
iface: "com.nokia.mce.request"
bus: DBusInterface.SystemBus
}
Timer { //request seems to time out after a while:
running: parent.enabled
interval: 15000 //minimum setting for blank display is 15s
repeat: true
onTriggered: {
if(parent.enabled) {
parent.request()
}
}
}
Component.onDestruction: {
if(enabled){
enabled=false
}
}
}

View File

@ -35,6 +35,10 @@ import Pw.Unitoo.Backend 1.0
import "pages" import "pages"
ApplicationWindow { ApplicationWindow {
ScreenBlank {
enabled: true
}
BoxingTimer { BoxingTimer {
id: boxingTimer id: boxingTimer
} }

View File

@ -8,6 +8,9 @@
# * date Author's Name <author's email> version-release # * date Author's Name <author's email> version-release
# - Summary of changes # - Summary of changes
* Thu Aug 27 2019 Claudio Maradonna <claudio@unitoo.pw> 1.2.4-1
- Update for Sailfish X (Tested on Xperia XA2 Plus)
* Fri Sep 08 2017 Claudio Maradonna <claudio@unitoo.pw> 1.2.3-4 * Fri Sep 08 2017 Claudio Maradonna <claudio@unitoo.pw> 1.2.3-4
- Fixed bug when saving multiple inner timers - Fixed bug when saving multiple inner timers
- Fixed bug when change presets and rounds done > 0 - Fixed bug when change presets and rounds done > 0

View File

@ -13,8 +13,8 @@ Name: harbour-boxing-timer
%{!?qtc_make:%define qtc_make make} %{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir} %{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Boxing timer Summary: Boxing timer
Version: 1.2.3 Version: 1.2.4
Release: 4 Release: 1
Group: Applications/Utilities Group: Applications/Utilities
License: GPLv3 License: GPLv3
URL: https://github.com/UnitooTeam/harbour-boxing-timer URL: https://github.com/UnitooTeam/harbour-boxing-timer
@ -69,6 +69,7 @@ desktop-file-install --delete-original \
%{_datadir}/icons/hicolor/86x86/apps/%{name}.png %{_datadir}/icons/hicolor/86x86/apps/%{name}.png
%{_datadir}/icons/hicolor/108x108/apps/%{name}.png %{_datadir}/icons/hicolor/108x108/apps/%{name}.png
%{_datadir}/icons/hicolor/128x128/apps/%{name}.png %{_datadir}/icons/hicolor/128x128/apps/%{name}.png
%{_datadir}/icons/hicolor/172x172/apps/%{name}.png
%{_datadir}/icons/hicolor/256x256/apps/%{name}.png %{_datadir}/icons/hicolor/256x256/apps/%{name}.png
# >> files # >> files
# << files # << files

View File

@ -1,7 +1,7 @@
Name: harbour-boxing-timer Name: harbour-boxing-timer
Summary: Boxing timer Summary: Boxing timer
Version: 1.2.3 Version: 1.2.4
Release: 4 Release: 1
# The contents of the Group field should be one of the groups listed here: # The contents of the Group field should be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS # http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
Group: Applications/Utilities Group: Applications/Utilities
@ -42,6 +42,7 @@ Files:
- '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png' - '%{_datadir}/icons/hicolor/86x86/apps/%{name}.png'
- '%{_datadir}/icons/hicolor/108x108/apps/%{name}.png' - '%{_datadir}/icons/hicolor/108x108/apps/%{name}.png'
- '%{_datadir}/icons/hicolor/128x128/apps/%{name}.png' - '%{_datadir}/icons/hicolor/128x128/apps/%{name}.png'
- '%{_datadir}/icons/hicolor/172x172/apps/%{name}.png'
- '%{_datadir}/icons/hicolor/256x256/apps/%{name}.png' - '%{_datadir}/icons/hicolor/256x256/apps/%{name}.png'
# For more information about yaml and what's supported in Sailfish OS # For more information about yaml and what's supported in Sailfish OS

View File

@ -1,88 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1">
<context>
<name>CoverPage</name>
<message>
<source>My Cover</source>
<translation>Mein Cover</translation>
</message>
</context>
<context>
<name>PresetList</name>
<message>
<source>Saved presets</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
<message>
<source>Save</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Delete</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Round&apos;s settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Preset name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duration</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rest</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Total rounds</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>TimerPage</name>
<message>
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Stop</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Reset</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Round</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Pause</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Boxing timer</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

Binary file not shown.

View File

@ -1,88 +1,188 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS> <!DOCTYPE TS>
<TS version="2.1"> <TS version="2.1" language="it_IT" sourcelanguage="en">
<context> <context>
<name>CoverPage</name> <name>AboutPage</name>
<message> <message>
<source>My Cover</source> <source>About</source>
<translation type="unfinished"></translation> <translation>Chi siamo</translation>
</message>
<message>
<source>
&quot;Boxing Timer&quot; is a customizable timer for fighting sports like boxe.
You can set duration, rest and number of rounds. If you set 0 rounds, timer loops and count number of rounds.
You can add inner timers too.
You can save, load and delete your settings giving a name to them.
</source>
<translation>
&quot;Boxing Timer&quot; è un timer personalizzabile per gli sport da combattimento come la boxe.
Puoi personalizzare la durata, il riposo e il numero di round. Se imposti 0 round, il timer va in loop e conta il numero di round effettuati.
Puoi creare anche dei round intermedi.
Puoi salvare, caricare e cancellare le tue impostazioni impostando un nome a esse.
</translation>
</message>
<message>
<source>Developers and sources</source>
<translation>Sviluppatori e sorgenti</translation>
</message>
<message>
<source>
Copyright (C) 2017 Claudio Maradonna
Unitoo Team, Italy
Sources at: https://github.com/UnitooTeam/harbour-boxing-timer
</source>
<translation>
Copyright (C) 2017 Claudio Maradonna
Unitoo Team, Italia
Sorgenti: https://github.com/UnitooTeam/harbour-boxing-timer
</translation>
</message>
<message>
<source>Artists</source>
<translation>Artisti</translation>
</message>
<message>
<source>
Stefano Amandonico
GrafixPrint, Italy
info@grafixprint.it
http://www.grafixprint.it
</source>
<translation>
Stefano Amandonico
GrafixPrint, Italia
info@grafixprint.it
http://www.grafixprint.it
</translation>
</message>
<message>
<source>License</source>
<translation>Licenza</translation>
</message>
<message>
<source>
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 3 of the License, or
(at your option) any later version.&lt;br&gt;&lt;br&gt;
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.&lt;br&gt;&lt;br&gt;
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;a href=&quot;http://www.gnu.org/licenses&quot;&gt;http://www.gnu.org/licenses&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;br&gt;
All artworks are licensed under a &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;Creative Commons Attribution-ShareAlike 4.0 International&lt;/a&gt;
</source>
<translation>
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 3 of the License, or
(at your option) any later version.&lt;br&gt;&lt;br&gt;
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.&lt;br&gt;&lt;br&gt;
You should have received a copy of the GNU General Public License
along with this program. If not, see &lt;a href=&quot;http://www.gnu.org/licenses&quot;&gt;http://www.gnu.org/licenses&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;br&gt;
All artworks are licensed under a &lt;a href=&quot;https://creativecommons.org/licenses/by-sa/4.0/&quot;&gt;Creative Commons Attribution-ShareAlike 4.0 International&lt;/a&gt;
</translation>
</message> </message>
</context> </context>
<context> <context>
<name>PresetList</name> <name>PresetList</name>
<message> <message>
<source>Saved presets</source> <source>Saved presets</source>
<translation type="unfinished"></translation> <translation>Presets salvati</translation>
</message>
<message>
<source>Deleting</source>
<translation>Sto eliminando</translation>
</message>
<message>
<source>Delete</source>
<translation>Elimina</translation>
</message> </message>
</context> </context>
<context> <context>
<name>SettingsPage</name> <name>SettingsPage</name>
<message> <message>
<source>Save</source> <source>Save</source>
<translation type="unfinished"></translation> <translation>Salva</translation>
</message> </message>
<message> <message>
<source>Delete</source> <source>Add inner time</source>
<translation type="unfinished"></translation> <translation>Aggiungi tempo intermedio</translation>
</message> </message>
<message> <message>
<source>Round&apos;s settings</source> <source>Remove last inner time</source>
<translation type="unfinished"></translation> <translation>Rimuovi ultimo tempo intermedio</translation>
</message>
<message>
<source>Preset name</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Duration</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Rest</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Total rounds</source>
<translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation>Impostazioni</translation>
</message>
<message>
<source>Round&apos;s settings</source>
<translation>Impostazioni del round</translation>
</message>
<message>
<source>Preset name</source>
<translation>Nome del preset</translation>
</message>
<message>
<source>Duration</source>
<translation>Durata</translation>
</message>
<message>
<source>Rest</source>
<translation>Riposo</translation>
</message>
<message>
<source>Total rounds</source>
<translation>Totale round</translation>
</message>
<message>
<source>Inner timers</source>
<translation>Tempi intermedi</translation>
</message> </message>
</context> </context>
<context> <context>
<name>TimerPage</name> <name>TimerPage</name>
<message>
<source>About</source>
<translation>Chi siamo</translation>
</message>
<message> <message>
<source>Settings</source> <source>Settings</source>
<translation type="unfinished"></translation> <translation>Impostazioni</translation>
</message> </message>
<message> <message>
<source>Stop</source> <source>Stop</source>
<translation type="unfinished"></translation> <translation>Stop</translation>
</message> </message>
<message> <message>
<source>Reset</source> <source>Reset</source>
<translation type="unfinished"></translation> <translation>Resetta</translation>
</message>
<message>
<source>Round</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Start</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>About</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Pause</source>
<translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>Boxing timer</source> <source>Boxing timer</source>
<translation type="unfinished"></translation> <translation>Boxing timer</translation>
</message> </message>
</context> </context>
</TS> </TS>