- Timestamp:
- Apr 4, 2007 10:59:48 AM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxGlobal.h
r1915 r1922 375 375 bool openURL (const QString &aURL); 376 376 377 QString languageID() const;378 377 QString languageName() const; 379 378 QString languageCountry() const; … … 409 408 410 409 static QString highlight (const QString &aStr, bool aToolTip = false); 410 411 static QString systemLanguageID(); 411 412 412 413 static QString getExistingDirectory (const QString &aDir, QWidget *aParent, -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxGlobal.cpp
r1915 r1922 1603 1603 1604 1604 /** 1605 * Shortcut to QLocale::system().name().1606 */1607 QString VBoxGlobal::languageID() const1608 {1609 return QLocale::system().name();1610 }1611 1612 /**1613 1605 * Native language name of the currently installed translation. 1614 1606 * Returns "English [built-in]" if no translation is installed … … 2208 2200 2209 2201 /** 2202 * This does exactly the same as QLocale::system().name() but corrects its 2203 * wrong behavior on Linux systems (LC_NUMERIC for some strange reason takes 2204 * precedence over any other locale setting in the QLocale::system() 2205 * implementation). This implementation first looks at LC_MESSAGES which is 2206 * designed to define a language for program messages in case if it differs 2207 * from the language for other locale categories. Then it looks for LC_ALL, 2208 * then for LANG and finally falls back to QLocale::system().name(). 2209 */ 2210 /* static */ 2211 QString VBoxGlobal::systemLanguageID() 2212 { 2213 #ifdef Q_OS_UNIX 2214 const char *s = getenv ("LC_MESSAGES"); 2215 if (s == 0) 2216 s = getenv ("LC_ALL"); 2217 if (s == 0) 2218 s = getenv ("LANG"); 2219 if (s != 0) 2220 return QLocale (s).name(); 2221 #endif 2222 return QLocale::system().name(); 2223 } 2224 2225 /** 2210 2226 * Reimplementation of QFileDialog::getExistingDirectory() that removes some 2211 2227 * oddities and limitations. … … 2279 2295 bi.lpfn = winGetExistDirCallbackProc; 2280 2296 bi.lParam = Q_ULONG (&mDir); 2281 if (mParent) mParent->setEnabled (false); 2297 2298 /* Qt is uncapable to properly handle modal state if the modal 2299 * window is not a QWidget. For example, if we have the W1->W2->N 2300 * ownership where Wx are QWidgets (W2 is modal), and N is a 2301 * native modal window, cliking on the title bar of W1 will still 2302 * activate W2 and redirect keyboard/mouse to it. The dirty hack 2303 * to prevent it is to disable the entire widget... */ 2304 if (mParent) 2305 mParent->setEnabled (false); 2306 2282 2307 LPITEMIDLIST itemIdList = SHBrowseForFolder (&bi); 2283 2308 if (itemIdList) … … 2297 2322 result = QString::null; 2298 2323 QApplication::postEvent (mTarget, new VBoxGetExistDirectoryEvent (result)); 2299 if (mParent) mParent->setEnabled (true); 2324 2325 /* Enable the parent widget again. */ 2326 if (mParent) 2327 mParent->setEnabled (true); 2300 2328 } 2301 2329 -
trunk/src/VBox/Frontends/VirtualBox/src/main.cpp
r1688 r1922 162 162 /* load a translation based on the current locale */ 163 163 QTranslator translator; 164 QString lang = QLocale::system().name();164 QString lang = VBoxGlobal::systemLanguageID(); 165 165 QString nlsPath = a.applicationDirPath() + "/nls"; 166 166 LogFlowFunc (("lang=%S, nlsPath=\"%S\"\n",
Note:
See TracChangeset
for help on using the changeset viewer.