]> git.sesse.net Git - vlc/commitdiff
* Away with that annoying playlist drawer. We now have a nice resizable
authorDerk-Jan Hartman <hartman@videolan.org>
Wed, 12 Nov 2003 01:22:40 +0000 (01:22 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Wed, 12 Nov 2003 01:22:40 +0000 (01:22 +0000)
  window, with additional index and author columns.

extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib
extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib
modules/gui/macosx/playlist.h
modules/gui/macosx/playlist.m

index 2890dd74937818733d7ce969bc34a1cc0fa02caf..8d98ec90009f19dcaecc6aa09f29b3fe9556a07d 100644 (file)
             SUPERCLASS = NSObject; 
         }, 
         {
-            ACTIONS = {deleteItems = id; playItem = id; savePlaylist = id; selectAll = id; }; 
+            ACTIONS = {
+                deleteItems = id; 
+                playItem = id; 
+                savePlaylist = id; 
+                selectAll = id; 
+                toggleWindow = id; 
+            }; 
             CLASS = VLCPlaylist; 
             LANGUAGE = ObjC; 
             OUTLETS = {
-                "o_btn_add" = id; 
-                "o_btn_remove" = id; 
                 "o_ctx_menu" = id; 
                 "o_mi_delete" = id; 
                 "o_mi_play" = id; 
                 "o_mi_save_playlist" = id; 
                 "o_mi_selectall" = id; 
+                "o_status_field" = id; 
                 "o_table_view" = id; 
+                "o_tc_author" = id; 
+                "o_tc_name" = id; 
+                "o_window" = id; 
             }; 
             SUPERCLASS = NSObject; 
         }, 
index da681ed05f0f4de2306214f989b8b947405b44f8..e5b1101ac500c9125ae3a01294f4ccff40b7ce12 100644 (file)
@@ -10,8 +10,6 @@
                <string>691 686 104 149 0 0 1280 1002 </string>
                <key>29</key>
                <string>165 930 419 44 0 0 1280 1002 </string>
-               <key>909</key>
-               <string>72 297 430 172 0 0 1152 746 </string>
                <key>915</key>
                <string>439 657 93 99 0 0 1280 1002 </string>
        </dict>
@@ -24,8 +22,9 @@
        <key>IBOpenObjects</key>
        <array>
                <integer>21</integer>
+               <integer>1647</integer>
        </array>
        <key>IBSystem Version</key>
-       <string>7B85</string>
+       <string>7C107</string>
 </dict>
 </plist>
index a295bf21d7217f24726dd9dd99589fbdf86eed4f..edae4e560c3d64838c68d4e7fae4bde7f1f6c18f 100644 (file)
Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ
index 7046bd4f3a1a95d8f25e731eea2cadcf8cf7bd4a..c6c1290648bda35affae1c679c85dea5a2a11ffc 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.h: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: playlist.h,v 1.11 2003/09/22 03:40:05 hartman Exp $
+ * $Id: playlist.h,v 1.12 2003/11/12 01:22:40 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
@@ -27,7 +27,6 @@
  *****************************************************************************/
 @interface VLCPlaylistView : NSTableView
 {
-    NSColor *o_striped_row_color;
 }
 
 @end
 @interface VLCPlaylist : NSObject
 {
     int i_moveRow;
-        
+    
+    IBOutlet id o_window;
     IBOutlet id o_table_view;
+    
+    IBOutlet id o_status_field;
+    IBOutlet id o_tc_name;
+    IBOutlet id o_tc_author;
 
     IBOutlet id o_ctx_menu;
-
     IBOutlet id o_mi_save_playlist;
     IBOutlet id o_mi_play;
     IBOutlet id o_mi_delete;
     IBOutlet id o_mi_selectall;
-    
-    IBOutlet id o_btn_add;
-    IBOutlet id o_btn_remove;
 }
 
 - (NSMenu *)menuForEvent:(NSEvent *)o_event;
 
+- (IBAction)toggleWindow:(id)sender;
 - (IBAction)savePlaylist:(id)sender;
 - (IBAction)playItem:(id)sender;
 - (IBAction)deleteItems:(id)sender;
index 04536cead015a1359327c628182f363c97567d73..261227f7b69cc8abcd397cdabcd94f12648583b6 100644 (file)
@@ -2,7 +2,7 @@
  * playlist.m: MacOS X interface plugin
  *****************************************************************************
  * Copyright (C) 2002-2003 VideoLAN
- * $Id: playlist.m,v 1.35 2003/11/06 16:28:28 hartman Exp $
+ * $Id: playlist.m,v 1.36 2003/11/12 01:22:40 hartman Exp $
  *
  * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
  *          Derk-Jan Hartman <thedj@users.sourceforge.net>
 #include "playlist.h"
 #include "controls.h"
 
-int MacVersion102 = -1;
-
 /*****************************************************************************
  * VLCPlaylistView implementation 
  *****************************************************************************/
 @implementation VLCPlaylistView
 
-- (void)dealloc
-{
-    if( o_striped_row_color != nil )
-    {
-        [o_striped_row_color release];
-    }
-    [super dealloc];
-}
-
 - (NSMenu *)menuForEvent:(NSEvent *)o_event
 {
     return( [[self delegate] menuForEvent: o_event] );
@@ -114,48 +103,6 @@ int MacVersion102 = -1;
     }
 }
 
-- (void)highlightSelectionInClipRect:(NSRect)o_rect {
-    NSRect o_new_rect;
-    float f_height = [self rowHeight] + [self intercellSpacing].height;
-    float f_origin_y = NSMaxY( o_rect );
-    int i_row = o_rect.origin.y / f_height;
-    
-    if ( i_row % 2 == 0 )
-    {
-        i_row++;
-    }
-    
-    o_new_rect.size.width = o_rect.size.width;
-    o_new_rect.size.height = f_height;
-    o_new_rect.origin.x = o_rect.origin.x;
-    o_new_rect.origin.y = i_row * f_height;
-   
-    if( ( MacVersion102 < 0 ) && ( floor( NSAppKitVersionNumber ) > NSAppKitVersionNumber10_1 ) )
-    {
-        MacVersion102 = 102;
-    }
-    if ( MacVersion102 == 102 && o_striped_row_color == nil )
-    {
-        o_striped_row_color = [[[NSColor alternateSelectedControlColor]
-                                highlightWithLevel: 0.90] retain];
-        
-    }
-    else if ( o_striped_row_color == nil )
-    {
-        /* OSX 10.1 and before ain't that smart ;) */
-        o_striped_row_color = [[NSColor whiteColor] retain];
-    }
-
-    [o_striped_row_color set];
-    
-    while ( o_new_rect.origin.y < f_origin_y ) {
-        NSRectFill( o_new_rect );
-        o_new_rect.origin.y += f_height * 2.0;
-    }
-    [super highlightSelectionInClipRect:o_rect];
-}
-
 @end
 
 /*****************************************************************************
@@ -184,13 +131,13 @@ int MacVersion102 = -1;
     [o_table_view registerForDraggedTypes: 
         [NSArray arrayWithObjects: NSFilenamesPboardType, nil]];
 
+    [o_window setTitle: _NS("Playlist")];
     [o_mi_save_playlist setTitle: _NS("Save Playlist...")];
     [o_mi_play setTitle: _NS("Play")];
     [o_mi_delete setTitle: _NS("Delete")];
     [o_mi_selectall setTitle: _NS("Select All")];
-    
-    [o_btn_add setToolTip: _NS("Add")];
-    [o_btn_remove setToolTip: _NS("Delete")];
+    [[o_tc_name headerCell] setStringValue:_NS("Name")];
+    [[o_tc_author headerCell] setStringValue:_NS("Author")];
 }
 
 - (BOOL)tableView:(NSTableView *)o_tv 
@@ -219,6 +166,18 @@ int MacVersion102 = -1;
     return( o_ctx_menu );
 }
 
+- (IBAction)toggleWindow:(id)sender
+{
+    if( [o_window isVisible] )
+    {
+        [o_window orderOut:sender];
+    }
+    else
+    {
+        [o_window makeKeyAndOrderFront:sender];
+    }
+}
+
 - (IBAction)savePlaylist:(id)sender
 {
     intf_thread_t * p_intf = [NSApp getIntf];
@@ -429,7 +388,7 @@ int MacVersion102 = -1;
         vlc_mutex_unlock( &p_playlist->object_lock );
         vlc_object_release( p_playlist );
     }
-
+    [o_status_field setStringValue: [NSString stringWithFormat:_NS("%i items in playlist"), i_count]];
     return( i_count );
 }
 
@@ -447,10 +406,24 @@ int MacVersion102 = -1;
         return( nil );
     }
 
-    vlc_mutex_lock( &p_playlist->object_lock );
-    o_value = [[NSString stringWithUTF8String: 
-        p_playlist->pp_items[i_row]->psz_name] lastPathComponent]; 
-    vlc_mutex_unlock( &p_playlist->object_lock ); 
+    if( [[o_tc identifier] isEqualToString:@"0"] )
+    {
+        o_value = [NSString stringWithFormat:@"%i", i_row + 1];
+    }
+    else if( [[o_tc identifier] isEqualToString:@"1"] )
+    {
+        vlc_mutex_lock( &p_playlist->object_lock );
+        o_value = [[NSString stringWithUTF8String: 
+            p_playlist->pp_items[i_row]->psz_name] lastPathComponent]; 
+        vlc_mutex_unlock( &p_playlist->object_lock );
+    }
+    else if( [[o_tc identifier] isEqualToString:@"2"] )
+    {
+        vlc_mutex_lock( &p_playlist->object_lock );
+        o_value = [NSString stringWithUTF8String: 
+            p_playlist->pp_items[i_row]->psz_author]; 
+        vlc_mutex_unlock( &p_playlist->object_lock );
+    }
 
     vlc_object_release( p_playlist );