Index: trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 43589)
+++ trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 43590)
@@ -168,11 +168,11 @@
     int iViewportWidth = viewportSize.width() - 2 * iSceneMargin;
     int iViewportHeight = viewportSize.height() - 2 * iSceneMargin;
-    /* Set root item position: */
+    /* Set root-item position: */
     root()->setPos(iSceneMargin, iSceneMargin);
-    /* Set root item size: */
+    /* Set root-item size: */
     root()->resize(iViewportWidth, iViewportHeight);
-    /* Relayout root item: */
+    /* Relayout root-item: */
     root()->updateLayout();
-    /* Make sure root is shown: */
+    /* Make sure root-item is shown: */
     root()->show();
     /* Notify listener about root-item relayouted: */
@@ -198,5 +198,4 @@
 void UIGChooserModel::updateNavigation()
 {
-    /* Recreate navigation list: */
     clearNavigationList();
     m_navigationList = createNavigationList(root());
@@ -211,5 +210,5 @@
 QList<UIVMItem*> UIGChooserModel::currentMachineItems() const
 {
-    /* Populate list of selected machines: */
+    /* Populate list of selected machine-items: */
     QList<UIVMItem*> currentMachineItemList;
     enumerateCurrentItems(currentItems(), currentMachineItemList);
@@ -352,5 +351,5 @@
 bool UIGChooserModel::isAllItemsOfOneGroupSelected() const
 {
-    /* Make sure at least on item selected: */
+    /* Make sure at least one item selected: */
     if (currentItems().isEmpty())
         return false;
@@ -359,5 +358,5 @@
     UIGChooserItem *pFirstParent = currentItem()->parentItem();
 
-    /* Make sure this parent is not main root item: */
+    /* Make sure this parent is not main root-item: */
     if (pFirstParent == mainRoot())
         return false;
@@ -400,5 +399,5 @@
     if (pOldFocusItem)
         disconnect(pOldFocusItem, SIGNAL(destroyed(QObject*)), this, SLOT(sltFocusItemDestroyed()));
-    /* Connect new focus item (if any): */
+    /* Connect new focus-item (if any): */
     if (m_pFocusItem)
         connect(m_pFocusItem, SIGNAL(destroyed(QObject*)), this, SLOT(sltFocusItemDestroyed()));
@@ -420,5 +419,5 @@
 void UIGChooserModel::indentRoot(UIGChooserItem *pNewRootItem)
 {
-    /* Do nothing is sliding already: */
+    /* Do nothing if sliding already: */
     if (m_fSliding)
         return;
@@ -453,5 +452,5 @@
 void UIGChooserModel::unindentRoot()
 {
-    /* Do nothing is sliding already: */
+    /* Do nothing if sliding already: */
     if (m_fSliding)
         return;
@@ -580,5 +579,5 @@
 void UIGChooserModel::sltMachineStateChanged(QString strId, KMachineState)
 {
-    /* Update machine items with passed id: */
+    /* Update machine-items with passed id: */
     updateMachineItems(strId, mainRoot());
 }
@@ -586,5 +585,5 @@
 void UIGChooserModel::sltMachineDataChanged(QString strId)
 {
-    /* Update machine items with passed id: */
+    /* Update machine-items with passed id: */
     updateMachineItems(strId, mainRoot());
 }
@@ -630,5 +629,5 @@
 void UIGChooserModel::sltSessionStateChanged(QString strId, KSessionState)
 {
-    /* Update machine items with passed id: */
+    /* Update machine-items with passed id: */
     updateMachineItems(strId, mainRoot());
 }
@@ -636,5 +635,5 @@
 void UIGChooserModel::sltSnapshotChanged(QString strId, QString)
 {
-    /* Update machine items with passed id: */
+    /* Update machine-items with passed id: */
     updateMachineItems(strId, mainRoot());
 }
@@ -764,5 +763,5 @@
 {
     /* Make sure focus item is of group type! */
-    AssertMsg(focusItem()->type() == UIGChooserItemType_Group, ("This is not group item!"));
+    AssertMsg(focusItem()->type() == UIGChooserItemType_Group, ("This is not group-item!"));
 
     /* Check if we have collisions with our siblings: */
@@ -913,7 +912,7 @@
 void UIGChooserModel::sltRemoveCurrentlySelectedMachine()
 {
-    /* Enumerate all the selected machine items: */
+    /* Enumerate all the selected machine-items: */
     QList<UIGChooserItem*> selectedMachineItemList = gatherMachineItems(currentItems());
-    /* Enumerate all the existing machine items: */
+    /* Enumerate all the existing machine-items: */
     QList<UIGChooserItem*> existingMachineItemList = gatherMachineItems(mainRoot()->items());
 
@@ -922,5 +921,5 @@
     QMap<QString, QString> namesMap;
 
-    /* For each selected machine item: */
+    /* For each selected machine-item: */
     foreach (UIGChooserItem *pItem, selectedMachineItemList)
     {
@@ -1019,5 +1018,4 @@
 void UIGChooserModel::sltCurrentDragObjectDestroyed()
 {
-    /* Reset drag tokens starting from the root item: */
     root()->resetDragToken();
 }
@@ -1083,5 +1081,5 @@
 void UIGChooserModel::prepareContextMenu()
 {
-    /* Context menu for group: */
+    /* Context menu for group(s): */
     m_pContextMenuGroup = new QMenu;
     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_New));
@@ -1262,5 +1260,5 @@
         return QObject::eventFilter(pWatched, pEvent);
 
-    /* Process only item is focused by model, not by scene: */
+    /* Process only item focused by model: */
     if (scene()->focusItem())
         return QObject::eventFilter(pWatched, pEvent);
@@ -1281,8 +1279,8 @@
         case QEvent::GraphicsSceneMouseDoubleClick:
             return m_pMouseHandler->handle(static_cast<QGraphicsSceneMouseEvent*>(pEvent), UIMouseEventType_DoubleClick);
-        /* Context menu: */
+        /* Context-menu handler: */
         case QEvent::GraphicsSceneContextMenu:
             return processContextMenuEvent(static_cast<QGraphicsSceneContextMenuEvent*>(pEvent));
-        /* Improvised scroll event: */
+        /* Drag&drop scroll-event handler: */
         case QEvent::GraphicsSceneDragMove:
             return processDragMoveEvent(static_cast<QGraphicsSceneDragDropEvent*>(pEvent));
@@ -1298,5 +1296,5 @@
     QList<UIGChooserItem*> navigationItems;
 
-    /* Iterate over all the group items: */
+    /* Iterate over all the group-items: */
     foreach (UIGChooserItem *pGroupItem, pItem->items(UIGChooserItemType_Group))
     {
@@ -1305,5 +1303,5 @@
             navigationItems << createNavigationList(pGroupItem);
     }
-    /* Iterate over all the machine items: */
+    /* Iterate over all the machine-items: */
     foreach (UIGChooserItem *pMachineItem, pItem->items(UIGChooserItemType_Machine))
         navigationItems << pMachineItem;
@@ -1318,5 +1316,5 @@
     foreach (UIGChooserItem *pItem, list)
     {
-        /* If that is machine-item, just return it: */
+        /* If that is machine-item: */
         if (pItem->type() == UIGChooserItemType_Machine)
         {
@@ -1374,5 +1372,5 @@
 void UIGChooserModel::clearRealFocus()
 {
-    /* Set real focus to null: */
+    /* Set the real focus to null: */
     scene()->setFocusItem(0);
 }
@@ -1418,9 +1416,9 @@
 UIGChooserItem* UIGChooserModel::findGroupItem(const QString &strName, UIGChooserItem *pParent)
 {
-    /* Search among all the group items of passed parent: */
+    /* Search among all the group-items of passed parent: */
     foreach (UIGChooserItem *pGroupItem, pParent->items(UIGChooserItemType_Group))
         if (pGroupItem->name() == strName)
             return pGroupItem;
-    /* Recursively iterate into each the group item of the passed parent: */
+    /* Recursively iterate into each the group-item of the passed parent: */
     foreach (UIGChooserItem *pGroupItem, pParent->items(UIGChooserItemType_Group))
         if (UIGChooserItem *pSubGroupItem = findGroupItem(strName, pGroupItem))
@@ -1432,5 +1430,5 @@
 void UIGChooserModel::cleanupGroupTree(UIGChooserItem *pGroupItem)
 {
-    /* Cleanup all the group items first: */
+    /* Cleanup all the group-items first: */
     foreach (UIGChooserItem *pSubGroupItem, pGroupItem->items(UIGChooserItemType_Group))
         cleanupGroupTree(pSubGroupItem);
@@ -1440,5 +1438,5 @@
         if (!pGroupItem->isRoot())
             delete pGroupItem;
-        /* Unindent root items: */
+        /* Unindent root-items: */
         else if (root() != mainRoot())
             unindentRoot();
@@ -1448,9 +1446,9 @@
 UIGChooserItem* UIGChooserModel::findMachineItem(const QString &strName, UIGChooserItem *pParent)
 {
-    /* Search among all the machine items of passed parent: */
+    /* Search among all the machine-items of passed parent: */
     foreach (UIGChooserItem *pMachineItem, pParent->items(UIGChooserItemType_Machine))
         if (pMachineItem->name() == strName)
             return pMachineItem;
-    /* Recursively iterate into each the group item of the passed parent: */
+    /* Recursively iterate into each the group-item of the passed parent: */
     foreach (UIGChooserItem *pGroupItem, pParent->items(UIGChooserItemType_Group))
         if (UIGChooserItem *pSubMachineItem = findMachineItem(strName, pGroupItem))
@@ -1508,5 +1506,5 @@
 void UIGChooserModel::sortItems(UIGChooserItem *pParent, bool fRecursively /* = false */)
 {
-    /* Sort group items: */
+    /* Sort group-items: */
     QMap<QString, UIGChooserItem*> sorter;
     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))
@@ -1518,5 +1516,5 @@
     pParent->setItems(sorter.values(), UIGChooserItemType_Group);
 
-    /* Sort machine items: */
+    /* Sort machine-items: */
     sorter.clear();
     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))
@@ -1531,17 +1529,17 @@
 void UIGChooserModel::updateMachineItems(const QString &strId, UIGChooserItem *pParent)
 {
-    /* For each group item in passed parent: */
+    /* For each group-item in passed parent: */
     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))
         updateMachineItems(strId, pItem->toGroupItem());
-    /* For each machine item in passed parent: */
+    /* For each machine-item in passed parent: */
     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))
         if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem())
             if (pMachineItem->id() == strId)
             {
-                /* Update machine item: */
+                /* Update machine-item: */
                 pMachineItem->recache();
                 pMachineItem->updateToolTip();
                 pMachineItem->update();
-                /* Update parent group item: */
+                /* Update parent group-item: */
                 UIGChooserItemGroup *pParentGroupItem = pMachineItem->parentItem()->toGroupItem();
                 pParentGroupItem->updateToolTip();
@@ -1552,8 +1550,8 @@
 void UIGChooserModel::removeMachineItems(const QString &strId, UIGChooserItem *pParent)
 {
-    /* For each group item in passed parent: */
+    /* For each group-item in passed parent: */
     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))
         removeMachineItems(strId, pItem->toGroupItem());
-    /* For each machine item in passed parent: */
+    /* For each machine-item in passed parent: */
     foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))
         if (pItem->toMachineItem()->id() == strId)
@@ -1563,5 +1561,5 @@
 void UIGChooserModel::removeMachineItems(const QStringList &names, QList<UIGChooserItem*> &selectedItems)
 {
-    /* Show machine items remove dialog: */
+    /* Show machine-items remove dialog: */
     int rc = msgCenter().confirmMachineItemRemoval(names);
     if (rc == QIMessageBox::Cancel)
@@ -1647,10 +1645,10 @@
                     case UIGChooserItemType_Group:
                     {
-                        /* Get group item: */
+                        /* Get group-item: */
                         UIGChooserItem *pGroupItem = qgraphicsitem_cast<UIGChooserItemGroup*>(pItem);
                         /* Make sure thats not root: */
                         if (pGroupItem->isRoot())
                             return false;
-                        /* Is this group item only the one selected? */
+                        /* Is this group-item only the one selected? */
                         if (currentItems().contains(pGroupItem) && currentItems().size() == 1)
                         {
@@ -1682,5 +1680,5 @@
                     case UIGChooserItemType_Group:
                     {
-                        /* Is this group item only the one selected? */
+                        /* Is this group-item only the one selected? */
                         if (currentItems().size() == 1)
                         {
@@ -1740,5 +1738,5 @@
     QGraphicsView *pView = scene()->views()[0];
 
-    /* Check scroll area: */
+    /* Check scroll-area: */
     QPoint eventPoint = pView->mapFromGlobal(pEvent->screenPos());
     if ((eventPoint.y() < m_iScrollingTokenSize) ||
@@ -1806,5 +1804,5 @@
             if (strGroup.right(1) == "/")
                 strGroup.truncate(strGroup.size() - 1);
-            /* Create machine item with found group item as parent: */
+            /* Create machine-item with found group-item as parent: */
             LogRel(("  Creating item for VM {%s}, group {%s}.\n", strName.toAscii().constData(),
                                                                   strGroup.toAscii().constData()));
@@ -1819,5 +1817,5 @@
         /* VM is accessible: */
         LogRel((" VM {%s} is inaccessible.\n", machine.GetId().toAscii().constData()));
-        /* Create machine item with main-root group item as parent: */
+        /* Create machine-item with main-root group-item as parent: */
         createMachineItem(machine, mainRoot());
     }
@@ -1841,5 +1839,5 @@
         /* Make sure first-suffix is NOT empty: */
         AssertMsg(!strFirstSuffix.isEmpty(), ("Invalid group name!"));
-        /* Trying to get group item among our children: */
+        /* Trying to get group-item among our children: */
         foreach (UIGChooserItem *pGroupItem, pParentItem->items(UIGChooserItemType_Group))
         {
@@ -1861,5 +1859,5 @@
                                     /* Should be new group opened when created? */
                                     fAllGroupsOpened || shouldBeGroupOpened(pParentItem, strSecondSubName),
-                                    /* Which position new group item should be placed in? */
+                                    /* Which position new group-item should be placed in? */
                                     getDesiredPosition(pParentItem, UIGChooserItemType_Group, strSecondSubName));
     return strSecondSuffix.isEmpty() ? pNewGroupItem : getGroupItem(strFirstSuffix, pNewGroupItem, fAllGroupsOpened);
@@ -1990,5 +1988,5 @@
     new UIGChooserItemMachine(/* Parent item and corresponding machine: */
                               pParentItem, machine,
-                              /* Which position new group item should be placed in? */
+                              /* Which position new group-item should be placed in? */
                               getDesiredPosition(pParentItem, UIGChooserItemType_Machine, machine.GetId()));
 }
@@ -2034,10 +2032,10 @@
                                              UIGChooserItem *pParentGroup)
 {
-    /* Iterate over all the machine items: */
+    /* Iterate over all the machine-items: */
     foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Machine))
         if (UIGChooserItemMachine *pMachineItem = pItem->toMachineItem())
             if (pMachineItem->accessible())
                 groups[pMachineItem->id()] << fullName(pParentGroup);
-    /* Iterate over all the group items: */
+    /* Iterate over all the group-items: */
     foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group))
         gatherGroupDefinitions(groups, pItem);
@@ -2049,5 +2047,5 @@
     /* Prepare extra-data key for current group: */
     QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);
-    /* Iterate over all the group items: */
+    /* Iterate over all the group-items: */
     foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group))
     {
@@ -2056,5 +2054,5 @@
         gatherGroupOrders(groups, pItem);
     }
-    /* Iterate over all the machine items: */
+    /* Iterate over all the machine-items: */
     foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Machine))
         groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id());
