From fdd30413c4b8a5acfbf0db749e20dc2406767fdc Mon Sep 17 00:00:00 2001 From: ad Date: Thu, 19 Apr 2018 18:18:54 +0300 Subject: [PATCH] * open dialog at default configs directory --- MTMR/AppDelegate.swift | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/MTMR/AppDelegate.swift b/MTMR/AppDelegate.swift index 3c4e037..850031a 100644 --- a/MTMR/AppDelegate.swift +++ b/MTMR/AppDelegate.swift @@ -42,13 +42,14 @@ class AppDelegate: NSObject, NSApplicationDelegate { @objc func openPreset(_ sender: Any?) { let dialog = NSOpenPanel(); - dialog.title = "Choose a items.json file"; - dialog.showsResizeIndicator = true; - dialog.showsHiddenFiles = true; - dialog.canChooseDirectories = false; - dialog.canCreateDirectories = false; - dialog.allowsMultipleSelection = false; - dialog.allowedFileTypes = ["json"]; + dialog.title = "Choose a items.json file" + dialog.showsResizeIndicator = true + dialog.showsHiddenFiles = true + dialog.canChooseDirectories = false + dialog.canCreateDirectories = false + dialog.allowsMultipleSelection = false + dialog.allowedFileTypes = ["json"] + dialog.directoryURL = NSURL.fileURL(withPath: NSSearchPathForDirectoriesInDomains(.applicationSupportDirectory, .userDomainMask, true).first!.appending("/MTMR"), isDirectory: true) if (dialog.runModal() == NSApplication.ModalResponse.OK) { let result = dialog.url