UpdateProgressDialog.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 #ifndef _UPDATEPROGRESSDIALOG_H
00012 #define _UPDATEPROGRESSDIALOG_H
00013 
00014 #include "ui_UpdateProgressDialog.h"
00015 
00016 #include <QDialog>
00017 
00018 
00019 class UpdateProgressDialog : public QDialog
00020 {
00021   Q_OBJECT
00022 
00023 public:
00024   enum Status {
00025     CheckingForUpdates,
00026     DownloadingUpdates,
00027     InstallingUpdates,
00028     UpdatesInstalled,
00029   };
00030 
00031   /** Default constructor.
00032    */
00033   UpdateProgressDialog(QWidget *parent = 0);
00034 
00035   /** Updates the dialog's display to reflect the current action indicated
00036    * by <b>status</b>.
00037    */
00038   void setStatus(UpdateProgressDialog::Status status);
00039 
00040 signals:
00041   /** Emitted when the user clicks the "Cancel" button indicating they
00042    * want to terminate the current check for available updates.
00043    */
00044   void cancelUpdate();
00045 
00046 public slots:
00047   /** Called when more bytes of <b>url</b> have been received.
00048    * <b>bytesReceived</b> indicates how many bytes have been downloaded so
00049    * far and <b>bytesTotal</b> indicates the total size of the update to be
00050    * downloaded.
00051    */
00052   void setDownloadProgress(const QString &url,
00053                            int bytesReceived, int bytesTotal);
00054 
00055 private slots:
00056   /** Called when the user clicks the "Cancel" button. Emits the
00057    * cancelUpdate() signal.
00058    */
00059   void onHide();
00060 
00061   /** Called when the user clicks the "Hide" button. Hides the dialog
00062    * box.
00063    */
00064   void onCancel();
00065 
00066 private:
00067   Ui::UpdateProgressDialog ui; /**< Qt Designer generated object. */
00068 };
00069 
00070 #endif

Generated on Mon Aug 30 19:10:00 2010 for Vidalia by  doxygen 1.5.9