~ubuntu-branches/ubuntu/precise/virtualbox/precise-updates

« back to all changes in this revision

Viewing changes to src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.h

  • Committer: Bazaar Package Importer
  • Author(s): Felix Geyer
  • Date: 2011-10-17 23:23:09 UTC
  • mfrom: (3.1.5 sid)
  • Revision ID: james.westby@ubuntu.com-20111017232309-kzm6841lzk61ranj
Tags: 4.1.4-dfsg-1
* New upstream release.
  - Fixes missing icons when using pt_BR locale. (Closes: #507188)
  - Fixes guest additions download url. (Closes: #637349; LP: #840668)
* Refresh patches.
* Drop the vboxmouse x11 driver. The mouse integration is now completely
  handled by the kernel module.
* Restrict dh_pycentral to the virtualbox binary package.
* Merge changes from the Ubuntu package but use them only when built
  on Ubuntu:
  - Add an Apport hook.
  - Add vboxguest modalias to the package control field.
* Pass KBUILD_VERBOSE=2 to kmk.
* Add 36-fix-text-mode.patch to fix text mode when using the vboxvideo driver.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/** @file
 
2
 *
 
3
 * VBox frontends: Qt4 GUI ("VirtualBox"):
 
4
 * UIUpdateManager class declaration
 
5
 */
 
6
 
 
7
/*
 
8
 * Copyright (C) 2006-2011 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 <QUrl>
 
24
 
 
25
/* Local includes: */
 
26
#include "UIUpdateDefs.h"
 
27
 
 
28
/* Forward declarations: */
 
29
class QEventLoop;
 
30
 
 
31
/* Singleton to check for the new VirtualBox version.
 
32
 * Performs update of required parts if necessary. */
 
33
class UIUpdateManager : public QObject
 
34
{
 
35
    Q_OBJECT;
 
36
 
 
37
public:
 
38
 
 
39
    /* Schedule manager: */
 
40
    static void schedule();
 
41
    /* Shutdown manager: */
 
42
    static void shutdown();
 
43
    /* Manager instance: */
 
44
    static UIUpdateManager* instance() { return m_pInstance; }
 
45
 
 
46
signals:
 
47
 
 
48
    /* Signal to notify listeners about downloading: */
 
49
    void sigDownloaderCreatedForExtensionPack();
 
50
 
 
51
public slots:
 
52
 
 
53
    /* Force call for new version check: */
 
54
    void sltForceCheck();
 
55
 
 
56
private slots:
 
57
 
 
58
    /* Slot to check if update is necessary: */
 
59
    void sltCheckIfUpdateIsNecessary(bool fForceCall = false);
 
60
 
 
61
    /* Handle downloaded extension pack: */
 
62
    void sltHandleDownloadedExtensionPack(const QString &strSource, const QString &strTarget);
 
63
 
 
64
private:
 
65
 
 
66
    /* Constructor/destructor: */
 
67
    UIUpdateManager();
 
68
    ~UIUpdateManager();
 
69
 
 
70
    /* Helping stuff: */
 
71
    void checkIfUpdateIsNecessary(bool fForceCall);
 
72
    void checkIfUpdateIsNecessaryForExtensionPack(bool fForceCall);
 
73
 
 
74
    /* Variables: */
 
75
    static UIUpdateManager* m_pInstance;
 
76
    quint64 m_uTime;
 
77
};
 
78
#define gUpdateManager UIUpdateManager::instance()
 
79
 
 
80
/* Class to check for the new VirtualBox version: */
 
81
class UINewVersionChecker : public QObject
 
82
{
 
83
    Q_OBJECT;
 
84
 
 
85
public:
 
86
 
 
87
    /* Constructor: */
 
88
    UINewVersionChecker(bool fForceCall);
 
89
 
 
90
    /* Function to check if new version is available: */
 
91
    void checkForTheNewVersion();
 
92
 
 
93
private slots:
 
94
 
 
95
    /* Slot to analyze new version check reply: */
 
96
    void sltHandleCheckReply();
 
97
 
 
98
private:
 
99
 
 
100
    /* Variables: */
 
101
    QUrl m_url;
 
102
    bool m_fForceCall;
 
103
    QEventLoop *m_pLoop;
 
104
};
 
105
 
 
106
#endif // __UIUpdateManager_h__