VirtualBox

Changeset 90967 in vbox


Ignore:
Timestamp:
Aug 27, 2021 8:37:40 PM (3 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10067: Move localization stuff from UICommon to UITranslator.

Location:
trunk/src/VBox/Frontends/VirtualBox/src
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/overview/UIVMActivityOverviewWidget.cpp

    r89094 r90967  
    3232/* GUI includes: */
    3333#include "QIDialogButtonBox.h"
     34#include "QIToolBar.h"
    3435#include "UIActionPoolManager.h"
    3536#include "UICommon.h"
     
    3839#include "UIExtraDataManager.h"
    3940#include "UIIconPool.h"
     41#include "UIMessageCenter.h"
     42#include "UITranslator.h"
     43#include "UIVirtualBoxEventHandler.h"
    4044#include "UIVMActivityMonitor.h"
    4145#include "UIVMActivityOverviewWidget.h"
    42 #include "UIMessageCenter.h"
    43 #include "QIToolBar.h"
    44 #include "UIVirtualBoxEventHandler.h"
    4546
    4647#ifdef VBOX_WS_MAC
     
    634635    if (m_pRAMFreeLabel)
    635636    {
    636         QString strRAM = uiCommon().formatSize(m_hostStats.m_iRAMFree);
     637        QString strRAM = UITranslator::formatSize(m_hostStats.m_iRAMFree);
    637638        QString strColor = QColor(m_RAMFreeColor).name(QColor::HexRgb);
    638639        m_pRAMFreeLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Free")).arg(strRAM));
     
    640641    if (m_pRAMUsedLabel)
    641642    {
    642         QString strRAM = uiCommon().formatSize(m_hostStats.m_iRAMTotal - m_hostStats.m_iRAMFree);
     643        QString strRAM = UITranslator::formatSize(m_hostStats.m_iRAMTotal - m_hostStats.m_iRAMFree);
    643644        QString strColor = QColor(m_RAMUsedColor).name(QColor::HexRgb);
    644645        m_pRAMUsedLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Used")).arg(strRAM));
     
    646647    if (m_pRAMTotalLabel)
    647648    {
    648         QString strRAM = uiCommon().formatSize(m_hostStats.m_iRAMTotal);
     649        QString strRAM = UITranslator::formatSize(m_hostStats.m_iRAMTotal);
    649650        m_pRAMTotalLabel->setText(QString("%1: %2").arg(UIVMActivityOverviewWidget::tr("Total")).arg(strRAM));
    650651    }
     
    653654    if (m_pFSFreeLabel)
    654655    {
    655         QString strFS = uiCommon().formatSize(m_hostStats.m_iFSFree);
     656        QString strFS = UITranslator::formatSize(m_hostStats.m_iFSFree);
    656657        QString strColor = QColor(m_RAMFreeColor).name(QColor::HexRgb);
    657658        m_pFSFreeLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Free")).arg(strFS));
     
    659660    if (m_pFSUsedLabel)
    660661    {
    661         QString strFS = uiCommon().formatSize(m_hostStats.m_iFSTotal - m_hostStats.m_iFSFree);
     662        QString strFS = UITranslator::formatSize(m_hostStats.m_iFSTotal - m_hostStats.m_iFSFree);
    662663        QString strColor = QColor(m_RAMUsedColor).name(QColor::HexRgb);
    663664        m_pFSUsedLabel->setText(QString("<font color=\"%1\">%2: %3</font>").arg(strColor).arg(UIVMActivityOverviewWidget::tr("Used")).arg(strFS));
     
    665666    if (m_pFSTotalLabel)
    666667    {
    667         QString strFS = uiCommon().formatSize(m_hostStats.m_iFSTotal);
     668        QString strFS = UITranslator::formatSize(m_hostStats.m_iFSTotal);
    668669        m_pFSTotalLabel->setText(QString("%1: %2").arg(UIVMActivityOverviewWidget::tr("Total")).arg(strFS));
    669670    }
     
    11781179        if (m_itemList[i].isWithGuestAdditions())
    11791180            m_itemList[i].m_columnData[VMActivityOverviewColumn_RAMUsedAndTotal] =
    1180                 QString("%1/%2").arg(uiCommon().formatSize(_1K * m_itemList[i].m_uUsedRAM, iDecimalCount)).
    1181                 arg(uiCommon().formatSize(_1K * m_itemList[i].m_uTotalRAM, iDecimalCount));
     1181                QString("%1/%2").arg(UITranslator::formatSize(_1K * m_itemList[i].m_uUsedRAM, iDecimalCount)).
     1182                arg(UITranslator::formatSize(_1K * m_itemList[i].m_uTotalRAM, iDecimalCount));
    11821183        else
    11831184            m_itemList[i].m_columnData[VMActivityOverviewColumn_RAMUsedAndTotal] = UIVMActivityOverviewWidget::tr("N/A");
     
    11901191
    11911192        m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkUpRate] =
    1192             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkUpRate, iDecimalCount));
     1193            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uNetworkUpRate, iDecimalCount));
    11931194
    11941195        m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkDownRate] =
    1195             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkDownRate, iDecimalCount));
     1196            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uNetworkDownRate, iDecimalCount));
    11961197
    11971198        m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkUpTotal] =
    1198             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkUpTotal, iDecimalCount));
     1199            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uNetworkUpTotal, iDecimalCount));
    11991200
    12001201        m_itemList[i].m_columnData[VMActivityOverviewColumn_NetworkDownTotal] =
    1201             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uNetworkDownTotal, iDecimalCount));
     1202            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uNetworkDownTotal, iDecimalCount));
    12021203
    12031204        m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOReadRate] =
    1204             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskReadRate, iDecimalCount));
     1205            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uDiskReadRate, iDecimalCount));
    12051206
    12061207        m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOWriteRate] =
    1207             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskWriteRate, iDecimalCount));
     1208            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uDiskWriteRate, iDecimalCount));
    12081209
    12091210        m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOReadTotal] =
    1210             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskReadTotal, iDecimalCount));
     1211            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uDiskReadTotal, iDecimalCount));
    12111212
    12121213        m_itemList[i].m_columnData[VMActivityOverviewColumn_DiskIOWriteTotal] =
    1213             QString("%1").arg(uiCommon().formatSize(m_itemList[i].m_uDiskWriteTotal, iDecimalCount));
     1214            QString("%1").arg(UITranslator::formatSize(m_itemList[i].m_uDiskWriteTotal, iDecimalCount));
    12141215
    12151216        m_itemList[i].m_columnData[VMActivityOverviewColumn_VMExits] =
    1216             QString("%1/%2").arg(UICommon::addMetricSuffixToNumber(m_itemList[i].m_uVMExitRate)).
    1217             arg(UICommon::addMetricSuffixToNumber(m_itemList[i].m_uVMExitTotal));
     1217            QString("%1/%2").arg(UITranslator::addMetricSuffixToNumber(m_itemList[i].m_uVMExitRate)).
     1218            arg(UITranslator::addMetricSuffixToNumber(m_itemList[i].m_uVMExitTotal));
    12181219    }
    12191220
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp

    r89093 r90967  
    3232#include "UICommon.h"
    3333#include "UIIconPool.h"
     34#include "UITranslator.h"
    3435#include "UIVMActivityMonitor.h"
    3536#include "UIVirtualBoxEventHandler.h"
     
    521522        return QString::number(iValue);
    522523    else if (m_pMetric->unit().compare("kb", Qt::CaseInsensitive) == 0)
    523         return uiCommon().formatSize(_1K * (quint64)iValue, g_iDecimalCount);
     524        return UITranslator::formatSize(_1K * (quint64)iValue, g_iDecimalCount);
    524525    else if (m_pMetric->unit().compare("b", Qt::CaseInsensitive) == 0 ||
    525526             m_pMetric->unit().compare("b/s", Qt::CaseInsensitive) == 0)
    526         return uiCommon().formatSize(iValue, g_iDecimalCount);
     527        return UITranslator::formatSize(iValue, g_iDecimalCount);
    527528    else if (m_pMetric->unit().compare("times", Qt::CaseInsensitive) == 0)
    528         return UICommon::addMetricSuffixToNumber(iValue);
     529        return UITranslator::addMetricSuffixToNumber(iValue);
    529530    return QString();
    530531}
     
    13341335    {
    13351336        QString strInfo;
    1336         strInfo = QString("<b>%1</b><br/>%2: %3<br/>%4: %5<br/>%6: %7").arg(m_strRAMInfoLabelTitle).arg(m_strRAMInfoLabelTotal).arg(uiCommon().formatSize(_1K * iTotalRAM, g_iDecimalCount))
    1337             .arg(m_strRAMInfoLabelFree).arg(uiCommon().formatSize(_1K * (iFreeRAM), g_iDecimalCount))
    1338             .arg(m_strRAMInfoLabelUsed).arg(uiCommon().formatSize(_1K * (iTotalRAM - iFreeRAM), g_iDecimalCount));
     1337        strInfo = QString("<b>%1</b><br/>%2: %3<br/>%4: %5<br/>%6: %7").arg(m_strRAMInfoLabelTitle).arg(m_strRAMInfoLabelTotal).arg(UITranslator::formatSize(_1K * iTotalRAM, g_iDecimalCount))
     1338            .arg(m_strRAMInfoLabelFree).arg(UITranslator::formatSize(_1K * (iFreeRAM), g_iDecimalCount))
     1339            .arg(m_strRAMInfoLabelUsed).arg(UITranslator::formatSize(_1K * (iTotalRAM - iFreeRAM), g_iDecimalCount));
    13391340        m_infoLabels[m_strRAMMetricName]->setText(strInfo);
    13401341    }
     
    13671368        strInfo = QString("<b>%1</b></b><br/><font color=\"%2\">%3: %4<br/>%5 %6</font><br/><font color=\"%7\">%8: %9<br/>%10 %11</font>")
    13681369            .arg(m_strNetworkInfoLabelTitle)
    1369             .arg(dataColorString(m_strNetworkMetricName, 0)).arg(m_strNetworkInfoLabelReceived).arg(uiCommon().formatSize((quint64)iReceiveRate, g_iDecimalCount))
    1370             .arg(m_strNetworkInfoLabelReceivedTotal).arg(uiCommon().formatSize((quint64)iReceiveTotal, g_iDecimalCount))
    1371             .arg(dataColorString(m_strNetworkMetricName, 1)).arg(m_strNetworkInfoLabelTransmitted).arg(uiCommon().formatSize((quint64)iTransmitRate, g_iDecimalCount))
    1372             .arg(m_strNetworkInfoLabelTransmittedTotal).arg(uiCommon().formatSize((quint64)iTransmitTotal, g_iDecimalCount));
     1370            .arg(dataColorString(m_strNetworkMetricName, 0)).arg(m_strNetworkInfoLabelReceived).arg(UITranslator::formatSize((quint64)iReceiveRate, g_iDecimalCount))
     1371            .arg(m_strNetworkInfoLabelReceivedTotal).arg(UITranslator::formatSize((quint64)iReceiveTotal, g_iDecimalCount))
     1372            .arg(dataColorString(m_strNetworkMetricName, 1)).arg(m_strNetworkInfoLabelTransmitted).arg(UITranslator::formatSize((quint64)iTransmitRate, g_iDecimalCount))
     1373            .arg(m_strNetworkInfoLabelTransmittedTotal).arg(UITranslator::formatSize((quint64)iTransmitTotal, g_iDecimalCount));
    13731374        m_infoLabels[m_strNetworkMetricName]->setText(strInfo);
    13741375    }
     
    14651466        QString strInfo = QString("<b>%1</b></b><br/><font color=\"%2\">%3: %4<br/>%5 %6</font><br/><font color=\"%7\">%8: %9<br/>%10 %11</font>")
    14661467            .arg(m_strDiskIOInfoLabelTitle)
    1467             .arg(dataColorString(m_strDiskIOMetricName, 0)).arg(m_strDiskIOInfoLabelWritten).arg(uiCommon().formatSize((quint64)iWriteRate, g_iDecimalCount))
    1468             .arg(m_strDiskIOInfoLabelWrittenTotal).arg(uiCommon().formatSize((quint64)uDiskIOTotalWritten, g_iDecimalCount))
    1469             .arg(dataColorString(m_strDiskIOMetricName, 1)).arg(m_strDiskIOInfoLabelRead).arg(uiCommon().formatSize((quint64)iReadRate, g_iDecimalCount))
    1470             .arg(m_strDiskIOInfoLabelReadTotal).arg(uiCommon().formatSize((quint64)uDiskIOTotalRead, g_iDecimalCount));
     1468            .arg(dataColorString(m_strDiskIOMetricName, 0)).arg(m_strDiskIOInfoLabelWritten).arg(UITranslator::formatSize((quint64)iWriteRate, g_iDecimalCount))
     1469            .arg(m_strDiskIOInfoLabelWrittenTotal).arg(UITranslator::formatSize((quint64)uDiskIOTotalWritten, g_iDecimalCount))
     1470            .arg(dataColorString(m_strDiskIOMetricName, 1)).arg(m_strDiskIOInfoLabelRead).arg(UITranslator::formatSize((quint64)iReadRate, g_iDecimalCount))
     1471            .arg(m_strDiskIOInfoLabelReadTotal).arg(UITranslator::formatSize((quint64)uDiskIOTotalRead, g_iDecimalCount));
    14711472        m_infoLabels[m_strDiskIOMetricName]->setText(strInfo);
    14721473    }
     
    14951496        strInfo = QString("<b>%1</b></b><br/>%2: %3 %4<br/>%5: %6 %7")
    14961497            .arg(m_strVMExitInfoLabelTitle)
    1497             .arg(m_strVMExitLabelCurrent).arg(UICommon::addMetricSuffixToNumber(iRate)).arg(VMExitMetric.unit())
    1498             .arg(m_strVMExitLabelTotal).arg(UICommon::addMetricSuffixToNumber(uTotalVMExits)).arg(VMExitMetric.unit());
     1498            .arg(m_strVMExitLabelCurrent).arg(UITranslator::addMetricSuffixToNumber(iRate)).arg(VMExitMetric.unit())
     1499            .arg(m_strVMExitLabelTotal).arg(UITranslator::addMetricSuffixToNumber(uTotalVMExits)).arg(VMExitMetric.unit());
    14991500         m_infoLabels[m_strVMExitMetricName]->setText(strInfo);
    15001501    }
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIActionPool.cpp

    r90490 r90967  
    2929#include "UIMessageCenter.h"
    3030#include "UIShortcutPool.h"
     31#include "UITranslator.h"
    3132#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    3233# include "UIExtraDataManager.h"
     
    191192        case UIActionPoolType_Manager: return name();
    192193        /* Filtered name for Runtime UI: */
    193         case UIActionPoolType_Runtime: return UICommon::removeAccelMark(name());
     194        case UIActionPoolType_Runtime: return UITranslator::removeAccelMark(name());
    194195    }
    195196    /* Nothing by default: */
     
    228229                {
    229230                    if (m_fMachineMenuAction)
    230                         setText(uiCommon().insertKeyToActionText(nameInMenu(),
    231                                                                  gShortcutPool->shortcut(actionPool(), this).primaryToPortableText()));
     231                        setText(UITranslator::insertKeyToActionText(nameInMenu(),
     232                                                                    gShortcutPool->shortcut(actionPool(), this).primaryToPortableText()));
    232233                    else
    233234                        setText(nameInMenu());
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp

    r90966 r90967  
    172172
    173173
    174 /** Port config cache. */
    175 struct PortConfig
    176 {
    177     const char *name;
    178     const ulong IRQ;
    179     const ulong IOBase;
    180 };
    181 
    182 /** Known port config COM ports. */
    183 static const PortConfig kComKnownPorts[] =
    184 {
    185     { "COM1", 4, 0x3F8 },
    186     { "COM2", 3, 0x2F8 },
    187     { "COM3", 4, 0x3E8 },
    188     { "COM4", 3, 0x2E8 },
    189     /* Must not contain an element with IRQ=0 and IOBase=0 used to cause
    190      * toCOMPortName() to return the "User-defined" string for these values. */
    191 };
    192 
    193 /** Known port config LPT ports. */
    194 static const PortConfig kLptKnownPorts[] =
    195 {
    196     { "LPT1", 7, 0x378 },
    197     { "LPT2", 5, 0x278 },
    198     { "LPT1", 2, 0x3BC },
    199     /* Must not contain an element with IRQ=0 and IOBase=0 used to cause
    200      * toLPTPortName() to return the "User-defined" string for these values. */
    201 };
    202 
    203 
    204174/* static */
    205175UICommon *UICommon::s_pInstance = 0;
    206 QString   UICommon::s_strUserDefinedPortName = QString();
    207176
    208177/* static */
     
    12221191
    12231192/* static */
    1224 QString UICommon::yearsToString(uint32_t cVal)
    1225 {
    1226     return QApplication::translate("UICommon", "%n year(s)", "", cVal);
    1227 }
    1228 
    1229 /* static */
    1230 QString UICommon::monthsToString(uint32_t cVal)
    1231 {
    1232     return QApplication::translate("UICommon", "%n month(s)", "", cVal);
    1233 }
    1234 
    1235 /* static */
    1236 QString UICommon::daysToString(uint32_t cVal)
    1237 {
    1238     return QApplication::translate("UICommon", "%n day(s)", "", cVal);
    1239 }
    1240 
    1241 /* static */
    1242 QString UICommon::hoursToString(uint32_t cVal)
    1243 {
    1244     return QApplication::translate("UICommon", "%n hour(s)", "", cVal);
    1245 }
    1246 
    1247 /* static */
    1248 QString UICommon::minutesToString(uint32_t cVal)
    1249 {
    1250     return QApplication::translate("UICommon", "%n minute(s)", "", cVal);
    1251 }
    1252 
    1253 /* static */
    1254 QString UICommon::secondsToString(uint32_t cVal)
    1255 {
    1256     return QApplication::translate("UICommon", "%n second(s)", "", cVal);
    1257 }
    1258 
    1259 /* static */
    1260 QChar UICommon::decimalSep()
    1261 {
    1262     return QLocale::system().decimalPoint();
    1263 }
    1264 
    1265 /* static */
    1266 QString UICommon::sizeRegexp()
    1267 {
    1268     /* This regexp will capture 5 groups of text:
    1269      * - cap(1): integer number in case when no decimal point is present
    1270      *           (if empty, it means that decimal point is present)
    1271      * - cap(2): size suffix in case when no decimal point is present (may be empty)
    1272      * - cap(3): integer number in case when decimal point is present (may be empty)
    1273      * - cap(4): fraction number (hundredth) in case when decimal point is present
    1274      * - cap(5): size suffix in case when decimal point is present (note that
    1275      *           B cannot appear there). */
    1276 
    1277     const QString strRegexp =
    1278         QString("^(?:(?:(\\d+)(?:\\s?(%2|%3|%4|%5|%6|%7))?)|(?:(\\d*)%1(\\d{1,2})(?:\\s?(%3|%4|%5|%6|%7))))$")
    1279             .arg(decimalSep())
    1280             .arg(tr("B", "size suffix Bytes"))
    1281             .arg(tr("KB", "size suffix KBytes=1024 Bytes"))
    1282             .arg(tr("MB", "size suffix MBytes=1024 KBytes"))
    1283             .arg(tr("GB", "size suffix GBytes=1024 MBytes"))
    1284             .arg(tr("TB", "size suffix TBytes=1024 GBytes"))
    1285             .arg(tr("PB", "size suffix PBytes=1024 TBytes"));
    1286     return strRegexp;
    1287 }
    1288 
    1289 /* static */
    1290 quint64 UICommon::parseSize(const QString &strText)
    1291 {
    1292     /* Text should be in form of B|KB|MB|GB|TB|PB. */
    1293     QRegExp regexp(sizeRegexp());
    1294     int iPos = regexp.indexIn(strText);
    1295     if (iPos != -1)
    1296     {
    1297         QString strInteger = regexp.cap(1);
    1298         QString strHundred;
    1299         QString strSuff = regexp.cap(2);
    1300         if (strInteger.isEmpty())
    1301         {
    1302             strInteger = regexp.cap(3);
    1303             strHundred = regexp.cap(4);
    1304             strSuff = regexp.cap(5);
    1305         }
    1306 
    1307         quint64 uDenominator = 0;
    1308         if (strSuff.isEmpty() || strSuff == tr("B", "size suffix Bytes"))
    1309             uDenominator = 1;
    1310         else if (strSuff == tr("KB", "size suffix KBytes=1024 Bytes"))
    1311             uDenominator = _1K;
    1312         else if (strSuff == tr("MB", "size suffix MBytes=1024 KBytes"))
    1313             uDenominator = _1M;
    1314         else if (strSuff == tr("GB", "size suffix GBytes=1024 MBytes"))
    1315             uDenominator = _1G;
    1316         else if (strSuff == tr("TB", "size suffix TBytes=1024 GBytes"))
    1317             uDenominator = _1T;
    1318         else if (strSuff == tr("PB", "size suffix PBytes=1024 TBytes"))
    1319             uDenominator = _1P;
    1320 
    1321         quint64 iInteger = strInteger.toULongLong();
    1322         if (uDenominator == 1)
    1323             return iInteger;
    1324 
    1325         quint64 iHundred = strHundred.leftJustified(2, '0').toULongLong();
    1326         iHundred = iHundred * uDenominator / 100;
    1327         iInteger = iInteger * uDenominator + iHundred;
    1328         return iInteger;
    1329     }
    1330     else
    1331         return 0;
    1332 }
    1333 
    1334 /* static */
    1335 SizeSuffix UICommon::parseSizeSuffix(const QString &strText)
    1336 {
    1337     /* Text should be in form of B|KB|MB|GB|TB|PB. */
    1338     QRegExp regexp(sizeRegexp());
    1339     int iPos = regexp.indexIn(strText);
    1340     if (iPos != -1)
    1341     {
    1342         QString strInteger = regexp.cap(1);
    1343         QString strSuff = regexp.cap(2);
    1344         if (strInteger.isEmpty())
    1345         {
    1346             strInteger = regexp.cap(3);
    1347             strSuff = regexp.cap(5);
    1348         }
    1349 
    1350         SizeSuffix enmSizeSuffix = SizeSuffix_Byte;
    1351 
    1352         if (strSuff.isEmpty() || strSuff == tr("B", "size suffix Bytes"))
    1353             enmSizeSuffix = SizeSuffix_Byte;
    1354         else if (strSuff == tr("KB", "size suffix KBytes=1024 Bytes"))
    1355             enmSizeSuffix = SizeSuffix_KiloByte;
    1356         else if (strSuff == tr("MB", "size suffix MBytes=1024 KBytes"))
    1357             enmSizeSuffix = SizeSuffix_MegaByte;
    1358         else if (strSuff == tr("GB", "size suffix GBytes=1024 MBytes"))
    1359             enmSizeSuffix = SizeSuffix_GigaByte;
    1360         else if (strSuff == tr("TB", "size suffix TBytes=1024 GBytes"))
    1361             enmSizeSuffix = SizeSuffix_TeraByte;
    1362         else if (strSuff == tr("PB", "size suffix PBytes=1024 TBytes"))
    1363             enmSizeSuffix = SizeSuffix_PetaByte;
    1364         return enmSizeSuffix;
    1365     }
    1366     else
    1367         return SizeSuffix_Byte;
    1368 }
    1369 
    1370 /* static */
    1371 bool UICommon::hasSizeSuffix(const QString &strText)
    1372 {
    1373     /* Text should be in form of B|KB|MB|GB|TB|PB. */
    1374     QRegExp regexp(sizeRegexp());
    1375     int iPos = regexp.indexIn(strText);
    1376     if (iPos != -1)
    1377     {
    1378         QString strInteger = regexp.cap(1);
    1379         QString strSuff = regexp.cap(2);
    1380         if (strInteger.isEmpty())
    1381         {
    1382             strInteger = regexp.cap(3);
    1383             strSuff = regexp.cap(5);
    1384         }
    1385 
    1386         if (strSuff.isEmpty())
    1387             return false;
    1388         if (strSuff == tr("B", "size suffix Bytes") ||
    1389             strSuff == tr("KB", "size suffix KBytes=1024 Bytes") ||
    1390             strSuff == tr("MB", "size suffix MBytes=1024 KBytes") ||
    1391             strSuff == tr("GB", "size suffix GBytes=1024 MBytes") ||
    1392             strSuff == tr("TB", "size suffix TBytes=1024 GBytes") ||
    1393             strSuff == tr("PB", "size suffix PBytes=1024 TBytes"))
    1394             return true;
    1395         return false;
    1396     }
    1397     else
    1398         return false;
    1399 }
    1400 
    1401 /* static */
    1402 QString UICommon::formatSize(quint64 uSize, uint cDecimal /* = 2 */,
    1403                                FormatSize enmMode /* = FormatSize_Round */)
    1404 {
    1405     /* Text will be in form of B|KB|MB|GB|TB|PB.
    1406      *
    1407      * When enmMode is FormatSize_Round, the result is rounded to the
    1408      *              closest number containing @a aDecimal decimal digits.
    1409      * When enmMode is FormatSize_RoundDown, the result is rounded to the
    1410      *              largest number with @a aDecimal decimal digits that is not greater than
    1411      *              the result. This guarantees that converting the resulting string back to
    1412      *              the integer value in bytes will not produce a value greater that the
    1413      *              initial size parameter.
    1414      * When enmMode is FormatSize_RoundUp, the result is rounded to the
    1415      *              smallest number with @a aDecimal decimal digits that is not less than the
    1416      *              result. This guarantees that converting the resulting string back to the
    1417      *              integer value in bytes will not produce a value less that the initial
    1418      *              size parameter. */
    1419 
    1420     quint64 uDenominator = 0;
    1421     int iSuffix = 0;
    1422 
    1423     if (uSize < _1K)
    1424     {
    1425         uDenominator = 1;
    1426         iSuffix = 0;
    1427     }
    1428     else if (uSize < _1M)
    1429     {
    1430         uDenominator = _1K;
    1431         iSuffix = 1;
    1432     }
    1433     else if (uSize < _1G)
    1434     {
    1435         uDenominator = _1M;
    1436         iSuffix = 2;
    1437     }
    1438     else if (uSize < _1T)
    1439     {
    1440         uDenominator = _1G;
    1441         iSuffix = 3;
    1442     }
    1443     else if (uSize < _1P)
    1444     {
    1445         uDenominator = _1T;
    1446         iSuffix = 4;
    1447     }
    1448     else
    1449     {
    1450         uDenominator = _1P;
    1451         iSuffix = 5;
    1452     }
    1453 
    1454     quint64 uInteger = uSize / uDenominator;
    1455     quint64 uDecimal = uSize % uDenominator;
    1456     quint64 uMult = 1;
    1457     for (uint i = 0; i < cDecimal; ++i)
    1458         uMult *= 10;
    1459 
    1460     QString strNumber;
    1461     if (uDenominator > 1)
    1462     {
    1463         if (uDecimal)
    1464         {
    1465             uDecimal *= uMult;
    1466             /* Not greater: */
    1467             if (enmMode == FormatSize_RoundDown)
    1468                 uDecimal = uDecimal / uDenominator;
    1469             /* Not less: */
    1470             else if (enmMode == FormatSize_RoundUp)
    1471                 uDecimal = (uDecimal + uDenominator - 1) / uDenominator;
    1472             /* Nearest: */
    1473             else
    1474                 uDecimal = (uDecimal + uDenominator / 2) / uDenominator;
    1475         }
    1476         /* Check for the fractional part overflow due to rounding: */
    1477         if (uDecimal == uMult)
    1478         {
    1479             uDecimal = 0;
    1480             ++uInteger;
    1481             /* Check if we've got 1024 XB after rounding and scale down if so: */
    1482             if (uInteger == 1024 && iSuffix + 1 < (int)SizeSuffix_Max)
    1483             {
    1484                 uInteger /= 1024;
    1485                 ++iSuffix;
    1486             }
    1487         }
    1488         strNumber = QString::number(uInteger);
    1489         if (cDecimal)
    1490             strNumber += QString("%1%2").arg(decimalSep())
    1491                                         .arg(QString::number(uDecimal).rightJustified(cDecimal, '0'));
    1492     }
    1493     else
    1494     {
    1495         strNumber = QString::number(uInteger);
    1496     }
    1497 
    1498     return QString("%1 %2").arg(strNumber).arg(gpConverter->toString(static_cast<SizeSuffix>(iSuffix)));
    1499 }
    1500 
    1501 /* static */
    1502 QString UICommon::addMetricSuffixToNumber(quint64 uNumber)
    1503 {
    1504     if (uNumber <= 0)
    1505         return QString();
    1506     /* See https://en.wikipedia.org/wiki/Metric_prefix for metric suffixes:*/
    1507     char suffixes[] = {'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'};
    1508     int zeroCount = (int)log10((long double)uNumber);
    1509     if (zeroCount < 3)
    1510         return QString::number(uNumber);
    1511     int h = 3 * (zeroCount / 3);
    1512     char result[128];
    1513     sprintf(result, "%.2f", uNumber / (float)pow((double)10, h));
    1514     return QString("%1%2").arg(result).arg(suffixes[h / 3 - 1]);
    1515 }
    1516 
    1517 /* static */
    1518 QStringList UICommon::COMPortNames()
    1519 {
    1520     QStringList list;
    1521     for (size_t i = 0; i < RT_ELEMENTS(kComKnownPorts); ++i)
    1522         list << kComKnownPorts[i].name;
    1523 
    1524     return list;
    1525 }
    1526 
    1527 /* static */
    1528 QString UICommon::toCOMPortName(ulong uIRQ, ulong uIOBase)
    1529 {
    1530     for (size_t i = 0; i < RT_ELEMENTS(kComKnownPorts); ++i)
    1531         if (kComKnownPorts[i].IRQ == uIRQ &&
    1532             kComKnownPorts[i].IOBase == uIOBase)
    1533             return kComKnownPorts[i].name;
    1534 
    1535     return s_strUserDefinedPortName;
    1536 }
    1537 
    1538 /* static */
    1539 bool UICommon::toCOMPortNumbers(const QString &strName, ulong &uIRQ, ulong &uIOBase)
    1540 {
    1541     for (size_t i = 0; i < RT_ELEMENTS(kComKnownPorts); ++i)
    1542         if (strcmp(kComKnownPorts[i].name, strName.toUtf8().data()) == 0)
    1543         {
    1544             uIRQ = kComKnownPorts[i].IRQ;
    1545             uIOBase = kComKnownPorts[i].IOBase;
    1546             return true;
    1547         }
    1548 
    1549     return false;
    1550 }
    1551 
    1552 /* static */
    1553 QStringList UICommon::LPTPortNames()
    1554 {
    1555     QStringList list;
    1556     for (size_t i = 0; i < RT_ELEMENTS(kLptKnownPorts); ++i)
    1557         list << kLptKnownPorts[i].name;
    1558 
    1559     return list;
    1560 }
    1561 
    1562 /* static */
    1563 QString UICommon::toLPTPortName(ulong uIRQ, ulong uIOBase)
    1564 {
    1565     for (size_t i = 0; i < RT_ELEMENTS(kLptKnownPorts); ++i)
    1566         if (kLptKnownPorts[i].IRQ == uIRQ &&
    1567             kLptKnownPorts[i].IOBase == uIOBase)
    1568             return kLptKnownPorts[i].name;
    1569 
    1570     return s_strUserDefinedPortName;
    1571 }
    1572 
    1573 /* static */
    1574 bool UICommon::toLPTPortNumbers(const QString &strName, ulong &uIRQ, ulong &uIOBase)
    1575 {
    1576     for (size_t i = 0; i < RT_ELEMENTS(kLptKnownPorts); ++i)
    1577         if (strcmp(kLptKnownPorts[i].name, strName.toUtf8().data()) == 0)
    1578         {
    1579             uIRQ = kLptKnownPorts[i].IRQ;
    1580             uIOBase = kLptKnownPorts[i].IOBase;
    1581             return true;
    1582         }
    1583 
    1584     return false;
    1585 }
    1586 
    1587 /* static */
    1588 QString UICommon::highlight(QString strText, bool fToolTip /* = false */)
    1589 {
    1590     /* We should reformat the input strText so that:
    1591      * - strings in single quotes will be put inside <nobr> and marked
    1592      *   with blue color;
    1593      * - UUIDs be put inside <nobr> and marked
    1594      *   with green color;
    1595      * - replaces new line chars with </p><p> constructs to form paragraphs
    1596      *   (note that <p\> and </p> are not appended to the beginning and to the
    1597      *    end of the string respectively, to allow the result be appended
    1598      *    or prepended to the existing paragraph).
    1599      *
    1600      *  If @a fToolTip is true, colouring is not applied, only the <nobr> tag
    1601      *  is added. Also, new line chars are replaced with <br> instead of <p>. */
    1602 
    1603     QString strFont;
    1604     QString uuidFont;
    1605     QString endFont;
    1606     if (!fToolTip)
    1607     {
    1608         strFont = "<font color=#0000CC>";
    1609         uuidFont = "<font color=#008000>";
    1610         endFont = "</font>";
    1611     }
    1612 
    1613     /* Replace special entities, '&' -- first! */
    1614     strText.replace('&', "&amp;");
    1615     strText.replace('<', "&lt;");
    1616     strText.replace('>', "&gt;");
    1617     strText.replace('\"', "&quot;");
    1618 
    1619     /* Mark strings in single quotes with color: */
    1620     QRegExp rx = QRegExp("((?:^|\\s)[(]?)'([^']*)'(?=[:.-!);]?(?:\\s|$))");
    1621     rx.setMinimal(true);
    1622     strText.replace(rx, QString("\\1%1<nobr>'\\2'</nobr>%2").arg(strFont).arg(endFont));
    1623 
    1624     /* Mark UUIDs with color: */
    1625     strText.replace(QRegExp(
    1626         "((?:^|\\s)[(]?)"
    1627         "(\\{[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}\\})"
    1628         "(?=[:.-!);]?(?:\\s|$))"),
    1629         QString("\\1%1<nobr>\\2</nobr>%2").arg(uuidFont).arg(endFont));
    1630 
    1631     /* Split to paragraphs at \n chars: */
    1632     if (!fToolTip)
    1633         strText.replace('\n', "</p><p>");
    1634     else
    1635         strText.replace('\n', "<br>");
    1636 
    1637     return strText;
    1638 }
    1639 
    1640 /* static */
    1641 QString UICommon::emphasize(QString strText)
    1642 {
    1643     /* We should reformat the input string @a strText so that:
    1644      * - strings in single quotes will be put inside \<nobr\> and marked
    1645      *   with bold style;
    1646      * - UUIDs be put inside \<nobr\> and marked
    1647      *   with italic style;
    1648      * - replaces new line chars with \</p\>\<p\> constructs to form paragraphs
    1649      *   (note that \<p\> and \</p\> are not appended to the beginning and to the
    1650      *    end of the string respectively, to allow the result be appended
    1651      *    or prepended to the existing paragraph). */
    1652 
    1653     QString strEmphStart("<b>");
    1654     QString strEmphEnd("</b>");
    1655     QString uuidEmphStart("<i>");
    1656     QString uuidEmphEnd("</i>");
    1657 
    1658     /* Replace special entities, '&' -- first! */
    1659     strText.replace('&', "&amp;");
    1660     strText.replace('<', "&lt;");
    1661     strText.replace('>', "&gt;");
    1662     strText.replace('\"', "&quot;");
    1663 
    1664     /* Mark strings in single quotes with bold style: */
    1665     QRegExp rx = QRegExp("((?:^|\\s)[(]?)'([^']*)'(?=[:.-!);]?(?:\\s|$))");
    1666     rx.setMinimal(true);
    1667     strText.replace(rx, QString("\\1%1<nobr>'\\2'</nobr>%2").arg(strEmphStart).arg(strEmphEnd));
    1668 
    1669     /* Mark UUIDs with italic style: */
    1670     strText.replace(QRegExp(
    1671         "((?:^|\\s)[(]?)"
    1672         "(\\{[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}\\})"
    1673         "(?=[:.-!);]?(?:\\s|$))"),
    1674         QString("\\1%1<nobr>\\2</nobr>%2").arg(uuidEmphStart).arg(uuidEmphEnd));
    1675 
    1676     /* Split to paragraphs at \n chars: */
    1677     strText.replace('\n', "</p><p>");
    1678 
    1679     return strText;
    1680 }
    1681 
    1682 /* static */
    1683 QString UICommon::removeAccelMark(QString strText)
    1684 {
    1685     /* In order to support accelerators used in non-alphabet languages
    1686      * (e.g. Japanese) that has a form of "(&<L>)" (where <L> is a latin letter),
    1687      * this method first searches for this pattern and, if found, removes it as a
    1688      * whole. If such a pattern is not found, then the '&' character is simply
    1689      * removed from the string. */
    1690 
    1691     QRegExp accel("\\(&[a-zA-Z]\\)");
    1692     int iPos = accel.indexIn(strText);
    1693     if (iPos >= 0)
    1694         strText.remove(iPos, accel.cap().length());
    1695     else
    1696     {
    1697         iPos = strText.indexOf('&');
    1698         if (iPos >= 0)
    1699             strText.remove(iPos, 1);
    1700     }
    1701 
    1702     return strText;
    1703 }
    1704 
    1705 /* static */
    1706 QString UICommon::insertKeyToActionText(const QString &strText, const QString &strKey)
    1707 {
    1708 #ifdef VBOX_WS_MAC
    1709     QString strPattern("%1 (Host+%2)");
    1710 #else
    1711     QString strPattern("%1 \tHost+%2");
    1712 #endif
    1713     if (   strKey.isEmpty()
    1714         || strKey.compare("None", Qt::CaseInsensitive) == 0)
    1715         return strText;
    1716     else
    1717         return strPattern.arg(strText).arg(QKeySequence(strKey).toString(QKeySequence::NativeText));
    1718 }
    1719 
    1720 /* static */
    17211193QString UICommon::helpFile()
    17221194{
     
    44333905void UICommon::retranslateUi()
    44343906{
    4435     s_strUserDefinedPortName = tr("User-defined", "serial port");
    4436 
    44373907    m_pixWarning = UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_MessageBoxWarning).pixmap(16, 16);
    44383908    Assert(!m_pixWarning.isNull());
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h

    r90966 r90967  
    301301        void deletePidfile();
    302302#endif
    303     /** @} */
    304 
    305     /** @name Localization stuff.
    306      * @{ */
    307         /** Returns tr("%n year(s)"). */
    308         static QString yearsToString(uint32_t cVal);
    309         /** Returns tr("%n month(s)"). */
    310         static QString monthsToString(uint32_t cVal);
    311         /** Returns tr("%n day(s)"). */
    312         static QString daysToString(uint32_t cVal);
    313         /** Returns tr("%n hour(s)"). */
    314         static QString hoursToString(uint32_t cVal);
    315         /** Returns tr("%n minute(s)"). */
    316         static QString minutesToString(uint32_t cVal);
    317         /** Returns tr("%n second(s)"). */
    318         static QString secondsToString(uint32_t cVal);
    319 
    320         /** Returns the decimal separator for the current locale. */
    321         static QChar decimalSep();
    322         /** Returns the regexp string that defines the format of the human-readable size representation. */
    323         static QString sizeRegexp();
    324         /** Parses the given size strText and returns the size value in bytes. */
    325         static quint64 parseSize(const QString &strText);
    326         /** Parses the given size strText and returns the size suffix. */
    327         static SizeSuffix parseSizeSuffix(const QString &strText);
    328         /** Parses the given string @a strText and returns true if it includes a size suffix. */
    329         static bool hasSizeSuffix(const QString &strText);
    330         /** Formats the given @a uSize value in bytes to a human readable string.
    331           * @param  uSize     Brings the size value in bytes.
    332           * @param  enmMode   Brings the conversion mode.
    333           * @param  cDecimal  Brings the number of decimal digits in result. */
    334         static QString formatSize(quint64 uSize, uint cDecimal = 2, FormatSize enmMode = FormatSize_Round);
    335         /** Formats the given @a uNumber to that 'k' is added for thousand, 'M' for million and so on. */
    336         static QString addMetricSuffixToNumber(quint64 uNumber);
    337 
    338         /** Returns the list of the standard COM port names (i.e. "COMx"). */
    339         static QStringList COMPortNames();
    340         /** Returns the name of the standard COM port corresponding to the given parameters,
    341           * or "User-defined" (which is also returned when both @a uIRQ and @a uIOBase are 0). */
    342         static QString toCOMPortName(ulong uIRQ, ulong uIOBase);
    343         /** Returns port parameters corresponding to the given standard COM name.
    344           * Returns @c true on success, or @c false if the given port name is not one of the standard names (i.e. "COMx"). */
    345         static bool toCOMPortNumbers(const QString &strName, ulong &uIRQ, ulong &uIOBase);
    346         /** Returns the list of the standard LPT port names (i.e. "LPTx"). */
    347         static QStringList LPTPortNames();
    348         /** Returns the name of the standard LPT port corresponding to the given parameters,
    349           * or "User-defined" (which is also returned when both @a uIRQ and @a uIOBase are 0). */
    350         static QString toLPTPortName(ulong uIRQ, ulong uIOBase);
    351         /** Returns port parameters corresponding to the given standard LPT name.
    352           * Returns @c true on success, or @c false if the given port name is not one of the standard names (i.e. "LPTx"). */
    353         static bool toLPTPortNumbers(const QString &strName, ulong &uIRQ, ulong &uIOBase);
    354 
    355         /** Reformats the input @a strText to highlight it. */
    356         static QString highlight(QString strText, bool fToolTip = false);
    357         /** Reformats the input @a strText to emphasize it. */
    358         static QString emphasize(QString strText);
    359         /** Removes the first occurrence of the accelerator mark (the ampersand symbol) from the given @a strText. */
    360         static QString removeAccelMark(QString strText);
    361         /** Inserts a passed @a strKey into action @a strText. */
    362         static QString insertKeyToActionText (const QString &strText, const QString &strKey);
    363303    /** @} */
    364304
     
    834774    /** @name General stuff.
    835775     * @{ */
    836         /** Holds the tr("User Defined") port name. */
    837         static QString  s_strUserDefinedPortName;
    838 
    839776        /** Holds the UI type. */
    840777        UIType  m_enmType;
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UICustomFileSystemModel.cpp

    r87719 r90967  
    2222
    2323/* GUI includes: */
     24#include "UICommon.h"
     25#include "UICustomFileSystemModel.h"
    2426#include "UIErrorString.h"
    25 #include "UICustomFileSystemModel.h"
    2627#include "UIPathOperations.h"
    27 #include "UICommon.h"
     28#include "UITranslator.h"
    2829
    2930const char *UICustomFileSystemModel::strUpDirectoryString = "..";
     
    440441            {
    441442                qulonglong size = item->data(index.column()).toULongLong();
    442                 return uiCommon().formatSize(size);
     443                return UITranslator::formatSize(size);
    443444            }
    444445            else
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDetailsGenerator.cpp

    r86275 r90967  
    2222/* GUI includes: */
    2323#include "UIBootOrderEditor.h"
     24#include "UICommon.h"
    2425#include "UIConverter.h"
    2526#include "UIDetailsGenerator.h"
    2627#include "UIErrorString.h"
    27 #include "UICommon.h"
     28#include "UITranslator.h"
    2829
    2930/* COM includes: */
     
    816817        /* Gather port information: */
    817818        const KPortMode enmMode = comPort.GetHostMode();
    818         const QString strModeTemplate = uiCommon().toCOMPortName(comPort.GetIRQ(), comPort.GetIOBase()) + ", ";
     819        const QString strModeTemplate = UITranslator::toCOMPortName(comPort.GetIRQ(), comPort.GetIOBase()) + ", ";
    819820        QString strModeType;
    820821        switch (enmMode)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIErrorString.cpp

    r89582 r90967  
    2424#include "UICommon.h"
    2525#include "UIErrorString.h"
     26#include "UITranslator.h"
    2627
    2728/* COM includes: */
     
    149150        if (   strDetailsInfo == QString::fromLatin1(strDetailsInfo.toLatin1())
    150151            && strDetailsInfo != QObject::tr(strDetailsInfo.toLatin1().constData()))
    151             strFormatted += QString("<p>%1.</p>").arg(uiCommon().emphasize(QObject::tr(strDetailsInfo.toLatin1().constData())));
     152            strFormatted += QString("<p>%1.</p>").arg(UITranslator::emphasize(QObject::tr(strDetailsInfo.toLatin1().constData())));
    152153        else
    153             strFormatted += QString("<p>%1.</p>").arg(uiCommon().emphasize(strDetailsInfo));
     154            strFormatted += QString("<p>%1.</p>").arg(UITranslator::emphasize(strDetailsInfo));
    154155    }
    155156
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp

    r90941 r90967  
    25592559    QString formatted("<!--EOM-->");
    25602560    if (!strErrorMsg.isEmpty())
    2561         formatted.prepend(QString("<p>%1.</p>").arg(uiCommon().emphasize(strErrorMsg)));
     2561        formatted.prepend(QString("<p>%1.</p>").arg(UITranslator::emphasize(strErrorMsg)));
    25622562    if (!strErrorId.isEmpty())
    25632563        formatted += QString("<table bgcolor=%1 border=0 cellspacing=5 "
     
    27882788                             "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
    27892789                             "<p>Press <b>Ignore</b> to switch to full-screen mode anyway or press <b>Cancel</b> to cancel the operation.</p>")
    2790                              .arg(UICommon::formatSize(uMinVRAM)),
     2790                             .arg(UITranslator::formatSize(uMinVRAM)),
    27912791                          0 /* auto-confirm id */,
    27922792                          tr("Ignore"));
     
    28002800             "<p>You should configure the virtual machine to have at "
    28012801             "least <b>%1</b> of video memory.</p>")
    2802              .arg(UICommon::formatSize(uMinVRAM)));
     2802             .arg(UITranslator::formatSize(uMinVRAM)));
    28032803}
    28042804
     
    28092809                             "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
    28102810                             "<p>Press <b>Ignore</b> to switch the screen anyway or press <b>Cancel</b> to cancel the operation.</p>")
    2811                              .arg(UICommon::formatSize(uMinVRAM)),
     2811                             .arg(UITranslator::formatSize(uMinVRAM)),
    28122812                          0 /* auto-confirm id */,
    28132813                          tr("Ignore"));
     
    28212821             "<p>You should configure the virtual machine to have at "
    28222822             "least <b>%1</b> of video memory.</p>")
    2823              .arg(UICommon::formatSize(uMinVRAM)));
     2823             .arg(UITranslator::formatSize(uMinVRAM)));
    28242824}
    28252825
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslator.cpp

    r90951 r90967  
    1919#include <QApplication>
    2020#include <QDir>
     21#include <QKeySequence>
    2122#ifdef Q_OS_UNIX
    2223# include <QLibraryInfo>
     
    2425
    2526/* GUI includes: */
     27#include "UIConverter.h"
    2628#include "UIMessageCenter.h"
    2729#include "UITranslator.h"
     
    3638# include <iprt/env.h>
    3739#endif
     40
     41
     42/** Port config cache. */
     43struct PortConfig
     44{
     45    const char *name;
     46    const ulong IRQ;
     47    const ulong IOBase;
     48};
     49
     50/** Known port config COM ports. */
     51static const PortConfig kComKnownPorts[] =
     52{
     53    { "COM1", 4, 0x3F8 },
     54    { "COM2", 3, 0x2F8 },
     55    { "COM3", 4, 0x3E8 },
     56    { "COM4", 3, 0x2E8 },
     57    /* Must not contain an element with IRQ=0 and IOBase=0 used to cause
     58     * toCOMPortName() to return the "User-defined" string for these values. */
     59};
     60
    3861
    3962/* static */
     
    227250}
    228251
     252/* static */
     253QString UITranslator::yearsToString(uint32_t cVal)
     254{
     255    return QApplication::translate("UITranslator", "%n year(s)", "", cVal);
     256}
     257
     258/* static */
     259QString UITranslator::monthsToString(uint32_t cVal)
     260{
     261    return QApplication::translate("UITranslator", "%n month(s)", "", cVal);
     262}
     263
     264/* static */
     265QString UITranslator::daysToString(uint32_t cVal)
     266{
     267    return QApplication::translate("UITranslator", "%n day(s)", "", cVal);
     268}
     269
     270/* static */
     271QString UITranslator::hoursToString(uint32_t cVal)
     272{
     273    return QApplication::translate("UITranslator", "%n hour(s)", "", cVal);
     274}
     275
     276/* static */
     277QString UITranslator::minutesToString(uint32_t cVal)
     278{
     279    return QApplication::translate("UITranslator", "%n minute(s)", "", cVal);
     280}
     281
     282/* static */
     283QString UITranslator::secondsToString(uint32_t cVal)
     284{
     285    return QApplication::translate("UITranslator", "%n second(s)", "", cVal);
     286}
     287
     288/* static */
     289QChar UITranslator::decimalSep()
     290{
     291    return QLocale::system().decimalPoint();
     292}
     293
     294/* static */
     295QString UITranslator::sizeRegexp()
     296{
     297    /* This regexp will capture 5 groups of text:
     298     * - cap(1): integer number in case when no decimal point is present
     299     *           (if empty, it means that decimal point is present)
     300     * - cap(2): size suffix in case when no decimal point is present (may be empty)
     301     * - cap(3): integer number in case when decimal point is present (may be empty)
     302     * - cap(4): fraction number (hundredth) in case when decimal point is present
     303     * - cap(5): size suffix in case when decimal point is present (note that
     304     *           B cannot appear there). */
     305
     306    const QString strRegexp =
     307        QString("^(?:(?:(\\d+)(?:\\s?(%2|%3|%4|%5|%6|%7))?)|(?:(\\d*)%1(\\d{1,2})(?:\\s?(%3|%4|%5|%6|%7))))$")
     308            .arg(decimalSep())
     309            .arg(tr("B", "size suffix Bytes"))
     310            .arg(tr("KB", "size suffix KBytes=1024 Bytes"))
     311            .arg(tr("MB", "size suffix MBytes=1024 KBytes"))
     312            .arg(tr("GB", "size suffix GBytes=1024 MBytes"))
     313            .arg(tr("TB", "size suffix TBytes=1024 GBytes"))
     314            .arg(tr("PB", "size suffix PBytes=1024 TBytes"));
     315    return strRegexp;
     316}
     317
     318/* static */
     319quint64 UITranslator::parseSize(const QString &strText)
     320{
     321    /* Text should be in form of B|KB|MB|GB|TB|PB. */
     322    QRegExp regexp(sizeRegexp());
     323    int iPos = regexp.indexIn(strText);
     324    if (iPos != -1)
     325    {
     326        QString strInteger = regexp.cap(1);
     327        QString strHundred;
     328        QString strSuff = regexp.cap(2);
     329        if (strInteger.isEmpty())
     330        {
     331            strInteger = regexp.cap(3);
     332            strHundred = regexp.cap(4);
     333            strSuff = regexp.cap(5);
     334        }
     335
     336        quint64 uDenominator = 0;
     337        if (strSuff.isEmpty() || strSuff == tr("B", "size suffix Bytes"))
     338            uDenominator = 1;
     339        else if (strSuff == tr("KB", "size suffix KBytes=1024 Bytes"))
     340            uDenominator = _1K;
     341        else if (strSuff == tr("MB", "size suffix MBytes=1024 KBytes"))
     342            uDenominator = _1M;
     343        else if (strSuff == tr("GB", "size suffix GBytes=1024 MBytes"))
     344            uDenominator = _1G;
     345        else if (strSuff == tr("TB", "size suffix TBytes=1024 GBytes"))
     346            uDenominator = _1T;
     347        else if (strSuff == tr("PB", "size suffix PBytes=1024 TBytes"))
     348            uDenominator = _1P;
     349
     350        quint64 iInteger = strInteger.toULongLong();
     351        if (uDenominator == 1)
     352            return iInteger;
     353
     354        quint64 iHundred = strHundred.leftJustified(2, '0').toULongLong();
     355        iHundred = iHundred * uDenominator / 100;
     356        iInteger = iInteger * uDenominator + iHundred;
     357        return iInteger;
     358    }
     359    else
     360        return 0;
     361}
     362
     363/* static */
     364SizeSuffix UITranslator::parseSizeSuffix(const QString &strText)
     365{
     366    /* Text should be in form of B|KB|MB|GB|TB|PB. */
     367    QRegExp regexp(sizeRegexp());
     368    int iPos = regexp.indexIn(strText);
     369    if (iPos != -1)
     370    {
     371        QString strInteger = regexp.cap(1);
     372        QString strSuff = regexp.cap(2);
     373        if (strInteger.isEmpty())
     374        {
     375            strInteger = regexp.cap(3);
     376            strSuff = regexp.cap(5);
     377        }
     378
     379        SizeSuffix enmSizeSuffix = SizeSuffix_Byte;
     380
     381        if (strSuff.isEmpty() || strSuff == tr("B", "size suffix Bytes"))
     382            enmSizeSuffix = SizeSuffix_Byte;
     383        else if (strSuff == tr("KB", "size suffix KBytes=1024 Bytes"))
     384            enmSizeSuffix = SizeSuffix_KiloByte;
     385        else if (strSuff == tr("MB", "size suffix MBytes=1024 KBytes"))
     386            enmSizeSuffix = SizeSuffix_MegaByte;
     387        else if (strSuff == tr("GB", "size suffix GBytes=1024 MBytes"))
     388            enmSizeSuffix = SizeSuffix_GigaByte;
     389        else if (strSuff == tr("TB", "size suffix TBytes=1024 GBytes"))
     390            enmSizeSuffix = SizeSuffix_TeraByte;
     391        else if (strSuff == tr("PB", "size suffix PBytes=1024 TBytes"))
     392            enmSizeSuffix = SizeSuffix_PetaByte;
     393        return enmSizeSuffix;
     394    }
     395    else
     396        return SizeSuffix_Byte;
     397}
     398
     399/* static */
     400bool UITranslator::hasSizeSuffix(const QString &strText)
     401{
     402    /* Text should be in form of B|KB|MB|GB|TB|PB. */
     403    QRegExp regexp(sizeRegexp());
     404    int iPos = regexp.indexIn(strText);
     405    if (iPos != -1)
     406    {
     407        QString strInteger = regexp.cap(1);
     408        QString strSuff = regexp.cap(2);
     409        if (strInteger.isEmpty())
     410        {
     411            strInteger = regexp.cap(3);
     412            strSuff = regexp.cap(5);
     413        }
     414
     415        if (strSuff.isEmpty())
     416            return false;
     417        if (strSuff == tr("B", "size suffix Bytes") ||
     418            strSuff == tr("KB", "size suffix KBytes=1024 Bytes") ||
     419            strSuff == tr("MB", "size suffix MBytes=1024 KBytes") ||
     420            strSuff == tr("GB", "size suffix GBytes=1024 MBytes") ||
     421            strSuff == tr("TB", "size suffix TBytes=1024 GBytes") ||
     422            strSuff == tr("PB", "size suffix PBytes=1024 TBytes"))
     423            return true;
     424        return false;
     425    }
     426    else
     427        return false;
     428}
     429
     430/* static */
     431QString UITranslator::formatSize(quint64 uSize, uint cDecimal /* = 2 */,
     432                                 FormatSize enmMode /* = FormatSize_Round */)
     433{
     434    /* Text will be in form of B|KB|MB|GB|TB|PB.
     435     *
     436     * When enmMode is FormatSize_Round, the result is rounded to the
     437     *              closest number containing @a aDecimal decimal digits.
     438     * When enmMode is FormatSize_RoundDown, the result is rounded to the
     439     *              largest number with @a aDecimal decimal digits that is not greater than
     440     *              the result. This guarantees that converting the resulting string back to
     441     *              the integer value in bytes will not produce a value greater that the
     442     *              initial size parameter.
     443     * When enmMode is FormatSize_RoundUp, the result is rounded to the
     444     *              smallest number with @a aDecimal decimal digits that is not less than the
     445     *              result. This guarantees that converting the resulting string back to the
     446     *              integer value in bytes will not produce a value less that the initial
     447     *              size parameter. */
     448
     449    quint64 uDenominator = 0;
     450    int iSuffix = 0;
     451
     452    if (uSize < _1K)
     453    {
     454        uDenominator = 1;
     455        iSuffix = 0;
     456    }
     457    else if (uSize < _1M)
     458    {
     459        uDenominator = _1K;
     460        iSuffix = 1;
     461    }
     462    else if (uSize < _1G)
     463    {
     464        uDenominator = _1M;
     465        iSuffix = 2;
     466    }
     467    else if (uSize < _1T)
     468    {
     469        uDenominator = _1G;
     470        iSuffix = 3;
     471    }
     472    else if (uSize < _1P)
     473    {
     474        uDenominator = _1T;
     475        iSuffix = 4;
     476    }
     477    else
     478    {
     479        uDenominator = _1P;
     480        iSuffix = 5;
     481    }
     482
     483    quint64 uInteger = uSize / uDenominator;
     484    quint64 uDecimal = uSize % uDenominator;
     485    quint64 uMult = 1;
     486    for (uint i = 0; i < cDecimal; ++i)
     487        uMult *= 10;
     488
     489    QString strNumber;
     490    if (uDenominator > 1)
     491    {
     492        if (uDecimal)
     493        {
     494            uDecimal *= uMult;
     495            /* Not greater: */
     496            if (enmMode == FormatSize_RoundDown)
     497                uDecimal = uDecimal / uDenominator;
     498            /* Not less: */
     499            else if (enmMode == FormatSize_RoundUp)
     500                uDecimal = (uDecimal + uDenominator - 1) / uDenominator;
     501            /* Nearest: */
     502            else
     503                uDecimal = (uDecimal + uDenominator / 2) / uDenominator;
     504        }
     505        /* Check for the fractional part overflow due to rounding: */
     506        if (uDecimal == uMult)
     507        {
     508            uDecimal = 0;
     509            ++uInteger;
     510            /* Check if we've got 1024 XB after rounding and scale down if so: */
     511            if (uInteger == 1024 && iSuffix + 1 < (int)SizeSuffix_Max)
     512            {
     513                uInteger /= 1024;
     514                ++iSuffix;
     515            }
     516        }
     517        strNumber = QString::number(uInteger);
     518        if (cDecimal)
     519            strNumber += QString("%1%2").arg(decimalSep())
     520                                        .arg(QString::number(uDecimal).rightJustified(cDecimal, '0'));
     521    }
     522    else
     523    {
     524        strNumber = QString::number(uInteger);
     525    }
     526
     527    return QString("%1 %2").arg(strNumber).arg(gpConverter->toString(static_cast<SizeSuffix>(iSuffix)));
     528}
     529
     530/* static */
     531QString UITranslator::addMetricSuffixToNumber(quint64 uNumber)
     532{
     533    if (uNumber <= 0)
     534        return QString();
     535    /* See https://en.wikipedia.org/wiki/Metric_prefix for metric suffixes:*/
     536    char suffixes[] = {'k', 'M', 'G', 'T', 'P', 'E', 'Z', 'Y'};
     537    int zeroCount = (int)log10((long double)uNumber);
     538    if (zeroCount < 3)
     539        return QString::number(uNumber);
     540    int h = 3 * (zeroCount / 3);
     541    char result[128];
     542    sprintf(result, "%.2f", uNumber / (float)pow((double)10, h));
     543    return QString("%1%2").arg(result).arg(suffixes[h / 3 - 1]);
     544}
     545
     546/* static */
     547QStringList UITranslator::COMPortNames()
     548{
     549    QStringList list;
     550    for (size_t i = 0; i < RT_ELEMENTS(kComKnownPorts); ++i)
     551        list << kComKnownPorts[i].name;
     552
     553    return list;
     554}
     555
     556/* static */
     557QString UITranslator::toCOMPortName(ulong uIRQ, ulong uIOBase)
     558{
     559    for (size_t i = 0; i < RT_ELEMENTS(kComKnownPorts); ++i)
     560        if (kComKnownPorts[i].IRQ == uIRQ &&
     561            kComKnownPorts[i].IOBase == uIOBase)
     562            return kComKnownPorts[i].name;
     563
     564    return tr("User-defined", "serial port");;
     565}
     566
     567/* static */
     568bool UITranslator::toCOMPortNumbers(const QString &strName, ulong &uIRQ, ulong &uIOBase)
     569{
     570    for (size_t i = 0; i < RT_ELEMENTS(kComKnownPorts); ++i)
     571        if (strcmp(kComKnownPorts[i].name, strName.toUtf8().data()) == 0)
     572        {
     573            uIRQ = kComKnownPorts[i].IRQ;
     574            uIOBase = kComKnownPorts[i].IOBase;
     575            return true;
     576        }
     577
     578    return false;
     579}
     580
     581/* static */
     582QString UITranslator::highlight(QString strText, bool fToolTip /* = false */)
     583{
     584    /* We should reformat the input strText so that:
     585     * - strings in single quotes will be put inside <nobr> and marked
     586     *   with blue color;
     587     * - UUIDs be put inside <nobr> and marked
     588     *   with green color;
     589     * - replaces new line chars with </p><p> constructs to form paragraphs
     590     *   (note that <p\> and </p> are not appended to the beginning and to the
     591     *    end of the string respectively, to allow the result be appended
     592     *    or prepended to the existing paragraph).
     593     *
     594     *  If @a fToolTip is true, colouring is not applied, only the <nobr> tag
     595     *  is added. Also, new line chars are replaced with <br> instead of <p>. */
     596
     597    QString strFont;
     598    QString uuidFont;
     599    QString endFont;
     600    if (!fToolTip)
     601    {
     602        strFont = "<font color=#0000CC>";
     603        uuidFont = "<font color=#008000>";
     604        endFont = "</font>";
     605    }
     606
     607    /* Replace special entities, '&' -- first! */
     608    strText.replace('&', "&amp;");
     609    strText.replace('<', "&lt;");
     610    strText.replace('>', "&gt;");
     611    strText.replace('\"', "&quot;");
     612
     613    /* Mark strings in single quotes with color: */
     614    QRegExp rx = QRegExp("((?:^|\\s)[(]?)'([^']*)'(?=[:.-!);]?(?:\\s|$))");
     615    rx.setMinimal(true);
     616    strText.replace(rx, QString("\\1%1<nobr>'\\2'</nobr>%2").arg(strFont).arg(endFont));
     617
     618    /* Mark UUIDs with color: */
     619    strText.replace(QRegExp(
     620        "((?:^|\\s)[(]?)"
     621        "(\\{[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}\\})"
     622        "(?=[:.-!);]?(?:\\s|$))"),
     623        QString("\\1%1<nobr>\\2</nobr>%2").arg(uuidFont).arg(endFont));
     624
     625    /* Split to paragraphs at \n chars: */
     626    if (!fToolTip)
     627        strText.replace('\n', "</p><p>");
     628    else
     629        strText.replace('\n', "<br>");
     630
     631    return strText;
     632}
     633
     634/* static */
     635QString UITranslator::emphasize(QString strText)
     636{
     637    /* We should reformat the input string @a strText so that:
     638     * - strings in single quotes will be put inside \<nobr\> and marked
     639     *   with bold style;
     640     * - UUIDs be put inside \<nobr\> and marked
     641     *   with italic style;
     642     * - replaces new line chars with \</p\>\<p\> constructs to form paragraphs
     643     *   (note that \<p\> and \</p\> are not appended to the beginning and to the
     644     *    end of the string respectively, to allow the result be appended
     645     *    or prepended to the existing paragraph). */
     646
     647    QString strEmphStart("<b>");
     648    QString strEmphEnd("</b>");
     649    QString uuidEmphStart("<i>");
     650    QString uuidEmphEnd("</i>");
     651
     652    /* Replace special entities, '&' -- first! */
     653    strText.replace('&', "&amp;");
     654    strText.replace('<', "&lt;");
     655    strText.replace('>', "&gt;");
     656    strText.replace('\"', "&quot;");
     657
     658    /* Mark strings in single quotes with bold style: */
     659    QRegExp rx = QRegExp("((?:^|\\s)[(]?)'([^']*)'(?=[:.-!);]?(?:\\s|$))");
     660    rx.setMinimal(true);
     661    strText.replace(rx, QString("\\1%1<nobr>'\\2'</nobr>%2").arg(strEmphStart).arg(strEmphEnd));
     662
     663    /* Mark UUIDs with italic style: */
     664    strText.replace(QRegExp(
     665        "((?:^|\\s)[(]?)"
     666        "(\\{[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}\\})"
     667        "(?=[:.-!);]?(?:\\s|$))"),
     668        QString("\\1%1<nobr>\\2</nobr>%2").arg(uuidEmphStart).arg(uuidEmphEnd));
     669
     670    /* Split to paragraphs at \n chars: */
     671    strText.replace('\n', "</p><p>");
     672
     673    return strText;
     674}
     675
     676/* static */
     677QString UITranslator::removeAccelMark(QString strText)
     678{
     679    /* In order to support accelerators used in non-alphabet languages
     680     * (e.g. Japanese) that has a form of "(&<L>)" (where <L> is a latin letter),
     681     * this method first searches for this pattern and, if found, removes it as a
     682     * whole. If such a pattern is not found, then the '&' character is simply
     683     * removed from the string. */
     684
     685    QRegExp accel("\\(&[a-zA-Z]\\)");
     686    int iPos = accel.indexIn(strText);
     687    if (iPos >= 0)
     688        strText.remove(iPos, accel.cap().length());
     689    else
     690    {
     691        iPos = strText.indexOf('&');
     692        if (iPos >= 0)
     693            strText.remove(iPos, 1);
     694    }
     695
     696    return strText;
     697}
     698
     699/* static */
     700QString UITranslator::insertKeyToActionText(const QString &strText, const QString &strKey)
     701{
     702#ifdef VBOX_WS_MAC
     703    QString strPattern("%1 (Host+%2)");
     704#else
     705    QString strPattern("%1 \tHost+%2");
     706#endif
     707    if (   strKey.isEmpty()
     708        || strKey.compare("None", Qt::CaseInsensitive) == 0)
     709        return strText;
     710    else
     711        return strPattern.arg(strText).arg(QKeySequence(strKey).toString(QKeySequence::NativeText));
     712}
     713
    229714UITranslator::UITranslator(QObject *pParent /* = 0 */)
    230715    : QTranslator(pParent)
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UITranslator.h

    r90950 r90967  
    2525#include <QTranslator>
    2626
     27/* GUI includes: */
     28#include "UIDefs.h"
     29#include "UILibraryDefs.h"
     30
    2731/** QTranslator subclass for VBox needs. */
    28 class UITranslator : public QTranslator
     32class SHARED_LIBRARY_STUFF UITranslator : public QTranslator
    2933{
    3034    Q_OBJECT;
     
    5054    /** Returns the loaded (active) language ID. */
    5155    static QString languageId();
     56
     57    /** Returns tr("%n year(s)"). */
     58    static QString yearsToString(uint32_t cVal);
     59    /** Returns tr("%n month(s)"). */
     60    static QString monthsToString(uint32_t cVal);
     61    /** Returns tr("%n day(s)"). */
     62    static QString daysToString(uint32_t cVal);
     63    /** Returns tr("%n hour(s)"). */
     64    static QString hoursToString(uint32_t cVal);
     65    /** Returns tr("%n minute(s)"). */
     66    static QString minutesToString(uint32_t cVal);
     67    /** Returns tr("%n second(s)"). */
     68    static QString secondsToString(uint32_t cVal);
     69
     70    /** Returns the decimal separator for the current locale. */
     71    static QChar decimalSep();
     72    /** Returns the regexp string that defines the format of the human-readable size representation. */
     73    static QString sizeRegexp();
     74    /** Parses the given size strText and returns the size value in bytes. */
     75    static quint64 parseSize(const QString &strText);
     76    /** Parses the given size strText and returns the size suffix. */
     77    static SizeSuffix parseSizeSuffix(const QString &strText);
     78    /** Parses the given string @a strText and returns true if it includes a size suffix. */
     79    static bool hasSizeSuffix(const QString &strText);
     80    /** Formats the given @a uSize value in bytes to a human readable string.
     81      * @param  uSize     Brings the size value in bytes.
     82      * @param  enmMode   Brings the conversion mode.
     83      * @param  cDecimal  Brings the number of decimal digits in result. */
     84    static QString formatSize(quint64 uSize, uint cDecimal = 2, FormatSize enmMode = FormatSize_Round);
     85    /** Formats the given @a uNumber to that 'k' is added for thousand, 'M' for million and so on. */
     86    static QString addMetricSuffixToNumber(quint64 uNumber);
     87
     88    /** Returns the list of the standard COM port names (i.e. "COMx"). */
     89    static QStringList COMPortNames();
     90    /** Returns the name of the standard COM port corresponding to the given parameters,
     91      * or "User-defined" (which is also returned when both @a uIRQ and @a uIOBase are 0). */
     92    static QString toCOMPortName(ulong uIRQ, ulong uIOBase);
     93    /** Returns port parameters corresponding to the given standard COM name.
     94      * Returns @c true on success, or @c false if the given port name is not one of the standard names (i.e. "COMx"). */
     95    static bool toCOMPortNumbers(const QString &strName, ulong &uIRQ, ulong &uIOBase);
     96
     97    /** Reformats the input @a strText to highlight it. */
     98    static QString highlight(QString strText, bool fToolTip = false);
     99    /** Reformats the input @a strText to emphasize it. */
     100    static QString emphasize(QString strText);
     101    /** Removes the first occurrence of the accelerator mark (the ampersand symbol) from the given @a strText. */
     102    static QString removeAccelMark(QString strText);
     103    /** Inserts a passed @a strKey into action @a strText. */
     104    static QString insertKeyToActionText(const QString &strText, const QString &strKey);
    52105
    53106private:
     
    75128    /** Holds the singleton instance. */
    76129    static UITranslator *s_pTranslator;
     130
    77131    /** Holds the currently loaded language ID. */
    78     static QString       s_strLoadedLanguageId;
     132    static QString  s_strLoadedLanguageId;
    79133
    80134    /** Holds the loaded data. */
  • trunk/src/VBox/Frontends/VirtualBox/src/guestctrl/UIFileManagerTable.cpp

    r88793 r90967  
    3131#include "QILabel.h"
    3232#include "QILineEdit.h"
     33#include "QIToolBar.h"
    3334#include "QIToolButton.h"
     35#include "UIActionPool.h"
    3436#include "UICommon.h"
    35 #include "UIActionPool.h"
    3637#include "UICustomFileSystemModel.h"
    3738#include "UIErrorString.h"
     39#include "UIFileManager.h"
    3840#include "UIFileManagerGuestTable.h"
    3941#include "UIFileManagerTable.h"
    40 #include "UIFileManager.h"
    4142#include "UIIconPool.h"
    4243#include "UIPathOperations.h"
    43 #include "QIToolBar.h"
     44#include "UITranslator.h"
    4445
    4546/* COM includes: */
     
    14841485/* static */ QString UIFileManagerTable::humanReadableSize(ULONG64 size)
    14851486{
    1486     return uiCommon().formatSize(size);
     1487    return UITranslator::formatSize(size);
    14871488}
    14881489
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMedium.cpp

    r83371 r90967  
    2121
    2222/* GUI includes: */
    23 #include "UIMedium.h"
    2423#include "UICommon.h"
    2524#include "UIConverter.h"
     
    2726#include "UIExtraDataManager.h"
    2827#include "UIIconPool.h"
     28#include "UIMedium.h"
     29#include "UITranslator.h"
    2930
    3031/* COM includes: */
     
    226227            {
    227228                m_uSize = m_medium.GetSize();
    228                 m_strSize = uiCommon().formatSize(m_uSize);
     229                m_strSize = UITranslator::formatSize(m_uSize);
    229230                if (m_type == UIMediumDeviceType_HardDisk)
    230231                {
    231232                    m_uLogicalSize = m_medium.GetLogicalSize();
    232                     m_strLogicalSize = uiCommon().formatSize(m_uLogicalSize);
     233                    m_strLogicalSize = UITranslator::formatSize(m_uLogicalSize);
    233234                }
    234235                else
     
    409410                {
    410411                    /* Not Accessible: */
    411                     m_strToolTip += m_sstrRow.arg("<hr>") + m_sstrRow.arg(UICommon::highlight(m_strLastAccessError, true /* aToolTip */));
     412                    m_strToolTip += m_sstrRow.arg("<hr>") + m_sstrRow.arg(UITranslator::highlight(m_strLastAccessError, true /* aToolTip */));
    412413                }
    413414                else
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumDetailsWidget.cpp

    r90761 r90967  
    3333#include "QITabWidget.h"
    3434#include "QIToolButton.h"
     35#include "UICommon.h"
    3536#include "UIConverter.h"
    3637#include "UIIconPool.h"
     
    3839#include "UIMediumManager.h"
    3940#include "UIMediumSizeEditor.h"
    40 #include "UICommon.h"
     41#include "UITranslator.h"
    4142
    4243/* COM includes: */
     
    777778    if (!pWidget || pWidget == m_pErrorPaneSize)
    778779        m_pErrorPaneSize->setToolTip(tr("Cannot change medium size from <b>%1</b> to <b>%2</b> as storage shrinking is currently not implemented.")
    779                                         .arg(uiCommon().formatSize(m_oldData.m_options.m_uLogicalSize))
    780                                         .arg(uiCommon().formatSize(m_newData.m_options.m_uLogicalSize)));
     780                                        .arg(UITranslator::formatSize(m_oldData.m_options.m_uLogicalSize))
     781                                        .arg(UITranslator::formatSize(m_newData.m_options.m_uLogicalSize)));
    781782}
    782783
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/UIMediumItem.cpp

    r90564 r90967  
    2929#include "UIMessageCenter.h"
    3030#include "UINotificationCenter.h"
     31#include "UITranslator.h"
    3132
    3233/* COM includes: */
     
    143144{
    144145    int iColumn = treeWidget()->sortColumn();
    145     ULONG64 uThisValue = uiCommon().parseSize(      text(iColumn));
    146     ULONG64 uThatValue = uiCommon().parseSize(other.text(iColumn));
     146    ULONG64 uThisValue = UITranslator::parseSize(      text(iColumn));
     147    ULONG64 uThatValue = UITranslator::parseSize(other.text(iColumn));
    147148    return uThisValue && uThatValue ? uThisValue < uThatValue : QTreeWidgetItem::operator<(other);
    148149}
  • trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp

    r90933 r90967  
    2626#include "UINotificationCenter.h"
    2727#include "UINotificationObjects.h"
     28#include "UITranslator.h"
    2829#ifdef VBOX_GUI_WITH_NETWORK_MANAGER
    2930# include "UIDownloaderExtensionPack.h"
     
    428429QString UINotificationProgressMediumCreate::details() const
    429430{
    430     return UINotificationProgress::tr("<b>Location:</b> %1<br><b>Size:</b> %2").arg(m_strLocation, uiCommon().formatSize(m_uSize));
     431    return UINotificationProgress::tr("<b>Location:</b> %1<br><b>Size:</b> %2").arg(m_strLocation, UITranslator::formatSize(m_uSize));
    431432}
    432433
     
    579580{
    580581    return UINotificationProgress::tr("<b>From:</b> %1<br><b>To:</b> %2")
    581                                       .arg(uiCommon().formatSize(m_uFrom),
    582                                            uiCommon().formatSize(m_uTo));
     582                                      .arg(UITranslator::formatSize(m_uFrom),
     583                                           UITranslator::formatSize(m_uTo));
    583584}
    584585
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp

    r89323 r90967  
    2424#include "UIAutoCaptureKeyboardEditor.h"
    2525#include "UICommon.h"
     26#include "UIExtraDataManager.h"
    2627#include "UIGlobalSettingsInput.h"
    2728#include "UIHostComboEditor.h"
    2829#include "UIShortcutConfigurationEditor.h"
    2930#include "UIShortcutPool.h"
    30 #include "UIExtraDataManager.h"
     31#include "UITranslator.h"
    3132
    3233
     
    101102        list << UIShortcutConfigurationItem(strShortcutKey,
    102103                                            shortcut.scope(),
    103                                             UICommon::removeAccelMark(shortcut.description()),
     104                                            UITranslator::removeAccelMark(shortcut.description()),
    104105                                            shortcut.primaryToNativeText(),
    105106                                            shortcut.defaultSequence().toString(QKeySequence::NativeText));
     
    156157    {
    157158        UIValidationMessage message;
    158         message.first = UICommon::removeAccelMark(m_pEditorShortcutConfiguration->tabNameManager());
     159        message.first = UITranslator::removeAccelMark(m_pEditorShortcutConfiguration->tabNameManager());
    159160        message.second << tr("Some items have the same shortcuts assigned.");
    160161        messages << message;
     
    166167    {
    167168        UIValidationMessage message;
    168         message.first = UICommon::removeAccelMark(m_pEditorShortcutConfiguration->tabNameRuntime());
     169        message.first = UITranslator::removeAccelMark(m_pEditorShortcutConfiguration->tabNameRuntime());
    169170        message.second << tr("Some items have the same shortcuts assigned.");
    170171        messages << message;
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsDisplay.cpp

    r87608 r90967  
    3939#include "UIMachineSettingsDisplay.h"
    4040#include "UIScaleFactorEditor.h"
     41#include "UITranslator.h"
    4142#include "UIVideoMemoryEditor.h"
    4243
     
    646647        /* Prepare message: */
    647648        UIValidationMessage message;
    648         message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(0));
     649        message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(0));
    649650
    650651        /* Video RAM amount test: */
     
    658659                message.second << tr("The virtual machine is currently assigned less than <b>%1</b> of video memory "
    659660                                     "which is the minimum amount required to switch to full-screen or seamless mode.")
    660                                      .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp));
     661                                     .arg(UITranslator::formatSize(uNeedBytes, 0, FormatSize_RoundUp));
    661662            }
    662663#ifdef VBOX_WITH_3D_ACCELERATION
     
    670671                                         "and the operating system hint is set to Windows Vista or later. "
    671672                                         "For best performance you should set the machine's video memory to at least <b>%1</b>.")
    672                                          .arg(uiCommon().formatSize(uNeedBytes, 0, FormatSize_RoundUp));
     673                                         .arg(UITranslator::formatSize(uNeedBytes, 0, FormatSize_RoundUp));
    673674                }
    674675            }
     
    706707        /* Prepare message: */
    707708        UIValidationMessage message;
    708         message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(1));
     709        message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(1));
    709710
    710711        /* VRDE Extension Pack presence test: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp

    r88446 r90967  
    3636#include "UINameAndSystemEditor.h"
    3737#include "UIProgressObject.h"
     38#include "UITranslator.h"
    3839
    3940/* COM includes: */
     
    383384
    384385    /* 'Basic' tab validations: */
    385     message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(0));
     386    message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(0));
    386387    message.second.clear();
    387388
     
    407408
    408409    /* 'Encryption' tab validations: */
    409     message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(3));
     410    message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(3));
    410411    message.second.clear();
    411412
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r87460 r90967  
    3333#include "UIConverter.h"
    3434#include "UIErrorString.h"
     35#include "UIExtraDataManager.h"
    3536#include "UIIconPool.h"
    3637#include "UIMachineSettingsNetwork.h"
    37 #include "UIExtraDataManager.h"
    3838#include "UINetworkAttachmentEditor.h"
     39#include "UITranslator.h"
    3940
    4041/* COM includes: */
     
    421422    /* Prepare message: */
    422423    UIValidationMessage message;
    423     message.first = uiCommon().removeAccelMark(tabTitle());
     424    message.first = UITranslator::removeAccelMark(tabTitle());
    424425
    425426    /* Validate alternatives: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSerial.cpp

    r86045 r90967  
    2727#include "QITabWidget.h"
    2828#include "QIWidgetValidator.h"
     29#include "UICommon.h"
    2930#include "UIConverter.h"
     31#include "UIErrorString.h"
    3032#include "UIMachineSettingsSerial.h"
    31 #include "UIErrorString.h"
    32 #include "UICommon.h"
     33#include "UITranslator.h"
    3334
    3435/* COM includes: */
     
    213214    /* Polish port page: */
    214215    ulong uIRQ, uIOBase;
    215     const bool fStd = uiCommon().toCOMPortNumbers(m_pComboNumber->currentText(), uIRQ, uIOBase);
     216    const bool fStd = UITranslator::toCOMPortNumbers(m_pComboNumber->currentText(), uIRQ, uIOBase);
    216217    const KPortMode enmMode = m_pComboMode->currentData().value<KPortMode>();
    217218    m_pCheckBoxPort->setEnabled(m_pParent->isMachineOffline());
     
    239240    /* Load port data: */
    240241    m_pCheckBoxPort->setChecked(portData.m_fPortEnabled);
    241     m_pComboNumber->setCurrentIndex(m_pComboNumber->findText(uiCommon().toCOMPortName(portData.m_uIRQ, portData.m_uIOBase)));
     242    m_pComboNumber->setCurrentIndex(m_pComboNumber->findText(UITranslator::toCOMPortName(portData.m_uIRQ, portData.m_uIOBase)));
    242243    m_pLineEditIRQ->setText(QString::number(portData.m_uIRQ));
    243244    m_pLineEditIOPort->setText("0x" + QString::number(portData.m_uIOBase, 16).toUpper());
     
    283284{
    284285    ulong a, b;
    285     return !uiCommon().toCOMPortNumbers(m_pComboNumber->currentText(), a, b);
     286    return !UITranslator::toCOMPortNumbers(m_pComboNumber->currentText(), a, b);
    286287}
    287288
     
    315316                                     "the TCP \"port\" when in server mode, or \"hostname:port\" when in client mode."));
    316317
    317     m_pComboNumber->setItemText(m_pComboNumber->count() - 1, uiCommon().toCOMPortName(0, 0));
     318    m_pComboNumber->setItemText(m_pComboNumber->count() - 1, UITranslator::toCOMPortName(0, 0));
    318319
    319320    /* Translate combo-boxes content: */
     
    339340{
    340341    ulong uIRQ, uIOBase;
    341     bool fStd = uiCommon().toCOMPortNumbers(strText, uIRQ, uIOBase);
     342    bool fStd = UITranslator::toCOMPortNumbers(strText, uIRQ, uIOBase);
    342343
    343344    m_pLineEditIRQ->setEnabled(!fStd);
     
    416417                    if (m_pLabelNumber)
    417418                        m_pLabelNumber->setBuddy(m_pComboNumber);
    418                     m_pComboNumber->insertItem(0, uiCommon().toCOMPortName(0, 0));
    419                     m_pComboNumber->insertItems(0, uiCommon().COMPortNames());
     419                    m_pComboNumber->insertItem(0, UITranslator::toCOMPortName(0, 0));
     420                    m_pComboNumber->insertItems(0, UITranslator::COMPortNames());
    420421                    pLayoutPortSettings->addWidget(m_pComboNumber, 0, 1);
    421422                }
     
    688689        /* Prepare message: */
    689690        UIValidationMessage message;
    690         message.first = uiCommon().removeAccelMark(m_pTabWidget->tabText(m_pTabWidget->indexOf(pTab)));
     691        message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(m_pTabWidget->indexOf(pTab)));
    691692
    692693        /* Check the port attribute emptiness & uniqueness: */
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsSystem.cpp

    r86045 r90967  
    3030#include "UIBaseMemoryEditor.h"
    3131#include "UIBootOrderEditor.h"
     32#include "UICommon.h"
    3233#include "UIConverter.h"
     34#include "UIErrorString.h"
    3335#include "UIIconPool.h"
    3436#include "UIMachineSettingsSystem.h"
    35 #include "UIErrorString.h"
    36 #include "UICommon.h"
     37#include "UITranslator.h"
    3738
    3839/* COM includes: */
     
    412413        /* Prepare message: */
    413414        UIValidationMessage message;
    414         message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(0));
     415        message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(0));
    415416
    416417        /* RAM amount test: */
     
    422423                "Not enough memory is left for the host operating system. Please select a smaller amount.")
    423424                .arg((unsigned)qRound((double)m_pEditorBaseMemory->maxRAMAlw() / uFullSize * 100.0))
    424                 .arg(uiCommon().formatSize((uint64_t)uFullSize * _1M));
     425                .arg(UITranslator::formatSize((uint64_t)uFullSize * _1M));
    425426            fPass = false;
    426427        }
     
    431432                "There might not be enough memory left for the host operating system. Please consider selecting a smaller amount.")
    432433                .arg((unsigned)qRound((double)m_pEditorBaseMemory->maxRAMOpt() / uFullSize * 100.0))
    433                 .arg(uiCommon().formatSize((uint64_t)uFullSize * _1M));
     434                .arg(UITranslator::formatSize((uint64_t)uFullSize * _1M));
    434435        }
    435436
     
    461462        /* Prepare message: */
    462463        UIValidationMessage message;
    463         message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(1));
     464        message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(1));
    464465
    465466        /* VCPU amount test: */
     
    554555        /* Prepare message: */
    555556        UIValidationMessage message;
    556         message.first = UICommon::removeAccelMark(m_pTabWidget->tabText(2));
     557        message.first = UITranslator::removeAccelMark(m_pTabWidget->tabText(2));
    557558
    558559        /* HW Virt Ex test: */
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotDetailsWidget.cpp

    r88862 r90967  
    3434#include "QIDialogButtonBox.h"
    3535#include "QIFlowLayout.h"
     36#include "UICommon.h"
    3637#include "UIConverter.h"
    3738#include "UIDesktopWidgetWatchdog.h"
     
    3940#include "UISnapshotDetailsWidget.h"
    4041#include "UIMessageCenter.h"
    41 #include "UICommon.h"
     42#include "UITranslator.h"
    4243#include "VBoxUtils.h"
    4344
     
    19131914            /* Compose the data: */
    19141915            QStringList aInfo;
    1915             aInfo << uiCommon().toCOMPortName(comPort.GetIRQ(), comPort.GetIOBase());
     1916            aInfo << UITranslator::toCOMPortName(comPort.GetIRQ(), comPort.GetIOBase());
    19161917            if (   enmMode == KPortMode_HostPipe
    19171918                || enmMode == KPortMode_HostDevice
  • trunk/src/VBox/Frontends/VirtualBox/src/snapshots/UISnapshotPane.cpp

    r90737 r90967  
    3232/* GUI includes: */
    3333#include "QIMessageBox.h"
     34#include "QIToolBar.h"
    3435#include "QITreeWidget.h"
    3536#include "UIActionPoolManager.h"
     
    4344#include "UISnapshotPane.h"
    4445#include "UITakeSnapshotDialog.h"
    45 #include "QIToolBar.h"
     46#include "UITranslator.h"
    4647#include "UIVirtualBoxEventHandler.h"
    4748#include "UIWizardCloneVM.h"
     
    357358    {
    358359        strAge = tr("%1 (%2 ago)", "date time (how long ago)")
    359                     .arg(then.toString(Qt::LocalDate), UICommon::daysToString(then.secsTo(now) / 60 / 60 / 24));
     360                    .arg(then.toString(Qt::LocalDate), UITranslator::daysToString(then.secsTo(now) / 60 / 60 / 24));
    360361        enmAgeFormat = SnapshotAgeFormat_InDays;
    361362    }
     
    363364    {
    364365        strAge = tr("%1 (%2 ago)", "date time (how long ago)")
    365                     .arg(then.toString(Qt::LocalDate), UICommon::hoursToString(then.secsTo(now) / 60 / 60));
     366                    .arg(then.toString(Qt::LocalDate), UITranslator::hoursToString(then.secsTo(now) / 60 / 60));
    366367        enmAgeFormat = SnapshotAgeFormat_InHours;
    367368    }
     
    369370    {
    370371        strAge = tr("%1 (%2 ago)", "date time (how long ago)")
    371                     .arg(then.toString(Qt::LocalDate), UICommon::minutesToString(then.secsTo(now) / 60));
     372                    .arg(then.toString(Qt::LocalDate), UITranslator::minutesToString(then.secsTo(now) / 60));
    372373        enmAgeFormat = SnapshotAgeFormat_InMinutes;
    373374    }
     
    375376    {
    376377        strAge = tr("%1 (%2 ago)", "date time (how long ago)")
    377                     .arg(then.toString(Qt::LocalDate), UICommon::secondsToString(then.secsTo(now)));
     378                    .arg(then.toString(Qt::LocalDate), UITranslator::secondsToString(then.secsTo(now)));
    378379        enmAgeFormat = SnapshotAgeFormat_InSeconds;
    379380    }
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediumSizeEditor.cpp

    r90761 r90967  
    2727#include "UIConverter.h"
    2828#include "UIMediumSizeEditor.h"
     29#include "UITranslator.h"
    2930
    3031/* COM includes: */
     
    4849    /* Prepare: */
    4950    prepare();
    50     QString strRegEx = QString("[^\\d%1]").arg(uiCommon().decimalSep());
     51    QString strRegEx = QString("[^\\d%1]").arg(UITranslator::decimalSep());
    5152    m_regExNonDigitOrSeparator = QRegularExpression(strRegEx);
    5253}
     
    6263    m_pSlider->blockSignals(false);
    6364    m_pEditor->blockSignals(true);
    64     m_pEditor->setText(uiCommon().formatSize(m_uSize));
    65     m_enmSizeSuffix = uiCommon().parseSizeSuffix(m_pEditor->text());
     65    m_pEditor->setText(UITranslator::formatSize(m_uSize));
     66    m_enmSizeSuffix = UITranslator::parseSizeSuffix(m_pEditor->text());
    6667    m_pEditor->blockSignals(false);
    6768
     
    7374{
    7475    /* Translate labels: */
    75     m_pLabelMinSize->setText(uiCommon().formatSize(m_uSizeMin));
    76     m_pLabelMaxSize->setText(uiCommon().formatSize(m_uSizeMax));
     76    m_pLabelMinSize->setText(UITranslator::formatSize(m_uSizeMin));
     77    m_pLabelMaxSize->setText(UITranslator::formatSize(m_uSizeMax));
    7778
    7879    /* Translate fields: */
     
    9091    /* Update the other widget: */
    9192    m_pEditor->blockSignals(true);
    92     m_pEditor->setText(uiCommon().formatSize(m_uSize));
    93     m_enmSizeSuffix = uiCommon().parseSizeSuffix(m_pEditor->text());
     93    m_pEditor->setText(UITranslator::formatSize(m_uSize));
     94    m_enmSizeSuffix = UITranslator::parseSizeSuffix(m_pEditor->text());
    9495    m_pEditor->blockSignals(false);
    9596    /* Update the tool-tips: */
     
    111112
    112113    /* Update the current size: */
    113     m_uSize = checkSectorSizeAlignment(uiCommon().parseSize(strSizeString));
     114    m_uSize = checkSectorSizeAlignment(UITranslator::parseSize(strSizeString));
    114115
    115116    /* Update the other widget: */
     
    126127{
    127128    /* Try to update the m_enmSizeSuffix: */
    128     if (uiCommon().hasSizeSuffix(strSizeString))
    129         m_enmSizeSuffix = uiCommon().parseSizeSuffix(strSizeString);
     129    if (UITranslator::hasSizeSuffix(strSizeString))
     130        m_enmSizeSuffix = UITranslator::parseSizeSuffix(strSizeString);
    130131
    131132    QString strOnlyDigits(strSizeString);
     
    198199            m_pEditor->setFixedWidthByText("88888.88 MB");
    199200            m_pEditor->setAlignment(Qt::AlignRight);
    200             m_pEditor->setValidator(new QRegExpValidator(QRegExp(uiCommon().sizeRegexp()), this));
     201            m_pEditor->setValidator(new QRegExpValidator(QRegExp(UITranslator::sizeRegexp()), this));
    201202            connect(m_pEditor, &QILineEdit::textChanged,
    202203                    this, &UIMediumSizeEditor::sltSizeEditorTextChanged);
     
    287288void UIMediumSizeEditor::updateSizeToolTips(qulonglong uSize)
    288289{
    289     const QString strToolTip = tr("<nobr>%1 (%2 B)</nobr>").arg(uiCommon().formatSize(uSize)).arg(uSize);
     290    const QString strToolTip = tr("<nobr>%1 (%2 B)</nobr>").arg(UITranslator::formatSize(uSize)).arg(uSize);
    290291    m_pSlider->setToolTip(strToolTip);
    291292    m_pEditor->setToolTip(strToolTip);
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIProgressDialog.cpp

    r86772 r90967  
    3434#include "UIProgressEventHandler.h"
    3535#include "UISpecialControls.h"
    36 #include "UICommon.h"
     36#include "UITranslator.h"
    3737#ifdef VBOX_WS_MAC
    3838# include "VBoxUtils-darwin.h"
     
    423423        iHours   -= iDays    * 24;
    424424
    425         const QString strDays = UICommon::daysToString(iDays);
    426         const QString strHours = UICommon::hoursToString(iHours);
    427         const QString strMinutes = UICommon::minutesToString(iMinutes);
    428         const QString strSeconds = UICommon::secondsToString(iSeconds);
     425        const QString strDays = UITranslator::daysToString(iDays);
     426        const QString strHours = UITranslator::hoursToString(iHours);
     427        const QString strMinutes = UITranslator::minutesToString(iMinutes);
     428        const QString strSeconds = UITranslator::secondsToString(iSeconds);
    429429
    430430        const QString strTwoComp = tr("%1, %2 remaining", "You may wish to translate this more like \"Time remaining: %1, %2\"");
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette