[vlc-commits] [Git][videolan/vlc][master] 5 commits: macosx: Select current chapter in chapter sidebar view when notification is...

Steve Lhomme (@robUx4) gitlab at videolan.org
Tue Nov 5 16:41:41 UTC 2024



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
f71e7e30 by Claudio Cambra at 2024-11-05T15:46:16+00:00
macosx: Select current chapter in chapter sidebar view when notification is received that the current chapter changed

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
55e63184 by Claudio Cambra at 2024-11-05T15:46:16+00:00
macosx: Make sure to update the chapter table view's selection when the chapters view loads

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
d4a8cd6f by Claudio Cambra at 2024-11-05T15:46:16+00:00
macosx: React to title selection change in player controller in title view sidebar

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
27a7bb56 by Claudio Cambra at 2024-11-05T15:46:16+00:00
macosx: Make sure to update title selection on title sidebar view init

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -
95004b2b by Claudio Cambra at 2024-11-05T15:46:16+00:00
macosx: Replace deprecated selectRow with selectRowIndexes in sidebar vcs

Signed-off-by: Claudio Cambra <developer at claudiocambra.com>

- - - - -


2 changed files:

- modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m
- modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m


Changes:

=====================================
modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m
=====================================
@@ -66,12 +66,17 @@
                  options:nil];
 
     [self updateChapterList];
+    [self updateSelectedChapter];
     
     NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
     [notificationCenter addObserver:self
                            selector:@selector(titleListChanged:)
                                name:VLCPlayerTitleListChanged
                              object:nil];
+    [notificationCenter addObserver:self
+                           selector:@selector(chapterSelectionChanged:)
+                               name:VLCPlayerChapterSelectionChanged
+                             object:nil];
 }
 
 - (NSString *)title
@@ -130,6 +135,19 @@
     [VLCMain.sharedInstance.playlistController.playerController setTimeFast:selectedChapter.time];
 }
 
+- (void)chapterSelectionChanged:(NSNotification *)notification
+{
+    [self updateSelectedChapter];
+}
+
+- (void)updateSelectedChapter
+{
+    const NSUInteger selectedChapterIndex =
+        VLCMain.sharedInstance.playlistController.playerController.selectedChapterIndex;
+    NSIndexSet * const indexSet = [NSIndexSet indexSetWithIndex:selectedChapterIndex];
+    [self.tableView selectRowIndexes:indexSet byExtendingSelection:NO];
+}
+
 # pragma mark - NSTableView delegation
 
 - (NSView *)tableView:(NSTableView *)tableView


=====================================
modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m
=====================================
@@ -66,12 +66,17 @@
                  options:nil];
 
     [self updateTitleList];
+    [self updateTitleSelection];
 
     NSNotificationCenter * const notificationCenter = NSNotificationCenter.defaultCenter;
     [notificationCenter addObserver:self
                            selector:@selector(titleListChanged:)
                                name:VLCPlayerTitleListChanged
                              object:nil];
+    [notificationCenter addObserver:self
+                           selector:@selector(titleSelectionChanged:)
+                               name:VLCPlayerTitleSelectionChanged
+                             object:nil];
 }
 
 - (NSString *)title
@@ -116,6 +121,20 @@
     [VLCMain.sharedInstance.playlistController.playerController setSelectedTitleIndex:selectedTitle.index];
 }
 
+- (void)titleSelectionChanged:(NSNotification *)notification
+{
+    [self updateTitleSelection];
+}
+
+- (void)updateTitleSelection
+{
+    VLCPlayerController * const playerController =
+        VLCMain.sharedInstance.playlistController.playerController;
+    const NSUInteger selectedTitleIndex = playerController.selectedTitleIndex;
+    NSIndexSet * const indexSet = [NSIndexSet indexSetWithIndex:selectedTitleIndex];
+    [self.tableView selectRowIndexes:indexSet byExtendingSelection:NO];
+}
+
 # pragma mark - NSTableView delegation
 
 - (NSView *)tableView:(NSTableView *)tableView



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/477f37bdbab7fec32e684cb15ee47c4a7784110b...95004b2b348d6e54c3b99d597c0c5d3b5535fce7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/477f37bdbab7fec32e684cb15ee47c4a7784110b...95004b2b348d6e54c3b99d597c0c5d3b5535fce7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list