Skip to content

Commit

Permalink
Better handling of longer texts in cover
Browse files Browse the repository at this point in the history
  • Loading branch information
scharel committed Jun 16, 2014
1 parent 5f06040 commit 3cdea37
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 15 deletions.
8 changes: 4 additions & 4 deletions qml/content/FeedData.qml
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,20 @@ ListModel {
function load() {
nUnSeen = 0
clear()
console.log("Loading content from local storage")
//console.log("Loading content from local storage")
var count = settings.value("content/count", 0)
if (count > 0)
{
console.log(count + " episodes in local storage")
//console.log(count + " episodes in local storage")
var seasons = settings.value("content/seasons", 0)
if (seasons > 0)
{
console.log(seasons + " seasons in local storage")
//console.log(seasons + " seasons in local storage")
for (var actSeason = seasons; actSeason > 0; actSeason--)
{
var episodes = settings.value("content/" + actSeason + "/episodes", 0)
if (episodes > 0) {
console.log(episodes + " episodes in season " + actSeason)
//console.log(episodes + " episodes in season " + actSeason)
for (var actEpisode = episodes; actEpisode > 0; actEpisode--)
{
var noDataString = "NO_DATA"
Expand Down
17 changes: 11 additions & 6 deletions qml/cover/CoverPage.qml
Original file line number Diff line number Diff line change
Expand Up @@ -44,41 +44,46 @@ CoverBackground {
Column {
y: 175
x: Theme.paddingSmall
width: parent.width - Theme.paddingSmall
width: parent.width - 2 * Theme.paddingSmall
spacing: Theme.paddingSmall

Label {
id: updatingLabel
visible: feedModel.progress !== 1
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
truncationMode: TruncationMode.Fade
horizontalAlignment: contentWidth < width ? Text.AlignHCenter : Text.AlignLeft
//: While updating feed
text: qsTr("Updating...")
}

Label {
id: playingLabel
visible: !updatingLabel.visible && !player.stopped && !updatingTimer.running
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
truncationMode: TruncationMode.Fade
horizontalAlignment: contentWidth < width ? Text.AlignHCenter : Text.AlignLeft
text: getPrettyNumber(player.season, player.episode) + ": " + settings.value("content/" + player.season + "/" + player.episode + "/title")
}

Label {
id: newEpisodesLabel
visible: !updatingLabel.visible && !playingLabel.visible
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
truncationMode: TruncationMode.Fade
horizontalAlignment: wrapMode === Text.Wrap ? Text.AlignHCenter : Text.AlignLeft
maximumLineCount: 2
wrapMode: player.stopped ? Text.Wrap : Text.NoWrap
//: Number of unseen episodes
text: (nUnSeen === 0 ? qsTr("No") : nUnSeen) + " " + qsTr("unseen Episode") + (nUnSeen > 1 ? qsTr("s") : qsTr(""))
text: (nUnSeen === 0 ? qsTr("No") : nUnSeen) + " " + qsTr("Unseen Episode") + (nUnSeen > 1 ? qsTr("s") : qsTr(""))
}

Label {
id: audioPositionLabel
visible: !player.stopped
anchors.horizontalCenter: parent.horizontalCenter
width: parent.width
truncationMode: TruncationMode.Fade
horizontalAlignment: contentWidth < width ? Text.AlignHCenter : Text.AlignLeft
text: getTimeFromMs(player.position) + "/" + getTimeFromMs(player.duration)
}
}
Expand Down
3 changes: 3 additions & 0 deletions rpm/harbour-badvoltage.changes
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# * date Author's Name <author's email> version-release
# - Summary of changes

* Sun Jun 15 2014 Scharel Clemens <scharelc@gmail.com> 0.2-4
- Better handling of longer texts in cover

* Sun Jun 15 2014 Scharel Clemens <scharelc@gmail.com> 0.2-3
- Showing currently playing episode again in cover

Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-badvoltage.spec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Name: harbour-badvoltage
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Bad Voltage
Version: 0.2
Release: 3
Release: 4
Group: Applications/Internet
License: GNU General Public License
URL: https://github.com/scharel/harbour-badvoltage
Expand Down
2 changes: 1 addition & 1 deletion rpm/harbour-badvoltage.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Name: harbour-badvoltage
Summary: Bad Voltage
Version: 0.2
Release: 3
Release: 4
# The contents of the Group field must be one of the groups listed here:
# http://gitorious.org/meego-developer-tools/spectacle/blobs/master/data/GROUPS
Group: Applications/Internet
Expand Down
2 changes: 1 addition & 1 deletion src/Settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class Settings : public QObject {
_settings->beginGroup("app");
_settings->setValue("url", "http://scharel.github.io/harbour-badvoltage");
_settings->setValue("gitUrl", "https://github.com/scharel/harbour-badvoltage");
_settings->setValue("version", "0.2-3");
_settings->setValue("version", "0.2-4");
_settings->setValue("agent", QString("Bad Voltage for SailfishOS - ").append(_settings->value("version").toString()));
_settings->endGroup();
}
Expand Down
2 changes: 1 addition & 1 deletion translations/harbour-badvoltage-de.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<translation></translation>
</message>
<message>
<source>unseen Episode</source>
<source>Unseen Episode</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down
2 changes: 1 addition & 1 deletion translations/harbour-badvoltage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
<translation></translation>
</message>
<message>
<source>unseen Episode</source>
<source>Unseen Episode</source>
<translation type="unfinished"></translation>
</message>
</context>
Expand Down

0 comments on commit 3cdea37

Please sign in to comment.