Changeset 90528 in vbox
- Timestamp:
- Aug 5, 2021 11:35:02 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/networking
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkRequestManager.cpp
r90527 r90528 58 58 } 59 59 60 void UINetworkRequestManager::show()61 {62 /* Show network-manager dialog: */63 m_pNetworkManagerDialog->showNormal();64 }65 66 60 void UINetworkRequestManager::createNetworkRequest(UINetworkRequestType enmType, 67 61 const QList<QUrl> &urls, … … 76 70 } 77 71 72 void UINetworkRequestManager::show() 73 { 74 /* Show network-manager dialog: */ 75 m_pNetworkManagerDialog->showNormal(); 76 } 77 78 78 UINetworkRequestManager::UINetworkRequestManager() 79 79 : m_pNetworkManagerDialog(0) … … 87 87 cleanup(); 88 88 s_pInstance = 0; 89 } 90 91 void UINetworkRequestManager::sltHandleNetworkRequestProgress(qint64 iReceived, qint64 iTotal) 92 { 93 /* Make sure we have this request registered: */ 94 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender()); 95 AssertPtrReturnVoid(pNetworkRequest); 96 const QUuid uId = m_requests.key(pNetworkRequest); 97 AssertReturnVoid(!uId.isNull()); 98 99 /* Delegate request to customer: */ 100 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer(); 101 AssertPtrReturnVoid(pNetworkCustomer); 102 pNetworkCustomer->processNetworkReplyProgress(iReceived, iTotal); 103 } 104 105 void UINetworkRequestManager::sltHandleNetworkRequestCancel() 106 { 107 /* Make sure we have this request registered: */ 108 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender()); 109 AssertPtrReturnVoid(pNetworkRequest); 110 const QUuid uId = m_requests.key(pNetworkRequest); 111 AssertReturnVoid(!uId.isNull()); 112 113 /* Delegate request to customer: */ 114 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer(); 115 AssertPtrReturnVoid(pNetworkCustomer); 116 pNetworkCustomer->processNetworkReplyCanceled(pNetworkRequest->reply()); 117 118 /* Cleanup request: */ 119 cleanupNetworkRequest(uId); 120 } 121 122 void UINetworkRequestManager::sltHandleNetworkRequestFinish() 123 { 124 /* Make sure we have this request registered: */ 125 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender()); 126 AssertPtrReturnVoid(pNetworkRequest); 127 const QUuid uId = m_requests.key(pNetworkRequest); 128 AssertReturnVoid(!uId.isNull()); 129 130 /* Delegate request to customer: */ 131 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer(); 132 AssertPtrReturnVoid(pNetworkCustomer); 133 pNetworkCustomer->processNetworkReplyFinished(pNetworkRequest->reply()); 134 135 /* Cleanup request: */ 136 cleanupNetworkRequest(uId); 137 } 138 139 void UINetworkRequestManager::sltHandleNetworkRequestFailure(const QString &) 140 { 141 /* Make sure we have this request registered: */ 142 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender()); 143 AssertPtrReturnVoid(pNetworkRequest); 144 const QUuid uId = m_requests.key(pNetworkRequest); 145 AssertReturnVoid(!uId.isNull()); 146 147 /* Delegate request to customer: */ 148 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer(); 149 AssertPtrReturnVoid(pNetworkCustomer); 150 if (pNetworkCustomer->isItForceCall()) 151 { 152 /* Just show the dialog: */ 153 show(); 154 } 89 155 } 90 156 … … 143 209 delete m_pNetworkManagerDialog; 144 210 } 145 146 void UINetworkRequestManager::sltHandleNetworkRequestProgress(qint64 iReceived, qint64 iTotal)147 {148 /* Make sure we have this request registered: */149 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender());150 AssertPtrReturnVoid(pNetworkRequest);151 const QUuid uId = m_requests.key(pNetworkRequest);152 AssertReturnVoid(!uId.isNull());153 154 /* Delegate request to customer: */155 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer();156 AssertPtrReturnVoid(pNetworkCustomer);157 pNetworkCustomer->processNetworkReplyProgress(iReceived, iTotal);158 }159 160 void UINetworkRequestManager::sltHandleNetworkRequestCancel()161 {162 /* Make sure we have this request registered: */163 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender());164 AssertPtrReturnVoid(pNetworkRequest);165 const QUuid uId = m_requests.key(pNetworkRequest);166 AssertReturnVoid(!uId.isNull());167 168 /* Delegate request to customer: */169 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer();170 AssertPtrReturnVoid(pNetworkCustomer);171 pNetworkCustomer->processNetworkReplyCanceled(pNetworkRequest->reply());172 173 /* Cleanup request: */174 cleanupNetworkRequest(uId);175 }176 177 void UINetworkRequestManager::sltHandleNetworkRequestFinish()178 {179 /* Make sure we have this request registered: */180 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender());181 AssertPtrReturnVoid(pNetworkRequest);182 const QUuid uId = m_requests.key(pNetworkRequest);183 AssertReturnVoid(!uId.isNull());184 185 /* Delegate request to customer: */186 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer();187 AssertPtrReturnVoid(pNetworkCustomer);188 pNetworkCustomer->processNetworkReplyFinished(pNetworkRequest->reply());189 190 /* Cleanup request: */191 cleanupNetworkRequest(uId);192 }193 194 void UINetworkRequestManager::sltHandleNetworkRequestFailure(const QString &)195 {196 /* Make sure we have this request registered: */197 UINetworkRequest *pNetworkRequest = qobject_cast<UINetworkRequest*>(sender());198 AssertPtrReturnVoid(pNetworkRequest);199 const QUuid uId = m_requests.key(pNetworkRequest);200 AssertReturnVoid(!uId.isNull());201 202 /* Delegate request to customer: */203 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer();204 AssertPtrReturnVoid(pNetworkCustomer);205 if (pNetworkCustomer->isItForceCall())206 {207 /* Just show the dialog: */208 show();209 }210 } -
trunk/src/VBox/Frontends/VirtualBox/src/networking/UINetworkRequestManager.h
r90527 r90528 59 59 UINetworkRequestManagerWindow *window() const; 60 60 61 public slots:62 63 /** Shows network-manager dialog. */64 void show();65 66 protected:67 68 /** Allows UINetworkCustomer to create network-request. */69 friend class UINetworkCustomer;70 71 61 /** Creates network-request returning request ID. 72 62 * @param enmType Brings request type. … … 81 71 UINetworkCustomer *pCustomer); 82 72 73 public slots: 74 75 /** Shows network-manager dialog. */ 76 void show(); 77 83 78 private: 84 79 … … 87 82 /** Destructs network manager. */ 88 83 virtual ~UINetworkRequestManager() /* override final */; 89 90 /** Prepares all. */91 void prepare();92 /** Prepares @a pNetworkRequest. */93 void prepareNetworkRequest(UINetworkRequest *pNetworkRequest);94 /** Cleanups network-request with passed @a uId. */95 void cleanupNetworkRequest(const QUuid &uId);96 /** Cleanups all network-requests. */97 void cleanupNetworkRequests();98 /** Cleanups all. */99 void cleanup();100 84 101 85 private slots: … … 111 95 112 96 private: 97 98 /** Prepares all. */ 99 void prepare(); 100 /** Prepares @a pNetworkRequest. */ 101 void prepareNetworkRequest(UINetworkRequest *pNetworkRequest); 102 /** Cleanups network-request with passed @a uId. */ 103 void cleanupNetworkRequest(const QUuid &uId); 104 /** Cleanups all network-requests. */ 105 void cleanupNetworkRequests(); 106 /** Cleanups all. */ 107 void cleanup(); 113 108 114 109 /** Holds the singleton instance. */
Note:
See TracChangeset
for help on using the changeset viewer.