From 42bc251199d5a9124553a7f0d181844037bb36b9 Mon Sep 17 00:00:00 2001 From: Vineet Choudhary Date: Wed, 4 Dec 2024 22:32:48 +0530 Subject: [PATCH] Update deprecated types --- AppBox/Common/Common.m | 2 +- AppBox/Common/UpdateHandler/UpdateHandler.m | 2 +- .../DashboardViewController.m | 2 +- .../ProvisioningDetailsViewController.m | 2 +- .../HomeViewController/DragDropView/DragDropView.m | 2 +- .../HomeViewController/HomeViewController.m | 6 +++--- .../HomeWindowController/HomeWindowController.m | 2 +- .../MenuHandler/NSApplication+MenuHandler.m | 2 +- .../PreferencesViewController.m | 14 +++++++------- .../ShowLinkViewController.m | 2 +- 10 files changed, 18 insertions(+), 18 deletions(-) diff --git a/AppBox/Common/Common.m b/AppBox/Common/Common.m index eb6732a2..cd41545d 100644 --- a/AppBox/Common/Common.m +++ b/AppBox/Common/Common.m @@ -38,7 +38,7 @@ + (NSModalResponse)showAlertWithTitle:(NSString *)title andMessage:(NSString *)m NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText: title == nil ? @"Error" : title]; [alert setInformativeText:message == nil ? @"" : message]; - [alert setAlertStyle:NSWarningAlertStyle]; + [alert setAlertStyle:NSAlertStyleWarning]; return [alert runModal]; } diff --git a/AppBox/Common/UpdateHandler/UpdateHandler.m b/AppBox/Common/UpdateHandler/UpdateHandler.m index 7afc7494..97bf03a9 100644 --- a/AppBox/Common/UpdateHandler/UpdateHandler.m +++ b/AppBox/Common/UpdateHandler/UpdateHandler.m @@ -16,7 +16,7 @@ + (void)showUpdateAlertWithUpdateURL:(NSURL *)url{ NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText: @"New Version Available"]; [alert setInformativeText:@"A newer version of the \"AppBox\" is available. Do you want to update it? \n\n\n"]; - [alert setAlertStyle:NSInformationalAlertStyle]; + [alert setAlertStyle:NSAlertStyleInformational]; [alert addButtonWithTitle:@"YES"]; [alert addButtonWithTitle:@"NO"]; if ([alert runModal] == NSAlertFirstButtonReturn){ diff --git a/AppBox/ViewController/DashboardViewController/DashboardViewController.m b/AppBox/ViewController/DashboardViewController/DashboardViewController.m index e9802517..80c88588 100644 --- a/AppBox/ViewController/DashboardViewController/DashboardViewController.m +++ b/AppBox/ViewController/DashboardViewController/DashboardViewController.m @@ -177,7 +177,7 @@ - (IBAction)copyURLButtonTapped:(NSButton *)sender { ABUploadRecord *uploadRecord = [self selectedUploadRecord]; if (uploadRecord){ [[NSPasteboard generalPasteboard] clearContents]; - [[NSPasteboard generalPasteboard] setString:uploadRecord.shortURL forType:NSStringPboardType]; + [[NSPasteboard generalPasteboard] setString:uploadRecord.shortURL forType:NSPasteboardTypeString]; [ABHudViewController showOnlyStatus:@"Copied!!" onView:self.view]; [EventTracker logEventWithType:LogEventTypeCopyToClipboardFromDashboard]; } diff --git a/AppBox/ViewController/DashboardViewController/ProvisioningDetailsViewController/ProvisioningDetailsViewController.m b/AppBox/ViewController/DashboardViewController/ProvisioningDetailsViewController/ProvisioningDetailsViewController.m index ae0db883..a889b5ea 100644 --- a/AppBox/ViewController/DashboardViewController/ProvisioningDetailsViewController/ProvisioningDetailsViewController.m +++ b/AppBox/ViewController/DashboardViewController/ProvisioningDetailsViewController/ProvisioningDetailsViewController.m @@ -46,7 +46,7 @@ - (IBAction)copyAllDeviceUUIDTapped:(NSButton *)sender { [devices appendFormat:@"%@,\n",obj.deviceId]; }]; [[NSPasteboard generalPasteboard] clearContents]; - [[NSPasteboard generalPasteboard] setString:devices forType:NSStringPboardType]; + [[NSPasteboard generalPasteboard] setString:devices forType:NSPasteboardTypeString]; } - (IBAction)showInFinderButtonTapped:(NSButton *)sender { diff --git a/AppBox/ViewController/HomeViewController/DragDropView/DragDropView.m b/AppBox/ViewController/HomeViewController/DragDropView/DragDropView.m index 1e4cef18..d17c2a26 100644 --- a/AppBox/ViewController/HomeViewController/DragDropView/DragDropView.m +++ b/AppBox/ViewController/HomeViewController/DragDropView/DragDropView.m @@ -15,7 +15,7 @@ @implementation DragDropView{ - (void)drawRect:(NSRect)dirtyRect { [super drawRect:dirtyRect]; - acceptedType = [NSSet setWithObjects:@"com.apple.iTunes.ipa", @"com.apple.dt.document.workspace", @"com.apple.xcode.project", NSURLPboardType, nil]; + acceptedType = [NSSet setWithObjects:@"com.apple.iTunes.ipa", @"com.apple.dt.document.workspace", @"com.apple.xcode.project", NSPasteboardTypeURL, nil]; readOptions = @{NSPasteboardURLReadingContentsConformToTypesKey: acceptedType.allObjects}; [self registerForDraggedTypes:acceptedType.allObjects]; } diff --git a/AppBox/ViewController/HomeViewController/HomeViewController.m b/AppBox/ViewController/HomeViewController/HomeViewController.m index ac484962..338d27d3 100644 --- a/AppBox/ViewController/HomeViewController/HomeViewController.m +++ b/AppBox/ViewController/HomeViewController/HomeViewController.m @@ -178,7 +178,7 @@ - (void)initIPAUploadProcessForCIProject:(XCProject *)ciProject { if (ciProject.personalMessage.length != 0) { [textFieldMessage setStringValue:ciProject.personalMessage]; } - [buttonUniqueLink setState:ciProject.keepSameLink.boolValue ? NSOnState : NSOffState]; + [buttonUniqueLink setState:ciProject.keepSameLink.boolValue ? NSControlStateValueOn : NSControlStateValueOff]; [self actionButtonTapped:buttonAction]; } @@ -186,7 +186,7 @@ - (void)initIPAUploadProcessForCIProject:(XCProject *)ciProject { //IPA File Path Handler - (IBAction)buttonUniqueLinkTapped:(NSButton *)sender{ - self.project.isKeepSameLinkEnabled = (sender.state == NSOnState); + self.project.isKeepSameLinkEnabled = (sender.state == NSControlStateValueOn); } - (IBAction)buttonSameLinkHelpTapped:(NSButton *)sender { @@ -293,7 +293,7 @@ -(void)viewStateForProgressFinish:(BOOL)finish{ //unique link [buttonUniqueLink setEnabled:finish]; - [buttonUniqueLink setState: finish ? NSOffState : buttonUniqueLink.state]; + [buttonUniqueLink setState: finish ? NSControlStateValueOff : buttonUniqueLink.state]; //ipa or project path [selectedFilePath setEnabled:finish]; diff --git a/AppBox/ViewController/HomeViewController/HomeWindowController/HomeWindowController.m b/AppBox/ViewController/HomeViewController/HomeWindowController/HomeWindowController.m index 25c11bfc..00dbf859 100644 --- a/AppBox/ViewController/HomeViewController/HomeWindowController/HomeWindowController.m +++ b/AppBox/ViewController/HomeViewController/HomeWindowController/HomeWindowController.m @@ -26,7 +26,7 @@ -(BOOL)windowShouldClose:(id)sender{ NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText: @"Are you sure you want to close the \"AppBox\"?"]; [alert setInformativeText:@"Closing this will stop the current task."]; - [alert setAlertStyle:NSInformationalAlertStyle]; + [alert setAlertStyle:NSAlertStyleInformational]; [alert addButtonWithTitle:@"Stop Tasks"]; [alert addButtonWithTitle:@"NO"]; if ([alert runModal] == NSAlertFirstButtonReturn){ diff --git a/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m b/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m index 0978fdf6..8a8b39e8 100644 --- a/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m +++ b/AppBox/ViewController/MenuHandler/NSApplication+MenuHandler.m @@ -105,7 +105,7 @@ - (IBAction)logoutDropBoxTapped:(NSMenuItem *)sender { NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText: @"Are you sure?"]; [alert setInformativeText:@"Do you want to logout current dropbox account?"]; - [alert setAlertStyle:NSInformationalAlertStyle]; + [alert setAlertStyle:NSAlertStyleInformational]; [alert addButtonWithTitle:@"Yes"]; [alert addButtonWithTitle:@"No"]; if ([alert runModal] == NSAlertFirstButtonReturn){ diff --git a/AppBox/ViewController/PreferencesViewController/GeneralPreferencesViewController/PreferencesViewController.m b/AppBox/ViewController/PreferencesViewController/GeneralPreferencesViewController/PreferencesViewController.m index 8ef2bcd4..d586add4 100644 --- a/AppBox/ViewController/PreferencesViewController/GeneralPreferencesViewController/PreferencesViewController.m +++ b/AppBox/ViewController/PreferencesViewController/GeneralPreferencesViewController/PreferencesViewController.m @@ -30,8 +30,8 @@ - (void)viewDidLoad { [chunkSizeComboBox selectItemAtIndex:[chunkSizes indexOfObject:chunkSize]]; //set general settings - [limitedLogCheckBox setState: [UserData debugLog] ? NSOffState : NSOnState]; - [updateAlertCheckBox setState: [UserData updateAlertEnable] ? NSOnState : NSOffState]; + [limitedLogCheckBox setState: [UserData debugLog] ? NSControlStateValueOff : NSControlStateValueOn]; + [updateAlertCheckBox setState: [UserData updateAlertEnable] ? NSControlStateValueOn : NSControlStateValueOff]; } - (IBAction)chunckSizeComboBoxValueChanged:(NSComboBox *)sender { @@ -39,15 +39,15 @@ - (IBAction)chunckSizeComboBoxValueChanged:(NSComboBox *)sender { } - (IBAction)downloadIPACheckBoxValueChanged:(NSButton *)sender { - [UserData setDownloadIPAEnable:(sender.state == NSOnState)]; + [UserData setDownloadIPAEnable:(sender.state == NSControlStateValueOn)]; } - (IBAction)moreDetailsCheckBoxValueChanged:(NSButton *)sender { - [UserData setMoreDetailsEnable:(sender.state == NSOnState)]; + [UserData setMoreDetailsEnable:(sender.state == NSControlStateValueOn)]; } - (IBAction)showPreviousVersionCheckBoxValueChanged:(NSButton *)sender { - [UserData setShowPreviousVersions:(sender.state == NSOffState)]; + [UserData setShowPreviousVersions:(sender.state == NSControlStateValueOff)]; } - (IBAction)helpDownloadIPAButtonAction:(NSButton *)sender { @@ -67,11 +67,11 @@ - (IBAction)helpUploadChunkSizeAction:(NSButton *)sender { } - (IBAction)updateAlertCheckBoxChanged:(NSButton *)sender { - [UserData setUpdateAlertEnable:(sender.state == NSOnState)]; + [UserData setUpdateAlertEnable:(sender.state == NSControlStateValueOn)]; } - (IBAction)limitedLogCheckBoxChanged:(NSButton *)sender { - [UserData setEnableDebugLog:(sender.state != NSOnState)]; + [UserData setEnableDebugLog:(sender.state != NSControlStateValueOn)]; } @end diff --git a/AppBox/ViewController/ShowLinkViewController/ShowLinkViewController.m b/AppBox/ViewController/ShowLinkViewController/ShowLinkViewController.m index e1a76057..e4be8227 100644 --- a/AppBox/ViewController/ShowLinkViewController/ShowLinkViewController.m +++ b/AppBox/ViewController/ShowLinkViewController/ShowLinkViewController.m @@ -39,7 +39,7 @@ - (void)viewDidLoad { - (IBAction)buttonCopyToClipboardTapped:(NSButton *)sender { [EventTracker logEventWithType:LogEventTypeCopyToClipboard]; [[NSPasteboard generalPasteboard] clearContents]; - [[NSPasteboard generalPasteboard] setString:self.project.appShortShareableURL.stringValue forType:NSStringPboardType]; + [[NSPasteboard generalPasteboard] setString:self.project.appShortShareableURL.stringValue forType:NSPasteboardTypeString]; [sender setTitle:@"Copied!!"]; dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{ [sender setTitle:@"Copy to Clipboard"];