diff --git a/AppBox.xcodeproj/project.pbxproj b/AppBox.xcodeproj/project.pbxproj index 126f1d7f..9963608d 100644 --- a/AppBox.xcodeproj/project.pbxproj +++ b/AppBox.xcodeproj/project.pbxproj @@ -50,6 +50,7 @@ E13161F21E9777DF00586052 /* RepoBuilder.m in Sources */ = {isa = PBXBuildFile; fileRef = E13161F11E9777DF00586052 /* RepoBuilder.m */; }; E13946121DF2AFCF00B3FAD0 /* XCProject.m in Sources */ = {isa = PBXBuildFile; fileRef = E13946111DF2AFCF00B3FAD0 /* XCProject.m */; }; E13946161DF2FBAD00B3FAD0 /* ProjectBuildScript.sh in Resources */ = {isa = PBXBuildFile; fileRef = E13946141DF2FBAD00B3FAD0 /* ProjectBuildScript.sh */; }; + E14237C22010A6F600F83501 /* CreateIPAScript.sh in Resources */ = {isa = PBXBuildFile; fileRef = E14237C12010A16300F83501 /* CreateIPAScript.sh */; }; E143637B1DF59AFD00FB10CA /* LogViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E143637A1DF59AFD00FB10CA /* LogViewController.m */; }; E14A441F1F277590006A9102 /* XCArchiveResult.m in Sources */ = {isa = PBXBuildFile; fileRef = E14A441E1F277590006A9102 /* XCArchiveResult.m */; }; E14A44221F2775A2006A9102 /* XCArchiveParser.m in Sources */ = {isa = PBXBuildFile; fileRef = E14A44211F2775A2006A9102 /* XCArchiveParser.m */; }; @@ -281,6 +282,7 @@ E13946111DF2AFCF00B3FAD0 /* XCProject.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XCProject.m; sourceTree = ""; }; E13946131DF2AFFF00B3FAD0 /* AppBoxPrefixHeader.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AppBoxPrefixHeader.pch; sourceTree = ""; }; E13946141DF2FBAD00B3FAD0 /* ProjectBuildScript.sh */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.sh; path = ProjectBuildScript.sh; sourceTree = ""; }; + E14237C12010A16300F83501 /* CreateIPAScript.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = CreateIPAScript.sh; sourceTree = ""; }; E14363791DF59AFD00FB10CA /* LogViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LogViewController.h; sourceTree = ""; }; E143637A1DF59AFD00FB10CA /* LogViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LogViewController.m; sourceTree = ""; }; E14A441D1F277590006A9102 /* XCArchiveResult.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XCArchiveResult.h; sourceTree = ""; }; @@ -906,6 +908,7 @@ E172E13B1DEEB3B900405EF2 /* GetSchemeScript.sh */, E10B82211DF0498600BBE0CD /* TeamIDScript.sh */, E13946141DF2FBAD00B3FAD0 /* ProjectBuildScript.sh */, + E14237C12010A16300F83501 /* CreateIPAScript.sh */, E191F7C21E1E7B2A00D2A590 /* ALAppStore.sh */, E119EF5F1E3735EA00A7798E /* XCodePath.sh */, E1C024721E9B9DC700C87CC9 /* InstallPrivateKey.sh */, @@ -1236,6 +1239,7 @@ E119EF601E373C9B00A7798E /* ALAppStore.sh in Resources */, E1C024731E9B9DD500C87CC9 /* InstallPrivateKey.sh in Resources */, E1D12EEA1EC2F5230065E59A /* EmailPreferencesViewController.xib in Resources */, + E14237C22010A6F600F83501 /* CreateIPAScript.sh in Resources */, DBCD1563200BCD1C00C003E6 /* PreferencesViewController.xib in Resources */, E10B82221DF0498800BBE0CD /* TeamIDScript.sh in Resources */, E16D72E51E8912790031FB7C /* XCodePath.sh in Resources */, diff --git a/AppBox/AppDelegate.m b/AppBox/AppDelegate.m index 7f18e029..54a6f848 100644 --- a/AppBox/AppDelegate.m +++ b/AppBox/AppDelegate.m @@ -36,7 +36,9 @@ - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { //Check for update [UpdateHandler isNewVersionAvailableCompletion:^(bool available, NSURL *url) { if (available){ - [UpdateHandler showUpdateAlertWithUpdateURL:url]; + if (![UserData updateAlertEnable]){ + [UpdateHandler showUpdateAlertWithUpdateURL:url]; + } } }]; @@ -81,7 +83,7 @@ +(AppDelegate *)appDelegate{ -(void)addSessionLog:(NSString *)sessionLog{ NSLog(@"%@",sessionLog); - [_sessionLog appendFormat: @"%@",sessionLog]; + [_sessionLog appendFormat: @"%@\n",sessionLog]; [[NSNotificationCenter defaultCenter] postNotificationName:abSessionLogUpdated object:nil]; } diff --git a/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@2x.png b/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@2x.png index db174aa8..f49b0318 100644 Binary files a/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@2x.png and b/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@2x.png differ diff --git a/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@3x.png b/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@3x.png index 4bef2175..f42dc307 100644 Binary files a/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@3x.png and b/AppBox/Assets/AppBoxIcons.xcassets/CI.imageset/CI@3x.png differ diff --git a/AppBox/Commands/CreateIPAScript.sh b/AppBox/Commands/CreateIPAScript.sh new file mode 100755 index 00000000..22b280c5 --- /dev/null +++ b/AppBox/Commands/CreateIPAScript.sh @@ -0,0 +1,45 @@ +#!/bin/sh + +# CreateIPAScript.sh +# AppBox +# +# Created by Vineet Choudhary on 18/01/18. +# Copyright © 2018 Developer Insider. All rights reserved. + +#{1} - Project Directory + +#Make Archove +#{2} - Project Workspace or XcodeProject -workspace VisualStudioMobileCenterDemo.xcworkspace or -project -vsmcd.xcodeproj +#{3} - Project Scheme - VisualStudioMobileCenterDemo +#{4} - Project Archive Path - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive + + +#Make IPA +#{4} - Project Archive Path - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/VSMCD.xcarchive +#{5} - IPA Export Path - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/build/ +#{6} - IPA Export options plist - /Users/emp195/Desktop/VisualStudioMobileCenterDemoGitHub/VisualStudioMobileCenterDemo/exportoption.plist + + +#Others +#{7} - Xcode Version +#{8} - xcpretty path + + +#change directory to project +cd "${1}" + +#################################### +# Make IPA # +#################################### +echo "Creating IPA..." + +#check either selected xcode is 9 or higher +if [[ "${7}" > "9" || "${7}" == "9" ]] +then +echo "Creating IPA with Xcode 9" +xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration +else +echo "Creating IPA with Xcode 8" +xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" +fi +echo "End of build script." diff --git a/AppBox/Commands/ProjectBuildScript.sh b/AppBox/Commands/ProjectBuildScript.sh index 7c3bd165..22760897 100755 --- a/AppBox/Commands/ProjectBuildScript.sh +++ b/AppBox/Commands/ProjectBuildScript.sh @@ -41,10 +41,10 @@ then if [[ "${7}" > "9" || "${7}" == "9" ]] then echo "Building Project with Xcode 9" - xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | ${8} && exit ${PIPESTATUS[0]} + xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | "${8}" && exit ${PIPESTATUS[0]} else echo "Building Project with Xcode 8" - xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" | ${8} && exit ${PIPESTATUS[0]} + xcodebuild clean -project "${2}" -scheme "${3}" archive -archivePath "${4}" | "${8}" && exit ${PIPESTATUS[0]} fi else @@ -54,24 +54,10 @@ else if [[ "${7}" > "9" || "${7}" == "9" ]] then echo "Building Project with Xcode 9" - xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | ${8} && exit ${PIPESTATUS[0]} + xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration | "${8}" && exit ${PIPESTATUS[0]} else echo "Building Project with Xcode 8" - xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" | ${8} && exit ${PIPESTATUS[0]} + xcodebuild clean -workspace "${2}" -scheme "${3}" archive -archivePath "${4}" | "${8}" && exit ${PIPESTATUS[0]} fi fi - -#################################### -# Make IPA # -#################################### -echo "Creating IPA..." -#check either selected xcode is 9 or higher -if [[ "${7}" > "9" || "${7}" == "9" ]] -then - echo "Creating IPA with Xcode 9" - xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -allowProvisioningUpdates -allowProvisioningDeviceRegistration -else - echo "Creating IPA with Xcode 8" - xcodebuild -exportArchive -archivePath "${4}" -exportPath "${5}" -exportOptionsPlist "${6}" -fi diff --git a/AppBox/Common/Constants.h b/AppBox/Common/Constants.h index d53c877f..9c3afa4b 100644 --- a/AppBox/Common/Constants.h +++ b/AppBox/Common/Constants.h @@ -100,6 +100,7 @@ typedef enum : NSUInteger { ScriptTypeGetScheme, ScriptTypeTeamId, ScriptTypeBuild, + ScriptTypeCreateIPA, ScriptTypeXcodePath, ScriptTypeAppStoreValidation, ScriptTypeAppStoreUpload, diff --git a/AppBox/Common/LogManager/ABLog.m b/AppBox/Common/LogManager/ABLog.m index cdddcea8..d5e55168 100644 --- a/AppBox/Common/LogManager/ABLog.m +++ b/AppBox/Common/LogManager/ABLog.m @@ -11,7 +11,7 @@ @implementation ABLog +(void)log:(NSString *)format, ...{ - if ([UserData debugLog]) { + if (![UserData debugLog]) { va_list args; va_start(args, format); NSLogv(format, args); diff --git a/AppBox/Common/UpdateHandler/UpdateHandler.m b/AppBox/Common/UpdateHandler/UpdateHandler.m index 3028b40f..0b51459b 100644 --- a/AppBox/Common/UpdateHandler/UpdateHandler.m +++ b/AppBox/Common/UpdateHandler/UpdateHandler.m @@ -48,7 +48,7 @@ + (void)isNewVersionAvailableCompletion:(void (^)(bool available, NSURL *url))co NSString *currentVersion = [[versionString componentsSeparatedByCharactersInSet:[[NSCharacterSet decimalDigitCharacterSet] invertedSet]] componentsJoinedByString:abEmptyString]; //log current and latest version - [ABLog log:@"Current Version - %@ <=> Latest Version - %@", versionString, tag]; + [ABLog log:@"\n\nCurrent Version - %@ <=> Latest Version - %@\n\n", versionString, tag]; //return result based on version strings completion(([newVesion compare:currentVersion] == NSOrderedDescending),[NSURL URLWithString:[responseObj valueForKey:@"html_url"]]); diff --git a/AppBox/Common/UploadManager/UploadManager.m b/AppBox/Common/UploadManager/UploadManager.m index a6f1e5c2..8b3ed14a 100644 --- a/AppBox/Common/UploadManager/UploadManager.m +++ b/AppBox/Common/UploadManager/UploadManager.m @@ -108,9 +108,7 @@ -(void)uploadIPAFile:(NSURL *)ipaFileURL{ } - if ([AppDelegate appDelegate].isInternetConnected){ - [self showStatus:@"Ready to upload..." andShowProgressBar:NO withProgress:-1]; - }else{ + if (![AppDelegate appDelegate].isInternetConnected){ [self showStatus:abNotConnectedToInternet andShowProgressBar:YES withProgress:-1]; } @@ -403,6 +401,8 @@ -(void)updateProgressBytesWritten:(int64_t)bytesWritten totalBytesWritten:(int64 -(void)dbUploadFile:(NSString *)file to:(NSString *)path mode:(DBFILESWriteMode *)mode{ + [[AppDelegate appDelegate] addSessionLog:@"Uploading IPA File..."]; + //Upload large ipa file with dropbox session api if (_project.ipaFileSize.integerValue > 150 && self.dbFileType == DBFileTypeIPA) { [self dbUploadLargeFile:file to:path mode:mode]; diff --git a/AppBox/Common/UserData/UserData.h b/AppBox/Common/UserData/UserData.h index c0efcd20..92e6bed5 100644 --- a/AppBox/Common/UserData/UserData.h +++ b/AppBox/Common/UserData/UserData.h @@ -49,5 +49,7 @@ +(BOOL)debugLog; +(void)setEnableDebugLog:(BOOL)debugLog; ++(BOOL)updateAlertEnable; ++(void)setUpdateAlertEnable:(BOOL)updateAlert; @end diff --git a/AppBox/Common/UserData/UserData.m b/AppBox/Common/UserData/UserData.m index 85711ade..dadad5f6 100644 --- a/AppBox/Common/UserData/UserData.m +++ b/AppBox/Common/UserData/UserData.m @@ -188,13 +188,24 @@ +(void)setUploadChunkSize:(NSInteger)chunkSize{ [[NSUserDefaults standardUserDefaults] synchronize]; } +#pragma mark - CI Settings - #define DebugLogEnable @"DebugLogEnable" +(BOOL)debugLog{ return [[NSUserDefaults standardUserDefaults] boolForKey:DebugLogEnable]; } +(void)setEnableDebugLog:(BOOL)debugLog{ - [[NSUserDefaults standardUserDefaults] boolForKey:DebugLogEnable]; + [[NSUserDefaults standardUserDefaults] setBool:debugLog forKey:DebugLogEnable]; + [[NSUserDefaults standardUserDefaults] synchronize]; +} + +#define UpdateAlertEnable @"UpdateAlertEnable" ++(BOOL)updateAlertEnable{ + return [[NSUserDefaults standardUserDefaults] boolForKey:UpdateAlertEnable]; +} + ++(void)setUpdateAlertEnable:(BOOL)updateAlert{ + [[NSUserDefaults standardUserDefaults] setBool:updateAlert forKey:UpdateAlertEnable]; [[NSUserDefaults standardUserDefaults] synchronize]; } diff --git a/AppBox/Info.plist b/AppBox/Info.plist index 963c1378..f451738b 100644 --- a/AppBox/Info.plist +++ b/AppBox/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType APPL CFBundleShortVersionString - 2.2.0 + 2.3.0 CFBundleSignature ???? CFBundleURLTypes diff --git a/AppBox/ViewController/HomeViewController/HomeViewController.m b/AppBox/ViewController/HomeViewController/HomeViewController.m index a6c6c8c7..e5fcf6a5 100644 --- a/AppBox/ViewController/HomeViewController/HomeViewController.m +++ b/AppBox/ViewController/HomeViewController/HomeViewController.m @@ -44,7 +44,7 @@ - (void)viewDidLoad { if (status == AFNetworkReachabilityStatusNotReachable){ [self showStatus:abNotConnectedToInternet andShowProgressBar:YES withProgress:-1]; }else{ - [self showStatus:abConnectedToInternet andShowProgressBar:NO withProgress:-1]; + //[self showStatus:abConnectedToInternet andShowProgressBar:NO withProgress:-1]; //restart last failed operation if (uploadManager.lastfailedOperation){ [uploadManager.lastfailedOperation start]; @@ -280,18 +280,7 @@ - (void)runTeamIDScript{ [self runTaskWithLaunchPath:teamIdScriptPath andArgument:@[project.rootDirectory]]; } -- (void)runBuildScript{ - [self showStatus:@"Cleaning..." andShowProgressBar:YES withProgress:-1]; - scriptType = ScriptTypeBuild; - - //Create Export Option Plist - if (![project createExportOptionPlist]){ - [Common showAlertWithTitle:@"Error" andMessage:@"Unable to create file in this directory."]; - return; - } - - //Build Script - NSString *buildScriptPath = [[NSBundle mainBundle] pathForResource:@"ProjectBuildScript" ofType:@"sh"]; +-(void)buildAndIPAArguments:(void (^) (NSArray *arguments))completion{ NSMutableArray *buildArgument = [[NSMutableArray alloc] init]; //${1} Project Location @@ -312,10 +301,8 @@ - (void)runBuildScript{ //${6} export options plist Location [buildArgument addObject:[project.exportOptionsPlistPath.resourceSpecifier stringByRemovingPercentEncoding]]; - //Get Xcode Version [XCHandler getXcodeVersionWithCompletion:^(BOOL success, XcodeVersion version, NSString *versionString) { - //${7} xcode version dispatch_async(dispatch_get_main_queue(), ^{ NSString *version; if (success) { @@ -323,17 +310,59 @@ - (void)runBuildScript{ } else { version = @"8"; } + //${7} xcode version [buildArgument addObject:version]; + //${8} xcpretty NSString *xcPrettyPath = [[NSBundle mainBundle] pathForResource:@"xcpretty/bin/xcpretty" ofType:nil]; [buildArgument addObject:xcPrettyPath]; - - //Run Task - [self runTaskWithLaunchPath:buildScriptPath andArgument:buildArgument]; + if (buildArgument.count == 8) { + completion(buildArgument); + } else { + NSString *errorLog = [NSString stringWithFormat:@"Failed to create build command.\n Build Arguments %@", buildArgument]; + if (ciRepoProject) { + [[AppDelegate appDelegate] addSessionLog:errorLog]; + exit(1); + } else { + [ABLog log:errorLog]; + [Common showAlertWithTitle:@"Error" andMessage:@"Failed to create build command."]; + [self viewStateForProgressFinish:YES]; + completion(nil); + } + } }); }]; +} + +- (void)runBuildScript{ + [self showStatus:@"Cleaning..." andShowProgressBar:YES withProgress:-1]; + scriptType = ScriptTypeBuild; + + //Create Export Option Plist + if (![project createExportOptionPlist]){ + [Common showAlertWithTitle:@"Error" andMessage:@"Unable to create file in this directory."]; + return; + } + //Run Task + NSString *buildScriptPath = [[NSBundle mainBundle] pathForResource:@"ProjectBuildScript" ofType:@"sh"]; + [self buildAndIPAArguments:^(NSArray *arguments) { + if (arguments){ + [self runTaskWithLaunchPath:buildScriptPath andArgument:arguments]; + } + }]; +} + +- (void)runCreateIPAScript{ + scriptType = ScriptTypeCreateIPA; + [self showStatus:@"Creating IPA..." andShowProgressBar:YES withProgress:-1]; + NSString *createIPASriptPath = [[NSBundle mainBundle] pathForResource:@"CreateIPAScript" ofType:@"sh"]; + [self buildAndIPAArguments:^(NSArray *arguments) { + if (arguments){ + [self runTaskWithLaunchPath:createIPASriptPath andArgument:arguments]; + } + }]; } - (void)runXcodePathScript{ @@ -479,27 +508,10 @@ - (void)captureStandardOutputWithTask:(NSTask *)task{ //Handle Build Response else if (scriptType == ScriptTypeBuild){ if ([outputString.lowercaseString containsString:@"archive succeeded"]){ - [self showStatus:@"Creating IPA..." andShowProgressBar:YES withProgress:-1]; - [outputPipe.fileHandleForReading waitForDataInBackgroundAndNotify]; + [self runCreateIPAScript]; } else if ([outputString.lowercaseString containsString:@"clean succeeded"]){ [self showStatus:@"Archiving..." andShowProgressBar:YES withProgress:-1]; [outputPipe.fileHandleForReading waitForDataInBackgroundAndNotify]; - } else if ([outputString.lowercaseString containsString:@"export succeeded"]){ - //Check and Upload IPA File - if (project.isBuildOnly){ - [self showStatus:[NSString stringWithFormat:@"Export Succeeded - %@",project.buildUUIDDirectory] andShowProgressBar:NO withProgress:-1]; - }else{ - [self showStatus:@"Export Succeeded" andShowProgressBar:YES withProgress:-1]; - [self checkIPACreated]; - } - } else if ([outputString.lowercaseString containsString:@"export failed"]){ - [self showStatus:@"Export Failed" andShowProgressBar:NO withProgress:-1]; - [Common showAlertWithTitle:@"Export Failed" andMessage:outputString]; - [self viewStateForProgressFinish:YES]; - //exit if appbox failed to export IPA file - if (ciRepoProject) { - exit(1); - } } else if ([outputString.lowercaseString containsString:@"archive failed"]){ if ([AppDelegate appDelegate].isInternetConnected || [outputString containsString:@"^"]){ [self showStatus:@"Archive Failed" andShowProgressBar:NO withProgress:-1]; @@ -520,8 +532,38 @@ - (void)captureStandardOutputWithTask:(NSTask *)task{ } } + //Handle Create IPA Script Response + else if (scriptType == ScriptTypeCreateIPA) { + if ([outputString.lowercaseString containsString:@"export succeeded"]){ + //Check and Upload IPA File + if (project.isBuildOnly){ + [self showStatus:[NSString stringWithFormat:@"Export Succeeded - %@",project.buildUUIDDirectory] andShowProgressBar:NO withProgress:-1]; + }else{ + [self showStatus:@"Export Succeeded" andShowProgressBar:YES withProgress:-1]; + [self checkIPACreated]; + } + } else if ([outputString.lowercaseString containsString:@"export failed"]){ + if ([AppDelegate appDelegate].isInternetConnected){ + [self showStatus:@"Export Failed" andShowProgressBar:NO withProgress:-1]; + [Common showAlertWithTitle:@"Export Failed" andMessage:outputString]; + [self viewStateForProgressFinish:YES]; + } else { + [self showStatus:abNotConnectedToInternet andShowProgressBar:YES withProgress:-1]; + uploadManager.lastfailedOperation = [NSBlockOperation blockOperationWithBlock:^{ + [self runCreateIPAScript]; + }]; + } + //exit if appbox failed to export IPA file + if (ciRepoProject) { + exit(1); + } + } else { + [outputPipe.fileHandleForReading waitForDataInBackgroundAndNotify]; + } + } + //Handle Xcode Path Response - else if (scriptType == ScriptTypeXcodePath){ + else if (scriptType == ScriptTypeXcodePath) { } @@ -624,7 +666,7 @@ -(void)viewStateForProgressFinish:(BOOL)finish{ project = [[XCProject alloc] init]; [project setBuildDirectory:[UserData buildLocation]]; [uploadManager setProject:project]; - [ABHudViewController hideAllHudFromView:self.view after:0]; + [ABHudViewController hudForView:self.view hide:YES]; } //unique link diff --git a/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.h b/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.h index c11e6621..9dca6391 100644 --- a/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.h +++ b/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.h @@ -8,6 +8,11 @@ #import -@interface CISettingViewController : NSViewController +@interface CISettingViewController : NSViewController{ + __weak IBOutlet NSButton *updateAlertCheckBox; + __weak IBOutlet NSButton *limitedLogCheckBox; +} +- (IBAction)updateAlertCheckBoxChanged:(NSButton *)sender; +- (IBAction)limitedLogCheckBoxChanged:(NSButton *)sender; @end diff --git a/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.m b/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.m index c43156c5..6728663c 100644 --- a/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.m +++ b/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.m @@ -16,7 +16,15 @@ @implementation CISettingViewController - (void)viewDidLoad { [super viewDidLoad]; - // Do view setup here. + [limitedLogCheckBox setState: [UserData debugLog] ? NSOnState : NSOffState]; + [updateAlertCheckBox setState: [UserData updateAlertEnable] ? NSOnState : NSOffState]; } +- (IBAction)updateAlertCheckBoxChanged:(NSButton *)sender { + [UserData setUpdateAlertEnable:(sender.state == NSOnState)]; +} + +- (IBAction)limitedLogCheckBoxChanged:(NSButton *)sender { + [UserData setEnableDebugLog:(sender.state == NSOnState)]; +} @end diff --git a/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.xib b/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.xib index f2d340db..3530ff65 100644 --- a/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.xib +++ b/AppBox/ViewController/PreferencesViewController/CISettingViewController/CISettingViewController.xib @@ -9,17 +9,19 @@ + + - + - + @@ -31,14 +33,17 @@ - + @@ -50,15 +55,19 @@ +