Commit 2dbc6647 authored by David Fuhrmann's avatar David Fuhrmann

macosx: fix and cleanup quit-after-playback main menu item

close #6073
parent f36dcf5a
......@@ -12,10 +12,10 @@
</object>
<object class="NSMutableArray" key="IBDocument.EditedObjectIDs">
<bool key="EncodedWithXMLCoder">YES</bool>
<integer value="5132"/>
<integer value="2730"/>
<integer value="24"/>
<integer value="5547"/>
<integer value="2461"/>
<integer value="5547"/>
</object>
<object class="NSArray" key="IBDocument.PluginDependencies">
<bool key="EncodedWithXMLCoder">YES</bool>
......@@ -3652,14 +3652,6 @@
</object>
<int key="connectionID">5098</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">quitAfterPlayback:</string>
<reference key="source" ref="113811151"/>
<reference key="destination" ref="872694174"/>
</object>
<int key="connectionID">5172</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">next:</string>
......@@ -4464,6 +4456,14 @@
</object>
<int key="connectionID">5611</int>
</object>
<object class="IBConnectionRecord">
<object class="IBActionConnection" key="connection">
<string key="label">quitAfterPlayback:</string>
<reference key="source" ref="651263286"/>
<reference key="destination" ref="872694174"/>
</object>
<int key="connectionID">5612</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
......@@ -7010,7 +7010,7 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>{{592, 420}, {222, 383}}</string>
<string>{{567, 353}, {222, 383}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
......@@ -7181,7 +7181,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">5611</int>
<int key="maxID">5612</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
......@@ -7259,7 +7259,6 @@
<string>next:</string>
<string>play:</string>
<string>prev:</string>
<string>quitAfterPlayback:</string>
<string>random:</string>
<string>repeat:</string>
<string>showPosition:</string>
......@@ -7286,7 +7285,6 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
......@@ -7302,7 +7300,6 @@
<string>next:</string>
<string>play:</string>
<string>prev:</string>
<string>quitAfterPlayback:</string>
<string>random:</string>
<string>repeat:</string>
<string>showPosition:</string>
......@@ -7349,10 +7346,6 @@
<string key="name">prev:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">quitAfterPlayback:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">random:</string>
<string key="candidateClassName">id</string>
......@@ -7766,6 +7759,7 @@
<string>openForum:</string>
<string>openReadMe:</string>
<string>openWebsite:</string>
<string>quitAfterPlayback:</string>
<string>resizeVideoWindow:</string>
<string>savePlaylist:</string>
<string>setPlaybackRate:</string>
......@@ -7848,6 +7842,7 @@
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="NSMutableDictionary" key="actionInfosByName">
......@@ -7867,6 +7862,7 @@
<string>openForum:</string>
<string>openReadMe:</string>
<string>openWebsite:</string>
<string>quitAfterPlayback:</string>
<string>resizeVideoWindow:</string>
<string>savePlaylist:</string>
<string>setPlaybackRate:</string>
......@@ -7955,6 +7951,10 @@
<string key="name">openWebsite:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">quitAfterPlayback:</string>
<string key="candidateClassName">id</string>
</object>
<object class="IBActionInfo">
<string key="name">resizeVideoWindow:</string>
<string key="candidateClassName">id</string>
......
......@@ -252,6 +252,7 @@
- (void)setPlaylistColumnTableState:(NSInteger)i_state forColumn:(NSString *)o_column;
- (NSMenu *)setupPlaylistTableColumnsMenu;
- (IBAction)quitAfterPlayback:(id)sender;
- (IBAction)toggleRecord:(id)sender;
- (void)updateRecordState:(BOOL)b_value;
- (IBAction)setPlaybackRate:(id)sender;
......
......@@ -756,6 +756,15 @@ static VLCMainMenu *_o_sharedInstance = nil;
#pragma mark -
#pragma mark Playback
- (IBAction)quitAfterPlayback:(id)sender
{
playlist_t *p_playlist = pl_Get(VLCIntf);
bool b_value = !var_CreateGetBool(p_playlist, "play-and-exit");
var_SetBool(p_playlist, "play-and-exit", b_value);
config_PutInt(p_intf, "play-and-exit", b_value);
}
- (IBAction)toggleRecord:(id)sender
{
[[VLCCoreInteraction sharedInstance] toggleRecord];
......@@ -1502,8 +1511,8 @@ static VLCMainMenu *_o_sharedInstance = nil;
[o_mi setState: i_state];
} else if ([o_title isEqualToString: _NS("Quit after Playback")]) {
int i_state;
var_Get(p_playlist, "play-and-exit", &val);
i_state = val.b_bool ? NSOnState : NSOffState;
bool b_value = var_InheritBool(p_playlist, "play-and-exit");
i_state = b_value ? NSOnState : NSOffState;
[o_mi setState: i_state];
} else if ([o_title isEqualToString: _NS("Step Forward")] ||
[o_title isEqualToString: _NS("Step Backward")] ||
......
......@@ -50,7 +50,6 @@
- (IBAction)random:(id)sender;
- (IBAction)repeat:(id)sender;
- (IBAction)loop:(id)sender;
- (IBAction)quitAfterPlayback:(id)sender;
- (IBAction)forward:(id)sender;
- (IBAction)backward:(id)sender;
......
......@@ -117,13 +117,6 @@
[[VLCCoreInteraction sharedInstance] repeatOff];
}
- (IBAction)quitAfterPlayback:(id)sender
{
vlc_value_t val;
playlist_t * p_playlist = pl_Get(VLCIntf);
var_ToggleBool(p_playlist, "play-and-exit");
}
- (IBAction)forward:(id)sender
{
[[VLCCoreInteraction sharedInstance] forward];
......
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