VirtualBox

Changeset 42813 in vbox for trunk/src


Ignore:
Timestamp:
Aug 14, 2012 5:38:46 PM (12 years ago)
Author:
vboxsync
Message:

FE/Qt: 6234: Support for VM groups: Details-view update fix, performance improvement.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElement.h

    r42795 r42813  
    4949
    5050signals:
     51
     52    /* Notifier: Prepare stuff: */
     53    void sigElementUpdateDone();
    5154
    5255    /* Notifiers: Hover stuff: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsElements.cpp

    r42755 r42813  
    7777{
    7878    if (text() != newText)
    79     {
    8079        setText(newText);
    81         model()->updateLayout();
    82         update();
    83     }
    8480    cleanupThread();
     81    emit sigElementUpdateDone();
    8582}
    8683
     
    224221{
    225222    m_pPreview->setMachine(machine());
     223    emit sigElementUpdateDone();
    226224}
    227225
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.cpp

    r42678 r42813  
    160160}
    161161
    162 void UIGDetailsGroup::sltNextDone(QString strGroupId)
     162void UIGDetailsGroup::sltNextStep(QString strGroupId)
    163163{
    164164    /* Clear step: */
     
    256256        m_pStep = new UIPrepareStep(this, strGroupId);
    257257        connect(pSet, SIGNAL(sigSetCreationDone()), m_pStep, SLOT(sltStepDone()), Qt::QueuedConnection);
    258         connect(m_pStep, SIGNAL(sigStepDone(const QString&)), this, SLOT(sltNextDone(const QString&)), Qt::QueuedConnection);
     258        connect(m_pStep, SIGNAL(sigStepDone(const QString&)), this, SLOT(sltNextStep(const QString&)), Qt::QueuedConnection);
    259259        /* Configure set: */
    260260        pSet->configure(m_items[m_iStep], m_settings, m_items.size() == 1);
    261         /* Update model: */
    262         model()->updateLayout();
    263     }
    264 }
    265 
     261    }
     262}
     263
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsGroup.h

    r42608 r42813  
    6767    /* Handlers: Prepare stuff: */
    6868    void sltFirstStep(QString strGroupId);
    69     void sltNextDone(QString strGroupId);
     69    void sltNextStep(QString strGroupId);
    7070
    7171private:
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.cpp

    r42768 r42813  
    3232UIGDetailsSet::UIGDetailsSet(UIGDetailsItem *pParent)
    3333    : UIGDetailsItem(pParent)
     34    , m_pStep(0)
    3435    , m_iStep(-1)
    3536    , m_iLastStep(-1)
     
    4344    /* Prepare connections: */
    4445    connect(this, SIGNAL(sigStartFirstStep(QString)), this, SLOT(sltFirstStep(QString)), Qt::QueuedConnection);
    45     connect(this, SIGNAL(sigElementPrepared(QString)), this, SLOT(sltNextStep(QString)), Qt::QueuedConnection);
    4646    connect(this, SIGNAL(sigSetPrepared()), this, SLOT(sltSetPrepared()), Qt::QueuedConnection);
    4747    connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)), this, SLOT(sltMachineStateChange(QString)));
     
    7979void UIGDetailsSet::sltFirstStep(QString strSetId)
    8080{
     81    /* Clear step: */
     82    delete m_pStep;
     83    m_pStep = 0;
     84
    8185    /* Was that a requested set? */
    8286    if (strSetId != m_strSetId)
     
    9094void UIGDetailsSet::sltNextStep(QString strSetId)
    9195{
     96    /* Clear step: */
     97    delete m_pStep;
     98    m_pStep = 0;
     99
    92100    /* Was that a requested set? */
    93101    if (strSetId != m_strSetId)
     
    477485    }
    478486
     487    /* Clear step: */
     488    delete m_pStep;
     489    m_pStep = 0;
     490
    479491    /* Prepare first element: */
    480492    m_strSetId = QUuid::createUuid().toString();
     
    498510        /* Check if element is present already: */
    499511        UIGDetailsElement *pElement = element(elementType);
    500         /* Create if necessary: */
     512        /* Create element if necessary: */
     513        bool fJustCreated = false;
    501514        if (!pElement)
     515        {
     516            fJustCreated = true;
    502517            pElement = createElement(elementType, fOpen);
    503         /* Prepare element: */
     518        }
     519
     520        /* Show element if necessary: */
    504521        if (fVisible && !pElement->isVisible())
     522        {
    505523            pElement->show();
     524            model()->updateLayout();
     525        }
     526        /* Hide element if necessary: */
    506527        else if (!fVisible && pElement->isVisible())
     528        {
    507529            pElement->hide();
     530            model()->updateLayout();
     531        }
     532        /* Update model if necessary: */
     533        else if (fJustCreated)
     534            model()->updateLayout();
     535
     536        /* For visible element: */
    508537        if (pElement->isVisible())
     538        {
     539            /* Create prepare step: */
     540            m_pStep = new UIPrepareStep(this, strSetId);
     541            connect(pElement, SIGNAL(sigElementUpdateDone()), m_pStep, SLOT(sltStepDone()), Qt::QueuedConnection);
     542            connect(m_pStep, SIGNAL(sigStepDone(const QString&)), this, SLOT(sltNextStep(const QString&)), Qt::QueuedConnection);
     543
     544            /* Update element: */
    509545            pElement->updateAppearance();
    510         model()->updateLayout();
    511         /* Mark element prepared: */
    512         emit sigElementPrepared(strSetId);
     546        }
     547        /* For invisible element: */
     548        else
     549        {
     550            /* Just go to the next step: */
     551            sltNextStep(strSetId);
     552        }
    513553    }
    514554    /* Step number out of bounds: */
     
    516556    {
    517557        /* Mark whole set prepared: */
     558        model()->updateLayout();
     559        foreach (UIGDetailsItem *pElement, items())
     560            pElement->update();
    518561        emit sigSetPrepared();
    519562    }
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/details/UIGDetailsSet.h

    r42722 r42813  
    4141    /* Notifiers: Prepare stuff: */
    4242    void sigStartFirstStep(QString strSetId);
    43     void sigElementPrepared(QString strSetId);
    4443    void sigSetPrepared();
    4544    void sigSetCreationDone();
     
    112111
    113112    /* Prepare variables: */
     113    UIPrepareStep *m_pStep;
    114114    int m_iStep;
    115115    int m_iLastStep;
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