this, &ownCloudGui::slotShowOptionalTrayMessage);
connect(Logger::instance(), &Logger::guiMessage,
this, &ownCloudGui::slotShowGuiMessage);
+
+ _tray->create();
}
#ifdef WITH_LIBCLOUDPROVIDERS
_trayEngine->rootContext()->setContextProperty("systrayBackend", this);
_trayComponent = new QQmlComponent(_trayEngine, QUrl(QStringLiteral("qrc:/qml/src/gui/tray/Window.qml")));
- _trayContext = _trayEngine->contextForObject(_trayComponent->create());
if (!AccountManager::instance()->accounts().isEmpty()) {
slotChangeActivityModel();
connect(UserModel::instance(), &UserModel::newUserSelected,
this, &Systray::slotChangeActivityModel);
-
- hideWindow();
}
Systray::~Systray()
{
}
+void Systray::create()
+{
+ if (_trayContext == nullptr) {
+ _trayContext = _trayEngine->contextForObject(_trayComponent->create());
+ hideWindow();
+ }
+}
+
void Systray::slotChangeActivityModel()
{
_trayEngine->rootContext()->setContextProperty("activityModel", UserModel::instance()->currentActivityModel());
public:
explicit Systray();
~Systray();
+ void create();
void showMessage(const QString &title, const QString &message, MessageIcon icon = Information, int millisecondsTimeoutHint = 10000);
void setToolTip(const QString &tip);
bool isOpen();
currentAccountUser.text = userModelBackend.currentUserName();\r
currentAccountServer.text = userModelBackend.currentUserServer();\r
trayWindowTalkButton.visible = userModelBackend.currentServerHasTalk() ? true : false;\r
+\r
+ userLineInstantiator.active = false;\r
+ userLineInstantiator.active = true;\r
}\r
\r
Connections {\r
radius: 2\r
}\r
\r
- onClosed: {\r
- userLineInstantiator.active = false;\r
- userLineInstantiator.active = true;\r
- }\r
-\r
Instantiator {\r
id: userLineInstantiator\r
model: userModelBackend\r