Bunch of fixes and optimizations for activityList

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
This commit is contained in:
Dominique Fuchs 2020-01-12 17:52:51 +01:00
parent b76da25ef1
commit 1c2916052d
5 changed files with 15 additions and 11 deletions

View file

@ -192,6 +192,10 @@ AccountSettings::AccountSettings(AccountState *accountState, QWidget *parent)
connect(_accountState, &AccountState::stateChanged, this, &AccountSettings::slotAccountStateChanged);
slotAccountStateChanged();
if (!AccountManager::instance()->accounts().isEmpty()) {
Systray::instance()->slotChangeActivityModel();
}
connect(&_quotaInfo, &QuotaInfo::quotaUpdated,
this, &AccountSettings::slotUpdateQuota);

View file

@ -61,10 +61,6 @@ Systray::Systray()
_trayComponent = new QQmlComponent(_trayEngine, QUrl(QStringLiteral("qrc:/qml/src/gui/tray/Window.qml")));
if (!AccountManager::instance()->accounts().isEmpty()) {
slotChangeActivityModel();
}
connect(UserModel::instance(), &UserModel::newUserSelected,
this, &Systray::slotChangeActivityModel);
@ -83,7 +79,7 @@ void Systray::create()
void Systray::slotChangeActivityModel()
{
_trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel());
emit currentUserChanged();
//UserModel::instance()->currentActivityModel()->slotRefreshActivity();
}
bool Systray::isOpen()

View file

@ -69,7 +69,7 @@ signals:
Q_INVOKABLE void hideWindow();
Q_INVOKABLE void showWindow();
private slots:
public slots:
void slotChangeActivityModel();
private:

View file

@ -25,7 +25,11 @@ MenuItem {
}
onClicked: {
userModelBackend.switchCurrentUser(index)
if (!isCurrentUser) {
userModelBackend.switchCurrentUser(id)
} else {
accountMenu.close()
}
}
RowLayout {

View file

@ -31,6 +31,10 @@ Window {
currentAccountStateIndicator.source = ""
currentAccountStateIndicator.source = userModelBackend.isUserConnected(userModelBackend.currentUserId()) ? "qrc:///client/theme/colored/state-ok.svg" : "qrc:///client/theme/colored/state-offline.svg"
if (userModelBackend.isUserConnected(userModelBackend.currentUserId())) {
systrayBackend.slotChangeActivityModel()
}
userLineInstantiator.active = false;
userLineInstantiator.active = true;
}
@ -535,10 +539,6 @@ Window {
}
focus: true
// For interactive ListView/Animation testing only
//Keys.onSpacePressed: model.insert(0, { "name": "Item " + model.count })
//Keys.onTabPressed: model.remove(3)
}
} // Rectangle trayWindowBackground