VirtualBox

Ignore:
Timestamp:
Apr 20, 2022 9:08:37 AM (3 years ago)
Author:
vboxsync
Message:

Main/Update check: Big overhaul of the API and functionality.

  • Now uses VBOX_WITH_UPDATE_AGENT to entirely disable the feature (enabled by default).
  • Main: Uses new (more abstract) API as proposed in the latest UML docs.
  • Main: Added support for several events.
  • Main: Added support for update severities, order and dependencies (all optional).
  • Settings/XML: Now has own "Updates" branch to also cover other updatable components (later); not part of the system properties anymore.
  • Prepared for GuestAdditions and ExtPack updates.
  • FE/Qt: Adapted to new API.
  • FE/VBoxManage: Adapted to new API; uses more uniform (common) synopsis "modify" and "list" for modifying and listing (showing) update settings.
  • Docs: Fixed various typos, extended documentation.

Work in progress. bugref:7983

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r94623 r94643  
    255255        $(if $(VBOX_WITH_RAW_MODE),VBOX_WITH_RAW_MODE) \
    256256        $(if $(VBOX_WITH_QHELP_VIEWER),VBOX_WITH_QHELP_VIEWER) \
    257         $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,)
     257        $(if $(VBOX_WITH_SDS),VBOX_WITH_SDS,) \
     258        $(if $(VBOX_WITH_UPDATE_AGENT),VBOX_WITH_UPDATE_AGENT)
    258259ifdef VBOX_WITH_DEBUGGER_GUI
    259260 UICommon_DEFS        += VBOX_WITH_DEBUGGER_GUI
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r94516 r94643  
    43164316    connect(this, &UINotificationProgress::sigProgressFinished,
    43174317            this, &UINotificationProgressNewVersionChecker::sltHandleProgressFinished);
    4318     CHost comHost = uiCommon().virtualBox().GetHost();
     4318
     4319#ifdef VBOX_WITH_UPDATE_AGENT
     4320    CHost comHost = uiCommon().host();
    43194321    if (!comHost.isNull())
    4320         m_comUpdateChecker = comHost.GetUpdate();
     4322        m_comUpdateHost = comHost.GetUpdateHost();
     4323#endif /* VBOX_WITH_UPDATE_AGENT */
    43214324}
    43224325
    43234326QString UINotificationProgressNewVersionChecker::name() const
    43244327{
    4325     return UINotificationProgress::tr("Check for New Version ...");
     4328#ifdef VBOX_WITH_UPDATE_AGENT
     4329    if (m_comUpdateHost.isOk())
     4330        return UINotificationProgress::tr("Checking for new version of %s ...", m_comUpdateHost.GetName().toLocal8Bit().data());
     4331#endif /* VBOX_WITH_UPDATE_AGENT */
     4332    return UINotificationProgress::tr("Checking for new version ...");
    43264333}
    43274334
     
    43334340CProgress UINotificationProgressNewVersionChecker::createProgress(COMResult &comResult)
    43344341{
    4335     if (!m_comUpdateChecker.isOk())
     4342#ifdef VBOX_WITH_UPDATE_AGENT
     4343    if (!m_comUpdateHost.isOk())
    43364344        return CProgress();
    43374345
    4338     CProgress comProgress = m_comUpdateChecker.UpdateCheck(KUpdateCheckType_VirtualBox);
    4339     comResult = m_comUpdateChecker;
    4340 
    4341     return comProgress;
     4346    CProgress comProgress = m_comUpdateHost.Check();
     4347    comResult = m_comUpdateHost;
     4348
     4349    return comProgress;
     4350#else
     4351    return CProgress();
     4352#endif /* VBOX_WITH_UPDATE_AGENT */
    43424353}
    43434354
    43444355void UINotificationProgressNewVersionChecker::sltHandleProgressFinished()
    43454356{
    4346     if (m_comUpdateChecker.isNull() && !m_comUpdateChecker.isOk())
     4357#ifdef VBOX_WITH_UPDATE_AGENT
     4358    if (m_comUpdateHost.isNull() && !m_comUpdateHost.isOk())
    43474359        return;
    43484360
    4349     bool fUpdateAvailable = m_comUpdateChecker.GetUpdateResponse();
    4350     if (!m_comUpdateChecker.isOk())
     4361    bool const fUpdateAvailable = m_comUpdateHost.GetState() == UpdateState_Available; /** @todo Handle other states. */
     4362    if (!m_comUpdateHost.isOk())
    43514363        return;
    43524364
    43534365    if (fUpdateAvailable)
    43544366    {
    4355         QString strVersion = m_comUpdateChecker.GetUpdateVersion();
    4356         if (!m_comUpdateChecker.isOk())
     4367        QString strVersion = m_comUpdateHost.GetVersion();
     4368        if (!m_comUpdateHost.isOk())
    43574369            return;
    43584370
    4359         QString strURL = m_comUpdateChecker.GetUpdateURL();
    4360         if (!m_comUpdateChecker.isOk())
     4371        QString strURL = m_comUpdateHost.GetDownloadUrl();
     4372        if (!m_comUpdateHost.isOk())
    43614373            return;
    43624374
     
    43684380            UINotificationMessage::showUpdateNotFound();
    43694381    }
     4382#endif /* VBOX_WITH_UPDATE_AGENT */
    43704383}
    43714384
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h

    r94516 r94643  
    4242#include "CGuest.h"
    4343#include "CHost.h"
    44 #include "CHostUpdate.h"
    4544#include "CHostNetworkInterface.h"
    4645#include "CMachine.h"
     
    4948#include "CSnapshot.h"
    5049#include "CStringArray.h"
     50#ifdef VBOX_WITH_UPDATE_AGENT
     51# include "CUpdateAgent.h"
     52#endif
    5153#include "CVFSExplorer.h"
    5254#include "CVirtualSystemDescription.h"
     
    27092711private:
    27102712
    2711     CHostUpdate m_comUpdateChecker;
     2713#ifdef VBOX_WITH_UPDATE_AGENT
     2714    CUpdateAgent m_comUpdateHost;
     2715#endif
    27122716    /** Holds whether this customer has forced privelegies. */
    2713     bool        m_fForcedCall;
     2717    bool         m_fForcedCall;
    27142718};
    27152719
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette