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::coreAboutToClose()
{
    while (m_tabWidget->count()) {
        RunControl *rc = runControlForTab(0);
        if (rc->isRunning())
            rc->stop();
        closeTab(0);
    }
}
void OutputPane::stopRunControl()
{
    RunControl *rc = runControlForTab(m_tabWidget->currentIndex());
    rc->stop();
}