Changeset 94454 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 4, 2022 12:50:13 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/networking/UIUpdateManager.cpp
r93990 r94454 93 93 void UIUpdateStepVirtualBox::exec() 94 94 { 95 #if 0 95 96 /* Return if already checking: */ 96 97 if (UINotificationNewVersionCheckerVirtualBox::exists()) … … 111 112 connect(pNotification, &UINotificationNewVersionCheckerVirtualBox::sigProgressFinished, 112 113 this, &UIUpdateStepVirtualBox::sigStepFinished); 114 113 115 /* Append and start notification: */ 114 116 gpNotificationCenter->append(pNotification); 117 #else 118 UINotificationProgressNewVersionChecker *pNotification = 119 new UINotificationProgressNewVersionChecker(); 120 connect(pNotification, &UINotificationProgressNewVersionChecker::sigProgressFinished, 121 this, &UIUpdateStepVirtualBox::sigStepFinished); 122 gpNotificationCenter->append(pNotification); 123 #endif 115 124 } 116 125 -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r94089 r94454 4306 4306 } 4307 4307 4308 4309 /********************************************************************************************************************************* 4310 * Class UINotificationProgressNewVersionChecker implementation. * 4311 *********************************************************************************************************************************/ 4312 4313 UINotificationProgressNewVersionChecker::UINotificationProgressNewVersionChecker() 4314 { 4315 connect(this, &UINotificationProgress::sigProgressFinished, 4316 this, &UINotificationProgressNewVersionChecker::sltHandleProgressFinished); 4317 CHost comHost = uiCommon().virtualBox().GetHost(); 4318 if (!comHost.isNull()) 4319 m_comUpdateChecker = comHost.GetUpdate(); 4320 } 4321 4322 QString UINotificationProgressNewVersionChecker::name() const 4323 { 4324 return UINotificationProgress::tr("Check for New Version ..."); 4325 } 4326 4327 QString UINotificationProgressNewVersionChecker::details() const 4328 { 4329 return QString(); 4330 } 4331 4332 CProgress UINotificationProgressNewVersionChecker::createProgress(COMResult &comResult) 4333 { 4334 if (!m_comUpdateChecker.isOk()) 4335 return CProgress(); 4336 4337 CProgress comProgress = m_comUpdateChecker.UpdateCheck(KUpdateCheckType_VirtualBox); 4338 comResult = m_comUpdateChecker; 4339 4340 return comProgress; 4341 } 4342 4343 void UINotificationProgressNewVersionChecker::sltHandleProgressFinished() 4344 { 4345 if (m_comUpdateChecker.isNull() && !m_comUpdateChecker.isOk()) 4346 return; 4347 4348 bool fUpdateAvailable = m_comUpdateChecker.GetUpdateResponse(); 4349 if (!m_comUpdateChecker.isOk()) 4350 return; 4351 4352 if (fUpdateAvailable) 4353 { 4354 QString strVersion = m_comUpdateChecker.GetUpdateVersion(); 4355 if (!m_comUpdateChecker.isOk()) 4356 return; 4357 4358 QString strURL = m_comUpdateChecker.GetUpdateURL(); 4359 if (!m_comUpdateChecker.isOk()) 4360 return; 4361 4362 UINotificationMessage::showUpdateSuccess(strVersion, strURL); 4363 } 4364 else 4365 UINotificationMessage::showUpdateNotFound(); 4366 } 4367 4308 4368 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r94089 r94454 42 42 #include "CGuest.h" 43 43 #include "CHost.h" 44 #include "CHostUpdate.h" 44 45 #include "CHostNetworkInterface.h" 45 46 #include "CMachine.h" … … 2683 2684 QString m_strUrl; 2684 2685 }; 2686 2687 /** UINotificationProgress extension for checking a new VirtualBox version. */ 2688 class SHARED_LIBRARY_STUFF UINotificationProgressNewVersionChecker : public UINotificationProgress 2689 { 2690 Q_OBJECT; 2691 2692 public: 2693 2694 UINotificationProgressNewVersionChecker(); 2695 2696 protected: 2697 2698 /** Returns object name. */ 2699 virtual QString name() const /* override final */; 2700 /** Returns object details. */ 2701 virtual QString details() const /* override final */; 2702 /** Creates and returns started progress-wrapper. */ 2703 virtual CProgress createProgress(COMResult &comResult) /* override final */; 2704 2705 private slots: 2706 2707 void sltHandleProgressFinished(); 2708 2709 private: 2710 2711 CHostUpdate m_comUpdateChecker; 2712 }; 2713 2714 2685 2715 #endif /* VBOX_GUI_WITH_NETWORK_MANAGER */ 2686 2716
Note:
See TracChangeset
for help on using the changeset viewer.