Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 43004)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 43005)
@@ -1451,6 +1451,5 @@
     connect(m_pChooser, SIGNAL(sigToggleStarted()), m_pDetails, SIGNAL(sigToggleStarted()));
     connect(m_pChooser, SIGNAL(sigToggleFinished()), m_pDetails, SIGNAL(sigToggleFinished()));
-    connect(m_pChooser, SIGNAL(sigGroupSavingStarted()), this, SLOT(sltGroupSavingUpdate()));
-    connect(m_pChooser, SIGNAL(sigGroupSavingFinished()), this, SLOT(sltGroupSavingUpdate()));
+    connect(m_pChooser, SIGNAL(sigGroupSavingStateChanged()), this, SLOT(sltGroupSavingUpdate()));
 
     /* Tool-bar connections: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.cpp	(revision 43004)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.cpp	(revision 43005)
@@ -126,6 +126,5 @@
     connect(m_pChooserModel, SIGNAL(sigToggleStarted()), this, SIGNAL(sigToggleStarted()));
     connect(m_pChooserModel, SIGNAL(sigToggleFinished()), this, SIGNAL(sigToggleFinished()));
-    connect(m_pChooserModel, SIGNAL(sigGroupSavingStarted()), this, SIGNAL(sigGroupSavingStarted()));
-    connect(m_pChooserModel, SIGNAL(sigGroupSavingFinished()), this, SIGNAL(sigGroupSavingFinished()));
+    connect(m_pChooserModel, SIGNAL(sigGroupSavingStateChanged()), this, SIGNAL(sigGroupSavingStateChanged()));
     connect(m_pChooserModel, SIGNAL(sigFocusChanged(UIGChooserItem*)), m_pChooserView, SLOT(sltFocusChanged(UIGChooserItem*)));
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.h	(revision 43004)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooser.h	(revision 43005)
@@ -50,7 +50,6 @@
     void sigToggleFinished();
 
-    /* Notifiers: Group saving stuff: */
-    void sigGroupSavingStarted();
-    void sigGroupSavingFinished();
+    /* Notifier: Group saving stuff: */
+    void sigGroupSavingStateChanged();
 
 public:
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 43004)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 43005)
@@ -553,5 +553,6 @@
 bool UIGChooserModel::isGroupSavingInProgress() const
 {
-    return UIGroupsSavingThread::instance();
+    return UIGroupDefinitionSaveThread::instance() ||
+           UIGroupOrderSaveThread::instance();
 }
 
@@ -977,11 +978,18 @@
 void UIGChooserModel::sltGroupSavingStart()
 {
-    saveGroupTree();
-}
-
-void UIGChooserModel::sltGroupSavingComplete()
-{
-    makeSureGroupSavingIsFinished();
-    emit sigGroupSavingFinished();
+    saveGroupDefinitions();
+    saveGroupOrders();
+}
+
+void UIGChooserModel::sltGroupDefinitionsSaveComplete()
+{
+    makeSureGroupDefinitionsSaveIsFinished();
+    emit sigGroupSavingStateChanged();
+}
+
+void UIGChooserModel::sltGroupOrdersSaveComplete()
+{
+    makeSureGroupOrdersSaveIsFinished();
+    emit sigGroupSavingStateChanged();
 }
 
@@ -1110,6 +1118,6 @@
 void UIGChooserModel::cleanupGroupTree()
 {
-    makeSureGroupSavingIsFinished();
-    saveGroupsOrder();
+    makeSureGroupDefinitionsSaveIsFinished();
+    makeSureGroupOrdersSaveIsFinished();
 }
 
@@ -1471,52 +1479,41 @@
 }
 
-void UIGChooserModel::saveGroupTree()
-{
-    /* Make sure there is no group saving activity: */
-    if (UIGroupsSavingThread::instance())
+void UIGChooserModel::saveGroupDefinitions()
+{
+    /* Make sure there is no group save activity: */
+    if (UIGroupDefinitionSaveThread::instance())
         return;
 
     /* Prepare full group map: */
     QMap<QString, QStringList> groups;
-    gatherGroupTree(groups, mainRoot());
+    gatherGroupDefinitions(groups, mainRoot());
 
     /* Save information in other thread: */
-    UIGroupsSavingThread::prepare();
-    emit sigGroupSavingStarted();
-    UIGroupsSavingThread::instance()->configure(this, m_groups, groups);
-    UIGroupsSavingThread::instance()->start();
+    UIGroupDefinitionSaveThread::prepare();
+    emit sigGroupSavingStateChanged();
+    UIGroupDefinitionSaveThread::instance()->configure(this, m_groups, groups);
+    UIGroupDefinitionSaveThread::instance()->start();
     m_groups = groups;
 }
 
-void UIGChooserModel::saveGroupsOrder()
-{
-    /* Clear all the extra-data records related to group-definitions: */
-    const QVector<QString> extraDataKeys = vboxGlobal().virtualBox().GetExtraDataKeys();
-    foreach (const QString &strKey, extraDataKeys)
-        if (strKey.startsWith(UIDefs::GUI_GroupDefinitions))
-            vboxGlobal().virtualBox().SetExtraData(strKey, QString());
-    /* Save order starting from the root-item: */
-    saveGroupsOrder(mainRoot());
-}
-
-void UIGChooserModel::saveGroupsOrder(UIGChooserItem *pParentItem)
-{
-    /* Prepare extra-data key for current group: */
-    QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);
-    /* Gather item order: */
-    QStringList order;
-    foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group))
-    {
-        saveGroupsOrder(pItem);
-        QString strGroupDescriptor(pItem->toGroupItem()->opened() ? "go" : "gc");
-        order << QString("%1=%2").arg(strGroupDescriptor, pItem->name());
-    }
-    foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Machine))
-        order << QString("m=%1").arg(pItem->toMachineItem()->id());
-    vboxGlobal().virtualBox().SetExtraDataStringList(strExtraDataKey, order);
-}
-
-void UIGChooserModel::gatherGroupTree(QMap<QString, QStringList> &groups,
-                                      UIGChooserItem *pParentGroup)
+void UIGChooserModel::saveGroupOrders()
+{
+    /* Make sure there is no group save activity: */
+    if (UIGroupOrderSaveThread::instance())
+        return;
+
+    /* Prepare full group map: */
+    QMap<QString, QStringList> groups;
+    gatherGroupOrders(groups, mainRoot());
+
+    /* Save information in other thread: */
+    UIGroupOrderSaveThread::prepare();
+    emit sigGroupSavingStateChanged();
+    UIGroupOrderSaveThread::instance()->configure(this, groups);
+    UIGroupOrderSaveThread::instance()->start();
+}
+
+void UIGChooserModel::gatherGroupDefinitions(QMap<QString, QStringList> &groups,
+                                             UIGChooserItem *pParentGroup)
 {
     /* Iterate over all the machine items: */
@@ -1527,5 +1524,22 @@
     /* Iterate over all the group items: */
     foreach (UIGChooserItem *pItem, pParentGroup->items(UIGChooserItemType_Group))
-        gatherGroupTree(groups, pItem);
+        gatherGroupDefinitions(groups, pItem);
+}
+
+void UIGChooserModel::gatherGroupOrders(QMap<QString, QStringList> &groups,
+                                        UIGChooserItem *pParentItem)
+{
+    /* Prepare extra-data key for current group: */
+    QString strExtraDataKey = UIDefs::GUI_GroupDefinitions + fullName(pParentItem);
+    /* Iterate over all the group items: */
+    foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Group))
+    {
+        QString strGroupDescriptor(pItem->toGroupItem()->opened() ? "go" : "gc");
+        groups[strExtraDataKey] << QString("%1=%2").arg(strGroupDescriptor, pItem->name());
+        gatherGroupOrders(groups, pItem);
+    }
+    /* Iterate over all the machine items: */
+    foreach (UIGChooserItem *pItem, pParentItem->items(UIGChooserItemType_Machine))
+        groups[strExtraDataKey] << QString("m=%1").arg(pItem->toMachineItem()->id());
 }
 
@@ -1901,12 +1915,16 @@
 }
 
