VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox4/include/VBoxUpdateDlg.h@ 10590

Last change on this file since 10590 was 10515, checked in by vboxsync, 17 years ago

Fe/Qt4: '3003: Auto-update: New-version notifier'

  1. Settings moved to Global Settings / Update page.
  2. New Version Notifier now can be run only in background mode.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 3.0 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt4 GUI ("VirtualBox"):
4 * VBoxUpdateDlg class declaration
5 */
6
7/*
8 * Copyright (C) 2006-2008 Sun Microsystems, Inc.
9 *
10 * This file is part of VirtualBox Open Source Edition (OSE), as
11 * available from http://www.virtualbox.org. This file is free software;
12 * you can redistribute it and/or modify it under the terms of the GNU
13 * General Public License (GPL) as published by the Free Software
14 * Foundation, in version 2 as it comes in the "COPYING" file of the
15 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
16 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
17 *
18 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
19 * Clara, CA 95054 USA or visit http://www.sun.com if you need
20 * additional information or have any questions.
21 */
22
23#ifndef __VBoxUpdateDlg_h__
24#define __VBoxUpdateDlg_h__
25
26/* Common includes */
27#include "QIAbstractWizard.h"
28#include "VBoxUpdateDlg.gen.h"
29#include "QIWithRetranslateUI.h"
30
31/* Qt includes */
32#include <QUrl>
33#include <QDate>
34
35class VBoxNetworkFramework;
36
37/**
38 * This structure is used to store retranslated reminder values.
39 */
40struct UpdateDay
41{
42 UpdateDay (const QString &aVal, const QString &aKey)
43 : val (aVal), key (aKey) {}
44
45 QString val;
46 QString key;
47
48 bool operator== (const UpdateDay &aOther)
49 {
50 return val == aOther.val || key == aOther.key;
51 }
52};
53
54/**
55 * This class is used to encode/decode the registration data.
56 */
57class VBoxUpdateData
58{
59public:
60
61 enum
62 {
63 NeverCheck = -2,
64 AutoCheck = -3
65 };
66
67 static void populate();
68 static QStringList list();
69
70 VBoxUpdateData (const QString &aData);
71 VBoxUpdateData (int aIndex);
72
73 bool isNecessary();
74 bool isAutomatic();
75
76 QString data() const;
77 int index() const;
78 QString date() const;
79
80private:
81
82 /* Private functions */
83 void decode (const QString &aData);
84 void encode (int aIndex);
85
86 /* Private variables */
87 static QList<UpdateDay> mDayList;
88
89 QString mData;
90 int mIndex;
91 QDate mDate;
92};
93
94class VBoxUpdateDlg : public QIWithRetranslateUI2<QIAbstractWizard>,
95 public Ui::VBoxUpdateDlg
96{
97 Q_OBJECT;
98
99public:
100
101 static bool isNecessary();
102 static bool isAutomatic();
103
104 VBoxUpdateDlg (VBoxUpdateDlg **aSelf, bool aForceRun,
105 QWidget *aParent = 0, Qt::WindowFlags aFlags = 0);
106 ~VBoxUpdateDlg();
107
108public slots:
109
110 void accept();
111 void search();
112
113protected:
114
115 void retranslateUi();
116
117private slots:
118
119 void processTimeout();
120
121 void onNetBegin (int aStatus);
122 void onNetData (const QByteArray &aData);
123 void onNetEnd (const QByteArray &aData);
124 void onNetError (const QString &aError);
125
126 void onPageShow();
127
128private:
129
130 /* Private functions */
131 void searchAbort (const QString &aReason);
132 void searchComplete (const QString &aFullList);
133
134 /* Private variables */
135 VBoxUpdateDlg **mSelf;
136 VBoxNetworkFramework *mNetfw;
137 QTimer *mTimeout;
138 QUrl mUrl;
139 bool mForceRun;
140 bool mSuicide;
141};
142
143#endif // __VBoxUpdateDlg_h__
144
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette