mirror of
https://github.com/transmission/transmission
synced 2025-01-30 19:03:04 +00:00
Fix a few deprecation warnings
This commit is contained in:
parent
df04a59350
commit
1527698de4
5 changed files with 14 additions and 5 deletions
|
@ -73,7 +73,7 @@ AboutWindowController * fAboutBoxInstance = nil;
|
||||||
[fLicenseView setString: licenseText];
|
[fLicenseView setString: licenseText];
|
||||||
[fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")];
|
[fLicenseCloseButton setTitle: NSLocalizedString(@"OK", "About window -> license close button")];
|
||||||
|
|
||||||
[NSApp beginSheet: fLicenseSheet modalForWindow: [self window] modalDelegate: nil didEndSelector: nil contextInfo: nil];
|
[self.window beginSheet: fLicenseSheet completionHandler:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (IBAction) hideLicense: (id) sender
|
- (IBAction) hideLicense: (id) sender
|
||||||
|
|
|
@ -146,7 +146,7 @@ BlocklistDownloaderViewController * fBLViewController = nil;
|
||||||
BlocklistDownloader * downloader = [BlocklistDownloader downloader];
|
BlocklistDownloader * downloader = [BlocklistDownloader downloader];
|
||||||
[downloader setViewController: self]; //do before showing the sheet to ensure it doesn't slide out with placeholder text
|
[downloader setViewController: self]; //do before showing the sheet to ensure it doesn't slide out with placeholder text
|
||||||
|
|
||||||
[NSApp beginSheet: fStatusWindow modalForWindow: [fPrefsController window] modalDelegate: nil didEndSelector: nil contextInfo: nil];
|
[fPrefsController.window beginSheet: fStatusWindow completionHandler:nil];
|
||||||
}
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
|
@ -1319,7 +1319,16 @@ static void removeKeRangerRansomware()
|
||||||
{
|
{
|
||||||
fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self];
|
fUrlSheetController = [[URLSheetWindowController alloc] initWithController: self];
|
||||||
|
|
||||||
[NSApp beginSheet: [fUrlSheetController window] modalForWindow: fWindow modalDelegate: self didEndSelector: @selector(urlSheetDidEnd:returnCode:contextInfo:) contextInfo: nil];
|
[fWindow beginSheet: fUrlSheetController.window completionHandler:^(NSModalResponse returnCode) {
|
||||||
|
if (returnCode == 1)
|
||||||
|
{
|
||||||
|
NSString * urlString = [fUrlSheetController urlString];
|
||||||
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
|
[self openURL: urlString];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
fUrlSheetController = nil;
|
||||||
|
}];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -465,7 +465,7 @@ NSMutableSet *creatorWindowControllerSet = nil;
|
||||||
|
|
||||||
[panel setMessage: NSLocalizedString(@"Select a file or folder for the torrent file.", "Create torrent -> select file")];
|
[panel setMessage: NSLocalizedString(@"Select a file or folder for the torrent file.", "Create torrent -> select file")];
|
||||||
|
|
||||||
BOOL success = [panel runModal] == NSOKButton;
|
BOOL success = [panel runModal] == NSModalResponseOK;
|
||||||
return success ? [panel URLs][0] : nil;
|
return success ? [panel URLs][0] : nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -709,7 +709,7 @@
|
||||||
+ (NSInteger) dateToTimeSum: (NSDate *) date
|
+ (NSInteger) dateToTimeSum: (NSDate *) date
|
||||||
{
|
{
|
||||||
NSCalendar * calendar = [NSCalendar currentCalendar];
|
NSCalendar * calendar = [NSCalendar currentCalendar];
|
||||||
NSDateComponents * components = [calendar components: NSHourCalendarUnit | NSMinuteCalendarUnit fromDate: date];
|
NSDateComponents * components = [calendar components: NSCalendarUnitHour | NSCalendarUnitMinute fromDate: date];
|
||||||
return [components hour] * 60 + [components minute];
|
return [components hour] * 60 + [components minute];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue