00001 /* 00002 ** This file is part of Vidalia, and is subject to the license terms in the 00003 ** LICENSE file, found in the top level directory of this distribution. If you 00004 ** did not receive the LICENSE file with this file, you may obtain it from the 00005 ** Vidalia source package distributed by the Vidalia Project at 00006 ** http://www.vidalia-project.net/. No part of Vidalia, including this file, 00007 ** may be copied, modified, propagated, or distributed except according to the 00008 ** terms described in the LICENSE file. 00009 */ 00010 00011 /* 00012 ** \file CrashReportDialog.h 00013 ** \version $Id$ 00014 ** \brief Dialog that asks the user whether they would like to 00015 ** submit the crash report, along with optional additional details 00016 ** about what they were doing at the time of the crash. 00017 */ 00018 00019 #include "ui_CrashReportDialog.h" 00020 00021 #include <QHash> 00022 #include <QByteArray> 00023 00024 class QString; 00025 00026 00027 class CrashReportDialog : public QDialog 00028 { 00029 Q_OBJECT 00030 00031 public: 00032 /** Default constructor. 00033 */ 00034 CrashReportDialog(QWidget *parent = 0); 00035 00036 /** Sets the crash <b>annotations</b> key-value pairs associated with 00037 * the generated minidump. 00038 */ 00039 void setCrashAnnotations(const QHash<QString,QString> &annotations); 00040 00041 /** Sets the <b>minidump</b> contents generated by the crashed 00042 * applications exception handler. 00043 */ 00044 void setMinidump(const QString &id, const QByteArray &minidump); 00045 00046 /** Uploads the generated minidump, user comments, and any additional 00047 * crash annotations generated by the exception handler to the crash 00048 * reporting server. 00049 * \sa setMinidump() 00050 * \sa setCrashAnnotations() 00051 */ 00052 void submitCrashReport(); 00053 00054 public slots: 00055 /** Called when the user clicks the "Restart Vidalia" button on the 00056 * dialog. If the "Submit my crash report..." checkbox is checked, it 00057 * will first attempt to submit the crash report. After that is complete, 00058 * it will try to restart the Vidalia process with any arguments specified 00059 * in the crash annotations file. 00060 * \sa setCrashAnnotations() 00061 */ 00062 virtual void accept(); 00063 00064 /** Called when the user clicks the "Don't Restart" button on the 00065 * dialog. If the "Submit my crash report.." checkbox is checked, it 00066 * will attempt to submit the crash report and then exit without 00067 * restarting Vidalia. 00068 */ 00069 virtual void reject(); 00070 00071 private: 00072 /** Each minidump is given a randomly-generated GUID when it is created, 00073 * which is used to form the minidump filename. This ID is also used by 00074 * the crash reporting server when accepting and processing uploaded 00075 * minidumps. 00076 */ 00077 QString _minidumpId; 00078 00079 /** Contents of the generated minidump. 00080 */ 00081 QByteArray _minidump; 00082 00083 /** Set of parsed key-value pairs generated by the crashed application's 00084 * exception handler and written alongside the minidump. 00085 */ 00086 QHash<QString,QString> _annotations; 00087 00088 /** Qt Designer created object. 00089 */ 00090 Ui::CrashReportDialog ui; 00091 }; 00092