MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / createApplicationPane

Method createApplicationPane

src/common/widget/appoutputpane.cpp:230–266  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void 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
268void AppOutputPane::setProcessFinished(const QString &id)
269{

Callers 2

executeToolMethod · 0.80
launchSessionMethod · 0.80

Calls 14

insertMethod · 0.80
showMethod · 0.45
countMethod · 0.45
widgetMethod · 0.45
propertyMethod · 0.45
keyMethod · 0.45
containsMethod · 0.45
removeMethod · 0.45
setCurrentIndexMethod · 0.45
setEnabledMethod · 0.45
setPropertyMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected