ui: Prevent activation of already activated Tokens
This commit is contained in:
@@ -245,7 +245,13 @@ void QtCodeArea::mouseReleaseEvent(QMouseEvent* event)
|
||||
|
||||
if (annotation)
|
||||
{
|
||||
MessageActivateTokenLocation(annotation->locationId).dispatch();
|
||||
const std::vector<Id>& ids = m_fileWidget->getActiveTokenIds();
|
||||
bool isActive = std::find(ids.begin(), ids.end(), annotation->tokenId) != ids.end();
|
||||
|
||||
if (!isActive)
|
||||
{
|
||||
MessageActivateTokenLocation(annotation->locationId).dispatch();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,8 +9,8 @@
|
||||
|
||||
QtCodeFileList::QtCodeFileList(QWidget* parent)
|
||||
: QScrollArea(parent)
|
||||
, m_showMaximizeButton(true)
|
||||
, m_focusedTokenId(0)
|
||||
, m_showMaximizeButton(true)
|
||||
{
|
||||
m_frame = std::make_shared<QFrame>(this);
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ void QtGraphPostprocessor::doPostprocessing(std::list<std::shared_ptr<QtGraphNod
|
||||
|
||||
if (nodes.size() < 2)
|
||||
{
|
||||
LOG_WARNING_STREAM(<< "Skipping postprocessing, need at least 2 nodes but got " << nodes.size());
|
||||
LOG_INFO_STREAM(<< "Skipping postprocessing, need at least 2 nodes but got " << nodes.size());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ void QtGraphPostprocessor::resolveOverlap(std::list<std::shared_ptr<QtGraphNode>
|
||||
|
||||
while (overlap && iterationCount < maxIterations)
|
||||
{
|
||||
LOG_WARNING_STREAM(<< iterationCount);
|
||||
LOG_INFO_STREAM(<< iterationCount);
|
||||
|
||||
overlap = false;
|
||||
iterationCount++;
|
||||
|
||||
@@ -106,7 +106,7 @@ void QtGraphEdge::onClick()
|
||||
message.isAggregation = true;
|
||||
message.dispatch();
|
||||
}
|
||||
else
|
||||
else if (!m_isActive)
|
||||
{
|
||||
MessageActivateTokens message(getData()->getId());
|
||||
message.isEdge = true;
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
|
||||
#include "utility/messaging/type/MessageActivateTokens.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeMove.h"
|
||||
#include "utility/messaging/type/MessageFocusIn.h";
|
||||
#include "utility/messaging/type/MessageFocusOut.h";
|
||||
#include "utility/messaging/type/MessageFocusIn.h"
|
||||
#include "utility/messaging/type/MessageFocusOut.h"
|
||||
|
||||
#include "qt/graphics/QtRoundedRectItem.h"
|
||||
#include "qt/utility/QtDeviceScaledPixmap.h"
|
||||
@@ -252,7 +252,7 @@ void QtGraphNode::setShadowEnabledRecursive(bool enabled)
|
||||
|
||||
void QtGraphNode::onClick()
|
||||
{
|
||||
if (m_data && !m_data->isType(Node::NODE_UNDEFINED | Node::NODE_NAMESPACE))
|
||||
if (!m_isActive && m_data && !m_data->isType(Node::NODE_UNDEFINED | Node::NODE_NAMESPACE))
|
||||
{
|
||||
MessageActivateTokens(m_data->getId()).dispatch();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user