File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,7 +16,39 @@ class AppDelegate: NSObject, NSApplicationDelegate {
1616 func applicationDidFinishLaunching( _ aNotification: Notification )
1717 {
1818 }
19-
19+
20+ @IBAction func openHelp( _ sender: NSMenuItem )
21+ {
22+ self . mainViewController!. getHelp ( sender: sender)
23+ }
24+
25+ func dialogOKCancel( question: String , text: String ) -> Bool {
26+ let alert = NSAlert ( )
27+ alert. messageText = question
28+ alert. informativeText = text
29+ alert. alertStyle = NSAlertStyle . warning
30+ alert. addButton ( withTitle: " OK " )
31+ alert. addButton ( withTitle: " Cancel " )
32+ return alert. runModal ( ) == NSAlertFirstButtonReturn
33+ }
34+
35+ @IBAction func promptDirectory( _ sender: Any )
36+ {
37+ let vc = mainViewController!
38+
39+ let openPanel = NSOpenPanel ( )
40+ openPanel. allowsMultipleSelection = false
41+ openPanel. canChooseDirectories = true
42+ openPanel. canCreateDirectories = true
43+ openPanel. canChooseFiles = false
44+ openPanel. begin { ( result) -> Void in
45+ if result == NSFileHandlingPanelOKButton {
46+ vc. ITUNES_BACKUP_PATH = " \( ( openPanel. url? . path) !) / "
47+ vc. refreshDevices ( )
48+ }
49+ }
50+ }
51+
2052 func applicationWillTerminate( _ aNotification: Notification ) {
2153 // Insert code here to tear down your application
2254 }
You can’t perform that action at this time.
0 commit comments