VirtualBox

Changeset 41140 in vbox


Ignore:
Timestamp:
May 3, 2012 3:43:49 PM (13 years ago)
Author:
vboxsync
Message:

FE/Qt: Network Manager stuff: Downloaders stuff: Cleanup.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/net
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloader.cpp

    r39932 r41140  
    2626#include "UIMessageCenter.h"
    2727#include "VBoxUtils.h"
    28 
    29 #if 0
    30 /* Global includes: */
    31 #include <QProgressBar>
    32 
    33 /* Local includes: */
    34 #include "UISpecialControls.h"
    35 
    36 /* UIMiniProgressWidget stuff: */
    37 UIMiniProgressWidget::UIMiniProgressWidget(QWidget *pParent /* = 0 */)
    38     : QWidget(pParent)
    39     , m_pProgressBar(new QProgressBar(this))
    40     , m_pCancelButton(new UIMiniCancelButton(this))
    41 {
    42     /* Progress-bar setup: */
    43     m_pProgressBar->setFixedWidth(100);
    44     m_pProgressBar->setFormat("%p%");
    45     m_pProgressBar->setValue(0);
    46 
    47     /* Cancel-button setup: */
    48     m_pCancelButton->setFocusPolicy(Qt::NoFocus);
    49     m_pCancelButton->removeBorder();
    50     connect(m_pCancelButton, SIGNAL(clicked()), this, SIGNAL(sigCancel()));
    51 
    52     setContentsMargins(0, 0, 0, 0);
    53     setFixedHeight(16);
    54 
    55     /* Layout setup: */
    56     QHBoxLayout *pMainLayout = new QHBoxLayout(this);
    57     VBoxGlobal::setLayoutMargin(pMainLayout, 0);
    58 
    59 #ifdef Q_WS_MAC
    60     pMainLayout->setSpacing(2);
    61     m_pProgressBar->setFixedHeight(14);
    62     m_pCancelButton->setFixedHeight(11);
    63     pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignTop);
    64     pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignBottom);
    65 #else /* Q_WS_MAC */
    66     pMainLayout->setSpacing(0);
    67     pMainLayout->addWidget(m_pProgressBar, 0, Qt::AlignCenter);
    68     pMainLayout->addWidget(m_pCancelButton, 0, Qt::AlignCenter);
    69 #endif /* !Q_WS_MAC */
    70 
    71     pMainLayout->addStretch(1);
    72 }
    73 
    74 void UIMiniProgressWidget::setCancelButtonToolTip(const QString &strText)
    75 {
    76     m_pCancelButton->setToolTip(strText);
    77 }
    78 
    79 QString UIMiniProgressWidget::cancelButtonToolTip() const
    80 {
    81     return m_pCancelButton->toolTip();
    82 }
    83 
    84 void UIMiniProgressWidget::setProgressBarToolTip(const QString &strText)
    85 {
    86     m_pProgressBar->setToolTip(strText);
    87 }
    88 
    89 QString UIMiniProgressWidget::progressBarToolTip() const
    90 {
    91     return m_pProgressBar->toolTip();
    92 }
    93 
    94 void UIMiniProgressWidget::sltSetSource(const QString &strSource)
    95 {
    96     m_strSource = strSource;
    97 }
    98 
    99 void UIMiniProgressWidget::sltSetProgress(qint64 cDone, qint64 cTotal)
    100 {
    101     m_pProgressBar->setMaximum(cTotal);
    102     m_pProgressBar->setValue(cDone);
    103 }
    104 #endif
    10528
    10629/* Starting routine: */
     
    13861}
    13962
    140 #if 0
    141 /* Cancel-button stuff: */
    142 void UIDownloader::sltCancel()
    143 {
    144     /* Delete downloader: */
    145     deleteLater();
    146 }
    147 #endif
    148 
    14963/* Constructor: */
    15064UIDownloader::UIDownloader()
     65    : m_state(UIDownloaderState_Null)
    15166{
    152     /* Choose initial state: */
    153     m_state = UIDownloaderState_Null;
    154 
    15567    /* Connect listeners: */
    15668    connect(this, SIGNAL(sigToStartAcknowledging()), this, SLOT(sltStartAcknowledging()), Qt::QueuedConnection);
     
    16476    Q_UNUSED(iReceived);
    16577    Q_UNUSED(iTotal);
    166 
    167 #if 0
    168     emit sigDownloadProgress(iReceived, iTotal);
    169 #endif
    17078}
    17179
     
    230138}
    231139
    232 #if 0
    233 /* UIDownloader stuff: */
    234 UIMiniProgressWidget* UIDownloader::progressWidget(QWidget *pParent) const
    235 {
    236     /* Create progress widget: */
    237     UIMiniProgressWidget *pWidget = createProgressWidgetFor(pParent);
    238 
    239     /* Connect the signal to notify about progress canceled: */
    240     connect(pWidget, SIGNAL(sigCancel()), this, SLOT(sltCancel()));
    241     /* Connect the signal to notify about source changed: */
    242     connect(this, SIGNAL(sigSourceChanged(const QString&)), pWidget, SLOT(sltSetSource(const QString&)));
    243     /* Connect the signal to notify about downloading progress: */
    244     connect(this, SIGNAL(sigDownloadProgress(qint64, qint64)), pWidget, SLOT(sltSetProgress(qint64, qint64)));
    245     /* Make sure the widget is destroyed when this class is deleted: */
    246     connect(this, SIGNAL(destroyed(QObject*)), pWidget, SLOT(deleteLater()));
    247 
    248     /* Return widget: */
    249     return pWidget;
    250 }
    251 #endif
    252 
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloader.h

    r39932 r41140  
    2121
    2222/* Global includes: */
    23 #include <QWidget>
    2423#include <QUrl>
    25 #include <QPointer>
    2624#include <QList>
    2725
     
    3331class QNetworkReply;
    3432
    35 #if 0
    36 /* Forward declarations: */
    37 class QProgressBar;
    38 class UIMiniCancelButton;
    39 
    40 /**
    41  * The UIMiniProgressWidget class is QWidget class re-implementation which
    42  * embeds into the dialog's status-bar and reflects background http downloading.
    43  * This class is not supposed to be used itself and made for sub-classing only.
    44  */
    45 class UIMiniProgressWidget : public QWidget
    46 {
    47     Q_OBJECT;
    48 
    49 signals:
    50 
    51     /* Signal to notify listeners about progress canceling: */
    52     void sigCancel();
    53 
    54 protected:
    55 
    56     /* Constructor: */
    57     UIMiniProgressWidget(QWidget *pParent = 0);
    58 
    59     /* Source stuff: */
    60     QString source() const { return m_strSource; }
    61 
    62     /* Cancel-button stuff: */
    63     void setCancelButtonToolTip(const QString &strText);
    64     QString cancelButtonToolTip() const;
    65 
    66     /* Progress-bar stuff: */
    67     void setProgressBarToolTip(const QString &strText);
    68     QString progressBarToolTip() const;
    69 
    70 protected slots:
    71 
    72     /* Slot to set source: */
    73     void sltSetSource(const QString &strSource);
    74 
    75     /* Slot to set progress: */
    76     void sltSetProgress(qint64 cDone, qint64 cTotal);
    77 
    78 private:
    79 
    80     /* Private member vars: */
    81     QProgressBar *m_pProgressBar;
    82     UIMiniCancelButton *m_pCancelButton;
    83     QString m_strSource;
    84 };
    85 #endif
    86 
    87 /**
    88  * The UIDownloader class is UINetworkCustomer class extension
    89  * which allows background http downloading.
    90  * This class is not supposed to be used itself and made for sub-classing only.
    91  */
     33/* Downloader interface.
     34 * UINetworkCustomer class extension which allows background http downloading. */
    9235class UIDownloader : public UINetworkCustomer
    9336{
     
    10144    void sigToStartDownloading();
    10245
    103 #if 0
    104     /* Notifies listeners about source-change: */
    105     void sigSourceChanged(const QString &strNewSource);
    106 
    107     /* Notifies about downloading progress: */
    108     void sigDownloadProgress(qint64 cDone, qint64 cTotal);
    109 #endif
    110 
    11146public:
    11247
    11348    /* Starting routine: */
    114     virtual void start();
     49    void start();
    11550
    116 private slots:
     51protected slots:
    11752
    11853    /* Acknowledging part: */
     
    12055    /* Downloading part: */
    12156    void sltStartDownloading();
    122 
    123 #if 0
    124     /* Common slots: */
    125     void sltCancel();
    126 #endif
    12757
    12858protected:
     
    177107    virtual void handleDownloadedObject(QNetworkReply *pNetworkReply) = 0;
    178108
    179 #if 0
    180     /* Pure virtual function to create UIMiniProgressWidget sub-class: */
    181     virtual UIMiniProgressWidget* createProgressWidgetFor(QWidget *pParent) const = 0;
    182     /* Create UIMiniProgressWidget for particular parent: */
    183     UIMiniProgressWidget* progressWidget(QWidget *pParent = 0) const;
    184 #endif
    185 
    186109private:
    187110
    188111    /* Private variables: */
    189112    UIDownloaderState m_state;
    190     QPointer<QWidget> m_pParent;
    191113    QList<QUrl> m_sources;
    192114    QUrl m_source;
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp

    r39932 r41140  
    2929#include "UIMessageCenter.h"
    3030
    31 /* Static stuff: */
     31/* static */
    3232UIDownloaderAdditions* UIDownloaderAdditions::m_spInstance = 0;
    3333
     34/* static */
    3435UIDownloaderAdditions* UIDownloaderAdditions::create()
    3536{
     
    3940}
    4041
     42/* static */
    4143UIDownloaderAdditions* UIDownloaderAdditions::current()
    4244{
     
    4446}
    4547
    46 /* Starting routine: */
    47 void UIDownloaderAdditions::start()
    48 {
    49     /* Call for base-class: */
    50     UIDownloader::start();
    51 #if 0
    52     /* Notify about downloading started: */
    53     notifyDownloaderCreated(UIDownloadType_Additions);
    54 #endif
    55 }
    56 
    57 /* Constructor: */
    5848UIDownloaderAdditions::UIDownloaderAdditions()
    5949{
     
    7565}
    7666
    77 /* Destructor: */
    7867UIDownloaderAdditions::~UIDownloaderAdditions()
    7968{
     
    8372}
    8473
    85 /* Virtual stuff reimplementations: */
    8674bool UIDownloaderAdditions::askForDownloadingConfirmation(QNetworkReply *pReply)
    8775{
     
    8977}
    9078
    91 /* Virtual stuff reimplementations: */
    9279void UIDownloaderAdditions::handleDownloadedObject(QNetworkReply *pReply)
    9380{
    94     /* Read received data: */
     81    /* Read received data into the buffer: */
    9582    QByteArray receivedData(pReply->readAll());
    96     /* Serialize the incoming buffer into the .iso image: */
     83    /* Serialize that buffer into the file: */
    9784    while (true)
    9885    {
    99         /* Try to open file to save image: */
     86        /* Try to open file for writing: */
    10087        QFile file(target());
    10188        if (file.open(QIODevice::WriteOnly))
    10289        {
    103             /* Write received data into the file: */
     90            /* Write buffer into the file: */
    10491            file.write(receivedData);
    10592            file.close();
    10693
    107             /* Warn user about additions image loaded and saved, propose to mount it: */
     94            /* Warn the user about additions-image loaded and saved, propose to mount it: */
    10895            if (msgCenter().confirmMountAdditions(source().toString(), QDir::toNativeSeparators(target())))
    10996                emit sigDownloadFinished(target());
     
    11198        }
    11299
    113         /* Warn user about additions image was downloaded but was NOT saved: */
     100        /* Warn the user about additions-image was downloaded but was NOT saved: */
    114101        msgCenter().warnAboutAdditionsCantBeSaved(target());
    115102
    116         /* Ask the user for another location for the additions image file: */
     103        /* Ask the user for another location for the additions-image file: */
    117104        QString strTarget = QIFileDialog::getExistingDirectory(QFileInfo(target()).absolutePath(),
    118105                                                               msgCenter().networkManagerOrMainMachineWindowShown(),
     
    127114}
    128115
    129 #if 0
    130 UIMiniProgressWidget* UIDownloaderAdditions::createProgressWidgetFor(QWidget *pParent) const
    131 {
    132     return new UIMiniProgressWidgetAdditions(source(), pParent);
    133 }
    134 #endif
    135 
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.h

    r39932 r41140  
    2323#include "UIDownloader.h"
    2424
    25 #if 0
    26 /* Local includes: */
    27 # include "QIWithRetranslateUI.h"
    28 
    29 /**
    30  * The UIMiniProgressWidgetAdditions class is UIMiniProgressWidget class re-implementation
    31  * which embeds into the dialog's status-bar and reflects background http downloading.
    32  */
    33 class UIMiniProgressWidgetAdditions : public QIWithRetranslateUI<UIMiniProgressWidget>
    34 {
    35     Q_OBJECT;
    36 
    37 public:
    38 
    39     /* Constructor: */
    40     UIMiniProgressWidgetAdditions(const QString &strSource, QWidget *pParent = 0)
    41         : QIWithRetranslateUI<UIMiniProgressWidget>(pParent)
    42     {
    43         sltSetSource(strSource);
    44         retranslateUi();
    45     }
    46 
    47 protected:
    48 
    49     /* Translating stuff: */
    50     void retranslateUi()
    51     {
    52         setCancelButtonToolTip(tr("Cancel the VirtualBox Guest Additions CD image download"));
    53         setProgressBarToolTip(tr("Downloading the VirtualBox Guest Additions CD image from <nobr><b>%1</b>...</nobr>")
    54                                 .arg(source()));
    55     }
    56 };
    57 #endif
    58 
    59 /**
    60  * The UIDownloaderAdditions class is UIDownloader class extension
    61  * which allows background http downloading.
    62  */
     25/* UIDownloader extension for background additions downloading. */
    6326class UIDownloaderAdditions : public UIDownloader
    6427{
     
    6730signals:
    6831
    69     /* Notifies listeners about file was downloaded: */
     32    /* Notifies listeners about downloading finished: */
    7033    void sigDownloadFinished(const QString &strFile);
    7134
     
    7538    static UIDownloaderAdditions* create();
    7639    static UIDownloaderAdditions* current();
    77 
    78     /* Starting routine: */
    79     void start();
    8040
    8141private:
     
    8848    bool askForDownloadingConfirmation(QNetworkReply *pReply);
    8949    void handleDownloadedObject(QNetworkReply *pReply);
    90 #if 0
    91     UIMiniProgressWidget* createProgressWidgetFor(QWidget *pParent) const;
    92 #endif
    9350
    94     /* Static instance variable: */
     51    /* Variables: */
    9552    static UIDownloaderAdditions *m_spInstance;
    9653};
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.cpp

    r39932 r41140  
    3434using namespace VBoxGlobalDefs;
    3535
    36 /* Static stuff: */
     36/* static */
    3737UIDownloaderExtensionPack* UIDownloaderExtensionPack::m_spInstance = 0;
    3838
     39/* static */
    3940UIDownloaderExtensionPack* UIDownloaderExtensionPack::create()
    4041{
     
    4445}
    4546
     47/* static */
    4648UIDownloaderExtensionPack* UIDownloaderExtensionPack::current()
    4749{
     
    4951}
    5052
    51 /* Starting routine: */
    52 void UIDownloaderExtensionPack::start()
    53 {
    54     /* Call for base-class: */
    55     UIDownloader::start();
    56 #if 0
    57     /* Notify about downloading started: */
    58     notifyDownloaderCreated(UIDownloadType_ExtensionPack);
    59 #endif
    60 }
    61 
    62 /* Constructor: */
    6353UIDownloaderExtensionPack::UIDownloaderExtensionPack()
    6454{
     
    8676}
    8777
    88 /* Destructor: */
    8978UIDownloaderExtensionPack::~UIDownloaderExtensionPack()
    9079{
     
    9483}
    9584
    96 /* Virtual stuff reimplementations: */
    9785bool UIDownloaderExtensionPack::askForDownloadingConfirmation(QNetworkReply *pReply)
    9886{
     
    10290void UIDownloaderExtensionPack::handleDownloadedObject(QNetworkReply *pReply)
    10391{
    104     /* Read received data into buffer: */
     92    /* Read received data into the buffer: */
    10593    QByteArray receivedData(pReply->readAll());
    106     /* Serialize the incoming buffer into the file: */
     94    /* Serialize that buffer into the file: */
    10795    while (true)
    10896    {
     
    11199        if (file.open(QIODevice::WriteOnly))
    112100        {
    113             /* Write incoming buffer into the file: */
     101            /* Write buffer into the file: */
    114102            file.write(receivedData);
    115103            file.close();
     
    126114            }
    127115
    128             /* Notify listener about extension pack was downloaded: */
     116            /* Warn the listener about extension-pack was downloaded: */
    129117            emit sigDownloadFinished(source().toString(), target(), &szDigest[0]);
    130118            break;
    131119        }
    132120
    133         /* Warn the user about extension pack was downloaded but was NOT saved: */
     121        /* Warn the user about extension-pack was downloaded but was NOT saved: */
    134122        msgCenter().warnAboutExtentionPackCantBeSaved(UI_ExtPackName, source().toString(), QDir::toNativeSeparators(target()));
    135123
    136         /* Ask the user for another location for the extension pack file: */
     124        /* Ask the user for another location for the extension-pack file: */
    137125        QString strTarget = QIFileDialog::getExistingDirectory(QFileInfo(target()).absolutePath(),
    138126                                                               msgCenter().networkManagerOrMainWindowShown(),
     
    147135}
    148136
    149 #if 0
    150 UIMiniProgressWidget* UIDownloaderExtensionPack::createProgressWidgetFor(QWidget *pParent) const
    151 {
    152     return new UIMiniProgressWidgetExtension(source(), pParent);
    153 }
    154 #endif
    155 
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderExtensionPack.h

    r39932 r41140  
    2323#include "UIDownloader.h"
    2424
    25 #if 0
    26 /* Local includes: */
    27 # include "QIWithRetranslateUI.h"
    28 
    29 /**
    30  * The UIMiniProgressWidgetExtension class is UIMiniProgressWidget class re-implementation
    31  * which embeds into the dialog's status-bar and reflects background http downloading.
    32  */
    33 class UIMiniProgressWidgetExtension : public QIWithRetranslateUI<UIMiniProgressWidget>
    34 {
    35     Q_OBJECT;
    36 
    37 public:
    38 
    39     /* Constructor: */
    40     UIMiniProgressWidgetExtension(const QString &strSource, QWidget *pParent = 0)
    41         : QIWithRetranslateUI<UIMiniProgressWidget>(pParent)
    42     {
    43         sltSetSource(strSource);
    44         retranslateUi();
    45     }
    46 
    47 private:
    48 
    49     /* Translating stuff: */
    50     void retranslateUi()
    51     {
    52         setCancelButtonToolTip(tr("Cancel the <nobr><b>%1</b></nobr> download").arg(UI_ExtPackName));
    53         setProgressBarToolTip(tr("Downloading the <nobr><b>%1</b></nobr> from <nobr><b>%2</b>...</nobr>")
    54                                  .arg(UI_ExtPackName, source()));
    55     }
    56 };
    57 #endif
    58 
    59 /**
    60  * The UIDownloaderExtensionPack class is UIDownloader class extension
    61  * which allows background http downloading.
    62  */
     25/* UIDownloader extension for background extension-pack downloading. */
    6326class UIDownloaderExtensionPack : public UIDownloader
    6427{
     
    6730signals:
    6831
    69     /* Notify listeners about file was downloaded: */
     32    /* Notifies listeners about downloading finished: */
    7033    void sigDownloadFinished(const QString &strSource, const QString &strTarget, QString strHash);
    7134
     
    7538    static UIDownloaderExtensionPack* create();
    7639    static UIDownloaderExtensionPack* current();
    77 
    78     /* Starting routine: */
    79     void start();
    8040
    8141private:
     
    8848    bool askForDownloadingConfirmation(QNetworkReply *pReply);
    8949    void handleDownloadedObject(QNetworkReply *pReply);
    90 #if 0
    91     UIMiniProgressWidget* createProgressWidgetFor(QWidget *pParent) const;
    92 #endif
    9350
    94     /* Static instance variable: */
     51    /* Variables: */
    9552    static UIDownloaderExtensionPack *m_spInstance;
    9653};
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderUserManual.cpp

    r39932 r41140  
    2929#include "UIMessageCenter.h"
    3030
    31 /* Static stuff: */
     31/* static */
    3232UIDownloaderUserManual* UIDownloaderUserManual::m_spInstance = 0;
    3333
     34/* static */
    3435UIDownloaderUserManual* UIDownloaderUserManual::create()
    3536{
     
    3940}
    4041
     42/* static */
    4143UIDownloaderUserManual* UIDownloaderUserManual::current()
    4244{
    4345    return m_spInstance;
    44 }
    45 
    46 void UIDownloaderUserManual::start()
    47 {
    48     /* Call for base-class: */
    49     UIDownloader::start();
    50 #if 0
    51     /* Notify about downloading started: */
    52     notifyDownloaderCreated(UIDownloadType_UserManual);
    53 #endif
    5446}
    5547
     
    9082void UIDownloaderUserManual::handleDownloadedObject(QNetworkReply *pReply)
    9183{
    92     /* Read received data: */
     84    /* Read received data into the buffer: */
    9385    QByteArray receivedData(pReply->readAll());
    94     /* Serialize the incoming buffer into the User Manual file: */
     86    /* Serialize that buffer into the file: */
    9587    while (true)
    9688    {
    97         /* Try to open file to save document: */
     89        /* Try to open file for writing: */
    9890        QFile file(target());
    9991        if (file.open(QIODevice::WriteOnly))
    10092        {
    101             /* Write received data into file: */
     93            /* Write buffer into the file: */
    10294            file.write(receivedData);
    10395            file.close();
    10496
    105             /* Warn user about User Manual document loaded and saved: */
     97            /* Warn the user about user-manual loaded and saved: */
    10698            msgCenter().warnAboutUserManualDownloaded(source().toString(), QDir::toNativeSeparators(target()));
    107             /* Warn listener about User Manual was downloaded: */
     99            /* Warn the listener about user-manual was downloaded: */
    108100            emit sigDownloadFinished(target());
    109101            break;
    110102        }
    111103
    112         /* Warn user about User Manual document was downloaded but was NOT saved: */
     104        /* Warn user about user-manual was downloaded but was NOT saved: */
    113105        msgCenter().warnAboutUserManualCantBeSaved(source().toString(), QDir::toNativeSeparators(target()));
    114106
    115         /* Ask the user for another location for User Manual file: */
     107        /* Ask the user for another location for the user-manual file: */
    116108        QString strTarget = QIFileDialog::getExistingDirectory(QFileInfo(target()).absolutePath(),
    117109                                                               msgCenter().networkManagerOrMainWindowShown(),
     
    126118}
    127119
    128 #if 0
    129 UIMiniProgressWidget* UIDownloaderUserManual::createProgressWidgetFor(QWidget *pParent) const
    130 {
    131     return new UIMiniProcessWidgetUserManual(pParent);
    132 }
    133 #endif
    134 
  • trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderUserManual.h

    r39932 r41140  
    2323#include "UIDownloader.h"
    2424
    25 #if 0
    26 /* Local includes: */
    27 # include "QIWithRetranslateUI.h"
    28 
    29 /**
    30  * The UIMiniProcessWidgetUserManual class is UIMiniProgressWidget class re-implementation
    31  * which embeds into the dialog's status-bar and reflects background http downloading.
    32  */
    33 class UIMiniProcessWidgetUserManual : public QIWithRetranslateUI<UIMiniProgressWidget>
    34 {
    35     Q_OBJECT;
    36 
    37 public:
    38 
    39     /* Constructor: */
    40     UIMiniProcessWidgetUserManual(QWidget *pParent = 0)
    41         : QIWithRetranslateUI<UIMiniProgressWidget>(pParent)
    42     {
    43         retranslateUi();
    44     }
    45 
    46 private slots:
    47 
    48     /* Source change stuff: */
    49     void sltSetSource(const QString &strSource)
    50     {
    51         UIMiniProgressWidget::sltSetSource(strSource);
    52         retranslateUi();
    53     }
    54 
    55 private:
    56 
    57     /* Translating stuff: */
    58     void retranslateUi()
    59     {
    60         setCancelButtonToolTip(tr("Cancel the VirtualBox User Manual download"));
    61         setProgressBarToolTip(source().isEmpty() ? tr("Downloading the VirtualBox User Manual") :
    62                                                    tr("Downloading the VirtualBox User Manual <nobr><b>%1</b>...</nobr>")
    63                                                      .arg(source()));
    64     }
    65 };
    66 #endif
    67 
    68 /**
    69  * The UIDownloaderUserManual class is UIDownloader class extension
    70  * which allows background http downloading.
    71  */
     25/* UIDownloader extension for background user-manual downloading. */
    7226class UIDownloaderUserManual : public UIDownloader
    7327{
     
    7630signals:
    7731
    78     /* Notifies listeners about file was downloaded: */
     32    /* Notifies listeners about downloading finished: */
    7933    void sigDownloadFinished(const QString &strFile);
    8034
     
    8438    static UIDownloaderUserManual* create();
    8539    static UIDownloaderUserManual* current();
    86 
    87     /* Starting routine: */
    88     void start();
    8940
    9041private:
     
    9748    bool askForDownloadingConfirmation(QNetworkReply *pReply);
    9849    void handleDownloadedObject(QNetworkReply *pReply);
    99 #if 0
    100     UIMiniProgressWidget* createProgressWidgetFor(QWidget *pParent) const;
    101 #endif
    10250
    103     /* Static instance variable: */
     51    /* Variables: */
    10452    static UIDownloaderUserManual *m_spInstance;
    10553};
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette