• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-cqtcocoa誰得pythonphprubygameguibathyscaphec翻訳計画中(planning stage)omegatframeworktwittertestdomvb.netdirectxbtronarduinopreviewerゲームエンジン

macOSのスクリーンショットの保存場所を変更するメニュバーエクストラ


Commit MetaInfo

Revision7399f8a5498109ba7c2251b2cc63baff75d48952 (tree)
Time2017-11-04 23:17:10
Authormasakih <masakih@user...>
Commitermasakih

Log Message

Seledctorを静的定数として持たず直接与えるようにした

Change Summary

Incremental Difference

--- a/GoInto/ChooseFolderItem.swift
+++ b/GoInto/ChooseFolderItem.swift
@@ -25,9 +25,6 @@ extension ActionListener {
2525 owner.urlSelector(url)
2626 }
2727 }
28-extension Selector {
29- static let selectFolder = #selector(ActionListener.selectFolder(_:))
30-}
3128
3229 class ChooseFolderItem: StatusItem {
3330 let menuItem = NSMenuItem()
@@ -37,7 +34,7 @@ class ChooseFolderItem: StatusItem {
3734 init(_ handler: @escaping ((URL) -> Void)) {
3835 urlSelector = handler
3936 menuItem.title = NSLocalizedString("Choose Folder", comment: "Choose Folder MenuItem")
40- menuItem.action = .selectFolder
37+ menuItem.action = #selector(ActionListener.selectFolder(_:))
4138 menuItem.target = listener
4239 listener.owner = self
4340 }
--- a/GoInto/FolderItem.swift
+++ b/GoInto/FolderItem.swift
@@ -14,9 +14,6 @@ extension ActionListener {
1414 owner.set()
1515 }
1616 }
17-extension Selector {
18- static let changeFolder = #selector(ActionListener.changeFolder(_:))
19-}
2017
2118 final class FolderItem: StatusItem {
2219 let url: URL
@@ -35,7 +32,7 @@ final class FolderItem: StatusItem {
3532
3633 let work = NSWorkspace.shared()
3734 menuItem.image = fitSize(work.icon(forFile: url.path))
38- menuItem.action = .changeFolder
35+ menuItem.action = #selector(ActionListener.changeFolder(_:))
3936 menuItem.target = listener
4037 listener.owner = self
4138 }
--- a/GoInto/ImageTypeItem.swift
+++ b/GoInto/ImageTypeItem.swift
@@ -17,9 +17,6 @@ extension ActionListener {
1717 owner.set(typeName)
1818 }
1919 }
20-extension Selector {
21- static let selectType = #selector(ActionListener.selectType(_:))
22-}
2320
2421 private func loadImageTypes() -> [String] {
2522 guard let url = Bundle.main.url(forResource: "ImageType", withExtension: "plist"),
@@ -46,7 +43,7 @@ class ImageTypeItem: StatusItem {
4643 .map {
4744 let item = NSMenuItem()
4845 item.title = ws.localizedDescription(forType: $0) ?? "Never Use Default Value"
49- item.action = .selectType
46+ item.action = #selector(ActionListener.selectType(_:))
5047 item.target = listener
5148 item.representedObject = ws.preferredFilenameExtension(forType: $0)
5249 return item
--- a/GoInto/QuitItem.swift
+++ b/GoInto/QuitItem.swift
@@ -14,10 +14,6 @@ extension ActionListener {
1414 }
1515 }
1616
17-extension Selector {
18- static let quit = #selector(ActionListener.quit(_:))
19-}
20-
2117 class QuitItem: StatusItem {
2218 let menuItem = NSMenuItem()
2319 private let listener = ActionListener()
@@ -25,7 +21,7 @@ class QuitItem: StatusItem {
2521 init() {
2622 let format = NSLocalizedString("Quit %@", comment: "Quit Menu Item")
2723 menuItem.title = String(format: format, AppDelegate.appName)
28- menuItem.action = .quit
24+ menuItem.action = #selector(ActionListener.quit(_:))
2925 menuItem.target = listener
3026 }
3127 }