mirror of
https://github.com/nimbold/Firelink.git
synced 2026-07-26 12:08:27 +00:00
0ddea52db8
- Implement Firefox extension to intercept downloads and scrape selected links via context menus - Create LocalExtensionServer over TCP (localhost:6412) to receive links from the extension - Automatically package extension to firelink.xpi in create_app_bundle.sh - Add Integrations tab in SettingsView with one-click installer for Firefox variants - Modify ContentView and TrayMenuView to automatically open the Add Downloads window on extension trigger
42 lines
1.1 KiB
Swift
42 lines
1.1 KiB
Swift
import SwiftUI
|
|
|
|
struct TrayMenuView: View {
|
|
@Environment(\.openWindow) private var openWindow
|
|
@EnvironmentObject private var controller: DownloadController
|
|
|
|
var body: some View {
|
|
Button("Show main window") {
|
|
openWindow(id: "main")
|
|
NSApp.activate(ignoringOtherApps: true)
|
|
}
|
|
|
|
Button("Add downloads") {
|
|
openWindow(id: "add-downloads")
|
|
NSApp.activate(ignoringOtherApps: true)
|
|
}
|
|
|
|
Menu("Start queue") {
|
|
ForEach(controller.queues) { queue in
|
|
Button(queue.name) {
|
|
controller.startQueue(queueID: queue.id)
|
|
}
|
|
}
|
|
}
|
|
|
|
Button("Stop downloads") {
|
|
for download in controller.downloads where download.status == .downloading {
|
|
controller.pause(download)
|
|
}
|
|
}
|
|
|
|
Divider()
|
|
|
|
Button("Exit") {
|
|
NSApplication.shared.terminate(nil)
|
|
}
|
|
.onReceive(NotificationCenter.default.publisher(for: NSNotification.Name("OpenAddDownloadsWindow"))) { _ in
|
|
openWindow(id: "add-downloads")
|
|
}
|
|
}
|
|
}
|