[apps/code] Get imported modules in the variable box

This commit is contained in:
Léa Saviot
2020-04-01 14:32:01 +02:00
committed by Émilie Feral
parent a0f1d0f24b
commit 4cb947759d
3 changed files with 39 additions and 4 deletions

View File

@@ -437,6 +437,18 @@ PythonToolbox::PythonToolbox() :
{
}
const ToolboxMessageTree * PythonToolbox::moduleChildren(const char * name, int * numberOfNodes) const {
assert(numberOfNodes != nullptr);
for (ToolboxMessageTree t : modulesChildren) {
if (strcmp(I18n::translate(t.label()), name)) {
*numberOfNodes = t.numberOfChildren();
assert(*numberOfNodes > 0);
return static_cast<const ToolboxMessageTree *>(t.children(0));
}
}
return nullptr;
}
bool PythonToolbox::handleEvent(Ion::Events::Event event) {
if (Toolbox::handleEvent(event)) {
return true;