]> git.sesse.net Git - vlc/blobdiff - modules/gui/macosx/prefs_widgets.m
macosx: fix resume playback guards, do not resume for folder urls
[vlc] / modules / gui / macosx / prefs_widgets.m
index c6b4076c9dcbef17f5c8efa43f170f5e3b8b5d2a..0324a034aa2c4e0e2333b7fedce8cbee94c5fc66 100644 (file)
@@ -1,17 +1,17 @@
 /*****************************************************************************
  * prefs_widgets.m: Preferences controls
  *****************************************************************************
- * Copyright (C) 2002-2003 the VideoLAN team
+ * Copyright (C) 2002-2012 VLC authors and VideoLAN
  * $Id$
  *
  * Authors: Derk-Jan Hartman <hartman at videolan.org>
- *          Jérôme Decoodt <djc at videolan.org>
+ *          Jérôme Decoodt <djc at videolan.org>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * the Free Software Foundation; either version 2 of the License, or
  * (at your option) any later version.
- * 
+ *
  * This program is distributed in the hope that it will be useful,
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 #include <stdlib.h>                                      /* malloc(), free() */
 #include <string.h>
 
-#include <vlc/vlc.h>
-#include "vlc_keys.h"
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <vlc_common.h>
+#include <vlc_modules.h>
+#include <vlc_plugin.h>
+#include <vlc_keys.h>
 
 #include "intf.h"
 #include "prefs_widgets.h"
 #define OFFSET_RIGHT 20
 #define OFFSET_BETWEEN 2
 
-#define UPWARDS_WHITE_ARROW                 "\xE2\x87\xA7" 
+#define UPWARDS_WHITE_ARROW                 "\xE2\x87\xA7"
 #define OPTION_KEY                          "\xE2\x8C\xA5"
 #define UP_ARROWHEAD                        "\xE2\x8C\x83"
 #define PLACE_OF_INTEREST_SIGN              "\xE2\x8C\x98"
 
-#define POPULATE_A_KEY( o_menu, string, value )                             \
+#define POPULATE_A_KEY(o_menu, string, value)                               \
 {                                                                           \
     NSMenuItem *o_mi;                                                       \
 /*  Normal */                                                               \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         0];                                                                 \
-if( MACOS_VERSION >= 10.3 )                                                 \
     [o_mi setAlternate: NO];                                                \
     [o_mi setTag:                                                           \
-        ( value )];                                                         \
+        (value)];                                                           \
     [o_menu addItem: o_mi];                                                 \
-if( MACOS_VERSION >= 10.3 )                                                 \
-{                                                                           \
 /*  Ctrl */                                                                 \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD                                                    \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD]                       \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask];                                                  \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        KEY_MODIFIER_CTRL | ( value )];                                     \
+        KEY_MODIFIER_CTRL | (value)];                                       \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Alt */                                                              \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD OPTION_KEY                                         \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD OPTION_KEY]            \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask | NSAlternateKeyMask];                             \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        (KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT) | ( value )];                \
+        (KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT) | (value)];                  \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Shift */                                                            \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD UPWARDS_WHITE_ARROW                                \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD UPWARDS_WHITE_ARROW]   \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
        NSControlKeyMask | NSShiftKeyMask];                                  \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        (KEY_MODIFIER_CTRL | KEY_MODIFIER_SHIFT) | ( value )];              \
+        (KEY_MODIFIER_CTRL | KEY_MODIFIER_SHIFT) | (value)];                \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Apple */                                                            \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD PLACE_OF_INTEREST_SIGN                             \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD PLACE_OF_INTEREST_SIGN]\
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask | NSCommandKeyMask];                               \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        (KEY_MODIFIER_CTRL | KEY_MODIFIER_COMMAND) | ( value )];            \
+        (KEY_MODIFIER_CTRL | KEY_MODIFIER_COMMAND) | (value)];              \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Alt+Shift */                                                        \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW                     \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW] \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask];            \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
         (KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT) |       \
-             ( value )];                                                    \
+             (value)];                                                      \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Alt+Apple */                                                        \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD OPTION_KEY PLACE_OF_INTEREST_SIGN                  \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD OPTION_KEY PLACE_OF_INTEREST_SIGN] \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask | NSAlternateKeyMask | NSCommandKeyMask];          \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
         (KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT | KEY_MODIFIER_COMMAND) |     \
-            ( value )];                                                     \
+            (value)];                                                       \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Shift+Apple */                                                      \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN         \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN] \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask | NSShiftKeyMask | NSCommandKeyMask];              \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
         (KEY_MODIFIER_CTRL | KEY_MODIFIER_SHIFT | KEY_MODIFIER_COMMAND) |   \
-            ( value )];                                                     \
+            (value)];                                                       \
     [o_menu addItem: o_mi];                                                 \
 /* Ctrl+Alt+Shift+Apple */                                                  \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW                     \
-                PLACE_OF_INTEREST_SIGN                                      \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UP_ARROWHEAD OPTION_KEY UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN] \
+         stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSControlKeyMask | NSAlternateKeyMask | NSShiftKeyMask |            \
@@ -158,97 +152,87 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
         (KEY_MODIFIER_CTRL | KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT |        \
-            KEY_MODIFIER_COMMAND) | ( value )];                             \
+            KEY_MODIFIER_COMMAND) | (value)];                               \
     [o_menu addItem: o_mi];                                                 \
 /* Alt */                                                                   \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            OPTION_KEY                                                      \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:OPTION_KEY] stringByAppendingString: string] \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSAlternateKeyMask];                                                \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        KEY_MODIFIER_ALT | ( value )];                                      \
+        KEY_MODIFIER_ALT | (value)];                                        \
     [o_menu addItem: o_mi];                                                 \
 /* Alt+Shift */                                                             \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            OPTION_KEY UPWARDS_WHITE_ARROW                                  \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:OPTION_KEY UPWARDS_WHITE_ARROW] stringByAppendingString: string] \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSAlternateKeyMask | NSShiftKeyMask];                               \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        (KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT) | ( value )];               \
+        (KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT) | (value)];                 \
     [o_menu addItem: o_mi];                                                 \
 /* Alt+Apple */                                                             \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            OPTION_KEY PLACE_OF_INTEREST_SIGN                               \
-        ] stringByAppendingString: string]                                  \
-        action:nil keyEquivalent:@""];                                      \
+        [[NSString stringWithUTF8String:OPTION_KEY PLACE_OF_INTEREST_SIGN]  \
+         stringByAppendingString: string] action:nil keyEquivalent:@""];    \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSAlternateKeyMask | NSCommandKeyMask];                             \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        (KEY_MODIFIER_ALT | KEY_MODIFIER_COMMAND) | ( value )];             \
+        (KEY_MODIFIER_ALT | KEY_MODIFIER_COMMAND) | (value)];               \
     [o_menu addItem: o_mi];                                                 \
 /* Alt+Shift+Apple */                                                       \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            OPTION_KEY UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN           \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:OPTION_KEY UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN] \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSAlternateKeyMask | NSShiftKeyMask | NSCommandKeyMask];            \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
         (KEY_MODIFIER_ALT | KEY_MODIFIER_SHIFT | KEY_MODIFIER_COMMAND) |    \
-            ( value )];                                                     \
+            (value)];                                                       \
     [o_menu addItem: o_mi];                                                 \
 /* Shift */                                                                 \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UPWARDS_WHITE_ARROW                                             \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UPWARDS_WHITE_ARROW]                \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSShiftKeyMask];                                                    \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        KEY_MODIFIER_SHIFT | ( value )];                                    \
+        KEY_MODIFIER_SHIFT | (value)];                                      \
     [o_menu addItem: o_mi];                                                 \
 /* Shift+Apple */                                                           \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-            UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN                      \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:UPWARDS_WHITE_ARROW PLACE_OF_INTEREST_SIGN] \
+         stringByAppendingString: string]                                   \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSShiftKeyMask | NSCommandKeyMask];                                 \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        (KEY_MODIFIER_SHIFT | KEY_MODIFIER_COMMAND) | ( value )];           \
+        (KEY_MODIFIER_SHIFT | KEY_MODIFIER_COMMAND) | (value)];             \
     [o_menu addItem: o_mi];                                                 \
 /* Apple */                                                                 \
     o_mi = [[NSMenuItem alloc] initWithTitle:                               \
-        [[NSString stringWithUTF8String:                                    \
-        PLACE_OF_INTEREST_SIGN                                              \
-        ] stringByAppendingString: string]                                  \
+        [[NSString stringWithUTF8String:PLACE_OF_INTEREST_SIGN]             \
+          stringByAppendingString: string]                                  \
         action:nil keyEquivalent:@""];                                      \
     [o_mi setKeyEquivalentModifierMask:                                     \
         NSCommandKeyMask];                                                  \
     [o_mi setAlternate: YES];                                               \
     [o_mi setTag:                                                           \
-        KEY_MODIFIER_COMMAND | ( value )];                                  \
+        KEY_MODIFIER_COMMAND | (value)];                                    \
     [o_menu addItem: o_mi];                                                 \
-}                                                                           \
 }
 
-#define ADD_LABEL( o_label, superFrame, x_offset, my_y_offset, label )      \
+#define ADD_LABEL(o_label, superFrame, x_offset, my_y_offset, label,        \
+    tooltip)                                                                \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.size.height = 17;                                                  \
@@ -260,12 +244,13 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_label setEditable: NO];                                              \
     [o_label setSelectable: NO];                                            \
     [o_label setStringValue: label];                                        \
+    [o_label setToolTip: tooltip];                                          \
     [o_label setFont:[NSFont systemFontOfSize:0]];                          \
     [o_label sizeToFit];                                                    \
 }
 
-#define ADD_TEXTFIELD( o_textfield, superFrame, x_offset, my_y_offset,      \
-    my_width, tooltip, init_value )                                         \
+#define ADD_TEXTFIELD(o_textfield, superFrame, x_offset, my_y_offset,       \
+    my_width, tooltip, init_value                                         \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.origin.x = x_offset;                                               \
@@ -278,8 +263,22 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_textfield setStringValue: init_value];                               \
 }
 
-#define ADD_COMBO( o_combo, superFrame, x_offset, my_y_offset, x2_offset,   \
-    tooltip )                                                               \
+#define ADD_SECURETEXTFIELD(o_textfield, superFrame, x_offset, my_y_offset, \
+my_width, tooltip, init_value)                                              \
+{                                                                           \
+NSRect s_rc = superFrame;                                                   \
+s_rc.origin.x = x_offset;                                                   \
+s_rc.origin.y = my_y_offset;                                                \
+s_rc.size.height = 22;                                                      \
+s_rc.size.width = my_width;                                                 \
+o_textfield = [[[NSSecureTextField alloc] initWithFrame: s_rc] retain];     \
+[o_textfield setFont:[NSFont systemFontOfSize:0]];                          \
+[o_textfield setToolTip: tooltip];                                          \
+[o_textfield setStringValue: init_value];                                   \
+}
+
+#define ADD_COMBO(o_combo, superFrame, x_offset, my_y_offset, x2_offset,    \
+    tooltip)                                                                \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.origin.x = x_offset + 2;                                           \
@@ -296,8 +295,8 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_combo setCompletes:YES];                                             \
 }
 
-#define ADD_RIGHT_BUTTON( o_button, superFrame, x_offset, my_y_offset,      \
-    tooltip, title )                                                        \
+#define ADD_RIGHT_BUTTON(o_button, superFrame, x_offset, my_y_offset,       \
+    tooltip, title                                                        \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     o_button = [[[NSButton alloc] initWithFrame: s_rc] retain];             \
@@ -316,8 +315,8 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_button setAction: @selector(openFileDialog:)];                       \
 }
 
-#define ADD_POPUP( o_popup, superFrame, x_offset, my_y_offset, x2_offset,   \
-    tooltip )                                                               \
+#define ADD_POPUP(o_popup, superFrame, x_offset, my_y_offset, x2_offset,    \
+    tooltip                                                               \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.origin.x = x_offset - 1;                                           \
@@ -330,8 +329,8 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_popup setToolTip: tooltip];                                          \
 }
 
-#define ADD_STEPPER( o_stepper, superFrame, x_offset, my_y_offset, tooltip, \
-    lower, higher )                                                         \
+#define ADD_STEPPER(o_stepper, superFrame, x_offset, my_y_offset, tooltip,  \
+    lower, higher                                                         \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.origin.x = x_offset;                                               \
@@ -349,8 +348,8 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         NSLeftMouseDraggedMask];                                            \
 }
 
-#define ADD_SLIDER( o_slider, superFrame, x_offset, my_y_offset, my_width,  \
-    tooltip, lower, higher )                                                \
+#define ADD_SLIDER(o_slider, superFrame, x_offset, my_y_offset, my_width,   \
+    tooltip, lower, higher                                                \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.origin.x = x_offset;                                               \
@@ -364,8 +363,8 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_slider setMinValue: lower];                                          \
 }
 
-#define ADD_CHECKBOX( o_checkbox, superFrame, x_offset, my_y_offset, label, \
-    tooltip, init_value, position )                                         \
+#define ADD_CHECKBOX(o_checkbox, superFrame, x_offset, my_y_offset, label,  \
+    tooltip, init_value, position                                         \
 {                                                                           \
     NSRect s_rc = superFrame;                                               \
     s_rc.size.height = 18;                                                  \
@@ -382,6 +381,8 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 }
 
 @implementation VLCConfigControl
+@synthesize type = i_type, viewType = i_view_type, advanced = b_advanced;
+
 - (id)initWithFrame: (NSRect)frame
 {
     return [self initWithFrame: frame
@@ -393,10 +394,9 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 {
     self = [super initWithFrame: frame];
 
-    if( self != nil )
-    {
+    if (self != nil) {
         p_item = _p_item;
-        psz_name = strdup( p_item->psz_name );
+        psz_name = p_item->psz_name;
         o_label = NULL;
         i_type = p_item->i_type;
         i_view_type = 0;
@@ -415,26 +415,27 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 
 - (void)dealloc
 {
-    if( o_label ) [o_label release];
-    if( psz_name ) free( psz_name );
+    if (o_label) [o_label release];
+    free(psz_name);
     [super dealloc];
 }
 
 + (int)calcVerticalMargin: (int)i_curItem lastItem: (int)i_lastItem
 {
     int i_margin;
-    switch( i_curItem )
-    {
+    switch(i_curItem) {
     case CONFIG_ITEM_STRING:
-        switch( i_lastItem )
-        {
+    case CONFIG_ITEM_PASSWORD:
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 8;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 8;
             break;
         case CONFIG_ITEM_MODULE:
@@ -449,10 +450,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -464,15 +462,16 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         }
         break;
     case CONFIG_ITEM_STRING_LIST:
-        switch( i_lastItem )
-        {
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 8;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE:
@@ -487,10 +486,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -501,16 +497,18 @@ if( MACOS_VERSION >= 10.3 )                                                 \
             break;
         }
         break;
-    case CONFIG_ITEM_FILE:
-        switch( i_lastItem )
-        {
+    case CONFIG_ITEM_LOADFILE:
+    case CONFIG_ITEM_SAVEFILE:
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 13;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 10;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 9;
             break;
         case CONFIG_ITEM_MODULE:
@@ -525,10 +523,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 10;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 10;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 9;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -540,15 +535,16 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         }
         break;
     case CONFIG_ITEM_MODULE:
-        switch( i_lastItem )
-        {
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 8;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE:
@@ -563,10 +559,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 8;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 8;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 7;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -578,15 +571,16 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         }
         break;
     case CONFIG_ITEM_INTEGER:
-        switch( i_lastItem )
-        {
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 8;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE:
@@ -601,10 +595,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -616,15 +607,16 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         }
         break;
     case CONFIG_ITEM_RANGED_INTEGER:
-        switch( i_lastItem )
-        {
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 8;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 8;
             break;
         case CONFIG_ITEM_MODULE:
@@ -639,10 +631,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -654,15 +643,16 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         }
         break;
     case CONFIG_ITEM_BOOL:
-        switch( i_lastItem )
-        {
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 10;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 9;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 8;
             break;
         case CONFIG_ITEM_MODULE:
@@ -677,10 +667,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 5;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -691,54 +678,17 @@ if( MACOS_VERSION >= 10.3 )                                                 \
             break;
         }
         break;
-    case CONFIG_ITEM_KEY_BEFORE_10_3:
-        switch( i_lastItem )
-        {
-        case CONFIG_ITEM_STRING:
-            i_margin = 6;
-            break;
-        case CONFIG_ITEM_STRING_LIST:
-            i_margin = 5;
-            break;
-        case CONFIG_ITEM_FILE:
-            i_margin = 4;
-            break;
-        case CONFIG_ITEM_MODULE:
-            i_margin = 2;
-            break;
-        case CONFIG_ITEM_INTEGER:
-            i_margin = 5;
-            break;
-        case CONFIG_ITEM_RANGED_INTEGER:
-            i_margin = 3;
-            break;
-        case CONFIG_ITEM_BOOL:
-            i_margin = 3;
-            break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 10;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
-            i_margin = 6;
-            break;
-        case CONFIG_ITEM_MODULE_LIST:
-            i_margin = 6;
-            break;
-        default:
-            i_margin = 18;
-            break;
-        }
-        break;
-    case CONFIG_ITEM_KEY_AFTER_10_3:
-        switch( i_lastItem )
-        {
+    case CONFIG_ITEM_KEY:
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 8;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE:
@@ -753,10 +703,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 8;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -768,15 +715,16 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         }
         break;
     case CONFIG_ITEM_MODULE_LIST:
-        switch( i_lastItem )
-        {
+        switch(i_lastItem) {
         case CONFIG_ITEM_STRING:
+        case CONFIG_ITEM_PASSWORD:
             i_margin = 10;
             break;
         case CONFIG_ITEM_STRING_LIST:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_FILE:
+        case CONFIG_ITEM_LOADFILE:
+        case CONFIG_ITEM_SAVEFILE:
             i_margin = 6;
             break;
         case CONFIG_ITEM_MODULE:
@@ -791,10 +739,7 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         case CONFIG_ITEM_BOOL:
             i_margin = 7;
             break;
-        case CONFIG_ITEM_KEY_BEFORE_10_3:
-            i_margin = 7;
-            break;
-        case CONFIG_ITEM_KEY_AFTER_10_3:
+        case CONFIG_ITEM_KEY:
             i_margin = 5;
             break;
         case CONFIG_ITEM_MODULE_LIST:
@@ -816,59 +761,44 @@ if( MACOS_VERSION >= 10.3 )                                                 \
                       withView: (NSView *)o_parent_view
 {
     VLCConfigControl *p_control = NULL;
-    /* Skip depracated options */
-    if( _p_item->psz_current )
-    {
-        return NULL;
-    }
 
-    switch( _p_item->i_type )
-    {
+    switch(_p_item->i_type) {
     case CONFIG_ITEM_STRING:
-        if( !_p_item->i_list )
-        {
+    case CONFIG_ITEM_PASSWORD:
+        if (!_p_item->list_count) {
             p_control = [[StringConfigControl alloc]
                     initWithItem: _p_item
                     withView: o_parent_view];
-        }
-        else
-        {
+        } else {
             p_control = [[StringListConfigControl alloc]
                     initWithItem: _p_item
                     withView: o_parent_view];
         }
         break;
-    case CONFIG_ITEM_FILE:
+    case CONFIG_ITEM_LOADFILE:
+    case CONFIG_ITEM_SAVEFILE:
     case CONFIG_ITEM_DIRECTORY:
         p_control = [[FileConfigControl alloc]
                     initWithItem: _p_item
                     withView: o_parent_view];
         break;
     case CONFIG_ITEM_MODULE:
+            p_control = [[StringListConfigControl alloc]
+                         initWithItem: _p_item
+                         withView: o_parent_view];
+            break;
     case CONFIG_ITEM_MODULE_CAT:
         p_control = [[ModuleConfigControl alloc]
                     initWithItem: _p_item
                     withView: o_parent_view];
         break;
     case CONFIG_ITEM_INTEGER:
-        if( _p_item->i_list )
-        {
-            p_control = [[IntegerListConfigControl alloc]
-                        initWithItem: _p_item
-                        withView: o_parent_view];
-        }
-        else if( _p_item->i_min != 0 || _p_item->i_max != 0 )
-        {
-            p_control = [[RangedIntegerConfigControl alloc]
-                        initWithItem: _p_item
-                        withView: o_parent_view];
-        }
+        if (_p_item->list_count)
+            p_control = [[IntegerListConfigControl alloc] initWithItem: _p_item withView: o_parent_view];
+        else if ((_p_item->min.i != 0 || _p_item->max.i != 0) && (_p_item->min.i != INT_MIN || _p_item->max.i != INT_MAX))
+            p_control = [[RangedIntegerConfigControl alloc] initWithItem: _p_item withView: o_parent_view];
         else
-        {
-            p_control = [[IntegerConfigControl alloc]
-                        initWithItem: _p_item
-                        withView: o_parent_view];
-        }
+            p_control = [[IntegerConfigControl alloc] initWithItem: _p_item withView: o_parent_view];
         break;
     case CONFIG_ITEM_BOOL:
         p_control = [[BoolConfigControl alloc]
@@ -876,38 +806,25 @@ if( MACOS_VERSION >= 10.3 )                                                 \
                     withView: o_parent_view];
         break;
     case CONFIG_ITEM_FLOAT:
-        if( _p_item->f_min != 0 || _p_item->f_max != 0 )
-        {
-            p_control = [[RangedFloatConfigControl alloc]
-                        initWithItem: _p_item
-                        withView: o_parent_view];
-        }
+        if ((_p_item->min.i != 0 || _p_item->max.i != 0) && (_p_item->min.i != INT_MIN || _p_item->max.i != INT_MAX))
+            p_control = [[RangedFloatConfigControl alloc] initWithItem: _p_item withView: o_parent_view];
         else
-        {
-            p_control = [[FloatConfigControl alloc]
-                        initWithItem: _p_item
-                        withView: o_parent_view];
-        }
+            p_control = [[FloatConfigControl alloc] initWithItem: _p_item withView: o_parent_view];
         break;
+    /* don't display keys in the advanced settings, since the current controls
+    are broken by design. The user is required to change hotkeys in the sprefs
+    and can only change really advanced stuff here..
     case CONFIG_ITEM_KEY:
-        if( MACOS_VERSION < 10.3 )
-        {
-            p_control = [[KeyConfigControlBefore103 alloc]
+        p_control = [[KeyConfigControl alloc]
                         initWithItem: _p_item
                         withView: o_parent_view];
-        }
-        else
-        {
-            p_control = [[KeyConfigControlAfter103 alloc]
-                        initWithItem: _p_item
-                        withView: o_parent_view];
-        }
-        break;
+        break; */
     case CONFIG_ITEM_MODULE_LIST:
     case CONFIG_ITEM_MODULE_LIST_CAT:
-        p_control = [[ModuleListConfigControl alloc]
-                    initWithItem: _p_item
-                    withView: o_parent_view];
+        p_control = [[ModuleListConfigControl alloc] initWithItem: _p_item withView: o_parent_view];
+        break;
+    case CONFIG_SECTION:
+        p_control = [[SectionControl alloc] initWithItem: _p_item withView: o_parent_view];
         break;
     default:
         break;
@@ -915,24 +832,9 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     return p_control;
 }
 
-- (NSString *)getName
+- (NSString *)name
 {
-    return [[VLCMain sharedInstance] localizedString: psz_name];
-}
-
-- (int)getType
-{
-    return i_type;
-}
-
-- (int)getViewType
-{
-    return i_view_type;
-}
-
-- (BOOL)isAdvanced
-{
-    return b_advanced;
+    return _NS(psz_name);
 }
 
 - (int)intValue
@@ -953,31 +855,39 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 - (void)applyChanges
 {
     vlc_value_t val;
-    switch( p_item->i_type )
-    {
+    switch(p_item->i_type) {
     case CONFIG_ITEM_STRING:
-    case CONFIG_ITEM_FILE:
+    case CONFIG_ITEM_PASSWORD:
+    case CONFIG_ITEM_LOADFILE:
+    case CONFIG_ITEM_SAVEFILE:
     case CONFIG_ITEM_DIRECTORY:
     case CONFIG_ITEM_MODULE:
     case CONFIG_ITEM_MODULE_LIST:
-    case CONFIG_ITEM_MODULE_LIST_CAT:
-        config_PutPsz( VLCIntf, psz_name, [self stringValue] );
+    case CONFIG_ITEM_MODULE_LIST_CAT: {
+        char *psz_val = [self stringValue];
+        config_PutPsz(VLCIntf, psz_name, psz_val);
+        free(psz_val);
         break;
+    }
     case CONFIG_ITEM_KEY:
         /* So you don't need to restart to have the changes take effect */
         val.i_int = [self intValue];
-        var_Set( VLCIntf->p_vlc, psz_name, val );
+        var_Set(VLCIntf->p_libvlc, psz_name, val);
     case CONFIG_ITEM_INTEGER:
     case CONFIG_ITEM_BOOL:
-        config_PutInt( VLCIntf, psz_name, [self intValue] );
+        config_PutInt(VLCIntf, psz_name, [self intValue]);
         break;
     case CONFIG_ITEM_FLOAT:
-        config_PutFloat( VLCIntf, psz_name, [self floatValue] );
+        config_PutFloat(VLCIntf, psz_name, [self floatValue]);
         break;
     }
 }
 
-- (int)getLabelSize
+- (void)resetValues
+{
+}
+
+- (int)labelSize
 {
     return [o_label frame].size.width;
 }
@@ -1000,32 +910,39 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        i_view_type = CONFIG_ITEM_STRING;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
+        if (p_item->i_type == CONFIG_ITEM_PASSWORD)
+            i_view_type = CONFIG_ITEM_PASSWORD;
+        else
+            i_view_type = CONFIG_ITEM_STRING;
+
+        o_textfieldTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance] localizedString: p_item->psz_longtext]
-                                         toWidth: PREFS_WRAP];
-        if( p_item->psz_value )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: p_item->psz_value];
+        if (p_item->value.psz)
+            o_textfieldString = [NSString stringWithCString:p_item->value.psz encoding:NSUTF8StringEncoding];
         else
-            o_textfieldString = [NSString stringWithString: @""];
-        ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2,
-                        0, mainFrame.size.width - [o_label frame].size.width -
-                        2, o_textfieldTooltip, o_textfieldString )
+            o_textfieldString = @"";
+        if (p_item->i_type == CONFIG_ITEM_PASSWORD) {
+            ADD_SECURETEXTFIELD(o_textfield, mainFrame, [o_label frame].size.width + 2,
+                          0, mainFrame.size.width - [o_label frame].size.width -
+                          2, o_textfieldTooltip, o_textfieldString)
+        } else {
+            ADD_TEXTFIELD(o_textfield, mainFrame, [o_label frame].size.width + 2,
+                            0, mainFrame.size.width - [o_label frame].size.width -
+                            2, o_textfieldTooltip, o_textfieldString)
+        }
         [o_textfield setAutoresizingMask:NSViewWidthSizable ];
+
         [self addSubview: o_textfield];
     }
     return self;
@@ -1053,8 +970,19 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 
 - (char *)stringValue
 {
-    return strdup( [[VLCMain sharedInstance] delocalizeString:
-                        [o_textfield stringValue]] );
+    return strdup([[o_textfield stringValue] UTF8String]);
+}
+
+- (void)resetValues
+{
+    NSString *o_textfieldString;
+    char *psz_value = config_GetPsz(VLCIntf, p_item->psz_name);
+    if (psz_value)
+        o_textfieldString = _NS(psz_value);
+    else
+        o_textfieldString = @"";
+    free(psz_value);
+    [super resetValues];
 }
 @end
 
@@ -1069,32 +997,32 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        int i_index;
-        i_view_type = CONFIG_ITEM_STRING_LIST;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
+        if (p_item->i_type == CONFIG_ITEM_STRING)
+            i_view_type = CONFIG_ITEM_STRING_LIST;
+        else
+            i_view_type = CONFIG_ITEM_MODULE;
+
+        o_textfieldTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS(p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width,
-            -2, 0, o_textfieldTooltip )
-        [o_combo setAutoresizingMask:NSViewWidthSizable ];
-        for( i_index = 0; i_index < p_item->i_list; i_index++ )
-            if( p_item->psz_value &&
-                !strcmp( p_item->psz_value, p_item->ppsz_list[i_index] ) )
-                [o_combo selectItemAtIndex: i_index];
-        [self addSubview: o_combo];
+        ADD_POPUP(o_popup, mainFrame, [o_label frame].size.width,
+            -2, 0, o_textfieldTooltip)
+        [o_popup setAutoresizingMask:NSViewWidthSizable];
+
+        /* add items */
+        [self resetValues];
+
+        [self addSubview: o_popup];
     }
     return self;
 }
@@ -1107,42 +1035,56 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     frame.origin.x = i_xPos - frame.size.width - 3;
     [o_label setFrame:frame];
 
-    frame = [o_combo frame];
+    frame = [o_popup frame];
     frame.origin.x = i_xPos + 2;
     frame.size.width = superFrame.size.width - frame.origin.x + 2;
-    [o_combo setFrame:frame];
+    [o_popup setFrame:frame];
 }
 
 - (void)dealloc
 {
-    [o_combo release];
+    [o_popup release];
     [super dealloc];
 }
 
 - (char *)stringValue
 {
-    if( [o_combo indexOfSelectedItem] >= 0 )
-        return strdup( p_item->ppsz_list[[o_combo indexOfSelectedItem]] );
-    else
-        return strdup( [[VLCMain sharedInstance]
-                            delocalizeString: [o_combo stringValue]] );
-}
-@end
+    if ([o_popup indexOfSelectedItem] < 0)
+        return NULL;
 
-@implementation StringListConfigControl (NSComboBoxDataSource)
-- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
-{
-        return p_item->i_list;
+    NSString *o_data = [[o_popup selectedItem] representedObject];
+    return strdup([o_data UTF8String]);
 }
 
-- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)i_index
+- (void)resetValues
 {
-    if( p_item->ppsz_list_text && p_item->ppsz_list_text[i_index] )
-    {
-        return [[VLCMain sharedInstance]
-                    localizedString: p_item->ppsz_list_text[i_index]];
-    } else return [[VLCMain sharedInstance]
-                    localizedString: p_item->ppsz_list[i_index]];
+    [o_popup removeAllItems];
+
+    char *psz_value = config_GetPsz(VLCIntf, p_item->psz_name);
+
+    char **values, **texts;
+    ssize_t count = config_GetPszChoices(VLC_OBJECT(VLCIntf), p_item->psz_name,
+                                         &values, &texts);
+    for (ssize_t i = 0; i < count && texts; i++) {
+        if (texts[i] == NULL || values[i] == NULL)
+            continue;
+
+        [o_popup addItemWithTitle: toNSStr(texts[i])];
+        NSMenuItem *lastItem = [o_popup lastItem];
+        [lastItem setRepresentedObject: toNSStr(values[i])];
+
+        if (!strcmp(psz_value ? psz_value : "", values[i]))
+            [o_popup selectItem: [o_popup lastItem]];
+
+        free(texts[i]);
+        free(values[i]);
+    }
+    free(texts);
+    free(values);
+
+    free(psz_value);
+
+    [super resetValues];
 }
 @end
 
@@ -1151,51 +1093,43 @@ if( MACOS_VERSION >= 10.3 )                                                 \
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_buttonTooltip, *o_textfieldString;
-    NSString *o_textfieldTooltip;
+    NSString *o_labelString, *o_itemTooltip, *o_textfieldString;
     mainFrame.size.height = 46;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        i_view_type = CONFIG_ITEM_FILE;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
+        i_view_type = CONFIG_ITEM_LOADFILE;
+
+        o_itemTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
 
         /* is it a directory */
-        b_directory = ( [self getType] == CONFIG_ITEM_DIRECTORY ) ? YES : NO;
+        b_directory = ([self type] == CONFIG_ITEM_DIRECTORY) ? YES : NO;
 
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, 3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, 3, o_labelString, o_itemTooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the button */
-        o_buttonTooltip = [[VLCMain sharedInstance]
-                wrapString: [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_RIGHT_BUTTON( o_button, mainFrame, 0, 0, o_buttonTooltip,
-                            _NS("Browse...") )
+        ADD_RIGHT_BUTTON(o_button, mainFrame, 0, 0, o_itemTooltip,
+                            _NS("Browse..."))
         [o_button setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_button];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        if( p_item->psz_value )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: p_item->psz_value];
+        if (p_item->value.psz)
+            o_textfieldString = [NSString stringWithFormat: @"%s", (char *)p_item->value.psz];
         else
-            o_textfieldString = [NSString stringWithString: @""];
-        ADD_TEXTFIELD( o_textfield, mainFrame, 12, 2, mainFrame.size.width -
+            o_textfieldString = @"";
+        ADD_TEXTFIELD(o_textfield, mainFrame, 12, 2, mainFrame.size.width -
                         8 - [o_button frame].size.width,
-                        o_textfieldTooltip, o_textfieldString )
+                        o_itemTooltip, o_textfieldString)
         [o_textfield setAutoresizingMask:NSViewWidthSizable ];
         [self addSubview: o_textfield];
     }
@@ -1224,34 +1158,34 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     [o_open_panel setAllowsMultipleSelection: NO];
     [o_open_panel setCanChooseFiles: !b_directory];
     [o_open_panel setCanChooseDirectories: b_directory];
-    [o_open_panel beginSheetForDirectory:nil
-        file:nil
-        types:nil
-        modalForWindow:[sender window]
-        modalDelegate: self
-        didEndSelector: @selector(pathChosenInPanel: 
-                        withReturn:
-                        contextInfo:)
-        contextInfo: nil];
-}
-
-- (void)pathChosenInPanel:(NSOpenPanel *)o_sheet
-    withReturn:(int)i_return_code contextInfo:(void  *)o_context_info
-{
-    if( i_return_code == NSOKButton )
-    {
-        NSString *o_path = [[o_sheet filenames] objectAtIndex: 0];
-        [o_textfield setStringValue: o_path];
-    }
+    [o_open_panel beginSheetModalForWindow:[sender window] completionHandler:^(NSInteger returnCode) {
+        if (returnCode == NSOKButton) {
+            NSString *o_path = [[[o_open_panel URLs] objectAtIndex:0] path];
+            [o_textfield setStringValue: o_path];
+        }        
+    }];
 }
 
 - (char *)stringValue
 {
-    if[[o_textfield stringValue] length] != 0)
-        return strdup( [[o_textfield stringValue] fileSystemRepresentation] );
+    if ([[o_textfield stringValue] length] != 0)
+        return strdup([[o_textfield stringValue] fileSystemRepresentation]);
     else
         return NULL;
 }
+
+-(void)resetValues
+{
+    NSString *o_textfieldString;
+    char *psz_value = config_GetPsz(VLCIntf, p_item->psz_name);
+    if (psz_value)
+        o_textfieldString = [NSString stringWithFormat: @"%s", psz_value];
+    else
+        o_textfieldString = @"";
+
+    free(psz_value);
+    [super resetValues];
+}
 @end
 
 @implementation ModuleConfigControl
@@ -1265,78 +1199,30 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        int i_index;
-        vlc_list_t *p_list;
-        module_t *p_parser;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_MODULE;
 
+        o_popupTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString )
+            o_labelString = @"";
+
+        ADD_LABEL(o_label, mainFrame, 0, -1, o_labelString, o_popupTooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the popup */
-        o_popupTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_POPUP( o_popup, mainFrame, [o_label frame].size.width,
-            -2, 0, o_popupTooltip )
+        ADD_POPUP(o_popup, mainFrame, [o_label frame].size.width,
+            -2, 0, o_popupTooltip)
         [o_popup setAutoresizingMask:NSViewWidthSizable ];
         [o_popup addItemWithTitle: _NS("Default")];
         [[o_popup lastItem] setTag: -1];
         [o_popup selectItem: [o_popup lastItem]];
 
-        /* build a list of available modules */
-        p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-        for( i_index = 0; i_index < p_list->i_count; i_index++ )
-        {
-            p_parser = (module_t *)p_list->p_values[i_index].p_object ;
-            if( p_item->i_type == CONFIG_ITEM_MODULE )
-            {
-                if( !strcmp( p_parser->psz_capability,
-                            p_item->psz_type ) )
-                {
-                    NSString *o_description = [[VLCMain sharedInstance]
-                        localizedString: p_parser->psz_longname];
-                    [o_popup addItemWithTitle: o_description];
-
-                    if( p_item->psz_value &&
-                !strcmp( p_item->psz_value, p_parser->psz_object_name ) )
-                        [o_popup selectItem:[o_popup lastItem]];
-                }
-            }
-            else
-            {
-                module_config_t *p_config;
-                if( !strcmp( p_parser->psz_object_name, "main" ) )
-                      continue;
-
-                p_config = p_parser->p_config;
-                if( p_config ) do
-                {
-                    /* Hack: required subcategory is stored in i_min */
-                    if( p_config->i_type == CONFIG_SUBCATEGORY &&
-                        p_config->i_value == p_item->i_min )
-                    {
-                        NSString *o_description = [[VLCMain sharedInstance]
-                            localizedString: p_parser->psz_longname];
-                        [o_popup addItemWithTitle: o_description];
-
-                        if( p_item->psz_value && !strcmp(p_item->psz_value,
-                                                p_parser->psz_object_name) )
-                            [o_popup selectItem:[o_popup lastItem]];
-                    }
-                } while( p_config->i_type != CONFIG_HINT_END && p_config++ );
-            }
-        }
-        vlc_list_release( p_list );
+        [self resetValues];
         [self addSubview: o_popup];
     }
     return self;
@@ -1366,55 +1252,74 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 {
     NSString *newval = [o_popup titleOfSelectedItem];
     char *returnval = NULL;
-    int i_index;
-    vlc_list_t *p_list;
-    module_t *p_parser;
-
-    p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-    for( i_index = 0; i_index < p_list->i_count; i_index++ )
-    {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object ;
-        if( p_item->i_type == CONFIG_ITEM_MODULE )
-        {
-            if( !strcmp( p_parser->psz_capability,
-                    p_item->psz_type ) )
-            {
-                NSString *o_description = [[VLCMain sharedInstance]
-                    localizedString: p_parser->psz_longname];
-                if( [newval isEqualToString: o_description] )
-                {
-                    returnval = strdup(p_parser->psz_object_name);
+    size_t i_module_index;
+    module_t *p_parser, **p_list;
+
+    size_t count;
+    p_list = module_list_get(&count);
+    for (i_module_index = 0; i_module_index < count; i_module_index++) {
+        p_parser = p_list[i_module_index];
+
+        if (module_is_main(p_parser))
+            continue;
+
+        unsigned int confsize;
+        module_config_t *p_config = module_config_get(p_parser, &confsize);
+        for (size_t i = 0; i < confsize; i++) {
+            module_config_t *p_cfg = p_config + i;
+            /* Hack: required subcategory is stored in i_min */
+            if (p_cfg->i_type == CONFIG_SUBCATEGORY &&
+                p_cfg->value.i == p_cfg->min.i) {
+                NSString *o_description = _NS(module_get_name(p_parser, TRUE));
+                if ([newval isEqualToString: o_description]) {
+                    returnval = strdup(module_get_object(p_parser));
                     break;
                 }
             }
+            module_config_free(p_config);
         }
-        else
-        {
-            module_config_t *p_config;
-            if( !strcmp( p_parser->psz_object_name, "main" ) )
-                  continue;
-
-            p_config = p_parser->p_config;
-            if( p_config ) do
-            {
-                /* Hack: required subcategory is stored in i_min */
-                if( p_config->i_type == CONFIG_SUBCATEGORY &&
-                    p_config->i_value == p_item->i_min )
-                {
-                    NSString *o_description = [[VLCMain sharedInstance]
-                        localizedString: p_parser->psz_longname];
-                    if( [newval isEqualToString: o_description] )
-                    {
-                        returnval = strdup(p_parser->psz_object_name);
-                        break;
-                    }
-                }
-            } while( p_config->i_type != CONFIG_HINT_END && p_config++ );
-        }
     }
-    vlc_list_release( p_list );
+    module_list_free(p_list);
+
+    if(returnval == NULL && [newval isEqualToString: _NS("Default")] && p_item->orig.psz != NULL) {
+        returnval = strdup(p_item->orig.psz);
+    }
     return returnval;
 }
+
+-(void)resetValues
+{
+    /* build a list of available modules */
+    module_t *p_parser, **p_list;
+
+    size_t count;
+    p_list = module_list_get(&count);
+    for (size_t i_index = 0; i_index < count; i_index++) {
+        p_parser = p_list[i_index];
+
+        if (module_is_main(p_parser))
+            continue;
+        unsigned int confsize;
+
+        module_config_t *p_configlist = module_config_get(p_parser, &confsize);
+        for (size_t i = 0; i < confsize; i++) {
+            module_config_t *p_config = &p_configlist[i];
+            /* Hack: required subcategory is stored in i_min */
+            if (p_config->i_type == CONFIG_SUBCATEGORY &&
+                p_config->value.i == p_item->min.i) {
+                NSString *o_description = _NS(module_get_name(p_parser, TRUE));
+                [o_popup addItemWithTitle: o_description];
+
+                if (p_item->value.psz && !strcmp(p_item->value.psz,
+                                                 module_get_object(p_parser)))
+                    [o_popup selectItem:[o_popup lastItem]];
+            }
+        }
+        module_config_free(p_configlist);
+    }
+    module_list_free(p_list);
+    [super resetValues];
+}
 @end
 
 @implementation IntegerConfigControl
@@ -1422,46 +1327,36 @@ if( MACOS_VERSION >= 10.3 )                                                 \
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip, *o_textfieldString;
+    NSString *o_labelString, *o_tooltip;
     mainFrame.size.height = 23;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_INTEGER;
 
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
 
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_tooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the stepper */
-        ADD_STEPPER( o_stepper, mainFrame, mainFrame.size.width - 19,
-            0, o_tooltip, -1600, 1600)
-        [o_stepper setIntValue: p_item->i_value];
+        ADD_STEPPER(o_stepper, mainFrame, mainFrame.size.width - 19,
+            0, o_tooltip, -100000, 100000)
+        [o_stepper setIntValue: p_item->value.i];
         [o_stepper setAutoresizingMask:NSViewMaxXMargin ];
         [self addSubview: o_stepper];
 
-        /* build the textfield */
-        if( p_item->psz_value )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: p_item->psz_value];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
-        ADD_TEXTFIELD( o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
-            1, 49, o_tooltip, @"" )
-        [o_textfield setIntValue: p_item->i_value];
+        ADD_TEXTFIELD(o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
+            1, 49, o_tooltip, @"")
+        [o_textfield setIntValue: p_item->value.i];
         [o_textfield setDelegate: self];
         [[NSNotificationCenter defaultCenter] addObserver: self
             selector: @selector(textfieldChanged:)
@@ -1511,6 +1406,12 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     return [o_textfield intValue];
 }
 
+-(void)resetValues
+{
+    [o_textfield setIntValue: config_GetInt(VLCIntf, p_item->psz_name)];
+    [super resetValues];
+}
+
 @end
 
 @implementation IntegerListConfigControl
@@ -1525,36 +1426,29 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        int i_index;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_STRING_LIST;
 
+        o_textfieldTooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_textfieldTooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_textfieldTooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_COMBO( o_combo, mainFrame, [o_label frame].size.width,
-            -2, 0, o_textfieldTooltip )
-        [o_combo setAutoresizingMask:NSViewWidthSizable ];
-        for( i_index = 0; i_index < p_item->i_list; i_index++ )
-        {
-            if( p_item->i_value == p_item->pi_list[i_index] )
-            {
-                [o_combo selectItemAtIndex: i_index];
-            }
-        }
-        [self addSubview: o_combo];
+        ADD_POPUP(o_popup, mainFrame, [o_label frame].size.width,
+            -2, 0, o_textfieldTooltip)
+        [o_popup setAutoresizingMask:NSViewWidthSizable ];
+
+        /* add items */
+        [self resetValues];
+        
+        [self addSubview: o_popup];
     }
     return self;
 }
@@ -1567,40 +1461,47 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     frame.origin.x = i_xPos - frame.size.width - 3;
     [o_label setFrame:frame];
 
-    frame = [o_combo frame];
+    frame = [o_popup frame];
     frame.origin.x = i_xPos + 2;
     frame.size.width = superFrame.size.width - frame.origin.x + 2;
-    [o_combo setFrame:frame];
+    [o_popup setFrame:frame];
 }
 
 - (void)dealloc
 {
-    [o_combo release];
+    [o_popup release];
     [super dealloc];
 }
 
 - (int)intValue
 {
-    if( [o_combo indexOfSelectedItem] >= 0 )
-        return p_item->pi_list[[o_combo indexOfSelectedItem]];
-    else
-        return [o_combo intValue];
+    NSNumber *p_valueobject = (NSNumber *)[[o_popup selectedItem] representedObject];
+    if (p_valueobject) {
+        assert([p_valueobject isKindOfClass:[NSNumber class]]);
+        return [p_valueobject intValue];
+    } else
+        return 0;
 }
-@end
 
-@implementation IntegerListConfigControl (NSComboBoxDataSource)
-- (int)numberOfItemsInComboBox:(NSComboBox *)aComboBox
+-(void)resetValues
 {
-    return p_item->i_list;
-}
+    [o_popup removeAllItems];
 
-- (id)comboBox:(NSComboBox *)aComboBox objectValueForItemAtIndex:(int)i_index
-{
-    if( p_item->ppsz_list_text && p_item->ppsz_list_text[i_index] )
-        return [[VLCMain sharedInstance]
-                    localizedString: p_item->ppsz_list_text[i_index]];
-    else
-        return [NSString stringWithFormat: @"%i", p_item->pi_list[i_index]];
+    int i_current_selection = config_GetInt(VLCIntf, p_item->psz_name);
+    int64_t *values;
+    char **texts;
+    ssize_t count = config_GetIntChoices(VLC_OBJECT(VLCIntf), p_item->psz_name, &values, &texts);
+    for (ssize_t i = 0; i < count; i++) {
+        NSMenuItem *mi = [[NSMenuItem alloc] initWithTitle: toNSStr(texts[i]) action: NULL keyEquivalent: @""];
+        [mi setRepresentedObject:[NSNumber numberWithInt:values[i]]];
+        [[o_popup menu] addItem: [mi autorelease]];
+
+        if (i_current_selection == values[i])
+            [o_popup selectItem:[o_popup lastItem]];
+
+        free(texts[i]);
+    }
+    free(texts);
 }
 @end
 
@@ -1615,27 +1516,24 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_RANGED_INTEGER;
 
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_tooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2,
-            28, 49, o_tooltip, @"" )
-        [o_textfield setIntValue: p_item->i_value];
+        ADD_TEXTFIELD(o_textfield, mainFrame, [o_label frame].size.width + 2,
+            28, 49, o_tooltip, @"")
+        [o_textfield setIntValue: p_item->value.i];
         [o_textfield setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield setDelegate: self];
         [[NSNotificationCenter defaultCenter] addObserver: self
@@ -1645,27 +1543,27 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         [self addSubview: o_textfield];
 
         /* build the mintextfield */
-        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888" )
-        [o_textfield_min setIntValue: p_item->i_min];
+        ADD_LABEL(o_textfield_min, mainFrame, 12, -30, @"-8888", @"")
+        [o_textfield_min setIntValue: p_item->min.i];
         [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield_min setAlignment:NSRightTextAlignment];
         [self addSubview: o_textfield_min];
 
         /* build the maxtextfield */
-        ADD_LABEL( o_textfield_max, mainFrame,
-                    mainFrame.size.width - 31, -30, @"8888" )
-        [o_textfield_max setIntValue: p_item->i_max];
+        ADD_LABEL(o_textfield_max, mainFrame,
+                    mainFrame.size.width - 31, -30, @"8888", @"")
+        [o_textfield_max setIntValue: p_item->max.i];
         [o_textfield_max setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_textfield_max];
 
         /* build the slider */
-        ADD_SLIDER( o_slider, mainFrame, [o_textfield_min frame].origin.x +
+        ADD_SLIDER(o_slider, mainFrame, [o_textfield_min frame].origin.x +
             [o_textfield_min frame].size.width + 6, -1, mainFrame.size.width -
             [o_textfield_max frame].size.width -
             [o_textfield_max frame].size.width - 14 -
             [o_textfield_min frame].origin.x, o_tooltip,
-            p_item->i_min, p_item->i_max )
-        [o_slider setIntValue: p_item->i_value];
+            p_item->min.i, p_item->max.i)
+        [o_slider setIntValue: p_item->value.i];
         [o_slider setAutoresizingMask:NSViewWidthSizable ];
         [o_slider setTarget: self];
         [o_slider setAction: @selector(sliderChanged:)];
@@ -1712,6 +1610,14 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 {
     return [o_slider intValue];
 }
+
+- (void)resetValues
+{
+    int value = config_GetInt(VLCIntf, p_item->psz_name);
+    [o_textfield setIntValue:value];
+    [o_slider setIntValue:value];
+    [super resetValues];
+}
 @end
 
 @implementation FloatConfigControl
@@ -1719,46 +1625,37 @@ if( MACOS_VERSION >= 10.3 )                                                 \
            withView: (NSView *)o_parent_view
 {
     NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip, *o_textfieldString;
+    NSString *o_labelString, *o_tooltip;
     mainFrame.size.height = 23;
     mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_INTEGER;
 
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
 
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -2, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -2, o_labelString, o_tooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the stepper */
-        ADD_STEPPER( o_stepper, mainFrame, mainFrame.size.width - 19,
-            0, o_tooltip, -1600, 1600)
-        [o_stepper setFloatValue: p_item->f_value];
+        ADD_STEPPER(o_stepper, mainFrame, mainFrame.size.width - 19,
+            0, o_tooltip, -100000, 100000)
+        [o_stepper setFloatValue: p_item->value.f];
         [o_stepper setAutoresizingMask:NSViewMaxXMargin ];
         [self addSubview: o_stepper];
 
         /* build the textfield */
-        if( p_item->psz_value )
-            o_textfieldString = [[VLCMain sharedInstance]
-                                    localizedString: p_item->psz_value];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
-        ADD_TEXTFIELD( o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
-            1, 49, o_tooltip, @"" )
-        [o_textfield setFloatValue: p_item->f_value];
+        ADD_TEXTFIELD(o_textfield, mainFrame, mainFrame.size.width - 19 - 52,
+            1, 49, o_tooltip, @"")
+        [o_textfield setFloatValue: p_item->value.f];
         [o_textfield setDelegate: self];
         [[NSNotificationCenter defaultCenter] addObserver: self
             selector: @selector(textfieldChanged:)
@@ -1807,6 +1704,12 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 {
     return [o_stepper floatValue];
 }
+
+- (void)resetValues
+{
+    [o_textfield setFloatValue: config_GetFloat(VLCIntf, p_item->psz_name)];
+    [super resetValues];
+}
 @end
 
 @implementation RangedFloatConfigControl
@@ -1820,27 +1723,24 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_RANGED_INTEGER;
 
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -3, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_tooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the textfield */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2,
-            28, 49, o_tooltip, @"" )
-        [o_textfield setFloatValue: p_item->f_value];
+        ADD_TEXTFIELD(o_textfield, mainFrame, [o_label frame].size.width + 2,
+            28, 49, o_tooltip, @"")
+        [o_textfield setFloatValue: p_item->value.f];
         [o_textfield setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield setDelegate: self];
         [[NSNotificationCenter defaultCenter] addObserver: self
@@ -1850,27 +1750,27 @@ if( MACOS_VERSION >= 10.3 )                                                 \
         [self addSubview: o_textfield];
 
         /* build the mintextfield */
-        ADD_LABEL( o_textfield_min, mainFrame, 12, -30, @"-8888" )
-        [o_textfield_min setFloatValue: p_item->f_min];
+        ADD_LABEL(o_textfield_min, mainFrame, 12, -30, @"-8888", @"")
+        [o_textfield_min setFloatValue: p_item->min.f];
         [o_textfield_min setAutoresizingMask:NSViewMaxXMargin ];
         [o_textfield_min setAlignment:NSRightTextAlignment];
         [self addSubview: o_textfield_min];
 
         /* build the maxtextfield */
-        ADD_LABEL( o_textfield_max, mainFrame, mainFrame.size.width - 31,
-            -30, @"8888" )
-        [o_textfield_max setFloatValue: p_item->f_max];
+        ADD_LABEL(o_textfield_max, mainFrame, mainFrame.size.width - 31,
+            -30, @"8888", @"")
+        [o_textfield_max setFloatValue: p_item->max.f];
         [o_textfield_max setAutoresizingMask:NSViewMinXMargin ];
         [self addSubview: o_textfield_max];
 
         /* build the slider */
-        ADD_SLIDER( o_slider, mainFrame, [o_textfield_min frame].origin.x +
+        ADD_SLIDER(o_slider, mainFrame, [o_textfield_min frame].origin.x +
             [o_textfield_min frame].size.width + 6, -1, mainFrame.size.width -
             [o_textfield_max frame].size.width -
             [o_textfield_max frame].size.width - 14 -
-            [o_textfield_min frame].origin.x, o_tooltip, p_item->f_min,
-            p_item->f_max )
-        [o_slider setFloatValue: p_item->f_value];
+            [o_textfield_min frame].origin.x, o_tooltip, p_item->min.f,
+            p_item->max.f)
+        [o_slider setFloatValue: p_item->value.f];
         [o_slider setAutoresizingMask:NSViewWidthSizable ];
         [o_slider setTarget: self];
         [o_slider setAction: @selector(sliderChanged:)];
@@ -1918,6 +1818,12 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     return [o_slider floatValue];
 }
 
+- (void)resetValues
+{
+    [o_textfield setFloatValue: config_GetFloat(VLCIntf, p_item->psz_name)];
+    [o_slider setFloatValue: config_GetFloat(VLCIntf, p_item->psz_name)];
+    [super resetValues];
+}
 @end
 
 @implementation BoolConfigControl
@@ -1932,27 +1838,21 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
         i_view_type = CONFIG_ITEM_BOOL;
 
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
+        else
+            o_labelString = @"";
+
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
         /* 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)
+        ADD_CHECKBOX(o_checkbox, mainFrame, 0,
+                        0, o_labelString, o_tooltip, p_item->value.i, 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, [o_checkbox frame].size.width, 0, o_labelString )
-        [o_label setAutoresizingMask:NSViewNotSizable ];
-        [self addSubview: o_label];
     }
     return self;
 }
@@ -1968,157 +1868,14 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     return [o_checkbox intValue];
 }
 
-@end
-
-@implementation KeyConfigControlBefore103
-
-- (id) initWithItem: (module_config_t *)_p_item
-           withView: (NSView *)o_parent_view
-{
-    NSRect mainFrame = [o_parent_view frame];
-    NSString *o_labelString, *o_tooltip;
-    mainFrame.size.height = 37;
-    mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 1;
-    mainFrame.origin.x = LEFTMARGIN;
-    mainFrame.origin.y = 0;
-
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        i_view_type = CONFIG_ITEM_KEY_BEFORE_10_3;
-
-        /* 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, -10, o_labelString )
-        [o_label setAutoresizingMask:NSViewNotSizable ];
-        [self addSubview: o_label];
-
-        /* add the checkboxes */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_CHECKBOX( o_cmd_checkbox, mainFrame,
-            [o_label frame].size.width + 2, 0,
-            [NSString stringWithUTF8String:PLACE_OF_INTEREST_SIGN], o_tooltip,
-            ((((unsigned int)p_item->i_value) & KEY_MODIFIER_COMMAND)?YES:NO),
-            NSImageLeft )
-        [o_cmd_checkbox setState: p_item->i_value & KEY_MODIFIER_COMMAND];
-        ADD_CHECKBOX( o_ctrl_checkbox, mainFrame,
-            [o_cmd_checkbox frame].size.width +
-            [o_cmd_checkbox frame].origin.x + 6, 0,
-            [NSString stringWithUTF8String:UP_ARROWHEAD], o_tooltip,
-            ((((unsigned int)p_item->i_value) & KEY_MODIFIER_CTRL)?YES:NO),
-            NSImageLeft )
-        [o_ctrl_checkbox setState: p_item->i_value & KEY_MODIFIER_CTRL];
-        ADD_CHECKBOX( o_alt_checkbox, mainFrame, [o_label frame].size.width +
-            2, -2 - [o_cmd_checkbox frame].size.height,
-            [NSString stringWithUTF8String:OPTION_KEY], o_tooltip,
-            ((((unsigned int)p_item->i_value) & KEY_MODIFIER_ALT)?YES:NO),
-            NSImageLeft )
-        [o_alt_checkbox setState: p_item->i_value & KEY_MODIFIER_ALT];
-        ADD_CHECKBOX( o_shift_checkbox, mainFrame,
-            [o_cmd_checkbox frame].size.width +
-            [o_cmd_checkbox frame].origin.x + 6, -2 -
-            [o_cmd_checkbox frame].size.height,
-            [NSString stringWithUTF8String:UPWARDS_WHITE_ARROW], o_tooltip,
-            ((((unsigned int)p_item->i_value) & KEY_MODIFIER_SHIFT)?YES:NO),
-            NSImageLeft )
-        [o_shift_checkbox setState: p_item->i_value & KEY_MODIFIER_SHIFT];
-        [self addSubview: o_cmd_checkbox];
-        [self addSubview: o_ctrl_checkbox];
-        [self addSubview: o_alt_checkbox];
-        [self addSubview: o_shift_checkbox];
-
-        /* build the popup */
-        ADD_POPUP( o_popup, mainFrame, [o_shift_checkbox frame].origin.x +
-            [o_shift_checkbox frame].size.width + 4,
-            4, 0, o_tooltip )
-        [o_popup setAutoresizingMask:NSViewWidthSizable ];
-
-        if( o_keys_menu == nil )
-        {
-            unsigned int i;
-            o_keys_menu = [[NSMenu alloc] initWithTitle: @"Keys Menu"];
-            for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++)
-                if( vlc_keys[i].psz_key_string && *vlc_keys[i].psz_key_string )
-                    POPULATE_A_KEY( o_keys_menu,
-                        [NSString stringWithCString:vlc_keys[i].psz_key_string]
-                        , vlc_keys[i].i_key_code)
-        }
-        [o_popup setMenu:[o_keys_menu copyWithZone:nil]];
-        [o_popup selectItemWithTitle: [[VLCMain sharedInstance]
-            localizedString:KeyToString(
-            (((unsigned int)p_item->i_value) & ~KEY_MODIFIER ))]];
-        [self addSubview: o_popup];
-    }
-    return self;
-}
-
-- (void) alignWithXPosition:(int)i_xPos
-{
-    NSRect frame;
-    NSRect superFrame = [self frame];
-    frame = [o_label frame];
-    frame.origin.x = i_xPos - frame.size.width - 3;
-    [o_label setFrame:frame];
-
-    frame = [o_cmd_checkbox frame];
-    frame.origin.x = i_xPos;
-    [o_cmd_checkbox setFrame:frame];
-
-    frame = [o_ctrl_checkbox frame];
-    frame.origin.x = [o_cmd_checkbox frame].size.width +
-                        [o_cmd_checkbox frame].origin.x + 4;
-    [o_ctrl_checkbox setFrame:frame];
-
-    frame = [o_alt_checkbox frame];
-    frame.origin.x = i_xPos;
-    [o_alt_checkbox setFrame:frame];
-
-    frame = [o_shift_checkbox frame];
-    frame.origin.x = [o_cmd_checkbox frame].size.width +
-                        [o_cmd_checkbox frame].origin.x + 4;
-    [o_shift_checkbox setFrame:frame];
-
-    frame = [o_popup frame];
-    frame.origin.x = [o_shift_checkbox frame].origin.x +
-                        [o_shift_checkbox frame].size.width + 3;
-    frame.size.width = superFrame.size.width - frame.origin.x + 2;
-    [o_popup setFrame:frame];
-}
-
-- (void)dealloc
-{
-    [o_cmd_checkbox release];
-    [o_ctrl_checkbox release];
-    [o_alt_checkbox release];
-    [o_shift_checkbox release];
-    [o_popup release];
-    [super dealloc];
-}
-
-- (int)intValue
+- (void)resetValues
 {
-    unsigned int i_new_key = 0;
-
-    i_new_key |= ([o_cmd_checkbox state] == NSOnState) ?
-        KEY_MODIFIER_COMMAND : 0;
-    i_new_key |= ([o_ctrl_checkbox state] == NSOnState) ?
-        KEY_MODIFIER_CTRL : 0;
-    i_new_key |= ([o_alt_checkbox state] == NSOnState) ?
-        KEY_MODIFIER_ALT : 0;
-    i_new_key |= ([o_shift_checkbox state] == NSOnState) ?
-        KEY_MODIFIER_SHIFT : 0;
-
-    i_new_key |= StringToKey((char *)[[[o_popup selectedItem] title] cString]);
-    return i_new_key;
+    [o_checkbox setState: config_GetInt(VLCIntf, p_item->psz_name)];
+    [super resetValues];
 }
 @end
 
-@implementation KeyConfigControlAfter103
+@implementation KeyConfigControl
 - (id) initWithItem: (module_config_t *)_p_item
            withView: (NSView *)o_parent_view
 {
@@ -2129,41 +1886,40 @@ if( MACOS_VERSION >= 10.3 )                                                 \
     mainFrame.origin.x = LEFTMARGIN;
     mainFrame.origin.y = 0;
 
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        i_view_type = CONFIG_ITEM_KEY_AFTER_10_3;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
+        i_view_type = CONFIG_ITEM_KEY;
+
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
 
         /* add the label */
-        if( p_item->psz_text )
-            o_labelString = [[VLCMain sharedInstance]
-                localizedString: p_item->psz_text];
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
         else
-            o_labelString = [NSString stringWithString:@""];
-        ADD_LABEL( o_label, mainFrame, 0, -1, o_labelString )
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -1, o_labelString, o_tooltip)
         [o_label setAutoresizingMask:NSViewNotSizable ];
         [self addSubview: o_label];
 
         /* build the popup */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        ADD_POPUP( o_popup, mainFrame, [o_label frame].origin.x +
+        ADD_POPUP(o_popup, mainFrame, [o_label frame].origin.x +
             [o_label frame].size.width + 3,
-            -2, 0, o_tooltip )
+            -2, 0, o_tooltip)
         [o_popup setAutoresizingMask:NSViewWidthSizable ];
 
-        if( o_keys_menu == nil )
-        {
+        if (o_keys_menu == nil) {
             unsigned int i;
             o_keys_menu = [[NSMenu alloc] initWithTitle: @"Keys Menu"];
-            for ( i = 0; i < sizeof(vlc_keys) / sizeof(key_descriptor_t); i++)
-                if( vlc_keys[i].psz_key_string && *vlc_keys[i].psz_key_string )
-                    POPULATE_A_KEY( o_keys_menu,
-                        [NSString stringWithCString:vlc_keys[i].psz_key_string]
-                        , vlc_keys[i].i_key_code)
+#warning This does not work anymore. FIXME.
+#if 0
+            for (i = 0; i < sizeof(vlc_key) / sizeof(key_descriptor_t); i++)
+                if (vlc_key[i].psz_key_string)
+                    POPULATE_A_KEY(o_keys_menu,
+                        [NSString stringWithUTF8String:vlc_key[i].psz_key_string],
+                                   vlc_key[i].i_key_code)
+#endif
         }
         [o_popup setMenu:[o_keys_menu copyWithZone:nil]];
-        [o_popup selectItem:[[o_popup menu] itemWithTag:p_item->i_value]];
+        [o_popup selectItem:[[o_popup menu] itemWithTag:p_item->value.i]];
         [self addSubview: o_popup];
 
     }
