]> git.sesse.net Git - vlc/commitdiff
macosx: correctly toggle enabled state of record menu item
authorDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 29 Nov 2014 11:51:33 +0000 (12:51 +0100)
committerDavid Fuhrmann <dfuhrmann@videolan.org>
Sat, 29 Nov 2014 11:52:03 +0000 (12:52 +0100)
modules/gui/macosx/MainMenu.m

index 0927d6ad9dd594c74c2b003f3d3d48bab83ffc8a..ffe784eb9e2d798a272046c321f5e3cf32554475 100644 (file)
@@ -576,8 +576,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
     playlist_t * p_playlist = pl_Get(p_intf);
     input_thread_t * p_input = playlist_CurrentInput(p_playlist);
     if (p_input != NULL) {
-        [o_mi_record setEnabled: var_GetBool(p_input, "can-record")];
-
         [self setupVarMenuItem: o_mi_program target: (vlc_object_t *)p_input
                                  var: "program" selector: @selector(toggleVar:)];
 
@@ -628,7 +626,6 @@ static VLCMainMenu *_o_sharedInstance = nil;
         [o_mi_ffmpeg_pp setEnabled:YES];
         vlc_object_release(p_input);
     } else {
-        [o_mi_record setEnabled: NO];
         [o_mi_ffmpeg_pp setEnabled:NO];
     }
 }
@@ -1534,6 +1531,10 @@ static VLCMainMenu *_o_sharedInstance = nil;
         if (!p_input)
             bEnabled = FALSE;
         [self setupMenus]; /* Make sure input menu is up to date */
+    } else if ([o_title isEqualToString: _NS("Record")]) {
+        bEnabled = FALSE;
+        if (p_input)
+            bEnabled = var_GetBool(p_input, "can-record");
     } else if ([o_title isEqualToString: _NS("Previous")] ||
             [o_title isEqualToString: _NS("Next")]) {
         PL_LOCK;