Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 54879)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 54880)
@@ -41,4 +41,5 @@
 CGuestOSType UIMachineSettingsGeneral::guestOSType() const
 {
+    AssertPtrReturn(m_pNameAndSystemEditor, CGuestOSType());
     return m_pNameAndSystemEditor->type();
 }
@@ -46,4 +47,5 @@
 bool UIMachineSettingsGeneral::is64BitOSTypeSelected() const
 {
+    AssertPtrReturn(m_pNameAndSystemEditor, false);
     return m_pNameAndSystemEditor->type().GetIs64Bit();
 }
@@ -52,4 +54,5 @@
 bool UIMachineSettingsGeneral::isWindowsOSTypeSelected() const
 {
+    AssertPtrReturn(m_pNameAndSystemEditor, false);
     return m_pNameAndSystemEditor->type().GetFamilyId() == "Windows";
 }
@@ -80,11 +83,15 @@
     UIDataSettingsMachineGeneral generalData;
 
-    /* Gather general data: */
+    /* 'Basic' tab data: */
     generalData.m_strName = m_machine.GetName();
     generalData.m_strGuestOsTypeId = m_machine.GetOSTypeId();
+
+    /* 'Advanced' tab data: */
     generalData.m_strSnapshotsFolder = m_machine.GetSnapshotFolder();
     generalData.m_strSnapshotsHomeDir = QFileInfo(m_machine.GetSettingsFilePath()).absolutePath();
     generalData.m_clipboardMode = m_machine.GetClipboardMode();
     generalData.m_dndMode = m_machine.GetDnDMode();
+
+    /* 'Description' tab data: */
     generalData.m_strDescription = m_machine.GetDescription();
 
@@ -101,11 +108,20 @@
     const UIDataSettingsMachineGeneral &generalData = m_cache.base();
 
-    /* Load general data to page: */
+    /* 'Basic' tab data: */
+    AssertPtrReturnVoid(m_pNameAndSystemEditor);
     m_pNameAndSystemEditor->setName(generalData.m_strName);
     m_pNameAndSystemEditor->setType(vboxGlobal().vmGuestOSType(generalData.m_strGuestOsTypeId));
+
+    /* 'Advanced' tab data: */
+    AssertPtrReturnVoid(mPsSnapshot);
+    AssertPtrReturnVoid(mCbClipboard);
+    AssertPtrReturnVoid(mCbDragAndDrop);
     mPsSnapshot->setPath(generalData.m_strSnapshotsFolder);
     mPsSnapshot->setHomeDir(generalData.m_strSnapshotsHomeDir);
     mCbClipboard->setCurrentIndex(generalData.m_clipboardMode);
     mCbDragAndDrop->setCurrentIndex(generalData.m_dndMode);
+
+    /* 'Description' tab data: */
+    AssertPtrReturnVoid(mTeDescription);
     mTeDescription->setPlainText(generalData.m_strDescription);
 
@@ -122,10 +138,19 @@
     UIDataSettingsMachineGeneral generalData = m_cache.base();
 
-    /* Gather general data: */
+    /* 'Basic' tab data: */
+    AssertPtrReturnVoid(m_pNameAndSystemEditor);
     generalData.m_strName = m_pNameAndSystemEditor->name();
     generalData.m_strGuestOsTypeId = m_pNameAndSystemEditor->type().GetId();
+
+    /* 'Advanced' tab data: */
+    AssertPtrReturnVoid(mPsSnapshot);
+    AssertPtrReturnVoid(mCbClipboard);
+    AssertPtrReturnVoid(mCbDragAndDrop);
     generalData.m_strSnapshotsFolder = mPsSnapshot->path();
     generalData.m_clipboardMode = (KClipboardMode)mCbClipboard->currentIndex();
     generalData.m_dndMode = (KDnDMode)mCbDragAndDrop->currentIndex();
+
+    /* 'Description' tab data: */
+    AssertPtrReturnVoid(mTeDescription);
     generalData.m_strDescription = mTeDescription->toPlainText().isEmpty() ?
                                    QString::null : mTeDescription->toPlainText();
@@ -146,16 +171,20 @@
         const UIDataSettingsMachineGeneral &generalData = m_cache.data();
 
-        /* Store general data: */
         if (isMachineInValidMode())
         {
-            /* Advanced tab: */
-            m_machine.SetClipboardMode(generalData.m_clipboardMode);
-            m_machine.SetDnDMode(generalData.m_dndMode);
-            /* Description tab: */
-            m_machine.SetDescription(generalData.m_strDescription);
+            /* 'Advanced' tab data: */
+            if (generalData.m_clipboardMode != m_cache.base().m_clipboardMode)
+                m_machine.SetClipboardMode(generalData.m_clipboardMode);
+            if (generalData.m_dndMode != m_cache.base().m_dndMode)
+                m_machine.SetDnDMode(generalData.m_dndMode);
+
+            /* 'Description' tab: */
+            if (generalData.m_strDescription != m_cache.base().m_strDescription)
+                m_machine.SetDescription(generalData.m_strDescription);
         }
