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:
@@ -349,8 +349,11 @@ void Channels::cmCopy()
|
||||
|
||||
void Channels::cmCut()
|
||||
{
|
||||
if (QMessageBox::question(this, CPN_STR_APP_NAME, tr("Cut Channel. Are you sure?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
|
||||
return;
|
||||
|
||||
cmCopy();
|
||||
cmClear();
|
||||
cmClear(false);
|
||||
}
|
||||
|
||||
void Channels::onCustomContextMenuRequested(QPoint pos)
|
||||
@@ -412,10 +415,12 @@ void Channels::cmMoveDown()
|
||||
swapData(selectedIndex, selectedIndex + 1);
|
||||
}
|
||||
|
||||
void Channels::cmClear()
|
||||
void Channels::cmClear(bool prompt)
|
||||
{
|
||||
if (QMessageBox::question(this, CPN_STR_APP_NAME, tr("Clear Channel. Are you sure?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
|
||||
return;
|
||||
if (prompt) {
|
||||
if (QMessageBox::question(this, CPN_STR_APP_NAME, tr("Clear Channel. Are you sure?"), QMessageBox::Yes | QMessageBox::No) == QMessageBox::No)
|
||||
return;
|
||||
}
|
||||
|
||||
model->limitData[selectedIndex].clear();
|
||||
model->updateAllReferences(ModelData::REF_UPD_TYPE_CHANNEL, ModelData::REF_UPD_ACT_CLEAR, selectedIndex);
|
||||
|
||||
Reference in New Issue
Block a user