Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
(cherry picked from commit
9935606c87ec4818f04c7d7c63d2f4b61187eead)
Signed-off-by: Michael Schuster <michael@schuster.ms>
} else if (_tray->isOpen()) {
_tray->hideWindow();
} else {
- _tray->showWindow();
+ if (AccountManager::instance()->accounts().isEmpty()) {
+ this->slotOpenSettingsDialog();
+ } else {
+ _tray->showWindow();
+ }
+
}
}
// FIXME: Also make sure that any auto updater dialogue https://github.com/owncloud/client/issues/5613
void Systray::create()
{
if (_trayContext == nullptr) {
- _trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel());
+ if (!AccountManager::instance()->accounts().isEmpty()) {
+ _trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel());
+ }
_trayContext = _trayEngine->contextForObject(_trayComponent->create());
hideWindow();
}
Q_INVOKABLE bool UserModel::isUserConnected(const int &id)
{
- return _users[id]->isConnected();
+ if (!_users.isEmpty()) {
+ return _users[id]->isConnected();
+ } else {
+ return false;
+ }
+
}
Q_INVOKABLE QImage UserModel::currentUserAvatar()
endInsertRows();
ConfigFile cfg;
_users.last()->setNotificationRefreshInterval(cfg.notificationRefreshInterval());
+ emit newUserSelected();
}
}