Index: trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc	(revision 79247)
+++ trunk/src/VBox/Frontends/VirtualBox/VirtualBox_xml.qrc	(revision 79248)
@@ -5,4 +5,5 @@
         <file alias="us_international.xml">xml/us_international.xml</file>
         <file alias="german.xml">xml/german.xml</file>
+        <file alias="us.xml">xml/us.xml</file>
     </qresource>
 </RCC>
Index: trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp	(revision 79247)
+++ trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.cpp	(revision 79248)
@@ -41,4 +41,5 @@
 #include "UIExtraDataManager.h"
 #include "UIIconPool.h"
+#include "UIMessageCenter.h"
 #include "UIModalWindowManager.h"
 #include "UISession.h"
@@ -143,8 +144,9 @@
 private slots:
 
-    void sltKeyBaseCaptionChange();
-    void sltKeyShiftCaptionChange();
-    void sltKeyAltGrCaptionChange();
+    void sltKeyBaseCaptionChange(const QString &strCaption);
+    void sltKeyShiftCaptionChange(const QString &strCaption);
+    void sltKeyAltGrCaptionChange(const QString &strCaption);
     void sltPhysicalLayoutChanged();
+    void sltLayoutNameChanged(const QString &strCaption);
 
 private:
@@ -195,4 +197,5 @@
     void sigSaveLayout();
     void sigCopyLayout();
+    void sigDeleteLayout();
     void sigLayoutSelectionChanged(const QString &strSelectedLayoutName);
     void sigShowLayoutEditor();
@@ -204,4 +207,5 @@
     void setLayoutList(const QStringList &layoutNames);
     void setCurrentLayout(const QString &strLayoutName);
+    void setCurrentLayoutIsEditable(bool fEditable);
 
 protected:
@@ -221,4 +225,5 @@
     QToolButton *m_pCopyLayoutButton;
     QToolButton *m_pSaveLayoutButton;
+    QToolButton *m_pDeleteLayoutButton;
     QLabel      *m_pTitleLabel;
     QToolButton *m_pCloseButton;
@@ -364,22 +369,29 @@
 public:
 
-    UISoftKeyboardLayout(){}
-
-    void setName(const QString &strName)
-    {
-        m_strName = strName;
-    }
-
-    void updateKeyCaptions(int iKeyPosition, KeyCaptions &newCaptions)
-    {
-        if (!m_keyCapMap.contains(iKeyPosition))
-            return;
-        m_keyCapMap[iKeyPosition] = newCaptions;
-    }
-
-    const QString &name() const
-    {
-        return m_strName;
-    }
+    UISoftKeyboardLayout();
+
+    void setName(const QString &strName);
+    const QString &name() const;
+
+    void setSourceFilePath(const QString& strSourceFilePath);
+    const QString& sourceFilePath() const;
+
+    void setIsFromResources(bool fIsFromResources);
+    bool isFromResources() const;
+
+    void updateKeyCaptions(int iKeyPosition, KeyCaptions &newCaptions);
+
+    void setEditable(bool fEditable);
+    bool editable() const;
+
+    void setPhysicalLayoutUuid(const QUuid &uuid);
+    const QUuid &physicalLayoutUuid() const;
+
+    void setKeyCapMap(const QMap<int, KeyCaptions> &keyCapMap);
+    QMap<int, KeyCaptions> &keyCapMap();
+    const QMap<int, KeyCaptions> &keyCapMap() const;
+    bool operator==(const UISoftKeyboardLayout &otherLayout);
+
+private:
 
     /** The UUID of the physical layout used by this layout. */
@@ -390,7 +402,8 @@
     QMap<int, KeyCaptions> m_keyCapMap;
 
-private:
-
     QString m_strName;
+    QString m_strSourceFilePath;
+    bool    m_fEditable;
+    bool    m_fIsFromResources;
 };
 
@@ -432,11 +445,11 @@
     QStringList layoutNameList() const;
     const QVector<UISoftKeyboardPhysicalLayout> &physicalLayouts() const;
-
+    void deleteCurrentLayout();
     void toggleEditMode(bool fIsEditMode);
     /** Is called when the captions in UISoftKeyboardKey is changed and forward this changes to
       * corresponding UISoftKeyboardLayout */
     void updateKeyCaptionsInLayout(UISoftKeyboardKey *pKey);
-    void addLayout(const UISoftKeyboardLayout &newLayout);
     void saveCurentLayoutToFile();
+    void copyCurentLayout();
 
 protected:
@@ -455,6 +468,7 @@
 private:
 
-    void               setNewMinimumSize(const QSize &size);
-    void               setInitialSize(int iWidth, int iHeight);
+    void    addLayout(const UISoftKeyboardLayout &newLayout);
+    void    setNewMinimumSize(const QSize &size);
+    void    setInitialSize(int iWidth, int iHeight);
     /** Searches for the key which contains the position of the @p pEvent and returns it if found. */
     UISoftKeyboardKey *keyUnderMouse(QMouseEvent *pEvent);
@@ -620,4 +634,15 @@
     if (m_pKey == pKey)
         return;
+    /* First apply the pending changes to the key that has been edited: */
+    if (m_pKey)
+    {
+        if (m_pKey->shiftCaption() != m_pShiftCaptionEdit->text())
+            m_pKey->setShiftCaption(m_pShiftCaptionEdit->text());
+        if (m_pKey->baseCaption() != m_pBaseCaptionEdit->text())
+            m_pKey->setBaseCaption(m_pBaseCaptionEdit->text());
+        if (m_pKey->altGrCaption() != m_pAltGrCaptionEdit->text())
+            m_pKey->setAltGrCaption(m_pAltGrCaptionEdit->text());
+    }
+
     m_pKey = pKey;
     if (m_pSelectedKeyGroupBox)
@@ -651,5 +676,5 @@
     if (m_pPhysicalLayoutCombo && m_pLayout)
     {
-        int iIndex = m_pPhysicalLayoutCombo->findData(m_pLayout->m_physicalLayoutUuid);
+        int iIndex = m_pPhysicalLayoutCombo->findData(m_pLayout->physicalLayoutUuid());
         if (iIndex != -1)
             m_pPhysicalLayoutCombo->setCurrentIndex(iIndex);
@@ -693,25 +718,25 @@
 }
 
-void UILayoutEditor::sltKeyBaseCaptionChange()
-{
-    if (!m_pKey || !m_pBaseCaptionEdit)
-        return;
-    m_pKey->setBaseCaption(m_pBaseCaptionEdit->text());
+void UILayoutEditor::sltKeyBaseCaptionChange(const QString &strCaption)
+{
+    if (!m_pKey || m_pKey->baseCaption() == strCaption)
+        return;
+    m_pKey->setBaseCaption(strCaption);
     emit sigKeyCaptionsEdited(m_pKey);
 }
 
-void UILayoutEditor::sltKeyShiftCaptionChange()
-{
-    if (!m_pKey || !m_pShiftCaptionEdit)
-        return;
-    m_pKey->setShiftCaption(m_pShiftCaptionEdit->text());
+void UILayoutEditor::sltKeyShiftCaptionChange(const QString &strCaption)
+{
+    if (!m_pKey || m_pKey->shiftCaption() == strCaption)
+        return;
+    m_pKey->setShiftCaption(strCaption);
     emit sigKeyCaptionsEdited(m_pKey);
 }
 
-void UILayoutEditor::sltKeyAltGrCaptionChange()
-{
-    if (!m_pKey || !m_pAltGrCaptionEdit)
-        return;
-    m_pKey->setAltGrCaption(m_pAltGrCaptionEdit->text());
+void UILayoutEditor::sltKeyAltGrCaptionChange(const QString &strCaption)
+{
+    if (!m_pKey  || m_pKey->altGrCaption() == strCaption)
+        return;
+    m_pKey->setAltGrCaption(strCaption);
     emit sigKeyCaptionsEdited(m_pKey);
 }
@@ -723,5 +748,13 @@
     QUuid currentData = m_pPhysicalLayoutCombo->currentData().toUuid();
     if (!currentData.isNull())
-        m_pLayout->m_physicalLayoutUuid = currentData;
+        m_pLayout->setPhysicalLayoutUuid(currentData);
+    emit sigLayoutEdited();
+}
+
+void UILayoutEditor::sltLayoutNameChanged(const QString &strName)
+{
+    if (!m_pLayout || m_pLayout->name() == strName)
+        return;
+    m_pLayout->setName(strName);
     emit sigLayoutEdited();
 }
@@ -739,5 +772,5 @@
     m_pGoBackButton->setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}");
     m_pEditorLayout->addWidget(m_pGoBackButton, 0, 0, 1, 1);
-    connect(m_pGoBackButton, &QToolButton::pressed, this, &UILayoutEditor::sigGoBackButton);
+    connect(m_pGoBackButton, &QToolButton::clicked, this, &UILayoutEditor::sigGoBackButton);
     pTitleLayout->addWidget(m_pGoBackButton);
     pTitleLayout->addStretch(2);
@@ -752,5 +785,5 @@
     m_pEditorLayout->addWidget(m_pLayoutNameLabel, 2, 0, 1, 1);
     m_pEditorLayout->addWidget(m_pLayoutNameEdit, 2, 1, 1, 1);
-    connect(m_pLayoutNameEdit, &QLineEdit::editingFinished, this, &UILayoutEditor::sigLayoutEdited);
+    connect(m_pLayoutNameEdit, &QLineEdit::textChanged, this, &UILayoutEditor::sltLayoutNameChanged);
 
 
@@ -814,5 +847,5 @@
     pCaptionEditorLayout->addWidget(m_pBaseCaptionLabel, 0, 0);
     pCaptionEditorLayout->addWidget(m_pBaseCaptionEdit, 0, 1);
-    connect(m_pBaseCaptionEdit, &QLineEdit::editingFinished, this, &UILayoutEditor::sltKeyBaseCaptionChange);
+    connect(m_pBaseCaptionEdit, &QLineEdit::textChanged, this, &UILayoutEditor::sltKeyBaseCaptionChange);
 
     m_pShiftCaptionLabel = new QLabel;
@@ -821,5 +854,5 @@
     pCaptionEditorLayout->addWidget(m_pShiftCaptionLabel, 1, 0);
     pCaptionEditorLayout->addWidget(m_pShiftCaptionEdit, 1, 1);
-    connect(m_pShiftCaptionEdit, &QLineEdit::editingFinished, this, &UILayoutEditor::sltKeyShiftCaptionChange);
+    connect(m_pShiftCaptionEdit, &QLineEdit::textChanged, this, &UILayoutEditor::sltKeyShiftCaptionChange);
 
     m_pAltGrCaptionLabel = new QLabel;
@@ -828,5 +861,5 @@
     pCaptionEditorLayout->addWidget(m_pAltGrCaptionLabel, 2, 0);
     pCaptionEditorLayout->addWidget(m_pAltGrCaptionEdit, 2, 1);
-    connect(m_pAltGrCaptionEdit, &QLineEdit::editingFinished, this, &UILayoutEditor::sltKeyAltGrCaptionChange);
+    connect(m_pAltGrCaptionEdit, &QLineEdit::textChanged, this, &UILayoutEditor::sltKeyAltGrCaptionChange);
 
     QSpacerItem *pSpacer = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Expanding);
