Skip to content

Commit

Permalink
fix display error when backup path missing, allow specifying
Browse files Browse the repository at this point in the history
  • Loading branch information
vgmoose committed Mar 21, 2018
1 parent 0017505 commit 788e725
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 340 deletions.
Binary file added Frameworks/libmagic.a
Binary file not shown.
34 changes: 33 additions & 1 deletion Open Backup Extractor/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,39 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification)
{
}


@IBAction func openHelp(_ sender: NSMenuItem)
{
self.mainViewController!.getHelp(sender: sender)
}

func dialogOKCancel(question: String, text: String) -> Bool {
let alert = NSAlert()
alert.messageText = question
alert.informativeText = text
alert.alertStyle = NSAlertStyle.warning
alert.addButton(withTitle: "OK")
alert.addButton(withTitle: "Cancel")
return alert.runModal() == NSAlertFirstButtonReturn
}

@IBAction func promptDirectory(_ sender: Any)
{
let vc = mainViewController!

let openPanel = NSOpenPanel()
openPanel.allowsMultipleSelection = false
openPanel.canChooseDirectories = true
openPanel.canCreateDirectories = true
openPanel.canChooseFiles = false
openPanel.begin { (result) -> Void in
if result == NSFileHandlingPanelOKButton {
vc.ITUNES_BACKUP_PATH = "\((openPanel.url?.path)!)/"
vc.refreshDevices()
}
}
}

func applicationWillTerminate(_ aNotification: Notification) {
// Insert code here to tear down your application
}
Expand Down
Loading

0 comments on commit 788e725

Please sign in to comment.