mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2025-07-01 15:26:09 +00:00
Add "View details" to PC list (#1221)
* feat: add view pc details menu item * feat: show mac address * fix: cast mac byte array to string
This commit is contained in:
parent
211fec0ff0
commit
c096238998
@ -6,6 +6,7 @@ import ComputerModel 1.0
|
|||||||
|
|
||||||
import ComputerManager 1.0
|
import ComputerManager 1.0
|
||||||
import StreamingPreferences 1.0
|
import StreamingPreferences 1.0
|
||||||
|
import SystemProperties 1.0
|
||||||
import SdlGamepadKeyNavigation 1.0
|
import SdlGamepadKeyNavigation 1.0
|
||||||
|
|
||||||
CenteredGridView {
|
CenteredGridView {
|
||||||
@ -215,6 +216,14 @@ CenteredGridView {
|
|||||||
deletePcDialog.open()
|
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 {}
|
ScrollBar.vertical: ScrollBar {}
|
||||||
}
|
}
|
||||||
|
@ -42,6 +42,20 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const
|
|||||||
return computer->state == NvComputer::CS_UNKNOWN;
|
return computer->state == NvComputer::CS_UNKNOWN;
|
||||||
case ServerSupportedRole:
|
case ServerSupportedRole:
|
||||||
return computer->isSupportedServerVersion;
|
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() ? "<NULL>" : QString(computer->macAddress.toHex(':')))
|
||||||
|
.arg(computer->pairState == NvComputer::PS_PAIRED ? tr("Paired") : tr("Unpaired"))
|
||||||
|
.arg(computer->currentGameId)
|
||||||
|
.arg(computer->activeHttpsPort);
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -69,6 +83,7 @@ QHash<int, QByteArray> ComputerModel::roleNames() const
|
|||||||
names[WakeableRole] = "wakeable";
|
names[WakeableRole] = "wakeable";
|
||||||
names[StatusUnknownRole] = "statusUnknown";
|
names[StatusUnknownRole] = "statusUnknown";
|
||||||
names[ServerSupportedRole] = "serverSupported";
|
names[ServerSupportedRole] = "serverSupported";
|
||||||
|
names[DetailsRole] = "details";
|
||||||
|
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,8 @@ class ComputerModel : public QAbstractListModel
|
|||||||
BusyRole,
|
BusyRole,
|
||||||
WakeableRole,
|
WakeableRole,
|
||||||
StatusUnknownRole,
|
StatusUnknownRole,
|
||||||
ServerSupportedRole
|
ServerSupportedRole,
|
||||||
|
DetailsRole
|
||||||
};
|
};
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user