VirtualBox

Changeset 80520 in vbox


Ignore:
Timestamp:
Aug 30, 2019 6:30:16 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9510: Caching some more translatable strings

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.cpp

    r80495 r80520  
    8989
    9090    void runTimeAttributes();
     91    QString screenResolutions();
     92
    9193    void insertInfoLine(InfoLine enmInfoLine, const QString& strLabel, const QString &strInfo);
    9294    void computeMinimumWidth();
     
    99101        QString m_strTableTitle;
    100102        QString m_strScreenResolutionLabel;
     103        QString m_strMonitorTurnedOff;
    101104        QString m_strUptimeLabel;
    102105        QString m_strClipboardModeLabel;
     
    106109        QString m_strUnrestrictedExecutionLabel;
    107110        QString m_strParavirtualizationLabel;
     111        QString m_strActive;
     112        QString m_strInactive;
     113        QString m_strNotAvailable;
    108114        QString m_strGuestAdditionsLabel;
    109115        QString m_strGuestOSTypeLabel;
    110116        QString m_strRemoteDesktopLabel;
     117        QString m_strNotSet;
     118        QString m_strNotDetected;
    111119    /** @} */
    112120
     
    236244    m_strTableTitle = QApplication::translate("UIVMInformationDialog", "Runtime Attributes");
    237245    m_strScreenResolutionLabel = QApplication::translate("UIVMInformationDialog", "Screen Resolution");
     246    m_strMonitorTurnedOff = QApplication::translate("UIVMInformationDialog", "turned off");
    238247    m_strUptimeLabel = QApplication::translate("UIVMInformationDialog", "VM Uptime");
    239248    m_strClipboardModeLabel = QApplication::translate("UIVMInformationDialog", "Clipboard Mode");
     
    243252    m_strUnrestrictedExecutionLabel = QApplication::translate("UIVMInformationDialog", "Unrestricted Execution");
    244253    m_strParavirtualizationLabel = QApplication::translate("UIVMInformationDialog", "Paravirtualization Interface");
     254    m_strActive = QApplication::translate("UIVMInformationDialog", "Active");
     255    m_strInactive = QApplication::translate("UIVMInformationDialog", "Inactive");
     256    m_strNotAvailable = QApplication::translate("UIVMInformationDialog", "Not Available");
    245257    m_strGuestAdditionsLabel = QApplication::translate("UIVMInformationDialog", "Guest Additions");
    246258    m_strGuestOSTypeLabel = QApplication::translate("UIVMInformationDialog", "Guest OS Type");
    247259    m_strRemoteDesktopLabel = QApplication::translate("UIVMInformationDialog", "Remote Desktop Server Port");
     260    m_strNotSet = QApplication::translate("UIVMInformationDialog", "not set");
     261    m_strNotDetected = QApplication::translate("UIVMInformationDialog", "Not Detected");
    248262}
    249263
     
    266280    setItem(iRow, 1, new QTableWidgetItem(strInfo, enmInfoLine));
    267281    setRowHeight(iRow, 2 * iMargin + m_iFontHeight);
     282}
     283
     284QString UIRuntimeInfoWidget::screenResolutions()
     285{
     286    QString strResolutions;
     287    return strResolutions;
    268288}
    269289
     
    289309        {
    290310            strResolution += QString(" ");
    291             strResolution += QString(QApplication::translate("UIVMInformationDialog", "turned off"));
     311            strResolution += m_strMonitorTurnedOff;
    292312        }
    293313        aResolutions[iScreen] = strResolution;
     
    315335    /* Determine virtualization attributes: */
    316336    QString strVirtualization = debugger.GetHWVirtExEnabled() ?
    317         QApplication::translate("UIVMInformationDialog", "Active") :
    318         QApplication::translate("UIVMInformationDialog", "Inactive");
     337        m_strActive : m_strInactive;
    319338
    320339    QString strExecutionEngine;
     
    334353            RT_FALL_THRU();
    335354        case KVMExecutionEngine_NotSet:
    336             strExecutionEngine = QApplication::translate("UIVMInformationDialog", "not set");
     355            strExecutionEngine = m_strNotSet;
    337356            break;
    338357    }
    339358    QString strNestedPaging = debugger.GetHWVirtExNestedPagingEnabled() ?
    340         QApplication::translate("UIVMInformationDialog", "Active"):
    341         QApplication::translate("UIVMInformationDialog", "Inactive");
     359        m_strActive : m_strInactive;
    342360
    343361    QString strUnrestrictedExecution = debugger.GetHWVirtExUXEnabled() ?
    344         QApplication::translate("UIVMInformationDialog", "Active"):
    345         QApplication::translate("UIVMInformationDialog", "Inactive");
    346 
    347         QString strParavirtProvider = gpConverter->toString(m_machine.GetEffectiveParavirtProvider());
     362        m_strActive : m_strInactive;
     363
     364    QString strParavirtProvider = gpConverter->toString(m_machine.GetEffectiveParavirtProvider());
    348365
    349366    /* Guest information: */
     
    351368    QString strGAVersion = guest.GetAdditionsVersion();
    352369    if (strGAVersion.isEmpty())
    353         strGAVersion = tr("Not Detected", "guest additions");
     370        strGAVersion = m_strNotDetected;
    354371    else
    355372    {
     
    360377    QString strOSType = guest.GetOSTypeId();
    361378    if (strOSType.isEmpty())
    362         strOSType = tr("Not Detected", "guest os type");
     379        strOSType = m_strNotDetected;
    363380    else
    364381        strOSType = uiCommon().vmGuestOSTypeDescription(strOSType);
     
    367384    int iVRDEPort = m_console.GetVRDEServerInfo().GetPort();
    368385    QString strVRDEInfo = (iVRDEPort == 0 || iVRDEPort == -1)?
    369         tr("Not Available", "details report (VRDE server port)") :
    370         QString("%1").arg(iVRDEPort);
     386        m_strNotAvailable : QString("%1").arg(iVRDEPort);
    371387
    372388    /* Searching for longest string: */
     
    539555{
    540556    int iFontSize = 24;
    541 
    542     //const QString &strText = m_pMetric->name();
    543557    foreach (const QString &strText, m_textList)
    544558    {
    545559        m_font.setPixelSize(iFontSize);
    546 
    547560        do{
    548561            int iWidth = QFontMetrics(m_font).width(strText);
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