From: Felix Paul Kühne Date: Fri, 31 Jul 2009 13:43:54 +0000 (+0200) Subject: macosx: implemented 'play-and-exit' (closes #2237) X-Git-Tag: 1.1.0-ff~4663 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=47318ef39515bdc734bff5b68fb3124986ae58ed;p=vlc macosx: implemented 'play-and-exit' (closes #2237) Should be backported. --- diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib index 23536c7937..c07a401f5c 100644 --- a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib +++ b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/designable.nib @@ -8,11 +8,11 @@ 353.00 YES - - + + YES @@ -842,6 +842,16 @@ + + + YES + YES + + + 2147483647 + + + Repeat Item @@ -860,6 +870,24 @@ + + + Quit after Playback + + 2147483647 + + + + + + YES + YES + + + 2147483647 + + + Add Folder to Playlist... @@ -9146,6 +9174,22 @@ LCAuLi4 4535 + + + quitAfterPlayback: + + + + 4538 + + + + o_mi_quitAfterPB + + + + 4539 + @@ -9726,6 +9770,9 @@ LCAuLi4 + + + @@ -12689,6 +12736,21 @@ LCAuLi4 Sparkle Updater + + 4536 + + + + + 4537 + + + + + 4540 + + + @@ -13197,6 +13259,7 @@ LCAuLi4 3292.ImportedFromIB2 333.IBPluginDependency 333.ImportedFromIB2 + 334.IBEditorWindowLastContentRect 334.IBPluginDependency 334.ImportedFromIB2 3385.IBPluginDependency @@ -13560,6 +13623,9 @@ LCAuLi4 446.IBPluginDependency 446.ImportedFromIB2 4533.IBPluginDependency + 4536.IBPluginDependency + 4537.IBPluginDependency + 4540.IBPluginDependency 5.IBPluginDependency 5.ImportedFromIB2 56.IBPluginDependency @@ -13628,7 +13694,7 @@ LCAuLi4 com.apple.InterfaceBuilder.CocoaPlugin - {{291, 259}, {200, 173}} + {{564, 509}, {200, 173}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -13944,7 +14010,7 @@ LCAuLi4 com.apple.InterfaceBuilder.CocoaPlugin - {{214, 79}, {255, 353}} + {{358, 293}, {255, 393}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -14104,13 +14170,14 @@ LCAuLi4 com.apple.InterfaceBuilder.CocoaPlugin - {{343, 682}, {468, 20}} + {{214, 686}, {468, 20}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + {{493, 343}, {198, 343}} com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -14475,6 +14542,9 @@ LCAuLi4 com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -14542,7 +14612,7 @@ LCAuLi4 - 4535 + 4540 @@ -14760,6 +14830,7 @@ LCAuLi4 next: play: prev: + quitAfterPlayback: random: repeat: repeatButtonAction: @@ -14802,6 +14873,7 @@ LCAuLi4 id id id + id @@ -15253,6 +15325,7 @@ LCAuLi4 o_mi_previous o_mi_program o_mi_quit + o_mi_quitAfterPB o_mi_random o_mi_readme o_mi_repeat @@ -15452,6 +15525,7 @@ LCAuLi4 NSMenuItem NSMenuItem NSMenuItem + NSMenuItem NSButton NSWindow NSButton diff --git a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib index 019ad092c9..5190d2bf5f 100644 Binary files a/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib and b/extras/package/macosx/Resources/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/modules/gui/macosx/controls.h b/modules/gui/macosx/controls.h index 9b40fdc6ef..64ffa2a85a 100644 --- a/modules/gui/macosx/controls.h +++ b/modules/gui/macosx/controls.h @@ -73,6 +73,7 @@ - (IBAction)repeat:(id)sender; - (IBAction)loop:(id)sender; - (IBAction)repeatButtonAction:(id)sender; +- (IBAction)quitAfterPlayback:(id)sender; /* the three ugly helpers again */ - (void)repeatOne; diff --git a/modules/gui/macosx/controls.m b/modules/gui/macosx/controls.m index f517c1290f..3cf5c8dce5 100644 --- a/modules/gui/macosx/controls.m +++ b/modules/gui/macosx/controls.m @@ -379,6 +379,16 @@ pl_Release( p_intf ); } +- (IBAction)quitAfterPlayback:(id)sender +{ + vlc_value_t val; + playlist_t * p_playlist = pl_Hold( VLCIntf ); + var_Get( p_playlist, "play-and-exit", &val ); + val.b_bool = !val.b_bool; + var_Set( p_playlist, "play-and-exit", val ); + pl_Release( VLCIntf ); +} + - (IBAction)forward:(id)sender { intf_thread_t * p_intf = VLCIntf; @@ -1053,6 +1063,13 @@ i_state = val.b_bool ? NSOnState : NSOffState; [o_mi setState: i_state]; } + else if( [[o_mi title] isEqualToString: _NS("Quit after Playback")] ) + { + int i_state; + var_Get( p_playlist, "play-and-exit", &val ); + i_state = val.b_bool ? NSOnState : NSOffState; + [o_mi setState: i_state]; + } else if( [[o_mi title] isEqualToString: _NS("Step Forward")] || [[o_mi title] isEqualToString: _NS("Step Backward")] || [[o_mi title] isEqualToString: _NS("Jump To Time")]) diff --git a/modules/gui/macosx/intf.h b/modules/gui/macosx/intf.h index fb0afba44a..a8f33abbde 100644 --- a/modules/gui/macosx/intf.h +++ b/modules/gui/macosx/intf.h @@ -212,6 +212,7 @@ struct intf_sys_t IBOutlet NSMenuItem * o_mi_random; IBOutlet NSMenuItem * o_mi_repeat; IBOutlet NSMenuItem * o_mi_loop; + IBOutlet NSMenuItem * o_mi_quitAfterPB; IBOutlet NSMenuItem * o_mi_fwd; IBOutlet NSMenuItem * o_mi_bwd; IBOutlet NSMenuItem * o_mi_fwd1m; diff --git a/modules/gui/macosx/intf.m b/modules/gui/macosx/intf.m index 43604e83f4..1113e9e2b2 100644 --- a/modules/gui/macosx/intf.m +++ b/modules/gui/macosx/intf.m @@ -661,6 +661,7 @@ static VLCMain *_o_sharedMainInstance = nil; [o_mi_random setTitle: _NS("Random")]; [o_mi_repeat setTitle: _NS("Repeat One")]; [o_mi_loop setTitle: _NS("Repeat All")]; + [o_mi_quitAfterPB setTitle: _NS("Quit after Playback")]; [o_mi_fwd setTitle: _NS("Step Forward")]; [o_mi_bwd setTitle: _NS("Step Backward")];