+ wxTreeItemId category = GetFirstChild( root_item, cookie );
+ while( category.IsOk() )
+ {
+ wxTreeItemId subcategory = GetFirstChild( category, cookie2 );
+ while( subcategory.IsOk() )
+ {
+ wxTreeItemId module = GetFirstChild( subcategory, cookie3 );
+ while( module.IsOk() )
+ {
+ config_data = (ConfigTreeData *)GetItemData( module );
+ if( config_data && config_data->panel )
+ {
+ config_data->panel->ApplyChanges();
+ }
+ module = GetNextChild( subcategory, cookie3 );
+ }
+ config_data = (ConfigTreeData *)GetItemData( subcategory );
+ if( config_data && config_data->panel )
+ {
+ config_data->panel->ApplyChanges();
+ }
+ subcategory = GetNextChild( category, cookie2 );
+ }
+ config_data = (ConfigTreeData *)GetItemData( category );
+ if( config_data && config_data->panel )
+ {
+ config_data->panel->ApplyChanges();
+ }
+ category = GetNextChild( root_item, cookie );
+ }
+}
+
+void PrefsTreeCtrl::CleanChanges()
+{
+ long cookie, cookie2, cookie3;
+ ConfigTreeData *config_data;
+
+ config_data = !GetSelection() ? NULL :
+ FindModuleConfig( (ConfigTreeData *)GetItemData( GetSelection() ) );
+ if( config_data )
+ {
+ config_data->panel->Hide();
+ p_sizer->Remove( config_data->panel );
+ }
+
+ wxTreeItemId category = GetFirstChild( root_item, cookie );
+ while( category.IsOk() )
+ {
+ wxTreeItemId subcategory = GetFirstChild( category, cookie2 );
+ while( subcategory.IsOk() )
+ {
+ wxTreeItemId module = GetFirstChild( subcategory, cookie3 );
+ while( module.IsOk() )
+ {
+ config_data = (ConfigTreeData *)GetItemData( module );
+ if( config_data && config_data->panel )
+ {
+ delete config_data->panel;
+ config_data->panel = NULL;
+ }
+ module = GetNextChild( subcategory, cookie3 );
+ }
+ config_data = (ConfigTreeData *)GetItemData( subcategory );
+ if( config_data && config_data->panel )
+ {
+ delete config_data->panel;
+ config_data->panel = NULL;
+ }
+ subcategory = GetNextChild( category, cookie2 );
+ }
+ config_data = (ConfigTreeData *)GetItemData( category );
+ if( config_data && config_data->panel )
+ {
+ delete config_data->panel;
+ config_data->panel = NULL;
+ }
+ category = GetNextChild( root_item, cookie );
+ }
+
+#if 0
+ /* Clean changes for the main module */
+ wxTreeItemId item = GetFirstChild( root_item, cookie );
+ for( size_t i_child_index = 0;
+ i_child_index < GetChildrenCount( root_item, FALSE );