@@ -2194,115 +1950,119 @@ if( MACOS_VERSION >= 10.3 )                                                 \
 {
     return [o_popup selectedTag];
 }
+
+- (void)resetValues
+{
+    [o_popup selectItem:[[o_popup menu] itemWithTag:config_GetInt(VLCIntf, p_item->psz_name)]];
+    [super resetValues];
+}
 @end
 
 @implementation ModuleListConfigControl
 - (id) initWithItem: (module_config_t *)_p_item
            withView: (NSView *)o_parent_view
 {
-if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
-//TODO....
-        return nil;
+    BOOL b_by_cat = _p_item->i_type == CONFIG_ITEM_MODULE_LIST_CAT;
 
-//Fill our array to know how may items we have...
-    vlc_list_t *p_list;
-    module_t *p_parser;
-    int i_index;
+    //Fill our array to know how may items we have...
+    module_t *p_parser, **p_list;
+    size_t i_module_index;
     NSRect mainFrame = [o_parent_view frame];
     NSString *o_labelString, *o_textfieldString, *o_tooltip;
 
     o_modulearray = [[NSMutableArray alloc] initWithCapacity:10];
     /* build a list of available modules */
-    p_list = vlc_list_find( VLCIntf, VLC_OBJECT_MODULE, FIND_ANYWHERE );
-    for( i_index = 0; i_index < p_list->i_count; i_index++ )
-    {
-        p_parser = (module_t *)p_list->p_values[i_index].p_object ;
+    size_t count;
+    p_list = module_list_get(&count);
+    for (i_module_index = 0; i_module_index < count; i_module_index++) {
+        int i;
+        p_parser = p_list[i_module_index];
 
-        if( !strcmp( p_parser->psz_object_name, "main" ) )
+        if (module_is_main(p_parser))
             continue;
 
-        module_config_t *p_config = p_parser->p_config;
-        if( p_config ) do
-        {
-            NSString *o_modulelongname, *o_modulename;
-            NSNumber *o_moduleenabled = nil;
-            /* Hack: required subcategory is stored in i_min */
-            if( p_config->i_type == CONFIG_SUBCATEGORY &&
-                p_config->i_value == _p_item->i_min )
-            {
-                o_modulelongname = [NSString stringWithUTF8String:
-                                        p_parser->psz_longname];
-                o_modulename = [NSString stringWithUTF8String:
-                                        p_parser->psz_object_name];
-
-                if( _p_item->psz_value &&
-                    strstr( _p_item->psz_value, p_parser->psz_object_name ) )
-                    o_moduleenabled = [NSNumber numberWithBool:YES];
-                else
-                    o_moduleenabled = [NSNumber numberWithBool:NO];
-
-                [o_modulearray addObject:[NSMutableArray
-                    arrayWithObjects: o_modulename, o_modulelongname,
-                    o_moduleenabled, nil]];
+        if (b_by_cat) {
+            unsigned int confsize;
+            module_config_t *p_configlist = module_config_get(p_parser, &confsize);
+
+            for (i = 0; i < confsize; i++) {
+                unsigned int unused;
+                module_config_t *p_config = &p_configlist[i];
+                NSString *o_modulelongname, *o_modulename;
+                NSNumber *o_moduleenabled = nil;
+
+                /* Hack: required subcategory is stored in i_min */
+                if (p_config->i_type == CONFIG_SUBCATEGORY &&
+                    p_config->value.i == _p_item->min.i) {
+
+                    o_modulelongname = [NSString stringWithUTF8String:module_get_name(p_parser, TRUE)];
+                    o_modulename = [NSString stringWithUTF8String:module_get_object(p_parser)];
+
+                    if (_p_item->value.psz &&
+                        strstr(_p_item->value.psz, module_get_object(p_parser)))
+                        o_moduleenabled = [NSNumber numberWithBool:YES];
+                    else
+                        o_moduleenabled = [NSNumber numberWithBool:NO];
+
+                    [o_modulearray addObject:[NSMutableArray
+                                              arrayWithObjects: o_modulename, o_modulelongname,
+                                              o_moduleenabled, nil]];
+                }
+
+                /* Parental Advisory HACK:
+                 * Selecting HTTP, RC and Telnet interfaces is difficult now
+                 * since they are just the lua interface module */
+                if (p_config->i_type == CONFIG_SUBCATEGORY &&
+                    !strcmp(module_get_object(p_parser), "lua") &&
+                    !strcmp(_p_item->psz_name, "extraintf") &&
+                    p_config->value.i == _p_item->min.i) {
+
+#define addLuaIntf(shortname, longname) \
+if (_p_item->value.psz && strstr(_p_item->value.psz, shortname))\
+    o_moduleenabled = [NSNumber numberWithBool:YES];\
+else\
+    o_moduleenabled = [NSNumber numberWithBool:NO];\
+    [o_modulearray addObject:[NSMutableArray arrayWithObjects: @shortname, _NS(longname), o_moduleenabled, nil]]
+
+                    addLuaIntf("http", "Web");
+                    addLuaIntf("telnet", "Telnet");
+                    addLuaIntf("cli", "Console");
+#undef addLuaIntf
+                }
+
             }
-        } while( p_config->i_type != CONFIG_HINT_END && p_config++ );
-    }
-    vlc_list_release( p_list );
+            module_config_free(p_configlist);
 
-    mainFrame.size.height = 30 + 18 * [o_modulearray count];
-    mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
-    mainFrame.origin.x = LEFTMARGIN;
-    mainFrame.origin.y = 0;
-    if( [super initWithFrame: mainFrame item: _p_item] != nil )
-    {
-        i_view_type = CONFIG_ITEM_MODULE_LIST;
 
-        /* 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, -3, o_labelString )
-        [o_label setAutoresizingMask:NSViewNotSizable ];
-        [self addSubview: o_label];
+        } else if (module_provides(p_parser, _p_item->psz_type)) {
 
-        /* build the textfield */
-        o_tooltip = [[VLCMain sharedInstance] wrapString:
-            [[VLCMain sharedInstance]
-                localizedString: p_item->psz_longtext ] toWidth: PREFS_WRAP];
-        if( p_item->psz_value )
-            o_textfieldString = [[VLCMain sharedInstance]
-                localizedString: p_item->psz_value];
-        else
-            o_textfieldString = [NSString stringWithString: @""];
-        ADD_TEXTFIELD( o_textfield, mainFrame, [o_label frame].size.width + 2,
-            mainFrame.size.height - 22, mainFrame.size.width -
-            [o_label frame].size.width - 2, o_tooltip, o_textfieldString )
-        [o_textfield setAutoresizingMask:NSViewWidthSizable ];
-        [self addSubview: o_textfield];
+            NSString *o_modulelongname = toNSStr(module_get_name(p_parser, TRUE));
+            NSString *o_modulename = toNSStr(module_get_object(p_parser));
+
+            NSNumber *o_moduleenabled = nil;
+            if (_p_item->value.psz &&
+                strstr(_p_item->value.psz, module_get_object(p_parser)))
+                o_moduleenabled = [NSNumber numberWithBool:YES];
+            else
+                o_moduleenabled = [NSNumber numberWithBool:NO];
 
+            [o_modulearray addObject:[NSMutableArray
+                                      arrayWithObjects: o_modulename, o_modulelongname,
+                                      o_moduleenabled, nil]];
+        }
 
-{
-    NSRect s_rc = mainFrame;
-    s_rc.size.height = mainFrame.size.height - 30;
-    s_rc.size.width = mainFrame.size.width - 12;
-    s_rc.origin.x = 12;
-    s_rc.origin.y = 0;
-    o_scrollview = [[[NSScrollView alloc] initWithFrame: s_rc] retain];
-    [o_scrollview setDrawsBackground: NO];
-    [o_scrollview setBorderType: NSBezelBorder];
-    if( MACOS_VERSION >= 10.3 )
-        [o_scrollview setAutohidesScrollers:YES];
+    } /* FOR i_module_index */
+    module_list_free(p_list);
 
-    NSTableView *o_tableview;
+    // First, initialize and draw the table view to get its height
+    // width is increased a little to fix horizontal auto-sizing
+    NSRect s_rc = NSMakeRect(12, 10, mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN + 18, 50);
+    // height is automatically increased as needed
     o_tableview = [[NSTableView alloc] initWithFrame : s_rc];
-    if( MACOS_VERSION >= 10.3 )
-        [o_tableview setUsesAlternatingRowBackgroundColors:YES];
+    [o_tableview setUsesAlternatingRowBackgroundColors:YES];
     [o_tableview setHeaderView:nil];
-/* TODO: find a good way to fix the row height and text size*/
-/* FIXME: support for multiple selection... */
-//    [o_tableview setAllowsMultipleSelection:YES];
+    /* FIXME: support for multiple selection... */
+    //    [o_tableview setAllowsMultipleSelection:YES];
 
     NSCell *o_headerCell = [[NSCell alloc] initTextCell:@"Enabled"];
     NSCell *o_dataCell = [[NSButtonCell alloc] init];
@@ -2310,7 +2070,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     [o_dataCell setTitle:@""];
     [o_dataCell setFont:[NSFont systemFontOfSize:0]];
     NSTableColumn *o_tableColumn = [[NSTableColumn alloc]
-        initWithIdentifier:[NSString stringWithCString: "Enabled"]];
+                                    initWithIdentifier:@"Enabled"];
     [o_tableColumn setHeaderCell: o_headerCell];
     [o_tableColumn setDataCell: o_dataCell];
     [o_tableColumn setWidth:17];
@@ -2320,25 +2080,54 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     o_dataCell = [[NSTextFieldCell alloc] init];
     [o_dataCell setFont:[NSFont systemFontOfSize:12]];
     o_tableColumn = [[NSTableColumn alloc]
-        initWithIdentifier:[NSString stringWithCString: "Module"]];
+                     initWithIdentifier:@"Module"];
     [o_tableColumn setHeaderCell: o_headerCell];
     [o_tableColumn setDataCell: o_dataCell];
-    [o_tableColumn setWidth:388 - 17];
+    [o_tableColumn setWidth:s_rc.size.width - 34];
     [o_tableview addTableColumn: o_tableColumn];
-    [o_tableview registerForDraggedTypes:[NSArray arrayWithObjects:
-            @"VLC media player module", nil]];
+    [o_tableview registerForDraggedTypes:[NSArray arrayWithObject:@"VLC media player module"]];
 
     [o_tableview setDataSource:self];
     [o_tableview setTarget: self];
     [o_tableview setAction: @selector(tableChanged:)];
     [o_tableview sendActionOn:NSLeftMouseUpMask | NSLeftMouseDownMask |
-        NSLeftMouseDraggedMask];
-    [o_scrollview setDocumentView: o_tableview];
-}
-    [o_scrollview setAutoresizingMask:NSViewWidthSizable ];
-    [self addSubview: o_scrollview];
+     NSLeftMouseDraggedMask];
+
+    [o_tableview reloadData];
+    [o_tableview setAutoresizingMask: NSViewWidthSizable];
 
