diff options
author | Damiano Galassi <[email protected]> | 2019-07-19 21:17:27 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-07-19 21:17:27 +0200 |
commit | 97734fff76d15a2da60f7956d82d463ac7ce6ece (patch) | |
tree | 11d568970a940eea0bb12dd8594773da39c830a4 /macosx/HBQueueDetailsViewController.m | |
parent | f7654c69cb5bad5dcdeaa7375e04327c5178d387 (diff) |
MacGui: refactor the queue and implement part of the new queue ui.
Diffstat (limited to 'macosx/HBQueueDetailsViewController.m')
-rw-r--r-- | macosx/HBQueueDetailsViewController.m | 65 |
1 files changed, 65 insertions, 0 deletions
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: <http://handbrake.fr/>. + 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<HBQueueDetailsViewControllerDelegate> delegate; + +@end + +@implementation HBQueueDetailsViewController + +- (NSString *)nibName +{ + return @"HBQueueDetailsViewController"; +} + +- (instancetype)initWithDelegate:(id<HBQueueDetailsViewControllerDelegate>)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 |