VirtualBox

儲存庫 vbox 的更動 67473


忽略:
時間撮記:
2017-6-19 下午12:48:41 (7 年 以前)
作者:
vboxsync
訊息:

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

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/UISnapshotPane.cpp

    r67472 r67473  
    782782            strMachineId.toUtf8().constData(), strSnapshotId.toUtf8().constData()));
    783783
    784     // TODO: Refresh only necessary bits.
    785     /* Refresh everything: */
    786     refreshAll();
     784    /* Prepare result: */
     785    bool fSuccess = true;
     786    {
     787        /* Prevent snapshot editing in the meantime: */
     788        QWriteLocker locker(m_pLockReadWrite);
     789
     790        /* Search for an existing item with such id: */
     791        UISnapshotItem *pItem = findItem(strSnapshotId);
     792        fSuccess = pItem;
     793
     794        /* Choose this item as new "current snapshot": */
     795        if (fSuccess)
     796        {
     797            /* Delete "current state" item first of all: */
     798            UISnapshotItem *pCurrentStateItem = m_pCurrentStateItem;
     799            m_pCurrentStateItem = 0;
     800            delete pCurrentStateItem;
     801            pCurrentStateItem = 0;
     802
     803            /* Move the "current snapshot" token from one to another: */
     804            m_pCurrentSnapshotItem->setCurrentSnapshotItem(false);
     805            m_pCurrentSnapshotItem = pItem;
     806            m_pCurrentSnapshotItem->setCurrentSnapshotItem(true);
     807
     808            /* Create "current state" item as a child of "current snapshot" item: */
     809            m_pCurrentStateItem = new UISnapshotItem(this, m_pCurrentSnapshotItem, m_comMachine);
     810            m_pCurrentStateItem->recache();
     811            /* And choose is as current one: */
     812            m_pSnapshotTree->setCurrentItem(m_pCurrentStateItem);
     813            sltHandleCurrentItemChange();
     814
     815            LogRel(("GUI: Snapshot tree update successful!\n"));
     816        }
     817    }
     818
     819    /* Just refresh everything as fallback: */
     820    if (!fSuccess)
     821    {
     822        LogRel(("GUI: Snapshot tree update failed! Rebuilding from scratch...\n"));
     823        refreshAll();
     824    }
    787825}
    788826
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

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