Changeset 90965 in vbox for trunk/src/VBox
- Timestamp:
- Aug 27, 2021 7:30:44 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146604
- 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 991 991 } 992 992 993 bool 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 1007 QString UICommon::brandingGetKey(QString strKey) const 1008 { 1009 QSettings settings(m_strBrandingConfigFilePath, QSettings::IniFormat); 1010 return settings.value(QString("%1").arg(strKey)).toString(); 1011 } 1012 993 1013 #ifdef VBOX_WS_MAC 994 1014 /* static */ … … 1018 1038 } 1019 1039 #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 }1040 1040 1041 1041 bool UICommon::processArgs() -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r90941 r90965 161 161 static void destroy(); 162 162 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. 164 175 * @{ */ 165 176 /** Returns Qt runtime version string. */ … … 179 190 static uint qtCTVersion(); 180 191 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 189 192 /** Returns VBox version string. */ 190 193 QString vboxVersionString() const; … … 194 197 bool isBeta() const; 195 198 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 * @{ */ 196 207 #ifdef VBOX_WS_MAC 197 208 /** Mac OS X: Returns #MacOSXRelease determined by <i>uname</i> call. */ … … 207 218 X11WMType typeOfWindowManager() const { return m_enmWindowManagerType; } 208 219 #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);214 220 /** @} */ 215 221 … … 826 832 static UICommon *s_pInstance; 827 833 828 /** @name Commonstuff.834 /** @name General stuff. 829 835 * @{ */ 830 836 /** Holds the tr("User Defined") port name. */ … … 838 844 /** Holds whether UICommon instance cleanup is in progress. */ 839 845 bool m_fCleaningUp; 840 841 846 #ifdef VBOX_WS_WIN 842 847 /** Holds whether overall GUI data is committed. */ 843 848 bool m_fDataCommitted; 844 849 #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 * @{ */ 846 860 #ifdef VBOX_WS_MAC 847 861 /** Mac OS X: Holds the #MacOSXRelease determined using <i>uname</i> call. */ … … 855 869 bool m_fCompositingManagerRunning; 856 870 #endif 857 858 /** Holds the VBox branding config file path. */859 QString m_strBrandingConfigFilePath;860 871 /** @} */ 861 872
Note:
See TracChangeset
for help on using the changeset viewer.