diff options
| -rw-r--r-- | Hotline/Hotline.entitlements | 4 | ||||
| -rw-r--r-- | Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift | 4 | ||||
| -rw-r--r-- | Hotline/Info.plist | 10 | ||||
| -rw-r--r-- | Hotline/Library/Views/HotlinePanel.swift | 5 | ||||
| -rw-r--r-- | Hotline/macOS/ServerView.swift | 28 |
5 files changed, 38 insertions, 13 deletions
diff --git a/Hotline/Hotline.entitlements b/Hotline/Hotline.entitlements index e15d27d..074bc56 100644 --- a/Hotline/Hotline.entitlements +++ b/Hotline/Hotline.entitlements @@ -2,10 +2,6 @@ <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> - <key>aps-environment</key> - <string>development</string> - <key>com.apple.developer.aps-environment</key> - <string>development</string> <key>com.apple.developer.icloud-container-identifiers</key> <array> <string>iCloud.co.goodmake.hotline</string> diff --git a/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift b/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift index 82f61d4..6441047 100644 --- a/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift +++ b/Hotline/Hotline/Transfers/HotlineFileDownloadClient.swift @@ -125,9 +125,7 @@ public class HotlineFileDownloadClient: @MainActor HotlineTransferClient { destinationURL = url.resolvingSymlinksInPath() destinationFilename = destinationURL.lastPathComponent case .downloads(let filename): - var downloadsURL = fm.urls(for: .downloadsDirectory, in: .userDomainMask)[0] - downloadsURL = downloadsURL.resolvingSymlinksInPath() - destinationURL = URL(filePath: downloadsURL.generateUniqueFilePath(filename: filename)) + destinationURL = URL.downloadsDirectory.resolvingSymlinksInPath().generateUniqueFileURL(filename: filename) destinationFilename = destinationURL.lastPathComponent } diff --git a/Hotline/Info.plist b/Hotline/Info.plist index 82ee6ac..59b1e50 100644 --- a/Hotline/Info.plist +++ b/Hotline/Info.plist @@ -7,11 +7,13 @@ <dict> <key>CFBundleTypeName</key> <string>Hotline Bookmark</string> + <key>CFBundleTypeRole</key> + <string>Editor</string> <key>LSHandlerRank</key> <string>Owner</string> <key>LSItemContentTypes</key> <array> - <string>'HTbm'</string> + <string>'HTbm'</string> </array> </dict> </array> @@ -19,7 +21,7 @@ <array> <dict> <key>CFBundleTypeRole</key> - <string>Viewer</string> + <string>Editor</string> <key>CFBundleURLName</key> <string>co.goodmake.hotline</string> <key>CFBundleURLSchemes</key> @@ -29,7 +31,7 @@ </dict> <dict> <key>CFBundleTypeRole</key> - <string>Viewer</string> + <string>Editor</string> <key>CFBundleURLName</key> <string>co.goodmake.hotline</string> <key>CFBundleURLSchemes</key> @@ -46,7 +48,7 @@ <key>UTTypeIconFiles</key> <array/> <key>UTTypeIdentifier</key> - <string>'HTbm'</string> + <string>'HTbm'</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> diff --git a/Hotline/Library/Views/HotlinePanel.swift b/Hotline/Library/Views/HotlinePanel.swift index d7d8284..f6d76fc 100644 --- a/Hotline/Library/Views/HotlinePanel.swift +++ b/Hotline/Library/Views/HotlinePanel.swift @@ -22,7 +22,10 @@ class HotlinePanel: NSPanel { // Don't delete panel state when it's closed. self.isReleasedWhenClosed = false - + + // Disable state restoration for this utility panel + self.isRestorable = false + self.standardWindowButton(.closeButton)?.isHidden = false self.standardWindowButton(.zoomButton)?.isHidden = true self.standardWindowButton(.miniaturizeButton)?.isHidden = true diff --git a/Hotline/macOS/ServerView.swift b/Hotline/macOS/ServerView.swift index 98ab976..399deba 100644 --- a/Hotline/macOS/ServerView.swift +++ b/Hotline/macOS/ServerView.swift @@ -425,6 +425,7 @@ struct ServerTransferRow: View { @Environment(HotlineState.self) private var model: HotlineState @State private var hovered: Bool = false @State private var buttonHovered: Bool = false + @State private var detailsShown: Bool = false var body: some View { HStack(alignment: .center, spacing: 5) { @@ -508,6 +509,7 @@ struct ServerTransferRow: View { withAnimation(.snappy(duration: 0.25, extraBounce: 0.3)) { self.hovered = hovered } + self.detailsShown = hovered } .onTapGesture(count: 2) { guard transfer.completed, let url = transfer.fileURL else { @@ -516,7 +518,31 @@ struct ServerTransferRow: View { NSWorkspace.shared.activateFileViewerSelecting([url]) } - .help(self.formattedProgressHelp) + .popover(isPresented: .constant(self.detailsShown && !self.transfer.done), arrowEdge: .trailing) { + let rows: [(String, String)] = [ + ("document", self.transfer.title), + ("info", self.transfer.displaySize), + (self.transfer.isUpload ? "arrow.up" : "arrow.down", self.transfer.displaySpeed ?? "--"), + ("clock", self.transfer.displayTimeRemaining ?? "--") + ] + + Grid(alignment: .leading, horizontalSpacing: 8, verticalSpacing: 8) { + ForEach(rows, id: \.0) { imageName, label in + GridRow { + Image(systemName: imageName) + .resizable() + .scaledToFit() + .frame(width: 16, height: 16) + .gridColumnAlignment(.trailing) + Text(label) + .monospacedDigit() + .gridColumnAlignment(.leading) + } + } + } + .frame(minWidth: 200, maxWidth: 350, alignment: .leading) + .padding() + } } private var formattedProgressHelp: String { |