| 27 | } |
| 28 | |
| 29 | bool Console::start() |
| 30 | { |
| 31 | qInfo() << __FUNCTION__; |
| 32 | |
| 33 | auto &ctx = dpfInstance.serviceContext(); |
| 34 | auto consoleManager = new ConsoleManager; |
| 35 | WindowService *windowService = ctx.service<WindowService>(WindowService::name()); |
| 36 | if (windowService) { |
| 37 | windowService->addContextWidget(TERMINAL_TAB_TEXT, new AbstractWidget(consoleManager), true); |
| 38 | } |
| 39 | |
| 40 | // bind service. |
| 41 | auto terminalService = ctx.service<TerminalService>(TerminalService::name()); |
| 42 | if (terminalService) { |
| 43 | using namespace std::placeholders; |
| 44 | terminalService->sendCommand = std::bind(&ConsoleManager::sendCommand, consoleManager, _1); |
| 45 | terminalService->executeCommand = std::bind(&ConsoleManager::executeCommand, consoleManager, _1, _2, _3, _4, _5); |
| 46 | terminalService->createConsole = std::bind(&ConsoleManager::newConsole, consoleManager, _1, _2); |
| 47 | terminalService->selectConsole = std::bind(&ConsoleManager::selectConsole, consoleManager, _1); |
| 48 | terminalService->run2Console = std::bind(&ConsoleManager::run2Console, consoleManager, _1, _2); |
| 49 | } |
| 50 | return true; |
| 51 | } |
| 52 | |
| 53 | dpf::Plugin::ShutdownFlag Console::stop() |
| 54 | { |
no test coverage detected