Vidalia  0.3.1
UpdatesAvailableDialog.h
Go to the documentation of this file.
1 /*
2 ** This file is part of Vidalia, and is subject to the license terms in the
3 ** LICENSE file, found in the top level directory of this distribution. If you
4 ** did not receive the LICENSE file with this file, you may obtain it from the
5 ** Vidalia source package distributed by the Vidalia Project at
6 ** http://www.torproject.org/projects/vidalia.html. No part of Vidalia,
7 ** including this file, may be copied, modified, propagated, or distributed
8 ** except according to the terms described in the LICENSE file.
9 */
10 
11 /*
12 ** \file UpdatesAvailableDialog.h
13 ** \brief Displays a list of available updates and details, such as release
14 ** notes. The user can choose to either install the updates now or later, or
15 ** skip the updates entirely.
16 */
17 
18 #ifndef _UpdatesAvailableDialog_H
19 #define _UpdatesAvailableDialog_H
20 
21 #include "ui_UpdatesAvailableDialog.h"
22 #include "PackageInfo.h"
23 
24 #include <QDialog>
25 #include <QShowEvent>
26 #include <QTreeWidgetItem>
27 
28 
29 class UpdatesAvailableDialog : public QDialog
30 {
31  Q_OBJECT
32 
33 public:
37  };
38 
39  /** Constructor. */
40  UpdatesAvailableDialog(const PackageList &packageList, QWidget *parent = 0);
41 
42 protected:
43  /** Called when the dialog receives a QShowEvent. This simply adjusts
44  * the column widths to something close to sane and forwards the event
45  * to the parent.
46  */
47  virtual void showEvent(QShowEvent *e);
48 
49 private slots:
50  /** Called when the user selects a different package in the list. The widget
51  * displaying details on the selected package will be updated.
52  */
53  void currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous);
54 
55  /** Called when the user opts to install the displayed software updates
56  * immediately.
57  */
58  void installUpdatesNow();
59 
60  /** Called when the user opts to install the display software updates at
61  * a later time.
62  */
63  void installUpdatesLater();
64 
65 private:
66  /** Populates the table of available updates with package information
67  * from <b>packageList</b>.
68  */
69  void loadPackagesTable(const PackageList &packageList);
70 
71  Ui::UpdatesAvailableDialog ui; /**< Qt Designer generated object. */
72 };
73 
74 #endif
75 
UpdatesAvailableDialog::InstallUpdatesNow
@ InstallUpdatesNow
Definition: UpdatesAvailableDialog.h:35
UpdatesAvailableDialog::InstallUpdatesLater
@ InstallUpdatesLater
Definition: UpdatesAvailableDialog.h:36
UpdatesAvailableDialog::showEvent
virtual void showEvent(QShowEvent *e)
Definition: UpdatesAvailableDialog.cpp:43
UpdatesAvailableDialog::loadPackagesTable
void loadPackagesTable(const PackageList &packageList)
Definition: UpdatesAvailableDialog.cpp:51
UpdatesAvailableDialog
Definition: UpdatesAvailableDialog.h:29
UpdatesAvailableDialog::installUpdatesLater
void installUpdatesLater()
Definition: UpdatesAvailableDialog.cpp:95
PackageList
QList< PackageInfo > PackageList
Definition: PackageInfo.h:93
UpdatesAvailableDialog::ui
Ui::UpdatesAvailableDialog ui
Definition: UpdatesAvailableDialog.h:71
UpdatesAvailableDialog::installUpdatesNow
void installUpdatesNow()
Definition: UpdatesAvailableDialog.cpp:89
UpdatesAvailableDialog::UpdatesAvailableDialog
UpdatesAvailableDialog(const PackageList &packageList, QWidget *parent=0)
Definition: UpdatesAvailableDialog.cpp:24
UpdatesAvailableDialog::currentItemChanged
void currentItemChanged(QTreeWidgetItem *current, QTreeWidgetItem *previous)
Definition: UpdatesAvailableDialog.cpp:78
UpdatesAvailableDialog::UpdatesAvailableDialogExitCode
UpdatesAvailableDialogExitCode
Definition: UpdatesAvailableDialog.h:34
PackageInfo.h