From 493165f57f628ec01ebbe8dbb7b0605fce8a8dd2 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sun, 5 Aug 2018 12:13:08 -0700 Subject: [PATCH] Add a busy indicator while waiting for initial contact with a PC --- app/gui/PcView.qml | 10 +++++++++- app/gui/computermodel.cpp | 3 +++ app/gui/computermodel.h | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/app/gui/PcView.qml b/app/gui/PcView.qml index 52b13698..20229d22 100644 --- a/app/gui/PcView.qml +++ b/app/gui/PcView.qml @@ -102,7 +102,7 @@ GridView { // TODO: Tooltip id: stateIcon 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" sourceSize { width: 50 @@ -110,6 +110,14 @@ GridView { } } + BusyIndicator { + id: statusUnknownSpinner + anchors.centerIn: pcIcon + width: 50 + height: 50 + visible: !model.addPc && model.statusUnknown + } + Text { id: pcNameText text: model.name diff --git a/app/gui/computermodel.cpp b/app/gui/computermodel.cpp index ad52af05..b3550b5a 100644 --- a/app/gui/computermodel.cpp +++ b/app/gui/computermodel.cpp @@ -50,6 +50,8 @@ QVariant ComputerModel::data(const QModelIndex& index, int role) const return !computer->macAddress.isEmpty(); case AddPcRole: return false; + case StatusUnknownRole: + return computer->state == NvComputer::CS_UNKNOWN; default: return QVariant(); } @@ -77,6 +79,7 @@ QHash ComputerModel::roleNames() const names[BusyRole] = "busy"; names[AddPcRole] = "addPc"; names[WakeableRole] = "wakeable"; + names[StatusUnknownRole] = "statusUnknown"; return names; } diff --git a/app/gui/computermodel.h b/app/gui/computermodel.h index e749cf0e..18947d2b 100644 --- a/app/gui/computermodel.h +++ b/app/gui/computermodel.h @@ -14,6 +14,7 @@ class ComputerModel : public QAbstractListModel PairedRole, BusyRole, WakeableRole, + StatusUnknownRole, AddPcRole };