Changeset 94643 in vbox for trunk/src/VBox/Main/xml
- Timestamp:
- Apr 20, 2022 9:08:37 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/xml/Settings.cpp
r94598 r94643 1638 1638 , uLogHistoryCount(3) 1639 1639 , fExclusiveHwVirt(true) 1640 , fVBoxUpdateEnabled(true)1641 , uVBoxUpdateCount(0)1642 , uVBoxUpdateFrequency(1)1643 , uVBoxUpdateTarget(VBoxUpdateTarget_Stable)1644 1640 { 1645 1641 #if defined(RT_OS_DARWIN) || defined(RT_OS_WINDOWS) || defined(RT_OS_SOLARIS) … … 1647 1643 #endif 1648 1644 } 1645 1646 #ifdef VBOX_WITH_UPDATE_AGENT 1647 UpdateAgent::UpdateAgent() 1648 : fEnabled(false) 1649 , enmChannel(UpdateChannel_Stable) 1650 , uCheckFreqSeconds(RT_SEC_1DAY) 1651 , enmProxyMode(ProxyMode_NoProxy) 1652 , uCheckCount(0) 1653 { 1654 } 1655 #endif /* VBOX_WITH_UPDATE_AGENT */ 1649 1656 1650 1657 /** … … 2332 2339 fCopyProxySettingsFromExtraData = true; 2333 2340 pelmGlobalChild->getAttributeValue("proxyUrl", systemProperties.strProxyUrl); 2334 pelmGlobalChild->getAttributeValue("updateEnabled", systemProperties.fVBoxUpdateEnabled);2335 pelmGlobalChild->getAttributeValue("updateCount", systemProperties.uVBoxUpdateCount);2336 pelmGlobalChild->getAttributeValue("updateFrequency", systemProperties.uVBoxUpdateFrequency);2337 pelmGlobalChild->getAttributeValue("updateTarget", systemProperties.uVBoxUpdateTarget);2338 pelmGlobalChild->getAttributeValue("updateLastCheckDate",2339 systemProperties.strVBoxUpdateLastCheckDate);2340 2341 pelmGlobalChild->getAttributeValue("LanguageId", systemProperties.strLanguageId); 2341 2342 } 2343 #ifdef VBOX_WITH_UPDATE_AGENT 2344 else if (pelmGlobalChild->nameEquals("Updates")) 2345 { 2346 /* We keep the updates configuration as part of the host for now, as the API exposes the IHost::updateHost attribute, 2347 * but use an own "Updates" branch in the XML for better structurizing stuff in the future. */ 2348 UpdateAgent &updateHost = host.updateHost; 2349 2350 xml::NodesLoop nlLevel4(*pelmGlobalChild); 2351 const xml::ElementNode *pelmLevel4Child; 2352 while ((pelmLevel4Child = nlLevel4.forAllNodes())) 2353 { 2354 if (pelmLevel4Child->nameEquals("Host")) 2355 { 2356 pelmLevel4Child->getAttributeValue("enabled", updateHost.fEnabled); 2357 pelmLevel4Child->getAttributeValue("channel", (uint32_t&)updateHost.enmChannel); 2358 pelmLevel4Child->getAttributeValue("checkFrequency", updateHost.uCheckFreqSeconds); 2359 pelmLevel4Child->getAttributeValue("repoUrl", updateHost.strRepoUrl); 2360 pelmLevel4Child->getAttributeValue("proxyMode", (uint32_t&)updateHost.enmProxyMode); 2361 pelmLevel4Child->getAttributeValue("proxyUrl", (uint32_t&)updateHost.enmProxyMode); 2362 pelmLevel4Child->getAttributeValue("lastCheckDate", updateHost.strLastCheckDate); 2363 pelmLevel4Child->getAttributeValue("checkCount", updateHost.uCheckCount); 2364 } 2365 /** @todo Add update settings for ExtPack and Guest Additions here later. See @bugref{7983}. */ 2366 } 2367 2368 /* Global enabled switch for updates. Currently bound to host updates, as this is the only update we have so far. */ 2369 pelmGlobalChild->getAttributeValue("enabled", updateHost.fEnabled); 2370 } 2371 #endif 2342 2372 else if (pelmGlobalChild->nameEquals("ExtraData")) 2343 2373 readExtraData(*pelmGlobalChild, mapExtraDataItems); … … 2561 2591 #endif /* VBOX_WITH_CLOUD_NET */ 2562 2592 2593 #ifdef VBOX_WITH_UPDATE_AGENT 2594 /* We keep the updates configuration as part of the host for now, as the API exposes the IHost::updateHost attribute, 2595 * but use an own "Updates" branch in the XML for better structurizing stuff in the future. */ 2596 UpdateAgent &updateHost = host.updateHost; 2597 2598 xml::ElementNode *pelmUpdates = pelmGlobal->createChild("Updates"); 2599 /* Global enabled switch for updates. Currently bound to host updates, as this is the only update we have so far. */ 2600 pelmUpdates->setAttribute("enabled", updateHost.fEnabled); 2601 2602 xml::ElementNode *pelmUpdateHost = pelmUpdates->createChild("Host"); 2603 pelmUpdateHost->setAttribute("enabled", updateHost.fEnabled); 2604 pelmUpdateHost->setAttribute("channel", (int32_t)updateHost.enmChannel); 2605 pelmUpdateHost->setAttribute("checkFrequency", updateHost.uCheckFreqSeconds); 2606 if (updateHost.strRepoUrl.length()) 2607 pelmUpdateHost->setAttribute("repoUrl", updateHost.strRepoUrl); 2608 pelmUpdateHost->setAttribute("proxyMode", (int32_t)updateHost.enmProxyMode); 2609 if (updateHost.strProxyUrl.length()) 2610 pelmUpdateHost->setAttribute("proxyUrl", updateHost.strProxyUrl); 2611 if (updateHost.strLastCheckDate.length()) 2612 pelmUpdateHost->setAttribute("lastCheckDate", updateHost.strLastCheckDate); 2613 pelmUpdateHost->setAttribute("checkCount", updateHost.uCheckCount); 2614 /** @todo Add update settings for ExtPack and Guest Additions here later. See @bugref{7983}. */ 2615 #endif 2563 2616 2564 2617 xml::ElementNode *pelmSysProps = pelmGlobal->createChild("SystemProperties"); … … 2584 2637 pelmSysProps->setAttribute("proxyMode", systemProperties.uProxyMode); 2585 2638 pelmSysProps->setAttribute("exclusiveHwVirt", systemProperties.fExclusiveHwVirt); 2586 pelmSysProps->setAttribute("updateEnabled", systemProperties.fVBoxUpdateEnabled);2587 pelmSysProps->setAttribute("updateCount", systemProperties.uVBoxUpdateCount);2588 pelmSysProps->setAttribute("updateFrequency", systemProperties.uVBoxUpdateFrequency);2589 pelmSysProps->setAttribute("updateTarget", systemProperties.uVBoxUpdateTarget);2590 if (systemProperties.strVBoxUpdateLastCheckDate.length())2591 pelmSysProps->setAttribute("updateLastCheckDate", systemProperties.strVBoxUpdateLastCheckDate);2592 2639 if (systemProperties.strLanguageId.isNotEmpty()) 2593 2640 pelmSysProps->setAttribute("LanguageId", systemProperties.strLanguageId);
Note:
See TracChangeset
for help on using the changeset viewer.