Changeset 91877 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Oct 20, 2021 11:26:48 AM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.cpp
r91844 r91877 156 156 , m_iAnimatedValue(0) 157 157 , m_pTimerOpen(0) 158 , m_fLastResult(false) 158 159 { 159 160 prepare(); … … 227 228 } 228 229 229 voidUINotificationCenter::handleNow(UINotificationProgress *pProgress)230 bool UINotificationCenter::handleNow(UINotificationProgress *pProgress) 230 231 { 231 232 /* Check for the recursive run: */ 232 AssertMsgReturnVoid(!m_pEventLoop, ("UINotificationCenter::handleNow() is called recursively!\n")); 233 AssertMsgReturn(!m_pEventLoop, ("UINotificationCenter::handleNow() is called recursively!\n"), false); 234 235 /* Reset the result: */ 236 m_fLastResult = false; 233 237 234 238 /* Guard progress for the case … … 241 245 /* Is progress still valid? */ 242 246 if (guardProgress.isNull()) 243 return ;247 return m_fLastResult; 244 248 /* Is progress still running? */ 245 249 if (guardProgress->isFinished()) 246 return ;250 return m_fLastResult; 247 251 248 252 /* Create a local event-loop: */ … … 259 263 /* Are we still valid? */ 260 264 if (guardThis.isNull()) 261 return ;265 return false; 262 266 263 267 /* Cleanup event-loop: */ 264 268 m_pEventLoop = 0; 269 270 /* Return actual result: */ 271 return m_fLastResult; 265 272 } 266 273 … … 401 408 void UINotificationCenter::sltHandleProgressFinished() 402 409 { 410 /* Acquire the sender: */ 411 UINotificationProgress *pProgress = qobject_cast<UINotificationProgress*>(sender()); 412 AssertPtrReturnVoid(pProgress); 413 414 /* Set the result: */ 415 m_fLastResult = pProgress->error().isNull(); 416 403 417 /* Break the loop if exists: */ 404 418 if (m_pEventLoop) -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationCenter.h
r91755 r91877 83 83 /** Immediately and synchronously handles passed notification @a pProgress. 84 84 * @note It's a blocking call finished by sltHandleProgressFinished(). */ 85 voidhandleNow(UINotificationProgress *pProgress);85 bool handleNow(UINotificationProgress *pProgress); 86 86 87 87 protected: … … 175 175 * handles progress directly via handleNow(). */ 176 176 QPointer<QEventLoop> m_pEventLoop; 177 /** Holds the last handleNow() result. */ 178 bool m_fLastResult; 177 179 }; 178 180 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.cpp
r91755 r91877 80 80 81 81 82 voidUINativeWizard::handleNotificationProgressNow(UINotificationProgress *pProgress)83 { 84 m_pNotificationCenter->handleNow(pProgress);82 bool UINativeWizard::handleNotificationProgressNow(UINotificationProgress *pProgress) 83 { 84 return m_pNotificationCenter->handleNow(pProgress); 85 85 } 86 86 -
trunk/src/VBox/Frontends/VirtualBox/src/wizards/UINativeWizard.h
r91755 r91877 81 81 82 82 /** Immediately handles notification @a pProgress object. */ 83 voidhandleNotificationProgressNow(UINotificationProgress *pProgress);83 bool handleNotificationProgressNow(UINotificationProgress *pProgress); 84 84 85 85 public slots:
Note:
See TracChangeset
for help on using the changeset viewer.