8
* Copyright (C) 2006-2011 Oracle Corporation
8
* Copyright (C) 2006-2012 Oracle Corporation
10
10
* This file is part of VirtualBox Open Source Edition (OSE), as
11
11
* available from http://www.virtualbox.org. This file is free software;
20
20
#define __UIDownloaderAdditions_h__
22
22
/* Local includes: */
23
#include "QIWithRetranslateUI.h"
24
23
#include "UIDownloader.h"
26
class UIMiniProgressWidgetAdditions : public QIWithRetranslateUI<UIMiniProgressWidget>
32
UIMiniProgressWidgetAdditions(const QString &strSource, QWidget *pParent = 0)
33
: QIWithRetranslateUI<UIMiniProgressWidget>(pParent)
35
sltSetSource(strSource);
43
setCancelButtonToolTip(tr("Cancel the VirtualBox Guest Additions CD image download"));
44
setProgressBarToolTip(tr("Downloading the VirtualBox Guest Additions CD image from <nobr><b>%1</b>...</nobr>")
25
/* UIDownloader extension for background additions downloading. */
49
26
class UIDownloaderAdditions : public UIDownloader
32
/* Notifies listeners about downloading finished: */
33
void sigDownloadFinished(const QString &strFile);
55
38
static UIDownloaderAdditions* create();
56
39
static UIDownloaderAdditions* current();
58
void setAction(QAction *pAction);
59
QAction *action() const;
63
void sigDownloadFinished(const QString &strFile);
43
/* Constructor/destructor: */
67
44
UIDownloaderAdditions();
68
45
~UIDownloaderAdditions();
70
UIMiniProgressWidget* createProgressWidgetFor(QWidget *pParent) const;
47
/* Virtual stuff reimplementations: */
71
48
bool askForDownloadingConfirmation(QNetworkReply *pReply);
72
49
void handleDownloadedObject(QNetworkReply *pReply);
73
void warnAboutNetworkError(const QString &strError);
75
/* Private member variables: */
76
static UIDownloaderAdditions *m_pInstance;
78
/* Action to be blocked: */
79
QPointer<QAction> m_pAction;
52
static UIDownloaderAdditions *m_spInstance;
82
55
#endif // __UIDownloaderAdditions_h__