[vlc-commits] [Git][videolan/vlc][master] 2 commits: macosx: Only react to user interaction of the title sidebar table view
Steve Lhomme (@robUx4)
gitlab at videolan.org
Mon Nov 4 12:46:25 UTC 2024
Steve Lhomme pushed to branch master at VideoLAN / VLC
Commits:
61fd0e31 by Claudio Cambra at 2024-11-04T12:29:29+00:00
macosx: Only react to user interaction of the title sidebar table view
Prevents the playback of the item being reset to the first title when
the title view is opened and loaded for the first time. Caused by the
table view selection changing on initialisation
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
70c1f979 by Claudio Cambra at 2024-11-04T12:29:29+00:00
macosx: Only react to user interaction of the chapters sidebar table view
Signed-off-by: Claudio Cambra <developer at claudiocambra.com>
- - - - -
6 changed files:
- modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib
- modules/gui/macosx/UI/VLCLibraryWindowTitlesView.xib
- modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.h
- modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m
- modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.h
- modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m
Changes:
=====================================
modules/gui/macosx/UI/VLCLibraryWindowChaptersView.xib
=====================================
@@ -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>
=====================================
modules/gui/macosx/UI/VLCLibraryWindowTitlesView.xib
=====================================
@@ -100,6 +100,7 @@
</tableColumn>
</tableColumns>
<connections>
+ <action selector="tableViewAction:" target="-2" id="BSk-To-3Pu"/>
<outlet property="delegate" destination="-2" id="n2S-Eb-GVz"/>
</connections>
</tableView>
=====================================
modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.h
=====================================
@@ -37,6 +37,8 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;
+- (IBAction)tableViewAction:(id)sender;
+
@end
NS_ASSUME_NONNULL_END
=====================================
modules/gui/macosx/library/VLCLibraryWindowChaptersSidebarViewController.m
=====================================
@@ -119,6 +119,17 @@
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
@@ -149,15 +160,4 @@
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
=====================================
modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.h
=====================================
@@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithLibraryWindow:(VLCLibraryWindow *)libraryWindow;
+- (IBAction)tableViewAction:(id)sender;
+
@end
NS_ASSUME_NONNULL_END
=====================================
modules/gui/macosx/library/VLCLibraryWindowTitlesSidebarViewController.m
=====================================
@@ -105,6 +105,17 @@
self.counterLabel.stringValue = [NSString stringWithFormat:@"%lu", titleCount];
}
+- (IBAction)tableViewAction:(id)sender
+{
+ VLCPlayerTitle * const selectedTitle =
+ self.titlesArrayController.selectedObjects.firstObject;
+ if (selectedTitle == nil) {
+ return;
+ }
+
+ [VLCMain.sharedInstance.playlistController.playerController setSelectedTitleIndex:selectedTitle.index];
+}
+
# pragma mark - NSTableView delegation
- (NSView *)tableView:(NSTableView *)tableView
@@ -135,15 +146,4 @@
return nil;
}
-- (void)tableViewSelectionDidChange:(NSNotification *)notification
-{
- VLCPlayerTitle * const selectedTitle =
- self.titlesArrayController.selectedObjects.firstObject;
- if (selectedTitle == nil) {
- return;
- }
-
- [VLCMain.sharedInstance.playlistController.playerController setSelectedTitleIndex:selectedTitle.index];
-}
-
@end
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c3ed31846ee2ae67e1260e6d1fbe025935cb81b5...70c1f979a8ec96ed1bb449da73d8b8b56aaca991
--
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/c3ed31846ee2ae67e1260e6d1fbe025935cb81b5...70c1f979a8ec96ed1bb449da73d8b8b56aaca991
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