1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt4 GUI ("VirtualBox"):
|
---|
4 | * UIUpdateManager class declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2012 Oracle Corporation
|
---|
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 |
|
---|
19 | #ifndef __UIUpdateManager_h__
|
---|
20 | #define __UIUpdateManager_h__
|
---|
21 |
|
---|
22 | /* Global includes: */
|
---|
23 | #include <QObject>
|
---|
24 |
|
---|
25 | /* Forward declarations: */
|
---|
26 | class UIUpdateQueue;
|
---|
27 |
|
---|
28 | /* Singleton to perform new version checks
|
---|
29 | * and update of various VirtualBox parts. */
|
---|
30 | class UIUpdateManager : public QObject
|
---|
31 | {
|
---|
32 | Q_OBJECT;
|
---|
33 |
|
---|
34 | public:
|
---|
35 |
|
---|
36 | /* Schedule manager: */
|
---|
37 | static void schedule();
|
---|
38 | /* Shutdown manager: */
|
---|
39 | static void shutdown();
|
---|
40 | /* Manager instance: */
|
---|
41 | static UIUpdateManager* instance() { return m_pInstance; }
|
---|
42 |
|
---|
43 | public slots:
|
---|
44 |
|
---|
45 | /* Force call for new version check: */
|
---|
46 | void sltForceCheck();
|
---|
47 |
|
---|
48 | private slots:
|
---|
49 |
|
---|
50 | /* Slot to check if update is necessary: */
|
---|
51 | void sltCheckIfUpdateIsNecessary(bool fForceCall = false);
|
---|
52 |
|
---|
53 | /* Slot to handle update finishing: */
|
---|
54 | void sltHandleUpdateFinishing();
|
---|
55 |
|
---|
56 | private:
|
---|
57 |
|
---|
58 | /* Constructor/destructor: */
|
---|
59 | UIUpdateManager();
|
---|
60 | ~UIUpdateManager();
|
---|
61 |
|
---|
62 | /* Variables: */
|
---|
63 | static UIUpdateManager* m_pInstance;
|
---|
64 | UIUpdateQueue *m_pQueue;
|
---|
65 | bool m_fIsRunning;
|
---|
66 | quint64 m_uTime;
|
---|
67 | };
|
---|
68 | #define gUpdateManager UIUpdateManager::instance()
|
---|
69 |
|
---|
70 | #endif // __UIUpdateManager_h__
|
---|
71 |
|
---|