Commit 283328fb authored by kempe's avatar kempe

Added setting to select player layout

parent daa0206d
......@@ -65,7 +65,8 @@ DISTFILES += \
qml/components/audioplayer/SleepTimerSwitch.qml \
qml/components/sleeptimer/SleepTimerDialogForm.ui.qml \
qml/components/sleeptimer/SleepTimerDialog.qml \
qml/components/sleeptimer/SleepTimer.qml
qml/components/sleeptimer/SleepTimer.qml \
qml/components/listmodels/PlayerLayoutListModel.qml
OTHER_FILES += \
rpm/harbour-received.changes.in \
......
import QtQuick 2.0
ListModel {
id: model
ListElement { title: qsTr("Original player"); fileName: "DockedAudioPlayer" }
ListElement { title: qsTr("Smal player"); fileName: "DockedAudioPlayerSmal" }
}
......@@ -18,6 +18,11 @@ SettingsPageForm {
radioAPI.setApiBaseUrl()
}
onPlayerLayoutChanged: {
settings.setValue("playerLayout", fileName)
console.log("Changing layout to", fileName)
}
Component.onCompleted: {
for (var i = 0; i < apiLanguageModel.count; i++) {
var item = apiLanguageModel.get(i)
......
......@@ -6,6 +6,7 @@ Page {
id: settingsPage
signal apiLanguageChanged(string title, string url)
signal playerLayoutChanged(string fileName)
property alias aboutAction: aboutAction
property alias buttonResetDb: buttonResetDb
......@@ -39,6 +40,36 @@ Page {
title: qsTr("Settings")
}
SectionHeader {
text: qsTr("Basic Options")
}
ComboBox {
id: playerLayoutComboBox
label: qsTr("Player layout")
menu: ContextMenu {
id: playerLayoutComboBoxMenu
Repeater {
model: PlayerLayoutListModel { id: playerLayoutModel }
MenuItem {
id: playerLayout
text: model.title
Connections {
target: playerLayout
onClicked: playerLayoutChanged(model.fileName)
}
}
}
}
}
SectionHeader {
text: qsTr("API Options")
}
ComboBox {
id: apiLanguageComboBox
label: qsTr("API Language:")
......
......@@ -184,6 +184,17 @@
<translation>Buscar</translation>
</message>
</context>
<context>
<name>PlayerLayoutListModel</name>
<message>
<source>Original player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Smal player</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
<message>
......@@ -229,6 +240,18 @@
<source>&lt;p&gt;&lt;b&gt;API Language:&lt;/b&gt; Sets the endpoint to be used for API calls e.g. rad.io for English and radio.de for German&lt;/p&gt;</source>
<translation>&lt;p&gt;&lt;b&gt;Idioma API:&lt;/b&gt; Especifica el endpoint usado en las llamadas API, p.e. rad.io para inglés y radio.de para alemán&lt;/p&gt;</translation>
</message>
<message>
<source>Player layout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>API Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Basic Options</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StationsListContextMenu</name>
......
......@@ -184,6 +184,17 @@
<translation>Sök</translation>
</message>
</context>
<context>
<name>PlayerLayoutListModel</name>
<message>
<source>Original player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Smal player</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
<message>
......@@ -229,6 +240,18 @@
<source>&lt;p&gt;&lt;b&gt;API Language:&lt;/b&gt; Sets the endpoint to be used for API calls e.g. rad.io for English and radio.de for German&lt;/p&gt;</source>
<translation>&lt;p&gt;&lt;b&gt;API språk:&lt;/b&gt; Bestämmer vilken domän som ska användas vid API anrop, t.ex. rad.io för engelska och radio.de för tyska&lt;/p&gt;</translation>
</message>
<message>
<source>Player layout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>API Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Basic Options</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StationsListContextMenu</name>
......
......@@ -184,6 +184,17 @@
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>PlayerLayoutListModel</name>
<message>
<source>Original player</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Smal player</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>SettingsPage</name>
<message>
......@@ -229,6 +240,18 @@
<source>&lt;p&gt;&lt;b&gt;API Language:&lt;/b&gt; Sets the endpoint to be used for API calls e.g. rad.io for English and radio.de for German&lt;/p&gt;</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Player layout</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>API Options</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Basic Options</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>StationsListContextMenu</name>
......
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