]> granicus.if.org Git - handbrake/commitdiff
MacGui: fix documentation link, some property annotations.
authorDamiano Galassi <damiog@gmail.com>
Thu, 14 Feb 2019 13:24:39 +0000 (14:24 +0100)
committerDamiano Galassi <damiog@gmail.com>
Thu, 14 Feb 2019 13:24:39 +0000 (14:24 +0100)
macosx/HBAddPresetController.m
macosx/HBAppDelegate.m
macosx/HBAudioDefaultsController.m
macosx/HBJob+UIAdditions.m
macosx/HBPreviewGenerator.m
macosx/HBQueueItem.h
macosx/HBSubtitlesDefaultsController.m
macosx/HBUtilities.h
macosx/HBUtilities.m

index 79c7f56c268f8f33e07e489a05bae90dbab5c657..3779eb0562c7199b37ba7d4344abcf19b4834aab 100644 (file)
@@ -253,8 +253,7 @@ typedef NS_ENUM(NSUInteger, HBAddPresetControllerMode) {
 
 - (IBAction)openUserGuide:(id)sender
 {
-    [[NSWorkspace sharedWorkspace] openURL:[NSURL
-                                            URLWithString:@"https://handbrake.fr/docs/en/1.1.0/advanced/custom-presets.html"]];
+    [[NSWorkspace sharedWorkspace] openURL:[HBUtilities.documentationURL URLByAppendingPathComponent:@"advanced/custom-presets.html"]];
 }
 
 @end
index 630fcb7500fc020322596c5e21493edd7aa5028a..83e768fd19e2644ee2cad55332503e095a81ef77 100644 (file)
 }
 - (IBAction)openUserGuide:(id)sender
 {
-    [[NSWorkspace sharedWorkspace] openURL:[NSURL
-                                            URLWithString:@"https://handbrake.fr/docs/en/1.1.0/"]];
+    [[NSWorkspace sharedWorkspace] openURL:HBUtilities.documentationURL];
 }
 
 @end
index 88788e63b7111a29281483957da24a2d467c5ab6..5fb7c04d976f22932a86fde9d592a76348abb136 100644 (file)
@@ -97,8 +97,7 @@ static void *HBAudioDefaultsContext = &HBAudioDefaultsContext;
 
 - (IBAction)openUserGuide:(id)sender
 {
-    [[NSWorkspace sharedWorkspace] openURL:[NSURL
-                                            URLWithString:@"https://handbrake.fr/docs/en/1.1.0/advanced/audio-subtitle-defaults.html"]];
+    [[NSWorkspace sharedWorkspace] openURL:[HBUtilities.documentationURL URLByAppendingPathComponent:@"advanced/audio-subtitle-defaults.html"]];
 }
 
 - (void)dealloc
index 095cc8697a4b317eb5b3bfa5f288491f720137c8..cd3c8e06864a7c07cacfb061cb8a2fbd4f15fa68 100644 (file)
@@ -23,7 +23,6 @@
 #include "hb.h"
 
 // Text Styles
-static NSMutableParagraphStyle *ps;
 static NSDictionary            *detailAttr;
 static NSDictionary            *detailBoldAttr;
 static NSDictionary            *titleAttr;
@@ -96,10 +95,10 @@ static NSDictionary            *shortHeightAttr;
 
 - (void)initStyles
 {
-    if (!ps)
+    if (!detailAttr)
     {
         // Attributes
-        ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
+        NSMutableParagraphStyle *ps = [[NSParagraphStyle defaultParagraphStyle] mutableCopy];
         ps.headIndent = 88.0;
         ps.paragraphSpacing = 1.0;
         ps.tabStops = @[[[NSTextTab alloc] initWithType:
@@ -1000,4 +999,3 @@ static NSDictionary            *shortHeightAttr;
 }
 
 @end
-
index dde0ccd32055c0d2a6a8064e9ad56a44732e28af..ea81aeac19bd104de3506bd6e94bb9698cd33bdf 100644 (file)
         return NO;
     }
 
-    NSURL *destURL = nil;
     // Generate the file url and directories.
-    if (self.job.container & 0x030000 /*HB_MUX_MASK_MP4*/)
-    {
-        // we use .m4v for our mp4 files so that ac3 and chapters in mp4 will play properly.
-        destURL = [HBPreviewGenerator generateFileURLForType:@"m4v"];
-    }
-    else if (self.job.container & 0x300000 /*HB_MUX_MASK_MKV*/)
-    {
-        destURL = [HBPreviewGenerator generateFileURLForType:@"mkv"];
-    }
-    else if (self.job.container & 0x400000 /*HB_MUX_MASK_WEBM*/)
-    {
-        destURL = [HBPreviewGenerator generateFileURLForType:@"webm"];
-    }
+    NSString *extension = [HBUtilities automaticExtForJob:self.job];
+    NSURL *destURL = [HBPreviewGenerator generateFileURLForType:extension];
 
     // return if we couldn't get the fileURL.
     if (!destURL)
index 28bb4af291ab023676bd463b83a171416cb363bd..a4a96ab369be30ee2237e93e9a968f0374fac2c0 100644 (file)
@@ -34,13 +34,13 @@ typedef NS_ENUM(NSUInteger, HBQueueItemState){
 @property (nonatomic, readonly) NSURL *fileURL;
 
 /// The file URL at which the new file will be created.
-@property (nonatomic, readwrite, copy, nullable) NSURL *outputURL;
+@property (nonatomic, readonly, copy) NSURL *outputURL;
 
 /// The name of the new file that will be created.
-@property (nonatomic, readwrite, copy, nullable) NSString *outputFileName;
+@property (nonatomic, readonly, copy) NSString *outputFileName;
 
 /// The file URL at which the new file will be created.
-@property (nonatomic, readwrite, copy, nullable) NSURL *completeOutputURL;
+@property (nonatomic, readonly, copy) NSURL *completeOutputURL;
 
 @property (nonatomic, readonly) NSAttributedString *attributedTitleDescription;
 @property (nonatomic, readonly) NSAttributedString *attributedDescription;
index 47f650dfa8954466f15f26ea8a4dad58fbd61e2d..adff701ecceda2d1fa6ffdc4813e0daf98ca892d 100644 (file)
@@ -78,8 +78,7 @@ static void *HBSubtitlesDefaultsContext = &HBSubtitlesDefaultsContext;
 
 - (IBAction)openUserGuide:(id)sender
 {
-    [[NSWorkspace sharedWorkspace] openURL:[NSURL
-                                            URLWithString:@"https://handbrake.fr/docs/en/1.1.0/advanced/audio-subtitle-defaults.html"]];
+    [[NSWorkspace sharedWorkspace] openURL:[HBUtilities.documentationURL URLByAppendingPathComponent:@"advanced/audio-subtitle-defaults.html"]];
 }
 
 - (void)dealloc
index fd8963693c376a0cb62003b7bb8ea27fe24edb67..edf25ed73aa9b3185d34dbad30068e131390f73a 100644 (file)
@@ -22,6 +22,11 @@ NS_ASSUME_NONNULL_BEGIN
  */
 + (nullable NSURL *)appSupportURL;
 
+/**
+ * Returns the url of the current version documentation.
+ */
+@property (nonatomic, readonly, class) NSURL *documentationURL;
+
 /**
  *  Writes a message to standard error.
  *  The message will show up in the output panel and in the activity log.
index e6f9c67ecc84af31dfaaa048dee48018980c4bb3..7e95f007a8bb5ec520cc59e4d914c632ee2b35e0 100644 (file)
@@ -57,6 +57,11 @@ static NSDateFormatter *_releaseDateFormatter = nil;
     return appSupportURL;
 }
 
++ (NSURL *)documentationURL
+{
+    return [NSURL URLWithString:@"https://handbrake.fr/docs/en/1.2.0/"];
+}
+
 + (void)writeToActivityLog:(const char *)format, ...
 {
     va_list args;