| 186 | } |
| 187 | |
| 188 | QTermWidget *ConsoleManager::createConsole(const QString &name, bool startNow, bool rename) |
| 189 | { |
| 190 | auto id = QUuid::createUuid().toString(); |
| 191 | ConsoleWidget *console = new ConsoleWidget(this, startNow); |
| 192 | d->consoleMap.insert(id, console); |
| 193 | d->consoleStackedWidget->addWidget(console); |
| 194 | |
| 195 | QStandardItem *item = new QStandardItem(name); |
| 196 | item->setData(id, IdRole); |
| 197 | item->setEditable(rename); |
| 198 | d->model->appendRow(item); |
| 199 | d->consoleListView->setCurrentIndex(d->model->index(d->model->rowCount() - 1, 0)); |
| 200 | |
| 201 | return console; |
| 202 | } |
| 203 | |
| 204 | void ConsoleManager::sendCommand(const QString &text) |
| 205 | { |