Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.cpp	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.cpp	(revision 50906)
@@ -1,11 +1,9 @@
 /* $Id$ */
 /** @file
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * UISettingsDefs implementation
+ * VBox Qt GUI - UISettingsDefs implementation
  */
 
 /*
- * Copyright (C) 2011-2012 Oracle Corporation
+ * Copyright (C) 2011-2014 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -18,5 +16,5 @@
  */
 
-/* VBox includes: */
+/* GUI includes: */
 #include "UISettingsDefs.h"
 
@@ -24,27 +22,19 @@
 using namespace UISettingsDefs;
 
-/* Machine state => Settings dialog type converter: */
-SettingsDialogType UISettingsDefs::determineSettingsDialogType(KSessionState sessionState, KMachineState machineState)
+ConfigurationAccessLevel UISettingsDefs::configurationAccessLevel(KSessionState sessionState, KMachineState machineState)
 {
-    SettingsDialogType result = SettingsDialogType_Wrong;
+    /* Depending on passed arguments: */
     switch (machineState)
     {
         case KMachineState_PoweredOff:
         case KMachineState_Teleported:
-        case KMachineState_Aborted:
-            result = sessionState == KSessionState_Unlocked ? SettingsDialogType_Offline :
-                                                              SettingsDialogType_Online;
-            break;
-        case KMachineState_Saved:
-            result = SettingsDialogType_Saved;
-            break;
+        case KMachineState_Aborted:    return sessionState == KSessionState_Unlocked ? ConfigurationAccessLevel_Full : ConfigurationAccessLevel_Runtime;
+        case KMachineState_Saved:      return ConfigurationAccessLevel_Saved;
         case KMachineState_Running:
-        case KMachineState_Paused:
-            result = SettingsDialogType_Online;
-            break;
-        default:
-            break;
+        case KMachineState_Paused:     return ConfigurationAccessLevel_Runtime;
+        default: break;
     }
-    return result;
+    /* Null by default: */
+    return ConfigurationAccessLevel_Null;
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDefs.h	(revision 50906)
@@ -1,10 +1,8 @@
 /** @file
- *
- * VBox frontends: Qt GUI ("VirtualBox"):
- * Header with definitions and functions related to settings window
+ * VBox Qt GUI - Header with definitions and functions related to settings configuration.
  */
 
 /*
- * Copyright (C) 2011-2012 Oracle Corporation
+ * Copyright (C) 2011-2014 Oracle Corporation
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -17,6 +15,6 @@
  */
 
-#ifndef __UISettingsDefs_h__
-#define __UISettingsDefs_h__
+#ifndef ___UISettingsDefs_h___
+#define ___UISettingsDefs_h___
 
 /* Qt includes: */
@@ -27,18 +25,18 @@
 #include "COMEnums.h"
 
-/* Settings dialog namespace: */
+/** Settings configuration namespace: */
 namespace UISettingsDefs
 {
-    /* Settings dialog types: */
-    enum SettingsDialogType
+    /** Configuration access levels: */
+    enum ConfigurationAccessLevel
     {
-        SettingsDialogType_Wrong,
-        SettingsDialogType_Offline,
-        SettingsDialogType_Saved,
-        SettingsDialogType_Online
+        ConfigurationAccessLevel_Null,
+        ConfigurationAccessLevel_Saved,
+        ConfigurationAccessLevel_Runtime,
+        ConfigurationAccessLevel_Full
     };
 
-    /* Machine state => Settings dialog type converter: */
-    SettingsDialogType determineSettingsDialogType(KSessionState sessionState, KMachineState machineState);
+    /** Determines configuration access level for passed @a sessionState and @a machineState. */
+    ConfigurationAccessLevel configurationAccessLevel(KSessionState sessionState, KMachineState machineState);
 }
 
@@ -164,4 +162,3 @@
 };
 
-#endif /* __UISettingsDefs_h__ */
-
+#endif /* !___UISettingsDefs_h___ */
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.cpp	(revision 50906)
@@ -52,5 +52,5 @@
     , m_pStack(0)
     /* Common variables: */
-    , m_dialogType(SettingsDialogType_Wrong)
+    , m_configurationAccessLevel(ConfigurationAccessLevel_Null)
     , m_fPolished(false)
     /* Loading/saving stuff: */
@@ -246,12 +246,16 @@
 }
 
-void UISettingsDialog::setDialogType(SettingsDialogType settingsDialogType)
-{
-    /* Remember new dialog-type: */
-    m_dialogType = settingsDialogType;
-
-    /* Propagate it to settings-page(s): */
+void UISettingsDialog::setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel)
+{
+    /* Make sure something changed: */
+    if (m_configurationAccessLevel == newConfigurationAccessLevel)
+        return;
+
+    /* Apply new configuration access level: */
+    m_configurationAccessLevel = newConfigurationAccessLevel;
+
+    /* And propagate it to settings-page(s): */
     foreach (UISettingsPage *pPage, m_pSelector->settingPages())
-        pPage->setDialogType(dialogType());
+        pPage->setConfigurationAccessLevel(configurationAccessLevel());
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialog.h	(revision 50906)
@@ -75,7 +75,9 @@
     virtual void retranslateUi();
 
-    /* Dialog type: */
-    SettingsDialogType dialogType() { return m_dialogType; }
-    void setDialogType(SettingsDialogType settingsDialogType);
+    /** Returns configuration access level. */
+    ConfigurationAccessLevel configurationAccessLevel() { return m_configurationAccessLevel; }
+    /** Defines configuration access level. */
+    void setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel);
+
     /* Dialog title: */
     virtual QString title() const = 0;
@@ -119,6 +121,8 @@
     void assignValidator(UISettingsPage *pPage);
 
+    /** Holds configuration access level. */
+    ConfigurationAccessLevel m_configurationAccessLevel;
+
     /* Global Flags: */
-    SettingsDialogType m_dialogType;
     bool m_fPolished;
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp	(revision 50906)
@@ -323,7 +323,4 @@
 #endif /* !Q_WS_MAC */
 
-    /* Assign default dialog type: */
-    setDialogType(SettingsDialogType_Offline);
-
     /* Creating settings pages: */
     CVirtualBox vbox = vboxGlobal().virtualBox();
@@ -412,8 +409,9 @@
                     break;
             }
-            if (pSettingsPage)
-                pSettingsPage->setDialogType(dialogType());
-        }
-    }
+        }
+    }
+
+    /* Assign default (full) configuration access level: */
+    setConfigurationAccessLevel(ConfigurationAccessLevel_Full);
 
     /* Retranslate UI: */
@@ -564,6 +562,4 @@
     m_sessionState = m_machine.GetSessionState();
     m_machineState = m_machine.GetState();
-    /* Recalculate current dialog-type: */
-    updateDialogType();
 
     /* Creating settings pages: */
@@ -672,8 +668,9 @@
                     break;
             }
-            if (pSettingsPage)
-                pSettingsPage->setDialogType(dialogType());
-        }
-    }
+        }
+    }
+
+    /* Recalculate configuration access level: */
+    updateConfigurationAccessLevel();
 
     /* Retranslate UI: */
@@ -734,5 +731,5 @@
 
     /* Prepare session: */
-    m_session = dialogType() == SettingsDialogType_Wrong ? CSession() : vboxGlobal().openExistingSession(m_strMachineId);
+    m_session = configurationAccessLevel() == ConfigurationAccessLevel_Null ? CSession() : vboxGlobal().openExistingSession(m_strMachineId);
     /* Check that session was created: */
     if (m_session.isNull())
@@ -742,5 +739,5 @@
     m_machine = m_session.GetMachine();
     /* Get console from session: */
-    m_console = dialogType() == SettingsDialogType_Offline ? CConsole() : m_session.GetConsole();
+    m_console = configurationAccessLevel() == ConfigurationAccessLevel_Full ? CConsole() : m_session.GetConsole();
 
     /* Prepare machine data: */
@@ -773,7 +770,7 @@
 
     /* Prepare session: */
-    if (dialogType() == SettingsDialogType_Wrong)
+    if (configurationAccessLevel() == ConfigurationAccessLevel_Null)
         m_session = CSession();
-    else if (dialogType() != SettingsDialogType_Offline)
+    else if (configurationAccessLevel() != ConfigurationAccessLevel_Full)
         m_session = vboxGlobal().openExistingSession(m_strMachineId);
     else
@@ -786,5 +783,5 @@
     m_machine = m_session.GetMachine();
     /* Get console from session: */
-    m_console = dialogType() == SettingsDialogType_Offline ? CConsole() : m_session.GetConsole();
+    m_console = configurationAccessLevel() == ConfigurationAccessLevel_Full ? CConsole() : m_session.GetConsole();
 
     /* Prepare machine data: */
@@ -1011,6 +1008,6 @@
     m_sessionState = sessionState;
 
-    /* Update dialog-type if necessary: */
-    updateDialogType();
+    /* Recalculate configuration access level: */
+    updateConfigurationAccessLevel();
 }
 
@@ -1028,6 +1025,6 @@
     m_machineState = machineState;
 
-    /* Update dialog-type if necessary: */
-    updateDialogType();
+    /* Recalculate configuration access level: */
+    updateConfigurationAccessLevel();
 }
 
@@ -1127,21 +1124,21 @@
 }
 
-void UISettingsDialogMachine::updateDialogType()
-{
-    /* Get new dialog type: */
-    SettingsDialogType newDialogType = determineSettingsDialogType(m_sessionState, m_machineState);
-
-    /* Ignore if dialog type was NOT actually changed: */
-    if (dialogType() == newDialogType)
+void UISettingsDialogMachine::updateConfigurationAccessLevel()
+{
+    /* Determine new configuration access level: */
+    ConfigurationAccessLevel newConfigurationAccessLevel = ::configurationAccessLevel(m_sessionState, m_machineState);
+
+    /* Make sure someting changed: */
+    if (configurationAccessLevel() == newConfigurationAccessLevel)
         return;
 
-    /* Should we show a warning about leaving 'offline' state? */
-    bool fShouldWe = dialogType() == SettingsDialogType_Offline;
-
-    /* Update current dialog type: */
-    setDialogType(newDialogType);
-
-    /* Show a warning about leaving 'offline' state if we should: */
-    if (isSettingsChanged() && fShouldWe)
+    /* Should we warn a user about access level decrease? */
+    bool fShouldWeWarn = configurationAccessLevel() == ConfigurationAccessLevel_Full;
+
+    /* Apply new configuration access level: */
+    setConfigurationAccessLevel(newConfigurationAccessLevel);
+
+    /* Show a warning about access level decrease if we should: */
+    if (isSettingsChanged() && fShouldWeWarn)
         msgCenter().warnAboutStateChange(this);
 }
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.h	(revision 50906)
@@ -91,5 +91,7 @@
     bool isPageAvailable(int iPageId);
     bool isSettingsChanged();
-    void updateDialogType();
+
+    /* Recalculates configuration access level. */
+    void updateConfigurationAccessLevel();
 
     QString m_strMachineId;
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.cpp	(revision 50906)
@@ -26,5 +26,5 @@
 UISettingsPage::UISettingsPage(UISettingsPageType pageType)
     : m_pageType(pageType)
-    , m_dialogType(SettingsDialogType_Wrong)
+    , m_configurationAccessLevel(ConfigurationAccessLevel_Null)
     , m_cId(-1)
     , m_fProcessed(false)
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsPage.h	(revision 50906)
@@ -108,10 +108,10 @@
     UISettingsPageType pageType() const { return m_pageType; }
 
-    /* Settings dialog type stuff: */
-    SettingsDialogType dialogType() const { return m_dialogType; }
-    virtual void setDialogType(SettingsDialogType settingsDialogType) { m_dialogType = settingsDialogType; polishPage(); }
-    bool isMachineOffline() const { return dialogType() == SettingsDialogType_Offline; }
-    bool isMachineSaved() const { return dialogType() == SettingsDialogType_Saved; }
-    bool isMachineOnline() const { return dialogType() == SettingsDialogType_Online; }
+    /* Configuration access level stuff: */
+    ConfigurationAccessLevel configurationAccessLevel() const { return m_configurationAccessLevel; }
+    virtual void setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel) { m_configurationAccessLevel = newConfigurationAccessLevel; polishPage(); }
+    bool isMachineOffline() const { return configurationAccessLevel() == ConfigurationAccessLevel_Full; }
+    bool isMachineSaved() const { return configurationAccessLevel() == ConfigurationAccessLevel_Saved; }
+    bool isMachineOnline() const { return configurationAccessLevel() == ConfigurationAccessLevel_Runtime; }
     bool isMachineInValidMode() const { return isMachineOffline() || isMachineSaved() || isMachineOnline(); }
 
@@ -154,5 +154,5 @@
     /* Variables: */
     UISettingsPageType m_pageType;
-    SettingsDialogType m_dialogType;
+    ConfigurationAccessLevel m_configurationAccessLevel;
     int m_cId;
     bool m_fProcessed;
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp	(revision 50906)
@@ -864,5 +864,5 @@
     , mToolTipType (DefaultToolTip)
     , m_chipsetType(KChipsetType_PIIX3)
-    , m_dialogType(SettingsDialogType_Wrong)
+    , m_configurationAccessLevel(ConfigurationAccessLevel_Null)
 {
 }
@@ -1034,5 +1034,5 @@
         case R_IsMoreIDEControllersPossible:
         {
-            return (m_dialogType == SettingsDialogType_Offline) &&
+            return (m_configurationAccessLevel == ConfigurationAccessLevel_Full) &&
                    (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_IDE) <
                     vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_IDE));
@@ -1040,5 +1040,5 @@
         case R_IsMoreSATAControllersPossible:
         {
-            return (m_dialogType == SettingsDialogType_Offline) &&
+            return (m_configurationAccessLevel == ConfigurationAccessLevel_Full) &&
                    (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_SATA) <
                     vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_SATA));
@@ -1046,5 +1046,5 @@
         case R_IsMoreSCSIControllersPossible:
         {
-            return (m_dialogType == SettingsDialogType_Offline) &&
+            return (m_configurationAccessLevel == ConfigurationAccessLevel_Full) &&
                    (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_SCSI) <
                     vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_SCSI));
@@ -1052,5 +1052,5 @@
         case R_IsMoreFloppyControllersPossible:
         {
-            return (m_dialogType == SettingsDialogType_Offline) &&
+            return (m_configurationAccessLevel == ConfigurationAccessLevel_Full) &&
                    (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_Floppy) <
                     vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_Floppy));
@@ -1058,5 +1058,5 @@
         case R_IsMoreSASControllersPossible:
         {
-            return (m_dialogType == SettingsDialogType_Offline) &&
+            return (m_configurationAccessLevel == ConfigurationAccessLevel_Full) &&
                    (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_SAS) <
                     vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_SAS));
