File tree Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Expand file tree Collapse file tree 3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change 13151315 <behavior key =" behavior" pushIn =" YES" lightByBackground =" YES" lightByGray =" YES" />
13161316 <font key =" font" metaFont =" cellTitle" />
13171317 </buttonCell >
1318+ <connections >
1319+ <action selector =" openURL:" target =" 0A2-e5-fyj" id =" GsW-Zy-yPi" />
1320+ </connections >
13181321 </button >
13191322 </subviews >
13201323 <visibilityPriorities >
15901593 <behavior key =" behavior" pushIn =" YES" lightByBackground =" YES" lightByGray =" YES" />
15911594 <font key =" font" metaFont =" cellTitle" />
15921595 </buttonCell >
1596+ <connections >
1597+ <action selector =" openURL:" target =" bvi-xf-WO0" id =" Ttq-gc-Nh4" />
1598+ </connections >
15931599 </button >
15941600 </subviews >
15951601 <visibilityPriorities >
Original file line number Diff line number Diff line change @@ -53,4 +53,22 @@ class ItemListCellView: NSTableCellView {
5353 }
5454 }
5555 }
56+
57+ @IBAction func openURL( _ sender: NSButton ) {
58+ guard objectValue != nil else {
59+ return
60+ }
61+ let item = objectValue as! TopLevelItem
62+
63+ let url : URL
64+ switch item {
65+ case . story( let story) :
66+ guard story. content. url != nil else { return }
67+ url = story. content. url!
68+ case . job( let job) :
69+ guard job. content. url != nil else { return }
70+ url = job. content. url!
71+ }
72+ NSWorkspace . shared. open ( url)
73+ }
5674}
Original file line number Diff line number Diff line change @@ -54,6 +54,20 @@ class ItemViewController: NSViewController {
5454 }
5555 }
5656
57+ @IBAction func openURL( _ sender: NSButton ) {
58+ let url : URL
59+ switch item {
60+ case . story( let story) :
61+ guard story. content. url != nil else { return }
62+ url = story. content. url!
63+ case . job( let job) :
64+ guard job. content. url != nil else { return }
65+ url = job. content. url!
66+ default : return
67+ }
68+ NSWorkspace . shared. open ( url)
69+ }
70+
5771 override func viewDidLoad( ) {
5872 super. viewDidLoad ( )
5973 // Do view setup here.
You can’t perform that action at this time.
0 commit comments