diff options
author | Damiano Galassi <[email protected]> | 2019-07-27 13:15:37 +0200 |
---|---|---|
committer | Damiano Galassi <[email protected]> | 2019-07-27 13:15:37 +0200 |
commit | f82a8597f2800a5ca147679ad5660ef9fab5a85d (patch) | |
tree | 8e859079072c7c5e939ba4a7a7fcac5e8a67c3d9 /macosx/HBQueueInfoViewController.m | |
parent | a1d064d2f01d963213b1336c0aeda9e7a1a6817f (diff) |
MacGui: improve queue labels when multiple jobs are selected; fix some bugs.
Diffstat (limited to 'macosx/HBQueueInfoViewController.m')
-rw-r--r-- | macosx/HBQueueInfoViewController.m | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/macosx/HBQueueInfoViewController.m b/macosx/HBQueueInfoViewController.m new file mode 100644 index 000000000..1ae88bfc8 --- /dev/null +++ b/macosx/HBQueueInfoViewController.m @@ -0,0 +1,72 @@ +/* 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 "HBQueueInfoViewController.h" + +@interface HBQueueInfoViewController () + +@property (weak) IBOutlet NSTextField *summaryLabel; +@property (weak) IBOutlet NSTextField *statisticsLabel; +@property (weak) IBOutlet NSScrollView *scrollView; + +@property (weak) id<HBQueueDetailsViewControllerDelegate> delegate; + +@end + +@implementation HBQueueInfoViewController + +- (instancetype)initWithDelegate:(id<HBQueueDetailsViewControllerDelegate>)delegate +{ + self = [super init]; + if (self) + { + _delegate = delegate; + } + return self; +} + +- (void)viewDidLoad { + [super viewDidLoad]; + [self updateLabels]; +} + +- (void)updateLabels +{ + if (self.item) + { + self.statisticsLabel.hidden = self.item.endedDate == nil; + self.summaryLabel.hidden = NO; + + self.statisticsLabel.attributedStringValue = self.item.attributedStatistics; + self.summaryLabel.attributedStringValue = self.item.attributedDescription; + + [self.scrollView flashScrollers]; + } + else + { + self.statisticsLabel.hidden = YES; + self.summaryLabel.hidden = YES; + } +} + +- (void)setItem:(HBQueueItem *)item +{ + _item = item; + [self updateLabels]; +} + +- (IBAction)editItem:(id)sender +{ + [self.delegate detailsViewEditItem:self.item]; +} + +- (IBAction)resetItem:(id)sender +{ + [self.delegate detailsViewResetItem:self.item]; +} + + +@end |