Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp	(revision 42563)
@@ -432,9 +432,9 @@
     {
 #if defined(Q_WS_MAC)
-        setText(QApplication::translate("UIActionPool", "Create Alias on Desktop"));
-        setStatusTip(QApplication::translate("UIActionPool", "Creates an Alias file to the VirtualBox Machine Definition file on your Desktop."));
+        setText(QApplication::translate("UIActionPool", "Create alias on desktop"));
+        setStatusTip(QApplication::translate("UIActionPool", "Creates an alias file to the VirtualBox Machine Definition file on your desktop."));
 #else
-        setText(QApplication::translate("UIActionPool", "Create Shortcut on Desktop"));
-        setStatusTip(QApplication::translate("UIActionPool", "Creates an Shortcut file to the VirtualBox Machine Definition file on your Desktop."));
+        setText(QApplication::translate("UIActionPool", "Create shortcut on desktop"));
+        setStatusTip(QApplication::translate("UIActionPool", "Creates an shortcut file to the VirtualBox Machine Definition file on your desktop."));
 #endif
         setShortcut(gSS->keySequence(UISelectorShortcuts::CreateVMAliasShortcut));
@@ -458,7 +458,7 @@
     void retranslateUi()
     {
-        setText(QApplication::translate("UIActionPool", "Sort List"));
-        setStatusTip(QApplication::translate("UIActionPool", "Sort the VM list alphabetically (Shift for descending order)"));
-        setShortcut(gSS->keySequence(UISelectorShortcuts::ResortVMList));
+        setText(QApplication::translate("UIActionPool", "Sort group"));
+        setStatusTip(QApplication::translate("UIActionPool", "Sort the items of the selected group alphabetically"));
+        setShortcut(gSS->keySequence(UISelectorShortcuts::SortGroup));
     }
 };
@@ -823,11 +823,11 @@
 };
 
-class UIActionSimpleMachineSort : public UIActionSimple
-{
-    Q_OBJECT;
-
-public:
-
-    UIActionSimpleMachineSort(QObject *pParent)
+class UIActionSimpleCommonSortParent : public UIActionSimple
+{
+    Q_OBJECT;
+
+public:
+
+    UIActionSimpleCommonSortParent(QObject *pParent)
         : UIActionSimple(pParent/*, ":/settings_16px.png", ":/settings_dis_16px.png"*/)
     {
@@ -839,7 +839,7 @@
     void retranslateUi()
     {
-        setText(QApplication::translate("UIActionPool", "Sort List"));
-        setStatusTip(QApplication::translate("UIActionPool", "Sort the VM list alphabetically (Shift for descending order)"));
-        setShortcut(gSS->keySequence(UISelectorShortcuts::ResortVMList));
+        setText(QApplication::translate("UIActionPool", "Sort parent group"));
+        setStatusTip(QApplication::translate("UIActionPool", "Sort the parent group of the first selected item alphabetically"));
+        setShortcut(gSS->keySequence(UISelectorShortcuts::SortParentGroup));
     }
 };
@@ -977,5 +977,7 @@
     m_pool[UIActionIndexSelector_Simple_Machine_ShowInFileManager] = new UIActionSimpleMachineShowInFileManager(this);
     m_pool[UIActionIndexSelector_Simple_Machine_CreateShortcut] = new UIActionSimpleMachineCreateShortcut(this);
-    m_pool[UIActionIndexSelector_Simple_Machine_Sort] = new UIActionSimpleMachineSort(this);
+
+    /* Common actions: */
+    m_pool[UIActionIndexSelector_Simple_Common_SortParent] = new UIActionSimpleCommonSortParent(this);
 
     /* 'Machine/Close' actions: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.h	(revision 42563)
@@ -63,5 +63,7 @@
     UIActionIndexSelector_Simple_Machine_ShowInFileManager,
     UIActionIndexSelector_Simple_Machine_CreateShortcut,
-    UIActionIndexSelector_Simple_Machine_Sort,
+
+    /* Common menu action: */
+    UIActionIndexSelector_Simple_Common_SortParent,
 
     /* 'Machine/Close' menu actions: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.cpp	(revision 42563)
@@ -49,5 +49,6 @@
     m_Shortcuts[ShowVMInFileManagerShortcut] = UIKeySequence("ShowVMInFileManager");
     m_Shortcuts[CreateVMAliasShortcut]       = UIKeySequence("CreateVMAlias");
-    m_Shortcuts[ResortVMList]                = UIKeySequence("ResortVMList");
+    m_Shortcuts[SortParentGroup]             = UIKeySequence("SortParentGroup");
+    m_Shortcuts[SortGroup]                   = UIKeySequence("SortGroup");
     m_Shortcuts[HelpShortcut]                = UIKeySequence("Help",                QKeySequence::HelpContents);
     m_Shortcuts[WebShortcut]                 = UIKeySequence("Web");
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorShortcuts.h	(revision 42563)
@@ -51,5 +51,6 @@
         ShowVMInFileManagerShortcut,
         CreateVMAliasShortcut,
-        ResortVMList,
+        SortParentGroup,
+        SortGroup,
         HelpShortcut,
         WebShortcut,
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 42563)
@@ -1116,6 +1116,8 @@
     pMenu->addAction(m_pActionGroupCreateShortcut);
     pMenu->addSeparator();
-//    m_pActionGroupSort = gActionPool->action(UIActionIndexSelector_Simple_Group_Sort);
-//    pMenu->addAction(m_pActionGroupSort);
+    m_pActionGroupSortParent = gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent);
+    pMenu->addAction(m_pActionGroupSortParent);
+    m_pActionGroupSort = gActionPool->action(UIActionIndexSelector_Simple_Group_Sort);
+    pMenu->addAction(m_pActionGroupSort);
 
     /* Remember action list: */
@@ -1125,5 +1127,5 @@
                    << m_pActionGroupReset << m_pActionGroupRefresh
                    << m_pActionGroupLogDialog << m_pActionGroupShowInFileManager
-                   << m_pActionGroupCreateShortcut /* << m_pActionGroupSort */;
+                   << m_pActionGroupCreateShortcut << m_pActionGroupSort;
 }
 
@@ -1168,6 +1170,6 @@
     pMenu->addAction(m_pActionMachineCreateShortcut);
     pMenu->addSeparator();
-//    m_pActionMachineSort = gActionPool->action(UIActionIndexSelector_Simple_Machine_Sort);
-//    pMenu->addAction(m_pActionMachineSort);
+    m_pActionMachineSortParent = gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent);
+    pMenu->addAction(m_pActionMachineSortParent);
 
     /* Remember action list: */
@@ -1179,5 +1181,5 @@
                      << m_pActionMachineReset << m_pActionMachineRefresh
                      << m_pActionMachineLogDialog << m_pActionMachineShowInFileManager
-                     << m_pActionMachineCreateShortcut /* << m_pActionMachineSort */;
+                     << m_pActionMachineCreateShortcut;
 }
 
@@ -1522,5 +1524,6 @@
     m_pActionGroupShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_ShowInFileManager, items));
     m_pActionGroupCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_CreateShortcut, items));
-//    m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
+    m_pActionGroupSortParent->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_SortParent, items));
+    m_pActionGroupSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Group_Sort, items));
 
     /* Enable/disable machine actions: */
@@ -1537,5 +1540,5 @@
     m_pActionMachineShowInFileManager->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_ShowInFileManager, items));
     m_pActionMachineCreateShortcut->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_CreateShortcut, items));
-//    m_pActionMachineSort->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Machine_Sort, items));
+    m_pActionMachineSortParent->setEnabled(isActionEnabled(UIActionIndexSelector_Simple_Common_SortParent, items));
 
     /* Enable/disable machine-close actions: */
@@ -1758,10 +1761,10 @@
         case UIActionIndexSelector_Simple_Group_ShowInFileManager:
         case UIActionIndexSelector_Simple_Machine_ShowInFileManager:
-//        case UIActionIndexSelector_Simple_Group_Sort:
-//        case UIActionIndexSelector_Simple_Machine_Sort:
-//        {
-//            /* Make sure all items are accessible: */
-//            return isItemsAccessible(items);
-//        }
+        case UIActionIndexSelector_Simple_Common_SortParent:
+        case UIActionIndexSelector_Simple_Group_Sort:
+        {
+            /* Make sure all items are accessible: */
+            return items.size() > 0 && isItemsAccessible(items);
+        }
         case UIActionIndexSelector_Simple_Group_CreateShortcut:
         case UIActionIndexSelector_Simple_Machine_CreateShortcut:
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.h	(revision 42563)
@@ -190,5 +190,6 @@
     UIAction *m_pActionGroupShowInFileManager;
     UIAction *m_pActionGroupCreateShortcut;
-//    UIAction *m_pActionGroupSort;
+    UIAction *m_pActionGroupSortParent;
+    UIAction *m_pActionGroupSort;
 
     /* 'Machine' menu action pointers: */
@@ -210,5 +211,5 @@
     UIAction *m_pActionMachineShowInFileManager;
     UIAction *m_pActionMachineCreateShortcut;
-//    UIAction *m_pActionMachineSort;
+    UIAction *m_pActionMachineSortParent;
 
     /* 'Machine / Close' menu action pointers: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItem.h	(revision 42563)
@@ -86,4 +86,5 @@
     virtual void addItem(UIGChooserItem *pItem, int iPosition) = 0;
     virtual void removeItem(UIGChooserItem *pItem) = 0;
+    virtual void setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type) = 0;
     virtual QList<UIGChooserItem*> items(UIGChooserItemType type = UIGChooserItemType_Any) const = 0;
     virtual bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const = 0;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.cpp	(revision 42563)
@@ -475,4 +475,15 @@
 }
 
+void UIGChooserItemGroup::setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type)
+{
+    /* Check item type: */
+    switch (type)
+    {
+        case UIGChooserItemType_Group: m_groupItems = items; break;
+        case UIGChooserItemType_Machine: m_machineItems = items; break;
+        default: AssertMsgFailed(("Invalid item type!")); break;
+    }
+}
+
 QList<UIGChooserItem*> UIGChooserItemGroup::items(UIGChooserItemType type /* = UIGChooserItemType_Any */) const
 {
@@ -513,10 +524,12 @@
         case UIGChooserItemType_Group:
         {
-            while (!m_groupItems.isEmpty()) { delete m_groupItems.last(); }
+            while (!m_groupItems.isEmpty()) { delete m_groupItems.takeLast(); }
+            AssertMsg(m_groupItems.isEmpty(), ("Group items cleanup failed!"));
             break;
         }
         case UIGChooserItemType_Machine:
         {
-            while (!m_machineItems.isEmpty()) { delete m_machineItems.last(); }
+            while (!m_machineItems.isEmpty()) { delete m_machineItems.takeLast(); }
+            AssertMsg(m_machineItems.isEmpty(), ("Machine items cleanup failed!"));
             break;
         }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemGroup.h	(revision 42563)
@@ -117,4 +117,5 @@
     void addItem(UIGChooserItem *pItem, int iPosition);
     void removeItem(UIGChooserItem *pItem);
+    void setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type);
     QList<UIGChooserItem*> items(UIGChooserItemType type = UIGChooserItemType_Any) const;
     bool hasItems(UIGChooserItemType type = UIGChooserItemType_Any) const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.cpp	(revision 42563)
@@ -233,4 +233,9 @@
 
 void UIGChooserItemMachine::removeItem(UIGChooserItem*)
