Skip to content

Commit

Permalink
Copy selected object ids to clipboard
Browse files Browse the repository at this point in the history
  • Loading branch information
kenohori committed Nov 17, 2016
1 parent ac2f8c0 commit f0bb5f8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/Base.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
</menuItem>
<menuItem title="Copy" keyEquivalent="c" id="x3v-GG-iWU">
<connections>
<action selector="copy:" target="-1" id="G1f-GL-Joy"/>
<action selector="copy:" target="Voe-Tx-rLC" id="Lio-le-pYM"/>
</connections>
</menuItem>
<menuItem title="Paste" keyEquivalent="v" id="gVA-U4-sdL">
Expand Down
7 changes: 7 additions & 0 deletions src/Controller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,13 @@ class Controller: NSObject, NSApplicationDelegate {
})
}

@IBAction func copy(_ sender: NSMenuItem) {
let pasteboard = NSPasteboard.general()
pasteboard.clearContents()
pasteboard.declareTypes([NSStringPboardType], owner: self)
pasteboard.setString(dataStorage.selection.joined(separator: ","), forType: NSStringPboardType)
}

@IBAction func toggleViewEdges(_ sender: NSMenuItem) {
if let metalView = view as? MetalView {
if metalView.viewEdges {
Expand Down
1 change: 1 addition & 0 deletions src/DataStorage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ class DataStorage: NSObject, NSOutlineViewDataSource, NSOutlineViewDelegate {
}

self.storeData(in: cityGMLParser)
cityGMLParser.clear()

while self.view == nil {
Thread.sleep(forTimeInterval: 0.01)
Expand Down

0 comments on commit f0bb5f8

Please sign in to comment.