VirtualBox

Changeset 28554 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Apr 21, 2010 10:39:09 AM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
60364
Message:

FE/Qt: use the guest property when showing the version of the guest additions

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxVMInformationDlg.cpp

    r28215 r28554  
    570570            VBoxGlobal::tr ("Enabled", "details report (Nested Paging)") :
    571571            VBoxGlobal::tr ("Disabled", "details report (Nested Paging)");
    572         QString addInfo = console.GetGuest().GetAdditionsVersion();
    573         uint addVersion = addInfo.toUInt();
    574         QString addVerisonStr = !addInfo.isNull() ?
    575             tr ("Version %1.%2", "guest additions")
    576                 .arg (RT_HIWORD (addVersion)).arg (RT_LOWORD (addVersion)) :
    577             tr ("Not Detected", "guest additions");
     572        QString addVersion = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Version");
     573        QString addVersionStr;
     574        if (!addVersion.isEmpty())
     575        {
     576            addVersionStr = addVersion;
     577            QStringList addVersionList = addVersion.split(".");
     578            if (addVersionList.size() >= 2)
     579            {
     580                uint addVersionBuild = addVersionList[2].toUInt();
     581                /* show the revision for development releases */
     582                if ((addVersionBuild % 2) != 0)
     583                {
     584                    QString addRevision = m.GetGuestPropertyValue("/VirtualBox/GuestAdd/Revision");
     585                    addVersionStr += " r" + addRevision;
     586                }
     587            }
     588        }
     589        else
     590            addVersionStr = tr ("Not Detected", "guest additions");
    578591        QString osType = console.GetGuest().GetOSTypeId();
    579         if (osType.isNull())
     592        if (osType.isEmpty())
    580593            osType = tr ("Not Detected", "guest os type");
    581594        else
     
    588601        /* Searching for longest string */
    589602        QStringList valuesList;
    590         valuesList << resolution << virtualization << nested << addVerisonStr << osType << vrdpInfo;
     603        valuesList << resolution << virtualization << nested << addVersionStr << osType << vrdpInfo;
    591604        int maxLength = 0;
    592605        foreach (const QString &value, valuesList)
     
    598611        result += formatValue (VBoxGlobal::tr ("VT-x/AMD-V", "details report"), virtualization, maxLength);
    599612        result += formatValue (VBoxGlobal::tr ("Nested Paging", "details report"), nested, maxLength);
    600         result += formatValue (tr ("Guest Additions"), addVerisonStr, maxLength);
     613        result += formatValue (tr ("Guest Additions"), addVersionStr, maxLength);
    601614        result += formatValue (tr ("Guest OS Type"), osType, maxLength);
    602615        result += formatValue (VBoxGlobal::tr ("Remote Display Server Port", "details report (VRDP Server)"), vrdpInfo, maxLength);
Note: See TracChangeset for help on using the changeset viewer.

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