VirtualBox

Changeset 5579 in vbox


Ignore:
Timestamp:
Oct 31, 2007 4:30:22 PM (17 years ago)
Author:
vboxsync
Message:

2332: Registration feature:

Add "distribution | version | kernel" info for platform registration field under linux, solaris, freebsd, macos.
Add "distribution | version | build" info for platform registration field under windows.

Location:
trunk/src/VBox/Frontends/VirtualBox/ui
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxRegistrationDlg.ui

    r5294 r5579  
    218218    <include location="global" impldecl="in implementation">qtimer.h</include>
    219219    <include location="global" impldecl="in implementation">qvalidator.h</include>
     220    <include location="global" impldecl="in implementation">qprocess.h</include>
    220221</includes>
    221222<forwards>
  • trunk/src/VBox/Frontends/VirtualBox/ui/VBoxRegistrationDlg.ui.h

    r5487 r5579  
    468468    platform += QString (".%1").arg (ARCH_BITS);
    469469
     470    /* add more system information */
     471#if defined (Q_OS_WIN)
     472    OSVERSIONINFO versionInfo;
     473    ZeroMemory (&versionInfo, sizeof (OSVERSIONINFO));
     474    versionInfo.dwOSVersionInfoSize = sizeof (OSVERSIONINFO);
     475    GetVersionEx (&versionInfo);
     476    int major = versionInfo.dwMajorVersion;
     477    int minor = versionInfo.dwMinorVersion;
     478    int build = versionInfo.dwBuildNumber;
     479    QString sp = QString::fromUcs2 ((ushort*)versionInfo.szCSDVersion);
     480
     481    QString distrib;
     482    if (major == 6)
     483        distrib = QString ("Windows Vista %1");
     484    else if (major == 5)
     485    {
     486        if (minor == 2)
     487            distrib = QString ("Windows Server 2003 %1");
     488        else if (minor == 1)
     489            distrib = QString ("Windows XP %1");
     490        else if (minor == 0)
     491            distrib = QString ("Windows 2000 %1");
     492        else
     493            distrib = QString ("Unknown %1");
     494    }
     495    else if (major == 4)
     496    {
     497        if (minor == 90)
     498            distrib = QString ("Windows Me %1");
     499        else if (minor == 10)
     500            distrib = QString ("Windows 98 %1");
     501        else if (minor == 0)
     502            distrib = QString ("Windows 95 %1");
     503        else
     504            distrib = QString ("Unknown %1");
     505    }
     506    else
     507        distrib = QString ("Unknown %1");
     508    distrib = distrib.arg (sp);
     509    QString version = QString ("%1.%2").arg (major).arg (minor);
     510    QString kernel = QString ("%1").arg (build);
     511    platform += QString (" [Distribution: %1 | Version: %2 | Build: %3]")
     512        .arg (distrib).arg (version).arg (kernel);
     513#elif defined (Q_OS_OS2)
     514    // TODO: add sys info for os2 if any...
     515#elif defined (Q_OS_LINUX) || defined (Q_OS_MACX) || defined (Q_OS_FREEBSD) || defined (Q_OS_SOLARIS)
     516    QProcess infoScript (QString ("./VBoxSysInfo.sh"), this, "infoScript");
     517    infoScript.setWorkingDirectory (qApp->applicationDirPath());
     518    if (infoScript.start())
     519    {
     520        while (infoScript.isRunning()) {}
     521        if (infoScript.normalExit())
     522            platform += QString (" [%1]").arg (infoScript.readStdout());
     523    }
     524#endif
     525
    470526    return platform;
    471527}
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