Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 86844)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp	(revision 86845)
@@ -1035,41 +1035,47 @@
 }
 
-void UIMessageCenter::cannotOpenPublicKeyFile(const QString &strPath, QWidget *pParent /* = 0 */) const
+void UIMessageCenter::cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */)
+{
+    error(pParent, MessageType_Error,
+          tr("Failed to create console connection for cloud machine <b>%1</b>.")
+             .arg(CCloudMachine(comMachine).GetName()),
+          UIErrorString::formatErrorInfo(comMachine));
+}
+
+void UIMessageCenter::cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */)
+{
+    error(pParent, MessageType_Error,
+          tr("Failed to create console connection for cloud machine <b>%1</b>.")
+             .arg(strMachineName),
+          UIErrorString::formatErrorInfo(comProgress));
+}
+
+void UIMessageCenter::cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */)
+{
+    error(pParent, MessageType_Error,
+          tr("Failed to delete console connection for cloud machine <b>%1</b>.")
+             .arg(CCloudMachine(comMachine).GetName()),
+          UIErrorString::formatErrorInfo(comMachine));
+}
+
+void UIMessageCenter::cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */)
+{
+    error(pParent, MessageType_Error,
+          tr("Failed to delete console connection for cloud machine <b>%1</b>.")
+             .arg(strMachineName),
+          UIErrorString::formatErrorInfo(comProgress));
+}
+
+void UIMessageCenter::publicKeyFilePathIsEmpty(QWidget *pParent /* = 0 */) const
+{
+    alert(pParent, MessageType_Error,
+          tr("Public key file path is empty."));
+}
+
+void UIMessageCenter::publicKeyFileIsntReadable(const QString &strPath, QWidget *pParent /* = 0 */) const
 {
     alert(pParent, MessageType_Error,
           tr("Failed to open the public key file <nobr><b>%1</b></nobr>. Check file permissions.")
              .arg(strPath));
-}
-
-void UIMessageCenter::cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */)
-{
-    error(pParent, MessageType_Error,
-          tr("Failed to create console connection for cloud machine <b>%1</b>.")
-             .arg(CCloudMachine(comMachine).GetName()),
-          UIErrorString::formatErrorInfo(comMachine));
-}
-
-void UIMessageCenter::cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */)
-{
-    error(pParent, MessageType_Error,
-          tr("Failed to create console connection for cloud machine <b>%1</b>.")
-             .arg(strMachineName),
-          UIErrorString::formatErrorInfo(comProgress));
-}
-
-void UIMessageCenter::cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent /* = 0 */)
-{
-    error(pParent, MessageType_Error,
-          tr("Failed to delete console connection for cloud machine <b>%1</b>.")
-             .arg(CCloudMachine(comMachine).GetName()),
-          UIErrorString::formatErrorInfo(comMachine));
-}
-
-void UIMessageCenter::cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent /* = 0 */)
-{
-    error(pParent, MessageType_Error,
-          tr("Failed to delete console connection for cloud machine <b>%1</b>.")
-             .arg(strMachineName),
-          UIErrorString::formatErrorInfo(comProgress));
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 86844)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h	(revision 86845)
@@ -305,9 +305,10 @@
     void cannotMoveMachine(const CMachine &machine, QWidget *pParent = 0) const;
     void cannotMoveMachine(const CProgress &progress, const QString &strMachineName, QWidget *pParent = 0) const;
-    void cannotOpenPublicKeyFile(const QString &strPath, QWidget *pParent = 0) const;
     void cannotCreateConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent = 0);
     void cannotCreateConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0);
     void cannotDeleteConsoleConnection(const CCloudMachine &comMachine, QWidget *pParent = 0);
     void cannotDeleteConsoleConnection(const CProgress &comProgress, const QString &strMachineName, QWidget *pParent = 0);
+    void publicKeyFilePathIsEmpty(QWidget *pParent = 0) const;
+    void publicKeyFileIsntReadable(const QString &strPath, QWidget *pParent = 0) const;
 
     /* API: Snapshot warnings: */
Index: /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 86844)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp	(revision 86845)
@@ -136,6 +136,7 @@
     void prepare();
 
-    /** Loads file contents. */
-    void loadFileContents(const QString &strPath, bool fIgnoreErrors = false);
+    /** Loads file contents.
+      * @returns Whether file was really loaded. */
+    bool loadFileContents(const QString &strPath, bool fIgnoreErrors = false);
 
     /** Holds the text-editor instance. */
@@ -235,13 +236,26 @@
 }
 
-void UIAcquirePublicKeyDialog::loadFileContents(const QString &strPath, bool fIgnoreErrors /* = false */)
-{
+bool UIAcquirePublicKeyDialog::loadFileContents(const QString &strPath, bool fIgnoreErrors /* = false */)
+{
+    /* Make sure file path isn't empty: */
     if (strPath.isEmpty())
-        return;
+    {
+        if (!fIgnoreErrors)
+            msgCenter().publicKeyFilePathIsEmpty();
+        return false;
+    }
+
+    /* Make sure file can be opened: */
     QFile file(strPath);
-    if (file.open(QIODevice::ReadOnly))
-        m_pTextEditor->setPlainText(file.readAll());
-    else if (!fIgnoreErrors)
-        msgCenter().cannotOpenPublicKeyFile(strPath);
+    if (!file.open(QIODevice::ReadOnly))
+    {
+        if (!fIgnoreErrors)
+            msgCenter().publicKeyFileIsntReadable(strPath);
+        return false;
+    }
+
+    /* File opened and read, filling editor: */
+    m_pTextEditor->setPlainText(file.readAll());
+    return true;
 }
 
