diff options
author | Damiano Galassi <[email protected]> | 2018-06-10 09:12:18 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2018-06-10 09:12:18 +0200 |
commit | 0e8eb04fd769fa471b71e5e5f81b55c47537d694 (patch) | |
tree | 5597113cd9a93a437af03859b38a22e2ea424f40 /macosx/HBController.m | |
parent | d3cd483eeddd8726bad862e811b31f75c1fad965 (diff) |
MacGui: fix another round of deprecation warnings. Remove drawer code.
Diffstat (limited to 'macosx/HBController.m')
-rw-r--r-- | macosx/HBController.m | 31 |
1 files changed, 6 insertions, 25 deletions
diff --git a/macosx/HBController.m b/macosx/HBController.m index 3c4d60c38..4e38c5852 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -34,7 +34,7 @@ @import HandBrakeKit; -@interface HBController () <HBPresetsViewControllerDelegate, HBTitleSelectionDelegate, NSDrawerDelegate, NSDraggingDestination, NSPopoverDelegate> +@interface HBController () <HBPresetsViewControllerDelegate, HBTitleSelectionDelegate, NSDraggingDestination, NSPopoverDelegate> { IBOutlet NSTabView *fMainTabView; @@ -93,7 +93,6 @@ @property (nonatomic, strong) HBPresetsMenuBuilder *presetsMenuBuilder; @property (nonatomic, strong) IBOutlet NSPopUpButton *presetsPopup; -@property (nonatomic, strong) IBOutlet NSDrawer *presetsDrawer; @property (nonatomic, strong) IBOutlet NSToolbarItem *presetsItem; @property (nonatomic, strong) NSPopover *presetsPopover; @@ -355,11 +354,6 @@ fPresetsView.enabled = enabled; } -- (NSSize)drawerWillResizeContents:(NSDrawer *) drawer toSize:(NSSize)contentSize { - [[NSUserDefaults standardUserDefaults] setObject:NSStringFromSize(contentSize) forKey:@"HBDrawerSize"]; - return contentSize; -} - - (void)setNilValueForKey:(NSString *)key { if ([key isEqualToString:@"scanSpecificTitleIdx"]) @@ -886,7 +880,7 @@ [panel beginSheetModalForWindow:self.window completionHandler: ^(NSInteger result) { - if (result == NSFileHandlingPanelOKButton) + if (result == NSModalResponseOK) { NSInteger titleIdx = self.scanSpecificTitle ? self.scanSpecificTitleIdx : 0; [self openURL:panel.URL titleIndex:titleIdx]; @@ -912,7 +906,7 @@ [panel beginSheetModalForWindow:self.window completionHandler:^(NSInteger result) { - if (result == NSFileHandlingPanelOKButton) + if (result == NSModalResponseOK) { self.job.outputURL = panel.URL; self.currentDestination = panel.URL; @@ -1096,7 +1090,7 @@ [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Do you want to overwrite %@?", @"File already exists alert -> informative text"), job.completeOutputURL.path]]; [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"File already exists alert -> first button")]; [alert addButtonWithTitle:NSLocalizedString(@"Overwrite", @"File already exists alert -> second button")]; - [alert setAlertStyle:NSCriticalAlertStyle]; + [alert setAlertStyle:NSAlertStyleCritical]; [alert beginSheetModalForWindow:self.window completionHandler:handler]; } @@ -1107,7 +1101,7 @@ [alert setInformativeText:[NSString stringWithFormat:NSLocalizedString(@"Do you want to overwrite %@?", @"File already exists in queue alert -> informative text"), job.completeOutputURL.path]]; [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"File already exists in queue alert -> first button")]; [alert addButtonWithTitle:NSLocalizedString(@"Overwrite", @"File already exists in queue alert -> second button")]; - [alert setAlertStyle:NSCriticalAlertStyle]; + [alert setAlertStyle:NSAlertStyleCritical]; [alert beginSheetModalForWindow:self.window completionHandler:handler]; } @@ -1270,7 +1264,7 @@ [alert setInformativeText:NSLocalizedString(@"One or more file already exists. Do you want to overwrite?", @"File already exists alert -> informative text")]; [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"File already exists alert -> first button")]; [alert addButtonWithTitle:NSLocalizedString(@"Overwrite", @"File already exists alert -> second button")]; - [alert setAlertStyle:NSCriticalAlertStyle]; + [alert setAlertStyle:NSAlertStyleCritical]; [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) { if (returnCode == NSAlertSecondButtonReturn) @@ -1336,19 +1330,6 @@ [self.presetsPopover close]; } } - else - { - if (self.presetsDrawer.state == NSDrawerClosedState) - { - [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HBDefaultPresetsDrawerShow"]; - } - else - { - [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"HBDefaultPresetsDrawerShow"]; - } - - [self.presetsDrawer toggle:self]; - } } - (void)setCurrentPreset:(HBPreset *)currentPreset |