VirtualBox

Changeset 90559 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Aug 7, 2021 6:41:32 AM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Notification signature for ext pack downloading which should now go to center instead of network-request center.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateManager.cpp

    r90541 r90559  
    3434#include "UINetworkCustomer.h"
    3535#include "UINetworkRequest.h"
     36#include "UINotificationCenter.h"
    3637#include "UIUpdateDefs.h"
    3738#include "UIUpdateManager.h"
     
    489490    }
    490491
    491     /* Create and configure the Extension Pack downloader: */
    492     UIDownloaderExtensionPack *pDl = UIDownloaderExtensionPack::create();
     492    /* Download extension pack: */
     493    UINotificationDownloaderExtensionPack *pNotification = new UINotificationDownloaderExtensionPack(GUI_ExtPackName);
    493494    /* After downloading finished => propose to install the Extension Pack: */
    494     connect(pDl, &UIDownloaderExtensionPack::sigDownloadFinished,
     495    connect(pNotification, &UINotificationDownloaderExtensionPack::sigExtensionPackDownloaded,
    495496            this, &UIUpdateStepVirtualBoxExtensionPack::sltHandleDownloadedExtensionPack);
    496497    /* Also, destroyed downloader is a signal to finish the step: */
    497     connect(pDl, &UIDownloaderExtensionPack::destroyed,
     498    connect(pNotification, &UINotificationDownloaderExtensionPack::sigDownloaderDestroyed,
    498499            this, &UIUpdateStepVirtualBoxExtensionPack::sigStepComplete);
    499     /* Start downloading: */
    500     pDl->start();
     500    /* Append and start notification: */
     501    notificationCenter().append(pNotification);
    501502}
    502503
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90483 r90559  
    2222/* GUI includes: */
    2323#include "UICommon.h"
     24#include "UIDownloaderExtensionPack.h"
    2425#include "UINotificationObjects.h"
    2526
     
    14851486        emit sigHostOnlyNetworkInterfaceRemoved(m_strInterfaceName);
    14861487}
     1488
     1489
     1490/*********************************************************************************************************************************
     1491*   Class UINotificationDownloaderExtensionPack implementation.                                                                  *
     1492*********************************************************************************************************************************/
     1493
     1494UINotificationDownloaderExtensionPack::UINotificationDownloaderExtensionPack(const QString &strPackName)
     1495    : m_strPackName(strPackName)
     1496{
     1497}
     1498
     1499QString UINotificationDownloaderExtensionPack::name() const
     1500{
     1501    return UINotificationDownloader::tr("Downloading Extension Pack ...");
     1502}
     1503
     1504QString UINotificationDownloaderExtensionPack::details() const
     1505{
     1506    return UINotificationProgress::tr("<b>Name:</b> %1").arg(m_strPackName);
     1507}
     1508
     1509UIDownloader *UINotificationDownloaderExtensionPack::createDownloader()
     1510{
     1511    /* Create and configure the Extension Pack downloader: */
     1512    UIDownloaderExtensionPack *pDownloader = UIDownloaderExtensionPack::create();
     1513    if (pDownloader)
     1514    {
     1515        connect(pDownloader, &UIDownloaderExtensionPack::sigDownloadFinished,
     1516                this, &UINotificationDownloaderExtensionPack::sigExtensionPackDownloaded);
     1517        return pDownloader;
     1518    }
     1519    return 0;
     1520}
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r90483 r90559  
    11181118};
    11191119
     1120/** UINotificationDownloader extension for Extension Pack downloading functionality. */
     1121class SHARED_LIBRARY_STUFF UINotificationDownloaderExtensionPack : public UINotificationDownloader
     1122{
     1123    Q_OBJECT;
     1124
     1125signals:
     1126
     1127    /** Notifies listeners about extension pack downloaded.
     1128      * @param  strSource  Brings the EP source.
     1129      * @param  strTarget  Brings the EP target.
     1130      * @param  strDigest  Brings the EP digest. */
     1131    void sigExtensionPackDownloaded(const QString &strSource,
     1132                                    const QString &strTarget,
     1133                                    const QString &strDigest);
     1134
     1135public:
     1136
     1137    /** Constructs host-only network interface remove notification-progress. */
     1138    UINotificationDownloaderExtensionPack(const QString &strPackName);
     1139
     1140protected:
     1141
     1142    /** Returns object name. */
     1143    virtual QString name() const /* override final */;
     1144    /** Returns object details. */
     1145    virtual QString details() const /* override final */;
     1146    /** Creates and returns started progress-wrapper. */
     1147    virtual UIDownloader *createDownloader() /* override final */;
     1148
     1149private:
     1150
     1151    /** Holds the pack being dowloaded. */
     1152    QString  m_strPackName;
     1153};
     1154
    11201155#endif /* !FEQT_INCLUDED_SRC_notificationcenter_UINotificationObjects_h */
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