When owncloud is started during desktop startup the tray may not yet
be running when the client starts. This will make the client attempt
to create a tray icon again after 10 seconds if there's no tray
during initial startup.
We had signals just to call those backs in ownCloudGui, they were
otherwise unused. So let's move them inside of Systray since it's
specific to it anyway.
Also fix the dangerous call to sender(). We can call this function
without going through a signal/slot connection and also it's never
connected to an AccountState.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Because of PR #2580 the settings dialog doesn't always exist. We need to
check for it first before placing calls to it.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
ownCloudGui::slotShowSettings already got what it takes to create it only when we try to show it for the first time.
This however has some implications:
Pros:
- Only created when needed, while testing saved ca. 20 MB of RAM and got freed again after closing the dialog.
- Since we defaulted to the new Tray UI from 3.0, this is an added bonus for users don't opening the settings.
Cons:
- Resources like the avatar image have to be refetched everytime the dialog is recreated.
This may be desired as well, because it ensures displaying no outdated info (e.g. on connection issues).
Signed-off-by: Michael Schuster <michael@schuster.ms>
This flagged mostly unused parameters. Didn't enable the
misc-non-private-member-variables-in-classes check as we got a lot of
those. Hopefully we'll get to fix them at some point but that feels too
early and too much work for now.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
The context menu offers to open the main dialog and the settings
even if no accounts are configured. In this case, the main dialog
is useless and the settings are probably confusing. Hence, this
commit replaces these actions in the context menu by an action
to open the wizard (which also opens on left click, so this is
the most natural thing to do).
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Update systray behavior and context menu:
- left click brings up the new QtQuick based dialogs on all latforms
- right click brings up the new QtQuick based dialog on Mac OS only
- right click brings up a context menu on all other platforms than Mac OS
- "Quit Nextcloud" => "Exit Nextcloud"
- Add "Open main dialog" option.
Signed-off-by: Camila <hello@camila.codes>
Commit a12205f322 (PR #1891) introduced
a circular ownership: qmlRegisterSingletonType<Systray>(...) makes the
QQmlEngine own the resulting singleton Systray instance, however, the
QQmlEngine _trayEngine itself is owned by the Systray instance. This
circular ownership results in a crash when the destructor of Systray
calls the destructor of _trayEngine which attempts to call the destructor
of Systray.
This commit solves this problem by making ownCloudGui, which is the
parent of Systray, the parent of the _trayEngine.
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
Previously we were showing up the settings dialog but it doesn't quite
make sense anymore now that we got two dialogs.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Note this won't work on all platforms. KDE Plasma and GNOME Shell (with
systray extension) assume that right click is necessarily for a context
menu exposed via D-Bus, there's not nice way to make the right click
popup the main dialog on those platforms.
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
Make the codebase consistent, we already have a lot of implicit pointer comparisons.
Exception: Stay explicit on return's, example:
return _db != nullptr;
Signed-off-by: Michael Schuster <michael@schuster.ms>
- Add a new class AccountApp to keep them in an AccountAppList
and also save properties like ID and Icon URL.
- Clear the app list upon re-fetch to avoid endlessly growing lists
like in the previous implementation in ownCloudGui.
Signed-off-by: Michael Schuster <michael@schuster.ms>