Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp	(revision 57626)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.cpp	(revision 57627)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2014 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -257,5 +257,29 @@
             /* Add button-box into main-layout: */
             pMainLayout->addWidget(m_pButtonBox);
+
+            /* Prepares focus. It is important to prepare focus after adding buttonbox to the layout as,
+             * parenting the buttonbox to the QDialog changes default button focus by Qt: */
+            prepareFocus();
         }
+    }
+}
+
+void QIMessageBox::prepareFocus()
+{
+    /* Configure default button and focus: */
+    if (m_pButton1 && (m_iButton1 & AlertButtonOption_Default))
+    {
+        m_pButton1->setDefault(true);
+        m_pButton1->setFocus();
+    }
+    if (m_pButton2 && (m_iButton2 & AlertButtonOption_Default))
+    {
+        m_pButton2->setDefault(true);
+        m_pButton2->setFocus();
+    }
+    if (m_pButton3 && (m_iButton3 & AlertButtonOption_Default))
+    {
+        m_pButton3->setDefault(true);
+        m_pButton3->setFocus();
     }
 }
@@ -285,10 +309,4 @@
     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)
Index: /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h	(revision 57626)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/extensions/QIMessageBox.h	(revision 57627)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2014 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -26,10 +26,10 @@
 
 /* Forward declarations: */
-class QLabel;
-class QILabel;
-class QPushButton;
 class QCheckBox;
 class QIArrowSplitter;
 class QIDialogButtonBox;
+class QILabel;
+class QLabel;
+class QPushButton;
 
 /** Button types. */
@@ -123,6 +123,9 @@
 private:
 
-    /** Prepare routine. */
+    /** Prepares message-box. */
     void prepare();
+
+    /** Prepares focus. */
+    void prepareFocus();
 
     /** Push-button factory. */
@@ -183,2 +186,3 @@
 
 #endif /* !___QIMessageBox_h___ */
+
