VirtualBox

Ignore:
Timestamp:
Aug 26, 2019 7:51:16 AM (6 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
132894
Message:

FE/Qt: bugref:9510: Adding info labels for the vm exit metric

Location:
trunk/src/VBox/Frontends/VirtualBox/src/runtime/information
Files:
2 edited

Legend:

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

    r80419 r80420  
    666666    {
    667667        int iTextX = m_iMarginLeft + i * iChartWidth / (float) (iXSubAxisCount + 1);
    668         QString strCurentSec = QString::number(iTotalSeconds - i * iTotalSeconds / (float)(iXSubAxisCount + 1));
    669         int iTextWidth = fontMetrics.width(strCurentSec);
     668        QString strCurrentSec = QString::number(iTotalSeconds - i * iTotalSeconds / (float)(iXSubAxisCount + 1));
     669        int iTextWidth = fontMetrics.width(strCurrentSec);
    670670        if (i == 0)
    671671        {
    672             strCurentSec += " " + m_strXAxisLabel;
    673             painter.drawText(iTextX, height() - m_iMarginBottom + iFontHeight, strCurentSec);
     672            strCurrentSec += " " + m_strXAxisLabel;
     673            painter.drawText(iTextX, height() - m_iMarginBottom + iFontHeight, strCurrentSec);
    674674        }
    675675        else
    676             painter.drawText(iTextX - 0.5 * iTextWidth, height() - m_iMarginBottom + iFontHeight, strCurentSec);
     676            painter.drawText(iTextX - 0.5 * iTextWidth, height() - m_iMarginBottom + iFontHeight, strCurrentSec);
    677677    }
    678678}
     
    967967    m_strDiskIOInfoLabelReadTotal = QApplication::translate("UIVMInformationDialog", "Total Read");
    968968    iMaximum = qMax(iMaximum, m_strDiskIOInfoLabelReadTotal.length());
     969    m_strVMExitInfoLabelTitle = QApplication::translate("UIVMInformationDialog", "VM Exits");
     970    iMaximum = qMax(iMaximum, m_strVMExitInfoLabelTitle.length());
     971    m_strVMExitLabelCurrent = QApplication::translate("UIVMInformationDialog", "Current");
     972    iMaximum = qMax(iMaximum, m_strVMExitLabelCurrent.length());
     973    m_strVMExitLabelTotal = QApplication::translate("UIVMInformationDialog", "Total");
     974    iMaximum = qMax(iMaximum, m_strVMExitLabelTotal.length());
    969975
    970976
     
    12851291    {
    12861292        QString strInfo;
    1287         QString strReceiveColor;
    12881293        if (m_infoLabels[m_strCPUMetricName]->isEnabled())
    12891294            strInfo = QString("<b>%1</b></b><br/><font color=\"%2\">%3: %4%5</font><br/><font color=\"%6\">%7: %8%9</font>")
     
    14281433    qulonglong iMaximum = qMax(VMExitMetric.maximum(), iRate);
    14291434    VMExitMetric.setMaximum(iMaximum);
     1435
     1436    if (m_infoLabels.contains(m_strVMExitMetricName)  && m_infoLabels[m_strVMExitMetricName])
     1437    {
     1438        QString strInfo;
     1439        if (m_infoLabels[m_strVMExitMetricName]->isEnabled())
     1440            strInfo = QString("<b>%1</b></b><br/>%2: %3 %4<br/>%5: %6 %7")
     1441                .arg(m_strVMExitInfoLabelTitle)
     1442                .arg(m_strVMExitLabelCurrent).arg(QString::number(iRate)).arg(VMExitMetric.unit())
     1443                .arg(m_strVMExitLabelTotal).arg(QString::number(uTotalVMExits)).arg(VMExitMetric.unit());
     1444        else
     1445            strInfo = QString("<b>%1</b><br/>%2%3").arg(m_strVMExitInfoLabelTitle).arg("--").arg("%");
     1446        m_infoLabels[m_strVMExitMetricName]->setText(strInfo);
     1447    }
     1448    if (m_charts.contains(m_strVMExitMetricName))
     1449        m_charts[m_strVMExitMetricName]->update();
    14301450}
    14311451
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIInformationRuntime.h

    r80419 r80420  
    221221        QString m_strDiskIOInfoLabelWrittenTotal;
    222222        QString m_strDiskIOInfoLabelReadTotal;
     223        /** VM Exit info label strings. */
     224        QString m_strVMExitInfoLabelTitle;
     225        QString m_strVMExitLabelCurrent;
     226        QString m_strVMExitLabelTotal;
    223227    /** @} */
    224228    /** The following string is used while querrying CMachineDebugger. */
Note: See TracChangeset for help on using the changeset viewer.

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