refs #661, info in context menu when force reload is unavailable

(KB/RW slack discussion)
This commit is contained in:
Klaus Basan
2016-05-24 18:21:30 +02:00
parent 54b1234f7f
commit 0ff7791532
3 changed files with 32 additions and 0 deletions

View File

@@ -233,6 +233,7 @@ namespace BlackGui
}
// with models loaded I allow a refresh reload
// I need those models because I want to merge with DM data in the loader
if (sGui->getWebDataServices() && sGui->getWebDataServices()->getModelsCount() > 0)
{
if (this->m_reloadActions.isEmpty()) { this->m_reloadActions = QList<QAction *>({nullptr, nullptr, nullptr, nullptr}); }
@@ -290,6 +291,12 @@ namespace BlackGui
menuActions.addAction(this->m_reloadActions[3], CMenuAction::pathSimulatorModelsReload());
}
}
else
{
// dummy action grayed out
CMenuAction a = menuActions.addAction(CIcons::refresh16(), "Force model reload impossible, no DB data", CMenuAction::pathSimulator());
a.setActionEnabled(false); // gray out
}
}
this->nestedCustomMenu(menuActions);
}