VirtualBox

Changeset 72626 in vbox


Ignore:
Timestamp:
Jun 20, 2018 1:28:15 PM (7 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
123128
Message:

FE/Qt: bugref:9049: Huge overhaul for VBoxGlobal class: Code renaming according to coding-style.

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

Legend:

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

    r72435 r72626  
    185185
    186186    /** Constructs translator passing @a pParent to the base-class. */
    187     VBoxTranslator (QObject *aParent = 0)
    188         : QTranslator (aParent) {}
     187    VBoxTranslator (QObject *pParent = 0)
     188        : QTranslator (pParent) {}
    189189
    190190    /** Loads language file with gained @a strFileName. */
    191     bool loadFile (const QString &aFileName)
    192     {
    193         QFile file (aFileName);
     191    bool loadFile (const QString &strFileName)
     192    {
     193        QFile file (strFileName);
    194194        if (!file.open (QIODevice::ReadOnly))
    195195            return false;
    196         mData = file.readAll();
    197         return load ((uchar*) mData.data(), mData.size());
     196        m_data = file.readAll();
     197        return load ((uchar*)m_data.data(), m_data.size());
    198198    }
    199199
     
    201201
    202202    /** Holds the loaded data. */
    203     QByteArray mData;
     203    QByteArray m_data;
    204204};
    205205
     
    240240/* static */
    241241VBoxGlobal *VBoxGlobal::s_pInstance = 0;
    242 bool        VBoxGlobal::s_fCleanupInProgress = false;
     242bool        VBoxGlobal::s_fCleaningUp = false;
    243243QString     VBoxGlobal::s_strLoadedLanguageId = vboxBuiltInLanguageName();
    244244
     
    290290#ifndef VBOX_GUI_WITH_SHARED_LIBRARY
    291291VBoxGlobal::VBoxGlobal()
    292     : mValid(false)
     292    : m_fValid(false)
    293293#else
    294294VBoxGlobal::VBoxGlobal(UIType enmType)
    295295    : m_enmType(enmType)
    296     , mValid(false)
     296    , m_fValid(false)
    297297#endif
    298298#ifdef VBOX_WS_MAC
    299     , m_osRelease(MacOSXRelease_Old)
     299    , m_enmMacOSVersion(MacOSXRelease_Old)
    300300#endif
    301301#ifdef VBOX_WS_X11
     
    304304#endif
    305305    , m_fSeparateProcess(false)
    306     , mShowStartVMErrors(true)
     306    , m_fShowStartVMErrors(true)
    307307#if defined(DEBUG_bird)
    308     , mAgressiveCaching(false)
     308    , m_fAgressiveCaching(false)
    309309#else
    310     , mAgressiveCaching(true)
     310    , m_fAgressiveCaching(true)
    311311#endif
    312     , mRestoreCurrentSnapshot(false)
    313     , mDisablePatm(false)
    314     , mDisableCsam(false)
    315     , mRecompileSupervisor(false)
    316     , mRecompileUser(false)
    317     , mExecuteAllInIem(false)
    318     , mWarpPct(100)
     312    , m_fRestoreCurrentSnapshot(false)
     313    , m_fDisablePatm(false)
     314    , m_fDisableCsam(false)
     315    , m_fRecompileSupervisor(false)
     316    , m_fRecompileUser(false)
     317    , m_fExecuteAllInIem(false)
     318    , m_uWarpPct(100)
    319319#ifdef VBOX_WITH_DEBUGGER_GUI
    320320    , m_fDbgEnabled(0)
     
    323323    , m_fDbgAutoShowStatistics(0)
    324324    , m_hVBoxDbg(NIL_RTLDRMOD)
    325     , m_enmStartRunning(StartRunning_Default)
     325    , m_enmLaunchRunning(LaunchRunning_Default)
    326326#endif
    327     , mSettingsPwSet(false)
     327    , m_fSettingsPwSet(false)
    328328    , m_fWrappersValid(false)
    329329    , m_fVBoxSVCAvailable(true)
    330     , m3DAvailable(-1)
     330    , m_i3DAvailable(-1)
    331331    , m_pThreadPool(0)
    332332    , m_pIconPool(0)
     
    352352uint VBoxGlobal::qtRTVersion()
    353353{
    354     QString rt_ver_str = VBoxGlobal::qtRTVersionString();
    355     return (rt_ver_str.section ('.', 0, 0).toInt() << 16) +
    356            (rt_ver_str.section ('.', 1, 1).toInt() << 8) +
    357            rt_ver_str.section ('.', 2, 2).toInt();
     354    QString strVersionRT = VBoxGlobal::qtRTVersionString();
     355    return (strVersionRT.section ('.', 0, 0).toInt() << 16) +
     356           (strVersionRT.section ('.', 1, 1).toInt() << 8) +
     357           strVersionRT.section ('.', 2, 2).toInt();
    358358}
    359359
     
    367367uint VBoxGlobal::qtCTVersion()
    368368{
    369     QString ct_ver_str = VBoxGlobal::qtCTVersionString();
    370     return (ct_ver_str.section ('.', 0, 0).toInt() << 16) +
    371            (ct_ver_str.section ('.', 1, 1).toInt() << 8) +
    372            ct_ver_str.section ('.', 2, 2).toInt();
     369    QString strVersionCompiled = VBoxGlobal::qtCTVersionString();
     370    return (strVersionCompiled.section('.', 0, 0).toInt() << 16) +
     371           (strVersionCompiled.section('.', 1, 1).toInt() << 8) +
     372           strVersionCompiled.section('.', 2, 2).toInt();
    373373}
    374374
    375375QString VBoxGlobal::vboxVersionString() const
    376376{
    377     return m_vbox.GetVersion();
     377    return m_comVBox.GetVersion();
    378378}
    379379
    380380QString VBoxGlobal::vboxVersionStringNormalized() const
    381381{
    382     return m_vbox.GetVersionNormalized();
     382    return m_comVBox.GetVersionNormalized();
    383383}
    384384
    385385bool VBoxGlobal::isBeta() const
    386386{
    387     return m_vbox.GetVersion().contains("BETA", Qt::CaseInsensitive);
     387    return vboxVersionString().contains("BETA", Qt::CaseInsensitive);
    388388}
    389389
     
    416416#endif /* VBOX_WS_MAC */
    417417
    418 bool VBoxGlobal::brandingIsActive (bool aForce /* = false */)
    419 {
    420     if (aForce)
     418bool VBoxGlobal::brandingIsActive (bool fForce /* = false */)
     419{
     420    if (fForce)
    421421        return true;
    422422
    423     if (mBrandingConfig.isEmpty())
    424     {
    425         mBrandingConfig = QDir(QApplication::applicationDirPath()).absolutePath();
    426         mBrandingConfig += "/custom/custom.ini";
    427     }
    428     return QFile::exists (mBrandingConfig);
    429 }
    430 
    431 QString VBoxGlobal::brandingGetKey (QString aKey)
    432 {
    433     QSettings s(mBrandingConfig, QSettings::IniFormat);
    434     return s.value(QString("%1").arg(aKey)).toString();
     423    if (m_strBrandingConfigFilePath.isEmpty())
     424    {
     425        m_strBrandingConfigFilePath = QDir(QApplication::applicationDirPath()).absolutePath();
     426        m_strBrandingConfigFilePath += "/custom/custom.ini";
     427    }
     428    return QFile::exists (m_strBrandingConfigFilePath);
     429}
     430
     431QString VBoxGlobal::brandingGetKey (QString strKey)
     432{
     433    QSettings settings(m_strBrandingConfigFilePath, QSettings::IniFormat);
     434    return settings.value(QString("%1").arg(strKey)).toString();
    435435}
    436436
     
    450450    QStringList args = qApp->arguments();
    451451    /* We are looking for a list of file URLs passed to the executable: */
    452     QList<QUrl> list;
     452    QList<QUrl> listArgUrls;
    453453    for (int i = 1; i < args.size(); ++i)
    454454    {
     
    465465        if (   !strArg.isEmpty()
    466466            && QFile::exists(strArg))
    467             list << QUrl::fromLocalFile(strArg);
     467            listArgUrls << QUrl::fromLocalFile(strArg);
    468468    }
    469469    /* If there are file URLs: */
    470     if (!list.isEmpty())
     470    if (!listArgUrls.isEmpty())
    471471    {
    472472        /* We enumerate them and: */
    473         for (int i = 0; i < list.size(); ++i)
     473        for (int i = 0; i < listArgUrls.size(); ++i)
    474474        {
    475475            /* Check which of them has allowed VM extensions: */
    476             const QString& strFile = list.at(i).toLocalFile();
     476            const QString& strFile = listArgUrls.at(i).toLocalFile();
    477477            if (VBoxGlobal::hasAllowedExtension(strFile, VBoxFileExts))
    478478            {
    479479                /* So that we could run existing VMs: */
    480                 CVirtualBox vbox = virtualBox();
    481                 CMachine machine = vbox.FindMachine(strFile);
    482                 if (!machine.isNull())
     480                CVirtualBox comVBox = virtualBox();
     481                CMachine comMachine = comVBox.FindMachine(strFile);
     482                if (!comMachine.isNull())
    483483                {
    484484                    fResult = true;
    485                     launchMachine(machine);
     485                    launchMachine(comMachine);
    486486                    /* And remove their URLs from the ULR list: */
    487                     list.removeAll(strFile);
     487                    listArgUrls.removeAll(strFile);
    488488                }
    489489            }
     
    491491    }
    492492    /* And if there are *still* URLs: */
    493     if (!list.isEmpty())
     493    if (!listArgUrls.isEmpty())
    494494    {
    495495        /* We store them: */
    496         m_ArgUrlList = list;
     496        m_listArgUrls = listArgUrls;
    497497        /* And ask UIStarter to open them: */
    498498        emit sigAskToOpenURLs();
     
    528528{
    529529#ifdef VBOX_WITH_DEBUGGER_GUI
    530     return m_enmStartRunning == StartRunning_Default ? isDebuggerAutoShowEnabled() : m_enmStartRunning == StartRunning_No;
     530    return m_enmLaunchRunning == LaunchRunning_Default ? isDebuggerAutoShowEnabled() : m_enmLaunchRunning == LaunchRunning_No;
    531531#else
    532532    return false;
     
    538538void VBoxGlobal::createPidfile()
    539539{
    540     if (!m_strPidfile.isEmpty())
    541     {
    542         qint64 pid = qApp->applicationPid();
    543         QFile file(m_strPidfile);
     540    if (!m_strPidFile.isEmpty())
     541    {
     542        qint64 iPid = qApp->applicationPid();
     543        QFile file(m_strPidFile);
    544544        if (file.open(QIODevice::WriteOnly | QIODevice::Truncate))
    545545        {
    546546             QTextStream out(&file);
    547              out << pid << endl;
     547             out << iPid << endl;
    548548        }
    549549        else
    550             LogRel(("Failed to create pid file %s\n", m_strPidfile.toUtf8().constData()));
     550            LogRel(("Failed to create pid file %s\n", m_strPidFile.toUtf8().constData()));
    551551    }
    552552}
     
    554554void VBoxGlobal::deletePidfile()
    555555{
    556     if (   !m_strPidfile.isEmpty()
    557         && QFile::exists(m_strPidfile))
    558         QFile::remove(m_strPidfile);
     556    if (   !m_strPidFile.isEmpty()
     557        && QFile::exists(m_strPidFile))
     558        QFile::remove(m_strPidFile);
    559559}
    560560
     
    665665    return ::darwinSystemLanguage();
    666666#elif defined (Q_OS_UNIX)
    667     const char *s = RTEnvGet ("LC_ALL");
    668     if (s == 0)
    669         s = RTEnvGet ("LC_MESSAGES");
    670     if (s == 0)
    671         s = RTEnvGet ("LANG");
    672     if (s != 0)
    673         return QLocale (s).name();
     667    const char *pszValue = RTEnvGet ("LC_ALL");
     668    if (pszValue == 0)
     669        pszValue = RTEnvGet ("LC_MESSAGES");
     670    if (pszValue == 0)
     671        pszValue = RTEnvGet ("LANG");
     672    if (pszValue != 0)
     673        return QLocale (pszValue).name();
    674674#endif
    675675    return  QLocale::system().name();
     
    677677
    678678/* static */
    679 void VBoxGlobal::loadLanguage (const QString &aLangId)
    680 {
    681     QString langId = aLangId.isEmpty() ?
    682         VBoxGlobal::systemLanguageId() : aLangId;
    683     QString languageFileName;
    684     QString selectedLangId = vboxBuiltInLanguageName();
     679void VBoxGlobal::loadLanguage (const QString &strLangId)
     680{
     681    QString strEffectiveLangId = strLangId.isEmpty() ?
     682        VBoxGlobal::systemLanguageId() : strLangId;
     683    QString strLanguageFileName;
     684    QString strSelectedLangId = vboxBuiltInLanguageName();
    685685
    686686    /* If C is selected we change it temporary to en. This makes sure any extra
     
    688688     * plural forms of some of our translations. */
    689689    bool fResetToC = false;
    690     if (langId == "C")
    691     {
    692         langId = "en";
     690    if (strEffectiveLangId == "C")
     691    {
     692        strEffectiveLangId = "en";
    693693        fResetToC = true;
    694694    }
     
    700700    AssertRC (rc);
    701701
    702     QString nlsPath = QString(szNlsPath) + vboxLanguageSubDirectory();
    703     QDir nlsDir (nlsPath);
    704 
    705     Assert (!langId.isEmpty());
    706     if (!langId.isEmpty() && langId != vboxBuiltInLanguageName())
     702    QString strNlsPath = QString(szNlsPath) + vboxLanguageSubDirectory();
     703    QDir nlsDir (strNlsPath);
     704
     705    Assert (!strEffectiveLangId.isEmpty());
     706    if (!strEffectiveLangId.isEmpty() && strEffectiveLangId != vboxBuiltInLanguageName())
    707707    {
    708708        QRegExp regExp (vboxLanguageIdRegExp());
    709         int pos = regExp.indexIn (langId);
     709        int iPos = regExp.indexIn (strEffectiveLangId);
    710710        /* the language ID should match the regexp completely */
    711         AssertReturnVoid (pos == 0);
    712 
    713         QString lang = regExp.cap (2);
    714 
    715         if (nlsDir.exists (vboxLanguageFileBase() + langId + vboxLanguageFileExtension()))
    716         {
    717             languageFileName = nlsDir.absoluteFilePath (vboxLanguageFileBase() + langId +
    718                                                         vboxLanguageFileExtension());
    719             selectedLangId = langId;
    720         }
    721         else if (nlsDir.exists (vboxLanguageFileBase() + lang + vboxLanguageFileExtension()))
    722         {
    723             languageFileName = nlsDir.absoluteFilePath (vboxLanguageFileBase() + lang +
    724                                                         vboxLanguageFileExtension());
    725             selectedLangId = lang;
     711        AssertReturnVoid (iPos == 0);
     712
     713        QString strStrippedLangId = regExp.cap (2);
     714
     715        if (nlsDir.exists (vboxLanguageFileBase() + strEffectiveLangId + vboxLanguageFileExtension()))
     716        {
     717            strLanguageFileName = nlsDir.absoluteFilePath (vboxLanguageFileBase() + strEffectiveLangId +
     718                                                           vboxLanguageFileExtension());
     719            strSelectedLangId = strEffectiveLangId;
     720        }
     721        else if (nlsDir.exists (vboxLanguageFileBase() + strStrippedLangId + vboxLanguageFileExtension()))
     722        {
     723            strLanguageFileName = nlsDir.absoluteFilePath (vboxLanguageFileBase() + strStrippedLangId +
     724                                                           vboxLanguageFileExtension());
     725            strSelectedLangId = strStrippedLangId;
    726726        }
    727727        else
     
    730730             * case, if no explicit language file exists, we will simply
    731731             * fall-back to English (built-in). */
    732             if (!aLangId.isNull() && langId != "en")
    733                 msgCenter().cannotFindLanguage (langId, nlsPath);
    734             /* selectedLangId remains built-in here */
    735             AssertReturnVoid (selectedLangId == vboxBuiltInLanguageName());
     732            if (!strLangId.isNull() && strEffectiveLangId != "en")
     733                msgCenter().cannotFindLanguage (strEffectiveLangId, strNlsPath);
     734            /* strSelectedLangId remains built-in here: */
     735            AssertReturnVoid (strSelectedLangId == vboxBuiltInLanguageName());
    736736        }
    737737    }
     
    749749    sTranslator = new VBoxTranslator (qApp);
    750750    Assert (sTranslator);
    751     bool loadOk = true;
     751    bool fLoadOk = true;
    752752    if (sTranslator)
    753753    {
    754         if (selectedLangId != vboxBuiltInLanguageName())
    755         {
    756             Assert (!languageFileName.isNull());
    757             loadOk = sTranslator->loadFile (languageFileName);
     754        if (strSelectedLangId != vboxBuiltInLanguageName())
     755        {
     756            Assert (!strLanguageFileName.isNull());
     757            fLoadOk = sTranslator->loadFile (strLanguageFileName);
    758758        }
    759759        /* We install the translator in any case: on failure, this will
     
    762762    }
    763763    else
    764         loadOk = false;
    765 
    766     if (loadOk)
    767         s_strLoadedLanguageId = selectedLangId;
     764        fLoadOk = false;
     765
     766    if (fLoadOk)
     767        s_strLoadedLanguageId = strSelectedLangId;
    768768    else
    769769    {
    770         msgCenter().cannotLoadLanguage (languageFileName);
     770        msgCenter().cannotLoadLanguage (strLanguageFileName);
    771771        s_strLoadedLanguageId = vboxBuiltInLanguageName();
    772772    }
     
    778778        /* We use system installations of Qt on Linux systems, so first, try
    779779         * to load the Qt translation from the system location. */
    780         languageFileName = QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/qt_" +
    781                            languageId() + vboxLanguageFileExtension();
    782         QTranslator *qtSysTr = new QTranslator (sTranslator);
    783         Assert (qtSysTr);
    784         if (qtSysTr && qtSysTr->load (languageFileName))
    785             qApp->installTranslator (qtSysTr);
     780        strLanguageFileName = QLibraryInfo::location(QLibraryInfo::TranslationsPath) + "/qt_" +
     781                              languageId() + vboxLanguageFileExtension();
     782        QTranslator *pQtSysTr = new QTranslator (sTranslator);
     783        Assert (pQtSysTr);
     784        if (pQtSysTr && pQtSysTr->load (strLanguageFileName))
     785            qApp->installTranslator (pQtSysTr);
    786786        /* Note that the Qt translation supplied by Oracle is always loaded
    787787         * afterwards to make sure it will take precedence over the system
     
    793793         * Oracle translation is always the best one. */
    794794#endif
    795         languageFileName =  nlsDir.absoluteFilePath (QString ("qt_") +
    796                                                      languageId() +
    797                                                      vboxLanguageFileExtension());
    798         QTranslator *qtTr = new QTranslator (sTranslator);
    799         Assert (qtTr);
    800         if (qtTr && (loadOk = qtTr->load (languageFileName)))
    801             qApp->installTranslator (qtTr);
     795        strLanguageFileName =  nlsDir.absoluteFilePath (QString ("qt_") +
     796                                                        languageId() +
     797                                                        vboxLanguageFileExtension());
     798        QTranslator *pQtTr = new QTranslator (sTranslator);
     799        Assert (pQtTr);
     800        if (pQtTr && (fLoadOk = pQtTr->load (strLanguageFileName)))
     801            qApp->installTranslator (pQtTr);
    802802        /* The below message doesn't fit 100% (because it's an additional
    803803         * language and the main one won't be reset to built-in on failure)
    804804         * but the load failure is so rare here that it's not worth a separate
    805805         * message (but still, having something is better than having none) */
    806         if (!loadOk && !aLangId.isNull())
    807             msgCenter().cannotLoadLanguage (languageFileName);
     806        if (!fLoadOk && !strLangId.isNull())
     807            msgCenter().cannotLoadLanguage (strLanguageFileName);
    808808    }
    809809    if (fResetToC)
     
    870870     *           B cannot appear there). */
    871871
    872     QString regexp =
     872    QString strRegexp =
    873873        QString ("^(?:(?:(\\d+)(?:\\s?(%2|%3|%4|%5|%6|%7))?)|(?:(\\d*)%1(\\d{1,2})(?:\\s?(%3|%4|%5|%6|%7))))$")
    874874            .arg (decimalSep())
     
    879879            .arg (tr ("TB", "size suffix TBytes=1024 GBytes"))
    880880            .arg (tr ("PB", "size suffix PBytes=1024 TBytes"));
    881     return regexp;
    882 }
    883 
    884 /* static */
    885 quint64 VBoxGlobal::parseSize (const QString &aText)
     881    return strRegexp;
     882}
     883
     884/* static */
     885quint64 VBoxGlobal::parseSize (const QString &strText)
    886886{
    887887    /* Text should be in form of B|KB|MB|GB|TB|PB. */
    888888    QRegExp regexp (sizeRegexp());
    889     int pos = regexp.indexIn (aText);
    890     if (pos != -1)
    891     {
    892         QString intgS = regexp.cap (1);
    893         QString hundS;
    894         QString suff = regexp.cap (2);
    895         if (intgS.isEmpty())
    896         {
    897             intgS = regexp.cap (3);
    898             hundS = regexp.cap (4);
    899             suff = regexp.cap (5);
    900         }
    901 
    902         quint64 denom = 0;
    903         if (suff.isEmpty() || suff == tr ("B", "size suffix Bytes"))
    904             denom = 1;
    905         else if (suff == tr ("KB", "size suffix KBytes=1024 Bytes"))
    906             denom = _1K;
    907         else if (suff == tr ("MB", "size suffix MBytes=1024 KBytes"))
    908             denom = _1M;
    909         else if (suff == tr ("GB", "size suffix GBytes=1024 MBytes"))
    910             denom = _1G;
    911         else if (suff == tr ("TB", "size suffix TBytes=1024 GBytes"))
    912             denom = _1T;
    913         else if (suff == tr ("PB", "size suffix PBytes=1024 TBytes"))
    914             denom = _1P;
    915 
    916         quint64 intg = intgS.toULongLong();
    917         if (denom == 1)
    918             return intg;
    919 
    920         quint64 hund = hundS.leftJustified (2, '0').toULongLong();
    921         hund = hund * denom / 100;
    922         intg = intg * denom + hund;
    923         return intg;
     889    int iPos = regexp.indexIn (strText);
     890    if (iPos != -1)
     891    {
     892        QString strInteger = regexp.cap (1);
     893        QString strHundred;
     894        QString strSuff = regexp.cap (2);
     895        if (strInteger.isEmpty())
     896        {
     897            strInteger = regexp.cap (3);
     898            strHundred = regexp.cap (4);
     899            strSuff = regexp.cap (5);
     900        }
     901
     902        quint64 uDenominator = 0;
     903        if (strSuff.isEmpty() || strSuff == tr ("B", "size suffix Bytes"))
     904            uDenominator = 1;
     905        else if (strSuff == tr ("KB", "size suffix KBytes=1024 Bytes"))
     906            uDenominator = _1K;
     907        else if (strSuff == tr ("MB", "size suffix MBytes=1024 KBytes"))
     908            uDenominator = _1M;
     909        else if (strSuff == tr ("GB", "size suffix GBytes=1024 MBytes"))
     910            uDenominator = _1G;
     911        else if (strSuff == tr ("TB", "size suffix TBytes=1024 GBytes"))
     912            uDenominator = _1T;
     913        else if (strSuff == tr ("PB", "size suffix PBytes=1024 TBytes"))
     914            uDenominator = _1P;
     915
     916        quint64 iInteger = strInteger.toULongLong();
     917        if (uDenominator == 1)
     918            return iInteger;
     919
     920        quint64 iHundred = strHundred.leftJustified (2, '0').toULongLong();
     921        iHundred = iHundred * uDenominator / 100;
     922        iInteger = iInteger * uDenominator + iHundred;
     923        return iInteger;
    924924    }
    925925    else
     
    928928
    929929/* static */
    930 QString VBoxGlobal::formatSize (quint64 aSize, uint aDecimal /* = 2 */,
    931                                 FormatSize aMode /* = FormatSize_Round */)
     930QString VBoxGlobal::formatSize (quint64 uSize, uint cDecimal /* = 2 */,
     931                                FormatSize enmMode /* = FormatSize_Round */)
    932932{
    933933    /* Text will be in form of B|KB|MB|GB|TB|PB.
     
    946946     *              size parameter. */
    947947
    948     quint64 denom = 0;
    949     int suffix = 0;
    950 
    951     if (aSize < _1K)
    952     {
    953         denom = 1;
    954         suffix = 0;
    955     }
    956     else if (aSize < _1M)
    957     {
    958         denom = _1K;
    959         suffix = 1;
    960     }
    961     else if (aSize < _1G)
    962     {
    963         denom = _1M;
    964         suffix = 2;
    965     }
    966     else if (aSize < _1T)
    967     {
    968         denom = _1G;
    969         suffix = 3;
    970     }
    971     else if (aSize < _1P)
    972     {
    973         denom = _1T;
    974         suffix = 4;
     948    quint64 uDenominator = 0;
     949    int iSuffix = 0;
     950
     951    if (uSize < _1K)
     952    {
     953        uDenominator = 1;
     954        iSuffix = 0;
     955    }
     956    else if (uSize < _1M)
     957    {
     958        uDenominator = _1K;
     959        iSuffix = 1;
     960    }
     961    else if (uSize < _1G)
     962    {
     963        uDenominator = _1M;
     964        iSuffix = 2;
     965    }
     966    else if (uSize < _1T)
     967    {
     968        uDenominator = _1G;
     969        iSuffix = 3;
     970    }
     971    else if (uSize < _1P)
     972    {
     973        uDenominator = _1T;
     974        iSuffix = 4;
    975975    }
    976976    else
    977977    {
    978         denom = _1P;
    979         suffix = 5;
    980     }
    981 
    982     quint64 intg = aSize / denom;
    983     quint64 decm = aSize % denom;
    984     quint64 mult = 1;
    985     for (uint i = 0; i < aDecimal; ++ i) mult *= 10;
    986 
    987     QString number;
    988     if (denom > 1)
    989     {
    990         if (decm)
    991         {
    992             decm *= mult;
     978        uDenominator = _1P;
     979        iSuffix = 5;
     980    }
     981
     982    quint64 uInteger = uSize / uDenominator;
     983    quint64 uDecimal = uSize % uDenominator;
     984    quint64 uMult = 1;
     985    for (uint i = 0; i < cDecimal; ++ i) uMult *= 10;
     986
     987    QString strNumber;
     988    if (uDenominator > 1)
     989    {
     990        if (uDecimal)
     991        {
     992            uDecimal *= uMult;
    993993            /* not greater */
    994             if (aMode == FormatSize_RoundDown)
    995                 decm = decm / denom;
     994            if (enmMode == FormatSize_RoundDown)
     995                uDecimal = uDecimal / uDenominator;
    996996            /* not less */
    997             else if (aMode == FormatSize_RoundUp)
    998                 decm = (decm + denom - 1) / denom;
     997            else if (enmMode == FormatSize_RoundUp)
     998                uDecimal = (uDecimal + uDenominator - 1) / uDenominator;
    999999            /* nearest */
    1000             else decm = (decm + denom / 2) / denom;
     1000            else uDecimal = (uDecimal + uDenominator / 2) / uDenominator;
    10011001        }
    10021002        /* Check for the fractional part overflow due to rounding: */
    1003         if (decm == mult)
    1004         {
    1005             decm = 0;
    1006             ++ intg;
     1003        if (uDecimal == uMult)
     1004        {
     1005            uDecimal = 0;
     1006            ++ uInteger;
    10071007            /* Check if we've got 1024 XB after rounding and scale down if so: */
    1008             if (intg == 1024 && suffix + 1 < (int)SizeSuffix_Max)
     1008            if (uInteger == 1024 && iSuffix + 1 < (int)SizeSuffix_Max)
    10091009            {
    1010                 intg /= 1024;
    1011                 ++ suffix;
     1010                uInteger /= 1024;
     1011                ++ iSuffix;
    10121012            }
    10131013        }
    1014         number = QString::number (intg);
    1015         if (aDecimal) number += QString ("%1%2").arg (decimalSep())
    1016             .arg (QString::number (decm).rightJustified (aDecimal, '0'));
     1014        strNumber = QString::number (uInteger);
     1015        if (cDecimal) strNumber += QString ("%1%2").arg (decimalSep())
     1016            .arg (QString::number (uDecimal).rightJustified (cDecimal, '0'));
    10171017    }
    10181018    else
    10191019    {
    1020         number = QString::number (intg);
    1021     }
    1022 
    1023     return QString ("%1 %2").arg (number).arg (gpConverter->toString(static_cast<SizeSuffix>(suffix)));
     1020        strNumber = QString::number (uInteger);
     1021    }
     1022
     1023    return QString ("%1 %2").arg (strNumber).arg (gpConverter->toString(static_cast<SizeSuffix>(iSuffix)));
    10241024}
    10251025
     
    10511051}
    10521052
    1053 QString VBoxGlobal::toCOMPortName (ulong aIRQ, ulong aIOBase) const
     1053QString VBoxGlobal::toCOMPortName (ulong uIRQ, ulong uIOBase) const
    10541054{
    10551055    for (size_t i = 0; i < RT_ELEMENTS (kComKnownPorts); ++ i)
    1056         if (kComKnownPorts [i].IRQ == aIRQ &&
    1057             kComKnownPorts [i].IOBase == aIOBase)
     1056        if (kComKnownPorts [i].IRQ == uIRQ &&
     1057            kComKnownPorts [i].IOBase == uIOBase)
    10581058            return kComKnownPorts [i].name;
    10591059
    1060     return mUserDefinedPortName;
    1061 }
    1062 
    1063 bool VBoxGlobal::toCOMPortNumbers (const QString &aName, ulong &aIRQ,
    1064                                    ulong &aIOBase) const
     1060    return m_strUserDefinedPortName;
     1061}
     1062
     1063bool VBoxGlobal::toCOMPortNumbers (const QString &strName, ulong &uIRQ,
     1064                                   ulong &uIOBase) const
    10651065{
    10661066    for (size_t i = 0; i < RT_ELEMENTS (kComKnownPorts); ++ i)
    1067         if (strcmp (kComKnownPorts [i].name, aName.toUtf8().data()) == 0)
    1068         {
    1069             aIRQ = kComKnownPorts [i].IRQ;
    1070             aIOBase = kComKnownPorts [i].IOBase;
     1067        if (strcmp (kComKnownPorts [i].name, strName.toUtf8().data()) == 0)
     1068        {
     1069            uIRQ = kComKnownPorts [i].IRQ;
     1070            uIOBase = kComKnownPorts [i].IOBase;
    10711071            return true;
    10721072        }
     
    10841084}
    10851085
    1086 QString VBoxGlobal::toLPTPortName (ulong aIRQ, ulong aIOBase) const
     1086QString VBoxGlobal::toLPTPortName (ulong uIRQ, ulong uIOBase) const
    10871087{
    10881088    for (size_t i = 0; i < RT_ELEMENTS (kLptKnownPorts); ++ i)
    1089         if (kLptKnownPorts [i].IRQ == aIRQ &&
    1090             kLptKnownPorts [i].IOBase == aIOBase)
     1089        if (kLptKnownPorts [i].IRQ == uIRQ &&
     1090            kLptKnownPorts [i].IOBase == uIOBase)
    10911091            return kLptKnownPorts [i].name;
    10921092
    1093     return mUserDefinedPortName;
    1094 }
    1095 
    1096 bool VBoxGlobal::toLPTPortNumbers (const QString &aName, ulong &aIRQ,
    1097                                    ulong &aIOBase) const
     1093    return m_strUserDefinedPortName;
     1094}
     1095
     1096bool VBoxGlobal::toLPTPortNumbers (const QString &strName, ulong &uIRQ,
     1097                                   ulong &uIOBase) const
    10981098{
    10991099    for (size_t i = 0; i < RT_ELEMENTS (kLptKnownPorts); ++ i)
    1100         if (strcmp (kLptKnownPorts [i].name, aName.toUtf8().data()) == 0)
    1101         {
    1102             aIRQ = kLptKnownPorts [i].IRQ;
    1103             aIOBase = kLptKnownPorts [i].IOBase;
     1100        if (strcmp (kLptKnownPorts [i].name, strName.toUtf8().data()) == 0)
     1101        {
     1102            uIRQ = kLptKnownPorts [i].IRQ;
     1103            uIOBase = kLptKnownPorts [i].IOBase;
    11041104            return true;
    11051105        }
     
    11091109
    11101110/* static */
    1111 QString VBoxGlobal::highlight (const QString &aStr, bool aToolTip /* = false */)
     1111QString VBoxGlobal::highlight (const QString &strTextArg, bool fToolTip /* = false */)
    11121112{
    11131113    /* We should reformat the input strText so that:
     
    11271127    QString uuidFont;
    11281128    QString endFont;
    1129     if (!aToolTip)
     1129    if (!fToolTip)
    11301130    {
    11311131        strFont = "<font color=#0000CC>";
     
    11341134    }
    11351135
    1136     QString text = aStr;
     1136    QString strText = strTextArg;
    11371137
    11381138    /* Replace special entities, '&' -- first! */
    1139     text.replace ('&', "&amp;");
    1140     text.replace ('<', "&lt;");
    1141     text.replace ('>', "&gt;");
    1142     text.replace ('\"', "&quot;");
     1139    strText.replace ('&', "&amp;");
     1140    strText.replace ('<', "&lt;");
     1141    strText.replace ('>', "&gt;");
     1142    strText.replace ('\"', "&quot;");
    11431143
    11441144    /* Mark strings in single quotes with color: */
    11451145    QRegExp rx = QRegExp ("((?:^|\\s)[(]?)'([^']*)'(?=[:.-!);]?(?:\\s|$))");
    11461146    rx.setMinimal (true);
    1147     text.replace (rx,
     1147    strText.replace (rx,
    11481148        QString ("\\1%1<nobr>'\\2'</nobr>%2").arg (strFont).arg (endFont));
    11491149
    11501150    /* Mark UUIDs with color: */
    1151     text.replace (QRegExp (
     1151    strText.replace (QRegExp (
    11521152        "((?:^|\\s)[(]?)"
    11531153        "(\\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\})"
     
    11561156
    11571157    /* Split to paragraphs at \n chars: */
    1158     if (!aToolTip)
    1159         text.replace ('\n', "</p><p>");
     1158    if (!fToolTip)
     1159        strText.replace ('\n', "</p><p>");
    11601160    else
    1161         text.replace ('\n', "<br>");
    1162 
    1163     return text;
    1164 }
    1165 
    1166 /* static */
    1167 QString VBoxGlobal::emphasize (const QString &aStr)
     1161        strText.replace ('\n', "<br>");
     1162
     1163    return strText;
     1164}
     1165
     1166/* static */
     1167QString VBoxGlobal::emphasize (const QString &strTextArg)
    11681168{
    11691169    /* We should reformat the input string @a strText so that:
     
    11821182    QString uuidEmphEnd ("</i>");
    11831183
    1184     QString text = aStr;
     1184    QString strText = strTextArg;
    11851185
    11861186    /* Replace special entities, '&' -- first! */
    1187     text.replace ('&', "&amp;");
    1188     text.replace ('<', "&lt;");
    1189     text.replace ('>', "&gt;");
    1190     text.replace ('\"', "&quot;");
     1187    strText.replace ('&', "&amp;");
     1188    strText.replace ('<', "&lt;");
     1189    strText.replace ('>', "&gt;");
     1190    strText.replace ('\"', "&quot;");
    11911191
    11921192    /* Mark strings in single quotes with bold style: */
    11931193    QRegExp rx = QRegExp ("((?:^|\\s)[(]?)'([^']*)'(?=[:.-!);]?(?:\\s|$))");
    11941194    rx.setMinimal (true);
    1195     text.replace (rx,
     1195    strText.replace(rx,
    11961196        QString ("\\1%1<nobr>'\\2'</nobr>%2").arg (strEmphStart).arg (strEmphEnd));
    11971197
    11981198    /* Mark UUIDs with italic style: */
    1199     text.replace (QRegExp (
     1199    strText.replace (QRegExp (
    12001200        "((?:^|\\s)[(]?)"
    12011201        "(\\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\})"
     
    12041204
    12051205    /* Split to paragraphs at \n chars: */
    1206     text.replace ('\n', "</p><p>");
    1207 
    1208     return text;
    1209 }
    1210 
    1211 /* static */
    1212 QString VBoxGlobal::removeAccelMark (const QString &aText)
     1206    strText.replace ('\n', "</p><p>");
     1207
     1208    return strText;
     1209}
     1210
     1211/* static */
     1212QString VBoxGlobal::removeAccelMark (const QString &strTextArg)
    12131213{
    12141214    /* In order to support accelerators used in non-alphabet languages
     
    12181218     * removed from the string. */
    12191219
    1220     QString result = aText;
     1220    QString strText = strTextArg;
    12211221
    12221222    QRegExp accel ("\\(&[a-zA-Z]\\)");
    1223     int pos = accel.indexIn (result);
    1224     if (pos >= 0)
    1225         result.remove (pos, accel.cap().length());
     1223    int iPos = accel.indexIn (strText);
     1224    if (iPos >= 0)
     1225        strText.remove (iPos, accel.cap().length());
    12261226    else
    12271227    {
    1228         pos = result.indexOf ('&');
    1229         if (pos >= 0)
    1230             result.remove (pos, 1);
    1231     }
    1232 
    1233     return result;
     1228        iPos = strText.indexOf ('&');
     1229        if (iPos >= 0)
     1230            strText.remove (iPos, 1);
     1231    }
     1232
     1233    return strText;
    12341234}
    12351235
     
    12381238{
    12391239#ifdef VBOX_WS_MAC
    1240     QString pattern("%1 (Host+%2)");
     1240    QString strPattern("%1 (Host+%2)");
    12411241#else
    1242     QString pattern("%1 \tHost+%2");
     1242    QString strPattern("%1 \tHost+%2");
    12431243#endif
    12441244    if (   strKey.isEmpty()
     
    12461246        return strText;
    12471247    else
    1248         return pattern.arg(strText).arg(QKeySequence(strKey).toString(QKeySequence::NativeText));
     1248        return strPattern.arg(strText).arg(QKeySequence(strKey).toString(QKeySequence::NativeText));
    12491249}
    12501250
     
    12521252{
    12531253#if defined (VBOX_WS_WIN)
    1254     const QString name = "VirtualBox";
    1255     const QString suffix = "chm";
     1254    const QString strName = "VirtualBox";
     1255    const QString strSuffix = "chm";
    12561256#elif defined (VBOX_WS_MAC)
    1257     const QString name = "UserManual";
    1258     const QString suffix = "pdf";
     1257    const QString strName = "UserManual";
     1258    const QString strSuffix = "pdf";
    12591259#elif defined (VBOX_WS_X11)
    12601260# if defined VBOX_OSE
    1261     const QString name = "UserManual";
    1262     const QString suffix = "pdf";
     1261    const QString strName = "UserManual";
     1262    const QString strSuffix = "pdf";
    12631263# else
    1264     const QString name = "VirtualBox";
    1265     const QString suffix = "chm";
     1264    const QString strName = "VirtualBox";
     1265    const QString strSuffix = "chm";
    12661266# endif
    12671267#endif
     
    12761276
    12771277    /* Construct the path and the filename: */
    1278     QString manual = QString ("%1/%2_%3.%4").arg (szDocsPath)
    1279                                             .arg (name)
    1280                                             .arg (lang.name())
    1281                                             .arg (suffix);
     1278    QString strManual = QString ("%1/%2_%3.%4").arg (szDocsPath)
     1279                                               .arg (strName)
     1280                                               .arg (lang.name())
     1281                                               .arg (strSuffix);
    12821282    /* Check if a help file with that name exists: */
    1283     QFileInfo fi (manual);
     1283    QFileInfo fi (strManual);
    12841284    if (fi.exists())
    1285         return manual;
     1285        return strManual;
    12861286
    12871287    /* Fall back to the standard: */
    1288     manual = QString ("%1/%2.%4").arg (szDocsPath)
    1289                                  .arg (name)
    1290                                  .arg (suffix);
    1291     return manual;
     1288    strManual = QString ("%1/%2.%4").arg (szDocsPath)
     1289                                    .arg (strName)
     1290                                    .arg (strSuffix);
     1291    return strManual;
    12921292}
    12931293
     
    12951295QString VBoxGlobal::documentsPath()
    12961296{
    1297     QString path = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
    1298     QDir dir(path);
     1297    QString strPath = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
     1298    QDir dir(strPath);
    12991299    if (dir.exists())
    13001300        return QDir::cleanPath(dir.canonicalPath());
     
    13101310
    13111311/* static */
    1312 QRect VBoxGlobal::normalizeGeometry (const QRect &aRectangle, const QRegion &aBoundRegion,
    1313                                      bool aCanResize /* = true */)
     1312QRect VBoxGlobal::normalizeGeometry (const QRect &rectangle, const QRegion &boundRegion,
     1313                                     bool fCanResize /* = true */)
    13141314{
    13151315    /* Perform direct and flipped search of position for @a rectangle to make sure it is fully contained
     
    13181318
    13191319    /* Direct search for normalized rectangle */
    1320     QRect var1 (getNormalized (aRectangle, aBoundRegion, aCanResize));
     1320    QRect var1 (getNormalized (rectangle, boundRegion, fCanResize));
    13211321
    13221322    /* Flipped search for normalized rectangle: */
    1323     QRect var2 (flip (getNormalized (flip (aRectangle).boundingRect(),
    1324                                      flip (aBoundRegion), aCanResize)).boundingRect());
     1323    QRect var2 (flip (getNormalized (flip (rectangle).boundingRect(),
     1324                                     flip (boundRegion), fCanResize)).boundingRect());
    13251325
    13261326    /* Calculate shift from starting position for both variants: */
    1327     double length1 = sqrt (pow ((double) (var1.x() - aRectangle.x()), (double) 2) +
    1328                            pow ((double) (var1.y() - aRectangle.y()), (double) 2));
    1329     double length2 = sqrt (pow ((double) (var2.x() - aRectangle.x()), (double) 2) +
    1330                            pow ((double) (var2.y() - aRectangle.y()), (double) 2));
     1327    double dLength1 = sqrt (pow ((double) (var1.x() - rectangle.x()), (double) 2) +
     1328                            pow ((double) (var1.y() - rectangle.y()), (double) 2));
     1329    double dLength2 = sqrt (pow ((double) (var2.x() - rectangle.x()), (double) 2) +
     1330                            pow ((double) (var2.y() - rectangle.y()), (double) 2));
    13311331
    13321332    /* Return minimum shifted variant: */
    1333     return length1 > length2 ? var2 : var1;
    1334 }
    1335 
    1336 /* static */
    1337 QRect VBoxGlobal::getNormalized (const QRect &aRectangle, const QRegion &aBoundRegion,
    1338                                  bool /* aCanResize = true */)
     1333    return dLength1 > dLength2 ? var2 : var1;
     1334}
     1335
     1336/* static */
     1337QRect VBoxGlobal::getNormalized (const QRect &rectangle, const QRegion &boundRegion,
     1338                                 bool /* fCanResize = true */)
    13391339{
    13401340    /* Ensures that the given rectangle @a rectangle is fully contained within the region @a boundRegion
     
    13441344
    13451345    /* Storing available horizontal sub-rectangles & vertical shifts: */
    1346     int windowVertical = aRectangle.center().y();
    1347     QVector <QRect> rectanglesVector (aBoundRegion.rects());
     1346    int iWindowVertical = rectangle.center().y();
     1347    QVector <QRect> rectanglesVector (boundRegion.rects());
    13481348    QList <QRect> rectanglesList;
    13491349    QList <int> shiftsList;
    13501350    foreach (QRect currentItem, rectanglesVector)
    13511351    {
    1352         int currentDelta = qAbs (windowVertical - currentItem.center().y());
    1353         int shift2Top = currentItem.top() - aRectangle.top();
    1354         int shift2Bot = currentItem.bottom() - aRectangle.bottom();
    1355 
    1356         int itemPosition = 0;
     1352        int iCurrentDelta = qAbs (iWindowVertical - currentItem.center().y());
     1353        int iShift2Top = currentItem.top() - rectangle.top();
     1354        int iShift2Bot = currentItem.bottom() - rectangle.bottom();
     1355
     1356        int iTtemPosition = 0;
    13571357        foreach (QRect item, rectanglesList)
    13581358        {
    1359             int delta = qAbs (windowVertical - item.center().y());
    1360             if (delta > currentDelta) break; else ++ itemPosition;
    1361         }
    1362         rectanglesList.insert (itemPosition, currentItem);
    1363 
    1364         int shift2TopPos = 0;
    1365         foreach (int shift, shiftsList)
    1366             if (qAbs (shift) > qAbs (shift2Top)) break; else ++ shift2TopPos;
    1367         shiftsList.insert (shift2TopPos, shift2Top);
    1368 
    1369         int shift2BotPos = 0;
    1370         foreach (int shift, shiftsList)
    1371             if (qAbs (shift) > qAbs (shift2Bot)) break; else ++ shift2BotPos;
    1372         shiftsList.insert (shift2BotPos, shift2Bot);
     1359            int iDelta = qAbs (iWindowVertical - item.center().y());
     1360            if (iDelta > iCurrentDelta) break; else ++ iTtemPosition;
     1361        }
     1362        rectanglesList.insert (iTtemPosition, currentItem);
     1363
     1364        int iShift2TopPos = 0;
     1365        foreach (int iShift, shiftsList)
     1366            if (qAbs (iShift) > qAbs (iShift2Top)) break; else ++ iShift2TopPos;
     1367        shiftsList.insert (iShift2TopPos, iShift2Top);
     1368
     1369        int iShift2BotPos = 0;
     1370        foreach (int iShift, shiftsList)
     1371            if (qAbs(iShift) > qAbs(iShift2Bot)) break; else ++ iShift2BotPos;
     1372        shiftsList.insert (iShift2BotPos, iShift2Bot);
    13731373    }
    13741374
     
    13781378    {
    13791379        /* Move to appropriate vertical: */
    1380         QRect rectangle (aRectangle);
    1381         if (i >= 0) rectangle.translate (0, shiftsList [i]);
     1380        QRect newRectangle (rectangle);
     1381        if (i >= 0) newRectangle.translate (0, shiftsList [i]);
    13821382
    13831383        /* Search horizontal shift: */
    1384         int maxShift = 0;
     1384        int iMaxShift = 0;
    13851385        foreach (QRect item, rectanglesList)
    13861386        {
    1387             QRect trectangle (rectangle.translated (item.left() - rectangle.left(), 0));
     1387            QRect trectangle (newRectangle.translated (item.left() - newRectangle.left(), 0));
    13881388            if (!item.intersects (trectangle))
    13891389                continue;
    13901390
    1391             if (rectangle.left() < item.left())
     1391            if (newRectangle.left() < item.left())
    13921392            {
    1393                 int shift = item.left() - rectangle.left();
    1394                 maxShift = qAbs (shift) > qAbs (maxShift) ? shift : maxShift;
     1393                int iShift = item.left() - newRectangle.left();
     1394                iMaxShift = qAbs (iShift) > qAbs (iMaxShift) ? iShift : iMaxShift;
    13951395            }
    1396             else if (rectangle.right() > item.right())
     1396            else if (newRectangle.right() > item.right())
    13971397            {
    1398                 int shift = item.right() - rectangle.right();
    1399                 maxShift = qAbs (shift) > qAbs (maxShift) ? shift : maxShift;
     1398                int iShift = item.right() - newRectangle.right();
     1399                iMaxShift = qAbs (iShift) > qAbs (iMaxShift) ? iShift : iMaxShift;
    14001400            }
    14011401        }
    14021402
    14031403        /* Shift across the horizontal direction: */
    1404         rectangle.translate (maxShift, 0);
     1404        newRectangle.translate (iMaxShift, 0);
    14051405
    14061406        /* Check the translated rectangle to feat the rules: */
    1407         if (aBoundRegion.united (rectangle) == aBoundRegion)
    1408             result = rectangle;
     1407        if (boundRegion.united (newRectangle) == boundRegion)
     1408            result = newRectangle;
    14091409
    14101410        if (!result.isNull()) break;
     
    14161416         * using max of available rectangles: */
    14171417        QRect maxRectangle;
    1418         quint64 maxSquare = 0;
     1418        quint64 uMaxSquare = 0;
    14191419        foreach (QRect item, rectanglesList)
    14201420        {
    1421             quint64 square = item.width() * item.height();
    1422             if (square > maxSquare)
     1421            quint64 uSquare = item.width() * item.height();
     1422            if (uSquare > uMaxSquare)
    14231423            {
    1424                 maxSquare = square;
     1424                uMaxSquare = uSquare;
    14251425                maxRectangle = item;
    14261426            }
    14271427        }
    14281428
    1429         result = aRectangle;
     1429        result = rectangle;
    14301430        result.moveTo (maxRectangle.x(), maxRectangle.y());
    14311431        if (maxRectangle.right() < result.right())
     
    14391439
    14401440/* static */
    1441 QRegion VBoxGlobal::flip (const QRegion &aRegion)
     1441QRegion VBoxGlobal::flip (const QRegion &region)
    14421442{
    14431443    QRegion result;
    1444     QVector <QRect> rectangles (aRegion.rects());
     1444    QVector <QRect> rectangles (region.rects());
    14451445    foreach (QRect rectangle, rectangles)
    14461446        result += QRect (rectangle.y(), rectangle.x(),
     
    14501450
    14511451/* static */
    1452 void VBoxGlobal::centerWidget (QWidget *aWidget, QWidget *aRelative,
    1453                                bool aCanResize /* = true */)
     1452void VBoxGlobal::centerWidget (QWidget *pWidget, QWidget *pRelative,
     1453                               bool fCanResize /* = true */)
    14541454{
    14551455    /* If necessary, pWidget's position is adjusted to make it fully visible within
     
    14621462     * pWidget will be centered relative to the available desktop area. */
    14631463
    1464     AssertReturnVoid (aWidget);
    1465     AssertReturnVoid (aWidget->isTopLevel());
     1464    AssertReturnVoid (pWidget);
     1465    AssertReturnVoid (pWidget->isTopLevel());
    14661466
    14671467    QRect deskGeo, parentGeo;
    1468     QWidget *w = aRelative;
     1468    QWidget *w = pRelative;
    14691469    if (w)
    14701470    {
     
    14921492    // is based on the idea taken from QDialog::adjustPositionInternal().
    14931493
    1494     int extraw = 0, extrah = 0;
     1494    int iExtraW = 0, iExtraH = 0;
    14951495
    14961496    QWidgetList list = QApplication::topLevelWidgets();
    14971497    QListIterator<QWidget*> it (list);
    1498     while ((extraw == 0 || extrah == 0) && it.hasNext())
    1499     {
    1500         int framew, frameh;
    1501         QWidget *current = it.next();
    1502         if (!current->isVisible())
     1498    while ((iExtraW == 0 || iExtraH == 0) && it.hasNext())
     1499    {
     1500        int iFrameW, iFrameH;
     1501        QWidget *pCurrent = it.next();
     1502        if (!pCurrent->isVisible())
    15031503            continue;
    15041504
    1505         framew = current->frameGeometry().width() - current->width();
    1506         frameh = current->frameGeometry().height() - current->height();
    1507 
    1508         extraw = qMax (extraw, framew);
    1509         extrah = qMax (extrah, frameh);
     1505        iFrameW = pCurrent->frameGeometry().width() - pCurrent->width();
     1506        iFrameH = pCurrent->frameGeometry().height() - pCurrent->height();
     1507
     1508        iExtraW = qMax (iExtraW, iFrameW);
     1509        iExtraH = qMax (iExtraH, iFrameH);
    15101510    }
    15111511
     
    15131513     * above workaround: */
    15141514    // QRect geo = frameGeometry();
    1515     QRect geo = QRect (0, 0, aWidget->width() + extraw,
    1516                              aWidget->height() + extrah);
     1515    QRect geo = QRect (0, 0, pWidget->width() + iExtraW,
     1516                             pWidget->height() + iExtraH);
    15171517
    15181518    geo.moveCenter (QPoint (parentGeo.x() + (parentGeo.width() - 1) / 2,
     
    15201520
    15211521    /* Ensure the widget is within the available desktop area: */
    1522     QRect newGeo = normalizeGeometry (geo, deskGeo, aCanResize);
     1522    QRect newGeo = normalizeGeometry (geo, deskGeo, fCanResize);
    15231523#ifdef VBOX_WS_MAC
    15241524    // WORKAROUND:
     
    15271527    // the position.
    15281528    if (w)
    1529         newGeo.translate (0, ::darwinWindowToolBarHeight (aWidget));
     1529        newGeo.translate (0, ::darwinWindowToolBarHeight (pWidget));
    15301530#endif /* VBOX_WS_MAC */
    15311531
    1532     aWidget->move (newGeo.topLeft());
    1533 
    1534     if (aCanResize &&
     1532    pWidget->move (newGeo.topLeft());
     1533
     1534    if (fCanResize &&
    15351535        (geo.width() != newGeo.width() || geo.height() != newGeo.height()))
    1536         aWidget->resize (newGeo.width() - extraw, newGeo.height() - extrah);
     1536        pWidget->resize(newGeo.width() - iExtraW, newGeo.height() - iExtraH);
    15371537}
    15381538
     
    16311631#if defined (VBOX_WS_X11)
    16321632
    1633 static char *XXGetProperty (Display *aDpy, Window aWnd,
    1634                             Atom aPropType, const char *aPropName)
    1635 {
    1636     Atom propNameAtom = XInternAtom (aDpy, aPropName,
     1633static char *XXGetProperty (Display *pDpy, Window windowHandle,
     1634                            Atom propType, const char *pszPropName)
     1635{
     1636    Atom propNameAtom = XInternAtom (pDpy, pszPropName,
    16371637                                     True /* only_if_exists */);
    16381638    if (propNameAtom == None)
     
    16441644    unsigned long nBytesAfter = 0;
    16451645    unsigned char *propVal = NULL;
    1646     int rc = XGetWindowProperty (aDpy, aWnd, propNameAtom,
     1646    int rc = XGetWindowProperty (pDpy, windowHandle, propNameAtom,
    16471647                                 0, LONG_MAX, False /* delete */,
    1648                                  aPropType, &actTypeAtom, &actFmt,
     1648                                 propType, &actTypeAtom, &actFmt,
    16491649                                 &nItems, &nBytesAfter, &propVal);
    16501650    if (rc != Success)
     
    16541654}
    16551655
    1656 static Bool XXSendClientMessage (Display *aDpy, Window aWnd, const char *aMsg,
     1656static Bool XXSendClientMessage (Display *pDpy, Window windowHandle, const char *pszMsg,
    16571657                                 unsigned long aData0 = 0, unsigned long aData1 = 0,
    16581658                                 unsigned long aData2 = 0, unsigned long aData3 = 0,
    16591659                                 unsigned long aData4 = 0)
    16601660{
    1661     Atom msgAtom = XInternAtom (aDpy, aMsg, True /* only_if_exists */);
     1661    Atom msgAtom = XInternAtom (pDpy, pszMsg, True /* only_if_exists */);
    16621662    if (msgAtom == None)
    16631663        return False;
     
    16681668    ev.xclient.serial = 0;
    16691669    ev.xclient.send_event = True;
    1670     ev.xclient.display = aDpy;
    1671     ev.xclient.window = aWnd;
     1670    ev.xclient.display = pDpy;
     1671    ev.xclient.window = windowHandle;
    16721672    ev.xclient.message_type = msgAtom;
    16731673
     
    16801680    ev.xclient.data.l [4] = aData4;
    16811681
    1682     return XSendEvent (aDpy, DefaultRootWindow (aDpy), False,
     1682    return XSendEvent (pDpy, DefaultRootWindow (pDpy), False,
    16831683                       SubstructureRedirectMask, &ev) != 0;
    16841684}
     
    16871687
    16881688/* static */
    1689 bool VBoxGlobal::activateWindow (WId aWId, bool aSwitchDesktop /* = true */)
    1690 {
    1691     RT_NOREF(aSwitchDesktop);
    1692     bool result = true;
     1689bool VBoxGlobal::activateWindow (WId wId, bool fSwitchDesktop /* = true */)
     1690{
     1691    RT_NOREF(fSwitchDesktop);
     1692    bool fResult = true;
    16931693
    16941694#if defined (VBOX_WS_WIN)
    16951695
    1696     HWND handle = (HWND)aWId;
     1696    HWND handle = (HWND)wId;
    16971697
    16981698    if (IsIconic (handle))
    1699         result &= !!ShowWindow (handle, SW_RESTORE);
     1699        fResult &= !!ShowWindow (handle, SW_RESTORE);
    17001700    else if (!IsWindowVisible (handle))
    1701         result &= !!ShowWindow (handle, SW_SHOW);
    1702 
    1703     result &= !!SetForegroundWindow (handle);
     1701        fResult &= !!ShowWindow (handle, SW_SHOW);
     1702
     1703    fResult &= !!SetForegroundWindow (handle);
    17041704
    17051705#elif defined (VBOX_WS_X11)
    17061706
    1707     Display *dpy = QX11Info::display();
    1708 
    1709     if (aSwitchDesktop)
     1707    Display *pDisplay = QX11Info::display();
     1708
     1709    if (fSwitchDesktop)
    17101710    {
    17111711        /* try to find the desktop ID using the NetWM property */
    1712         CARD32 *desktop = (CARD32 *) XXGetProperty (dpy, aWId, XA_CARDINAL,
    1713                                                     "_NET_WM_DESKTOP");
    1714         if (desktop == NULL)
     1712        CARD32 *pDesktop = (CARD32 *) XXGetProperty (pDisplay, wId, XA_CARDINAL,
     1713                                                     "_NET_WM_DESKTOP");
     1714        if (pDesktop == NULL)
    17151715            // WORKAROUND:
    17161716            // if the NetWM properly is not supported try to find
    17171717            // the desktop ID using the GNOME WM property.
    1718             desktop = (CARD32 *) XXGetProperty (dpy, aWId, XA_CARDINAL,
    1719                                                 "_WIN_WORKSPACE");
    1720 
    1721         if (desktop != NULL)
    1722         {
    1723             Bool ok = XXSendClientMessage (dpy, DefaultRootWindow (dpy),
     1718            pDesktop = (CARD32 *) XXGetProperty (pDisplay, wId, XA_CARDINAL,
     1719                                                 "_WIN_WORKSPACE");
     1720
     1721        if (pDesktop != NULL)
     1722        {
     1723            Bool ok = XXSendClientMessage (pDisplay, DefaultRootWindow (pDisplay),
    17241724                                           "_NET_CURRENT_DESKTOP",
    1725                                            *desktop);
     1725                                           *pDesktop);
    17261726            if (!ok)
    17271727            {
    1728                 Log1WarningFunc(("Couldn't switch to desktop=%08X\n", desktop));
    1729                 result = false;
     1728                Log1WarningFunc(("Couldn't switch to pDesktop=%08X\n", pDesktop));
     1729                fResult = false;
    17301730            }
    1731             XFree (desktop);
     1731            XFree (pDesktop);
    17321732        }
    17331733        else
    17341734        {
    1735             Log1WarningFunc(("Couldn't find a desktop ID for aWId=%08X\n", aWId));
    1736             result = false;
    1737         }
    1738     }
    1739 
    1740     Bool ok = XXSendClientMessage (dpy, aWId, "_NET_ACTIVE_WINDOW");
    1741     result &= !!ok;
    1742 
    1743     XRaiseWindow (dpy, aWId);
     1735            Log1WarningFunc(("Couldn't find a pDesktop ID for wId=%08X\n", wId));
     1736            fResult = false;
     1737        }
     1738    }
     1739
     1740    Bool ok = XXSendClientMessage (pDisplay, wId, "_NET_ACTIVE_WINDOW");
     1741    fResult &= !!ok;
     1742
     1743    XRaiseWindow (pDisplay, wId);
    17441744
    17451745#else
    17461746
    1747     NOREF (aWId);
    1748     NOREF (aSwitchDesktop);
     1747    NOREF (wId);
     1748    NOREF (fSwitchDesktop);
    17491749    AssertFailed();
    1750     result = false;
     1750    fResult = false;
    17511751
    17521752#endif
    17531753
    1754     if (!result)
    1755         Log1WarningFunc(("Couldn't activate aWId=%08X\n", aWId));
    1756 
    1757     return result;
     1754    if (!fResult)
     1755        Log1WarningFunc(("Couldn't activate wId=%08X\n", wId));
     1756
     1757    return fResult;
    17581758}
    17591759
     
    20212021}
    20222022
    2023 QList<CGuestOSType> VBoxGlobal::vmGuestOSTypeList(const QString &aFamilyId) const
    2024 {
    2025     AssertMsg(m_guestOSFamilyIDs.contains(aFamilyId), ("Family ID incorrect: '%s'.", aFamilyId.toLatin1().constData()));
    2026     return m_guestOSFamilyIDs.contains(aFamilyId) ?
    2027            m_guestOSTypes[m_guestOSFamilyIDs.indexOf(aFamilyId)] : QList<CGuestOSType>();
    2028 }
    2029 
    2030 CGuestOSType VBoxGlobal::vmGuestOSType(const QString &aTypeId,
    2031              const QString &aFamilyId /* = QString::null */) const
     2023QList<CGuestOSType> VBoxGlobal::vmGuestOSTypeList(const QString &strFamilyId) const
     2024{
     2025    AssertMsg(m_guestOSFamilyIDs.contains(strFamilyId), ("Family ID incorrect: '%s'.", strFamilyId.toLatin1().constData()));
     2026    return m_guestOSFamilyIDs.contains(strFamilyId) ?
     2027           m_guestOSTypes[m_guestOSFamilyIDs.indexOf(strFamilyId)] : QList<CGuestOSType>();
     2028}
     2029
     2030CGuestOSType VBoxGlobal::vmGuestOSType(const QString &strTypeId,
     2031             const QString &strFamilyId /* = QString() */) const
    20322032{
    20332033    QList <CGuestOSType> list;
    2034     if (m_guestOSFamilyIDs.contains (aFamilyId))
    2035     {
    2036         list = m_guestOSTypes [m_guestOSFamilyIDs.indexOf (aFamilyId)];
     2034    if (m_guestOSFamilyIDs.contains (strFamilyId))
     2035    {
     2036        list = m_guestOSTypes [m_guestOSFamilyIDs.indexOf (strFamilyId)];
    20372037    }
    20382038    else
     
    20422042    }
    20432043    for (int j = 0; j < list.size(); ++ j)
    2044         if (!list [j].GetId().compare (aTypeId))
     2044        if (!list [j].GetId().compare (strTypeId))
    20452045            return list [j];
    2046     AssertMsgFailed (("Type ID incorrect: '%s'.", aTypeId.toLatin1().constData()));
     2046    AssertMsgFailed (("Type ID incorrect: '%s'.", strTypeId.toLatin1().constData()));
    20472047    return CGuestOSType();
    20482048}
    20492049
    2050 QString VBoxGlobal::vmGuestOSTypeDescription (const QString &aTypeId) const
     2050QString VBoxGlobal::vmGuestOSTypeDescription (const QString &strTypeId) const
    20512051{
    20522052    for (int i = 0; i < m_guestOSFamilyIDs.size(); ++ i)
     
    20542054        QList <CGuestOSType> list (m_guestOSTypes [i]);
    20552055        for ( int j = 0; j < list.size(); ++ j)
    2056             if (!list [j].GetId().compare (aTypeId))
     2056            if (!list [j].GetId().compare (strTypeId))
    20572057                return list [j].GetDescription();
    20582058    }
    2059     return QString::null;
    2060 }
    2061 
    2062 /* static */
    2063 bool VBoxGlobal::isDOSType (const QString &aOSTypeId)
    2064 {
    2065     if (aOSTypeId.left (3) == "dos" ||
    2066         aOSTypeId.left (3) == "win" ||
    2067         aOSTypeId.left (3) == "os2")
     2059    return QString();
     2060}
     2061
     2062/* static */
     2063bool VBoxGlobal::isDOSType (const QString &strOSTypeId)
     2064{
     2065    if (strOSTypeId.left (3) == "dos" ||
     2066        strOSTypeId.left (3) == "win" ||
     2067        strOSTypeId.left (3) == "os2")
    20682068        return true;
    20692069
     
    20712071}
    20722072
    2073 bool VBoxGlobal::switchToMachine(CMachine &machine)
     2073bool VBoxGlobal::switchToMachine(CMachine &comMachine)
    20742074{
    20752075#ifdef VBOX_WS_MAC
    2076     ULONG64 id = machine.ShowConsoleWindow();
     2076    ULONG64 id = comMachine.ShowConsoleWindow();
    20772077#else
    2078     WId id = (WId) machine.ShowConsoleWindow();
     2078    WId id = (WId) comMachine.ShowConsoleWindow();
    20792079#endif
    2080     AssertWrapperOk(machine);
    2081     if (!machine.isOk())
     2080    AssertWrapperOk(comMachine);
     2081    if (!comMachine.isOk())
    20822082        return false;
    20832083
     
    21202120}
    21212121
    2122 bool VBoxGlobal::launchMachine(CMachine &machine, LaunchMode enmLaunchMode /* = LaunchMode_Default */)
     2122bool VBoxGlobal::launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode /* = LaunchMode_Default */)
    21232123{
    21242124    /* Switch to machine window(s) if possible: */
    2125     if (   machine.GetSessionState() == KSessionState_Locked /* precondition for CanShowConsoleWindow() */
    2126         && machine.CanShowConsoleWindow())
     2125    if (   comMachine.GetSessionState() == KSessionState_Locked /* precondition for CanShowConsoleWindow() */
     2126        && comMachine.CanShowConsoleWindow())
    21272127    {
    21282128        /* For the Selector UI: */
     
    21302130        {
    21312131            /* Just switch to existing VM window: */
    2132             return VBoxGlobal::switchToMachine(machine);
     2132            return VBoxGlobal::switchToMachine(comMachine);
    21332133        }
    21342134        /* For the Runtime UI: */
     
    21372137            /* Only separate UI process can reach that place,
    21382138             * switch to existing VM window and exit. */
    2139             VBoxGlobal::switchToMachine(machine);
     2139            VBoxGlobal::switchToMachine(comMachine);
    21402140            return false;
    21412141        }
     
    21452145    {
    21462146        /* Make sure machine-state is one of required: */
    2147         KMachineState state = machine.GetState(); NOREF(state);
    2148         AssertMsg(   state == KMachineState_PoweredOff
    2149                   || state == KMachineState_Saved
    2150                   || state == KMachineState_Teleported
    2151                   || state == KMachineState_Aborted
    2152                   , ("Machine must be PoweredOff/Saved/Teleported/Aborted (%d)", state));
     2147        KMachineState enmState = comMachine.GetState(); NOREF(enmState);
     2148        AssertMsg(   enmState == KMachineState_PoweredOff
     2149                  || enmState == KMachineState_Saved
     2150                  || enmState == KMachineState_Teleported
     2151                  || enmState == KMachineState_Aborted
     2152                  , ("Machine must be PoweredOff/Saved/Teleported/Aborted (%d)", enmState));
    21532153    }
    21542154
    21552155    /* Create empty session instance: */
    2156     CSession session;
    2157     session.createInstance(CLSID_Session);
    2158     if (session.isNull())
    2159     {
    2160         msgCenter().cannotOpenSession(session);
     2156    CSession comSession;
     2157    comSession.createInstance(CLSID_Session);
     2158    if (comSession.isNull())
     2159    {
     2160        msgCenter().cannotOpenSession(comSession);
    21612161        return false;
    21622162    }
     
    21872187
    21882188    /* Prepare "VM spawning" progress: */
    2189     CProgress progress = machine.LaunchVMProcess(session, strType, strEnv);
    2190     if (!machine.isOk())
     2189    CProgress comProgress = comMachine.LaunchVMProcess(comSession, strType, strEnv);
     2190    if (!comMachine.isOk())
    21912191    {
    21922192        /* If the VM is started separately and the VM process is already running, then it is OK. */
    21932193        if (enmLaunchMode == LaunchMode_Separate)
    21942194        {
    2195             KMachineState state = machine.GetState();
    2196             if (   state >= KMachineState_FirstOnline
    2197                 && state <= KMachineState_LastOnline)
     2195            KMachineState enmState = comMachine.GetState();
     2196            if (   enmState >= KMachineState_FirstOnline
     2197                && enmState <= KMachineState_LastOnline)
    21982198            {
    21992199                /* Already running. */
     
    22022202        }
    22032203
    2204         msgCenter().cannotOpenSession(machine);
     2204        msgCenter().cannotOpenSession(comMachine);
    22052205        return false;
    22062206    }
     
    22112211     * If starting separately, then show the progress now. */
    22122212    int iSpawningDuration = enmLaunchMode == LaunchMode_Separate ? 0 : 60000;
    2213     msgCenter().showModalProgressDialog(progress, machine.GetName(),
     2213    msgCenter().showModalProgressDialog(comProgress, comMachine.GetName(),
    22142214                                        ":/progress_start_90px.png", 0, iSpawningDuration);
    2215     if (!progress.isOk() || progress.GetResultCode() != 0)
    2216         msgCenter().cannotOpenSession(progress, machine.GetName());
     2215    if (!comProgress.isOk() || comProgress.GetResultCode() != 0)
     2216        msgCenter().cannotOpenSession(comProgress, comMachine.GetName());
    22172217
    22182218    /* Unlock machine, close session: */
    2219     session.UnlockMachine();
     2219    comSession.UnlockMachine();
    22202220
    22212221    /* True finally: */
     
    22262226{
    22272227    /* Prepare session: */
    2228     CSession session;
     2228    CSession comSession;
    22292229
    22302230    /* Simulate try-catch block: */
     
    22332233    {
    22342234        /* Create empty session instance: */
    2235         session.createInstance(CLSID_Session);
    2236         if (session.isNull())
    2237         {
    2238             msgCenter().cannotOpenSession(session);
     2235        comSession.createInstance(CLSID_Session);
     2236        if (comSession.isNull())
     2237        {
     2238            msgCenter().cannotOpenSession(comSession);
    22392239            break;
    22402240        }
    22412241
    22422242        /* Search for the corresponding machine: */
    2243         CMachine machine = m_vbox.FindMachine(strId);
    2244         if (machine.isNull())
    2245         {
    2246             msgCenter().cannotFindMachineById(m_vbox, strId);
     2243        CMachine comMachine = m_comVBox.FindMachine(strId);
     2244        if (comMachine.isNull())
     2245        {
     2246            msgCenter().cannotFindMachineById(m_comVBox, strId);
    22472247            break;
    22482248        }
    22492249
    22502250        if (lockType == KLockType_VM)
    2251             session.SetName("GUI/Qt");
     2251            comSession.SetName("GUI/Qt");
    22522252
    22532253        /* Lock found machine to session: */
    2254         machine.LockMachine(session, lockType);
    2255         if (!machine.isOk())
    2256         {
    2257             msgCenter().cannotOpenSession(machine);
     2254        comMachine.LockMachine(comSession, lockType);
     2255        if (!comMachine.isOk())
     2256        {
     2257            msgCenter().cannotOpenSession(comMachine);
    22582258            break;
    22592259        }
    22602260
    22612261        /* Pass the language ID as the property to the guest: */
    2262         if (session.GetType() == KSessionType_Shared)
    2263         {
    2264             CMachine startedMachine = session.GetMachine();
     2262        if (comSession.GetType() == KSessionType_Shared)
     2263        {
     2264            CMachine comStartedMachine = comSession.GetMachine();
    22652265            /* Make sure that the language is in two letter code.
    22662266             * Note: if languageId() returns an empty string lang.name() will
    22672267             * return "C" which is an valid language code. */
    22682268            QLocale lang(VBoxGlobal::languageId());
    2269             startedMachine.SetGuestPropertyValue("/VirtualBox/HostInfo/GUI/LanguageID", lang.name());
     2269            comStartedMachine.SetGuestPropertyValue("/VirtualBox/HostInfo/GUI/LanguageID", lang.name());
    22702270        }
    22712271
     
    22762276    /* Cleanup try-catch block: */
    22772277    if (!fSuccess)
    2278         session.detach();
     2278        comSession.detach();
    22792279
    22802280    /* Return session: */
    2281     return session;
     2281    return comSession;
    22822282}
    22832283
     
    22862286{
    22872287    /* Prepare a list of pairs with the form <tt>{"Backend Name", "*.suffix1 .suffix2 ..."}</tt>. */
    2288     CSystemProperties systemProperties = vboxGlobal().virtualBox().GetSystemProperties();
    2289     QVector<CMediumFormat> mediumFormats = systemProperties.GetMediumFormats();
     2288    CSystemProperties comSystemProperties = vboxGlobal().virtualBox().GetSystemProperties();
     2289    QVector<CMediumFormat> mediumFormats = comSystemProperties.GetMediumFormats();
    22902290    QList< QPair<QString, QString> > backendPropList;
    22912291    for (int i = 0; i < mediumFormats.size(); ++ i)
     
    23292329{
    23302330    /* Make sure VBoxGlobal is already valid: */
    2331     AssertReturnVoid(mValid);
     2331    AssertReturnVoid(m_fValid);
    23322332
    23332333    /* Make sure medium-enumerator is already created: */
     
    23402340
    23412341    /* Ignore the request during VBoxGlobal cleanup: */
    2342     if (s_fCleanupInProgress)
     2342    if (s_fCleaningUp)
    23432343        return;
    23442344
     
    23482348        return;
    23492349
    2350     if (m_mediumEnumeratorDtorRwLock.tryLockForRead())
     2350    if (m_meCleanupProtectionToken.tryLockForRead())
    23512351    {
    23522352        /* Redirect request to medium-enumerator: */
    23532353        if (m_pMediumEnumerator)
    23542354            m_pMediumEnumerator->enumerateMediums();
    2355         m_mediumEnumeratorDtorRwLock.unlock();
     2355        m_meCleanupProtectionToken.unlock();
    23562356    }
    23572357}
     
    23662366UIMedium VBoxGlobal::medium(const QString &strMediumID) const
    23672367{
    2368     if (m_mediumEnumeratorDtorRwLock.tryLockForRead())
     2368    if (m_meCleanupProtectionToken.tryLockForRead())
    23692369    {
    23702370        /* Redirect call to medium-enumerator: */
    2371         UIMedium result;
     2371        UIMedium guiMedium;
    23722372        if (m_pMediumEnumerator)
    2373             result = m_pMediumEnumerator->medium(strMediumID);
    2374         m_mediumEnumeratorDtorRwLock.unlock();
    2375         return result;
     2373            guiMedium = m_pMediumEnumerator->medium(strMediumID);
     2374        m_meCleanupProtectionToken.unlock();
     2375        return guiMedium;
    23762376    }
    23772377    return UIMedium();
     
    23802380QList<QString> VBoxGlobal::mediumIDs() const
    23812381{
    2382     if (m_mediumEnumeratorDtorRwLock.tryLockForRead())
     2382    if (m_meCleanupProtectionToken.tryLockForRead())
    23832383    {
    23842384        /* Redirect call to medium-enumerator: */
    2385         QList<QString> result;
     2385        QList<QString> listOfMediums;
    23862386        if (m_pMediumEnumerator)
    2387             result = m_pMediumEnumerator->mediumIDs();
    2388         m_mediumEnumeratorDtorRwLock.unlock();
    2389         return result;
     2387            listOfMediums = m_pMediumEnumerator->mediumIDs();
     2388        m_meCleanupProtectionToken.unlock();
     2389        return listOfMediums;
    23902390    }
    23912391    return QList<QString>();
    23922392}
    23932393
    2394 void VBoxGlobal::createMedium(const UIMedium &medium)
    2395 {
    2396     if (m_mediumEnumeratorDtorRwLock.tryLockForRead())
     2394void VBoxGlobal::createMedium(const UIMedium &guiMedium)
     2395{
     2396    if (m_meCleanupProtectionToken.tryLockForRead())
    23972397    {
    23982398        /* Create medium in medium-enumerator: */
    23992399        if (m_pMediumEnumerator)
    2400             m_pMediumEnumerator->createMedium(medium);
    2401         m_mediumEnumeratorDtorRwLock.unlock();
     2400            m_pMediumEnumerator->createMedium(guiMedium);
     2401        m_meCleanupProtectionToken.unlock();
    24022402    }
    24032403}
     
    24052405void VBoxGlobal::deleteMedium(const QString &strMediumID)
    24062406{
    2407     if (m_mediumEnumeratorDtorRwLock.tryLockForRead())
     2407    if (m_meCleanupProtectionToken.tryLockForRead())
    24082408    {
    24092409        /* Delete medium from medium-enumerator: */
    24102410        if (m_pMediumEnumerator)
    24112411            m_pMediumEnumerator->deleteMedium(strMediumID);
    2412         m_mediumEnumeratorDtorRwLock.unlock();
    2413     }
    2414 }
    2415 
    2416 QString VBoxGlobal::openMedium(UIMediumType mediumType, QString strMediumLocation, QWidget *pParent /* = 0 */)
     2412        m_meCleanupProtectionToken.unlock();
     2413    }
     2414}
     2415
     2416QString VBoxGlobal::openMedium(UIMediumType enmMediumType, QString strMediumLocation, QWidget *pParent /* = 0 */)
    24172417{
    24182418    /* Convert to native separators: */
     
    24202420
    24212421    /* Initialize variables: */
    2422     CVirtualBox vbox = virtualBox();
     2422    CVirtualBox comVBox = virtualBox();
    24232423
    24242424    /* Remember the path of the last chosen medium: */
    2425     switch (mediumType)
     2425    switch (enmMediumType)
    24262426    {
    24272427        case UIMediumType_HardDisk: gEDataManager->setRecentFolderForHardDrives(QFileInfo(strMediumLocation).absolutePath()); break;
     
    24332433    /* Update recently used list: */
    24342434    QStringList recentMediumList;
    2435     switch (mediumType)
     2435    switch (enmMediumType)
    24362436    {
    24372437        case UIMediumType_HardDisk: recentMediumList = gEDataManager->recentListOfHardDrives(); break;
     
    24442444    recentMediumList.prepend(strMediumLocation);
    24452445    while(recentMediumList.size() > 5) recentMediumList.removeLast();
    2446     switch (mediumType)
     2446    switch (enmMediumType)
    24472447    {
    24482448        case UIMediumType_HardDisk: gEDataManager->setRecentListOfHardDrives(recentMediumList); break;
     
    24532453
    24542454    /* Open corresponding medium: */
    2455     CMedium cmedium = vbox.OpenMedium(strMediumLocation, mediumTypeToGlobal(mediumType), KAccessMode_ReadWrite, false);
    2456 
    2457     if (vbox.isOk())
     2455    CMedium comMedium = comVBox.OpenMedium(strMediumLocation, mediumTypeToGlobal(enmMediumType), KAccessMode_ReadWrite, false);
     2456
     2457    if (comVBox.isOk())
    24582458    {
    24592459        /* Prepare vbox medium wrapper: */
    2460         UIMedium uimedium = medium(cmedium.GetId());
     2460        UIMedium guiMedium = medium(comMedium.GetId());
    24612461
    24622462        /* First of all we should test if that medium already opened: */
    2463         if (uimedium.isNull())
     2463        if (guiMedium.isNull())
    24642464        {
    24652465            /* And create new otherwise: */
    2466             uimedium = UIMedium(cmedium, mediumType, KMediumState_Created);
    2467             vboxGlobal().createMedium(uimedium);
    2468         }
    2469 
    2470         /* Return uimedium id: */
    2471         return uimedium.id();
     2466            guiMedium = UIMedium(comMedium, enmMediumType, KMediumState_Created);
     2467            createMedium(guiMedium);
     2468        }
     2469
     2470        /* Return guiMedium id: */
     2471        return guiMedium.id();
    24722472    }
    24732473    else
    2474         msgCenter().cannotOpenMedium(vbox, mediumType, strMediumLocation, pParent);
     2474        msgCenter().cannotOpenMedium(comVBox, enmMediumType, strMediumLocation, pParent);
    24752475
    24762476    return QString();
    24772477}
    24782478
    2479 QString VBoxGlobal::openMediumWithFileOpenDialog(UIMediumType mediumType, QWidget *pParent,
     2479QString VBoxGlobal::openMediumWithFileOpenDialog(UIMediumType enmMediumType, QWidget *pParent,
    24802480                                                 const QString &strDefaultFolder /* = QString() */,
    24812481                                                 bool fUseLastFolder /* = false */)
     
    24892489    QString allType;
    24902490    QString strLastFolder;
    2491     switch (mediumType)
     2491    switch (enmMediumType)
    24922492    {
    24932493        case UIMediumType_HardDisk:
     
    25532553    /* If dialog has some result: */
    25542554    if (!files.empty() && !files[0].isEmpty())
    2555         return openMedium(mediumType, files[0], pParent);
     2555        return openMedium(enmMediumType, files[0], pParent);
    25562556
    25572557    return QString();
    25582558}
    25592559
    2560 QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder)
    2561 {
    2562     AssertReturn(!strMachineFolder.isEmpty(), QString());
     2560QString VBoxGlobal::createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder)
     2561{
     2562    AssertReturn(!strFolder.isEmpty(), QString());
    25632563
    25642564    /* Figure out where to start browsing for content. */
     
    25852585    /* Produce the VISO. */
    25862586    char szVisoPath[RTPATH_MAX];
    2587     int vrc = RTPathJoin(szVisoPath, sizeof(szVisoPath), strMachineFolder.toUtf8().constData(), "ad-hoc.viso");
     2587    int vrc = RTPathJoin(szVisoPath, sizeof(szVisoPath), strFolder.toUtf8().constData(), "ad-hoc.viso");
    25882588    if (RT_SUCCESS(vrc))
    25892589    {
     
    26322632void VBoxGlobal::prepareStorageMenu(QMenu &menu,
    26332633                                    QObject *pListener, const char *pszSlotName,
    2634                                     const CMachine &machine, const QString &strControllerName, const StorageSlot &storageSlot)
     2634                                    const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot)
    26352635{
    26362636    /* Current attachment attributes: */
    2637     const CMediumAttachment currentAttachment = machine.GetMediumAttachment(strControllerName, storageSlot.port, storageSlot.device);
    2638     const CMedium currentMedium = currentAttachment.GetMedium();
    2639     const QString strCurrentID = currentMedium.isNull() ? QString() : currentMedium.GetId();
    2640     const QString strCurrentLocation = currentMedium.isNull() ? QString() : currentMedium.GetLocation();
     2637    const CMediumAttachment comCurrentAttachment = comMachine.GetMediumAttachment(strControllerName, storageSlot.port, storageSlot.device);
     2638    const CMedium comCurrentMedium = comCurrentAttachment.GetMedium();
     2639    const QString strCurrentID = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetId();
     2640    const QString strCurrentLocation = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetLocation();
    26412641
    26422642    /* Other medium-attachments of same machine: */
    2643     const CMediumAttachmentVector attachments = machine.GetMediumAttachments();
     2643    const CMediumAttachmentVector comAttachments = comMachine.GetMediumAttachments();
    26442644
    26452645    /* Determine device & medium types: */
    2646     const UIMediumType mediumType = mediumTypeToLocal(currentAttachment.GetType());
    2647     AssertMsgReturnVoid(mediumType != UIMediumType_Invalid, ("Incorrect storage medium type!\n"));
     2646    const UIMediumType enmMediumType = mediumTypeToLocal(comCurrentAttachment.GetType());
     2647    AssertMsgReturnVoid(enmMediumType != UIMediumType_Invalid, ("Incorrect storage medium type!\n"));
    26482648
    26492649
    26502650    /* Prepare open-existing-medium action: */
    26512651    QAction *pActionOpenExistingMedium = menu.addAction(UIIconPool::iconSet(":/select_file_16px.png"), QString(), pListener, pszSlotName);
    2652     pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(),
    2653                                                                           mediumType)));
     2652    pActionOpenExistingMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), comCurrentAttachment.GetDevice(),
     2653                                                                          enmMediumType)));
    26542654    pActionOpenExistingMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Choose disk image...", "This is used for hard disks, optical media and floppies"));
    26552655
    26562656    /* Prepare ad-hoc-viso action for DVD-ROMs: */
    2657     if (mediumType == UIMediumType_DVD)
     2657    if (enmMediumType == UIMediumType_DVD)
    26582658    {
    26592659        QAction *pActionAdHocViso = menu.addAction(UIIconPool::iconSet(":/select_file_16px.png"), QString(),
    26602660                                                   pListener, pszSlotName);
    2661         pActionAdHocViso->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(),
    2662                                                                      currentAttachment.GetDevice(), mediumType,
     2661        pActionAdHocViso->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(),
     2662                                                                     comCurrentAttachment.GetDevice(), enmMediumType,
    26632663                                                                     UIMediumTarget::UIMediumTargetType_CreateAdHocVISO)));
    26642664        pActionAdHocViso->setText(QApplication::translate("UIMachineSettingsStorage", "Create ad hoc VISO...", "This is used for optical media"));
     
    26702670
    26712671    /* Get existing-host-drive vector: */
    2672     CMediumVector mediums;
    2673     switch (mediumType)
    2674     {
    2675         case UIMediumType_DVD:    mediums = vboxGlobal().host().GetDVDDrives(); break;
    2676         case UIMediumType_Floppy: mediums = vboxGlobal().host().GetFloppyDrives(); break;
     2672    CMediumVector comMediums;
     2673    switch (enmMediumType)
     2674    {
     2675        case UIMediumType_DVD:    comMediums = host().GetDVDDrives(); break;
     2676        case UIMediumType_Floppy: comMediums = host().GetFloppyDrives(); break;
    26772677        default: break;
    26782678    }
    26792679    /* Prepare choose-existing-host-drive actions: */
    2680     foreach (const CMedium &medium, mediums)
     2680    foreach (const CMedium &comMedium, comMediums)
    26812681    {
    26822682        /* Make sure host-drive usage is unique: */
    26832683        bool fIsHostDriveUsed = false;
    2684         foreach (const CMediumAttachment &otherAttachment, attachments)
    2685         {
    2686             if (otherAttachment != currentAttachment)
     2684        foreach (const CMediumAttachment &comOtherAttachment, comAttachments)
     2685        {
     2686            if (comOtherAttachment != comCurrentAttachment)
    26872687            {
    2688                 const CMedium &otherMedium = otherAttachment.GetMedium();
    2689                 if (!otherMedium.isNull() && otherMedium.GetId() == medium.GetId())
     2688                const CMedium &comOtherMedium = comOtherAttachment.GetMedium();
     2689                if (!comOtherMedium.isNull() && comOtherMedium.GetId() == comMedium.GetId())
    26902690                {
    26912691                    fIsHostDriveUsed = true;
     
    26972697        if (!fIsHostDriveUsed)
    26982698        {
    2699             QAction *pActionChooseHostDrive = menu.addAction(UIMedium(medium, mediumType).name(), pListener, pszSlotName);
     2699            QAction *pActionChooseHostDrive = menu.addAction(UIMedium(comMedium, enmMediumType).name(), pListener, pszSlotName);
    27002700            pActionChooseHostDrive->setCheckable(true);
    2701             pActionChooseHostDrive->setChecked(!currentMedium.isNull() && medium.GetId() == strCurrentID);
    2702             pActionChooseHostDrive->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(),
    2703                                                                                mediumType, UIMediumTarget::UIMediumTargetType_WithID, medium.GetId())));
     2701            pActionChooseHostDrive->setChecked(!comCurrentMedium.isNull() && comMedium.GetId() == strCurrentID);
     2702            pActionChooseHostDrive->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), comCurrentAttachment.GetDevice(),
     2703                                                                               enmMediumType, UIMediumTarget::UIMediumTargetType_WithID, comMedium.GetId())));
    27042704        }
    27052705    }
     
    27092709    QStringList recentMediumList;
    27102710    QStringList recentMediumListUsed;
    2711     switch (mediumType)
     2711    switch (enmMediumType)
    27122712    {
    27132713        case UIMediumType_HardDisk: recentMediumList = gEDataManager->recentListOfHardDrives(); break;
     
    27312731        /* Make sure recent-medium usage is unique: */
    27322732        bool fIsRecentMediumUsed = false;
    2733         foreach (const CMediumAttachment &otherAttachment, attachments)
    2734         {
    2735             if (otherAttachment != currentAttachment)
     2733        foreach (const CMediumAttachment &otherAttachment, comAttachments)
     2734        {
     2735            if (otherAttachment != comCurrentAttachment)
    27362736            {
    2737                 const CMedium &otherMedium = otherAttachment.GetMedium();
    2738                 if (!otherMedium.isNull() && otherMedium.GetLocation() == strRecentMediumLocation)
     2737                const CMedium &comOtherMedium = otherAttachment.GetMedium();
     2738                if (!comOtherMedium.isNull() && comOtherMedium.GetLocation() == strRecentMediumLocation)
    27392739                {
    27402740                    fIsRecentMediumUsed = true;
     
    27482748            QAction *pActionChooseRecentMedium = menu.addAction(QFileInfo(strRecentMediumLocation).fileName(), pListener, pszSlotName);
    27492749            pActionChooseRecentMedium->setCheckable(true);
    2750             pActionChooseRecentMedium->setChecked(!currentMedium.isNull() && strRecentMediumLocation == strCurrentLocation);
    2751             pActionChooseRecentMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice(),
    2752                                                                                   mediumType, UIMediumTarget::UIMediumTargetType_WithLocation, strRecentMediumLocation)));
     2750            pActionChooseRecentMedium->setChecked(!comCurrentMedium.isNull() && strRecentMediumLocation == strCurrentLocation);
     2751            pActionChooseRecentMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), comCurrentAttachment.GetDevice(),
     2752                                                                                  enmMediumType, UIMediumTarget::UIMediumTargetType_WithLocation, strRecentMediumLocation)));
    27532753            pActionChooseRecentMedium->setToolTip(strRecentMediumLocation);
    27542754        }
     
    27572757
    27582758    /* Last action for optical/floppy attachments only: */
    2759     if (mediumType == UIMediumType_DVD || mediumType == UIMediumType_Floppy)
     2759    if (enmMediumType == UIMediumType_DVD || enmMediumType == UIMediumType_Floppy)
    27602760    {
    27612761        /* Insert separator: */
     
    27642764        /* Prepare unmount-current-medium action: */
    27652765        QAction *pActionUnmountMedium = menu.addAction(QString(), pListener, pszSlotName);
    2766         pActionUnmountMedium->setEnabled(!currentMedium.isNull());
    2767         pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, currentAttachment.GetPort(), currentAttachment.GetDevice())));
     2766        pActionUnmountMedium->setEnabled(!comCurrentMedium.isNull());
     2767        pActionUnmountMedium->setData(QVariant::fromValue(UIMediumTarget(strControllerName, comCurrentAttachment.GetPort(), comCurrentAttachment.GetDevice())));
    27682768        pActionUnmountMedium->setText(QApplication::translate("UIMachineSettingsStorage", "Remove disk from virtual drive"));
    2769         if (mediumType == UIMediumType_DVD)
     2769        if (enmMediumType == UIMediumType_DVD)
    27702770            pActionUnmountMedium->setIcon(UIIconPool::iconSet(":/cd_unmount_16px.png", ":/cd_unmount_disabled_16px.png"));
    2771         else if (mediumType == UIMediumType_Floppy)
     2771        else if (enmMediumType == UIMediumType_Floppy)
    27722772            pActionUnmountMedium->setIcon(UIIconPool::iconSet(":/fd_unmount_16px.png", ":/fd_unmount_disabled_16px.png"));
    27732773    }
    27742774}
    27752775
    2776 void VBoxGlobal::updateMachineStorage(const CMachine &constMachine, const UIMediumTarget &target)
     2776void VBoxGlobal::updateMachineStorage(const CMachine &comConstMachine, const UIMediumTarget &target)
    27772777{
    27782778    /* Mount (by default): */
    27792779    bool fMount = true;
    27802780    /* Null medium (by default): */
    2781     CMedium cmedium;
     2781    CMedium comMedium;
    27822782    /* With null ID (by default): */
    27832783    QString strActualID;
    27842784
    27852785    /* Current mount-target attributes: */
    2786     const CStorageController currentController = constMachine.GetStorageControllerByName(target.name);
    2787     const KStorageBus currentStorageBus = currentController.GetBus();
    2788     const CMediumAttachment currentAttachment = constMachine.GetMediumAttachment(target.name, target.port, target.device);
    2789     const CMedium currentMedium = currentAttachment.GetMedium();
    2790     const QString strCurrentID = currentMedium.isNull() ? QString() : currentMedium.GetId();
    2791     const QString strCurrentLocation = currentMedium.isNull() ? QString() : currentMedium.GetLocation();
     2786    const CStorageController comCurrentController = comConstMachine.GetStorageControllerByName(target.name);
     2787    const KStorageBus enmCurrentStorageBus = comCurrentController.GetBus();
     2788    const CMediumAttachment comCurrentAttachment = comConstMachine.GetMediumAttachment(target.name, target.port, target.device);
     2789    const CMedium comCurrentMedium = comCurrentAttachment.GetMedium();
     2790    const QString strCurrentID = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetId();
     2791    const QString strCurrentLocation = comCurrentMedium.isNull() ? QString() : comCurrentMedium.GetLocation();
    27922792
    27932793    /* Which additional info do we have? */
     
    28142814                }
    28152815                /* Call for file-open dialog: */
    2816                 const QString strMachineFolder(QFileInfo(constMachine.GetSettingsFilePath()).absolutePath());
     2816                const QString strMachineFolder(QFileInfo(comConstMachine.GetSettingsFilePath()).absolutePath());
    28172817                const QString strMediumID = target.type != UIMediumTarget::UIMediumTargetType_CreateAdHocVISO
    28182818                                          ? vboxGlobal().openMediumWithFileOpenDialog(target.mediumType,
     
    28382838
    28392839            /* Prepare target medium: */
    2840             const UIMedium uimedium = vboxGlobal().medium(strNewID);
    2841             cmedium = uimedium.medium();
     2840            const UIMedium guiMedium = vboxGlobal().medium(strNewID);
     2841            comMedium = guiMedium.medium();
    28422842            strActualID = fMount ? strNewID : strCurrentID;
    28432843            break;
     
    28562856
    28572857            /* Prepare target medium: */
    2858             const UIMedium uimedium = fMount ? vboxGlobal().medium(strNewID) : UIMedium();
    2859             cmedium = fMount ? uimedium.medium() : CMedium();
     2858            const UIMedium guiMedium = fMount ? vboxGlobal().medium(strNewID) : UIMedium();
     2859            comMedium = fMount ? guiMedium.medium() : CMedium();
    28602860            strActualID = fMount ? strNewID : strCurrentID;
    28612861            break;
     
    28682868
    28692869    /* Get editable machine: */
    2870     CSession session;
    2871     CMachine machine = constMachine;
    2872     KSessionState sessionState = machine.GetSessionState();
     2870    CSession comSession;
     2871    CMachine comMachine = comConstMachine;
     2872    KSessionState enmSessionState = comMachine.GetSessionState();
    28732873    /* Session state unlocked? */
    2874     if (sessionState == KSessionState_Unlocked)
     2874    if (enmSessionState == KSessionState_Unlocked)
    28752875    {
    28762876        /* Open own 'write' session: */
    2877         session = openSession(machine.GetId());
    2878         AssertReturnVoid(!session.isNull());
    2879         machine = session.GetMachine();
     2877        comSession = openSession(comMachine.GetId());
     2878        AssertReturnVoid(!comSession.isNull());
     2879        comMachine = comSession.GetMachine();
    28802880    }
    28812881    /* Is it Selector UI call? */
     
    28832883    {
    28842884        /* Open existing 'shared' session: */
    2885         session = openExistingSession(machine.GetId());
    2886         AssertReturnVoid(!session.isNull());
    2887         machine = session.GetMachine();
     2885        comSession = openExistingSession(comMachine.GetId());
     2886        AssertReturnVoid(!comSession.isNull());
     2887        comMachine = comSession.GetMachine();
    28882888    }
    28892889    /* Else this is Runtime UI call
     
    28962896    {
    28972897        /* Detaching: */
    2898         machine.DetachDevice(target.name, target.port, target.device);
    2899         fWasMounted = machine.isOk();
     2898        comMachine.DetachDevice(target.name, target.port, target.device);
     2899        fWasMounted = comMachine.isOk();
    29002900        if (!fWasMounted)
    2901             msgCenter().cannotDetachDevice(machine, UIMediumType_HardDisk, strCurrentLocation,
    2902                                            StorageSlot(currentStorageBus, target.port, target.device));
     2901            msgCenter().cannotDetachDevice(comMachine, UIMediumType_HardDisk, strCurrentLocation,
     2902                                           StorageSlot(enmCurrentStorageBus, target.port, target.device));
    29032903        else
    29042904        {
    29052905            /* Attaching: */
    2906             machine.AttachDevice(target.name, target.port, target.device, KDeviceType_HardDisk, cmedium);
    2907             fWasMounted = machine.isOk();
     2906            comMachine.AttachDevice(target.name, target.port, target.device, KDeviceType_HardDisk, comMedium);
     2907            fWasMounted = comMachine.isOk();
    29082908            if (!fWasMounted)
    2909                 msgCenter().cannotAttachDevice(machine, UIMediumType_HardDisk, strCurrentLocation,
    2910                                                StorageSlot(currentStorageBus, target.port, target.device));
     2909                msgCenter().cannotAttachDevice(comMachine, UIMediumType_HardDisk, strCurrentLocation,
     2910                                               StorageSlot(enmCurrentStorageBus, target.port, target.device));
    29112911        }
    29122912    }
     
    29152915    {
    29162916        /* Remounting: */
    2917         machine.MountMedium(target.name, target.port, target.device, cmedium, false /* force? */);
    2918         fWasMounted = machine.isOk();
     2917        comMachine.MountMedium(target.name, target.port, target.device, comMedium, false /* force? */);
     2918        fWasMounted = comMachine.isOk();
    29192919        if (!fWasMounted)
    29202920        {
    29212921            /* Ask for force remounting: */
    2922             if (msgCenter().cannotRemountMedium(machine, vboxGlobal().medium(strActualID),
     2922            if (msgCenter().cannotRemountMedium(comMachine, vboxGlobal().medium(strActualID),
    29232923                                                fMount, true /* retry? */))
    29242924            {
    29252925                /* Force remounting: */
    2926                 machine.MountMedium(target.name, target.port, target.device, cmedium, true /* force? */);
    2927                 fWasMounted = machine.isOk();
     2926                comMachine.MountMedium(target.name, target.port, target.device, comMedium, true /* force? */);
     2927                fWasMounted = comMachine.isOk();
    29282928                if (!fWasMounted)
    2929                     msgCenter().cannotRemountMedium(machine, vboxGlobal().medium(strActualID),
     2929                    msgCenter().cannotRemountMedium(comMachine, vboxGlobal().medium(strActualID),
    29302930                                                    fMount, false /* retry? */);
    29312931            }
     
    29352935        {
    29362936            /* Disable First RUN Wizard: */
    2937             if (gEDataManager->machineFirstTimeStarted(machine.GetId()))
    2938                 gEDataManager->setMachineFirstTimeStarted(false, machine.GetId());
     2937            if (gEDataManager->machineFirstTimeStarted(comMachine.GetId()))
     2938                gEDataManager->setMachineFirstTimeStarted(false, comMachine.GetId());
    29392939        }
    29402940    }
     
    29432943    if (fWasMounted)
    29442944    {
    2945         machine.SaveSettings();
    2946         if (!machine.isOk())
    2947             msgCenter().cannotSaveMachineSettings(machine, windowManager().mainWindowShown());
    2948     }
    2949 
    2950     /* Close session to editable machine if necessary: */
    2951     if (!session.isNull())
    2952         session.UnlockMachine();
    2953 }
    2954 
    2955 QString VBoxGlobal::details(const CMedium &cmedium, bool fPredictDiff, bool fUseHtml /* = true */)
     2945        comMachine.SaveSettings();
     2946        if (!comMachine.isOk())
     2947            msgCenter().cannotSaveMachineSettings(comMachine, windowManager().mainWindowShown());
     2948    }
     2949
     2950    /* Close session to editable comMachine if necessary: */
     2951    if (!comSession.isNull())
     2952        comSession.UnlockMachine();
     2953}
     2954
     2955QString VBoxGlobal::details(const CMedium &comMedium, bool fPredictDiff, bool fUseHtml /* = true */)
    29562956{
    29572957    /* Search for corresponding UI medium: */
    2958     const QString strMediumID = cmedium.isNull() ? UIMedium::nullID() : cmedium.GetId();
    2959     UIMedium uimedium = medium(strMediumID);
    2960     if (!cmedium.isNull() && uimedium.isNull())
     2958    const QString strMediumID = comMedium.isNull() ? UIMedium::nullID() : comMedium.GetId();
     2959    UIMedium guiMedium = medium(strMediumID);
     2960    if (!comMedium.isNull() && guiMedium.isNull())
    29612961    {
    29622962        /* UI medium may be new and not among our mediums, request enumeration: */
     
    29652965        /* Search for corresponding UI medium again: */
    29662966
    2967         uimedium = medium(strMediumID);
    2968         if (uimedium.isNull())
     2967        guiMedium = medium(strMediumID);
     2968        if (guiMedium.isNull())
    29692969        {
    29702970            /* Medium might be deleted already, return null string: */
     
    29742974
    29752975    /* Return UI medium details: */
    2976     return fUseHtml ? uimedium.detailsHTML(true /* aNoDiffs */, fPredictDiff) :
    2977                       uimedium.details(true /* aNoDiffs */, fPredictDiff);
     2976    return fUseHtml ? guiMedium.detailsHTML(true /* no diffs? */, fPredictDiff) :
     2977                      guiMedium.details(true /* no diffs? */, fPredictDiff);
    29782978}
    29792979
     
    30073007#endif /* RT_OS_LINUX */
    30083008
    3009 QString VBoxGlobal::details (const CUSBDevice &aDevice) const
    3010 {
    3011     QString sDetails;
    3012     if (aDevice.isNull())
    3013         sDetails = tr("Unknown device", "USB device details");
     3009QString VBoxGlobal::details (const CUSBDevice &comDevice) const
     3010{
     3011    QString strDetails;
     3012    if (comDevice.isNull())
     3013        strDetails = tr("Unknown device", "USB device details");
    30143014    else
    30153015    {
    3016         QVector<QString> devInfoVector = aDevice.GetDeviceInfo();
    3017         QString m;
    3018         QString p;
     3016        QVector<QString> devInfoVector = comDevice.GetDeviceInfo();
     3017        QString strManufacturer;
     3018        QString strProduct;
    30193019
    30203020        if (devInfoVector.size() >= 1)
    3021             m = devInfoVector[0].trimmed();
     3021            strManufacturer = devInfoVector[0].trimmed();
    30223022        if (devInfoVector.size() >= 2)
    3023             p = devInfoVector[1].trimmed();
    3024 
    3025         if (m.isEmpty() && p.isEmpty())
    3026         {
    3027             sDetails =
     3023            strProduct = devInfoVector[1].trimmed();
     3024
     3025        if (strManufacturer.isEmpty() && strProduct.isEmpty())
     3026        {
     3027            strDetails =
    30283028                tr ("Unknown device %1:%2", "USB device details")
    3029                 .arg (QString().sprintf ("%04hX", aDevice.GetVendorId()))
    3030                 .arg (QString().sprintf ("%04hX", aDevice.GetProductId()));
     3029                    .arg (QString().sprintf ("%04hX", comDevice.GetVendorId()))
     3030                    .arg (QString().sprintf ("%04hX", comDevice.GetProductId()));
    30313031        }
    30323032        else
    30333033        {
    3034             if (p.toUpper().startsWith (m.toUpper()))
    3035                 sDetails = p;
     3034            if (strProduct.toUpper().startsWith (strManufacturer.toUpper()))
     3035                strDetails = strProduct;
    30363036            else
    3037                 sDetails = m + " " + p;
    3038         }
    3039         ushort r = aDevice.GetRevision();
    3040         if (r != 0)
    3041             sDetails += QString().sprintf (" [%04hX]", r);
    3042     }
    3043 
    3044     return sDetails.trimmed();
    3045 }
    3046 
    3047 QString VBoxGlobal::toolTip (const CUSBDevice &aDevice) const
    3048 {
    3049     QString tip =
     3037                strDetails = strManufacturer + " " + strProduct;
     3038        }
     3039        ushort iRev = comDevice.GetRevision();
     3040        if (iRev != 0)
     3041            strDetails += QString().sprintf (" [%04hX]", iRev);
     3042    }
     3043
     3044    return strDetails.trimmed();
     3045}
     3046
     3047QString VBoxGlobal::toolTip (const CUSBDevice &comDevice) const
     3048{
     3049    QString strTip =
    30503050        tr ("<nobr>Vendor ID: %1</nobr><br>"
    30513051            "<nobr>Product ID: %2</nobr><br>"
    30523052            "<nobr>Revision: %3</nobr>", "USB device tooltip")
    3053         .arg (QString().sprintf ("%04hX", aDevice.GetVendorId()))
    3054         .arg (QString().sprintf ("%04hX", aDevice.GetProductId()))
    3055         .arg (QString().sprintf ("%04hX", aDevice.GetRevision()));
    3056 
    3057     QString ser = aDevice.GetSerialNumber();
    3058     if (!ser.isEmpty())
    3059         tip += QString (tr ("<br><nobr>Serial No. %1</nobr>", "USB device tooltip"))
    3060                         .arg (ser);
     3053            .arg (QString().sprintf ("%04hX", comDevice.GetVendorId()))
     3054            .arg (QString().sprintf ("%04hX", comDevice.GetProductId()))
     3055            .arg (QString().sprintf ("%04hX", comDevice.GetRevision()));
     3056
     3057    QString strSerial = comDevice.GetSerialNumber();
     3058    if (!strSerial.isEmpty())
     3059        strTip += QString (tr ("<br><nobr>Serial No. %1</nobr>", "USB device tooltip"))
     3060                               .arg (strSerial);
    30613061
    30623062    /* add the state field if it's a host USB device */
    3063     CHostUSBDevice hostDev (aDevice);
     3063    CHostUSBDevice hostDev (comDevice);
    30643064    if (!hostDev.isNull())
    30653065    {
    3066         tip += QString (tr ("<br><nobr>State: %1</nobr>", "USB device tooltip"))
    3067                         .arg (gpConverter->toString (hostDev.GetState()));
    3068     }
    3069 
    3070     return tip;
    3071 }
    3072 
    3073 QString VBoxGlobal::toolTip (const CUSBDeviceFilter &aFilter) const
    3074 {
    3075     QString tip;
    3076 
    3077     QString vendorId = aFilter.GetVendorId();
    3078     if (!vendorId.isEmpty())
    3079         tip += tr ("<nobr>Vendor ID: %1</nobr>", "USB filter tooltip")
    3080                    .arg (vendorId);
    3081 
    3082     QString productId = aFilter.GetProductId();
    3083     if (!productId.isEmpty())
    3084         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>Product ID: %2</nobr>", "USB filter tooltip")
    3085                                                 .arg (productId);
    3086 
    3087     QString revision = aFilter.GetRevision();
    3088     if (!revision.isEmpty())
    3089         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>Revision: %3</nobr>", "USB filter tooltip")
    3090                                                 .arg (revision);
    3091 
    3092     QString product = aFilter.GetProduct();
    3093     if (!product.isEmpty())
    3094         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>Product: %4</nobr>", "USB filter tooltip")
    3095                                                 .arg (product);
    3096 
    3097     QString manufacturer = aFilter.GetManufacturer();
    3098     if (!manufacturer.isEmpty())
    3099         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>Manufacturer: %5</nobr>", "USB filter tooltip")
    3100                                                 .arg (manufacturer);
    3101 
    3102     QString serial = aFilter.GetSerialNumber();
    3103     if (!serial.isEmpty())
    3104         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>Serial No.: %1</nobr>", "USB filter tooltip")
    3105                                                 .arg (serial);
    3106 
    3107     QString port = aFilter.GetPort();
    3108     if (!port.isEmpty())
    3109         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>Port: %1</nobr>", "USB filter tooltip")
    3110                                                 .arg (port);
     3066        strTip += QString (tr ("<br><nobr>State: %1</nobr>", "USB device tooltip"))
     3067                               .arg (gpConverter->toString (hostDev.GetState()));
     3068    }
     3069
     3070    return strTip;
     3071}
     3072
     3073QString VBoxGlobal::toolTip (const CUSBDeviceFilter &comFilter) const
     3074{
     3075    QString strTip;
     3076
     3077    QString strVendorId = comFilter.GetVendorId();
     3078    if (!strVendorId.isEmpty())
     3079        strTip += tr ("<nobr>Vendor ID: %1</nobr>", "USB filter tooltip")
     3080                      .arg (strVendorId);
     3081
     3082    QString strProductId = comFilter.GetProductId();
     3083    if (!strProductId.isEmpty())
     3084        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>Product ID: %2</nobr>", "USB filter tooltip")
     3085                                                      .arg (strProductId);
     3086
     3087    QString strRevision = comFilter.GetRevision();
     3088    if (!strRevision.isEmpty())
     3089        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>Revision: %3</nobr>", "USB filter tooltip")
     3090                                                      .arg (strRevision);
     3091
     3092    QString strProduct = comFilter.GetProduct();
     3093    if (!strProduct.isEmpty())
     3094        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>Product: %4</nobr>", "USB filter tooltip")
     3095                                                      .arg (strProduct);
     3096
     3097    QString strManufacturer = comFilter.GetManufacturer();
     3098    if (!strManufacturer.isEmpty())
     3099        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>Manufacturer: %5</nobr>", "USB filter tooltip")
     3100                                                      .arg (strManufacturer);
     3101
     3102    QString strSerial = comFilter.GetSerialNumber();
     3103    if (!strSerial.isEmpty())
     3104        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>Serial No.: %1</nobr>", "USB filter tooltip")
     3105                                                      .arg (strSerial);
     3106
     3107    QString strPort = comFilter.GetPort();
     3108    if (!strPort.isEmpty())
     3109        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>Port: %1</nobr>", "USB filter tooltip")
     3110                                                      .arg (strPort);
    31113111
    31123112    /* add the state field if it's a host USB device */
    3113     CHostUSBDevice hostDev (aFilter);
     3113    CHostUSBDevice hostDev (comFilter);
    31143114    if (!hostDev.isNull())
    31153115    {
    3116         tip += tip.isEmpty() ? "":"<br/>" + tr ("<nobr>State: %1</nobr>", "USB filter tooltip")
    3117                                                 .arg (gpConverter->toString (hostDev.GetState()));
    3118     }
    3119 
    3120     return tip;
    3121 }
    3122 
    3123 QString VBoxGlobal::toolTip(const CHostVideoInputDevice &webcam) const
     3116        strTip += strTip.isEmpty() ? "":"<br/>" + tr ("<nobr>State: %1</nobr>", "USB filter tooltip")
     3117                                                      .arg (gpConverter->toString (hostDev.GetState()));
     3118    }
     3119
     3120    return strTip;
     3121}
     3122
     3123QString VBoxGlobal::toolTip(const CHostVideoInputDevice &comWebcam) const
    31243124{
    31253125    QStringList records;
    31263126
    3127     QString strName = webcam.GetName();
     3127    const QString strName = comWebcam.GetName();
    31283128    if (!strName.isEmpty())
    31293129        records << strName;
    31303130
    3131     QString strPath = webcam.GetPath();
     3131    const QString strPath = comWebcam.GetPath();
    31323132    if (!strPath.isEmpty())
    31333133        records << strPath;
     
    32383238    bool fSupported = false;
    32393239#endif
    3240     unconst(this)->m3DAvailable = fSupported;
     3240    unconst(this)->m_i3DAvailable = fSupported;
    32413241    return fSupported;
    32423242}
     
    32443244bool VBoxGlobal::is3DAvailable() const
    32453245{
    3246     if (m3DAvailable < 0)
     3246    if (m_i3DAvailable < 0)
    32473247        return is3DAvailableWorker();
    3248     return m3DAvailable != 0;
     3248    return m_i3DAvailable != 0;
    32493249}
    32503250
     
    32883288            screenSize.replace(i, screenSize.at(0));
    32893289
    3290     quint64 needBits = 0;
     3290    quint64 uNeedBits = 0;
    32913291    for (int i = 0; i < cMonitors; ++i)
    32923292    {
    32933293        /* Calculate summary required memory amount in bits: */
    3294         needBits += (screenSize.at(i) * /* with x height */
     3294        uNeedBits += (screenSize.at(i) * /* with x height */
    32953295                     32 + /* we will take the maximum possible bpp for now */
    32963296                     8 * _1M) + /* current cache per screen - may be changed in future */
    3297                     8 * 4096; /* adapter info */
     3297                     8 * 4096; /* adapter info */
    32983298    }
    32993299    /* Translate value into megabytes with rounding to highest side: */
    3300     quint64 needMBytes = needBits % (8 * _1M) ? needBits / (8 * _1M) + 1 :
    3301                          needBits / (8 * _1M) /* convert to megabytes */;
     3300    quint64 uNeedMBytes = uNeedBits % (8 * _1M) ? uNeedBits / (8 * _1M) + 1 :
     3301                          uNeedBits / (8 * _1M) /* convert to megabytes */;
    33023302
    33033303    if (strGuestOSTypeId.startsWith("Windows"))
     
    33083308       {
    33093309           /* WDDM mode, there are two surfaces for each screen: shadow & primary: */
    3310            needMBytes *= 3;
     3310           uNeedMBytes *= 3;
    33113311       }
    33123312       else
    33133313#endif /* VBOX_WITH_CRHGSMI */
    33143314       {
    3315            needMBytes *= 2;
     3315           uNeedMBytes *= 2;
    33163316       }
    33173317    }
    33183318
    3319     return needMBytes * _1M;
     3319    return uNeedMBytes * _1M;
    33203320}
    33213321
     
    33933393
    33943394/* static */
    3395 QPixmap VBoxGlobal::joinPixmaps (const QPixmap &aPM1, const QPixmap &aPM2)
    3396 {
    3397     if (aPM1.isNull())
    3398         return aPM2;
    3399     if (aPM2.isNull())
    3400         return aPM1;
    3401 
    3402     QPixmap result (aPM1.width() + aPM2.width() + 2,
    3403                     qMax (aPM1.height(), aPM2.height()));
     3395QPixmap VBoxGlobal::joinPixmaps (const QPixmap &pixmap1, const QPixmap &pixmap2)
     3396{
     3397    if (pixmap1.isNull())
     3398        return pixmap2;
     3399    if (pixmap2.isNull())
     3400        return pixmap1;
     3401
     3402    QPixmap result (pixmap1.width() + pixmap2.width() + 2,
     3403                    qMax (pixmap1.height(), pixmap2.height()));
    34043404    result.fill (Qt::transparent);
    34053405
    34063406    QPainter painter (&result);
    3407     painter.drawPixmap (0, 0, aPM1);
    3408     painter.drawPixmap (aPM1.width() + 2, result.height() - aPM2.height(), aPM2);
     3407    painter.drawPixmap (0, 0, pixmap1);
     3408    painter.drawPixmap (pixmap1.width() + 2, result.height() - pixmap2.height(), pixmap2);
    34093409    painter.end();
    34103410
     
    34123412}
    34133413
    3414 bool VBoxGlobal::openURL (const QString &aURL)
     3414bool VBoxGlobal::openURL (const QString &strUrl)
    34153415{
    34163416    /** Service event. */
     
    34203420
    34213421            /** Constructs service event on th basis of passed @a fResult. */
    3422             ServiceEvent (bool aResult) : QEvent (QEvent::User), mResult (aResult) {}
     3422            ServiceEvent (bool fResult) : QEvent (QEvent::User), m_fResult (fResult) {}
    34233423
    34243424            /** Returns the result which event brings. */
    3425             bool result() const { return mResult; }
     3425            bool result() const { return m_fResult; }
    34263426
    34273427        private:
    34283428
    34293429            /** Holds the result which event brings. */
    3430             bool mResult;
     3430            bool m_fResult;
    34313431    };
    34323432
     
    34373437
    34383438            /** Constructs service client on the basis of passed @a fResult. */
    3439             ServiceClient() : mResult (false) {}
     3439            ServiceClient() : m_fResult (false) {}
    34403440
    34413441            /** Returns the result which event brings. */
    3442             bool result() const { return mResult; }
     3442            bool result() const { return m_fResult; }
    34433443
    34443444        private:
    34453445
    34463446            /** Handles any Qt @a pEvent. */
    3447             bool event (QEvent *aEvent)
     3447            bool event (QEvent *pEvent)
    34483448            {
    34493449                /* Handle service event: */
    3450                 if (aEvent->type() == QEvent::User)
     3450                if (pEvent->type() == QEvent::User)
    34513451                {
    3452                     ServiceEvent *pEvent = static_cast <ServiceEvent*> (aEvent);
    3453                     mResult = pEvent->result();
    3454                     pEvent->accept();
     3452                    ServiceEvent *pServiceEvent = static_cast <ServiceEvent*> (pEvent);
     3453                    m_fResult = pServiceEvent->result();
     3454                    pServiceEvent->accept();
    34553455                    quit();
    34563456                    return true;
     
    34593459            }
    34603460
    3461             bool mResult;
     3461            bool m_fResult;
    34623462    };
    34633463
     
    34683468
    34693469            /** Constructs service server on the basis of passed @a client and @a strUrl. */
    3470             ServiceServer (ServiceClient &aClient, const QString &sURL)
    3471                 : mClient (aClient), mURL (sURL) {}
     3470            ServiceServer (ServiceClient &client, const QString &strUrl)
     3471                : m_client (client), m_strUrl (strUrl) {}
    34723472
    34733473        private:
     
    34763476            void run()
    34773477            {
    3478                 QApplication::postEvent (&mClient, new ServiceEvent (QDesktopServices::openUrl (mURL)));
     3478                QApplication::postEvent (&m_client, new ServiceEvent (QDesktopServices::openUrl (m_strUrl)));
    34793479            }
    34803480
    34813481            /** Holds the client reference. */
    3482             ServiceClient &mClient;
     3482            ServiceClient &m_client;
    34833483            /** Holds the URL to be processed. */
    3484             const QString &mURL;
     3484            const QString &m_strUrl;
    34853485    };
    34863486
    34873487    /* Create/start client & server: */
    34883488    ServiceClient client;
    3489     ServiceServer server (client, aURL);
     3489    ServiceServer server (client, strUrl);
    34903490    server.start();
    34913491    client.exec();
     
    34933493
    34943494    /* Acquire client result: */
    3495     bool result = client.result();
    3496 
    3497     if (!result)
    3498         msgCenter().cannotOpenURL (aURL);
    3499 
    3500     return result;
    3501 }
    3502 
    3503 void VBoxGlobal::sltGUILanguageChange(QString strLang)
     3495    bool fResult = client.result();
     3496
     3497    if (!fResult)
     3498        msgCenter().cannotOpenURL (strUrl);
     3499
     3500    return fResult;
     3501}
     3502
     3503void VBoxGlobal::sltGUILanguageChange(QString strLanguage)
    35043504{
    35053505    /* Make sure medium-enumeration is not in progress! */
    35063506    AssertReturnVoid(!isMediumEnumerationInProgress());
    35073507    /* Load passed language: */
    3508     loadLanguage(strLang);
    3509 }
    3510 
    3511 bool VBoxGlobal::eventFilter (QObject *aObject, QEvent *aEvent)
     3508    loadLanguage(strLanguage);
     3509}
     3510
     3511bool VBoxGlobal::eventFilter (QObject *pObject, QEvent *pEvent)
    35123512{
    35133513    /** @todo Just use the QIWithRetranslateUI3 template wrapper. */
    35143514
    3515     if (aEvent->type() == QEvent::LanguageChange &&
    3516         aObject->isWidgetType() &&
    3517         static_cast <QWidget *> (aObject)->isTopLevel())
     3515    if (pEvent->type() == QEvent::LanguageChange &&
     3516        pObject->isWidgetType() &&
     3517        static_cast <QWidget *> (pObject)->isTopLevel())
    35183518    {
    35193519        /* Catch the language change event before any other widget gets it in
     
    35213521         * templates) that may be used by other widgets. */
    35223522        QWidgetList list = QApplication::topLevelWidgets();
    3523         if (list.first() == aObject)
     3523        if (list.first() == pObject)
    35243524        {
    35253525            /* Call this only once per every language change (see
     
    35303530
    35313531    /* Call to base-class: */
    3532     return QObject::eventFilter (aObject, aEvent);
     3532    return QObject::eventFilter (pObject, pEvent);
    35333533}
    35343534
    35353535void VBoxGlobal::retranslateUi()
    35363536{
    3537     mUserDefinedPortName = tr ("User-defined", "serial port");
    3538 
    3539     mWarningIcon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning).pixmap (16, 16);
    3540     Assert (!mWarningIcon.isNull());
    3541 
    3542     mErrorIcon = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxCritical).pixmap (16, 16);
    3543     Assert (!mErrorIcon.isNull());
     3537    m_strUserDefinedPortName = tr ("User-defined", "serial port");
     3538
     3539    m_pixWarning = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning).pixmap (16, 16);
     3540    Assert (!m_pixWarning.isNull());
     3541
     3542    m_pixError = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxCritical).pixmap (16, 16);
     3543    Assert (!m_pixError.isNull());
    35443544
    35453545    /* Re-enumerate uimedium since they contain some translations too: */
    3546     if (mValid)
     3546    if (m_fValid)
    35473547        startMediumEnumeration();
    35483548
     
    35653565#ifdef VBOX_WS_MAC
    35663566    /* Determine OS release early: */
    3567     m_osRelease = determineOsRelease();
     3567    m_enmMacOSVersion = determineOsRelease();
    35683568#endif /* VBOX_WS_MAC */
    35693569
     
    36183618
    36193619    /* Make sure VirtualBoxClient instance created: */
    3620     m_client.createInstance(CLSID_VirtualBoxClient);
    3621     if (!m_client.isOk())
    3622     {
    3623         msgCenter().cannotCreateVirtualBoxClient(m_client);
     3620    m_comVBoxClient.createInstance(CLSID_VirtualBoxClient);
     3621    if (!m_comVBoxClient.isOk())
     3622    {
     3623        msgCenter().cannotCreateVirtualBoxClient(m_comVBoxClient);
    36243624        return;
    36253625    }
    36263626    /* Make sure VirtualBox instance acquired: */
    3627     m_vbox = m_client.GetVirtualBox();
    3628     if (!m_client.isOk())
    3629     {
    3630         msgCenter().cannotAcquireVirtualBox(m_client);
     3627    m_comVBox = m_comVBoxClient.GetVirtualBox();
     3628    if (!m_comVBoxClient.isOk())
     3629    {
     3630        msgCenter().cannotAcquireVirtualBox(m_comVBoxClient);
    36313631        return;
    36323632    }
     
    36733673    initDebuggerVar(&m_fDbgAutoShow, "VBOX_GUI_DBG_AUTO_SHOW", GUI_Dbg_AutoShow, false);
    36743674    m_fDbgAutoShowCommandLine = m_fDbgAutoShowStatistics = m_fDbgAutoShow;
    3675     m_enmStartRunning = StartRunning_Default;
     3675    m_enmLaunchRunning = LaunchRunning_Default;
    36763676#endif
    36773677
    3678     mShowStartVMErrors = true;
     3678    m_fShowStartVMErrors = true;
    36793679    bool startVM = false;
    36803680    bool fSeparateProcess = false;
     
    37083708        {
    37093709            if (++i < argc)
    3710                 m_strPidfile = arguments.at(i);
     3710                m_strPidFile = arguments.at(i);
    37113711        }
    37123712#endif /* VBOX_GUI_WITH_PIDFILE */
     
    37253725            if (++i < argc)
    37263726            {
    3727                 RTStrCopy(mSettingsPw, sizeof(mSettingsPw), arguments.at(i).toLocal8Bit().constData());
    3728                 mSettingsPwSet = true;
     3727                RTStrCopy(m_astrSettingsPw, sizeof(m_astrSettingsPw), arguments.at(i).toLocal8Bit().constData());
     3728                m_fSettingsPwSet = true;
    37293729            }
    37303730        }
     
    37453745                if (RT_SUCCESS(vrc))
    37463746                {
    3747                     vrc = RTStrmReadEx(pStrm, mSettingsPw, sizeof(mSettingsPw)-1, &cbFile);
     3747                    vrc = RTStrmReadEx(pStrm, m_astrSettingsPw, sizeof(m_astrSettingsPw)-1, &cbFile);
    37483748                    if (RT_SUCCESS(vrc))
    37493749                    {
    3750                         if (cbFile >= sizeof(mSettingsPw)-1)
     3750                        if (cbFile >= sizeof(m_astrSettingsPw)-1)
    37513751                            continue;
    37523752                        else
    37533753                        {
    37543754                            unsigned i;
    3755                             for (i = 0; i < cbFile && !RT_C_IS_CNTRL(mSettingsPw[i]); i++)
     3755                            for (i = 0; i < cbFile && !RT_C_IS_CNTRL(m_astrSettingsPw[i]); i++)
    37563756                                ;
    3757                             mSettingsPw[i] = '\0';
    3758                             mSettingsPwSet = true;
     3757                            m_astrSettingsPw[i] = '\0';
     3758                            m_fSettingsPwSet = true;
    37593759                        }
    37603760                    }
     
    37683768            ++i;
    37693769        else if (!::strcmp(arg, "--no-startvm-errormsgbox"))
    3770             mShowStartVMErrors = false;
     3770            m_fShowStartVMErrors = false;
    37713771        else if (!::strcmp(arg, "--aggressive-caching"))
    3772             mAgressiveCaching = true;
     3772            m_fAgressiveCaching = true;
    37733773        else if (!::strcmp(arg, "--no-aggressive-caching"))
    3774             mAgressiveCaching = false;
     3774            m_fAgressiveCaching = false;
    37753775        else if (!::strcmp(arg, "--restore-current"))
    3776             mRestoreCurrentSnapshot = true;
     3776            m_fRestoreCurrentSnapshot = true;
    37773777        /* Ad hoc VM reconfig options: */
    37783778        else if (!::strcmp(arg, "--fda"))
     
    37883788        /* VMM Options: */
    37893789        else if (!::strcmp(arg, "--disable-patm"))
    3790             mDisablePatm = true;
     3790            m_fDisablePatm = true;
    37913791        else if (!::strcmp(arg, "--disable-csam"))
    3792             mDisableCsam = true;
     3792            m_fDisableCsam = true;
    37933793        else if (!::strcmp(arg, "--recompile-supervisor"))
    3794             mRecompileSupervisor = true;
     3794            m_fRecompileSupervisor = true;
    37953795        else if (!::strcmp(arg, "--recompile-user"))
    3796             mRecompileUser = true;
     3796            m_fRecompileUser = true;
    37973797        else if (!::strcmp(arg, "--recompile-all"))
    3798             mDisablePatm = mDisableCsam = mRecompileSupervisor = mRecompileUser = true;
     3798            m_fDisablePatm = m_fDisableCsam = m_fRecompileSupervisor = m_fRecompileUser = true;
    37993799        else if (!::strcmp(arg, "--execute-all-in-iem"))
    3800             mDisablePatm = mDisableCsam = mExecuteAllInIem = true;
     3800            m_fDisablePatm = m_fDisableCsam = m_fExecuteAllInIem = true;
    38013801        else if (!::strcmp(arg, "--warp-pct"))
    38023802        {
    38033803            if (++i < argc)
    3804                 mWarpPct = RTStrToUInt32(arguments.at(i).toLocal8Bit().constData());
     3804                m_uWarpPct = RTStrToUInt32(arguments.at(i).toLocal8Bit().constData());
    38053805        }
    38063806#ifdef VBOX_WITH_DEBUGGER_GUI
     
    38363836        /* Not quite debug options, but they're only useful with the debugger bits. */
    38373837        else if (!::strcmp(arg, "--start-paused"))
    3838             m_enmStartRunning = StartRunning_No;
     3838            m_enmLaunchRunning = LaunchRunning_No;
    38393839        else if (!::strcmp(arg, "--start-running"))
    3840             m_enmStartRunning = StartRunning_Yes;
     3840            m_enmLaunchRunning = LaunchRunning_Yes;
    38413841#endif
    38423842        /** @todo add an else { msgbox(syntax error); exit(1); } here, pretty please... */
     
    38553855        /* Search for corresponding VM: */
    38563856        QUuid uuid = QUuid(vmNameOrUuid);
    3857         const CMachine machine = m_vbox.FindMachine(vmNameOrUuid);
     3857        const CMachine machine = m_comVBox.FindMachine(vmNameOrUuid);
    38583858        if (!uuid.isNull())
    38593859        {
    38603860            if (machine.isNull() && showStartVMErrors())
    3861                 return msgCenter().cannotFindMachineById(m_vbox, vmNameOrUuid);
     3861                return msgCenter().cannotFindMachineById(m_comVBox, vmNameOrUuid);
    38623862        }
    38633863        else
    38643864        {
    38653865            if (machine.isNull() && showStartVMErrors())
    3866                 return msgCenter().cannotFindMachineByName(m_vbox, vmNameOrUuid);
    3867         }
    3868         vmUuid = machine.GetId();
     3866                return msgCenter().cannotFindMachineByName(m_comVBox, vmNameOrUuid);
     3867        }
     3868        m_strManagedVMId = machine.GetId();
    38693869    }
    38703870
     
    38943894    }
    38953895
    3896     if (mSettingsPwSet)
    3897         m_vbox.SetSettingsSecret(mSettingsPw);
    3898 
    3899     if (visualStateType != UIVisualStateType_Invalid && !vmUuid.isEmpty())
    3900         gEDataManager->setRequestedVisualState(visualStateType, vmUuid);
     3896    if (m_fSettingsPwSet)
     3897        m_comVBox.SetSettingsSecret(m_astrSettingsPw);
     3898
     3899    if (visualStateType != UIVisualStateType_Invalid && !m_strManagedVMId.isEmpty())
     3900        gEDataManager->setRequestedVisualState(visualStateType, m_strManagedVMId);
    39013901
    39023902#ifdef VBOX_WITH_DEBUGGER_GUI
     
    39183918#endif
    39193919
    3920     mValid = true;
     3920    m_fValid = true;
    39213921
    39223922    /* Create medium-enumerator but don't do any immediate caching: */
     
    39583958    /* Remember that the cleanup is in progress preventing any unwanted
    39593959     * stuff which could be called from the other threads: */
    3960     s_fCleanupInProgress = true;
     3960    s_fCleaningUp = true;
    39613961
    39623962#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
     
    39763976
    39773977    /* Starting medium-enumerator cleanup: */
    3978     m_mediumEnumeratorDtorRwLock.lockForWrite();
     3978    m_meCleanupProtectionToken.lockForWrite();
    39793979    {
    39803980        /* Destroy medium-enumerator: */
     
    39833983    }
    39843984    /* Finishing medium-enumerator cleanup: */
    3985     m_mediumEnumeratorDtorRwLock.unlock();
     3985    m_meCleanupProtectionToken.unlock();
    39863986
    39873987    /* Destroy the global (VirtualBox) Main event handler
     
    40114011    {
    40124012        /* First, make sure we don't use COM any more: */
    4013         m_host.detach();
    4014         m_vbox.detach();
    4015         m_client.detach();
     4013        m_comHost.detach();
     4014        m_comVBox.detach();
     4015        m_comVBoxClient.detach();
    40164016
    40174017        /* There may be UIMedium(s)EnumeratedEvent instances still in the message
     
    40344034    UIDesktopWidgetWatchdog::destroy();
    40354035
    4036     mValid = false;
     4036    m_fValid = false;
    40374037}
    40384038
     
    40724072        m_fWrappersValid = false;
    40734073        /* Re-fetch corresponding CVirtualBox to restart VBoxSVC: */
    4074         m_vbox = m_client.GetVirtualBox();
    4075         if (!m_client.isOk())
     4074        m_comVBox = m_comVBoxClient.GetVirtualBox();
     4075        if (!m_comVBoxClient.isOk())
    40764076        {
    40774077            // The proper behavior would be to show the message and to exit the app, e.g.:
    4078             // msgCenter().cannotAcquireVirtualBox(m_client);
     4078            // msgCenter().cannotAcquireVirtualBox(m_comVBoxClient);
    40794079            // return QApplication::quit();
    40804080            // But CVirtualBox is still NULL in current Main implementation,
     
    40894089        {
    40904090            /* Re-fetch corresponding CVirtualBox: */
    4091             m_vbox = m_client.GetVirtualBox();
    4092             if (!m_client.isOk())
     4091            m_comVBox = m_comVBoxClient.GetVirtualBox();
     4092            if (!m_comVBoxClient.isOk())
    40934093            {
    4094                 msgCenter().cannotAcquireVirtualBox(m_client);
     4094                msgCenter().cannotAcquireVirtualBox(m_comVBoxClient);
    40954095                return QApplication::quit();
    40964096            }
     
    41544154        strEnvValue = "veto";
    41554155
    4156     QString strExtraValue = m_vbox.GetExtraData(pszExtraDataName).toLower().trimmed();
     4156    QString strExtraValue = m_comVBox.GetExtraData(pszExtraDataName).toLower().trimmed();
    41574157    if (strExtraValue.isEmpty())
    41584158        strExtraValue = QString();
     
    42254225{
    42264226    /* Re-fetch corresponding objects/values: */
    4227     m_host = virtualBox().GetHost();
     4227    m_comHost = virtualBox().GetHost();
    42284228    m_strHomeFolder = virtualBox().GetHomeFolder();
    42294229
     
    42314231    m_guestOSFamilyIDs.clear();
    42324232    m_guestOSTypes.clear();
    4233     const CGuestOSTypeVector guestOSTypes = m_vbox.GetGuestOSTypes();
     4233    const CGuestOSTypeVector guestOSTypes = m_comVBox.GetGuestOSTypes();
    42344234    const int cGuestOSTypeCount = guestOSTypes.size();
    42354235    AssertMsg(cGuestOSTypeCount > 0, ("Number of OS types must not be zero"));
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h

    r72435 r72626  
    122122
    123123    /** VM launch running options. */
    124     enum StartRunning
     124    enum LaunchRunning
    125125    {
    126         StartRunning_Default, /**< Default (depends on debug settings). */
    127         StartRunning_No,      /**< Start the VM paused. */
    128         StartRunning_Yes      /**< Start the VM running. */
     126        LaunchRunning_Default, /**< Default (depends on debug settings). */
     127        LaunchRunning_No,      /**< Start the VM paused. */
     128        LaunchRunning_Yes      /**< Start the VM running. */
    129129    };
    130130
     
    144144     * @{ */
    145145        /** Returns whether VBoxGlobal cleanup is in progress. */
    146         bool isCleaningUp() { return s_fCleanupInProgress; }
     146        bool isCleaningUp() { return s_fCleaningUp; }
    147147
    148148        /** Returns Qt runtime version string. */
     
    156156
    157157        /** Returns whether VBoxGlobal instance is properly initialized. */
    158         bool isValid() { return mValid; }
     158        bool isValid() { return m_fValid; }
    159159
    160160        /** Returns VBox version string. */
     
    169169        static MacOSXRelease determineOsRelease();
    170170        /** Mac OS X: Returns #MacOSXRelease determined during VBoxGlobal prepare routine. */
    171         MacOSXRelease osRelease() const { return m_osRelease; }
     171        MacOSXRelease osRelease() const { return m_enmMacOSVersion; }
    172172#endif /* VBOX_WS_MAC */
    173173
     
    180180
    181181        /** Returns whether branding is active. */
    182         bool brandingIsActive (bool aForce = false);
     182        bool brandingIsActive (bool fForce = false);
    183183        /** Returns value for certain branding @a strKey from custom.ini file. */
    184         QString brandingGetKey (QString aKey);
     184        QString brandingGetKey (QString strKey);
    185185    /** @} */
    186186
     
    194194
    195195        /** Returns the URL arguments list. */
    196         QList<QUrl> &argUrlList() { return m_ArgUrlList; }
     196        QList<QUrl> &argUrlList() { return m_listArgUrls; }
    197197
    198198        /** Returns the --startvm option value (managed VM id). */
    199         QString managedVMUuid() const { return vmUuid; }
     199        QString managedVMUuid() const { return m_strManagedVMId; }
    200200        /** Returns whether this is VM console process. */
    201         bool isVMConsoleProcess() const { return !vmUuid.isNull(); }
     201        bool isVMConsoleProcess() const { return !m_strManagedVMId.isNull(); }
    202202        /** Returns the --separate option value (whether GUI process is separate from VM process). */
    203203        bool isSeparateProcess() const { return m_fSeparateProcess; }
    204204        /** Returns the --no-startvm-errormsgbox option value (whether startup VM errors are disabled). */
    205         bool showStartVMErrors() const { return mShowStartVMErrors; }
     205        bool showStartVMErrors() const { return m_fShowStartVMErrors; }
    206206
    207207        /** Returns the --aggressive-caching / --no-aggressive-caching option value (whether medium-enumeration is required). */
    208         bool agressiveCaching() const { return mAgressiveCaching; }
     208        bool agressiveCaching() const { return m_fAgressiveCaching; }
    209209
    210210        /** Returns the --restore-current option value (whether we should restore current snapshot before VM started). */
    211         bool shouldRestoreCurrentSnapshot() const { return mRestoreCurrentSnapshot; }
     211        bool shouldRestoreCurrentSnapshot() const { return m_fRestoreCurrentSnapshot; }
    212212        /** Defines whether we should fRestore current snapshot before VM started. */
    213         void setShouldRestoreCurrentSnapshot(bool fRestore) { mRestoreCurrentSnapshot = fRestore; }
     213        void setShouldRestoreCurrentSnapshot(bool fRestore) { m_fRestoreCurrentSnapshot = fRestore; }
    214214
    215215        /** Returns the --fda option value (whether we have floppy image). */
     
    223223
    224224        /** Returns the --disable-patm option value. */
    225         bool isPatmDisabled() const { return mDisablePatm; }
     225        bool isPatmDisabled() const { return m_fDisablePatm; }
    226226        /** Returns the --disable-csam option value. */
    227         bool isCsamDisabled() const { return mDisableCsam; }
     227        bool isCsamDisabled() const { return m_fDisableCsam; }
    228228        /** Returns the --recompile-supervisor option value. */
    229         bool isSupervisorCodeExecedRecompiled() const { return mRecompileSupervisor; }
     229        bool isSupervisorCodeExecedRecompiled() const { return m_fRecompileSupervisor; }
    230230        /** Returns the --recompile-user option value. */
    231         bool isUserCodeExecedRecompiled()       const { return mRecompileUser; }
     231        bool isUserCodeExecedRecompiled()       const { return m_fRecompileUser; }
    232232        /** Returns the --execute-all-in-iem option value. */
    233         bool areWeToExecuteAllInIem()           const { return mExecuteAllInIem; }
     233        bool areWeToExecuteAllInIem()           const { return m_fExecuteAllInIem; }
    234234        /** Returns whether --warp-factor option value is equal to 100. */
    235         bool isDefaultWarpPct() const { return mWarpPct == 100; }
     235        bool isDefaultWarpPct() const { return m_uWarpPct == 100; }
    236236        /** Returns the --warp-factor option value. */
    237         uint32_t getWarpPct()       const { return mWarpPct; }
     237        uint32_t getWarpPct()       const { return m_uWarpPct; }
    238238
    239239#ifdef VBOX_WITH_DEBUGGER_GUI
     
    294294          * @param  strLangId  Brings the language ID in in form of xx_YY.
    295295          *                    QString() means the system default language. */
    296         static void loadLanguage (const QString &aLangId = QString::null);
     296        static void loadLanguage (const QString &strLangId = QString());
    297297
    298298        /** Returns tr("%n year(s)"). */
     
    314314        static QString sizeRegexp();
    315315        /** Parses the given size strText and returns the size value in bytes. */
    316         static quint64 parseSize (const QString &);
     316        static quint64 parseSize (const QString &strText);
    317317        /** Formats the given @a uSize value in bytes to a human readable string.
    318318          * @param  uSize     Brings the size value in bytes.
    319319          * @param  enmMode   Brings the conversion mode.
    320320          * @param  cDecimal  Brings the number of decimal digits in result. */
    321         static QString formatSize (quint64 aSize, uint aDecimal = 2, FormatSize aMode = FormatSize_Round);
     321        static QString formatSize (quint64 uSize, uint cDecimal = 2, FormatSize enmMode = FormatSize_Round);
    322322
    323323        /** Returns full medium-format name for the given @a strBaseMediumFormatName. */
     
    328328        /** Returns the name of the standard COM port corresponding to the given parameters,
    329329          * or "User-defined" (which is also returned when both @a uIRQ and @a uIOBase are 0). */
    330         QString toCOMPortName (ulong aIRQ, ulong aIOBase) const;
     330        QString toCOMPortName (ulong uIRQ, ulong uIOBase) const;
    331331        /** Returns port parameters corresponding to the given standard COM name.
    332332          * Returns @c true on success, or @c false if the given port name is not one of the standard names (i.e. "COMx"). */
    333         bool toCOMPortNumbers (const QString &aName, ulong &aIRQ, ulong &aIOBase) const;
     333        bool toCOMPortNumbers (const QString &strName, ulong &uIRQ, ulong &uIOBase) const;
    334334        /** Returns the list of the standard LPT port names (i.e. "LPTx"). */
    335335        QStringList LPTPortNames() const;
    336336        /** Returns the name of the standard LPT port corresponding to the given parameters,
    337337          * or "User-defined" (which is also returned when both @a uIRQ and @a uIOBase are 0). */
    338         QString toLPTPortName (ulong aIRQ, ulong aIOBase) const;
     338        QString toLPTPortName (ulong uIRQ, ulong uIOBase) const;
    339339        /** Returns port parameters corresponding to the given standard LPT name.
    340340          * Returns @c true on success, or @c false if the given port name is not one of the standard names (i.e. "LPTx"). */
    341         bool toLPTPortNumbers (const QString &aName, ulong &aIRQ, ulong &aIOBase) const;
     341        bool toLPTPortNumbers (const QString &strName, ulong &uIRQ, ulong &uIOBase) const;
    342342
    343343        /** Reformats the input @a strText to highlight it. */
    344         static QString highlight (const QString &aStr, bool aToolTip = false);
     344        static QString highlight (const QString &strText, bool fToolTip = false);
    345345        /** Reformats the input @a strText to emphasize it. */
    346         static QString emphasize (const QString &aStr);
     346        static QString emphasize (const QString &strText);
    347347        /** Removes the first occurrence of the accelerator mark (the ampersand symbol) from the given @a strText. */
    348         static QString removeAccelMark (const QString &aText);
     348        static QString removeAccelMark (const QString &strText);
    349349        /** Inserts a passed @a strKey into action @a strText. */
    350         static QString insertKeyToActionText (const QString &aText, const QString &aKey);
     350        static QString insertKeyToActionText (const QString &strText, const QString &strKey);
    351351    /** @} */
    352352
     
    363363     * @{ */
    364364        /** Search position for @a rectangle to make sure it is fully contained @a boundRegion. */
    365         static QRect normalizeGeometry (const QRect &aRectangle, const QRegion &aBoundRegion,
    366                                         bool aCanResize = true);
     365        static QRect normalizeGeometry (const QRect &rectangle, const QRegion &boundRegion,
     366                                        bool fCanResize = true);
    367367        /** Ensures that the given rectangle @a rectangle is fully contained within the region @a boundRegion. */
    368         static QRect getNormalized (const QRect &aRectangle, const QRegion &aBoundRegion,
    369                                     bool aCanResize = true);
     368        static QRect getNormalized (const QRect &rectangle, const QRegion &boundRegion,
     369                                    bool fCanResize = true);
    370370        /** Returns the flipped (transposed) @a region. */
    371         static QRegion flip (const QRegion &aRegion);
     371        static QRegion flip (const QRegion &region);
    372372
    373373        /** Aligns the center of @a pWidget with the center of @a pRelative. */
    374         static void centerWidget (QWidget *aWidget, QWidget *aRelative,
    375                                   bool aCanResize = true);
     374        static void centerWidget (QWidget *pWidget, QWidget *pRelative,
     375                                  bool fCanResize = true);
    376376
    377377        /** Assigns top-level @a pWidget geometry passed as QRect coordinates.
     
    383383
    384384        /** Activates the specified window with given @a wId. Can @a fSwitchDesktop if requested. */
    385         static bool activateWindow (WId aWId, bool aSwitchDesktop = true);
     385        static bool activateWindow (WId wId, bool fSwitchDesktop = true);
    386386
    387387#ifdef VBOX_WS_X11
     
    418418
    419419        /** Returns the copy of VirtualBox client wrapper. */
    420         CVirtualBoxClient virtualBoxClient() const { return m_client; }
     420        CVirtualBoxClient virtualBoxClient() const { return m_comVBoxClient; }
    421421        /** Returns the copy of VirtualBox object wrapper. */
    422         CVirtualBox virtualBox() const { return m_vbox; }
     422        CVirtualBox virtualBox() const { return m_comVBox; }
    423423        /** Returns the copy of VirtualBox host-object wrapper. */
    424         CHost host() const { return m_host; }
     424        CHost host() const { return m_comHost; }
    425425        /** Returns the symbolic VirtualBox home-folder representation. */
    426426        QString homeFolder() const { return m_strHomeFolder; }
     
    437437        /** Returns the list of all guest OS types, queried from
    438438          * IVirtualBox corresponding to passed family id. */
    439         QList <CGuestOSType> vmGuestOSTypeList (const QString &aFamilyId) const;
     439        QList <CGuestOSType> vmGuestOSTypeList (const QString &strFamilyId) const;
    440440
    441441        /** Returns the guest OS type object corresponding to the given type id of list
    442442          * containing OS types related to OS family determined by family id attribute.
    443443          * If the index is invalid a null object is returned. */
    444         CGuestOSType vmGuestOSType (const QString &aTypeId,
    445                                     const QString &aFamilyId = QString::null) const;
     444        CGuestOSType vmGuestOSType (const QString &strTypeId,
     445                                    const QString &strFamilyId = QString()) const;
    446446        /** Returns the description corresponding to the given guest OS type id. */
    447         QString vmGuestOSTypeDescription (const QString &aTypeId) const;
     447        QString vmGuestOSTypeDescription (const QString &strTypeId) const;
    448448
    449449        /** Returns whether guest type with passed @a strOSTypeId is one of DOS types. */
    450         static bool isDOSType (const QString &aOSTypeId);
     450        static bool isDOSType (const QString &strOSTypeId);
    451451    /** @} */
    452452
     
    454454     * @{ */
    455455        /** Switches to certain @a comMachine. */
    456         bool switchToMachine(CMachine &machine);
     456        bool switchToMachine(CMachine &comMachine);
    457457        /** Launches certain @a comMachine in specified @a enmLaunchMode. */
    458         bool launchMachine(CMachine &machine, LaunchMode enmLaunchMode = LaunchMode_Default);
     458        bool launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode = LaunchMode_Default);
    459459
    460460        /** Opens session of certain @a enmLockType for VM with certain @a strId. */
    461         CSession openSession(const QString &aId, KLockType aLockType = KLockType_Write);
     461        CSession openSession(const QString &strId, KLockType enmLockType = KLockType_Write);
    462462        /** Opens session of KLockType_Shared type for VM with certain @a strId. */
    463         CSession openExistingSession(const QString &aId) { return openSession(aId, KLockType_Shared); }
     463        CSession openExistingSession(const QString &strId) { return openSession(strId, KLockType_Shared); }
    464464    /** @} */
    465465
     
    484484        QList<QString> mediumIDs() const;
    485485        /** Creates medium on the basis of passed @a guiMedium description. */
    486         void createMedium(const UIMedium &medium);
     486        void createMedium(const UIMedium &guiMedium);
    487487        /** Deletes medium with certain @a strMediumID. */
    488488        void deleteMedium(const QString &strMediumID);
     
    493493          * @param  strMediumLocation  Brings the file path to load medium from.
    494494          * @param  pParent            Brings the dialog parent. */
    495         QString openMedium(UIMediumType mediumType, QString strMediumLocation, QWidget *pParent = 0);
     495        QString openMedium(UIMediumType enmMediumType, QString strMediumLocation, QWidget *pParent = 0);
    496496
    497497        /** Opens external medium using file-open dialog.
     
    500500          * @param  strDefaultFolder  Brings the folder to browse for medium.
    501501          * @param  fUseLastFolder    Brings whether we should propose to use last used folder. */
    502         QString openMediumWithFileOpenDialog(UIMediumType mediumType, QWidget *pParent = 0,
     502        QString openMediumWithFileOpenDialog(UIMediumType enmMediumType, QWidget *pParent = 0,
    503503                                             const QString &strDefaultFolder = QString(), bool fUseLastFolder = true);
    504504
     
    506506          * @param  pParent    Brings the dialog parent.
    507507          * @param  strFolder  Brings the folder to browse for VISO file contents. */
    508         QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strMachineFolder);
     508        QString createVisoMediumWithFileOpenDialog(QWidget *pParent, const QString &strFolder);
    509509
    510510        /** Prepares storage menu according passed parameters.
     
    512512          * @param  pListener          Brings the listener #QObject, this @a menu being prepared for.
    513513          * @param  pszSlotName        Brings the name of the SLOT in the @a pListener above, this menu will be handled with.
    514           * @param  machine            Brings the #CMachine object, this @a menu being prepared for.
     514          * @param  comMachine         Brings the #CMachine object, this @a menu being prepared for.
    515515          * @param  strControllerName  Brings the name of the #CStorageController in the @a machine above.
    516516          * @param  storageSlot        Brings the #StorageSlot of the storage controller with @a strControllerName above. */
    517517        void prepareStorageMenu(QMenu &menu,
    518518                                QObject *pListener, const char *pszSlotName,
    519                                 const CMachine &machine, const QString &strControllerName, const StorageSlot &storageSlot);
     519                                const CMachine &comMachine, const QString &strControllerName, const StorageSlot &storageSlot);
    520520        /** Updates @a comConstMachine storage with data described by @a target. */
    521         void updateMachineStorage(const CMachine &constMachine, const UIMediumTarget &target);
     521        void updateMachineStorage(const CMachine &comConstMachine, const UIMediumTarget &target);
    522522
    523523        /** Generates details for passed @a comMedium.
    524524          * @param  fPredictDiff  Brings whether medium will be marked differencing on attaching.
    525525          * @param  fUseHtml      Brings whether HTML subsets should be used in the generated output. */
    526         QString details(const CMedium &medium, bool fPredictDiff, bool fUseHtml = true);
     526        QString details(const CMedium &comMedium, bool fPredictDiff, bool fUseHtml = true);
    527527    /** @} */
    528528
     
    535535
    536536        /** Generates details for passed USB @a comDevice. */
    537         QString details (const CUSBDevice &aDevice) const;
     537        QString details(const CUSBDevice &comDevice) const;
    538538        /** Generates tool-tip for passed USB @a comDevice. */
    539         QString toolTip (const CUSBDevice &aDevice) const;
     539        QString toolTip(const CUSBDevice &comDevice) const;
    540540        /** Generates tool-tip for passed USB @a comFilter. */
    541         QString toolTip (const CUSBDeviceFilter &aFilter) const;
     541        QString toolTip(const CUSBDeviceFilter &comFilter) const;
    542542        /** Generates tool-tip for passed USB @a comWebcam. */
    543         QString toolTip(const CHostVideoInputDevice &webcam) const;
     543        QString toolTip(const CHostVideoInputDevice &comWebcam) const;
    544544    /** @} */
    545545
     
    598598
    599599        /** Returns default icon of certain @a enmType. */
    600         QIcon icon(QFileIconProvider::IconType type) { return m_globalIconProvider.icon(type); }
     600        QIcon icon(QFileIconProvider::IconType enmType) { return m_fileIconProvider.icon(enmType); }
    601601        /** Returns file icon fetched from passed file @a info. */
    602         QIcon icon(const QFileInfo &info) { return m_globalIconProvider.icon(info); }
     602        QIcon icon(const QFileInfo &info) { return m_fileIconProvider.icon(info); }
    603603
    604604        /** Returns cached default warning pixmap. */
    605         QPixmap warningIcon() const { return mWarningIcon; }
     605        QPixmap warningIcon() const { return m_pixWarning; }
    606606        /** Returns cached default error pixmap. */
    607         QPixmap errorIcon() const { return mErrorIcon; }
     607        QPixmap errorIcon() const { return m_pixError; }
    608608
    609609        /** Joins two pixmaps horizontally with 2px space between them and returns the result. */
    610         static QPixmap joinPixmaps (const QPixmap &aPM1, const QPixmap &aPM2);
     610        static QPixmap joinPixmaps (const QPixmap &pixmap1, const QPixmap &pixmap2);
    611611    /** @} */
    612612
     
    616616     * @{ */
    617617        /** Opens the specified URL using OS/Desktop capabilities. */
    618         bool openURL (const QString &aURL);
     618        bool openURL (const QString &strURL);
    619619    /** @} */
    620620
     
    622622     * @{ */
    623623        /** Handles language change to new @a strLanguage. */
    624         void sltGUILanguageChange(QString strLang);
     624        void sltGUILanguageChange(QString strLanguage);
    625625    /** @} */
    626626
     
    628628
    629629    /** Preprocesses any Qt @a pEvent for passed @a pObject. */
    630     bool eventFilter (QObject *, QEvent *);
     630    bool eventFilter (QObject *pObject, QEvent *pEvent);
    631631
    632632    /** Handles translation event. */
     
    705705     * @{ */
    706706        /** Holds whether VBoxGlobal cleanup is in progress. */
    707         static bool        s_fCleanupInProgress;
     707        static bool        s_fCleaningUp;
    708708
    709709        /** Holds the currently loaded language ID. */
     
    716716
    717717        /** Holds whether VBoxGlobal instance is properly initialized. */
    718         bool mValid;
     718        bool m_fValid;
    719719
    720720#ifdef VBOX_WS_MAC
    721721        /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */
    722         MacOSXRelease m_osRelease;
     722        MacOSXRelease m_enmMacOSVersion;
    723723#endif /* VBOX_WS_MAC */
    724724
     
    731731
    732732        /** Holds the VBox branding config file path. */
    733         QString mBrandingConfig;
     733        QString m_strBrandingConfigFilePath;
    734734    /** @} */
    735735
     
    737737     * @{ */
    738738        /** Holds the URL arguments list. */
    739         QList<QUrl> m_ArgUrlList;
     739        QList<QUrl> m_listArgUrls;
    740740
    741741        /** Holds the --startvm option value (managed VM id). */
    742         QString vmUuid;
     742        QString m_strManagedVMId;
    743743        /** Holds the --separate option value (whether GUI process is separate from VM process). */
    744744        bool m_fSeparateProcess;
    745745        /** Holds the --no-startvm-errormsgbox option value (whether startup VM errors are disabled). */
    746         bool mShowStartVMErrors;
     746        bool m_fShowStartVMErrors;
    747747
    748748        /** Holds the --aggressive-caching / --no-aggressive-caching option value (whether medium-enumeration is required). */
    749         bool mAgressiveCaching;
     749        bool m_fAgressiveCaching;
    750750
    751751        /** Holds the --restore-current option value. */
    752         bool mRestoreCurrentSnapshot;
     752        bool m_fRestoreCurrentSnapshot;
    753753
    754754        /** Holds the --fda option value (floppy image). */
     
    758758
    759759        /** Holds the --disable-patm option value. */
    760         bool mDisablePatm;
     760        bool m_fDisablePatm;
    761761        /** Holds the --disable-csam option value. */
    762         bool mDisableCsam;
     762        bool m_fDisableCsam;
    763763        /** Holds the --recompile-supervisor option value. */
    764         bool mRecompileSupervisor;
     764        bool m_fRecompileSupervisor;
    765765        /** Holds the --recompile-user option value. */
    766         bool mRecompileUser;
     766        bool m_fRecompileUser;
    767767        /** Holds the --execute-all-in-iem option value. */
    768         bool mExecuteAllInIem;
     768        bool m_fExecuteAllInIem;
    769769        /** Holds the --warp-factor option value. */
    770         uint32_t mWarpPct;
     770        uint32_t m_uWarpPct;
    771771
    772772#ifdef VBOX_WITH_DEBUGGER_GUI
     
    783783
    784784        /** Holds whether --start-running, --start-paused or nothing was given. */
    785         enum StartRunning m_enmStartRunning;
     785        enum LaunchRunning m_enmLaunchRunning;
    786786#endif
    787787
    788788        /** Holds the --settingspw option value. */
    789         char mSettingsPw[256];
     789        char m_astrSettingsPw[256];
    790790        /** Holds the --settingspwfile option value. */
    791         bool mSettingsPwSet;
     791        bool m_fSettingsPwSet;
    792792
    793793#ifdef VBOX_GUI_WITH_PIDFILE
    794794        /** Holds the --pidfile option value (application PID file path). */
    795         QString m_strPidfile;
     795        QString m_strPidFile;
    796796#endif
    797797
    798798        /** @todo remove */
    799         QString mUserDefinedPortName;
     799        QString m_strUserDefinedPortName;
    800800    /** @} */
    801801
     
    806806
    807807        /** Holds the instance of VirtualBox client wrapper. */
    808         CVirtualBoxClient m_client;
     808        CVirtualBoxClient m_comVBoxClient;
    809809        /** Holds the copy of VirtualBox object wrapper. */
    810         CVirtualBox m_vbox;
     810        CVirtualBox m_comVBox;
    811811        /** Holds the copy of VirtualBox host-object wrapper. */
    812         CHost m_host;
     812        CHost m_comHost;
    813813        /** Holds the symbolic VirtualBox home-folder representation. */
    814814        QString m_strHomeFolder;
     
    828828     * @{ */
    829829        /** Holds whether 3D is available. */
    830         int m3DAvailable;
     830        int m_i3DAvailable;
    831831    /** @} */
    832832
     
    843843
    844844        /** Holds the global file icon provider instance. */
    845         QFileIconProvider m_globalIconProvider;
     845        QFileIconProvider m_fileIconProvider;
    846846
    847847        /** Holds the warning pixmap. */
    848         QPixmap mWarningIcon;
     848        QPixmap m_pixWarning;
    849849        /** Holds the error pixmap. */
    850         QPixmap mErrorIcon;
     850        QPixmap m_pixError;
    851851    /** @} */
    852852
     
    854854     * @{ */
    855855        /** Holds the medium enumerator cleanup protection token. */
    856         mutable QReadWriteLock m_mediumEnumeratorDtorRwLock;
     856        mutable QReadWriteLock m_meCleanupProtectionToken;
    857857
    858858        /** Holds the medium enumerator. */
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