summaryrefslogtreecommitdiffstats
path: root/macosx/HBPreviewController.m
diff options
context:
space:
mode:
authorritsuka <[email protected]>2015-04-07 16:14:30 +0000
committerritsuka <[email protected]>2015-04-07 16:14:30 +0000
commit13d0d1d579a7e56ac2e2978994e3f0e74d324bba (patch)
tree557b0bc93f0d4c42028ae5c3a6cd80989b52fbfa /macosx/HBPreviewController.m
parent3f537cb97206f609c62867b32f262dd716b8df31 (diff)
MacGui: changed the Preview Window and Picture Panel behaviour to avoid the hide and show thing when loading a new title, now they can always be opened even if no title is loaded.
git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@7065 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'macosx/HBPreviewController.m')
-rw-r--r--macosx/HBPreviewController.m26
1 files changed, 17 insertions, 9 deletions
diff --git a/macosx/HBPreviewController.m b/macosx/HBPreviewController.m
index 4196819e7..92e779685 100644
--- a/macosx/HBPreviewController.m
+++ b/macosx/HBPreviewController.m
@@ -93,8 +93,6 @@ typedef enum ViewMode : NSUInteger {
IBOutlet NSPopUpButton * fPreviewMovieLengthPopUp;
}
-@property (nonatomic, unsafe_unretained) id <HBPreviewControllerDelegate> delegate;
-
@property (nonatomic, strong) CALayer *backLayer;
@property (nonatomic, strong) CALayer *pictureLayer;
@@ -130,12 +128,9 @@ typedef enum ViewMode : NSUInteger {
@implementation HBPreviewController
-- (id)initWithDelegate:(id <HBPreviewControllerDelegate>)delegate
+- (instancetype)init
{
- if (self = [super initWithWindowNibName:@"PicturePreview"])
- {
- _delegate = delegate;
- }
+ self = [super initWithWindowNibName:@"PicturePreview"];
return self;
}
@@ -211,6 +206,8 @@ typedef enum ViewMode : NSUInteger {
[fEncodingControlBox setFrameOrigin:hudControlBoxOrigin];
[fMoviePlaybackControlBox setFrameOrigin:hudControlBoxOrigin];
+ [self hideHud];
+
/* set the current scale factor */
if( [[self window] respondsToSelector:@selector( backingScaleFactor )] )
self.backingScaleFactor = [[self window] backingScaleFactor];
@@ -239,6 +236,11 @@ typedef enum ViewMode : NSUInteger {
[self switchViewToMode:ViewModePicturePreview];
[self displayPreview];
}
+ else
+ {
+ [self.pictureLayer setContents:nil];
+ self.window.title = NSLocalizedString(@"Preview", nil);
+ }
}
- (void) reloadPreviews
@@ -280,7 +282,6 @@ typedef enum ViewMode : NSUInteger {
}
[self.generator purgeImageCache];
- [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"PreviewWindowIsOpen"];
}
- (void) windowDidChangeBackingProperties: (NSNotification *) notification
@@ -613,6 +614,13 @@ typedef enum ViewMode : NSUInteger {
}
}
+- (void)hideHud
+{
+ [fPictureControlBox setHidden:YES];
+ [fMoviePlaybackControlBox setHidden:YES];
+ [fEncodingControlBox setHidden:YES];
+}
+
- (void) startHudTimer
{
if (self.hudTimer)
@@ -795,7 +803,7 @@ typedef enum ViewMode : NSUInteger {
- (IBAction) showPictureSettings: (id) sender
{
- [self.delegate showPicturePanel:self];
+ [self.pictureSettingsWindow showWindow:self];
}
#pragma mark -