+
         if (isMachineOffline())
         {
-            /* Basic tab: Must update long mode CPU feature bit when os type changes. */
+            /* 'Basic' tab data: Must update long mode CPU feature bit when os type changes. */
             if (generalData.m_strGuestOsTypeId != m_cache.base().m_strGuestOsTypeId)
             {
@@ -165,10 +194,15 @@
                 m_machine.SetCPUProperty(KCPUPropertyType_LongMode, newType.GetIs64Bit());
             }
-            /* Advanced tab: */
-            m_machine.SetSnapshotFolder(generalData.m_strSnapshotsFolder);
-            /* Basic (again) tab: */
-            /* VM name must be last as otherwise its VM rename magic can collide with other settings in the config,
+
+            /* 'Advanced' tab data: */
+            if (generalData.m_strSnapshotsFolder != m_cache.base().m_strSnapshotsFolder)
+                m_machine.SetSnapshotFolder(generalData.m_strSnapshotsFolder);
+
+            /* 'Basic' (again) tab data: */
+            /* VM name must be last as otherwise its VM rename magic
+             * can collide with other settings in the config,
              * especially with the snapshot folder: */
-            m_machine.SetName(generalData.m_strName);
+            if (generalData.m_strName != m_cache.base().m_strName)
+                m_machine.SetName(generalData.m_strName);
         }
     }
@@ -212,14 +246,22 @@
 void UIMachineSettingsGeneral::setOrderAfter(QWidget *pWidget)
 {
-    /* Basic tab-order: */
+    /* 'Basic' tab: */
+    AssertPtrReturnVoid(pWidget);
+    AssertPtrReturnVoid(mTwGeneral);
+    AssertPtrReturnVoid(mTwGeneral->focusProxy());
+    AssertPtrReturnVoid(m_pNameAndSystemEditor);
     setTabOrder(pWidget, mTwGeneral->focusProxy());
     setTabOrder(mTwGeneral->focusProxy(), m_pNameAndSystemEditor);
 
-    /* Advanced tab-order: */
+    /* 'Advanced' tab: */
+    AssertPtrReturnVoid(mPsSnapshot);
+    AssertPtrReturnVoid(mCbClipboard);
+    AssertPtrReturnVoid(mCbDragAndDrop);
     setTabOrder(m_pNameAndSystemEditor, mPsSnapshot);
     setTabOrder(mPsSnapshot, mCbClipboard);
     setTabOrder(mCbClipboard, mCbDragAndDrop);
 
-    /* Description tab-order: */
+    /* 'Description' tab: */
+    AssertPtrReturnVoid(mTeDescription);
     setTabOrder(mCbDragAndDrop, mTeDescription);
 }
@@ -231,8 +273,10 @@
 
     /* Translate path selector: */
+    AssertPtrReturnVoid(mPsSnapshot);
     mPsSnapshot->setWhatsThis(tr("Holds the path where snapshots of this "
                                  "virtual machine will be stored. Be aware that "
                                  "snapshots can take quite a lot of disk space."));
     /* Translate Shared Clipboard mode combo: */
+    AssertPtrReturnVoid(mCbClipboard);
     mCbClipboard->setItemText(0, gpConverter->toString(KClipboardMode_Disabled));
     mCbClipboard->setItemText(1, gpConverter->toString(KClipboardMode_HostToGuest));
@@ -240,4 +284,5 @@
     mCbClipboard->setItemText(3, gpConverter->toString(KClipboardMode_Bidirectional));
     /* Translate Drag'n'drop mode combo: */
+    AssertPtrReturnVoid(mCbDragAndDrop);
     mCbDragAndDrop->setItemText(0, gpConverter->toString(KDnDMode_Disabled));
     mCbDragAndDrop->setItemText(1, gpConverter->toString(KDnDMode_HostToGuest));
@@ -251,11 +296,11 @@
     Ui::UIMachineSettingsGeneral::setupUi(this);
 
-    /* Prepare pages: */
-    preparePageBasic();
-    preparePageAdvanced();
-    preparePageDescription();
-}
-
-void UIMachineSettingsGeneral::preparePageBasic()
+    /* Prepare tabs: */
+    prepareTabBasic();
+    prepareTabAdvanced();
+    prepareTabDescription();
+}
+
+void UIMachineSettingsGeneral::prepareTabBasic()
 {
     /* Name and OS Type widget was created in the .ui file: */
@@ -269,5 +314,5 @@
 }
 
