mirror of
https://github.com/moonlight-stream/moonlight-qt
synced 2025-01-07 08:48:45 +00:00
Add a busy indicator while waiting for initial contact with a PC
This commit is contained in:
parent
1dcf55515b
commit
493165f57f
3 changed files with 13 additions and 1 deletions
|
@ -102,7 +102,7 @@ GridView {
|
||||||
// TODO: Tooltip
|
// TODO: Tooltip
|
||||||
id: stateIcon
|
id: stateIcon
|
||||||
anchors.centerIn: pcIcon // TODO: Center within screen
|
anchors.centerIn: pcIcon // TODO: Center within screen
|
||||||
visible: !model.addPc && (!model.online || !model.paired)
|
visible: !model.addPc && !model.statusUnknown && (!model.online || !model.paired)
|
||||||
source: !model.online ? "qrc:/res/baseline-warning-24px.svg" : "qrc:/res/baseline-lock-24px.svg"
|
source: !model.online ? "qrc:/res/baseline-warning-24px.svg" : "qrc:/res/baseline-lock-24px.svg"
|
||||||
sourceSize {
|
sourceSize {
|
||||||
width: 50
|
width: 50
|
||||||
|
@ -110,6 +110,14 @@ GridView {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BusyIndicator {
|
||||||
|
id: statusUnknownSpinner
|
||||||
|
anchors.centerIn: pcIcon
|
||||||
|
width: 50
|
||||||
|
height: 50
|
||||||
|
visible: !model.addPc && model.statusUnknown
|
||||||
|
}
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
id: pcNameText
|
id: pcNameText
|
||||||
text: model.name
|
text: model.name
|
||||||
|
|
|
@ -50,6 +50,8 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const
|
||||||
return !computer->macAddress.isEmpty();
|
return !computer->macAddress.isEmpty();
|
||||||
case AddPcRole:
|
case AddPcRole:
|
||||||
return false;
|
return false;
|
||||||
|
case StatusUnknownRole:
|
||||||
|
return computer->state == NvComputer::CS_UNKNOWN;
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
@ -77,6 +79,7 @@ QHash<int, QByteArray> ComputerModel::roleNames() const
|
||||||
names[BusyRole] = "busy";
|
names[BusyRole] = "busy";
|
||||||
names[AddPcRole] = "addPc";
|
names[AddPcRole] = "addPc";
|
||||||
names[WakeableRole] = "wakeable";
|
names[WakeableRole] = "wakeable";
|
||||||
|
names[StatusUnknownRole] = "statusUnknown";
|
||||||
|
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@ class ComputerModel : public QAbstractListModel
|
||||||
PairedRole,
|
PairedRole,
|
||||||
BusyRole,
|
BusyRole,
|
||||||
WakeableRole,
|
WakeableRole,
|
||||||
|
StatusUnknownRole,
|
||||||
AddPcRole
|
AddPcRole
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue