Commit b2b37ee9 authored by Benjamin Pracht's avatar Benjamin Pracht

* recrate some missing actions (mainly copy paste from the old playlist)

* Link some actions and outlets in IB
* some small visual fixes
parent 966d7c6c
...@@ -402,12 +402,17 @@ ...@@ -402,12 +402,17 @@
SUPERCLASS = NSObject; SUPERCLASS = NSObject;
}, },
{ {
ACTIONS = {handlePopUp = id; };
CLASS = VLCPlaylist; CLASS = VLCPlaylist;
LANGUAGE = ObjC; LANGUAGE = ObjC;
OUTLETS = { OUTLETS = {
"o_btn_playlist" = id; "o_btn_playlist" = id;
"o_loop_popup" = id;
"o_mi_save_playlist" = id;
"o_outline_view" = id; "o_outline_view" = id;
"o_random_ckb" = id;
"o_search_field" = id; "o_search_field" = id;
"o_search_keyword" = id;
"o_status_field" = id; "o_status_field" = id;
"o_tc_author" = id; "o_tc_author" = id;
"o_tc_duration" = id; "o_tc_duration" = id;
......
...@@ -3,15 +3,15 @@ ...@@ -3,15 +3,15 @@
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>IBDocumentLocation</key> <key>IBDocumentLocation</key>
<string>852 421 505 517 0 0 1280 938 </string> <string>23 -174 505 517 0 0 1024 746 </string>
<key>IBEditorPositions</key> <key>IBEditorPositions</key>
<dict> <dict>
<key>1617</key> <key>1617</key>
<string>542 480 104 149 0 0 1024 746 </string> <string>542 480 104 149 0 0 1024 746 </string>
<key>2197</key> <key>2197</key>
<string>150 134 596 368 0 0 1280 938 </string> <string>259 330 596 367 0 0 1024 746 </string>
<key>29</key> <key>29</key>
<string>58 849 419 44 0 0 1280 938 </string> <string>84 667 419 44 0 0 1024 746 </string>
<key>915</key> <key>915</key>
<string>54 452 185 199 0 0 1024 746 </string> <string>54 452 185 199 0 0 1024 746 </string>
</dict> </dict>
...@@ -20,15 +20,15 @@ ...@@ -20,15 +20,15 @@
<key>IBLockedObjects</key> <key>IBLockedObjects</key>
<array> <array>
<integer>1789</integer> <integer>1789</integer>
<integer>2199</integer>
<integer>2206</integer>
<integer>2208</integer>
<integer>2202</integer>
<integer>2203</integer> <integer>2203</integer>
<integer>2208</integer>
<integer>2206</integer>
<integer>2199</integer>
</array> </array>
<key>IBOpenObjects</key> <key>IBOpenObjects</key>
<array> <array>
<integer>21</integer> <integer>21</integer>
<integer>29</integer>
<integer>2197</integer> <integer>2197</integer>
</array> </array>
<key>IBSystem Version</key> <key>IBSystem Version</key>
......
...@@ -43,16 +43,22 @@ ...@@ -43,16 +43,22 @@
IBOutlet id o_tc_duration; IBOutlet id o_tc_duration;
IBOutlet id o_status_field; IBOutlet id o_status_field;
IBOutlet id o_search_field; IBOutlet id o_search_field;
IBOutlet id o_random_ckb;
IBOutlet id o_loop_popup;
IBOutlet id o_mi_save_playlist;
NSImage *o_descendingSortingImage; NSImage *o_descendingSortingImage;
NSImage *o_ascendingSortingImage; NSImage *o_ascendingSortingImage;
} }
- (IBAction)handlePopUp:(id)sender;
- (void)initStrings; - (void)initStrings;
- (void)playlistUpdated; - (void)playlistUpdated;
- (void)playItem:(id)sender; - (void)playItem:(id)sender;
- (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue; - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue;
@end @end
...@@ -179,8 +179,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -179,8 +179,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
- (void)initStrings - (void)initStrings
{ {
#if 0
[o_mi_save_playlist setTitle: _NS("Save Playlist...")]; [o_mi_save_playlist setTitle: _NS("Save Playlist...")];
#if 0
[o_mi_play setTitle: _NS("Play")]; [o_mi_play setTitle: _NS("Play")];
[o_mi_delete setTitle: _NS("Delete")]; [o_mi_delete setTitle: _NS("Delete")];
[o_mi_selectall setTitle: _NS("Select All")]; [o_mi_selectall setTitle: _NS("Select All")];
...@@ -192,16 +192,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -192,16 +192,14 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
[[o_tc_name headerCell] setStringValue:_NS("Name")]; [[o_tc_name headerCell] setStringValue:_NS("Name")];
[[o_tc_author headerCell] setStringValue:_NS("Author")]; [[o_tc_author headerCell] setStringValue:_NS("Author")];
[[o_tc_duration headerCell] setStringValue:_NS("Duration")]; [[o_tc_duration headerCell] setStringValue:_NS("Duration")];
#if 0
[o_random_ckb setTitle: _NS("Random")]; [o_random_ckb setTitle: _NS("Random")];
#if 0
[o_search_button setTitle: _NS("Search")]; [o_search_button setTitle: _NS("Search")];
#endif #endif
[o_btn_playlist setToolTip: _NS("Playlist")]; [o_btn_playlist setToolTip: _NS("Playlist")];
#if 0
[[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")]; [[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")];
[[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")]; [[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")];
[[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")]; [[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")];
#endif
} }
- (void)playlistUpdated - (void)playlistUpdated
...@@ -319,6 +317,53 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -319,6 +317,53 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
} }
- (IBAction)handlePopUp:(id)sender
{
intf_thread_t * p_intf = VLCIntf;
vlc_value_t val1,val2;
playlist_t * p_playlist = vlc_object_find( p_intf, VLC_OBJECT_PLAYLIST,
FIND_ANYWHERE );
if( p_playlist == NULL )
{
return;
}
switch ([o_loop_popup indexOfSelectedItem])
{
case 1:
val1.b_bool = 0;
var_Set( p_playlist, "loop", val1 );
val1.b_bool = 1;
var_Set( p_playlist, "repeat", val1 );
vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat One" ) );
break;
case 2:
val1.b_bool = 0;
var_Set( p_playlist, "repeat", val1 );
val1.b_bool = 1;
var_Set( p_playlist, "loop", val1 );
vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat All" ) );
break;
default:
var_Get( p_playlist, "repeat", &val1 );
var_Get( p_playlist, "loop", &val2 );
if (val1.b_bool || val2.b_bool)
{
val1.b_bool = 0;
var_Set( p_playlist, "repeat", val1 );
var_Set( p_playlist, "loop", val1 );
vout_OSDMessage( p_intf, DEFAULT_CHAN, _( "Repeat Off" ) );
}
break;
}
vlc_object_release( p_playlist );
[self playlistUpdated];
}
@end @end
@implementation VLCPlaylist (NSOutlineViewDataSource) @implementation VLCPlaylist (NSOutlineViewDataSource)
...@@ -349,6 +394,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ ...@@ -349,6 +394,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/
vlc_object_release( p_playlist ); vlc_object_release( p_playlist );
if( i_return == -1 ) i_return = 0; if( i_return == -1 ) i_return = 0;
msg_Dbg( p_playlist, "I have %d children", i_return ); msg_Dbg( p_playlist, "I have %d children", i_return );
[o_status_field setStringValue: [NSString stringWithFormat:
_NS("%i items in playlist"), i_return]];
return i_return; return i_return;
} }
......
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