[apps] Code: merge actions for text input in ConsoleController and

EditorController
This commit is contained in:
Émilie Feral
2018-02-23 15:45:23 +01:00
committed by EmilieNumworks
parent aade7cb2fe
commit 3db86a8111
8 changed files with 29 additions and 72 deletions

View File

@@ -259,10 +259,6 @@ PythonToolbox::PythonToolbox() :
{
}
void PythonToolbox::setAction(Action action) {
m_action = action;
}
bool PythonToolbox::handleEvent(Ion::Events::Event event) {
if (Toolbox::handleEvent(event)) {
return true;
@@ -297,7 +293,8 @@ bool PythonToolbox::selectLeaf(ToolboxMessageTree * selectedMessageTree) {
const char * editedText = I18n::translate(node->insertedText());
char strippedEditedText[strlen(editedText)+1];
Shared::ToolboxHelpers::TextToInsertForCommandMessage(node->insertedText(), strippedEditedText);
m_action(sender(), const_cast<const char *>(strippedEditedText));
TextInput * textInput = static_cast<TextInput *>(sender());
textInput->handleEventWithText(strippedEditedText, true);
app()->dismissModalViewController();
return true;
}