-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added return to cloud login and wait message
- Loading branch information
Showing
22 changed files
with
1,339 additions
and
99 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,101 @@ | ||
// | ||
// AppDelegate.swift | ||
// XCreds Login Overlay | ||
// | ||
// Created by Timothy Perfitt on 7/16/22. | ||
// | ||
|
||
import Cocoa | ||
import AppKit | ||
@main | ||
struct MyMain { | ||
static func main() -> Void { | ||
sleep(5) | ||
let _ = NSApplicationMain(CommandLine.argc, CommandLine.unsafeArgv) | ||
} | ||
} | ||
|
||
class AppDelegate: NSObject, NSApplicationDelegate { | ||
|
||
@IBOutlet var window: NSWindow! | ||
@IBOutlet var waitWindow: NSWindow! | ||
|
||
@IBAction func cloudLoginButtonPressed(_ sender: Any) { | ||
|
||
waitWindow.level = .modalPanel | ||
waitWindow.canBecomeVisibleWithoutLogin = true | ||
let screenRect = NSScreen.screens[0].visibleFrame | ||
|
||
let screenWidth = screenRect.width | ||
let screenHeight = screenRect.height | ||
let waitWindowWidth = waitWindow.frame.width | ||
|
||
let newPos = NSMakePoint(screenWidth/2-waitWindowWidth/2, screenHeight/2) | ||
waitWindow.setFrameOrigin(newPos) | ||
waitWindow.makeKeyAndOrderFront(self) | ||
DispatchQueue.main.asyncAfter(deadline: .now() + 0.5) { | ||
|
||
|
||
if AuthorizationDBManager.shared.rightExists(right: "loginwindow:login"){ | ||
TCSLogWithMark("setting standard login back to XCreds login") | ||
let _ = AuthorizationDBManager.shared.replace(right:"loginwindow:login", withNewRight: "XCredsLoginPlugin:LoginWindow") | ||
let _ = cliTask("/usr/bin/killall loginwindow") | ||
|
||
} | ||
} | ||
} | ||
|
||
/* | ||
(void)showStatusBar:(__unused id)sender{ | ||
[self updateStatus:self]; | ||
[self.returnToBootRunnerWindow setLevel:NSScreenSaverWindowLevel]; | ||
[self.returnToBootRunnerWindow setCanBecomeVisibleWithoutLogin:YES]; | ||
[self.returnToBootRunnerWindow setHidesOnDeactivate:NO]; | ||
[self.returnToBootRunnerWindow setOpaque:NO]; | ||
[self.returnToBootRunnerWindow orderFront:self]; | ||
NSRect statusWindowRect=self.returnToBootRunnerWindow.frame; | ||
NSRect screenRect=[[[NSScreen screens] objectAtIndex:0] visibleFrame]; | ||
statusWindowRect.size.width=screenRect.size.width; | ||
statusWindowRect.origin=screenRect.origin; | ||
[self.returnToBootRunnerWindow setFrame:statusWindowRect display:YES]; | ||
} | ||
*/ | ||
func applicationDidFinishLaunching(_ aNotification: Notification) { | ||
// Insert code here to initialize your application | ||
window.level = .modalPanel | ||
window.canBecomeVisibleWithoutLogin=true | ||
NSApp.activate(ignoringOtherApps: true) | ||
window.hidesOnDeactivate=false | ||
window.isOpaque=false | ||
window.orderFrontRegardless() | ||
|
||
|
||
var statusWindowRect=window.frame | ||
let screenRect = NSScreen.screens[0].visibleFrame | ||
|
||
|
||
statusWindowRect.size.width=screenRect.size.width | ||
statusWindowRect.origin=screenRect.origin; | ||
window.setFrame(statusWindowRect, display: true, animate: false) | ||
|
||
} | ||
|
||
func applicationWillTerminate(_ aNotification: Notification) { | ||
// Insert code here to tear down your application | ||
} | ||
|
||
func applicationSupportsSecureRestorableState(_ app: NSApplication) -> Bool { | ||
return true | ||
} | ||
|
||
|
||
} | ||
|
11 changes: 11 additions & 0 deletions
11
XCreds Login Overlay/Assets.xcassets/AccentColor.colorset/Contents.json
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,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
XCreds Login Overlay/Assets.xcassets/AppIcon.appiconset/Contents.json
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,58 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "16x16" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "16x16" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "32x32" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "32x32" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "128x128" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "128x128" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "256x256" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "256x256" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "1x", | ||
"size" : "512x512" | ||
}, | ||
{ | ||
"idiom" : "mac", | ||
"scale" : "2x", | ||
"size" : "512x512" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Oops, something went wrong.