Skip to content
This repository was archived by the owner on Feb 1, 2025. It is now read-only.

Commit 3fa8143

Browse files
first commit of the public version
added all the materia of the first public version of the project
1 parent 5e7dfd4 commit 3fa8143

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6398
-0
lines changed

TINU-Bridging-Header.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
//
2+
// Use this file to import your target's public headers that you would like to expose to Swift.
3+
//
4+
5+
//Unused header file

TINU.xcodeproj/project.pbxproj

Lines changed: 690 additions & 0 deletions
Large diffs are not rendered by default.

TINU.xcodeproj/project.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

TINU/.DS_Store

6 KB
Binary file not shown.

TINU/AppDelegate.swift

Lines changed: 163 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,163 @@
1+
//
2+
// AppDelegate.swift
3+
// TINU
4+
//
5+
// Created by Pietro Caruso on 24/08/17.
6+
// Copyright © 2017 Pietro Caruso. All rights reserved.
7+
//
8+
9+
import Cocoa
10+
11+
@NSApplicationMain
12+
class AppDelegate: NSObject, NSApplicationDelegate {
13+
@IBOutlet weak var verboseItem: NSMenuItem!
14+
@IBOutlet weak var verboseItemSpace: NSMenuItem!
15+
16+
func applicationShouldTerminateAfterLastWindowClosed(_ sender: NSApplication) -> Bool {
17+
return true
18+
}
19+
20+
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply {
21+
if sharedIsPreCreationInProgress{
22+
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)
23+
return NSApplicationTerminateReply.terminateCancel
24+
}
25+
26+
27+
if sharedIsCreationInProgress{
28+
if !dialogYesNo(question: "Installer creation in progress in progess", text: "The installer creation is inprogress do you want to quit?", style: .warning){
29+
if let i = sharedWindow.contentViewController as? InstallingViewController{
30+
i.stop()
31+
}
32+
}else{
33+
return NSApplicationTerminateReply.terminateCancel
34+
}
35+
}
36+
erasePassword()
37+
return NSApplicationTerminateReply.terminateNow
38+
}
39+
40+
@IBOutlet weak var QuitMenuButton: NSMenuItem!
41+
42+
func applicationDidFinishLaunching(_ aNotification: Notification) {
43+
// Insert code here to initialize your application
44+
//checkUser()
45+
//checkAppMode()
46+
47+
if Bundle.main.url(forResource: "DebugScript", withExtension: "sh") == nil || sharedIsOnRecovery{
48+
verboseItem.isHidden = true
49+
verboseItemSpace.isHidden = true
50+
if !sharedIsOnRecovery{
51+
print("Verbose mode script not present")
52+
}else{
53+
print("Verbose mode not usable under recovery")
54+
}
55+
}else{
56+
verboseItem.isHidden = false
57+
verboseItemSpace.isHidden = false
58+
print("Verbose mode script present")
59+
}
60+
61+
}
62+
63+
func applicationWillTerminate(_ aNotification: Notification) {
64+
// Insert code here to tear down your application
65+
66+
if sharedIsCreationInProgress{
67+
if let i = sharedWindow.contentViewController as? InstallingViewController{
68+
i.stop()
69+
}
70+
}
71+
}
72+
@IBAction func OpenGithub(_ sender: Any) {
73+
if let checkURL = NSURL(string: "https://github.com/ITzTravelInTime/TINU") {
74+
if NSWorkspace.shared().open(checkURL as URL) {
75+
print("url successfully opened: " + String(describing: checkURL))
76+
}
77+
} else {
78+
print("invalid url")
79+
}
80+
}
81+
82+
@IBAction func InsanelyMacThread(_ sender: Any) {
83+
if let checkURL = NSURL(string: "http://www.insanelymac.com/forum/topic/326959-tinu-the-macos-installer-creator-app-mac-app/") {
84+
if NSWorkspace.shared().open(checkURL as URL) {
85+
print("url successfully opened: " + String(describing: checkURL))
86+
}
87+
} else {
88+
print("invalid url")
89+
}
90+
}
91+
92+
private var secondWindowController: ContactsWindowController?
93+
94+
@IBAction func openContacts(_ sender: Any) {
95+
//open here a window with all the contacts inside
96+
97+
if secondWindowController == nil {
98+
secondWindowController = ContactsWindowController()
99+
}
100+
101+
secondWindowController?.showWindow(self)
102+
103+
}
104+
105+
private var creditsWindowController: CreditsWindowController?
106+
107+
@IBAction func openCredits(_ sender: Any) {
108+
//open here a window with all the credits inside
109+
110+
if creditsWindowController == nil {
111+
creditsWindowController = CreditsWindowController()
112+
}
113+
114+
creditsWindowController?.showWindow(self)
115+
116+
}
117+
118+
@IBAction func VoodooTSCSyncConfigurator(_ sender: Any) {
119+
if let checkURL = NSURL(string: "http://www.insanelymac.com/forum/files/file/744-voodootscsync-configurator/") {
120+
if NSWorkspace.shared().open(checkURL as URL) {
121+
print("url successfully opened: " + String(describing: checkURL))
122+
}
123+
} else {
124+
print("invalid url")
125+
}
126+
}
127+
128+
@IBAction func openVerbose(_ sender: Any) {
129+
if !sharedIsCreationInProgress{
130+
if let f = Bundle.main.url(forResource: "DebugScript", withExtension: "sh"){
131+
if !sharedIsOnRecovery{
132+
print("Trying to fix script permitions")
133+
if let e = getErrWithSudo(cmd: "chmod -R 771 \"" + f.path + "\""){
134+
if e == "" || e == "Password:\n" || e == "Password:" {
135+
print("Script permitions fixed with success")
136+
print("Restarting app with log in the terminal")
137+
NSWorkspace.shared().openFile(f.path, withApplication: "Terminal")
138+
NSApplication.shared().terminate(self)
139+
}else{
140+
print("Script permitions fix failed")
141+
print("Application not opened: " + e)
142+
}
143+
}else{
144+
145+
}
146+
}else{
147+
//recovery special mode
148+
print("Restarting app with log in the terminal")
149+
NSWorkspace.shared().openFile(f.path, withApplication: "Terminal")
150+
NSApplication.shared().terminate(self)
151+
}
152+
153+
}else{
154+
155+
}
156+
}else{
157+
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)
158+
}
159+
}
160+
161+
162+
}
163+
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
{
2+
"images" : [
3+
{
4+
"size" : "16x16",
5+
"idiom" : "mac",
6+
"filename" : "21100949_475187179526802_1743676795_n-16.png",
7+
"scale" : "1x"
8+
},
9+
{
10+
"size" : "16x16",
11+
"idiom" : "mac",
12+
"filename" : "21100949_475187179526802_1743676795_n-32.png",
13+
"scale" : "2x"
14+
},
15+
{
16+
"size" : "32x32",
17+
"idiom" : "mac",
18+
"filename" : "21100949_475187179526802_1743676795_n-32.png",
19+
"scale" : "1x"
20+
},
21+
{
22+
"size" : "32x32",
23+
"idiom" : "mac",
24+
"filename" : "21100949_475187179526802_1743676795_n-64.png",
25+
"scale" : "2x"
26+
},
27+
{
28+
"size" : "128x128",
29+
"idiom" : "mac",
30+
"filename" : "21100949_475187179526802_1743676795_n-128.png",
31+
"scale" : "1x"
32+
},
33+
{
34+
"size" : "128x128",
35+
"idiom" : "mac",
36+
"filename" : "21100949_475187179526802_1743676795_n-256.png",
37+
"scale" : "2x"
38+
},
39+
{
40+
"size" : "256x256",
41+
"idiom" : "mac",
42+
"filename" : "21100949_475187179526802_1743676795_n-256.png",
43+
"scale" : "1x"
44+
},
45+
{
46+
"size" : "256x256",
47+
"idiom" : "mac",
48+
"filename" : "21100949_475187179526802_1743676795_n-512.png",
49+
"scale" : "2x"
50+
},
51+
{
52+
"size" : "512x512",
53+
"idiom" : "mac",
54+
"filename" : "21100949_475187179526802_1743676795_n-512.png",
55+
"scale" : "1x"
56+
},
57+
{
58+
"size" : "512x512",
59+
"idiom" : "mac",
60+
"filename" : "21100949_475187179526802_1743676795_n-1024.png",
61+
"scale" : "2x"
62+
}
63+
],
64+
"info" : {
65+
"version" : 1,
66+
"author" : "xcode"
67+
}
68+
}

TINU/Assets.xcassets/Contents.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "check.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
6.21 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "check.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
6.21 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "logo.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
937 KB
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "uncheck.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
Loading
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"filename" : "warning-2.png",
6+
"scale" : "1x"
7+
},
8+
{
9+
"idiom" : "universal",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
Loading

0 commit comments

Comments
 (0)