Skip to content

Commit

Permalink
Update deprecated types
Browse files Browse the repository at this point in the history
  • Loading branch information
vineetchoudhary committed Dec 4, 2024
1 parent 8d24a5b commit 42bc251
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion AppBox/Common/Common.m
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}

Expand Down
2 changes: 1 addition & 1 deletion AppBox/Common/UpdateHandler/UpdateHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down
6 changes: 3 additions & 3 deletions AppBox/ViewController/HomeViewController/HomeViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ - (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];
}

#pragma mark → IPA File Controlles Actions
//IPA File Path Handler

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

- (IBAction)buttonSameLinkHelpTapped:(NSButton *)sender {
Expand Down Expand Up @@ -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];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,24 +30,24 @@ - (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 {
[UserData setUploadChunkSize:[chunkSizes[[sender indexOfSelectedItem]] integerValue]];
}

- (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 {
Expand All @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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"];
Expand Down

0 comments on commit 42bc251

Please sign in to comment.