Index: /trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc	(revision 23923)
+++ /trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc	(revision 23924)
@@ -135,8 +135,8 @@
     <file alias="discard_cur_state_snapshot_dis_16px.png">images/discard_cur_state_snapshot_dis_16px.png</file>
     <file alias="discard_cur_state_snapshot_dis_22px.png">images/discard_cur_state_snapshot_dis_22px.png</file>
-    <file alias="discard_snapshot_16px.png">images/discard_snapshot_16px.png</file>
-    <file alias="discard_snapshot_22px.png">images/discard_snapshot_22px.png</file>
-    <file alias="discard_snapshot_dis_16px.png">images/discard_snapshot_dis_16px.png</file>
-    <file alias="discard_snapshot_dis_22px.png">images/discard_snapshot_dis_22px.png</file>
+    <file alias="delete_snapshot_16px.png">images/delete_snapshot_16px.png</file>
+    <file alias="delete_snapshot_22px.png">images/delete_snapshot_22px.png</file>
+    <file alias="delete_snapshot_dis_16px.png">images/delete_snapshot_dis_16px.png</file>
+    <file alias="delete_snapshot_dis_22px.png">images/delete_snapshot_dis_22px.png</file>
     <file alias="take_snapshot_16px.png">images/take_snapshot_16px.png</file>
     <file alias="take_snapshot_22px.png">images/take_snapshot_22px.png</file>
Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h	(revision 23923)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h	(revision 23924)
@@ -209,14 +209,11 @@
 
     void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
-    bool askAboutSnapshotAndStateDiscarding();
-    bool askAboutSnapshotDiscarding();
-    void cannotDiscardSnapshot (const CConsole &aConsole,
-                                const QString &aSnapshotName);
-    void cannotDiscardSnapshot (const CProgress &aProgress,
-                                const QString &aSnapshotName);
-    void cannotDiscardCurrentState (const CConsole &console);
-    void cannotDiscardCurrentState (const CProgress &progress);
-    void cannotDiscardCurrentSnapshotAndState (const CConsole &console);
-    void cannotDiscardCurrentSnapshotAndState (const CProgress &progress);
+
+    bool askAboutSnapshotRestoring (const QString &aSnapshotName);
+    bool askAboutSnapshotDeleting (const QString &aSnapshotName);
+    void cannotRestoreSnapshot (const CConsole &aConsole, const QString &aSnapshotName);
+    void cannotRestoreSnapshot (const CProgress &aProgress, const QString &aSnapshotName);
+    void cannotDeleteSnapshot (const CConsole &aConsole, const QString &aSnapshotName);
+    void cannotDeleteSnapshot (const CProgress &aProgress, const QString &aSnapshotName);
 
     void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
Index: /trunk/src/VBox/Frontends/VirtualBox/include/VBoxSnapshotsWgt.h
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/include/VBoxSnapshotsWgt.h	(revision 23923)
+++ /trunk/src/VBox/Frontends/VirtualBox/include/VBoxSnapshotsWgt.h	(revision 23924)
@@ -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,17 +24,13 @@
 #define __VBoxSnapshotsWgt_h__
 
+/* Local includes */
 #include "VBoxSnapshotsWgt.gen.h"
 #include "VBoxGlobal.h"
 #include "QIWithRetranslateUI.h"
 
-/* Qt includes */
-#include <QUuid>
-
+/* Local forwards */
 class SnapshotWgtItem;
 
-class QMenu;
-
-class VBoxSnapshotsWgt : public QIWithRetranslateUI<QWidget>,
-                         public Ui::VBoxSnapshotsWgt
+class VBoxSnapshotsWgt : public QIWithRetranslateUI <QWidget>, public Ui::VBoxSnapshotsWgt
 {
     Q_OBJECT;
@@ -52,24 +48,20 @@
 private slots:
 
-    void onCurrentChanged (QTreeWidgetItem *aNewItem,
-                           QTreeWidgetItem *aOldItem = 0);
+    void onCurrentChanged (QTreeWidgetItem *aItem = 0);
     void onContextMenuRequested (const QPoint &aPoint);
-    void onItemChanged (QTreeWidgetItem *aItem, int aColumn);
+    void onItemChanged (QTreeWidgetItem *aItem);
 
-    void discardSnapshot();
+    void restoreSnapshot();
+    void deleteSnapshot();
+    void showSnapshotDetails();
     void takeSnapshot();
-    void discardCurState();
-    void showSnapshotDetails();
 
-    void machineDataChanged (const VBoxMachineDataChangeEvent &aE);
-    void machineStateChanged (const VBoxMachineStateChangeEvent &aE);
-    void sessionStateChanged (const VBoxSessionStateChangeEvent &aE);
-#if 0
-    void snapshotChanged (const VBoxSnapshotEvent &aE);
-#endif
+    void machineDataChanged (const VBoxMachineDataChangeEvent &aEvent);
+    void machineStateChanged (const VBoxMachineStateChangeEvent &aEvent);
+    void sessionStateChanged (const VBoxSessionStateChangeEvent &aEvent);
 
 private:
 
-    void refreshAll (bool aKeepSelected = true);
+    void refreshAll();
     SnapshotWgtItem* findItem (const QString &aSnapshotId);
     SnapshotWgtItem* curStateItem();
@@ -80,6 +72,4 @@
     KSessionState    mSessionState;
     SnapshotWgtItem *mCurSnapshotItem;
-    QMenu           *mContextMenu;
-    bool             mContextMenuDirty;
     bool             mEditProtector;
 
@@ -87,8 +77,8 @@
     QActionGroup    *mCurStateActionGroup;
 
-    QAction         *mDiscardSnapshotAction;
+    QAction         *mRestoreSnapshotAction;
+    QAction         *mDeleteSnapshotAction;
+    QAction         *mShowSnapshotDetailsAction;
     QAction         *mTakeSnapshotAction;
-    QAction         *mRevertToCurSnapAction;
-    QAction         *mShowSnapshotDetailsAction;
 };
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 23923)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp	(revision 23924)
@@ -1388,5 +1388,6 @@
                         if (dlg.mCbDiscardCurState->isChecked() && dlg.mCbDiscardCurState->isVisibleTo (&dlg))
                         {
-                            CProgress progress = console.RestoreSnapshot(machine.GetCurrentSnapshot());
+                            CSnapshot snapshot = machine.GetCurrentSnapshot();
+                            CProgress progress = console.RestoreSnapshot (snapshot);
                             if (console.isOk())
                             {
@@ -1394,8 +1395,8 @@
                                 vboxProblem().showModalProgressDialog (progress, machine.GetName(), this);
                                 if (progress.GetResultCode() != 0)
-                                    vboxProblem().cannotDiscardCurrentState (progress);
+                                    vboxProblem().cannotRestoreSnapshot (progress, snapshot.GetName());
                             }
                             else
-                                vboxProblem().cannotDiscardCurrentState (console);
+                                vboxProblem().cannotRestoreSnapshot (console, snapshot.GetName());
                         }
                     }
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp	(revision 23923)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp	(revision 23924)
@@ -804,27 +804,28 @@
 }
 
-bool VBoxProblemReporter::askAboutSnapshotDiscarding()
+bool VBoxProblemReporter::askAboutSnapshotRestoring (const QString &aSnapshotName)
 {
     return messageOkCancel (mainWindowShown(), Question,
-        tr ("<p>Are you sure you wish to merge the selected snapshot?</p>"),
-        "confirmSnapshotDiscarding" /* aAutoConfirmId */,
-        tr ("Discard"), tr ("Cancel"));
-}
-
-bool VBoxProblemReporter::askAboutSnapshotAndStateDiscarding()
+        tr ("<p>Are you sure you wish to restore the selected snapshot <b>%1</b>? "
+            "This will also cause you to lose your current machine state.</p>")
+            .arg (aSnapshotName),
+        "confirmSnapshotRestoring" /* aAutoConfirmId */,
+        tr ("Restore"), tr ("Cancel"));
+}
+
+bool VBoxProblemReporter::askAboutSnapshotDeleting (const QString &aSnapshotName)
 {
     return messageOkCancel (mainWindowShown(), Question,
-        tr ("<p>Are you sure you wish to delete the selected snapshot "
-            "and saved state?</p>"),
-        "confirmSnapshotAndStateDiscarding" /* aAutoConfirmId */,
-        tr ("Discard"), tr ("Cancel"));
-}
-
-void VBoxProblemReporter::cannotDiscardSnapshot (const CConsole &aConsole,
+        tr ("<p>Are you sure you wish to delete the selected snapshot <b>%1</b>?</p>")
+            .arg (aSnapshotName),
+        "confirmSnapshotDeleting" /* aAutoConfirmId */,
+        tr ("Delete"), tr ("Cancel"));
+}
+
+void VBoxProblemReporter::cannotRestoreSnapshot (const CConsole &aConsole,
                                                  const QString &aSnapshotName)
 {
     message (mainWindowShown(), Error,
-        tr ("Failed to discard the snapshot <b>%1</b> of the virtual "
-            "machine <b>%2</b>.")
+        tr ("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
             .arg (aSnapshotName)
             .arg (CConsole (aConsole).GetMachine().GetName()),
@@ -832,5 +833,5 @@
 }
 
-void VBoxProblemReporter::cannotDiscardSnapshot (const CProgress &aProgress,
+void VBoxProblemReporter::cannotRestoreSnapshot (const CProgress &aProgress,
                                                  const QString &aSnapshotName)
 {
@@ -838,6 +839,5 @@
 
     message (mainWindowShown(), Error,
-        tr ("Failed to discard the snapshot <b>%1</b> of the virtual "
-            "machine <b>%2</b>.")
+        tr ("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
             .arg (aSnapshotName)
             .arg (console.GetMachine().GetName()),
@@ -845,50 +845,24 @@
 }
 
-void VBoxProblemReporter::cannotDiscardCurrentState (const CConsole &console)
-{
-    message (
-        mainWindowShown(),
-        Error,
-        tr ("Failed to discard the current state of the virtual "
-            "machine <b>%1</b>.")
-            .arg (CConsole (console).GetMachine().GetName()),
-        formatErrorInfo (console));
-}
-
-void VBoxProblemReporter::cannotDiscardCurrentState (const CProgress &progress)
-{
-    CConsole console (CProgress (progress).GetInitiator());
-
-    message (
-        mainWindowShown(),
-        Error,
-        tr ("Failed to discard the current state of the virtual "
-            "machine <b>%1</b>.")
+void VBoxProblemReporter::cannotDeleteSnapshot (const CConsole &aConsole,
+                                                const QString &aSnapshotName)
+{
+    message (mainWindowShown(), Error,
+        tr ("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
+            .arg (aSnapshotName)
+            .arg (CConsole (aConsole).GetMachine().GetName()),
+        formatErrorInfo (aConsole));
+}
+
+void VBoxProblemReporter::cannotDeleteSnapshot (const CProgress &aProgress,
+                                                const QString &aSnapshotName)
+{
+    CConsole console (CProgress (aProgress).GetInitiator());
+
+    message (mainWindowShown(), Error,
+        tr ("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
+            .arg (aSnapshotName)
             .arg (console.GetMachine().GetName()),
-        formatErrorInfo (progress.GetErrorInfo()));
-}
-
-void VBoxProblemReporter::cannotDiscardCurrentSnapshotAndState (const CConsole &console)
-{
-    message (
-        mainWindowShown(),
-        Error,
-        tr ("Failed to discard the current snapshot and the current state "
-            "of the virtual machine <b>%1</b>.")
-            .arg (CConsole (console).GetMachine().GetName()),
-        formatErrorInfo (console));
-}
-
-void VBoxProblemReporter::cannotDiscardCurrentSnapshotAndState (const CProgress &progress)
-{
-    CConsole console (CProgress (progress).GetInitiator());
-
-    message (
-        mainWindowShown(),
-        Error,
-        tr ("Failed to discard the current snapshot and the current state "
-            "of the virtual machine <b>%1</b>.")
-            .arg (console.GetMachine().GetName()),
-        formatErrorInfo (progress.GetErrorInfo()));
+        formatErrorInfo (aProgress.GetErrorInfo()));
 }
 
Index: /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp
===================================================================
--- /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp	(revision 23923)
+++ /trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp	(revision 23924)
@@ -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,4 +21,11 @@
  */
 
+/* Global includes */
+#include <QDateTime>
+#include <QHeaderView>
+#include <QMenu>
+#include <QScrollBar>
+
+/* Local includes */
 #include <VBoxSnapshotsWgt.h>
 #include <VBoxProblemReporter.h>
@@ -27,16 +34,12 @@
 #include <VBoxToolBar.h>
 
-/* Qt includes */
-#include <QMenu>
-#include <QHeaderView>
-#include <QScrollBar>
-#include <QDateTime>
-
-/** QListViewItem subclass for snapshots items */
+/**
+ *  QTreeWidgetItem subclass for snapshots items
+ */
 class SnapshotWgtItem : public QTreeWidgetItem
 {
 public:
 
-    /** Normal snapshot item */
+    /* Normal snapshot item (child of tree-widget) */
     SnapshotWgtItem (QTreeWidget *aTreeWidget, const CSnapshot &aSnapshot)
         : QTreeWidgetItem (aTreeWidget)
@@ -46,5 +49,5 @@
     }
 
-    /** Normal snapshot item */
+    /* Normal snapshot item (child of tree-widget-item) */
     SnapshotWgtItem (QTreeWidgetItem *aRootItem, const CSnapshot &aSnapshot)
         : QTreeWidgetItem (aRootItem)
@@ -54,5 +57,5 @@
     }
 
-    /** Current state item */
+    /* Current state item (child of tree-widget) */
     SnapshotWgtItem (QTreeWidget *aTreeWidget, const CMachine &aMachine)
         : QTreeWidgetItem (aTreeWidget)
@@ -63,5 +66,5 @@
     }
 
-    /** Current state item */
+    /* Current state item (child of tree-widget-item) */
     SnapshotWgtItem (QTreeWidgetItem *aRootItem, const CMachine &aMachine)
         : QTreeWidgetItem (aRootItem)
@@ -70,4 +73,9 @@
         updateCurrentState (mMachine.GetState());
         recache();
+    }
+
+    bool isCurrentStateItem() const
+    {
+        return mSnapshot.isNull();
     }
 
@@ -122,14 +130,10 @@
             mCurStateModified = mMachine.GetCurrentStateModified();
             setText (0, mCurStateModified ?
-                VBoxSnapshotsWgt::tr ("Current State (changed)",
-                                      "Current State (Modified)") :
-                VBoxSnapshotsWgt::tr ("Current State",
-                                      "Current State (Unmodified)"));
+                        VBoxSnapshotsWgt::tr ("Current State (changed)", "Current State (Modified)") :
+                        VBoxSnapshotsWgt::tr ("Current State", "Current State (Unmodified)"));
             mDesc = mCurStateModified ?
-                VBoxSnapshotsWgt::tr ("The current state differs from the state "
-                                      "stored in the current snapshot") :
-                parent() != 0 ? /* we're not the only item in the view */
-                    VBoxSnapshotsWgt::tr ("The current state is identical to the state "
-                                          "stored in the current snapshot") :
+                    VBoxSnapshotsWgt::tr ("The current state differs from the state stored in the current snapshot") :
+                    parent() != 0 ?
+                    VBoxSnapshotsWgt::tr ("The current state is identical to the state stored in the current snapshot") :
                     QString::null;
         }
@@ -175,5 +179,5 @@
         if (!mSnapshot.isNull())
         {
-            /* the current snapshot is always bold */
+            /* The current snapshot is always bold */
             if (bold())
                 details = VBoxSnapshotsWgt::tr (" (current, ", "Snapshot details");
@@ -184,20 +188,16 @@
 
             if (dateTimeToday)
-                dateTime = VBoxSnapshotsWgt::tr ("Taken at %1", "Snapshot (time)")
-                    .arg (dateTime);
+                dateTime = VBoxSnapshotsWgt::tr ("Taken at %1", "Snapshot (time)").arg (dateTime);
             else
-                dateTime = VBoxSnapshotsWgt::tr ("Taken on %1", "Snapshot (date + time)")
-                    .arg (dateTime);
+                dateTime = VBoxSnapshotsWgt::tr ("Taken on %1", "Snapshot (date + time)").arg (dateTime);
         }
         else
         {
             dateTime = VBoxSnapshotsWgt::tr ("%1 since %2", "Current State (time or date + time)")
-                .arg (vboxGlobal().toString (mMachineState))
-                .arg (dateTime);
+                .arg (vboxGlobal().toString (mMachineState)).arg (dateTime);
         }
 
         QString toolTip = QString ("<nobr><b>%1</b>%2</nobr><br><nobr>%3</nobr>")
-            .arg (name) .arg (details)
-            .arg (dateTime);
+            .arg (name) .arg (details).arg (dateTime);
 
         if (!mDesc.isEmpty())
@@ -244,17 +244,14 @@
 };
 
-
 VBoxSnapshotsWgt::VBoxSnapshotsWgt (QWidget *aParent)
-    : QIWithRetranslateUI<QWidget> (aParent)
+    : QIWithRetranslateUI <QWidget> (aParent)
     , mCurSnapshotItem (0)
-    , mContextMenu (new QMenu (this))
-    , mContextMenuDirty (true)
     , mEditProtector (false)
     , mSnapshotActionGroup (new QActionGroup (this))
     , mCurStateActionGroup (new QActionGroup (this))
-    , mDiscardSnapshotAction (new QAction (mSnapshotActionGroup))
-    , mTakeSnapshotAction (new QAction (this))
-    , mRevertToCurSnapAction (new QAction (mCurStateActionGroup))
-    , mShowSnapshotDetailsAction (new QAction (this))
+    , mRestoreSnapshotAction (new QAction (mSnapshotActionGroup))
+    , mDeleteSnapshotAction (new QAction (mSnapshotActionGroup))
+    , mShowSnapshotDetailsAction (new QAction (mSnapshotActionGroup))
+    , mTakeSnapshotAction (new QAction (mCurStateActionGroup))
 {
     /* Apply UI decorations */
@@ -270,7 +267,7 @@
 
     toolBar->addAction (mTakeSnapshotAction);
-    toolBar->addActions (mCurStateActionGroup->actions());
     toolBar->addSeparator();
-    toolBar->addActions (mSnapshotActionGroup->actions());
+    toolBar->addAction (mRestoreSnapshotAction);
+    toolBar->addAction (mDeleteSnapshotAction);
     toolBar->addSeparator();
     toolBar->addAction (mShowSnapshotDetailsAction);
@@ -279,42 +276,38 @@
 
     /* Setup actions */
-    mDiscardSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
+    mRestoreSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
         QSize (22, 22), QSize (16, 16),
-        ":/discard_snapshot_22px.png", ":/discard_snapshot_16px.png",
-        ":/discard_snapshot_dis_22px.png", ":/discard_snapshot_dis_16px.png"));
+        ":/discard_cur_state_22px.png", ":/discard_cur_state_16px.png", // TODO: Update Icons!
+        ":/discard_cur_state_dis_22px.png", ":/discard_cur_state_dis_16px.png")); // TODO: Update Icons!
+    mDeleteSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
+        QSize (22, 22), QSize (16, 16),
+        ":/delete_snapshot_22px.png", ":/delete_snapshot_16px.png",
+        ":/delete_snapshot_dis_22px.png", ":/delete_snapshot_dis_16px.png"));
+    mShowSnapshotDetailsAction->setIcon (VBoxGlobal::iconSetFull (
+        QSize (22, 22), QSize (16, 16),
+        ":/show_snapshot_details_22px.png", ":/show_snapshot_details_16px.png",
+        ":/show_snapshot_details_dis_22px.png", ":/show_snapshot_details_dis_16px.png"));
     mTakeSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
         QSize (22, 22), QSize (16, 16),
         ":/take_snapshot_22px.png", ":/take_snapshot_16px.png",
         ":/take_snapshot_dis_22px.png", ":/take_snapshot_dis_16px.png"));
-    mRevertToCurSnapAction->setIcon (VBoxGlobal::iconSetFull (
-        QSize (22, 22), QSize (16, 16),
-        ":/discard_cur_state_22px.png", ":/discard_cur_state_16px.png",
-        ":/discard_cur_state_dis_22px.png", ":/discard_cur_state_dis_16px.png"));
-    mShowSnapshotDetailsAction->setIcon (VBoxGlobal::iconSetFull (
-        QSize (22, 22), QSize (16, 16),
-        ":/show_snapshot_details_22px.png", ":/show_snapshot_details_16px.png",
-        ":/show_snapshot_details_dis_22px.png", ":/show_snapshot_details_dis_16px.png"));
-
-    mDiscardSnapshotAction->setShortcut (QString ("Ctrl+Shift+D"));
+
+    mRestoreSnapshotAction->setShortcut (QString ("Ctrl+Shift+R"));
+    mDeleteSnapshotAction->setShortcut (QString ("Ctrl+Shift+D"));
+    mShowSnapshotDetailsAction->setShortcut (QString ("Ctrl+Space"));
     mTakeSnapshotAction->setShortcut (QString ("Ctrl+Shift+S"));
-    mRevertToCurSnapAction->setShortcut (QString ("Ctrl+Shift+R"));
-    mShowSnapshotDetailsAction->setShortcut (QString ("Ctrl+Space"));
 
     /* Setup connections */
     connect (mTreeWidget, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
-             this, SLOT (onCurrentChanged (QTreeWidgetItem*, QTreeWidgetItem*)));
+             this, SLOT (onCurrentChanged (QTreeWidgetItem*)));
     connect (mTreeWidget, SIGNAL (customContextMenuRequested (const QPoint&)),
              this, SLOT (onContextMenuRequested (const QPoint&)));
     connect (mTreeWidget, SIGNAL (itemChanged (QTreeWidgetItem*, int)),
-             this, SLOT (onItemChanged (QTreeWidgetItem*, int)));
-
-    connect (mDiscardSnapshotAction, SIGNAL (triggered()),
-             this, SLOT (discardSnapshot()));
-    connect (mTakeSnapshotAction, SIGNAL (triggered()),
-             this, SLOT (takeSnapshot()));
-    connect (mRevertToCurSnapAction, SIGNAL (triggered()),
-             this, SLOT (discardCurState()));
-    connect (mShowSnapshotDetailsAction, SIGNAL (triggered()),
-             this, SLOT (showSnapshotDetails()));
+             this, SLOT (onItemChanged (QTreeWidgetItem*)));
+
+    connect (mRestoreSnapshotAction, SIGNAL (triggered()), this, SLOT (restoreSnapshot()));
+    connect (mDeleteSnapshotAction, SIGNAL (triggered()), this, SLOT (deleteSnapshot()));
+    connect (mShowSnapshotDetailsAction, SIGNAL (triggered()), this, SLOT (showSnapshotDetails()));
+    connect (mTakeSnapshotAction, SIGNAL (triggered()), this, SLOT (takeSnapshot()));
 
     connect (&vboxGlobal(), SIGNAL (machineDataChanged (const VBoxMachineDataChangeEvent&)),
@@ -324,8 +317,4 @@
     connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent&)),
              this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent&)));
-#if 0
-    connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent&)),
-             this, SLOT (snapshotChanged (const VBoxSnapshotEvent&)));
-#endif
 
     retranslateUi();
@@ -351,15 +340,13 @@
 
 
-void VBoxSnapshotsWgt::onCurrentChanged (QTreeWidgetItem *aItem,
-                                         QTreeWidgetItem* /* old */)
+void VBoxSnapshotsWgt::onCurrentChanged (QTreeWidgetItem *aItem)
 {
     /* Make the selected item visible */
-    if (aItem)
-    {
-        SnapshotWgtItem *item = static_cast<SnapshotWgtItem*> (aItem);
+    SnapshotWgtItem *item = aItem ? static_cast <SnapshotWgtItem*> (aItem) : 0;
+    if (item)
+    {
         mTreeWidget->horizontalScrollBar()->setValue (0);
         mTreeWidget->scrollToItem (item);
-        mTreeWidget->horizontalScrollBar()->setValue (
-            mTreeWidget->indentation() * item->level());
+        mTreeWidget->horizontalScrollBar()->setValue (mTreeWidget->indentation() * item->level());
     }
 
@@ -368,20 +355,12 @@
 
     /* Enable/disable snapshot actions */
-    mSnapshotActionGroup->setEnabled (!busy &&
-        aItem && mCurSnapshotItem && aItem != mCurSnapshotItem->child (0));
+    mSnapshotActionGroup->setEnabled (!busy && mCurSnapshotItem && item && !item->isCurrentStateItem());
 
     /* Enable/disable the details action regardles of the session state */
-    mShowSnapshotDetailsAction->setEnabled (
-        aItem && mCurSnapshotItem && aItem != mCurSnapshotItem->child (0));
+    mShowSnapshotDetailsAction->setEnabled (mCurSnapshotItem && item && !item->isCurrentStateItem());
 
     /* Enable/disable current state actions */
-    mCurStateActionGroup->setEnabled (!busy &&
-        aItem && mCurSnapshotItem && aItem == mCurSnapshotItem->child (0));
-
-    /* The Take Snapshot action is always enabled for the current state */
-    mTakeSnapshotAction->setEnabled ((!busy && mCurStateActionGroup->isEnabled()) ||
-                                     (aItem && !mCurSnapshotItem));
-
-    mContextMenuDirty = true;
+    mCurStateActionGroup->setEnabled (!busy && mCurSnapshotItem && item && item->isCurrentStateItem() ||
+                                      item && !mCurSnapshotItem);
 }
 
@@ -389,65 +368,50 @@
 {
     QTreeWidgetItem *item = mTreeWidget->itemAt (aPoint);
-    if (!item)
-        return;
-
-    if (mContextMenuDirty)
-    {
-        mContextMenu->clear();
-
-        if (!mCurSnapshotItem)
-        {
-            /* We have only one item -- current state */
-            mContextMenu->addAction (mTakeSnapshotAction);
-            mContextMenu->addActions (mCurStateActionGroup->actions());
-        }
-        else
-        {
-            if (item == mCurSnapshotItem->child (0))
-            {
-                /* Current state is selected */
-                mContextMenu->addAction (mTakeSnapshotAction);
-                mContextMenu->addActions (mCurStateActionGroup->actions());
-            }
-            else
-            {
-                /* Snapshot is selected */
-                mContextMenu->addActions (mSnapshotActionGroup->actions());
-                mContextMenu->addSeparator();
-                mContextMenu->addAction (mShowSnapshotDetailsAction);
-            }
-        }
-
-        mContextMenuDirty = false;
-    }
-
-    mContextMenu->exec (mTreeWidget->viewport()->mapToGlobal (aPoint));
-}
-
-void VBoxSnapshotsWgt::onItemChanged (QTreeWidgetItem *aItem, int)
+    SnapshotWgtItem *snapshotItem = item ? static_cast <SnapshotWgtItem*> (item) : 0;
+    if (!snapshotItem)
+        return;
+
+    QMenu menu;
+
+    if (mCurSnapshotItem && !snapshotItem->isCurrentStateItem())
+    {
+        menu.addAction (mRestoreSnapshotAction);
+        menu.addAction (mDeleteSnapshotAction);
+        menu.addSeparator();
+        menu.addAction (mShowSnapshotDetailsAction);
+    }
+    else
+        menu.addAction (mTakeSnapshotAction);
+
+    menu.exec (mTreeWidget->viewport()->mapToGlobal (aPoint));
+}
+
+void VBoxSnapshotsWgt::onItemChanged (QTreeWidgetItem *aItem)
 {
     if (mEditProtector)
         return;
 
-    SnapshotWgtItem *item = aItem ? static_cast<SnapshotWgtItem*> (aItem) : 0;
+    SnapshotWgtItem *item = aItem ? static_cast <SnapshotWgtItem*> (aItem) : 0;
 
     if (item)
     {
         CSnapshot snap = mMachine.GetSnapshot (item->snapshotId());
-        if (!snap.isNull() && snap.isOk() &&
-            snap.GetName() != item->text (0))
+        if (!snap.isNull() && snap.isOk() && snap.GetName() != item->text (0))
             snap.SetName (item->text (0));
     }
 }
 
-
-void VBoxSnapshotsWgt::discardSnapshot()
-{
-    SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
-        static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
+void VBoxSnapshotsWgt::restoreSnapshot()
+{
+    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
+        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
     AssertReturn (item, (void) 0);
 
     QString snapId = item->snapshotId();
     AssertReturn (!snapId.isNull(), (void) 0);
+    CSnapshot snapshot = mMachine.GetSnapshot (snapId);
+
+    if (!vboxProblem().askAboutSnapshotRestoring (snapshot.GetName()))
+        return;
 
     /* Open a direct session (this call will handle all errors) */
@@ -456,8 +420,6 @@
         return;
 
-    QString snapName = mMachine.GetSnapshot (snapId).GetName();
-
     CConsole console = session.GetConsole();
-    CProgress progress = console.DeleteSnapshot(snapId);
+    CProgress progress = console.RestoreSnapshot (snapshot);
     if (console.isOk())
     {
@@ -467,16 +429,69 @@
 
         if (progress.GetResultCode() != 0)
-            vboxProblem().cannotDiscardSnapshot (progress, snapName);
+            vboxProblem().cannotRestoreSnapshot (progress, snapshot.GetName());
     }
     else
-        vboxProblem().cannotDiscardSnapshot (console, snapName);
+        vboxProblem().cannotRestoreSnapshot (progress, snapshot.GetName());
 
     session.Close();
 }
 
+void VBoxSnapshotsWgt::deleteSnapshot()
+{
+    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
+        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
+    AssertReturn (item, (void) 0);
+
+    QString snapId = item->snapshotId();
+    AssertReturn (!snapId.isNull(), (void) 0);
+    CSnapshot snapshot = mMachine.GetSnapshot (snapId);
+
+    if (!vboxProblem().askAboutSnapshotDeleting (snapshot.GetName()))
+        return;
+
+    /* Open a direct session (this call will handle all errors) */
+    CSession session = vboxGlobal().openSession (mMachineId);
+    if (session.isNull())
+        return;
+
+    CConsole console = session.GetConsole();
+    CProgress progress = console.DeleteSnapshot (snapId);
+    if (console.isOk())
+    {
+        /* Show the progress dialog */
+        vboxProblem().showModalProgressDialog (progress, mMachine.GetName(),
+                                               vboxProblem().mainWindowShown());
+
+        if (progress.GetResultCode() != 0)
+            vboxProblem().cannotDeleteSnapshot (progress,  snapshot.GetName());
+    }
+    else
+        vboxProblem().cannotDeleteSnapshot (console,  snapshot.GetName());
+
+    session.Close();
+}
+
+void VBoxSnapshotsWgt::showSnapshotDetails()
+{
+    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
+        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
+    AssertReturn (item, (void) 0);
+
+    CSnapshot snap = item->snapshot();
+    AssertReturn (!snap.isNull(), (void) 0);
+
+    CMachine snapMachine = snap.GetMachine();
+
+    VBoxSnapshotDetailsDlg dlg (this);
+    dlg.getFromSnapshot (snap);
+
+    if (dlg.exec() == QDialog::Accepted)
+        dlg.putBackToSnapshot();
+}
+
 void VBoxSnapshotsWgt::takeSnapshot()
 {
-    SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
-        static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
+    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
+        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
     AssertReturn (item, (void) 0);
 
@@ -510,7 +525,6 @@
 
         CConsole console = session.GetConsole();
-        CProgress progress =
-                console.TakeSnapshot (dlg.mLeName->text().trimmed(),
-                                      dlg.mTeDescription->toPlainText());
+        CProgress progress = console.TakeSnapshot (dlg.mLeName->text().trimmed(),
+                                                   dlg.mTeDescription->toPlainText());
         if (console.isOk())
         {
@@ -529,115 +543,36 @@
 }
 
-void VBoxSnapshotsWgt::discardCurState()
-{
-    if (!vboxProblem().askAboutSnapshotDiscarding())
-        return;
-
-    SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
-        static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
-    AssertReturn (item, (void) 0);
-
-    /* Open a direct session (this call will handle all errors) */
-    CSession session = vboxGlobal().openSession (mMachineId);
-    if (session.isNull())
-        return;
-
-    CConsole console = session.GetConsole();
-    CProgress progress = console.RestoreSnapshot(mMachine.GetCurrentSnapshot());
-    if (console.isOk())
-    {
-        /* show the progress dialog */
-        vboxProblem().showModalProgressDialog (progress, mMachine.GetName(),
-                                               vboxProblem().mainWindowShown());
-
-        if (progress.GetResultCode() != 0)
-            vboxProblem().cannotDiscardCurrentState (progress);
-    }
-    else
-        vboxProblem().cannotDiscardCurrentState (console);
-
-    session.Close();
-}
-
-void VBoxSnapshotsWgt::showSnapshotDetails()
-{
-    SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
-        static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
-    AssertReturn (item, (void) 0);
-
-    CSnapshot snap = item->snapshot();
-    AssertReturn (!snap.isNull(), (void) 0);
-
-    CMachine snapMachine = snap.GetMachine();
-
-    VBoxSnapshotDetailsDlg dlg (this);
-    dlg.getFromSnapshot (snap);
-
-    if (dlg.exec() == QDialog::Accepted)
-        dlg.putBackToSnapshot();
-}
-
-
-void VBoxSnapshotsWgt::machineDataChanged (const VBoxMachineDataChangeEvent &aE)
+
+void VBoxSnapshotsWgt::machineDataChanged (const VBoxMachineDataChangeEvent &aEvent)
 {
     SnapshotEditBlocker guardBlock (mEditProtector);
 
-    if (aE.id != mMachineId)
-        return; /* not interested in other machines */
+    if (aEvent.id != mMachineId)
+        return;
 
     curStateItem()->recache();
 }
 
-void VBoxSnapshotsWgt::machineStateChanged (const VBoxMachineStateChangeEvent &aE)
+void VBoxSnapshotsWgt::machineStateChanged (const VBoxMachineStateChangeEvent &aEvent)
 {
     SnapshotEditBlocker guardBlock (mEditProtector);
 
-    if (aE.id != mMachineId)
-        return; /* not interested in other machines */
+    if (aEvent.id != mMachineId)
+        return;
 
     curStateItem()->recache();
-    curStateItem()->updateCurrentState (aE.state);
-}
-
-void VBoxSnapshotsWgt::sessionStateChanged (const VBoxSessionStateChangeEvent &aE)
+    curStateItem()->updateCurrentState (aEvent.state);
+}
+
+void VBoxSnapshotsWgt::sessionStateChanged (const VBoxSessionStateChangeEvent &aEvent)
 {
     SnapshotEditBlocker guardBlock (mEditProtector);
 
-    if (aE.id != mMachineId)
-        return; /* not interested in other machines */
-
-    mSessionState = aE.state;
-    onCurrentChanged (mTreeWidget->selectedItems().isEmpty() ? 0 :
-                      mTreeWidget->selectedItems() [0]);
-}
-
-#if 0
-void VBoxSnapshotsWgt::snapshotChanged (const VBoxSnapshotEvent &aE)
-{
-    SnapshotEditBlocker guardBlock (mEditProtector);
-
-    if (aE.machineId != mMachineId)
-        return; /* not interested in other machines */
-
-    switch (aE.what)
-    {
-        case VBoxSnapshotEvent::Taken:
-        case VBoxSnapshotEvent::Discarded:
-        {
-            refreshAll();
-            break;
-        }
-        case VBoxSnapshotEvent::Changed:
-        {
-            SnapshotWgtItem *lvi = findItem (aE.snapshotId);
-            if (!lvi)
-                refreshAll (false);
-            else
-                lvi->recache();
-            break;
-        }
-    }
-}
-#endif
+    if (aEvent.id != mMachineId)
+        return;
+
+    mSessionState = aEvent.state;
+    onCurrentChanged (mTreeWidget->currentItem());
+}
 
 void VBoxSnapshotsWgt::retranslateUi()
