1
0
Fork 0
Commit Graph

13625 Commits

Author SHA1 Message Date
Michael Schuster 1d745535f7
KeychainChunk: Fix error handling in ReadJob::slotReadJobDone
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 12:13:26 +01:00
Michael Schuster 3184aeed43
Add temporary Flow2 translation (german)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 11:06:17 +01:00
Michael Schuster 3faf010b55
Update translations
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:18:57 +01:00
Michael Schuster 163c80e203
Fix date in ActivityWidget and remove unnecessary string conversion
The local date and time value was converted into a string, just to be converted
into another string, to be converted to a value once again, returning zero as
the result. This caused the widget to always display "now".

Looks like this was a simply copy and paste mistake from this line in
ActivityListModel::slotActivitiesReceived:

a._dateTime = QDateTime::fromString(json.value("date").toString(), Qt::ISODate);

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e07859fb3c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:52 +01:00
Michael Schuster 73462e97aa
Heavy refactoring: Windows workaround for >= 4k (4096 bit) client-cert SSL keys and large certs
With QtKeychain on Windows, storing larger keys or certs in one keychain entry causes the
following error due to limits in the Windows APIs:
    Error: "Credential size exceeds maximum size of 2560"

This fix implements the new wrapper class KeychainChunk with wrapper jobs ReadJob and WriteJob
to encapsulate the QKeychain handling of ReadPasswordJob and WritePasswordJob with binaryData
but split every supplied keychain entry's data into 2048 byte chunks, on Windows only.

The wrapper is used for all keychain operations in WebFlowCredentials, except for the server password.

All finished keychain jobs now get deleted properly, to avoid memory leaks.

For reference also see previous fixes:
- https://github.com/nextcloud/desktop/pull/1389
- https://github.com/nextcloud/desktop/pull/1394

This should finally fix the re-opened issue:
- https://github.com/nextcloud/desktop/issues/863

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 9b034a2eb0)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:52 +01:00
Michael Schuster 6f4144a464
Flow2AuthWidget: Minor fixes and improvements
- Improve status messages

- Add a counter to make sure that "Link copied to clipboard." is visible for
  three seconds and to not enable the buttons too early

- Add more space between buttons and status

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit bd9652b24c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:51 +01:00
Michael Schuster 9820464545
Flow2: Refactor UI into Flow2AuthWidget only and improve Flow2Auth
- Flow2AuthCredsPage:
  - Remove .ui file and embed Flow2AuthWidget into layout

- Flow2AuthWidget:
  - Make use generic for Flow2AuthCredsPage and WebFlowCredentialsDialog
  - Fix _errorLabel to render HTML tags instead of dumping them as plain text

- Flow2Auth:
  - Explicitly start auth with startAuth(account) instead of using constructor
  - Take control of copying the auth link to clipboard
  - Request a new auth link on copying, to avoid expiry invalidation
  - Use signals statusChanged() and result() to be more verbose (status, errors)
  - Change timer invocation and add safety bool's to avoid weird behaviour when
    the user triggers multiple link-copy calls (fetchNewToken)

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 8b5f09305c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:51 +01:00
Michael Schuster 3ecd7823f9
Add new HeaderBanner class for WebFlowCredentialsDialog
New widget on top of the layout, based on Qt's own modern wizard header banner.

This should improve the user's perception of the dialog.

Encapsulate the existing layout into a container layout to allow the banner taking
the full width of the dialog.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 6d033f2964)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:51 +01:00
Michael Schuster 9b504eaddd
Make WebFlowCredentialsDialog cancellation- and deletion-safe
- Add new signal to let WebFlowCredentials know and emit asked() to also
  tell AccountState that the user won't authenticate, and triggering
  log-out state in the settings window.

- Use deleteLater() to safely delete WebFlowCredentialsDialog, so
  that Qt can free it at the right time and without crashes.
  Do the same with it's _webView and _flow2AuthWidget on closeEvent().

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 0bcac1882a)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:51 +01:00
Michael Schuster 838ca6cba0
WebFlowCredentialsDialog: Bring re-auth dialog to top (raise) on error
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit b6b04aeff8)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:51 +01:00
Michael Schuster 7e5e40d5c4
Flow2: Make ProgressIndicator's background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit a69aed80e6)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:50 +01:00
Michael Schuster abd8d1fda1
Flow2: Add poll status text, ProgressIndicator and countdown timer
Also enable / disable buttons during polling.

