Skip to content

Commit a77845f

Browse files
committed
Closes #1426
1 parent aa470d0 commit a77845f

File tree

3 files changed

+29
-1
lines changed

3 files changed

+29
-1
lines changed

src/Interface/Application/ModuleProxyWidget.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ namespace SCIRun
9595
static const int CurrentTagKey = 101;
9696
static const int NoTag = -1;
9797
static const int AllTags = -50;
98+
static const int ClearTags = -77;
9899
static const int ShowGroups = -100;
99100
static const int HideGroups = -101;
100101
}

src/Interface/Application/NetworkEditor.cc

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1323,6 +1323,22 @@ void NetworkEditor::tagLayer(bool active, int tag)
13231323
{
13241324
tagLayerActive_ = active;
13251325

1326+
if (active)
1327+
{
1328+
auto items = scene_->selectedItems();
1329+
Q_FOREACH(QGraphicsItem* item, items)
1330+
{
1331+
if (item->data(TagDataKey).toInt() == NoTag)
1332+
{
1333+
item->setData(TagDataKey, tag);
1334+
}
1335+
else if (ClearTags == tag)
1336+
{
1337+
item->setData(TagDataKey, NoTag);
1338+
}
1339+
}
1340+
}
1341+
13261342
Q_FOREACH(QGraphicsItem* item, scene_->items())
13271343
{
13281344
item->setData(TagLayerKey, active);
@@ -1334,7 +1350,7 @@ void NetworkEditor::tagLayer(bool active, int tag)
13341350
{
13351351
highlightTaggedItem(item, itemTag);
13361352
}
1337-
else if (tag != NoTag)
1353+
else if (tag != NoTag && tag != ClearTags)
13381354
{
13391355
if (tag == itemTag)
13401356
{

src/Interface/Application/SCIRunMainWindow.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1676,6 +1676,17 @@ void SCIRunMainWindow::keyPressEvent(QKeyEvent *event)
16761676
}
16771677
}
16781678
}
1679+
else if (event->key() == Qt::Key_J)
1680+
{
1681+
if (!actionToggleTagLayer_->isChecked())
1682+
{
1683+
if (networkEditor_->tagLayerActive())
1684+
{
1685+
networkEditor_->tagLayer(true, ClearTags);
1686+
showStatusMessage("Tag layer active: selected modules' tags cleared");
1687+
}
1688+
}
1689+
}
16791690
else if (event->key() >= Qt::Key_0 && event->key() <= Qt::Key_9)
16801691
{
16811692
if (!actionToggleTagLayer_->isChecked())

0 commit comments

Comments
 (0)