Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp	(revision 43775)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp	(revision 43776)
@@ -248,9 +248,9 @@
 bool UIGChooserItemGroup::isContainsLockedMachine()
 {
-    /* For each machine item: */
+    /* For each machine-item: */
     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Machine))
         if (pItem->toMachineItem()->isLockedMachine())
             return true;
-    /* For each group item: */
+    /* For each group-item: */
     foreach (UIGChooserItem *pItem, items(UIGChooserItemType_Group))
         if (pItem->toGroupItem()->isContainsLockedMachine())
@@ -518,4 +518,52 @@
 }
 
+void UIGChooserItemGroup::prepare()
+{
+    /* Non root item only: */
+    if (!isRoot())
+    {
+        /* Setup toggle-button: */
+        m_pToggleButton = new UIGraphicsRotatorButton(this, "additionalHeight", opened());
+        connect(m_pToggleButton, SIGNAL(sigRotationStart()), this, SLOT(sltGroupToggleStart()));
+        connect(m_pToggleButton, SIGNAL(sigRotationFinish(bool)), this, SLOT(sltGroupToggleFinish(bool)));
+        m_pToggleButton->hide();
+
+        /* Setup enter-button: */
+        m_pEnterButton = new UIGraphicsButton(this, UIGraphicsButtonType_DirectArrow);
+        connect(m_pEnterButton, SIGNAL(sigButtonClicked()), this, SLOT(sltIndentRoot()));
+        m_pEnterButton->hide();
+
+        /* Setup name-editor: */
+        m_pNameEditorWidget = new UIGroupRenameEditor(m_strName, this);
+        m_pNameEditorWidget->setFont(data(GroupItemData_NameFont).value<QFont>());
+        connect(m_pNameEditorWidget, SIGNAL(sigEditingFinished()), this, SLOT(sltNameEditingFinished()));
+        m_pNameEditor = new QGraphicsProxyWidget(this);
+        m_pNameEditor->setWidget(m_pNameEditorWidget);
+        m_pNameEditor->hide();
+    }
+    /* Root item but non main: */
+    if (!isMainRoot())
+    {
+        /* Setup exit-button: */
+        m_pExitButton = new UIGraphicsButton(this, UIGraphicsButtonType_DirectArrow);
+        connect(m_pExitButton, SIGNAL(sigButtonClicked()), this, SLOT(sltUnindentRoot()));
+        QSizeF sh = m_pExitButton->minimumSizeHint();
+        m_pExitButton->setTransformOriginPoint(sh.width() / 2, sh.height() / 2);
+        m_pExitButton->setRotation(180);
+        m_pExitButton->hide();
+    }
+}
+
+/* static */
+void UIGChooserItemGroup::copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo)
+{
+    /* Copy group items: */
+    foreach (UIGChooserItem *pGroupItem, pFrom->items(UIGChooserItemType_Group))
+        new UIGChooserItemGroup(pTo, pGroupItem->toGroupItem());
+    /* Copy machine items: */
+    foreach (UIGChooserItem *pMachineItem, pFrom->items(UIGChooserItemType_Machine))
+        new UIGChooserItemMachine(pTo, pMachineItem->toMachineItem());
+}
+
 void UIGChooserItemGroup::retranslateUi()
 {
@@ -622,5 +670,5 @@
         case UIGChooserItemType_Group:
         {
-            AssertMsg(!m_groupItems.contains(pItem), ("Group item already added!"));
+            AssertMsg(!m_groupItems.contains(pItem), ("Group-item already added!"));
             if (iPosition < 0 || iPosition >= m_groupItems.size())
                 m_groupItems.append(pItem);
@@ -632,5 +680,5 @@
         case UIGChooserItemType_Machine:
         {
-            AssertMsg(!m_machineItems.contains(pItem), ("Machine item already added!"));
+            AssertMsg(!m_machineItems.contains(pItem), ("Machine-item already added!"));
             if (iPosition < 0 || iPosition >= m_machineItems.size())
                 m_machineItems.append(pItem);
@@ -657,5 +705,5 @@
         case UIGChooserItemType_Group:
         {
-            AssertMsg(m_groupItems.contains(pItem), ("Group item was not found!"));
+            AssertMsg(m_groupItems.contains(pItem), ("Group-item was not found!"));
             scene()->removeItem(pItem);
             m_groupItems.removeAt(m_groupItems.indexOf(pItem));
@@ -664,5 +712,5 @@
         case UIGChooserItemType_Machine:
         {
-            AssertMsg(m_machineItems.contains(pItem), ("Machine item was not found!"));
+            AssertMsg(m_machineItems.contains(pItem), ("Machine-item was not found!"));
             scene()->removeItem(pItem);
             m_machineItems.removeAt(m_machineItems.indexOf(pItem));
@@ -963,5 +1011,5 @@
     int iProposedWidth = 0;
 
-    /* Simple group item have 2 margins - left and right: */
+    /* Simple group-item have 2 margins - left and right: */
     iProposedWidth += 2 * iHorizontalMargin;
     /* And full header width to take into account: */
@@ -995,5 +1043,5 @@
     int iProposedHeight = 0;
 
-    /* Simple group item have 2 margins - top and bottom: */
+    /* Simple group-item have 2 margins - top and bottom: */
     iProposedHeight += 2 * iVerticalMargin;
     /* And full header height to take into account: */
@@ -1046,4 +1094,14 @@
     /* Else call to base-class: */
     return UIGChooserItem::sizeHint(which, constraint);
+}
+
+void UIGChooserItemGroup::updateToggleButtonToolTip()
+{
+    /* Is toggle-button created? */
+    if (!m_pToggleButton)
+        return;
+
+    /* Update toggle-button tool-tip: */
+    m_pToggleButton->setToolTip(opened() ? tr("Collapse group") : tr("Expand group"));
 }
 
@@ -1074,5 +1132,5 @@
     if (pMimeData->hasFormat(UIGChooserItemGroup::className()))
     {
-        /* Get passed group item: */
+        /* Get passed group-item: */
         const UIGChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);
         AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
@@ -1097,5 +1155,5 @@
     else if (pMimeData->hasFormat(UIGChooserItemMachine::className()))
     {
-        /* Get passed machine item: */
+        /* Get passed machine-item: */
         const UIGChooserItemMimeData *pCastedMimeData = qobject_cast<const UIGChooserItemMimeData*>(pMimeData);
         AssertMsg(pCastedMimeData, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
@@ -1138,5 +1196,5 @@
                 UIGChooserModel *pModel = model();
 
-                /* Get passed group item: */
+                /* Get passed group-item: */
                 const UIGChooserItemMimeData *pCastedMime = qobject_cast<const UIGChooserItemMimeData*>(pMime);
                 AssertMsg(pCastedMime, ("Can't cast passed mime-data to UIGChooserItemMimeData!"));
@@ -1210,5 +1268,5 @@
                 }
 
-                /* Copy passed machine item into this group: */
+                /* Copy passed machine-item into this group: */
                 UIGChooserItem *pNewMachineItem = new UIGChooserItemMachine(this, pItem->toMachineItem(), iPosition);
                 if (closed())
@@ -1581,62 +1639,4 @@
 }
 
-void UIGChooserItemGroup::prepare()
-{
-    /* Non root item only: */
-    if (!isRoot())
-    {
-        /* Setup toggle-button: */
-        m_pToggleButton = new UIGraphicsRotatorButton(this, "additionalHeight", opened());
-        connect(m_pToggleButton, SIGNAL(sigRotationStart()), this, SLOT(sltGroupToggleStart()));
-        connect(m_pToggleButton, SIGNAL(sigRotationFinish(bool)), this, SLOT(sltGroupToggleFinish(bool)));
-        m_pToggleButton->hide();
-
-        /* Setup enter-button: */
-        m_pEnterButton = new UIGraphicsButton(this, UIGraphicsButtonType_DirectArrow);
-        connect(m_pEnterButton, SIGNAL(sigButtonClicked()), this, SLOT(sltIndentRoot()));
-        m_pEnterButton->hide();
-
-        /* Setup name-editor: */
-        m_pNameEditorWidget = new UIGroupRenameEditor(m_strName, this);
-        m_pNameEditorWidget->setFont(data(GroupItemData_NameFont).value<QFont>());
-        connect(m_pNameEditorWidget, SIGNAL(sigEditingFinished()), this, SLOT(sltNameEditingFinished()));
-        m_pNameEditor = new QGraphicsProxyWidget(this);
-        m_pNameEditor->setWidget(m_pNameEditorWidget);
-        m_pNameEditor->hide();
-    }
-    /* Root item but non main: */
-    if (!isMainRoot())
-    {
-        /* Setup exit-button: */
-        m_pExitButton = new UIGraphicsButton(this, UIGraphicsButtonType_DirectArrow);
-        connect(m_pExitButton, SIGNAL(sigButtonClicked()), this, SLOT(sltUnindentRoot()));
-        QSizeF sh = m_pExitButton->minimumSizeHint();
-        m_pExitButton->setTransformOriginPoint(sh.width() / 2, sh.height() / 2);
-        m_pExitButton->setRotation(180);
-        m_pExitButton->hide();
-    }
-}
-
-/* static */
-void UIGChooserItemGroup::copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo)
-{
-    /* Copy group items: */
-    foreach (UIGChooserItem *pGroupItem, pFrom->items(UIGChooserItemType_Group))
-        new UIGChooserItemGroup(pTo, pGroupItem->toGroupItem());
-    /* Copy machine items: */
-    foreach (UIGChooserItem *pMachineItem, pFrom->items(UIGChooserItemType_Machine))
-        new UIGChooserItemMachine(pTo, pMachineItem->toMachineItem());
-}
-
-void UIGChooserItemGroup::updateToggleButtonToolTip()
-{
-    /* Is toggle-button created? */
-    if (!m_pToggleButton)
-        return;
-
-    /* Update toggle-button tool-tip: */
-    m_pToggleButton->setToolTip(opened() ? tr("Collapse group") : tr("Expand group"));
-}
-
 UIGroupRenameEditor::UIGroupRenameEditor(const QString &strName, UIGChooserItem *pParent)
     : m_pParent(pParent)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h	(revision 43775)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h	(revision 43776)
@@ -28,11 +28,11 @@
 /* Forward declarations: */
 class QGraphicsScene;
+class QGraphicsProxyWidget;
+class QLineEdit;
 class UIGraphicsButton;
 class UIGraphicsRotatorButton;
-class QLineEdit;
-class QGraphicsProxyWidget;
 class UIGroupRenameEditor;
 
-/* Graphics group item
+/* Graphics group-item
  * for graphics selector model/view architecture: */
 class UIGChooserItemGroup : public UIGChooserItem
@@ -61,7 +61,7 @@
                         bool fMainRoot);
     UIGChooserItemGroup(UIGChooserItem *pParent, const QString &strName,
-                        bool fOpened  = false , int iPosition  = -1 );
+                        bool fOpened = false, int iPosition  = -1);
     UIGChooserItemGroup(UIGChooserItem *pParent, UIGChooserItemGroup *pCopyFrom,
-                        int iPosition  = -1 );
+                        int iPosition = -1);
     ~UIGChooserItemGroup();
 
