VirtualBox

source: vbox/trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIDownloaderUserManual.h@ 35740

Last change on this file since 35740 was 28800, checked in by vboxsync, 14 years ago

Automated rebranding to Oracle copyright/license strings via filemuncher

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.8 KB
Line 
1/** @file
2 *
3 * VBox frontends: Qt GUI ("VirtualBox"):
4 * UIDownloaderUserManual class declaration
5 */
6
7/*
8 * Copyright (C) 2010 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 __UIDownloaderUserManual_h__
20#define __UIDownloaderUserManual_h__
21
22/* Global includes */
23#include <QPointer>
24
25/* Local includes */
26#include "QIWithRetranslateUI.h"
27#include "UIDownloader.h"
28
29class UIMiniProcessWidgetUserManual : public QIWithRetranslateUI<UIMiniProcessWidget>
30{
31 Q_OBJECT;
32
33public:
34
35 UIMiniProcessWidgetUserManual(QWidget *pParent = 0)
36 : QIWithRetranslateUI<UIMiniProcessWidget>(pParent)
37 {
38 retranslateUi();
39 }
40
41protected slots:
42
43 void sltSetSource(const QString &strSource)
44 {
45 setSource(strSource);
46 retranslateUi();
47 }
48
49protected:
50
51 void retranslateUi()
52 {
53 setCancelButtonText(tr("Cancel"));
54 setCancelButtonToolTip(tr("Cancel the VirtualBox User Manual download"));
55 QString strProgressBarTip = source().isEmpty() ? tr("Downloading the VirtualBox User Manual") :
56 tr("Downloading the VirtualBox User Manual <nobr><b>%1</b>...</nobr>").arg(source());
57 setProgressBarToolTip(strProgressBarTip);
58 }
59};
60
61class UIDownloaderUserManual : public UIDownloader
62{
63 Q_OBJECT;
64
65public:
66
67 static UIDownloaderUserManual* create();
68 static UIDownloaderUserManual* current();
69 static void destroy();
70
71 void setSource(const QString &strSource);
72 void addSource(const QString &strSource);
73
74 void setParentWidget(QWidget *pParent);
75 QWidget *parentWidget() const;
76
77 UIMiniProcessWidgetUserManual* processWidget(QWidget *pParent = 0) const;
78 void startDownload();
79
80signals:
81
82 void sigSourceChanged(const QString &strSource);
83 void sigDownloadFinished(const QString &strFile);
84
85private slots:
86
87 void acknowledgeFinished(bool fError);
88 void downloadFinished(bool fError);
89 void suicide();
90
91private:
92
93 UIDownloaderUserManual();
94
95 bool confirmDownload();
96 void warnAboutError(const QString &strError);
97
98 /* Private member variables: */
99 static UIDownloaderUserManual *m_pInstance;
100
101 /* We use QPointer here, cause these items could be deleted in the life of this object.
102 * QPointer guarantees that the ptr itself is zero in that case. */
103 QPointer<QWidget> m_pParent;
104
105 /* List of sources to try to download from: */
106 QList<QString> m_sourcesList;
107};
108
109#endif // __UIDownloaderUserManual_h__
110
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use