Add all view
This commit is contained in:
1 parent
186cff1d73
commit
49d8524597
18 files changed
+1007
-98
No files matched your search
@@ -0,0 +1,65 @@
|
||||
import QtQuick 2.5
|
||||
import "../Components"
|
||||
|
||||
// Écran 1 : choix d'un serveur enregistré ou découvert sur le réseau local.
|
||||
Page {
|
||||
id: page
|
||||
|
||||
title: "Sélectionner un serveur"
|
||||
subtitle: serverList.count > 0
|
||||
? "Choisissez le serveur Jellyfin auquel vous connecter."
|
||||
: "Aucun serveur enregistré. Ajoutez l'adresse de votre serveur Jellyfin."
|
||||
initialFocus: serverList.count > 0 ? serverList : addButton
|
||||
|
||||
function openServer(index) {
|
||||
page.session.selectServer(index);
|
||||
page.navigator.push("UserSelect");
|
||||
}
|
||||
|
||||
ListView {
|
||||
id: serverList
|
||||
anchors {
|
||||
top: parent.top
|
||||
left: parent.left
|
||||
right: parent.right
|
||||
bottom: addButton.top
|
||||
bottomMargin: Theme.spacingL
|
||||
}
|
||||
clip: true
|
||||
spacing: Theme.spacingS
|
||||
model: page.session ? page.session.servers : null
|
||||
|
||||
delegate: ServerItem {
|
||||
width: serverList.width
|
||||
name: model.name
|
||||
address: model.address
|
||||
discovered: model.discovered
|
||||
highlighted: ListView.isCurrentItem && serverList.activeFocus
|
||||
onClicked: {
|
||||
serverList.currentIndex = index;
|
||||
page.openServer(index);
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onPressed: {
|
||||
if (Remote.isAccept(event.key) && currentIndex >= 0) {
|
||||
event.accepted = true;
|
||||
page.openServer(currentIndex);
|
||||
}
|
||||
}
|
||||
// Laisse la ListView gérer Haut/Bas ; on ne sort qu'en bout de liste.
|
||||
KeyNavigation.priority: KeyNavigation.AfterItem
|
||||
KeyNavigation.down: addButton
|
||||
}
|
||||
|
||||
FocusButton {
|
||||
id: addButton
|
||||
anchors {
|
||||
left: parent.left
|
||||
bottom: parent.bottom
|
||||
}
|
||||
text: "Ajouter un serveur"
|
||||
KeyNavigation.up: serverList.count > 0 ? serverList : null
|
||||
onClicked: page.navigator.push("ServerAdd")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user