- Timestamp:
- Aug 6, 2021 10:19:48 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/networking
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloader.cpp
r90540 r90541 24 24 25 25 26 void UIDownloader::start() 26 UIDownloader::UIDownloader() 27 : m_state(UIDownloaderState_Null) 27 28 { 28 startDelayedAcknowledging(); 29 /* Connect async listeners for our own commands: */ 30 connect(this, &UIDownloader::sigToStartAcknowledging, this, &UIDownloader::sltStartAcknowledging, Qt::QueuedConnection); 31 connect(this, &UIDownloader::sigToStartDownloading, this, &UIDownloader::sltStartDownloading, Qt::QueuedConnection); 32 connect(this, &UIDownloader::sigToStartVerifying, this, &UIDownloader::sltStartVerifying, Qt::QueuedConnection); 29 33 } 30 34 … … 56 60 } 57 61 58 UIDownloader::UIDownloader() 59 : m_state(UIDownloaderState_Null) 60 { 61 /* Connect listeners: */ 62 connect(this, &UIDownloader::sigToStartAcknowledging, this, &UIDownloader::sltStartAcknowledging, Qt::QueuedConnection); 63 connect(this, &UIDownloader::sigToStartDownloading, this, &UIDownloader::sltStartDownloading, Qt::QueuedConnection); 64 connect(this, &UIDownloader::sigToStartVerifying, this, &UIDownloader::sltStartVerifying, Qt::QueuedConnection); 65 } 66 67 const QString UIDownloader::description() const 62 QString UIDownloader::description() const 68 63 { 69 64 /* Look for known state: */ -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloader.h
r90540 r90541 52 52 public: 53 53 54 /** Constructs downloader. */ 55 UIDownloader(); 56 57 public slots: 58 54 59 /** Starts the sequence. */ 55 void start() ;60 void start() { startDelayedAcknowledging(); } 56 61 57 62 protected slots: … … 65 70 66 71 protected: 67 68 /** UIDownloader states. */69 enum UIDownloaderState70 {71 UIDownloaderState_Null,72 UIDownloaderState_Acknowledging,73 UIDownloaderState_Downloading,74 UIDownloaderState_Verifying75 };76 77 /** Constructs downloader. */78 UIDownloader();79 72 80 73 /** Appends subsequent source to try to download from. */ … … 98 91 99 92 /** Returns description of the current network operation. */ 100 virtual const QString description() const; 101 102 /** Starts delayed acknowledging. */ 103 void startDelayedAcknowledging() { emit sigToStartAcknowledging(); } 104 /** Starts delayed downloading. */ 105 void startDelayedDownloading() { emit sigToStartDownloading(); } 106 /** Starts delayed verifying. */ 107 void startDelayedVerifying() { emit sigToStartVerifying(); } 93 virtual QString description() const; 108 94 109 95 /** Handles network-reply progress for @a iReceived bytes of @a iTotal. */ 110 v oid processNetworkReplyProgress(qint64 iReceived, qint64 iTotal);96 virtual void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal) /* override */; 111 97 /** Handles network-reply failed with specified @a strError. */ 112 v oid processNetworkReplyFailed(const QString &strError);98 virtual void processNetworkReplyFailed(const QString &strError) /* override */; 113 99 /** Handles network-reply cancel request for @a pReply. */ 114 v oid processNetworkReplyCanceled(UINetworkReply *pReply);100 virtual void processNetworkReplyCanceled(UINetworkReply *pReply) /* override */; 115 101 /** Handles network-reply finish for @a pReply. */ 116 void processNetworkReplyFinished(UINetworkReply *pReply); 117 118 /** Handles acknowledging result. */ 119 virtual void handleAcknowledgingResult(UINetworkReply *pReply); 120 /** Handles downloading result. */ 121 virtual void handleDownloadingResult(UINetworkReply *pReply); 122 /** Handles verifying result. */ 123 virtual void handleVerifyingResult(UINetworkReply *pReply); 102 virtual void processNetworkReplyFinished(UINetworkReply *pReply) /* override */; 124 103 125 104 /** Asks user for downloading confirmation for passed @a pReply. */ … … 131 110 132 111 private: 112 113 /** UIDownloader states. */ 114 enum UIDownloaderState 115 { 116 UIDownloaderState_Null, 117 UIDownloaderState_Acknowledging, 118 UIDownloaderState_Downloading, 119 UIDownloaderState_Verifying 120 }; 121 122 /** Starts delayed acknowledging. */ 123 void startDelayedAcknowledging() { emit sigToStartAcknowledging(); } 124 /** Starts delayed downloading. */ 125 void startDelayedDownloading() { emit sigToStartDownloading(); } 126 /** Starts delayed verifying. */ 127 void startDelayedVerifying() { emit sigToStartVerifying(); } 128 129 /** Handles acknowledging result. */ 130 void handleAcknowledgingResult(UINetworkReply *pReply); 131 /** Handles downloading result. */ 132 void handleDownloadingResult(UINetworkReply *pReply); 133 /** Handles verifying result. */ 134 void handleVerifyingResult(UINetworkReply *pReply); 133 135 134 136 /** Holds the downloader state. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloaderAdditions.cpp
r90491 r90541 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 74 74 } 75 75 76 constQString UIDownloaderAdditions::description() const76 QString UIDownloaderAdditions::description() const 77 77 { 78 78 return UIDownloader::description().arg(tr("VirtualBox Guest Additions")); -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloaderAdditions.h
r86996 r90541 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 54 54 55 55 /** Returns description of the current network operation. */ 56 virtual constQString description() const /* override */;56 virtual QString description() const /* override */; 57 57 58 58 /** Asks user for downloading confirmation for passed @a pReply. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloaderExtensionPack.cpp
r90491 r90541 5 5 6 6 /* 7 * Copyright (C) 2011-202 0Oracle Corporation7 * Copyright (C) 2011-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 75 75 } 76 76 77 constQString UIDownloaderExtensionPack::description() const77 QString UIDownloaderExtensionPack::description() const 78 78 { 79 79 return UIDownloader::description().arg(tr("VirtualBox Extension Pack")); -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloaderExtensionPack.h
r86996 r90541 5 5 6 6 /* 7 * Copyright (C) 2011-202 0Oracle Corporation7 * Copyright (C) 2011-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 56 56 57 57 /** Returns description of the current network operation. */ 58 virtual constQString description() const /* override */;58 virtual QString description() const /* override */; 59 59 60 60 /** Asks user for downloading confirmation for passed @a pReply. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloaderUserManual.cpp
r90491 r90541 5 5 6 6 /* 7 * Copyright (C) 2006-202 0Oracle Corporation7 * Copyright (C) 2006-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 73 73 } 74 74 75 constQString UIDownloaderUserManual::description() const75 QString UIDownloaderUserManual::description() const 76 76 { 77 77 return UIDownloader::description().arg(tr("VirtualBox User Manual")); -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIDownloaderUserManual.h
r86996 r90541 5 5 6 6 /* 7 * Copyright (C) 2010-202 0Oracle Corporation7 * Copyright (C) 2010-2021 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 51 51 52 52 /** Returns description of the current network operation. */ 53 virtual constQString description() const /* override */;53 virtual QString description() const /* override */; 54 54 55 55 /** Asks user for downloading confirmation for passed @a pReply. */ -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkCustomer.h
r90540 r90541 47 47 bool isItForceCall() const { return m_fForceCall; } 48 48 49 /** Returns description of the current network operation. */ 50 virtual QString description() const { return QString(); } 51 49 52 /** Handles network reply progress for @a iReceived amount of bytes among @a iTotal. */ 50 53 virtual void processNetworkReplyProgress(qint64 iReceived, qint64 iTotal) = 0; … … 55 58 /** Handles network reply finishing for a passed @a pReply. */ 56 59 virtual void processNetworkReplyFinished(UINetworkReply *pReply) = 0; 57 58 /** Returns description of the current network operation. */59 virtual const QString description() const { return QString(); }60 60 61 61 protected: -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateManager.cpp
r90540 r90541 144 144 protected: 145 145 146 /** Returns description of the current network operation. */ 147 virtual QString description() const /* override */; 148 146 149 /** Handles network reply finishing with specified @a strError. */ 147 150 virtual void processNetworkReplyFailed(const QString &strError) /* override */; … … 150 153 /** Handles network reply finishing for a passed @a pReply. */ 151 154 virtual void processNetworkReplyFinished(UINetworkReply *pReply) /* override */; 152 153 /** Returns description of the current network operation. */154 virtual const QString description() const /* override */;155 155 156 156 protected slots: … … 249 249 *********************************************************************************************************************************/ 250 250 251 QString UIUpdateStepVirtualBox::description() const 252 { 253 return tr("Checking for a new VirtualBox version..."); 254 } 255 251 256 void UIUpdateStepVirtualBox::processNetworkReplyFailed(const QString &strError) 252 257 { … … 291 296 /* Notify about step completion: */ 292 297 emit sigStepComplete(); 293 }294 295 const QString UIUpdateStepVirtualBox::description() const296 {297 return tr("Checking for a new VirtualBox version...");298 298 } 299 299
Note:
See TracChangeset
for help on using the changeset viewer.