diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index a1749dee..a71a9caf 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -406,11 +406,10 @@ 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) + standardButtons: Dialog.Ok } ScrollBar.vertical: ScrollBar {} diff --git a/app/gui/computermodel.cpp b/app/gui/computermodel.cpp index af427560..81a80743 100644 --- a/app/gui/computermodel.cpp +++ b/app/gui/computermodel.cpp @@ -42,20 +42,47 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const return computer->state == NvComputer::CS_UNKNOWN; case ServerSupportedRole: return computer->isSupportedServerVersion; - case DetailsRole: + case DetailsRole: { + QString state, pairState; + + switch (computer->state) { + case NvComputer::CS_ONLINE: + state = tr("Online"); + break; + case NvComputer::CS_OFFLINE: + state = tr("Offline"); + break; + default: + state = tr("Unknown"); + break; + } + + switch (computer->pairState) { + case NvComputer::PS_PAIRED: + pairState = tr("Paired"); + break; + case NvComputer::PS_NOT_PAIRED: + pairState = tr("Unpaired"); + break; + default: + pairState = tr("Unknown"); + break; + } + 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(state) .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); + .arg(computer->macAddress.isEmpty() ? tr("Unknown") : QString(computer->macAddress.toHex(':'))) + .arg(pairState) + .arg(computer->state == NvComputer::CS_ONLINE ? QString::number(computer->currentGameId) : tr("Unknown")) + .arg(computer->state == NvComputer::CS_ONLINE ? QString::number(computer->activeHttpsPort) : tr("Unknown")); + } default: return QVariant(); }