VirtualBox

Changeset 102773 in vbox


Ignore:
Timestamp:
Jan 5, 2024 12:56:26 PM (11 months ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10501. Dealing with cloud vm state changes a bit better.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/activity/vmactivity/UIVMActivityMonitor.cpp

    r102748 r102773  
    757757            const QQueue<QString> *labels = m_pMetric->labels();
    758758            int iDataIndex = qMin(labels->size() - 1, iTimeIndex - (m_iMaximumQueueSize - maxDataSize()));
    759             strAxisText = UIVMActivityMonitorCloud::formatCloudTimeStamp(labels->at(iDataIndex));
     759            if (iDataIndex >= 0)
     760                strAxisText = UIVMActivityMonitorCloud::formatCloudTimeStamp(labels->at(iDataIndex));
    760761        }
    761762        else
     
    19501951    resetDiskIOInfoLabel();
    19511952    resetRAMInfoLabel();
     1953
     1954    if (m_comMachine.isOk())
     1955    {
     1956        m_ReadListProgressTask = new UIProgressTaskReadCloudMachineMetricList(this, m_comMachine);
     1957        if (m_ReadListProgressTask)
     1958            connect(m_ReadListProgressTask, &UIProgressTaskReadCloudMachineMetricList::sigMetricListReceived,
     1959                    this, &UIVMActivityMonitorCloud::sltMetricNameListingComplete);
     1960    }
     1961    /* Start the timer: */
     1962    start();
    19521963}
    19531964
     
    19942005    if (!m_comMachine.isOk())
    19952006        return;
    1996 
    1997     m_ReadListProgressTask = new UIProgressTaskReadCloudMachineMetricList(this, comMachine);
    1998     if (m_ReadListProgressTask)
    1999     {
    2000         connect(m_ReadListProgressTask, &UIProgressTaskReadCloudMachineMetricList::sigMetricListReceived,
    2001                 this, &UIVMActivityMonitorCloud::sltMetricNameListingComplete);
    2002         m_ReadListProgressTask->start();
    2003     }
     2007    setEnabled(m_comMachine.GetState() == KCloudMachineState_Running);
    20042008}
    20052009
     
    20722076void UIVMActivityMonitorCloud::obtainDataAndUpdate()
    20732077{
     2078    /* No need to refresh cached values of the ICloudMachine since it has been already done
     2079     * by the VM list related class. Just fetch the machine attribute here:  */
     2080    if (!m_comMachine.isOk() || m_comMachine.GetState() != KCloudMachineState_Running)
     2081    {
     2082        setEnabled(false);
     2083        return;
     2084    }
     2085    if (!isEnabled())
     2086        setEnabled(true);
     2087    if (m_ReadListProgressTask && !m_ReadListProgressTask->isRunning())
     2088        m_ReadListProgressTask->start();
    20742089    foreach (const KMetricType &enmMetricType, m_availableMetricTypes)
    20752090    {
     
    23422357QString UIVMActivityMonitorCloud::formatCloudTimeStamp(const QString &strInput)
    23432358{
     2359    if (strInput.isEmpty())
     2360        return QString();
    23442361    QDateTime dateTime = QDateTime::fromString(strInput, Qt::RFC2822Date);
    23452362
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