diff --git a/gui/src/qml/MainView.qml b/gui/src/qml/MainView.qml index 8be363ea..4828df82 100644 --- a/gui/src/qml/MainView.qml +++ b/gui/src/qml/MainView.qml @@ -9,8 +9,16 @@ Pane { padding: 0 StackView.onActivated: forceActiveFocus() - Keys.onUpPressed: hostsView.decrementCurrentIndex() - Keys.onDownPressed: hostsView.incrementCurrentIndex() + Keys.onUpPressed: { + hostsView.decrementCurrentIndex() + while(hostsView.currentItem && !hostsView.currentItem.visible) + hostsView.decrementCurrentIndex() + } + Keys.onDownPressed: { + hostsView.incrementCurrentIndex() + while(hostsView.currentItem && !hostsView.currentItem.visible) + hostsView.incrementCurrentIndex() + } Keys.onMenuPressed: settingsButton.clicked() Keys.onReturnPressed: if (hostsView.currentItem) hostsView.currentItem.connectToHost() Keys.onYesPressed: if (hostsView.currentItem) hostsView.currentItem.wakeUpHost() @@ -112,6 +120,7 @@ Pane { ListView { id: hostsView + keyNavigationWraps: true anchors { top: toolBar.bottom left: parent.left @@ -122,9 +131,10 @@ Pane { clip: true model: Chiaki.hosts delegate: ItemDelegate { + visible: modelData.display id: delegate width: parent ? parent.width : 0 - height: 180 + height: modelData.display ? 180 : 0 highlighted: ListView.isCurrentItem onClicked: connectToHost() @@ -146,7 +156,6 @@ Pane { } RowLayout { - visible: modelData.display anchors { fill: parent leftMargin: 30 @@ -179,6 +188,7 @@ Pane { t += "\n" + qsTr("Remote Connection via PSN"); } else + { t += "\n"; if(modelData.discovered) { @@ -189,6 +199,7 @@ Pane { } else t += qsTr("manual"); + } return t; } } @@ -197,9 +208,11 @@ Pane { Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter text: { let t = ""; - if (!modelData.discovered) + if(modelData.duid) return t; t += qsTr("State: %1").arg(modelData.state); + if(!modelData.discovered) + return t; if (modelData.app) t += "\n" + qsTr("App: %1").arg(modelData.app); if (modelData.titleId) diff --git a/gui/src/qmlbackend.cpp b/gui/src/qmlbackend.cpp index db411dc7..71db5c41 100644 --- a/gui/src/qmlbackend.cpp +++ b/gui/src/qmlbackend.cpp @@ -462,6 +462,7 @@ QVariantList QmlBackend::hosts() const m["name"] = host.GetHost(); m["duid"] = ""; m["address"] = host.GetHost(); + m["state"] = "unknown"; m["registered"] = false; m["display"] = discovered_manual_hosts.contains(host) ? false : true; if (host.GetRegistered() && settings->GetRegisteredHostRegistered(host.GetMAC())) {