@@ -646,51 +581,47 @@
     Ui::VBoxSnapshotsWgt::retranslateUi (this);
 
-    mDiscardSnapshotAction->setText (tr ("&Discard Snapshot"));
+    mRestoreSnapshotAction->setText (tr ("&Restore Snapshot"));
+    mDeleteSnapshotAction->setText (tr ("&Delete Snapshot"));
+    mShowSnapshotDetailsAction->setText (tr ("S&how Details"));
     mTakeSnapshotAction->setText (tr ("Take &Snapshot"));
-    mRevertToCurSnapAction->setText (tr ("&Revert to Current Snapshot"));
-    mShowSnapshotDetailsAction->setText (tr ("S&how Details"));
-
-    mDiscardSnapshotAction->setStatusTip (tr ("Discard the selected snapshot of the virtual machine"));
+
+    mRestoreSnapshotAction->setStatusTip (tr ("Restore the selected snapshot of the virtual machine"));
+    mDeleteSnapshotAction->setStatusTip (tr ("Delete the selected snapshot of the virtual machine"));
+    mShowSnapshotDetailsAction->setStatusTip (tr ("Show details of the selected snapshot"));
     mTakeSnapshotAction->setStatusTip (tr ("Take a snapshot of the current virtual machine state"));
-    mRevertToCurSnapAction->setStatusTip (tr ("Restore the virtual machine state from the state stored in the current snapshot"));
-    mShowSnapshotDetailsAction->setStatusTip (tr ("Show details of the selected snapshot"));
-
-    mDiscardSnapshotAction->setToolTip (mDiscardSnapshotAction->text().remove ('&').remove ('.') +
-        QString (" (%1)").arg (mDiscardSnapshotAction->shortcut().toString()));
+
+    mRestoreSnapshotAction->setToolTip (mRestoreSnapshotAction->text().remove ('&').remove ('.') +
+        QString (" (%1)").arg (mRestoreSnapshotAction->shortcut().toString()));
+    mDeleteSnapshotAction->setToolTip (mDeleteSnapshotAction->text().remove ('&').remove ('.') +
+        QString (" (%1)").arg (mDeleteSnapshotAction->shortcut().toString()));
+    mShowSnapshotDetailsAction->setToolTip (mShowSnapshotDetailsAction->text().remove ('&').remove ('.') +
+        QString (" (%1)").arg (mShowSnapshotDetailsAction->shortcut().toString()));
     mTakeSnapshotAction->setToolTip (mTakeSnapshotAction->text().remove ('&').remove ('.') +
         QString (" (%1)").arg (mTakeSnapshotAction->shortcut().toString()));
