Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp	(revision 71520)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.cpp	(revision 71521)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2013-2017 Oracle Corporation
+ * Copyright (C) 2013-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -19,11 +19,12 @@
 # include <precomp.h>
 #else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
 /* Qt includes: */
-# include <QVBoxLayout>
-# include <QScrollArea>
 # include <QEvent>
 # include <QMainWindow>
 # include <QMenuBar>
+# include <QScrollArea>
 # include <QStatusBar>
+# include <QVBoxLayout>
 
 /* GUI includes: */
@@ -35,7 +36,7 @@
 
 
-UIPopupStack::UIPopupStack(const QString &strID, UIPopupStackOrientation orientation)
+UIPopupStack::UIPopupStack(const QString &strID, UIPopupStackOrientation enmOrientation)
     : m_strID(strID)
-    , m_orientation(orientation)
+    , m_enmOrientation(enmOrientation)
     , m_pScrollArea(0)
     , m_pScrollViewport(0)
@@ -47,16 +48,16 @@
 }
 
-bool UIPopupStack::exists(const QString &strPopupPaneID) const
+bool UIPopupStack::exists(const QString &strID) const
 {
     /* Redirect question to viewport: */
-    return m_pScrollViewport->exists(strPopupPaneID);
-}
-
-void UIPopupStack::createPopupPane(const QString &strPopupPaneID,
+    return m_pScrollViewport->exists(strID);
+}
+
+void UIPopupStack::createPopupPane(const QString &strID,
                                    const QString &strMessage, const QString &strDetails,
                                    const QMap<int, QString> &buttonDescriptions)
 {
     /* Redirect request to viewport: */
-    m_pScrollViewport->createPopupPane(strPopupPaneID,
+    m_pScrollViewport->createPopupPane(strID,
                                        strMessage, strDetails,
                                        buttonDescriptions);
@@ -66,26 +67,26 @@
 }
 
-void UIPopupStack::updatePopupPane(const QString &strPopupPaneID,
+void UIPopupStack::updatePopupPane(const QString &strID,
                                    const QString &strMessage, const QString &strDetails)
 {
     /* Redirect request to viewport: */
-    m_pScrollViewport->updatePopupPane(strPopupPaneID,
+    m_pScrollViewport->updatePopupPane(strID,
                                        strMessage, strDetails);
 }
 
-void UIPopupStack::recallPopupPane(const QString &strPopupPaneID)
+void UIPopupStack::recallPopupPane(const QString &strID)
 {
     /* Redirect request to viewport: */
-    m_pScrollViewport->recallPopupPane(strPopupPaneID);
-}
-
-void UIPopupStack::setOrientation(UIPopupStackOrientation orientation)
+    m_pScrollViewport->recallPopupPane(strID);
+}
+
+void UIPopupStack::setOrientation(UIPopupStackOrientation enmOrientation)
 {
     /* Make sure orientation has changed: */
-    if (m_orientation == orientation)
+    if (m_enmOrientation == enmOrientation)
         return;
 
     /* Update orientation: */
-    m_orientation = orientation;
+    m_enmOrientation = enmOrientation;
     sltAdjustGeometry();
 }
@@ -109,4 +110,43 @@
     /* Recalculate parent status-bar height: */
     m_iParentStatusBarHeight = parentStatusBarHeight(pParent);
+}
+
+bool UIPopupStack::eventFilter(QObject *pWatched, QEvent *pEvent)
+{
+    /* Call to base-class if that is not parent event: */
+    if (!parent() || pWatched != parent())
+        return QWidget::eventFilter(pWatched, pEvent);
+
+    /* Handle parent geometry events: */
+    switch (pEvent->type())
+    {
+        case QEvent::Resize:
+        {
+            /* Propagate size: */
+            propagateSize();
+            /* Adjust geometry: */
+            sltAdjustGeometry();
+            break;
+        }
+        case QEvent::Move:
+        {
+            /* Adjust geometry: */
+            sltAdjustGeometry();
+            break;
+        }
+        default:
+            break; /* Shuts up MSC. */
+    }
+
+    /* Call to base-class: */
+    return QWidget::eventFilter(pWatched, pEvent);
+}
+
+void UIPopupStack::showEvent(QShowEvent*)
+{
+    /* Propagate size: */
+    propagateSize();
+    /* Adjust geometry: */
+    sltAdjustGeometry();
 }
 
@@ -149,5 +189,5 @@
         iY += geo.y();
     }
-    switch (m_orientation)
+    switch (m_enmOrientation)
     {
         case UIPopupStackOrientation_Top:
@@ -189,15 +229,12 @@
     setAutoFillBackground(false);
 #if defined(VBOX_WS_WIN) || defined (VBOX_WS_MAC)
-    /* Using Qt API to enable translucent background for the Win/Mac host.
-     * - Under x11 host Qt 4.8.3 has it broken wih KDE 4.9 for now: */
+    /* Using Qt API to enable translucent background for the Win/Mac host: */
     setAttribute(Qt::WA_TranslucentBackground);
-#endif /* VBOX_WS_WIN || VBOX_WS_MAC */
+#endif
 
 #ifdef VBOX_WS_MAC
-    /* Do not hide popup-stack
-     * and actually the seamless machine-window too
-     * due to Qt bug on window deactivation... */
+    /* Do not hide popup-stack: */
     setAttribute(Qt::WA_MacAlwaysShowToolWindow);
-#endif /* VBOX_WS_MAC */
+#endif
 
     /* Prepare content: */
@@ -249,42 +286,4 @@
 }
 
-bool UIPopupStack::eventFilter(QObject *pWatched, QEvent *pEvent)
-{
-    /* Call to base-class if that is not parent event: */
-    if (!parent() || pWatched != parent())
-        return QWidget::eventFilter(pWatched, pEvent);
-
-    /* Handle parent geometry events: */
-    switch (pEvent->type())
-    {
-        case QEvent::Resize:
-        {
-            /* Propagate size: */
-            propagateSize();
-            /* Adjust geometry: */
-            sltAdjustGeometry();
-            break;
-        }
-        case QEvent::Move:
-        {
-            /* Adjust geometry: */
-            sltAdjustGeometry();
-            break;
-        }
-        default: break; /* Shuts up MSC.  */
-    }
-
-    /* Call to base-class: */
-    return QWidget::eventFilter(pWatched, pEvent);
-}
-
-void UIPopupStack::showEvent(QShowEvent*)
-{
-    /* Propagate size: */
-    propagateSize();
-    /* Adjust geometry: */
-    sltAdjustGeometry();
-}
-
 void UIPopupStack::propagateSize()
 {
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.h	(revision 71520)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStack.h	(revision 71521)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2013-2017 Oracle Corporation
+ * Copyright (C) 2013-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -16,6 +16,6 @@
  */
 
-#ifndef __UIPopupStack_h__
-#define __UIPopupStack_h__
+#ifndef ___UIPopupStack_h___
+#define ___UIPopupStack_h___
 
 /* Qt includes: */
@@ -27,9 +27,14 @@
 
 /* Forward declaration: */
+class QEvent;
+class QObject;
+class QScrollArea;
+class QShowEvent;
+class QSize;
+class QString;
 class QVBoxLayout;
-class QScrollArea;
 class UIPopupStackViewport;
 
-/* Popup-stack prototype class: */
+/** QWidget extension providing GUI with popup-stack prototype class. */
 class UIPopupStack : public QWidget
 {
@@ -38,73 +43,88 @@
 signals:
 
-    /* Notifier: Layout stuff: */
+    /** Notifies about popup-stack viewport size change. */
     void sigProposeStackViewportSize(QSize newSize);
 
-    /* Notifier: Popup-pane stuff: */
-    void sigPopupPaneDone(QString strPopupPaneID, int iResultCode);
+    /** Asks to close popup-pane with @a strID and @a iResultCode. */
+    void sigPopupPaneDone(QString strID, int iResultCode);
 
-    /* Notifier: Popup-stack stuff: */
+    /** Asks to close popup-stack with @a strID. */
     void sigRemove(QString strID);
 
 public:
 
-    /* Constructor: */
-    UIPopupStack(const QString &strID, UIPopupStackOrientation orientation);
+    /** Constructs popup-stack with passed @a strID and @a enmOrientation. */
+    UIPopupStack(const QString &strID, UIPopupStackOrientation enmOrientation);
 
-    /* API: Popup-pane stuff: */
-    bool exists(const QString &strPopupPaneID) const;
-    void createPopupPane(const QString &strPopupPaneID,
+    /** Returns whether pane with passed @a strID exists. */
+    bool exists(const QString &strID) const;
+    /** Creates pane with passed @a strID, @a strMessage, @a strDetails and @a buttonDescriptions. */
+    void createPopupPane(const QString &strID,
                          const QString &strMessage, const QString &strDetails,
                          const QMap<int, QString> &buttonDescriptions);
-    void updatePopupPane(const QString &strPopupPaneID,
+    /** Updates pane with passed @a strID, @a strMessage and @a strDetails. */
+    void updatePopupPane(const QString &strID,
                          const QString &strMessage, const QString &strDetails);
-    void recallPopupPane(const QString &strPopupPaneID);
-    void setOrientation(UIPopupStackOrientation orientation);
+    /** Recalls pane with passed @a strID. */
+    void recallPopupPane(const QString &strID);
+    /** Defines stack @a enmOrientation. */
+    void setOrientation(UIPopupStackOrientation enmOrientation);
 
-    /* API: Parent stuff: */
+    /** Defines stack @a pParent*/
     void setParent(QWidget *pParent);
-    void setParent(QWidget *pParent, Qt::WindowFlags flags);
+    /** Defines stack @a pParent and @a enmFlags. */
+    void setParent(QWidget *pParent, Qt::WindowFlags enmFlags);
+
+protected:
+
+    /** Pre-handles standard Qt @a pEvent for passed @a pObject. */
+    virtual bool eventFilter(QObject *pObject, QEvent *pEvent) /* override */;
+
+    /** Handles show @a pEvent. */
+    virtual void showEvent(QShowEvent *pEvent) /* override */;
 
 private slots:
 
-    /* Handler: Layout stuff: */
+    /** Adjusts geometry. */
     void sltAdjustGeometry();
 
-    /* Handlers: Popup-pane stuff: */
-    void sltPopupPaneRemoved(QString strPopupPaneID);
+    /** Handles removal of the popup-pane with @a strID. */
+    void sltPopupPaneRemoved(QString strID);
+    /** Handles removal of all the popup-panes. */
     void sltPopupPanesRemoved();
 
 private:
 
-    /* Helpers: Prepare stuff: */
+    /** Prepares all. */
     void prepare();
+    /** Prepares contents. */
     void prepareContent();
 
-    /* Handler: Event-filter stuff: */
-    bool eventFilter(QObject *pWatched, QEvent *pEvent);
-
-    /* Handler: Event stuff: */
-    void showEvent(QShowEvent *pEvent);
-
-    /* Helper: Layout stuff: */
+    /** Propagates size. */
     void propagateSize();
 
-    /* Static helpers: Prepare stuff: */
+    /** Returns @a pParent menu-bar height. */
     static int parentMenuBarHeight(QWidget *pParent);
+    /** Returns @a pParent status-bar height. */
     static int parentStatusBarHeight(QWidget *pParent);
 
-    /* Variable: General stuff: */
-    QString m_strID;
-    UIPopupStackOrientation m_orientation;
+    /** Holds the stack ID. */
+    QString                 m_strID;
+    /** Holds the stack orientation. */
+    UIPopupStackOrientation m_enmOrientation;
 
-    /* Variables: Widget stuff: */
-    QVBoxLayout *m_pMainLayout;
-    QScrollArea *m_pScrollArea;
+    /** Holds the main-layout instance. */
+    QVBoxLayout          *m_pMainLayout;
+    /** Holds the scroll-area instance. */
+    QScrollArea          *m_pScrollArea;
+    /** Holds the scroll-viewport instance. */
     UIPopupStackViewport *m_pScrollViewport;
 
-    /* Variables: Layout stuff: */
+    /** Holds the parent menu-bar height. */
     int m_iParentMenuBarHeight;
+    /** Holds the parent status-bar height. */
     int m_iParentStatusBarHeight;
 };
 
-#endif /* __UIPopupStack_h__ */
+#endif /* !___UIPopupStack_h___ */
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStackViewport.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStackViewport.cpp	(revision 71520)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStackViewport.cpp	(revision 71521)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2013-2017 Oracle Corporation
+ * Copyright (C) 2013-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -19,7 +19,8 @@
 # include <precomp.h>
 #else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
+
 /* GUI includes: */
+# include "UIPopupPane.h"
 # include "UIPopupStackViewport.h"
-# include "UIPopupPane.h"
 
 /* Other VBox includes: */
@@ -35,16 +36,16 @@
 }
 
-bool UIPopupStackViewport::exists(const QString &strPopupPaneID) const
+bool UIPopupStackViewport::exists(const QString &strID) const
 {
     /* Is there already popup-pane with the same ID? */
-    return m_panes.contains(strPopupPaneID);
-}
-
-void UIPopupStackViewport::createPopupPane(const QString &strPopupPaneID,
+    return m_panes.contains(strID);
+}
+
+void UIPopupStackViewport::createPopupPane(const QString &strID,
                                            const QString &strMessage, const QString &strDetails,
                                            const QMap<int, QString> &buttonDescriptions)
 {
     /* Make sure there is no such popup-pane already: */
-    if (m_panes.contains(strPopupPaneID))
+    if (m_panes.contains(strID))
     {
         AssertMsgFailed(("Popup-pane already exists!"));
@@ -53,5 +54,5 @@
 
     /* Create new popup-pane: */
-    UIPopupPane *pPopupPane = m_panes[strPopupPaneID] = new UIPopupPane(this,
+    UIPopupPane *pPopupPane = m_panes[strID] = new UIPopupPane(this,
                                                                         strMessage, strDetails,
                                                                         buttonDescriptions);
@@ -66,9 +67,9 @@
 }
 
-void UIPopupStackViewport::updatePopupPane(const QString &strPopupPaneID,
+void UIPopupStackViewport::updatePopupPane(const QString &strID,
                                            const QString &strMessage, const QString &strDetails)
 {
     /* Make sure there is such popup-pane already: */
-    if (!m_panes.contains(strPopupPaneID))
+    if (!m_panes.contains(strID))
     {
         AssertMsgFailed(("Popup-pane doesn't exists!"));
@@ -77,5 +78,5 @@
 
     /* Get existing popup-pane: */
-    UIPopupPane *pPopupPane = m_panes[strPopupPaneID];
+    UIPopupPane *pPopupPane = m_panes[strID];
 
     /* Update message and details: */
@@ -84,8 +85,8 @@
 }
 
-void UIPopupStackViewport::recallPopupPane(const QString &strPopupPaneID)
+void UIPopupStackViewport::recallPopupPane(const QString &strID)
 {
     /* Make sure there is such popup-pane already: */
-    if (!m_panes.contains(strPopupPaneID))
+    if (!m_panes.contains(strID))
     {
         AssertMsgFailed(("Popup-pane doesn't exists!"));
@@ -94,5 +95,5 @@
 
     /* Get existing popup-pane: */
-    UIPopupPane *pPopupPane = m_panes[strPopupPaneID];
+    UIPopupPane *pPopupPane = m_panes[strID];
 
     /* Recall popup-pane: */
@@ -133,6 +134,6 @@
 
     /* Make sure the popup-pane still exists: */
-    const QString strPopupPaneID(m_panes.key(pPopupPane, QString()));
-    if (strPopupPaneID.isNull())
+    const QString strID(m_panes.key(pPopupPane, QString()));
+    if (strID.isNull())
     {
         AssertMsgFailed(("Popup-pane already destroyed!"));
@@ -141,13 +142,13 @@
 
     /* Notify listeners about popup-pane removal: */
-    emit sigPopupPaneDone(strPopupPaneID, iResultCode);
+    emit sigPopupPaneDone(strID, iResultCode);
 
     /* Delete popup-pane asyncronously.
      * To avoid issues with events which already posted: */
-    m_panes.remove(strPopupPaneID);
+    m_panes.remove(strID);
     pPopupPane->deleteLater();
 
     /* Notify listeners about popup-pane removed: */
-    emit sigPopupPaneRemoved(strPopupPaneID);
+    emit sigPopupPaneRemoved(strID);
 
     /* Adjust geometry: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStackViewport.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStackViewport.h	(revision 71520)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupStackViewport.h	(revision 71521)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2013-2017 Oracle Corporation
+ * Copyright (C) 2013-2018 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -16,6 +16,6 @@
  */
 
-#ifndef __UIPopupStackViewport_h__
-#define __UIPopupStackViewport_h__
+#ifndef ___UIPopupStackViewport_h___
+#define ___UIPopupStackViewport_h___
 
 /* Qt includes: */
@@ -24,7 +24,9 @@
 
 /* Forward declaration: */
+class QSize;
+class QString;
 class UIPopupPane;
 
-/* Popup-stack viewport prototype class: */
+/** QWidget extension providing GUI with popup-stack viewport prototype class. */
 class UIPopupStackViewport : public QWidget
 {
@@ -33,57 +35,69 @@
 signals:
 
-    /* Notifiers: Layout stuff: */
+    /** Notifies about popup-pane size change. */
     void sigProposePopupPaneSize(QSize newSize);
+
+    /** Notifies about size-hint change. */
     void sigSizeHintChanged();
 
-    /* Notifiers: Popup-pane stuff: */
-    void sigPopupPaneDone(QString strPopupPaneID, int iResultCode);
-    void sigPopupPaneRemoved(QString strPopupPaneID);
+    /** Asks to close popup-pane with @a strID and @a iResultCode. */
+    void sigPopupPaneDone(QString strID, int iResultCode);
+    /** Notifies about popup-pane with @a strID was removed. */
+    void sigPopupPaneRemoved(QString strID);
+    /** Notifies about popup-panes were removed. */
     void sigPopupPanesRemoved();
 
 public:
 
-    /* Constructor: */
+    /** Constructs popup-stack viewport. */
     UIPopupStackViewport();
 
-    /* API: Popup-pane stuff: */
-    bool exists(const QString &strPopupPaneID) const;
-    void createPopupPane(const QString &strPopupPaneID,
+    /** Returns whether pane with passed @a strID exists. */
+    bool exists(const QString &strID) const;
+    /** Creates pane with passed @a strID, @a strMessage, @a strDetails and @a buttonDescriptions. */
+    void createPopupPane(const QString &strID,
                          const QString &strMessage, const QString &strDetails,
                          const QMap<int, QString> &buttonDescriptions);
-    void updatePopupPane(const QString &strPopupPaneID,
+    /** Updates pane with passed @a strID, @a strMessage and @a strDetails. */
+    void updatePopupPane(const QString &strID,
                          const QString &strMessage, const QString &strDetails);
-    void recallPopupPane(const QString &strPopupPaneID);
+    /** Recalls pane with passed @a strID. */
+    void recallPopupPane(const QString &strID);
 
-    /* API: Layout stuff: */
+    /** Returns minimum size-hint. */
     QSize minimumSizeHint() const { return m_minimumSizeHint; }
 
 public slots:
 
-    /* Handler: Layout stuff: */
+    /** Handle proposal for @a newSize. */
     void sltHandleProposalForSize(QSize newSize);
 
 private slots:
 
-    /* Handler: Layout stuff: */
+    /** Adjusts geometry. */
     void sltAdjustGeometry();
 
-    /* Handler: Popup-pane stuff: */
+    /** Handles reuqest to dismiss popup-pane with @a iButtonCode. */
     void sltPopupPaneDone(int iButtonCode);
 
 private:
 
-    /* Helpers: Layout stuff: */
+    /** Updates size-hint. */
     void updateSizeHint();
+    /** Lays the content out. */
     void layoutContent();
 
-    /* Variables: Layout stuff: */
+    /** Holds the layout margin. */
     const int m_iLayoutMargin;
+    /** Holds the layout spacing. */
     const int m_iLayoutSpacing;
+
+    /** Holds the minimum size-hint. */
     QSize m_minimumSizeHint;
 
-    /* Variables: Children stuff: */
+    /** Holds the popup-pane instances. */
     QMap<QString, UIPopupPane*> m_panes;
 };
 
-#endif /* __UIPopupStackViewport_h__ */
+#endif /* !___UIPopupStackViewport_h___ */
+
