1
0
Fork 0
Commit Graph

2782 Commits

Author SHA1 Message Date
Harald Eilertsen e343b4b947 gui/accountstate: Replace foreach (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen 225fdabf6a gui/accountstate: Replace foreach (#2219)
Most instances have been converted to range based for, but std::find_if
has been used where it made sense.

Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Harald Eilertsen 1898782781 gui/accountmanager: Replace foreach/Q_FOREACH (#2219)
Signed-off-by: Harald Eilertsen <haraldei@anduin.net>
2020-09-29 19:31:23 +02:00
Camila dc12cdf196
Correct the object name returned by the api.
The id was always 0 so no new systray messages were displayed.

Signed-off-by: Camila <hello@camila.codes>
2020-09-29 18:53:28 +02:00
Camila d2eb24a9a8
Connect signal guiLog to slot to display systray message.
Signed-off-by: Camila <hello@camila.codes>
2020-09-29 18:53:28 +02:00
Valdnet d50ad548d2
l10n: Remove space from string text 2020-09-29 14:39:34 +02:00
Dominique Fuchs b96b7e20c7 emitting signals from Qts Accessibility interaction invocations instead of duplicating actions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 1053c58b0f KISS. Removed description for now, instead clarified some Accessible.name
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 8abe4219a5 Added missing qsTr() calls - again
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs a69898371f Added missing qsTr() calls
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs a4151d71bc Fix typo
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 3287ec2387 Typo fixes, minor additions
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs c6047e4d63 Re-add wrongly delete action
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dominique Fuchs 43bf703806 Initial accessibility declarations for tray window qml src
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-28 12:38:21 +00:00
Dan Griffin 5763e1e9d8
Free IconJob after use
Signed-off-by: Dan Griffin <github.mk@xiragon.com>
2020-09-28 12:30:53 +02:00
Kevin Ottens 78b03739a7
Force tooltip wrap mode because it's not enabled in Qt 5.12...
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-24 14:47:56 +02:00
Jeremy Plsek 5fa2a13f8d Use native text rendering for qml windows
Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-23 08:00:46 +00:00
Michael Schuster ce71ffe9f9 Allow server URL to be pre-defined without enforcing it to be used unmodified
APPLICATION_SERVER_URL can be either empty or be specified. This commit adds the new CMake option APPLICATION_SERVER_URL_ENFORCE to decide whether to enforce the
URL's unmodified use (like before, default: ON) or to allow modification by the user (new).

By default APPLICATION_SERVER_URL_ENFORCE is set to ON, to no break with the previous implementation's expectations.

If APPLICATION_SERVER_URL is empty, APPLICATION_SERVER_URL_ENFORCE will be ignored by the Account Wizard.

The previous behaviour confused me a bit with branded builds. When the URL was (usually) specified but not forced, it was simply discarded, forcing the user to
manually supply it.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-09-23 07:21:35 +00:00
Jeremy Plsek 3a53afd704 Remove "This includes" due to tooltip order
Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-21 09:46:25 +00:00
Kevin Ottens 3171cb2720 If there's no description just say nothing
Otherwise we get lots of "No description available" lines in the
activity list which is basically noise. Also trains the user to ignore
the secondary line.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-18 17:46:38 +00:00
Dominique Fuchs f8f3190cb4 Fix missing subdirectory discovery on move operations in macOS.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Add qAsConst to avoid detaching

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Changed callchain to find and return possibly coalesced paths

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Removed another qAsConst remnant, more func const-correctness.

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-17 15:44:32 +02:00
Dominique Fuchs d09b0284dd
Do not break out of outer loop when upgrading folders, continue instead
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>

Remove awkward debug line a.k.a. whoops

Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-09-16 10:57:43 +02:00
Jeremy Plsek 797df2b5d5 Include list info in tooltip
Also extend the tooltip timeout

Signed-off-by: Jeremy Plsek <jeremyplsek@gmail.com>
2020-09-15 10:04:06 +00:00
Kevin Ottens 6ee37b5975 Make sure menu are closed when button is clicked again
This way we also made sure all the Menu are currently on the same close
policy.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:10 +00:00
Kevin Ottens f7efe6a902 Delay binding on the menu width
Indee the MenuItem might not be linked to its Menu at creation time
which will make the binding fail and give a warning. Delay for the menu
availability.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:10 +00:00
Kevin Ottens eb0cedebfa Remove pre-QQC2.3 workaround
Now that we depend on Qt 5.12 anyway, the count property is available
just fine on the Menu item.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 08:46:09 +00:00
Kevin Ottens 7ccb016397 Use QGuiApplication::primaryScreen() as fallback for Systray::currentScreen()
Under Wayland QCursor::pos() is unlikely to give us anything meaningful,
so fallback to the primary screen information.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-15 07:17:03 +00:00
Kevin Ottens 01986df8ca Don't use a confusing "royal you" in the sync messages
Users get rightfully confused with the "You changed ..." messages in the
activity list for syncs. Indeed, some of those changes might be coming
from the server in which case we don't really know who did the change.

So now we use the old "Synced ..." messages for changes pulled from the
server and we have a more precise "You changed ..." (renamed, deleted,
created) when the changes were initiated locally (since there we know
the user reading the message did it).

Also changed how the messages are constructed so that they can be
properly translated.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-10 15:40:05 +02:00
Camila 95f634ce28 Click on activity list in systray open file in the file manager.
Clean up code, add more const and auto.

Signed-off-by: Camila <hello@camila.codes>
2020-09-09 20:06:46 +02:00
Camila c1086c9886 Fix tooltip for activity info.
Also improves readability of the items in the list.

Signed-off-by: Camila <hello@camila.codes>
2020-09-09 20:06:46 +02:00
Kevin Ottens fdb35e5f9f Leave the implicit uint to int cast
I wrongly (and stupidly) assumed the int in QBitArray was treated as a
hash as well but it is an index so it must be positive. Also to make
things even worse I misread on which expression clang-tidy was
complaining regarding the implementation specific narrowing
conversion... This is happening after the modulo operator and not
before. We're in a safe range of values at that point, so it's fine to
let the narrowing happen.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-08 16:44:31 +02:00
Kevin Ottens aa63889e5b Enable bugprone-terminating-continue clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 80cc196f6f Enable bugprone-narrowing-conversions clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 608bf025e6 Enable bugprone-forward-declaration-namespace clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens c8ea848596 Enable the bugprone-branch-clone clang-tidy check
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-09-01 06:37:03 +00:00
Kevin Ottens 1a0945a973 Enable all the misc clang-tidy check except one
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>
2020-08-31 09:14:09 +02:00
Michael Schuster 11632da7ea
Windows shell extensions: Change NCUtil Pipe name from ownCloud to APPLICATION_EXECUTABLE
Avoid interference with foreign pipes as this is always a bad idea ;p

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-20 18:50:05 +02:00
Kevin Ottens ed5e9de9f6
Present sharing of E2EE files from the main dialog too
The visibility of the share button for the activity list is tied to the
path role in the ActivityListModel, so make sure we don't return a path
for E2EE files and folders.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-20 14:53:14 +02:00
Kevin Ottens 07388e0f22
Disable context menu actions for E2EE files and folders
Those files and folders are not shareable and the "Edit" or "Open in
browser" actions will lead to showing an error in the web GUI. No need
to lead users there so just disable them.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-20 14:13:56 +02:00
Kevin Ottens 3540f1e460 Show the "Display mnemonic" button only when we know e2e is supported
Turns out that showing the button straight from the page ctor is a bit
too early. At that point the account might not be connected yet and thus
we wouldn't have proper information. Currently we were displaying that
button all the time, now we wait for the account to be connected to
decide to show it or not.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-18 17:41:38 +02:00
Kevin Ottens 866ffc2a6b Enable the modernize-loop-convert check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens a5b4922a0e Remove unused method
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 12:55:14 +00:00
Kevin Ottens 0e2af4b502 Enable the modernize-deprecated-headers check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:53:52 +02:00
Kevin Ottens 2f8c29082a Enable the modernize-use-equals-default check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-13 14:19:42 +02:00
Kevin Ottens cdf6e7d72b Enable the modernize-user-nullptr check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 19:45:25 +02:00
Kevin Ottens d58ec4bf70
Enable the modernize-use-using check on clang-tidy
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 18:18:57 +02:00
Kevin Ottens c50a968a1e
Add more raw string literals missed previously
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-12 09:48:29 +02:00
Kevin Ottens 37e20698ca
Keep the E2EE info message around to allow displaying mnemonic
We lost the ability to display the E2EE mnemonic during the GUI
redesign and the info message wasn't displayed again on restart. So now
we display it every time, it still can be dismissed and the button text
is different in such a case to make the intent clearer.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-11 14:55:51 +02:00
Camila 8f300ffe66 Remove extra check for talk app on server in AccountState.
- Remove repeated hard coded "spreed" string.

Signed-off-by: Camila <hello@camila.codes>
2020-08-04 16:28:19 +00:00
Camila 6d6cc3852b Fix #2243: use server url instead of hard coded string.
Signed-off-by: Camila <hello@camila.codes>
2020-08-04 16:28:19 +00:00
Kevin Ottens 0516db5e10 Make sure we always have a CLSID when Explorer integration is used
We update properly the CLSID of folders to integrate them with the
Explorer pane when they are added or removed from the GUI. That said,
there might be cases of users adding folders to sync straight from the
GUI. In such a case the CLSID might be missing on config load so now we
assign one on the fly when that happens.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-08-04 07:33:53 +02:00
Michael Schuster bc5888e8e4 Always show Settings in the context menu (amends #2164)
The context menu should allow access to the Settings even when no accounts are configured.

Users may specify proxy / startup / update and other settings at any time.

This slipped through in #2164.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-08-03 10:10:05 +02:00
Camila e89177b25b Add OpacityMask to fix mouse hover on round corner.
- Fix for #2173.
- Removed the workaround for the left round corner which was also
fixed with the OpacityMask.

Signed-off-by: Camila <hello@camila.codes>
2020-07-28 11:19:22 +02:00
Stephan Beyer cd008ffe59 Let context menu open wizard if there are no accounts
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>
2020-07-23 21:08:53 +02:00
Dominique Fuchs a07db657d5 sigh, too
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 12:44:45 +02:00
Dominique Fuchs cd3a72822e Get a const auto for the FolderMap to iterate over
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs dbdf40ea45 Replaced Qt foreach by C++11 ranged for loop
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs 82c70f0c95 Properly set syncPause state on Systray creation when account init is done
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs 5ac3099b37 Fixed copy/paste bug, resulting in a wrong signal ::pauseSync used instead of ::resumeSync
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-21 10:10:07 +00:00
Dominique Fuchs 6ab55eddae Add -no-strip cmd line arg to macdeployqt if when building with Debug profile
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-20 15:04:33 +02:00
Kevin Ottens 6b8d2270c6 Make sure the tray icon point is in screen coordinates
Previously we were using QCursor::pos() in the Linux case, which is a
fair heuristic except it will always be relative to the primary screen
and not the current screen. This explains why we had to adjust with the
virtual geometry.

In the Windows and Mac case we got the position out of QSystemTrayIcon
and that one was already relative to the current screen.

So now we use QCursor::pos(currentScreen()) which ensures we give the
coordinates relatively to the current screen also in the Linux case.

Since all platforms are now having that point in the same coordinate
system we don't need to mess around with the virtual geometry to
compensate.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-15 12:22:54 +02:00
Dominique Fuchs 6bc70ddd5b
Fix typo, use compound assignment op
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-13 17:47:19 +02:00
Dominique Fuchs bc20edc582
Only attempt to move if file exist
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-13 17:47:18 +02:00
Dominique Fuchs 4656748130
Move existing syncjournal db files from client ver <2.7
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-13 17:47:11 +02:00
Camila f018f7df3b Fix text in the permissions menu for share link.
Changed word capitalization and replace && for andi to match the server.

Signed-off-by: Camila <hello@camila.codes>
2020-07-09 03:21:04 +00:00
Camila 30a533d49c Share link display the correct permissions for files and folders.
- Fix #2175:
	- Shows the correct default permissions
	- Shows the permissions the user set

Signed-off-by: Camila <hello@camila.codes>
2020-07-09 03:21:04 +00:00
Camila d7a1367292
Display the correct default permissions when creating a share.
- The default displayed was not in sync with the server because
the client was setting permissions when creating a share while it
should get the default permissions from the server to display it to the
user first.

Signed-off-by: Camila <hello@camila.codes>
2020-07-08 18:15:36 +02:00
Stephan Beyer 308bed0da7 Use braced initializer list for returns in Systray::taskbarGeometry()
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer 1e6747cd1d Remove redundant initialization of ElidedLabel::_elideMode
The value gets already initialized by default member initialization,
so there is no need to set it again in the constructor.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer 00f93fdb77 Use more auto in folderstatusdelegate.cpp
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-08 14:08:41 +02:00
Stephan Beyer e32bd75519 Set maximum height of account and app menu
The menus may become too large if they have too many items
(the account menu has this in case of many accounts, the apps
menu in case of many apps).  This commit limits the maximum
height such that the menus do not hide the header.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-07-07 17:35:09 +02:00
Kevin Ottens b98cf0a029 Reach out to the contentItem inside of the ListView to find the width
Turns out that the ListView embedded in the Menu (reachable via
contentItem) would create a binding loop if we're using its
childrenRect. But really we're interested in the total width for the
instantiated delegate *inside* the ListView. That's why we go one level
deeper and get the childrenRect of the inner contentItem instead.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 20:39:42 +00:00
Michael Schuster f4d83d02f6
Cleanup auto pointers and qobject casts, refactor KeychainChunk
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:40 +02:00
Michael Schuster ff631e919f
ProxyAuthHandler: Add template member function execAwait to avoid code duplication
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:40 +02:00
Michael Schuster 8503226c44
Keychain: Use auto deletion in WebFlowCredentials and ConfigFile
- Also make use of the new KeychainChunk::DeleteJob

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:40 +02:00
Michael Schuster ea95c4bf49
Refactor ProxyAuthHandler to use QEventLoop
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:39 +02:00
Michael Schuster 81c644e702
ConfigFile security: Migrate Proxy password to keychain
When specified in the config file, the Proxy password will be migrated
to the keychain, for backward compatibility and to allow admins to
overwrite an existing password by rolling out updated config files.

Once migrated to the keychain, the password will be removed from the
config file.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:39 +02:00
Michael Schuster 2a3ef044be
Move KeychainChunk class from gui to libsync
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:39 +02:00
Michael Schuster 203a2ce003
Move QKeychain::NoBackendAvailable error handling to KeychainChunk class
Originally this was in the WebFlowCredentials class. Since we've abstracted everything
from there already, let's also move this in case some other code may use
KeychainChunk::ReadJob prior to WebFlowCredentials.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-07-06 21:51:36 +02:00
Kevin Ottens d3d713ff9c Fix the hover for the other menu items
Ultimately we would avoid the code duplication by creating our own
proper QQC2 style instead of directly tuning everything. That's a battle
for another time (more elements would need to be adjusted for that, I
don't want to dilute this branch too much).

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-06 20:14:57 +02:00
Dominique Fuchs 180f191014 Fix hover cutoff in apps menu
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-07-06 20:14:57 +02:00
asemmar d5587e386c fixed bad spelling of word 'retreive' except in sqlite dependancy
Signed-off-by: asemmar <anis.semmar@itron.com>
2020-07-06 09:46:14 +02:00
Camila bd9aae8ca2 Don't display quota information when the user has no quota.
- The code handling the api response was not up to date with the latest
api changes.
- Unlimited quota display: use qint64 to avoid data loss
- Change total with quota: total holds the quota total and not the storage total.

Signed-off-by: Camila <hello@camila.codes>
2020-07-02 20:06:12 +02:00
Camila fdc160460b Fix #2085 new tray menu.
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>
2020-07-02 19:21:10 +02:00
Kevin Ottens 542d303313 Reduce interaction with e2ee folders when in the wizard
During the wizard we currently don't have much information about the
encrypted folders. In particular we can only display their mangled names
which is far from ideal for the user to make an informed choice.

That's why in the wizard we now forbid creation of subfolders in e2ee
folders and we also don't display subfolders of e2ee folders.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens cb9ba9702b Properly display encryption status for non root folder connection
Since the e2e oracle works only in term of absolute remote paths and
that our model x._path was relative, we need to properly convert.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:58:29 +00:00
Kevin Ottens fdceb1f2d2 Allow to control logFlush from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:10:56 +02:00
Kevin Ottens f557dd7792 Allow to control logDir from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:10:53 +02:00
Kevin Ottens be2d9d4838 Allow to control logExpire from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 16:10:50 +02:00
Kevin Ottens 808fb17809 Allow to control log debug from the config file
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 15:56:23 +02:00
Kevin Ottens 53c31f5fed Make sure all our logging categories start with nextcloud.
Otherwise it was a bit confusing and annoying for filter rules:
e.g. "nextcloud.sync.*" vs "sync.*".

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-07-01 15:39:52 +02:00
Valdnet 01e6f73da5 Change the space character to a dot
Change the space character to a dot in the text string
2020-07-01 14:11:14 +02:00
Kevin Ottens 01d44dd3a1 Display folder names demangled in the settings
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens fc9a8c4496 Mark user strings for translation
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 74978a23fb Move the encrypt folder logic in a reusable job class
This way this whole logic isn't stuck into the settings dialog anymore.
Also cleaned up the unused "decrypt folder" logic.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens b3fb730d5a Use the propagator to trigger the e2e info fetch
This is a much better place than the GUI, this way we ensure the
propagator is always operating of up to date information. Previously if
the propagator kicked in without user interaction from startup (not
showing the settings dialog) it would have no E2E information available
whatsoever... unsurprisingly it would thus take wrong information at
every turn.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 76fbbfefa5 Fix typo
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 839c056b8d Don't show the encrypt action in subfolders of encrypted folders
Since we want to move to a place where the encryption of subfolders is
always enforced it makes no sense to leave it in control of the user.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 3bbc54ee6c Fix typo
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Kevin Ottens 03ecaab259 Capture the pointer to info by value
Using a reference capture is a disaster waiting to happen here, if for
some reason we'd move from exec() to popup() for the menu below we'd be
getting garbage in the lambda call.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-30 11:29:08 +02:00
Stephan Beyer 20b58219e4 Hide Systray's auxiliary positioning methods from public and Qml
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-26 12:03:26 +00:00
Stephan Beyer 080505ef46 Simplify tray window positioning
The Qml position setting code is moved to C++, which allowed to get rid
of the currentScreenIndex() method (which seemed to be just a detour to
pass the screen from C++ to Qml).

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-26 12:03:26 +00:00
Michael Schuster d71249bb6e Fix crash in UserModel::currentUser() and add more sanity checks
Commit 07bede8 (PR #1892) introduced a new helper method currentUser()
that didn't check for _users.count() thus causing to throw an
"index out of range" exception when no accounts are configured.

This commit uses the opportunity to add more sanity checks to UserModel.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-25 20:52:30 +02:00
Stephan Beyer f90e0e519f Make Systray's _trayEngine a QPointer
This is just safer.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-24 17:25:20 +02:00
Stephan Beyer 08cb289b8c Fix SEGV (by circular ownership) at exit
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>
2020-06-24 13:50:17 +02:00
Stephan Beyer 6adb798728 Let Systray constructor call its base class constructor
Although I see no behavioral difference, this is probably
a good idea.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-24 13:42:26 +02:00
Stephan Beyer 3f4ed0883a Make sure the menu separator uses Style.menuBorder color
In case the default color value will ever change, this
commit makes sure that the colors of the menu border and
the menu separator coincide.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-22 06:54:57 +00:00
Michael Schuster 92c8d6836b
Fix libsync exports for proxy changes in #1886
Build failed on Windows, missing libsync export for printQNetworkProxy after
moving ClientProxy class from gui to libsync.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-18 21:05:11 +02:00
Roeland Jago Douma 50dcab5f88
Move the proxyfiles to libsync where they make more sense
Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-18 18:38:06 +02:00
Kevin Ottens 2ce1669ceb Bring forward the main systray dialog on second execution
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>
2020-06-17 16:01:49 +00:00
Kevin Ottens a6873f556b Also show the window on right click
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>
2020-06-17 16:01:49 +00:00
Kevin Ottens 73a689bc39 Don't call method on potentially null object
We were calling accountState() on a "folder" member which could be
nullptr. In fact this would happen any time one right click on a file
outside of a sync dir under Windows, this thus led to a crash.

Since the capabilities variable was unused anyway, we just removed it.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 19:15:53 +02:00
Kevin Ottens 4f7a6cfb1d Make activity items with a link clickable
We then get more items clickable, in particular the bottom one proposing
to open the activity application. Now we can click it and it opens the
activity application straight away.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Kevin Ottens f147e5a66f Don't use a bright blue color for menus
As advised, use a light gray instead, this electric blue was a bit too
much.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Kevin Ottens bc863584db Don't duplicate file name in the info line
For the "Activity" type activities, displayPath contains the file name
which is also in the subject. This was redundant, so now we don't
display an info line at all for that type of activities.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Kevin Ottens f8e2e3403a Close all menus on window show
We previously missed the app menu which wasn't closed.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-16 18:52:20 +02:00
Nicolas Fella 07bede8a56 Use properties to get user details
Convert imperative QML code to declarative code using property bindings

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-16 15:01:37 +02:00
Nicolas Fella a12205f322 Port from context properties to singletons
Context properties are deprecated and will be removed in Qt 6.
QML singletons are the better option here, especially given that
UserModel and UserAppsModel already are singletons.

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-16 14:34:59 +02:00
Nicolas Fella be2e5266aa Create HeaderButton QML component
Deduplicate the Button code by moving it into a separate file.

Also use the same background code for the apps button since as far as I can tell it didn't behave any different

Signed-off-by: Nicolas Fella <nicolas.fella@gmx.de>
2020-06-15 20:52:41 +02:00
Kevin Ottens d3d99b2d9d Add some debug output for the window placement
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Michael Schuster 44a9200c5d Fix crash caused by setting Tray window screen pointer on the QML side
Seems like Qt sometimes doesn't like the QML window's screen property to be set
to a C++ (QVariant) pointer value, so we use the index: Qt.application.screens[]

See Qt docs: https://doc.qt.io/qt-5/qml-qtquick-window-window.html#screen-prop

This fix returns the matching window's index from the QGuiApplication::screens()
list to the QML side, instead of the window pointer.

Steps to reproduce the crash with the previous code:
- Open the Tray menu and close it a few times,
  or scroll randomly up and down in its activity list.

Tested with Qt 5.12.5

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-15 12:32:25 +00:00
Kevin Ottens f15a9cfc82 Try make taskbar position heuristic more readable
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens 5848a1575b Make the reference point independent of the window
This leads to simplifying the computation code quite a bit as well.
Indeed we're separating concern between what is window size dependent or
not and that shows.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens 40824dc427 Get rid of screenIndex
This was leading to the same logic being duplicated several times. It's
fine to return the QScreen* on the QML side directly but wrapped into a
QVariant.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens 6c6dfb15a7 Move all the position computation on the C++ side
The API is just more convenient there, the rect and point types on the
QML side are just pale shadow of their C++ counterparts.

Also improved a bit the constness of the Systray class.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens 83b36b4ab0 Rename tbOrientation into taskbarOrientation
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens aa90237e94 Introduce a screenRect as coordinate space
The top left corner of that screenRect is (0,0) or based on
(virtualX,virtualY) depending on the platform. This leads to easier
reduction in code duplication.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Kevin Ottens 65e8f33ccf Use TaskBarPosition enum on the QML side
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-15 12:32:25 +00:00
Dominique Fuchs a6f918f3c2 More simplifications, also transfer of more tray positioning logic to C++ backend.
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-06-15 12:32:25 +00:00
Dominique Fuchs f44df7f61a Major multi monitor improvements and rewrite of tray window positioning
Signed-off-by: Dominique Fuchs <32204802+DominiqueFuchs@users.noreply.github.com>
2020-06-15 12:32:25 +00:00
Michael Schuster 456c1eadbe
Simplify nullptr comparisons where appropriate
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>
2020-06-11 00:27:30 +02:00
Stephan Beyer 0f620acc1f Replace prefixing of paths with file:// by QUrl::fromLocalFile()
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 16:45:46 +02:00
Stephan Beyer 749070a29c Hide openLocalFolderButton if no local folder is configured
Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 16:45:46 +02:00
Stephan Beyer 131c1f1bac Fix crash on opening unconfigured local folder
When you try to open the local sync folder (by clicking on the
folder symbol) for an account that has no folder configured,
the client crashes.

This commit changes User::openLocalFolder() to do nothing in
case no local folder is configured.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 16:45:38 +02:00
Stephan Beyer 2946c335ba Change width of app menu
The app menu had a width based on the header button size which was
way too narrow to display its content.

This commit changes the width based on the contents (menu items) of
the menu, however, limiting the maximum width to half the window width.

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-09 14:53:51 +02:00
Stephan Beyer ea16804751 Replace NULL by nullptr in all C++ files
We keep NULL in the pure C files in src/csync/std and test/csync.

We also replace Doxygen documentation referring to "NULL" to
"\c nullptr" (formatted as code).

Signed-off-by: Stephan Beyer <s-beyer@gmx.net>
2020-06-08 20:07:50 +02:00
Roeland Jago Douma fba69de096 Don't show a message box if the entered url returned an error
BEtter to now just display clickable links etc.

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
2020-06-08 19:40:16 +02:00
Michael Schuster e6389959ce macOS: Build nextcloudcmd after gui and run macdeployqt with the -executable option
- src/CMakeLists.txt: Switch build order to build cmd before gui
- src/gui/CMakeLists.txt: Use the -executable option for a combined run of macdeployqt

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 14:39:42 +02:00
Michael Schuster acb56be528 macOS: Use macdeployqt instead of the old admin/osx/macdeployqt.py
In order to build the new 2.7 releases (new QML dependencies) without manually
modifying the old Python script each time, rely on Qt's standard tool instead.

This should streamline the build systems for upcoming dependency changes.

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 14:39:42 +02:00
Michael Schuster 221e5c5fc4
Improve command line version info and help display to streamline gui and cmd
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-06-07 14:20:33 +02:00
Kevin Ottens 0503be65ae Cleanup the missing braced init list returns
Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:14:18 +02:00
Kevin Ottens e3e262e42e Use default member init when applicable
This also fixes a couple of warnings at places (out of order init for
instance) and a potential bug in the webflow credentials / qtkeychain
integration.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:10:39 +02:00
Kevin Ottens 965909f7fa Add missing auto opportunities
Somehow forgot to run it on the updater code

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-03 16:02:43 +02:00
Camila San 3bae570f29 Do not declare local variables without an initial value.
Signed-off-by: Camila San <hello@camila.codes>
2020-06-03 07:50:40 +00:00
Kevin Ottens 02a28325a8 Show broken encryption icon only in non-empty folders
This should address Tobias' concerns regarding the icon being
misleading. Now we basically do the following inside an encrypted folder
parent:
 * encrypted folders get the encrypted icon;
 * non-encrypted empty folders get the regular folder icon;
 * non-encrypted non-empty folders get the broken encryption icon.

Signed-off-by: Kevin Ottens <kevin.ottens@nextcloud.com>
2020-06-02 15:50:18 +00:00
Ivan Čukić c800d9149e Show a broken lock icon for unencrypted subdirectory
The E2E application allows creating unencrypted subdirectories
in an encrypted parent. This is a big privacy problem.

This patch shows a red broken lock icon for these subdirectories
in the NC client UI.

Signed-off-by: Ivan Čukić <ivan.cukic@kde.org>
2020-06-02 15:50:18 +00:00
Michael Schuster 6ec69a700d
ShareDialog: Pointer cosmetics
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-29 20:57:52 +02:00
Michael Schuster ae0ea12501
Merge branch 'master' into traywindow-listview-actions 2020-05-29 19:08:21 +02:00
Michael Schuster ba4d109315
ShareDialog: Add further checks for the _manager member ptr
Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-29 18:29:47 +02:00
Michael Schuster efdef8535f
ShareDialog: Fix crash, properly init member pointers
_manager ptr only got initialized in the constructor when sharingPossible was set to true

Changes:
- Move member ptr inits from constructor to the header file's class definition
- Init _manager: set to nullptr too
- Add check for _manager to avoid crash in showSharingUi()

Signed-off-by: Michael Schuster <michael@schuster.ms>
2020-05-29 18:12:36 +02:00