]> git.sesse.net Git - vlc/commitdiff
* Fix the 'auto' selection of Console intf in "extra intfs" menu entry.
authorDerk-Jan Hartman <hartman@videolan.org>
Mon, 12 Apr 2004 21:01:41 +0000 (21:01 +0000)
committerDerk-Jan Hartman <hartman@videolan.org>
Mon, 12 Apr 2004 21:01:41 +0000 (21:01 +0000)
modules/gui/macosx/controls.m

index 05afc31f08a41c219e7311fcdbbb01c4b1ae858e..a368b01f523b8851ca00e4eb79eed0d8c448e53a 100644 (file)
         o_data = [[VLCMenuExt alloc] initWithVar: psz_variable Object: p_object->i_object_id
                 Value: val ofType: i_type];
         [o_mi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
-        [o_mi setState: val.b_bool ? TRUE : FALSE ];
+        if( !( i_type & VLC_VAR_ISCOMMAND ) )
+            [o_mi setState: val.b_bool ? TRUE : FALSE ];
         break;
 
     default:
 
         switch( i_type & VLC_VAR_TYPE )
         {
-        case VLC_VAR_VARIABLE:
-
-            /* This is causing crashes for the moment.
-            o_title = [NSApp localizedString: text_list.p_list->p_values[i].psz_string ?
-                text_list.p_list->p_values[i].psz_string : val_list.p_list->p_values[i].psz_string ];
-            
-            o_data = [[VLCMenuExt alloc] initWithVar: strdup(psz_variable) Object: p_object->i_object_id
-                Value: val ofType: i_type];
-            [o_lmi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
-
-            // Create a submenu
-            NSMenu *o_menu = [o_lmi submenu];
-
-            [self setupVarMenu: o_menu forMenuItem: o_lmi target:p_object
-                            var:psz_variable selector:pf_callback];
-*/
-            return;
-
         case VLC_VAR_STRING:
             another_val.psz_string =
                 strdup(val_list.p_list->p_values[i].psz_string);
             [o_lmi setRepresentedObject: [NSValue valueWithPointer:[o_data retain]]];
             [o_lmi setTarget: self];
             
-            if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) )
+            if( !strcmp( val.psz_string, val_list.p_list->p_values[i].psz_string ) && !( i_type & VLC_VAR_ISCOMMAND ) )
                 [o_lmi setState: TRUE ];
 
             break;
             [o_lmi setRepresentedObject: [NSValue valueWithPointer:[ o_data retain]]];
             [o_lmi setTarget: self];
 
-            if( val_list.p_list->p_values[i].i_int == val.i_int )
+            if( val_list.p_list->p_values[i].i_int == val.i_int && !( i_type & VLC_VAR_ISCOMMAND ) )
                 [o_lmi setState: TRUE ];
             break;