VirtualBox

Ignore:
Timestamp:
Jun 19, 2017 12:42:27 PM (8 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
116208
Message:

FE/Qt: bugref:8901: Selector UI: Tools pane: Snapshot pane: Implement 'change snapshot' event handler.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp

    r67471 r67472  
    742742            strMachineId.toUtf8().constData(), strSnapshotId.toUtf8().constData()));
    743743
    744     // TODO: Refresh only necessary bits.
    745     /* Refresh everything: */
    746     refreshAll();
     744    /* Prepare result: */
     745    bool fSuccess = true;
     746    {
     747        /* Prevent snapshot editing in the meantime: */
     748        QWriteLocker locker(m_pLockReadWrite);
     749
     750        /* Search for an existing item with such id: */
     751        UISnapshotItem *pItem = findItem(strSnapshotId);
     752        fSuccess = pItem;
     753
     754        /* Update the item: */
     755        if (fSuccess)
     756        {
     757            /* Recache it: */
     758            pItem->recache();
     759            /* And choose it again if it's current one (to update details-widget): */
     760            if (UISnapshotItem::toSnapshotItem(m_pSnapshotTree->currentItem()) == pItem)
     761                sltHandleCurrentItemChange();
     762
     763            LogRel(("GUI: Snapshot tree update successful!\n"));
     764        }
     765    }
     766
     767    /* Just refresh everything as fallback: */
     768    if (!fSuccess)
     769    {
     770        LogRel(("GUI: Snapshot tree update failed! Rebuilding from scratch...\n"));
     771        return refreshAll();
     772    }
    747773}
    748774
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