]> git.sesse.net Git - vlc/commitdiff
macosx: use input changed event to update bookmarks dialog
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Wed, 30 Jul 2014 10:14:51 +0000 (12:14 +0200)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Wed, 30 Jul 2014 10:30:49 +0000 (12:30 +0200)
This allows lazy loading of the bookmarks window.

modules/gui/macosx/bookmarks.h
modules/gui/macosx/bookmarks.m
modules/gui/macosx/intf.m

index dedba7eeced075ff1c3dc232b5594132524b9f1f..809c112bf913356571398e576efad8faaa8f4d54 100644 (file)
@@ -64,6 +64,5 @@
 - (IBAction)edit_ok:(id)sender;
 
 - (void)showBookmarks;
-- (void)refresh;
 - (id)dataTable;
 @end
index adb1b6ae6e1bc5d367c713556a2fd3426f937fdb..0115db1207c2baad49ca9dce9e84daba43952436 100644 (file)
@@ -71,6 +71,11 @@ static VLCBookmarks *_o_sharedInstance = nil;
         [o_bookmarks_window setCollectionBehavior: NSWindowCollectionBehaviorFullScreenAuxiliary];
 
     [self initStrings];
+
+    [[NSNotificationCenter defaultCenter] addObserver:self
+                                             selector:@selector(inputChangedEvent:)
+                                                 name:VLCInputChangedNotification
+                                               object:nil];
 }
 
 - (void)dealloc
@@ -78,6 +83,8 @@ static VLCBookmarks *_o_sharedInstance = nil;
     if (p_old_input)
         vlc_object_release(p_old_input);
 
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
     [super dealloc];
 }
 
@@ -121,7 +128,7 @@ static VLCBookmarks *_o_sharedInstance = nil;
     [o_bookmarks_window makeKeyAndOrderFront:nil];
 }
 
-- (void)refresh
+-(void)inputChangedEvent:(NSNotification *)o_notification
 {
     [o_tbl_dataTable reloadData];
 }
index d35be88302f846092b8a063a6af3fb2f27065588..a93157333f3605e78789b7e2f0c2f231386efe6b 100644 (file)
@@ -1303,7 +1303,6 @@ static bool f_appExit = false;
     [o_mainwindow updateWindow];
     [self updateDelays];
     [self updateMainMenu];
-    [[self bookmarks] refresh];
     [self playlistUpdated];
 
     /*