Skip to content

Commit 42bc251

Browse files
Update deprecated types
1 parent 8d24a5b commit 42bc251

File tree

10 files changed

+18
-18
lines changed

10 files changed

+18
-18
lines changed

AppBox/Common/Common.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ + (NSModalResponse)showAlertWithTitle:(NSString *)title andMessage:(NSString *)m
3838
NSAlert *alert = [[NSAlert alloc] init];
3939
[alert setMessageText: title == nil ? @"Error" : title];
4040
[alert setInformativeText:message == nil ? @"" : message];
41-
[alert setAlertStyle:NSWarningAlertStyle];
41+
[alert setAlertStyle:NSAlertStyleWarning];
4242
return [alert runModal];
4343
}
4444

AppBox/Common/UpdateHandler/UpdateHandler.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ + (void)showUpdateAlertWithUpdateURL:(NSURL *)url{
1616
NSAlert *alert = [[NSAlert alloc] init];
1717
[alert setMessageText: @"New Version Available"];
1818
[alert setInformativeText:@"A newer version of the \"AppBox\" is available. Do you want to update it? \n\n\n"];
19-
[alert setAlertStyle:NSInformationalAlertStyle];
19+
[alert setAlertStyle:NSAlertStyleInformational];
2020
[alert addButtonWithTitle:@"YES"];
2121
[alert addButtonWithTitle:@"NO"];
2222
if ([alert runModal] == NSAlertFirstButtonReturn){

AppBox/ViewController/DashboardViewController/DashboardViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ - (IBAction)copyURLButtonTapped:(NSButton *)sender {
177177
ABUploadRecord *uploadRecord = [self selectedUploadRecord];
178178
if (uploadRecord){
179179
[[NSPasteboard generalPasteboard] clearContents];
180-
[[NSPasteboard generalPasteboard] setString:uploadRecord.shortURL forType:NSStringPboardType];
180+
[[NSPasteboard generalPasteboard] setString:uploadRecord.shortURL forType:NSPasteboardTypeString];
181181
[ABHudViewController showOnlyStatus:@"Copied!!" onView:self.view];
182182
[EventTracker logEventWithType:LogEventTypeCopyToClipboardFromDashboard];
183183
}

AppBox/ViewController/DashboardViewController/ProvisioningDetailsViewController/ProvisioningDetailsViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ - (IBAction)copyAllDeviceUUIDTapped:(NSButton *)sender {
4646
[devices appendFormat:@"%@,\n",obj.deviceId];
4747
}];
4848
[[NSPasteboard generalPasteboard] clearContents];
49-
[[NSPasteboard generalPasteboard] setString:devices forType:NSStringPboardType];
49+
[[NSPasteboard generalPasteboard] setString:devices forType:NSPasteboardTypeString];
5050
}
5151

5252
- (IBAction)showInFinderButtonTapped:(NSButton *)sender {

AppBox/ViewController/HomeViewController/DragDropView/DragDropView.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ @implementation DragDropView{
1515

1616
- (void)drawRect:(NSRect)dirtyRect {
1717
[super drawRect:dirtyRect];
18-
acceptedType = [NSSet setWithObjects:@"com.apple.iTunes.ipa", @"com.apple.dt.document.workspace", @"com.apple.xcode.project", NSURLPboardType, nil];
18+
acceptedType = [NSSet setWithObjects:@"com.apple.iTunes.ipa", @"com.apple.dt.document.workspace", @"com.apple.xcode.project", NSPasteboardTypeURL, nil];
1919
readOptions = @{NSPasteboardURLReadingContentsConformToTypesKey: acceptedType.allObjects};
2020
[self registerForDraggedTypes:acceptedType.allObjects];
2121
}

AppBox/ViewController/HomeViewController/HomeViewController.m

+3-3
Original file line numberDiff line numberDiff line change
@@ -178,15 +178,15 @@ - (void)initIPAUploadProcessForCIProject:(XCProject *)ciProject {
178178
if (ciProject.personalMessage.length != 0) {
179179
[textFieldMessage setStringValue:ciProject.personalMessage];
180180
}
181-
[buttonUniqueLink setState:ciProject.keepSameLink.boolValue ? NSOnState : NSOffState];
181+
[buttonUniqueLink setState:ciProject.keepSameLink.boolValue ? NSControlStateValueOn : NSControlStateValueOff];
182182
[self actionButtonTapped:buttonAction];
183183
}
184184

185185
#pragma mark → IPA File Controlles Actions
186186
//IPA File Path Handler
187187

188188
- (IBAction)buttonUniqueLinkTapped:(NSButton *)sender{
189-
self.project.isKeepSameLinkEnabled = (sender.state == NSOnState);
189+
self.project.isKeepSameLinkEnabled = (sender.state == NSControlStateValueOn);
190190
}
191191

192192
- (IBAction)buttonSameLinkHelpTapped:(NSButton *)sender {
@@ -293,7 +293,7 @@ -(void)viewStateForProgressFinish:(BOOL)finish{
293293

294294
//unique link
295295
[buttonUniqueLink setEnabled:finish];
296-
[buttonUniqueLink setState: finish ? NSOffState : buttonUniqueLink.state];
296+
[buttonUniqueLink setState: finish ? NSControlStateValueOff : buttonUniqueLink.state];
297297

298298
//ipa or project path
299299
[selectedFilePath setEnabled:finish];

AppBox/ViewController/HomeViewController/HomeWindowController/HomeWindowController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ -(BOOL)windowShouldClose:(id)sender{
2626
NSAlert *alert = [[NSAlert alloc] init];
2727
[alert setMessageText: @"Are you sure you want to close the \"AppBox\"?"];
2828
[alert setInformativeText:@"Closing this will stop the current task."];
29-
[alert setAlertStyle:NSInformationalAlertStyle];
29+
[alert setAlertStyle:NSAlertStyleInformational];
3030
[alert addButtonWithTitle:@"Stop Tasks"];
3131
[alert addButtonWithTitle:@"NO"];
3232
if ([alert runModal] == NSAlertFirstButtonReturn){

AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ - (IBAction)logoutDropBoxTapped:(NSMenuItem *)sender {
105105
NSAlert *alert = [[NSAlert alloc] init];
106106
[alert setMessageText: @"Are you sure?"];
107107
[alert setInformativeText:@"Do you want to logout current dropbox account?"];
108-
[alert setAlertStyle:NSInformationalAlertStyle];
108+
[alert setAlertStyle:NSAlertStyleInformational];
109109
[alert addButtonWithTitle:@"Yes"];
110110
[alert addButtonWithTitle:@"No"];
111111
if ([alert runModal] == NSAlertFirstButtonReturn){

AppBox/ViewController/PreferencesViewController/GeneralPreferencesViewController/PreferencesViewController.m

+7-7
Original file line numberDiff line numberDiff line change
@@ -30,24 +30,24 @@ - (void)viewDidLoad {
3030
[chunkSizeComboBox selectItemAtIndex:[chunkSizes indexOfObject:chunkSize]];
3131

3232
//set general settings
33-
[limitedLogCheckBox setState: [UserData debugLog] ? NSOffState : NSOnState];
34-
[updateAlertCheckBox setState: [UserData updateAlertEnable] ? NSOnState : NSOffState];
33+
[limitedLogCheckBox setState: [UserData debugLog] ? NSControlStateValueOff : NSControlStateValueOn];
34+
[updateAlertCheckBox setState: [UserData updateAlertEnable] ? NSControlStateValueOn : NSControlStateValueOff];
3535
}
3636

3737
- (IBAction)chunckSizeComboBoxValueChanged:(NSComboBox *)sender {
3838
[UserData setUploadChunkSize:[chunkSizes[[sender indexOfSelectedItem]] integerValue]];
3939
}
4040

4141
- (IBAction)downloadIPACheckBoxValueChanged:(NSButton *)sender {
42-
[UserData setDownloadIPAEnable:(sender.state == NSOnState)];
42+
[UserData setDownloadIPAEnable:(sender.state == NSControlStateValueOn)];
4343
}
4444

4545
- (IBAction)moreDetailsCheckBoxValueChanged:(NSButton *)sender {
46-
[UserData setMoreDetailsEnable:(sender.state == NSOnState)];
46+
[UserData setMoreDetailsEnable:(sender.state == NSControlStateValueOn)];
4747
}
4848

4949
- (IBAction)showPreviousVersionCheckBoxValueChanged:(NSButton *)sender {
50-
[UserData setShowPreviousVersions:(sender.state == NSOffState)];
50+
[UserData setShowPreviousVersions:(sender.state == NSControlStateValueOff)];
5151
}
5252

5353
- (IBAction)helpDownloadIPAButtonAction:(NSButton *)sender {
@@ -67,11 +67,11 @@ - (IBAction)helpUploadChunkSizeAction:(NSButton *)sender {
6767
}
6868

6969
- (IBAction)updateAlertCheckBoxChanged:(NSButton *)sender {
70-
[UserData setUpdateAlertEnable:(sender.state == NSOnState)];
70+
[UserData setUpdateAlertEnable:(sender.state == NSControlStateValueOn)];
7171
}
7272

7373
- (IBAction)limitedLogCheckBoxChanged:(NSButton *)sender {
74-
[UserData setEnableDebugLog:(sender.state != NSOnState)];
74+
[UserData setEnableDebugLog:(sender.state != NSControlStateValueOn)];
7575
}
7676

7777
@end

AppBox/ViewController/ShowLinkViewController/ShowLinkViewController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ - (void)viewDidLoad {
3939
- (IBAction)buttonCopyToClipboardTapped:(NSButton *)sender {
4040
[EventTracker logEventWithType:LogEventTypeCopyToClipboard];
4141
[[NSPasteboard generalPasteboard] clearContents];
42-
[[NSPasteboard generalPasteboard] setString:self.project.appShortShareableURL.stringValue forType:NSStringPboardType];
42+
[[NSPasteboard generalPasteboard] setString:self.project.appShortShareableURL.stringValue forType:NSPasteboardTypeString];
4343
[sender setTitle:@"Copied!!"];
4444
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
4545
[sender setTitle:@"Copy to Clipboard"];

0 commit comments

Comments
 (0)