@@ -1064,5 +1064,5 @@
         case R_IsMoreUSBControllersPossible:
         {
-            return (m_dialogType == SettingsDialogType_Offline) &&
+            return (m_configurationAccessLevel == ConfigurationAccessLevel_Full) &&
                    (static_cast<RootItem*>(mRootItem)->childCount(KStorageBus_USB) <
                     vboxGlobal().virtualBox().GetSystemProperties().GetMaxInstancesOfStorageBus(chipsetType(), KStorageBus_USB));
@@ -1076,10 +1076,10 @@
                     ControllerItem *ctr = static_cast <ControllerItem*> (item);
                     CSystemProperties sp = vboxGlobal().virtualBox().GetSystemProperties();
-                    switch (m_dialogType)
+                    switch (m_configurationAccessLevel)
                     {
-                        case SettingsDialogType_Offline: return ((uint)rowCount(aIndex) < sp.GetMaxPortCountForStorageBus(ctr->ctrBusType()) *
-                                                                                          sp.GetMaxDevicesPerPortForStorageBus(ctr->ctrBusType()));
-                        case SettingsDialogType_Online: return (ctr->ctrBusType() == KStorageBus_SATA) &&
-                                                               ((uint)rowCount(aIndex) < ctr->portCount());
+                        case ConfigurationAccessLevel_Full: return ((uint)rowCount(aIndex) < sp.GetMaxPortCountForStorageBus(ctr->ctrBusType()) *
+                                                                                             sp.GetMaxDevicesPerPortForStorageBus(ctr->ctrBusType()));
+                        case ConfigurationAccessLevel_Runtime: return (ctr->ctrBusType() == KStorageBus_SATA) &&
+                                                                      ((uint)rowCount(aIndex) < ctr->portCount());
                         default: break;
                     }
@@ -1504,5 +1504,5 @@
         beginInsertRows (parentIndex, parent->childCount(), parent->childCount());
         AttachmentItem *pItem = new AttachmentItem (parent, aDeviceType);
-        pItem->setAttIsHotPluggable(m_dialogType != SettingsDialogType_Offline);
+        pItem->setAttIsHotPluggable(m_configurationAccessLevel != ConfigurationAccessLevel_Full);
         pItem->setAttMediumId(strMediumId);
         endInsertRows();
@@ -1617,7 +1617,7 @@
 }
 
-void StorageModel::setDialogType(SettingsDialogType dialogType)
-{
-    m_dialogType = dialogType;
+void StorageModel::setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel)
+{
+    m_configurationAccessLevel = newConfigurationAccessLevel;
 }
 
@@ -3812,10 +3812,10 @@
 }
 
-void UIMachineSettingsStorage::setDialogType(SettingsDialogType settingsDialogType)
-{
-    /* Update model 'settings window type': */
-    mStorageModel->setDialogType(settingsDialogType);
-    /* Update 'settings window type' of base class: */
-    UISettingsPageMachine::setDialogType(settingsDialogType);
+void UIMachineSettingsStorage::setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel)
+{
+    /* Update model 'configuration access level': */
+    mStorageModel->setConfigurationAccessLevel(newConfigurationAccessLevel);
+    /* Update 'configuration access level' of base class: */
+    UISettingsPageMachine::setConfigurationAccessLevel(newConfigurationAccessLevel);
 }
 
Index: trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
===================================================================
--- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h	(revision 50904)
+++ trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h	(revision 50906)
@@ -542,5 +542,6 @@
     void setChipsetType(KChipsetType type);
 
-    void setDialogType(SettingsDialogType settingsDialogType);
+    /** Defines configuration access level. */
+    void setConfigurationAccessLevel(ConfigurationAccessLevel newConfigurationAccessLevel);
 
     void clear();
@@ -564,5 +565,7 @@
 
     KChipsetType m_chipsetType;
-    SettingsDialogType m_dialogType;
+
+    /** Holds configuration access level. */
+    ConfigurationAccessLevel m_configurationAccessLevel;
 };
 Q_DECLARE_METATYPE (StorageModel::ToolTipType);
@@ -784,5 +787,7 @@
     bool isAttachmentCouldBeUpdated(const UICacheSettingsMachineStorageAttachment &attachmentCache) const;
 
-    void setDialogType(SettingsDialogType settingsDialogType);
+    /** Defines configuration access level. */
+    void setConfigurationAccessLevel(ConfigurationAccessLevel configurationAccessLevel);
+
     void polishPage();
 
