[o_tree selectRow:0 byExtendingSelection:NO];
}
+- (void)setTitle: (NSString *) o_title_name
+{
+ [o_title setStringValue: o_title_name];
+}
+
- (void)showPrefs
{
/* load our nib (if not already loaded) */
#define IsALeafNode ((id)-1)
-- (id)initWithName: (NSString *)o_item_name ID: (int)i_id
+- (id)initWithName: (NSString *)o_item_name
+ withTitle: (NSString *)o_item_title
+ withHelp: (NSString *)o_item_help
+ ID: (int)i_id
parent:(VLCTreeItem *)o_parent_item
children:(NSMutableArray *)o_children_array
whithCategory: (int) i_category
if( self != nil )
{
o_name = [o_item_name copy];
+ o_title= [o_item_title copy];
+ o_help= [o_item_help copy];
i_object_id = i_id;
o_parent = o_parent_item;
o_children = o_children_array;
+ (VLCTreeItem *)rootItem
{
if (o_root_item == nil)
- o_root_item = [[VLCTreeItem alloc] initWithName:@"main" ID:0
+ o_root_item = [[VLCTreeItem alloc] initWithName:@"main" withTitle:@"main" withHelp:@"" ID:0
parent:nil children:[[NSMutableArray alloc] initWithCapacity:10]
whithCategory: -1];
return o_root_item;
{
if (o_children != IsALeafNode) [o_children release];
[o_name release];
+ [o_title release];
+ [o_help release];
[super dealloc];
}
if( p_item ) do
{
NSString *o_child_name;
+ NSString *o_child_title;
+ NSString *o_child_help;
switch( p_item->i_type )
{
case CONFIG_CATEGORY:
o_child_name = [[VLCMain sharedInstance]
- localizedString: config_CategoryNameGet(p_item->i_value ) ];
+ localizedString: config_CategoryNameGet( p_item->i_value ) ];
+ o_child_title = o_child_name;
+ o_child_help = [[VLCMain sharedInstance]
+ localizedString: config_CategoryHelpGet( p_item->i_value ) ];
p_last_category = [VLCTreeItem alloc];
[o_children addObject:[p_last_category
initWithName: o_child_name
+ withTitle: o_child_title
+ withHelp: o_child_help
ID: p_item->i_value
parent:self
children:[[NSMutableArray alloc]
break;
case CONFIG_SUBCATEGORY:
o_child_name = [[VLCMain sharedInstance]
- localizedString: config_CategoryNameGet(p_item->i_value ) ];
+ localizedString: config_CategoryNameGet( p_item->i_value ) ];
+ o_child_title = o_child_name;
+ o_child_help = [[VLCMain sharedInstance]
+ localizedString: config_CategoryHelpGet( p_item->i_value ) ];
if( p_item->i_value != SUBCAT_PLAYLIST_GENERAL &&
p_item->i_value != SUBCAT_VIDEO_GENERAL &&
p_item->i_value != SUBCAT_AUDIO_GENERAL )
[p_last_category->o_children
addObject:[[VLCTreeItem alloc]
initWithName: o_child_name
+ withTitle: o_child_title
+ withHelp: o_child_help
ID: p_item->i_value
parent:p_last_category
children:[[NSMutableArray alloc]
initWithName:[[VLCMain sharedInstance]
localizedString: p_module->psz_shortname ?
p_module->psz_shortname : p_module->psz_object_name ]
+ withTitle:[[VLCMain sharedInstance]
+ localizedString: p_module->psz_longname ?
+ p_module->psz_longname : p_module->psz_object_name ]
+ withHelp: @""
ID: p_module->i_object_id
parent:p_subcategory_item
children:IsALeafNode
return o_name;
}
+- (NSString *)getTitle
+{
+ return o_title;
+}
+
+- (NSString *)getHelp
+{
+ return o_help;
+}
+
- (VLCTreeItem *)childAtIndex:(int)i_index
{
return [[self children] objectAtIndex:i_index];
NSRect s_vrc;
NSView *o_view;
+ [[VLCPrefs sharedInstance] setTitle: [self getTitle]];
+ /* NSLog( [self getHelp] ); */
s_vrc = [[o_prefs_view contentView] bounds]; s_vrc.size.height -= 4;
o_view = [[VLCFlippedView alloc] initWithFrame: s_vrc];
[o_view setAutoresizingMask: NSViewWidthSizable | NSViewMinYMargin |
{
case CONFIG_SUBCATEGORY:
break;
- case CONFIG_SECTION:
- break;
case CONFIG_CATEGORY:
break;
+ case CONFIG_SECTION:
+ break;
case CONFIG_HINT_END:
break;
case CONFIG_HINT_USAGE:
break;
default:
{
+ NSLog( @"one" );
VLCConfigControl *o_control = nil;
o_control = [VLCConfigControl newControl:p_item
withView:o_view];
msg_Err( p_intf, "null item found" );
break;
}
- switch(p_item->i_type)
+ switch( p_item->i_type )
{
case CONFIG_SUBCATEGORY:
break;
- case CONFIG_SECTION:
- break;
case CONFIG_CATEGORY:
break;
+ case CONFIG_SECTION:
+ break;
case CONFIG_HINT_END:
break;
case CONFIG_HINT_USAGE:
{
i_view_type = CONFIG_ITEM_BOOL;
+ /* add the checkbox */
+ o_tooltip = [[VLCMain sharedInstance]
+ wrapString: [[VLCMain sharedInstance]
+ localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
+ ADD_CHECKBOX( o_checkbox, mainFrame, 0,
+ 0, @"", o_tooltip, p_item->i_value, NSImageLeft)
+ [o_checkbox setAutoresizingMask:NSViewNotSizable ];
+ [self addSubview: o_checkbox];
/* add the label */
if( p_item->psz_text )
o_labelString = [[VLCMain sharedInstance]
localizedString: p_item->psz_text];
else
o_labelString = [NSString stringWithString:@""];
- ADD_LABEL( o_label, mainFrame, 0, 0, o_labelString )
+ ADD_LABEL( o_label, mainFrame, [o_checkbox frame].size.width, 0, o_labelString )
[o_label setAutoresizingMask:NSViewNotSizable ];
[self addSubview: o_label];
- /* add the checkbox */
- o_tooltip = [[VLCMain sharedInstance]
- wrapString: [[VLCMain sharedInstance]
- localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
- ADD_CHECKBOX( o_checkbox, mainFrame, [o_label frame].size.width,
- 0, @"", o_tooltip, p_item->i_value, NSImageLeft)
- [o_checkbox setAutoresizingMask:NSViewNotSizable ];
- [self addSubview: o_checkbox];
}
return self;
}
-- (void) alignWithXPosition:(int)i_xPos
-{
- NSRect frame;
- frame = [o_label frame];
- frame.origin.x = i_xPos - frame.size.width - 3;
- [o_label setFrame:frame];
-
- frame = [o_checkbox frame];
- frame.origin.x = i_xPos;
- [o_checkbox setFrame:frame];
-}
-
- (void)dealloc
{
[o_checkbox release];