Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45277)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45278)
@@ -443,17 +443,14 @@
 }
 
-void UIMessageCenter::cannotOpenMachine(QWidget *pParent, const QString &strMachinePath, const CVirtualBox &vbox)
-{
-    message(pParent ? pParent : mainWindowShown(),
-            MessageType_Error,
-            tr("Failed to open virtual machine located in %1.")
-               .arg(strMachinePath),
+void UIMessageCenter::cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath)
+{
+    message(mainWindowShown(), MessageType_Error,
+            tr("Failed to open virtual machine located in %1.").arg(strMachinePath),
             formatErrorInfo(vbox));
 }
 
-void UIMessageCenter::cannotReregisterMachine(QWidget *pParent, const QString &strMachinePath, const QString &strMachineName)
-{
-    message(pParent ? pParent : mainWindowShown(),
-            MessageType_Error,
+void UIMessageCenter::cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName)
+{
+    message(mainWindowShown(), MessageType_Error,
             tr("Failed to add virtual machine <b>%1</b> located in <i>%2</i> because its already present.")
                .arg(strMachineName).arg(strMachinePath));
@@ -462,7 +459,7 @@
 void UIMessageCenter::cannotDeleteMachine(const CMachine &machine)
 {
-    /* preserve the current error info before calling the object again */
+    /* Preserve error-info: */
     COMResult res(machine);
-
+    /* Show the message: */
     message(mainWindowShown(),
             MessageType_Error,
@@ -532,26 +529,22 @@
 }
 
-int UIMessageCenter::confirmMachineDeletion(const QList<CMachine> &machines)
-{
-    /* Enumerate VMs: */
-    int cInacessibleVMCount = 0;
-    bool fVMWithHDPresent = false;
-    QString strVMNames;
-    for (int i = 0; i < machines.size(); ++i)
-    {
-        /* Get iterated VM: */
-        const CMachine &machine = machines[i];
-        /* Prepare VM name: */
+int UIMessageCenter::confirmMachineRemoval(const QList<CMachine> &machines)
+{
+    /* Enumerate the machines: */
+    int cInacessibleMachineCount = 0;
+    bool fMachineWithHardDiskPresent = false;
+    QString strMachineNames;
+    foreach (const CMachine &machine, machines)
+    {
+        /* Prepare machine name: */
         QString strMachineName;
         if (machine.GetAccessible())
         {
-            /* Get VM name: */
+            /* Just get machine name: */
             strMachineName = machine.GetName();
-            /* Enumerate attachments: */
+            /* Enumerate the attachments: */
             const CMediumAttachmentVector &attachments = machine.GetMediumAttachments();
-            for (int i = 0; !fVMWithHDPresent && i < attachments.size(); ++i)
+            foreach (const CMediumAttachment &attachment, attachments)
             {
-                /* Get current attachment: */
-                const CMediumAttachment &attachment = attachments.at(i);
                 /* Check if the medium is a hard disk: */
                 if (attachment.GetType() == KDeviceType_HardDisk)
@@ -559,8 +552,8 @@
                     /* Check if that hard disk isn't shared.
                      * If hard disk is shared, it will *never* be deleted: */
-                    QVector<QString> ids = attachment.GetMedium().GetMachineIds();
-                    if (ids.size() == 1)
+                    QVector<QString> usedMachineList = attachment.GetMedium().GetMachineIds();
+                    if (usedMachineList.size() == 1)
                     {
-                        fVMWithHDPresent = true;
+                        fMachineWithHardDiskPresent = true;
                         break;
                     }
@@ -570,22 +563,21 @@
         else
         {
-            /* Get VM name: */
+            /* Compose machine name: */
             QFileInfo fi(machine.GetSettingsFilePath());
             strMachineName = VBoxGlobal::hasAllowedExtension(fi.completeSuffix(), VBoxFileExts) ? fi.completeBaseName() : fi.fileName();
-            /* Increment inacessible VM count: */
-            ++cInacessibleVMCount;
+            /* Increment inacessible machine count: */
+            ++cInacessibleMachineCount;
         }
-
-        /* Compose VM name list: */
-        strVMNames += QString(strVMNames.isEmpty() ? "<b>%1</b>" : ", <b>%1</b>").arg(strMachineName);
+        /* Append machine name to the full name string: */
+        strMachineNames += QString(strMachineNames.isEmpty() ? "<b>%1</b>" : ", <b>%1</b>").arg(strMachineName);
     }
 
     /* Prepare message text: */
-    QString strText = cInacessibleVMCount == machines.size() ?
+    QString strText = cInacessibleMachineCount == machines.size() ?
                       tr("<p>You are about to remove following inaccessible virtual machines from the machine list:</p>"
                          "<p>%1</p>"
                          "<p>Do you wish to proceed?</p>")
-                         .arg(strVMNames) :
-                      fVMWithHDPresent ?
+                         .arg(strMachineNames) :
+                      fMachineWithHardDiskPresent ?
                       tr("<p>You are about to remove following virtual machines from the machine list:</p>"
                          "<p>%1</p>"
@@ -593,13 +585,13 @@
                          "Doing this will also remove the files containing the machine's virtual hard disks "
                          "if they are not in use by another machine.</p>")
-                         .arg(strVMNames) :
+                         .arg(strMachineNames) :
                       tr("<p>You are about to remove following virtual machines from the machine list:</p>"
                          "<p>%1</p>"
                          "<p>Would you like to delete the files containing the virtual machine from your hard disk as well?</p>")
-                         .arg(strVMNames);
+                         .arg(strMachineNames);
 
     /* Prepare message itself: */
-    return cInacessibleVMCount == machines.size() ?
-           message(&vboxGlobal().selectorWnd(),
+    return cInacessibleMachineCount == machines.size() ?
+           message(mainWindowShown(),
                    MessageType_Question,
                    strText,
@@ -609,5 +601,5 @@
                    0,
                    tr("Remove")) :
-           message(&vboxGlobal().selectorWnd(),
+           message(mainWindowShown(),
                    MessageType_Question,
                    strText,
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45277)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45278)
@@ -210,6 +210,6 @@
 
     /* API: Selector warnings: */
-    void cannotOpenMachine(QWidget *pParent, const QString &strMachinePath, const CVirtualBox &vbox);
-    void cannotReregisterMachine(QWidget *pParent, const QString &strMachinePath, const QString &strMachineName);
+    void cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath);
+    void cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName);
     void cannotDeleteMachine(const CMachine &machine);
     void cannotDeleteMachine(const CMachine &machine, const CProgress &progress);
@@ -218,5 +218,5 @@
     int askAboutCollisionOnGroupRemoving(const QString &strName, const QString &strGroupName);
     int confirmMachineItemRemoval(const QStringList &names);
-    int confirmMachineDeletion(const QList<CMachine> &machines);
+    int confirmMachineRemoval(const QList<CMachine> &machines);
     bool confirmDiscardSavedState(const QString &strNames);
     void cannotSetGroups(const CMachine &machine);
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 45277)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 45278)
@@ -355,5 +355,5 @@
     if (!vbox.isOk() || newMachine.isNull())
     {
-        msgCenter().cannotOpenMachine(this, strTmpFile, vbox);
+        msgCenter().cannotOpenMachine(vbox, strTmpFile);
         return;
     }
@@ -363,5 +363,5 @@
     if (!oldMachine.isNull())
     {
-        msgCenter().cannotReregisterMachine(this, strTmpFile, oldMachine.GetName());
+        msgCenter().cannotReregisterExistingMachine(strTmpFile, oldMachine.GetName());
         return;
     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 45277)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 45278)
@@ -1457,35 +1457,46 @@
     }
 
-    /* Show machine remove dialog: */
-    int rc = msgCenter().confirmMachineDeletion(machines);
-    if (rc != QIMessageBox::Cancel)
-    {
-        /* For every selected item: */
-        foreach (CMachine machine, machines)
+    /* Confirm machine removal: */
+    int iResultCode = msgCenter().confirmMachineRemoval(machines);
+    if (iResultCode == QIMessageBox::Cancel)
+        return;
+
+    /* For every selected item: */
+    for (int iMachineIndex = 0; iMachineIndex < machines.size(); ++iMachineIndex)
+    {
+        /* Get iterated machine: */
+        CMachine &machine = machines[iMachineIndex];
+        if (iResultCode == QIMessageBox::Yes)
         {
-            if (rc == QIMessageBox::Yes)
+            /* Unregister machine first: */
+            CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
+            if (!machine.isOk())
             {
-                /* Unregister and cleanup machine's data & hard-disks: */
-                CMediumVector mediums = machine.Unregister(KCleanupMode_DetachAllReturnHardDisksOnly);
-                if (machine.isOk())
-                {
-                    /* Delete machine hard-disks: */
-                    CProgress progress = machine.DeleteConfig(mediums);
-                    if (machine.isOk())
-                    {
-                        msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_delete_90px.png", msgCenter().mainWindowShown());
-                        if (progress.GetResultCode() != 0)
-                            msgCenter().cannotDeleteMachine(machine, progress);
-                    }
-                }
-                if (!machine.isOk())
-                    msgCenter().cannotDeleteMachine(machine);
+                msgCenter().cannotDeleteMachine(machine);
+                continue;
             }
-            else
+            /* Prepare cleanup progress: */
+            CProgress progress = machine.DeleteConfig(mediums);
+            if (!machine.isOk())
             {
-                /* Just unregister machine: */
-                machine.Unregister(KCleanupMode_DetachAllReturnNone);
-                if (!machine.isOk())
-                    msgCenter().cannotDeleteMachine(machine);
+                msgCenter().cannotDeleteMachine(machine);
+                continue;
+            }
+            /* And show cleanup progress finally: */
+            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_delete_90px.png");
+            if (progress.GetResultCode() != 0)
+            {
+                msgCenter().cannotDeleteMachine(machine, progress);
+                continue;
+            }
+        }
+        else
+        {
+            /* Just unregister machine: */
+            machine.Unregister(KCleanupMode_DetachAllReturnNone);
+            if (!machine.isOk())
+            {
+                msgCenter().cannotDeleteMachine(machine);
+                continue;
             }
         }
