| 228 | } |
| 229 | |
| 230 | void AppOutputPane::createApplicationPane(const QString &id, const QString &program) |
| 231 | { |
| 232 | d->tabbar->show(); |
| 233 | d->hLine->show(); |
| 234 | |
| 235 | //check if exist avaliable pane of this name |
| 236 | for (auto index = 0; index < d->stackWidget->count(); index++) { |
| 237 | auto pane = qobject_cast<OutputPane *>(d->stackWidget->widget(index)); |
| 238 | if (pane->property("program") == program) { |
| 239 | auto paneId = d->appPane.key(pane); |
| 240 | if (d->appIsRunning.contains(paneId) && !d->appIsRunning[paneId]) { |
| 241 | d->appIsRunning.insert(id, true); |
| 242 | d->appPane.remove(paneId); |
| 243 | d->appPane.insert(id, pane); |
| 244 | d->tabChosser->setCurrentIndex(index); |
| 245 | d->closeProcessBtn->setEnabled(true); |
| 246 | return; |
| 247 | } |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | auto pane = new OutputPane(this); |
| 252 | pane->setProperty("program", program); |
| 253 | d->appPane.insert(id, pane); |
| 254 | d->appIsRunning.insert(id, true); |
| 255 | |
| 256 | auto file = QFileInfo(program); |
| 257 | if (file.exists()) |
| 258 | d->tabChosser->addItem(file.baseName()); |
| 259 | else |
| 260 | d->tabChosser->addItem(program); |
| 261 | |
| 262 | d->stackWidget->addWidget(pane); |
| 263 | d->tabChosser->setCurrentIndex(d->tabChosser->count() - 1); |
| 264 | |
| 265 | emit paneCreated(id); |
| 266 | } |
| 267 | |
| 268 | void AppOutputPane::setProcessFinished(const QString &id) |
| 269 | { |
no test coverage detected