connect(_accountState, &AccountState::stateChanged, this, &AccountSettings::slotAccountStateChanged);
slotAccountStateChanged();
- if (!AccountManager::instance()->accounts().isEmpty()) {
- Systray::instance()->slotChangeActivityModel();
- }
-
connect(&_quotaInfo, &QuotaInfo::quotaUpdated,
this, &AccountSettings::slotUpdateQuota);
// Allow other classes to hook into isShowingSettingsDialog() signals (re-auth widgets, for example)
connect(_gui.data(), &ownCloudGui::isShowingSettingsDialog, this, &Application::slotGuiIsShowingSettings);
+
+ _gui->createTray();
}
Application::~Application()
connect(Logger::instance(), &Logger::guiMessage,
this, &ownCloudGui::slotShowGuiMessage);
+}
+
+void ownCloudGui::createTray()
+{
_tray->create();
}
void setupCloudProviders();
bool cloudProviderApiAvailable();
#endif
+ void createTray();
signals:
void setupProxy();
void Systray::create()
{
if (_trayContext == nullptr) {
+ _trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel());
_trayContext = _trayEngine->contextForObject(_trayComponent->create());
hideWindow();
}
_users[_currentUserId]->setCurrentUser(false);
_users[id]->setCurrentUser(true);
_currentUserId = id;
- emit newUserSelected();
emit refreshCurrentUserGui();
+ emit newUserSelected();
}
Q_INVOKABLE void UserModel::login(const int &id) {
return _users[currentUserIndex()]->hasActivities();
}
+void UserModel::fetchCurrentActivityModel()
+{
+ if (_users[currentUserId()]->isConnected()) {
+ _users[currentUserId()]->getActivityModel()->fetchMore(QModelIndex());
+ }
+}
+
/*-------------------------------------------------------------------------------------*/
ImageProvider::ImageProvider()
QImage avatarById(const int &id);
+ Q_INVOKABLE void fetchCurrentActivityModel();
Q_INVOKABLE void openCurrentAccountLocalFolder();
Q_INVOKABLE void openCurrentAccountTalk();
Q_INVOKABLE void openCurrentAccountServer();
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
- if (userModelBackend.isUserConnected(userModelBackend.currentUserId())) {\r
- systrayBackend.slotChangeActivityModel()\r
- }\r
-\r
userLineInstantiator.active = false;\r
userLineInstantiator.active = true;\r
}\r
trayWindow.setX( systrayBackend.calcTrayWindowX());\r
trayWindow.setY( systrayBackend.calcTrayWindowY());\r
systrayBackend.setOpened();\r
+ userModelBackend.fetchCurrentActivityModel();\r
}\r
onHideWindow: {\r
trayWindow.hide();\r