-void UIMachineSettingsGeneral::preparePageAdvanced()
+void UIMachineSettingsGeneral::prepareTabAdvanced()
 {
     /* Shared Clipboard mode combo was created in the .ui file: */
@@ -275,8 +320,8 @@
     {
         /* Configure Shared Clipboard mode combo: */
-        mCbClipboard->addItem (""); /* KClipboardMode_Disabled */
-        mCbClipboard->addItem (""); /* KClipboardMode_HostToGuest */
-        mCbClipboard->addItem (""); /* KClipboardMode_GuestToHost */
-        mCbClipboard->addItem (""); /* KClipboardMode_Bidirectional */
+        mCbClipboard->addItem(""); /* KClipboardMode_Disabled */
+        mCbClipboard->addItem(""); /* KClipboardMode_HostToGuest */
+        mCbClipboard->addItem(""); /* KClipboardMode_GuestToHost */
+        mCbClipboard->addItem(""); /* KClipboardMode_Bidirectional */
     }
     /* Drag&drop mode combo was created in the .ui file: */
@@ -284,12 +329,12 @@
     {
         /* Configure Drag&drop mode combo: */
-        mCbDragAndDrop->addItem (""); /* KDnDMode_Disabled */
-        mCbDragAndDrop->addItem (""); /* KDnDMode_HostToGuest */
-        mCbDragAndDrop->addItem (""); /* KDnDMode_GuestToHost */
-        mCbDragAndDrop->addItem (""); /* KDnDMode_Bidirectional */
-    }
-}
-
-void UIMachineSettingsGeneral::preparePageDescription()
+        mCbDragAndDrop->addItem(""); /* KDnDMode_Disabled */
+        mCbDragAndDrop->addItem(""); /* KDnDMode_HostToGuest */
+        mCbDragAndDrop->addItem(""); /* KDnDMode_GuestToHost */
+        mCbDragAndDrop->addItem(""); /* KDnDMode_Bidirectional */
+    }
+}
+
+void UIMachineSettingsGeneral::prepareTabDescription()
 {
     /* Description text editor was created in the .ui file: */
@@ -305,7 +350,15 @@
 void UIMachineSettingsGeneral::polishPage()
 {
-    /* Basic tab: */
+    /* 'Basic' tab: */
+    AssertPtrReturnVoid(m_pNameAndSystemEditor);
     m_pNameAndSystemEditor->setEnabled(isMachineOffline());
-    /* Advanced tab: */
+
+    /* 'Advanced' tab: */
+    AssertPtrReturnVoid(mLbSnapshot);
+    AssertPtrReturnVoid(mPsSnapshot);
+    AssertPtrReturnVoid(mLbClipboard);
+    AssertPtrReturnVoid(mCbClipboard);
+    AssertPtrReturnVoid(mLbDragAndDrop);
+    AssertPtrReturnVoid(mCbDragAndDrop);
     mLbSnapshot->setEnabled(isMachineOffline());
     mPsSnapshot->setEnabled(isMachineOffline());
@@ -314,4 +367,8 @@
     mLbDragAndDrop->setEnabled(isMachineInValidMode());
     mCbDragAndDrop->setEnabled(isMachineInValidMode());
-}
-
+
+    /* 'Description' tab: */
+    AssertPtrReturnVoid(mTeDescription);
+    mTeDescription->setEnabled(isMachineInValidMode());
+}
+
Index: /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h	(revision 54879)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h	(revision 54880)
@@ -33,5 +33,6 @@
         , m_clipboardMode(KClipboardMode_Disabled)
         , m_dndMode(KDnDMode_Disabled)
-        , m_strDescription(QString()) {}
+        , m_strDescription(QString())
+    {}
 
     /** Returns whether passed @a other is equal to this. */
@@ -61,5 +62,4 @@
     /** Holds the default VM snapshot folder. */
     QString m_strSnapshotsHomeDir;
-
     /** Holds the VM shared clipboard mode. */
     KClipboardMode m_clipboardMode;
@@ -127,10 +127,10 @@
     /** Prepare routine. */
     void prepare();
-    /** Prepare 'Basic' page routine. */
-    void preparePageBasic();
-    /** Prepare 'Advanced' page routine. */
-    void preparePageAdvanced();
-    /** Prepare 'Description' page routine. */
-    void preparePageDescription();
+    /** Prepare 'Basic' tab routine. */
+    void prepareTabBasic();
+    /** Prepare 'Advanced' tab routine. */
+    void prepareTabAdvanced();
+    /** Prepare 'Description' tab routine. */
+    void prepareTabDescription();
 
     /** Polish routine. */
