mirror of
https://github.com/TomHarte/CLK.git
synced 2024-10-05 23:56:33 +00:00
Switch to saving screenshots to the desktop.
Or, at least, try. User permission would be required. More reading necessary.
This commit is contained in:
parent
b514756272
commit
fbe479c43f
@ -596,7 +596,7 @@ class MachineDocument:
|
|||||||
return super.validateUserInterfaceItem(item)
|
return super.validateUserInterfaceItem(item)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Saves a screenshot of the
|
/// Saves a screenshot of the machine's current display.
|
||||||
@IBAction func saveScreenshot(_ sender: AnyObject!) {
|
@IBAction func saveScreenshot(_ sender: AnyObject!) {
|
||||||
// Grab a date formatter and form a file name.
|
// Grab a date formatter and form a file name.
|
||||||
let dateFormatter = DateFormatter()
|
let dateFormatter = DateFormatter()
|
||||||
@ -605,8 +605,8 @@ class MachineDocument:
|
|||||||
|
|
||||||
let filename = ("Clock Signal Screen Shot " + dateFormatter.string(from: Date()) + ".png").replacingOccurrences(of: "/", with: "-")
|
let filename = ("Clock Signal Screen Shot " + dateFormatter.string(from: Date()) + ".png").replacingOccurrences(of: "/", with: "-")
|
||||||
.replacingOccurrences(of: ":", with: ".")
|
.replacingOccurrences(of: ":", with: ".")
|
||||||
let pictursURL = FileManager.default.urls(for: .picturesDirectory, in: .userDomainMask)[0]
|
let desktopURL = FileManager.default.urls(for: .desktopDirectory, in: .userDomainMask)[0]
|
||||||
let url = pictursURL.appendingPathComponent(filename)
|
let url = desktopURL.appendingPathComponent(filename)
|
||||||
|
|
||||||
// Obtain the machine's current display.
|
// Obtain the machine's current display.
|
||||||
var imageRepresentation: NSBitmapImageRep? = nil
|
var imageRepresentation: NSBitmapImageRep? = nil
|
||||||
|
Loading…
Reference in New Issue
Block a user