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

[vidalia-svn] r3860: Add a progress dialog for displaying the crash report upload (vidalia/branches/breakpad/src/crashreporter)



Author: edmanm
Date: 2009-06-16 00:57:13 -0400 (Tue, 16 Jun 2009)
New Revision: 3860

Added:
   vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.cpp
   vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.h
Modified:
   vidalia/branches/breakpad/src/crashreporter/CMakeLists.txt
Log:

Add a progress dialog for displaying the crash report upload status.


Modified: vidalia/branches/breakpad/src/crashreporter/CMakeLists.txt
===================================================================
--- vidalia/branches/breakpad/src/crashreporter/CMakeLists.txt	2009-06-16 04:37:55 UTC (rev 3859)
+++ vidalia/branches/breakpad/src/crashreporter/CMakeLists.txt	2009-06-16 04:57:13 UTC (rev 3860)
@@ -19,12 +19,15 @@
 set(crashreporter_SRCS
   main.cpp
   CrashReportDialog.cpp
+  UploadProgressDialog.cpp
 )
 qt4_wrap_cpp(crashreporter_SRCS
   CrashReportDialog.h
+  UploadProgressDialog.h
 )
 qt4_wrap_ui(crashreporter_SRCS
   CrashReportDialog.ui
+  UploadProgressDialog.ui
 )
 qt4_add_resources(crashreporter_SRCS
   res/CrashReporter.qrc

Added: vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.cpp
===================================================================
--- vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.cpp	                        (rev 0)
+++ vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.cpp	2009-06-16 04:57:13 UTC (rev 3860)
@@ -0,0 +1,61 @@
+/*
+**  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
+** \version $Id$
+** \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);
+}
+


Property changes on: vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.cpp
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native

Added: vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.h
===================================================================
--- vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.h	                        (rev 0)
+++ vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.h	2009-06-16 04:57:13 UTC (rev 3860)
@@ -0,0 +1,63 @@
+/*
+**  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
+** \version $Id$
+** \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
+


Property changes on: vidalia/branches/breakpad/src/crashreporter/UploadProgressDialog.h
___________________________________________________________________
Added: svn:keywords
   + Id
Added: svn:eol-style
   + native