diff options
author | Damiano Galassi <[email protected]> | 2019-02-14 14:24:39 +0100 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-02-14 14:24:39 +0100 |
commit | d79e33831e4713493e74a9267dc2bb5fe260685a (patch) | |
tree | f530236f416d543469f5cb635789f74dd7c44e06 /macosx | |
parent | 54140f90ecb0e9e2ccb312bde22e64133518ed9b (diff) |
MacGui: fix documentation link, some property annotations.
Diffstat (limited to 'macosx')
-rw-r--r-- | macosx/HBAddPresetController.m | 3 | ||||
-rw-r--r-- | macosx/HBAppDelegate.m | 3 | ||||
-rw-r--r-- | macosx/HBAudioDefaultsController.m | 3 | ||||
-rw-r--r-- | macosx/HBJob+UIAdditions.m | 6 | ||||
-rw-r--r-- | macosx/HBPreviewGenerator.m | 16 | ||||
-rw-r--r-- | macosx/HBQueueItem.h | 6 | ||||
-rw-r--r-- | macosx/HBSubtitlesDefaultsController.m | 3 | ||||
-rw-r--r-- | macosx/HBUtilities.h | 5 | ||||
-rw-r--r-- | macosx/HBUtilities.m | 5 |
9 files changed, 21 insertions, 29 deletions
diff --git a/macosx/HBAddPresetController.m b/macosx/HBAddPresetController.m index 79c7f56c2..3779eb056 100644 --- a/macosx/HBAddPresetController.m +++ b/macosx/HBAddPresetController.m @@ -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 diff --git a/macosx/HBAppDelegate.m b/macosx/HBAppDelegate.m index 630fcb750..83e768fd1 100644 --- a/macosx/HBAppDelegate.m +++ b/macosx/HBAppDelegate.m @@ -362,8 +362,7 @@ } - (IBAction)openUserGuide:(id)sender { - [[NSWorkspace sharedWorkspace] openURL:[NSURL - URLWithString:@"https://handbrake.fr/docs/en/1.1.0/"]]; + [[NSWorkspace sharedWorkspace] openURL:HBUtilities.documentationURL]; } @end diff --git a/macosx/HBAudioDefaultsController.m b/macosx/HBAudioDefaultsController.m index 88788e63b..5fb7c04d9 100644 --- a/macosx/HBAudioDefaultsController.m +++ b/macosx/HBAudioDefaultsController.m @@ -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 diff --git a/macosx/HBJob+UIAdditions.m b/macosx/HBJob+UIAdditions.m index 095cc8697..cd3c8e068 100644 --- a/macosx/HBJob+UIAdditions.m +++ b/macosx/HBJob+UIAdditions.m @@ -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 - diff --git a/macosx/HBPreviewGenerator.m b/macosx/HBPreviewGenerator.m index dde0ccd32..ea81aeac1 100644 --- a/macosx/HBPreviewGenerator.m +++ b/macosx/HBPreviewGenerator.m @@ -244,21 +244,9 @@ 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) diff --git a/macosx/HBQueueItem.h b/macosx/HBQueueItem.h index 28bb4af29..a4a96ab36 100644 --- a/macosx/HBQueueItem.h +++ b/macosx/HBQueueItem.h @@ -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; diff --git a/macosx/HBSubtitlesDefaultsController.m b/macosx/HBSubtitlesDefaultsController.m index 47f650dfa..adff701ec 100644 --- a/macosx/HBSubtitlesDefaultsController.m +++ b/macosx/HBSubtitlesDefaultsController.m @@ -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 diff --git a/macosx/HBUtilities.h b/macosx/HBUtilities.h index fd8963693..edf25ed73 100644 --- a/macosx/HBUtilities.h +++ b/macosx/HBUtilities.h @@ -23,6 +23,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. * diff --git a/macosx/HBUtilities.m b/macosx/HBUtilities.m index e6f9c67ec..7e95f007a 100644 --- a/macosx/HBUtilities.m +++ b/macosx/HBUtilities.m @@ -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; |