mirror of
https://github.com/GopeedLab/gopeed.git
synced 2026-11-19 14:53:44 +00:00
feat: new ui (#1455)
This commit is contained in:
742 files changed
+59951
-5934
No files matched your search
@@ -4,17 +4,17 @@ import app_links
|
||||
|
||||
@main
|
||||
class AppDelegate: FlutterAppDelegate {
|
||||
public override func application(_ application: NSApplication,
|
||||
continue userActivity: NSUserActivity,
|
||||
restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void) -> Bool {
|
||||
|
||||
override func application(
|
||||
_ application: NSApplication,
|
||||
continue userActivity: NSUserActivity,
|
||||
restorationHandler: @escaping ([any NSUserActivityRestoring]) -> Void
|
||||
) -> Bool {
|
||||
guard let url = AppLinks.shared.getUniversalLink(userActivity) else {
|
||||
return false
|
||||
}
|
||||
|
||||
AppLinks.shared.handleLink(link: url.absoluteString)
|
||||
|
||||
return false // Returning true will stop the propagation to other packages
|
||||
// Keep propagating the activity to other registered plugins.
|
||||
return false
|
||||
}
|
||||
|
||||
override func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
|
||||
@@ -32,23 +32,19 @@ class AppDelegate: FlutterAppDelegate {
|
||||
window.setIsVisible(true)
|
||||
}
|
||||
window.makeKeyAndOrderFront(self)
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
NSApp.activate(ignoringOtherApps: true)
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
override func application(_ sender: NSApplication, openFile filename: String) -> Bool {
|
||||
let url = URL(fileURLWithPath: filename)
|
||||
AppLinks.shared.handleLink(link: url.absoluteString)
|
||||
return false;
|
||||
AppLinks.shared.handleLink(link: URL(fileURLWithPath: filename).absoluteString)
|
||||
return true
|
||||
}
|
||||
|
||||
override func application(_ application: NSApplication, open urls: [URL]) {
|
||||
// Only handle the first file
|
||||
if(urls.isEmpty) {
|
||||
return
|
||||
}
|
||||
AppLinks.shared.handleLink(link: urls.first!.absoluteString)
|
||||
guard let url = urls.first else { return }
|
||||
AppLinks.shared.handleLink(link: url.absoluteString)
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user