1
0
mirror of https://github.com/clementine-player/Clementine synced 2025-02-03 20:57:35 +01:00

Clean up the background streams settings page a bit, and use a different icon

This commit is contained in:
David Sansome 2010-12-04 15:11:50 +00:00
parent b67bc3939a
commit f94f2cd03c
43 changed files with 164 additions and 45 deletions

View File

@ -25,9 +25,8 @@ void BackgroundStreams::LoadStreams() {
int version = s.value("version", 0).toInt(); int version = s.value("version", 0).toInt();
if (version < kVersion) { if (version < kVersion) {
s.setValue("version", kVersion); s.setValue("version", kVersion);
// TODO: Make these robust against translations. AddStream(QT_TR_NOOP("Hypnotoad"), QUrl(kHypnotoadUrl));
AddStream(tr("Hypnotoad"), QUrl(kHypnotoadUrl)); AddStream(QT_TR_NOOP("Rain"), QUrl(kRainUrl));
AddStream(tr("Rain"), QUrl(kRainUrl));
SaveStreams(); SaveStreams();
return; return;
} }
@ -115,16 +114,15 @@ bool BackgroundStreams::IsPlaying(const QString& name) {
} }
void BackgroundStreams::MakeItRain(bool enable) { void BackgroundStreams::MakeItRain(bool enable) {
if (!streams_.contains(tr("Rain"))) { if (!streams_.contains("Rain")) {
AddStream(tr("Rain"), QUrl(kRainUrl)); AddStream("Rain", QUrl(kRainUrl));
} }
EnableStream(tr("Rain"), enable); EnableStream("Rain", enable);
} }
void BackgroundStreams::AllGloryToTheHypnotoad(bool enable) { void BackgroundStreams::AllGloryToTheHypnotoad(bool enable) {
if (!streams_.contains(tr("Hypnotoad"))) { if (!streams_.contains("Hypnotoad")) {
AddStream(tr("Hypnotoad"), QUrl(kHypnotoadUrl)); AddStream("Hypnotoad", QUrl(kHypnotoadUrl));
} }
EnableStream(tr("Hypnotoad"), enable); EnableStream("Hypnotoad", enable);
} }

View File

@ -1,9 +1,9 @@
#ifndef BACKGROUNDSTREAMS_H #ifndef BACKGROUNDSTREAMS_H
#define BACKGROUNDSTREAMS_H #define BACKGROUNDSTREAMS_H
#include <QList>
#include <QMap> #include <QMap>
#include <QObject> #include <QObject>
#include <QStringList>
#include <QUrl> #include <QUrl>
#include "engines/engine_fwd.h" #include "engines/engine_fwd.h"
@ -17,7 +17,7 @@ class BackgroundStreams : public QObject {
void LoadStreams(); void LoadStreams();
void SaveStreams(); void SaveStreams();
QList<QString> streams() const { return streams_.keys(); } QStringList streams() const { return streams_.keys(); }
void EnableStream(const QString& name, bool enable); void EnableStream(const QString& name, bool enable);
void SetStreamVolume(const QString& name, int volume); void SetStreamVolume(const QString& name, int volume);

View File

@ -2306,6 +2306,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2310,6 +2310,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2348,6 +2348,9 @@ msgstr ""
"Pots sentir cançons de Magnatune gratuïtament sense compte. Comprant una " "Pots sentir cançons de Magnatune gratuïtament sense compte. Comprant una "
"afiliació s'eliminaran els missatges al final de cada pista." "afiliació s'eliminaran els missatges al final de cada pista."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2310,6 +2310,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2306,6 +2306,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2313,6 +2313,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2357,6 +2357,9 @@ msgstr ""
"Ende der einzelnen Stücke zu entfernen, müssen Sie eine Mitgliedschaft " "Ende der einzelnen Stücke zu entfernen, müssen Sie eine Mitgliedschaft "
"kaufen." "kaufen."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2370,6 +2370,9 @@ msgstr ""
"Μπορείτε να ακούσετε τραγούδια δωρεάν από το Magnatune χωρίς λογαριασμό. Η " "Μπορείτε να ακούσετε τραγούδια δωρεάν από το Magnatune χωρίς λογαριασμό. Η "
"αγορά μιας συνδρομής αφαιρεί το μήνυμα από το τέλος κάθε κομματιού." "αγορά μιας συνδρομής αφαιρεί το μήνυμα από το τέλος κάθε κομματιού."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2311,6 +2311,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2308,6 +2308,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2306,6 +2306,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2365,6 +2365,9 @@ msgstr ""
"Puede escuchar canciones de Magnatune gratis sin la necesidad de una cuenta. " "Puede escuchar canciones de Magnatune gratis sin la necesidad de una cuenta. "
"Comprar una cuenta elimina el mensaje al final de cada canción." "Comprar una cuenta elimina el mensaje al final de cada canción."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2308,6 +2308,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2308,6 +2308,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2370,6 +2370,9 @@ msgstr ""
"Vous pouvez écouter gratuitement les chansons de Magnatune sans avoir un " "Vous pouvez écouter gratuitement les chansons de Magnatune sans avoir un "
"compte. L'achat d'un abonnement supprime le message à la fin de chaque piste." "compte. L'achat d'un abonnement supprime le message à la fin de chaque piste."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2312,6 +2312,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2356,6 +2356,9 @@ msgstr ""
"Hallgathat Magnatune számokat ingyen, előfizetés nélkül. Előfizetés " "Hallgathat Magnatune számokat ingyen, előfizetés nélkül. Előfizetés "
"vásárlása esetén a számvégi üzenetek eltávolításra kerülnek." "vásárlása esetén a számvégi üzenetek eltávolításra kerülnek."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2371,6 +2371,9 @@ msgstr ""
"Il versamento della quota d'iscrizione rimuove i messaggi alla fine di ogni " "Il versamento della quota d'iscrizione rimuove i messaggi alla fine di ogni "
"traccia." "traccia."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2344,6 +2344,9 @@ msgstr ""
"Magnatune の曲はアカウントなしで無料で聴取できます。メンバーシップを購入する" "Magnatune の曲はアカウントなしで無料で聴取できます。メンバーシップを購入する"
"とトラックの最後のメッセージを削除できます。" "とトラックの最後のメッセージを削除できます。"
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2308,6 +2308,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2306,6 +2306,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2321,6 +2321,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2361,6 +2361,9 @@ msgstr ""
"U kunt zonder account gratis naar Magnatunes nummers luisteren. Bij " "U kunt zonder account gratis naar Magnatunes nummers luisteren. Bij "
"lidmaatschap worden de berichten aan aan het eind van elk nummer verwijderd." "lidmaatschap worden de berichten aan aan het eind van elk nummer verwijderd."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2306,6 +2306,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2350,6 +2350,9 @@ msgstr ""
"Możesz słuchać utworów z Magnatune za darmo nie posiadając konta. Opłacenie " "Możesz słuchać utworów z Magnatune za darmo nie posiadając konta. Opłacenie "
"członkostwa usuwa komunikaty na końcu każdej ścieżki." "członkostwa usuwa komunikaty na końcu każdej ścieżki."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2362,6 +2362,9 @@ msgstr ""
"Você pode ouvir as músicas Magnatune sem possuir uma conta. Se aderir ao " "Você pode ouvir as músicas Magnatune sem possuir uma conta. Se aderir ao "
"serviço, a mensagem no final de cada faixa será removida." "serviço, a mensagem no final de cada faixa será removida."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2327,6 +2327,9 @@ msgstr ""
"Você pode ouvir as músicas do Magnatune de graça, sem uma conta. Comprando " "Você pode ouvir as músicas do Magnatune de graça, sem uma conta. Comprando "
"uma assinatura as mensagens no final de cada faixa serão removidas." "uma assinatura as mensagens no final de cada faixa serão removidas."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2307,6 +2307,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2345,6 +2345,9 @@ msgstr ""
"Вы можете слушать песни с Magnatune свободно без регистрации. Регистрация " "Вы можете слушать песни с Magnatune свободно без регистрации. Регистрация "
"убирает сообщения в конце каждой композиции." "убирает сообщения в конце каждой композиции."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2348,6 +2348,9 @@ msgstr ""
"Môžte zadarmo počúvať Magnatune piesne bez účtu. Zakúpenie členstva odstráni " "Môžte zadarmo počúvať Magnatune piesne bez účtu. Zakúpenie členstva odstráni "
"správy na konci každej skladby." "správy na konci každej skladby."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2349,6 +2349,9 @@ msgstr ""
"Skladbe iz Magnatune lahko poslušate brezplačno tudi brez računa. Če plačate " "Skladbe iz Magnatune lahko poslušate brezplačno tudi brez računa. Če plačate "
"članstvo, bodo sporočila na koncu skladb odstranjena." "članstvo, bodo sporočila na koncu skladb odstranjena."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2313,6 +2313,9 @@ msgstr ""
"Можете бесплатно слушати песеме на Магнатјуну без регистровања налога. " "Можете бесплатно слушати песеме на Магнатјуну без регистровања налога. "
"Куповином чланства ослободићете се порука на крају сваке нумере." "Куповином чланства ослободићете се порука на крају сваке нумере."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2347,6 +2347,9 @@ msgstr ""
"Du kan lyssna på Magnatune-låtar gratis utan ett konto. Köp av ett " "Du kan lyssna på Magnatune-låtar gratis utan ett konto. Köp av ett "
"medlemskap tar bort meddelandena i slutet av varje spår." "medlemskap tar bort meddelandena i slutet av varje spår."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2339,6 +2339,9 @@ msgstr ""
"dinleyebilirsiniz. Üyelik alırsanız her şarkının sonunda görünen bu mesajı " "dinleyebilirsiniz. Üyelik alırsanız her şarkının sonunda görünen bu mesajı "
"kaldırabilirsiniz." "kaldırabilirsiniz."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2296,6 +2296,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2343,6 +2343,9 @@ msgstr ""
"Ви можете прослухати композиції з Magnatune безкоштовно і без реєстрації. " "Ви можете прослухати композиції з Magnatune безкоштовно і без реєстрації. "
"Набуття членства дає змогу вилучати повідомлення в кінці кожної композиції." "Набуття членства дає змогу вилучати повідомлення в кінці кожної композиції."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2308,6 +2308,9 @@ msgid ""
"membership removes the messages at the end of each track." "membership removes the messages at the end of each track."
msgstr "" msgstr ""
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -2313,6 +2313,9 @@ msgstr ""
"你可以免費聽Magnatune歌曲,而不需要一個帳戶.而當你購買成為會員時,每首歌曲後的" "你可以免費聽Magnatune歌曲,而不需要一個帳戶.而當你購買成為會員時,每首歌曲後的"
"廣告訊息將刪除." "廣告訊息將刪除."
msgid "You can listen to background streams at the same time as other music."
msgstr ""
msgid "" msgid ""
"You can scrobble tracks for free, but only <span style=\" font-weight:600;" "You can scrobble tracks for free, but only <span style=\" font-weight:600;"
"\">paid subscribers</span> can stream Last.fm radio from Clementine." "\">paid subscribers</span> can stream Last.fm radio from Clementine."

View File

@ -46,43 +46,39 @@
#include <QtDebug> #include <QtDebug>
void SettingsDialog::AddStream(const QString& name) { void SettingsDialog::AddStream(const QString& name) {
QGroupBox* box = new QGroupBox(name, streams_page_); QGroupBox* box = new QGroupBox(tr(name.toUtf8()));
QSlider* slider = new QSlider(Qt::Horizontal, box); QSlider* slider = new QSlider(Qt::Horizontal, box);
QCheckBox* check = new QCheckBox(box); QCheckBox* check = new QCheckBox(box);
QHBoxLayout* layout = new QHBoxLayout(box); QHBoxLayout* layout = new QHBoxLayout(box);
layout->addWidget(slider); layout->addWidget(slider);
layout->addWidget(check); layout->addWidget(check);
streams_layout_->addWidget(box); QVBoxLayout* streams_layout = qobject_cast<QVBoxLayout*>(
ui_->streams_page->layout());
streams_layout->insertWidget(streams_layout->count() - 1, box);
sliders_[slider] = name; slider->setProperty("stream_name", name);
checkboxes_[check] = name; check->setProperty("stream_name", name);
connect(slider, SIGNAL(valueChanged(int)), SLOT(StreamVolumeChanged(int))); connect(slider, SIGNAL(valueChanged(int)), SLOT(StreamVolumeChanged(int)));
connect(check, SIGNAL(stateChanged(int)), SLOT(EnableStream(int))); connect(check, SIGNAL(toggled(bool)), SLOT(EnableStream(bool)));
slider->setValue(streams_->GetStreamVolume(name)); slider->setValue(streams_->GetStreamVolume(name));
check->setCheckState(streams_->IsPlaying(name) ? Qt::Checked : Qt::Unchecked); check->setCheckState(streams_->IsPlaying(name) ? Qt::Checked : Qt::Unchecked);
} }
void SettingsDialog::EnableStream(int state) { void SettingsDialog::EnableStream(bool enabled) {
QCheckBox* check = qobject_cast<QCheckBox*>(sender()); const QString name = sender()->property("stream_name").toString();
Q_ASSERT(check); streams_->EnableStream(name, enabled);
const QString& name = checkboxes_[check];
streams_->EnableStream(name, state == Qt::Checked ? true : false);
} }
void SettingsDialog::StreamVolumeChanged(int value) { void SettingsDialog::StreamVolumeChanged(int value) {
QSlider* slider = qobject_cast<QSlider*>(sender()); const QString name = sender()->property("stream_name").toString();
Q_ASSERT(slider);
const QString& name = sliders_[slider];
streams_->SetStreamVolume(name, value); streams_->SetStreamVolume(name, value);
} }
void SettingsDialog::AddStreams() { void SettingsDialog::AddStreams() {
const QList<QString>& streams = streams_->streams(); foreach (const QString& name, streams_->streams()) {
foreach (const QString& name, streams) {
AddStream(name); AddStream(name);
} }
} }
@ -91,8 +87,6 @@ SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent)
: QDialog(parent), : QDialog(parent),
gst_engine_(NULL), gst_engine_(NULL),
ui_(new Ui_SettingsDialog), ui_(new Ui_SettingsDialog),
streams_page_(new QWidget(this)),
streams_layout_(new QVBoxLayout(streams_page_)),
loading_settings_(false), loading_settings_(false),
pretty_popup_(new OSDPretty(OSDPretty::Mode_Draggable)), pretty_popup_(new OSDPretty(OSDPretty::Mode_Draggable)),
streams_(streams) streams_(streams)
@ -107,14 +101,9 @@ SettingsDialog::SettingsDialog(BackgroundStreams* streams, QWidget* parent)
ui_->list->item(Page_GlobalShortcuts)->setIcon(IconLoader::Load("input-keyboard")); ui_->list->item(Page_GlobalShortcuts)->setIcon(IconLoader::Load("input-keyboard"));
ui_->list->item(Page_Notifications)->setIcon(IconLoader::Load("help-hint")); ui_->list->item(Page_Notifications)->setIcon(IconLoader::Load("help-hint"));
ui_->list->item(Page_Library)->setIcon(IconLoader::Load("folder-sound")); ui_->list->item(Page_Library)->setIcon(IconLoader::Load("folder-sound"));
ui_->list->item(Page_BackgroundStreams)->setIcon(IconLoader::Load("folder-sound")); ui_->list->item(Page_BackgroundStreams)->setIcon(QIcon(":/icons/32x32/weather-showers-scattered.png"));
streams_page_->setObjectName(QString::fromUtf8("streams_page"));
streams_layout_->setObjectName(QString::fromUtf8("streams_layout"));
AddStreams(); AddStreams();
streams_layout_->addStretch(1);
ui_->stacked_widget->addWidget(streams_page_);
#ifdef ENABLE_WIIMOTEDEV #ifdef ENABLE_WIIMOTEDEV
// Wiimotedev page // Wiimotedev page

View File

@ -101,7 +101,7 @@ class SettingsDialog : public QDialog {
void SongInfoFontSizeChanged(double value); void SongInfoFontSizeChanged(double value);
// Background streams. // Background streams.
void EnableStream(int state); void EnableStream(bool enabled);
void StreamVolumeChanged(int value); void StreamVolumeChanged(int value);
private: private:
@ -111,18 +111,12 @@ class SettingsDialog : public QDialog {
const GstEngine* gst_engine_; const GstEngine* gst_engine_;
Ui_SettingsDialog* ui_; Ui_SettingsDialog* ui_;
QWidget* streams_page_;
QBoxLayout* streams_layout_;
bool loading_settings_; bool loading_settings_;
OSDPretty* pretty_popup_; OSDPretty* pretty_popup_;
QMap<QString, QString> language_map_; QMap<QString, QString> language_map_;
QMap<QSlider*, QString> sliders_;
QMap<QCheckBox*, QString> checkboxes_;
BackgroundStreams* streams_; BackgroundStreams* streams_;
#ifdef ENABLE_WIIMOTEDEV #ifdef ENABLE_WIIMOTEDEV

View File

@ -124,7 +124,7 @@
<item> <item>
<widget class="QStackedWidget" name="stacked_widget"> <widget class="QStackedWidget" name="stacked_widget">
<property name="currentIndex"> <property name="currentIndex">
<number>2</number> <number>8</number>
</property> </property>
<widget class="QWidget" name="playback_page"> <widget class="QWidget" name="playback_page">
<layout class="QVBoxLayout" name="verticalLayout_10"> <layout class="QVBoxLayout" name="verticalLayout_10">
@ -366,7 +366,7 @@
<item row="2" column="1"> <item row="2" column="1">
<widget class="QSpinBox" name="buffer_duration"> <widget class="QSpinBox" name="buffer_duration">
<property name="enabled"> <property name="enabled">
<bool>true</bool> <bool>false</bool>
</property> </property>
<property name="suffix"> <property name="suffix">
<string> ms</string> <string> ms</string>
@ -796,6 +796,30 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="QWidget" name="streams_page">
<layout class="QVBoxLayout" name="verticalLayout_16">
<item>
<widget class="QLabel" name="label_13">
<property name="text">
<string>You can listen to background streams at the same time as other music.</string>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
</widget>
</widget> </widget>
</item> </item>
<item> <item>