Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 54828)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.cpp	(revision 54831)
@@ -5,5 +5,5 @@
 
 /*
- * Copyright (C) 2006-2014 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -19,9 +19,7 @@
 # include <precomp.h>
 #else  /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
 /* Qt includes: */
 # include <QDir>
 # include <QLineEdit>
-
 /* GUI includes: */
 # include "QIWidgetValidator.h"
@@ -29,37 +27,13 @@
 # include "UIMessageCenter.h"
 # include "UIConverter.h"
-
 #endif /* !VBOX_WITH_PRECOMPILED_HEADERS */
-
 
 UIMachineSettingsGeneral::UIMachineSettingsGeneral()
     : m_fHWVirtExEnabled(false)
 {
-    /* Apply UI decorations */
-    Ui::UIMachineSettingsGeneral::setupUi (this);
-
-    /* Setup validators */
-    m_pNameAndSystemEditor->nameEditor()->setValidator(new QRegExpValidator(QRegExp(".+"), this));
-
-    /* Shared Clipboard mode */
-    mCbClipboard->addItem (""); /* KClipboardMode_Disabled */
-    mCbClipboard->addItem (""); /* KClipboardMode_HostToGuest */
-    mCbClipboard->addItem (""); /* KClipboardMode_GuestToHost */
-    mCbClipboard->addItem (""); /* KClipboardMode_Bidirectional */
-
-    /* Drag'n'drop mode */
-    mCbDragAndDrop->addItem (""); /* KDnDMode_Disabled */
-    mCbDragAndDrop->addItem (""); /* KDnDMode_HostToGuest */
-    mCbDragAndDrop->addItem (""); /* KDnDMode_GuestToHost */
-    mCbDragAndDrop->addItem (""); /* KDnDMode_Bidirectional */
-
-#ifdef Q_WS_MAC
-    mTeDescription->setMinimumHeight (150);
-#endif /* Q_WS_MAC */
-
-    /* Prepare validation: */
-    prepareValidation();
-
-    /* Applying language settings */
+    /* Prepare: */
+    prepare();
+
+    /* Translate: */
     retranslateUi();
 }
@@ -69,4 +43,16 @@
     return m_pNameAndSystemEditor->type();
 }
+
+bool UIMachineSettingsGeneral::is64BitOSTypeSelected() const
+{
+    return m_pNameAndSystemEditor->type().GetIs64Bit();
+}
+
+#ifdef VBOX_WITH_VIDEOHWACCEL
+bool UIMachineSettingsGeneral::isWindowsOSTypeSelected() const
+{
+    return m_pNameAndSystemEditor->type().GetFamilyId() == "Windows";
+}
+#endif /* VBOX_WITH_VIDEOHWACCEL */
 
 void UIMachineSettingsGeneral::setHWVirtExEnabled(bool fEnabled)
@@ -83,18 +69,4 @@
 }
 
-bool UIMachineSettingsGeneral::is64BitOSTypeSelected() const
-{
-    return m_pNameAndSystemEditor->type().GetIs64Bit();
-}
-
-#ifdef VBOX_WITH_VIDEOHWACCEL
-bool UIMachineSettingsGeneral::isWindowsOSTypeSelected() const
-{
-    return m_pNameAndSystemEditor->type().GetFamilyId() == "Windows";
-}
-#endif /* VBOX_WITH_VIDEOHWACCEL */
-
-/* Load data to cache from corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
 void UIMachineSettingsGeneral::loadToCacheFrom(QVariant &data)
 {
@@ -124,6 +96,4 @@
 }
 
-/* Load data to corresponding widgets from cache,
- * this task SHOULD be performed in GUI thread only: */
 void UIMachineSettingsGeneral::getFromCache()
 {
@@ -147,6 +117,4 @@
 }
 
-/* Save data from corresponding widgets to cache,
- * this task SHOULD be performed in GUI thread only: */
 void UIMachineSettingsGeneral::putToCache()
 {
@@ -167,6 +135,4 @@
 }
 
