Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp	(revision 64688)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.cpp	(revision 64689)
@@ -21,24 +21,22 @@
 
 /* Qt includes: */
-# include <QItemDelegate>
-# include <QSortFilterProxyModel>
+# include <QComboBox>
+# include <QDir>
+# include <QCheckBox>
 # include <QHeaderView>
+# include <QLabel>
 # include <QLineEdit>
 # include <QSpinBox>
-# include <QComboBox>
-# include <QDir>
+# include <QTextEdit>
 # include <QTreeView>
-# include <QCheckBox>
-# include <QLabel>
-# include <QTextEdit>
 
 /* GUI includes: */
+# include "VBoxGlobal.h"
+# include "VBoxOSTypeSelectorButton.h"
 # include "UIApplianceEditorWidget.h"
-# include "VBoxGlobal.h"
-# include "UIMessageCenter.h"
-# include "VBoxOSTypeSelectorButton.h"
-# include "UILineTextEdit.h"
 # include "UIConverter.h"
 # include "UIIconPool.h"
+# include "UILineTextEdit.h"
+# include "UIMessageCenter.h"
 
 /* COM includes: */
@@ -59,4 +57,7 @@
     virtual ~ModelItem();
 
+    /** Returns the item type. */
+    ApplianceModelItemType type() const { return m_type; }
+
     /** Returns the parent of the item. */
     ModelItem *parent() const { return m_pParentItem; }
@@ -77,12 +78,15 @@
     /** Returns the item flags for the given @a column. */
     virtual Qt::ItemFlags itemFlags(int /* column */) const { return 0; }
+
     /** Defines the @a role data for the item at @a column to @a value. */
     virtual bool setData(int /* column */, const QVariant & /* value */, int /* role */) { return false; }
     /** Returns the data stored under the given @a role for the item referred to by the @a column. */
     virtual QVariant data(int /* column */, int /* role */) const { return QVariant(); }
+
     /** Returns the widget used to edit the item specified by @a idx for editing.
       * @param  pParent      Brings the parent to be assigned for newly created editor.
       * @param  styleOption  Bring the style option set for the newly created editor. */
     virtual QWidget *createEditor(QWidget * /* pParent */, const QStyleOptionViewItem & /* styleOption */, const QModelIndex & /* idx */) const { return NULL; }
+
     /** Defines the contents of the given @a pEditor to the data for the item at the given @a idx. */
     virtual bool setEditorData(QWidget * /* pEditor */, const QModelIndex & /* idx */) const { return false; }
@@ -92,9 +96,7 @@
     /** Restores the default values. */
     virtual void restoreDefaults() {}
+
     /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */
     virtual void putBack(QVector<BOOL>& finalStates, QVector<QString>& finalValues, QVector<QString>& finalExtraValues);
-
-    /** Returns the item type. */
-    ApplianceModelItemType type() const { return m_type; }
 
 protected:
@@ -138,6 +140,4 @@
 {
     friend class VirtualSystemSortProxyModel;
-
-public:
 
     /** Data roles. */
@@ -147,4 +147,6 @@
         ModifiedRole
     };
+
+public:
 
     /** Constructs item passing @a number and @a pParent to the base-class.
@@ -162,6 +164,6 @@
                  ModelItem *pParent);
 
-    /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */
-    virtual void putBack(QVector<BOOL>& finalStates, QVector<QString>& finalValues, QVector<QString>& finalExtraValues);
+    /** Returns the item flags for the given @a column. */
+    virtual Qt::ItemFlags itemFlags(int column) const;
 
     /** Defines the @a role data for the item at @a column to @a value. */
@@ -170,11 +172,9 @@
     virtual QVariant data(int column, int role) const;
 
-    /** Returns the item flags for the given @a column. */
-    virtual Qt::ItemFlags itemFlags(int column) const;
-
     /** Returns the widget used to edit the item specified by @a idx for editing.
       * @param  pParent      Brings the parent to be assigned for newly created editor.
       * @param  styleOption  Bring the style option set for the newly created editor. */
     virtual QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
+
     /** Defines the contents of the given @a pEditor to the data for the item at the given @a idx. */
     virtual bool setEditorData(QWidget *pEditor, const QModelIndex &idx) const;
@@ -183,9 +183,8 @@
 
     /** Restores the default values. */
-    virtual void restoreDefaults()
-    {
-        m_strConfigValue = m_strConfigDefaultValue;
-        m_checkState = Qt::Checked;
-    }
+    virtual void restoreDefaults();
+
+    /** Cache currently stored values, such as @a finalStates, @a finalValues and @a finalExtraValues. */
+    virtual void putBack(QVector<BOOL>& finalStates, QVector<QString>& finalValues, QVector<QString>& finalExtraValues);
 
 private:
@@ -312,210 +311,5 @@
   , m_checkState(Qt::Checked)
   , m_fModified(false)
-{}
-
-void HardwareItem::putBack(QVector<BOOL>& finalStates, QVector<QString>& finalValues, QVector<QString>& finalExtraValues)
-{
-    finalStates[m_number]      = m_checkState == Qt::Checked;
-    finalValues[m_number]      = m_strConfigValue;
-    finalExtraValues[m_number] = m_strExtraConfigValue;
-    ModelItem::putBack(finalStates, finalValues, finalExtraValues);
-}
-
-bool HardwareItem::setData(int column, const QVariant &value, int role)
-{
-    bool fDone = false;
-    switch (role)
-    {
-        case Qt::CheckStateRole:
-        {
-            if (column == ApplianceViewSection_ConfigValue &&
-                (m_type == KVirtualSystemDescriptionType_Floppy ||
-                 m_type == KVirtualSystemDescriptionType_CDROM ||
-                 m_type == KVirtualSystemDescriptionType_USBController ||
-                 m_type == KVirtualSystemDescriptionType_SoundCard ||
-                 m_type == KVirtualSystemDescriptionType_NetworkAdapter))
-            {
-                m_checkState = static_cast<Qt::CheckState>(value.toInt());
-                fDone = true;
-            }
-            break;
-        }
-        case Qt::EditRole:
-        {
-            if (column == ApplianceViewSection_OriginalValue)
-                m_strOrigValue = value.toString();
-            else if (column == ApplianceViewSection_ConfigValue)
-                m_strConfigValue = value.toString();
-            break;
-        }
-        default: break;
-    }
-    return fDone;
-}
-
-QVariant HardwareItem::data(int column, int role) const
-{
-    QVariant v;
-    switch (role)
-    {
-        case Qt::EditRole:
-        {
-            if (column == ApplianceViewSection_OriginalValue)
-                v = m_strOrigValue;
-            else if (column == ApplianceViewSection_ConfigValue)
-                v = m_strConfigValue;
-            break;
-        }
-        case Qt::DisplayRole:
-        {
-            if (column == ApplianceViewSection_Description)
-            {
-                switch (m_type)
-                {
-                    case KVirtualSystemDescriptionType_Name:                   v = UIApplianceEditorWidget::tr("Name"); break;
-                    case KVirtualSystemDescriptionType_Product:                v = UIApplianceEditorWidget::tr("Product"); break;
-                    case KVirtualSystemDescriptionType_ProductUrl:             v = UIApplianceEditorWidget::tr("Product-URL"); break;
-                    case KVirtualSystemDescriptionType_Vendor:                 v = UIApplianceEditorWidget::tr("Vendor"); break;
-                    case KVirtualSystemDescriptionType_VendorUrl:              v = UIApplianceEditorWidget::tr("Vendor-URL"); break;
-                    case KVirtualSystemDescriptionType_Version:                v = UIApplianceEditorWidget::tr("Version"); break;
-                    case KVirtualSystemDescriptionType_Description:            v = UIApplianceEditorWidget::tr("Description"); break;
-                    case KVirtualSystemDescriptionType_License:                v = UIApplianceEditorWidget::tr("License"); break;
-                    case KVirtualSystemDescriptionType_OS:                     v = UIApplianceEditorWidget::tr("Guest OS Type"); break;
-                    case KVirtualSystemDescriptionType_CPU:                    v = UIApplianceEditorWidget::tr("CPU"); break;
-                    case KVirtualSystemDescriptionType_Memory:                 v = UIApplianceEditorWidget::tr("RAM"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerIDE:  v = UIApplianceEditorWidget::tr("Storage Controller (IDE)"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIApplianceEditorWidget::tr("Storage Controller (SATA)"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIApplianceEditorWidget::tr("Storage Controller (SCSI)"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerSAS:  v = UIApplianceEditorWidget::tr("Storage Controller (SAS)"); break;
-                    case KVirtualSystemDescriptionType_CDROM:                  v = UIApplianceEditorWidget::tr("DVD"); break;
-                    case KVirtualSystemDescriptionType_Floppy:                 v = UIApplianceEditorWidget::tr("Floppy"); break;
-                    case KVirtualSystemDescriptionType_NetworkAdapter:         v = UIApplianceEditorWidget::tr("Network Adapter"); break;
-                    case KVirtualSystemDescriptionType_USBController:          v = UIApplianceEditorWidget::tr("USB Controller"); break;
-                    case KVirtualSystemDescriptionType_SoundCard:              v = UIApplianceEditorWidget::tr("Sound Card"); break;
-                    case KVirtualSystemDescriptionType_HardDiskImage:          v = UIApplianceEditorWidget::tr("Virtual Disk Image"); break;
-                    default:                                                   v = UIApplianceEditorWidget::tr("Unknown Hardware Item"); break;
-                }
-            }
-            else if (column == ApplianceViewSection_OriginalValue)
-                v = m_strOrigValue;
-            else if (column == ApplianceViewSection_ConfigValue)
-            {
-                switch (m_type)
-                {
-                    case KVirtualSystemDescriptionType_Description:
-                    case KVirtualSystemDescriptionType_License:
-                    {
-                        /* Shorten the big text if there is more than
-                         * one line */
-                        QString tmp(m_strConfigValue);
-                        int i = tmp.indexOf('\n');
-                        if (i > -1)
-                            tmp.replace(i, tmp.length(), "...");
-                        v = tmp; break;
-                    }
-                    case KVirtualSystemDescriptionType_OS:             v = vboxGlobal().vmGuestOSTypeDescription(m_strConfigValue); break;
-                    case KVirtualSystemDescriptionType_Memory:         v = m_strConfigValue + " " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes"); break;
-                    case KVirtualSystemDescriptionType_SoundCard:      v = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break;
-                    case KVirtualSystemDescriptionType_NetworkAdapter: v = gpConverter->toString(static_cast<KNetworkAdapterType>(m_strConfigValue.toInt())); break;
-                    default:                                           v = m_strConfigValue; break;
-                }
-            }
-            break;
-        }
-        case Qt::ToolTipRole:
-        {
-            if (column == ApplianceViewSection_ConfigValue)
-            {
-                if (!m_strOrigValue.isEmpty())
-                    v = UIApplianceEditorWidget::tr("<b>Original Value:</b> %1").arg(m_strOrigValue);
-            }
-            break;
-        }
-        case Qt::DecorationRole:
-        {
-            if (column == ApplianceViewSection_Description)
-            {
-                switch (m_type)
-                {
-                    case KVirtualSystemDescriptionType_Name:                   v = UIIconPool::iconSet(":/name_16px.png"); break;
-                    case KVirtualSystemDescriptionType_Product:
-                    case KVirtualSystemDescriptionType_ProductUrl:
-                    case KVirtualSystemDescriptionType_Vendor:
-                    case KVirtualSystemDescriptionType_VendorUrl:
-                    case KVirtualSystemDescriptionType_Version:
-                    case KVirtualSystemDescriptionType_Description:
-                    case KVirtualSystemDescriptionType_License:                v = UIIconPool::iconSet(":/description_16px.png"); break;
-                    case KVirtualSystemDescriptionType_OS:                     v = UIIconPool::iconSet(":/os_type_16px.png"); break;
-                    case KVirtualSystemDescriptionType_CPU:                    v = UIIconPool::iconSet(":/cpu_16px.png"); break;
-                    case KVirtualSystemDescriptionType_Memory:                 v = UIIconPool::iconSet(":/ram_16px.png"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerIDE:  v = UIIconPool::iconSet(":/ide_16px.png"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIIconPool::iconSet(":/sata_16px.png"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIIconPool::iconSet(":/scsi_16px.png"); break;
-                    case KVirtualSystemDescriptionType_HardDiskControllerSAS:  v = UIIconPool::iconSet(":/scsi_16px.png"); break;
-                    case KVirtualSystemDescriptionType_HardDiskImage:          v = UIIconPool::iconSet(":/hd_16px.png"); break;
-                    case KVirtualSystemDescriptionType_CDROM:                  v = UIIconPool::iconSet(":/cd_16px.png"); break;
-                    case KVirtualSystemDescriptionType_Floppy:                 v = UIIconPool::iconSet(":/fd_16px.png"); break;
-                    case KVirtualSystemDescriptionType_NetworkAdapter:         v = UIIconPool::iconSet(":/nw_16px.png"); break;
-                    case KVirtualSystemDescriptionType_USBController:          v = UIIconPool::iconSet(":/usb_16px.png"); break;
-                    case KVirtualSystemDescriptionType_SoundCard:              v = UIIconPool::iconSet(":/sound_16px.png"); break;
-                    default: break;
-                }
-            }
-            else if (column == ApplianceViewSection_ConfigValue &&
-                     m_type == KVirtualSystemDescriptionType_OS)
-            {
-                const QStyle *pStyle = QApplication::style();
-                const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
-                v = vboxGlobal().vmGuestOSTypeIcon(m_strConfigValue).scaledToHeight(iIconMetric, Qt::SmoothTransformation);
-            }
-            break;
-        }
-        case Qt::FontRole:
-        {
-            /* If the item is unchecked mark it with italic text. */
-            if (column == ApplianceViewSection_ConfigValue &&
-                m_checkState == Qt::Unchecked)
-            {
-                QFont font = qApp->font();
-                font.setItalic(true);
-                v = font;
-            }
-            break;
-        }
-        case Qt::ForegroundRole:
-        {
-            /* If the item is unchecked mark it with gray text. */
-            if (column == ApplianceViewSection_ConfigValue &&
-                m_checkState == Qt::Unchecked)
-            {
-                QPalette pal = qApp->palette();
-                v = pal.brush(QPalette::Disabled, QPalette::WindowText);
-            }
-            break;
-        }
-        case Qt::CheckStateRole:
-        {
-            if (column == ApplianceViewSection_ConfigValue &&
-                (m_type == KVirtualSystemDescriptionType_Floppy ||
-                 m_type == KVirtualSystemDescriptionType_CDROM ||
-                 m_type == KVirtualSystemDescriptionType_USBController ||
-                 m_type == KVirtualSystemDescriptionType_SoundCard ||
-                 m_type == KVirtualSystemDescriptionType_NetworkAdapter))
-                v = m_checkState;
-            break;
-        }
-        case HardwareItem::TypeRole:
-        {
-            v = m_type;
-            break;
-        }
-        case HardwareItem::ModifiedRole:
-        {
-            if (column == ApplianceViewSection_ConfigValue)
-                v = m_fModified;
-            break;
-        }
-    }
-    return v;
+{
 }
 
@@ -554,4 +348,202 @@
 }
 
+bool HardwareItem::setData(int column, const QVariant &value, int role)
+{
+    bool fDone = false;
+    switch (role)
+    {
+        case Qt::CheckStateRole:
+        {
+            if (column == ApplianceViewSection_ConfigValue &&
+                (m_type == KVirtualSystemDescriptionType_Floppy ||
+                 m_type == KVirtualSystemDescriptionType_CDROM ||
+                 m_type == KVirtualSystemDescriptionType_USBController ||
+                 m_type == KVirtualSystemDescriptionType_SoundCard ||
+                 m_type == KVirtualSystemDescriptionType_NetworkAdapter))
+            {
+                m_checkState = static_cast<Qt::CheckState>(value.toInt());
+                fDone = true;
+            }
+            break;
+        }
+        case Qt::EditRole:
+        {
+            if (column == ApplianceViewSection_OriginalValue)
+                m_strOrigValue = value.toString();
+            else if (column == ApplianceViewSection_ConfigValue)
+                m_strConfigValue = value.toString();
+            break;
+        }
+        default: break;
+    }
+    return fDone;
+}
+
+QVariant HardwareItem::data(int column, int role) const
+{
+    QVariant v;
+    switch (role)
+    {
+        case Qt::EditRole:
+        {
+            if (column == ApplianceViewSection_OriginalValue)
+                v = m_strOrigValue;
+            else if (column == ApplianceViewSection_ConfigValue)
+                v = m_strConfigValue;
+            break;
+        }
+        case Qt::DisplayRole:
+        {
+            if (column == ApplianceViewSection_Description)
+            {
+                switch (m_type)
+                {
+                    case KVirtualSystemDescriptionType_Name:                   v = UIApplianceEditorWidget::tr("Name"); break;
+                    case KVirtualSystemDescriptionType_Product:                v = UIApplianceEditorWidget::tr("Product"); break;
+                    case KVirtualSystemDescriptionType_ProductUrl:             v = UIApplianceEditorWidget::tr("Product-URL"); break;
+                    case KVirtualSystemDescriptionType_Vendor:                 v = UIApplianceEditorWidget::tr("Vendor"); break;
+                    case KVirtualSystemDescriptionType_VendorUrl:              v = UIApplianceEditorWidget::tr("Vendor-URL"); break;
+                    case KVirtualSystemDescriptionType_Version:                v = UIApplianceEditorWidget::tr("Version"); break;
+                    case KVirtualSystemDescriptionType_Description:            v = UIApplianceEditorWidget::tr("Description"); break;
+                    case KVirtualSystemDescriptionType_License:                v = UIApplianceEditorWidget::tr("License"); break;
+                    case KVirtualSystemDescriptionType_OS:                     v = UIApplianceEditorWidget::tr("Guest OS Type"); break;
+                    case KVirtualSystemDescriptionType_CPU:                    v = UIApplianceEditorWidget::tr("CPU"); break;
+                    case KVirtualSystemDescriptionType_Memory:                 v = UIApplianceEditorWidget::tr("RAM"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerIDE:  v = UIApplianceEditorWidget::tr("Storage Controller (IDE)"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIApplianceEditorWidget::tr("Storage Controller (SATA)"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIApplianceEditorWidget::tr("Storage Controller (SCSI)"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerSAS:  v = UIApplianceEditorWidget::tr("Storage Controller (SAS)"); break;
+                    case KVirtualSystemDescriptionType_CDROM:                  v = UIApplianceEditorWidget::tr("DVD"); break;
+                    case KVirtualSystemDescriptionType_Floppy:                 v = UIApplianceEditorWidget::tr("Floppy"); break;
+                    case KVirtualSystemDescriptionType_NetworkAdapter:         v = UIApplianceEditorWidget::tr("Network Adapter"); break;
+                    case KVirtualSystemDescriptionType_USBController:          v = UIApplianceEditorWidget::tr("USB Controller"); break;
+                    case KVirtualSystemDescriptionType_SoundCard:              v = UIApplianceEditorWidget::tr("Sound Card"); break;
+                    case KVirtualSystemDescriptionType_HardDiskImage:          v = UIApplianceEditorWidget::tr("Virtual Disk Image"); break;
+                    default:                                                   v = UIApplianceEditorWidget::tr("Unknown Hardware Item"); break;
+                }
+            }
+            else if (column == ApplianceViewSection_OriginalValue)
+                v = m_strOrigValue;
+            else if (column == ApplianceViewSection_ConfigValue)
+            {
+                switch (m_type)
+                {
+                    case KVirtualSystemDescriptionType_Description:
+                    case KVirtualSystemDescriptionType_License:
+                    {
+                        /* Shorten the big text if there is more than
+                         * one line */
+                        QString tmp(m_strConfigValue);
+                        int i = tmp.indexOf('\n');
+                        if (i > -1)
+                            tmp.replace(i, tmp.length(), "...");
+                        v = tmp; break;
+                    }
+                    case KVirtualSystemDescriptionType_OS:             v = vboxGlobal().vmGuestOSTypeDescription(m_strConfigValue); break;
+                    case KVirtualSystemDescriptionType_Memory:         v = m_strConfigValue + " " + VBoxGlobal::tr("MB", "size suffix MBytes=1024 KBytes"); break;
+                    case KVirtualSystemDescriptionType_SoundCard:      v = gpConverter->toString(static_cast<KAudioControllerType>(m_strConfigValue.toInt())); break;
+                    case KVirtualSystemDescriptionType_NetworkAdapter: v = gpConverter->toString(static_cast<KNetworkAdapterType>(m_strConfigValue.toInt())); break;
+                    default:                                           v = m_strConfigValue; break;
+                }
+            }
+            break;
+        }
+        case Qt::ToolTipRole:
+        {
+            if (column == ApplianceViewSection_ConfigValue)
+            {
+                if (!m_strOrigValue.isEmpty())
+                    v = UIApplianceEditorWidget::tr("<b>Original Value:</b> %1").arg(m_strOrigValue);
+            }
+            break;
+        }
+        case Qt::DecorationRole:
+        {
+            if (column == ApplianceViewSection_Description)
+            {
+                switch (m_type)
+                {
+                    case KVirtualSystemDescriptionType_Name:                   v = UIIconPool::iconSet(":/name_16px.png"); break;
+                    case KVirtualSystemDescriptionType_Product:
+                    case KVirtualSystemDescriptionType_ProductUrl:
+                    case KVirtualSystemDescriptionType_Vendor:
+                    case KVirtualSystemDescriptionType_VendorUrl:
+                    case KVirtualSystemDescriptionType_Version:
+                    case KVirtualSystemDescriptionType_Description:
+                    case KVirtualSystemDescriptionType_License:                v = UIIconPool::iconSet(":/description_16px.png"); break;
+                    case KVirtualSystemDescriptionType_OS:                     v = UIIconPool::iconSet(":/os_type_16px.png"); break;
+                    case KVirtualSystemDescriptionType_CPU:                    v = UIIconPool::iconSet(":/cpu_16px.png"); break;
+                    case KVirtualSystemDescriptionType_Memory:                 v = UIIconPool::iconSet(":/ram_16px.png"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerIDE:  v = UIIconPool::iconSet(":/ide_16px.png"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerSATA: v = UIIconPool::iconSet(":/sata_16px.png"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerSCSI: v = UIIconPool::iconSet(":/scsi_16px.png"); break;
+                    case KVirtualSystemDescriptionType_HardDiskControllerSAS:  v = UIIconPool::iconSet(":/scsi_16px.png"); break;
+                    case KVirtualSystemDescriptionType_HardDiskImage:          v = UIIconPool::iconSet(":/hd_16px.png"); break;
+                    case KVirtualSystemDescriptionType_CDROM:                  v = UIIconPool::iconSet(":/cd_16px.png"); break;
+                    case KVirtualSystemDescriptionType_Floppy:                 v = UIIconPool::iconSet(":/fd_16px.png"); break;
+                    case KVirtualSystemDescriptionType_NetworkAdapter:         v = UIIconPool::iconSet(":/nw_16px.png"); break;
+                    case KVirtualSystemDescriptionType_USBController:          v = UIIconPool::iconSet(":/usb_16px.png"); break;
+                    case KVirtualSystemDescriptionType_SoundCard:              v = UIIconPool::iconSet(":/sound_16px.png"); break;
+                    default: break;
+                }
+            }
+            else if (column == ApplianceViewSection_ConfigValue &&
+                     m_type == KVirtualSystemDescriptionType_OS)
+            {
+                const QStyle *pStyle = QApplication::style();
+                const int iIconMetric = pStyle->pixelMetric(QStyle::PM_SmallIconSize);
+                v = vboxGlobal().vmGuestOSTypeIcon(m_strConfigValue).scaledToHeight(iIconMetric, Qt::SmoothTransformation);
+            }
+            break;
+        }
+        case Qt::FontRole:
+        {
+            /* If the item is unchecked mark it with italic text. */
+            if (column == ApplianceViewSection_ConfigValue &&
+                m_checkState == Qt::Unchecked)
+            {
+                QFont font = qApp->font();
+                font.setItalic(true);
+                v = font;
+            }
+            break;
+        }
+        case Qt::ForegroundRole:
+        {
+            /* If the item is unchecked mark it with gray text. */
+            if (column == ApplianceViewSection_ConfigValue &&
+                m_checkState == Qt::Unchecked)
+            {
+                QPalette pal = qApp->palette();
+                v = pal.brush(QPalette::Disabled, QPalette::WindowText);
+            }
+            break;
+        }
+        case Qt::CheckStateRole:
+        {
+            if (column == ApplianceViewSection_ConfigValue &&
+                (m_type == KVirtualSystemDescriptionType_Floppy ||
+                 m_type == KVirtualSystemDescriptionType_CDROM ||
+                 m_type == KVirtualSystemDescriptionType_USBController ||
+                 m_type == KVirtualSystemDescriptionType_SoundCard ||
+                 m_type == KVirtualSystemDescriptionType_NetworkAdapter))
+                v = m_checkState;
+            break;
+        }
+        case HardwareItem::TypeRole:
+        {
+            v = m_type;
+            break;
+        }
+        case HardwareItem::ModifiedRole:
+        {
+            if (column == ApplianceViewSection_ConfigValue)
+                v = m_fModified;
+            break;
+        }
+    }
+    return v;
+}
+
 QWidget *HardwareItem::createEditor(QWidget *pParent, const QStyleOptionViewItem & /* styleOption */, const QModelIndex &idx) const
 {
@@ -890,4 +882,18 @@
 }
 
+void HardwareItem::restoreDefaults()
+{
+    m_strConfigValue = m_strConfigDefaultValue;
+    m_checkState = Qt::Checked;
+}
+
+void HardwareItem::putBack(QVector<BOOL>& finalStates, QVector<QString>& finalValues, QVector<QString>& finalExtraValues)
+{
+    finalStates[m_number]      = m_checkState == Qt::Checked;
+    finalValues[m_number]      = m_strConfigValue;
+    finalExtraValues[m_number] = m_strExtraConfigValue;
+    ModelItem::putBack(finalStates, finalValues, finalExtraValues);
+}
+
 
 /*********************************************************************************************************************************
@@ -1019,24 +1025,4 @@
 }
 
-bool VirtualSystemModel::setData(const QModelIndex &idx, const QVariant &value, int role)
-{
-    if (!idx.isValid())
-        return false;
-
-    ModelItem *item = static_cast<ModelItem*>(idx.internalPointer());
-
-    return item->setData(idx.column(), value, role);
-}
-
-QVariant VirtualSystemModel::data(const QModelIndex &idx, int role /* = Qt::DisplayRole */) const
-{
-    if (!idx.isValid())
-        return QVariant();
-
-    ModelItem *item = static_cast<ModelItem*>(idx.internalPointer());
-
-    return item->data(idx.column(), role);
-}
-
 Qt::ItemFlags VirtualSystemModel::flags(const QModelIndex &idx) const
 {
@@ -1062,4 +1048,24 @@
     }
     return title;
+}
+
+bool VirtualSystemModel::setData(const QModelIndex &idx, const QVariant &value, int role)
+{
+    if (!idx.isValid())
+        return false;
+
+    ModelItem *item = static_cast<ModelItem*>(idx.internalPointer());
+
+    return item->setData(idx.column(), value, role);
+}
+
+QVariant VirtualSystemModel::data(const QModelIndex &idx, int role /* = Qt::DisplayRole */) const
+{
+    if (!idx.isValid())
+        return QVariant();
+
+    ModelItem *item = static_cast<ModelItem*>(idx.internalPointer());
+
+    return item->data(idx.column(), role);
 }
 
@@ -1171,4 +1177,16 @@
     if (pEditor)
         pEditor->setGeometry(styleOption.rect);
+}
+
+QSize VirtualSystemDelegate::sizeHint(const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const
+{
+    QSize size = QItemDelegate::sizeHint(styleOption, idx);
+#ifdef VBOX_WS_MAC
+    int h = 28;
+#else
+    int h = 24;
+#endif
+    size.setHeight(RT_MAX(h, size.height()));
+    return size;
 }
 
@@ -1199,5 +1217,5 @@
 *********************************************************************************************************************************/
 
-/* How to sort the items in the tree view */
+/* static */
 KVirtualSystemDescriptionType VirtualSystemSortProxyModel::m_sortList[] =
 {
@@ -1284,4 +1302,5 @@
 *********************************************************************************************************************************/
 
+/* static */
 int UIApplianceEditorWidget::m_minGuestRAM      = -1;
 int UIApplianceEditorWidget::m_maxGuestRAM      = -1;
Index: /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h	(revision 64688)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIApplianceEditorWidget.h	(revision 64689)
@@ -20,6 +20,8 @@
 
 /* Qt includes: */
+#include <QAbstractItemModel>
+#include <QItemDelegate>
 #include <QSortFilterProxyModel>
-#include <QItemDelegate>
+#include <QWidget>
 
 /* GUI includes: */
@@ -32,9 +34,8 @@
 /* Forward declarations: */
 class ModelItem;
-class QWidget;
-class QTreeView;
 class QCheckBox;
 class QLabel;
 class QTextEdit;
+class QTreeView;
 
 
@@ -72,16 +73,19 @@
     /** Returns the parent of the model item with the given @a idx. */
     QModelIndex parent(const QModelIndex &idx) const;
+
     /** Returns the number of rows for the children of the given @a parentIdx. */
     int rowCount(const QModelIndex &parentIdx = QModelIndex()) const;
     /** Returns the number of columns for the children of the given @a parentIdx. */
     int columnCount(const QModelIndex &parentIdx = QModelIndex()) const;
+
+    /** Returns the item flags for the given @a idx. */
+    Qt::ItemFlags flags(const QModelIndex &idx) const;
+    /** Returns the data for the given @a role and @a section in the header with the specified @a orientation. */
+    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
+
     /** Defines the @a role data for the item at @a idx to @a value. */
     bool setData(const QModelIndex &idx, const QVariant &value, int role);
     /** Returns the data stored under the given @a role for the item referred to by the @a idx. */
     QVariant data(const QModelIndex &idx, int role = Qt::DisplayRole) const;
-    /** Returns the item flags for the given @a idx. */
-    Qt::ItemFlags flags(const QModelIndex &idx) const;
-    /** Returns the data for the given @a role and @a section in the header with the specified @a orientation. */
-    QVariant headerData(int section, Qt::Orientation orientation, int role) const;
 
     /** Returns a model index for the buddy of the item represented by @a idx. */
@@ -90,4 +94,5 @@
     /** Restores the default values for the item with the given @a parentIdx. */
     void restoreDefaults(const QModelIndex &parentIdx = QModelIndex());
+
     /** Cache currently stored values. */
     void putBack();
@@ -113,23 +118,15 @@
       * @param  styleOption  Bring the style option set for the newly created editor. */
     QWidget *createEditor(QWidget *pParent, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
+
     /** Defines the contents of the given @a pEditor to the data for the item at the given @a idx. */
     void setEditorData(QWidget *pEditor, const QModelIndex &idx) const;
     /** Defines the data for the item at the given @a idx in the @a pModel to the contents of the given @a pEditor. */
     void setModelData(QWidget *pEditor, QAbstractItemModel *pModel, const QModelIndex &idx) const;
+
     /** Updates the geometry of the @a pEditor for the item with the given @a idx, according to the rectangle specified in the @a styleOption. */
     void updateEditorGeometry(QWidget *pEditor, const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
 
     /** Returns the size hint for the item at the given @a idx and specified @a styleOption. */
-    QSize sizeHint(const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const
-    {
-        QSize size = QItemDelegate::sizeHint(styleOption, idx);
-#ifdef VBOX_WS_MAC
-        int h = 28;
-#else /* VBOX_WS_MAC */
-        int h = 24;
-#endif /* VBOX_WS_MAC */
-        size.setHeight(RT_MAX(h, size.height()));
-        return size;
-    }
+    QSize sizeHint(const QStyleOptionViewItem &styleOption, const QModelIndex &idx) const;
 
 protected:
@@ -138,5 +135,5 @@
     /** Filters @a pEvent if this object has been installed as an event filter for the watched @a pObject. */
     bool eventFilter(QObject *pObject, QEvent *pEvent);
-#endif /* VBOX_WS_MAC */
+#endif
 
 private:
@@ -159,4 +156,5 @@
     /** Returns whether item in the row indicated by the given @a srcRow and @a srcParenIdx should be included in the model. */
     bool filterAcceptsRow(int srcRow, const QModelIndex & srcParenIdx) const;
+
     /** Returns whether value of the item referred to by the given index @a leftIdx is less
       * than the value of the item referred to by the given index @a rightIdx. */
@@ -182,12 +180,12 @@
 
     /** Returns whether the Appliance Editor has valid state. */
-    bool isValid() const          { return m_pAppliance != NULL; }
+    bool isValid() const { return m_pAppliance != NULL; }
     /** Returns the currently set appliance reference. */
     CAppliance* appliance() const { return m_pAppliance; }
 
     /** Returns the minimum guest RAM. */
-    static int minGuestRAM()      { return m_minGuestRAM; }
+    static int minGuestRAM() { return m_minGuestRAM; }
     /** Returns the maximum guest RAM. */
-    static int maxGuestRAM()      { return m_maxGuestRAM; }
+    static int maxGuestRAM() { return m_maxGuestRAM; }
     /** Returns the minimum guest CPU count. */
     static int minGuestCPUCount() { return m_minGuestCPUCount; }