+    CGFloat tableview_height = [o_tableview frame].size.height;
 
+    mainFrame.size.height = 40 + tableview_height;
+    mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
+    mainFrame.origin.x = LEFTMARGIN;
+    mainFrame.origin.y = 0;
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
+        i_view_type = CONFIG_ITEM_MODULE_LIST;
+
+        o_tooltip = [[VLCStringUtility sharedInstance] wrapString: _NS((char *)p_item->psz_longtext) toWidth: PREFS_WRAP];
+
+        /* add the label */
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
+        else
+            o_labelString = @"";
+        ADD_LABEL(o_label, mainFrame, 0, -3, o_labelString, o_tooltip)
+        [o_label setAutoresizingMask:NSViewNotSizable ];
+        [self addSubview: o_label];
+
+        /* build the textfield */
+        if (p_item->value.psz)
+            o_textfieldString = _NS((char *)p_item->value.psz);
+        else
+            o_textfieldString = @"";
+        ADD_TEXTFIELD(o_textfield, mainFrame, [o_label frame].size.width + 2,
+                      mainFrame.size.height - 22, mainFrame.size.width -
+                      [o_label frame].size.width - 2, o_tooltip, o_textfieldString)
+        [o_textfield setAutoresizingMask:NSViewWidthSizable ];
+        [self addSubview: o_textfield];
+
+        [self addSubview: o_tableview];
     }
     return self;
 }
