mirror of
https://github.com/TomHarte/CLK.git
synced 2025-02-16 18:30:32 +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)
|
||||
}
|
||||
|
||||
/// Saves a screenshot of the
|
||||
/// Saves a screenshot of the machine's current display.
|
||||
@IBAction func saveScreenshot(_ sender: AnyObject!) {
|
||||
// Grab a date formatter and form a file name.
|
||||
let dateFormatter = DateFormatter()
|
||||
@ -605,8 +605,8 @@ class MachineDocument:
|
||||
|
||||
let filename = ("Clock Signal Screen Shot " + dateFormatter.string(from: Date()) + ".png").replacingOccurrences(of: "/", with: "-")
|
||||
.replacingOccurrences(of: ":", with: ".")
|
||||
let pictursURL = FileManager.default.urls(for: .picturesDirectory, in: .userDomainMask)[0]
|
||||
let url = pictursURL.appendingPathComponent(filename)
|
||||
let desktopURL = FileManager.default.urls(for: .desktopDirectory, in: .userDomainMask)[0]
|
||||
let url = desktopURL.appendingPathComponent(filename)
|
||||
|
||||
// Obtain the machine's current display.
|
||||
var imageRepresentation: NSBitmapImageRep? = nil
|
||||
|
Loading…
x
Reference in New Issue
Block a user