Make group selection optional.

This commit is contained in:
dfighter1985 2014-10-08 18:45:17 +02:00
parent 01cdcaa480
commit e9f5fef158
5 changed files with 21 additions and 1 deletions

View file

@ -516,6 +516,8 @@ namespace NLGUI
void unregisterWidgetWatcher( IWidgetWatcher *watcher );
CInterfaceElement* addWidgetToGroup( std::string &group, std::string &widgetClass, std::string &widgetName );
void setGroupSelection( bool b ){ groupSelection = b; }
private:
CWidgetManager();
@ -610,6 +612,7 @@ namespace NLGUI
std::string currentEditorSelection;
bool groupSelection;
};
}

View file

@ -2408,7 +2408,7 @@ namespace NLGUI
// This may happen when alt-tab has been used => the sheet is dragged but the left button is up
if (!CCtrlDraggable::getDraggedSheet())
{
if( CInterfaceElement::getEditorMode() )
if( CInterfaceElement::getEditorMode() && groupSelection )
{
for( sint32 i = _GroupsUnderPointer.size() - 1; i >= 0; i-- )
{
@ -3516,6 +3516,7 @@ namespace NLGUI
setScreenWH( 0, 0 );
currentEditorSelection = "";
groupSelection = false;
}
CWidgetManager::~CWidgetManager()

View file

@ -130,5 +130,10 @@ namespace GUIEditor
e->setActive( false );
e->setActive( true );
}
void CEditorMessageProcessor::onSetGroupSelection( bool b )
{
CWidgetManager::getInstance()->setGroupSelection( b );
}
}

View file

@ -38,6 +38,7 @@ namespace GUIEditor
public Q_SLOTS:
void onDelete();
void onAdd( const QString &parentGroup, const QString &widgetType, const QString &name );
void onSetGroupSelection( bool b );
private:
CWidgetInfoTree *tree;

View file

@ -399,6 +399,16 @@ namespace GUIEditor
connect( a, SIGNAL( triggered( bool ) ), this, SLOT( onAddWidgetClicked() ) );
m->addAction( a );
// ----------------------------------------------------------------------------------
m->addSeparator();
a = new QAction( "Select groups", this );
a->setCheckable( true );
a->setChecked( false );
connect( a, SIGNAL( triggered( bool ) ), messageProcessor, SLOT( onSetGroupSelection( bool ) ) );
m->addAction( a );
menu = m;
}
}