TupCrashWidget::TupCrashWidget(int sig) : QDialog(0), m_sig(sig) { setModal(true); setWindowTitle(CHANDLER->title()); setWindowIcon(QPixmap(THEME_DIR + "icons/skull.png")); m_layout = new QVBoxLayout(this); m_tabber = new QTabWidget(this); m_layout->addWidget(m_tabber); QWidget *page1 = new QWidget; QVBoxLayout *page1layout = new QVBoxLayout(page1); QLabel *message = new QLabel("<font color="+CHANDLER->messageColor().name()+">"+ CHANDLER->message()+"</color>"); page1layout->addWidget(message); QHBoxLayout *hbox = new QHBoxLayout; QString text = CHANDLER->defaultText(); QImage img(CHANDLER->defaultImage()); if (CHANDLER->containsSignalEntry(sig)) { text = CHANDLER->signalText(sig); img = QImage(CHANDLER->signalImage(sig)); } QLabel *sigImg = new QLabel; sigImg->setPixmap(QPixmap::fromImage(img)); hbox->addWidget(sigImg); TextArea *sigText = new TextArea(); sigText->setHtml(text); hbox->addWidget(sigText); page1layout->addLayout(hbox); m_tabber->addTab(page1, tr("What's happening?")); QPushButton *launch = new QPushButton(CHANDLER->launchButtonLabel(),this); connect(launch, SIGNAL(clicked()), SLOT(restart())); m_layout->addWidget(launch); QPushButton *end = new QPushButton(CHANDLER->closeButtonLabel(),this); connect(end, SIGNAL(clicked()), SLOT(exit())); m_layout->addWidget(end); setLayout(m_layout); }
void TupCrashWidget::addBacktracePage(const QString &execInfo, const QString &backtrace) { #ifdef K_DEBUG T_FUNCINFO << execInfo << " " << backtrace; #endif QWidget *btPage = new QWidget; QVBoxLayout *layout = new QVBoxLayout(btPage); layout->addWidget(new QLabel(tr("Executable information"))); TextArea *fileInfo = new TextArea; fileInfo->setHtml(execInfo); layout->addWidget(fileInfo); layout->addWidget(new QLabel(tr("Backtrace"))); TextArea *btInfo = new TextArea; btInfo->setHtml(backtrace); layout->addWidget(btInfo); m_tabber->addTab(btPage, tr("Backtrace")); }