forked from Silverfish/proton-bridge
Compare commits
12 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| ba712516ff | |||
| 865ac44037 | |||
| 7d41062ae9 | |||
| f3c69faf8b | |||
| e353dc554d | |||
| 415d08b411 | |||
| 62499a5630 | |||
| d6d7ea592e | |||
| 5033e9718c | |||
| 16f9dc43cb | |||
| b8f27cc7d2 | |||
| 6b10da524c |
@ -43,6 +43,10 @@ lint:
|
||||
stage: test
|
||||
only:
|
||||
- branches
|
||||
before_script:
|
||||
- mkdir -p .cache/bin
|
||||
- export PATH=$(pwd)/.cache/bin:$PATH
|
||||
- export GOPATH="$CI_PROJECT_DIR/.cache"
|
||||
script:
|
||||
- env GOMAXPROCS=$(( ${CI_TAG_CPU} / 2 )) make lint
|
||||
tags:
|
||||
|
||||
@ -56,7 +56,6 @@ linters:
|
||||
- godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false]
|
||||
- gofmt # Gofmt checks whether code was gofmt-ed. By default this tool runs with -s option to check for code simplification [fast: true, auto-fix: true]
|
||||
- goimports # Goimports does everything that gofmt does. Additionally it checks unused imports [fast: true, auto-fix: true]
|
||||
- golint # Golint differs from gofmt. Gofmt reformats Go source code, whereas golint prints out style mistakes [fast: true, auto-fix: false]
|
||||
- gosec # Inspects source code for security problems [fast: true, auto-fix: false]
|
||||
- misspell # Finds commonly misspelled English words in comments [fast: true, auto-fix: true]
|
||||
- nakedret # Finds naked returns in functions greater than a specified function length [fast: true, auto-fix: false]
|
||||
|
||||
@ -2,8 +2,7 @@
|
||||
|
||||
By making a contribution to this project:
|
||||
|
||||
1. I assign any and all copyright related to the contribution to
|
||||
Proton Technologies AG;
|
||||
1. I assign any and all copyright related to the contribution to Proton AG;
|
||||
2. I certify that the contribution was created in whole by me;
|
||||
3. I understand and agree that this project and the contribution are public
|
||||
and that a record of the contribution (including all personal information I
|
||||
|
||||
123
COPYING_NOTES.md
123
COPYING_NOTES.md
@ -1,5 +1,5 @@
|
||||
# Copying
|
||||
Copyright (c) 2020 Proton Technologies AG
|
||||
Copyright (c) 2022 Proton AG
|
||||
|
||||
Proton Mail Bridge is free software: you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the Free
|
||||
@ -15,58 +15,79 @@ ProtonMail Bridge. If not, see https://www.gnu.org/licenses.
|
||||
|
||||
|
||||
# Dependencies
|
||||
ProtonMail Bridge app includes the following libraries from Proton Technologies AG:
|
||||
|
||||
* [GopenPGP library](https://gopenpgp.org/) | The [MIT License](https://github.com/ProtonMail/gopenpgp/blob/master/LICENSE).
|
||||
|
||||
Proton Mail Bridge includes the following 3rd party software:
|
||||
|
||||
* [The Go Project libraries](https://golang.org/project/) | Available under [BSD license](https://golang.org/LICENSE)
|
||||
* [Qt Go binding](https://github.com/therecipe/qt) | Available under [LGPLv3 license](https://github.com/therecipe/qt/blob/master/LICENSE)
|
||||
* [Qt](https://www.qt.io/) | Available under [multiple licences](https://www.qt.io/licensing)
|
||||
* [Font Awesome 4.7.0](https://fontawesome.com/v4.7.0/) | Available under [multiple licenses](https://fontawesome.com/v4.7.0/license/)
|
||||
|
||||
* [notificator](https://github.com/0xAX/notificator) | Available under [license](https://github.com/0xAX/notificator/blob/master/LICENSE)
|
||||
* [ishell](https://github.com/abiosoft/ishell) | Available under [license](https://github.com/abiosoft/ishell/blob/master/LICENSE)
|
||||
* [readline](https://github.com/abiosoft/readline) | Available under [license](https://github.com/abiosoft/readline/blob/master/LICENSE)
|
||||
* [singleinstance](https://github.com/allan-simon/go-singleinstance) | Available under [license](https://github.com/allan-simon/go-singleinstance/blob/master/LICENSE)
|
||||
* [cascadia](https://github.com/andybalholm/cascadia) | Available under [license](https://github.com/andybalholm/cascadia/blob/master/LICENSE)
|
||||
* [gocertifi](https://github.com/certifi/gocertifi) | Available under [license](https://github.com/certifi/gocertifi/blob/master/LICENSE)
|
||||
* [logex](https://github.com/chzyer/logex) | Available under [license](https://github.com/chzyer/logex/blob/master/LICENSE)
|
||||
* [test](https://github.com/chzyer/test) | Available under [license](https://github.com/chzyer/test/blob/master/LICENSE)
|
||||
* [godog](https://github.com/cucumber/godog) | Available under [license](https://github.com/cucumber/godog/blob/master/LICENSE)
|
||||
* [wincred](https://github.com/danieljoos/wincred) | Available under [license](https://github.com/danieljoos/wincred/blob/master/LICENSE)
|
||||
* [credential-helpers](https://github.com/docker/docker-credential-helpers) | Available under [license](https://github.com/docker/docker-credential-helpers/blob/master/LICENSE)
|
||||
* [imap](https://github.com/emersion/go-imap) | Available under [license](https://github.com/emersion/go-imap/blob/master/LICENSE)
|
||||
* [imap-appendlimit](https://github.com/emersion/go-imap-appendlimit) | Available under [license](https://github.com/emersion/go-imap-appendlimit/blob/master/LICENSE)
|
||||
* [imap-idle](https://github.com/emersion/go-imap-idle) | Available under [license](https://github.com/emersion/go-imap-idle/blob/master/LICENSE)
|
||||
* [imap-quota](https://github.com/emersion/go-imap-quota) | Available under [license](https://github.com/emersion/go-imap-quota/blob/master/LICENSE)
|
||||
* [sasl](https://github.com/emersion/go-sasl) | Available under [license](https://github.com/emersion/go-sasl/blob/master/LICENSE)
|
||||
* [smtp](https://github.com/emersion/go-smtp) | Available under [license](https://github.com/emersion/go-smtp/blob/master/LICENSE)
|
||||
* [textwrapper](https://github.com/emersion/go-textwrapper) | Available under [license](https://github.com/emersion/go-textwrapper/blob/master/LICENSE)
|
||||
* [vcard](https://github.com/emersion/go-vcard) | Available under [license](https://github.com/emersion/go-vcard/blob/master/LICENSE)
|
||||
* [color](https://github.com/fatih/color) | Available under [license](https://github.com/fatih/color/blob/master/LICENSE.md)
|
||||
* [shlex](https://github.com/flynn-archive/go-shlex) | Available under [license](https://github.com/flynn-archive/go-shlex/blob/master/COPYING)
|
||||
* [raven](https://github.com/getsentry/raven-go) | Available under [license](https://github.com/getsentry/raven-go/blob/master/LICENSE)
|
||||
* [resty](https://github.com/go-resty/resty) | Available under [license](https://github.com/go-resty/resty/blob/master/LICENSE)
|
||||
* [mock](https://github.com/golang/mock) | Available under [license](https://github.com/golang/mock/blob/master/LICENSE)
|
||||
* [cmp](https://github.com/google/go-cmp) | Available under [license](https://github.com/google/go-cmp/blob/master/LICENSE)
|
||||
* [gopherjs](https://github.com/gopherjs/gopherjs) | Available under [license](https://github.com/gopherjs/gopherjs/blob/master/LICENSE)
|
||||
* [multierror](https://github.com/hashicorp/go-multierror) | Available under [license](https://github.com/hashicorp/go-multierror/blob/master/LICENSE)
|
||||
* [bcrypt](https://github.com/jameskeane/bcrypt) | Available under [license](https://github.com/jameskeane/bcrypt/blob/master/LICENSE)
|
||||
* [html2text](https://github.com/jaytaylor/html2text) | Available under [license](https://github.com/jaytaylor/html2text/blob/master/LICENSE)
|
||||
* [enmime](https://github.com/jhillyerd/enmime) | Available under [license](https://github.com/jhillyerd/enmime/blob/master/LICENSE)
|
||||
* [osext](https://github.com/kardianos/osext) | Available under [license](https://github.com/kardianos/osext/blob/master/LICENSE)
|
||||
* [keychain](https://github.com/keybase/go-keychain) | Available under [license](https://github.com/keybase/go-keychain/blob/master/LICENSE)
|
||||
* [aurora](https://github.com/logrusorgru/aurora) | Available under [license](https://github.com/logrusorgru/aurora/blob/master/LICENSE)
|
||||
* [dns](https://github.com/miekg/dns) | Available under [license](https://github.com/miekg/dns/blob/master/LICENSE)
|
||||
* [uuid](https://github.com/myesui/uuid) | Available under [license](https://github.com/myesui/uuid/blob/master/LICENSE)
|
||||
* [jsondiff](https://github.com/nsf/jsondiff) | Available under [license](https://github.com/nsf/jsondiff/blob/master/LICENSE)
|
||||
* [logrus](https://github.com/sirupsen/logrus) | Available under [license](https://github.com/sirupsen/logrus/blob/master/LICENSE)
|
||||
* [golang](https://github.com/skratchdot/open-golang) | Available under [license](https://github.com/skratchdot/open-golang/blob/master/LICENSE)
|
||||
* [testify](https://github.com/stretchr/testify) | Available under [license](https://github.com/stretchr/testify/blob/master/LICENSE)
|
||||
* [uuid](https://github.com/twinj/uuid) | Available under [license](https://github.com/twinj/uuid/blob/master/LICENSE)
|
||||
* [cli](https://github.com/urfave/cli) | Available under [license](https://github.com/urfave/cli/blob/master/LICENSE)
|
||||
|
||||
* [BBolt](https://pkg.go.dev/go.etcd.io/bbolt/?tab=doc) | Available under [license](https://pkg.go.dev/go.etcd.io/bbolt?tab=licenses#LICENSE)
|
||||
* [testify.v1](https://gopkg.in/stretchr/testify.v1) | Available under [license](https://github.com/stretchr/testify/blob/master/LICENSE)
|
||||
<!-- START AUTOGEN -->
|
||||
* [docker-credential-helpers](https://github.com/docker/docker-credential-helpers) available under [license](https://github.com/docker/docker-credential-helpers/blob/master/LICENSE)
|
||||
* [go-imap](https://github.com/emersion/go-imap) available under [license](https://github.com/emersion/go-imap/blob/master/LICENSE)
|
||||
* [bcrypt](https://github.com/jameskeane/bcrypt) available under [license](https://github.com/jameskeane/bcrypt/blob/master/LICENSE)
|
||||
* [notificator](https://github.com/0xAX/notificator) available under [license](https://github.com/0xAX/notificator/blob/master/LICENSE)
|
||||
* [semver](https://github.com/Masterminds/semver/v3) available under [license](https://github.com/Masterminds/semver/v3/blob/master/LICENSE)
|
||||
* [go-autostart](https://github.com/ProtonMail/go-autostart) available under [license](https://github.com/ProtonMail/go-autostart/blob/master/LICENSE)
|
||||
* [go-crypto](https://github.com/ProtonMail/go-crypto) available under [license](https://github.com/ProtonMail/go-crypto/blob/master/LICENSE)
|
||||
* [go-imap-id](https://github.com/ProtonMail/go-imap-id) available under [license](https://github.com/ProtonMail/go-imap-id/blob/master/LICENSE)
|
||||
* [go-rfc5322](https://github.com/ProtonMail/go-rfc5322) available under [license](https://github.com/ProtonMail/go-rfc5322/blob/master/LICENSE)
|
||||
* [go-srp](https://github.com/ProtonMail/go-srp) available under [license](https://github.com/ProtonMail/go-srp/blob/master/LICENSE)
|
||||
* [go-vcard](https://github.com/ProtonMail/go-vcard) available under [license](https://github.com/ProtonMail/go-vcard/blob/master/LICENSE)
|
||||
* [gopenpgp](https://github.com/ProtonMail/gopenpgp/v2) available under [license](https://github.com/ProtonMail/gopenpgp/v2/blob/master/LICENSE)
|
||||
* [goquery](https://github.com/PuerkitoBio/goquery) available under [license](https://github.com/PuerkitoBio/goquery/blob/master/LICENSE)
|
||||
* [ishell](https://github.com/abiosoft/ishell) available under [license](https://github.com/abiosoft/ishell/blob/master/LICENSE)
|
||||
* [readline](https://github.com/abiosoft/readline) available under [license](https://github.com/abiosoft/readline/blob/master/LICENSE)
|
||||
* [go-singleinstance](https://github.com/allan-simon/go-singleinstance) available under [license](https://github.com/allan-simon/go-singleinstance/blob/master/LICENSE)
|
||||
* [logex](https://github.com/chzyer/logex) available under [license](https://github.com/chzyer/logex/blob/master/LICENSE)
|
||||
* [test](https://github.com/chzyer/test) available under [license](https://github.com/chzyer/test/blob/master/LICENSE)
|
||||
* [godog](https://github.com/cucumber/godog) available under [license](https://github.com/cucumber/godog/blob/master/LICENSE)
|
||||
* [messages-go](https://github.com/cucumber/messages-go/v16) available under [license](https://github.com/cucumber/messages-go/v16/blob/master/LICENSE)
|
||||
* [go-sysinfo](https://github.com/elastic/go-sysinfo) available under [license](https://github.com/elastic/go-sysinfo/blob/master/LICENSE)
|
||||
* [go-windows](https://github.com/elastic/go-windows) available under [license](https://github.com/elastic/go-windows/blob/master/LICENSE)
|
||||
* [go-imap-appendlimit](https://github.com/emersion/go-imap-appendlimit) available under [license](https://github.com/emersion/go-imap-appendlimit/blob/master/LICENSE)
|
||||
* [go-imap-move](https://github.com/emersion/go-imap-move) available under [license](https://github.com/emersion/go-imap-move/blob/master/LICENSE)
|
||||
* [go-imap-quota](https://github.com/emersion/go-imap-quota) available under [license](https://github.com/emersion/go-imap-quota/blob/master/LICENSE)
|
||||
* [go-imap-unselect](https://github.com/emersion/go-imap-unselect) available under [license](https://github.com/emersion/go-imap-unselect/blob/master/LICENSE)
|
||||
* [go-message](https://github.com/emersion/go-message) available under [license](https://github.com/emersion/go-message/blob/master/LICENSE)
|
||||
* [go-sasl](https://github.com/emersion/go-sasl) available under [license](https://github.com/emersion/go-sasl/blob/master/LICENSE)
|
||||
* [go-smtp](https://github.com/emersion/go-smtp) available under [license](https://github.com/emersion/go-smtp/blob/master/LICENSE)
|
||||
* [go-textwrapper](https://github.com/emersion/go-textwrapper) available under [license](https://github.com/emersion/go-textwrapper/blob/master/LICENSE)
|
||||
* [go-vcard](https://github.com/emersion/go-vcard) available under [license](https://github.com/emersion/go-vcard/blob/master/LICENSE)
|
||||
* [color](https://github.com/fatih/color) available under [license](https://github.com/fatih/color/blob/master/LICENSE)
|
||||
* [go-shlex](https://github.com/flynn-archive/go-shlex) available under [license](https://github.com/flynn-archive/go-shlex/blob/master/LICENSE)
|
||||
* [sentry-go](https://github.com/getsentry/sentry-go) available under [license](https://github.com/getsentry/sentry-go/blob/master/LICENSE)
|
||||
* [resty](https://github.com/go-resty/resty/v2) available under [license](https://github.com/go-resty/resty/v2/blob/master/LICENSE)
|
||||
* [dbus](https://github.com/godbus/dbus) available under [license](https://github.com/godbus/dbus/blob/master/LICENSE)
|
||||
* [mock](https://github.com/golang/mock) available under [license](https://github.com/golang/mock/blob/master/LICENSE)
|
||||
* [go-cmp](https://github.com/google/go-cmp) available under [license](https://github.com/google/go-cmp/blob/master/LICENSE)
|
||||
* [uuid](https://github.com/google/uuid) available under [license](https://github.com/google/uuid/blob/master/LICENSE)
|
||||
* [go-multierror](https://github.com/hashicorp/go-multierror) available under [license](https://github.com/hashicorp/go-multierror/blob/master/LICENSE)
|
||||
* [html2text](https://github.com/jaytaylor/html2text) available under [license](https://github.com/jaytaylor/html2text/blob/master/LICENSE)
|
||||
* [go-keychain](https://github.com/keybase/go-keychain) available under [license](https://github.com/keybase/go-keychain/blob/master/LICENSE)
|
||||
* [text](https://github.com/kr/text) available under [license](https://github.com/kr/text/blob/master/LICENSE)
|
||||
* [aurora](https://github.com/logrusorgru/aurora) available under [license](https://github.com/logrusorgru/aurora/blob/master/LICENSE)
|
||||
* [go-runewidth](https://github.com/mattn/go-runewidth) available under [license](https://github.com/mattn/go-runewidth/blob/master/LICENSE)
|
||||
* [dns](https://github.com/miekg/dns) available under [license](https://github.com/miekg/dns/blob/master/LICENSE)
|
||||
* [pretty](https://github.com/niemeyer/pretty) available under [license](https://github.com/niemeyer/pretty/blob/master/LICENSE)
|
||||
* [jsondiff](https://github.com/nsf/jsondiff) available under [license](https://github.com/nsf/jsondiff/blob/master/LICENSE)
|
||||
* [tablewriter](https://github.com/olekukonko/tablewriter) available under [license](https://github.com/olekukonko/tablewriter/blob/master/LICENSE)
|
||||
* [errors](https://github.com/pkg/errors) available under [license](https://github.com/pkg/errors/blob/master/LICENSE)
|
||||
* [procfs](https://github.com/prometheus/procfs) available under [license](https://github.com/prometheus/procfs/blob/master/LICENSE)
|
||||
* [du](https://github.com/ricochet2200/go-disk-usage/du) available under [license](https://github.com/ricochet2200/go-disk-usage/du/blob/master/LICENSE)
|
||||
* [logrus](https://github.com/sirupsen/logrus) available under [license](https://github.com/sirupsen/logrus/blob/master/LICENSE)
|
||||
* [bom](https://github.com/ssor/bom) available under [license](https://github.com/ssor/bom/blob/master/LICENSE)
|
||||
* [testify](https://github.com/stretchr/testify) available under [license](https://github.com/stretchr/testify/blob/master/LICENSE)
|
||||
* [qt](https://github.com/therecipe/qt) available under [license](https://github.com/therecipe/qt/blob/master/LICENSE)
|
||||
* [cli](https://github.com/urfave/cli/v2) available under [license](https://github.com/urfave/cli/v2/blob/master/LICENSE)
|
||||
* [msgpack](https://github.com/vmihailenco/msgpack/v5) available under [license](https://github.com/vmihailenco/msgpack/v5/blob/master/LICENSE)
|
||||
* [bbolt](https://go.etcd.io/bbolt) available under [license](https://github.com/etcd-io/bbolt/blob/master/LICENSE)
|
||||
* [crypto](https://golang.org/x/crypto) available under [license](https://cs.opensource.google/go/x/crypto/+/master:LICENSE)
|
||||
* [net](https://golang.org/x/net) available under [license](https://cs.opensource.google/go/x/net/+/master:LICENSE)
|
||||
* [sys](https://golang.org/x/sys) available under [license](https://cs.opensource.google/go/x/sys/+/master:LICENSE)
|
||||
* [text](https://golang.org/x/text) available under [license](https://cs.opensource.google/go/x/text/+/master:LICENSE)
|
||||
* [plist](https://howett.net/plist) available under [license](https://github.com/DHowett/go-plist/blob/main/LICENSE)
|
||||
* [docker-credential-helpers](https://github.com/ProtonMail/docker-credential-helpers) available under [license](https://github.com/ProtonMail/docker-credential-helpers/blob/master/LICENSE)
|
||||
* [go-imap](https://github.com/ProtonMail/go-imap) available under [license](https://github.com/ProtonMail/go-imap/blob/master/LICENSE)
|
||||
* [go-message](https://github.com/ProtonMail/go-message) available under [license](https://github.com/ProtonMail/go-message/blob/master/LICENSE)
|
||||
* [bcrypt](https://github.com/ProtonMail/bcrypt) available under [license](https://github.com/ProtonMail/bcrypt/blob/master/LICENSE)
|
||||
* [go-keychain](https://github.com/cuthix/go-keychain) available under [license](https://github.com/cuthix/go-keychain/blob/master/LICENSE)
|
||||
<!-- END AUTOGEN -->
|
||||
|
||||
40
Changelog.md
40
Changelog.md
@ -2,30 +2,50 @@
|
||||
|
||||
Changelog [format](http://keepachangelog.com/en/1.0.0/)
|
||||
|
||||
## [Bridge 2.2.0] Millau
|
||||
|
||||
### Added
|
||||
* Rebranding:
|
||||
* GODT-1508: Splash screen for rebranding.
|
||||
* GODT-1542: Update login screen for rebranding.
|
||||
* GODT-1260: Renaming.
|
||||
* GODT-1502: Rebranding: color and radius.
|
||||
* GODT-1549: Add notification when address list changes.
|
||||
* GODT-1560: Dependecy licenses update and link.
|
||||
|
||||
### Changed
|
||||
* GODT-1543: Using one buffered event for off and on connection.
|
||||
* GODT-1550: Update dependencies.
|
||||
* GODT-1545 GODT-1521: Change wording and enable release notes link.
|
||||
|
||||
### Fixed
|
||||
* GODT-1534: Reset address when leaving split mode.
|
||||
|
||||
|
||||
## [Bridge 2.1.3] London
|
||||
|
||||
## Added
|
||||
### Added
|
||||
GODT-1525: Add keybase/go-keychain/secretservice as new keychain helper.
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
GODT-1527: Change bug report description.
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
GODT-1537: Manual in-app update mechanism.
|
||||
|
||||
|
||||
## [Bridge 2.1.2] London
|
||||
|
||||
## Added
|
||||
### Added
|
||||
* GODT-1522: Rebuild macOS keychain notification.
|
||||
* GODT-1437 Add new proxy provider (Quad9 with port).
|
||||
* GODT-1516: Return notification on missing keychain.
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
* GODT-1451: Do not check for gnome keyring to allow other implementations of secret-service API. Thanks to @remgodow.
|
||||
* GODT-1516 GODT-1451: KeepassXC is crashing on start. We need to block it until it's fixed.
|
||||
|
||||
## Fixed
|
||||
### Fixed
|
||||
* GODT-1524: Logout issues with macOS.
|
||||
* GODT-1503 GODT-1492: Improve email validation and username in bug report.
|
||||
* GODT-1507: Enable autostart after Qt setup.
|
||||
@ -34,7 +54,7 @@ GODT-1537: Manual in-app update mechanism.
|
||||
|
||||
## [Bridge 2.1.1] London
|
||||
|
||||
## Added
|
||||
### Added
|
||||
* GODT-1376: Add first userID to sentry scope.
|
||||
* GODT-1375: Add host architecture to sentry reports.
|
||||
* GODT-1364: Add windows CI machine for tests, and build.
|
||||
@ -56,7 +76,7 @@ GODT-1537: Manual in-app update mechanism.
|
||||
* GODT-1483: Correct scope in sentry report.
|
||||
* GODT-1477: Change CoD wording.
|
||||
|
||||
## Added
|
||||
### Added
|
||||
* GODT-1478: Add GUI settings for keychain selection.
|
||||
* Other: Change copyright year.
|
||||
* GODT-1329: Dark mode, with autodetect.
|
||||
@ -70,7 +90,7 @@ GODT-1537: Manual in-app update mechanism.
|
||||
|
||||
## [Bridge 2.0.0] Kwai
|
||||
|
||||
## Added
|
||||
### Added
|
||||
* GODT-22: New GUI style and improved UX:
|
||||
* GODT-1168 GODT-1169 Qml artifacts for preview.
|
||||
* GODT-1177: Remove Import-Export from repo.
|
||||
@ -141,7 +161,7 @@ GODT-1537: Manual in-app update mechanism.
|
||||
* GODT-1158: Store full messages bodies on disk.
|
||||
* GODT-1433 Adding first integration test for drafts.
|
||||
|
||||
## Changed
|
||||
### Changed
|
||||
* GODT-1438: Turn off SW OpenGL on windows and add debug info about graphic renderer.
|
||||
* GODT-1425: Factory reset enables launch on startup.
|
||||
* GODT-1433 Message.Type is deprecated, use Flags instead.
|
||||
|
||||
7
Makefile
7
Makefile
@ -10,7 +10,7 @@ TARGET_OS?=${GOOS}
|
||||
.PHONY: build build-nogui build-launcher versioner hasher
|
||||
|
||||
# Keep version hardcoded so app build works also without Git repository.
|
||||
BRIDGE_APP_VERSION?=2.1.3+git
|
||||
BRIDGE_APP_VERSION?=2.2.0+git
|
||||
APP_VERSION:=${BRIDGE_APP_VERSION}
|
||||
SRC_ICO:=logo.ico
|
||||
SRC_ICNS:=Bridge.icns
|
||||
@ -235,11 +235,14 @@ mocks:
|
||||
mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/pmapi Client,Manager > pkg/pmapi/mocks/mocks.go
|
||||
mockgen --package mocks github.com/ProtonMail/proton-bridge/pkg/message Fetcher > pkg/message/mocks/mocks.go
|
||||
|
||||
lint: gofiles lint-golang lint-license lint-changelog
|
||||
lint: gofiles lint-golang lint-license lint-dependencies lint-changelog
|
||||
|
||||
lint-license:
|
||||
./utils/missing_license.sh check
|
||||
|
||||
lint-dependencies:
|
||||
./utils/dependency_license.sh check
|
||||
|
||||
lint-changelog:
|
||||
./utils/changelog_linter.sh Changelog.md
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
# Proton Mail Bridge and Import Export app
|
||||
Copyright (c) 2020 Proton Technologies AG
|
||||
Copyright (c) 2022 Proton AG
|
||||
|
||||
This repository holds the Proton Mail Bridge and the Proton Mail Import-Export applications.
|
||||
For a detailed build information see [BUILDS](./BUILDS.md).
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -44,7 +44,7 @@ const (
|
||||
exeName = "proton-bridge"
|
||||
)
|
||||
|
||||
func main() { // nolint[funlen]
|
||||
func main() { //nolint:funlen
|
||||
reporter := sentry.NewReporter(appName, constants.Version, useragent.New())
|
||||
|
||||
crashHandler := crash.NewHandler(reporter.ReportException)
|
||||
@ -98,7 +98,7 @@ func main() { // nolint[funlen]
|
||||
logrus.WithError(err).Fatal("Failed to determine path to launcher")
|
||||
}
|
||||
|
||||
cmd := exec.Command(exe, appendLauncherPath(launcher, os.Args[1:])...) // nolint[gosec]
|
||||
cmd := exec.Command(exe, appendLauncherPath(launcher, os.Args[1:])...) //nolint:gosec
|
||||
|
||||
cmd.Stdin = os.Stdin
|
||||
cmd.Stdout = os.Stdout
|
||||
|
||||
3
go.mod
3
go.mod
@ -69,7 +69,8 @@ require (
|
||||
github.com/urfave/cli/v2 v2.2.0
|
||||
github.com/vmihailenco/msgpack/v5 v5.1.3
|
||||
go.etcd.io/bbolt v1.3.6
|
||||
golang.org/x/net v0.0.0-20211008194852-3b03d305991f
|
||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 // indirect
|
||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4
|
||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320
|
||||
golang.org/x/text v0.3.7
|
||||
howett.net/plist v1.0.0 // indirect
|
||||
|
||||
7
go.sum
7
go.sum
@ -471,6 +471,8 @@ golang.org/x/crypto v0.0.0-20200323165209-0ec3e9974c59/go.mod h1:LzIPMQfyMNhhGPh
|
||||
golang.org/x/crypto v0.0.0-20210322153248-0c34fe9e7dc2/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 h1:7I4JAnoQBe7ZtJcBaYHi5UtiO8tQHbUSXxL+pnGRANg=
|
||||
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA=
|
||||
golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@ -518,6 +520,9 @@ golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||
golang.org/x/net v0.0.0-20211008194852-3b03d305991f h1:1scJEYZBaF48BaG6tYbtxmLcXqwYGSfGcMoStTqkkIw=
|
||||
golang.org/x/net v0.0.0-20211008194852-3b03d305991f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4 h1:HVyaeDAYux4pnY+D/SiwmLOR36ewZ4iGQIIrtnuCjFA=
|
||||
golang.org/x/net v0.0.0-20220425223048-2871e0cb64e4/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@ -571,6 +576,8 @@ golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320 h1:0jf+tOCoZ3LyutmCOWpVni1chK4VfFLhRsDK7MhqGRY=
|
||||
golang.org/x/sys v0.0.0-20220111092808-5a964db01320/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211 h1:JGgROgKl9N8DuW20oFS5gxc+lE67/N3FcwmBPMe7ArY=
|
||||
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -34,7 +34,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
log = logrus.WithField("pkg", "api") //nolint[gochecknoglobals]
|
||||
log = logrus.WithField("pkg", "api") //nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
type apiServer struct {
|
||||
@ -44,7 +44,7 @@ type apiServer struct {
|
||||
}
|
||||
|
||||
// NewAPIServer returns prepared API server struct.
|
||||
func NewAPIServer(settings *settings.Settings, eventListener listener.Listener) *apiServer { //nolint[golint]
|
||||
func NewAPIServer(settings *settings.Settings, eventListener listener.Listener) *apiServer { //nolint:revive
|
||||
return &apiServer{
|
||||
host: bridge.Host,
|
||||
settings: settings,
|
||||
@ -68,7 +68,7 @@ func (api *apiServer) ListenAndServe() {
|
||||
api.eventListener.Emit(events.ErrorEvent, "API failed: "+err.Error())
|
||||
log.Error("API failed: ", err)
|
||||
}
|
||||
defer server.Close() //nolint[errcheck]
|
||||
defer server.Close() //nolint:errcheck
|
||||
}
|
||||
|
||||
func (api *apiServer) getAddress() string {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -42,7 +42,7 @@ func CheckOtherInstanceAndFocus(port int) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer resp.Body.Close() //nolint[errcheck]
|
||||
defer resp.Body.Close() //nolint:errcheck
|
||||
|
||||
if resp.StatusCode != 200 {
|
||||
log.Error("Focus error: ", resp.StatusCode)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -102,7 +102,7 @@ type Base struct {
|
||||
teardown []func() error // actions to perform when app is exiting
|
||||
}
|
||||
|
||||
func New( // nolint[funlen]
|
||||
func New( //nolint:funlen
|
||||
appName,
|
||||
appUsage,
|
||||
configName,
|
||||
@ -159,6 +159,10 @@ func New( // nolint[funlen]
|
||||
return nil, api.CheckOtherInstanceAndFocus(settingsObj.GetInt(settings.APIPortKey))
|
||||
}
|
||||
|
||||
if err := migrateRebranding(settingsObj, keychainName); err != nil {
|
||||
logrus.WithError(err).Warn("Rebranding migration failed")
|
||||
}
|
||||
|
||||
cachePath, err := locations.ProvideCachePath()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -192,8 +196,8 @@ func New( // nolint[funlen]
|
||||
sentryReporter.SetClientFromManager(cm)
|
||||
|
||||
cm.AddConnectionObserver(pmapi.NewConnectionObserver(
|
||||
func() { listener.Emit(events.InternetOffEvent, "") },
|
||||
func() { listener.Emit(events.InternetOnEvent, "") },
|
||||
func() { listener.Emit(events.InternetConnChangedEvent, events.InternetOff) },
|
||||
func() { listener.Emit(events.InternetConnChangedEvent, events.InternetOn) },
|
||||
))
|
||||
|
||||
jar, err := cookies.NewCookieJar(settingsObj)
|
||||
@ -236,7 +240,7 @@ func New( // nolint[funlen]
|
||||
}
|
||||
|
||||
autostart := &autostart.App{
|
||||
Name: appName,
|
||||
Name: startupNameForRebranding(appName),
|
||||
DisplayName: appName,
|
||||
Exec: []string{exe, "--" + FlagNoWindow},
|
||||
}
|
||||
@ -324,7 +328,7 @@ func (b *Base) AddTeardownAction(fn func() error) {
|
||||
b.teardown = append(b.teardown, fn)
|
||||
}
|
||||
|
||||
func (b *Base) wrapMainLoop(appMainLoop func(*Base, *cli.Context) error) cli.ActionFunc { // nolint[funlen]
|
||||
func (b *Base) wrapMainLoop(appMainLoop func(*Base, *cli.Context) error) cli.ActionFunc { //nolint:funlen
|
||||
return func(c *cli.Context) error {
|
||||
defer b.CrashHandler.HandlePanic()
|
||||
defer func() { _ = b.Lock.Close() }()
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -50,7 +50,7 @@ func migrateFiles(configName string) error {
|
||||
if err := migrateCacheFromBoth15xAnd16x(locations, userCacheDir); err != nil {
|
||||
return err
|
||||
}
|
||||
if err := migrateUpdatesFrom16x(configName, locations); err != nil { //nolint[revive] It is more clear to structure this way
|
||||
if err := migrateUpdatesFrom16x(configName, locations); err != nil { //nolint:revive It is more clear to structure this way
|
||||
return err
|
||||
}
|
||||
return nil
|
||||
|
||||
197
internal/app/base/migration_rebranding.go
Normal file
197
internal/app/base/migration_rebranding.go
Normal file
@ -0,0 +1,197 @@
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
// Proton Mail Bridge is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// Proton Mail Bridge is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
package base
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"runtime"
|
||||
"strings"
|
||||
|
||||
"github.com/ProtonMail/proton-bridge/internal/config/settings"
|
||||
"github.com/ProtonMail/proton-bridge/pkg/keychain"
|
||||
"github.com/hashicorp/go-multierror"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const darwin = "darwin"
|
||||
|
||||
func migrateRebranding(settingsObj *settings.Settings, keychainName string) (result error) {
|
||||
if err := migrateStartupBeforeRebranding(); err != nil {
|
||||
result = multierror.Append(result, err)
|
||||
}
|
||||
|
||||
lastUsedVersion := settingsObj.Get(settings.LastVersionKey)
|
||||
|
||||
// Skipping migration: it is first bridge start or cache was cleared.
|
||||
if lastUsedVersion == "" {
|
||||
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
|
||||
return
|
||||
}
|
||||
|
||||
// Skipping rest of migration: already done
|
||||
if settingsObj.GetBool(settings.RebrandingMigrationKey) {
|
||||
return
|
||||
}
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows", "linux":
|
||||
// GODT-1260 we would need admin rights to changes desktop files
|
||||
// and start menu items.
|
||||
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
|
||||
case darwin:
|
||||
if shouldContinue, err := isMacBeforeRebranding(); !shouldContinue || err != nil {
|
||||
if err != nil {
|
||||
result = multierror.Append(result, err)
|
||||
}
|
||||
break
|
||||
}
|
||||
|
||||
if err := migrateMacKeychainBeforeRebranding(settingsObj, keychainName); err != nil {
|
||||
result = multierror.Append(result, err)
|
||||
}
|
||||
|
||||
settingsObj.SetBool(settings.RebrandingMigrationKey, true)
|
||||
}
|
||||
|
||||
return result
|
||||
}
|
||||
|
||||
// migrateMacKeychainBeforeRebranding deals with write access restriction to
|
||||
// mac keychain passwords which are caused by application renaming. The old
|
||||
// passwords are copied under new name in order to have write access afer
|
||||
// renaming.
|
||||
func migrateMacKeychainBeforeRebranding(settingsObj *settings.Settings, keychainName string) error {
|
||||
l := logrus.WithField("pkg", "app/base/migration")
|
||||
l.Warn("Migrating mac keychain")
|
||||
|
||||
helperConstructor, ok := keychain.Helpers["macos-keychain"]
|
||||
if !ok {
|
||||
return errors.New("cannot find macos-keychain helper")
|
||||
}
|
||||
|
||||
oldKC, err := helperConstructor("ProtonMailBridgeService")
|
||||
if err != nil {
|
||||
l.WithError(err).Error("Keychain constructor failed")
|
||||
return err
|
||||
}
|
||||
|
||||
idByURL, err := oldKC.List()
|
||||
if err != nil {
|
||||
l.WithError(err).Error("List old keychain failed")
|
||||
return err
|
||||
}
|
||||
|
||||
newKC, err := keychain.NewKeychain(settingsObj, keychainName)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
for url, id := range idByURL {
|
||||
li := l.WithField("id", id).WithField("url", url)
|
||||
userID, secret, err := oldKC.Get(url)
|
||||
if err != nil {
|
||||
li.WithField("userID", userID).
|
||||
WithField("err", err).
|
||||
Error("Faild to get old item")
|
||||
continue
|
||||
}
|
||||
|
||||
if _, _, err := newKC.Get(userID); err == nil {
|
||||
li.Warn("Skipping migration, item already exists.")
|
||||
continue
|
||||
}
|
||||
|
||||
if err := newKC.Put(userID, secret); err != nil {
|
||||
li.WithError(err).Error("Failed to migrate user")
|
||||
}
|
||||
|
||||
li.Info("Item migrated")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
// migrateStartupBeforeRebranding removes old startup links. The creation of new links is
|
||||
// handled by bridge initialisation.
|
||||
func migrateStartupBeforeRebranding() error {
|
||||
path, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
switch runtime.GOOS {
|
||||
case "windows":
|
||||
path = filepath.Join(path, `AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup\ProtonMail Bridge.lnk`)
|
||||
case "linux":
|
||||
path = filepath.Join(path, `.config/autostart/ProtonMail Bridge.desktop`)
|
||||
case darwin:
|
||||
path = filepath.Join(path, `Library/LaunchAgents/ProtonMail Bridge.plist`)
|
||||
default:
|
||||
return errors.New("unknown GOOS")
|
||||
}
|
||||
|
||||
if _, err := os.Stat(path); os.IsNotExist(err) {
|
||||
return nil
|
||||
}
|
||||
|
||||
logrus.WithField("pkg", "app/base/migration").Warn("Migrating autostartup links")
|
||||
return os.Remove(path)
|
||||
}
|
||||
|
||||
// startupNameForRebranding returns the name for autostart launcher based on
|
||||
// type of rebranded instance i.e. update or manual.
|
||||
//
|
||||
// This only affects darwin when udpate re-writes the old startup and then
|
||||
// manual installed it would not run proper exe. Therefore we return "old" name
|
||||
// for updates and "new" name for manual which would be properly migrated.
|
||||
//
|
||||
// For orther (linux and windows) the link is always pointing to launcher which
|
||||
// path didn't changed.
|
||||
func startupNameForRebranding(origin string) string {
|
||||
if runtime.GOOS == darwin {
|
||||
if path, err := os.Executable(); err == nil && strings.Contains(path, "ProtonMail Bridge") {
|
||||
return "ProtonMail Bridge"
|
||||
}
|
||||
}
|
||||
|
||||
// No need to solve for other OS. See comment above.
|
||||
return origin
|
||||
}
|
||||
|
||||
// isBeforeRebranding decide if last used version was older than 2.2.0. If
|
||||
// cannot decide it returns false with error.
|
||||
func isMacBeforeRebranding() (bool, error) {
|
||||
// previous version | update | do mac migration |
|
||||
// | first | false |
|
||||
// cleared-cache | manual | false |
|
||||
// cleared-cache | in-app | false |
|
||||
// old | in-app | false |
|
||||
// old in-app | in-app | false |
|
||||
// old | manual | true |
|
||||
// old in-app | manual | true |
|
||||
// manual | in-app | false |
|
||||
|
||||
// Skip if it was in-app update and not manual
|
||||
if path, err := os.Executable(); err != nil || strings.Contains(path, "ProtonMail Bridge") {
|
||||
return false, err
|
||||
}
|
||||
|
||||
return true, nil
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -43,7 +43,7 @@ func (b *Base) restartApp(crash bool) error {
|
||||
WithField("args", args).
|
||||
Warn("Restarting")
|
||||
|
||||
return exec.Command(b.command, args...).Start() // nolint[gosec]
|
||||
return exec.Command(b.command, args...).Start() //nolint:gosec
|
||||
}
|
||||
|
||||
// incrementRestartFlag increments the value of the restart flag.
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -69,7 +69,7 @@ func New(base *base.Base) *cli.App {
|
||||
return app
|
||||
}
|
||||
|
||||
func mailLoop(b *base.Base, c *cli.Context) error { // nolint[funlen]
|
||||
func mailLoop(b *base.Base, c *cli.Context) error { //nolint:funlen
|
||||
tlsConfig, err := loadTLSConfig(b)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -18,14 +18,21 @@
|
||||
// Package bridge provides core functionality of Bridge app.
|
||||
package bridge
|
||||
|
||||
import "github.com/ProtonMail/proton-bridge/internal/config/settings"
|
||||
|
||||
// IsAutostartEnabled checks if link file exits.
|
||||
func (b *Bridge) IsAutostartEnabled() bool {
|
||||
return b.autostart.IsEnabled()
|
||||
}
|
||||
|
||||
// EnableAutostart creates link and sets the preferences.
|
||||
func (b *Bridge) EnableAutostart() error {
|
||||
b.settings.SetBool(settings.AutostartKey, true)
|
||||
return b.autostart.Enable()
|
||||
}
|
||||
|
||||
// DisableAutostart removes link and sets the preferences.
|
||||
func (b *Bridge) DisableAutostart() error {
|
||||
b.settings.SetBool(settings.AutostartKey, false)
|
||||
return b.autostart.Disable()
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -40,7 +40,7 @@ import (
|
||||
logrus "github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var log = logrus.WithField("pkg", "bridge") //nolint[gochecknoglobals]
|
||||
var log = logrus.WithField("pkg", "bridge") //nolint:gochecknoglobals
|
||||
|
||||
var ErrLocalCacheUnavailable = errors.New("local cache is unavailable")
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -153,7 +153,7 @@ func zipFiles(filenames []string) (io.Reader, error) {
|
||||
buf := NewLimitedBuffer(MaxAttachmentSize)
|
||||
|
||||
w := zip.NewWriter(buf)
|
||||
defer w.Close() //nolint[errcheck]
|
||||
defer w.Close() //nolint:errcheck
|
||||
|
||||
for _, file := range filenames {
|
||||
err := addFileToZip(file, w)
|
||||
@ -174,7 +174,7 @@ func addFileToZip(filename string, writer *zip.Writer) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer fileReader.Close() //nolint[errcheck]
|
||||
defer fileReader.Close() //nolint:errcheck,gosec
|
||||
|
||||
fileInfo, err := fileReader.Stat()
|
||||
if err != nil {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
2
internal/config/cache/cache.go
vendored
2
internal/config/cache/cache.go
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
2
internal/config/cache/cache_test.go
vendored
2
internal/config/cache/cache_test.go
vendored
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -61,7 +61,7 @@ func (p *keyValueStore) load() error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer f.Close() //nolint[errcheck]
|
||||
defer f.Close() //nolint:errcheck,gosec
|
||||
|
||||
return json.NewDecoder(f).Decode(&p.cache)
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -54,6 +54,7 @@ const (
|
||||
FetchWorkers = "fetch_workers"
|
||||
AttachmentWorkers = "attachment_workers"
|
||||
ColorScheme = "color_scheme"
|
||||
RebrandingMigrationKey = "rebranding_migrated"
|
||||
)
|
||||
|
||||
type Settings struct {
|
||||
@ -89,7 +90,7 @@ func (s *Settings) setDefaultValues() {
|
||||
s.setDefault(ReportOutgoingNoEncKey, "false")
|
||||
s.setDefault(LastVersionKey, "")
|
||||
s.setDefault(UpdateChannelKey, "")
|
||||
s.setDefault(RolloutKey, fmt.Sprintf("%v", rand.Float64())) //nolint[gosec] G404 It is OK to use weak random number generator here
|
||||
s.setDefault(RolloutKey, fmt.Sprintf("%v", rand.Float64())) //nolint:gosec // G404 It is OK to use weak random number generator here
|
||||
s.setDefault(PreferredKeychainKey, "")
|
||||
s.setDefault(CacheEnabledKey, "true")
|
||||
s.setDefault(CacheCompressionKey, "true")
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -20,7 +20,7 @@ package tls
|
||||
import "os/exec"
|
||||
|
||||
func addTrustedCert(certPath string) error {
|
||||
return exec.Command( // nolint[gosec]
|
||||
return exec.Command( //nolint:gosec
|
||||
"/usr/bin/security",
|
||||
"execute-with-privileges",
|
||||
"/usr/bin/security",
|
||||
@ -34,7 +34,7 @@ func addTrustedCert(certPath string) error {
|
||||
}
|
||||
|
||||
func removeTrustedCert(certPath string) error {
|
||||
return exec.Command( // nolint[gosec]
|
||||
return exec.Command( //nolint:gosec
|
||||
"/usr/bin/security",
|
||||
"execute-with-privileges",
|
||||
"/usr/bin/security",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -55,7 +55,7 @@ func NewTLSTemplate() (*x509.Certificate, error) {
|
||||
SerialNumber: serialNumber,
|
||||
Subject: pkix.Name{
|
||||
Country: []string{"CH"},
|
||||
Organization: []string{"Proton Technologies AG"},
|
||||
Organization: []string{"Proton AG"},
|
||||
OrganizationalUnit: []string{"Proton Mail"},
|
||||
CommonName: "127.0.0.1",
|
||||
},
|
||||
@ -110,7 +110,7 @@ func (t *TLS) GenerateCerts(template *x509.Certificate) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer certOut.Close() // nolint[errcheck]
|
||||
defer certOut.Close() //nolint:errcheck,gosec
|
||||
|
||||
if err := pem.Encode(certOut, &pem.Block{Type: "CERTIFICATE", Bytes: derBytes}); err != nil {
|
||||
return err
|
||||
@ -120,7 +120,7 @@ func (t *TLS) GenerateCerts(template *x509.Certificate) error {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
defer keyOut.Close() // nolint[errcheck]
|
||||
defer keyOut.Close() //nolint:errcheck,gosec
|
||||
|
||||
return pem.Encode(keyOut, &pem.Block{Type: "RSA PRIVATE KEY", Bytes: x509.MarshalPKCS1PrivateKey(priv)})
|
||||
}
|
||||
@ -144,7 +144,7 @@ func (t *TLS) GetConfig() (*tls.Config, error) {
|
||||
caCertPool := x509.NewCertPool()
|
||||
caCertPool.AddCert(c.Leaf)
|
||||
|
||||
// nolint[gosec]: We need to support older TLS versions for AppleMail and Outlook.
|
||||
//nolint:gosec // We need to support older TLS versions for AppleMail and Outlook
|
||||
return &tls.Config{
|
||||
Certificates: []tls.Certificate{c},
|
||||
ServerName: "127.0.0.1",
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.Bridge.
|
||||
//
|
||||
@ -22,7 +22,7 @@ import "fmt"
|
||||
|
||||
const VendorName = "protonmail"
|
||||
|
||||
// nolint[gochecknoglobals]
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
// Version of the build.
|
||||
Version = ""
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -15,14 +15,15 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build !build_qa
|
||||
// +build !build_qa
|
||||
|
||||
package constants
|
||||
|
||||
import "time"
|
||||
|
||||
// nolint[gochecknoglobals]
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
// UpdateCheckInterval defines how often we check for new version
|
||||
UpdateCheckInterval = time.Hour //nolint[gochecknoglobals]
|
||||
// UpdateCheckInterval defines how often we check for new version.
|
||||
UpdateCheckInterval = time.Hour //nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -15,13 +15,14 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build build_qa
|
||||
// +build build_qa
|
||||
|
||||
package constants
|
||||
|
||||
import "time"
|
||||
|
||||
// nolint[gochecknoglobals]
|
||||
//nolint:gochecknoglobals
|
||||
var (
|
||||
// UpdateCheckInterval defines how often we check for new version
|
||||
UpdateCheckInterval = time.Duration(5 * time.Minute)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -34,8 +34,9 @@ const (
|
||||
AddressChangedLogoutEvent = "addressChangedLogout"
|
||||
UserRefreshEvent = "userRefresh"
|
||||
RestartBridgeEvent = "restartBridge"
|
||||
InternetOffEvent = "internetOff"
|
||||
InternetOnEvent = "internetOn"
|
||||
InternetConnChangedEvent = "internetChanged"
|
||||
InternetOff = "internetOff"
|
||||
InternetOn = "internetOn"
|
||||
SecondInstanceEvent = "secondInstance"
|
||||
OutgoingNoEncEvent = "outgoingNoEncryption"
|
||||
NoActiveKeyForRecipientEvent = "noActiveKeyForRecipient"
|
||||
@ -52,7 +53,7 @@ func SetupEvents(listener listener.Listener) {
|
||||
listener.SetLimit(LogoutEvent, LogoutEventTimeout)
|
||||
listener.SetBuffer(ErrorEvent)
|
||||
listener.SetBuffer(CredentialsErrorEvent)
|
||||
listener.SetBuffer(InternetOffEvent)
|
||||
listener.SetBuffer(InternetConnChangedEvent)
|
||||
listener.SetBuffer(UpgradeApplicationEvent)
|
||||
listener.SetBuffer(TLSCertIssue)
|
||||
listener.SetBuffer(UserRefreshEvent)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -88,7 +88,7 @@ func (f *frontendCLI) showAccountAddressInfo(user types.User, address string) {
|
||||
f.Println("")
|
||||
}
|
||||
|
||||
func (f *frontendCLI) loginAccount(c *ishell.Context) { // nolint[funlen]
|
||||
func (f *frontendCLI) loginAccount(c *ishell.Context) { //nolint:funlen
|
||||
f.ShowPrompt(false)
|
||||
defer f.ShowPrompt(true)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -31,7 +31,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
log = logrus.WithField("pkg", "frontend/cli") //nolint[gochecknoglobals]
|
||||
log = logrus.WithField("pkg", "frontend/cli") //nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
type frontendCLI struct {
|
||||
@ -47,7 +47,7 @@ type frontendCLI struct {
|
||||
}
|
||||
|
||||
// New returns a new CLI frontend configured with the given options.
|
||||
func New( //nolint[funlen]
|
||||
func New( //nolint:funlen
|
||||
panicHandler types.PanicHandler,
|
||||
|
||||
locations *locations.Locations,
|
||||
@ -56,7 +56,7 @@ func New( //nolint[funlen]
|
||||
updater types.Updater,
|
||||
bridge types.Bridger,
|
||||
restarter types.Restarter,
|
||||
) *frontendCLI { //nolint[golint]
|
||||
) *frontendCLI { //nolint:revive
|
||||
fe := &frontendCLI{
|
||||
Shell: ishell.New(),
|
||||
|
||||
@ -244,8 +244,7 @@ func New( //nolint[funlen]
|
||||
func (f *frontendCLI) watchEvents() {
|
||||
errorCh := f.eventListener.ProvideChannel(events.ErrorEvent)
|
||||
credentialsErrorCh := f.eventListener.ProvideChannel(events.CredentialsErrorEvent)
|
||||
internetOffCh := f.eventListener.ProvideChannel(events.InternetOffEvent)
|
||||
internetOnCh := f.eventListener.ProvideChannel(events.InternetOnEvent)
|
||||
internetConnChangedCh := f.eventListener.ProvideChannel(events.InternetConnChangedEvent)
|
||||
addressChangedCh := f.eventListener.ProvideChannel(events.AddressChangedEvent)
|
||||
addressChangedLogoutCh := f.eventListener.ProvideChannel(events.AddressChangedLogoutEvent)
|
||||
logoutCh := f.eventListener.ProvideChannel(events.LogoutEvent)
|
||||
@ -256,10 +255,13 @@ func (f *frontendCLI) watchEvents() {
|
||||
f.Println("Bridge failed:", errorDetails)
|
||||
case <-credentialsErrorCh:
|
||||
f.notifyCredentialsError()
|
||||
case <-internetOffCh:
|
||||
case stat := <-internetConnChangedCh:
|
||||
if stat == events.InternetOff {
|
||||
f.notifyInternetOff()
|
||||
case <-internetOnCh:
|
||||
}
|
||||
if stat == events.InternetOn {
|
||||
f.notifyInternetOn()
|
||||
}
|
||||
case address := <-addressChangedCh:
|
||||
f.Printf("Address changed for %s. You may need to reconfigure your email client.", address)
|
||||
case address := <-addressChangedLogoutCh:
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -29,7 +29,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
currentPort = "" //nolint[gochecknoglobals]
|
||||
currentPort = "" //nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
func (f *frontendCLI) restart(c *ishell.Context) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -29,7 +29,7 @@ const (
|
||||
)
|
||||
|
||||
var (
|
||||
bold = color.New(color.Bold).SprintFunc() //nolint[gochecknoglobals]
|
||||
bold = color.New(color.Bold).SprintFunc() //nolint:gochecknoglobals
|
||||
)
|
||||
|
||||
func isNotEmpty(val string) bool {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -34,7 +34,7 @@ type AutoConfig interface {
|
||||
}
|
||||
|
||||
var (
|
||||
available = map[string]AutoConfig{} //nolint[gochecknoglobals]
|
||||
available = map[string]AutoConfig{} //nolint:gochecknoglobals
|
||||
ErrNotAvailable = errors.New("configuration not available")
|
||||
)
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -15,6 +15,7 @@
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with Proton Mail Bridge. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
//go:build darwin
|
||||
// +build darwin
|
||||
|
||||
package clientconfig
|
||||
@ -38,7 +39,7 @@ const (
|
||||
bigSurPreferncesPane = "/System/Library/PreferencePanes/Profiles.prefPane"
|
||||
)
|
||||
|
||||
func init() { //nolint[gochecknoinit]
|
||||
func init() { //nolint:gochecknoinit
|
||||
available[AppleMailClient] = &appleMail{}
|
||||
}
|
||||
|
||||
@ -55,10 +56,10 @@ func (c *appleMail) Configure(imapPort, smtpPort int, imapSSL, smtpSSL bool, use
|
||||
}
|
||||
|
||||
if useragent.IsBigSurOrNewer() {
|
||||
return exec.Command("open", bigSurPreferncesPane, confPath).Run() //nolint[gosec] G204: open command is safe, mobileconfig is generated by us
|
||||
return exec.Command("open", bigSurPreferncesPane, confPath).Run() //nolint:gosec G204: open command is safe, mobileconfig is generated by us
|
||||
}
|
||||
|
||||
return exec.Command("open", confPath).Run() //nolint[gosec] G204: open command is safe, mobileconfig is generated by us
|
||||
return exec.Command("open", confPath).Run() //nolint:gosec G204: open command is safe, mobileconfig is generated by us
|
||||
}
|
||||
|
||||
func prepareMobileConfig(imapPort, smtpPort int, imapSSL, smtpSSL bool, user types.User, address string) *mobileconfig.Config {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -27,7 +27,7 @@ Item {
|
||||
property ColorScheme colorScheme
|
||||
property var user
|
||||
|
||||
property var _spacing: 12
|
||||
property var _spacing: 12 * ProtonStyle.px
|
||||
|
||||
property color usedSpaceColor : {
|
||||
if (!root.enabled) return root.colorScheme.text_weak
|
||||
@ -86,7 +86,7 @@ Item {
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredWidth: height
|
||||
|
||||
radius: 4
|
||||
radius: ProtonStyle.avatar_radius
|
||||
|
||||
color: root.colorScheme.background_avatar
|
||||
|
||||
@ -130,7 +130,7 @@ Item {
|
||||
elide: Text.ElideMiddle
|
||||
}
|
||||
|
||||
Item { implicitHeight: root.type == AccountDelegate.LargeView ? 6 : 0 }
|
||||
Item { implicitHeight: root.type == AccountDelegate.LargeView ? 6 * ProtonStyle.px : 0 }
|
||||
|
||||
RowLayout {
|
||||
spacing: 0
|
||||
@ -161,14 +161,16 @@ Item {
|
||||
|
||||
|
||||
Rectangle {
|
||||
id: storage_bar
|
||||
visible: root.user ? root.type == AccountDelegate.LargeView : false
|
||||
width: 140
|
||||
height: 4
|
||||
radius: 3
|
||||
width: 140 * ProtonStyle.px
|
||||
height: 4 * ProtonStyle.px
|
||||
radius: ProtonStyle.storage_bar_radius
|
||||
color: root.colorScheme.border_weak
|
||||
|
||||
Rectangle {
|
||||
radius: 3
|
||||
id: storage_bar_filled
|
||||
radius: ProtonStyle.storage_bar_radius
|
||||
color: root.usedSpaceColor
|
||||
visible: root.user ? parent.visible && root.user.loggedIn : false
|
||||
anchors {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -163,6 +163,7 @@ Item {
|
||||
if (!splitMode.checked){
|
||||
root.notifications.askEnableSplitMode(user)
|
||||
} else {
|
||||
addressSelector.currentIndex = 0
|
||||
root.user.toggleSplitMode(!splitMode.checked)
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -73,7 +73,7 @@ Popup {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.left: parent.left
|
||||
width: parent.width + 10
|
||||
radius: 10
|
||||
radius: ProtonStyle.banner_radius
|
||||
color: {
|
||||
if (!root.notification) {
|
||||
return "transparent"
|
||||
@ -134,6 +134,7 @@ Popup {
|
||||
colorScheme: root.colorScheme
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.leftMargin: 16
|
||||
|
||||
color: root.colorScheme.text_invert
|
||||
text: root.notification ? root.notification.description : ""
|
||||
@ -179,7 +180,7 @@ Popup {
|
||||
anchors.bottom: parent.bottom
|
||||
anchors.right: parent.right
|
||||
width: parent.width + 10
|
||||
radius: 10
|
||||
radius: ProtonStyle.banner_radius
|
||||
color: {
|
||||
if (!root.notification) {
|
||||
return "transparent"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -34,6 +34,7 @@ QtObject {
|
||||
}
|
||||
|
||||
property var backend
|
||||
property var title: "Proton Mail Bridge"
|
||||
|
||||
property Notifications _notifications: Notifications {
|
||||
id: notifications
|
||||
@ -47,6 +48,7 @@ QtObject {
|
||||
id: mainWindow
|
||||
visible: false
|
||||
|
||||
title: root.title
|
||||
backend: root.backend
|
||||
notifications: root._notifications
|
||||
|
||||
@ -67,6 +69,7 @@ QtObject {
|
||||
id: statusWindow
|
||||
visible: false
|
||||
|
||||
title: root.title
|
||||
backend: root.backend
|
||||
notifications: root._notifications
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -262,7 +262,7 @@ Window {
|
||||
|
||||
|
||||
// add one user on start
|
||||
var hasUserOnStart = true
|
||||
var hasUserOnStart = false
|
||||
if (hasUserOnStart) {
|
||||
var newUserObject = root.userComponent.createObject(root)
|
||||
newUserObject.username = "LerooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooyJenkins@protonmail.com"
|
||||
@ -551,7 +551,12 @@ Window {
|
||||
root.reportBugFinished()
|
||||
root.bugReportSendSuccess()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
spacing: 5
|
||||
|
||||
Button {
|
||||
text: "Bug report send error"
|
||||
@ -609,6 +614,22 @@ Window {
|
||||
root.notifyRebuildKeychain()
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Address changed"
|
||||
colorScheme: root.colorScheme
|
||||
onClicked: {
|
||||
root.addressChanged("p@v.el")
|
||||
}
|
||||
}
|
||||
|
||||
Button {
|
||||
text: "Address changed + Logout"
|
||||
colorScheme: root.colorScheme
|
||||
onClicked: {
|
||||
root.addressChangedLogout("p@v.el")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -815,6 +836,7 @@ Window {
|
||||
property url logsPath: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
|
||||
property url licensePath: StandardPaths.standardLocations(StandardPaths.HomeLocation)[0]
|
||||
property url releaseNotesLink: Qt.resolvedUrl("https://protonmail.com/download/bridge/early_releases.html")
|
||||
property url dependencyLicensesLink: Qt.resolvedUrl("https://github.com/ProtonMail/proton-bridge/blob/master/COPYING_NOTES.md#dependencies")
|
||||
property url landingPageLink: Qt.resolvedUrl("https://protonmail.com/bridge")
|
||||
|
||||
property string colorSchemeName: "light"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -37,7 +37,7 @@ Rectangle {
|
||||
implicitHeight: content.height + 2*root._margin
|
||||
|
||||
color: root.colorScheme.background_norm
|
||||
radius: 9
|
||||
radius: ProtonStyle.card_radius
|
||||
|
||||
property int _margin: 24
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -159,7 +159,7 @@ Item {
|
||||
|
||||
highlight: Rectangle {
|
||||
color: leftBar.colorScheme.interaction_default_active
|
||||
radius: 4
|
||||
radius: ProtonStyle.account_row_radius
|
||||
}
|
||||
|
||||
model: root.backend.users
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -105,9 +105,10 @@ SettingsView {
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
|
||||
text: qsTr("Proton Mail Bridge v%1<br>© 2021 Proton AG<br>%2 %3").
|
||||
text: qsTr("Proton Mail Bridge v%1<br>© 2021 Proton AG<br>%2 %3<br>%4").
|
||||
arg(root.backend.version).
|
||||
arg(link(root.backend.licensePath, qsTr("License"))).
|
||||
arg(link(root.backend.dependencyLicensesLink, qsTr("Dependencies"))).
|
||||
arg(link(root.backend.releaseNotesLink, qsTr("Release notes")))
|
||||
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -28,7 +28,6 @@ import "tests"
|
||||
|
||||
ApplicationWindow {
|
||||
id: root
|
||||
title: "ProtonMail Bridge"
|
||||
|
||||
width: 960
|
||||
height: 576
|
||||
@ -98,10 +97,6 @@ ApplicationWindow {
|
||||
|
||||
property bool _showSetup: false
|
||||
currentIndex: {
|
||||
if (backend.showSplashScreen) {
|
||||
return 3
|
||||
}
|
||||
|
||||
// show welcome when there are no users or only one non-logged-in user is present
|
||||
if (backend.users.count === 0) {
|
||||
return 1
|
||||
@ -168,14 +163,6 @@ ApplicationWindow {
|
||||
}
|
||||
}
|
||||
|
||||
SplashScreen { // 3
|
||||
id: splashScreen
|
||||
colorScheme: root.colorScheme
|
||||
backend: root.backend
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
}
|
||||
|
||||
NotificationPopups {
|
||||
@ -185,6 +172,12 @@ ApplicationWindow {
|
||||
backend: root.backend
|
||||
}
|
||||
|
||||
SplashScreen {
|
||||
id: splashScreen
|
||||
colorScheme: root.colorScheme
|
||||
backend: root.backend
|
||||
}
|
||||
|
||||
function showLocalCacheSettings() { contentWrapper.showLocalCacheSettings() }
|
||||
function showSettings() { contentWrapper.showSettings() }
|
||||
function showHelp() { contentWrapper.showHelp() }
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -84,6 +84,7 @@ Dialog {
|
||||
wrapMode: Text.WordWrap
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
type: Label.LabelType.Body
|
||||
onLinkActivated: Qt.openUrlExternally(link)
|
||||
}
|
||||
|
||||
Item {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -74,7 +74,8 @@ QtObject {
|
||||
root.resetBridge,
|
||||
root.deleteAccount,
|
||||
root.noKeychain,
|
||||
root.rebuildKeychain
|
||||
root.rebuildKeychain,
|
||||
root.addressChanged
|
||||
]
|
||||
|
||||
// Connection
|
||||
@ -100,8 +101,13 @@ QtObject {
|
||||
// Updates
|
||||
property Notification updateManualReady: Notification {
|
||||
title: qsTr("Update to Bridge %1").arg(data ? data.version : "")
|
||||
description: qsTr("A new version of ProtonMail Bridge is available. See what's changed.")
|
||||
brief: qsTr("Update available. (See what's new.)")
|
||||
description: {
|
||||
var descr = qsTr("A new version of Proton Mail Bridge is available.")
|
||||
var text = qsTr("See what's changed.")
|
||||
var link = root.backend.releaseNotesLink
|
||||
return `${descr} <a href="${link}">${text}</a>`
|
||||
}
|
||||
brief: qsTr("Update available.")
|
||||
icon: "./icons/ic-info-circle-filled.svg"
|
||||
type: Notification.NotificationType.Info
|
||||
group: Notifications.Group.Update | Notifications.Group.Dialogs
|
||||
@ -834,10 +840,10 @@ QtObject {
|
||||
}
|
||||
|
||||
property Notification deleteAccount: Notification {
|
||||
title: qsTr("Delete this account?")
|
||||
title: qsTr("Remove this account?")
|
||||
brief: title
|
||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||
description: qsTr("Are you sure you want to delete this account and all the stored preferences and other data associated with it?")
|
||||
description: qsTr("Are you sure you want to remove this account from Bridge and delete locally stored preferences and data?")
|
||||
type: Notification.NotificationType.Danger
|
||||
group: Notifications.Group.Configuration | Notifications.Group.Dialogs
|
||||
|
||||
@ -861,7 +867,7 @@ QtObject {
|
||||
},
|
||||
Action {
|
||||
id: deleteAccount_delete
|
||||
text: qsTr("Delete this account")
|
||||
text: qsTr("Remove this account")
|
||||
onTriggered: {
|
||||
root.deleteAccount.user.remove()
|
||||
root.deleteAccount.active = false
|
||||
@ -935,4 +941,37 @@ QtObject {
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
property Notification addressChanged: Notification {
|
||||
title: qsTr("Address list changes")
|
||||
description: qsTr("The address list for your account has changed. You might need to reconfigure your email client.")
|
||||
brief: description
|
||||
icon: "./icons/ic-exclamation-circle-filled.svg"
|
||||
type: Notification.NotificationType.Warning
|
||||
group: Notifications.Group.Configuration
|
||||
|
||||
Connections {
|
||||
target: root.backend
|
||||
|
||||
onAddressChanged: {
|
||||
root.addressChanged.description = qsTr("The address list for your account %1 has changed. You might need to reconfigure your email client.").arg(address)
|
||||
root.addressChanged.active = true
|
||||
}
|
||||
|
||||
onAddressChangedLogout: {
|
||||
root.addressChanged.description = qsTr("The address list for your account %1 has changed. You have to reconfigure your email client.").arg(address)
|
||||
root.addressChanged.active = true
|
||||
}
|
||||
}
|
||||
|
||||
action: [
|
||||
Action {
|
||||
text: qsTr("OK")
|
||||
|
||||
onTriggered: {
|
||||
root.addressChanged.active = false
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -147,7 +147,7 @@ T.Button {
|
||||
background: Rectangle {
|
||||
implicitWidth: 36
|
||||
implicitHeight: 36
|
||||
radius: 4
|
||||
radius: Style.button_radius
|
||||
visible: true
|
||||
color: {
|
||||
if (!isIcon) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -39,7 +39,7 @@ T.CheckBox {
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 20
|
||||
implicitHeight: 20
|
||||
radius: 4
|
||||
radius: Style.checkbox_radius
|
||||
|
||||
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -88,4 +88,5 @@ QtObject {
|
||||
|
||||
// Images
|
||||
property string welcome_img
|
||||
property string logo_img
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -64,7 +64,7 @@ T.ComboBox {
|
||||
placeholderTextColor: root.enabled ? root.colorScheme.text_hint : root.colorScheme.text_disabled
|
||||
|
||||
background: Rectangle {
|
||||
radius: 4
|
||||
radius: Style.context_item_radius
|
||||
visible: root.enabled && root.editable && !root.flat
|
||||
border.color: {
|
||||
if (root.activeFocus) {
|
||||
@ -85,7 +85,7 @@ T.ComboBox {
|
||||
background: Rectangle {
|
||||
implicitWidth: 140
|
||||
implicitHeight: 36
|
||||
radius: 4
|
||||
radius: Style.context_item_radius
|
||||
color: {
|
||||
if (root.down) {
|
||||
return root.colorScheme.interaction_default_active
|
||||
@ -142,7 +142,7 @@ T.ComboBox {
|
||||
palette.highlightedText: selected ? root.colorScheme.text_invert : root.colorScheme.text_norm
|
||||
|
||||
background: PaddedRectangle {
|
||||
radius: 4
|
||||
radius: Style.context_item_radius
|
||||
color: {
|
||||
if (parent.down) {
|
||||
return root.colorScheme.interaction_default_active
|
||||
@ -187,7 +187,7 @@ T.ComboBox {
|
||||
|
||||
background: Rectangle {
|
||||
color: root.colorScheme.background_norm
|
||||
radius: 10
|
||||
radius: Style.dialog_radius
|
||||
border.color: root.colorScheme.border_weak
|
||||
border.width: 1
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -65,7 +65,7 @@ T.Dialog {
|
||||
|
||||
background: Rectangle {
|
||||
color: root.colorScheme.background_norm
|
||||
radius: 10
|
||||
radius: Style.dialog_radius
|
||||
}
|
||||
|
||||
// TODO: Add DropShadow here
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -27,10 +27,14 @@ T.Menu {
|
||||
|
||||
property ColorScheme colorScheme
|
||||
|
||||
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding)
|
||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding)
|
||||
implicitWidth: Math.max(
|
||||
implicitBackgroundWidth + leftInset + rightInset,
|
||||
contentWidth + leftPadding + rightPadding
|
||||
)
|
||||
implicitHeight: Math.max(
|
||||
implicitBackgroundHeight + topInset + bottomInset,
|
||||
contentHeight + topPadding + bottomPadding
|
||||
)
|
||||
|
||||
margins: 0
|
||||
overlap: 1
|
||||
@ -63,6 +67,6 @@ T.Menu {
|
||||
color: colorScheme.background_norm
|
||||
border.width: 1
|
||||
border.color: colorScheme.border_weak
|
||||
radius: 10
|
||||
radius: Style.account_row_radius
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -66,7 +66,7 @@ T.MenuItem {
|
||||
background: Rectangle {
|
||||
implicitWidth: 164
|
||||
implicitHeight: 36
|
||||
radius: 4
|
||||
radius: Style.button_radius
|
||||
color: control.down ? control.colorScheme.interaction_default_active : control.highlighted ? control.colorScheme.interaction_default_hover : control.colorScheme.interaction_default
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -25,6 +25,7 @@ import "./"
|
||||
// http://imaginativethinking.ca/make-qml-component-singleton/
|
||||
|
||||
QtObject {
|
||||
id: root
|
||||
// TODO: Once we will use Qt >=5.15 this should be refactored with inline components as follows:
|
||||
// https://doc.qt.io/qt-5/qtqml-documents-definetypes.html#inline-components
|
||||
|
||||
@ -39,72 +40,73 @@ QtObject {
|
||||
prominent: lightProminentStyle
|
||||
|
||||
// Primary
|
||||
primay_norm: "#657EE4"
|
||||
primay_norm: "#6D4AFF"
|
||||
|
||||
// Interaction-norm
|
||||
interaction_norm: "#657EE4"
|
||||
interaction_norm_hover: "#5064B6"
|
||||
interaction_norm_active: "#3C4B88"
|
||||
interaction_norm: "#6D4AFF"
|
||||
interaction_norm_hover: "#4D34B3"
|
||||
interaction_norm_active: "#372580"
|
||||
|
||||
// Text
|
||||
text_norm: "#262A33"
|
||||
text_weak: "#696F7D"
|
||||
text_hint: "#A4A9B5"
|
||||
text_disabled: "#BABEC7"
|
||||
text_norm: "#0C0C14"
|
||||
text_weak: "#706D6B"
|
||||
text_hint: "#8F8D8A"
|
||||
text_disabled: "#C2BFBC"
|
||||
text_invert: "#FFFFFF"
|
||||
|
||||
// Field
|
||||
field_norm: "#BABEC7"
|
||||
field_hover: "#A4A9B5"
|
||||
field_disabled: "#D0D3DA"
|
||||
field_norm: "#ADABA8"
|
||||
field_hover: "#8F8D8A"
|
||||
field_disabled: "#D1CFCD"
|
||||
|
||||
// Border
|
||||
border_norm: "#D0D3DA"
|
||||
border_weak: "#E7E9EC"
|
||||
border_norm: "#D1CFCD"
|
||||
border_weak: "#EAE7E4"
|
||||
|
||||
// Background
|
||||
background_norm: "#FFFFFF"
|
||||
background_weak: "#F3F4F6"
|
||||
background_strong: "#E7E9EC"
|
||||
background_avatar: "#A4A9B5"
|
||||
background_weak: "#F5F4F2"
|
||||
background_strong: "#EAE7E4"
|
||||
background_avatar: "#C2BFBC"
|
||||
|
||||
// Interaction-weak
|
||||
interaction_weak: "#D0D3DA"
|
||||
interaction_weak_hover: "#BABEC7"
|
||||
interaction_weak_active: "#A4A9B5"
|
||||
interaction_weak: "#D1CFCD"
|
||||
interaction_weak_hover: "#C2BFBC"
|
||||
interaction_weak_active: "#A8A6A3"
|
||||
|
||||
// Interaction-default
|
||||
interaction_default: "#00000000"
|
||||
interaction_default_hover: "#33BABEC7"
|
||||
interaction_default_active: "#4DBABEC7"
|
||||
interaction_default: Qt.rgba(0,0,0,0)
|
||||
interaction_default_hover: Qt.rgba(194./255., 191./255., 188./255., 0.2)
|
||||
interaction_default_active: Qt.rgba(194./255., 191./255., 188./255., 0.4)
|
||||
|
||||
// Scrollbar
|
||||
scrollbar_norm: "#D0D3DA"
|
||||
scrollbar_hover: "#BABEC7"
|
||||
scrollbar_norm: "#D1CFCD"
|
||||
scrollbar_hover: "#C2BFBC"
|
||||
|
||||
// Signal
|
||||
signal_danger: "#D42F34"
|
||||
signal_danger_hover: "#C7262B"
|
||||
signal_danger_active: "#BA1E23"
|
||||
signal_warning: "#F5830A"
|
||||
signal_warning_hover: "#F5740A"
|
||||
signal_warning_active: "#F5640A"
|
||||
signal_success: "#1B8561"
|
||||
signal_success_hover: "#147857"
|
||||
signal_success_active: "#0F6B4C"
|
||||
signal_info: "#1578CF"
|
||||
signal_info_hover: "#0E6DC2"
|
||||
signal_info_active: "#0764B5"
|
||||
signal_danger: "#DC3251"
|
||||
signal_danger_hover: "#F74F6D"
|
||||
signal_danger_active: "#B72346"
|
||||
signal_warning: "#FF9900"
|
||||
signal_warning_hover: "#FFB800"
|
||||
signal_warning_active: "#FF851A"
|
||||
signal_success: "#1EA885"
|
||||
signal_success_hover: "#23C299"
|
||||
signal_success_active: "#198F71"
|
||||
signal_info: "#239ECE"
|
||||
signal_info_hover: "#27B1E8"
|
||||
signal_info_active: "#1F83B5"
|
||||
|
||||
// Shadows
|
||||
shadow_norm: "#FFFFFF"
|
||||
shadow_lifted: "#FFFFFF"
|
||||
shadow_norm: Qt.rgba(0,0,0, 0.1) // #000000 10% x:0 y:1 blur:4
|
||||
shadow_lifted: Qt.rgba(0,0,0, 0.16) // #000000 16% x:0 y:8 blur:24
|
||||
|
||||
// Backdrop
|
||||
backdrop_norm: "#7A262A33"
|
||||
backdrop_norm: Qt.rgba(12./255., 12./255., 20./255., 0.32)
|
||||
|
||||
// Images
|
||||
welcome_img: "icons/img-welcome.png"
|
||||
logo_img: "icons/product_logos.svg"
|
||||
}
|
||||
|
||||
property ColorScheme lightProminentStyle: ColorScheme {
|
||||
@ -113,72 +115,73 @@ QtObject {
|
||||
prominent: this
|
||||
|
||||
// Primary
|
||||
primay_norm: "#657EE4"
|
||||
primay_norm: "#8A6EFF"
|
||||
|
||||
// Interaction-norm
|
||||
interaction_norm: "#657EE4"
|
||||
interaction_norm_hover: "#7D92E8"
|
||||
interaction_norm_active: "#98A9EE"
|
||||
interaction_norm: "#6D4AFF"
|
||||
interaction_norm_hover: "#7C5CFF"
|
||||
interaction_norm_active: "#8A6EFF"
|
||||
|
||||
// Text
|
||||
text_norm: "#FFFFFF"
|
||||
text_weak: "#949BB9"
|
||||
text_hint: "#565F84"
|
||||
text_disabled: "#444E72"
|
||||
text_invert: "#1C223D"
|
||||
text_weak: "#9282D4"
|
||||
text_hint: "#544399"
|
||||
text_disabled: "#4A398F"
|
||||
text_invert: "#1B1340"
|
||||
|
||||
// Field
|
||||
field_norm: "#565F84"
|
||||
field_hover: "#949BB9"
|
||||
field_disabled: "#353E60"
|
||||
field_norm: "#9282D4"
|
||||
field_hover: "#7C5CFF"
|
||||
field_disabled: "#38277A"
|
||||
|
||||
// Border
|
||||
border_norm: "#353E60"
|
||||
border_weak: "#2D3657"
|
||||
border_norm: "#413085"
|
||||
border_weak: "#3C2B80"
|
||||
|
||||
// Background
|
||||
background_norm: "#1C223D"
|
||||
background_weak: "#272F4F"
|
||||
background_strong: "#2D3657"
|
||||
background_avatar: "#444E72"
|
||||
background_norm: "#1B1340"
|
||||
background_weak: "#271C57"
|
||||
background_strong: "#38277A"
|
||||
background_avatar: "#6D4AFF"
|
||||
|
||||
// Interaction-weak
|
||||
interaction_weak: "#353E60"
|
||||
interaction_weak_hover: "#444E72"
|
||||
interaction_weak_active: "#565F84"
|
||||
interaction_weak: "#4A398F"
|
||||
interaction_weak_hover: "#6D4AFF"
|
||||
interaction_weak_active: "#8A6EFF"
|
||||
|
||||
// Interaction-default
|
||||
interaction_default: "#00000000"
|
||||
interaction_default_hover: "#4D444E72"
|
||||
interaction_default_active: "#66444E72"
|
||||
interaction_default: Qt.rgba(0,0,0,0)
|
||||
interaction_default_hover: Qt.rgba(68./255., 78./255., 114./255., 0.2)
|
||||
interaction_default_active: Qt.rgba(68./255., 78./255., 114./255., 0.3)
|
||||
|
||||
// Scrollbar
|
||||
scrollbar_norm: "#353E60"
|
||||
scrollbar_hover: "#444E72"
|
||||
scrollbar_norm: "#413085"
|
||||
scrollbar_hover: "#4A398F"
|
||||
|
||||
// Signal
|
||||
signal_danger: "#ED4C51"
|
||||
signal_danger_hover: "#F7595E"
|
||||
signal_danger_active: "#FF666B"
|
||||
signal_warning: "#F5930A"
|
||||
signal_warning_hover: "#F5A716"
|
||||
signal_warning_active: "#F5B922"
|
||||
signal_success: "#349172"
|
||||
signal_success_hover: "#339C79"
|
||||
signal_success_active: "#31A67F"
|
||||
signal_danger: "#F5385A"
|
||||
signal_danger_hover: "#FF5473"
|
||||
signal_danger_active: "#DC3251"
|
||||
signal_warning: "#FF9900"
|
||||
signal_warning_hover: "#FFB800"
|
||||
signal_warning_active: "#FF8419"
|
||||
signal_success: "#1EA885"
|
||||
signal_success_hover: "#23C299"
|
||||
signal_success_active: "#198F71"
|
||||
signal_info: "#2C89DB"
|
||||
signal_info_hover: "#3491E3"
|
||||
signal_info_active: "#3D99EB"
|
||||
signal_info_active: "#1F83B5"
|
||||
|
||||
// Shadows
|
||||
shadow_norm: "#1C223D"
|
||||
shadow_lifted: "#1C223D"
|
||||
shadow_norm: Qt.rgba(0,0,0, 0.32) // #000000 32% x:0 y:1 blur:4
|
||||
shadow_lifted: Qt.rgba(0,0,0, 0.40) // #000000 40% x:0 y:8 blur:24
|
||||
|
||||
// Backdrop
|
||||
backdrop_norm: "#52000000"
|
||||
backdrop_norm: Qt.rgba(0,0,0, 0.32)
|
||||
|
||||
// Images
|
||||
welcome_img: "icons/img-welcome-dark.png"
|
||||
logo_img: "icons/product_logos_dark.svg"
|
||||
}
|
||||
|
||||
property ColorScheme darkStyle: ColorScheme {
|
||||
@ -187,72 +190,73 @@ QtObject {
|
||||
prominent: darkProminentStyle
|
||||
|
||||
// Primary
|
||||
primay_norm: "#657EE4"
|
||||
primay_norm: "#8A6EFF"
|
||||
|
||||
// Interaction-norm
|
||||
interaction_norm: "#657EE4"
|
||||
interaction_norm_hover: "#7D92E8"
|
||||
interaction_norm_active: "#98A9EE"
|
||||
interaction_norm: "#6D4AFF"
|
||||
interaction_norm_hover: "#7C5CFF"
|
||||
interaction_norm_active: "#8A6EFF"
|
||||
|
||||
// Text
|
||||
text_norm: "#FFFFFF"
|
||||
text_weak: "#A4A9B5"
|
||||
text_hint: "#696F7D"
|
||||
text_disabled: "#575D6B"
|
||||
text_invert: "#262A33"
|
||||
text_weak: "#A7A4B5"
|
||||
text_hint: "#6D697D"
|
||||
text_disabled: "#5B576B"
|
||||
text_invert: "#1C1B24"
|
||||
|
||||
// Field
|
||||
field_norm: "#575D6B"
|
||||
field_hover: "#696F7D"
|
||||
field_disabled: "#464B58"
|
||||
field_norm: "#5B576B"
|
||||
field_hover: "#6D697D"
|
||||
field_disabled: "#3F3B4C"
|
||||
|
||||
// Border
|
||||
border_norm: "#464B58"
|
||||
border_weak: "#363A46"
|
||||
border_norm: "#4A4658"
|
||||
border_weak: "#343140"
|
||||
|
||||
// Background
|
||||
background_norm: "#262A33"
|
||||
background_weak: "#2E323C"
|
||||
background_strong: "#363A46"
|
||||
background_avatar: "#575D6B"
|
||||
background_norm: "#1C1B24"
|
||||
background_weak: "#292733"
|
||||
background_strong: "#3F3B4C"
|
||||
background_avatar: "#6D4AFF"
|
||||
|
||||
// Interaction-weak
|
||||
interaction_weak: "#464B58"
|
||||
interaction_weak_hover: "#575D6B"
|
||||
interaction_weak_active: "#696F7D"
|
||||
interaction_weak: "#4A4658"
|
||||
interaction_weak_hover: "#5B576B"
|
||||
interaction_weak_active: "#6D697D"
|
||||
|
||||
// Interaction-default
|
||||
interaction_default: "#00000000"
|
||||
interaction_default_hover: "#33575D6B"
|
||||
interaction_default_active: "#4D575D6B"
|
||||
interaction_default_hover: Qt.rgba(91./255.,87./255.,107./255.,0.2)
|
||||
interaction_default_active: Qt.rgba(91./255.,87./255.,107./255.,0.4)
|
||||
|
||||
// Scrollbar
|
||||
scrollbar_norm: "#464B58"
|
||||
scrollbar_hover: "#575D6B"
|
||||
scrollbar_norm: "#4A4658"
|
||||
scrollbar_hover: "#5B576B"
|
||||
|
||||
// Signal
|
||||
signal_danger: "#ED4C51"
|
||||
signal_danger_hover: "#F7595E"
|
||||
signal_danger_active: "#FF666B"
|
||||
signal_warning: "#F5930A"
|
||||
signal_warning_hover: "#F5A716"
|
||||
signal_warning_active: "#F5B922"
|
||||
signal_success: "#349172"
|
||||
signal_success_hover: "#339C79"
|
||||
signal_success_active: "#31A67F"
|
||||
signal_info: "#2C89DB"
|
||||
signal_info_hover: "#3491E3"
|
||||
signal_info_active: "#3D99EB"
|
||||
signal_danger: "#F5385A"
|
||||
signal_danger_hover: "#FF5473"
|
||||
signal_danger_active: "#DC3251"
|
||||
signal_warning: "#FF9900"
|
||||
signal_warning_hover: "#FFB800"
|
||||
signal_warning_active: "#FF8419"
|
||||
signal_success: "#1EA885"
|
||||
signal_success_hover: "#23C299"
|
||||
signal_success_active: "#198F71"
|
||||
signal_info: "#239ECE"
|
||||
signal_info_hover: "#27B1E8"
|
||||
signal_info_active: "#1F83B5"
|
||||
|
||||
// Shadows
|
||||
shadow_norm: "#262A33" // #000000 32% x+0 y+1 blur:4
|
||||
shadow_lifted: "#262A33" // #000000 40% x+0 y+8 blur:24
|
||||
shadow_norm: Qt.rgba(0,0,0,0.4) // #000000 40% x+0 y+1 blur:4
|
||||
shadow_lifted: Qt.rgba(0,0,0,0.48) // #000000 48% x+0 y+8 blur:24
|
||||
|
||||
// Backdrop
|
||||
backdrop_norm: "#52000000"
|
||||
backdrop_norm: Qt.rgba(0,0,0,0.32)
|
||||
|
||||
// Images
|
||||
welcome_img: "icons/img-welcome-dark.png"
|
||||
logo_img: "icons/product_logos_dark.svg"
|
||||
}
|
||||
|
||||
property ColorScheme darkProminentStyle: ColorScheme {
|
||||
@ -261,72 +265,73 @@ QtObject {
|
||||
prominent: this
|
||||
|
||||
// Primary
|
||||
primay_norm: "#657EE4"
|
||||
primay_norm: "#8A6EFF"
|
||||
|
||||
// Interaction-norm
|
||||
interaction_norm: "#657EE4"
|
||||
interaction_norm_hover: "#7D92E8"
|
||||
interaction_norm_active: "#98A9EE"
|
||||
interaction_norm: "#6D4AFF"
|
||||
interaction_norm_hover: "#7C5CFF"
|
||||
interaction_norm_active: "#8A6EFF"
|
||||
|
||||
// Text
|
||||
text_norm: "#FFFFFF"
|
||||
text_weak: "#A4A9B5"
|
||||
text_hint: "#696F7D"
|
||||
text_disabled: "#575D6B"
|
||||
text_invert: "#262A33"
|
||||
text_weak: "#A7A4B5"
|
||||
text_hint: "#6D697D"
|
||||
text_disabled: "#5B576B"
|
||||
text_invert: "#1C1B24"
|
||||
|
||||
// Field
|
||||
field_norm: "#575D6B"
|
||||
field_hover: "#696F7D"
|
||||
field_disabled: "#464B58"
|
||||
field_norm: "#5B576B"
|
||||
field_hover: "#6D697D"
|
||||
field_disabled: "#3F3B4C"
|
||||
|
||||
// Border
|
||||
border_norm: "#464B58"
|
||||
border_weak: "#363A46"
|
||||
border_norm: "#4A4658"
|
||||
border_weak: "#343140"
|
||||
|
||||
// Background
|
||||
background_norm: "#1A1D24"
|
||||
background_weak: "#2E323C"
|
||||
background_strong: "#363A46"
|
||||
background_avatar: "#575D6B"
|
||||
background_norm: "#16141c"
|
||||
background_weak: "#292733"
|
||||
background_strong: "#3F3B4C"
|
||||
background_avatar: "#6D4AFF"
|
||||
|
||||
// Interaction-weak
|
||||
interaction_weak: "#464B58"
|
||||
interaction_weak_hover: "#575D6B"
|
||||
interaction_weak_active: "#696F7D"
|
||||
interaction_weak: "#4A4658"
|
||||
interaction_weak_hover: "#5B576B"
|
||||
interaction_weak_active: "#6D697D"
|
||||
|
||||
// Interaction-default
|
||||
interaction_default: "#00000000"
|
||||
interaction_default_hover: "#33575D6B"
|
||||
interaction_default_active: "#4D575D6B"
|
||||
interaction_default_hover: Qt.rgba(91./255.,87./255.,107./255.,0.2)
|
||||
interaction_default_active: Qt.rgba(91./255.,87./255.,107./255.,0.4)
|
||||
|
||||
// Scrollbar
|
||||
scrollbar_norm: "#464B58"
|
||||
scrollbar_hover: "#575D6B"
|
||||
scrollbar_norm: "#4A4658"
|
||||
scrollbar_hover: "#5B576B"
|
||||
|
||||
// Signal
|
||||
signal_danger: "#ED4C51"
|
||||
signal_danger_hover: "#F7595E"
|
||||
signal_danger_active: "#FF666B"
|
||||
signal_warning: "#F5930A"
|
||||
signal_warning_hover: "#F5A716"
|
||||
signal_warning_active: "#F5B922"
|
||||
signal_success: "#349172"
|
||||
signal_success_hover: "#339C79"
|
||||
signal_success_active: "#31A67F"
|
||||
signal_info: "#2C89DB"
|
||||
signal_info_hover: "#3491E3"
|
||||
signal_info_active: "#3D99EB"
|
||||
signal_danger: "#F5385A"
|
||||
signal_danger_hover: "#FF5473"
|
||||
signal_danger_active: "#DC3251"
|
||||
signal_warning: "#FF9900"
|
||||
signal_warning_hover: "#FFB800"
|
||||
signal_warning_active: "#FF8419"
|
||||
signal_success: "#1EA885"
|
||||
signal_success_hover: "#23C299"
|
||||
signal_success_active: "#198F71"
|
||||
signal_info: "#239ECE"
|
||||
signal_info_hover: "#27B1E8"
|
||||
signal_info_active: "#1F83B5"
|
||||
|
||||
// Shadows
|
||||
shadow_norm: "#262A33" // #000000 32% x+0 y+1 blur:4
|
||||
shadow_lifted: "#262A33" // #000000 40% x+0 y+8 blur:24
|
||||
shadow_norm: Qt.rgba(0,0,0,0.4) // #000000 40% x+0 y+1 blur:4
|
||||
shadow_lifted: Qt.rgba(0,0,0,0.48) // #000000 48% x+0 y+8 blur:24
|
||||
|
||||
// Backdrop
|
||||
backdrop_norm: "#52000000"
|
||||
backdrop_norm: Qt.rgba(0,0,0,0.32)
|
||||
|
||||
// Images
|
||||
welcome_img: "icons/img-welcome-dark.png"
|
||||
logo_img: "icons/product_logos_dark.svg"
|
||||
}
|
||||
|
||||
property ColorScheme currentStyle: lightStyle
|
||||
@ -344,6 +349,22 @@ QtObject {
|
||||
}
|
||||
}
|
||||
|
||||
property real px : 1.00 // px
|
||||
|
||||
property real input_radius : 8 * root.px // px
|
||||
property real button_radius : 8 * root.px // px
|
||||
property real checkbox_radius : 4 * root.px // px
|
||||
property real avatar_radius : 8 * root.px // px
|
||||
property real big_avatar_radius : 12 * root.px // px
|
||||
property real account_hover_radius : 12 * root.px // px
|
||||
property real account_row_radius : 12 * root.px // px
|
||||
property real context_item_radius : 8 * root.px // px
|
||||
property real banner_radius : 12 * root.px // px
|
||||
property real dialog_radius : 12 * root.px // px
|
||||
property real card_radius : 12 * root.px // px
|
||||
property real storage_bar_radius : 3 * root.px // px
|
||||
property real tooltip_radius : 8 * root.px // px
|
||||
|
||||
property int heading_font_size: 28
|
||||
property int heading_line_height: 36
|
||||
|
||||
@ -355,11 +376,11 @@ QtObject {
|
||||
|
||||
property int body_font_size: 14
|
||||
property int body_line_height: 20
|
||||
property real body_letter_spacing: 0.2
|
||||
property real body_letter_spacing: 0.2 * root.px
|
||||
|
||||
property int caption_font_size: 12
|
||||
property int caption_line_height: 16
|
||||
property real caption_letter_spacing: 0.4
|
||||
property real caption_letter_spacing: 0.4 * root.px
|
||||
|
||||
property int fontWeight_100: Font.Thin
|
||||
property int fontWeight_200: Font.Light
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -53,7 +53,7 @@ T.Switch {
|
||||
x: text ? (control.mirrored ? control.width - width - control.rightPadding : control.leftPadding) : control.leftPadding + (control.availableWidth - width) / 2
|
||||
y: control.topPadding + (control.availableHeight - height) / 2
|
||||
|
||||
radius: 12
|
||||
radius: height / 2.
|
||||
color: control.enabled || control.loading ? control.colorScheme.background_norm : control.colorScheme.background_strong
|
||||
border.width: control.enabled && !loading ? 1 : 0
|
||||
border.color: control.hovered ? control.colorScheme.field_hover : control.colorScheme.field_norm
|
||||
@ -63,7 +63,7 @@ T.Switch {
|
||||
y: (parent.height - height) / 2
|
||||
width: 24
|
||||
height: 24
|
||||
radius: 12
|
||||
radius: parent.radius
|
||||
|
||||
visible: !loading
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
// Copyright (c) 2022 Proton Technologies AG
|
||||
// Copyright (c) 2022 Proton AG
|
||||
//
|
||||
// This file is part of Proton Mail Bridge.
|
||||
//
|
||||
@ -270,7 +270,7 @@ FocusScope {
|
||||
background: Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
radius: 4
|
||||
radius: Style.input_radius
|
||||
visible: true
|
||||
color: root.colorScheme.background_norm
|
||||
border.color: {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user