diff --git a/Source/Modules/WindowControllers/CtlClientListMgr.swift b/Source/Modules/WindowControllers/CtlClientListMgr.swift index e07df6a5..629cb889 100644 --- a/Source/Modules/WindowControllers/CtlClientListMgr.swift +++ b/Source/Modules/WindowControllers/CtlClientListMgr.swift @@ -103,31 +103,38 @@ extension CtlClientListMgr { "Choose the target application bundle.", comment: "" ) dlgOpenPath.showsResizeIndicator = true + dlgOpenPath.allowsMultipleSelection = true + dlgOpenPath.allowedFileTypes = ["app"] + dlgOpenPath.allowsOtherFileTypes = false dlgOpenPath.showsHiddenFiles = true dlgOpenPath.canChooseFiles = true dlgOpenPath.canChooseDirectories = false dlgOpenPath.beginSheetModal(for: window) { result in switch result { case .OK: - guard let url = dlgOpenPath.url else { return } - var title = NSLocalizedString("The selected item is not a valid macOS application bundle.", comment: "") - let text = NSLocalizedString("Please try again.", comment: "") - guard let bundle = Bundle(url: url) else { - self.callAlert(window, title: title, text: text) - return - } - guard let identifier = bundle.bundleIdentifier else { - self.callAlert(window, title: title, text: text) - return - } - if PrefMgr.shared.clientsIMKTextInputIncapable.contains(identifier) { - title = NSLocalizedString( - "The selected item's identifier is already in the list.", comment: "" + for url in dlgOpenPath.urls { + var title = NSLocalizedString( + "The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier.", + comment: "" ) - self.callAlert(window, title: title) - return + let text = url.path + "\n\n" + NSLocalizedString("Please try again.", comment: "") + guard let bundle = Bundle(url: url) else { + self.callAlert(window, title: title, text: text) + return + } + guard let identifier = bundle.bundleIdentifier else { + self.callAlert(window, title: title, text: text) + return + } + if PrefMgr.shared.clientsIMKTextInputIncapable.contains(identifier) { + title = NSLocalizedString( + "The selected item's identifier is already in the list.", comment: "" + ) + self.callAlert(window, title: title, text: identifier + "\n\n" + url.path) + return + } + self.applyNewValue(identifier) } - self.applyNewValue(identifier) default: return } } diff --git a/Source/Resources/Base.lproj/Localizable.strings b/Source/Resources/Base.lproj/Localizable.strings index 2173e5a7..5d3e63ee 100644 --- a/Source/Resources/Base.lproj/Localizable.strings +++ b/Source/Resources/Base.lproj/Localizable.strings @@ -10,7 +10,7 @@ "Add Client" = "Add Client"; "Remove Selected" = "Remove Selected"; "Choose the target application bundle." = "Choose the target application bundle."; -"The selected item is not a valid macOS application bundle." = "The selected item is not a valid macOS application bundle."; +"The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier." = "The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier."; "Please try again." = "Please try again."; "The selected item's identifier is already in the list." = "The selected item's identifier is already in the list."; "Update Check Completed" = "Update Check Completed"; diff --git a/Source/Resources/en.lproj/Localizable.strings b/Source/Resources/en.lproj/Localizable.strings index 2173e5a7..5d3e63ee 100644 --- a/Source/Resources/en.lproj/Localizable.strings +++ b/Source/Resources/en.lproj/Localizable.strings @@ -10,7 +10,7 @@ "Add Client" = "Add Client"; "Remove Selected" = "Remove Selected"; "Choose the target application bundle." = "Choose the target application bundle."; -"The selected item is not a valid macOS application bundle." = "The selected item is not a valid macOS application bundle."; +"The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier." = "The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier."; "Please try again." = "Please try again."; "The selected item's identifier is already in the list." = "The selected item's identifier is already in the list."; "Update Check Completed" = "Update Check Completed"; diff --git a/Source/Resources/ja.lproj/Localizable.strings b/Source/Resources/ja.lproj/Localizable.strings index accf7c21..5db50ad0 100644 --- a/Source/Resources/ja.lproj/Localizable.strings +++ b/Source/Resources/ja.lproj/Localizable.strings @@ -10,7 +10,7 @@ "Add Client" = "入れる"; "Remove Selected" = "外す"; "Choose the target application bundle." = "登録したいアプリのバンドルのお選びを。"; -"The selected item is not a valid macOS application bundle." = "今選んだんのは正しい macOS アプリバンドルではないと考えられる。"; +"The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier." = "今選んだんのは正しい macOS アプリバンドルではないと考えられる。少なくとも、唯一識別子は検出できぬ。"; "Please try again." = "お選び直しください。"; "The selected item's identifier is already in the list." = "今選んだバンドルの唯一識別子(Bundle Identifier)は既に登録済みである。"; "Update Check Completed" = "新バージョンチェック完了"; diff --git a/Source/Resources/zh-Hans.lproj/Localizable.strings b/Source/Resources/zh-Hans.lproj/Localizable.strings index 67941353..3a43c7da 100644 --- a/Source/Resources/zh-Hans.lproj/Localizable.strings +++ b/Source/Resources/zh-Hans.lproj/Localizable.strings @@ -10,7 +10,7 @@ "Add Client" = "登记新客体"; "Remove Selected" = "移除所选条目"; "Choose the target application bundle." = "请选择要登记的应用程式的封包。"; -"The selected item is not a valid macOS application bundle." = "当前所选之物并非 macOS 应用程式封包。"; +"The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier." = "当前所选之物并非 macOS 应用程式封包,至少无法发现其唯一标帜(Bundle Identifier)。"; "Please try again." = "请重试。"; "The selected item's identifier is already in the list." = "当前所选之封包的唯一标帜(Bundle Identifier)已被登记。"; "Update Check Completed" = "更新检查完毕"; diff --git a/Source/Resources/zh-Hant.lproj/Localizable.strings b/Source/Resources/zh-Hant.lproj/Localizable.strings index e6c28b9c..e8c39bfd 100644 --- a/Source/Resources/zh-Hant.lproj/Localizable.strings +++ b/Source/Resources/zh-Hant.lproj/Localizable.strings @@ -10,7 +10,7 @@ "Add Client" = "登記新客體"; "Remove Selected" = "移除所選條目"; "Choose the target application bundle." = "請選擇要登記的應用程式的封包。"; -"The selected item is not a valid macOS application bundle." = "當前所選之物並非 macOS 應用程式封包。"; +"The selected item is not a valid macOS application bundle, nor not having a valid app bundle identifier." = "當前所選之物並非 macOS 應用程式封包,至少無法發現其唯一標幟(Bundle Identifier)。"; "Please try again." = "請重試。"; "The selected item's identifier is already in the list." = "當前所選之封包的唯一標幟(Bundle Identifier)已被登記。"; "Update Check Completed" = "更新檢查完畢";