Commit ee503a8f authored by David Fuhrmann's avatar David Fuhrmann

macosx: use input changed event to update bookmarks dialog

This allows lazy loading of the bookmarks window.
parent 84d73bcd
...@@ -64,6 +64,5 @@ ...@@ -64,6 +64,5 @@
- (IBAction)edit_ok:(id)sender; - (IBAction)edit_ok:(id)sender;
- (void)showBookmarks; - (void)showBookmarks;
- (void)refresh;
- (id)dataTable; - (id)dataTable;
@end @end
...@@ -71,6 +71,11 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -71,6 +71,11 @@ static VLCBookmarks *_o_sharedInstance = nil;
[o_bookmarks_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary]; [o_bookmarks_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
[self initStrings]; [self initStrings];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(inputChangedEvent:)
name:VLCInputChangedNotification
object:nil];
} }
- (void)dealloc - (void)dealloc
...@@ -78,6 +83,8 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -78,6 +83,8 @@ static VLCBookmarks *_o_sharedInstance = nil;
if (p_old_input) if (p_old_input)
vlc_object_release(p_old_input); vlc_object_release(p_old_input);
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc]; [super dealloc];
} }
...@@ -121,7 +128,7 @@ static VLCBookmarks *_o_sharedInstance = nil; ...@@ -121,7 +128,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
[o_bookmarks_window makeKeyAndOrderFront:nil]; [o_bookmarks_window makeKeyAndOrderFront:nil];
} }
- (void)refresh -(void)inputChangedEvent:(NSNotification *)o_notification
{ {
[o_tbl_dataTable reloadData]; [o_tbl_dataTable reloadData];
} }
......
...@@ -1303,7 +1303,6 @@ static bool f_appExit = false; ...@@ -1303,7 +1303,6 @@ static bool f_appExit = false;
[o_mainwindow updateWindow]; [o_mainwindow updateWindow];
[self updateDelays]; [self updateDelays];
[self updateMainMenu]; [self updateMainMenu];
[[self bookmarks] refresh];
[self playlistUpdated]; [self playlistUpdated];
/* /*
......
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