Commit Graph

17 Commits

Author SHA1 Message Date
Davide De Rosa 7ccb10febc
Rethink library architecture (#301) 2023-05-24 18:19:47 +02:00
Davide De Rosa b4ad8dea0d Do some code clean up
- Use guard in validators

- Rename URL.openURL() to URL.open()

- Sort imports (SwiftLint)

- Drop unused VPNProtocolType.allTypes

- Drop unused imports
2023-05-21 11:48:03 +02:00
Davide De Rosa 7e2e4d6caa
Import missing translations (#280) 2023-04-04 17:07:41 +02:00
Davide De Rosa f06f097f27
Add SwiftLint phase (#262) 2023-03-17 21:55:47 +01:00
Davide De Rosa 26c34638cb Make category optional in server long description 2023-03-17 18:09:21 +01:00
Davide De Rosa 37354d1b87 Update copyright 2023-03-17 16:56:19 +01:00
Dmitry Chirkin 07eaa54f1b
Ukrainian transaltion (#243)
Co-authored-by: Davide De Rosa <keeshux@gmail.com>
2022-11-01 14:20:09 +01:00
Davide De Rosa fbc17877b1 Suppress buggy Xcode warnings
@discardableResult annotations became suddenly ineffective.
2022-10-15 22:30:21 +02:00
Davide De Rosa 6031d0119a Drop assertion on legit intents scenario 2022-10-13 19:10:45 +02:00
Davide De Rosa 5627e6c4a9
Address UI race conditions (#229)
* Make some managers concurrency-safe

- IntentsManager: @MainActor, non-shared, continuation

- SSIDReader: @MainActor, continuation

- Reviewer: main queue, non-shared

* Review wrong use of Concurrency framework

There were background thread calls e.g. in VPNToggle, because
ProfileManager was used inside a VPNManager async call.

Annotate @MainActor wherever a Task involves UI.

* Make main managers MainActor

* Apply MainActor to Mac menus

* [ci skip] Update CHANGELOG

* Set MainActor consistently on Mac menu view models
2022-10-13 08:53:50 +02:00
Davide De Rosa 092d4f5de2 Drop return in one-line functions 2022-09-04 20:30:55 +02:00
Davide De Rosa 9458c4f3a3 Fix server description and sorting
- Name (countries, area)
- Index
- Tags

Also use short description in menu (without country prefix).
2022-07-16 17:39:42 +02:00
Davide De Rosa 58e375ec41 Attach @MainActor where needed
Some methods were updating UI from non-main thread.
2022-07-16 17:39:42 +02:00
Davide De Rosa 3f4b55a003 Implement Mac bundle with system menu
Use bundle as a means to provide Mac APIs to Catalyst app.

In order to cross the @objc wall set by the Mac Bundle mechanism,
Swift structures cannot be used directly and must be bridged
through ObjC facades.

Create NSMenu in MVVM style and install it on app launch. Make
sure to do it in AppDelegate.applicationDidFinishLaunching(),
because doing it as early as in PassepartoutApp.init() would
crash Mac code.

Use .representedObject to own view models.

With menu in place, app can be sent to background when main window
is closed. Requires multiple documents support for app not to die
instantly.
2022-07-16 17:39:42 +02:00
Davide De Rosa 9a8477225e Refactor library into domain + impl 2022-06-23 23:31:01 +02:00
Davide De Rosa 35ec73570e Use NEHotspotNetwork to fetch current SSID
Old method did not work on Catalyst.
2022-05-15 22:24:36 +02:00
Davide De Rosa bf65f76401 Merge project into iOS + macOS
Share views with both platforms initially. Will split specific
views step by step.
2022-04-19 16:14:23 +02:00