From c7cfcb29f6b3e75cbeb45886c20768c009269b37 Mon Sep 17 00:00:00 2001 From: Xavier Michelon Date: Wed, 16 Nov 2022 19:46:56 +0100 Subject: [PATCH] GODT-2091: animated "Connecting..." label. + unstaged changes from GODT-2003. --- .../bridge-gui/qml/AccountDelegate.qml | 18 +++++++++++++++++- .../bridgepp/bridgepp/BridgeUtils.cpp | 1 + .../bridge-gui/bridgepp/bridgepp/User/User.h | 2 +- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/internal/frontend/bridge-gui/bridge-gui/qml/AccountDelegate.qml b/internal/frontend/bridge-gui/bridge-gui/qml/AccountDelegate.qml index 99e212bc..abdb2da3 100644 --- a/internal/frontend/bridge-gui/bridge-gui/qml/AccountDelegate.qml +++ b/internal/frontend/bridge-gui/bridge-gui/qml/AccountDelegate.qml @@ -144,12 +144,28 @@ Item { default: return qsTr("Signed out") case EUserState.Locked: - return qsTr("Connecting...") + return qsTr("Connecting") + dotsTimer.dots case EUserState.Connected: return root.usedSpace } } + Timer { // dots animation while connecting. 1 sec cycle, roughly similar to the webmail loading page. + id:dotsTimer + property string dots: "" + interval: 250; + repeat: true; + running: (root.user.state === EUserState.Locked) + onTriggered: { + dots = dots + "." + if (dots.length > 3) + dots = "" + } + onRunningChanged: { + dots = "" + } + } + color: root.usedSpaceColor type: { switch (root.type) { diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/BridgeUtils.cpp b/internal/frontend/bridge-gui/bridgepp/bridgepp/BridgeUtils.cpp index 0670a8e7..1f967ed5 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/BridgeUtils.cpp +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/BridgeUtils.cpp @@ -203,6 +203,7 @@ SPUser randomUser() user->setAddresses(QStringList() << (username + "@proton.me") << (username + "@protonmail.com") ); user->setPassword(QUuid().createUuid().toString(QUuid::StringFormat::WithoutBraces).left(20)); user->setAvatarText(firstName.left(1) + lastName.left(1)); + user->setState(UserState::Connected); user->setSplitMode(false); user->setSetupGuideSeen(true); qint64 const totalBytes = (500 + randN(2501)) * 1000000; diff --git a/internal/frontend/bridge-gui/bridgepp/bridgepp/User/User.h b/internal/frontend/bridge-gui/bridgepp/bridgepp/User/User.h index fe7e7195..99ee786f 100644 --- a/internal/frontend/bridge-gui/bridgepp/bridgepp/User/User.h +++ b/internal/frontend/bridge-gui/bridgepp/bridgepp/User/User.h @@ -33,7 +33,7 @@ class EUserState: public QObject { Q_OBJECT public: - enum State + enum class State { SignedOut = 0, Locked = 1,