@@ -863,4 +896,5 @@
     , m_pCopyLayoutButton(0)
     , m_pSaveLayoutButton(0)
+    , m_pDeleteLayoutButton(0)
     , m_pTitleLabel(0)
     , m_pCloseButton(0)
@@ -885,4 +919,14 @@
         return;
     m_pLayoutListWidget->setCurrentItem(pItem);
+}
+
+void UILayoutSelector::setCurrentLayoutIsEditable(bool fEditable)
+{
+    if (m_pEditLayoutButton)
+        m_pEditLayoutButton->setEnabled(fEditable);
+    if (m_pSaveLayoutButton)
+        m_pSaveLayoutButton->setEnabled(fEditable);
+    if (m_pDeleteLayoutButton)
+        m_pDeleteLayoutButton->setEnabled(fEditable);
 }
 
@@ -902,4 +946,6 @@
     if (m_pEditLayoutButton)
         m_pEditLayoutButton->setToolTip(UISoftKeyboard::tr("Edit the selected layout"));
+    if (m_pDeleteLayoutButton)
+        m_pDeleteLayoutButton->setToolTip(UISoftKeyboard::tr("Delete the selected layout"));
     if (m_pCopyLayoutButton)
         m_pCopyLayoutButton->setToolTip(UISoftKeyboard::tr("Copy the selected layout"));
@@ -924,5 +970,5 @@
     m_pCloseButton->setIcon(UIIconPool::defaultIcon(UIIconPool::UIDefaultIconType_DialogCancel));
     m_pCloseButton->setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}");
-    connect(m_pCloseButton, &QToolButton::pressed, this, &UILayoutSelector::sigCloseLayoutList);
+    connect(m_pCloseButton, &QToolButton::clicked, this, &UILayoutSelector::sigCloseLayoutList);
     pTitleLayout->addWidget(m_pCloseButton);
     pTitleLayout->addStretch(2);
@@ -941,16 +987,20 @@
     m_pEditLayoutButton->setIcon(UIIconPool::iconSet(":/keyboard_settings_16px.png"));
     pButtonsLayout->addWidget(m_pEditLayoutButton);
-    connect(m_pEditLayoutButton, &QToolButton::pressed, this, &UILayoutSelector::sigShowLayoutEditor);
+    connect(m_pEditLayoutButton, &QToolButton::clicked, this, &UILayoutSelector::sigShowLayoutEditor);
 
     m_pCopyLayoutButton = new QToolButton;
     m_pCopyLayoutButton->setIcon(UIIconPool::iconSet(":/vm_clone_16px.png"));
     pButtonsLayout->addWidget(m_pCopyLayoutButton);
-    connect(m_pCopyLayoutButton, &QToolButton::pressed, this, &UILayoutSelector::sigCopyLayout);
+    connect(m_pCopyLayoutButton, &QToolButton::clicked, this, &UILayoutSelector::sigCopyLayout);
 
     m_pSaveLayoutButton = new QToolButton;
     m_pSaveLayoutButton->setIcon(UIIconPool::iconSet(":/vm_save_state_16px.png"));
     pButtonsLayout->addWidget(m_pSaveLayoutButton);
-    connect(m_pSaveLayoutButton, &QToolButton::pressed, this, &UILayoutSelector::sigSaveLayout);
-
+    connect(m_pSaveLayoutButton, &QToolButton::clicked, this, &UILayoutSelector::sigSaveLayout);
+
+    m_pDeleteLayoutButton = new QToolButton;
+    m_pDeleteLayoutButton->setIcon(UIIconPool::iconSet(":/file_manager_delete_16px.png"));
+    pButtonsLayout->addWidget(m_pDeleteLayoutButton);
+    connect(m_pDeleteLayoutButton, &QToolButton::clicked, this, &UILayoutSelector::sigDeleteLayout);
 
     pButtonsLayout->addStretch(2);
@@ -1258,4 +1308,102 @@
         m_strText += QString("%1\n").arg(m_strAltGrCaption);
 }
+
+/*********************************************************************************************************************************
+*   UISoftKeyboardLayout implementation.                                                                                  *
+*********************************************************************************************************************************/
+
+UISoftKeyboardLayout::UISoftKeyboardLayout()
+    : m_fEditable(true)
+    , m_fIsFromResources(false)
+{
+}
+
+void UISoftKeyboardLayout::updateKeyCaptions(int iKeyPosition, KeyCaptions &newCaptions)
+{
+    if (!m_keyCapMap.contains(iKeyPosition))
+        return;
+    m_keyCapMap[iKeyPosition] = newCaptions;
+}
+
+void UISoftKeyboardLayout::setSourceFilePath(const QString& strSourceFilePath)
+{
+    m_strSourceFilePath = strSourceFilePath;
+}
+
+const QString& UISoftKeyboardLayout::sourceFilePath() const
+{
+    return m_strSourceFilePath;
+}
+
+void UISoftKeyboardLayout::setIsFromResources(bool fIsFromResources)
+{
+    m_fIsFromResources = fIsFromResources;
+}
+
+bool UISoftKeyboardLayout::isFromResources() const
+{
+    return m_fIsFromResources;
+}
+
+void UISoftKeyboardLayout::setName(const QString &strName)
+{
+    m_strName = strName;
+}
+
+const QString &UISoftKeyboardLayout::name() const
+{
+    return m_strName;
+}
+
+void UISoftKeyboardLayout::setEditable(bool fEditable)
+{
+    m_fEditable = fEditable;
+}
+
+bool UISoftKeyboardLayout::editable() const
+{
+    return m_fEditable;
+}
+
+void UISoftKeyboardLayout::setPhysicalLayoutUuid(const QUuid &uuid)
+{
+    m_physicalLayoutUuid = uuid;
+}
+
+const QUuid &UISoftKeyboardLayout::physicalLayoutUuid() const
+{
+    return m_physicalLayoutUuid;
+}
+
+void UISoftKeyboardLayout::setKeyCapMap(const QMap<int, KeyCaptions> &keyCapMap)
+{
+    m_keyCapMap = keyCapMap;
+}
+
+QMap<int, KeyCaptions> &UISoftKeyboardLayout::keyCapMap()
+{
+    return m_keyCapMap;
+}
+
+const QMap<int, KeyCaptions> &UISoftKeyboardLayout::keyCapMap() const
+{
+    return m_keyCapMap;
+}
+
+bool UISoftKeyboardLayout::operator==(const UISoftKeyboardLayout &otherLayout)
+{
+    if (m_strName != otherLayout.m_strName)
+        return false;
+    if (m_physicalLayoutUuid != otherLayout.m_physicalLayoutUuid)
+        return false;
+    if (m_fEditable != otherLayout.m_fEditable)
+        return false;
+    if (m_strSourceFilePath != otherLayout.m_strSourceFilePath)
+        return false;
+    if (m_fIsFromResources != otherLayout.m_fIsFromResources)
+        return false;
+    return true;
+}
+
 
 /*********************************************************************************************************************************
@@ -1320,5 +1468,5 @@
         return;
 
-    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->m_physicalLayoutUuid);
+    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->physicalLayoutUuid());
     if (!pPhysicalLayout)
         return;
@@ -1385,14 +1533,5 @@
         handleKeyPress(m_pKeyPressed);
     else if (m_enmMode == Mode_LayoutEdit)
-    {
-        /* If the editor is shown already for another key clicking away accepts the entered text: */
-        if (m_pKeyBeingEdited && m_pKeyBeingEdited != m_pKeyUnderMouse)
-        {
-            //printf("farkli %p\n", m_pKeyBeingEdited);
-        }
         setKeyBeingEdited(m_pKeyUnderMouse);
-        // if (m_pKeyBeingEdited && m_pLayoutEditor)
-        //     m_pLayoutEditor->setText(m_pKeyBeingEdited->keyCap());
-    }
     update();
 }
@@ -1430,4 +1569,7 @@
 void UISoftKeyboardWidget::saveCurentLayoutToFile()
 {
+    if (!m_pCurrentKeyboardLayout)
+        return;
+
     QString strHomeFolder = vboxGlobal().homeFolder();
     QDir dir(strHomeFolder);
@@ -1446,5 +1588,6 @@
     dialog.setWindowModality(Qt::WindowModal);
     dialog.setWindowTitle(UISoftKeyboard::tr("Provide a file name"));
-    dialog.setLabelText(QString("%1 %2").arg(UISoftKeyboard::tr("The File will be saved under:\n")).arg(strHomeFolder));
+    dialog.setTextValue(m_pCurrentKeyboardLayout->name());
+    dialog.setLabelText(QString("%1 %2").arg(UISoftKeyboard::tr("The file will be saved under:\n")).arg(strHomeFolder));
     if (dialog.exec() == QDialog::Rejected)
         return;
@@ -1456,8 +1599,5 @@
     }
 
-    if (!m_pCurrentKeyboardLayout)
-        return;
-
-    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->m_physicalLayoutUuid);
+    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->physicalLayoutUuid());
     if (!pPhysicalLayout)
     {
@@ -1471,5 +1611,5 @@
     strFileName = strHomeFolder + QString(QDir::separator()) + strFileName;
     QFile xmlFile(strFileName);
-    if (!xmlFile.open(QIODevice::WriteOnly))
+    if (!xmlFile.open(QIODevice::WriteOnly | QIODevice::Truncate))
     {
         sigStatusBarMessage("The layout file could not be saved");
@@ -1507,6 +1647,56 @@
 
    xmlFile.close();
-
+   m_pCurrentKeyboardLayout->setSourceFilePath(strFileName);
    sigStatusBarMessage(QString("%1 %2").arg(strFileName).arg(UISoftKeyboard::tr(" is saved")));
+}
+
+void UISoftKeyboardWidget::copyCurentLayout()
+{
+    UISoftKeyboardLayout newLayout(*(m_pCurrentKeyboardLayout));
+    QString strNewName = QString("%1-%2").arg(newLayout.name()).arg(tr("Copy"));
+    newLayout.setName(strNewName);
+    newLayout.setEditable(true);
+    newLayout.setIsFromResources(false);
+    newLayout.setSourceFilePath(QString());
+    addLayout(newLayout);
+}
+
+void UISoftKeyboardWidget::deleteCurrentLayout()
+{
+    if (!m_pCurrentKeyboardLayout || !m_pCurrentKeyboardLayout->editable() || m_pCurrentKeyboardLayout->isFromResources())
+        return;
+    /* Make sure we have at least one layout. */
+    if (m_layouts.size() <= 1)
+        return;
+
+    int iIndex = m_layouts.indexOf(*(m_pCurrentKeyboardLayout));
+    if (iIndex == -1)
+        return;
+
+    QDir fileToDelete;
+    QString strFilePath(m_pCurrentKeyboardLayout->sourceFilePath());
+    bool fFileExists = fileToDelete.exists(strFilePath);
+
+    if (fFileExists)
+    {
+        if (!msgCenter().questionBinary(this, MessageType_Question,
+                                        QString(UISoftKeyboard::tr("This will delete the keyboard layout file as well, Proceed?")),
+                                        0 /* auto-confirm id */,
+                                        QString("Delete") /* ok button text */,
+                                        QString() /* cancel button text */,
+                                        false /* ok button by default? */))
+            return;
+    }
+
+    m_layouts.removeAt(iIndex);
+    setCurrentLayout(&(m_layouts[0]));
+    /* It might be that the layout copied but not yet saved into a file: */
+    if (fFileExists)
+    {
+        if (fileToDelete.remove(strFilePath))
+            sigStatusBarMessage(QString("%1 %2 %3").arg(UISoftKeyboard::tr("The file ")).arg(strFilePath).arg(UISoftKeyboard::tr(" has been deleted")));
+        else
+            sigStatusBarMessage(QString("%1 %2 %3").arg(UISoftKeyboard::tr("Deleting the file ")).arg(strFilePath).arg(UISoftKeyboard::tr(" has failed")));
+    }
 }
 
@@ -1547,7 +1737,7 @@
         return;
 
-    if (m_pCurrentKeyboardLayout->m_physicalLayoutUuid == m_physicalLayouts[iIndex].m_uId)
-        return;
-    m_pCurrentKeyboardLayout->m_physicalLayoutUuid = m_physicalLayouts[iIndex].m_uId;
+    if (m_pCurrentKeyboardLayout->physicalLayoutUuid() == m_physicalLayouts[iIndex].m_uId)
+        return;
+    m_pCurrentKeyboardLayout->setPhysicalLayoutUuid(m_physicalLayouts[iIndex].m_uId);
     update();
 }
@@ -1575,5 +1765,5 @@
     if (!m_pCurrentKeyboardLayout)
         return 0;
-    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->m_physicalLayoutUuid);
+    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->physicalLayoutUuid());
     if (!pPhysicalLayout)
         return 0;
@@ -1737,12 +1927,12 @@
 }
 
-bool UISoftKeyboardWidget::loadKeyboardLayout(const QString &strLayoutName)
-{
-    if (strLayoutName.isEmpty())
+bool UISoftKeyboardWidget::loadKeyboardLayout(const QString &strLayoutFileName)
+{
+    if (strLayoutFileName.isEmpty())
         return false;
 
     UIKeyboardLayoutReader keyboardLayoutReader;
 
-    if (!keyboardLayoutReader.parseFile(strLayoutName))
+    if (!keyboardLayoutReader.parseFile(strLayoutFileName))
         return false;
 
@@ -1754,7 +1944,8 @@
     m_layouts.append(UISoftKeyboardLayout());
     UISoftKeyboardLayout &newLayout = m_layouts.back();
-    newLayout.m_physicalLayoutUuid = pPhysicalLayout->m_uId;
+    newLayout.setPhysicalLayoutUuid(pPhysicalLayout->m_uId);
     newLayout.setName(keyboardLayoutReader.name());
-    newLayout.m_keyCapMap = keyboardLayoutReader.keyCapMap();
+    newLayout.setSourceFilePath(strLayoutFileName);
+    newLayout.setKeyCapMap(keyboardLayoutReader.keyCapMap());
     return true;
 }
@@ -1786,5 +1977,16 @@
     QStringList keyboardLayoutNames;
     keyboardLayoutNames << ":/us_international.xml"
-                        <<":/german.xml";
+                        <<":/german.xml"
+                        << ":/us.xml";
+
+    foreach (const QString &strName, keyboardLayoutNames)
+        loadKeyboardLayout(strName);
+    /* Mark the layouts we load from the resources as non-editable: */
+    for (int i = 0; i < m_layouts.size(); ++i)
+    {
+        m_layouts[i].setEditable(false);
+        m_layouts[i].setIsFromResources(true);
+    }
+    keyboardLayoutNames.clear();
     /* Add keyboard layouts from the defalt keyboard layout folder: */
     lookAtDefaultLayoutFolder(keyboardLayoutNames);
@@ -1833,7 +2035,7 @@
     emit sigCurrentLayoutChange();
 
-    const QMap<int, KeyCaptions> &keyCapMap = m_pCurrentKeyboardLayout->m_keyCapMap;
-
-   UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->m_physicalLayoutUuid);
+    const QMap<int, KeyCaptions> &keyCapMap = m_pCurrentKeyboardLayout->keyCapMap();
+
+    UISoftKeyboardPhysicalLayout *pPhysicalLayout = findPhysicalLayout(m_pCurrentKeyboardLayout->physicalLayoutUuid());
     if (!pPhysicalLayout)
         return;
@@ -2214,5 +2416,5 @@
         m_pLayoutListButton->resize(QSize(iIconMetric, iIconMetric));
         m_pLayoutListButton->setStyleSheet("QToolButton { border: 0px none black; margin: 0px 0px 0px 0px; } QToolButton::menu-indicator {image: none;}");
-        connect(m_pLayoutListButton, &QToolButton::pressed, this, &UISoftKeyboardStatusBarWidget::sigShowHideSidePanel);
+        connect(m_pLayoutListButton, &QToolButton::clicked, this, &UISoftKeyboardStatusBarWidget::sigShowHideSidePanel);
         pLayout->addWidget(m_pLayoutListButton);
     }
@@ -2293,6 +2495,9 @@
 void UISoftKeyboard::sltLayoutSelectionChanged(const QString &strLayoutName)
 {
-    if (m_pKeyboardWidget)
-        m_pKeyboardWidget->setCurrentLayout(strLayoutName);
+    if (!m_pKeyboardWidget)
+        return;
+    m_pKeyboardWidget->setCurrentLayout(strLayoutName);
+    if (m_pLayoutSelector && m_pKeyboardWidget->currentLayout())
+        m_pLayoutSelector->setCurrentLayoutIsEditable(m_pKeyboardWidget->currentLayout()->editable());
 }
 
@@ -2306,4 +2511,5 @@
     QString strLayoutName = pCurrentLayout ? pCurrentLayout->name() : QString();
     updateStatusBarMessage(strLayoutName);
+    updateLayoutSelector();
 }
 
@@ -2339,4 +2545,9 @@
     m_pKeyboardWidget->update();
     updateLayoutSelector();
+    UISoftKeyboardLayout *pCurrentLayout = m_pKeyboardWidget->currentLayout();
+
+    /* Update the status bar string: */
+    QString strLayoutName = pCurrentLayout ? pCurrentLayout->name() : QString();
+    updateStatusBarMessage(strLayoutName);
 }
 
@@ -2359,10 +2570,7 @@
 void UISoftKeyboard::sltCopyLayout()
 {
-    if (!m_pKeyboardWidget || !m_pKeyboardWidget->currentLayout())
-        return;
-    UISoftKeyboardLayout newLayout(*(m_pKeyboardWidget->currentLayout()));
-    QString strNewName = QString("%1-%2").arg(newLayout.name()).arg(tr("Copy"));
-    newLayout.setName(strNewName);
-    m_pKeyboardWidget->addLayout(newLayout);
+    if (!m_pKeyboardWidget)
+        return;
+    m_pKeyboardWidget->copyCurentLayout();
     updateLayoutSelector();
 }
@@ -2372,4 +2580,10 @@
     if (m_pKeyboardWidget)
         m_pKeyboardWidget->saveCurentLayoutToFile();
+}
+
+void UISoftKeyboard::sltDeleteLayout()
+{
+    if (m_pKeyboardWidget)
+        m_pKeyboardWidget->deleteCurrentLayout();
 }
 
@@ -2429,4 +2643,5 @@
     connect(m_pLayoutSelector, &UILayoutSelector::sigCloseLayoutList, this, &UISoftKeyboard::sltShowHideSidePanel);
     connect(m_pLayoutSelector, &UILayoutSelector::sigSaveLayout, this, &UISoftKeyboard::sltSaveLayout);
+    connect(m_pLayoutSelector, &UILayoutSelector::sigDeleteLayout, this, &UISoftKeyboard::sltDeleteLayout);
     connect(m_pLayoutSelector, &UILayoutSelector::sigCopyLayout, this, &UISoftKeyboard::sltCopyLayout);
     connect(m_pLayoutEditor, &UILayoutEditor::sigGoBackButton, this, &UISoftKeyboard::sltShowLayoutSelector);
Index: trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h	(revision 79247)
+++ trunk/src/VBox/Frontends/VirtualBox/src/softkeyboard/UISoftKeyboard.h	(revision 79248)
@@ -81,4 +81,5 @@
     void sltCopyLayout();
     void sltSaveLayout();
+    void sltDeleteLayout();
     void sltStatusBarMessage(const QString &strMessage);
 
Index: trunk/src/VBox/Frontends/VirtualBox/xml/us.xml
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/xml/us.xml	(revision 79248)
+++ trunk/src/VBox/Frontends/VirtualBox/xml/us.xml	(revision 79248)
@@ -0,0 +1,527 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<layout>
+    <name>US</name>
+    <physicallayoutid>{368efa94-3744-48c5-9d5a-59c2f15fe5ec}</physicallayoutid>
+    <key>
+        <position>110</position>
+        <basecaption>Esc</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>112</position>
+        <basecaption>F1</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>113</position>
+        <basecaption>F2</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>114</position>
+        <basecaption>F3</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>115</position>
+        <basecaption>F4</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>116</position>
+        <basecaption>F5</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>117</position>
+        <basecaption>F6</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>188</position>
+        <basecaption>F7</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>119</position>
+        <basecaption>F8</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>120</position>
+        <basecaption>F9</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>121</position>
+        <basecaption>F10</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>122</position>
+        <basecaption>F11</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>123</position>
+        <basecaption>F12</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>124</position>
+        <basecaption>Prt Scrn</basecaption>
+        <shiftcaption>Sys Rq</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>125</position>
+        <basecaption>Scroll Lock</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>126</position>
+        <basecaption>Pause Break</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>1</position>
+        <basecaption>`</basecaption>
+        <shiftcaption>~</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>2</position>
+        <basecaption>1</basecaption>
+        <shiftcaption>!</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>3</position>
+        <basecaption>2</basecaption>
+        <shiftcaption>@</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>4</position>
+        <basecaption>3</basecaption>
+        <shiftcaption>#</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>5</position>
+        <basecaption>4</basecaption>
+        <shiftcaption>$</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>6</position>
+        <basecaption>5</basecaption>
+        <shiftcaption>%</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>7</position>
+        <basecaption></basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>8</position>
+        <basecaption>6</basecaption>
+        <shiftcaption>^</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>9</position>
+        <basecaption>7</basecaption>
+        <shiftcaption>&amp;</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>10</position>
+        <basecaption>8</basecaption>
+        <shiftcaption>*</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>11</position>
+        <basecaption>9</basecaption>
+        <shiftcaption>(</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>12</position>
+        <basecaption>0</basecaption>
+        <shiftcaption>)</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>13</position>
+        <basecaption>-</basecaption>
+        <shiftcaption>_</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>15</position>
+        <basecaption>Backspace</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>75</position>
+        <basecaption>Insert</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>80</position>
+        <basecaption>Home</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>85</position>
+        <basecaption>Page Up</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>16</position>
+        <basecaption>Tab</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>17</position>
+        <basecaption>Q</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>18</position>
+        <basecaption>W</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>19</position>
+        <basecaption>E</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>20</position>
+        <basecaption>R</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>21</position>
+        <basecaption>T</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>22</position>
+        <basecaption>Y</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>23</position>
+        <basecaption>U</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>24</position>
+        <basecaption>I</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>25</position>
+        <basecaption>O</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>26</position>
+        <basecaption>P</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>27</position>
+        <basecaption>[</basecaption>
+        <shiftcaption>{</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>28</position>
+        <basecaption>]</basecaption>
+        <shiftcaption>}</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>29</position>
+        <basecaption>\</basecaption>
+        <shiftcaption>|</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>76</position>
+        <basecaption>Delete</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>81</position>
+        <basecaption>End</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>86</position>
+        <basecaption>Page Down</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>30</position>
+        <basecaption>CapsLock</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>31</position>
+        <basecaption>A</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>32</position>
+        <basecaption>S</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>33</position>
+        <basecaption>D</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>34</position>
+        <basecaption>F</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>35</position>
+        <basecaption>G</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>36</position>
+        <basecaption>H</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>37</position>
+        <basecaption>J</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>38</position>
+        <basecaption>K</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>39</position>
+        <basecaption>L</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>40</position>
+        <basecaption>;</basecaption>
+        <shiftcaption>:</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>41</position>
+        <basecaption>'</basecaption>
+        <shiftcaption>&quot;</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>43</position>
+        <basecaption>Enter</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>44</position>
+        <basecaption>Shift</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>46</position>
+        <basecaption>Z</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>47</position>
+        <basecaption>X</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>48</position>
+        <basecaption>C</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>49</position>
+        <basecaption>V</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>50</position>
+        <basecaption>B</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>51</position>
+        <basecaption>N</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>52</position>
+        <basecaption>M</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>53</position>
+        <basecaption>,</basecaption>
+        <shiftcaption>&lt;</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>54</position>
+        <basecaption>.</basecaption>
+        <shiftcaption>&gt;</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>55</position>
+        <basecaption>/</basecaption>
+        <shiftcaption>?</shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>57</position>
+        <basecaption>Shift</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>83</position>
+        <basecaption>↑</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>58</position>
+        <basecaption>Ctrl</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>227</position>
+        <basecaption>OS</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>60</position>
+        <basecaption>Alt</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>61</position>
+        <basecaption></basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>62</position>
+        <basecaption>Alt</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>231</position>
+        <basecaption>OS</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>0</position>
+        <basecaption>Menu</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>64</position>
+        <basecaption>Ctrl</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>79</position>
+        <basecaption>←</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>84</position>
+        <basecaption>↓</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+    <key>
+        <position>89</position>
+        <basecaption>→</basecaption>
+        <shiftcaption></shiftcaption>
+        <altgrcaption></altgrcaption>
+    </key>
+</layout>
