Huggle  build:^490^dce1e5c
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
exceptionwindow.cpp
1 //This program is free software: you can redistribute it and/or modify
2 //it under the terms of the GNU General Public License as published by
3 //the Free Software Foundation, either version 3 of the License, or
4 //(at your option) any later version.
5 
6 //This program is distributed in the hope that it will be useful,
7 //but WITHOUT ANY WARRANTY; without even the implied warranty of
8 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 //GNU General Public License for more details.
10 
11 #include "exceptionwindow.hpp"
12 #include "ui_exceptionwindow.h"
13 
14 using namespace Huggle;
15 
16 ExceptionWindow::ExceptionWindow(Exception *e) : ui(new Ui::ExceptionWindow)
17 {
18  ui->setupUi(this);
19  ui->textEdit->setText("We are sorry, but huggle just crashed! Please submit the following information together with details of what were you doing to "\
20  "http://bugzilla.wikimedia.org/\n\nRing log\n==================\n" + Core::RingLogToText()
21  + "\n\n\n\nException details\n===========================\nError code: " + QString::number(e->ErrorCode)
22  + "\nReason: " + e->Message);
23 }
24 
25 ExceptionWindow::~ExceptionWindow()
26 {
27  delete ui;
28 }
29 
30 void ExceptionWindow::on_pushButton_clicked()
31 {
32  this->close();
33 }
34 
35 void ExceptionWindow::on_pushButton_3_clicked()
36 {
37  QApplication::exit(2);
38 }
static QString RingLogToText()
Return a ring log represented as 1 huge string.
Definition: core.cpp:712
QString Message
Reason for crash.
Definition: exception.hpp:27
int ErrorCode
Error code.
Definition: exception.hpp:24
Every exception raised by huggle is defined by this class.
Definition: exception.hpp:20