X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=modules%2Fgui%2Fmacosx%2Fprefs.m;h=c7f3aa8c64b614cb80650e0719a404088d9cdd9e;hb=bb63164ed7d2a8eaed855e0e526df7fbd2e22189;hp=eff5b9fc1acf076834b995d885b819d3b468dd4c;hpb=85b29bdc288a1573d43bd524908be5748a9b3640;p=vlc diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m index eff5b9fc1a..c7f3aa8c64 100644 --- a/modules/gui/macosx/prefs.m +++ b/modules/gui/macosx/prefs.m @@ -1,7 +1,7 @@ /***************************************************************************** * prefs.m: MacOS X module for vlc ***************************************************************************** - * Copyright (C) 2002-2005 VideoLAN (Centrale Réseaux) and its contributors + * Copyright (C) 2002-2005 the VideoLAN team * $Id$ * * Authors: Jon Lech Johansen @@ -101,6 +101,16 @@ static VLCPrefs *_o_sharedMainInstance = nil; [o_tree selectRow:0 byExtendingSelection:NO]; } +- (void)setTitle: (NSString *) o_title_name +{ + [o_title setStringValue: o_title_name]; +} + +- (void)setHelp: (NSString *) o_help_name +{ + [o_help setStringValue: o_help_name]; +} + - (void)showPrefs { /* load our nib (if not already loaded) */ @@ -214,7 +224,10 @@ static VLCTreeItem *o_root_item = nil; #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 @@ -224,6 +237,8 @@ static VLCTreeItem *o_root_item = nil; 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; @@ -236,7 +251,7 @@ static VLCTreeItem *o_root_item = nil; + (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; @@ -246,6 +261,8 @@ static VLCTreeItem *o_root_item = nil; { if (o_children != IsALeafNode) [o_children release]; [o_name release]; + [o_title release]; + [o_help release]; [super dealloc]; } @@ -295,14 +312,21 @@ static VLCTreeItem *o_root_item = nil; 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] @@ -311,13 +335,18 @@ static VLCTreeItem *o_root_item = nil; 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] @@ -400,7 +429,12 @@ static VLCTreeItem *o_root_item = nil; [p_subcategory_item->o_children addObject:[[VLCTreeItem alloc] initWithName:[[VLCMain sharedInstance] - localizedString: p_module->psz_object_name ] + 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 @@ -422,6 +456,16 @@ static VLCTreeItem *o_root_item = nil; return o_name; } +- (NSString *)getTitle +{ + return o_title; +} + +- (NSString *)getHelp +{ + return o_help; +} + - (VLCTreeItem *)childAtIndex:(int)i_index { return [[self children] objectAtIndex:i_index]; @@ -468,6 +512,9 @@ static VLCTreeItem *o_root_item = nil; NSRect s_vrc; NSView *o_view; + [[VLCPrefs sharedInstance] setTitle: [self getTitle]]; + [[VLCPrefs sharedInstance] setHelp: [self getHelp]]; + /* 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 | @@ -508,10 +555,10 @@ static VLCTreeItem *o_root_item = nil; { 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: @@ -571,14 +618,14 @@ static VLCTreeItem *o_root_item = nil; 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: