[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [vidalia/master] Update the crashreporter



commit bc3a5180f4585270673b7a31ce7248d57e7e9b7e
Author: Tomas Touceda <chiiph@xxxxxxxxxx>
Date:   Sat Apr 30 01:02:14 2011 -0300

    Update the crashreporter
    
    Removes everything related to the upload since we are not setting
    anything up for now. Just informs the user what he/she should do
    with the dumps.
---
 src/crashreporter/CMakeLists.txt           |    5 -
 src/crashreporter/CrashReportDialog.cpp    |   61 +-----------
 src/crashreporter/CrashReportDialog.h      |   28 +----
 src/crashreporter/CrashReportDialog.ui     |  115 +++++++++++++---------
 src/crashreporter/CrashReportUploader.cpp  |  152 ----------------------------
 src/crashreporter/CrashReportUploader.h    |  109 --------------------
 src/crashreporter/UploadProgressDialog.cpp |   60 -----------
 src/crashreporter/UploadProgressDialog.h   |   62 -----------
 src/crashreporter/UploadProgressDialog.ui  |  106 -------------------
 src/crashreporter/main.cpp                 |   43 +-------
 10 files changed, 81 insertions(+), 660 deletions(-)

diff --git a/src/crashreporter/CMakeLists.txt b/src/crashreporter/CMakeLists.txt
index 8fa72bf..11d68c2 100644
--- a/src/crashreporter/CMakeLists.txt
+++ b/src/crashreporter/CMakeLists.txt
@@ -19,17 +19,12 @@ include_directories(
 set(crashreporter_SRCS
   main.cpp
   CrashReportDialog.cpp
-  CrashReportUploader.cpp
-  UploadProgressDialog.cpp
 )
 qt4_wrap_cpp(crashreporter_SRCS
   CrashReportDialog.h
-  CrashReportUploader.h
-  UploadProgressDialog.h
 )
 qt4_wrap_ui(crashreporter_SRCS
   CrashReportDialog.ui
-  UploadProgressDialog.ui
 )
 qt4_add_resources(crashreporter_SRCS
   res/CrashReporter.qrc
diff --git a/src/crashreporter/CrashReportDialog.cpp b/src/crashreporter/CrashReportDialog.cpp
index f3acc68..c133706 100644
--- a/src/crashreporter/CrashReportDialog.cpp
+++ b/src/crashreporter/CrashReportDialog.cpp
@@ -16,8 +16,6 @@
 */
 
 #include "CrashReportDialog.h"
-#include "CrashReportUploader.h"
-#include "UploadProgressDialog.h"
 
 #include "stringutil.h"
 
@@ -48,57 +46,17 @@ CrashReportDialog::setCrashAnnotations(const QHash<QString,QString> &annotations
 }
 
 void
-CrashReportDialog::setMinidump(const QString &id, const QByteArray &minidump)
+CrashReportDialog::setMinidumpFiles(const QString &minidump, const QString &annotations)
 {
-  _minidump = minidump;
-  _minidumpId = id;
-}
-
-void
-CrashReportDialog::submitCrashReport()
-{
-  CrashReportUploader *uploader = new CrashReportUploader();
-  UploadProgressDialog *progressDialog = new UploadProgressDialog(this);
-  QMap<QString,QString> parameters;
-
-  connect(uploader, SIGNAL(statusChanged(QString)),
-          progressDialog, SLOT(setStatus(QString)));
-  connect(uploader, SIGNAL(uploadProgress(int, int)),
-          progressDialog, SLOT(setUploadProgress(int, int)));
-  connect(uploader, SIGNAL(uploadFinished()),
-          progressDialog, SLOT(accept()));
-  connect(uploader, SIGNAL(uploadFailed(QString)),
-          progressDialog, SLOT(uploadFailed(QString)));
-
-  /* Set up the form fields that will be uploaded with the minidump */
-  QString comments = ui.textDetails->toPlainText();
-  if (! comments.isEmpty())
-    parameters.insert("Comments", comments);
-  parameters.insert("ProductName", "Vidalia");
-  parameters.insert("Vendor", "Vidalia");
-  parameters.insert("Version", _annotations.value("BuildVersion"));
-  parameters.insert("CrashTime", _annotations.value("CrashTime"));
-  parameters.insert("StartupTime", _annotations.value("StartupTime"));
-
-  /* Start the upload (returns immediately) */
-  uploader->uploadMinidump(QUrl("https://crashes.vidalia-project.net/submit";),
-                           _minidumpId, _minidump, parameters);
+  _minidumpPath = minidump;
+  _annotationsPath = annotations;
 
-  /* Displays a modal progress dialog showing the progress of the upload. This
-   * will return when either the upload completes or the user hits "Cancel". */
-  if (progressDialog->exec() == QDialog::Rejected)
-    uploader->cancel(); /* User clicked "Cancel" */
-
-  delete uploader;
+  ui.textDetails->setPlainText(QString("%1\n%2\n").arg(_minidumpPath).arg(_annotationsPath));
 }
 
 void
 CrashReportDialog::accept()
 {
-  /* Upload the crash report, unless the user opted out */
-  if (ui.chkSubmitCrashReport->isChecked())
-    submitCrashReport();
-
   /* Attempt to restart Vidalia with the saved arguments */
   QString exe  = _annotations.value("RestartExecutable");
   QString args = _annotations.value("RestartExecutableArgs");
@@ -115,14 +73,3 @@ CrashReportDialog::accept()
   QDialog::accept();
 }
 
-void
-CrashReportDialog::reject()
-{
-  /* Upload the crash report, unless the user opted out */
-  if (ui.chkSubmitCrashReport->isChecked())
-    submitCrashReport();
-
-  /* Close this dialog without restarting Vidalia */
-  QDialog::reject();
-}
-
diff --git a/src/crashreporter/CrashReportDialog.h b/src/crashreporter/CrashReportDialog.h
index bc05892..b3fd533 100644
--- a/src/crashreporter/CrashReportDialog.h
+++ b/src/crashreporter/CrashReportDialog.h
@@ -40,15 +40,7 @@ public:
   /** Sets the <b>minidump</b> contents generated by the crashed
    * applications exception handler.
    */
-  void setMinidump(const QString &id, const QByteArray &minidump);
-
-  /** Uploads the generated minidump, user comments, and any additional
-   * crash annotations generated by the exception handler to the crash
-   * reporting server.
-   * \sa setMinidump()
-   * \sa setCrashAnnotations()
-   */
-  void submitCrashReport();
+  void setMinidumpFiles(const QString &minidump, const QString &annotations);
 
 public slots:
   /** Called when the user clicks the "Restart Vidalia" button on the
@@ -60,24 +52,14 @@ public slots:
    */
   virtual void accept();
 
-  /** Called when the user clicks the "Don't Restart" button on the
-   * dialog. If the "Submit my crash report.." checkbox is checked, it
-   * will attempt to submit the crash report and then exit without
-   * restarting Vidalia.
-   */
-  virtual void reject();
-
 private:
-  /** Each minidump is given a randomly-generated GUID when it is created,
-   * which is used to form the minidump filename. This ID is also used by
-   * the crash reporting server when accepting and processing uploaded
-   * minidumps.
+  /** Minidump path
    */
-  QString _minidumpId;
+  QString _minidumpPath;
 
-  /** Contents of the generated minidump.
+  /** Minidump info path
    */
-  QByteArray _minidump;
+  QString _annotationsPath;
 
   /** Set of parsed key-value pairs generated by the crashed application's
    * exception handler and written alongside the minidump.
diff --git a/src/crashreporter/CrashReportDialog.ui b/src/crashreporter/CrashReportDialog.ui
index b565822..ae3faac 100644
--- a/src/crashreporter/CrashReportDialog.ui
+++ b/src/crashreporter/CrashReportDialog.ui
@@ -6,8 +6,8 @@
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>434</width>
-    <height>310</height>
+    <width>492</width>
+    <height>257</height>
    </rect>
   </property>
   <property name="windowTitle">
@@ -18,7 +18,7 @@
     <normaloff>:/images/32x32/tools-report-bug.png</normaloff>:/images/32x32/tools-report-bug.png</iconset>
   </property>
   <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" rowspan="2">
+   <item row="1" column="0" rowspan="2">
     <widget class="QLabel" name="lblHeaderImage">
      <property name="text">
       <string/>
@@ -28,89 +28,112 @@
      </property>
     </widget>
    </item>
-   <item row="0" column="1">
-    <widget class="QLabel" name="lblTitle">
-     <property name="font">
-      <font>
-       <pointsize>9</pointsize>
-       <weight>75</weight>
-       <bold>true</bold>
-      </font>
+   <item row="5" column="0" colspan="2">
+    <widget class="Line" name="line">
+     <property name="orientation">
+      <enum>Qt::Horizontal</enum>
      </property>
+    </widget>
+   </item>
+   <item row="6" column="0" colspan="2">
+    <widget class="QLabel" name="lblDetails">
      <property name="text">
-      <string>Vidalia encountered an error and needed to close</string>
+      <string>Please fill a ticket in:</string>
      </property>
      <property name="alignment">
-      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+      <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="1" column="1">
-    <widget class="QLabel" name="lblHeader">
+   <item row="7" column="0" colspan="2">
+    <widget class="QLabel" name="label">
      <property name="text">
-      <string>A crash report has been created that you can automatically send to the Vidalia developers to help identify and fix the problem. The submitted report does not contain any personally identifying information, but your connection to the crash reporting server may not be anonymous.</string>
+      <string>&lt;a href=&quot;https://trac.torproject.org/projects/tor/newticket&quot;&gt;https://trac.torproject.org/projects/tor/newticket&lt;/a&gt;</string>
      </property>
-     <property name="alignment">
-      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     <property name="openExternalLinks">
+      <bool>true</bool>
      </property>
-     <property name="wordWrap">
+    </widget>
+   </item>
+   <item row="9" column="0" colspan="2">
+    <widget class="QTextBrowser" name="textDetails">
+     <property name="tabChangesFocus">
       <bool>true</bool>
      </property>
+     <property name="readOnly">
+      <bool>false</bool>
+     </property>
+     <property name="openLinks">
+      <bool>false</bool>
+     </property>
     </widget>
    </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="Line" name="line">
+   <item row="10" column="0" colspan="2">
+    <widget class="QDialogButtonBox" name="buttonBox">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
+     <property name="standardButtons">
+      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     </property>
     </widget>
    </item>
-   <item row="3" column="0" colspan="2">
-    <widget class="QLabel" name="lblDetails">
+   <item row="1" column="1">
+    <widget class="QLabel" name="lblTitle">
+     <property name="font">
+      <font>
+       <pointsize>9</pointsize>
+       <weight>75</weight>
+       <bold>true</bold>
+      </font>
+     </property>
      <property name="text">
-      <string>Please also describe what you were doing before the application crashed (optional):</string>
+      <string>Vidalia encountered an error and needed to close</string>
      </property>
      <property name="alignment">
-      <set>Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft</set>
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
      </property>
      <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="4" column="0" colspan="2">
-    <widget class="QTextBrowser" name="textDetails">
-     <property name="tabChangesFocus">
-      <bool>true</bool>
-     </property>
-     <property name="readOnly">
-      <bool>false</bool>
-     </property>
-     <property name="openLinks">
-      <bool>false</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="5" column="0" colspan="2">
-    <widget class="QCheckBox" name="chkSubmitCrashReport">
+   <item row="2" column="1">
+    <widget class="QLabel" name="lblHeader">
      <property name="text">
-      <string>Send my crash report to the Vidalia developers</string>
+      <string>A crash report has been created that you can send to the Vidalia developers to help identify and fix the problem. The submitted report does not contain any personally identifying information.</string>
      </property>
-     <property name="checked">
+     <property name="alignment">
+      <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+     </property>
+     <property name="wordWrap">
       <bool>true</bool>
      </property>
     </widget>
    </item>
-   <item row="6" column="1">
-    <widget class="QDialogButtonBox" name="buttonBox">
+   <item row="0" column="1">
+    <spacer name="horizontalSpacer">
      <property name="orientation">
       <enum>Qt::Horizontal</enum>
      </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+     <property name="sizeHint" stdset="0">
+      <size>
+       <width>40</width>
+       <height>0</height>
+      </size>
+     </property>
+    </spacer>
+   </item>
+   <item row="8" column="0" colspan="2">
+    <widget class="QLabel" name="lblDetails2">
+     <property name="text">
+      <string>with a description of what you were doing before the application crashed, along with the following files corresponding to the crash report:</string>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
      </property>
     </widget>
    </item>
diff --git a/src/crashreporter/CrashReportUploader.cpp b/src/crashreporter/CrashReportUploader.cpp
deleted file mode 100644
index cd59ee3..0000000
--- a/src/crashreporter/CrashReportUploader.cpp
+++ /dev/null
@@ -1,152 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.vidalia-project.net/. No part of Vidalia, including this file,
-**  may be copied, modified, propagated, or distributed except according to the
-**  terms described in the LICENSE file.
-*/
-
-/*
-** \file CrashReportUploader.cpp
-** \brief Uploads a minidump file and any extra information to a crash
-** reporting server.
-*/
-
-#include "CrashReportUploader.h"
-
-#include <QtGlobal>
-#include <QDateTime>
-#include <QSslSocket>
-#include <QSslCertificate>
-#include <QHttpRequestHeader>
-#include <QHttpResponseHeader>
-#include <QMap>
-#include <QUrl>
-
-
-CrashReportUploader::CrashReportUploader(QObject *parent)
-  : QObject(parent),
-    _requestId(-1)
-{
-  /* Clear the default CA certificate store and add the only one we want */
-  QSslSocket::setDefaultCaCertificates(QList<QSslCertificate>());
-  QSslSocket::addDefaultCaCertificates(":/pki/gd-class2-root.crt");
-
-  /* Create the QHttp object used to talk to the crash reporting server */
-  _http = new QHttp(this);
-  connect(_http, SIGNAL(stateChanged(int)),
-          this, SLOT(httpStateChanged(int)));
-  connect(_http, SIGNAL(requestFinished(int, bool)),
-          this, SLOT(httpRequestFinished(int, bool)));
-  connect(_http, SIGNAL(dataSendProgress(int, int)),
-          this, SIGNAL(uploadProgress(int, int)));
-
-  /* Seed the lame PRNG we'll use to generate the multipart boundary marker */
-  qsrand(QDateTime::currentDateTime().toTime_t());
-}
-
-void
-CrashReportUploader::uploadMinidump(const QUrl &serverUrl,
-                                    const QString &minidumpId,
-                                    const QByteArray &minidump,
-                                    const QMap<QString,QString> &parameters)
-{
-  QByteArray body;
-
-  /* Set the destination host. If it looks like the destination URL uses SSL,
-   * then we need to tell the QHttp object to use it as well. */
-  if (! serverUrl.scheme().compare("https", Qt::CaseInsensitive)) {
-    _http->setHost(serverUrl.host(), QHttp::ConnectionModeHttps,
-                   serverUrl.port(443));
-  } else {
-    _http->setHost(serverUrl.host(), QHttp::ConnectionModeHttp,
-                   serverUrl.port(80));
-  }
-
-  /* Set up the request header */
-  QHttpRequestHeader header("POST", serverUrl.path());
-  QString boundary = generateBoundaryMarker();
-  header.setValue("Host", serverUrl.host());
-  header.setContentType(QString("multipart/form-data; boundary=%1")
-                                                    .arg(boundary));
-
-  /* Add all the key=value parameters to the request body */
-  foreach (QString key, parameters.keys()) {
-    QString value = parameters.value(key);
-    if (! value.isEmpty()) {
-      body.append(QString("--%1\r\n").arg(boundary));
-      body.append(QString("Content-Disposition: form-data; name=\"%1\"").arg(key));
-      body.append("\r\n\r\n");
-      body.append(value.toUtf8());
-      body.append("\r\n");
-    }
-  }
-
-  /* Append the minidump contents */
-  body.append(QString("--%1\r\n").arg(boundary));
-  body.append("Content-Disposition: form-data; ");
-  body.append("name=\"upload_file_minidump\"; ");
-  body.append(QString("filename=\"%1\"\r\n").arg(minidumpId));
-  body.append("Content-Type: application/octet-stream\r\n\r\n");
-  body.append(minidump);
-  body.append(QString("\r\n--%1\r\n").arg(boundary));
-
-  /* Initiate the request and return the request ID */
-  _requestId = _http->request(header, body);
-}
-
-QString
-CrashReportUploader::generateBoundaryMarker() const
-{
-  return QString("%1%2").arg((quint32)qrand(), 8, 16, QChar('0'))
-                        .arg((quint32)qrand(), 8, 16, QChar('0'));  
-}
-
-void
-CrashReportUploader::cancel()
-{
-  _http->abort();
-}
-
-void
-CrashReportUploader::httpStateChanged(int state)
-{
-  switch (state) {
-    case QHttp::Connecting:
-      emit statusChanged(tr("Connecting..."));
-      break;
-
-    case QHttp::Sending:
-      emit statusChanged(tr("Sending crash report..."));
-      break;
-
-    case QHttp::Reading:
-      emit statusChanged(tr("Receiving response..."));
-      break;
-
-    default:
-      break;
-  }
-}
-
-void
-CrashReportUploader::httpRequestFinished(int id, bool error)
-{
-  if (id != _requestId)
-    return;
-
-  if (error) {
-    QString errorString = _http->errorString();
-    emit uploadFailed(errorString);
-  } else {
-    QHttpResponseHeader response = _http->lastResponse();
-    if (response.statusCode() == 200)
-      emit uploadFinished();
-    else
-      emit uploadFailed(response.reasonPhrase());
-  }
-  _http->close();
-}
-
diff --git a/src/crashreporter/CrashReportUploader.h b/src/crashreporter/CrashReportUploader.h
deleted file mode 100644
index dd97954..0000000
--- a/src/crashreporter/CrashReportUploader.h
+++ /dev/null
@@ -1,109 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.vidalia-project.net/. No part of Vidalia, including this file,
-**  may be copied, modified, propagated, or distributed except according to the
-**  terms described in the LICENSE file.
-*/
-
-/*
-** \file CrashReportUploader.h
-** \brief Uploads a minidump file and any extra information to a crash
-** reporting server.
-*/
-
-#ifndef _CRASHREPORTUPLOADER_H
-#define _CRASHREPORTUPLOADER_H
-
-#include <QObject>
-#include <QHttp>
-#include <QMap>
-
-class QUrl;
-class QString;
-class QByteArray;
-
-
-class CrashReportUploader : public QObject
-{
-  Q_OBJECT
-
-public:
-  /** Default constructor.
-   */
-  CrashReportUploader(QObject *parent = 0);
-
-  /** Starts uploading <b>minidump</b> to <b>serverUrl</b> and returns
-   * immediately. <b>minidumpId</b> is the minidump GUID generated by
-   * the exception handler and used for the minidump's filename. The
-   * optional <b>parameters</b> can be used to pass additional form fields
-   * to the crash reporting server.
-   */
-  void uploadMinidump(const QUrl &serverUrl,
-                      const QString &minidumpId,
-                      const QByteArray &minidump,
-                      const QMap<QString,QString> &parameters);
-
-public slots:
-  /** Cancels a pending minidump upload.
-   */
-  void cancel();
-
-signals:
-  /** Emitted when the underlying QHttp object posts data to the server.
-   * <b>done</b> indicates how many bytes out of <b>total</b>
-   * have been sent so far.
-   */
-  void uploadProgress(int done, int total);
-
-  /** Emitted when the status of the POST request changes. <b>status</b>
-   * describes the new current state of the request.
-   */
-  void statusChanged(const QString &status);
-
-  /** Emitted when the previous minidump upload completes successfully.
-   */
-  void uploadFinished();
-
-  /** Emitted when the previous crash report upload fails. The QString
-   * <b>error</b> is a human-readable string describing the error
-   * encountered.
-   */
-  void uploadFailed(const QString &error);
-
-private slots:
-  /** Called when the state of the underlying QHttp object changes. A
-   * statusChanged() signal is emitted with the appropriate text
-   * describing the new state of the POST request.
-   */
-  void httpStateChanged(int state); 
-
-  /** Called when the underlying QHttp object used to upload the minidump
-   * completes. <b>error</b> is set to false if the upload was
-   * successful, or true if the upload failed. If <b>id</b> does not
-   * match the request ID previously returned by QHttp::get(), then the
-   * signal is ignored since it is the result of a close() or abort()
-   * request.
-   */
-  void httpRequestFinished(int id, bool error);
-
-private:
-  /** Generates a "random" 8-byte multipart boundary marker encoded into
-   * 16 hex characters.
-   */
-  QString generateBoundaryMarker() const;
-
-  /** Unique numeric identifier of the current minidump upload POST request.
-   */
-  int _requestId;
-
-  /** Object used to POST a minidump to the crash server and read the
-   * response.
-   */
-  QHttp *_http;
-};
-
-#endif
-
diff --git a/src/crashreporter/UploadProgressDialog.cpp b/src/crashreporter/UploadProgressDialog.cpp
deleted file mode 100644
index 4030e10..0000000
--- a/src/crashreporter/UploadProgressDialog.cpp
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.vidalia-project.net/. No part of Vidalia, including this file,
-**  may be copied, modified, propagated, or distributed except according to the
-**  terms described in the LICENSE file.
-*/
-
-/*
-** \file UploadProgressDialog.cpp
-** \brief Displays the progress of uploading a crash report to the server
-*/
-
-#include "UploadProgressDialog.h"
-
-
-UploadProgressDialog::UploadProgressDialog(QWidget *parent)
-  : QDialog(parent)
-{
-  ui.setupUi(this);
- 
-  setModal(true);
-}
-
-void
-UploadProgressDialog::setVisible(bool visible)
-{
-  if (visible) {
-    ui.progressBar->setRange(0, 0);
-    ui.buttonBox->setStandardButtons(QDialogButtonBox::Cancel);
-  }
-  QDialog::setVisible(visible);
-}
-
-void
-UploadProgressDialog::setStatus(const QString &status)
-{
-  ui.lblStatus->setText(status);
-}
-
-void
-UploadProgressDialog::setUploadProgress(int done, int total)
-{
-  ui.progressBar->setRange(0, total);
-  ui.progressBar->setValue(done);
-}
-
-void
-UploadProgressDialog::uploadFailed(const QString &error)
-{
-  ui.lblStatus->setText(tr("Unable to send report: %1").arg(error));
-
-  ui.progressBar->setRange(0, 1);
-  ui.progressBar->setValue(1);
-
-  ui.buttonBox->setStandardButtons(QDialogButtonBox::Ok);
-}
-
diff --git a/src/crashreporter/UploadProgressDialog.h b/src/crashreporter/UploadProgressDialog.h
deleted file mode 100644
index e2cfcec..0000000
--- a/src/crashreporter/UploadProgressDialog.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-**  This file is part of Vidalia, and is subject to the license terms in the
-**  LICENSE file, found in the top level directory of this distribution. If you
-**  did not receive the LICENSE file with this file, you may obtain it from the
-**  Vidalia source package distributed by the Vidalia Project at
-**  http://www.vidalia-project.net/. No part of Vidalia, including this file,
-**  may be copied, modified, propagated, or distributed except according to the
-**  terms described in the LICENSE file.
-*/
-
-/*
-** \file UploadProgressDialog.cpp
-** \brief Displays the progress of uploading a crash report to the server
-*/
-
-#ifndef _UPLOADPROGRESSDIALOG_H
-#define _UPLOADPROGRESSDIALOG_H
-
-#include "ui_UploadProgressDialog.h"
-
-
-class UploadProgressDialog : public QDialog
-{
-  Q_OBJECT
-
-public:
-  /** Default constructor.
-   */
-  UploadProgressDialog(QWidget *parent = 0);
-
-public slots:
-  /** Sets the status message text in the dialog to <b>status</b>.
-   */
-  void setStatus(const QString &status);
-
-  /** Updates the minidump upload progress bar to <b>value</b> out of
-   * <b>maximum</b> steps. If <b>value</b> and <b>maximum</b> are both 0,
-   * then a "busy" progress bar is displayed.
-   */
-  void setUploadProgress(int value, int maximum);
-
-  /** Called when the minidump upload fails. The string <b>error</b>
-   * provides a human-readable description of the reason the upload
-   * failed, which is displayed for the user.
-   */
-  void uploadFailed(const QString &error);
-
-protected:
-  /** Overloaded method called when the progress dialog is first shown in
-   * order to initialize the progress bar, status text and dialog button
-   * box.
-   */
-  virtual void setVisible(bool visible);
-
-private:
-  /** Qt Designer generated object.
-   */
-  Ui::UploadProgressDialog ui;
-};
-
-#endif
-
diff --git a/src/crashreporter/UploadProgressDialog.ui b/src/crashreporter/UploadProgressDialog.ui
deleted file mode 100644
index 4b985ac..0000000
--- a/src/crashreporter/UploadProgressDialog.ui
+++ /dev/null
@@ -1,106 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>UploadProgressDialog</class>
- <widget class="QDialog" name="UploadProgressDialog">
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>366</width>
-    <height>104</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Uploading Crash Report</string>
-  </property>
-  <property name="windowIcon">
-   <iconset resource="res/CrashReporter.qrc">
-    <normaloff>:/images/32x32/tools-report-bug.png</normaloff>:/images/32x32/tools-report-bug.png</iconset>
-  </property>
-  <property name="modal">
-   <bool>true</bool>
-  </property>
-  <layout class="QGridLayout" name="gridLayout">
-   <item row="0" column="0" rowspan="2">
-    <widget class="QLabel" name="lblPixmap">
-     <property name="text">
-      <string/>
-     </property>
-     <property name="pixmap">
-      <pixmap resource="res/CrashReporter.qrc">:/images/48x48/tools-report-bug.png</pixmap>
-     </property>
-    </widget>
-   </item>
-   <item row="0" column="1">
-    <widget class="QLabel" name="lblStatus">
-     <property name="text">
-      <string/>
-     </property>
-     <property name="wordWrap">
-      <bool>true</bool>
-     </property>
-    </widget>
-   </item>
-   <item row="1" column="1">
-    <widget class="QProgressBar" name="progressBar">
-     <property name="value">
-      <number>0</number>
-     </property>
-     <property name="textVisible">
-      <bool>false</bool>
-     </property>
-     <property name="format">
-      <string/>
-     </property>
-    </widget>
-   </item>
-   <item row="2" column="0" colspan="2">
-    <widget class="QDialogButtonBox" name="buttonBox">
-     <property name="orientation">
-      <enum>Qt::Horizontal</enum>
-     </property>
-     <property name="standardButtons">
-      <set>QDialogButtonBox::Cancel</set>
-     </property>
-    </widget>
-   </item>
-  </layout>
- </widget>
- <resources>
-  <include location="res/CrashReporter.qrc"/>
- </resources>
- <connections>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>accepted()</signal>
-   <receiver>UploadProgressDialog</receiver>
-   <slot>accept()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>182</x>
-     <y>81</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>182</x>
-     <y>51</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>buttonBox</sender>
-   <signal>rejected()</signal>
-   <receiver>UploadProgressDialog</receiver>
-   <slot>reject()</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>182</x>
-     <y>81</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>182</x>
-     <y>51</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/src/crashreporter/main.cpp b/src/crashreporter/main.cpp
index 9d77dfd..558896c 100644
--- a/src/crashreporter/main.cpp
+++ b/src/crashreporter/main.cpp
@@ -22,34 +22,6 @@
 #include <QTextStream>
 #include <QTextCodec>
 
-
-/** Open the minidump file  given by <b>fileName</b> and read its entire
- * contents into a QByteArray. Returns the contents of the minidump file
- * on success. If an error occurs, this returns a default-constructed
- * QByteArray and sets <b>errorMessage</b> to a string describing the error
- * ecountered.
- */
-QByteArray
-read_minidump_file(const QString &fileName, QString &errorMessage)
-{
-  QByteArray md;
-  QFile mdFile(fileName);
-
-  if (! mdFile.open(QIODevice::ReadOnly)) {
-    errorMessage = mdFile.errorString();
-    return QByteArray();
-  }
-  while (! mdFile.atEnd()) {
-    md.append(mdFile.readAll());
-    if (mdFile.error() != QFile::NoError) {
-      errorMessage = mdFile.errorString();
-      return QByteArray();
-    }
-  }
-  mdFile.close();
-  return md;
-}
-
 /** Read the crash dump annotations file given by <b>fileName</b> and parse
  * each line into a Key=Value pair. Returns a QHash containing the keys
  * mapped to their values on success. If a file or parse error occurs, this
@@ -94,7 +66,6 @@ main(int argc, char *argv[])
   QFileInfo minidumpFile, extraInfoFile;
   QString minidumpFilePath, extraInfoFilePath, errorMessage;
   QHash<QString,QString> annotations;
-  QByteArray minidump;
 
   if (argc < 2) {
     errorMessage = "No minidump file specified.";
@@ -131,14 +102,6 @@ main(int argc, char *argv[])
     goto err;
   }
 
-  /* Read the minidump file's contents */
-  minidump = read_minidump_file(minidumpFilePath, errorMessage);
-  if (minidump.isNull()) {
-    errorMessage = QString("Unable to read minidump file '%1': %2")
-                                             .arg(minidumpFilePath)
-                                             .arg(errorMessage);
-    goto err;
-  }
   /* Read and parse the crash annotations file */
   annotations = read_annotations_file(extraInfoFilePath, errorMessage);
   if (annotations.isEmpty()) {
@@ -149,8 +112,8 @@ main(int argc, char *argv[])
   }
 
   /* Display the crash reporting dialog */
-  crashDialog.setMinidump(minidumpFile.baseName(), minidump);
   crashDialog.setCrashAnnotations(annotations);
+  crashDialog.setMinidumpFiles(minidumpFilePath, extraInfoFilePath);
   crashDialog.show();
   return app.exec();
 
@@ -171,8 +134,8 @@ err:
     "help diagnose the problem, but was unable to do so. Please report "
     "this problem, along with what you were doing before Vidalia crashed, "
     "to the developers at:</p><p>"
-    "<a href=\"https://trac.vidalia-project.net/wiki/ReportingBugs\";>"
-    "https://trac.vidalia-project.net/wiki/ReportingBugs</a></p> "
+    "<a href=\"https://trac.torproject.org/projects/tor/newticket\";>"
+    "https://trac.torproject.org/projects/tor/newticket</a></p> "
     "<p>Click \"Show Details\" below for information about the problem "
     "encountered.");
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits