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

Generated on 31 Mar 2010 for Vidalia by  doxygen 1.6.1