From 97734fff76d15a2da60f7956d82d463ac7ce6ece Mon Sep 17 00:00:00 2001 From: Damiano Galassi Date: Fri, 19 Jul 2019 21:17:27 +0200 Subject: MacGui: refactor the queue and implement part of the new queue ui. --- macosx/HBQueueDetailsViewController.m | 65 +++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 macosx/HBQueueDetailsViewController.m (limited to 'macosx/HBQueueDetailsViewController.m') diff --git a/macosx/HBQueueDetailsViewController.m b/macosx/HBQueueDetailsViewController.m new file mode 100644 index 000000000..a779346e8 --- /dev/null +++ b/macosx/HBQueueDetailsViewController.m @@ -0,0 +1,65 @@ +/* HBQueueDetailsViewController.m $ + + This file is part of the HandBrake source code. + Homepage: . + It may be used under the terms of the GNU General Public License. */ + +#import "HBQueueDetailsViewController.h" + +@interface HBQueueDetailsViewController () + +@property (weak) IBOutlet NSTextField *detailsLabel; +@property (weak) IBOutlet NSScrollView *scrollView; + +@property (weak) id delegate; + +@end + +@implementation HBQueueDetailsViewController + +- (NSString *)nibName +{ + return @"HBQueueDetailsViewController"; +} + +- (instancetype)initWithDelegate:(id)delegate +{ + self = [super init]; + if (self) + { + _delegate = delegate; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + self.item = nil; +} + +- (void)setItem:(HBQueueItem *)item +{ + _item = item; + if (item) + { + self.detailsLabel.attributedStringValue = item.attributedDescription; + [self.scrollView flashScrollers]; + } + else + { + self.detailsLabel.stringValue = NSLocalizedString(@"No job selected", @""); + } +} + +- (IBAction)editItem:(id)sender +{ + [self.delegate detailsViewEditItem:self.item]; +} + +- (IBAction)resetItem:(id)sender +{ + [self.delegate detailsViewResetItem:self.item]; +} + + +@end -- cgit v1.2.3