]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs.m
macosx: slightly de-uglify the VLC description in the about dialog by rendering it...
[vlc] / modules / gui / macosx / prefs.m
index 2174551ff0b4cdc95cf21c5179a1845118991d6c..ee31032f96594d7df92a044ffd421d9a0af4ea69 100644 (file)
@@ -224,30 +224,6 @@ static VLCPrefs *_o_sharedMainInstance = nil;
     [o_prefs_window orderOut:self];
 }
 
-- (IBAction)resetAll: (id)sender
-{
-    NSBeginInformationalAlertSheet(_NS("Reset Preferences"), _NS("Cancel"),
-        _NS("Continue"), nil, o_prefs_window, self,
-        @selector(sheetDidEnd: returnCode: contextInfo:), NULL, nil, @"%@",
-        _NS("Beware this will reset the VLC media player preferences.\n"
-            "Are you sure you want to continue?"));
-}
-
-- (void)sheetDidEnd:(NSWindow *)o_sheet returnCode:(int)i_return
-    contextInfo:(void *)o_context
-{
-    if (i_return == NSAlertAlternateReturn) {
-        /* reset VLC's config */
-        config_ResetAll(p_intf);
-        [_rootTreeItem resetView];
-        config_SaveConfigFile(p_intf);
-
-        /* reset OS X defaults */
-        [NSUserDefaults resetStandardUserDefaults];
-        [[NSUserDefaults standardUserDefaults] synchronize];
-    }
-}
-
 - (IBAction)buttonAction: (id)sender
 {
     [o_prefs_window orderOut: self];
@@ -385,13 +361,13 @@ static VLCPrefs *_o_sharedMainInstance = nil;
                 }
             }
 
-            if (module_is_main(p_module) && CONFIG_ITEM(configType)) {
+            if (module_is_main(p_module) && (CONFIG_ITEM(configType) || configType == CONFIG_SECTION)) {
                 if (categoryItem && [self isSubCategoryGeneral:lastsubcat])
                     [[categoryItem options] addObject:[[VLCTreeLeafItem alloc] initWithConfigItem:&p_configs[j]]];
                 else if (subCategoryItem)
                     [[subCategoryItem options] addObject:[[VLCTreeLeafItem alloc] initWithConfigItem:&p_configs[j]]];
             }
-            else if (!module_is_main(p_module) && CONFIG_ITEM(configType)) {
+            else if (!module_is_main(p_module) && (CONFIG_ITEM(configType) || configType == CONFIG_SECTION)) {
                 if (![[subCategoryItem children] containsObject: pluginItem])
                     [[subCategoryItem children] addObject:pluginItem];
 
@@ -471,7 +447,7 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 @implementation VLCTreePluginItem
 - (id)initWithPlugin:(module_t *)plugin
 {
-    NSString * name = _NS(module_get_name(plugin, false)?:"");
+    NSString * name = _NS(module_get_name(plugin, false));
     if (self = [super initWithName:name]) {
         _configItems = module_config_get(plugin, &_configSize);
         //_plugin = plugin;
@@ -508,9 +484,8 @@ static VLCPrefs *_o_sharedMainInstance = nil;
 
 - (id)initWithConfigItem: (module_config_t *) configItem
 {
-    NSString * name = _NS(configItem->psz_name);
+    NSString *name = toNSStr(configItem->psz_name);
     self = [super initWithName:name];
-    [name release];
     if (self != nil)
         _configItem = configItem;