+ switch( p_item->i_type )
+ {
+ case CONFIG_CATEGORY:
+ if( p_item->value.i == -1 ) break; // Don't display it
+ config_data = new ConfigTreeData;
+ config_data->psz_name = strdup( config_CategoryNameGet(p_item->value.i ) );
+ psz_help = config_CategoryHelpGet( p_item->value.i );
+ if( psz_help )
+ {
+ config_data->psz_help = wraptext( strdup( psz_help ), 72 );
+ }
+ else
+ {
+ config_data->psz_help = NULL;
+ }
+
+ config_data->i_type = TYPE_CATEGORY;
+ config_data->i_object_id = p_item->value.i;
+ config_data->p_module = p_module;
+ tvi.pszText = _FROMMB(config_data->psz_name);
+ tvi.cchTextMax = _tcslen(tvi.pszText);
+
+ /* Add the category to the tree */
+ tvi.lParam = (long)config_data;
+ tvins.item = tvi;
+ tvins.hInsertAfter = hPrev;
+ tvins.hParent = general_item; //level 3
+
+ // Add the item to the tree-view control.
+ hPrev = (HTREEITEM)TreeView_InsertItem( hwndTV, &tvins );
+ break;
+
+ case CONFIG_SUBCATEGORY:
+ if( p_item->value.i == -1 ) break; // Don't display it
+ /* Special case: move the "general" subcategories to their parent category */
+ if(config_data && p_item->value.i == SUBCAT_VIDEO_GENERAL ||
+ p_item->value.i == SUBCAT_ADVANCED_MISC ||
+ p_item->value.i == SUBCAT_INPUT_GENERAL ||
+ p_item->value.i == SUBCAT_INTERFACE_GENERAL ||
+ p_item->value.i == SUBCAT_SOUT_GENERAL||
+ p_item->value.i == SUBCAT_PLAYLIST_GENERAL||
+ p_item->value.i == SUBCAT_AUDIO_GENERAL )
+ {
+
+ config_data->i_type = TYPE_CATSUBCAT;
+ config_data->i_subcat_id = p_item->value.i;
+ free( config_data->psz_name );
+ config_data->psz_name = strdup( config_CategoryNameGet( p_item->value.i ) );
+
+ free( config_data->psz_help );
+ const char *psz_help = config_CategoryHelpGet( p_item->value.i );
+ if( psz_help )
+ {
+ config_data->psz_help = wraptext( strdup( psz_help ), 72 );
+ }
+ else
+ {
+ config_data->psz_help = NULL;
+ }
+ continue;
+ }
+
+ config_data = new ConfigTreeData;
+
+ config_data->psz_name = strdup( config_CategoryNameGet( p_item->value.i ) );
+ psz_help = config_CategoryHelpGet( p_item->value.i );
+ if( psz_help )
+ {
+ config_data->psz_help = wraptext( strdup( psz_help ), 72 );
+ }
+ else
+ {
+ config_data->psz_help = NULL;
+ }
+ config_data->i_type = TYPE_SUBCATEGORY;
+ config_data->i_object_id = p_item->value.i;
+
+ tvi.pszText = _FROMMB(config_data->psz_name);
+ tvi.cchTextMax = _tcslen(tvi.pszText);
+
+ tvi.lParam = (long)config_data;
+ tvins.item = tvi;
+ tvins.hInsertAfter = hPrev;
+ tvins.hParent = hPrev;
+
+ // Add the item to the tree-view control.
+ TreeView_InsertItem( hwndTV, &tvins );
+ break;