-void UIGChooserModel::makeSureGroupSavingIsFinished()
-{
-    /* Nothing to do if thread is null: */
-    if (!UIGroupsSavingThread::instance())
-        return;
-
-    /* Cleanup thread otherwise: */
-    UIGroupsSavingThread::cleanup();
+void UIGChooserModel::makeSureGroupDefinitionsSaveIsFinished()
+{
+    /* Cleanup if necessary: */
+    if (UIGroupDefinitionSaveThread::instance())
+        UIGroupDefinitionSaveThread::cleanup();
+}
+
+void UIGChooserModel::makeSureGroupOrdersSaveIsFinished()
+{
+    /* Cleanup if necessary: */
+    if (UIGroupOrderSaveThread::instance())
+        UIGroupOrderSaveThread::cleanup();
 }
 
@@ -1930,8 +1948,8 @@
 
 /* static */
-UIGroupsSavingThread* UIGroupsSavingThread::m_spInstance = 0;
+UIGroupDefinitionSaveThread* UIGroupDefinitionSaveThread::m_spInstance = 0;
 
 /* static */
-UIGroupsSavingThread* UIGroupsSavingThread::instance()
+UIGroupDefinitionSaveThread* UIGroupDefinitionSaveThread::instance()
 {
     return m_spInstance;
@@ -1939,5 +1957,5 @@
 
 /* static */
-void UIGroupsSavingThread::prepare()
+void UIGroupDefinitionSaveThread::prepare()
 {
     /* Make sure instance not prepared: */
@@ -1946,9 +1964,9 @@
 
     /* Crate instance: */
-    new UIGroupsSavingThread;
+    new UIGroupDefinitionSaveThread;
 }
 
 /* static */
-void UIGroupsSavingThread::cleanup()
+void UIGroupDefinitionSaveThread::cleanup()
 {
     /* Make sure instance prepared: */
@@ -1960,14 +1978,14 @@
 }
 
-void UIGroupsSavingThread::configure(QObject *pParent,
-                                     const QMap<QString, QStringList> &oldLists,
-                                     const QMap<QString, QStringList> &newLists)
+void UIGroupDefinitionSaveThread::configure(QObject *pParent,
+                                            const QMap<QString, QStringList> &oldLists,
+                                            const QMap<QString, QStringList> &newLists)
 {
     m_oldLists = oldLists;
     m_newLists = newLists;
-    connect(this, SIGNAL(sigComplete()), pParent, SLOT(sltGroupSavingComplete()));
-}
-
-void UIGroupsSavingThread::sltHandleError(UIGroupsSavingError errorType, const CMachine &machine)
+    connect(this, SIGNAL(sigComplete()), pParent, SLOT(sltGroupDefinitionsSaveComplete()));
+}
+
+void UIGroupDefinitionSaveThread::sltHandleError(UIGroupsSavingError errorType, const CMachine &machine)
 {
     switch (errorType)
@@ -1988,5 +2006,5 @@
 }
 
-UIGroupsSavingThread::UIGroupsSavingThread()
+UIGroupDefinitionSaveThread::UIGroupDefinitionSaveThread()
 {
     /* Assign instance: */
@@ -1999,5 +2017,5 @@
 }
 
-UIGroupsSavingThread::~UIGroupsSavingThread()
+UIGroupDefinitionSaveThread::~UIGroupDefinitionSaveThread()
 {
     /* Wait: */
@@ -2008,5 +2026,5 @@
 }
 
-void UIGroupsSavingThread::run()
+void UIGroupDefinitionSaveThread::run()
 {
     /* Lock other thread mutex: */
@@ -2085,2 +2103,77 @@
 }
 
+/* static */
+UIGroupOrderSaveThread* UIGroupOrderSaveThread::m_spInstance = 0;
+
+/* static */
+UIGroupOrderSaveThread* UIGroupOrderSaveThread::instance()
+{
+    return m_spInstance;
+}
+
+/* static */
+void UIGroupOrderSaveThread::prepare()
+{
+    /* Make sure instance not prepared: */
+    if (m_spInstance)
+        return;
+
+    /* Crate instance: */
+    new UIGroupOrderSaveThread;
+}
+
+/* static */
+void UIGroupOrderSaveThread::cleanup()
+{
+    /* Make sure instance prepared: */
+    if (!m_spInstance)
+        return;
+
+    /* Crate instance: */
+    delete m_spInstance;
+}
+
+void UIGroupOrderSaveThread::configure(QObject *pParent,
+                                       const QMap<QString, QStringList> &groups)
+{
+    m_groups = groups;
+    connect(this, SIGNAL(sigComplete()), pParent, SLOT(sltGroupOrdersSaveComplete()));
+}
+
+UIGroupOrderSaveThread::UIGroupOrderSaveThread()
+{
+    /* Assign instance: */
+    m_spInstance = this;
+}
+
+UIGroupOrderSaveThread::~UIGroupOrderSaveThread()
+{
+    /* Wait: */
+    wait();
+
+    /* Erase instance: */
+    m_spInstance = 0;
+}
+
+void UIGroupOrderSaveThread::run()
+{
+    /* COM prepare: */
+    COMBase::InitializeCOM(false);
+
+    /* Clear all the extra-data records related to group-definitions: */
+    const QVector<QString> extraDataKeys = vboxGlobal().virtualBox().GetExtraDataKeys();
+    foreach (const QString &strKey, extraDataKeys)
+        if (strKey.startsWith(UIDefs::GUI_GroupDefinitions))
+            vboxGlobal().virtualBox().SetExtraData(strKey, QString());
+
+    /* For every particular group definition: */
+    foreach (const QString &strId, m_groups.keys())
+        vboxGlobal().virtualBox().SetExtraDataStringList(strId, m_groups[strId]);
+
+    /* Notify listeners about completeness: */
+    emit sigComplete();
+
+    /* COM cleanup: */
+    COMBase::CleanupCOM();
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h	(revision 43004)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.h	(revision 43005)
@@ -85,6 +85,5 @@
     /* Notifiers: Group saving stuff: */
     void sigStartGroupSaving();
-    void sigGroupSavingStarted();
-    void sigGroupSavingFinished();
+    void sigGroupSavingStateChanged();
 
 public:
@@ -213,5 +212,6 @@
     /* Handlers: Group saving stuff: */
     void sltGroupSavingStart();
-    void sltGroupSavingComplete();
+    void sltGroupDefinitionsSaveComplete();
+    void sltGroupOrdersSaveComplete();
 
     /* Handler: Lookup stuff: */
@@ -266,9 +266,9 @@
     void createMachineItem(const CMachine &machine, UIGChooserItem *pParentItem);
 
-    /* Helpers: Saving: */
-    void saveGroupTree();
-    void saveGroupsOrder();
-    void saveGroupsOrder(UIGChooserItem *pParentItem);
-    void gatherGroupTree(QMap<QString, QStringList> &groups, UIGChooserItem *pParentGroup);
+    /* Helpers: Group saving stuff: */
+    void saveGroupDefinitions();
+    void saveGroupOrders();
+    void gatherGroupDefinitions(QMap<QString, QStringList> &groups, UIGChooserItem *pParentGroup);
+    void gatherGroupOrders(QMap<QString, QStringList> &groups, UIGChooserItem *pParentItem);
     QString fullName(UIGChooserItem *pItem);
 
@@ -307,6 +307,7 @@
     void sortItems(UIGChooserItem *pParent, bool fRecursively = false);
 
-    /* Helper: Group saving stuff: */
-    void makeSureGroupSavingIsFinished();
+    /* Helpers: Group saving stuff: */
+    void makeSureGroupDefinitionsSaveIsFinished();
+    void makeSureGroupOrdersSaveIsFinished();
 
     /* Helper: Lookup stuff: */
@@ -339,5 +340,5 @@
 };
 
-/* Represents group-saving error types: */
+/* Represents group definitions save error types: */
 enum UIGroupsSavingError
 {
@@ -348,6 +349,6 @@
 Q_DECLARE_METATYPE(UIGroupsSavingError);
 
-/* Allows to save group settings asynchronously: */
-class UIGroupsSavingThread : public QThread
+/* Allows to save group definitions asynchronously: */
+class UIGroupDefinitionSaveThread : public QThread
 {
     Q_OBJECT;
@@ -364,5 +365,5 @@
 
     /* Singleton stuff: */
-    static UIGroupsSavingThread* instance();
+    static UIGroupDefinitionSaveThread* instance();
     static void prepare();
     static void cleanup();
@@ -381,6 +382,6 @@
 
     /* Constructor/destructor: */
-    UIGroupsSavingThread();
-    ~UIGroupsSavingThread();
+    UIGroupDefinitionSaveThread();
+    ~UIGroupDefinitionSaveThread();
 
     /* Worker thread stuff: */
@@ -388,5 +389,5 @@
 
     /* Variables: */
-    static UIGroupsSavingThread *m_spInstance;
+    static UIGroupDefinitionSaveThread *m_spInstance;
     QMap<QString, QStringList> m_oldLists;
     QMap<QString, QStringList> m_newLists;
@@ -395,4 +396,38 @@
 };
 
+/* Allows to save group order asynchronously: */
+class UIGroupOrderSaveThread : public QThread
+{
+    Q_OBJECT;
+
+signals:
+
+    /* Notifier: Complete stuff: */
+    void sigComplete();
+
+public:
+
+    /* Singleton stuff: */
+    static UIGroupOrderSaveThread* instance();
+    static void prepare();
+    static void cleanup();
+
+    /* API: Configuring stuff: */
+    void configure(QObject *pParent, const QMap<QString, QStringList> &groups);
+
+private:
+
+    /* Constructor/destructor: */
+    UIGroupOrderSaveThread();
+    ~UIGroupOrderSaveThread();
+
+    /* Worker thread stuff: */
+    void run();
+
+    /* Variables: */
+    static UIGroupOrderSaveThread *m_spInstance;
+    QMap<QString, QStringList> m_groups;
+};
+
 #endif /* __UIGChooserModel_h__ */
 