This aims to make the authentication status more transparent and should avoid the
impression that the client is perhaps doing nothing.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e81f972270)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:50 +01:00
Michael Schuster 0a3491f332
Small fixes and code cleanup
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 542590db7c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:50 +01:00
Michael Schuster 15d9ca2b00
Flow2: Poll for re-auth result upon WebFlowCredentialsDialog window activation
Since the default remote poll interval has been re-raised recently to 30 seconds,
the delay between clicking "Grant access" in the browser and fetch and showing success
in the dialog may seem erroneous to the users and tempt them to click "Re-open browser"
again, causing the whole login process to restart.

This commit implements an event handler to pass the dialog's window activation
event down to the Login Flow v2 widget, in order to allow it to poll earlier.

See previous commits for dependent implementation details.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e04aae94bc)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:50 +01:00
Michael Schuster 7682749415
WebFlowCredentialsDialog: Bring re-auth dialog to top (raise) upon showing SettingsDialog
Purpose: The floating re-auth windows of the WebFlowCredentialsDialog often get hidden behind
the SettingsDialog, and the users have to minimize a lot of other windows to find them again.

See previous commit for dependent implementation details.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit aa18667905)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:50 +01:00
Michael Schuster a18fc5b5c9
Add helper slots and signals to catch SettingsDialog's window activation events
Signal the SettingsDialog's window activation event down to ownCloudGui and Application,
so that other classes can hook in to get notified when the SettingsDialog is being shown
again.

This approach has been chosen because we otherwise would have to deal with new instance
pointers of the current SettingsWindow - but Application is already there ;-)

Purpose: The floating re-auth windows of the WebFlowCredentialsDialog often get hidden
behind the SettingsDialog, and the users have to minimize a lot of other windows to find
them again. This commit implements the preparation for the upcoming fix commit.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit addb27a085)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:50 +01:00
Michael Schuster 96783a9b80
Flow2: Use ownCloudGui::raiseDialog to bring account setup wizard to top (raise) on auth result
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit be10d5200f)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:49 +01:00
Michael Schuster 258c2cee2e
Flow2: Poll for auth result upon account setup wizard window activation
Since the default remote poll interval has been re-raised recently to 30 seconds,
the delay between clicking "Grant access" in the browser and fetch and showing success
in the wizard may seem erroneous to the users and tempt them to click "Re-open browser"
again, causing the whole login process to restart.

This commit implements an event handler to pass the wizard's window activation
event down to the Login Flow v2 page, in order to allow it to poll earlier.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e8348612b4)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:49 +01:00
Michael Schuster 65ff3c0de1
Flow2: Bring account setup wizard to top (raise) on auth result
Show and raise the wizard on success / error in the Login Flow v2 auth.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 3a160a4dce)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:49 +01:00
Michael Schuster 6879c9f1c9
Fix issue #1237: White text on almost-white background
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit ccd20f0172)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:49 +01:00
Michael Schuster fade8465e4
Fix folder opening in ActivityListModel
After fixing the crash in the previous commit, double-clicking on Activity list rows still didn't work.

This fix partly reverts commit 8546d53b05 in ActivityItemDelegate::PathRole
of ActivityListModel::data, but adds a new check for relPath's existence in line 74.

I'm assuming the previous change there has been done to shorten the code and avoid opening the user's home
folder upon clicking entries which file value is "App Password". The new path-check takes care of that too now.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit c03bc8540c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:49 +01:00
Michael Schuster 76b5c6b6d4
Fix crash in ActivityListModel (fixes #1693)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 003acb7254)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:49 +01:00
Michael Schuster bdd0cc4dc3
Show date and time in activity log (fixes issue #1683)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit b961b683d6)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:16:48 +01:00
Michael Schuster 876b1e239e
Fix build (missing refactoring)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit a7dade979c)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:53 +01:00
Michael Schuster da2007c7f6
Mac and high-dpi displays: Add workaround in ActivityItemDelegate to show full uncropped activity's actionText and timeText
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 3a2caf61e5)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:53 +01:00
Michael Schuster 7a33cb97cd
Make all ProgressIndicator's background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit b5ed16088a)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:53 +01:00
Michael Schuster 7a18a58fae
Make OwncloudWizard and its pages background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit e4a20b9e72)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:53 +01:00
Michael Schuster fcc9d02bcc
Remove unnecessary string translation and copy in ActivityItemDelegate
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 37e5fe786f)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:52 +01:00
Michael Schuster 98238669fe
Remove unnecessary breaks in ActivityListModel
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 643995528b)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:52 +01:00
Michael Schuster a80de38517
Make ActivityItemDelegate background- and selection-aware (Dark-/Light-Mode switching)
Also implement cached member icons in ActivityListModel and return their enums to
ActivityItemDelegate instead of always recreating them for each call to paint().

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit ecd17f2ea2)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:52 +01:00
Michael Schuster 4cb75d91f9
Refactor ActivitySettings: Rename member variable ui to _ui
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit bf0bf2c1b6)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:52 +01:00
Michael Schuster 55e4dceeb7
Make AccountSettings and ActivitySettings background-aware (Dark-/Light-Mode switching)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit acedf362b6)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:52 +01:00
Michael Schuster 0006b35abf
Change error link colour in AccountSettings::showConnectionLabel
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 3b580eeca7)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:51 +01:00
Michael Schuster b153391cbf
Add new Theme helper method to custom-colourize links
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 6adfff1f13)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:51 +01:00
Michael Schuster c0659a3124
Change Dark Mode link colour
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 7d542d7989)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-24 09:15:49 +01:00
Michael Schuster de8a7aa680
Fix Activity List: Add check to avoid first empty entry
Add checks to ActivityListModel::combineActivityLists in order to avoid adding
empty Activity entries to the _finalList.

