VirtualBox

Changeset 43619 in vbox for trunk/src/VBox/Frontends


Ignore:
Timestamp:
Oct 11, 2012 2:07:55 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81332
Message:

FE/Qt: VM group feature UI: Moving some item remove stuff into corresponding place.

Location:
trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h

    r43617 r43619  
    107107    virtual void clearItems(UIGChooserItemType type = UIGChooserItemType_Any) = 0;
    108108    virtual void updateAll(const QString &strId) = 0;
     109    virtual void removeAll(const QString &strId) = 0;
    109110    virtual UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags) = 0;
    110111    virtual UIGChooserItemMachine* firstMachineItem() = 0;
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp

    r43617 r43619  
    734734void UIGChooserItemGroup::updateAll(const QString &strId)
    735735{
    736     /* Update all the items: */
     736    /* Update all the required items recursively: */
    737737    foreach (UIGChooserItem *pItem, items())
    738738        pItem->updateAll(strId);
     739}
     740
     741void UIGChooserItemGroup::removeAll(const QString &strId)
     742{
     743    /* Remove all the required items recursively: */
     744    foreach (UIGChooserItem *pItem, items())
     745        pItem->removeAll(strId);
    739746}
    740747
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h

    r43617 r43619  
    147147    void clearItems(UIGChooserItemType type = UIGChooserItemType_Any);
    148148    void updateAll(const QString &strId);
     149    void removeAll(const QString &strId);
    149150    UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
    150151    UIGChooserItemMachine* firstMachineItem();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r43617 r43619  
    376376}
    377377
     378void UIGChooserItemMachine::removeAll(const QString &strId)
     379{
     380    /* Skip wrong id: */
     381    if (id() != strId)
     382        return;
     383
     384    /* Remove item: */
     385    delete this;
     386}
     387
    378388UIGChooserItem* UIGChooserItemMachine::searchForItem(const QString &strSearchTag, int iItemSearchFlags)
    379389{
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h

    r43617 r43619  
    123123    void clearItems(UIGChooserItemType type);
    124124    void updateAll(const QString &strId);
     125    void removeAll(const QString &strId);
    125126    UIGChooserItem* searchForItem(const QString &strSearchTag, int iItemSearchFlags);
    126127    UIGChooserItemMachine* firstMachineItem();
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r43617 r43619  
    621621    {
    622622        /* Remove machine-items with passed id: */
    623         removeMachineItems(strId, mainRoot());
     623        mainRoot()->removeAll(strId);
    624624        /* Update model: */
    625625        cleanupGroupTree();
     
    885885{
    886886    /* Remove all the items first: */
    887     removeMachineItems(strId, mainRoot());
     887    mainRoot()->removeAll(strId);
    888888
    889889    /* Check if such machine still present: */
     
    14181418            unindentRoot();
    14191419    }
    1420 }
    1421 
    1422 void UIGChooserModel::removeMachineItems(const QString &strId, UIGChooserItem *pParent)
    1423 {
    1424     /* For each group-item in passed parent: */
    1425     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))
    1426         removeMachineItems(strId, pItem->toGroupItem());
    1427     /* For each machine-item in passed parent: */
    1428     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))
    1429         if (pItem->toMachineItem()->id() == strId)
    1430             delete pItem;
    14311420}
    14321421
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h

    r43617 r43619  
    247247
    248248    /* Helpers: Machine-item stuff: */
    249     void removeMachineItems(const QString &strId, UIGChooserItem *pParent);
    250249    void removeItems(const QList<UIGChooserItem*> &itemsToRemove);
    251250    void unregisterMachines(const QStringList &ids);
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