VirtualBox

Changeset 43543 in vbox


Ignore:
Timestamp:
Oct 4, 2012 1:38:39 PM (12 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
81146
Message:

FE/Qt: VM group feature UI: Current-item handling cleanup (part 5): Fixing bug with current/focus item handling on machine unregister procedure.

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

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp

    r43540 r43543  
    112112    if (model()->focusItem() == this)
    113113    {
    114         /* Unset the focus/selection: */
    115         model()->setFocusItem(0, true);
    116     }
    117     /* If that item is NOT focused, but selected: */
    118     else if (model()->currentItems().contains(this))
     114        /* Unset the focus: */
     115        model()->setFocusItem(0);
     116    }
     117    /* If that item is selected: */
     118    if (model()->currentItems().contains(this))
    119119    {
    120120        /* Remove item from the selection list: */
  • trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp

    r43542 r43543  
    585585        if (!machine.isNull())
    586586        {
    587             /* Add new machine item: */
     587            /* Add new machine-item: */
    588588            addMachineIntoTheTree(machine, true);
    589589            /* And update model: */
     
    596596    else
    597597    {
    598         /* Remove machine items with passed id: */
     598        /* Remove machine-items with passed id: */
    599599        removeMachineItems(strId, mainRoot());
    600         /* And update model: */
     600        /* Update model: */
    601601        updateGroupTree();
    602602        updateNavigation();
    603603        updateLayout();
    604         if (mainRoot()->hasItems())
     604        /* Make sure focus-item present, if possible: */
     605        if (!focusItem() && currentItem())
     606            setFocusItem(currentItem());
     607        /* Make sure current-item present, if possible: */
     608        if (!currentItem() && !navigationList().isEmpty())
    605609            setCurrentItem(0);
    606         else
    607             unsetCurrentItem();
     610        /* Notify about current-item change: */
     611        notifyCurrentItemChanged();
    608612    }
    609613}
     
    808812
    809813    /* And update model: */
    810     updateGroupTree();
    811814    updateNavigation();
    812815    updateLayout();
    813     if (mainRoot()->hasItems())
    814         setCurrentItem(0);
    815     else
    816         unsetCurrentItem();
     816    setCurrentItem(0);
    817817    saveGroupSettings();
    818818}
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