The previous implementation always added an empty entry to the top of the list because
_notificationIgnoredFiles was appended without checking (_listOfIgnoredFiles.size() > 0).

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit cc21d175f1)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-18 03:31:32 +01:00
Michael Schuster 03b11693a3
Fix build for stable-2.6 (changes from PR #1651)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 22:45:47 +01:00
Camila San 23f2d79f70
Bump version to 2.6.2 2019-12-09 21:51:13 +01:00
Michael Schuster f6db365391
Update translations
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:48:20 +01:00
Michael Schuster 95f74ceb1f
macOS: Rename 'Explorer' appropriately on non-Windows
- Rename it to 'Finder' on macOS.
- This way we also avoid having the whole string re-translated on Transifex.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit b754eacd74)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:48 +01:00
Michael Schuster 91be4961d7
Make the ShareDialog background-aware (Dark-/Light-Mode switching)
Use customizeStyle() to change link colours, icons and pixmaps in the ShareDialog and notify
it's widgets via slots.

TODO - known issue (macOS):
- The background and font colours in the ShareUserLine widget still stay the same.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 7ce8a6a201)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:48 +01:00
Michael Schuster b3eb16bfd3
Make SettingsDialog background-aware (Dark-/Light-Mode switching)
Use customizeStyle() to change link colours in the SettingsDialog and notify it's widgets via slots.

Also modify the background colour of the errors messages in AccountSettings::showConnectionLabel
to always use an appropiate colour for it's custom-defined background.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 789a2a7ae3)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:47 +01:00
Michael Schuster 52d91ce198
Implement and move some colour-aware helper methods into the Theme class
This introduces a new method to change the colours in the links in QLabel's.
Utilizes a custom crafted RegEx function to replace already-coloured links.

Moved code is based on stuff from the SettingsDialog class.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit be4fc6b887)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:47 +01:00
Michael Schuster c49efcc137
Pick from upstream: Fix too low contrast when tab is selected
The low contrast is also a problem with the Dark Mode on macOS.

For reference please see:
- Commit: 413ef5e96d
- Issue: https://github.com/owncloud/client/issues/7512

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 2dae31486a)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:47 +01:00
Michael Schuster c14556153f
Fix SSL-button's info background color for Dark Mode
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 71f66c6229)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:47 +01:00
Michael Schuster 5e1a2a423f
Remove submodule qtmacgoodies and the MacSettingsDialog class
Reverts back to the SettingsDialog class because of bugs and glitches with
more recent Qt versions (Qt 5.12) and with the macOS Dark Mode.

See upstream: https://github.com/owncloud/client/pull/7492

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit b4f926ded7)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-09 21:46:44 +01:00
Michael Schuster 3ac1ba079a
Fix deleteKeychainEntries: Stay consistent with job->setInsecureFallback(false)
We never fall back to the insecure variant in the whole codebase, so don't do it here.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 5869b93acb)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 03:10:30 +01:00
Michael Schuster b7a9cd1d45
Fix Windows key-chunk deletion (too paranoid)
Clear the key chunk buffer, but don't set _clientSslKeyChunkCount to zero because we need it later for deleteKeychainEntries

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit b15eb27aa9)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 03:10:29 +01:00
Michael Schuster c7b0ce036d
Fix member variable name from last refactoring (Windows code)
Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 336b64a569)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 03:10:29 +01:00
Michael Schuster f5afa07b0a
Fix Remote Wipe keychain storage
In certain cases don't write the app password in Account::writeAppPasswordOnce:
- id() is empty: This always happend once the Account Wizard showed the folder selection
- appPassword is empty: Caused by Logout -> Relaunch, preventing remote wipe on relaunch

Implement some logging to ease debugging in the future.

Signed-off-by: Michael Schuster <michael@schuster.ms>
(cherry picked from commit 6a49e787bb)
Signed-off-by: Michael Schuster <michael@schuster.ms>
2019-12-08 03:10:29 +01:00