Don't show unsaveable options in the preferences
[vlc.git] / modules / gui / wxwidgets / dialogs / preferences_widgets.cpp
index 6a8330b..3910e10 100644 (file)
@@ -39,7 +39,7 @@ ConfigControl *CreateConfigControl( vlc_object_t *p_this,
     ConfigControl *p_control = NULL;
 
     /*Skip deprecated options */
-    if( p_item->psz_current )
+    if( p_item->psz_current || p_item->b_unsaveable )
     {
         return NULL;
     }
@@ -281,7 +281,7 @@ ModuleConfigControl::ModuleConfigControl( vlc_object_t *p_this,
         if( !strcmp( p_parser->psz_capability, p_item->psz_type ) )
         {
             combo->Append( wxU(p_parser->psz_longname),
-                           p_parser->psz_object_name );
+                           (char *)p_parser->psz_object_name );
             if( p_item->value.psz && !strcmp(p_item->value.psz,
                                              p_parser->psz_object_name) )
                 combo->SetValue( wxU(p_parser->psz_longname) );
@@ -344,7 +344,7 @@ ModuleCatConfigControl::ModuleCatConfigControl( vlc_object_t *p_this,
                 p_config->value.i == p_item->min.i )
             {
                 combo->Append( wxU(p_parser->psz_longname),
-                                   p_parser->psz_object_name );
+                               (char *)p_parser->psz_object_name );
                 if( p_item->value.psz && !strcmp(p_item->value.psz,
                                         p_parser->psz_object_name) )
                 combo->SetValue( wxU(p_parser->psz_longname) );
@@ -559,7 +559,7 @@ StringListConfigControl::StringListConfigControl( vlc_object_t *p_this,
                                                   wxWindow *parent )
   : ConfigControl( p_this, p_item, parent )
 {
-    psz_default_value = p_item->value.psz;
+    psz_default_value = (char *)p_item->value.psz;
     if( psz_default_value ) psz_default_value = strdup( psz_default_value );
 
     label = new wxStaticText(this, -1, wxU(p_item->psz_text));
@@ -637,15 +637,15 @@ void StringListConfigControl::OnAction( wxCommandEvent& event )
 {
     int i_action = event.GetId() - wxID_HIGHEST;
 
-    module_config_t *p_item = config_FindConfig( p_this, GetName().mb_str() );
+    module_config_t *p_item = config_FindConfig( p_this, GetName().mb_str(wxConvUTF8) );
     if( !p_item ) return;
 
     if( i_action < 0 || i_action >= p_item->i_action ) return;
 
     vlc_value_t val;
     wxString value = GetPszValue();
-    *((const char **)&val.psz_string) = value.mb_str();
-    p_item->ppf_action[i_action]( p_this, GetName().mb_str(), val, val, 0 );
+    *((const char **)&val.psz_string) = value.mb_str(wxConvUTF8);
+    p_item->ppf_action[i_action]( p_this, GetName().mb_str(wxConvUTF8), val, val, 0 );
 
     if( p_item->b_dirty )
     {
@@ -854,14 +854,14 @@ void IntegerListConfigControl::OnAction( wxCommandEvent& event )
     int i_action = event.GetId() - wxID_HIGHEST;
 
     module_config_t *p_item;
-    p_item = config_FindConfig( p_this, GetName().mb_str() );
+    p_item = config_FindConfig( p_this, GetName().mb_str(wxConvUTF8) );
     if( !p_item ) return;
 
     if( i_action < 0 || i_action >= p_item->i_action ) return;
 
     vlc_value_t val;
     val.i_int = GetIntValue();
-    p_item->ppf_action[i_action]( p_this, GetName().mb_str(), val, val, 0 );
+    p_item->ppf_action[i_action]( p_this, GetName().mb_str(wxConvUTF8), val, val, 0 );
 
     if( p_item->b_dirty )
     {