Use default complexity mode defined in preferences when adding tool

This commit is contained in:
Pandagrapher
2020-05-04 20:03:58 +02:00
parent d0d79c7d59
commit bdb8a95b14
6 changed files with 30 additions and 48 deletions

View File

@@ -190,7 +190,22 @@ void LocallabTool::addLocallabTool(bool raiseEvent)
exp->set_visible(true);
// Raise event if required
if (raiseEvent) {
if (raiseEvent) { // Note: Event is only raised when a tool is added by user
if (needMode) {
// Set complexity mode according to chosen default one
complexityConn.block(true);
complexity->set_active(options.complexity);
complexityConn.block(false);
// Update GUI accordingly
if (complexity->get_active_row_number() == Normal) {
convertParamToNormal();
updateGUIToMode(Normal);
} else {
updateGUIToMode(Expert);
}
}
if (listener) {
listener->panelChanged(EvlocallabToolAdded,
toolName + " (" + escapeHtmlChars(spotName) + ")");