UpdatesAvailableDialog.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 UpdatesAvailableDialog.h
00013 ** \version $Id: UpdatesAvailableDialog.h 3735 2009-04-28 20:28:01Z edmanm $
00014 ** \brief Displays a list of available updates and details, such as release
00015 ** notes. The user can choose to either install the updates now or later, or
00016 ** skip the updates entirely.
00017 */
00018 
00019 #ifndef _UpdatesAvailableDialog_H
00020 #define _UpdatesAvailableDialog_H
00021 
00022 #include "ui_UpdatesAvailableDialog.h"
00023 #include "PackageInfo.h"
00024 
00025 #include <QDialog>
00026 #include <QShowEvent>
00027 #include <QTreeWidgetItem>
00028 
00029 
00030 class UpdatesAvailableDialog : public QDialog
00031 {
00032   Q_OBJECT
00033 
00034 public:
00035   enum UpdatesAvailableDialogExitCode {
00036     InstallUpdatesNow   = 100,
00037     InstallUpdatesLater = 101,
00038   };
00039 
00040   /** Constructor. */
00041   UpdatesAvailableDialog(const PackageList &packageList, QWidget *parent = 0);
00042 
00043 protected:
00044   /** Called when the dialog receives a QShowEvent. This simply adjusts
00045    * the column widths to something close to sane and forwards the event
00046    * to the parent.
00047    */
00048   virtual void showEvent(QShowEvent *e);
00049 
00050 private slots:
00051   /** Called when the user selects a different package in the list. The widget
00052    * displaying details on the selected package will be updated.
00053    */
00054   void currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
00055 
00056   /** Called when the user opts to install the displayed software updates
00057    * immediately.
00058    */
00059   void installUpdatesNow();
00060 
00061   /** Called when the user opts to install the display software updates at
00062    * a later time.
00063    */
00064   void installUpdatesLater();
00065 
00066 private:
00067   /** Populates the table of available updates with package information
00068    * from <b>packageList</b>.
00069    */
00070   void loadPackagesTable(const PackageList &packageList);
00071 
00072   Ui::UpdatesAvailableDialog ui; /**< Qt Designer generated object. */
00073 };
00074 
00075 #endif
00076 

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