Commit 413504f1 authored by Hugo Beauzee-Luyssen's avatar Hugo Beauzee-Luyssen

Adding consistency to the crash handler widget (title, close and restart button)

Rstart is functionnal.
parent c070b972
......@@ -26,7 +26,7 @@
#endif
#include <signal.h>
#include <QProcess>
#include "CrashHandler.h"
#include "ui_CrashHandler.h"
......@@ -36,6 +36,8 @@ CrashHandler::CrashHandler( int sig, QWidget *parent ) :
ui( new Ui::CrashHandler )
{
ui->setupUi( this );
connect( ui->okButton, SIGNAL( clicked() ), this, SLOT( close() ) );
connect( ui->restartButton, SIGNAL( clicked() ), this, SLOT( restart() ) );
#ifndef WIN32
void *buff[CrashHandler::backtraceSize];
......@@ -63,7 +65,7 @@ CrashHandler::~CrashHandler()
delete ui;
}
void CrashHandler::changeEvent(QEvent *e)
void CrashHandler::changeEvent(QEvent *e)
{
QWidget::changeEvent(e);
switch ( e->type() )
......@@ -75,3 +77,15 @@ void CrashHandler::changeEvent(QEvent *e)
break;
}
}
void CrashHandler::close()
{
accept();
}
void CrashHandler::restart()
{
QProcess* p = new QProcess();
p->start( "./vlmc" );
close();
}
......@@ -41,6 +41,10 @@ class CrashHandler : public QDialog
protected:
void changeEvent(QEvent *e);
private slots:
void close();
void restart();
private:
Ui::CrashHandler* ui;
static const int backtraceSize = 256;
......
......@@ -11,7 +11,7 @@
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
<string>VLMC Crash handler</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
......@@ -151,9 +151,16 @@
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<widget class="QPushButton" name="okButton">
<property name="text">
<string>PushButton</string>
<string>Ok</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="restartButton">
<property name="text">
<string>Restart</string>
</property>
</widget>
</item>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment