Commit 2c83415d authored by David Fuhrmann's avatar David Fuhrmann

macosx: Fix initialization of VLCPlaylist object

This is not loaded from a xib anymore, but rather manually.
parent 8eb81762
...@@ -74,7 +74,6 @@ ...@@ -74,7 +74,6 @@
NSTableColumn *_sortTableColumn; NSTableColumn *_sortTableColumn;
BOOL b_playlistmenu_nib_loaded; BOOL b_playlistmenu_nib_loaded;
BOOL b_view_setup;
PLModel *_model; PLModel *_model;
} }
...@@ -84,6 +83,22 @@ ...@@ -84,6 +83,22 @@
@implementation VLCPlaylist @implementation VLCPlaylist
- (id)init
{
self = [super init];
if (self) {
/* This uses a private API, but works fine on all current OSX releases.
* Radar ID 11739459 request a public API for this. However, it is probably
* easier and faster to recreate similar looking bitmaps ourselves. */
_ascendingSortingImage = [[NSOutlineView class] _defaultTableHeaderSortImage];
_descendingSortingImage = [[NSOutlineView class] _defaultTableHeaderReverseSortImage];
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: nil];
}
return self;
}
+ (void)initialize + (void)initialize
{ {
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
...@@ -126,23 +141,8 @@ ...@@ -126,23 +141,8 @@
- (void)awakeFromNib - (void)awakeFromNib
{ {
if (b_view_setup) // This is only called for the playlist popup menu
return;
[self reloadStyles];
[self initStrings]; [self initStrings];
/* This uses a private API, but works fine on all current OSX releases.
* Radar ID 11739459 request a public API for this. However, it is probably
* easier and faster to recreate similar looking bitmaps ourselves. */
_ascendingSortingImage = [[NSOutlineView class] _defaultTableHeaderSortImage];
_descendingSortingImage = [[NSOutlineView class] _defaultTableHeaderReverseSortImage];
_sortTableColumn = nil;
[[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(applicationWillTerminate:) name: NSApplicationWillTerminateNotification object: nil];
b_view_setup = YES;
} }
- (void)setOutlineView:(VLCPlaylistView * __nullable)outlineView - (void)setOutlineView:(VLCPlaylistView * __nullable)outlineView
...@@ -162,6 +162,8 @@ ...@@ -162,6 +162,8 @@
[_outlineView setAllowsEmptySelection: NO]; [_outlineView setAllowsEmptySelection: NO];
[_outlineView registerForDraggedTypes: [NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]]; [_outlineView registerForDraggedTypes: [NSArray arrayWithObjects:NSFilenamesPboardType, @"VLCPlaylistItemPboardType", nil]];
[_outlineView setIntercellSpacing: NSMakeSize (0.0, 1.0)]; [_outlineView setIntercellSpacing: NSMakeSize (0.0, 1.0)];
[self reloadStyles];
} }
- (void)setPlaylistHeaderView:(NSTableHeaderView * __nullable)playlistHeaderView - (void)setPlaylistHeaderView:(NSTableHeaderView * __nullable)playlistHeaderView
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment