Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp	(revision 39260)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMDesktop.cpp	(revision 39261)
@@ -224,5 +224,5 @@
         /* Assign corresponding vector values: */
         m_machines[i] = machine;
-        m_changeable[i] = machine.isNull() ? false :
+        m_changeable[i] = machine.isNull() || !machine.GetAccessible() ? false :
                           machine.GetState() != KMachineState_Stuck &&
                           machine.GetState() != KMachineState_Saved /* for now! */;
@@ -370,6 +370,14 @@
         if (!machine.isNull())
         {
-            QString item = sSectionItemTpl2.arg(tr("Name", "details report"), machine.GetName())
-                         + sSectionItemTpl2.arg(tr("OS Type", "details report"), vboxGlobal().vmGuestOSTypeDescription(machine.GetOSTypeId()));
+            QString item;
+            if (machine.GetAccessible())
+            {
+                item = sSectionItemTpl2.arg(tr("Name", "details report"), machine.GetName())
+                     + sSectionItemTpl2.arg(tr("OS Type", "details report"), vboxGlobal().vmGuestOSTypeDescription(machine.GetOSTypeId()));
+            }
+            else
+            {
+                item = QString(sSectionItemTpl1).arg(tr("Information inaccessible", "details report"));
+            }
             pLabel->setText(sTableTpl.arg(item));
         }
@@ -403,69 +411,76 @@
         if (!machine.isNull())
         {
-            QString item = sSectionItemTpl2.arg(tr("Base Memory", "details report"), tr("<nobr>%1 MB</nobr>", "details report"))
-                                           .arg(machine.GetMemorySize());
-
-            int cCPU = machine.GetCPUCount();
-            if (cCPU > 1)
-                item += sSectionItemTpl2.arg(tr("Processors", "details report"), tr("<nobr>%1</nobr>", "details report"))
-                                        .arg(cCPU);
-
-            int iCPUExecCap = machine.GetCPUExecutionCap();
-            if (iCPUExecCap < 100)
-                item += sSectionItemTpl2.arg(tr("Execution Cap", "details report"), tr("<nobr>%1%</nobr>", "details report"))
-                                        .arg(iCPUExecCap);
-
-            /* Boot order: */
-            QStringList bootOrder;
-            for (ulong i = 1; i <= m_vbox.GetSystemProperties().GetMaxBootPosition(); ++i)
+            QString item;
+            if (machine.GetAccessible())
             {
-                KDeviceType device = machine.GetBootOrder(i);
-                if (device == KDeviceType_Null)
-                    continue;
-                bootOrder << vboxGlobal().toString(device);
+                item = sSectionItemTpl2.arg(tr("Base Memory", "details report"), tr("<nobr>%1 MB</nobr>", "details report"))
+                                       .arg(machine.GetMemorySize());
+
+                int cCPU = machine.GetCPUCount();
+                if (cCPU > 1)
+                    item += sSectionItemTpl2.arg(tr("Processors", "details report"), tr("<nobr>%1</nobr>", "details report"))
+                                            .arg(cCPU);
+
+                int iCPUExecCap = machine.GetCPUExecutionCap();
+                if (iCPUExecCap < 100)
+                    item += sSectionItemTpl2.arg(tr("Execution Cap", "details report"), tr("<nobr>%1%</nobr>", "details report"))
+                                            .arg(iCPUExecCap);
+
+                /* Boot order: */
+                QStringList bootOrder;
+                for (ulong i = 1; i <= m_vbox.GetSystemProperties().GetMaxBootPosition(); ++i)
+                {
+                    KDeviceType device = machine.GetBootOrder(i);
+                    if (device == KDeviceType_Null)
+                        continue;
+                    bootOrder << vboxGlobal().toString(device);
+                }
+                if (bootOrder.isEmpty())
+                    bootOrder << vboxGlobal().toString(KDeviceType_Null);
+
+                item += sSectionItemTpl2.arg(tr("Boot Order", "details report"), bootOrder.join(", "));
+
+#ifdef VBOX_WITH_FULL_DETAILS_REPORT
+                /* BIOS Settings holder: */
+                const CBIOSSettings &biosSettings = machine.GetBIOSSettings();
+                QStringList bios;
+
+                /* ACPI: */
+                if (biosSettings.GetACPIEnabled())
+                    bios << tr("ACPI", "details report");
+
+                /* IO APIC: */
+                if (biosSettings.GetIOAPICEnabled())
+                    bios << tr("IO APIC", "details report");
+
+                if (!bios.isEmpty())
+                    item += sSectionItemTpl2.arg(tr("BIOS", "details report"), bios.join(", "));
+#endif /* VBOX_WITH_FULL_DETAILS_REPORT */
+
+                QStringList accel;
+                if (m_vbox.GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx))
+                {
+                    /* VT-x/AMD-V: */
+                    if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled))
+                    {
+                        accel << tr("VT-x/AMD-V", "details report");
+
+                        /* Nested Paging (only when hw virt is enabled): */
+                        if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging))
+                            accel << tr("Nested Paging", "details report");
+                    }
+                }
+
+                /* PAE/NX: */
+                if (machine.GetCPUProperty(KCPUPropertyType_PAE))
+                    accel << tr("PAE/NX", "details report");
+
+                if (!accel.isEmpty())
+                    item += sSectionItemTpl2.arg(tr("Acceleration", "details report"), accel.join(", "));
             }
-            if (bootOrder.isEmpty())
-                bootOrder << vboxGlobal().toString(KDeviceType_Null);
-
-            item += sSectionItemTpl2.arg(tr("Boot Order", "details report"), bootOrder.join(", "));
-
-#ifdef VBOX_WITH_FULL_DETAILS_REPORT
-            /* BIOS Settings holder: */
-            const CBIOSSettings &biosSettings = machine.GetBIOSSettings();
-            QStringList bios;
-
-            /* ACPI: */
-            if (biosSettings.GetACPIEnabled())
-                bios << tr("ACPI", "details report");
-
-            /* IO APIC: */
-            if (biosSettings.GetIOAPICEnabled())
-                bios << tr("IO APIC", "details report");
-
-            if (!bios.isEmpty())
-                item += sSectionItemTpl2.arg(tr("BIOS", "details report"), bios.join(", "));
-#endif /* VBOX_WITH_FULL_DETAILS_REPORT */
-
-            QStringList accel;
-            if (m_vbox.GetHost().GetProcessorFeature(KProcessorFeature_HWVirtEx))
+            else
             {
-                /* VT-x/AMD-V: */
-                if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_Enabled))
-                {
-                    accel << tr("VT-x/AMD-V", "details report");
-
-                    /* Nested Paging (only when hw virt is enabled): */
-                    if (machine.GetHWVirtExProperty(KHWVirtExPropertyType_NestedPaging))
-                        accel << tr("Nested Paging", "details report");
-                }
+                item = QString(sSectionItemTpl1).arg(tr("Information inaccessible", "details report"));
             }
-
-            /* PAE/NX: */
-            if (machine.GetCPUProperty(KCPUPropertyType_PAE))
-                accel << tr("PAE/NX", "details report");
-
-            if (!accel.isEmpty())
-                item += sSectionItemTpl2.arg(tr("Acceleration", "details report"), accel.join(", "));
-
             pLabel->setText(sTableTpl.arg(item));
         }
@@ -1150,4 +1165,6 @@
     pPopup->setProperty("block-number", iBlockNumber);
     pPopup->setProperty("section-type", static_cast<int>(section));
+    if (!m_machines[iBlockNumber].GetAccessible())
+        pPopup->setWarningIcon(UIIconPool::iconSet(":/state_aborted_16px.png"));
 
     /* Configure the popup box: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.cpp	(revision 39260)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.cpp	(revision 39261)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -18,5 +18,11 @@
  */
 
-/* Local includes */
+/* Global includes: */
+#include <QContextMenuEvent>
+#include <QMenu>
+#include <QPainter>
+#include <QTimer>
+
+/* Local includes: */
 #include "UIVMPreviewWindow.h"
 #include "UIVirtualBoxEventHandler.h"
@@ -24,10 +30,19 @@
 #include "VBoxGlobal.h"
 
-/* Global includes */
-#include <QContextMenuEvent>
-#include <QMenu>
-#include <QPainter>
-#include <QTimer>
-
+/* Initialize map: */
+UpdateIntervalMap UpdateIntervalMapConstructor()
+{
+    UpdateIntervalMap map;
+    map[UpdateInterval_Disabled] = "disabled";
+    map[UpdateInterval_500ms]    = "500";
+    map[UpdateInterval_1000ms]   = "1000";
+    map[UpdateInterval_2000ms]   = "2000";
+    map[UpdateInterval_5000ms]   = "5000";
+    map[UpdateInterval_10000ms]  = "10000";
+    return map;
+}
+UpdateIntervalMap UIVMPreviewWindow::m_intervals = UpdateIntervalMapConstructor();
+
+/* Constructor: */
 UIVMPreviewWindow::UIVMPreviewWindow(QWidget *pParent)
   : QIWithRetranslateUI<QWidget>(pParent)
@@ -39,20 +54,17 @@
   , m_pGlossyImg(0)
 {
-    m_session.createInstance(CLSID_Session);
-
+    /* Setup contents: */
     setContentsMargins(0, 5, 0, 5);
     setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
-    /* Connect the update timer */
-    connect(m_pUpdateTimer, SIGNAL(timeout()),
-            this, SLOT(sltRecreatePreview()));
-    /* Connect the machine state event */
-    connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
-            this, SLOT(sltMachineStateChange(QString, KMachineState)));
-    /* Create the context menu */
+
+    /* Create session instance: */
+    m_session.createInstance(CLSID_Session);
+
+    /* Create the context menu: */
     setContextMenuPolicy(Qt::DefaultContextMenu);
     m_pUpdateTimerMenu = new QMenu(this);
     QActionGroup *pUpdateTimeG = new QActionGroup(this);
     pUpdateTimeG->setExclusive(true);
-    for(int i = 0; i < UpdateEnd; ++i)
+    for(int i = 0; i < UpdateInterval_Max; ++i)
     {
         QAction *pUpdateTime = new QAction(pUpdateTimeG);
@@ -63,22 +75,17 @@
         m_actions[static_cast<UpdateInterval>(i)] = pUpdateTime;
     }
-    m_pUpdateTimerMenu->insertSeparator(m_actions[static_cast<UpdateInterval>(Update500ms)]);
-    /* Default value */
-    UpdateInterval interval = Update1000ms;
+    m_pUpdateTimerMenu->insertSeparator(m_actions[static_cast<UpdateInterval>(UpdateInterval_500ms)]);
+
+    /* Load preview update interval: */
     QString strInterval = vboxGlobal().virtualBox().GetExtraData(VBoxDefs::GUI_PreviewUpdate);
-    if (strInterval == "disabled")
-        interval = UpdateDisabled;
-    else if (strInterval == "500")
-        interval = Update500ms;
-    else if (strInterval == "1000")
-        interval = Update1000ms;
-    else if (strInterval == "2000")
-        interval = Update2000ms;
-    else if (strInterval == "5000")
-        interval = Update5000ms;
-    else if (strInterval == "10000")
-        interval = Update10000ms;
-    /* Initialize with the new update interval */
+    /* Parse loaded value: */
+    UpdateInterval interval = m_intervals.key(strInterval, UpdateInterval_1000ms);
+    /* Initialize with the new update interval: */
     setUpdateInterval(interval, false);
+
+    /* Setup connections: */
+    connect(m_pUpdateTimer, SIGNAL(timeout()), this, SLOT(sltRecreatePreview()));
+    connect(gVBoxEvents, SIGNAL(sigMachineStateChange(QString, KMachineState)),
+            this, SLOT(sltMachineStateChange(QString, KMachineState)));
 
     /* Retranslate the UI */
@@ -88,5 +95,5 @@
 UIVMPreviewWindow::~UIVMPreviewWindow()
 {
-    /* Close any open session */
+    /* Close any open session: */
     if (m_session.GetState() == KSessionState_Locked)
         m_session.UnlockMachine();
@@ -101,5 +108,5 @@
 void UIVMPreviewWindow::setMachine(const CMachine& machine)
 {
-    m_pUpdateTimer->stop();
+    stop();
     m_machine = machine;
     restart();
@@ -118,10 +125,10 @@
 void UIVMPreviewWindow::retranslateUi()
 {
-    m_actions.value(UpdateDisabled)->setText(tr("Update Disabled"));
-    m_actions.value(Update500ms)->setText(tr("Every 0.5 s"));
-    m_actions.value(Update1000ms)->setText(tr("Every 1 s"));
-    m_actions.value(Update2000ms)->setText(tr("Every 2 s"));
-    m_actions.value(Update5000ms)->setText(tr("Every 5 s"));
-    m_actions.value(Update10000ms)->setText(tr("Every 10 s"));
+    m_actions.value(UpdateInterval_Disabled)->setText(tr("Update Disabled"));
+    m_actions.value(UpdateInterval_500ms)->setText(tr("Every 0.5 s"));
+    m_actions.value(UpdateInterval_1000ms)->setText(tr("Every 1 s"));
+    m_actions.value(UpdateInterval_2000ms)->setText(tr("Every 2 s"));
+    m_actions.value(UpdateInterval_5000ms)->setText(tr("Every 5 s"));
+    m_actions.value(UpdateInterval_10000ms)->setText(tr("Every 10 s"));
 }
 
@@ -135,5 +142,5 @@
 void UIVMPreviewWindow::showEvent(QShowEvent *pEvent)
 {
-    /* Make sure there is some valid preview image when shown. */
+    /* Make sure there is some valid preview image when shown: */
     restart();
     QWidget::showEvent(pEvent);
@@ -142,6 +149,6 @@
 void UIVMPreviewWindow::hideEvent(QHideEvent *pEvent)
 {
-    /* Stop the update time when we aren't visible */
-    m_pUpdateTimer->stop();
+    /* Stop the update time when we aren't visible: */
+    stop();
     QWidget::hideEvent(pEvent);
 }
@@ -171,29 +178,30 @@
         /* Fill rectangle with black color: */
         painter.fillRect(m_vRect, Qt::black);
-    }
-
-    /* Compose name: */
-    QString strName = tr("No Preview");
-    if (!m_machine.isNull())
-        strName = m_machine.GetName();
-    /* Paint that name: */
-    QFont font = painter.font();
-    font.setBold(true);
-    int fFlags = Qt::AlignCenter | Qt::TextWordWrap;
-    float h = m_vRect.size().height() * .2;
-    QRect r;
-    /* Make a little magic to find out if the given text fits into our rectangle.
-     * Decrease the font pixel size as long as it doesn't fit. */
-    int cMax = 30;
-    do
-    {
-        h = h * .8;
-        font.setPixelSize((int)h);
-        painter.setFont(font);
-        r = painter.boundingRect(m_vRect, fFlags, strName);
-    }
-    while ((r.height() > m_vRect.height() || r.width() > m_vRect.width()) && cMax-- != 0);
-    painter.setPen(Qt::white);
-    painter.drawText(m_vRect, fFlags, strName);
+
+        /* Compose name: */
+        QString strName = tr("No Preview");
+        if (!m_machine.isNull())
+            strName = m_machine.GetAccessible() ? m_machine.GetName() :
+                      QApplication::translate("UIVMListView", "Inaccessible");
+        /* Paint that name: */
+        QFont font = painter.font();
+        font.setBold(true);
+        int fFlags = Qt::AlignCenter | Qt::TextWordWrap;
+        float h = m_vRect.size().height() * .2;
+        QRect r;
+        /* Make a little magic to find out if the given text fits into our rectangle.
+         * Decrease the font pixel size as long as it doesn't fit. */
+        int cMax = 30;
+        do
+        {
+            h = h * .8;
+            font.setPixelSize((int)h);
+            painter.setFont(font);
+            r = painter.boundingRect(m_vRect, fFlags, strName);
+        }
+        while ((r.height() > m_vRect.height() || r.width() > m_vRect.width()) && cMax-- != 0);
+        painter.setPen(Qt::white);
+        painter.drawText(m_vRect, fFlags, strName);
+    }
 
     /* Draw the glossy overlay last: */
@@ -215,8 +223,7 @@
 void UIVMPreviewWindow::sltMachineStateChange(QString strId, KMachineState state)
 {
-    if (   !m_machine.isNull()
-        && m_machine.GetId() == strId)
-    {
-        /* Cache the machine state */
+    if (!m_machine.isNull() && m_machine.GetId() == strId)
+    {
+        /* Cache the machine state: */
         m_machineState = state;
         restart();
@@ -226,8 +233,9 @@
 void UIVMPreviewWindow::sltRecreatePreview()
 {
-    /* Only do this if we are visible */
+    /* Only do this if we are visible: */
     if (!isVisible())
         return;
 
+    /* Remove preview if any: */
     if (m_pPreviewImg)
     {
@@ -236,9 +244,10 @@
     }
 
-    if (   !m_machine.isNull()
-        && m_vRect.width() > 0
-        && m_vRect.height() > 0)
-    {
-        Assert(m_machineState != KMachineState_Null);
+    /* We are not creating preview for inaccessible VMs: */
+    if (m_machineState == KMachineState_Null)
+        return;
+
+    if (!m_machine.isNull() && m_vRect.width() > 0 && m_vRect.height() > 0)
+    {
         QImage image(size(), QImage::Format_ARGB32);
         image.fill(Qt::transparent);
@@ -322,8 +331,6 @@
     switch (interval)
     {
-        case UpdateDisabled:
-        {
-            if (fSave)
-                vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, "disabled");
+        case UpdateInterval_Disabled:
+        {
             m_pUpdateTimer->setInterval(0);
             m_pUpdateTimer->stop();
@@ -331,78 +338,76 @@
             break;
         }
-        case Update500ms:
-        {
-            if (fSave)
-                vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, "500");
+        case UpdateInterval_500ms:
+        {
             m_pUpdateTimer->setInterval(500);
             m_actions[interval]->setChecked(true);
             break;
         }
-        case Update1000ms:
-        {
-            if (fSave)
-                vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, "1000");
+        case UpdateInterval_1000ms:
+        {
             m_pUpdateTimer->setInterval(1000);
             m_actions[interval]->setChecked(true);
             break;
         }
-        case Update2000ms:
-        {
-            if (fSave)
-                vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, "2000");
+        case UpdateInterval_2000ms:
+        {
             m_pUpdateTimer->setInterval(2000);
             m_actions[interval]->setChecked(true);
             break;
         }
-        case Update5000ms:
-        {
-            if (fSave)
-                vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, "5000");
+        case UpdateInterval_5000ms:
+        {
             m_pUpdateTimer->setInterval(5000);
             m_actions[interval]->setChecked(true);
             break;
         }
-        case Update10000ms:
-        {
-            if (fSave)
-                vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, "10000");
+        case UpdateInterval_10000ms:
+        {
             m_pUpdateTimer->setInterval(10000);
             m_actions[interval]->setChecked(true);
             break;
         }
-        case UpdateEnd: break;
-    }
+        case UpdateInterval_Max: break;
+    }
+    if (fSave && m_intervals.contains(interval))
+        vboxGlobal().virtualBox().SetExtraData(VBoxDefs::GUI_PreviewUpdate, m_intervals[interval]);
 }
 
 void UIVMPreviewWindow::restart()
 {
-    /* Close any open session */
+    /* Reopen session if necessary: */
     if (m_session.GetState() == KSessionState_Locked)
         m_session.UnlockMachine();
     if (!m_machine.isNull())
     {
-        /* Fetch the latest machine state */
+        /* Fetch the latest machine state: */
         m_machineState = m_machine.GetState();
-        /* Lock the session for the current machine */
-        if (   m_machineState == KMachineState_Running
-//            || m_machineState == KMachineState_Saving /* Not sure if this is valid */
+        /* Lock the session for the current machine: */
+        if (m_machineState == KMachineState_Running
+//          || m_machineState == KMachineState_Saving /* Not sure if this is valid */
             || m_machineState == KMachineState_Paused)
             m_machine.LockMachine(m_session, KLockType_Shared);
     }
 
-    /* Recreate the preview image */
+    /* Recreate the preview image: */
     sltRecreatePreview();
-    /* Start the timer */
+
+    /* Start the timer if necessary: */
     if (!m_machine.isNull())
     {
-        if (   m_pUpdateTimer->interval() > 0
-            && m_machineState == KMachineState_Running)
+        if (m_pUpdateTimer->interval() > 0 && m_machineState == KMachineState_Running)
             m_pUpdateTimer->start();
     }
 }
 
+void UIVMPreviewWindow::stop()
+{
+    /* Stop the timer: */
+    m_pUpdateTimer->stop();
+}
+
 void UIVMPreviewWindow::repaintBGImages()
 {
-    /* Delete the old images */
+    /* Delete the old images: */
     if (m_pbgImage)
     {
@@ -416,9 +421,8 @@
     }
 
-    /* Check that there is enough room for our fancy stuff. If not we just
-     * draw nothing (the border and the blur radius). */
+    /* Check that there is enough room for our fancy stuff.
+     * If not we just draw nothing (the border and the blur radius). */
     QRect cr = contentsRect();
-    if (   cr.width()  < 41
-        || cr.height() < 41)
+    if (cr.width()  < 41 || cr.height() < 41)
         return;
 
@@ -427,5 +431,5 @@
     m_vRect = m_wRect.adjusted(m_vMargin, m_vMargin, -m_vMargin, -m_vMargin).adjusted(-3, -3, 3, 3);
 
-    /* First draw the shadow. Its a rounded rectangle which get blurred. */
+    /* First draw the shadow. Its a rounded rectangle which get blurred: */
     QImage imageW(cr.size(), QImage::Format_ARGB32);
     QColor bg = pal.color(QPalette::Base);
@@ -442,10 +446,9 @@
     QPainter pO(&imageO);
 
-#if 1
-    /* Now paint the border with a gradient to get a look of a monitor. */
+    /* Now paint the border with a gradient to get a look of a monitor: */
     QRect rr = QRect(QPoint(0, 0), cr.size()).adjusted(10, 10, -10, -10);
     QLinearGradient lg(0, rr.y(), 0, rr.height());
     QColor base(200, 200, 200); /* light variant */
-    //        QColor base(80, 80, 80); /* Dark variant */
+    // QColor base(80, 80, 80); /* Dark variant */
     lg.setColorAt(0, base);
     lg.setColorAt(0.4, base.darker(300));
@@ -457,10 +460,10 @@
     pO.drawRoundedRect(rr, m_vMargin, m_vMargin);
     pO.end();
-#endif
-    /* Make a copy of the new bg image */
+
+    /* Make a copy of the new bg image: */
     m_pbgImage = new QImage(imageO);
 
-    /* Now the glossy overlay has to be created. Start with defining a nice
-     * looking painter path. */
+    /* Now the glossy overlay has to be created.
+     * Start with defining a nice looking painter path. */
     QRect gRect = QRect(QPoint(0, 0), m_vRect.size());
     QPainterPath glossyPath(QPointF(gRect.x(), gRect.y()));
@@ -472,5 +475,5 @@
     glossyPath.closeSubpath();
 
-    /* Paint the glossy path on a QImage */
+    /* Paint the glossy path on a QImage: */
     QImage image(m_vRect.size(), QImage::Format_ARGB32);
     QColor bg1(Qt::white); /* We want blur to transparent _and_ white. */
@@ -485,5 +488,5 @@
     m_pGlossyImg = new QImage(image1);
 
-    /* Repaint */
+    /* Repaint: */
     update();
 }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.h	(revision 39260)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/selector/UIVMPreviewWindow.h	(revision 39261)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,9 +24,9 @@
 #include "COMDefs.h"
 
-/* Global includes */
+/* Global includes: */
 #include <QWidget>
 #include <QHash>
 
-/* Global forward declarations */
+/* Forward declarations: */
 class QAction;
 class QImage;
@@ -34,18 +34,21 @@
 class QTimer;
 
+/* Update interval type: */
+enum UpdateInterval
+{
+    UpdateInterval_Disabled,
+    UpdateInterval_500ms,
+    UpdateInterval_1000ms,
+    UpdateInterval_2000ms,
+    UpdateInterval_5000ms,
+    UpdateInterval_10000ms,
+    UpdateInterval_Max
+};
+typedef QMap<UpdateInterval, QString> UpdateIntervalMap;
+
+/* Preview window class: */
 class UIVMPreviewWindow : public QIWithRetranslateUI<QWidget>
 {
     Q_OBJECT;
-
-    enum UpdateInterval
-    {
-        UpdateDisabled,
-        Update500ms,
-        Update1000ms,
-        Update2000ms,
-        Update5000ms,
-        Update10000ms,
-        UpdateEnd
-    };
 
 public:
@@ -77,8 +80,10 @@
 
     void setUpdateInterval(UpdateInterval interval, bool fSave);
-    void restart();
     void repaintBGImages();
 
-    /* Private member vars */
+    void restart();
+    void stop();
+
+    /* Variables: */
     CSession m_session;
     CMachine m_machine;
@@ -93,4 +98,6 @@
     QImage *m_pPreviewImg;
     QImage *m_pGlossyImg;
+
+    static UpdateIntervalMap m_intervals;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp	(revision 39260)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.cpp	(revision 39261)
@@ -7,5 +7,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -40,19 +40,25 @@
   , m_fHeaderHover(false)
 {
+    /* Placing content: */
     QVBoxLayout *pMainLayout = new QVBoxLayout(this);
     pMainLayout->setContentsMargins(10, 5, 5, 5);
     QHBoxLayout *pTitleLayout = new QHBoxLayout();
     m_pTitleIcon = new QLabel(this);
+    m_pWarningIcon = new QLabel(this);
     m_pTitleLabel = new QLabel(this);
-    connect(m_pTitleLabel, SIGNAL(linkActivated(const QString)),
-            this, SIGNAL(titleClicked(const QString)));
     pTitleLayout->addWidget(m_pTitleIcon);
+    pTitleLayout->addWidget(m_pWarningIcon);
     pTitleLayout->addWidget(m_pTitleLabel, Qt::AlignLeft);
     pMainLayout->addLayout(pTitleLayout);
 
+    /* Configure widgets: */
+    m_pWarningIcon->setHidden(true);
     m_arrowPath.lineTo(m_aw / 2.0, m_aw / 2.0);
     m_arrowPath.lineTo(m_aw, 0);
 
-//    setMouseTracking(true);
+    /* Setup connections: */
+    connect(m_pTitleLabel, SIGNAL(linkActivated(const QString)), this, SIGNAL(titleClicked(const QString)));
+
+    /* Install event-filter: */
     qApp->installEventFilter(this);
 }
@@ -78,5 +84,5 @@
 void UIPopupBox::setTitleIcon(const QIcon& icon)
 {
-    m_icon = icon;
+    m_titleIcon = icon;
     updateHover(true);
     recalc();
@@ -85,5 +91,18 @@
 QIcon UIPopupBox::titleIcon() const
 {
-    return m_icon;
+    return m_titleIcon;
+}
+
+void UIPopupBox::setWarningIcon(const QIcon& icon)
+{
+    m_warningIcon = icon;
+    m_pWarningIcon->setHidden(m_warningIcon.isNull());
+    updateHover(true);
+    recalc();
+}
+
+QIcon UIPopupBox::warningIcon() const
+{
+    return m_warningIcon;
 }
 
@@ -277,11 +296,15 @@
                                .arg(m_strTitle));
 
-        QPixmap i = m_icon.pixmap(16, 16);
+        QPixmap titleIcon = m_titleIcon.pixmap(16, 16);
+        QPixmap warningIcon = m_warningIcon.pixmap(16, 16);
 #ifdef Q_WS_MAC
-        /* todo: fix this */
+        /* TODO: Fix this! */
 //        if (!m_fHeaderHover)
-//            i = QPixmap::fromImage(toGray(i.toImage()));
+//            titleIcon = QPixmap::fromImage(toGray(titleIcon.toImage()));
+//        if (!m_fHeaderHover)
+//            warningIcon = QPixmap::fromImage(toGray(warningIcon.toImage()));
 #endif /* Q_WS_MAC */
-        m_pTitleIcon->setPixmap(i);
+        m_pTitleIcon->setPixmap(titleIcon);
+        m_pWarningIcon->setPixmap(warningIcon);
         update();
     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h	(revision 39260)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupBox.h	(revision 39261)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2010 Oracle Corporation
+ * Copyright (C) 2010-2011 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -41,4 +41,7 @@
     void setTitleIcon(const QIcon& icon);
     QIcon titleIcon() const;
+
+    void setWarningIcon(const QIcon& icon);
+    QIcon warningIcon() const;
 
     void setTitleLink(const QString& strLink);
@@ -84,5 +87,7 @@
     QString m_strTitle;
     QLabel *m_pTitleIcon;
-    QIcon m_icon;
+    QLabel *m_pWarningIcon;
+    QIcon m_titleIcon;
+    QIcon m_warningIcon;
     QString m_strLink;
     bool m_fLinkEnabled;
