Changeset 41153 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- May 3, 2012 10:23:07 PM (13 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r41017 r41153 1949 1949 } 1950 1950 1951 bool UIMessageCenter::askAboutCancelOrLeaveAllNetworkRequest(QWidget *pParent)1952 {1953 return messageYesNo(pParent, Question, tr("Do you wish to cancel all current network operations or leave them running in the background?"),1954 0 /* auto-confirm id */, tr("Cancel All"), tr("Leave in Background"));1955 }1956 1957 1951 /** 1958 1952 * @return @c true if the user has confirmed input capture (this is always -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r41017 r41153 327 327 328 328 bool askAboutCancelAllNetworkRequest(QWidget *pParent); 329 bool askAboutCancelOrLeaveAllNetworkRequest(QWidget *pParent);330 329 331 330 bool confirmInputCapture(bool *pfAutoConfirmed = NULL); -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.cpp
r41142 r41153 25 25 #include "UINetworkManager.h" 26 26 27 UINetworkCustomer::UINetworkCustomer(QObject *pParent /* = 0 */) 27 UINetworkCustomer::UINetworkCustomer() 28 : QObject(0) 29 , m_fForceCall(true) 30 { 31 } 32 33 UINetworkCustomer::UINetworkCustomer(QObject *pParent, bool fForceCall) 28 34 : QObject(pParent) 35 , m_fForceCall(fForceCall) 29 36 { 30 37 } -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkCustomer.h
r41142 r41153 37 37 public: 38 38 39 /* Constructor: */ 40 UINetworkCustomer(QObject *pParent = 0); 39 /* Constructors: */ 40 UINetworkCustomer(); 41 UINetworkCustomer(QObject *pParent, bool fForceCall); 42 43 /* Getters: */ 44 bool isItForceCall() const { return m_fForceCall; } 41 45 42 46 /* Network-reply progress handler: */ … … 53 57 /* Network-request wrapper (set): */ 54 58 void createNetworkRequest(const QList<QNetworkRequest> &requests, UINetworkRequestType type, const QString &strDescription); 59 60 private: 61 62 /* Variables: */ 63 bool m_fForceCall; 55 64 }; 56 65 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UINetworkManager.cpp
r41152 r41153 335 335 /* Show button-box: */ 336 336 m_pButtonBox->setHidden(false); 337 /* Show dialog: */ 338 showNormal(); 337 /* If customer made a force-call: */ 338 if (pNetworkRequest->customer()->isItForceCall()) 339 { 340 /* Show dialog: */ 341 showNormal(); 342 } 339 343 340 344 /* Return network-request widget: */ … … 401 405 /* Pass event to the base-class: */ 402 406 QMainWindow::showEvent(pShowEvent); 403 }404 405 /* Overloaded close-event: */406 void closeEvent(QCloseEvent *pCloseEvent)407 {408 /* If there are network-requests present409 * ask if user wants to cancel all current network-requests410 * or leave them working at the background: */411 if (!m_widgets.isEmpty() &&412 msgCenter().askAboutCancelOrLeaveAllNetworkRequest(this))413 emit sigCancelNetworkRequests();414 415 /* Pass event to the base-class: */416 QMainWindow::closeEvent(pCloseEvent);417 407 } 418 408 … … 854 844 855 845 /* Slot to handle network-request failure: */ 856 void UINetworkManager::sltHandleNetworkRequestFailure(const QUuid &uuid, const QString &strError) 857 { 858 /* Just show the dialog: */ 859 show(); 860 Q_UNUSED(uuid); 861 Q_UNUSED(strError); 846 void UINetworkManager::sltHandleNetworkRequestFailure(const QUuid &uuid, const QString &) 847 { 848 /* Make sure corresponding map contains received ID: */ 849 AssertMsg(m_requests.contains(uuid), ("Network-request NOT found!\n")); 850 851 /* Get corresponding network-request: */ 852 UINetworkRequest *pNetworkRequest = m_requests.value(uuid); 853 854 /* Get corresponding customer: */ 855 UINetworkCustomer *pNetworkCustomer = pNetworkRequest->customer(); 856 857 /* If customer made a force-call: */ 858 if (pNetworkCustomer->isItForceCall()) 859 { 860 /* Just show the dialog: */ 861 show(); 862 } 862 863 } 863 864 -
trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
r41145 r41153 91 91 92 92 /* Constructor: */ 93 UIUpdateStep(UIUpdateQueue *pQueue ) : UINetworkCustomer(pQueue)93 UIUpdateStep(UIUpdateQueue *pQueue, bool fForceCall) : UINetworkCustomer(pQueue, fForceCall) 94 94 { 95 95 /* If queue has no steps yet: */ … … 140 140 /* Constructor: */ 141 141 UIUpdateStepVirtualBox(UIUpdateQueue *pQueue, bool fForceCall) 142 : UIUpdateStep(pQueue )142 : UIUpdateStep(pQueue, fForceCall) 143 143 , m_url("http://update.virtualbox.org/query.php") 144 , m_fForceCall(fForceCall)145 144 { 146 145 } … … 217 216 else 218 217 { 219 if ( m_fForceCall)218 if (isItForceCall()) 220 219 msgCenter().showUpdateNotFound(); 221 220 } … … 240 239 /* Variables: */ 241 240 QUrl m_url; 242 bool m_fForceCall;243 241 }; 244 242 … … 251 249 252 250 /* Constructor: */ 253 UIUpdateStepVirtualBoxExtensionPack(UIUpdateQueue *pQueue )254 : UIUpdateStep(pQueue )251 UIUpdateStepVirtualBoxExtensionPack(UIUpdateQueue *pQueue, bool fForceCall) 252 : UIUpdateStep(pQueue, fForceCall) 255 253 { 256 254 } … … 395 393 void UIUpdateManager::sltCheckIfUpdateIsNecessary(bool fForceCall /* = false */) 396 394 { 397 /* If already running => just open Network Access Manager GUI: */395 /* If already running: */ 398 396 if (m_fIsRunning) 399 397 { 400 gNetworkManager->show(); 398 /* And we have a force-call: */ 399 if (fForceCall) 400 { 401 /* Just show Network Access Manager: */ 402 gNetworkManager->show(); 403 } 401 404 return; 402 405 } … … 413 416 /* Prepare update queue: */ 414 417 new UIUpdateStepVirtualBox(m_pQueue, fForceCall); 415 new UIUpdateStepVirtualBoxExtensionPack(m_pQueue );418 new UIUpdateStepVirtualBoxExtensionPack(m_pQueue, fForceCall); 416 419 /* Start update queue: */ 417 420 m_pQueue->start();
Note:
See TracChangeset
for help on using the changeset viewer.