Commit fffdde54 authored by Benjamin Pracht's avatar Benjamin Pracht

- Use NSTextField instead of NSSearchfield for the playlist search, since it...

- Use NSTextField instead of NSSearchfield for the playlist search, since it is not supported on MacOS < X.3.

- Search now restarts at the beginning of the playlist when reaching the end.
parent 2a176d97
...@@ -339,6 +339,7 @@ ...@@ -339,6 +339,7 @@
"o_mi_selectall" = id; "o_mi_selectall" = id;
"o_random_ckb" = id; "o_random_ckb" = id;
"o_repeat_ckb" = id; "o_repeat_ckb" = id;
"o_search_button" = id;
"o_search_keyword" = id; "o_search_keyword" = id;
"o_status_field" = id; "o_status_field" = id;
"o_table_view" = id; "o_table_view" = id;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>31 168 505 541 0 0 1024 746 </string> <string>497 164 505 541 0 0 1024 746 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
...@@ -19,11 +19,10 @@ ...@@ -19,11 +19,10 @@
<array/> <array/>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>915</integer>
<integer>21</integer>
<integer>636</integer>
<integer>29</integer> <integer>29</integer>
<integer>1647</integer> <integer>1647</integer>
<integer>915</integer>
<integer>21</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
<string>7C107</string> <string>7C107</string>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.h: MacOS X interface plugin * playlist.h: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.h,v 1.14 2003/11/17 13:05:17 bigben Exp $ * $Id: playlist.h,v 1.15 2003/11/17 23:36:12 bigben Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
IBOutlet id o_repeat_ckb; IBOutlet id o_repeat_ckb;
IBOutlet id o_search_keyword; IBOutlet id o_search_keyword;
IBOutlet id o_search_button;
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
* playlist.m: MacOS X interface plugin * playlist.m: MacOS X interface plugin
***************************************************************************** *****************************************************************************
* Copyright (C) 2002-2003 VideoLAN * Copyright (C) 2002-2003 VideoLAN
* $Id: playlist.m,v 1.42 2003/11/17 19:05:03 hartman Exp $ * $Id: playlist.m,v 1.43 2003/11/17 23:36:12 bigben Exp $
* *
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net> * Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
* Derk-Jan Hartman <thedj@users.sourceforge.net> * Derk-Jan Hartman <thedj@users.sourceforge.net>
...@@ -144,6 +144,7 @@ ...@@ -144,6 +144,7 @@
[o_random_ckb setTitle: _NS("Random")]; [o_random_ckb setTitle: _NS("Random")];
[o_loop_ckb setTitle: _NS("Repeat All")]; [o_loop_ckb setTitle: _NS("Repeat All")];
[o_repeat_ckb setTitle: _NS("Repeat One")]; [o_repeat_ckb setTitle: _NS("Repeat One")];
[o_search_button setTitle: _NS("Search")];
vlc_value_t val; vlc_value_t val;
...@@ -163,8 +164,6 @@ ...@@ -163,8 +164,6 @@
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
} }
- (BOOL)tableView:(NSTableView *)o_tv - (BOOL)tableView:(NSTableView *)o_tv
...@@ -285,7 +284,7 @@ ...@@ -285,7 +284,7 @@
- (IBAction)searchItem:(id)sender - (IBAction)searchItem:(id)sender
{ {
int i_start, i_current; int i_current = 0, i_counter;
NSString *o_current_name; NSString *o_current_name;
NSString *o_current_author; NSString *o_current_author;
...@@ -298,16 +297,16 @@ ...@@ -298,16 +297,16 @@
return; return;
} }
if ( [o_table_view selectedRow] == [o_table_view numberOfRows]-1 ) if ([o_table_view selectedRow] == [o_table_view numberOfRows]-1 )
{ {
i_start = -1; i_current = 0;
} }
else else
{ {
i_start = [o_table_view selectedRow]; i_current = [o_table_view selectedRow]+1;
} }
for ( i_current = i_start + 1 ; i_current < [o_table_view numberOfRows] ; i_current++ ) for ( i_counter = 0 ; i_counter < [o_table_view numberOfRows] ; i_counter++ )
{ {
vlc_mutex_lock( &p_playlist->object_lock ); vlc_mutex_lock( &p_playlist->object_lock );
o_current_name = [NSString stringWithUTF8String: o_current_name = [NSString stringWithUTF8String:
...@@ -316,6 +315,7 @@ ...@@ -316,6 +315,7 @@
p_playlist->pp_items[i_current]->psz_author]; p_playlist->pp_items[i_current]->psz_author];
vlc_mutex_unlock( &p_playlist->object_lock ); vlc_mutex_unlock( &p_playlist->object_lock );
if( [o_current_name rangeOfString:[o_search_keyword stringValue] options:NSCaseInsensitiveSearch ].length || if( [o_current_name rangeOfString:[o_search_keyword stringValue] options:NSCaseInsensitiveSearch ].length ||
[o_current_author rangeOfString:[o_search_keyword stringValue] options:NSCaseInsensitiveSearch ].length ) [o_current_author rangeOfString:[o_search_keyword stringValue] options:NSCaseInsensitiveSearch ].length )
{ {
...@@ -323,8 +323,14 @@ ...@@ -323,8 +323,14 @@
[o_table_view scrollRowToVisible: i_current]; [o_table_view scrollRowToVisible: i_current];
break; break;
} }
[o_table_view selectRow: i_start byExtendingSelection: NO]; if ( i_current == [o_table_view numberOfRows] - 1 )
[o_table_view scrollRowToVisible: i_start]; {
i_current = 0;
}
else
{
i_current++;
}
} }
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
......
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