void OutputPane::closeTab(int index) { OutputWindow *ow = static_cast<OutputWindow *>(m_tabWidget->widget(index)); RunControl *rc = m_outputWindows.key(ow); if (rc->isRunning()) { QMessageBox messageBox(QMessageBox::Warning, tr("Unable to close"), tr("The application is still running."), QMessageBox::Cancel | QMessageBox::Yes, ow->window()); messageBox.setInformativeText(tr("Force it to quit?")); messageBox.setDefaultButton(QMessageBox::Yes); messageBox.button(QMessageBox::Yes)->setText(tr("Force Quit")); if (messageBox.exec() != QMessageBox::Yes) return; rc->stop(); } m_tabWidget->removeTab(index); delete ow; delete rc; }
void OutputPane::createNewOutputWindow(RunControl *rc) { connect(rc, SIGNAL(started()), this, SLOT(runControlStarted())); connect(rc, SIGNAL(finished()), this, SLOT(runControlFinished())); // First look if we can reuse a tab bool found = false; for (int i = 0; i < m_tabWidget->count(); ++i) { RunControl *old = runControlForTab(i); if (old->sameRunConfiguration(rc) && !old->isRunning()) { // Reuse this tab delete old; m_outputWindows.remove(old); OutputWindow *ow = static_cast<OutputWindow *>(m_tabWidget->widget(i)); ow->grayOutOldContent(); ow->verticalScrollBar()->setValue(ow->verticalScrollBar()->maximum()); ow->setFormatter(rc->createOutputFormatter(ow)); m_outputWindows.insert(rc, ow); found = true; break; } } if (!found) { OutputWindow *ow = new OutputWindow(m_tabWidget); ow->setFormatter(rc->createOutputFormatter(ow)); Aggregation::Aggregate *agg = new Aggregation::Aggregate; agg->add(ow); agg->add(new Find::BaseTextFind(ow)); m_outputWindows.insert(rc, ow); m_tabWidget->addTab(ow, rc->displayName()); } }
void OutputPane::coreAboutToClose() { while (m_tabWidget->count()) { RunControl *rc = runControlForTab(0); if (rc->isRunning()) rc->stop(); closeTab(0); } }
void OutputPane::tabChanged(int i) { if (i == -1) { m_stopAction->setEnabled(false); m_reRunButton->setEnabled(false); } else { RunControl *rc = runControlForTab(i); m_stopAction->setEnabled(rc->isRunning()); m_reRunButton->setEnabled(!rc->isRunning()); } }
void OutputPane::reRunRunControl() { int index = m_tabWidget->currentIndex(); RunControl *rc = runControlForTab(index); OutputWindow *ow = static_cast<OutputWindow *>(m_tabWidget->widget(index)); if (ProjectExplorerPlugin::instance()->projectExplorerSettings().cleanOldAppOutput) ow->clear(); else ow->grayOutOldContent(); ow->verticalScrollBar()->setValue(ow->verticalScrollBar()->maximum()); rc->start(); }
void MemcheckWithGdbRunControl::startDebugger() { const qint64 valgrindPid = runner()->valgrindProcess()->pid(); const AnalyzerStartParameters &mySp = startParameters(); Debugger::DebuggerStartParameters sp; sp.executable = mySp.debuggee; sp.startMode = Debugger::AttachToRemoteServer; sp.displayName = QString::fromLatin1("VGdb %1").arg(valgrindPid); sp.remoteChannel = QString::fromLatin1("| vgdb --pid=%1").arg(valgrindPid); sp.useContinueInsteadOfRun = true; sp.expectedSignals.append("SIGTRAP"); QString errorMessage; RunControl *gdbRunControl = Debugger::createDebuggerRunControl(sp, runConfiguration(), &errorMessage); QTC_ASSERT(gdbRunControl, return); connect(gdbRunControl, &RunControl::finished, gdbRunControl, &RunControl::deleteLater); gdbRunControl->start(); }
void OutputPane::stopRunControl() { RunControl *rc = runControlForTab(m_tabWidget->currentIndex()); rc->stop(); }