@@ -82,12 +82,12 @@
 private slots:
 
-    /* Handler: Group name editing: */
+    /* Handler: Name editing stuff: */
     void sltNameEditingFinished();
 
-    /* Handler: Collapse/expand stuff: */
+    /* Handler: Toggle stuff: */
     void sltGroupToggleStart();
     void sltGroupToggleFinish(bool fToggled);
 
-    /* Handler: Indent root stuff: */
+    /* Handlers: Indent root stuff: */
     void sltIndentRoot();
     void sltUnindentRoot();
@@ -130,4 +130,8 @@
     QVariant data(int iKey) const;
 
+    /* Helpers: Prepare stuff: */
+    void prepare();
+    static void copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo);
+
     /* Helper: Translate stuff: */
     void retranslateUi();
@@ -162,5 +166,8 @@
     QSizeF sizeHint(Qt::SizeHint which, const QSizeF &constraint = QSizeF()) const;
 
-    /* Helpers: Drag and drop stuff: */
+    /* Helper: Collapse/expand stuff: */
+    void updateToggleButtonToolTip();
+
+    /* Helpers: Drag&drop stuff: */
     QPixmap toPixmap();
     bool isDropAllowed(QGraphicsSceneDragDropEvent *pEvent, DragToken where) const;
@@ -169,5 +176,5 @@
     QMimeData* createMimeData();
 
-    /* Event handlers: */
+    /* Helper: Event handling stuff: */
     void hoverMoveEvent(QGraphicsSceneHoverEvent *pEvent);
 
@@ -184,13 +191,6 @@
     int additionalHeight() const;
 
-    /* Helpers: Prepare stuff: */
-    void prepare();
-    static void copyContent(UIGChooserItemGroup *pFrom, UIGChooserItemGroup *pTo);
-
     /* Helper: Color stuff: */
     int blackoutDarkness() const { return m_iBlackoutDarkness; }
-
-    /* Helper: Collapse/expand stuff: */
-    void updateToggleButtonToolTip();
 
     /* Variables: */
