From: Derk-Jan Hartman Date: Tue, 14 Jun 2005 21:32:56 +0000 (+0000) Subject: * backport of [11419] X-Git-Tag: 0.8.2~50 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=a9e7453b9604f90a29ea1ad336a89ec4758f0d3c;hp=e2b261ca0b3f8587f11ba96092231b338a419552;p=vlc * backport of [11419] --- diff --git a/modules/gui/macosx/prefs.h b/modules/gui/macosx/prefs.h index ac1415ae3d..28ef646023 100644 --- a/modules/gui/macosx/prefs.h +++ b/modules/gui/macosx/prefs.h @@ -39,6 +39,7 @@ - (BOOL)hasPrefs:(NSString *)o_module_name; - (NSView *)showView:(NSScrollView *)o_prefs_view advancedView:(vlc_bool_t) b_advanced; - (void)applyChanges; +- (void)resetView; @end diff --git a/modules/gui/macosx/prefs.m b/modules/gui/macosx/prefs.m index 14ad8c6abc..7fab932b57 100644 --- a/modules/gui/macosx/prefs.m +++ b/modules/gui/macosx/prefs.m @@ -146,7 +146,9 @@ static VLCPrefs *_o_sharedMainInstance = nil; { if( i_return == NSAlertAlternateReturn ) { + [o_prefs_view setDocumentView: o_empty_view]; config_ResetAll( p_intf ); + [[VLCTreeItem rootItem] resetView]; [[o_tree itemAtRow:[o_tree selectedRow]] showView:o_prefs_view advancedView: ( [o_advanced_ckb state] == NSOnState ) ? VLC_TRUE : VLC_FALSE]; @@ -310,7 +312,8 @@ static VLCTreeItem *o_root_item = nil; case CONFIG_SUBCATEGORY: o_child_name = [[VLCMain sharedInstance] localizedString: config_CategoryNameGet(p_item->i_value ) ]; - if( p_item->i_value != SUBCAT_VIDEO_GENERAL && + 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] @@ -555,7 +558,8 @@ static VLCTreeItem *o_root_item = nil; } p_item = (p_parser->p_config + i_object_category); if( ( p_item->i_type == CONFIG_CATEGORY ) && - ( ( p_item->i_value == CAT_AUDIO ) || + ( ( p_item->i_value == CAT_PLAYLIST ) || + ( p_item->i_value == CAT_AUDIO ) || ( p_item->i_value == CAT_VIDEO ) ) ) p_item++; @@ -684,6 +688,21 @@ static VLCTreeItem *o_root_item = nil; [[o_children objectAtIndex:i] applyChanges]; } +- (void)resetView +{ + unsigned int i; + if( o_subviews != nil ) + { + //Item has been shown + [o_subviews release]; + o_subviews = nil; + } + + if( o_children != IsALeafNode ) + for( i = 0 ; i < [o_children count] ; i++ ) + [[o_children objectAtIndex:i] resetView]; +} + @end