mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-06-15 21:22:40 +00:00
Only allow waking PCs that are not online and paired
This commit is contained in:
+3
-2
@@ -147,6 +147,8 @@ GridView {
|
|||||||
MenuItem {
|
MenuItem {
|
||||||
text: "Wake PC"
|
text: "Wake PC"
|
||||||
onTriggered: computerModel.wakeComputer(index)
|
onTriggered: computerModel.wakeComputer(index)
|
||||||
|
visible: !model.online && model.wakeable
|
||||||
|
height: visible ? implicitHeight : 0
|
||||||
}
|
}
|
||||||
MenuItem {
|
MenuItem {
|
||||||
text: "Delete PC"
|
text: "Delete PC"
|
||||||
@@ -247,7 +249,7 @@ GridView {
|
|||||||
// don't allow edits to the rest of the window while open
|
// don't allow edits to the rest of the window while open
|
||||||
modality:Qt.WindowModal
|
modality:Qt.WindowModal
|
||||||
property int pcIndex : -1;
|
property int pcIndex : -1;
|
||||||
text:"Are you sure you want to unpair from this PC?"
|
text:"Are you sure you want to remove this PC?"
|
||||||
standardButtons: StandardButton.Yes |StandardButton.No
|
standardButtons: StandardButton.Yes |StandardButton.No
|
||||||
onYes: {
|
onYes: {
|
||||||
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
console.log("deleting PC pairing for PC at index: " + pcIndex)
|
||||||
@@ -257,7 +259,6 @@ GridView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Dialog {
|
Dialog {
|
||||||
id: addPcDialog
|
id: addPcDialog
|
||||||
property string label: "Enter the IP address of your GameStream PC"
|
property string label: "Enter the IP address of your GameStream PC"
|
||||||
|
|||||||
@@ -46,6 +46,8 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const
|
|||||||
return computer->pairState == NvComputer::PS_PAIRED;
|
return computer->pairState == NvComputer::PS_PAIRED;
|
||||||
case BusyRole:
|
case BusyRole:
|
||||||
return computer->currentGameId != 0;
|
return computer->currentGameId != 0;
|
||||||
|
case WakeableRole:
|
||||||
|
return !computer->macAddress.isEmpty();
|
||||||
case AddPcRole:
|
case AddPcRole:
|
||||||
return false;
|
return false;
|
||||||
default:
|
default:
|
||||||
@@ -74,6 +76,7 @@ QHash<int, QByteArray> ComputerModel::roleNames() const
|
|||||||
names[PairedRole] = "paired";
|
names[PairedRole] = "paired";
|
||||||
names[BusyRole] = "busy";
|
names[BusyRole] = "busy";
|
||||||
names[AddPcRole] = "addPc";
|
names[AddPcRole] = "addPc";
|
||||||
|
names[WakeableRole] = "wakeable";
|
||||||
|
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ class ComputerModel : public QAbstractListModel
|
|||||||
OnlineRole,
|
OnlineRole,
|
||||||
PairedRole,
|
PairedRole,
|
||||||
BusyRole,
|
BusyRole,
|
||||||
|
WakeableRole,
|
||||||
AddPcRole
|
AddPcRole
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user