mirror of
https://port.numenaute.org/aleajactaest/khanat-opennel-code.git
synced 2024-12-22 00:48:44 +00:00
Throw an error message when trying to link nodes that are already linked.
This commit is contained in:
parent
4b7e1c95a6
commit
69f89d4c74
1 changed files with 10 additions and 0 deletions
|
@ -26,6 +26,8 @@
|
||||||
#include "expression_node.h"
|
#include "expression_node.h"
|
||||||
#include "expression_link.h"
|
#include "expression_link.h"
|
||||||
|
|
||||||
|
#include <QMessageBox>
|
||||||
|
|
||||||
ExpressionEditor::ExpressionEditor( QWidget *parent ) :
|
ExpressionEditor::ExpressionEditor( QWidget *parent ) :
|
||||||
QWidget( parent )
|
QWidget( parent )
|
||||||
{
|
{
|
||||||
|
@ -113,6 +115,14 @@ void ExpressionEditor::onLinkItems()
|
||||||
ExpressionNode *from = static_cast< ExpressionNode* >( l[ 0 ] );
|
ExpressionNode *from = static_cast< ExpressionNode* >( l[ 0 ] );
|
||||||
ExpressionNode *to = static_cast< ExpressionNode* >( l[ 1 ] );
|
ExpressionNode *to = static_cast< ExpressionNode* >( l[ 1 ] );
|
||||||
|
|
||||||
|
if( ( from->link() != NULL ) || ( to->link() != NULL ) )
|
||||||
|
{
|
||||||
|
QMessageBox::information( this,
|
||||||
|
tr( "Failed to link nodes" ),
|
||||||
|
tr( "Unfortunately those nodes are already linked." ) );
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
ExpressionLink *link = new ExpressionLink();
|
ExpressionLink *link = new ExpressionLink();
|
||||||
link->link( from, to );
|
link->link( from, to );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue