]> granicus.if.org Git - handbrake/commitdiff
Fix: fix another deprecation warning and add a missing alloc message.
authorDamiano Galassi <damiog@gmail.com>
Sat, 9 Jun 2018 08:26:57 +0000 (10:26 +0200)
committerDamiano Galassi <damiog@gmail.com>
Sat, 9 Jun 2018 08:26:57 +0000 (10:26 +0200)
macosx/HBPresetsViewController.m
macosx/HBPreviewController.m
macosx/HandBrake.xcodeproj/project.pbxproj

index 1f9ba0c8bd0ad15ad64e877ebb81a55b80766ada..d2a22b378a54ec8c949c47ea62cb747d4a354f21 100644 (file)
@@ -257,7 +257,7 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext;
     if ([self.treeController canRemove])
     {
         // Alert user before deleting preset
-        NSAlert *alert = [NSAlert init];
+        NSAlert *alert = [[NSAlert alloc] init];
         alert.messageText = NSLocalizedString(@"Are you sure you want to permanently delete the selected preset?", @"Delete preset alert -> message");
         alert.informativeText = NSLocalizedString(@"You can't undo this action.", @"Delete preset alert -> informative text");
         [alert addButtonWithTitle:NSLocalizedString(@"Delete Preset", @"Delete preset alert -> first button")];
index 26d76d94fbf074bdb1f6000a69f7f1e678c2419c..f5c572cfd33725fbd4a8cb0886d0d7a6339df374 100644 (file)
 
 - (void)showAlert:(NSURL *)fileURL;
 {
-    NSAlert *alert = [NSAlert alertWithMessageText:NSLocalizedString(@"HandBrake can't open the preview.", @"Preview -> live preview alert message")
-                                     defaultButton:NSLocalizedString(@"Open in external player", @"Preview -> live preview alert default button")
-                                   alternateButton:NSLocalizedString(@"Cancel", @"Preview -> live preview alert alternate button")
-                                       otherButton:nil
-                         informativeTextWithFormat:NSLocalizedString(@"HandBrake can't playback this combination of video/audio/container format. Do you want to open it in an external player?", @"Preview -> live preview alert informative text")];
-
-    [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode) {
-        if (returnCode == NSModalResponseOK)
+    NSAlert *alert = [[NSAlert alloc] init];
+    alert.messageText = NSLocalizedString(@"HandBrake can't open the preview.", @"Preview -> live preview alert message");
+    alert.informativeText = NSLocalizedString(@"HandBrake can't playback this combination of video/audio/container format. Do you want to open it in an external player?", @"Preview -> live preview alert informative text");
+    [alert addButtonWithTitle:NSLocalizedString(@"Open in external player", @"Preview -> live preview alert default button")];
+    [alert addButtonWithTitle:NSLocalizedString(@"Cancel", @"Preview -> live preview alert alternate button")];
+
+    [alert beginSheetModalForWindow:self.window completionHandler:^(NSModalResponse returnCode)
+    {
+        if (returnCode == NSAlertFirstButtonReturn)
         {
             [[NSWorkspace sharedWorkspace] openURL:fileURL];
         }
index 52f1f02234a373b1630256334bd229c6b5f9e806..1fa8d0a8aab6fbca05c7e1579a1a2a1aaf0ffd38 100644 (file)
@@ -38,7 +38,7 @@
                273F20B314ADBE670021BE6D /* HBOutputPanelController.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F209C14ADBE670021BE6D /* HBOutputPanelController.m */; };
                273F20B414ADBE670021BE6D /* HBOutputRedirect.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F209E14ADBE670021BE6D /* HBOutputRedirect.m */; };
                273F20B514ADBE670021BE6D /* HBPreferencesController.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F20A014ADBE670021BE6D /* HBPreferencesController.m */; };
-               273F20B714ADBE670021BE6D /* HBPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F20A414ADBE670021BE6D /* HBPreviewController.m */; settings = {COMPILER_FLAGS = "-Wno-deprecated-declarations"; }; };
+               273F20B714ADBE670021BE6D /* HBPreviewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F20A414ADBE670021BE6D /* HBPreviewController.m */; };
                273F20BA14ADBE670021BE6D /* HBPictureController.m in Sources */ = {isa = PBXBuildFile; fileRef = 273F20AA14ADBE670021BE6D /* HBPictureController.m */; };
                273F20CC14ADC8A10021BE6D /* Sparkle.framework in CopyFiles */ = {isa = PBXBuildFile; fileRef = 273F20C014ADC1250021BE6D /* Sparkle.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
                273F218B14ADDDA10021BE6D /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 273F217C14ADDDA10021BE6D /* InfoPlist.strings */; };