diff --git a/EstEIDTokenApp/AppDelegate.m b/EstEIDTokenApp/AppDelegate.m index 88a115e..a65cf8b 100644 --- a/EstEIDTokenApp/AppDelegate.m +++ b/EstEIDTokenApp/AppDelegate.m @@ -20,8 +20,30 @@ #import @interface AppDelegate : NSObject +@property (weak) IBOutlet NSTextField *version; +@property (unsafe_unretained) IBOutlet NSTextView *text; @property (weak) IBOutlet NSWindow *window; @end @implementation AppDelegate + +- (void)applicationDidFinishLaunching:(NSNotification *)notification +{ + self.version.stringValue = [NSString stringWithFormat:@"Version: %@.%@", NSBundle.mainBundle.infoDictionary[@"CFBundleShortVersionString"], NSBundle.mainBundle.infoDictionary[@"CFBundleVersion"]]; + + NSPipe *pipe = [NSPipe pipe]; + NSFileHandle *file = pipe.fileHandleForReading; + + NSTask *task = [[NSTask alloc] init]; + task.launchPath = @"/usr/sbin/system_profiler"; + task.arguments = @[@"SPSmartCardsDataType"]; + task.standardOutput = pipe; + [task launch]; + + NSData *data = [file readDataToEndOfFile]; + [file closeFile]; + + self.text.string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; +} + @end diff --git a/EstEIDTokenApp/Base.lproj/MainMenu.xib b/EstEIDTokenApp/Base.lproj/MainMenu.xib index 679c16e..dd81107 100644 --- a/EstEIDTokenApp/Base.lproj/MainMenu.xib +++ b/EstEIDTokenApp/Base.lproj/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -15,6 +15,8 @@ + + @@ -77,8 +79,42 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -86,8 +122,16 @@ - - + + + + + + + + + +