summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authorDamiano Galassi <[email protected]>2019-07-20 09:08:25 +0200
committerDamiano Galassi <[email protected]>2019-07-20 09:08:25 +0200
commit61db67faf4bb26ce72cc22884e77269c038678c6 (patch)
treec575e4602831ebb93922445d3795e3aaa771cd9b /macosx
parente17eedc1cade5d99be6d85207f32020c19763948 (diff)
MacGui: add inline progress status and bar in the queue.
Diffstat (limited to 'macosx')
-rw-r--r--macosx/Base.lproj/HBQueueTableViewController.xib72
-rw-r--r--macosx/HBController.m17
-rw-r--r--macosx/HBQueue.h3
-rw-r--r--macosx/HBQueue.m14
-rw-r--r--macosx/HBQueueController.m7
-rw-r--r--macosx/HBQueueItemView.h1
-rw-r--r--macosx/HBQueueItemView.m6
-rw-r--r--macosx/HBQueueItemWorkingView.h15
-rw-r--r--macosx/HBQueueItemWorkingView.m56
-rw-r--r--macosx/HBQueueTableViewController.m46
-rw-r--r--macosx/HandBrake.xcodeproj/project.pbxproj6
11 files changed, 185 insertions, 58 deletions
diff --git a/macosx/Base.lproj/HBQueueTableViewController.xib b/macosx/Base.lproj/HBQueueTableViewController.xib
index 8eb989790..875c9a879 100644
--- a/macosx/Base.lproj/HBQueueTableViewController.xib
+++ b/macosx/Base.lproj/HBQueueTableViewController.xib
@@ -24,7 +24,7 @@
<rect key="frame" x="1" y="1" width="543" height="150"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
- <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveColumns="NO" rowHeight="22" rowSizeStyle="automatic" viewBased="YES" id="VV7-t7-Ufd" customClass="HBTableView">
+ <tableView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" alternatingRowBackgroundColors="YES" columnSelection="YES" autosaveColumns="NO" rowHeight="22" viewBased="YES" id="VV7-t7-Ufd" customClass="HBTableView">
<rect key="frame" x="0.0" y="0.0" width="543" height="150"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
@@ -44,8 +44,74 @@
</textFieldCell>
<tableColumnResizingMask key="resizingMask" resizeWithTable="YES" userResizable="YES"/>
<prototypeCellViews>
- <tableCellView identifier="MainSimpleCell" id="Til-BP-Zag" customClass="HBQueueItemView">
- <rect key="frame" x="1" y="1" width="540" height="22"/>
+ <tableCellView identifier="MainWorkingCell" id="XcX-ea-XWm" userLabel="Queue Working Item View" customClass="HBQueueItemWorkingView">
+ <rect key="frame" x="1" y="1" width="540" height="54"/>
+ <autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
+ <subviews>
+ <textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ar9-Uk-6sM">
+ <rect key="frame" x="21" y="35" width="494" height="17"/>
+ <constraints>
+ <constraint firstAttribute="height" relation="greaterThanOrEqual" constant="17" id="lzC-jf-dZI"/>
+ </constraints>
+ <textFieldCell key="cell" lineBreakMode="truncatingTail" enabled="NO" allowsUndo="NO" sendsActionOnEndEditing="YES" title="Table View Cell" id="5Rl-P0-bhc">
+ <font key="font" metaFont="system"/>
+ <color key="textColor" name="controlTextColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ <button horizontalHuggingPriority="750" verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="hRX-N0-lCu">
+ <rect key="frame" x="521" y="36" width="16" height="16"/>
+ <constraints>
+ <constraint firstAttribute="width" constant="16" id="3lG-7h-l6p"/>
+ <constraint firstAttribute="height" constant="16" id="R7j-DY-bWX"/>
+ </constraints>
+ <buttonCell key="cell" type="bevel" bezelStyle="rounded" image="Delete" imagePosition="only" alignment="center" alternateImage="DeleteHighlightPressed" id="bPd-yn-PRB">
+ <behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
+ <font key="font" metaFont="system"/>
+ </buttonCell>
+ </button>
+ <imageView horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="7OO-Ut-UrC">
+ <rect key="frame" x="3" y="37" width="14" height="14"/>
+ <imageCell key="cell" refusesFirstResponder="YES" alignment="left" imageScaling="proportionallyDown" image="NSActionTemplate" id="bqz-sk-X31"/>
+ </imageView>
+ <progressIndicator wantsLayer="YES" maxValue="1" style="bar" translatesAutoresizingMaskIntoConstraints="NO" id="xAK-4F-cCr">
+ <rect key="frame" x="23" y="13" width="490" height="23"/>
+ </progressIndicator>
+ <textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="fxw-eD-SmJ">
+ <rect key="frame" x="21" y="3" width="494" height="14"/>
+ <textFieldCell key="cell" lineBreakMode="truncatingTail" allowsUndo="NO" title="Encoding status" id="eEU-Dr-Qh8">
+ <font key="font" metaFont="smallSystem"/>
+ <color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
+ <color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
+ </textFieldCell>
+ </textField>
+ </subviews>
+ <constraints>
+ <constraint firstItem="7OO-Ut-UrC" firstAttribute="top" secondItem="XcX-ea-XWm" secondAttribute="top" constant="3" id="HF1-Wf-uIT"/>
+ <constraint firstItem="fxw-eD-SmJ" firstAttribute="leading" secondItem="7OO-Ut-UrC" secondAttribute="trailing" constant="6" id="Nj6-XZ-SEs"/>
+ <constraint firstAttribute="trailing" secondItem="hRX-N0-lCu" secondAttribute="trailing" constant="3" id="Syk-aw-gZV"/>
+ <constraint firstItem="ar9-Uk-6sM" firstAttribute="top" secondItem="XcX-ea-XWm" secondAttribute="top" constant="2" id="T9f-ov-BLW"/>
+ <constraint firstItem="xAK-4F-cCr" firstAttribute="top" secondItem="ar9-Uk-6sM" secondAttribute="bottom" id="Ujw-UU-Sqh"/>
+ <constraint firstItem="hRX-N0-lCu" firstAttribute="leading" secondItem="fxw-eD-SmJ" secondAttribute="trailing" constant="8" id="Vl3-R0-TIy"/>
+ <constraint firstItem="hRX-N0-lCu" firstAttribute="top" secondItem="XcX-ea-XWm" secondAttribute="top" constant="2" id="Wv0-tz-Hlh"/>
+ <constraint firstItem="xAK-4F-cCr" firstAttribute="leading" secondItem="ar9-Uk-6sM" secondAttribute="leading" id="ZIf-yJ-gev"/>
+ <constraint firstItem="xAK-4F-cCr" firstAttribute="width" secondItem="ar9-Uk-6sM" secondAttribute="width" id="aRZ-jw-Ekv"/>
+ <constraint firstItem="hRX-N0-lCu" firstAttribute="leading" secondItem="ar9-Uk-6sM" secondAttribute="trailing" constant="8" id="dxl-4e-TfR"/>
+ <constraint firstAttribute="bottom" secondItem="fxw-eD-SmJ" secondAttribute="bottom" constant="3" id="e8w-3K-333"/>
+ <constraint firstItem="ar9-Uk-6sM" firstAttribute="leading" secondItem="7OO-Ut-UrC" secondAttribute="trailing" constant="6" id="iaK-Ol-CUC"/>
+ <constraint firstItem="fxw-eD-SmJ" firstAttribute="top" secondItem="xAK-4F-cCr" secondAttribute="bottom" constant="-3" id="ihq-42-fa8"/>
+ <constraint firstItem="7OO-Ut-UrC" firstAttribute="leading" secondItem="XcX-ea-XWm" secondAttribute="leading" constant="3" id="l3I-Nv-u7l"/>
+ </constraints>
+ <connections>
+ <outlet property="imageView" destination="7OO-Ut-UrC" id="QPs-kQ-diT"/>
+ <outlet property="progressBar" destination="xAK-4F-cCr" id="DwJ-6S-D2O"/>
+ <outlet property="progressField" destination="fxw-eD-SmJ" id="X5Q-1e-7XB"/>
+ <outlet property="removeButton" destination="hRX-N0-lCu" id="jUg-bR-KAc"/>
+ <outlet property="textField" destination="ar9-Uk-6sM" id="eyL-cI-MDN"/>
+ </connections>
+ </tableCellView>
+ <tableCellView identifier="MainCell" id="Til-BP-Zag" customClass="HBQueueItemView">
+ <rect key="frame" x="1" y="57" width="540" height="22"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" textCompletion="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ns0-GA-WCh">
diff --git a/macosx/HBController.m b/macosx/HBController.m
index 40b42ff9b..21f08570c 100644
--- a/macosx/HBController.m
+++ b/macosx/HBController.m
@@ -81,7 +81,6 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
// Bottom
IBOutlet NSTextField * fStatusField;
IBOutlet NSProgressIndicator * fRipIndicator;
- BOOL fRipIndicatorShown;
// User Preset
HBPresetsManager * presetManager;
@@ -291,18 +290,28 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
[NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidStartNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
self.bottomConstrain.animator.constant = 0;
- self->fRipIndicatorShown = YES;
self->fRipIndicator.hidden = NO;
}];
[NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidCompleteNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
self.bottomConstrain.animator.constant = -WINDOW_HEIGHT_OFFSET;
self->fRipIndicator.hidden = YES;
- self->fRipIndicatorShown = NO;
}];
[NSNotificationCenter.defaultCenter addObserverForName:HBQueueProgressNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
- self.progressInfo = note.userInfo[HBQueueProgressNotificationInfoKey];
+ HBQueueItem *item = self.queue.currentItem;
+ NSString *info;
+ if (item)
+ {
+ info = [NSString stringWithFormat:NSLocalizedString(@"Encoding %@\n%@", @""),
+ self.queue.currentItem.outputFileName,
+ note.userInfo[HBQueueProgressNotificationInfoKey]];
+ }
+ else
+ {
+ info = note.userInfo[HBQueueProgressNotificationInfoKey];
+ }
+ self.progressInfo = [[NSAttributedString alloc] initWithString:info];
self.progress = [note.userInfo[HBQueueProgressNotificationPercentKey] doubleValue];
if (self->_visible)
diff --git a/macosx/HBQueue.h b/macosx/HBQueue.h
index 0e176292b..4a85c47ef 100644
--- a/macosx/HBQueue.h
+++ b/macosx/HBQueue.h
@@ -33,8 +33,9 @@ extern NSString * const HBQueueProgressNotificationInfoKey; // NSString
extern NSString * const HBQueueDidStartNotification;
extern NSString * const HBQueueDidCompleteNotification;
+extern NSString * const HBQueueDidStartItemNotification;
extern NSString * const HBQueueDidCompleteItemNotification;
-extern NSString * const HBQueueDidCompleteItemNotificationItemKey; // HBQueueItem
+extern NSString * const HBQueueItemNotificationItemKey; // HBQueueItem
@interface HBQueue : NSObject
diff --git a/macosx/HBQueue.m b/macosx/HBQueue.m
index 6aee92452..3c9c20a2b 100644
--- a/macosx/HBQueue.m
+++ b/macosx/HBQueue.m
@@ -28,8 +28,9 @@ NSString * const HBQueueProgressNotificationInfoKey = @"HBQueueProgressNotificat
NSString * const HBQueueDidStartNotification = @"HBQueueDidStartNotification";
NSString * const HBQueueDidCompleteNotification = @"HBQueueDidCompleteNotification";
+NSString * const HBQueueDidStartItemNotification = @"HBQueueDidStartItemNotification";
NSString * const HBQueueDidCompleteItemNotification = @"HBQueueDidCompleteItemNotification";
-NSString * const HBQueueDidCompleteItemNotificationItemKey = @"HBQueueDidCompleteItemNotificationItemKey";
+NSString * const HBQueueItemNotificationItemKey = @"HBQueueItemNotificationItemKey";
@interface HBQueue ()
@@ -520,7 +521,6 @@ NSString * const HBQueueDidCompleteItemNotificationItemKey = @"HBQueueDidComplet
- (void)encodeNextQueueItem
{
[self.items beginTransaction];
- self.currentItem = nil;
// since we have completed an encode, we go to the next
if (self.stop)
@@ -562,7 +562,9 @@ NSString * const HBQueueDidCompleteItemNotificationItemKey = @"HBQueueDidComplet
self.currentItem = nextItem;
NSIndexSet *indexes = [NSIndexSet indexSetWithIndex:[self.items indexOfObject:nextItem]];
- [NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidChangeItemNotification object:self userInfo:@{HBQueueItemNotificationIndexesKey: indexes}];
+
+ [NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidStartItemNotification object:self userInfo:@{HBQueueItemNotificationItemKey: nextItem,
+ HBQueueItemNotificationIndexesKey: indexes}];
[self updateStats];
@@ -622,12 +624,14 @@ NSString * const HBQueueDidCompleteItemNotificationItemKey = @"HBQueueDidComplet
break;
}
+ self.currentItem = nil;
+
[NSNotificationCenter.defaultCenter postNotificationName:HBQueueProgressNotification object:self userInfo:@{HBQueueProgressNotificationPercentKey: @1.0,
HBQueueProgressNotificationInfoKey: info}];
NSInteger index = [self.items indexOfObject:item];
NSIndexSet *indexes = index > -1 ? [NSIndexSet indexSetWithIndex:index] : [NSIndexSet indexSet];
- [NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidCompleteItemNotification object:self userInfo:@{HBQueueDidCompleteItemNotificationItemKey: item,
+ [NSNotificationCenter.defaultCenter postNotificationName:HBQueueDidCompleteItemNotification object:self userInfo:@{HBQueueItemNotificationItemKey: item,
HBQueueItemNotificationIndexesKey: indexes}];
[self.items commit];
@@ -686,7 +690,7 @@ NSString * const HBQueueDidCompleteItemNotificationItemKey = @"HBQueueDidComplet
NSParameterAssert(job);
HBStateFormatter *formatter = [[HBStateFormatter alloc] init];
- formatter.title = job.outputFileName;
+ formatter.twoLines = NO;
self.core.stateFormatter = formatter;
// Progress handler
diff --git a/macosx/HBQueueController.m b/macosx/HBQueueController.m
index 40ae17334..e5621db6d 100644
--- a/macosx/HBQueueController.m
+++ b/macosx/HBQueueController.m
@@ -79,8 +79,6 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
_splitViewController.splitView = _splitView;
_splitViewController.view.wantsLayer = YES;
_splitViewController.splitView.vertical = YES;
- _splitViewController.splitView.autosaveName = @"HBQueueSplitViewAutosave";
- _splitViewController.splitView.identifier = @"HBQueueSplitViewIdentifier";
_tableViewController = [[HBQueueTableViewController alloc] initWithQueue:self.queue delegate:self];
_detailsViewController = [[HBQueueDetailsViewController alloc] initWithDelegate:self];
@@ -96,6 +94,9 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
[_splitViewController addSplitViewItem:detailsItem];
+ _splitViewController.splitView.autosaveName = @"HBQueueSplitViewAutosave";
+ _splitViewController.splitView.identifier = @"HBQueueSplitViewIdentifier";
+
self.window.contentViewController = _splitViewController;
self.window.frameAutosaveName = @"HBQueueWindowFrameAutosave";
@@ -141,7 +142,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext;
self.dockIconProgress = 0;
// Run the per item notification and actions
- HBQueueItem *item = note.userInfo[HBQueueDidCompleteItemNotificationItemKey];
+ HBQueueItem *item = note.userInfo[HBQueueItemNotificationItemKey];
if (item.state == HBQueueItemStateCompleted)
{
[self sendToExternalApp:item];
diff --git a/macosx/HBQueueItemView.h b/macosx/HBQueueItemView.h
index e79ee51c8..43235e30f 100644
--- a/macosx/HBQueueItemView.h
+++ b/macosx/HBQueueItemView.h
@@ -14,7 +14,6 @@ NS_ASSUME_NONNULL_BEGIN
- (void)revealQueueItem:(HBQueueItem *)job;
- (void)removeQueueItem:(HBQueueItem *)job;
-- (void)toggleQueueItemHeight:(HBQueueItem *)job;
@end
diff --git a/macosx/HBQueueItemView.m b/macosx/HBQueueItemView.m
index 39fbdf4ce..243c52938 100644
--- a/macosx/HBQueueItemView.m
+++ b/macosx/HBQueueItemView.m
@@ -10,7 +10,6 @@
@interface HBQueueItemView ()
@property (nonatomic, weak) IBOutlet NSButton *removeButton;
-@property (nonatomic, weak) IBOutlet NSButton *expandButton;
@end
@@ -123,9 +122,4 @@
[self.delegate removeQueueItem:_item];
}
-- (IBAction)toggleHeight:(id)sender
-{
- [self.delegate toggleQueueItemHeight:_item];
-}
-
@end
diff --git a/macosx/HBQueueItemWorkingView.h b/macosx/HBQueueItemWorkingView.h
new file mode 100644
index 000000000..4223829b6
--- /dev/null
+++ b/macosx/HBQueueItemWorkingView.h
@@ -0,0 +1,15 @@
+/* HBQueueItemWorkingView.h $
+
+ 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 "HBQueueItemView.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface HBQueueItemWorkingView : HBQueueItemView
+
+@end
+
+NS_ASSUME_NONNULL_END
diff --git a/macosx/HBQueueItemWorkingView.m b/macosx/HBQueueItemWorkingView.m
new file mode 100644
index 000000000..94916e2d4
--- /dev/null
+++ b/macosx/HBQueueItemWorkingView.m
@@ -0,0 +1,56 @@
+/* HBQueueItemWorkingView.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 "HBQueueItemWorkingView.h"
+
+#import "HBQueueItem.h"
+#import "HBQueue.h"
+
+@interface HBQueueItemWorkingView ()
+
+@property (nonatomic, weak) IBOutlet NSProgressIndicator *progressBar;
+@property (nonatomic, weak) IBOutlet NSTextField *progressField;
+
+@property (nonatomic) id progressToken;
+@property (nonatomic) id completedToken;
+
+@end
+
+@implementation HBQueueItemWorkingView
+
+- (void)setItem:(HBQueueItem *)item
+{
+ [super setItem:item];
+
+ if (item.state == HBQueueItemStateWorking)
+ {
+ NSNotificationCenter * __weak center = NSNotificationCenter.defaultCenter;
+
+ self.progressToken = [center addObserverForName:HBQueueProgressNotification
+ object:nil
+ queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note)
+ {
+ NSString *progressInfo = note.userInfo[HBQueueProgressNotificationInfoKey];
+ double progress = [note.userInfo[HBQueueProgressNotificationPercentKey] doubleValue];
+
+ self.progressField.stringValue = progressInfo;
+ self.progressBar.doubleValue = progress;
+ }];
+
+ self.completedToken = [center addObserverForName:HBQueueDidCompleteItemNotification
+ object:nil
+ queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note)
+ {
+ HBQueueItem *completedItem = note.userInfo[HBQueueItemNotificationItemKey];
+ if (completedItem == self.item) {
+ [center removeObserver:self.progressToken];
+ [center removeObserver:self.completedToken];
+ }
+ }];
+ }
+}
+
+@end
diff --git a/macosx/HBQueueTableViewController.m b/macosx/HBQueueTableViewController.m
index d0b4753cb..309d6d48a 100644
--- a/macosx/HBQueueTableViewController.m
+++ b/macosx/HBQueueTableViewController.m
@@ -84,14 +84,19 @@
[self.tableView reloadDataForRowIndexes:indexes columnIndexes:columnIndexes];
}];
- [NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidCompleteItemNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:^(NSNotification * _Nonnull note) {
+ typedef void (^HBUpdateHeight)(NSNotification *note);
+ HBUpdateHeight updateHeight = ^void(NSNotification *note) {
NSIndexSet *indexes = note.userInfo[HBQueueItemNotificationIndexesKey];
NSIndexSet *columnIndexes = [NSIndexSet indexSetWithIndex:0];
if (indexes.count)
{
[self.tableView reloadDataForRowIndexes:indexes columnIndexes:columnIndexes];
+ [self.tableView noteHeightOfRowsWithIndexesChanged:indexes];
}
- }];
+ };
+
+ [NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidStartItemNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:updateHeight];
+ [NSNotificationCenter.defaultCenter addObserverForName:HBQueueDidCompleteItemNotification object:_queue queue:NSOperationQueue.mainQueue usingBlock:updateHeight];
}
#pragma mark - UI Actions
@@ -212,9 +217,10 @@
viewForTableColumn:(NSTableColumn *)tableColumn
row:(NSInteger)row {
- HBQueueItemView *view = [tableView makeViewWithIdentifier:@"MainSimpleCell" owner:self];
HBQueueItem *item = self.queue.items[row];
+ HBQueueItemView *view = item.state == HBQueueItemStateWorking ? [tableView makeViewWithIdentifier:@"MainWorkingCell" owner:self] : [tableView makeViewWithIdentifier:@"MainCell" owner:self];
+
view.delegate = self;
view.item = item;
@@ -228,32 +234,8 @@
- (CGFloat)tableView:(NSTableView *)tableView heightOfRow:(NSInteger)row
{
- return 22;
-}
-
-- (void)toggleRowsAtIndexes:(NSIndexSet *)rowIndexes expand:(BOOL)expand
-{
- NSMutableIndexSet *rowsToExpand = [NSMutableIndexSet indexSet];
- [rowIndexes enumerateIndexesUsingBlock:^(NSUInteger index, BOOL *stop) {
- HBQueueItem *item = self.queue.items[index];
- BOOL expanded = item.expanded;
- if (expanded != expand)
- {
- item.expanded = !expanded;
- [rowsToExpand addIndex:index];
- }
-
- //HBQueueItemView *itemView = (HBQueueItemView *)[self.tableView viewAtColumn:0 row:index makeIfNecessary:NO];
- //if (expand)
- //{
- //[itemView expand];
- //}
- //else
- //{
- //[itemView collapse];
- //}
- }];
- [self.tableView noteHeightOfRowsWithIndexesChanged:rowsToExpand];
+ HBQueueItem *item = self.queue.items[row];
+ return item.state == HBQueueItemStateWorking ? 56 : 22;
}
#pragma mark NSQueueItemView delegate
@@ -269,12 +251,6 @@
[[NSWorkspace sharedWorkspace] activateFileViewerSelectingURLs:@[item.completeOutputURL]];
}
-- (void)toggleQueueItemHeight:(nonnull HBQueueItem *)item
-{
- NSInteger row = [self.queue.items indexOfObject:item];
- [self toggleRowsAtIndexes:[NSIndexSet indexSetWithIndex:row] expand:!item.expanded];
-}
-
#pragma mark NSTableView delegate
- (void)tableViewSelectionDidChange:(NSNotification *)notification
diff --git a/macosx/HandBrake.xcodeproj/project.pbxproj b/macosx/HandBrake.xcodeproj/project.pbxproj
index f63eec1bf..ecdb0c0e9 100644
--- a/macosx/HandBrake.xcodeproj/project.pbxproj
+++ b/macosx/HandBrake.xcodeproj/project.pbxproj
@@ -259,6 +259,7 @@
A9ABD1A71E2A0F7500EC8B65 /* CoreText.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ABD1A51E2A0F0700EC8B65 /* CoreText.framework */; };
A9ABD1A91E2A0F8200EC8B65 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ABD1A81E2A0F8200EC8B65 /* CoreGraphics.framework */; };
A9ABD1AA1E2A0F8F00EC8B65 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ABD1A81E2A0F8200EC8B65 /* CoreGraphics.framework */; };
+ A9B3B63922E2EA58001CEB9A /* HBQueueItemWorkingView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9B3B63822E2EA58001CEB9A /* HBQueueItemWorkingView.m */; };
A9B6B9EE217B38D200B957AE /* HBLocalizationUtilities.h in Headers */ = {isa = PBXBuildFile; fileRef = A9B6B9ED217B38D200B957AE /* HBLocalizationUtilities.h */; };
A9B6B9F1217B408E00B957AE /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9B6B9EF217B408E00B957AE /* InfoPlist.strings */; };
A9B6B9F4217B408E00B957AE /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = A9B6B9F2217B408E00B957AE /* Localizable.strings */; };
@@ -667,6 +668,8 @@
A9ABD1A51E2A0F0700EC8B65 /* CoreText.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreText.framework; path = System/Library/Frameworks/CoreText.framework; sourceTree = SDKROOT; };
A9ABD1A81E2A0F8200EC8B65 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
A9B34D74197696FE00871B7D /* DiskArbitration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = DiskArbitration.framework; path = System/Library/Frameworks/DiskArbitration.framework; sourceTree = SDKROOT; };
+ A9B3B63722E2EA58001CEB9A /* HBQueueItemWorkingView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HBQueueItemWorkingView.h; sourceTree = "<group>"; };
+ A9B3B63822E2EA58001CEB9A /* HBQueueItemWorkingView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HBQueueItemWorkingView.m; sourceTree = "<group>"; };
A9B6B9ED217B38D200B957AE /* HBLocalizationUtilities.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HBLocalizationUtilities.h; sourceTree = "<group>"; };
A9B6B9F0217B408E00B957AE /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/InfoPlist.strings; sourceTree = "<group>"; };
A9B6B9F3217B408E00B957AE /* de */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = de; path = de.lproj/Localizable.strings; sourceTree = "<group>"; };
@@ -1098,6 +1101,8 @@
A9A96BD220CAD63000A39AFB /* Queue.xib */,
A9D3634F2209C08500D8EFEA /* HBQueueItemView.h */,
A9D363502209C08500D8EFEA /* HBQueueItemView.m */,
+ A9B3B63722E2EA58001CEB9A /* HBQueueItemWorkingView.h */,
+ A9B3B63822E2EA58001CEB9A /* HBQueueItemWorkingView.m */,
A96127E122E09ADD0086E6DC /* HBQueueTableViewController.h */,
A96127E222E09ADD0086E6DC /* HBQueueTableViewController.m */,
A958EAC422E24D6400D83AF4 /* HBQueueTableViewController.xib */,
@@ -1812,6 +1817,7 @@
A96127DF22E0994E0086E6DC /* HBQueueDetailsViewController.m in Sources */,
A97ECB8222E1D85500570935 /* HBQueue.m in Sources */,
A92B148220CA9F7700146FD8 /* HBHUDView.m in Sources */,
+ A9B3B63922E2EA58001CEB9A /* HBQueueItemWorkingView.m in Sources */,
A914BCB31BC441C700157917 /* HBPreviewView.m in Sources */,
273F20B714ADBE670021BE6D /* HBPreviewController.m in Sources */,
A9D1E41718262364002F6424 /* HBPreviewGenerator.m in Sources */,