Commit 6b108687 authored by Andrea Scarpino's avatar Andrea Scarpino

Display current provider in main window

Also fix settings not being saved.
parent cc027eb6
......@@ -78,7 +78,14 @@ Page {
width: parent.width - Theme.horizontalPageMargin * 2
PageHeader {
title: qsTr("Lyrics")
title: "Lyrics"
}
Label {
id: poweredBy
width: parent.width
font.pixelSize: Theme.fontSizeTiny
horizontalAlignment: Text.AlignRight
}
TextField {
......@@ -138,4 +145,10 @@ Page {
search.enabled = false;
manager.search(artist.text, song.text);
}
onStatusChanged: {
if (status === PageStatus.Active) {
poweredBy.text = qsTr("Powered by %1").arg(manager.getProvider());
}
}
}
......@@ -39,7 +39,7 @@ Page {
ComboBox {
id: provider
width: parent.width
label: "Provider"
label: qsTr("Provider")
menu: ContextMenu {
......
* Fri Jul 17 2015 Andrea Scarpino <me@andreascarpino.it> 0.3.1-1
- Display current provider in main window.
- Fix settings not being saved.
* Sat Jul 11 2015 Andrea Scarpino <me@andreascarpino.it> 0.3-1
- Allow to switch between lyric providers.
- Add Genius.com support.
......
......@@ -13,7 +13,7 @@ Name: harbour-lyrics
%{!?qtc_make:%define qtc_make make}
%{?qtc_builddir:%define _builddir %qtc_builddir}
Summary: Music lyrics application
Version: 0.3
Version: 0.3.1
Release: 1
Group: Qt/Qt
License: MIT
......
Name: harbour-lyrics
Summary: Music lyrics application
Version: 0.3
Version: 0.3.1
Release: 1
# 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
......
......@@ -39,7 +39,7 @@ LyricsManager::LyricsManager(QObject *parent) :
{
settings = new QSettings("it.andreascarpino", QCoreApplication::applicationName(), this);
setProvider(settings->property("Provider").toString());
setProvider(settings->value("Provider").toString());
}
LyricsManager::~LyricsManager()
......@@ -55,7 +55,7 @@ QString LyricsManager::getProvider() const
const QString className = api->metaObject()->className();
if (className.compare(QStringLiteral("ChartLyricsAPI")) == 0) {
provider = "ChartLyrics";
} else if (className.compare(QStringLiteral("Genius")) == 0) {
} else if (className.compare(QStringLiteral("GeniusAPI")) == 0) {
provider = "Genius";
} else {
provider = "LyricsWiki";
......@@ -84,7 +84,7 @@ void LyricsManager::setProvider(const QString &provider)
}
qDebug() << "Setting default provider to" << p;
settings->setProperty("Provider", p);
settings->setValue("Provider", p);
}
void LyricsManager::search(const QString &artist, const QString &song)
......
......@@ -14,22 +14,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="81"/>
<source>Lyrics</source>
<location filename="../qml/pages/MainPage.qml" line="151"/>
<source>Powered by %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="88"/>
<location filename="../qml/pages/MainPage.qml" line="95"/>
<source>Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="97"/>
<location filename="../qml/pages/MainPage.qml" line="104"/>
<source>Song</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="111"/>
<location filename="../qml/pages/MainPage.qml" line="118"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
......@@ -41,5 +41,10 @@
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="42"/>
<source>Provider</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
......@@ -14,22 +14,22 @@
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="81"/>
<source>Lyrics</source>
<location filename="../qml/pages/MainPage.qml" line="151"/>
<source>Powered by %1</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="88"/>
<location filename="../qml/pages/MainPage.qml" line="95"/>
<source>Artist</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="97"/>
<location filename="../qml/pages/MainPage.qml" line="104"/>
<source>Song</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/MainPage.qml" line="111"/>
<location filename="../qml/pages/MainPage.qml" line="118"/>
<source>Search</source>
<translation type="unfinished"></translation>
</message>
......@@ -41,5 +41,10 @@
<source>Settings</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../qml/pages/Settings.qml" line="42"/>
<source>Provider</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment