Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneButtonPane.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneButtonPane.cpp	(revision 71512)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneButtonPane.cpp	(revision 71513)
@@ -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
@@ -22,12 +22,12 @@
 # include <QApplication>
 # include <QHBoxLayout>
+# include <QKeyEvent>
 # include <QVBoxLayout>
-# include <QKeyEvent>
 
 /* GUI includes: */
+# include "QIMessageBox.h"
+# include "QIToolButton.h"
+# include "UIIconPool.h"
 # include "UIPopupPaneButtonPane.h"
-# include "UIIconPool.h"
-# include "QIToolButton.h"
-# include "QIMessageBox.h"
 
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
@@ -51,4 +51,5 @@
     /* Assign new button-descriptions: */
     m_buttonDescriptions = buttonDescriptions;
+
     /* Recreate buttons: */
     cleanupButtons();
@@ -80,13 +81,27 @@
 void UIPopupPaneButtonPane::prepareLayouts()
 {
-    /* Create layouts: */
-    m_pButtonLayout = new QHBoxLayout;
-    m_pButtonLayout->setContentsMargins(0, 0, 0, 0);
-    m_pButtonLayout->setSpacing(0);
+    /* Create main-layout: */
     QVBoxLayout *pMainLayout = new QVBoxLayout(this);
-    pMainLayout->setContentsMargins(0, 0, 0, 0);
-    pMainLayout->setSpacing(0);
-    pMainLayout->addLayout(m_pButtonLayout);
-    pMainLayout->addStretch();
+    if (pMainLayout)
+    {
+        /* Configure layout: */
+        pMainLayout->setSpacing(0);
+        pMainLayout->setContentsMargins(0, 0, 0, 0);
+
+        /* Create button-layout: */
+        m_pButtonLayout = new QHBoxLayout;
+        if (m_pButtonLayout)
+        {
+            /* Configure layout: */
+            m_pButtonLayout->setSpacing(0);
+            m_pButtonLayout->setContentsMargins(0, 0, 0, 0);
+
+            /* Add into layout: */
+            pMainLayout->addLayout(m_pButtonLayout);
+        }
+
+        /* Add stretch: */
+        pMainLayout->addStretch();
+    }
 }
 
@@ -153,18 +168,22 @@
 
 /* static */
-QIToolButton* UIPopupPaneButtonPane::addButton(int iButtonID, const QString &strToolTip)
+QIToolButton *UIPopupPaneButtonPane::addButton(int iButtonID, const QString &strToolTip)
 {
     /* Create button: */
     QIToolButton *pButton = new QIToolButton;
-    pButton->removeBorder();
-    pButton->setToolTip(strToolTip.isEmpty() ? defaultToolTip(iButtonID) : strToolTip);
-    pButton->setIcon(defaultIcon(iButtonID));
-
-    /* Sign the 'default' button: */
-    if (iButtonID & AlertButtonOption_Default)
-        pButton->setProperty("default", true);
-    /* Sign the 'escape' button: */
-    if (iButtonID & AlertButtonOption_Escape)
-        pButton->setProperty("escape", true);
+    if (pButton)
+    {
+        /* Configure button: */
+        pButton->removeBorder();
+        pButton->setToolTip(strToolTip.isEmpty() ? defaultToolTip(iButtonID) : strToolTip);
+        pButton->setIcon(defaultIcon(iButtonID));
+
+        /* Sign the 'default' button: */
+        if (iButtonID & AlertButtonOption_Default)
+            pButton->setProperty("default", true);
+        /* Sign the 'escape' button: */
+        if (iButtonID & AlertButtonOption_Escape)
+            pButton->setProperty("escape", true);
+    }
 
     /* Return button: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneButtonPane.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneButtonPane.h	(revision 71512)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIPopupPaneButtonPane.h	(revision 71513)
@@ -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 __UIPopupPaneButtonPane_h__
-#define __UIPopupPaneButtonPane_h__
+#ifndef ___UIPopupPaneButtonPane_h___
+#define ___UIPopupPaneButtonPane_h___
 
 /* Qt includes: */
@@ -25,8 +25,10 @@
 /* Forward declarations: */
 class QHBoxLayout;
+class QIcon;
 class QKeyEvent;
+class QString;
 class QIToolButton;
 
-/* Popup-pane button-pane prototype class: */
+/** QWidget extension providing GUI with popup-pane button-pane prototype class. */
 class UIPopupPaneButtonPane : public QWidget
 {
@@ -35,45 +37,59 @@
 signals:
 
-    /* Notifier: Button stuff: */
+    /** Notifies about button with @a iButtonID being clicked. */
     void sigButtonClicked(int iButtonID);
 
 public:
 
-    /* Constructor: */
+    /** Constructs popup-button pane passing @a pParent to the base-class. */
     UIPopupPaneButtonPane(QWidget *pParent = 0);
 
-    /* API: Button stuff: */
+    /** Defines @a buttonDescriptions. */
     void setButtons(const QMap<int, QString> &buttonDescriptions);
+    /** Returns default button. */
     int defaultButton() const { return m_iDefaultButton; }
+    /** Returns escape button. */
     int escapeButton() const { return m_iEscapeButton; }
 
 private slots:
 
-    /* Handler: Button stuff: */
+    /** Handles button click. */
     void sltButtonClicked();
 
 private:
 
-    /* Helpers: Prepare/cleanup stuff: */
+    /** Prepares all. */
     void prepare();
+    /** Prepares layouts. */
     void prepareLayouts();
+    /** Prepares buttons. */
     void prepareButtons();
+    /** Cleanups buttons. */
     void cleanupButtons();
 
-    /* Handler: Event stuff: */
-    void keyPressEvent(QKeyEvent *pEvent);
+    /** Handles key-press @a pEvent. */
+    virtual void keyPressEvent(QKeyEvent *pEvent) /* override */;
 
-    /* Static helpers: Button stuff: */
-    static QIToolButton* addButton(int iButtonID, const QString &strToolTip);
+    /** Adds button with @a iButtonID and @a strToolTip. */
+    static QIToolButton *addButton(int iButtonID, const QString &strToolTip);
+    /** Returns default tool-tip for button @a iButtonID. */
     static QString defaultToolTip(int iButtonID);
+    /** Returns default icon for button @a iButtonID. */
     static QIcon defaultIcon(int iButtonID);
 
-    /* Variables: Widget stuff: */
+    /** Holds the button layout. */
     QHBoxLayout *m_pButtonLayout;
-    QMap<int, QString> m_buttonDescriptions;
+
+    /** Holds the button descriptions. */
+    QMap<int, QString>       m_buttonDescriptions;
+    /** Holds the button instances. */
     QMap<int, QIToolButton*> m_buttons;
+
+    /** Holds default button. */
     int m_iDefaultButton;
+    /** Holds escape button. */
     int m_iEscapeButton;
 };
 
-#endif /* __UIPopupPaneButtonPane_h__ */
+#endif /* !___UIPopupPaneButtonPane_h___ */
+