-/* Save data from cache to corresponding external object(s),
- * this task COULD be performed in other than GUI thread: */
 void UIMachineSettingsGeneral::saveFromCacheTo(QVariant &data)
 {
@@ -195,10 +161,8 @@
             {
                 m_machine.SetOSTypeId(generalData.m_strGuestOsTypeId);
-
                 CVirtualBox vbox = vboxGlobal().virtualBox();
                 CGuestOSType newType = vbox.GetGuestOSType(generalData.m_strGuestOsTypeId);
                 m_machine.SetCPUProperty(KCPUPropertyType_LongMode, newType.GetIs64Bit());
             }
-
             /* Advanced tab: */
             m_machine.SetSnapshotFolder(generalData.m_strSnapshotsFolder);
@@ -246,48 +210,95 @@
 }
 
-void UIMachineSettingsGeneral::setOrderAfter (QWidget *aWidget)
-{
-    /* Basic tab-order */
-    setTabOrder (aWidget, mTwGeneral->focusProxy());
-    setTabOrder (mTwGeneral->focusProxy(), m_pNameAndSystemEditor);
-
-    /* Advanced tab-order */
-    setTabOrder (m_pNameAndSystemEditor, mPsSnapshot);
-    setTabOrder (mPsSnapshot, mCbClipboard);
-    setTabOrder (mCbClipboard, mCbDragAndDrop);
-
-    /* Description tab-order */
-    setTabOrder (mCbDragAndDrop, mTeDescription);
+void UIMachineSettingsGeneral::setOrderAfter(QWidget *pWidget)
+{
+    /* Basic tab-order: */
+    setTabOrder(pWidget, mTwGeneral->focusProxy());
+    setTabOrder(mTwGeneral->focusProxy(), m_pNameAndSystemEditor);
+
+    /* Advanced tab-order: */
+    setTabOrder(m_pNameAndSystemEditor, mPsSnapshot);
+    setTabOrder(mPsSnapshot, mCbClipboard);
+    setTabOrder(mCbClipboard, mCbDragAndDrop);
+
+    /* Description tab-order: */
+    setTabOrder(mCbDragAndDrop, mTeDescription);
 }
 
 void UIMachineSettingsGeneral::retranslateUi()
 {
-    /* Translate uic generated strings */
-    Ui::UIMachineSettingsGeneral::retranslateUi (this);
-
-    /* Path selector */
-    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."));
-
-    /* Shared Clipboard mode */
-    mCbClipboard->setItemText (0, gpConverter->toString (KClipboardMode_Disabled));
-    mCbClipboard->setItemText (1, gpConverter->toString (KClipboardMode_HostToGuest));
-    mCbClipboard->setItemText (2, gpConverter->toString (KClipboardMode_GuestToHost));
-    mCbClipboard->setItemText (3, gpConverter->toString (KClipboardMode_Bidirectional));
-
-    /* Drag'n'drop mode */
-    mCbDragAndDrop->setItemText (0, gpConverter->toString (KDnDMode_Disabled));
-    mCbDragAndDrop->setItemText (1, gpConverter->toString (KDnDMode_HostToGuest));
-    mCbDragAndDrop->setItemText (2, gpConverter->toString (KDnDMode_GuestToHost));
-    mCbDragAndDrop->setItemText (3, gpConverter->toString (KDnDMode_Bidirectional));
-}
-
-void UIMachineSettingsGeneral::prepareValidation()
-{
-    /* Prepare validation: */
-    connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(revalidate()));
-    connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString&)), this, SLOT(revalidate()));
+    /* Translate uic generated strings: */
+    Ui::UIMachineSettingsGeneral::retranslateUi(this);
+
+    /* Translate path selector: */
+    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: */
+    mCbClipboard->setItemText(0, gpConverter->toString(KClipboardMode_Disabled));
+    mCbClipboard->setItemText(1, gpConverter->toString(KClipboardMode_HostToGuest));
+    mCbClipboard->setItemText(2, gpConverter->toString(KClipboardMode_GuestToHost));
+    mCbClipboard->setItemText(3, gpConverter->toString(KClipboardMode_Bidirectional));
+    /* Translate Drag'n'drop mode combo: */
+    mCbDragAndDrop->setItemText(0, gpConverter->toString(KDnDMode_Disabled));
+    mCbDragAndDrop->setItemText(1, gpConverter->toString(KDnDMode_HostToGuest));
+    mCbDragAndDrop->setItemText(2, gpConverter->toString(KDnDMode_GuestToHost));
+    mCbDragAndDrop->setItemText(3, gpConverter->toString(KDnDMode_Bidirectional));
+}
+
+void UIMachineSettingsGeneral::prepare()
+{
+    /* Apply UI decorations: */
+    Ui::UIMachineSettingsGeneral::setupUi(this);
+
+    /* Prepare pages: */
+    preparePageBasic();
+    preparePageAdvanced();
+    preparePageDescription();
+}
+
+void UIMachineSettingsGeneral::preparePageBasic()
+{
+    /* Name and OS Type widget was created in the .ui file: */
+    AssertPtrReturnVoid(m_pNameAndSystemEditor);
+    {
+        /* Configure Name and OS Type widget: */
+        m_pNameAndSystemEditor->nameEditor()->setValidator(new QRegExpValidator(QRegExp(".+"), this));
+        connect(m_pNameAndSystemEditor, SIGNAL(sigOsTypeChanged()), this, SLOT(revalidate()));
+        connect(m_pNameAndSystemEditor, SIGNAL(sigNameChanged(const QString&)), this, SLOT(revalidate()));
+    }
+}
+
+void UIMachineSettingsGeneral::preparePageAdvanced()
+{
+    /* Shared Clipboard mode combo was created in the .ui file: */
+    AssertPtrReturnVoid(mCbClipboard);
+    {
+        /* Configure Shared Clipboard mode combo: */
+        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: */
+    AssertPtrReturnVoid(mCbDragAndDrop);
+    {
+        /* Configure Drag&drop mode combo: */
+        mCbDragAndDrop->addItem (""); /* KDnDMode_Disabled */
+        mCbDragAndDrop->addItem (""); /* KDnDMode_HostToGuest */
+        mCbDragAndDrop->addItem (""); /* KDnDMode_GuestToHost */
+        mCbDragAndDrop->addItem (""); /* KDnDMode_Bidirectional */
+    }
+}
+
+void UIMachineSettingsGeneral::preparePageDescription()
+{
+    /* Description text editor was created in the .ui file: */
+    AssertPtrReturnVoid(mTeDescription);
+    {
+        /* Configure Description text editor: */
+#ifdef Q_WS_MAC
+        mTeDescription->setMinimum(150);
+#endif /* Q_WS_MAC */
+    }
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h	(revision 54828)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsGeneral.h	(revision 54831)
@@ -4,5 +4,5 @@
 
 /*
- * Copyright (C) 2006-2014 Oracle Corporation
+ * Copyright (C) 2006-2015 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -15,15 +15,15 @@
  */
 
-#ifndef __UIMachineSettingsGeneral_h__
-#define __UIMachineSettingsGeneral_h__
+#ifndef ___UIMachineSettingsGeneral_h___
+#define ___UIMachineSettingsGeneral_h___
 
-/* Local includes: */
+/* GUI includes: */
 #include "UISettingsPage.h"
 #include "UIMachineSettingsGeneral.gen.h"
 
-/* Machine settings / General page / Data: */
+/** Machine settings: General page: Data structure. */
 struct UIDataSettingsMachineGeneral
 {
-    /* Default constructor: */
+    /** Constructor. */
     UIDataSettingsMachineGeneral()
         : m_strName(QString())
@@ -35,5 +35,5 @@
         , m_strDescription(QString()) {}
 
-    /* Functions: */
+    /** Returns whether passed @a other is equal to this. */
     bool equal(const UIDataSettingsMachineGeneral &other) const
     {
@@ -47,22 +47,32 @@
     }
 
-    /* Operators: */
+    /** Operator== implementation which returns whether passed @a other is equal to this. */
     bool operator==(const UIDataSettingsMachineGeneral &other) const { return equal(other); }
+    /** Operator!= implementation which returns whether passed @a other is differs from this. */
     bool operator!=(const UIDataSettingsMachineGeneral &other) const { return !equal(other); }
 
-    /* Variables: */
+    /** Holds the VM name. */
     QString m_strName;
+    /** Holds the VM OS type ID. */
     QString m_strGuestOsTypeId;
+
+    /** Holds the VM snapshot folder. */
     QString m_strSnapshotsFolder;
+    /** Holds the default VM snapshot folder. */
     QString m_strSnapshotsHomeDir;
+
+    /** Holds the VM shared clipboard mode. */
     KClipboardMode m_clipboardMode;
+    /** Holds the VM drag&drop mode. */
     KDnDMode m_dndMode;
+
+    /** Holds the VM description. */
     QString m_strDescription;
 };
 typedef UISettingsCache<UIDataSettingsMachineGeneral> UICacheSettingsMachineGeneral;
 
-/* Machine settings / General page: */
+/** Machine settings: General page. */
 class UIMachineSettingsGeneral : public UISettingsPageMachine,
-                              public Ui::UIMachineSettingsGeneral
+                                 public Ui::UIMachineSettingsGeneral
 {
     Q_OBJECT;
@@ -70,51 +80,67 @@
 public:
 
+    /** Constructor. */
     UIMachineSettingsGeneral();
 
+    /** Returns the VM OS type ID. */
     CGuestOSType guestOSType() const;
-    void setHWVirtExEnabled(bool fEnabled);
+    /** Returns whether 64bit OS type ID is selected. */
     bool is64BitOSTypeSelected() const;
 #ifdef VBOX_WITH_VIDEOHWACCEL
+    /** Returns whether Windows OS type ID is selected. */
     bool isWindowsOSTypeSelected() const;
 #endif /* VBOX_WITH_VIDEOHWACCEL */
 
+    /** Defines whether HW virtualization extension is enabled. */
+    void setHWVirtExEnabled(bool fEnabled);
+
 protected:
 
-    /* Load data to cache from corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
+    /** Loads data into the cache from the corresponding external object(s).
+      * @note This task COULD be performed in other than GUI thread. */
     void loadToCacheFrom(QVariant &data);
-    /* Load data to corresponding widgets from cache,
-     * this task SHOULD be performed in GUI thread only: */
+    /** Loads data into the corresponding widgets from the cache,
+      * @note This task SHOULD be performed in GUI thread only! */
     void getFromCache();
 
-    /* Page changed: */
+    /** Returns whether the page was changed: */
     bool changed() const { return m_cache.wasChanged(); }
 
-    /* Save data from corresponding widgets to cache,
-     * this task SHOULD be performed in GUI thread only: */
+    /** Saves the data from the corresponding widgets into the cache,
+      * @note This task SHOULD be performed in GUI thread only! */
     void putToCache();
-    /* Save data from cache to corresponding external object(s),
-     * this task COULD be performed in other than GUI thread: */
+    /** Save data from the cache into the corresponding external object(s).
+      * @note This task COULD be performed in other than GUI thread. */
     void saveFromCacheTo(QVariant &data);
 
-    /* API: Validation stuff: */
+    /** Validation routine. */
     bool validate(QList<UIValidationMessage> &messages);
 
-    void setOrderAfter (QWidget *aWidget);
+    /** Tab-order assignment routine. */
+    void setOrderAfter(QWidget *aWidget);
 
+    /** Translation routine. */
     void retranslateUi();
 
 private:
 
-    /* Helper: Prepare stuff: */
-    void prepareValidation();
+    /** Prepare routine. */
+    void prepare();
+    /** Prepare 'Basic' page routine. */
+    void preparePageBasic();
+    /** Prepare 'Advanced' page routine. */
+    void preparePageAdvanced();
+    /** Prepare 'Description' page routine. */
+    void preparePageDescription();
 
+    /** Polish routine. */
     void polishPage();
 
-    /* Cache: */
+    /** Holds the page cache. */
+    UICacheSettingsMachineGeneral m_cache;
+
+    /** Holds whether HW virtualization extension is enabled. */
     bool m_fHWVirtExEnabled;
-    UICacheSettingsMachineGeneral m_cache;
 };
 
-#endif // __UIMachineSettingsGeneral_h__
-
+#endif / !___UIMachineSettingsGeneral_h___ */
