[vlc-commits] macosx: use input changed event to update bookmarks dialog

David Fuhrmann git at videolan.org
Wed Jul 30 12:31:00 CEST 2014


vlc | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Wed Jul 30 12:14:51 2014 +0200| [ee503a8ffe8acadaef0f9a3dbe28196778cc1aa7] | committer: David Fuhrmann

macosx: use input changed event to update bookmarks dialog

This allows lazy loading of the bookmarks window.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=ee503a8ffe8acadaef0f9a3dbe28196778cc1aa7
---

 modules/gui/macosx/bookmarks.h |    1 -
 modules/gui/macosx/bookmarks.m |    9 ++++++++-
 modules/gui/macosx/intf.m      |    1 -
 3 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/modules/gui/macosx/bookmarks.h b/modules/gui/macosx/bookmarks.h
index dedba7e..809c112 100644
--- a/modules/gui/macosx/bookmarks.h
+++ b/modules/gui/macosx/bookmarks.h
@@ -64,6 +64,5 @@
 - (IBAction)edit_ok:(id)sender;
 
 - (void)showBookmarks;
-- (void)refresh;
 - (id)dataTable;
 @end
diff --git a/modules/gui/macosx/bookmarks.m b/modules/gui/macosx/bookmarks.m
index adb1b6a..0115db1 100644
--- a/modules/gui/macosx/bookmarks.m
+++ b/modules/gui/macosx/bookmarks.m
@@ -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];
 }
diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m
index d35be88..a931573 100644
--- a/modules/gui/macosx/intf.m
+++ b/modules/gui/macosx/intf.m
@@ -1303,7 +1303,6 @@ static bool f_appExit = false;
     [o_mainwindow updateWindow];
     [self updateDelays];
     [self updateMainMenu];
-    [[self bookmarks] refresh];
     [self playlistUpdated];
 
     /*



More information about the vlc-commits mailing list