Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 45608)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.cpp	(revision 45658)
@@ -20,5 +20,4 @@
 /* GUI includes: */
 #include "UIPopupCenter.h"
-#include "UIModalWindowManager.h"
 #include "UIPopupPane.h"
 
@@ -69,5 +68,5 @@
                             const QString &strButtonText1 /* = QString() */,
                             const QString &strButtonText2 /* = QString() */,
-                            const QString &strButtonText3 /* = QString() */) const
+                            const QString &strButtonText3 /* = QString() */)
 {
     showPopupPane(pParent, strId,
@@ -78,5 +77,5 @@
 
 void UIPopupCenter::error(QWidget *pParent, const QString &strId,
-                          const QString &strMessage, const QString &strDetails) const
+                          const QString &strMessage, const QString &strDetails)
 {
     message(pParent, strId,
@@ -86,5 +85,5 @@
 
 void UIPopupCenter::alert(QWidget *pParent, const QString &strId,
-                          const QString &strMessage) const
+                          const QString &strMessage)
 {
     error(pParent, strId,
@@ -97,5 +96,5 @@
                              const QString &strButtonText1 /*= QString()*/,
                              const QString &strButtonText2 /*= QString()*/,
-                             const QString &strButtonText3 /*= QString()*/) const
+                             const QString &strButtonText3 /*= QString()*/)
 {
     message(pParent, strId,
@@ -108,5 +107,5 @@
                                    const QString &strMessage,
                                    const QString &strOkButtonText /*= QString()*/,
-                                   const QString &strCancelButtonText /*= QString()*/) const
+                                   const QString &strCancelButtonText /*= QString()*/)
 {
     question(pParent, strId,
@@ -124,5 +123,5 @@
                                     const QString &strChoice1ButtonText /*= QString()*/,
                                     const QString &strChoice2ButtonText /*= QString()*/,
-                                    const QString &strCancelButtonText /*= QString()*/) const
+                                    const QString &strCancelButtonText /*= QString()*/)
 {
     question(pParent, strId,
@@ -136,72 +135,73 @@
 }
 
-void UIPopupCenter::showPopupPane(QWidget *pParent, const QString &strId,
+void UIPopupCenter::showPopupPane(QWidget *pParent, const QString &strPopupPaneID,
                                  const QString &strMessage, const QString &strDetails,
                                  int iButton1, int iButton2, int iButton3,
-                                 const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3) const
-{
-    /* Prepare popup-pane: */
-    UIPopupPane *pPopupPane = 0;
-    /* Is there already popup-pane with the same ID? */
-    if (m_popups.contains(strId))
+                                 const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3)
+{
+    /* Looking for the corresponding popup-stack: */
+    QString strPopupStackID = pParent->metaObject()->className();
+    UIPopupStack *pPopupStack = 0;
+    /* Is there already popup-stack with the same ID? */
+    if (m_stacks.contains(strPopupStackID))
     {
         /* Get existing one: */
-        pPopupPane = m_popups[strId];
-        /* And update message and details: */
-        pPopupPane->setMessage(strMessage);
-        pPopupPane->setDetails(strDetails);
-    }
-    /* There is no popup-pane with the same ID? */
+        pPopupStack = m_stacks[strPopupStackID];
+    }
+    /* There is no popup-stack with the same ID? */
     else
     {
-        /* Choose at least one button to be the 'default' and 'escape': */
-        if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0)
-            iButton1 = AlertButton_Ok | AlertButtonOption_Default | AlertButtonOption_Escape;
-        /* Compose button description map: */
-        QMap<int, QString> buttonDescriptions;
-        if (iButton1 != 0 && !buttonDescriptions.contains(iButton1))
-            buttonDescriptions[iButton1] = strButtonText1;
-        if (iButton2 != 0 && !buttonDescriptions.contains(iButton2))
-            buttonDescriptions[iButton2] = strButtonText2;
-        if (iButton3 != 0 && !buttonDescriptions.contains(iButton3))
-            buttonDescriptions[iButton3] = strButtonText3;
-        /* Create popup-pane and insert it into our map: */
-        QWidget *pPopupBoxParent = windowManager().realParentWindow(pParent ? pParent : windowManager().mainWindowShown());
-        pPopupPane = new UIPopupPane(pPopupBoxParent, strId, strMessage, strDetails, buttonDescriptions);
-        m_popups.insert(strId, pPopupPane);
-        /* Attach popup-pane connections: */
-        connect(pPopupPane, SIGNAL(sigDone(int)), this, SLOT(sltPopupDone(int)));
-    }
-    /* Show popup-pane: */
-    pPopupPane->show();
-}
-
-void UIPopupCenter::sltPopupDone(int iButtonCode) const
-{
-    /* Make sure the sender is popup: */
-    const UIPopupPane *pPopup = qobject_cast<UIPopupPane*>(sender());
-    if (!pPopup)
-        return;
-
-    /* Make sure the popup is still exists: */
-    const QString strPopupID(pPopup->id());
-    const bool fIsPopupStillHere = m_popups.contains(strPopupID);
-    AssertMsg(fIsPopupStillHere, ("Popup already destroyed!"));
-    if (!fIsPopupStillHere)
-        return;
-
-    /* Notify listeners: */
-    emit sigPopupDone(strPopupID, iButtonCode);
-
-    /* Cleanup the popup: */
-    m_popups.remove(strPopupID);
-    delete pPopup;
-}
-
-void UIPopupCenter::remindAboutMouseIntegration(bool fSupportsAbsolute) const
+        /* Create new one: */
+        pPopupStack = m_stacks[strPopupStackID] = new UIPopupStack(pParent);
+        /* Attach popup-stack connections: */
+        connect(pPopupStack, SIGNAL(sigPopupPaneDone(QString, int)), this, SIGNAL(sigPopupPaneDone(QString, int)));
+        connect(pPopupStack, SIGNAL(sigRemove()), this, SLOT(sltRemovePopupStack()));
+    }
+    /* Show popup-stack: */
+    pPopupStack->show();
+
+    /* Choose at least one button to be the 'default' and 'escape': */
+    if (iButton1 == 0 && iButton2 == 0 && iButton3 == 0)
+        iButton1 = AlertButton_Ok | AlertButtonOption_Default | AlertButtonOption_Escape;
+    /* Compose button description map: */
+    QMap<int, QString> buttonDescriptions;
+    if (iButton1 != 0 && !buttonDescriptions.contains(iButton1))
+        buttonDescriptions[iButton1] = strButtonText1;
+    if (iButton2 != 0 && !buttonDescriptions.contains(iButton2))
+        buttonDescriptions[iButton2] = strButtonText2;
+    if (iButton3 != 0 && !buttonDescriptions.contains(iButton3))
+        buttonDescriptions[iButton3] = strButtonText3;
+    /* Update corresponding popup-pane: */
+    pPopupStack->updatePopupPane(strPopupPaneID, strMessage, strDetails, buttonDescriptions);
+}
+
+void UIPopupCenter::sltRemovePopupStack()
+{
+    /* Make sure the sender is the popup-stack: */
+    UIPopupStack *pPopupStack = qobject_cast<UIPopupStack*>(sender());
+    if (!pPopupStack)
+    {
+        AssertMsgFailed(("Should be called by popup-stack only!"));
+        return;
+    }
+
+    /* Make sure the popup-stack still exists: */
+    const QString strPopupStackID(m_stacks.key(pPopupStack, QString()));
+    if (strPopupStackID.isNull())
+    {
+        AssertMsgFailed(("Popup-stack already destroyed!"));
+        return;
+    }
+
+    /* Cleanup the popup-stack: */
+    m_stacks.remove(strPopupStackID);
+    delete pPopupStack;
+}
+
+void UIPopupCenter::remindAboutMouseIntegration(bool fSupportsAbsolute, QWidget *pParent)
 {
     if (fSupportsAbsolute)
     {
-        alert(0, QString("remindAboutMouseIntegration"),
+        alert(pParent, QString("remindAboutMouseIntegration"),
               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 -- "
@@ -216,5 +216,5 @@
     else
     {
-        alert(0, QString("remindAboutMouseIntegration"),
+        alert(pParent, QString("remindAboutMouseIntegration"),
               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 "
@@ -223,2 +223,233 @@
 }
 
+
+/* Qt includes: */
+#include <QVBoxLayout>
+#include <QEvent>
+#include <QMainWindow>
+#include <QStatusBar>
+
+UIPopupStack::UIPopupStack(QWidget *pParent)
+    : QWidget(pParent)
+    , m_fPolished(false)
+    , m_iStackLayoutMargin(0)
+    , m_iStackLayoutSpacing(0)
+    , m_iParentStatusBarHeight(parentStatusBarHeight(pParent))
+{
+    /* Prepare: */
+    prepare();
+}
+
+void UIPopupStack::updatePopupPane(const QString &strPopupPaneID,
+                                   const QString &strMessage, const QString &strDetails,
+                                   const QMap<int, QString> &buttonDescriptions)
+{
+    /* Looking for the corresponding popup-pane: */
+    UIPopupPane *pPopupPane = 0;
+    /* Is there already popup-pane with the same ID? */
+    if (m_panes.contains(strPopupPaneID))
+    {
+        /* Get existing one: */
+        pPopupPane = m_panes[strPopupPaneID];
+        /* And update message and details: */
+        pPopupPane->setMessage(strMessage);
+        pPopupPane->setDetails(strDetails);
+    }
+    /* There is no popup-pane with the same ID? */
+    else
+    {
+        /* Create new one: */
+        pPopupPane = m_panes[strPopupPaneID] = new UIPopupPane(this,
+                                                               strMessage, strDetails,
+                                                               buttonDescriptions);
+        pPopupPane->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
+        /* Attach popup-pane connection: */
+        connect(pPopupPane, SIGNAL(sigSizeHintChanged()), this, SLOT(sltAdjustGeometry()));
+        connect(pPopupPane, SIGNAL(sigDone(int)), this, SLOT(sltPopupPaneDone(int)));
+        /* Show popup-pane: */
+        pPopupPane->show();
+    }
+
+    /* Propagate desired width: */
+    setDesiredWidth(parentWidget()->width());
+    /* Adjust geometry: */
+    sltAdjustGeometry();
+}
+
+void UIPopupStack::sltAdjustGeometry()
+{
+    /* Get this attributes: */
+    const int iWidth = parentWidget()->width();
+    const int iHeight = minimumHeightHint();
+
+    /* Move according parent: */
+    move(0, parentWidget()->height() - iHeight - m_iParentStatusBarHeight);
+    /* Resize according parent: */
+    resize(iWidth, iHeight);
+
+    /* Layout content: */
+    layoutContent();
+}
+
+void UIPopupStack::sltPopupPaneDone(int iButtonCode)
+{
+    /* Make sure the sender is the popup-pane: */
+    UIPopupPane *pPopupPane = qobject_cast<UIPopupPane*>(sender());
+    if (!pPopupPane)
+    {
+        AssertMsgFailed(("Should be called by popup-pane only!"));
+        return;
+    }
+
+    /* Make sure the popup-pane still exists: */
+    const QString strPopupPaneID(m_panes.key(pPopupPane, QString()));
+    if (strPopupPaneID.isNull())
+    {
+        AssertMsgFailed(("Popup-pane already destroyed!"));
+        return;
+    }
+
+    /* Notify listeners about popup-pane: */
+    emit sigPopupPaneDone(strPopupPaneID, iButtonCode);
+
+    /* Cleanup the popup-pane: */
+    m_panes.remove(strPopupPaneID);
+    delete pPopupPane;
+
+    /* Make sure this stack still contains popup-panes: */
+    if (!m_panes.isEmpty())
+        return;
+
+    /* Notify listeners about popup-stack: */
+    emit sigRemove();
+}
+
+void UIPopupStack::prepare()
+{
+    /* Install event-filter to parent: */
+    parent()->installEventFilter(this);
+}
+
+int UIPopupStack::minimumWidthHint()
+{
+    /* Prepare width hint: */
+    int iWidthHint = 0;
+
+    /* Take into account all the panes: */
+    foreach (UIPopupPane *pPane, m_panes)
+        iWidthHint = qMax(iWidthHint, pPane->minimumWidthHint());
+
+    /* And two margins finally: */
+    iWidthHint += 2 * m_iStackLayoutMargin;
+
+    /* Return width hint: */
+    return iWidthHint;
+}
+
+int UIPopupStack::minimumHeightHint()
+{
+    /* Prepare height hint: */
+    int iHeightHint = 0;
+
+    /* Take into account all the panes: */
+    foreach (UIPopupPane *pPane, m_panes)
+        iHeightHint += pPane->minimumHeightHint();
+
+    /* Take into account all the spacings, if any: */
+    if (!m_panes.isEmpty())
+        iHeightHint += (m_panes.size() - 1) * m_iStackLayoutSpacing;
+
+    /* And two margins finally: */
+    iHeightHint += 2 * m_iStackLayoutMargin;
+
+    /* Return height hint: */
+    return iHeightHint;
+}
+
+QSize UIPopupStack::minimumSizeHint()
+{
+    /* Wrap reimplemented getters: */
+    return QSize(minimumWidthHint(), minimumHeightHint());
+}
+
+void UIPopupStack::setDesiredWidth(int iWidth)
+{
+    /* Propagate desired width to all the popup-panes we have: */
+    foreach (UIPopupPane *pPane, m_panes)
+        pPane->setDesiredWidth(iWidth - 2 * m_iStackLayoutMargin);
+}
+
+void UIPopupStack::layoutContent()
+{
+    /* Get attributes: */
+    const int iWidth = width();
+    const int iHeight = height();
+    int iX = m_iStackLayoutMargin;
+    int iY = iHeight - m_iStackLayoutMargin;
+
+    /* Layout every pane we have: */
+    foreach (UIPopupPane *pPane, m_panes)
+    {
+        /* Get pane attributes: */
+        const int iPaneWidth = iWidth - 2 * m_iStackLayoutMargin;
+        const int iPaneHeight = pPane->minimumHeightHint();
+        /* Adjust geometry for the pane: */
+        pPane->move(iX, iY - iPaneHeight);
+        pPane->resize(iPaneWidth, iPaneHeight);
+        pPane->layoutContent();
+        /* Increment placeholder: */
+        iY -= (iPaneHeight + m_iStackLayoutSpacing);
+    }
+}
+
+bool UIPopupStack::eventFilter(QObject *pWatched, QEvent *pEvent)
+{
+    /* Make sure its parent event came: */
+    if (pWatched != parent())
+        return false;
+
+    /* Make sure its resize event came: */
+    if (pEvent->type() != QEvent::Resize)
+        return false;
+
+    /* Propagate desired width: */
+    setDesiredWidth(parentWidget()->width());
+    /* Adjust geometry: */
+    sltAdjustGeometry();
+
+    /* Do not filter anything: */
+    return false;
+}
+
+void UIPopupStack::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 UIPopupStack::polishEvent(QShowEvent*)
+{
+    /* Propagate desired width: */
+    setDesiredWidth(parentWidget()->width());
+    /* Adjust geometry: */
+    sltAdjustGeometry();
+}
+
+/* static */
+int UIPopupStack::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();
+    /* Zero by default: */
+    return 0;
+}
+
Index: trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 45608)
+++ trunk/src/VBox/Frontends/VirtualBox/src/globals/UIPopupCenter.h	(revision 45658)
@@ -27,4 +27,5 @@
 /* Forward declaration: */
 class QWidget;
+class UIPopupStack;
 class UIPopupPane;
 
@@ -36,6 +37,6 @@
 signals:
 
-    /* Notifier: Popup done stuff: */
-    void sigPopupDone(QString strId, int iButtonCode) const;
+    /* Notifier: Popup-pane done stuff: */
+    void sigPopupPaneDone(QString strID, int iButtonCode);
 
 public:
@@ -51,15 +52,15 @@
                  const QString &strButtonText1 = QString(),
                  const QString &strButtonText2 = QString(),
-                 const QString &strButtonText3 = QString()) const;
+                 const QString &strButtonText3 = QString());
 
     /* API: Wrapper to 'message' function.
      * Provides single OK button: */
     void error(QWidget *pParent, const QString &strId,
-               const QString &strMessage, const QString &strDetails) const;
+               const QString &strMessage, const QString &strDetails);
 
     /* API: Wrapper to 'error' function.
      * Omits details: */
     void alert(QWidget *pParent, const QString &strId,
-               const QString &strMessage) const;
+               const QString &strMessage);
 
     /* API: Wrapper to 'message' function.
@@ -70,5 +71,5 @@
                   const QString &strButtonText1 = QString(),
                   const QString &strButtonText2 = QString(),
-                  const QString &strButtonText3 = QString()) const;
+                  const QString &strButtonText3 = QString());
 
     /* API: Wrapper to 'question' function,
@@ -77,5 +78,5 @@
                         const QString &strMessage,
                         const QString &strOkButtonText = QString(),
-                        const QString &strCancelButtonText = QString()) const;
+                        const QString &strCancelButtonText = QString());
 
     /* API: Wrapper to 'question' function,
@@ -85,13 +86,13 @@
                          const QString &strChoice1ButtonText = QString(),
                          const QString &strChoice2ButtonText = QString(),
-                         const QString &strCancelButtonText = QString()) const;
+                         const QString &strCancelButtonText = QString());
 
     /* API: Runtime UI stuff: */
-    void remindAboutMouseIntegration(bool fSupportsAbsolute) const;
+    void remindAboutMouseIntegration(bool fSupportsAbsolute, QWidget *pParent);
 
 private slots:
 
-    /* Handler: Popup done stuff: */
-    void sltPopupDone(int iButtonCode) const;
+    /* Handler: Popup-stack stuff: */
+    void sltRemovePopupStack();
 
 private:
@@ -102,11 +103,11 @@
 
     /* Helper: Popup-pane stuff: */
-    void showPopupPane(QWidget *pParent, const QString &strId,
+    void showPopupPane(QWidget *pParent, const QString &strPopupPaneID,
                        const QString &strMessage, const QString &strDetails,
                        int iButton1, int iButton2, int iButton3,
-                       const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3) const;
+                       const QString &strButtonText1, const QString &strButtonText2, const QString &strButtonText3);
 
-    /* Variables: Popup-pane stuff: */
-    mutable QMap<QString, QPointer<UIPopupPane> > m_popups;
+    /* Variables: Popup-stack stuff: */
+    QMap<QString, QPointer<UIPopupStack> > m_stacks;
 
     /* Instance stuff: */
@@ -119,3 +120,68 @@
 inline UIPopupCenter& popupCenter() { return *UIPopupCenter::instance(); }
 
+
+/* Qt includes: */
+#include <QWidget>
+
+/* Popup-stack prototype class: */
+class UIPopupStack : public QWidget
+{
+    Q_OBJECT;
+
+signals:
+
+    /* Notifier: Popup-pane stuff: */
+    void sigPopupPaneDone(QString strID, int iButtonCode);
+
+    /* Notifier: Popup-stack stuff: */
+    void sigRemove();
+
+public:
+
+    /* Constructor: */
+    UIPopupStack(QWidget *pParent);
+
+    /* API: Popup-pane stuff: */
+    void updatePopupPane(const QString &strPopupPaneID,
+                         const QString &strMessage, const QString &strDetails,
+                         const QMap<int, QString> &buttonDescriptions);
+
+private slots:
+
+    /* Handler: Layout stuff: */
+    void sltAdjustGeometry();
+
+    /* Handler: Popup-pane stuff: */
+    void sltPopupPaneDone(int iButtonCode);
+
+private:
+
+    /* Prepare stuff: */
+    void prepare();
+
+    /* Helpers: Layout stuff: */
+    int minimumWidthHint();
+    int minimumHeightHint();
+    QSize minimumSizeHint();
+    void setDesiredWidth(int iWidth);
+    void layoutContent();
+
+    /* Handler: Event-filter stuff: */
+    bool eventFilter(QObject *pWatched, QEvent *pEvent);
+
+    /* Handlers: Event stuff: */
+    virtual void showEvent(QShowEvent *pEvent);
+    virtual void polishEvent(QShowEvent *pEvent);
+
+    /* Static helpers: Prepare stuff: */
+    static int parentStatusBarHeight(QWidget *pParent);
+
+    /* Variables: */
+    bool m_fPolished;
+    const int m_iStackLayoutMargin;
+    const int m_iStackLayoutSpacing;
+    QMap<QString, UIPopupPane*> m_panes;
+    const int m_iParentStatusBarHeight;
+};
+
 #endif /* __UIPopupCenter_h__ */
Index: trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp	(revision 45608)
+++ trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.cpp	(revision 45658)
@@ -22,9 +22,5 @@
 #include <QVBoxLayout>
 #include <QLabel>
-#include <QPushButton>
-#include <QEvent>
 #include <QKeyEvent>
-#include <QMainWindow>
-#include <QStatusBar>
 #include <QPainter>
 #include <QStateMachine>
@@ -159,4 +155,7 @@
 {
     Q_OBJECT;
+    Q_PROPERTY(QSize collapsedSizeHint READ collapsedSizeHint);
+    Q_PROPERTY(QSize expandedSizeHint READ expandedSizeHint);
+    Q_PROPERTY(QSize minimumSizeHint READ minimumSizeHint WRITE setMinimumSizeHint);
 
 signals:
@@ -167,5 +166,5 @@
 
     /* Notifier: Animation stuff: */
-    void sigSizeChanged();
+    void sigSizeHintChanged();
 
 public:
@@ -182,5 +181,5 @@
     /* API: Size-hint stuff: */
     QSize minimumSizeHint() const;
-    QSize sizeHint() const;
+    void setMinimumSizeHint(const QSize &minimumSizeHint);
 
 private slots:
@@ -197,8 +196,7 @@
 
     /* Helper: Size-hint stuff: */
-    void updateGeometry();
-
-    /* Handler: Animation stuff: */
-    void resizeEvent(QResizeEvent *pEvent);
+    QSize collapsedSizeHint() const { return m_collapsedSizeHint; }
+    QSize expandedSizeHint() const { return m_expandedSizeHint; }
+    void updateSizeHint();
 
     /* Variables: Label stuff: */
@@ -207,6 +205,7 @@
 
     /* Variables: Size-hint stuff: */
+    QSize m_collapsedSizeHint;
+    QSize m_expandedSizeHint;
     QSize m_minimumSizeHint;
-    QSize m_sizeHint;
 
     /* Variables: Animation stuff: */
@@ -264,12 +263,9 @@
 
 
-UIPopupPane::UIPopupPane(QWidget *pParent, const QString &strId,
+UIPopupPane::UIPopupPane(QWidget *pParent,
                          const QString &strMessage, const QString &strDetails,
                          const QMap<int, QString> &buttonDescriptions)
     : QWidget(pParent)
-    , m_fPolished(false)
-    , m_strId(strId)
     , m_iMainLayoutMargin(2), m_iMainFrameLayoutMargin(10), m_iMainFrameLayoutSpacing(5)
-    , m_iParentStatusBarHeight(parentStatusBarHeight(pParent))
     , m_strMessage(strMessage), m_strDetails(strDetails), m_buttonDescriptions(buttonDescriptions)
     , m_fHovered(false) , m_fFocused(false)
@@ -301,4 +297,104 @@
 }
 
+void UIPopupPane::setDesiredWidth(int iWidth)
+{
+    /* Make sure text-pane exists: */
+    if (!m_pTextPane)
+        return;
+
+    /* Propagate desired width to the text-pane we have: */
+    m_pTextPane->setDesiredWidth(iWidth - 2 * m_iMainLayoutMargin
+                                        - 2 * m_iMainFrameLayoutMargin
+                                        - m_pButtonPane->minimumSizeHint().width());
+}
+
+int UIPopupPane::minimumWidthHint() const
+{
+    /* Prepare width hint: */
+    int iWidthHint = 0;
+
+    /* Take into account main layout: */
+    iWidthHint += 2 * m_iMainLayoutMargin;
+    {
+        /* Take into account main-frame layout: */
+        iWidthHint += 2 * m_iMainFrameLayoutMargin;
+        {
+            /* Take into account widgets: */
+            iWidthHint += m_pTextPane->minimumSizeHint().width();
+            iWidthHint += m_iMainFrameLayoutSpacing;
+            iWidthHint += m_pButtonPane->minimumSizeHint().width();
+        }
+    }
+
+    /* Return width hint: */
+    return iWidthHint;
+}
+
+int UIPopupPane::minimumHeightHint() const
+{
+    /* Prepare height hint: */
+    int iHeightHint = 0;
+
+    /* Take into account main layout: */
+    iHeightHint += 2 * m_iMainLayoutMargin;
+    {
+        /* Take into account main-frame layout: */
+        iHeightHint += 2 * m_iMainFrameLayoutMargin;
+        {
+            /* Take into account widgets: */
+            const int iTextPaneHeight = m_pTextPane->minimumSizeHint().height();
+            const int iButtonBoxHeight = m_pButtonPane->minimumSizeHint().height();
+            iHeightHint += qMax(iTextPaneHeight, iButtonBoxHeight);
+        }
+    }
+
+    /* Return height hint: */
+    return iHeightHint;
+}
+
+QSize UIPopupPane::minimumSizeHint() const
+{
+    /* Wrap reimplemented getters: */
+    return QSize(minimumWidthHint(), minimumHeightHint());
+}
+
+void UIPopupPane::layoutContent()
+{
+    /* This attributes: */
+    const int iWidth = width();
+    const int iHeight = height();
+    /* Main layout: */
+    {
+        /* Main-frame: */
+        const int iMainFrameWidth = iWidth - 2 * m_iMainLayoutMargin;
+        const int iMainFrameHeight = iHeight - 2 * m_iMainLayoutMargin;
+        m_pMainFrame->move(m_iMainLayoutMargin, m_iMainLayoutMargin);
+        m_pMainFrame->resize(iMainFrameWidth, iMainFrameHeight);
+        /* Main-frame layout: */
+        {
+            /* Variables: */
+            const QSize buttonPaneMinimumSizeHint = m_pButtonPane->minimumSizeHint();
+            const int iButtonPaneMinimumWidth = buttonPaneMinimumSizeHint.width();
+            const int iButtonPaneMinimumHeight = buttonPaneMinimumSizeHint.height();
+            const int iTextPaneWidth = iMainFrameWidth - 2 * m_iMainFrameLayoutMargin - m_iMainFrameLayoutSpacing - iButtonPaneMinimumWidth;
+            const int iTextPaneHeight = m_pTextPane->minimumSizeHint().height();
+            const int iMaximumHeight = qMax(iTextPaneHeight, iButtonPaneMinimumHeight);
+            const int iMinimumHeight = qMin(iTextPaneHeight, iButtonPaneMinimumHeight);
+            const int iHeightShift = (iMaximumHeight - iMinimumHeight) / 2;
+            const bool fTextPaneShifted = iTextPaneHeight < iButtonPaneMinimumHeight;
+            /* Text-pane: */
+            m_pTextPane->move(m_iMainFrameLayoutMargin,
+                              fTextPaneShifted ? m_iMainFrameLayoutMargin + iHeightShift : m_iMainFrameLayoutMargin);
+            m_pTextPane->resize(iTextPaneWidth,
+                                iTextPaneHeight);
+            /* Button-box: */
+            m_pButtonPane->move(m_iMainFrameLayoutMargin + iTextPaneWidth + m_iMainFrameLayoutSpacing,
+                                m_iMainFrameLayoutMargin);
+            m_pButtonPane->resize(iButtonPaneMinimumWidth,
+                                  iMainFrameHeight - 2 * m_iMainFrameLayoutMargin);
+        }
+    }
+}
+
 void UIPopupPane::sltButtonClicked(int iButtonID)
 {
@@ -306,27 +402,6 @@
 }
 
-void UIPopupPane::sltAdjustGeomerty()
-{
-    /* Get parent attributes: */
-    const int iWidth = parentWidget()->width();
-    const int iHeight = parentWidget()->height();
-
-    /* Resize popup according parent width: */
-    resize(iWidth, minimumSizeHint().height());
-
-    /* Move popup according parent: */
-    move(0, iHeight - height() - m_iParentStatusBarHeight);
-
-    /* Raise popup according parent: */
-    raise();
-
-    /* Update layout: */
-    updateLayout();
-}
-
 void UIPopupPane::prepare()
 {
-    /* Install event-filter to parent: */
-    parent()->installEventFilter(this);
     /* Prepare content: */
     prepareContent();
@@ -347,6 +422,6 @@
         {
             /* Prepare label: */
-            connect(m_pTextPane, SIGNAL(sigSizeChanged()),
-                    this, SLOT(sltAdjustGeomerty()));
+            connect(m_pTextPane, SIGNAL(sigSizeHintChanged()),
+                    this, SIGNAL(sigSizeHintChanged()));
             m_pTextPane->installEventFilter(this);
             m_pTextPane->setFocusPolicy(Qt::StrongFocus);
@@ -370,62 +445,48 @@
 bool UIPopupPane::eventFilter(QObject *pWatched, QEvent *pEvent)
 {
-    /* If its parent event came: */
-    if (pWatched == parent())
-    {
-        /* Make sure its resize event came: */
-        if (pEvent->type() != QEvent::Resize)
-            return false;
-
-        /* Adjust geometry: */
-        adjustGeometry();
-    }
-    /* Other objects subscribed for hovering: */
-    else
-    {
-        /* Depending on event-type: */
-        switch (pEvent->type())
-        {
-            /* Something is hovered: */
-            case QEvent::HoverEnter:
-            case QEvent::Enter:
+    /* Depending on event-type: */
+    switch (pEvent->type())
+    {
+        /* Something is hovered: */
+        case QEvent::HoverEnter:
+        case QEvent::Enter:
+        {
+            if (!m_fHovered)
             {
-                if (!m_fHovered)
-                {
-                    m_fHovered = true;
-                    emit sigHoverEnter();
-                }
-                break;
+                m_fHovered = true;
+                emit sigHoverEnter();
             }
-            /* Nothing is hovered: */
-            case QEvent::Leave:
+            break;
+        }
+        /* Nothing is hovered: */
+        case QEvent::Leave:
+        {
+            if (pWatched == this && m_fHovered)
             {
-                if (pWatched == this && m_fHovered)
-                {
-                    m_fHovered = false;
-                    emit sigHoverLeave();
-                }
-                break;
+                m_fHovered = false;
+                emit sigHoverLeave();
             }
-            case QEvent::FocusIn:
+            break;
+        }
+        case QEvent::FocusIn:
+        {
+            if (!m_fFocused)
             {
-                if (!m_fFocused)
-                {
-                    m_fFocused = true;
-                    emit sigFocusEnter();
-                }
-                break;
+                m_fFocused = true;
+                emit sigFocusEnter();
             }
-            case QEvent::FocusOut:
+            break;
+        }
+        case QEvent::FocusOut:
+        {
+            if (m_fFocused)
             {
-                if (m_fFocused)
-                {
-                    m_fFocused = false;
-                    emit sigFocusLeave();
-                }
-                break;
+                m_fFocused = false;
+                emit sigFocusLeave();
             }
-            /* Default case: */
-            default: break;
-        }
+            break;
+        }
+        /* Default case: */
+        default: break;
     }
     /* Do not filter anything: */
@@ -433,127 +494,4 @@
 }
 
-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: */
-    adjustGeometry();
-}
-
-int UIPopupPane::minimumWidthHint() const
-{
-    /* Prepare minimum width hint: */
-    int iMinimumWidthHint = 0;
-
-    /* Take into account main layout: */
-    iMinimumWidthHint += 2 * m_iMainLayoutMargin;
-    {
-        /* Take into account main-frame layout: */
-        iMinimumWidthHint += 2 * m_iMainFrameLayoutMargin;
-        {
-            /* Take into account widgets: */
-            iMinimumWidthHint += m_pTextPane->width();
-            iMinimumWidthHint += m_iMainFrameLayoutSpacing;
-            iMinimumWidthHint += m_pButtonPane->minimumSizeHint().width();
-        }
-    }
-
-    /* Return minimum width hint: */
-    return iMinimumWidthHint;
-}
-
-int UIPopupPane::minimumHeightHint() const
-{
-    /* Prepare minimum height hint: */
-    int iMinimumHeightHint = 0;
-
-    /* Take into account main layout: */
-    iMinimumHeightHint += 2 * m_iMainLayoutMargin;
-    {
-        /* Take into account main-frame layout: */
-        iMinimumHeightHint += 2 * m_iMainFrameLayoutMargin;
-        {
-            /* Take into account widgets: */
-            const int iTextPaneHeight = m_pTextPane->height();
-            const int iButtonBoxHeight = m_pButtonPane->minimumSizeHint().height();
-            iMinimumHeightHint += qMax(iTextPaneHeight, iButtonBoxHeight);
-        }
-    }
-
-    /* Return minimum height hint: */
-    return iMinimumHeightHint;
-}
-
-QSize UIPopupPane::minimumSizeHint() const
-{
-    return QSize(minimumWidthHint(), minimumHeightHint());
-}
-
-void UIPopupPane::adjustGeometry()
-{
-    /* Get parent width: */
-    const int iWidth = parentWidget()->width();
-
-    /* Adjust text-pane according parent width: */
-    if (m_pTextPane)
-    {
-        m_pTextPane->setDesiredWidth(iWidth - 2 * m_iMainLayoutMargin
-                                            - 2 * m_iMainFrameLayoutMargin
-                                            - m_pButtonPane->minimumSizeHint().width());
-    }
-
-    /* Adjust other widgets: */
-    sltAdjustGeomerty();
-}
-
-void UIPopupPane::updateLayout()
-{
-    /* This attributes: */
-    const int iWidth = width();
-    const int iHeight = height();
-    /* Main layout: */
-    {
-        /* Main-frame: */
-        m_pMainFrame->move(m_iMainLayoutMargin,
-                           m_iMainLayoutMargin);
-        m_pMainFrame->resize(iWidth - 2 * m_iMainLayoutMargin,
-                             iHeight - 2 * m_iMainLayoutMargin);
-        const int iMainFrameHeight = m_pMainFrame->height();
-        /* Main-frame layout: */
-        {
-            /* Variables: */
-            const int iTextPaneWidth = m_pTextPane->width();
-            const int iTextPaneHeight = m_pTextPane->height();
-            const QSize buttonBoxMinimumSizeHint = m_pButtonPane->minimumSizeHint();
-            const int iButtonBoxWidth = buttonBoxMinimumSizeHint.width();
-            const int iButtonBoxHeight = buttonBoxMinimumSizeHint.height();
-            const int iMaximumHeight = qMax(iTextPaneHeight, iButtonBoxHeight);
-            const int iMinimumHeight = qMin(iTextPaneHeight, iButtonBoxHeight);
-            const int iHeightShift = (iMaximumHeight - iMinimumHeight) / 2;
-            const bool fTextPaneShifted = iTextPaneHeight < iButtonBoxHeight;
-            /* Text-pane: */
-            m_pTextPane->move(m_iMainFrameLayoutMargin,
-                              fTextPaneShifted ? m_iMainFrameLayoutMargin + iHeightShift : m_iMainFrameLayoutMargin);
-            m_pTextPane->resize(iTextPaneWidth, iTextPaneHeight);
-            /* Button-box: */
-            m_pButtonPane->move(m_iMainFrameLayoutMargin + iTextPaneWidth + m_iMainFrameLayoutSpacing,
-                                m_iMainFrameLayoutMargin);
-            m_pButtonPane->resize(iButtonBoxWidth,
-                                  iMainFrameHeight - 2 * m_iMainFrameLayoutMargin);
-        }
-    }
-}
-
 void UIPopupPane::done(int iButtonCode)
 {
@@ -563,15 +501,4 @@
     /* 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();
-    /* Zero by default: */
-    return 0;
 }
 
@@ -654,5 +581,5 @@
     /* Update the pane for new text: */
     m_pLabel->setText(strText);
-    updateGeometry();
+    updateSizeHint();
 }
 
@@ -664,5 +591,5 @@
     /* Update the pane for new desired-width: */
     m_iDesiredWidth = iDesiredWidth;
-    updateGeometry();
+    updateSizeHint();
 }
 
@@ -677,12 +604,13 @@
 }
 