+{
+    AssertMsgFailed(("Machine graphics item do NOT support children!"));
+}
+
+void UIGChooserItemMachine::setItems(const QList<UIGChooserItem*>&, UIGChooserItemType)
 {
     AssertMsgFailed(("Machine graphics item do NOT support children!"));
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserItemMachine.h	(revision 42563)
@@ -98,4 +98,5 @@
     void addItem(UIGChooserItem *pItem, int iPosition);
     void removeItem(UIGChooserItem *pItem);
+    void setItems(const QList<UIGChooserItem*> &items, UIGChooserItemType type);
     QList<UIGChooserItem*> items(UIGChooserItemType type) const;
     bool hasItems(UIGChooserItemType type) const;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 42563)
@@ -769,4 +769,16 @@
 }
 
+void UIGChooserModel::sltSortParentGroup()
+{
+    if (!selectionList().isEmpty())
+        sortItems(selectionList().first()->parentItem());
+}
+
+void UIGChooserModel::sltSortGroup()
+{
+    if (singleGroupSelected())
+        sortItems(selectionList().first());
+}
+
 QVariant UIGChooserModel::data(int iKey) const
 {
@@ -814,6 +826,7 @@
     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_ShowInFileManager));
     m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_CreateShortcut));
-//    m_pContextMenuGroup->addSeparator();
-//    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_Sort));
+    m_pContextMenuGroup->addSeparator();
+    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent));
+    m_pContextMenuGroup->addAction(gActionPool->action(UIActionIndexSelector_Simple_Group_Sort));
 
     /* Context menu for machine(s): */
@@ -835,6 +848,6 @@
     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_ShowInFileManager));
     m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_CreateShortcut));
-//    m_pContextMenuMachine->addSeparator();
-//    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Machine_Sort));
+    m_pContextMenuMachine->addSeparator();
+    m_pContextMenuMachine->addAction(gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent));
 
     connect(m_pContextMenuRoot, SIGNAL(hovered(QAction*)), this, SLOT(sltActionHovered(QAction*)));
@@ -850,4 +863,8 @@
     connect(gActionPool->action(UIActionIndexSelector_Simple_Machine_RemoveDialog), SIGNAL(triggered()),
             this, SLOT(sltRemoveCurrentlySelectedMachine()));
+    connect(gActionPool->action(UIActionIndexSelector_Simple_Common_SortParent), SIGNAL(triggered()),
+            this, SLOT(sltSortParentGroup()));
+    connect(gActionPool->action(UIActionIndexSelector_Simple_Group_Sort), SIGNAL(triggered()),
+            this, SLOT(sltSortGroup()));
 }
 
@@ -1606,2 +1623,25 @@
 }
 
+void UIGChooserModel::sortItems(UIGChooserItem *pParent, bool fRecursively /* = false */)
+{
+    /* Sort group items: */
+    QMap<QString, UIGChooserItem*> sorter;
+    foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Group))
+    {
+        sorter.insert(pItem->name().toLower(), pItem);
+        if (fRecursively)
+            sortItems(pItem, fRecursively);
+    }
+    pParent->setItems(sorter.values(), UIGChooserItemType_Group);
+
+    /* Sort machine items: */
+    sorter.clear();
+    foreach (UIGChooserItem *pItem, pParent->items(UIGChooserItemType_Machine))
+        sorter.insert(pItem->name().toLower(), pItem);
+    pParent->setItems(sorter.values(), UIGChooserItemType_Machine);
+
+    /* Update model: */
+    updateNavigation();
+    updateLayout();
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h	(revision 42562)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h	(revision 42563)
@@ -177,4 +177,8 @@
     void sltSlidingComplete();
 
+    /* Handlers: Sorting stuff: */
+    void sltSortParentGroup();
+    void sltSortGroup();
+
 private:
 
@@ -257,4 +261,7 @@
     void removeMachineItems(const QStringList &names, QList<UIGChooserItem*> &selectedItems);
     void unregisterMachines(const QStringList &names);
+
+    /* Helper: Sorting stuff: */
+    void sortItems(UIGChooserItem *pParent, bool fRecursively = false);
 
     /* Variables: */
