Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 45489)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 45490)
@@ -22,4 +22,10 @@
 #include <QPushButton>
 #include <QEvent>
+#include <QMainWindow>
+#include <QStatusBar>
+#include <QPainter>
+#include <QStateMachine>
+#include <QPropertyAnimation>
+#include <QSignalTransition>
 
 /* GUI includes: */
@@ -70,7 +76,6 @@
 }
 
-void UIPopupCenter::message(QWidget *pParent,
+void UIPopupCenter::message(QWidget *pParent, const QString &strId,
                             const QString &strMessage, const QString &strDetails,
-                            const char *pcszAutoConfirmId /*= 0*/,
                             int iButton1 /*= 0*/, int iButton2 /*= 0*/, int iButton3 /*= 0*/,
                             const QString &strButtonText1 /* = QString() */,
@@ -78,33 +83,27 @@
                             const QString &strButtonText3 /* = QString() */) const
 {
-    showPopupBox(pParent,
+    showPopupBox(pParent, strId,
                  strMessage, strDetails,
                  iButton1, iButton2, iButton3,
-                 strButtonText1, strButtonText2, strButtonText3,
-                 QString(pcszAutoConfirmId));
-}
-
-void UIPopupCenter::error(QWidget *pParent,
-                          const QString &strMessage, const QString &strDetails,
-                          const char *pcszAutoConfirmId /*= 0*/) const
-{
-    message(pParent,
+                 strButtonText1, strButtonText2, strButtonText3);
+}
+
+void UIPopupCenter::error(QWidget *pParent, const QString &strId,
+                          const QString &strMessage, const QString &strDetails) const
+{
+    message(pParent, strId,
             strMessage, strDetails,
-            pcszAutoConfirmId,
-            AlertButton_Ok | AlertButtonOption_Default);
-}
-
-void UIPopupCenter::alert(QWidget *pParent,
-                          const QString &strMessage,
-                          const char *pcszAutoConfirmId /*= 0*/) const
-{
-    error(pParent,
-          strMessage, QString(),
-          pcszAutoConfirmId);
-}
-
-void UIPopupCenter::question(QWidget *pParent,
+            AlertButton_Ok | AlertButtonOption_Default | AlertButtonOption_Escape);
+}
+
+void UIPopupCenter::alert(QWidget *pParent, const QString &strId,
+                          const QString &strMessage) const
+{
+    error(pParent, strId,
+          strMessage, QString());
+}
+
+void UIPopupCenter::question(QWidget *pParent, const QString &strId,
                              const QString &strMessage,
-                             const char *pcszAutoConfirmId /*= 0*/,
                              int iButton1 /*= 0*/, int iButton2 /*= 0*/, int iButton3 /*= 0*/,
                              const QString &strButtonText1 /*= QString()*/,
@@ -112,20 +111,17 @@
                              const QString &strButtonText3 /*= QString()*/) const
 {
-    message(pParent,
+    message(pParent, strId,
             strMessage, QString(),
-            pcszAutoConfirmId,
             iButton1, iButton2, iButton3,
             strButtonText1, strButtonText2, strButtonText3);
 }
 
-void UIPopupCenter::questionBinary(QWidget *pParent,
+void UIPopupCenter::questionBinary(QWidget *pParent, const QString &strId,
                                    const QString &strMessage,
-                                   const char *pcszAutoConfirmId /*= 0*/,
                                    const QString &strOkButtonText /*= QString()*/,
                                    const QString &strCancelButtonText /*= QString()*/) const
 {
-    question(pParent,
+    question(pParent, strId,
              strMessage,
-             pcszAutoConfirmId,
              AlertButton_Ok | AlertButtonOption_Default,
              AlertButton_Cancel | AlertButtonOption_Escape,
@@ -136,14 +132,12 @@
 }
 
-void UIPopupCenter::questionTrinary(QWidget *pParent,
+void UIPopupCenter::questionTrinary(QWidget *pParent, const QString &strId,
                                     const QString &strMessage,
-                                    const char *pcszAutoConfirmId /*= 0*/,
                                     const QString &strChoice1ButtonText /*= QString()*/,
                                     const QString &strChoice2ButtonText /*= QString()*/,
                                     const QString &strCancelButtonText /*= QString()*/) const
 {
-    question(pParent,
+    question(pParent, strId,
              strMessage,
-             pcszAutoConfirmId,
              AlertButton_Choice1,
              AlertButton_Choice2 | AlertButtonOption_Default,
@@ -154,21 +148,20 @@
 }
 
-void UIPopupCenter::showPopupBox(QWidget *pParent,
+void UIPopupCenter::showPopupBox(QWidget *pParent, const QString &strId,
                                  const QString &strMessage, const QString &strDetails,
                                  int iButton1, int iButton2, int iButton3,
-                                 const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
-                                 const QString &strAutoConfirmId) const
+                                 const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3) const
 {
     /* Choose at least one button by 'default': */
     if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0)
-        iButton1 = AlertButton_Ok | AlertButtonOption_Default;
+        iButton1 = AlertButton_Ok | AlertButtonOption_Default | AlertButtonOption_Escape;
 
     /* Create popup-box window: */
     QWidget *pPopupBoxParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown());
-    UIPopupPane *pPopupBox = new UIPopupPane(pPopupBoxParent, strAutoConfirmId,
+    UIPopupPane *pPopupBox = new UIPopupPane(pPopupBoxParent, strId,
                                              strMessage, strDetails,
                                              iButton1, iButton2, iButton3,
                                              strButtonText1, strButtonText2, strButtonText3);
-    m_popups.insert(strAutoConfirmId, pPopupBox);
+    m_popups.insert(strId, pPopupBox);
     connect(pPopupBox, SIGNAL(sigDone(int)), this, SLOT(sltPopupDone(int)));
     pPopupBox->show();
@@ -178,12 +171,10 @@
 {
     /* Make sure the sender is popup: */
-    UIPopupPane *pPopup = qobject_cast<UIPopupPane*>(sender());
+    const UIPopupPane *pPopup = qobject_cast<UIPopupPane*>(sender());
     if (!pPopup)
         return;
 
-    /* Get the popup ID: */
+    /* Make sure the popup is still exists: */
     const QString strPopupID(pPopup->id());
-
-    /* Make sure the popup still here: */
     const bool fIsPopupStillHere = m_popups.contains(strPopupID);
     AssertMsg(fIsPopupStillHere, ("Popup already destroyed!"));
@@ -199,32 +190,63 @@
 }
 
+void UIPopupCenter::remindAboutMouseIntegration(bool fSupportsAbsolute) const
+{
+    if (fSupportsAbsolute)
+    {
+        alert(0, QString("remindAboutMouseIntegrationOn"),
+              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 -- "
+                 "all mouse actions you perform when the mouse pointer is over the Virtual Machine's display "
+                 "are directly sent to the guest OS. If the mouse is currently captured, it will be automatically uncaptured.</p>"
+                 "<p>The mouse icon on the status bar will look like&nbsp;<img src=:/mouse_seamless_16px.png/>&nbsp;to inform you "
+                 "that mouse pointer integration is supported by the guest OS and is currently turned on.</p>"
+                 "<p><b>Note</b>: Some applications may behave incorrectly in mouse pointer integration mode. "
+                 "You can always disable it for the current session (and enable it again) "
+                 "by selecting the corresponding action from the menu bar.</p>"));
+    }
+    else
+    {
+        alert(0, QString("remindAboutMouseIntegrationOff"),
+              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 "
+                 "or pressing the host key) in order to use the mouse inside the guest OS.</p>"));
+    }
+}
+
 UIPopupPane::UIPopupPane(QWidget *pParent, const QString &strId,
                          const QString &strMessage, const QString &strDetails,
                          int iButton1, int iButton2, int iButton3,
                          const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3)
-    : QWidget(pParent, Qt::Window | Qt::FramelessWindowHint)
+    : QWidget(pParent)
     , m_fPolished(false)
     , m_strId(strId)
-    , m_strMessage(strMessage)
-    , m_strDetails(strDetails)
-    , m_iButton1(iButton1)
-    , m_iButton2(iButton2)
-    , m_iButton3(iButton3)
-    , m_strButtonText1(strButtonText1)
-    , m_strButtonText2(strButtonText2)
-    , m_strButtonText3(strButtonText3)
-{
-    /* Make sure popup will NOT be deleted on close: */
-    setAttribute(Qt::WA_DeleteOnClose, false);
-    /* Install event-filter: */
-    pParent->installEventFilter(this);
-    /* Configure window: */
-    setWindowOpacity(0.7);
-
+    , m_strMessage(strMessage), m_strDetails(strDetails)
+    , m_iButton1(iButton1), m_iButton2(iButton2), m_iButton3(iButton3)
+    , m_strButtonText1(strButtonText1), m_strButtonText2(strButtonText2), m_strButtonText3(strButtonText3)
+    , m_iButtonEsc(0)
+    , m_iParentStatusBarHeight(parentStatusBarHeight(pParent))
+    , m_pMainLayout(0), m_pFrameLayout(0)
+    , m_pTextPane(0), m_pButtonBox(0)
+    , m_pButton1(0), m_pButton2(0), m_pButton3(0)
+{
+    /* Prepare: */
+    prepare();
+}
+
+UIPopupPane::~UIPopupPane()
+{
+    /* Cleanup: */
+    cleanup();
+}
+
+void UIPopupPane::prepare()
+{
+    /* Install event-filter to parent: */
+    parent()->installEventFilter(this);
     /* Prepare content: */
     prepareContent();
 }
 
-UIPopupPane::~UIPopupPane()
+void UIPopupPane::cleanup()
 {
 }
@@ -236,22 +258,259 @@
         return false;
 
-    /* Make sure its move|rezize event came: */
-    if (   pEvent->type() != QEvent::Move
-        && pEvent->type() != QEvent::Resize)
+    /* Make sure its resize event came: */
+    if (pEvent->type() != QEvent::Resize)
         return false;
 
-    /* Process event: */
+    /* Adjust geometry: */
+    adjustAccordingParent();
+
+    /* Do not filter anything: */
+    return false;
+}
+
+void UIPopupPane::showEvent(QShowEvent *pEvent)
+{
+    /* Make sure we should polish dialog: */
+    if (m_fPolished)
+        return;
+
+    /* Call to polish-event: */
+    polishEvent(pEvent);
+
+    /* Mark dialog as polished: */
+    m_fPolished = true;
+}
+
+void UIPopupPane::polishEvent(QShowEvent*)
+{
+    /* Adjust geometry: */
+    adjustAccordingParent();
+}
+
+void UIPopupPane::keyPressEvent(QKeyEvent *pEvent)
+{
+    /* Preprocess Escape key: */
+    if (pEvent->key() == Qt::Key_Escape && m_iButtonEsc)
+    {
+        done(m_iButtonEsc);
+        return;
+    }
+    /* Handle all the other keys: */
+    QWidget::keyPressEvent(pEvent);
+}
+
+void UIPopupPane::adjustAccordingParent()
+{
+    /* Get some variables: */
+    const int iWidth = parentWidget()->width();
+    const int iHeight = parentWidget()->height();
+
+    /* Resize popup according parent: */
+    resize(iWidth, minimumSizeHint().height());
+
+    /* Move popup according parent: */
+    move(0, iHeight - height() - m_iParentStatusBarHeight);
+
+    /* Raise popup according parent: */
+    raise();
+
+    /* Resize text-pane according new size: */
+    if (m_pTextPane)
+    {
+        int iMinimumTextWidth = iWidth;
+        int iLeft, iTop, iRight, iBottom;
+        m_pMainLayout->getContentsMargins(&iLeft, &iTop, &iRight, &iBottom);
+        iMinimumTextWidth -= iLeft;
+        iMinimumTextWidth -= iRight;
+        m_pFrameLayout->getContentsMargins(&iLeft, &iTop, &iRight, &iBottom);
+        iMinimumTextWidth -= iLeft;
+        iMinimumTextWidth -= iRight;
+        m_pTextPane->setMinimumTextWidth(iMinimumTextWidth);
+    }
+}
+
+void UIPopupPane::prepareContent()
+{
+    /* Configure this: */
+    setFocusPolicy(Qt::StrongFocus);
+    /* Create main-layout: */
+    m_pMainLayout = new QVBoxLayout(this);
+    {
+        /* Configure layout: */
+        m_pMainLayout->setContentsMargins(2, 2, 2, 2);
+        m_pMainLayout->setSpacing(0);
+        /* Create main frame: */
+        UIPopupPaneFrame *pMainFrame = new UIPopupPaneFrame;
+        {
+            /* Add into layout: */
+            m_pMainLayout->addWidget(pMainFrame);
+            /* Create frame-layout: */
+            m_pFrameLayout = new QVBoxLayout(pMainFrame);
+            {
+                /* Configure layout: */
+                m_pFrameLayout->setContentsMargins(15, 0, 15, 0);
+                m_pFrameLayout->setSpacing(0);
+                /* Create message-label: */
+                m_pTextPane = new QIRichTextLabel;
+                {
+                    /* Add into layout: */
+                    m_pFrameLayout->addWidget(m_pTextPane);
+                    /* Configure label: */
+                    m_pTextPane->installEventFilter(pMainFrame);
+                    m_pTextPane->setText(m_strMessage);
+                    m_pTextPane->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
+                }
+                /* Create button-box: */
+                m_pButtonBox = new QIDialogButtonBox;
+                {
+                    /* Add into layout: */
+                    m_pFrameLayout->addWidget(m_pButtonBox);
+                    /* Configure button-box: */
+                    m_pButtonBox->installEventFilter(pMainFrame);
+                    setFocusProxy(m_pButtonBox);
+                    QList<int> activeButtons;
+                    m_pButton1 = createButton(m_iButton1);
+                    if (m_pButton1)
+                    {
+                        activeButtons << m_iButton1;
+                        connect(m_pButton1, SIGNAL(clicked()), SLOT(done1()));
+                        if (!m_strButtonText1.isEmpty())
+                            m_pButton1->setText(m_strButtonText1);
+                    }
+                    m_pButton2 = createButton(m_iButton2);
+                    if (m_pButton2)
+                    {
+                        activeButtons << m_iButton2;
+                        connect(m_pButton2, SIGNAL(clicked()), SLOT(done2()));
+                        if (!m_strButtonText2.isEmpty())
+                            m_pButton1->setText(m_strButtonText2);
+                    }
+                    m_pButton3 = createButton(m_iButton3);
+                    if (m_pButton3)
+                    {
+                        activeButtons << m_iButton3;
+                        connect(m_pButton3, SIGNAL(clicked()), SLOT(done3()));
+                        if (!m_strButtonText3.isEmpty())
+                            m_pButton1->setText(m_strButtonText3);
+                    }
+                }
+            }
+        }
+    }
+}
+
+QPushButton* UIPopupPane::createButton(int iButton)
+{
+    /* Not for AlertButton_NoButton: */
+    if (iButton == 0)
+        return 0;
+
+    /* Prepare button text & role: */
+    QString strText;
+    QDialogButtonBox::ButtonRole role;
+    switch (iButton & AlertButtonMask)
+    {
+        case AlertButton_Ok:      strText = tr("OK");     role = QDialogButtonBox::AcceptRole; break;
+        case AlertButton_Cancel:  strText = tr("Cancel"); role = QDialogButtonBox::RejectRole; break;
+        case AlertButton_Choice1: strText = tr("Yes");    role = QDialogButtonBox::YesRole; break;
+        case AlertButton_Choice2: strText = tr("No");     role = QDialogButtonBox::NoRole; break;
+        default: return 0;
+    }
+
+    /* Create push-button: */
+    QPushButton *pButton = m_pButtonBox->addButton(strText, role);
+
+    /* Configure <default> button: */
+    if (iButton & AlertButtonOption_Default)
+    {
+        pButton->setDefault(true);
+        pButton->setFocus();
+    }
+
+    /* Configure <escape> button: */
+    if (iButton & AlertButtonOption_Escape)
+    {
+        m_iButtonEsc = iButton & AlertButtonMask;
+    }
+
+    /* Return button: */
+    return pButton;
+}
+
+void UIPopupPane::done(int iButtonCode)
+{
+    /* Close the window: */
+    close();
+
+    /* Notify listeners: */
+    emit sigDone(iButtonCode);
+}
+
+/* static */
+int UIPopupPane::parentStatusBarHeight(QWidget *pParent)
+{
+    /* Check if passed parent is QMainWindow and contains status-bar: */
+    if (QMainWindow *pParentWindow = qobject_cast<QMainWindow*>(pParent))
+        if (pParentWindow->statusBar())
+            return pParentWindow->statusBar()->height();
+    return 0;
+}
+
+UIPopupPaneFrame::UIPopupPaneFrame(QWidget *pParent /*= 0*/)
+    : QWidget(pParent)
+    , m_fHovered(false)
+    , m_iDefaultOpacity(128)
+    , m_iHoveredOpacity(230)
+    , m_iOpacity(m_iDefaultOpacity)
+    , m_iHoverAnimationDuration(300)
+{
+    /* Prepare: */
+    prepare();
+}
+
+UIPopupPaneFrame::~UIPopupPaneFrame()
+{
+    /* Cleanup: */
+    cleanup();
+}
+
+void UIPopupPaneFrame::prepare()
+{
+    /* Install event-filter: */
+    installEventFilter(this);
+    /* Install 'hover' animation for 'opacity' property: */
+    installPropertyAnimation(this, QByteArray("opacity"),
+                             m_iDefaultOpacity, m_iHoveredOpacity, m_iHoverAnimationDuration,
+                             SIGNAL(sigHoverEnter()), SIGNAL(sigHoverLeave()));
+}
+
+void UIPopupPaneFrame::cleanup()
+{
+}
+
+bool UIPopupPaneFrame::eventFilter(QObject *pObject, QEvent *pEvent)
+{
+    /* Depending on event-type: */
     switch (pEvent->type())
     {
-        /* Move event: */
-        case QEvent::Move:
+        /* Something is hovered: */
+        case QEvent::HoverEnter:
+        case QEvent::Enter:
         {
-            moveAccordingParent();
+            if (!m_fHovered)
+            {
+                m_fHovered = true;
+                emit sigHoverEnter();
+            }
             break;
         }
-        /* Resize event: */
-        case QEvent::Resize:
+        /* Nothing is hovered: */
+        case QEvent::Leave:
         {
-            resizeAccordingParent();
+            if (pObject == this && m_fHovered)
+            {
+                m_fHovered = false;
+                emit sigHoverLeave();
+            }
             break;
         }
@@ -259,144 +518,71 @@
         default: break;
     }
-
-    /* Do not filter by default: */
+    /* Do not filter anything: */
     return false;
 }
 
-void UIPopupPane::showEvent(QShowEvent *pEvent)
-{
-    /* Make sure we should polish dialog: */
-    if (m_fPolished)
-        return;
-
-    /* Call to polish-event: */
-    polishEvent(pEvent);
-
-    /* Mark dialog as polished: */
-    m_fPolished = true;
-}
-
-void UIPopupPane::polishEvent(QShowEvent*)
-{
-    /* Tune geometry: */
-    moveAccordingParent();
-    resizeAccordingParent();
-}
-
-void UIPopupPane::moveAccordingParent()
-{
-    /* Move according parent: */
-    QRect geo = parentWidget()->geometry();
-    move(geo.x(), geo.y());
-}
-
-void UIPopupPane::resizeAccordingParent()
-{
-    /* Resize according parent: */
-    int iWidth = parentWidget()->width();
-    resize(iWidth, minimumSizeHint().height());
-
-    /* Resize text-pane according new size: */
-    int iMinimumTextWidth = iWidth;
-    int iLeft, iTop, iRight, iBottom;
-    m_pMainLayout->getContentsMargins(&iLeft, &iTop, &iRight, &iBottom);
-    iMinimumTextWidth -= iLeft;
-    iMinimumTextWidth -= iRight;
-    m_pTextPane->setMinimumTextWidth(iMinimumTextWidth);
-}
-
-void UIPopupPane::prepareContent()
-{
-    /* Crete main-layout: */
-    m_pMainLayout = new QVBoxLayout(this);
-    {
-        /* Configure layout: */
-#ifdef Q_WS_MAC
-        m_pMainLayout->setContentsMargins(20, 5, 20, 5);
-        m_pMainLayout->setSpacing(0);
-#else /* Q_WS_MAC */
-        m_pMainLayout->setContentsMargins(5, 5, 5, 5);
-        m_pMainLayout->setSpacing(5);
-#endif /* !Q_WS_MAC */
-        /* Create message-label: */
-        m_pTextPane = new QIRichTextLabel;
-        {
-            /* Add into layout: */
-            m_pMainLayout->addWidget(m_pTextPane);
-            /* Configure label: */
-            m_pTextPane->setText(m_strMessage);
-            m_pTextPane->setWordWrapMode(QTextOption::WrapAtWordBoundaryOrAnywhere);
-        }
-        /* Create button-box: */
-        m_pButtonBox = new QIDialogButtonBox;
-        {
-            /* Add into layout: */
-            m_pMainLayout->addWidget(m_pButtonBox);
-            /* Configure button-box: */
-            m_pButton1 = createButton(m_iButton1);
-            if (m_pButton1)
-            {
-                if (!m_strButtonText1.isEmpty())
-                    m_pButton1->setText(m_strButtonText1);
-                connect(m_pButton1, SIGNAL(clicked()), SLOT(done1()));
-            }
-            m_pButton2 = createButton(m_iButton2);
-            if (m_pButton2)
-            {
-                if (!m_strButtonText2.isEmpty())
-                    m_pButton1->setText(m_strButtonText2);
-                connect(m_pButton2, SIGNAL(clicked()), SLOT(done2()));
-            }
-            m_pButton3 = createButton(m_iButton3);
-            if (m_pButton3)
-            {
-                if (!m_strButtonText3.isEmpty())
-                    m_pButton1->setText(m_strButtonText3);
-                connect(m_pButton3, SIGNAL(clicked()), SLOT(done3()));
-            }
-        }
-    }
-}
-
-QPushButton* UIPopupPane::createButton(int iButton)
-{
-    /* Not for AlertButton_NoButton: */
-    if (iButton == 0)
-        return 0;
-
-    /* Prepare button text & role: */
-    QString strText;
-    QDialogButtonBox::ButtonRole role;
-    switch (iButton & AlertButtonMask)
-    {
-        case AlertButton_Ok:      strText = tr("OK");     role = QDialogButtonBox::AcceptRole; break;
-        case AlertButton_Cancel:  strText = tr("Cancel"); role = QDialogButtonBox::RejectRole; break;
-        case AlertButton_Choice1: strText = tr("Yes");    role = QDialogButtonBox::YesRole; break;
-        case AlertButton_Choice2: strText = tr("No");     role = QDialogButtonBox::NoRole; break;
-        case AlertButton_Copy:    strText = tr("Copy");   role = QDialogButtonBox::ActionRole; break;
-        default: return 0;
-    }
-
-    /* Create push-button: */
-    QPushButton *pButton = m_pButtonBox->addButton(strText, role);
-
-    /* Configure <default> button: */
-    if (iButton & AlertButtonOption_Default)
-    {
-        pButton->setDefault(true);
-        pButton->setFocus();
-    }
-
-    /* Return button: */
-    return pButton;
-}
-
-void UIPopupPane::done(int iButtonCode)
-{
-    /* Close the window: */
-    close();
-
-    /* Notify listeners: */
-    emit sigDone(iButtonCode);
-}
-
+void UIPopupPaneFrame::paintEvent(QPaintEvent*)
+{
+    /* Compose painting rectangle: */
+    const QRect rect(0, 0, width(), height());
+
+    /* Create painter: */
+    QPainter painter(this);
+    painter.setRenderHint(QPainter::Antialiasing);
+
+    /* Configure painter clipping: */
+    QPainterPath path;
+    int iDiameter = 5;
+    QSizeF arcSize(2 * iDiameter, 2 * iDiameter);
+    path.moveTo(iDiameter, 0);
+    path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-iDiameter, 0), 90, 90);
+    path.lineTo(path.currentPosition().x(), rect.height() - iDiameter);
+    path.arcTo(QRectF(path.currentPosition(), arcSize).translated(0, -iDiameter), 180, 90);
+    path.lineTo(rect.width() - iDiameter, path.currentPosition().y());
+    path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-iDiameter, -2 * iDiameter), 270, 90);
+    path.lineTo(path.currentPosition().x(), iDiameter);
+    path.arcTo(QRectF(path.currentPosition(), arcSize).translated(-2 * iDiameter, -iDiameter), 0, 90);
+    path.closeSubpath();
+    painter.setClipPath(path);
+
+    /* Fill with background: */
+    QColor currentColor(palette().color(QPalette::Window));
+    QColor newColor(currentColor.red(), currentColor.green(), currentColor.blue(), opacity());
+    painter.fillRect(rect, newColor);
+}
+
+/* static */
+void UIPopupPaneFrame::installPropertyAnimation(QWidget *pParent, const QByteArray &strPropertyName,
+                                                int iStartValue, int iFinalValue, int iAnimationDuration,
+                                                const char *pSignalForward, const char *pSignalBackward)
+{
+    /* State-machine: */
+    QStateMachine *pStateMachine = new QStateMachine(pParent);
+    /* State-machine 'start' state: */
+    QState *pStateStart = new QState(pStateMachine);
+    /* State-machine 'final' state: */
+    QState *pStateFinal = new QState(pStateMachine);
+
+    /* State-machine 'forward' animation: */
+    QPropertyAnimation *pForwardAnimation = new QPropertyAnimation(pParent, strPropertyName, pParent);
+    pForwardAnimation->setDuration(iAnimationDuration);
+    pForwardAnimation->setStartValue(iStartValue);
+    pForwardAnimation->setEndValue(iFinalValue);
+    /* State-machine 'backward' animation: */
+    QPropertyAnimation *pBackwardAnimation = new QPropertyAnimation(pParent, strPropertyName, pParent);
+    pBackwardAnimation->setDuration(iAnimationDuration);
+    pBackwardAnimation->setStartValue(iFinalValue);
+    pBackwardAnimation->setEndValue(iStartValue);
+
+    /* State-machine state transitions: */
+    QSignalTransition *pDefaultToHovered = pStateStart->addTransition(pParent, pSignalForward, pStateFinal);
+    pDefaultToHovered->addAnimation(pForwardAnimation);
+    QSignalTransition *pHoveredToDefault = pStateFinal->addTransition(pParent, pSignalBackward, pStateStart);
+    pHoveredToDefault->addAnimation(pBackwardAnimation);
+
+    /* Initial state is 'start': */
+    pStateMachine->setInitialState(pStateStart);
+    /* Start hover-machine: */
+    pStateMachine->start();
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 45489)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 45490)
@@ -53,7 +53,6 @@
 
     /* API: Main message function, used directly only in exceptional cases: */
-    void message(QWidget *pParent,
+    void message(QWidget *pParent, const QString &strId,
                  const QString &strMessage, const QString &strDetails,
-                 const char *pcszAutoConfirmId = 0,
                  int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
                  const QString &strButtonText1 = QString(),
@@ -63,19 +62,16 @@
     /* API: Wrapper to 'message' function.
      * Provides single OK button: */
-    void error(QWidget *pParent,
-               const QString &strMessage, const QString &strDetails,
-               const char *pcszAutoConfirmId = 0) const;
+    void error(QWidget *pParent, const QString &strId,
+               const QString &strMessage, const QString &strDetails) const;
 
     /* API: Wrapper to 'error' function.
      * Omits details: */
-    void alert(QWidget *pParent,
-               const QString &strMessage,
-               const char *pcszAutoConfirmId = 0) const;
+    void alert(QWidget *pParent, const QString &strId,
+               const QString &strMessage) const;
 
     /* API: Wrapper to 'message' function.
      * Omits details, provides two or three buttons: */
-    void question(QWidget *pParent,
+    void question(QWidget *pParent, const QString &strId,
                   const QString &strMessage,
-                  const char *pcszAutoConfirmId = 0,
                   int iButton1 = 0, int iButton2 = 0, int iButton3 = 0,
                   const QString &strButtonText1 = QString(),
@@ -85,7 +81,6 @@
     /* API: Wrapper to 'question' function,
      * Question providing two buttons (OK and Cancel by default): */
-    void questionBinary(QWidget *pParent,
+    void questionBinary(QWidget *pParent, const QString &strId,
                         const QString &strMessage,
-                        const char *pcszAutoConfirmId = 0,
                         const QString &strOkButtonText = QString(),
                         const QString &strCancelButtonText = QString()) const;
@@ -93,11 +88,13 @@
     /* API: Wrapper to 'question' function,
      * Question providing three buttons (Yes, No and Cancel by default): */
-    void questionTrinary(QWidget *pParent,
+    void questionTrinary(QWidget *pParent, const QString &strId,
                          const QString &strMessage,
-                         const char *pcszAutoConfirmId = 0,
                          const QString &strChoice1ButtonText = QString(),
                          const QString &strChoice2ButtonText = QString(),
                          const QString &strCancelButtonText = QString()) const;
 
+    /* API: Runtime UI stuff: */
+    void remindAboutMouseIntegration(bool fSupportsAbsolute) const;
+
 private slots:
 
@@ -112,9 +109,8 @@
 
     /* Helper: Popup-box stuff: */
-    void showPopupBox(QWidget *pParent,
+    void showPopupBox(QWidget *pParent, const QString &strId,
                       const QString &strMessage, const QString &strDetails,
                       int iButton1, int iButton2, int iButton3,
-                      const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3,
-                      const QString &strAutoConfirmId) const;
+                      const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3) const;
 
     /* Variables: */
@@ -161,4 +157,8 @@
 private:
 
+    /* Helpers: Prepare/cleanup stuff: */
+    void prepare();
+    void cleanup();
+
     /* Handler: Event-filter stuff: */
     bool eventFilter(QObject *pWatched, QEvent *pEvent);
@@ -167,8 +167,8 @@
     virtual void showEvent(QShowEvent *pEvent);
     virtual void polishEvent(QShowEvent *pEvent);
-
-    /* Helpers: Move/resize stuff: */
-    void moveAccordingParent();
-    void resizeAccordingParent();
+    virtual void keyPressEvent(QKeyEvent *pEvent);
+
+    /* Helper: Adjust stuff: */
+    void adjustAccordingParent();
 
     /* Helpers: Prepare stuff: */
@@ -176,6 +176,9 @@
     QPushButton* createButton(int iButton);
 
-    /* Helper: */
+    /* Helper: Complete stuff: */
     void done(int iButtonCode);
+
+    /* Helper: Parent stuff: */
+    static int parentStatusBarHeight(QWidget *pParent);
 
     /* Variables: */
@@ -185,11 +188,59 @@
     int m_iButton1, m_iButton2, m_iButton3;
     QString m_strButtonText1, m_strButtonText2, m_strButtonText3;
+    int m_iButtonEsc;
+    const int m_iParentStatusBarHeight;
 
     /* Widgets: */
     QVBoxLayout *m_pMainLayout;
+    QVBoxLayout *m_pFrameLayout;
     QIRichTextLabel *m_pTextPane;
+    QIDialogButtonBox *m_pButtonBox;
     QPushButton *m_pButton1, *m_pButton2, *m_pButton3;
-    QIDialogButtonBox *m_pButtonBox;
 };
 
+/* Popup-pane frame prototype class: */
+class UIPopupPaneFrame : public QWidget
+{
+    Q_OBJECT;
+    Q_PROPERTY(int opacity READ opacity WRITE setOpacity);
+
+signals:
+
+    /* Notifiers: Hover-machine stuff: */
+    void sigHoverEnter();
+    void sigHoverLeave();
+
+public:
+
+    /* Constructor/destructor: */
+    UIPopupPaneFrame(QWidget *pParent = 0);
+    ~UIPopupPaneFrame();
+
+private:
+
+    /* Helpers: Prepare/cleanup stuff: */
+    void prepare();
+    void cleanup();
+
+    /* Handlers: Event stuff: */
+    bool eventFilter(QObject *pWatched, QEvent *pEvent);
+    void paintEvent(QPaintEvent *pEvent);
+
+    /* Property: Hover-machine stuff: */
+    int opacity() const { return m_iOpacity; }
+    void setOpacity(int iOpacity) { m_iOpacity = iOpacity; update(); }
+
+    /* Static helper: Animation stuff: */
+    static void installPropertyAnimation(QWidget *pParent, const QByteArray &strPropertyName,
+                                         int iStartValue, int iFinalValue, int iAnimationDuration,
+                                         const char *pSignalForward, const char *pSignalBackward);
+
+    /* Hover-machine stuff: */
+    bool m_fHovered;
+    int m_iDefaultOpacity;
+    int m_iHoveredOpacity;
+    int m_iOpacity;
+    int m_iHoverAnimationDuration;
+};
+
 #endif /* __UIPopupCenter_h__ */
