]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/bookmarks.m
macosx: playlist: remove unused _other outlets
[vlc] / modules / gui / macosx / bookmarks.m
index a650e5aa8a1416fc33b0d96878e1f82d21c3d584..a322cdda2cc9a3066161b9cb55cb56f67d7555bd 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];
 }
 
@@ -117,10 +124,15 @@ static VLCBookmarks *_o_sharedInstance = nil;
 {
     /* show the window, called from intf.m */
     [o_bookmarks_window displayIfNeeded];
-    [o_bookmarks_window setLevel: [[[VLCMain sharedInstance] voutController] currentWindowLevel]];
+    [o_bookmarks_window setLevel: [[[VLCMain sharedInstance] voutController] currentStatusWindowLevel]];
     [o_bookmarks_window makeKeyAndOrderFront:nil];
 }
 
+-(void)inputChangedEvent:(NSNotification *)o_notification
+{
+    [o_tbl_dataTable reloadData];
+}
+
 - (IBAction)add:(id)sender
 {
     /* add item to list */
@@ -344,15 +356,6 @@ clear:
     [o_tbl_dataTable reloadData];
 }
 
-/*****************************************************************************
- * callback stuff
- *****************************************************************************/
-
--(id)dataTable
-{
-    return o_tbl_dataTable;
-}
-
 /*****************************************************************************
  * data source methods
  *****************************************************************************/
@@ -392,6 +395,8 @@ clear:
         return @"";
     else if (input_Control(p_input, INPUT_GET_BOOKMARKS, &pp_bookmarks, &i_bookmarks) != VLC_SUCCESS)
         ret = @"";
+    else if (row >= i_bookmarks)
+        ret = @"";
     else {
         NSString * identifier = [theTableColumn identifier];
         if ([identifier isEqualToString: @"description"])