/*****************************************************************************
* prefs.m: MacOS X plugin for vlc
*****************************************************************************
- * Copyright (C) 2002 VideoLAN
- * $Id: prefs.m,v 1.15 2003/02/21 02:45:21 hartman Exp $
+ * Copyright (C) 2002-2003 VideoLAN
+ * $Id: prefs.m,v 1.17 2003/03/06 10:15:37 hartman Exp $
*
* Authors: Jon Lech Johansen <jon-vl@nanocrew.net>
*
[o_text_field setBordered: NO]; \
[o_text_field setEditable: NO]; \
[o_text_field setSelectable: NO]; \
- [o_text_field setStringValue: \
- [NSApp localizedString: label]]; \
+ if ( label ) \
+ { \
+ [o_text_field setStringValue: \
+ [NSApp localizedString: label]]; \
+ } \
[o_text_field sizeToFit]; \
[o_view addSubview: [o_text_field autorelease]]; \
}
if( p_item ) do
{
- if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ))
+ if( p_item->b_advanced && !config_GetInt( p_intf, "advanced" ) )
{
continue;
}
{
id o_vlc_control;
NSEnumerator *o_enum;
- BOOL b_advanced_change = FALSE;
+ BOOL b_adv_change = FALSE;
NSWindow *o_pref_panel = [[sender superview] window];
NSString *o_module_name = [[o_pref_panel toolbar] identifier];
psz_value = (char *)[o_value lossyCString];
config_PutPsz( p_intf, psz_name,
- *psz_value ? psz_value : NULL );
+ *psz_value ? psz_value : NULL );
}
break;
case CONFIG_ITEM_BOOL:
{
int i_value = [o_vlc_control intValue];
- if ( !strcmp( psz_name, "advanced" ) && ( config_GetInt( p_intf, "advanced" ) != i_value ) )
+
+ if( !strcmp( psz_name, "advanced" ) &&
+ ( config_GetInt( p_intf, "advanced" ) != i_value ) )
{
- b_advanced_change = TRUE;
+ b_adv_change = TRUE;
}
+
config_PutInt( p_intf, psz_name, i_value );
}
break;
config_SaveConfigFile( p_intf, NULL );
}
- if ( [[sender title] isEqualToString: _NS("Apply")] && !b_advanced_change )
- {
- ;
- }
- else
+ if( ![[sender title] isEqualToString: _NS("Apply")] || b_adv_change )
{
[o_pref_panel close];
[self performSelectorOnMainThread: @selector(destroyPrefPanel:)
withObject: o_module_name
waitUntilDone: YES];
- if ( [[sender title] isEqualToString: _NS("Apply")] && b_advanced_change )
- {
- [self createPrefPanel:@"main"];
- }
}
else
{
target: self selector: @selector(destroyPrefPanel:)
userInfo: o_module_name repeats: NO];
}
+
+ if( [[sender title] isEqualToString: _NS("Apply")] && b_adv_change )
+ {
+ [self createPrefPanel: o_module_name];
+ }
}
}