Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp	(revision 64263)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/global/UIGlobalSettingsInput.cpp	(revision 64264)
@@ -53,17 +53,24 @@
 
 
-/** Global settings / Input page / Cache / Shortcut cache item. */
-struct UIShortcutCacheItem
-{
+/** Global settings / Input page / Shortcut table row. */
+class UIShortcutCacheRow : public QITableViewRow
+{
+    Q_OBJECT;
+
+public:
+
     /** Constructs table row on the basis of passed arguments.
+      * @param  pParent             Brings the row this cell belongs too.
       * @param  strKey              Brings the unique key inentifying held sequence.
       * @param  strDescription      Brings the deescription for the held sequence.
       * @param  strCurrentSequence  Brings the current held sequence.
       * @param  strDefaultSequence  Brings the default held sequence. */
-    UIShortcutCacheItem(const QString &strKey,
-                        const QString &strDescription,
-                        const QString &strCurrentSequence,
-                        const QString &strDefaultSequence)
-        : m_strKey(strKey)
+    UIShortcutCacheRow(QITableView *pParent,
+                       const QString &strKey,
+                       const QString &strDescription,
+                       const QString &strCurrentSequence,
+                       const QString &strDefaultSequence)
+        : QITableViewRow(pParent)
+        , m_strKey(strKey)
         , m_strDescription(strDescription)
         , m_strCurrentSequence(strCurrentSequence)
@@ -72,6 +79,7 @@
 
     /** Constructs table row on the basis of @a other one. */
-    UIShortcutCacheItem(const UIShortcutCacheItem &other)
-        : m_strKey(other.key())
+    UIShortcutCacheRow(const UIShortcutCacheRow &other)
+        : QITableViewRow(other.table())
+        , m_strKey(other.key())
         , m_strDescription(other.description())
         , m_strCurrentSequence(other.currentSequence())
@@ -80,7 +88,8 @@
 
     /** Copies a table row from @a other one. */
-    UIShortcutCacheItem &operator=(const UIShortcutCacheItem &other)
+    UIShortcutCacheRow &operator=(const UIShortcutCacheRow &other)
     {
         /* Reassign variables: */
+        setTable(other.table());
         m_strKey = other.key();
         m_strDescription = other.description();
@@ -93,5 +102,5 @@
 
     /** Returns whether this row equals to @a other. */
-    bool operator==(const UIShortcutCacheItem &other) const
+    bool operator==(const UIShortcutCacheRow &other) const
     {
         /* Compare by the key only: */
@@ -110,4 +119,19 @@
     /** Defines @a strCurrentSequence. */
     void setCurrentSequence(const QString &strCurrentSequence) { m_strCurrentSequence = strCurrentSequence; }
+
+protected:
+
+    /** Returns the number of children. */
+    virtual int childCount() const /* override */
+    {
+        return 0;
+    }
+
+    /** Returns the child item with @a iIndex. */
+    virtual QITableViewCell *childItem(int iIndex) const /* override */
+    {
+        Q_UNUSED(iIndex);
+        return 0;
+    }
 
 private:
@@ -125,5 +149,5 @@
 
 /** Global settings / Input page / Cache / Shortcut cache. */
-typedef QList<UIShortcutCacheItem> UIShortcutCache;
+typedef QList<UIShortcutCacheRow> UIShortcutCache;
 
 
@@ -174,5 +198,5 @@
     /** Returns whether the @a item1 is more/less than the @a item2.
       * @note  Order depends on the one set through constructor, stored in m_order. */
-    bool operator()(const UIShortcutCacheItem &item1, const UIShortcutCacheItem &item2)
+    bool operator()(const UIShortcutCacheRow &item1, const UIShortcutCacheRow &item2)
     {
         switch (m_iColumn)
@@ -288,5 +312,5 @@
 {
     /* Load shortcuts: */
-    foreach (const UIShortcutCacheItem &item, shortcuts)
+    foreach (const UIShortcutCacheRow &item, shortcuts)
     {
         /* Filter out unnecessary shortcuts: */
@@ -306,5 +330,5 @@
 {
     /* Save model items: */
-    foreach (const UIShortcutCacheItem &item, m_shortcuts)
+    foreach (const UIShortcutCacheRow &item, m_shortcuts)
     {
         /* Search for corresponding cache item index: */
@@ -322,5 +346,5 @@
     /* Enumerate all the sequences: */
     QMap<QString, QString> usedSequences;
-    foreach (const UIShortcutCacheItem &item, m_shortcuts)
+    foreach (const UIShortcutCacheRow &item, m_shortcuts)
         if (!item.currentSequence().isEmpty())
             usedSequences.insertMulti(item.currentSequence(), item.key());
@@ -511,5 +535,5 @@
                     int iIndex = index.row();
                     /* Set sequence to shortcut: */
-                    UIShortcutCacheItem &filteredShortcut = m_filteredShortcuts[iIndex];
+                    UIShortcutCacheRow &filteredShortcut = m_filteredShortcuts[iIndex];
                     int iShortcutIndex = m_shortcuts.indexOf(filteredShortcut);
                     if (iShortcutIndex != -1)
@@ -539,9 +563,9 @@
     qStableSort(m_shortcuts.begin(), m_shortcuts.end(), UIShortcutCacheItemFunctor(iColumn, order));
     /* Make sure host-combo item is always the first one: */
-    UIShortcutCacheItem fakeHostComboItem(UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
+    UIShortcutCacheRow fakeHostComboItem(0, UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
     int iIndexOfHostComboItem = m_shortcuts.indexOf(fakeHostComboItem);
     if (iIndexOfHostComboItem != -1)
     {
-        UIShortcutCacheItem hostComboItem = m_shortcuts.takeAt(iIndexOfHostComboItem);
+        UIShortcutCacheRow hostComboItem = m_shortcuts.takeAt(iIndexOfHostComboItem);
         m_shortcuts.prepend(hostComboItem);
     }
@@ -571,5 +595,5 @@
     {
         /* Check if the description matches the filter: */
-        foreach (const UIShortcutCacheItem &item, m_shortcuts)
+        foreach (const UIShortcutCacheRow &item, m_shortcuts)
         {
             /* If neither description nor sequence matches the filter, skip item: */
@@ -747,5 +771,5 @@
 
     /* Load host-combo shortcut to cache: */
-    m_pCache->shortcuts() << UIShortcutCacheItem(UIHostCombo::hostComboCacheKey(), tr("Host Key Combination"),  m_settings.hostCombo(), QString());
+    m_pCache->shortcuts() << UIShortcutCacheRow(m_pMachineTable, UIHostCombo::hostComboCacheKey(), tr("Host Key Combination"),  m_settings.hostCombo(), QString());
     /* Load all other shortcuts to cache: */
     const QMap<QString, UIShortcut>& shortcuts = gShortcutPool->shortcuts();
@@ -754,7 +778,10 @@
     {
         const UIShortcut &shortcut = shortcuts[strShortcutKey];
-        m_pCache->shortcuts() << UIShortcutCacheItem(strShortcutKey, VBoxGlobal::removeAccelMark(shortcut.description()),
-                                                     shortcut.sequence().toString(QKeySequence::NativeText),
-                                                     shortcut.defaultSequence().toString(QKeySequence::NativeText));
+        QITableView *pParent = strShortcutKey.startsWith(GUI_Input_MachineShortcuts) ? m_pMachineTable :
+                               strShortcutKey.startsWith(GUI_Input_SelectorShortcuts) ? m_pSelectorTable : 0;
+        AssertPtr(pParent);
+        m_pCache->shortcuts() << UIShortcutCacheRow(pParent, strShortcutKey, VBoxGlobal::removeAccelMark(shortcut.description()),
+                                                    shortcut.sequence().toString(QKeySequence::NativeText),
+                                                    shortcut.defaultSequence().toString(QKeySequence::NativeText));
     }
     /* Load other things to cache: */
@@ -796,5 +823,5 @@
 
     /* Save host-combo shortcut from cache: */
-    UIShortcutCacheItem fakeHostComboItem(UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
+    UIShortcutCacheRow fakeHostComboItem(0, UIHostCombo::hostComboCacheKey(), QString(), QString(), QString());
     int iIndexOfHostComboItem = m_pCache->shortcuts().indexOf(fakeHostComboItem);
     if (iIndexOfHostComboItem != -1)
@@ -802,5 +829,5 @@
     /* Iterate over cached shortcuts: */
     QMap<QString, QString> sequences;
-    foreach (const UIShortcutCacheItem &item, m_pCache->shortcuts())
+    foreach (const UIShortcutCacheRow &item, m_pCache->shortcuts())
         sequences.insert(item.key(), item.currentSequence());
     /* Save shortcut sequences from cache: */
