VirtualBox

Changeset 90965 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Aug 27, 2021 7:30:44 PM (4 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
146604
Message:

FE/Qt: bugref:10067: UICommon: A bit of rework for general, versioning and native stuff.

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

Legend:

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

    r90941 r90965  
    991991}
    992992
     993bool UICommon::brandingIsActive(bool fForce /* = false */)
     994{
     995    if (fForce)
     996        return true;
     997
     998    if (m_strBrandingConfigFilePath.isEmpty())
     999    {
     1000        m_strBrandingConfigFilePath = QDir(QApplication::applicationDirPath()).absolutePath();
     1001        m_strBrandingConfigFilePath += "/custom/custom.ini";
     1002    }
     1003
     1004    return QFile::exists(m_strBrandingConfigFilePath);
     1005}
     1006
     1007QString UICommon::brandingGetKey(QString strKey) const
     1008{
     1009    QSettings settings(m_strBrandingConfigFilePath, QSettings::IniFormat);
     1010    return settings.value(QString("%1").arg(strKey)).toString();
     1011}
     1012
    9931013#ifdef VBOX_WS_MAC
    9941014/* static */
     
    10181038}
    10191039#endif /* VBOX_WS_MAC */
    1020 
    1021 bool UICommon::brandingIsActive(bool fForce /* = false */)
    1022 {
    1023     if (fForce)
    1024         return true;
    1025 
    1026     if (m_strBrandingConfigFilePath.isEmpty())
    1027     {
    1028         m_strBrandingConfigFilePath = QDir(QApplication::applicationDirPath()).absolutePath();
    1029         m_strBrandingConfigFilePath += "/custom/custom.ini";
    1030     }
    1031 
    1032     return QFile::exists(m_strBrandingConfigFilePath);
    1033 }
    1034 
    1035 QString UICommon::brandingGetKey(QString strKey)
    1036 {
    1037     QSettings settings(m_strBrandingConfigFilePath, QSettings::IniFormat);
    1038     return settings.value(QString("%1").arg(strKey)).toString();
    1039 }
    10401040
    10411041bool UICommon::processArgs()
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r90941 r90965  
    161161    static void destroy();
    162162
    163     /** @name Common stuff.
     163    /** @name General stuff.
     164     * @{ */
     165        /** Returns the UI type. */
     166        UIType uiType() const { return m_enmType; }
     167
     168        /** Returns whether UICommon instance is properly initialized. */
     169        bool isValid() const { return m_fValid; }
     170        /** Returns whether UICommon instance cleanup is in progress. */
     171        bool isCleaningUp() const { return m_fCleaningUp; }
     172    /** @} */
     173
     174    /** @name Versioning stuff.
    164175     * @{ */
    165176        /** Returns Qt runtime version string. */
     
    179190        static uint qtCTVersion();
    180191
    181         /** Returns whether UICommon instance is properly initialized. */
    182         bool isValid() const { return m_fValid; }
    183         /** Returns whether UICommon instance cleanup is in progress. */
    184         bool isCleaningUp() const { return m_fCleaningUp; }
    185 
    186         /** Returns the UI type. */
    187         UIType uiType() const { return m_enmType; }
    188 
    189192        /** Returns VBox version string. */
    190193        QString vboxVersionString() const;
     
    194197        bool isBeta() const;
    195198
     199        /** Returns whether branding is active. */
     200        bool brandingIsActive(bool fForce = false);
     201        /** Returns value for certain branding @a strKey from custom.ini file. */
     202        QString brandingGetKey(QString strKey) const;
     203    /** @} */
     204
     205    /** @name Host OS stuff.
     206     * @{ */
    196207#ifdef VBOX_WS_MAC
    197208        /** Mac OS X: Returns #MacOSXRelease determined by <i>uname</i> call. */
     
    207218        X11WMType typeOfWindowManager() const { return m_enmWindowManagerType; }
    208219#endif
    209 
    210         /** Returns whether branding is active. */
    211         bool brandingIsActive(bool fForce = false);
    212         /** Returns value for certain branding @a strKey from custom.ini file. */
    213         QString brandingGetKey(QString strKey);
    214220    /** @} */
    215221
     
    826832    static UICommon *s_pInstance;
    827833
    828     /** @name Common stuff.
     834    /** @name General stuff.
    829835     * @{ */
    830836        /** Holds the tr("User Defined") port name. */
     
    838844        /** Holds whether UICommon instance cleanup is in progress. */
    839845        bool  m_fCleaningUp;
    840 
    841846#ifdef VBOX_WS_WIN
    842847        /** Holds whether overall GUI data is committed. */
    843848        bool  m_fDataCommitted;
    844849#endif
    845 
     850    /** @} */
     851
     852    /** @name Versioning stuff.
     853     * @{ */
     854        /** Holds the VBox branding config file path. */
     855        QString  m_strBrandingConfigFilePath;
     856    /** @} */
     857
     858    /** @name Host OS stuff.
     859     * @{ */
    846860#ifdef VBOX_WS_MAC
    847861        /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */
     
    855869        bool       m_fCompositingManagerRunning;
    856870#endif
    857 
    858         /** Holds the VBox branding config file path. */
    859         QString  m_strBrandingConfigFilePath;
    860871    /** @} */
    861872
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