1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox frontends: Qt GUI ("VirtualBox"):
|
---|
4 | * UINetworkRequestWidget stuff declaration
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2011-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 __UINetworkRequestWidget_h__
|
---|
20 | #define __UINetworkRequestWidget_h__
|
---|
21 |
|
---|
22 | /* Local inludes: */
|
---|
23 | #include "QIWithRetranslateUI.h"
|
---|
24 | #include "UIPopupBox.h"
|
---|
25 |
|
---|
26 | /* Forward declarations: */
|
---|
27 | class UINetworkManagerDialog;
|
---|
28 | class QWidget;
|
---|
29 | class QGridLayout;
|
---|
30 | class QProgressBar;
|
---|
31 | class QIToolButton;
|
---|
32 | class QIRichTextLabel;
|
---|
33 | class UINetworkRequest;
|
---|
34 | class QTimer;
|
---|
35 |
|
---|
36 | /* UIPopupBox reimplementation to reflect network-request status: */
|
---|
37 | class UINetworkRequestWidget : public QIWithRetranslateUI<UIPopupBox>
|
---|
38 | {
|
---|
39 | Q_OBJECT;
|
---|
40 |
|
---|
41 | signals:
|
---|
42 |
|
---|
43 | /* Signal to retry network-request: */
|
---|
44 | void sigRetry();
|
---|
45 | /* Signal to cancel network-request: */
|
---|
46 | void sigCancel();
|
---|
47 |
|
---|
48 | protected:
|
---|
49 |
|
---|
50 | /* Allow creation of UINetworkRequestWidget to UINetworkManagerDialog only: */
|
---|
51 | friend class UINetworkManagerDialog;
|
---|
52 | /* Constructor: */
|
---|
53 | UINetworkRequestWidget(UINetworkManagerDialog *pParent, UINetworkRequest *pNetworkRequest);
|
---|
54 |
|
---|
55 | private slots:
|
---|
56 |
|
---|
57 | /* Updates current network-request progess: */
|
---|
58 | void sltSetProgress(qint64 iReceived, qint64 iTotal);
|
---|
59 |
|
---|
60 | /* Set current network-request progress to 'started': */
|
---|
61 | void sltSetProgressToStarted();
|
---|
62 | /* Set current network-request progress to 'finished': */
|
---|
63 | void sltSetProgressToFinished();
|
---|
64 | /* Set current network-request progress to 'failed': */
|
---|
65 | void sltSetProgressToFailed(const QString &strError);
|
---|
66 |
|
---|
67 | /* Handle frozen progress: */
|
---|
68 | void sltTimeIsOut();
|
---|
69 |
|
---|
70 | private:
|
---|
71 |
|
---|
72 | /* Translation stuff: */
|
---|
73 | void retranslateUi();
|
---|
74 |
|
---|
75 | /* Widgets: */
|
---|
76 | QWidget *m_pContentWidget;
|
---|
77 | QGridLayout *m_pMainLayout;
|
---|
78 | QProgressBar *m_pProgressBar;
|
---|
79 | QIToolButton *m_pRetryButton;
|
---|
80 | QIToolButton *m_pCancelButton;
|
---|
81 | QIRichTextLabel *m_pErrorPane;
|
---|
82 |
|
---|
83 | /* Objects: */
|
---|
84 | UINetworkRequest *m_pNetworkRequest;
|
---|
85 | QTimer *m_pTimer;
|
---|
86 | };
|
---|
87 |
|
---|
88 | #endif // __UINetworkRequestWidget_h__
|
---|
89 |
|
---|