diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 031e0540..a1749dee 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -6,6 +6,7 @@ import ComputerModel 1.0 import ComputerManager 1.0 import StreamingPreferences 1.0 +import SystemProperties 1.0 import SdlGamepadKeyNavigation 1.0 CenteredGridView { @@ -215,6 +216,14 @@ CenteredGridView { deletePcDialog.open() } } + NavigableMenuItem { + parentMenu: pcContextMenu + text: qsTr("View Details") + onTriggered: { + showPcDetailsDialog.pcDetails = model.details + showPcDetailsDialog.open() + } + } } } @@ -395,5 +404,14 @@ CenteredGridView { } } + NavigableMessageDialog { + id: showPcDetailsDialog + property int pcIndex : -1; + property string pcDetails : ""; + text: showPcDetailsDialog.pcDetails + imageSrc: "qrc:/res/baseline-help_outline-24px.svg" + standardButtons: Dialog.Ok | (SystemProperties.hasBrowser ? Dialog.Help : 0) + } + ScrollBar.vertical: ScrollBar {} } diff --git a/app/gui/computermodel.cpp b/app/gui/computermodel.cpp index 0d386547..af427560 100644 --- a/app/gui/computermodel.cpp +++ b/app/gui/computermodel.cpp @@ -42,6 +42,20 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const return computer->state == NvComputer::CS_UNKNOWN; case ServerSupportedRole: return computer->isSupportedServerVersion; + case DetailsRole: + return tr("Name: %1\nStatus: %2\nActive Address: %3\nUUID: %4\nLocal Address: %5\nRemote Address: %6\nIPv6 Address: %7\nManual Address: %8\nMAC Address: %9\nPair State: %10\nRunning Game ID: %11\nHTTPS Port: %12") + .arg(computer->name) + .arg(computer->state == NvComputer::CS_ONLINE ? tr("Online") : tr("Offline")) + .arg(computer->activeAddress.toString()) + .arg(computer->uuid) + .arg(computer->localAddress.toString()) + .arg(computer->remoteAddress.toString()) + .arg(computer->ipv6Address.toString()) + .arg(computer->manualAddress.toString()) + .arg(computer->macAddress.isEmpty() ? "" : QString(computer->macAddress.toHex(':'))) + .arg(computer->pairState == NvComputer::PS_PAIRED ? tr("Paired") : tr("Unpaired")) + .arg(computer->currentGameId) + .arg(computer->activeHttpsPort); default: return QVariant(); } @@ -69,6 +83,7 @@ QHash ComputerModel::roleNames() const names[WakeableRole] = "wakeable"; names[StatusUnknownRole] = "statusUnknown"; names[ServerSupportedRole] = "serverSupported"; + names[DetailsRole] = "details"; return names; } diff --git a/app/gui/computermodel.h b/app/gui/computermodel.h index f8f391d7..815cc9a7 100644 --- a/app/gui/computermodel.h +++ b/app/gui/computermodel.h @@ -15,7 +15,8 @@ class ComputerModel : public QAbstractListModel BusyRole, WakeableRole, StatusUnknownRole, - ServerSupportedRole + ServerSupportedRole, + DetailsRole }; public: