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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user