Companion enhanced telemetry sensors context menu and other refinements across context menus (#7716)

Companion enhanced telemetry sensors context menu with reference updates
This commit is contained in:
Neil Horne
2020-09-04 18:36:58 +02:00
committed by GitHub
parent f7153ababb
commit 5a500cc055
22 changed files with 381 additions and 139 deletions
+9 -2
View File
@@ -533,8 +533,10 @@ void LogicalSwitchesPanel::cmCopy()
void LogicalSwitchesPanel::cmCut()
{
if (QMessageBox::question(this, CPN_STR_APP_NAME, tr("Cut Logical Switch. Are you sure?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
return;
cmCopy();
cmClear();
cmClear(false);
}
// TODO make something generic here!
@@ -597,8 +599,13 @@ void LogicalSwitchesPanel::cmMoveDown()
swapData(selectedIndex, selectedIndex + 1);
}
void LogicalSwitchesPanel::cmClear()
void LogicalSwitchesPanel::cmClear(bool prompt)
{
if (prompt) {
if (QMessageBox::question(this, CPN_STR_APP_NAME, tr("Clear Logical Switch. Are you sure?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
return;
}
model->logicalSw[selectedIndex].clear();
model->updateAllReferences(ModelData::REF_UPD_TYPE_LOGICAL_SWITCH, ModelData::REF_UPD_ACT_CLEAR, selectedIndex);
update();