+void PrefsTreeCtrl::CleanChanges()
+{
+ long cookie, cookie2;
+ ConfigTreeData *config_data;
+
+ /* 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 );
+ i_child_index++ )
+ {
+ config_data = (ConfigTreeData *)GetItemData( item );
+ if( config_data && config_data->panel )
+ {
+ if( item == GetSelection() )
+ {
+ config_data->panel->Hide();
+ p_sizer->Remove( config_data->panel );
+ }
+
+ delete config_data->panel;
+ config_data->panel = NULL;
+
+ if( item == GetSelection() )
+ {
+ wxTreeEvent event;
+ event.SetItem(item);
+
+ OnSelectTreeItem( event );
+ }
+ }
+
+ item = GetNextChild( root_item, cookie );
+ }
+
+ /* Clean changes for the plugins */
+ item = GetFirstChild( plugins_item, cookie );
+ for( size_t i_child_index = 0;
+ i_child_index < GetChildrenCount( plugins_item, FALSE );
+ i_child_index++ )
+ {
+ wxTreeItemId item2 = GetFirstChild( item, cookie2 );
+ for( size_t i_child_index = 0;
+ i_child_index < GetChildrenCount( item, FALSE );
+ i_child_index++ )
+ {
+ config_data = (ConfigTreeData *)GetItemData( item2 );
+
+ if( config_data && config_data->panel )
+ {
+ if( item2 == GetSelection() )
+ {
+ config_data->panel->Hide();
+ p_sizer->Remove( config_data->panel );
+ }
+
+ delete config_data->panel;
+ config_data->panel = NULL;
+
+ if( item2 == GetSelection() )
+ {
+ wxTreeEvent event;
+ event.SetItem(item2);
+
+ OnSelectTreeItem( event );
+ }
+ }
+
+ item2 = GetNextChild( item, cookie2 );
+ }
+
+ item = GetNextChild( plugins_item, cookie );
+ }
+}
+