Changeset 69005 in vbox
- Timestamp:
- Oct 6, 2017 2:37:28 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp
r69004 r69005 90 90 int UIProgressDialog::run(int cRefreshInterval) 91 91 { 92 if (m_comProgress.isOk()) 93 { 94 /* Start refresh timer: */ 95 int id = startTimer(cRefreshInterval); 96 97 /* Set busy cursor. 98 * We don't do this on the Mac, cause regarding the design rules of 99 * Apple there is no busy window behavior. A window should always be 100 * responsive and it is in our case (We show the progress dialog bar). */ 92 /* Make sure progress hasn't finished already: */ 93 if (!m_comProgress.isOk() || m_comProgress.GetCompleted()) 94 { 95 /* Progress completed? */ 96 if (m_comProgress.isOk()) 97 return Accepted; 98 /* Or aborted? */ 99 else 100 return Rejected; 101 } 102 103 /* Start refresh timer: */ 104 int id = startTimer(cRefreshInterval); 105 106 /* Set busy cursor. 107 * We don't do this on the Mac, cause regarding the design rules of 108 * Apple there is no busy window behavior. A window should always be 109 * responsive and it is in our case (We show the progress dialog bar). */ 101 110 #ifndef VBOX_WS_MAC 102 if (m_fCancelEnabled)103 QApplication::setOverrideCursor(QCursor(Qt::BusyCursor));104 else105 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor));111 if (m_fCancelEnabled) 112 QApplication::setOverrideCursor(QCursor(Qt::BusyCursor)); 113 else 114 QApplication::setOverrideCursor(QCursor(Qt::WaitCursor)); 106 115 #endif /* VBOX_WS_MAC */ 107 116 108 /* Create a local event-loop: */109 {110 /* Guard ourself for the case111 * we destroyed ourself in our event-loop: */112 QPointer<UIProgressDialog> guard = this;113 114 /* Holds the modal loop, but don't show the window immediately: */115 execute(false);116 117 /* Are we still valid? */118 if (guard.isNull())119 return Rejected;120 }121 122 /* Kill refresh timer: */123 killTimer(id);117 /* Create a local event-loop: */ 118 { 119 /* Guard ourself for the case 120 * we destroyed ourself in our event-loop: */ 121 QPointer<UIProgressDialog> guard = this; 122 123 /* Holds the modal loop, but don't show the window immediately: */ 124 execute(false); 125 126 /* Are we still valid? */ 127 if (guard.isNull()) 128 return Rejected; 129 } 130 131 /* Kill refresh timer: */ 132 killTimer(id); 124 133 125 134 #ifndef VBOX_WS_MAC 126 /* Reset the busy cursor */127 QApplication::restoreOverrideCursor();135 /* Reset the busy cursor */ 136 QApplication::restoreOverrideCursor(); 128 137 #endif /* VBOX_WS_MAC */ 129 138 130 return result(); 131 } 132 return Rejected; 139 return result(); 133 140 } 134 141 … … 440 447 { 441 448 /* Set progress to 100%: */ 442 m_pProgressBar->setValue(100);449 updateProgressPercentage(100); 443 450 444 451 /* Try to close the dialog: */
Note:
See TracChangeset
for help on using the changeset viewer.

