-
Notifications
You must be signed in to change notification settings - Fork 37
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added all the materia of the first public version of the project
- Loading branch information
1 parent
5e7dfd4
commit 3fa8143
Showing
55 changed files
with
6,398 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// | ||
// Use this file to import your target's public headers that you would like to expose to Swift. | ||
// | ||
|
||
//Unused header file |
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,163 @@ | ||
// | ||
// AppDelegate.swift | ||
// TINU | ||
// | ||
// Created by Pietro Caruso on 24/08/17. | ||
// Copyright © 2017 Pietro Caruso. All rights reserved. | ||
// | ||
|
||
import Cocoa | ||
|
||
@NSApplicationMain | ||
class AppDelegate: NSObject, NSApplicationDelegate { | ||
@IBOutlet weak var verboseItem: NSMenuItem! | ||
@IBOutlet weak var verboseItemSpace: NSMenuItem! | ||
|
||
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool { | ||
return true | ||
} | ||
|
||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply { | ||
if sharedIsPreCreationInProgress{ | ||
msgBox("You can't quit now", "You can't quit from TINU now, wait for the format to end or press the cancel button on the windows that asks for the password, and then quit if you want", .informational) | ||
return NSApplicationTerminateReply.terminateCancel | ||
} | ||
|
||
|
||
if sharedIsCreationInProgress{ | ||
if !dialogYesNo(question: "Installer creation in progress in progess", text: "The installer creation is inprogress do you want to quit?", style: .warning){ | ||
if let i = sharedWindow.contentViewController as? InstallingViewController{ | ||
i.stop() | ||
} | ||
}else{ | ||
return NSApplicationTerminateReply.terminateCancel | ||
} | ||
} | ||
erasePassword() | ||
return NSApplicationTerminateReply.terminateNow | ||
} | ||
|
||
@IBOutlet weak var QuitMenuButton: NSMenuItem! | ||
|
||
func applicationDidFinishLaunching(_ aNotification: Notification) { | ||
// Insert code here to initialize your application | ||
//checkUser() | ||
//checkAppMode() | ||
|
||
if Bundle.main.url(forResource: "DebugScript", withExtension: "sh") == nil || sharedIsOnRecovery{ | ||
verboseItem.isHidden = true | ||
verboseItemSpace.isHidden = true | ||
if !sharedIsOnRecovery{ | ||
print("Verbose mode script not present") | ||
}else{ | ||
print("Verbose mode not usable under recovery") | ||
} | ||
}else{ | ||
verboseItem.isHidden = false | ||
verboseItemSpace.isHidden = false | ||
print("Verbose mode script present") | ||
} | ||
|
||
} | ||
|
||
func applicationWillTerminate(_ aNotification: Notification) { | ||
// Insert code here to tear down your application | ||
|
||
if sharedIsCreationInProgress{ | ||
if let i = sharedWindow.contentViewController as? InstallingViewController{ | ||
i.stop() | ||
} | ||
} | ||
} | ||
@IBAction func OpenGithub(_ sender: Any) { | ||
if let checkURL = NSURL(string: "https://github.com/ITzTravelInTime/TINU") { | ||
if NSWorkspace.shared().open(checkURL as URL) { | ||
print("url successfully opened: " + String(describing: checkURL)) | ||
} | ||
} else { | ||
print("invalid url") | ||
} | ||
} | ||
|
||
@IBAction func InsanelyMacThread(_ sender: Any) { | ||
if let checkURL = NSURL(string: "http://www.insanelymac.com/forum/topic/326959-tinu-the-macos-installer-creator-app-mac-app/") { | ||
if NSWorkspace.shared().open(checkURL as URL) { | ||
print("url successfully opened: " + String(describing: checkURL)) | ||
} | ||
} else { | ||
print("invalid url") | ||
} | ||
} | ||
|
||
private var secondWindowController: ContactsWindowController? | ||
|
||
@IBAction func openContacts(_ sender: Any) { | ||
//open here a window with all the contacts inside | ||
|
||
if secondWindowController == nil { | ||
secondWindowController = ContactsWindowController() | ||
} | ||
|
||
secondWindowController?.showWindow(self) | ||
|
||
} | ||
|
||
private var creditsWindowController: CreditsWindowController? | ||
|
||
@IBAction func openCredits(_ sender: Any) { | ||
//open here a window with all the credits inside | ||
|
||
if creditsWindowController == nil { | ||
creditsWindowController = CreditsWindowController() | ||
} | ||
|
||
creditsWindowController?.showWindow(self) | ||
|
||
} | ||
|
||
@IBAction func VoodooTSCSyncConfigurator(_ sender: Any) { | ||
if let checkURL = NSURL(string: "http://www.insanelymac.com/forum/files/file/744-voodootscsync-configurator/") { | ||
if NSWorkspace.shared().open(checkURL as URL) { | ||
print("url successfully opened: " + String(describing: checkURL)) | ||
} | ||
} else { | ||
print("invalid url") | ||
} | ||
} | ||
|
||
@IBAction func openVerbose(_ sender: Any) { | ||
if !sharedIsCreationInProgress{ | ||
if let f = Bundle.main.url(forResource: "DebugScript", withExtension: "sh"){ | ||
if !sharedIsOnRecovery{ | ||
print("Trying to fix script permitions") | ||
if let e = getErrWithSudo(cmd: "chmod -R 771 \"" + f.path + "\""){ | ||
if e == "" || e == "Password:\n" || e == "Password:" { | ||
print("Script permitions fixed with success") | ||
print("Restarting app with log in the terminal") | ||
NSWorkspace.shared().openFile(f.path, withApplication: "Terminal") | ||
NSApplication.shared().terminate(self) | ||
}else{ | ||
print("Script permitions fix failed") | ||
print("Application not opened: " + e) | ||
} | ||
}else{ | ||
|
||
} | ||
}else{ | ||
//recovery special mode | ||
print("Restarting app with log in the terminal") | ||
NSWorkspace.shared().openFile(f.path, withApplication: "Terminal") | ||
NSApplication.shared().terminate(self) | ||
} | ||
|
||
}else{ | ||
|
||
} | ||
}else{ | ||
msgBox("You can't switch mode now", "The macOS install media creation process is currenly running, please cancel the operation or wait the end of the operation before switching mode", .warning) | ||
} | ||
} | ||
|
||
|
||
} | ||
|
Binary file added
BIN
+1.08 MB
...sets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-1024.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+26.5 KB
...ssets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.93 KB
...Assets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+82.9 KB
...ssets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-256.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+3.68 KB
...Assets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+298 KB
...ssets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+9.09 KB
...Assets.xcassets/AppIcon.appiconset/21100949_475187179526802_1743676795_n-64.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"size" : "16x16", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-16.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "16x16", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-32.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "32x32", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-32.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "32x32", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-64.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "128x128", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-128.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "128x128", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-256.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "256x256", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-256.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "256x256", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-512.png", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"size" : "512x512", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-512.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"size" : "512x512", | ||
"idiom" : "mac", | ||
"filename" : "21100949_475187179526802_1743676795_n-1024.png", | ||
"scale" : "2x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "check.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "check.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "logo.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "uncheck.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "universal", | ||
"filename" : "warning-2.png", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"version" : 1, | ||
"author" : "xcode" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.