Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45287)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 45288)
@@ -76,5 +76,5 @@
 }
 
-void UIMessageCenter::setWarningShown(const QString &strWarningName, bool fWarningShown)
+void UIMessageCenter::setWarningShown(const QString &strWarningName, bool fWarningShown) const
 {
     if (fWarningShown && !m_warnings.contains(strWarningName))
@@ -285,5 +285,5 @@
 
 #ifdef RT_OS_LINUX
-void UIMessageCenter::warnAboutWrongUSBMounted()
+void UIMessageCenter::warnAboutWrongUSBMounted() const
 {
     message(mainWindowShown(), MessageType_Warning,
@@ -295,5 +295,5 @@
 #endif /* RT_OS_LINUX */
 
-void UIMessageCenter::cannotStartSelector()
+void UIMessageCenter::cannotStartSelector() const
 {
     message(0, MessageType_Critical,
@@ -302,5 +302,5 @@
 }
 
-void UIMessageCenter::showBETAWarning()
+void UIMessageCenter::showBETAWarning() const
 {
     message(0, MessageType_Warning,
@@ -309,5 +309,5 @@
 }
 
-void UIMessageCenter::showBEBWarning()
+void UIMessageCenter::showBEBWarning() const
 {
     message(0, MessageType_Warning,
@@ -316,5 +316,5 @@
 }
 
-void UIMessageCenter::cannotInitUserHome(const QString &strUserHome)
+void UIMessageCenter::cannotInitUserHome(const QString &strUserHome) const
 {
     message(0, MessageType_Critical,
@@ -322,9 +322,10 @@
                "configuration directory <b><nobr>%1</nobr></b> is not accessible. "
                "Please check the permissions of this directory and of its parent directory.</p>"
-               "<p>The application will now terminate.</p>").arg(strUserHome),
+               "<p>The application will now terminate.</p>")
+               .arg(strUserHome),
             formatErrorInfo(COMErrorInfo()));
 }
 
-void UIMessageCenter::cannotInitCOM(HRESULT rc)
+void UIMessageCenter::cannotInitCOM(HRESULT rc) const
 {
     message(0, MessageType_Critical,
@@ -335,5 +336,5 @@
 }
 
-void UIMessageCenter::cannotCreateVirtualBox(const CVirtualBox &vbox)
+void UIMessageCenter::cannotCreateVirtualBox(const CVirtualBox &vbox) const
 {
     message(0, MessageType_Critical,
@@ -343,5 +344,5 @@
 }
 
-void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath)
+void UIMessageCenter::cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const
 {
     message(0, MessageType_Error,
@@ -353,5 +354,5 @@
 }
 
-void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile)
+void UIMessageCenter::cannotLoadLanguage(const QString &strLangFile) const
 {
     message(0, MessageType_Error,
@@ -363,5 +364,5 @@
 }
 
-void UIMessageCenter::cannotLoadGlobalConfig(const CVirtualBox &vbox, const QString &strError)
+void UIMessageCenter::cannotLoadGlobalConfig(const CVirtualBox &vbox, const QString &strError) const
 {
     /* Preserve error-info: */
@@ -370,10 +371,10 @@
     message(0, MessageType_Critical,
             tr("<p>Failed to load the global GUI configuration from <b><nobr>%1</nobr></b>.</p>"
-               "<p>The application will now terminate.</p>").arg(vbox.GetSettingsFilePath()),
-            !res.isOk() ? formatErrorInfo(res)
-                        : QString("<!--EOM--><p>%1</p>").arg(vboxGlobal().emphasize(strError)));
-}
-
-void UIMessageCenter::cannotSaveGlobalConfig(const CVirtualBox &vbox)
+               "<p>The application will now terminate.</p>")
+               .arg(vbox.GetSettingsFilePath()),
+            !res.isOk() ? formatErrorInfo(res) : QString("<!--EOM--><p>%1</p>").arg(vboxGlobal().emphasize(strError)));
+}
+
+void UIMessageCenter::cannotSaveGlobalConfig(const CVirtualBox &vbox) const
 {
     /* Preserve error-info: */
@@ -382,25 +383,27 @@
     message(0, MessageType_Critical,
             tr("<p>Failed to save the global GUI configuration to <b><nobr>%1</nobr></b>.</p>"
-               "<p>The application will now terminate.</p>").arg(vbox.GetSettingsFilePath()),
+               "<p>The application will now terminate.</p>")
+               .arg(vbox.GetSettingsFilePath()),
             formatErrorInfo(res));
 }
 
-void UIMessageCenter::cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName)
+void UIMessageCenter::cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const
 {
     message(0, MessageType_Error,
-            tr("There is no virtual machine named <b>%1</b>.").arg(strName),
+            tr("There is no virtual machine named <b>%1</b>.")
+               .arg(strName),
             formatErrorInfo(vbox));
 }
 
-void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QString &strId)
+void UIMessageCenter::cannotFindMachineById(const CVirtualBox &vbox, const QString &strId) const
 {
     message(0, MessageType_Error,
-            tr("There is no virtual machine with id <b>%1</b>.").arg(strId),
+            tr("There is no virtual machine with id <b>%1</b>.")
+               .arg(strId),
             formatErrorInfo(vbox));
 }
 
-void UIMessageCenter::cannotOpenSession(const CSession &session)
-{
-    Assert(session.isNull());
+void UIMessageCenter::cannotOpenSession(const CSession &session) const
+{
     /* Show the message: */
     message(mainWindowShown(), MessageType_Error,
@@ -409,6 +412,5 @@
 }
 
-void UIMessageCenter::cannotOpenSession(const CMachine &machine,
-                                        const CProgress &progress /* = CProgress() */)
+void UIMessageCenter::cannotOpenSession(const CMachine &machine, const CProgress &progress /* = CProgress() */) const
 {
     /* Format error-info: */
@@ -423,9 +425,10 @@
     /* Show the message: */
     message(mainWindowShown(), MessageType_Error,
-            tr("Failed to open a session for the virtual machine <b>%1</b>.").arg(strName),
+            tr("Failed to open a session for the virtual machine <b>%1</b>.")
+               .arg(strName),
             strErrorInfo);
 }
 
-void UIMessageCenter::cannotGetMediaAccessibility(const UIMedium &medium)
+void UIMessageCenter::cannotGetMediaAccessibility(const UIMedium &medium) const
 {
     message(mainWindowShown(), MessageType_Error,
@@ -435,5 +438,5 @@
 }
 
-void UIMessageCenter::cannotOpenURL(const QString &strUrl)
+void UIMessageCenter::cannotOpenURL(const QString &strUrl) const
 {
     message(mainWindowShown(), MessageType_Error,
@@ -443,12 +446,13 @@
 }
 
-void UIMessageCenter::cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath)
+void UIMessageCenter::cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath) const
 {
     message(mainWindowShown(), MessageType_Error,
-            tr("Failed to open virtual machine located in %1.").arg(strMachinePath),
+            tr("Failed to open virtual machine located in %1.")
+               .arg(strMachinePath),
             formatErrorInfo(vbox));
 }
 
-void UIMessageCenter::cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName)
+void UIMessageCenter::cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const
 {
     message(mainWindowShown(), MessageType_Error,
@@ -457,5 +461,5 @@
 }
 
-void UIMessageCenter::cannotResolveCollisionAutomatically(const QString &strName, const QString &strGroupName)
+void UIMessageCenter::cannotResolveCollisionAutomatically(const QString &strName, const QString &strGroupName) const
 {
     message(mainWindowShown(), MessageType_Error,
@@ -466,5 +470,5 @@
 }
 
-bool UIMessageCenter::confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName)
+bool UIMessageCenter::confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
@@ -473,9 +477,9 @@
                               "<p>Would you like to automatically rename it?</p>")
                               .arg(strName, strGroupName),
-                           0, /* auto-confirm id */
+                           0 /* auto-confirm id */,
                            tr("Rename"));
 }
 
-void UIMessageCenter::cannotSetGroups(const CMachine &machine)
+void UIMessageCenter::cannotSetGroups(const CMachine &machine) const
 {
     /* Preserve error-info: */
@@ -487,20 +491,20 @@
     /* Show the message: */
     message(mainWindowShown(), MessageType_Error,
-            tr("Failed to set groups of the virtual machine <b>%1</b>.").arg(strName),
+            tr("Failed to set groups of the virtual machine <b>%1</b>.")
+               .arg(strName),
             formatErrorInfo(res));
 }
 
-bool UIMessageCenter::confirmMachineItemRemoval(const QStringList &names)
+bool UIMessageCenter::confirmMachineItemRemoval(const QStringList &names) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
-                           tr("<p>You are about to remove following virtual "
-                              "machine items from the machine list:</p>"
-                              "<p><b>%1</b></p>"
-                              "<p>Do you wish to proceed?</p>").arg(names.join(", ")),
-                           0, /* auto-confirm id */
+                           tr("<p>You are about to remove following virtual machine items from the machine list:</p>"
+                              "<p><b>%1</b></p><p>Do you wish to proceed?</p>")
+                              .arg(names.join(", ")),
+                           0 /* auto-confirm id */,
                            tr("Remove"));
 }
 
-int UIMessageCenter::confirmMachineRemoval(const QList<CMachine> &machines)
+int UIMessageCenter::confirmMachineRemoval(const QList<CMachine> &machines) const
 {
     /* Enumerate the machines: */
@@ -567,5 +571,5 @@
     return cInacessibleMachineCount == machines.size() ?
            message(mainWindowShown(), MessageType_Question,
-                   strText, 0, /* auto-confirm id */
+                   strText, 0 /* auto-confirm id */,
                    QIMessageBox::Ok | QIMessageBox::Default,
                    QIMessageBox::Cancel | QIMessageBox::Escape,
@@ -573,5 +577,5 @@
                    tr("Remove")) :
            message(mainWindowShown(), MessageType_Question,
-                   strText, 0, /* auto-confirm id */
+                   strText, 0 /* auto-confirm id */,
                    QIMessageBox::Yes,
                    QIMessageBox::No | QIMessageBox::Default,
@@ -581,5 +585,5 @@
 }
 
-void UIMessageCenter::cannotRemoveMachine(const CMachine &machine)
+void UIMessageCenter::cannotRemoveMachine(const CMachine &machine) const
 {
     /* Preserve error-info: */
@@ -593,5 +597,5 @@
 }
 
-void UIMessageCenter::cannotRemoveMachine(const CMachine &machine, const CProgress &progress)
+void UIMessageCenter::cannotRemoveMachine(const CMachine &machine, const CProgress &progress) const
 {
     message(mainWindowShown(),
@@ -602,5 +606,5 @@
 }
 
-bool UIMessageCenter::remindAboutInaccessibleMedia()
+bool UIMessageCenter::remindAboutInaccessibleMedia() const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Warning,
@@ -616,5 +620,5 @@
 }
 
-bool UIMessageCenter::confirmDiscardSavedState(const QString &strNames)
+bool UIMessageCenter::confirmDiscardSavedState(const QString &strNames) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
@@ -628,5 +632,5 @@
 }
 
-bool UIMessageCenter::confirmVMReset(const QString &strNames)
+bool UIMessageCenter::confirmVMReset(const QString &strNames) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
@@ -639,5 +643,5 @@
 }
 
-bool UIMessageCenter::confirmVMACPIShutdown(const QString &strNames)
+bool UIMessageCenter::confirmVMACPIShutdown(const QString &strNames) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
@@ -649,5 +653,5 @@
 }
 
-bool UIMessageCenter::confirmVMPowerOff(const QString &strNames)
+bool UIMessageCenter::confirmVMPowerOff(const QString &strNames) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
@@ -660,5 +664,5 @@
 }
 
-void UIMessageCenter::cannotDiscardSavedState(const CConsole &console)
+void UIMessageCenter::cannotDiscardSavedState(const CConsole &console) const
 {
     /* Preserve error-info: */
@@ -671,5 +675,5 @@
 }
 
-void UIMessageCenter::cannotStopMachine(const CConsole &console)
+void UIMessageCenter::cannotStopMachine(const CConsole &console) const
 {
     /* Preserve error-info: */
@@ -682,5 +686,5 @@
 }
 
-int UIMessageCenter::confirmSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot)
+int UIMessageCenter::confirmSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot) const
 {
     return fAlsoCreateNewSnapshot ?
@@ -698,5 +702,6 @@
                              tr("Restore"), tr("Cancel"), QString() /* 3rd button text */) :
            message(mainWindowShown(), MessageType_Question,
-                   tr("<p>Are you sure you want to restore snapshot <nobr><b>%1</b></nobr>?</p>").arg(strSnapshotName),
+                   tr("<p>Are you sure you want to restore snapshot <nobr><b>%1</b></nobr>?</p>")
+                      .arg(strSnapshotName),
                    0 /* auto-confirm id */,
                    QIMessageBox::Ok | QIMessageBox::Default,
@@ -706,13 +711,14 @@
 }
 
-bool UIMessageCenter::confirmSnapshotRemoval(const QString &strSnapshotName)
+bool UIMessageCenter::confirmSnapshotRemoval(const QString &strSnapshotName) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
                            tr("<p>Deleting the snapshot will cause the state information saved in it to be lost, and disk data spread over "
-                              "several image files that VirtualBox has created together with the snapshot will be merged into one file. This can be a lengthy process, and the information "
-                              "in the snapshot cannot be recovered.</p></p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p>")
+                              "several image files that VirtualBox has created together with the snapshot will be merged into one file. "
+                              "This can be a lengthy process, and the information in the snapshot cannot be recovered.</p>"
+                              "</p>Are you sure you want to delete the selected snapshot <b>%1</b>?</p>")
                               .arg(strSnapshotName),
                            0 /* auto-confirm id */,
-                           tr("Delete"), tr("Cancel"));
+                           tr("Delete"));
 }
 
@@ -720,5 +726,5 @@
                                                         const QString &strTargetImageName,
                                                         const QString &strTargetImageMaxSize,
-                                                        const QString &strTargetFileSystemFree)
+                                                        const QString &strTargetFileSystemFree) const
 {
     return messageOkCancel(mainWindowShown(), MessageType_Question,
@@ -735,5 +741,5 @@
 }
 
-void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName)
+void UIMessageCenter::cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName) const
 {
     message(mainWindowShown(), MessageType_Error,
@@ -743,5 +749,5 @@
 }
 
-void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName)
+void UIMessageCenter::cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName) const
 {
     /* Get console: */
@@ -756,5 +762,5 @@
 }
 
-void UIMessageCenter::cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName)
+void UIMessageCenter::cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName) const
 {
     message(mainWindowShown(), MessageType_Error,
@@ -765,6 +771,5 @@
 }
 
-void UIMessageCenter::cannotRemoveSnapshot(const CProgress &progress,
-                                           const QString &strSnapshotName)
+void UIMessageCenter::cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName) const
 {
     /* Get console: */
@@ -774,18 +779,11 @@
     /* Show the message: */
     message(mainWindowShown(), MessageType_Error,
-        tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
-            .arg(strSnapshotName)
-            .arg(console.GetMachine().GetName()),
-        formatErrorInfo(progress.GetErrorInfo()));
-}
-
-void UIMessageCenter::cannotSetSystemProperties(const CSystemProperties &properties)
-{
-    message(mainWindowShown(), MessageType_Critical,
-            tr("Failed to set global VirtualBox properties."),
-            formatErrorInfo(properties));
-}
-
-void UIMessageCenter::cannotAccessUSB(const COMBaseWithEI &object)
+            tr("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
+               .arg(strSnapshotName)
+               .arg(console.GetMachine().GetName()),
+            formatErrorInfo(progress.GetErrorInfo()));
+}
+
+void UIMessageCenter::cannotAccessUSB(const COMBaseWithEI &object) const
 {
     /* If IMachine::GetUSBController(), IHost::GetUSBDevices() etc. return
@@ -795,5 +793,5 @@
     if (res.rc() == E_NOTIMPL)
         return;
-
+    /* Show the message: */
     message(mainWindowShown(), res.isWarning() ? MessageType_Warning : MessageType_Error,
              tr("Failed to access the USB subsystem."),
@@ -802,26 +800,12 @@
 }
 
-void UIMessageCenter::cannotLoadMachineSettings(const CMachine &machine, bool fStrict /*= true*/, QWidget *pParent /*= 0*/)
-{
-    /* This function is NOT use currently.
-     * We are keeping it here just for convinience with Save analog. */
-
-    /* Preserve error-info.
-     * If COM result code is E_NOTIMPL, it means the requested
-     * object or function is intentionally missing (as in the OSE version).
-     * Don't show the error message in this case. */
-    COMResult res(machine);
-    if (!fStrict && res.rc() == E_NOTIMPL)
-        return;
-
-    /* Show the message: */
-    message(pParent ? pParent : mainWindowShown(), MessageType_Error,
-            tr("Failed to load the settings of the virtual machine "
-               "<b>%1</b> from <b><nobr>%2</nobr></b>.")
-               .arg(machine.GetName(), machine.GetSettingsFilePath()),
-            formatErrorInfo(res));
-}
-
-void UIMessageCenter::cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent /*= 0*/)
+void UIMessageCenter::cannotSetSystemProperties(const CSystemProperties &properties) const
+{
+    message(mainWindowShown(), MessageType_Critical,
+            tr("Failed to set global VirtualBox properties."),
+            formatErrorInfo(properties));
+}
+
+void UIMessageCenter::cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent /*= 0*/) const
 {
     /* Preserve error-info: */
@@ -829,43 +813,57 @@
     /* Show the message: */
     message(pParent ? pParent : mainWindowShown(), MessageType_Error,
-            tr("Failed to save the settings of the virtual machine "
-               "<b>%1</b> to <b><nobr>%2</nobr></b>.")
+            tr("Failed to save the settings of the virtual machine <b>%1</b> to <b><nobr>%2</nobr></b>.")
                .arg(machine.GetName(), machine.GetSettingsFilePath()),
             formatErrorInfo(res));
 }
 
-void UIMessageCenter::warnAboutStateChange(QWidget *pParent)
-{
+void UIMessageCenter::warnAboutStateChange(QWidget *pParent /*= 0*/) const
+{
+    /* Do not show this async warning more than one at time: */
     if (warningShown("warnAboutStateChange"))
         return;
     setWarningShown("warnAboutStateChange", true);
-
+    /* Show the message: */
     message(pParent ? pParent : mainWindowShown(), MessageType_Warning,
             tr("The virtual machine that you are changing has been started. "
                "Only certain settings can be changed while a machine is running. "
                "All other changes will be lost if you close this window now."));
-
+    /* Allow to show this async warning: */
     setWarningShown("warnAboutStateChange", false);
 }
 
-bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent)
-{
-    int rc = message(pParent, MessageType_Question,
-                     tr("<p>The machine settings were changed while you were editing them. "
-                        "You currently have unsaved setting changes.</p>"
-                        "<p>Would you like to reload the changed settings or to keep your own changes?</p>"), 0,
-                     QIMessageBox::Yes, QIMessageBox::No | QIMessageBox::Default | QIMessageBox::Escape, 0,
-                     tr("Reload settings"), tr("Keep changes"), 0);
-    return rc == QIMessageBox::Yes;
-}
-
-int UIMessageCenter::askAboutHardDiskAttachmentCreation(QWidget *pParent,
-                                                        const QString &strControllerName)
-{
-    return message(pParent, MessageType_Question,
+bool UIMessageCenter::confirmSettingsReloading(QWidget *pParent /*= 0*/) const
+{
+    return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
+                           tr("<p>The machine settings were changed while you were editing them. "
+                              "You currently have unsaved setting changes.</p>"
+                              "<p>Would you like to reload the changed settings or to keep your own changes?</p>"),
+                           0 /* auto-confirm id */,
+                           tr("Reload settings"), tr("Keep changes"));
+}
+
+bool UIMessageCenter::confirmDeletingHostInterface(const QString &strName, QWidget *pParent /*= 0*/) const
+{
+    return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
+                           tr("<p>Deleting this host-only network will remove "
+                              "the host-only interface this network is based on. Do you want to "
+                              "remove the (host-only network) interface <nobr><b>%1</b>?</nobr></p>"
+                              "<p><b>Note:</b> this interface may be in use by one or more "
+                              "virtual network adapters belonging to one of your VMs. "
+                              "After it is removed, these adapters will no longer be usable until "
+                              "you correct their settings by either choosing a different interface "
+                              "name or a different adapter attachment type.</p>")
+                              .arg(strName),
+                           0 /* auto-confirm id */,
+                           tr("Remove"));
+}
+
+int UIMessageCenter::askAboutHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
+{
+    return message(pParent ? pParent : mainWindowShown(), 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>")
-                   .arg(strControllerName),
-                   0, /* auto-confirm id */
+                      .arg(strControllerName),
+                   0 /* auto-confirm id */,
                    QIMessageBox::Yes,
                    QIMessageBox::No,
@@ -875,13 +873,12 @@
 }
 
-int UIMessageCenter::askAboutOpticalAttachmentCreation(QWidget *pParent,
-                                                       const QString &strControllerName)
-{
-    return message(pParent, MessageType_Question,
+int UIMessageCenter::askAboutOpticalAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
+{
+    return message(pParent ? pParent : mainWindowShown(), 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 "
                       "or to leave it empty for now?</p>")
-                   .arg(strControllerName),
-                   0, /* auto-confirm id */
+                      .arg(strControllerName),
+                   0 /* auto-confirm id */,
                    QIMessageBox::Yes,
                    QIMessageBox::No,
@@ -891,13 +888,12 @@
 }
 
-int UIMessageCenter::askAboutFloppyAttachmentCreation(QWidget *pParent,
-                                                      const QString &strControllerName)
-{
-    return message(pParent, MessageType_Question,
+int UIMessageCenter::askAboutFloppyAttachmentCreation(const QString &strControllerName, QWidget *pParent /*= 0*/) const
+{
+    return message(pParent ? pParent : mainWindowShown(), 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 "
                       "or to leave it empty for now?</p>")
-                   .arg(strControllerName),
-                   0, /* auto-confirm id */
+                      .arg(strControllerName),
+                   0 /* auto-confirm id */,
                    QIMessageBox::Yes,
                    QIMessageBox::No,
@@ -907,43 +903,26 @@
 }
 
-int UIMessageCenter::confirmRemovingOfLastDVDDevice() const
-{
-    return messageOkCancel(QApplication::activeWindow(), 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 "
-                               "or install the Guest Additions without it!</p>"),
-                            0, /* auto-confirm id */
-                            tr("&Remove", "medium"));
-}
-
-int UIMessageCenter::confirmDeletingHostInterface(const QString &strName,
-                                                  QWidget *pParent)
-{
-    return msgCenter().message(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 "
-           "remove the (host-only network) interface <nobr><b>%1</b>?</nobr></p>"
-           "<p><b>Note:</b> this interface may be in use by one or more "
-           "virtual network adapters belonging to one of your VMs. "
-           "After it is removed, these adapters will no longer be usable until "
-           "you correct their settings by either choosing a different interface "
-           "name or a different adapter attachment type.</p>").arg(strName),
-        0, /* auto-confirm id */
-        QIMessageBox::Ok | QIMessageBox::Default,
-        QIMessageBox::Cancel | QIMessageBox::Escape);
-}
-
-void UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent) const
-{
-    message(pParent, MessageType_Error,
+int UIMessageCenter::confirmRemovingOfLastDVDDevice(QWidget *pParent /*= 0*/) const
+{
+    return messageOkCancel(pParent ? pParent : mainWindowShown(), 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 "
+                              "or install the Guest Additions without it!</p>"),
+                           0 /* auto-confirm id */,
+                           tr("&Remove", "medium"));
+}
+
+void UIMessageCenter::warnAboutIncorrectPort(QWidget *pParent /*= 0*/) const
+{
+    message(pParent ? pParent : mainWindowShown(), MessageType_Error,
             tr("The current port forwarding rules are not valid. "
                "None of the host or guest port values may be set to zero."));
 }
 
-bool UIMessageCenter::confirmCancelingPortForwardingDialog(QWidget *pParent) const
-{
-    return messageOkCancel(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>"));
+bool UIMessageCenter::confirmCancelingPortForwardingDialog(QWidget *pParent /*= 0*/) const
+{
+    return messageOkCancel(pParent ? pParent : mainWindowShown(), MessageType_Question,
+                           tr("<p>There are unsaved changes in the port forwarding configuration.</p>"
+                              "<p>If you proceed your changes will be discarded.</p>"));
 }
 
@@ -1013,5 +992,5 @@
 
     return messageOkCancel(pParent, MessageType_Question, msg,
-        "confirmRemoveMedium", /* auto-confirm id */
+        "confirmRemoveMedium" /* auto-confirm id */,
         tr("Remove", "medium"));
 }
@@ -1030,5 +1009,5 @@
            "disk to the list later again.</p>")
         .arg(strLocation),
-        0, /* auto-confirm id */
+        0 /* auto-confirm id */,
         QIMessageBox::Yes,
         QIMessageBox::No | QIMessageBox::Default,
@@ -1273,5 +1252,5 @@
            "until you add one. In the mean time you will only be able to start the "
            "machine using a virtual optical disk or from the network."),
-        0, /* auto-confirm id */
+        0 /* auto-confirm id */,
         QIMessageBox::Ok,
         QIMessageBox::Cancel | QIMessageBox::Default | QIMessageBox::Escape,
@@ -1354,5 +1333,5 @@
            strMachineNames.size()).arg(VBoxGlobal::toHumanReadableList(strMachineNames)),
         0 /* auto-confirm id */,
-        tr("Continue"), tr("Cancel"));
+        tr("Continue"));
 }
 
@@ -1563,5 +1542,5 @@
              .arg(strMachineName)
              .arg(strIfNames),
-             0, /* auto-confirm id */
+             0 /* auto-confirm id */,
              tr("Change Network Settings"),
              tr("Close Virtual Machine"));
@@ -1861,5 +1840,5 @@
                  "or press <b>Cancel</b> to cancel the operation.</p>")
              .arg(VBoxGlobal::formatSize(uMinVRAM)),
-             0, /* auto-confirm id */
+             0 /* auto-confirm id */,
              QIMessageBox::Ignore | QIMessageBox::Default,
              QIMessageBox::Cancel | QIMessageBox::Escape);
@@ -1886,5 +1865,5 @@
                       "or press <b>Cancel</b> to cancel the operation.</p>")
                    .arg(VBoxGlobal::formatSize(uMinVRAM)),
-                   0, /* auto-confirm id */
+                   0 /* auto-confirm id */,
                    QIMessageBox::Ignore | QIMessageBox::Default,
                    QIMessageBox::Cancel | QIMessageBox::Escape);
@@ -2035,5 +2014,5 @@
            "it is recommended to press <b>OK</b> now.</p>")
             .arg(strLogFolder),
-        0, /* auto-confirm id */
+        0 /* auto-confirm id */,
         QIMessageBox::Ok | QIMessageBox::Default,
         QIMessageBox::Ignore | QIMessageBox::Escape);
@@ -2078,5 +2057,5 @@
                               "<nobr><a href=\"%1\">%2</a></nobr> "
                               "(size %3 bytes)?</p>").arg(strUrl).arg(strUrl).arg(loc.toString(uSize)),
-                           0, /* auto-confirm id */
+                           0 /* auto-confirm id */,
                            tr("Download", "additions"));
 }
@@ -2092,5 +2071,5 @@
                               "on the virtual CD/DVD drive?</p>")
                                .arg(strUrl).arg(strUrl).arg(strSrc),
-                           0, /* auto-confirm id */
+                           0 /* auto-confirm id */,
                            tr("Mount", "additions"));
 }
@@ -2110,5 +2089,5 @@
                               "download this file from the Internet?</p>")
                               .arg(strMissedLocation),
-                           0, /* Auto-confirm Id */
+                           0 /* auto-confirm id */,
                            tr("Download", "additions"));
 }
@@ -2122,5 +2101,5 @@
                               "<nobr><a href=\"%1\">%2</a></nobr> "
                               "(size %3 bytes)?</p>").arg(strURL).arg(strURL).arg(loc.toString(uSize)),
-                           0, /* Auto-confirm Id */
+                           0 /* auto-confirm id */,
                            tr("Download", "additions"));
 }
@@ -2154,5 +2133,5 @@
                               "<p>Do you wish to download latest one from the Internet?</p>")
                               .arg(strExtPackVersion).arg(strExtPackName),
-                           0, /* Auto-confirm Id */
+                           0 /* auto-confirm id */,
                            tr("Download", "extension pack"));
 }
@@ -2164,5 +2143,5 @@
                       "<p>You should download and install version %3 of this extension pack from Oracle!</p>")
                       .arg(strExtPackVersion).arg(strExtPackName).arg(strVBoxVersion),
-                      0, /* Auto-confirm Id */
+                      0 /* auto-confirm id */,
                       QIMessageBox::Ok | QIMessageBox::Default,
                       0,
@@ -2178,5 +2157,5 @@
                               "from <nobr><a href=\"%2\">%2</a></nobr> (size %3 bytes)?</p>")
                               .arg(strExtPackName, strURL, loc.toString(uSize)),
-                           0, /* Auto-confirm Id */
+                           0 /* auto-confirm id */,
                            tr("Download", "extension pack"));
 }
@@ -2190,5 +2169,5 @@
                               "<p>Do you wish to install this extension pack?</p>")
                               .arg(strExtPackName, strFrom, strTo),
-                           0, /* Auto-confirm Id */
+                           0 /* auto-confirm id */,
                            tr ("Install", "extension pack"));
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45287)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 45288)
@@ -78,5 +78,5 @@
     /* API: Warning registration stuff: */
     bool warningShown(const QString &strWarningName) const;
-    void setWarningShown(const QString &strWarningName, bool fWarningShown);
+    void setWarningShown(const QString &strWarningName, bool fWarningShown) const;
 
     /* API: Alert providing stuff: Main function: */
@@ -186,69 +186,68 @@
     /* API: Main (startup) warnings: */
 #ifdef RT_OS_LINUX
-    void warnAboutWrongUSBMounted();
+    void warnAboutWrongUSBMounted() const;
 #endif /* RT_OS_LINUX */
-    void cannotStartSelector();
-    void showBETAWarning();
-    void showBEBWarning();
+    void cannotStartSelector() const;
+    void showBETAWarning() const;
+    void showBEBWarning() const;
 
     /* API: COM startup warnings: */
-    void cannotInitUserHome(const QString &strUserHome);
-    void cannotInitCOM(HRESULT rc);
-    void cannotCreateVirtualBox(const CVirtualBox &vbox);
+    void cannotInitUserHome(const QString &strUserHome) const;
+    void cannotInitCOM(HRESULT rc) const;
+    void cannotCreateVirtualBox(const CVirtualBox &vbox) const;
 
     /* API: Global warnings: */
-    void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath);
-    void cannotLoadLanguage(const QString &strLangFile);
-    void cannotLoadGlobalConfig(const CVirtualBox &vbox, const QString &strError);
-    void cannotSaveGlobalConfig(const CVirtualBox &vbox);
-    void cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName);
-    void cannotFindMachineById(const CVirtualBox &vbox, const QString &strId);
-    void cannotOpenSession(const CSession &session);
-    void cannotOpenSession(const CMachine &machine, const CProgress &progress = CProgress());
-    void cannotGetMediaAccessibility(const UIMedium &medium);
-    void cannotOpenURL(const QString &strUrl);
+    void cannotFindLanguage(const QString &strLangId, const QString &strNlsPath) const;
+    void cannotLoadLanguage(const QString &strLangFile) const;
+    void cannotLoadGlobalConfig(const CVirtualBox &vbox, const QString &strError) const;
+    void cannotSaveGlobalConfig(const CVirtualBox &vbox) const;
+    void cannotFindMachineByName(const CVirtualBox &vbox, const QString &strName) const;
+    void cannotFindMachineById(const CVirtualBox &vbox, const QString &strId) const;
+    void cannotOpenSession(const CSession &session) const;
+    void cannotOpenSession(const CMachine &machine, const CProgress &progress = CProgress()) const;
+    void cannotGetMediaAccessibility(const UIMedium &medium) const;
+    void cannotOpenURL(const QString &strUrl) const;
 
     /* API: Selector warnings: */
-    void cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath);
-    void cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName);
-    void cannotResolveCollisionAutomatically(const QString &strName, const QString &strGroupName);
-    bool confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName);
-    void cannotSetGroups(const CMachine &machine);
-    bool confirmMachineItemRemoval(const QStringList &names);
-    int confirmMachineRemoval(const QList<CMachine> &machines);
-    void cannotRemoveMachine(const CMachine &machine);
-    void cannotRemoveMachine(const CMachine &machine, const CProgress &progress);
-    bool remindAboutInaccessibleMedia();
-    bool confirmDiscardSavedState(const QString &strNames);
-    bool confirmVMReset(const QString &strNames);
-    bool confirmVMACPIShutdown(const QString &strNames);
-    bool confirmVMPowerOff(const QString &strNames);
-    void cannotDiscardSavedState(const CConsole &console);
-    void cannotStopMachine(const CConsole &console);
+    void cannotOpenMachine(const CVirtualBox &vbox, const QString &strMachinePath) const;
+    void cannotReregisterExistingMachine(const QString &strMachinePath, const QString &strMachineName) const;
+    void cannotResolveCollisionAutomatically(const QString &strName, const QString &strGroupName) const;
+    bool confirmAutomaticCollisionResolve(const QString &strName, const QString &strGroupName) const;
+    void cannotSetGroups(const CMachine &machine) const;
+    bool confirmMachineItemRemoval(const QStringList &names) const;
+    int confirmMachineRemoval(const QList<CMachine> &machines) const;
+    void cannotRemoveMachine(const CMachine &machine) const;
+    void cannotRemoveMachine(const CMachine &machine, const CProgress &progress) const;
+    bool remindAboutInaccessibleMedia() const;
+    bool confirmDiscardSavedState(const QString &strNames) const;
+    bool confirmVMReset(const QString &strNames) const;
+    bool confirmVMACPIShutdown(const QString &strNames) const;
+    bool confirmVMPowerOff(const QString &strNames) const;
+    void cannotDiscardSavedState(const CConsole &console) const;
+    void cannotStopMachine(const CConsole &console) const;
 
     /* API: Snapshot warnings: */
-    int confirmSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot);
-    bool confirmSnapshotRemoval(const QString &strSnapshotName);
+    int confirmSnapshotRestoring(const QString &strSnapshotName, bool fAlsoCreateNewSnapshot) const;
+    bool confirmSnapshotRemoval(const QString &strSnapshotName) const;
     bool warnAboutSnapshotRemovalFreeSpace(const QString &strSnapshotName, const QString &strTargetImageName,
-                                           const QString &strTargetImageMaxSize, const QString &strTargetFileSystemFree);
-    void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName);
-    void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName);
-    void cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName);
-    void cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName);
+                                           const QString &strTargetImageMaxSize, const QString &strTargetFileSystemFree) const;
+    void cannotRestoreSnapshot(const CConsole &console, const QString &strSnapshotName) const;
+    void cannotRestoreSnapshot(const CProgress &progress, const QString &strSnapshotName) const;
+    void cannotRemoveSnapshot(const CConsole &console, const QString &strSnapshotName) const;
+    void cannotRemoveSnapshot(const CProgress &progress, const QString &strSnapshotName) const;
 
     /* API: Settings warnings: */
-    void cannotSetSystemProperties(const CSystemProperties &properties);
-    void cannotAccessUSB(const COMBaseWithEI &object);
-    void cannotLoadMachineSettings(const CMachine &machine, bool fStrict = true, QWidget *pParent = 0);
-    void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0);
-    void warnAboutStateChange(QWidget *pParent);
-    bool confirmSettingsReloading(QWidget *pParent);
-    int askAboutHardDiskAttachmentCreation(QWidget *pParent, const QString &strControllerName);
-    int askAboutOpticalAttachmentCreation(QWidget *pParent, const QString &strControllerName);
-    int askAboutFloppyAttachmentCreation(QWidget *pParent, const QString &strControllerName);
-    int confirmRemovingOfLastDVDDevice() const;
-    int confirmDeletingHostInterface(const QString &strName, QWidget *pParent = 0);
-    void warnAboutIncorrectPort(QWidget *pParent) const;
-    bool confirmCancelingPortForwardingDialog(QWidget *pParent) const;
+    void cannotAccessUSB(const COMBaseWithEI &object) const;
+    void cannotSetSystemProperties(const CSystemProperties &properties) const;
+    void cannotSaveMachineSettings(const CMachine &machine, QWidget *pParent = 0) const;
+    void warnAboutStateChange(QWidget *pParent = 0) const;
+    bool confirmSettingsReloading(QWidget *pParent = 0) const;
+    bool confirmDeletingHostInterface(const QString &strName, QWidget *pParent = 0) const;
+    int askAboutHardDiskAttachmentCreation(const QString &strControllerName, QWidget *pParent = 0) const;
+    int askAboutOpticalAttachmentCreation(const QString &strControllerName, QWidget *pParent = 0) const;
+    int askAboutFloppyAttachmentCreation(const QString &strControllerName, QWidget *pParent = 0) const;
+    int confirmRemovingOfLastDVDDevice(QWidget *pParent = 0) const;
+    void warnAboutIncorrectPort(QWidget *pParent = 0) const;
+    bool confirmCancelingPortForwardingDialog(QWidget *pParent = 0) const;
 
     /* API: Virtual Medium Manager warnings: */
@@ -444,5 +443,5 @@
 
     /* Variables: */
-    QStringList m_warnings;
+    mutable QStringList m_warnings;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 45287)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/graphics/chooser/UIGChooserModel.cpp	(revision 45288)
@@ -2006,5 +2006,4 @@
          * with common cleanup in case of failure.
          * We have to simulate a try-catch block. */
-        bool fSuccess = false;
         CSession session;
         CMachine machine;
@@ -2024,22 +2023,21 @@
             machine.SetGroups(newGroupList.toVector());
             if (!machine.isOk())
+            {
+                msgCenter().cannotSetGroups(machine);
                 break;
+            }
 
             /* 4. Save settings: */
             machine.SaveSettings();
             if (!machine.isOk())
+            {
+                msgCenter().cannotSaveMachineSettings(machine);
                 break;
-
-            /* Transaction complete: */
-            fSuccess = true;
+            }
         } while (0);
 
         /* Cleanup if necessary: */
-        if (!fSuccess)
-        {
-            if (!machine.isNull())
-                msgCenter().cannotSaveMachineSettings(machine);
+        if (machine.isNull() || !machine.isOk())
             emit sigReload(strId);
-        }
         if (!session.isNull())
             session.UnlockMachine();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp	(revision 45287)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsNetwork.cpp	(revision 45288)
@@ -453,5 +453,5 @@
     QString strInterfaceName(pItem->name());
     /* Asking user about deleting selected network interface: */
-    if (msgCenter().confirmDeletingHostInterface(strInterfaceName, this) == QIMessageBox::Cancel)
+    if (!msgCenter().confirmDeletingHostInterface(strInterfaceName, this))
         return;
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 45287)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 45288)
@@ -2403,5 +2403,5 @@
         && deviceCount (KDeviceType_DVD) == 1)
     {
-        if (msgCenter().confirmRemovingOfLastDVDDevice() != QIMessageBox::Ok)
+        if (!msgCenter().confirmRemovingOfLastDVDDevice(this))
             return;
     }
@@ -3045,5 +3045,5 @@
         case KDeviceType_HardDisk:
         {
-            int iAnswer = msgCenter().askAboutHardDiskAttachmentCreation(this, strControllerName);
+            int iAnswer = msgCenter().askAboutHardDiskAttachmentCreation(strControllerName, this);
             if (iAnswer == QIMessageBox::Yes)
                 strMediumId = getWithNewHDWizard();
@@ -3054,5 +3054,5 @@
         case KDeviceType_DVD:
         {
-            int iAnswer = msgCenter().askAboutOpticalAttachmentCreation(this, strControllerName);
+            int iAnswer = msgCenter().askAboutOpticalAttachmentCreation(strControllerName, this);
             if (iAnswer == QIMessageBox::Yes)
                 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_DVD, this, strMachineFolder);
@@ -3063,5 +3063,5 @@
         case KDeviceType_Floppy:
         {
-            int iAnswer = msgCenter().askAboutFloppyAttachmentCreation(this, strControllerName);
+            int iAnswer = msgCenter().askAboutFloppyAttachmentCreation(strControllerName, this);
             if (iAnswer == QIMessageBox::Yes)
                 strMediumId = vboxGlobal().openMediumWithFileOpenDialog(UIMediumType_Floppy, this, strMachineFolder);
