From: Benjamin Pracht Date: Tue, 30 Nov 2004 00:04:45 +0000 (+0000) Subject: * recrate some missing actions (mainly copy paste from the old playlist) X-Git-Tag: 0.8.2~1577 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=b2b37ee9d53d07461871005666fa7ea82e8e7223;p=vlc * recrate some missing actions (mainly copy paste from the old playlist) * Link some actions and outlets in IB * some small visual fixes --- diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib index fb3e98a80b..23646ce864 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/classes.nib @@ -402,12 +402,17 @@ SUPERCLASS = NSObject; }, { + ACTIONS = {handlePopUp = id; }; CLASS = VLCPlaylist; LANGUAGE = ObjC; OUTLETS = { "o_btn_playlist" = id; + "o_loop_popup" = id; + "o_mi_save_playlist" = id; "o_outline_view" = id; + "o_random_ckb" = id; "o_search_field" = id; + "o_search_keyword" = id; "o_status_field" = id; "o_tc_author" = id; "o_tc_duration" = id; diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib index 3e3fc961f5..a715693b69 100644 --- a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib +++ b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/info.nib @@ -3,15 +3,15 @@ IBDocumentLocation - 852 421 505 517 0 0 1280 938 + 23 -174 505 517 0 0 1024 746 IBEditorPositions 1617 542 480 104 149 0 0 1024 746 2197 - 150 134 596 368 0 0 1280 938 + 259 330 596 367 0 0 1024 746 29 - 58 849 419 44 0 0 1280 938 + 84 667 419 44 0 0 1024 746 915 54 452 185 199 0 0 1024 746 @@ -20,15 +20,15 @@ IBLockedObjects 1789 - 2199 - 2206 - 2208 - 2202 2203 + 2208 + 2206 + 2199 IBOpenObjects 21 + 29 2197 IBSystem Version diff --git a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib index 38048351c6..a7b4cd623a 100644 Binary files a/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib and b/extras/MacOSX/Resources/English.lproj/MainMenu.nib/objects.nib differ diff --git a/modules/gui/macosx/playlist.h b/modules/gui/macosx/playlist.h index 9e8cc4b41d..cfef7b42d7 100644 --- a/modules/gui/macosx/playlist.h +++ b/modules/gui/macosx/playlist.h @@ -43,16 +43,22 @@ IBOutlet id o_tc_duration; IBOutlet id o_status_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_ascendingSortingImage; } +- (IBAction)handlePopUp:(id)sender; + - (void)initStrings; - (void)playlistUpdated; - (void)playItem:(id)sender; - (void)appendArray:(NSArray*)o_array atPos:(int)i_position enqueue:(BOOL)b_enqueue; + @end diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m index 76b9e7f235..9ef3f4dec2 100644 --- a/modules/gui/macosx/playlist.m +++ b/modules/gui/macosx/playlist.m @@ -179,8 +179,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ - (void)initStrings { -#if 0 [o_mi_save_playlist setTitle: _NS("Save Playlist...")]; +#if 0 [o_mi_play setTitle: _NS("Play")]; [o_mi_delete setTitle: _NS("Delete")]; [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*/ [[o_tc_name headerCell] setStringValue:_NS("Name")]; [[o_tc_author headerCell] setStringValue:_NS("Author")]; [[o_tc_duration headerCell] setStringValue:_NS("Duration")]; -#if 0 [o_random_ckb setTitle: _NS("Random")]; +#if 0 [o_search_button setTitle: _NS("Search")]; #endif [o_btn_playlist setToolTip: _NS("Playlist")]; -#if 0 [[o_loop_popup itemAtIndex:0] setTitle: _NS("Standard Play")]; [[o_loop_popup itemAtIndex:1] setTitle: _NS("Repeat One")]; [[o_loop_popup itemAtIndex:2] setTitle: _NS("Repeat All")]; -#endif } - (void)playlistUpdated @@ -319,6 +317,53 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ 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 @implementation VLCPlaylist (NSOutlineViewDataSource) @@ -349,6 +394,8 @@ belongs to an Apple hidden private API, and then can "disapear" at any time*/ vlc_object_release( p_playlist ); if( i_return == -1 ) i_return = 0; 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; }