Vidalia 0.2.15
BridgeDownloaderProgressDialog.h
Go to the documentation of this file.
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.torproject.org/projects/vidalia.html. No part of Vidalia, 
00007 **  including this file, may be copied, modified, propagated, or distributed 
00008 **  except according to the terms described in the LICENSE file.
00009 */
00010 
00011 /*
00012 ** \file BridgeDownloaderProgressDialog.h
00013 ** \brief Displays the progress of a request for bridge addresses
00014 */
00015 
00016 #ifndef _BRIDGEDOWNLOADERPROGRESSDIALOG_H
00017 #define _BRIDGEDOWNLOADERPROGRESSDIALOG_H
00018 
00019 #include "ui_BridgeDownloaderProgressDialog.h"
00020 
00021 #include <QDialog>
00022 
00023 
00024 class BridgeDownloaderProgressDialog : public QDialog
00025 {
00026   Q_OBJECT
00027 
00028 public:
00029   /** Default constructor.
00030    */
00031   BridgeDownloaderProgressDialog(QWidget *parent = 0);
00032 
00033 public slots:
00034   /** Sets the status message text in the dialog to <b>status</b>.
00035    */
00036   void setStatus(const QString &status);
00037 
00038   /** Updates the bridge download progress bar to <b>value</b> out of
00039    * <b>maximum</b> steps. If <b>value</b> and <b>maximum</b> are both 0,
00040    * then a "busy" progress bar is displayed.
00041    */
00042   void setDownloadProgress(qint64 value, qint64 maximum);
00043 
00044   /** Called when the bridge download completes successfully and discards 
00045    * the progress dialog with an Accept result code. <b>bridges</b>
00046    * contains the list of bridges downloaded, but is currently ignored.
00047    */
00048   void bridgeRequestFinished(const QStringList &bridges);
00049 
00050   /** Called when the bridge download fails. The string <b>error</b>
00051    * provides a human-readable description of the reason the download
00052    * failed, which is displayed for the user.
00053    */
00054   void bridgeRequestFailed(const QString &error);
00055 
00056 signals:
00057   /** Emitted when the user clicks the "Retry" button after a previous
00058    * bridge request has failed.
00059    */
00060   void retry();
00061 
00062 protected:
00063   /** Overloaded method called when the progress dialog is first shown in
00064    * order to initialize the progress bar, status text and dialog button
00065    * box.
00066    */
00067   virtual void setVisible(bool visible);
00068 
00069 private slots:
00070   /** Called when <b>button</b> is clicked in the progress dialog's
00071    * QDialogButtonBox. Dismisses the dialog and sets the result code to
00072    * the QDialogButtonBox::StandardButton enum value indicated by
00073    * <b>button</b>.
00074    */
00075   void buttonClicked(QAbstractButton *button);
00076 
00077 private:
00078   /**< Qt Designer generated object. */
00079   Ui::BridgeDownloaderProgressDialog ui;
00080 };
00081 
00082 #endif
00083