Skip to content

Commit

Permalink
macosx: Only react to user interaction of the chapters sidebar table …
Browse files Browse the repository at this point in the history
…view

Signed-off-by: Claudio Cambra <[email protected]>
  • Loading branch information
claucambra authored and robUx4 committed Nov 4, 2024
1 parent 61fd0e3 commit 70c1f97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
1 change: 1 addition & 0 deletions modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@
</tableColumn>
</tableColumns>
<connections>
<action selector="tableViewAction:" target="-2" id="Luw-YH-8N4"/>
<outlet property="delegate" destination="-2" id="n2S-Eb-GVz"/>
</connections>
</tableView>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN

- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;

- (IBAction)tableViewAction:(id)sender;

@end

NS_ASSUME_NONNULL_END
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,17 @@ - (void)updateChapterList
self.counterLabel.stringValue = [NSString stringWithFormat:@"%lu", chapterCount];
}

- (IBAction)tableViewAction:(id)sender
{
VLCPlayerChapter * const selectedChapter =
self.chaptersArrayController.selectedObjects.firstObject;
if (selectedChapter == nil) {
return;
}

[VLCMain.sharedInstance.playlistController.playerController setTimeFast:selectedChapter.time];
}

# pragma mark - NSTableView delegation

- (NSView *)tableView:(NSTableView *)tableView
Expand Down Expand Up @@ -149,15 +160,4 @@ - (NSView *)tableView:(NSTableView *)tableView
return nil;
}

- (void)tableViewSelectionDidChange:(NSNotification *)notification
{
VLCPlayerChapter * const selectedChapter =
self.chaptersArrayController.selectedObjects.firstObject;
if (selectedChapter == nil) {
return;
}

[VLCMain.sharedInstance.playlistController.playerController setTimeFast:selectedChapter.time];
}

@end

0 comments on commit 70c1f97

Please sign in to comment.