Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxTakeSnapshotDlg.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxTakeSnapshotDlg.h	(revision 25115)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxTakeSnapshotDlg.h	(revision 25116)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2009 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -24,9 +24,10 @@
 #define __VBoxTakeSnapshotDlg_h__
 
+/* Local includes */
 #include "VBoxTakeSnapshotDlg.gen.h"
 #include "QIWithRetranslateUI.h"
+#include "COMDefs.h"
 
-class VBoxTakeSnapshotDlg : public QIWithRetranslateUI<QDialog>,
-                            public Ui::VBoxTakeSnapshotDlg
+class VBoxTakeSnapshotDlg : public QIWithRetranslateUI<QDialog>, public Ui::VBoxTakeSnapshotDlg
 {
     Q_OBJECT;
@@ -34,5 +35,5 @@
 public:
 
-    VBoxTakeSnapshotDlg (QWidget *aParent);
+    VBoxTakeSnapshotDlg(QWidget *pParent, const CMachine &machine);
 
 protected:
@@ -42,5 +43,5 @@
 private slots:
 
-    void nameChanged (const QString &aName);
+    void nameChanged(const QString &strName);
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 25115)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 25116)
@@ -2027,5 +2027,5 @@
     CMachine machine = mSession.GetMachine();
 
-    VBoxTakeSnapshotDlg dlg (this);
+    VBoxTakeSnapshotDlg dlg (this, machine);
 
     QString typeId = machine.GetOSTypeId();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp	(revision 25115)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp	(revision 25116)
@@ -576,5 +576,5 @@
     AssertReturn (item, (void) 0);
 
-    VBoxTakeSnapshotDlg dlg (this);
+    VBoxTakeSnapshotDlg dlg (this, mMachine);
 
     QString typeId = mMachine.GetOSTypeId();
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxTakeSnapshotDlg.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxTakeSnapshotDlg.cpp	(revision 25115)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxTakeSnapshotDlg.cpp	(revision 25116)
@@ -6,5 +6,5 @@
 
 /*
- * Copyright (C) 2006-2008 Sun Microsystems, Inc.
+ * Copyright (C) 2006-2009 Sun Microsystems, Inc.
  *
  * This file is part of VirtualBox Open Source Edition (OSE), as
@@ -21,25 +21,56 @@
  */
 
+/* Global includes */
+#include <QPushButton>
+
+/* Local includes */
 #include "VBoxTakeSnapshotDlg.h"
 #include "VBoxProblemReporter.h"
 #include "VBoxUtils.h"
 
-/* Qt includes */
-#include <QPushButton>
-
-VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg (QWidget *aParent)
-    : QIWithRetranslateUI<QDialog> (aParent)
+VBoxTakeSnapshotDlg::VBoxTakeSnapshotDlg(QWidget *pParent, const CMachine &machine)
+    : QIWithRetranslateUI<QDialog>(pParent)
 {
     /* Apply UI decorations */
-    Ui::VBoxTakeSnapshotDlg::setupUi (this);
+    Ui::VBoxTakeSnapshotDlg::setupUi(this);
 
-    QIAltKeyFilter *af = new QIAltKeyFilter (this);
-    af->watchOn (mLeName);
+    /* Alt key filter */
+    QIAltKeyFilter *altKeyFilter = new QIAltKeyFilter(this);
+    altKeyFilter->watchOn(mLeName);
 
     /* Setup connections */
-    connect (mButtonBox, SIGNAL (helpRequested()),
-             &vboxProblem(), SLOT (showHelpHelpDialog()));
-    connect (mLeName, SIGNAL (textChanged (const QString &)),
-             this, SLOT (nameChanged (const QString &)));
+    connect (mButtonBox, SIGNAL(helpRequested()), &vboxProblem(), SLOT(showHelpHelpDialog()));
+    connect (mLeName, SIGNAL(textChanged(const QString &)), this, SLOT(nameChanged(const QString &)));
+
+    /* Check if machine have immutable attachments */
+    int immutableMediums = 0;
+
+    if (machine.GetState() == KMachineState_Paused)
+    {
+        foreach (const CMediumAttachment &attachment, machine.GetMediumAttachments())
+        {
+            CMedium medium = attachment.GetMedium();
+            if (!medium.isNull() && !medium.GetParent().isNull() && medium.GetBase().GetType() == KMediumType_Immutable)
+                ++ immutableMediums;
+        }
+    }
+
+    if (immutableMediums)
+    {
+        mLbInfo->setText(tr("Warning: You are taking a snapshot of a running machine which has %n immutable image(s) "
+                            "attached to it. The automatic resetting of the immutable image(s) will not occur while "
+                            "the snapshot you are taking is the current snapshot to avoid data corruption.", "",
+                            immutableMediums));
+        mLbInfo->useSizeHintForWidth(400);
+    }
+    else
+    {
+        QGridLayout *lt = qobject_cast<QGridLayout*>(layout());
+        lt->removeWidget (mLbInfo);
+        mLbInfo->setHidden (true);
+
+        lt->removeWidget (mButtonBox);
+        lt->addWidget (mButtonBox, 2, 0, 1, 2);
+    }
 
     retranslateUi();
@@ -49,10 +80,10 @@
 {
     /* Translate uic generated strings */
-    Ui::VBoxTakeSnapshotDlg::retranslateUi (this);
+    Ui::VBoxTakeSnapshotDlg::retranslateUi(this);
 }
 
-void VBoxTakeSnapshotDlg::nameChanged (const QString &aName)
+void VBoxTakeSnapshotDlg::nameChanged(const QString &strName)
 {
-    mButtonBox->button (QDialogButtonBox::Ok)->setEnabled (!aName.trimmed().isEmpty());
+    mButtonBox->button(QDialogButtonBox::Ok)->setEnabled(!strName.trimmed().isEmpty());
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxTakeSnapshotDlg.ui
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxTakeSnapshotDlg.ui	(revision 25115)
+++ /trunk/src/VBox/Frontends/VirtualBox/ui/VBoxTakeSnapshotDlg.ui	(revision 25116)
@@ -3,5 +3,5 @@
  VBox frontends: Qt4 GUI ("VirtualBox"):
 
- Copyright (C) 2008 Sun Microsystems, Inc.
+ Copyright (C) 2008-2009 Sun Microsystems, Inc.
 
  This file is part of VirtualBox Open Source Edition (OSE), as
@@ -18,11 +18,11 @@
  </comment>
  <class>VBoxTakeSnapshotDlg</class>
- <widget class="QDialog" name="VBoxTakeSnapshotDlg" >
-  <property name="geometry" >
+ <widget class="QDialog" name="VBoxTakeSnapshotDlg">
+  <property name="geometry">
    <rect>
     <x>0</x>
     <y>0</y>
-    <width>314</width>
-    <height>239</height>
+    <width>300</width>
+    <height>240</height>
    </rect>
   </property>
@@ -30,89 +30,88 @@
    <string>Take Snapshot of Virtual Machine</string>
   </property>
-  <layout class="QVBoxLayout" >
-   <item>
-    <layout class="QHBoxLayout" >
+  <layout class="QGridLayout">
+   <item rowspan="2" row="0" column="0">
+    <layout class="QVBoxLayout">
      <item>
-      <layout class="QVBoxLayout" >
-       <item>
-        <widget class="QLabel" name="mLbIcon" >
-         <property name="sizePolicy" >
-          <sizepolicy vsizetype="Preferred" hsizetype="Maximum" >
-           <horstretch>0</horstretch>
-           <verstretch>0</verstretch>
-          </sizepolicy>
-         </property>
-         <property name="text" >
-          <string/>
-         </property>
-        </widget>
-       </item>
-       <item>
-        <spacer>
-         <property name="orientation" >
-          <enum>Qt::Vertical</enum>
-         </property>
-         <property name="sizeHint" >
-          <size>
-           <width>20</width>
-           <height>40</height>
-          </size>
-         </property>
-        </spacer>
-       </item>
-      </layout>
+      <widget class="QLabel" name="mLbIcon">
+       <property name="sizePolicy" >
+        <sizepolicy vsizetype="Preferred" hsizetype="Maximum">
+         <horstretch>0</horstretch>
+         <verstretch>0</verstretch>
+        </sizepolicy>
+       </property>
+      </widget>
      </item>
      <item>
-      <layout class="QVBoxLayout" >
-       <property name="spacing" >
-        <number>10</number>
+      <spacer>
+       <property name="orientation">
+        <enum>Qt::Vertical</enum>
        </property>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="spacing" >
-          <number>2</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLbName" >
-           <property name="text" >
-            <string>Snapshot &amp;Name</string>
-           </property>
-           <property name="buddy" >
-            <cstring>mLeName</cstring>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QLineEdit" name="mLeName" />
-         </item>
-        </layout>
-       </item>
-       <item>
-        <layout class="QVBoxLayout" >
-         <property name="spacing" >
-          <number>2</number>
-         </property>
-         <item>
-          <widget class="QLabel" name="mLbDescription" >
-           <property name="text" >
-            <string>Snapshot &amp;Description</string>
-           </property>
-           <property name="buddy" >
-            <cstring>mTeDescription</cstring>
-           </property>
-          </widget>
-         </item>
-         <item>
-          <widget class="QTextEdit" name="mTeDescription" />
-         </item>
-        </layout>
-       </item>
-      </layout>
+       <property name="sizeHint">
+        <size>
+         <width>0</width>
+         <height>0</height>
+        </size>
+       </property>
+      </spacer>
      </item>
     </layout>
    </item>
-   <item>
-    <widget class="QIDialogButtonBox" name="mButtonBox" >
-     <property name="standardButtons" >
+   <item row="0" column="1">
+    <layout class="QVBoxLayout">
+     <property name="spacing">
+      <number>2</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="mLbName">
+       <property name="text" >
+        <string>Snapshot &amp;Name</string>
+       </property>
+       <property name="buddy" >
+        <cstring>mLeName</cstring>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QLineEdit" name="mLeName"/>
+     </item>
+    </layout>
+   </item>
+   <item row="1" column="1">
+    <layout class="QVBoxLayout">
+     <property name="spacing">
+      <number>2</number>
+     </property>
+     <item>
+      <widget class="QLabel" name="mLbDescription">
+       <property name="text">
+        <string>Snapshot &amp;Description</string>
+       </property>
+       <property name="buddy">
+        <cstring>mTeDescription</cstring>
+       </property>
+      </widget>
+     </item>
+     <item>
+      <widget class="QTextEdit" name="mTeDescription"/>
+     </item>
+    </layout>
+   </item>
+   <item row="2" column="0" colspan="2">
+    <widget class="QILabel" name="mLbInfo">
+     <property name="sizePolicy" >
+      <sizepolicy vsizetype="Preferred" hsizetype="Preferred">
+       <horstretch>0</horstretch>
+       <verstretch>0</verstretch>
+      </sizepolicy>
+     </property>
+     <property name="wordWrap">
+      <bool>true</bool>
+     </property>
+    </widget>
+   </item>
+   <item row="3" column="0" colspan="2">
+    <widget class="QIDialogButtonBox" name="mButtonBox">
+     <property name="standardButtons">
       <set>QDialogButtonBox::Cancel|QDialogButtonBox::Help|QDialogButtonBox::NoButton|QDialogButtonBox::Ok</set>
      </property>
@@ -122,4 +121,9 @@
  </widget>
  <customwidgets>
+  <customwidget>
+   <class>QILabel</class>
+   <extends>QLabel</extends>
+   <header>QILabel.h</header>
+  </customwidget>
   <customwidget>
    <class>QIDialogButtonBox</class>
@@ -136,9 +140,9 @@
    <slot>accept()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>156</x>
      <y>216</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>156</x>
      <y>119</y>
@@ -152,9 +156,9 @@
    <slot>reject()</slot>
    <hints>
-    <hint type="sourcelabel" >
+    <hint type="sourcelabel">
      <x>156</x>
      <y>216</y>
     </hint>
-    <hint type="destinationlabel" >
+    <hint type="destinationlabel">
      <x>156</x>
      <y>119</y>
