GODT-2091: animated "Connecting..." label. + unstaged changes from GODT-2003.

This commit is contained in:
Xavier Michelon
2022-11-16 19:46:56 +01:00
parent e087a7972e
commit c7cfcb29f6
3 changed files with 19 additions and 2 deletions

View File

@ -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) {

View File

@ -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;

View File

@ -33,7 +33,7 @@ class EUserState: public QObject
{
Q_OBJECT
public:
enum State
enum class State
{
SignedOut = 0,
Locked = 1,