-    mRevertToCurSnapAction->setToolTip (mRevertToCurSnapAction->text().remove ('&').remove ('.') +
-        QString (" (%1)").arg (mRevertToCurSnapAction->shortcut().toString()));
-    mShowSnapshotDetailsAction->setToolTip (mShowSnapshotDetailsAction->text().remove ('&').remove ('.') +
-        QString (" (%1)").arg (mShowSnapshotDetailsAction->shortcut().toString()));
-}
-
-void VBoxSnapshotsWgt::refreshAll (bool aKeepSelected /* = true */)
+}
+
+void VBoxSnapshotsWgt::refreshAll()
 {
     SnapshotEditBlocker guardBlock (mEditProtector);
 
-    QString selected, selectedFirstChild;
-    if (aKeepSelected)
-    {
-        SnapshotWgtItem *cur = mTreeWidget->selectedItems().isEmpty() ? 0 :
-            static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
-        if (cur)
-        {
-            selected = cur->snapshotId();
-            if (cur->child (0))
-                selectedFirstChild =
-                    static_cast<SnapshotWgtItem*> (cur->child (0))->snapshotId();
-        }
+    if (mMachine.isNull())
+    {
+        onCurrentChanged();
+        return;
+    }
+
+    QString selectedItem, firstChildOfSelectedItem;
+    SnapshotWgtItem *cur = !mTreeWidget->currentItem() ? 0 :
+        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
+    if (cur)
+    {
+        selectedItem = cur->snapshotId();
+        if (cur->child (0))
+            firstChildOfSelectedItem = static_cast <SnapshotWgtItem*> (cur->child (0))->snapshotId();
     }
 
     mTreeWidget->clear();
 
-    if (mMachine.isNull())
-    {
-        onCurrentChanged (NULL);
-        return;
-    }
-
-    /* get the first snapshot */
+    /* Get the first snapshot */
     if (mMachine.GetSnapshotCount() > 0)
     {
@@ -700,16 +631,13 @@
         Assert (mCurSnapshotItem);
 
-        /* add the "current state" item */
+        /* Add the "current state" item */
         new SnapshotWgtItem (mCurSnapshotItem, mMachine);
 
-        SnapshotWgtItem *cur = 0;
-        if (aKeepSelected)
-        {
-            cur = findItem (selected);
-            if (cur == 0)
-                cur = findItem (selectedFirstChild);
-        }
+        SnapshotWgtItem *cur = findItem (selectedItem);
+        if (cur == 0)
+            cur = findItem (firstChildOfSelectedItem);
         if (cur == 0)
             cur = curStateItem();
+
         mTreeWidget->scrollToItem (cur);
         mTreeWidget->setCurrentItem (cur);
@@ -720,6 +648,7 @@
         mCurSnapshotItem = 0;
 
-        /* add the "current state" item */
+        /* Add the "current state" item */
         SnapshotWgtItem *csi = new SnapshotWgtItem (mTreeWidget, mMachine);
+
         mTreeWidget->setCurrentItem (csi);
         onCurrentChanged (csi);
@@ -734,5 +663,5 @@
     while (*it)
     {
-        SnapshotWgtItem *lvi = static_cast<SnapshotWgtItem*> (*it);
+        SnapshotWgtItem *lvi = static_cast <SnapshotWgtItem*> (*it);
         if (lvi->snapshotId() == aSnapshotId)
             return lvi;
@@ -745,31 +674,28 @@
 SnapshotWgtItem *VBoxSnapshotsWgt::curStateItem()
 {
-    QTreeWidgetItem *csi = mCurSnapshotItem ? mCurSnapshotItem->child (0)
-                         : mTreeWidget->invisibleRootItem()->child (0);
+    QTreeWidgetItem *csi = mCurSnapshotItem ?
+                           mCurSnapshotItem->child (mCurSnapshotItem->childCount() - 1) :
+                           mTreeWidget->invisibleRootItem()->child (0);
     Assert (csi);
-    return static_cast<SnapshotWgtItem*> (csi);
-}
-
-void VBoxSnapshotsWgt::populateSnapshots (const CSnapshot &aSnapshot, QTreeWidgetItem *item)
-{
-    SnapshotWgtItem *si = 0;
-    si = item ? new SnapshotWgtItem (item, aSnapshot) :
-                new SnapshotWgtItem (mTreeWidget, aSnapshot);
+    return static_cast <SnapshotWgtItem*> (csi);
+}
+
+void VBoxSnapshotsWgt::populateSnapshots (const CSnapshot &aSnapshot, QTreeWidgetItem *aItem)
+{
+    SnapshotWgtItem *item = aItem ? new SnapshotWgtItem (aItem, aSnapshot) :
+                                    new SnapshotWgtItem (mTreeWidget, aSnapshot);
 
     if (mMachine.GetCurrentSnapshot().GetId() == aSnapshot.GetId())
     {
-        si->setBold (true);
-        mCurSnapshotItem = si;
-    }
-
-    CSnapshotVector snapvec = aSnapshot.GetChildren();
-    for (int i = 0; i < snapvec.size(); ++i)
-    {
-        CSnapshot sn = snapvec[i];
-        populateSnapshots (sn, si);
-    }
-
-    si->setExpanded (true);
-    si->setFlags (si->flags() | Qt::ItemIsEditable);
-}
-
+        item->setBold (true);
+        mCurSnapshotItem = item;
+    }
+
+    CSnapshotVector snapshots = aSnapshot.GetChildren();
+    foreach (const CSnapshot &snapshot, snapshots)
+        populateSnapshots (snapshot, item);
+
+    item->setExpanded (true);
+    item->setFlags (item->flags() | Qt::ItemIsEditable);
+}
+
