source: ("image://avatars/" + index)\r
Layout.preferredHeight: (userLineLayout.height -16)\r
Layout.preferredWidth: (userLineLayout.height -16)\r
+ Image {\r
+ id: accountStateIndicator\r
+ source: userModelBackend.isUserConnected(index) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"\r
+ cache: false\r
+ anchors.bottom: accountAvatar.bottom\r
+ anchors.right: accountAvatar.right\r
+ sourceSize.width: 16\r
+ sourceSize.height: 16\r
+ }\r
}\r
\r
Column {\r
return _users.size();
}
+Q_INVOKABLE int UserModel::currentUserId()
+{
+ return _currentUserId;
+}
+
Q_INVOKABLE bool UserModel::isUserConnected(const int &id)
{
return _users[id].isConnected();
Q_INVOKABLE QString currentUserServer();
Q_INVOKABLE bool currentUserHasActivities();
Q_INVOKABLE bool currentServerHasTalk();
+ Q_INVOKABLE int currentUserId();
Q_INVOKABLE bool isUserConnected(const int &id);
Q_INVOKABLE void switchCurrentUser(const int &id);
Q_INVOKABLE void login(const int &id);
currentAccountAvatar.source = "image://avatars/currentUser"\r
currentAccountUser.text = userModelBackend.currentUserName();\r
currentAccountServer.text = userModelBackend.currentUserServer();\r
+ currentAccountStateIndicator.source = ""\r
+ currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"\r
}\r
onNewUserSelected: {\r
accountMenu.close();\r
source: "image://avatars/currentUser"\r
Layout.preferredHeight: (trayWindowHeaderBackground.height -16)\r
Layout.preferredWidth: (trayWindowHeaderBackground.height -16)\r
+ Image {\r
+ id: currentAccountStateIndicator\r
+ source: userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"\r
+ cache: false\r
+ anchors.bottom: currentAccountAvatar.bottom\r
+ anchors.right: currentAccountAvatar.right\r
+ sourceSize.width: 16\r
+ sourceSize.height: 16\r
+ }\r
}\r
\r
Column {\r