Skip to content

Commit

Permalink
first commit of the public version
Browse files Browse the repository at this point in the history
added all the materia of the first public version of the project
  • Loading branch information
ITzTravelInTime committed Oct 17, 2017
1 parent 5e7dfd4 commit 3fa8143
Show file tree
Hide file tree
Showing 55 changed files with 6,398 additions and 0 deletions.
5 changes: 5 additions & 0 deletions TINU-Bridging-Header.h
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
690 changes: 690 additions & 0 deletions TINU.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions TINU.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added TINU/.DS_Store
Binary file not shown.
163 changes: 163 additions & 0 deletions TINU/AppDelegate.swift
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)
}
}


}

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
68 changes: 68 additions & 0 deletions TINU/Assets.xcassets/AppIcon.appiconset/Contents.json
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"
}
}
6 changes: 6 additions & 0 deletions TINU/Assets.xcassets/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
21 changes: 21 additions & 0 deletions TINU/Assets.xcassets/check-1.imageset/Contents.json
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"
}
}
Binary file added TINU/Assets.xcassets/check-1.imageset/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TINU/Assets.xcassets/check.imageset/Contents.json
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"
}
}
Binary file added TINU/Assets.xcassets/check.imageset/check.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TINU/Assets.xcassets/logo.imageset/Contents.json
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"
}
}
Binary file added TINU/Assets.xcassets/logo.imageset/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TINU/Assets.xcassets/uncheck.imageset/Contents.json
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"
}
}
Binary file added TINU/Assets.xcassets/uncheck.imageset/uncheck.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions TINU/Assets.xcassets/warning.imageset/Contents.json
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.
Loading

0 comments on commit 3fa8143

Please sign in to comment.