VirtualBox

Ignore:
Timestamp:
Jul 13, 2020 9:17:08 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9686. Moving UIPerformanceMonitor to UICommon.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/Makefile.kmk

    r85111 r85297  
    682682VirtualBoxVM_QT_MOCHDRS = \
    683683        src/globals/UIStarter.h \
    684         src/monitor/performance/UIPerformanceMonitor.h \
    685684        src/runtime/UIConsoleEventHandler.h \
    686685        src/runtime/UIFrameBuffer.h \
     
    815814        src/logviewer/UIVMLogViewerTextEdit.h \
    816815        src/logviewer/UIVMLogViewerWidget.h \
     816        src/monitor/performance/UIPerformanceMonitor.h \
    817817        src/medium/UIFDCreationDialog.h \
    818818        src/medium/UIMediumEnumerator.h \
     
    945945#
    946946VirtualBoxVM_QT_MOCSRCS = \
    947         src/monitor/performance/UIPerformanceMonitor.cpp \
    948947        src/runtime/UIConsoleEventHandler.cpp \
    949948        src/runtime/UIFrameBuffer.cpp \
     
    980979        src/logviewer/UIVMLogViewerSearchPanel.cpp \
    981980        src/logviewer/UIVMLogViewerTextEdit.cpp \
     981        src/monitor/performance/UIPerformanceMonitor.cpp \
    982982        src/medium/UIMediumEnumerator.cpp \
    983983        src/medium/viso/UIVisoContentBrowser.cpp \
     
    11601160        src/main.cpp \
    11611161        src/globals/UIStarter.cpp \
    1162         src/monitor/performance/UIPerformanceMonitor.cpp \
    11631162        src/runtime/UIConsoleEventHandler.cpp \
    11641163        src/runtime/UIFrameBuffer.cpp \
     
    13211320        src/logviewer/UIVMLogViewerWidget.cpp \
    13221321        src/monitor/UIMonitorCommon.cpp \
     1322        src/monitor/performance/UIPerformanceMonitor.cpp \
    13231323        src/medium/UIFDCreationDialog.cpp \
    13241324        src/medium/UIMedium.cpp \
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.cpp

    r83801 r85297  
    3030#include "UICommon.h"
    3131#include "UIPerformanceMonitor.h"
    32 #include "UISession.h"
    3332
    3433/* COM includes: */
     
    690689}
    691690
    692 
    693691/*********************************************************************************************************************************
    694692*   UIPerformanceMonitor implementation.                                                                              *
    695693*********************************************************************************************************************************/
    696694
    697 UIPerformanceMonitor::UIPerformanceMonitor(QWidget *pParent, const CMachine &machine, const CConsole &console, const UISession *pSession)
     695UIPerformanceMonitor::UIPerformanceMonitor(QWidget *pParent, const CMachine &machine, const CConsole &console)
    698696    : QIWithRetranslateUI<QWidget>(pParent)
    699697    , m_fGuestAdditionsAvailable(false)
     
    713711        m_comGuest = m_console.GetGuest();
    714712    m_fGuestAdditionsAvailable = guestAdditionsAvailable(6 /* minimum major version */);
    715     connect(pSession, &UISession::sigAdditionsStateChange, this, &UIPerformanceMonitor::sltGuestAdditionsStateChange);
    716713
    717714    prepareMetrics();
     
    862859    ++m_iTimeStep;
    863860
    864    if (m_metrics.contains(m_strRAMMetricName))
    865    {
    866        quint64 iTotalRAM = 0;
    867        quint64 iFreeRAM = 0;
    868        UIMonitorCommon::getRAMLoad(m_performanceMonitor, m_nameList, m_objectList, iTotalRAM, iFreeRAM);
    869        updateRAMGraphsAndMetric(iTotalRAM, iFreeRAM);
    870    }
     861    if (m_metrics.contains(m_strRAMMetricName))
     862    {
     863        quint64 iTotalRAM = 0;
     864        quint64 iFreeRAM = 0;
     865        UIMonitorCommon::getRAMLoad(m_performanceMonitor, m_nameList, m_objectList, iTotalRAM, iFreeRAM);
     866        updateRAMGraphsAndMetric(iTotalRAM, iFreeRAM);
     867    }
    871868
    872869    /* Update the CPU load chart with values we get from IMachineDebugger::getCPULoad(..): */
     
    904901}
    905902
    906 /**
    907  *
    908  * @returns
    909  */
    910903void UIPerformanceMonitor::sltGuestAdditionsStateChange()
    911904{
  • trunk/src/VBox/Frontends/VirtualBox/src/monitor/performance/UIPerformanceMonitor.h

    r83346 r85297  
    100100  * two sources of the performance metrics. Unfortunately these two have very distinct APIs resulting a bit too much
    101101  * special casing etc.*/
    102 class UIPerformanceMonitor : public QIWithRetranslateUI<QWidget>
     102class  SHARED_LIBRARY_STUFF UIPerformanceMonitor : public QIWithRetranslateUI<QWidget>
    103103{
    104104    Q_OBJECT;
     
    109109      * @param machine is machine reference.
    110110      * @param console is machine console reference. */
    111     UIPerformanceMonitor(QWidget *pParent, const CMachine &machine, const CConsole &console, const UISession *pSession);
     111    UIPerformanceMonitor(QWidget *pParent, const CMachine &machine, const CConsole &console);
    112112    ~UIPerformanceMonitor();
     113
     114 public slots:
     115
     116    /** @name These functions are connected to API events and implement necessary updates.
     117      * @{ */
     118        void sltGuestAdditionsStateChange();
     119    /** @} */
    113120
    114121protected:
     
    120127    /** Reads the metric values for several sources and calls corresponding update functions. */
    121128    void sltTimeout();
    122     /** @name These functions are connected to API events and implement necessary updates.
    123       * @{ */
    124         void sltGuestAdditionsStateChange();
    125     /** @} */
    126129
    127130private:
  • trunk/src/VBox/Frontends/VirtualBox/src/runtime/information/UIVMInformationDialog.cpp

    r83345 r85297  
    200200        /* Create Performance Monitor tab: */
    201201        UIPerformanceMonitor *pPerformanceMonitorWidget =
    202             new UIPerformanceMonitor(this, m_pMachineWindow->machine(), m_pMachineWindow->console(), m_pMachineWindow->uisession());
     202            new UIPerformanceMonitor(this, m_pMachineWindow->machine(), m_pMachineWindow->console());
    203203        if (pPerformanceMonitorWidget)
    204204        {
     205            connect(m_pMachineWindow->uisession(), &UISession::sigAdditionsStateChange,
     206                    pPerformanceMonitorWidget, &UIPerformanceMonitor::sltGuestAdditionsStateChange);
    205207            m_tabs.insert(2, pPerformanceMonitorWidget);
    206208            m_pTabWidget->addTab(m_tabs.value(2), QString());
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