CHANGED: #1471 Removing widgets from the widget properties dialog will now work.

This commit is contained in:
dfighter1985 2012-11-17 20:13:29 +01:00
parent b07f5cbb28
commit 443af251af
3 changed files with 12 additions and 8 deletions

View file

@ -62,10 +62,10 @@ namespace GUIEditor
return true;
}
/// Finds a node and removes it
bool removeNode( SWidgetInfo *info )
/// Finds a node by it's name and removes it
bool removeNode( const std::string &name )
{
CWidgetInfoTreeNode *node = findNodeByName( info->name );
CWidgetInfoTreeNode *node = findNodeByName( name );
if( node == NULL )
return false;
@ -78,6 +78,12 @@ namespace GUIEditor
return true;
}
/// Finds a node by it's info entry and removes it
bool removeNode( SWidgetInfo *info )
{
return removeNode( info->name );
}
/// Get the node names and put them into the vector
void getNames( std::vector< std::string > &v ) const
{

View file

@ -85,8 +85,8 @@ namespace GUIEditor
{
if( ( *itr )->getInfo().name == name )
{
children.erase( itr );
delete ( *itr );
children.erase( itr );
return true;
}
}

View file

@ -67,10 +67,8 @@ namespace GUIEditor{
if( reply != QMessageBox::Yes )
return;
/*
Remove the damned thing here
*/
tree->removeNode( widgetName.toStdString() );
widgetPropTree->clear();
buildWidgetList();
}