-QSize UIPopupPaneTextPane::sizeHint() const
-{
-    /* Check if desired-width set: */
-    if (m_iDesiredWidth >= 0)
-        /* Return dependent size-hint: */
-        return m_sizeHint;
-    /* Return golden-rule size-hint by default: */
-    return m_pLabel->sizeHint();
+void UIPopupPaneTextPane::setMinimumSizeHint(const QSize &minimumSizeHint)
+{
+    /* Make sure the size-hint is changed: */
+    if (m_minimumSizeHint == minimumSizeHint)
+        return;
+    /* Assign new size-hint: */
+    m_minimumSizeHint = minimumSizeHint;
+    /* Notify parent popup-pane: */
+    emit sigSizeHintChanged();
 }
 
@@ -741,24 +669,16 @@
 }
 
-void UIPopupPaneTextPane::updateGeometry()
+void UIPopupPaneTextPane::updateSizeHint()
 {
     /* Recalculate size-hints: */
     QFontMetrics fm(m_pLabel->font(), m_pLabel);
-    m_sizeHint = QSize(m_iDesiredWidth, m_pLabel->heightForWidth(m_iDesiredWidth));
-    m_minimumSizeHint = QSize(m_iDesiredWidth, fm.height());
-    /* Update geometry: */
-    QWidget::updateGeometry();
-    /* Resize to required size: */
-    resize(m_fFocused ? sizeHint() : minimumSizeHint());
+    m_collapsedSizeHint = QSize(m_iDesiredWidth, fm.height());
+    m_expandedSizeHint = QSize(m_iDesiredWidth, m_pLabel->heightForWidth(m_iDesiredWidth));
+    m_minimumSizeHint = m_fFocused ? m_expandedSizeHint : m_collapsedSizeHint;
     /* Reinstall animation: */
     delete m_pAnimation;
-    m_pAnimation = UIAnimationFramework::installPropertyAnimation(this, "size", "minimumSizeHint", "sizeHint",
+    m_pAnimation = UIAnimationFramework::installPropertyAnimation(this, "minimumSizeHint", "collapsedSizeHint", "expandedSizeHint",
                                                                   SIGNAL(sigFocusEnter()), SIGNAL(sigFocusLeave()),
                                                                   m_fFocused);
-}
-
-void UIPopupPaneTextPane::resizeEvent(QResizeEvent*)
-{
-    emit sigSizeChanged();
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.h	(revision 45608)
+++ trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPane.h	(revision 45658)
@@ -63,4 +63,5 @@
     void sigFocusEnter();
     void sigFocusLeave();
+    void sigSizeHintChanged();
 
     /* Notifier: Complete stuff: */
@@ -70,10 +71,7 @@
 
     /* Constructor: */
-    UIPopupPane(QWidget *pParent, const QString &strId,
+    UIPopupPane(QWidget *pParent,
                 const QString &strMessage, const QString &strDetails,
                 const QMap<int, QString> &buttonDescriptions);
-
-    /* API: Id stuff: */
-    const QString& id() const { return m_strId; }
 
     /* API: Text stuff: */
@@ -81,11 +79,15 @@
     void setDetails(const QString &strDetails);
 
+    /* API: Layout stuff: */
+    void setDesiredWidth(int iWidth);
+    int minimumWidthHint() const;
+    int minimumHeightHint() const;
+    QSize minimumSizeHint() const;
+    void layoutContent();
+
 private slots:
 
     /* Handler: Button stuff: */
     void sltButtonClicked(int iButtonID);
-
-    /* Handler: Layout stuff: */
-    void sltAdjustGeomerty();
 
 private:
@@ -98,23 +100,8 @@
     bool eventFilter(QObject *pWatched, QEvent *pEvent);
 
-    /* Handlers: Event stuff: */
-    virtual void showEvent(QShowEvent *pEvent);
-    virtual void polishEvent(QShowEvent *pEvent);
-
-    /* Helper: Layout stuff: */
-    int minimumWidthHint() const;
-    int minimumHeightHint() const;
-    QSize minimumSizeHint() const;
-    void adjustGeometry();
-    void updateLayout();
-
     /* Helper: Complete stuff: */
     void done(int iButtonCode);
 
-    /* Static helpers: Prepare stuff: */
-    static int parentStatusBarHeight(QWidget *pParent);
-
     /* Variables: */
-    bool m_fPolished;
     const QString m_strId;
 
@@ -123,5 +110,4 @@
     const int m_iMainFrameLayoutMargin;
     const int m_iMainFrameLayoutSpacing;
-    const int m_iParentStatusBarHeight;
 
     /* Variables: Text stuff: */
