Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45371)
@@ -317,45 +317,31 @@
 {
     /* It may happen that this method is called during VBoxGlobal
-     * initialization or even after it failed (for example, to show some
-     * error message). Return no main window in this case: */
+     * initialization or even after it failed (for example, to show some error message).
+     * Return no main window in this case: */
     if (!vboxGlobal().isValid())
         return 0;
 
+    /* For VM console process: */
     if (vboxGlobal().isVMConsoleProcess())
     {
-        if (vboxGlobal().vmWindow() && vboxGlobal().vmWindow()->isVisible()) /* VM window is visible */
-            return vboxGlobal().vmWindow(); /* return that window */
-    }
+        /* It will be currently active machine window if visible: */
+        if (vboxGlobal().vmWindow()->isVisible())
+            return vboxGlobal().vmWindow();
+    }
+    /* Otherwise: */
     else
     {
-        if (vboxGlobal().selectorWnd().isVisible()) /* VM selector is visible */
-            return &vboxGlobal().selectorWnd(); /* return that window */
-    }
-
+        /* It will be the selector window if visible: */
+        if (vboxGlobal().selectorWnd().isVisible())
+            return &vboxGlobal().selectorWnd();
+    }
+
+    /* Nothing by default: */
     return 0;
 }
 
-QWidget* UIMessageCenter::mainMachineWindowShown() const
-{
-    /* It may happen that this method is called during VBoxGlobal
-     * initialization or even after it failed (for example, to show some
-     * error message). Return no main window in this case: */
-    if (!vboxGlobal().isValid())
-        return 0;
-
-    if (vboxGlobal().vmWindow() && vboxGlobal().vmWindow()->isVisible()) /* VM window is visible */
-        return vboxGlobal().vmWindow(); /* return that window */
-
-    return 0;
-}
-
 QWidget* UIMessageCenter::networkManagerOrMainWindowShown() const
 {
     return gNetworkManager->window()->isVisible() ? gNetworkManager->window() : mainWindowShown();
-}
-
-QWidget* UIMessageCenter::networkManagerOrMainMachineWindowShown() const
-{
-    return gNetworkManager->window()->isVisible() ? gNetworkManager->window() : mainMachineWindowShown();
 }
 
@@ -877,5 +863,5 @@
 void UIMessageCenter::cannotTakeSnapshot(const CConsole &console, const QString &strMachineName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
              .arg(strMachineName),
@@ -885,5 +871,5 @@
 void UIMessageCenter::cannotTakeSnapshot(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create a snapshot of the virtual machine <b>%1</b>.")
              .arg(strMachineName),
@@ -893,5 +879,5 @@
 void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
              .arg(strSnapshotName, strMachineName),
@@ -901,5 +887,5 @@
 void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName, const QString &strMachineName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
              .arg(strSnapshotName, strMachineName),
@@ -925,5 +911,5 @@
 bool UIMessageCenter::confirmHostInterfaceRemoval(const QString &strName, QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           tr("<p>Deleting this host-only network will remove "
                              "the host-only interface this network is based on. Do you want to "
@@ -941,5 +927,5 @@
 void UIMessageCenter::cannotCreateHostInterface(const CHost &host, QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the host network interface."),
           formatErrorInfo(host));
@@ -948,5 +934,5 @@
 void UIMessageCenter::cannotCreateHostInterface(const CProgress &progress, QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the host network interface."),
           !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
@@ -955,5 +941,5 @@
 void UIMessageCenter::cannotRemoveHostInterface(const CHost &host, const QString &strName, QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to remove the host network interface <b>%1</b>.")
              .arg(strName),
@@ -963,5 +949,5 @@
 void UIMessageCenter::cannotRemoveHostInterface(const CProgress &progress, const QString &strName, QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to remove the host network interface <b>%1</b>.")
              .arg(strName),
@@ -971,5 +957,5 @@
 void UIMessageCenter::cannotSetSystemProperties(const CSystemProperties &properties, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Critical,
+    error(pParent, MessageType_Critical,
           tr("Failed to set global VirtualBox properties."),
           formatErrorInfo(properties));
@@ -985,5 +971,5 @@
         return;
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error,
+    error(pParent, res.isWarning() ? MessageType_Warning : MessageType_Error,
           tr("Failed to access the USB subsystem."),
           formatErrorInfo(res),
@@ -997,5 +983,5 @@
     setWarningShown("warnAboutUnsupportedUSB2", true);
 
-    alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
+    alert(pParent, MessageType_Warning,
           tr("<p>USB 2.0 is currently enabled for this virtual machine. "
              "However, this requires the <b><nobr>%1</nobr></b> to be installed.</p>"
@@ -1015,5 +1001,5 @@
     setWarningShown("warnAboutStateChange", true);
     /* Show the error: */
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Warning,
+    alert(pParent, MessageType_Warning,
           tr("The virtual machine that you are changing has been started. "
              "Only certain settings can be changed while a machine is running. "
@@ -1025,5 +1011,5 @@
 bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           tr("<p>The machine settings were changed while you were editing them. "
                              "You currently have unsaved setting changes.</p>"
@@ -1035,5 +1021,5 @@
 int UIMessageCenter::confirmHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
 {
-    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionTrinary(pParent, MessageType_Question,
                            tr("<p>You are about to add a virtual hard disk to controller <b>%1</b>.</p>"
                               "<p>Would you like to create a new, empty file to hold the disk contents or select an existing one?</p>")
@@ -1046,5 +1032,5 @@
 int UIMessageCenter::confirmOpticalAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
 {
-    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionTrinary(pParent, MessageType_Question,
                            tr("<p>You are about to add a new CD/DVD drive to controller <b>%1</b>.</p>"
                               "<p>Would you like to choose a virtual CD/DVD disk to put in the drive "
@@ -1058,5 +1044,5 @@
 int UIMessageCenter::confirmFloppyAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
 {
-    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionTrinary(pParent, MessageType_Question,
                            tr("<p>You are about to add a new floppy drive to controller <b>%1</b>.</p>"
                               "<p>Would you like to choose a virtual floppy disk to put in the drive "
@@ -1070,5 +1056,5 @@
 int UIMessageCenter::confirmRemovingOfLastDVDDevice(QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Info,
+    return questionBinary(pParent, MessageType_Info,
                           tr("<p>Are you sure you want to delete the CD/DVD-ROM device?</p>"
                              "<p>You will not be able to mount any CDs or ISO images "
@@ -1106,5 +1092,5 @@
             break;
     }
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           strMessage, formatErrorInfo(machine));
 }
@@ -1112,5 +1098,5 @@
 void UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /*= 0*/) const
 {
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    alert(pParent, MessageType_Error,
           tr("The current port forwarding rules are not valid. "
              "None of the host or guest port values may be set to zero."));
@@ -1119,5 +1105,5 @@
 bool UIMessageCenter::confirmCancelingPortForwardingDialog(QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           tr("<p>There are unsaved changes in the port forwarding configuration.</p>"
                              "<p>If you proceed your changes will be discarded.</p>"));
@@ -1128,5 +1114,5 @@
                                                QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the shared folder <b>%1</b> (pointing to "
              "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
@@ -1139,5 +1125,5 @@
                                                QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the shared folder <b>%1</b> (pointing to "
              "<nobr><b>%2</b></nobr>) for the virtual machine <b>%3</b>.")
@@ -1150,5 +1136,5 @@
                                                QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
              "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
@@ -1163,5 +1149,5 @@
                                                QWidget *pParent /*= 0*/)
 {
-    error(pParent ? pParent : mainMachineWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("<p>Failed to remove the shared folder <b>%1</b> (pointing to "
              "<nobr><b>%2</b></nobr>) from the virtual machine <b>%3</b>.</p>"
@@ -1177,5 +1163,5 @@
     COMResult res(machine);
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
              .arg(machine.GetName(), machine.GetSettingsFilePath()),
@@ -1186,5 +1172,5 @@
                                              QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("<p>Error changing medium type from <b>%1</b> to <b>%2</b>.</p>")
              .arg(gpConverter->toString(oldMediumType)).arg(gpConverter->toString(newMediumType)),
@@ -1220,5 +1206,5 @@
     }
     /* Show the question: */
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           strMessage.arg(medium.location(), strUsage),
                           0 /* auto-confirm id */, tr("Release", "detach medium"));
@@ -1270,5 +1256,5 @@
     }
     /* Show the question: */
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           strMessage.arg(medium.location()),
                           "confirmMediumRemoval" /* auto-confirm id */, tr("Remove", "medium"));
@@ -1277,5 +1263,5 @@
 int UIMessageCenter::confirmDeleteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    return questionTrinary(pParent ? pParent : mainWindowShown(), MessageType_Question,
+    return questionTrinary(pParent, MessageType_Question,
                            tr("<p>Do you want to delete the storage unit of the hard disk "
                               "<nobr><b>%1</b></nobr>?</p>"
@@ -1295,5 +1281,5 @@
 void UIMessageCenter::cannotDeleteHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
              .arg(strLocation),
@@ -1303,5 +1289,5 @@
 void UIMessageCenter::cannotDeleteHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to delete the storage unit of the hard disk <b>%1</b>.")
              .arg(strLocation),
@@ -1339,5 +1325,5 @@
     }
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           strMessage, strErrorInfo);
 }
@@ -1388,10 +1374,10 @@
     /* Show the messsage: */
     if (fRetry)
-        return errorWithQuestion(pParent ? pParent : mainWindowShown(), MessageType_Question,
+        return errorWithQuestion(pParent, MessageType_Question,
                                  strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
                                  strErrorInfo,
                                  0 /* Auto Confirm ID */,
                                  tr("Force Unmount"));
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           strMessage.arg(medium.isHostDrive() ? medium.name() : medium.location()).arg(machine.GetName()),
           strErrorInfo);
@@ -1424,5 +1410,5 @@
     }
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           strMessage.arg(strLocation), formatErrorInfo(vbox));
 }
@@ -1453,5 +1439,5 @@
     }
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           strMessage.arg(medium.location()), formatErrorInfo(rc));
 }
@@ -1459,5 +1445,5 @@
 bool UIMessageCenter::confirmHardDisklessMachine(QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning,
+    return questionBinary(pParent, MessageType_Warning,
                           tr("You are about to create a new virtual machine without a hard drive. "
                              "You will not be able to install an operating system on the machine "
@@ -1471,5 +1457,5 @@
 void UIMessageCenter::cannotCreateMachine(const CVirtualBox &vbox, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create a new virtual machine."),
           formatErrorInfo(vbox));
@@ -1478,5 +1464,5 @@
 void UIMessageCenter::cannotRegisterMachine(const CVirtualBox &vbox, const QString &strMachineName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to register the virtual machine <b>%1</b>.")
              .arg(strMachineName),
@@ -1489,5 +1475,5 @@
     QString strErrorInfo = formatErrorInfo(machine);
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to clone the virtual machine <b>%1</b>.")
              .arg(machine.GetName()),
@@ -1497,5 +1483,5 @@
 void UIMessageCenter::cannotCreateClone(const CProgress &progress, const QString &strMachineName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to clone the virtual machine <b>%1</b>.")
              .arg(strMachineName),
@@ -1505,5 +1491,5 @@
 void UIMessageCenter::cannotOverwriteHardDiskStorage(const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Info,
+    alert(pParent, MessageType_Info,
           tr("<p>The hard disk storage unit at location <b>%1</b> already exists. "
              "You cannot create a new virtual hard disk that uses this location "
@@ -1515,5 +1501,5 @@
 void UIMessageCenter::cannotCreateHardDiskStorage(const CVirtualBox &vbox, const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
              .arg(strLocation),
@@ -1523,5 +1509,5 @@
 void UIMessageCenter::cannotCreateHardDiskStorage(const CMedium &medium, const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
              .arg(strLocation),
@@ -1531,5 +1517,5 @@
 void UIMessageCenter::cannotCreateHardDiskStorage(const CProgress &progress, const QString &strLocation, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to create the hard disk storage <nobr><b>%1</b>.</nobr>")
              .arg(strLocation),
@@ -1540,5 +1526,5 @@
 {
     QFileInfo fi(strFolderName);
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
+    alert(pParent, MessageType_Critical,
           tr("<p>Cannot remove the machine folder <nobr><b>%1</b>.</nobr></p>"
              "<p>Please check that this folder really exists and that you have permissions to remove it.</p>")
@@ -1549,5 +1535,5 @@
 {
     QFileInfo fi(strFolderName);
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
+    alert(pParent, MessageType_Critical,
           tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
              "<p>This folder already exists and possibly belongs to another machine.</p>")
@@ -1558,5 +1544,5 @@
 {
     QFileInfo fi(strFolderName);
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Critical,
+    alert(pParent, MessageType_Critical,
           tr("<p>Cannot create the machine folder <b>%1</b> in the parent folder <nobr><b>%2</b>.</nobr></p>"
              "<p>Please check that the parent really exists and that you have permissions to create the machine folder.</p>")
@@ -1575,5 +1561,5 @@
         strWarningInfo = "<br />" + strWarningInfo;
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to open/interpret appliance <b>%1</b>.")
              .arg(appliance.GetPath()),
@@ -1583,5 +1569,5 @@
 void UIMessageCenter::cannotImportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to import appliance <b>%1</b>.")
              .arg(strPath),
@@ -1591,5 +1577,5 @@
 void UIMessageCenter::cannotCheckFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to check files."),
           !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
@@ -1598,5 +1584,5 @@
 void UIMessageCenter::cannotRemoveFiles(const CProgress &progress, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to remove file."),
           !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
@@ -1605,5 +1591,5 @@
 bool UIMessageCenter::confirmExportMachinesInSaveState(const QStringList &machineNames, QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(), MessageType_Warning,
+    return questionBinary(pParent, MessageType_Warning,
                           tr("<p>The %n following virtual machine(s) are currently in a saved state: <b>%1</b></p>"
                              "<p>If you continue the runtime state of the exported machine(s) will be discarded. "
@@ -1622,5 +1608,5 @@
     QString strErrorInfo = formatErrorInfo(appliance);
     /* Show the error: */
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to prepare the export of the appliance <b>%1</b>.")
              .arg(appliance.GetPath()),
@@ -1630,5 +1616,5 @@
 void UIMessageCenter::cannotExportAppliance(const CMachine &machine, const QString &strPath, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to prepare the export of the appliance <b>%1</b>.")
              .arg(strPath),
@@ -1638,5 +1624,5 @@
 void UIMessageCenter::cannotExportAppliance(const CProgress &progress, const QString &strPath, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to export appliance <b>%1</b>.")
              .arg(strPath),
@@ -1646,5 +1632,5 @@
 void UIMessageCenter::cannotFindSnapshotByName(const CMachine &machine, const QString &strName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Can't find snapshot named <b>%1</b>.")
              .arg(strName),
@@ -1713,5 +1699,5 @@
     if (type == MessageType_Critical)
     {
-        error(mainMachineWindowShown(), type,
+        error(mainWindowShown(), type,
               tr("<p>A fatal error has occurred during virtual machine execution! "
                  "The virtual machine will be powered off. Please copy the following error message "
@@ -1721,5 +1707,5 @@
     else if (type == MessageType_Error)
     {
-        error(mainMachineWindowShown(), type,
+        error(mainWindowShown(), type,
               tr("<p>An error has occurred during virtual machine execution! "
                  "The error details are shown below. You may try to correct the error "
@@ -1729,5 +1715,5 @@
     else
     {
-        error(mainMachineWindowShown(), type,
+        error(mainWindowShown(), type,
               tr("<p>The virtual machine execution may run into an error condition as described below. "
                  "We suggest that you take an appropriate action to avert the error.</p>"),
@@ -1746,5 +1732,5 @@
 bool UIMessageCenter::remindAboutGuruMeditation(const QString &strLogFolder)
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_GuruMeditation,
+    return questionBinary(mainWindowShown(), MessageType_GuruMeditation,
                           tr("<p>A critical error has occurred while running the virtual "
                              "machine and the machine execution has been stopped.</p>"
@@ -1773,5 +1759,5 @@
 {
     if (fHWVirtExSupported)
-        return questionBinary(mainMachineWindowShown(), MessageType_Error,
+        return questionBinary(mainWindowShown(), MessageType_Error,
                               tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is "
                                  "not operational. Your 64-bit guest will fail to detect a "
@@ -1782,5 +1768,5 @@
                               tr("Close VM"), tr("Continue"));
     else
-        return questionBinary(mainMachineWindowShown(), MessageType_Error,
+        return questionBinary(mainWindowShown(), MessageType_Error,
                               tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
                                  "Your 64-bit guest will fail to detect a 64-bit CPU and will "
@@ -1793,5 +1779,5 @@
 {
     if (fHWVirtExSupported)
-        return questionBinary(mainMachineWindowShown(), MessageType_Error,
+        return questionBinary(mainWindowShown(), MessageType_Error,
                               tr("<p>VT-x/AMD-V hardware acceleration has been enabled, but is not operational. "
                                  "Certain guests (e.g. OS/2 and QNX) require this feature.</p>"
@@ -1800,5 +1786,5 @@
                               tr("Close VM"), tr("Continue"));
     else
-        return questionBinary(mainMachineWindowShown(), MessageType_Error,
+        return questionBinary(mainWindowShown(), MessageType_Error,
                               tr("<p>VT-x/AMD-V hardware acceleration is not available on your system. "
                                  "Certain guests (e.g. OS/2 and QNX) require this feature and will fail to boot without it.</p>"),
@@ -1809,5 +1795,5 @@
 bool UIMessageCenter::cannotStartWithoutNetworkIf(const QString &strMachineName, const QString &strIfNames) const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Error,
+    return questionBinary(mainWindowShown(), MessageType_Error,
                           tr("<p>Could not start the machine <b>%1</b> because the following "
                              "physical network interfaces were not found:</p><p><b>%2</b></p>"
@@ -1820,5 +1806,5 @@
 void UIMessageCenter::cannotStartMachine(const CConsole &console, const QString &strName) const
 {
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to start the virtual machine <b>%1</b>.")
              .arg(strName),
@@ -1828,5 +1814,5 @@
 void UIMessageCenter::cannotStartMachine(const CProgress &progress, const QString &strName) const
 {
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to start the virtual machine <b>%1</b>.")
              .arg(strName),
@@ -1836,5 +1822,5 @@
 void UIMessageCenter::cannotSendACPIToMachine() const
 {
-    alert(mainMachineWindowShown(),  MessageType_Warning,
+    alert(mainWindowShown(),  MessageType_Warning,
           tr("You are trying to shut down the guest with the ACPI power button. "
              "This is currently not possible because the guest does not support software shutdown."));
@@ -1843,5 +1829,5 @@
 bool UIMessageCenter::confirmInputCapture(bool &fAutoConfirmed) const
 {
-    int rc = question(mainMachineWindowShown(), MessageType_Info,
+    int rc = question(mainWindowShown(), MessageType_Info,
                       tr("<p>You have <b>clicked the mouse</b> inside the Virtual Machine display or pressed the <b>host key</b>. "
                          "This will cause the Virtual Machine to <b>capture</b> the host mouse pointer (only if the mouse pointer "
@@ -1868,5 +1854,5 @@
 void UIMessageCenter::remindAboutAutoCapture() const
 {
-    alert(mainMachineWindowShown(), MessageType_Info,
+    alert(mainWindowShown(), MessageType_Info,
           tr("<p>You have the <b>Auto capture keyboard</b> option turned on. "
              "This will cause the Virtual Machine to automatically <b>capture</b> "
@@ -1903,5 +1889,5 @@
     if (fSupportsAbsolute)
     {
-        alert(mainMachineWindowShown(), MessageType_Info,
+        alert(mainWindowShown(), MessageType_Info,
               tr("<p>The Virtual Machine reports that the guest OS supports <b>mouse pointer integration</b>. "
                  "This means that you do not need to <i>capture</i> the mouse pointer to be able to use it in your guest OS -- "
@@ -1917,5 +1903,5 @@
     else
     {
-        alert(mainMachineWindowShown(), MessageType_Info,
+        alert(mainWindowShown(), MessageType_Info,
               tr("<p>The Virtual Machine reports that the guest OS does not support <b>mouse pointer integration</b> "
                  "in the current video mode. You need to capture the mouse (by clicking over the VM display "
@@ -1930,5 +1916,5 @@
 void UIMessageCenter::remindAboutPausedVMInput() const
 {
-    alert(mainMachineWindowShown(), MessageType_Info,
+    alert(mainWindowShown(), MessageType_Info,
           tr("<p>The Virtual Machine is currently in the <b>Paused</b> state and "
              "not able to see any keyboard or mouse input. If you want to "
@@ -1940,5 +1926,5 @@
 bool UIMessageCenter::confirmGoingFullscreen(const QString &strHotKey) const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Info,
+    return questionBinary(mainWindowShown(), MessageType_Info,
                           tr("<p>The virtual machine window will be now switched to <b>fullscreen</b> mode. "
                              "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
@@ -1953,5 +1939,5 @@
 bool UIMessageCenter::confirmGoingSeamless(const QString &strHotKey) const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Info,
+    return questionBinary(mainWindowShown(), MessageType_Info,
                           tr("<p>The virtual machine window will be now switched to <b>Seamless</b> mode. "
                              "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
@@ -1966,5 +1952,5 @@
 bool UIMessageCenter::confirmGoingScale(const QString &strHotKey) const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Info,
+    return questionBinary(mainWindowShown(), MessageType_Info,
                           tr("<p>The virtual machine window will be now switched to <b>Scale</b> mode. "
                              "You can go back to windowed mode at any time by pressing <b>%1</b>.</p>"
@@ -1979,5 +1965,5 @@
 bool UIMessageCenter::cannotEnterFullscreenMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Warning,
+    return questionBinary(mainWindowShown(), MessageType_Warning,
                           tr("<p>Could not switch the guest display to fullscreen mode due to insufficient guest video memory.</p>"
                              "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
@@ -1990,5 +1976,5 @@
 void UIMessageCenter::cannotEnterSeamlessMode(ULONG /* uWidth */, ULONG /* uHeight */, ULONG /* uBpp */, ULONG64 uMinVRAM) const
 {
-    alert(mainMachineWindowShown(), MessageType_Error,
+    alert(mainWindowShown(), MessageType_Error,
           tr("<p>Could not enter seamless mode due to insufficient guest "
              "video memory.</p>"
@@ -2000,5 +1986,5 @@
 bool UIMessageCenter::cannotSwitchScreenInFullscreen(quint64 uMinVRAM) const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Warning,
+    return questionBinary(mainWindowShown(), MessageType_Warning,
                           tr("<p>Could not change the guest screen to this host screen due to insufficient guest video memory.</p>"
                              "<p>You should configure the virtual machine to have at least <b>%1</b> of video memory.</p>"
@@ -2011,5 +1997,5 @@
 void UIMessageCenter::cannotSwitchScreenInSeamless(quint64 uMinVRAM) const
 {
-    alert(mainMachineWindowShown(), MessageType_Error,
+    alert(mainWindowShown(), MessageType_Error,
           tr("<p>Could not change the guest screen to this host screen "
              "due to insufficient guest video memory.</p>"
@@ -2024,5 +2010,5 @@
     QString strErrorInfo = formatErrorInfo(console);
     /* Show the error: */
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
              .arg(strDevice, console.GetMachine().GetName()),
@@ -2032,5 +2018,5 @@
 void UIMessageCenter::cannotAttachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const
 {
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to attach the USB device <b>%1</b> to the virtual machine <b>%2</b>.")
              .arg(strDevice, strMachineName),
@@ -2043,5 +2029,5 @@
     QString strErrorInfo = formatErrorInfo(console);
     /* Show the error: */
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
              .arg(strDevice, console.GetMachine().GetName()),
@@ -2051,5 +2037,5 @@
 void UIMessageCenter::cannotDetachUSBDevice(const CVirtualBoxErrorInfo &errorInfo, const QString &strDevice, const QString &strMachineName) const
 {
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to detach the USB device <b>%1</b> from the virtual machine <b>%2</b>.")
              .arg(strDevice, strMachineName),
@@ -2059,5 +2045,5 @@
 void UIMessageCenter::remindAboutGuestAdditionsAreNotActive(QWidget *pParent /*= 0*/) const
 {
-    alert(pParent ? pParent : mainMachineWindowShown(), MessageType_Warning,
+    alert(pParent, MessageType_Warning,
           tr("<p>The VirtualBox Guest Additions do not appear to be available on this virtual machine, "
              "and shared folders cannot be used without them. To use shared folders inside the virtual machine, "
@@ -2101,5 +2087,5 @@
 bool UIMessageCenter::cannotFindGuestAdditions() const
 {
-    return questionBinary(mainMachineWindowShown(), MessageType_Question,
+    return questionBinary(mainWindowShown(), MessageType_Question,
                           tr("<p>Could not find the <b>VirtualBox Guest Additions</b> CD image.</p>"
                              "<p>Do you wish to download this CD image from the Internet?</p>"),
@@ -2111,5 +2097,5 @@
 {
     QLocale loc(VBoxGlobal::languageId());
-    return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question,
+    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
                           tr("<p>Are you sure you want to download the <b>VirtualBox Guest Additions</b> CD image "
                              "from <nobr><a href=\"%1\">%1</a></nobr> (size %2 bytes)?</p>")
@@ -2121,5 +2107,5 @@
 void UIMessageCenter::cannotSaveGuestAdditions(const QString &strURL, const QString &strTarget) const
 {
-    alert(networkManagerOrMainMachineWindowShown(), MessageType_Error,
+    alert(networkManagerOrMainWindowShown(), MessageType_Error,
           tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
              "from <nobr><a href=\"%1\">%1</a></nobr> "
@@ -2131,5 +2117,5 @@
 bool UIMessageCenter::proposeMountGuestAdditions(const QString &strUrl, const QString &strSrc) const
 {
-    return questionBinary(networkManagerOrMainMachineWindowShown(), MessageType_Question,
+    return questionBinary(networkManagerOrMainWindowShown(), MessageType_Question,
                           tr("<p>The <b>VirtualBox Guest Additions</b> CD image has been successfully downloaded "
                              "from <nobr><a href=\"%1\">%1</a></nobr> "
@@ -2143,5 +2129,5 @@
 void UIMessageCenter::cannotMountGuestAdditions(const QString &strMachineName) const
 {
-    alert(mainMachineWindowShown(), MessageType_Error,
+    alert(mainWindowShown(), MessageType_Error,
           tr("<p>Could not insert the <b>VirtualBox Guest Additions</b> CD image into the virtual machine <b>%1</b>, "
              "as the machine has no CD/DVD-ROM drives. Please add a drive using the storage page of the "
@@ -2152,5 +2138,5 @@
 void UIMessageCenter::cannotUpdateGuestAdditions(const CProgress &progress) const
 {
-    error(mainMachineWindowShown(), MessageType_Error,
+    error(mainWindowShown(), MessageType_Error,
           tr("Failed to update Guest Additions. "
              "The Guest Additions installation image will be mounted to provide a manual installation."),
@@ -2245,6 +2231,5 @@
                                                   const QString &strPackDescription, QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(),
-                          MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           tr("<p>You are about to install a VirtualBox extension pack. "
                              "Extension packs complement the functionality of VirtualBox and can contain system level software "
@@ -2279,6 +2264,5 @@
     bool fRc;
     if (iVerCmp > 0)
-        fRc = questionBinary(pParent ? pParent : mainWindowShown(),
-                             MessageType_Question,
+        fRc = questionBinary(pParent, MessageType_Question,
                              tr("<p>An older version of the extension pack is already installed, would you like to upgrade? "
                                 "<p>%1</p>"
@@ -2293,6 +2277,5 @@
                              tr("&Upgrade"));
     else if (iVerCmp < 0)
-        fRc = questionBinary(pParent ? pParent : mainWindowShown(),
-                             MessageType_Question,
+        fRc = questionBinary(pParent, MessageType_Question,
                              tr("<p>An newer version of the extension pack is already installed, would you like to downgrade? "
                                 "<p>%1</p>"
@@ -2307,6 +2290,5 @@
                              tr("&Downgrade"));
     else
-        fRc = questionBinary(pParent ? pParent : mainWindowShown(),
-                             MessageType_Question,
+        fRc = questionBinary(pParent, MessageType_Question,
                              tr("<p>The extension pack is already installed with the same version, would you like reinstall it? "
                                 "<p>%1</p>"
@@ -2324,6 +2306,5 @@
 bool UIMessageCenter::confirmRemoveExtensionPack(const QString &strPackName, QWidget *pParent /*= 0*/) const
 {
-    return questionBinary(pParent ? pParent : mainWindowShown(),
-                          MessageType_Question,
+    return questionBinary(pParent, MessageType_Question,
                           tr("<p>You are about to remove the VirtualBox extension pack <b>%1</b>.</p>"
                              "<p>Are you sure you want to proceed?</p>")
@@ -2335,5 +2316,5 @@
 void UIMessageCenter::cannotOpenExtPack(const QString &strFilename, const CExtPackManager &extPackManager, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
           formatErrorInfo(extPackManager));
@@ -2342,5 +2323,5 @@
 void UIMessageCenter::warnAboutBadExtPackFile(const QString &strFilename, const CExtPackFile &extPackFile, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to open the Extension Pack <b>%1</b>.").arg(strFilename),
           "<!--EOM-->" + extPackFile.GetWhyUnusable());
@@ -2349,5 +2330,5 @@
 void UIMessageCenter::cannotInstallExtPack(const CExtPackFile &extPackFile, const QString &strFilename, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to install the Extension Pack <b>%1</b>.")
              .arg(strFilename),
@@ -2357,5 +2338,5 @@
 void UIMessageCenter::cannotInstallExtPack(const CProgress &progress, const QString &strFilename, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to install the Extension Pack <b>%1</b>.")
              .arg(strFilename),
@@ -2365,5 +2346,5 @@
 void UIMessageCenter::cannotUninstallExtPack(const CExtPackManager &extPackManager, const QString &strPackName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to uninstall the Extension Pack <b>%1</b>.")
              .arg(strPackName),
@@ -2373,5 +2354,5 @@
 void UIMessageCenter::cannotUninstallExtPack(const CProgress &progress, const QString &strPackName, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to uninstall the Extension Pack <b>%1</b>.")
              .arg(strPackName),
@@ -2381,5 +2362,5 @@
 void UIMessageCenter::warnAboutExtPackInstalled(const QString &strPackName, QWidget *pParent /*= 0*/) const
 {
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Info,
+    alert(pParent, MessageType_Info,
           tr("The extension pack <br><nobr><b>%1</b><nobr><br> was installed successfully.")
              .arg(strPackName));
@@ -2389,5 +2370,5 @@
 void UIMessageCenter::cannotDropData(const CGuest &guest, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to drop data."),
           formatErrorInfo(guest));
@@ -2396,5 +2377,5 @@
 void UIMessageCenter::cannotDropData(const CProgress &progress, QWidget *pParent /*= 0*/) const
 {
-    error(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    error(pParent, MessageType_Error,
           tr("Failed to drop data."),
           !progress.isOk() ? formatErrorInfo(progress) : formatErrorInfo(progress.GetErrorInfo()));
@@ -2404,5 +2385,5 @@
 void UIMessageCenter::cannotOpenLicenseFile(const QString &strPath, QWidget *pParent /*= 0*/) const
 {
-    alert(pParent ? pParent : mainWindowShown(), MessageType_Error,
+    alert(pParent, MessageType_Error,
           tr("Failed to open the license file <nobr><b>%1</b></nobr>. Check file permissions.")
              .arg(strPath));
@@ -2642,5 +2623,5 @@
     }
 
-    alert(mainMachineWindowShown(), MessageType_Info,
+    alert(mainWindowShown(), MessageType_Info,
           tr("<p>The virtual machine window is optimized to work in "
              "<b>%1&nbsp;bit</b> color mode but the "
@@ -2850,5 +2831,5 @@
 
     /* Create message-box: */
-    QWidget *pMessageBoxParent = mwManager().realParentWindow(pParent);
+    QWidget *pMessageBoxParent = mwManager().realParentWindow(pParent ? pParent : mainWindowShown());
     QPointer<QIMessageBox> pMessageBox = new QIMessageBox(title, strMessage, icon,
                                                           iButton1, iButton2, iButton3,
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45371)
@@ -155,7 +155,5 @@
     /* API: Main window stuff: */
     QWidget* mainWindowShown() const;
-    QWidget* mainMachineWindowShown() const;
     QWidget* networkManagerOrMainWindowShown() const;
-    QWidget* networkManagerOrMainMachineWindowShown() const;
 
     /* API: Main (startup) warnings: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp	(revision 45371)
@@ -4959,5 +4959,5 @@
      * otherwise we better show the progress... */
     int iSpawningDuration = 60000;
-    msgCenter().showModalProgressDialog(progress, machine.GetName(), "", mainWindow(), iSpawningDuration);
+    msgCenter().showModalProgressDialog(progress, machine.GetName(), "", msgCenter().mainWindowShown(), iSpawningDuration);
     if (!progress.isOk() || progress.GetResultCode() != 0)
         msgCenter().cannotOpenSession(progress, machine.GetName());
Index: /trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/net/UIDownloaderAdditions.cpp	(revision 45371)
@@ -103,5 +103,5 @@
         /* Ask the user for another location for the additions-image file: */
         QString strTarget = QIFileDialog::getExistingDirectory(QFileInfo(target()).absolutePath(),
-                                                               msgCenter().networkManagerOrMainMachineWindowShown(),
+                                                               msgCenter().networkManagerOrMainWindowShown(),
                                                                tr("Select folder to save Guest Additions image to"), true);
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/net/UIUpdateManager.cpp	(revision 45371)
@@ -443,5 +443,5 @@
         /* Warn the user about extension pack was downloaded and saved, propose to install it: */
         if (msgCenter().proposeInstallExtentionPack(GUI_ExtPackName, strSource, QDir::toNativeSeparators(strTarget)))
-            UIGlobalSettingsExtension::doInstallation(strTarget, strDigest, msgCenter().mainWindowShown(), NULL);
+            UIGlobalSettingsExtension::doInstallation(strTarget, strDigest, msgCenter().networkManagerOrMainWindowShown(), NULL);
     }
 };
Index: /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp	(revision 45371)
@@ -506,5 +506,5 @@
     {
         msgCenter().showModalProgressDialog(progressInstall, tr("Updating Guest Additions"), ":/progress_install_guest_additions_90px.png",
-                                            mainMachineWindow(), 500 /* 500ms delay. */);
+                                            machineLogic()->activeMachineWindow(), 500 /* 500ms delay. */);
         if (progressInstall.GetCanceled())
             return;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp	(revision 45371)
@@ -609,5 +609,5 @@
             /* Show machine state saving progress: */
             CMachine machine = session.GetMachine();
-            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png", this);
+            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png");
             if (!progress.isOk() || progress.GetResultCode() != 0)
                 msgCenter().cannotSaveMachineState(progress, machine.GetName());
@@ -699,5 +699,5 @@
             /* Show machine power down progress: */
             CMachine machine = session.GetMachine();
-            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png", this);
+            msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png");
             if (!progress.isOk() || progress.GetResultCode() != 0)
                 msgCenter().cannotPowerDownMachine(progress, machine.GetName());
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp	(revision 45370)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/VBoxSnapshotsWgt.cpp	(revision 45371)
@@ -607,6 +607,5 @@
     if (console.isOk())
     {
-        msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_restore_90px.png",
-                                            msgCenter().mainWindowShown(), true);
+        msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_restore_90px.png");
         if (progress.GetResultCode() != 0)
             msgCenter().cannotRestoreSnapshot(progress, snapshot.GetName(), mMachine.GetName());
@@ -656,6 +655,5 @@
     {
         /* Show the progress dialog */
-        msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_discard_90px.png",
-                                            msgCenter().mainWindowShown(), true);
+        msgCenter().showModalProgressDialog(progress, mMachine.GetName(), ":/progress_snapshot_discard_90px.png");
 
         if (progress.GetResultCode() != 0)
