VirtualBox

Changeset 42553 in vbox


Ignore:
Timestamp:
Aug 2, 2012 5:36:40 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6234: Support for VM groups: Restoring snapshot-view auto-update functionality, using valid events for that.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMainEventListener.cpp

    r41587 r42553  
    3232#include "CMachineRegisteredEvent.h"
    3333#include "CSessionStateChangedEvent.h"
     34#include "CSnapshotTakenEvent.h"
     35#include "CSnapshotDeletedEvent.h"
    3436#include "CSnapshotChangedEvent.h"
    3537#include "CMousePointerShapeChangedEvent.h"
     
    128130            break;
    129131        }
    130         /* Not used:
    131132        case KVBoxEventType_OnSnapshotTaken:
     133        {
     134            CSnapshotTakenEvent es(pEvent);
     135            emit sigSnapshotChange(es.GetMachineId(), es.GetSnapshotId());
     136            break;
     137        }
    132138        case KVBoxEventType_OnSnapshotDeleted:
    133          */
     139        {
     140            CSnapshotDeletedEvent es(pEvent);
     141            emit sigSnapshotChange(es.GetMachineId(), es.GetSnapshotId());
     142            break;
     143        }
    134144        case KVBoxEventType_OnSnapshotChanged:
    135145        {
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp

    r42547 r42553  
    135135}
    136136
     137void UISelectorWindow::sltSnapshotChanged(QString strId)
     138{
     139    /* Get current item: */
     140    UIVMItem *pCurrentItem = currentItem();
     141
     142    /* Make sure current item present: */
     143    if (!pCurrentItem)
     144        return;
     145
     146    /* If signal is for current item: */
     147    if (pCurrentItem->id() == strId)
     148        m_pVMDesktop->updateSnapshots(pCurrentItem, pCurrentItem->machine());
     149}
     150
    137151void UISelectorWindow::sltDetailsViewIndexChanged(int iWidgetIndex)
    138152{
     
    784798            m_pContainer->setCurrentWidget(m_pDetails);
    785799
    786         CMachine m = pItem->machine();
    787         QList<CMachine> machines;
    788         for (int i = 0; i < items.size(); ++i)
    789             machines << items[i]->machine();
    790800        KMachineState state = pItem->machineState();
    791801
     
    793803            m_pDetails->setItems(currentItems());
    794804        if (fRefreshSnapshots)
    795             m_pVMDesktop->updateSnapshots(pItem, m);
     805            m_pVMDesktop->updateSnapshots(pItem, pItem->machine());
    796806
    797807        /* Update the Start button action appearance: */
     
    14511461    connect(&vboxGlobal(), SIGNAL(sigTrayIconShow(bool)), this, SLOT(sltTrayIconShow(bool)));
    14521462#endif /* VBOX_GUI_WITH_SYSTRAY */
     1463
     1464    /* Global event handlers: */
     1465    connect(gVBoxEvents, SIGNAL(sigSnapshotChange(QString, QString)), this, SLOT(sltSnapshotChanged(QString)));
    14531466}
    14541467
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h

    r42542 r42553  
    6262
    6363private slots:
     64
     65    /* Handler: Snapshot-view stuff: */
     66    void sltSnapshotChanged(QString strId);
    6467
    6568    /* Handler: Details-view stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVirtualBoxEventHandler.cpp

    r41587 r42553  
    6161        << KVBoxEventType_OnMachineRegistered
    6262        << KVBoxEventType_OnSessionStateChanged
     63        << KVBoxEventType_OnSnapshotTaken
     64        << KVBoxEventType_OnSnapshotDeleted
    6365        << KVBoxEventType_OnSnapshotChanged;
    6466
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