@@ -2351,11 +2140,10 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 - (IBAction)tableChanged:(id)sender
 {
     NSString *o_newstring = @"";
-    unsigned int i;
-    for( i = 0 ; i < [o_modulearray count] ; i++ )
-        if( [[[o_modulearray objectAtIndex:i] objectAtIndex:2]
-            boolValue] != NO )
-        {
+    NSUInteger count = [o_modulearray count];
+    for (NSUInteger i = 0 ; i < count ; i++)
+        if ([[[o_modulearray objectAtIndex:i] objectAtIndex:2]
+            boolValue] != NO) {
             o_newstring = [o_newstring stringByAppendingString:
                 [[o_modulearray objectAtIndex:i] objectAtIndex:0]];
             o_newstring = [o_newstring stringByAppendingString:@":"];
@@ -2367,14 +2155,21 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 
 - (void)dealloc
 {
-    [o_scrollview release];
+    [o_tableview release];
     [super dealloc];
 }
 
 
 - (char *)stringValue
 {
-    return strdup( [[o_textfield stringValue] cString] );
+    return strdup([[o_textfield stringValue] UTF8String]);
+}
+
+-(void)resetValues
+{
+#warning Reset prefs of the module selector is broken atm.
+    msg_Err(VLCIntf, "don't forget about modulelistconfig");
+    [super resetValues];
 }
 
 @end
@@ -2387,25 +2182,22 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     // We only want to allow dragging of selected rows.
     NSEnumerator    *iter = [rows objectEnumerator];
     NSNumber        *row;
-    while ((row = [iter nextObject]) != nil)
-    {
+    while ((row = [iter nextObject]) != nil) {
         if (![table isRowSelected:[row intValue]])
             return NO;
     }
 
-    [pb declareTypes:[NSArray
-        arrayWithObject:@"VLC media player module"] owner:nil];
+    [pb declareTypes:[NSArray arrayWithObject:@"VLC media player module"] owner:nil];
     [pb setPropertyList:rows forType:@"VLC media player module"];
     return YES;
 }
 
 - (NSDragOperation)tableView:(NSTableView*)table
-    validateDrop:(id <NSDraggingInfo>)info proposedRow:(int)row
+    validateDrop:(id <NSDraggingInfo>)info proposedRow:(NSInteger)row
     proposedDropOperation:(NSTableViewDropOperation)op
 {
     // Make drops at the end of the table go to the end.
-    if (row == -1)
-    {
+    if (row == -1) {
         row = [table numberOfRows];
         op = NSTableViewDropAbove;
         [table setDropRow:row dropOperation:op];
@@ -2418,7 +2210,7 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 }
 
 - (BOOL)tableView:(NSTableView*)table acceptDrop:(id <NSDraggingInfo>)info
-    row:(int)dropRow dropOperation:(NSTableViewDropOperation)op;
+    row:(NSInteger)dropRow dropOperation:(NSTableViewDropOperation)op;
 {
     NSPasteboard    *pb = [info draggingPasteboard];
     NSDragOperation srcMask = [info draggingSourceOperationMask];
@@ -2430,15 +2222,13 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
 
         // Intra-table drag - data is the array of rows.
         if (!accepted && (array =
-            [pb propertyListForType:@"VLC media player module"]) != NULL)
-        {
+            [pb propertyListForType:@"VLC media player module"]) != NULL) {
             NSEnumerator *iter = nil;
             id val;
             BOOL isCopy = (srcMask & NSDragOperationMove) ? NO:YES;
             // Move the modules
             iter = [array objectEnumerator];
-            while ((val = [iter nextObject]) != NULL)
-            {
+            while ((val = [iter nextObject]) != NULL) {
                 NSArray *o_tmp = [[o_modulearray objectAtIndex:
                     [val intValue]] mutableCopyWithZone:nil];
                 [o_modulearray removeObject:o_tmp];
@@ -2472,28 +2262,67 @@ if( _p_item->i_type == CONFIG_ITEM_MODULE_LIST )
     return accepted;
 }
 
-- (int)numberOfRowsInTableView:(NSTableView *)aTableView
+- (NSInteger)numberOfRowsInTableView:(NSTableView *)aTableView
 {
     return [o_modulearray count];
 }
 
 - (id)tableView:(NSTableView *)aTableView
-    objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
+    objectValueForTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
 {
-    if( [[aTableColumn identifier] isEqualToString:
-        [NSString stringWithCString:"Enabled"]] )
+    if ([[aTableColumn identifier] isEqualToString: @"Enabled"])
         return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:2];
-    if( [[aTableColumn identifier] isEqualToString:
-        [NSString stringWithCString:"Module"]] )
+    if ([[aTableColumn identifier] isEqualToString: @"Module"])
         return [[o_modulearray objectAtIndex:rowIndex] objectAtIndex:1];
 
     return nil;
 }
 
 - (void)tableView:(NSTableView *)aTableView setObjectValue:(id)anObject
-    forTableColumn:(NSTableColumn *)aTableColumn row:(int)rowIndex
+    forTableColumn:(NSTableColumn *)aTableColumn row:(NSInteger)rowIndex
 {
     [[o_modulearray objectAtIndex:rowIndex] replaceObjectAtIndex:2
         withObject: anObject];
 }
 @end
+
+@implementation SectionControl
+
+- (id) initWithItem: (module_config_t *)_p_item
+           withView: (NSView *)o_parent_view
+{
+    NSRect mainFrame = [o_parent_view frame];
+    NSString *o_labelString, *o_tooltip;
+    mainFrame.size.height = 17;
+    mainFrame.size.width = mainFrame.size.width - LEFTMARGIN - RIGHTMARGIN;
+    mainFrame.origin.x = LEFTMARGIN;
+    mainFrame.origin.y = 0;
+
+    if ([super initWithFrame: mainFrame item: _p_item] != nil) {
+        
+        /* add the label */
+        if (p_item->psz_text)
+            o_labelString = _NS((char *)p_item->psz_text);
+        else
+            o_labelString = @"";
+
+        NSDictionary *boldAttributes = [NSDictionary dictionaryWithObjectsAndKeys:
+                        [NSFont boldSystemFontOfSize:[NSFont systemFontSize]],
+                        NSFontAttributeName,
+                        nil];
+        NSAttributedString *o_bold_string = [[NSAttributedString alloc] initWithString: o_labelString attributes: boldAttributes];
+
+        ADD_LABEL(o_label, mainFrame, 1, 0, @"", @"")
+        [o_label setAttributedStringValue: o_bold_string];
+        [o_label sizeToFit];
+
+        [o_bold_string release];
+        
+        [o_label setAutoresizingMask:NSViewNotSizable];
+        [self addSubview: o_label];
+    }
+    return self;
+}
+
+@end
+