mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Force OPML extension on NSSavePanel
`allowedContentTypes` in now `.opml` only for export subscriptions. To ensure that this extension is used, the `nameFieldStringValue` no longer provides an extension.
This commit is contained in:
@@ -75,7 +75,7 @@ import Account
|
||||
func exportOPML(account: Account) {
|
||||
|
||||
let panel = NSSavePanel()
|
||||
panel.allowedContentTypes = [.xml]
|
||||
panel.allowedContentTypes = [.opml]
|
||||
panel.allowsOtherFileTypes = false
|
||||
panel.prompt = NSLocalizedString("panel.prompt.export-opml", comment: "Export OPML")
|
||||
panel.title = NSLocalizedString("panel.title.export-opml", comment: "Export OPML")
|
||||
@@ -84,7 +84,7 @@ import Account
|
||||
panel.isExtensionHidden = false
|
||||
|
||||
let accountName = account.nameForDisplay.replacingOccurrences(of: " ", with: "").trimmingCharacters(in: .whitespaces)
|
||||
panel.nameFieldStringValue = "Subscriptions-\(accountName).opml"
|
||||
panel.nameFieldStringValue = "Subscriptions-\(accountName)"
|
||||
|
||||
panel.beginSheetModal(for: hostWindow!) { result in
|
||||
if result == NSApplication.ModalResponse.OK, let url = panel.url {
|
||||
|
||||
Reference in New Issue
Block a user