VirtualBox

Changeset 23924 in vbox


Ignore:
Timestamp:
Oct 20, 2009 6:56:51 PM (15 years ago)
Author:
vboxsync
Message:

FE/Qt4: Snapshots processing (VM Selector Page) algorithms update (1st revision).

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
6 edited
4 moved

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc

    r23580 r23924  
    135135    <file alias="discard_cur_state_snapshot_dis_16px.png">images/discard_cur_state_snapshot_dis_16px.png</file>
    136136    <file alias="discard_cur_state_snapshot_dis_22px.png">images/discard_cur_state_snapshot_dis_22px.png</file>
    137     <file alias="discard_snapshot_16px.png">images/discard_snapshot_16px.png</file>
    138     <file alias="discard_snapshot_22px.png">images/discard_snapshot_22px.png</file>
    139     <file alias="discard_snapshot_dis_16px.png">images/discard_snapshot_dis_16px.png</file>
    140     <file alias="discard_snapshot_dis_22px.png">images/discard_snapshot_dis_22px.png</file>
     137    <file alias="delete_snapshot_16px.png">images/delete_snapshot_16px.png</file>
     138    <file alias="delete_snapshot_22px.png">images/delete_snapshot_22px.png</file>
     139    <file alias="delete_snapshot_dis_16px.png">images/delete_snapshot_dis_16px.png</file>
     140    <file alias="delete_snapshot_dis_22px.png">images/delete_snapshot_dis_22px.png</file>
    141141    <file alias="take_snapshot_16px.png">images/take_snapshot_16px.png</file>
    142142    <file alias="take_snapshot_22px.png">images/take_snapshot_22px.png</file>
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r23585 r23924  
    209209
    210210    void cannotSetSnapshotFolder (const CMachine &aMachine, const QString &aPath);
    211     bool askAboutSnapshotAndStateDiscarding();
    212     bool askAboutSnapshotDiscarding();
    213     void cannotDiscardSnapshot (const CConsole &aConsole,
    214                                 const QString &aSnapshotName);
    215     void cannotDiscardSnapshot (const CProgress &aProgress,
    216                                 const QString &aSnapshotName);
    217     void cannotDiscardCurrentState (const CConsole &console);
    218     void cannotDiscardCurrentState (const CProgress &progress);
    219     void cannotDiscardCurrentSnapshotAndState (const CConsole &console);
    220     void cannotDiscardCurrentSnapshotAndState (const CProgress &progress);
     211
     212    bool askAboutSnapshotRestoring (const QString &aSnapshotName);
     213    bool askAboutSnapshotDeleting (const QString &aSnapshotName);
     214    void cannotRestoreSnapshot (const CConsole &aConsole, const QString &aSnapshotName);
     215    void cannotRestoreSnapshot (const CProgress &aProgress, const QString &aSnapshotName);
     216    void cannotDeleteSnapshot (const CConsole &aConsole, const QString &aSnapshotName);
     217    void cannotDeleteSnapshot (const CProgress &aProgress, const QString &aSnapshotName);
    221218
    222219    void cannotFindMachineByName (const CVirtualBox &vbox, const QString &name);
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxSnapshotsWgt.h

    r23879 r23924  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2424#define __VBoxSnapshotsWgt_h__
    2525
     26/* Local includes */
    2627#include "VBoxSnapshotsWgt.gen.h"
    2728#include "VBoxGlobal.h"
    2829#include "QIWithRetranslateUI.h"
    2930
    30 /* Qt includes */
    31 #include <QUuid>
    32 
     31/* Local forwards */
    3332class SnapshotWgtItem;
    3433
    35 class QMenu;
    36 
    37 class VBoxSnapshotsWgt : public QIWithRetranslateUI<QWidget>,
    38                          public Ui::VBoxSnapshotsWgt
     34class VBoxSnapshotsWgt : public QIWithRetranslateUI <QWidget>, public Ui::VBoxSnapshotsWgt
    3935{
    4036    Q_OBJECT;
     
    5248private slots:
    5349
    54     void onCurrentChanged (QTreeWidgetItem *aNewItem,
    55                            QTreeWidgetItem *aOldItem = 0);
     50    void onCurrentChanged (QTreeWidgetItem *aItem = 0);
    5651    void onContextMenuRequested (const QPoint &aPoint);
    57     void onItemChanged (QTreeWidgetItem *aItem, int aColumn);
     52    void onItemChanged (QTreeWidgetItem *aItem);
    5853
    59     void discardSnapshot();
     54    void restoreSnapshot();
     55    void deleteSnapshot();
     56    void showSnapshotDetails();
    6057    void takeSnapshot();
    61     void discardCurState();
    62     void showSnapshotDetails();
    6358
    64     void machineDataChanged (const VBoxMachineDataChangeEvent &aE);
    65     void machineStateChanged (const VBoxMachineStateChangeEvent &aE);
    66     void sessionStateChanged (const VBoxSessionStateChangeEvent &aE);
    67 #if 0
    68     void snapshotChanged (const VBoxSnapshotEvent &aE);
    69 #endif
     59    void machineDataChanged (const VBoxMachineDataChangeEvent &aEvent);
     60    void machineStateChanged (const VBoxMachineStateChangeEvent &aEvent);
     61    void sessionStateChanged (const VBoxSessionStateChangeEvent &aEvent);
    7062
    7163private:
    7264
    73     void refreshAll (bool aKeepSelected = true);
     65    void refreshAll();
    7466    SnapshotWgtItem* findItem (const QString &aSnapshotId);
    7567    SnapshotWgtItem* curStateItem();
     
    8072    KSessionState    mSessionState;
    8173    SnapshotWgtItem *mCurSnapshotItem;
    82     QMenu           *mContextMenu;
    83     bool             mContextMenuDirty;
    8474    bool             mEditProtector;
    8575
     
    8777    QActionGroup    *mCurStateActionGroup;
    8878
    89     QAction         *mDiscardSnapshotAction;
     79    QAction         *mRestoreSnapshotAction;
     80    QAction         *mDeleteSnapshotAction;
     81    QAction         *mShowSnapshotDetailsAction;
    9082    QAction         *mTakeSnapshotAction;
    91     QAction         *mRevertToCurSnapAction;
    92     QAction         *mShowSnapshotDetailsAction;
    9383};
    9484
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp

    r23879 r23924  
    13881388                        if (dlg.mCbDiscardCurState->isChecked() && dlg.mCbDiscardCurState->isVisibleTo (&dlg))
    13891389                        {
    1390                             CProgress progress = console.RestoreSnapshot(machine.GetCurrentSnapshot());
     1390                            CSnapshot snapshot = machine.GetCurrentSnapshot();
     1391                            CProgress progress = console.RestoreSnapshot (snapshot);
    13911392                            if (console.isOk())
    13921393                            {
     
    13941395                                vboxProblem().showModalProgressDialog (progress, machine.GetName(), this);
    13951396                                if (progress.GetResultCode() != 0)
    1396                                     vboxProblem().cannotDiscardCurrentState (progress);
     1397                                    vboxProblem().cannotRestoreSnapshot (progress, snapshot.GetName());
    13971398                            }
    13981399                            else
    1399                                 vboxProblem().cannotDiscardCurrentState (console);
     1400                                vboxProblem().cannotRestoreSnapshot (console, snapshot.GetName());
    14001401                        }
    14011402                    }
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r23585 r23924  
    804804}
    805805
    806 bool VBoxProblemReporter::askAboutSnapshotDiscarding()
     806bool VBoxProblemReporter::askAboutSnapshotRestoring (const QString &aSnapshotName)
    807807{
    808808    return messageOkCancel (mainWindowShown(), Question,
    809         tr ("<p>Are you sure you wish to merge the selected snapshot?</p>"),
    810         "confirmSnapshotDiscarding" /* aAutoConfirmId */,
    811         tr ("Discard"), tr ("Cancel"));
    812 }
    813 
    814 bool VBoxProblemReporter::askAboutSnapshotAndStateDiscarding()
     809        tr ("<p>Are you sure you wish to restore the selected snapshot <b>%1</b>? "
     810            "This will also cause you to lose your current machine state.</p>")
     811            .arg (aSnapshotName),
     812        "confirmSnapshotRestoring" /* aAutoConfirmId */,
     813        tr ("Restore"), tr ("Cancel"));
     814}
     815
     816bool VBoxProblemReporter::askAboutSnapshotDeleting (const QString &aSnapshotName)
    815817{
    816818    return messageOkCancel (mainWindowShown(), Question,
    817         tr ("<p>Are you sure you wish to delete the selected snapshot "
    818             "and saved state?</p>"),
    819         "confirmSnapshotAndStateDiscarding" /* aAutoConfirmId */,
    820         tr ("Discard"), tr ("Cancel"));
    821 }
    822 
    823 void VBoxProblemReporter::cannotDiscardSnapshot (const CConsole &aConsole,
     819        tr ("<p>Are you sure you wish to delete the selected snapshot <b>%1</b>?</p>")
     820            .arg (aSnapshotName),
     821        "confirmSnapshotDeleting" /* aAutoConfirmId */,
     822        tr ("Delete"), tr ("Cancel"));
     823}
     824
     825void VBoxProblemReporter::cannotRestoreSnapshot (const CConsole &aConsole,
    824826                                                 const QString &aSnapshotName)
    825827{
    826828    message (mainWindowShown(), Error,
    827         tr ("Failed to discard the snapshot <b>%1</b> of the virtual "
    828             "machine <b>%2</b>.")
     829        tr ("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    829830            .arg (aSnapshotName)
    830831            .arg (CConsole (aConsole).GetMachine().GetName()),
     
    832833}
    833834
    834 void VBoxProblemReporter::cannotDiscardSnapshot (const CProgress &aProgress,
     835void VBoxProblemReporter::cannotRestoreSnapshot (const CProgress &aProgress,
    835836                                                 const QString &aSnapshotName)
    836837{
     
    838839
    839840    message (mainWindowShown(), Error,
    840         tr ("Failed to discard the snapshot <b>%1</b> of the virtual "
    841             "machine <b>%2</b>.")
     841        tr ("Failed to restore the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
    842842            .arg (aSnapshotName)
    843843            .arg (console.GetMachine().GetName()),
     
    845845}
    846846
    847 void VBoxProblemReporter::cannotDiscardCurrentState (const CConsole &console)
    848 {
    849     message (
    850         mainWindowShown(),
    851         Error,
    852         tr ("Failed to discard the current state of the virtual "
    853             "machine <b>%1</b>.")
    854             .arg (CConsole (console).GetMachine().GetName()),
    855         formatErrorInfo (console));
    856 }
    857 
    858 void VBoxProblemReporter::cannotDiscardCurrentState (const CProgress &progress)
    859 {
    860     CConsole console (CProgress (progress).GetInitiator());
    861 
    862     message (
    863         mainWindowShown(),
    864         Error,
    865         tr ("Failed to discard the current state of the virtual "
    866             "machine <b>%1</b>.")
     847void VBoxProblemReporter::cannotDeleteSnapshot (const CConsole &aConsole,
     848                                                const QString &aSnapshotName)
     849{
     850    message (mainWindowShown(), Error,
     851        tr ("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     852            .arg (aSnapshotName)
     853            .arg (CConsole (aConsole).GetMachine().GetName()),
     854        formatErrorInfo (aConsole));
     855}
     856
     857void VBoxProblemReporter::cannotDeleteSnapshot (const CProgress &aProgress,
     858                                                const QString &aSnapshotName)
     859{
     860    CConsole console (CProgress (aProgress).GetInitiator());
     861
     862    message (mainWindowShown(), Error,
     863        tr ("Failed to delete the snapshot <b>%1</b> of the virtual machine <b>%2</b>.")
     864            .arg (aSnapshotName)
    867865            .arg (console.GetMachine().GetName()),
    868         formatErrorInfo (progress.GetErrorInfo()));
    869 }
    870 
    871 void VBoxProblemReporter::cannotDiscardCurrentSnapshotAndState (const CConsole &console)
    872 {
    873     message (
    874         mainWindowShown(),
    875         Error,
    876         tr ("Failed to discard the current snapshot and the current state "
    877             "of the virtual machine <b>%1</b>.")
    878             .arg (CConsole (console).GetMachine().GetName()),
    879         formatErrorInfo (console));
    880 }
    881 
    882 void VBoxProblemReporter::cannotDiscardCurrentSnapshotAndState (const CProgress &progress)
    883 {
    884     CConsole console (CProgress (progress).GetInitiator());
    885 
    886     message (
    887         mainWindowShown(),
    888         Error,
    889         tr ("Failed to discard the current snapshot and the current state "
    890             "of the virtual machine <b>%1</b>.")
    891             .arg (console.GetMachine().GetName()),
    892         formatErrorInfo (progress.GetErrorInfo()));
     866        formatErrorInfo (aProgress.GetErrorInfo()));
    893867}
    894868
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp

    r23879 r23924  
    66
    77/*
    8  * Copyright (C) 2006-2008 Sun Microsystems, Inc.
     8 * Copyright (C) 2006-2009 Sun Microsystems, Inc.
    99 *
    1010 * This file is part of VirtualBox Open Source Edition (OSE), as
     
    2121 */
    2222
     23/* Global includes */
     24#include <QDateTime>
     25#include <QHeaderView>
     26#include <QMenu>
     27#include <QScrollBar>
     28
     29/* Local includes */
    2330#include <VBoxSnapshotsWgt.h>
    2431#include <VBoxProblemReporter.h>
     
    2734#include <VBoxToolBar.h>
    2835
    29 /* Qt includes */
    30 #include <QMenu>
    31 #include <QHeaderView>
    32 #include <QScrollBar>
    33 #include <QDateTime>
    34 
    35 /** QListViewItem subclass for snapshots items */
     36/**
     37 *  QTreeWidgetItem subclass for snapshots items
     38 */
    3639class SnapshotWgtItem : public QTreeWidgetItem
    3740{
    3841public:
    3942
    40     /** Normal snapshot item */
     43    /* Normal snapshot item (child of tree-widget) */
    4144    SnapshotWgtItem (QTreeWidget *aTreeWidget, const CSnapshot &aSnapshot)
    4245        : QTreeWidgetItem (aTreeWidget)
     
    4649    }
    4750
    48     /** Normal snapshot item */
     51    /* Normal snapshot item (child of tree-widget-item) */
    4952    SnapshotWgtItem (QTreeWidgetItem *aRootItem, const CSnapshot &aSnapshot)
    5053        : QTreeWidgetItem (aRootItem)
     
    5457    }
    5558
    56     /** Current state item */
     59    /* Current state item (child of tree-widget) */
    5760    SnapshotWgtItem (QTreeWidget *aTreeWidget, const CMachine &aMachine)
    5861        : QTreeWidgetItem (aTreeWidget)
     
    6366    }
    6467
    65     /** Current state item */
     68    /* Current state item (child of tree-widget-item) */
    6669    SnapshotWgtItem (QTreeWidgetItem *aRootItem, const CMachine &aMachine)
    6770        : QTreeWidgetItem (aRootItem)
     
    7073        updateCurrentState (mMachine.GetState());
    7174        recache();
     75    }
     76
     77    bool isCurrentStateItem() const
     78    {
     79        return mSnapshot.isNull();
    7280    }
    7381
     
    122130            mCurStateModified = mMachine.GetCurrentStateModified();
    123131            setText (0, mCurStateModified ?
    124                 VBoxSnapshotsWgt::tr ("Current State (changed)",
    125                                       "Current State (Modified)") :
    126                 VBoxSnapshotsWgt::tr ("Current State",
    127                                       "Current State (Unmodified)"));
     132                        VBoxSnapshotsWgt::tr ("Current State (changed)", "Current State (Modified)") :
     133                        VBoxSnapshotsWgt::tr ("Current State", "Current State (Unmodified)"));
    128134            mDesc = mCurStateModified ?
    129                 VBoxSnapshotsWgt::tr ("The current state differs from the state "
    130                                       "stored in the current snapshot") :
    131                 parent() != 0 ? /* we're not the only item in the view */
    132                     VBoxSnapshotsWgt::tr ("The current state is identical to the state "
    133                                           "stored in the current snapshot") :
     135                    VBoxSnapshotsWgt::tr ("The current state differs from the state stored in the current snapshot") :
     136                    parent() != 0 ?
     137                    VBoxSnapshotsWgt::tr ("The current state is identical to the state stored in the current snapshot") :
    134138                    QString::null;
    135139        }
     
    175179        if (!mSnapshot.isNull())
    176180        {
    177             /* the current snapshot is always bold */
     181            /* The current snapshot is always bold */
    178182            if (bold())
    179183                details = VBoxSnapshotsWgt::tr (" (current, ", "Snapshot details");
     
    184188
    185189            if (dateTimeToday)
    186                 dateTime = VBoxSnapshotsWgt::tr ("Taken at %1", "Snapshot (time)")
    187                     .arg (dateTime);
     190                dateTime = VBoxSnapshotsWgt::tr ("Taken at %1", "Snapshot (time)").arg (dateTime);
    188191            else
    189                 dateTime = VBoxSnapshotsWgt::tr ("Taken on %1", "Snapshot (date + time)")
    190                     .arg (dateTime);
     192                dateTime = VBoxSnapshotsWgt::tr ("Taken on %1", "Snapshot (date + time)").arg (dateTime);
    191193        }
    192194        else
    193195        {
    194196            dateTime = VBoxSnapshotsWgt::tr ("%1 since %2", "Current State (time or date + time)")
    195                 .arg (vboxGlobal().toString (mMachineState))
    196                 .arg (dateTime);
     197                .arg (vboxGlobal().toString (mMachineState)).arg (dateTime);
    197198        }
    198199
    199200        QString toolTip = QString ("<nobr><b>%1</b>%2</nobr><br><nobr>%3</nobr>")
    200             .arg (name) .arg (details)
    201             .arg (dateTime);
     201            .arg (name) .arg (details).arg (dateTime);
    202202
    203203        if (!mDesc.isEmpty())
     
    244244};
    245245
    246 
    247246VBoxSnapshotsWgt::VBoxSnapshotsWgt (QWidget *aParent)
    248     : QIWithRetranslateUI<QWidget> (aParent)
     247    : QIWithRetranslateUI <QWidget> (aParent)
    249248    , mCurSnapshotItem (0)
    250     , mContextMenu (new QMenu (this))
    251     , mContextMenuDirty (true)
    252249    , mEditProtector (false)
    253250    , mSnapshotActionGroup (new QActionGroup (this))
    254251    , mCurStateActionGroup (new QActionGroup (this))
    255     , mDiscardSnapshotAction (new QAction (mSnapshotActionGroup))
    256     , mTakeSnapshotAction (new QAction (this))
    257     , mRevertToCurSnapAction (new QAction (mCurStateActionGroup))
    258     , mShowSnapshotDetailsAction (new QAction (this))
     252    , mRestoreSnapshotAction (new QAction (mSnapshotActionGroup))
     253    , mDeleteSnapshotAction (new QAction (mSnapshotActionGroup))
     254    , mShowSnapshotDetailsAction (new QAction (mSnapshotActionGroup))
     255    , mTakeSnapshotAction (new QAction (mCurStateActionGroup))
    259256{
    260257    /* Apply UI decorations */
     
    270267
    271268    toolBar->addAction (mTakeSnapshotAction);
    272     toolBar->addActions (mCurStateActionGroup->actions());
    273269    toolBar->addSeparator();
    274     toolBar->addActions (mSnapshotActionGroup->actions());
     270    toolBar->addAction (mRestoreSnapshotAction);
     271    toolBar->addAction (mDeleteSnapshotAction);
    275272    toolBar->addSeparator();
    276273    toolBar->addAction (mShowSnapshotDetailsAction);
     
    279276
    280277    /* Setup actions */
    281     mDiscardSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
     278    mRestoreSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
    282279        QSize (22, 22), QSize (16, 16),
    283         ":/discard_snapshot_22px.png", ":/discard_snapshot_16px.png",
    284         ":/discard_snapshot_dis_22px.png", ":/discard_snapshot_dis_16px.png"));
     280        ":/discard_cur_state_22px.png", ":/discard_cur_state_16px.png", // TODO: Update Icons!
     281        ":/discard_cur_state_dis_22px.png", ":/discard_cur_state_dis_16px.png")); // TODO: Update Icons!
     282    mDeleteSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
     283        QSize (22, 22), QSize (16, 16),
     284        ":/delete_snapshot_22px.png", ":/delete_snapshot_16px.png",
     285        ":/delete_snapshot_dis_22px.png", ":/delete_snapshot_dis_16px.png"));
     286    mShowSnapshotDetailsAction->setIcon (VBoxGlobal::iconSetFull (
     287        QSize (22, 22), QSize (16, 16),
     288        ":/show_snapshot_details_22px.png", ":/show_snapshot_details_16px.png",
     289        ":/show_snapshot_details_dis_22px.png", ":/show_snapshot_details_dis_16px.png"));
    285290    mTakeSnapshotAction->setIcon (VBoxGlobal::iconSetFull (
    286291        QSize (22, 22), QSize (16, 16),
    287292        ":/take_snapshot_22px.png", ":/take_snapshot_16px.png",
    288293        ":/take_snapshot_dis_22px.png", ":/take_snapshot_dis_16px.png"));
    289     mRevertToCurSnapAction->setIcon (VBoxGlobal::iconSetFull (
    290         QSize (22, 22), QSize (16, 16),
    291         ":/discard_cur_state_22px.png", ":/discard_cur_state_16px.png",
    292         ":/discard_cur_state_dis_22px.png", ":/discard_cur_state_dis_16px.png"));
    293     mShowSnapshotDetailsAction->setIcon (VBoxGlobal::iconSetFull (
    294         QSize (22, 22), QSize (16, 16),
    295         ":/show_snapshot_details_22px.png", ":/show_snapshot_details_16px.png",
    296         ":/show_snapshot_details_dis_22px.png", ":/show_snapshot_details_dis_16px.png"));
    297 
    298     mDiscardSnapshotAction->setShortcut (QString ("Ctrl+Shift+D"));
     294
     295    mRestoreSnapshotAction->setShortcut (QString ("Ctrl+Shift+R"));
     296    mDeleteSnapshotAction->setShortcut (QString ("Ctrl+Shift+D"));
     297    mShowSnapshotDetailsAction->setShortcut (QString ("Ctrl+Space"));
    299298    mTakeSnapshotAction->setShortcut (QString ("Ctrl+Shift+S"));
    300     mRevertToCurSnapAction->setShortcut (QString ("Ctrl+Shift+R"));
    301     mShowSnapshotDetailsAction->setShortcut (QString ("Ctrl+Space"));
    302299
    303300    /* Setup connections */
    304301    connect (mTreeWidget, SIGNAL (currentItemChanged (QTreeWidgetItem*, QTreeWidgetItem*)),
    305              this, SLOT (onCurrentChanged (QTreeWidgetItem*, QTreeWidgetItem*)));
     302             this, SLOT (onCurrentChanged (QTreeWidgetItem*)));
    306303    connect (mTreeWidget, SIGNAL (customContextMenuRequested (const QPoint&)),
    307304             this, SLOT (onContextMenuRequested (const QPoint&)));
    308305    connect (mTreeWidget, SIGNAL (itemChanged (QTreeWidgetItem*, int)),
    309              this, SLOT (onItemChanged (QTreeWidgetItem*, int)));
    310 
    311     connect (mDiscardSnapshotAction, SIGNAL (triggered()),
    312              this, SLOT (discardSnapshot()));
    313     connect (mTakeSnapshotAction, SIGNAL (triggered()),
    314              this, SLOT (takeSnapshot()));
    315     connect (mRevertToCurSnapAction, SIGNAL (triggered()),
    316              this, SLOT (discardCurState()));
    317     connect (mShowSnapshotDetailsAction, SIGNAL (triggered()),
    318              this, SLOT (showSnapshotDetails()));
     306             this, SLOT (onItemChanged (QTreeWidgetItem*)));
     307
     308    connect (mRestoreSnapshotAction, SIGNAL (triggered()), this, SLOT (restoreSnapshot()));
     309    connect (mDeleteSnapshotAction, SIGNAL (triggered()), this, SLOT (deleteSnapshot()));
     310    connect (mShowSnapshotDetailsAction, SIGNAL (triggered()), this, SLOT (showSnapshotDetails()));
     311    connect (mTakeSnapshotAction, SIGNAL (triggered()), this, SLOT (takeSnapshot()));
    319312
    320313    connect (&vboxGlobal(), SIGNAL (machineDataChanged (const VBoxMachineDataChangeEvent&)),
     
    324317    connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent&)),
    325318             this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent&)));
    326 #if 0
    327     connect (&vboxGlobal(), SIGNAL (snapshotChanged (const VBoxSnapshotEvent&)),
    328              this, SLOT (snapshotChanged (const VBoxSnapshotEvent&)));
    329 #endif
    330319
    331320    retranslateUi();
     
    351340
    352341
    353 void VBoxSnapshotsWgt::onCurrentChanged (QTreeWidgetItem *aItem,
    354                                          QTreeWidgetItem* /* old */)
     342void VBoxSnapshotsWgt::onCurrentChanged (QTreeWidgetItem *aItem)
    355343{
    356344    /* Make the selected item visible */
    357     if (aItem)
    358     {
    359         SnapshotWgtItem *item = static_cast<SnapshotWgtItem*> (aItem);
     345    SnapshotWgtItem *item = aItem ? static_cast <SnapshotWgtItem*> (aItem) : 0;
     346    if (item)
     347    {
    360348        mTreeWidget->horizontalScrollBar()->setValue (0);
    361349        mTreeWidget->scrollToItem (item);
    362         mTreeWidget->horizontalScrollBar()->setValue (
    363             mTreeWidget->indentation() * item->level());
     350        mTreeWidget->horizontalScrollBar()->setValue (mTreeWidget->indentation() * item->level());
    364351    }
    365352
     
    368355
    369356    /* Enable/disable snapshot actions */
    370     mSnapshotActionGroup->setEnabled (!busy &&
    371         aItem && mCurSnapshotItem && aItem != mCurSnapshotItem->child (0));
     357    mSnapshotActionGroup->setEnabled (!busy && mCurSnapshotItem && item && !item->isCurrentStateItem());
    372358
    373359    /* Enable/disable the details action regardles of the session state */
    374     mShowSnapshotDetailsAction->setEnabled (
    375         aItem && mCurSnapshotItem && aItem != mCurSnapshotItem->child (0));
     360    mShowSnapshotDetailsAction->setEnabled (mCurSnapshotItem && item && !item->isCurrentStateItem());
    376361
    377362    /* Enable/disable current state actions */
    378     mCurStateActionGroup->setEnabled (!busy &&
    379         aItem && mCurSnapshotItem && aItem == mCurSnapshotItem->child (0));
    380 
    381     /* The Take Snapshot action is always enabled for the current state */
    382     mTakeSnapshotAction->setEnabled ((!busy && mCurStateActionGroup->isEnabled()) ||
    383                                      (aItem && !mCurSnapshotItem));
    384 
    385     mContextMenuDirty = true;
     363    mCurStateActionGroup->setEnabled (!busy && mCurSnapshotItem && item && item->isCurrentStateItem() ||
     364                                      item && !mCurSnapshotItem);
    386365}
    387366
     
    389368{
    390369    QTreeWidgetItem *item = mTreeWidget->itemAt (aPoint);
    391     if (!item)
    392         return;
    393 
    394     if (mContextMenuDirty)
    395     {
    396         mContextMenu->clear();
    397 
    398         if (!mCurSnapshotItem)
    399         {
    400             /* We have only one item -- current state */
    401             mContextMenu->addAction (mTakeSnapshotAction);
    402             mContextMenu->addActions (mCurStateActionGroup->actions());
    403         }
    404         else
    405         {
    406             if (item == mCurSnapshotItem->child (0))
    407             {
    408                 /* Current state is selected */
    409                 mContextMenu->addAction (mTakeSnapshotAction);
    410                 mContextMenu->addActions (mCurStateActionGroup->actions());
    411             }
    412             else
    413             {
    414                 /* Snapshot is selected */
    415                 mContextMenu->addActions (mSnapshotActionGroup->actions());
    416                 mContextMenu->addSeparator();
    417                 mContextMenu->addAction (mShowSnapshotDetailsAction);
    418             }
    419         }
    420 
    421         mContextMenuDirty = false;
    422     }
    423 
    424     mContextMenu->exec (mTreeWidget->viewport()->mapToGlobal (aPoint));
    425 }
    426 
    427 void VBoxSnapshotsWgt::onItemChanged (QTreeWidgetItem *aItem, int)
     370    SnapshotWgtItem *snapshotItem = item ? static_cast <SnapshotWgtItem*> (item) : 0;
     371    if (!snapshotItem)
     372        return;
     373
     374    QMenu menu;
     375
     376    if (mCurSnapshotItem && !snapshotItem->isCurrentStateItem())
     377    {
     378        menu.addAction (mRestoreSnapshotAction);
     379        menu.addAction (mDeleteSnapshotAction);
     380        menu.addSeparator();
     381        menu.addAction (mShowSnapshotDetailsAction);
     382    }
     383    else
     384        menu.addAction (mTakeSnapshotAction);
     385
     386    menu.exec (mTreeWidget->viewport()->mapToGlobal (aPoint));
     387}
     388
     389void VBoxSnapshotsWgt::onItemChanged (QTreeWidgetItem *aItem)
    428390{
    429391    if (mEditProtector)
    430392        return;
    431393
    432     SnapshotWgtItem *item = aItem ? static_cast<SnapshotWgtItem*> (aItem) : 0;
     394    SnapshotWgtItem *item = aItem ? static_cast <SnapshotWgtItem*> (aItem) : 0;
    433395
    434396    if (item)
    435397    {
    436398        CSnapshot snap = mMachine.GetSnapshot (item->snapshotId());
    437         if (!snap.isNull() && snap.isOk() &&
    438             snap.GetName() != item->text (0))
     399        if (!snap.isNull() && snap.isOk() && snap.GetName() != item->text (0))
    439400            snap.SetName (item->text (0));
    440401    }
    441402}
    442403
    443 
    444 void VBoxSnapshotsWgt::discardSnapshot()
    445 {
    446     SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
    447         static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
     404void VBoxSnapshotsWgt::restoreSnapshot()
     405{
     406    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
     407        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
    448408    AssertReturn (item, (void) 0);
    449409
    450410    QString snapId = item->snapshotId();
    451411    AssertReturn (!snapId.isNull(), (void) 0);
     412    CSnapshot snapshot = mMachine.GetSnapshot (snapId);
     413
     414    if (!vboxProblem().askAboutSnapshotRestoring (snapshot.GetName()))
     415        return;
    452416
    453417    /* Open a direct session (this call will handle all errors) */
     
    456420        return;
    457421
    458     QString snapName = mMachine.GetSnapshot (snapId).GetName();
    459 
    460422    CConsole console = session.GetConsole();
    461     CProgress progress = console.DeleteSnapshot(snapId);
     423    CProgress progress = console.RestoreSnapshot (snapshot);
    462424    if (console.isOk())
    463425    {
     
    467429
    468430        if (progress.GetResultCode() != 0)
    469             vboxProblem().cannotDiscardSnapshot (progress, snapName);
     431            vboxProblem().cannotRestoreSnapshot (progress, snapshot.GetName());
    470432    }
    471433    else
    472         vboxProblem().cannotDiscardSnapshot (console, snapName);
     434        vboxProblem().cannotRestoreSnapshot (progress, snapshot.GetName());
    473435
    474436    session.Close();
    475437}
    476438
     439void VBoxSnapshotsWgt::deleteSnapshot()
     440{
     441    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
     442        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
     443    AssertReturn (item, (void) 0);
     444
     445    QString snapId = item->snapshotId();
     446    AssertReturn (!snapId.isNull(), (void) 0);
     447    CSnapshot snapshot = mMachine.GetSnapshot (snapId);
     448
     449    if (!vboxProblem().askAboutSnapshotDeleting (snapshot.GetName()))
     450        return;
     451
     452    /* Open a direct session (this call will handle all errors) */
     453    CSession session = vboxGlobal().openSession (mMachineId);
     454    if (session.isNull())
     455        return;
     456
     457    CConsole console = session.GetConsole();
     458    CProgress progress = console.DeleteSnapshot (snapId);
     459    if (console.isOk())
     460    {
     461        /* Show the progress dialog */
     462        vboxProblem().showModalProgressDialog (progress, mMachine.GetName(),
     463                                               vboxProblem().mainWindowShown());
     464
     465        if (progress.GetResultCode() != 0)
     466            vboxProblem().cannotDeleteSnapshot (progress,  snapshot.GetName());
     467    }
     468    else
     469        vboxProblem().cannotDeleteSnapshot (console,  snapshot.GetName());
     470
     471    session.Close();
     472}
     473
     474void VBoxSnapshotsWgt::showSnapshotDetails()
     475{
     476    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
     477        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
     478    AssertReturn (item, (void) 0);
     479
     480    CSnapshot snap = item->snapshot();
     481    AssertReturn (!snap.isNull(), (void) 0);
     482
     483    CMachine snapMachine = snap.GetMachine();
     484
     485    VBoxSnapshotDetailsDlg dlg (this);
     486    dlg.getFromSnapshot (snap);
     487
     488    if (dlg.exec() == QDialog::Accepted)
     489        dlg.putBackToSnapshot();
     490}
     491
    477492void VBoxSnapshotsWgt::takeSnapshot()
    478493{
    479     SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
    480         static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
     494    SnapshotWgtItem *item = !mTreeWidget->currentItem() ? 0 :
     495        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
    481496    AssertReturn (item, (void) 0);
    482497
     
    510525
    511526        CConsole console = session.GetConsole();
    512         CProgress progress =
    513                 console.TakeSnapshot (dlg.mLeName->text().trimmed(),
    514                                       dlg.mTeDescription->toPlainText());
     527        CProgress progress = console.TakeSnapshot (dlg.mLeName->text().trimmed(),
     528                                                   dlg.mTeDescription->toPlainText());
    515529        if (console.isOk())
    516530        {
     
    529543}
    530544
    531 void VBoxSnapshotsWgt::discardCurState()
    532 {
    533     if (!vboxProblem().askAboutSnapshotDiscarding())
    534         return;
    535 
    536     SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
    537         static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
    538     AssertReturn (item, (void) 0);
    539 
    540     /* Open a direct session (this call will handle all errors) */
    541     CSession session = vboxGlobal().openSession (mMachineId);
    542     if (session.isNull())
    543         return;
    544 
    545     CConsole console = session.GetConsole();
    546     CProgress progress = console.RestoreSnapshot(mMachine.GetCurrentSnapshot());
    547     if (console.isOk())
    548     {
    549         /* show the progress dialog */
    550         vboxProblem().showModalProgressDialog (progress, mMachine.GetName(),
    551                                                vboxProblem().mainWindowShown());
    552 
    553         if (progress.GetResultCode() != 0)
    554             vboxProblem().cannotDiscardCurrentState (progress);
    555     }
    556     else
    557         vboxProblem().cannotDiscardCurrentState (console);
    558 
    559     session.Close();
    560 }
    561 
    562 void VBoxSnapshotsWgt::showSnapshotDetails()
    563 {
    564     SnapshotWgtItem *item = mTreeWidget->selectedItems().isEmpty() ? 0 :
    565         static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
    566     AssertReturn (item, (void) 0);
    567 
    568     CSnapshot snap = item->snapshot();
    569     AssertReturn (!snap.isNull(), (void) 0);
    570 
    571     CMachine snapMachine = snap.GetMachine();
    572 
    573     VBoxSnapshotDetailsDlg dlg (this);
    574     dlg.getFromSnapshot (snap);
    575 
    576     if (dlg.exec() == QDialog::Accepted)
    577         dlg.putBackToSnapshot();
    578 }
    579 
    580 
    581 void VBoxSnapshotsWgt::machineDataChanged (const VBoxMachineDataChangeEvent &aE)
     545
     546void VBoxSnapshotsWgt::machineDataChanged (const VBoxMachineDataChangeEvent &aEvent)
    582547{
    583548    SnapshotEditBlocker guardBlock (mEditProtector);
    584549
    585     if (aE.id != mMachineId)
    586         return; /* not interested in other machines */
     550    if (aEvent.id != mMachineId)
     551        return;
    587552
    588553    curStateItem()->recache();
    589554}
    590555
    591 void VBoxSnapshotsWgt::machineStateChanged (const VBoxMachineStateChangeEvent &aE)
     556void VBoxSnapshotsWgt::machineStateChanged (const VBoxMachineStateChangeEvent &aEvent)
    592557{
    593558    SnapshotEditBlocker guardBlock (mEditProtector);
    594559
    595     if (aE.id != mMachineId)
    596         return; /* not interested in other machines */
     560    if (aEvent.id != mMachineId)
     561        return;
    597562
    598563    curStateItem()->recache();
    599     curStateItem()->updateCurrentState (aE.state);
    600 }
    601 
    602 void VBoxSnapshotsWgt::sessionStateChanged (const VBoxSessionStateChangeEvent &aE)
     564    curStateItem()->updateCurrentState (aEvent.state);
     565}
     566
     567void VBoxSnapshotsWgt::sessionStateChanged (const VBoxSessionStateChangeEvent &aEvent)
    603568{
    604569    SnapshotEditBlocker guardBlock (mEditProtector);
    605570
    606     if (aE.id != mMachineId)
    607         return; /* not interested in other machines */
    608 
    609     mSessionState = aE.state;
    610     onCurrentChanged (mTreeWidget->selectedItems().isEmpty() ? 0 :
    611                       mTreeWidget->selectedItems() [0]);
    612 }
    613 
    614 #if 0
    615 void VBoxSnapshotsWgt::snapshotChanged (const VBoxSnapshotEvent &aE)
    616 {
    617     SnapshotEditBlocker guardBlock (mEditProtector);
    618 
    619     if (aE.machineId != mMachineId)
    620         return; /* not interested in other machines */
    621 
    622     switch (aE.what)
    623     {
    624         case VBoxSnapshotEvent::Taken:
    625         case VBoxSnapshotEvent::Discarded:
    626         {
    627             refreshAll();
    628             break;
    629         }
    630         case VBoxSnapshotEvent::Changed:
    631         {
    632             SnapshotWgtItem *lvi = findItem (aE.snapshotId);
    633             if (!lvi)
    634                 refreshAll (false);
    635             else
    636                 lvi->recache();
    637             break;
    638         }
    639     }
    640 }
    641 #endif
     571    if (aEvent.id != mMachineId)
     572        return;
     573
     574    mSessionState = aEvent.state;
     575    onCurrentChanged (mTreeWidget->currentItem());
     576}
    642577
    643578void VBoxSnapshotsWgt::retranslateUi()
     
    646581    Ui::VBoxSnapshotsWgt::retranslateUi (this);
    647582
    648     mDiscardSnapshotAction->setText (tr ("&Discard Snapshot"));
     583    mRestoreSnapshotAction->setText (tr ("&Restore Snapshot"));
     584    mDeleteSnapshotAction->setText (tr ("&Delete Snapshot"));
     585    mShowSnapshotDetailsAction->setText (tr ("S&how Details"));
    649586    mTakeSnapshotAction->setText (tr ("Take &Snapshot"));
    650     mRevertToCurSnapAction->setText (tr ("&Revert to Current Snapshot"));
    651     mShowSnapshotDetailsAction->setText (tr ("S&how Details"));
    652 
    653     mDiscardSnapshotAction->setStatusTip (tr ("Discard the selected snapshot of the virtual machine"));
     587
     588    mRestoreSnapshotAction->setStatusTip (tr ("Restore the selected snapshot of the virtual machine"));
     589    mDeleteSnapshotAction->setStatusTip (tr ("Delete the selected snapshot of the virtual machine"));
     590    mShowSnapshotDetailsAction->setStatusTip (tr ("Show details of the selected snapshot"));
    654591    mTakeSnapshotAction->setStatusTip (tr ("Take a snapshot of the current virtual machine state"));
    655     mRevertToCurSnapAction->setStatusTip (tr ("Restore the virtual machine state from the state stored in the current snapshot"));
    656     mShowSnapshotDetailsAction->setStatusTip (tr ("Show details of the selected snapshot"));
    657 
    658     mDiscardSnapshotAction->setToolTip (mDiscardSnapshotAction->text().remove ('&').remove ('.') +
    659         QString (" (%1)").arg (mDiscardSnapshotAction->shortcut().toString()));
     592
     593    mRestoreSnapshotAction->setToolTip (mRestoreSnapshotAction->text().remove ('&').remove ('.') +
     594        QString (" (%1)").arg (mRestoreSnapshotAction->shortcut().toString()));
     595    mDeleteSnapshotAction->setToolTip (mDeleteSnapshotAction->text().remove ('&').remove ('.') +
     596        QString (" (%1)").arg (mDeleteSnapshotAction->shortcut().toString()));
     597    mShowSnapshotDetailsAction->setToolTip (mShowSnapshotDetailsAction->text().remove ('&').remove ('.') +
     598        QString (" (%1)").arg (mShowSnapshotDetailsAction->shortcut().toString()));
    660599    mTakeSnapshotAction->setToolTip (mTakeSnapshotAction->text().remove ('&').remove ('.') +
    661600        QString (" (%1)").arg (mTakeSnapshotAction->shortcut().toString()));
    662     mRevertToCurSnapAction->setToolTip (mRevertToCurSnapAction->text().remove ('&').remove ('.') +
    663         QString (" (%1)").arg (mRevertToCurSnapAction->shortcut().toString()));
    664     mShowSnapshotDetailsAction->setToolTip (mShowSnapshotDetailsAction->text().remove ('&').remove ('.') +
    665         QString (" (%1)").arg (mShowSnapshotDetailsAction->shortcut().toString()));
    666 }
    667 
    668 void VBoxSnapshotsWgt::refreshAll (bool aKeepSelected /* = true */)
     601}
     602
     603void VBoxSnapshotsWgt::refreshAll()
    669604{
    670605    SnapshotEditBlocker guardBlock (mEditProtector);
    671606
    672     QString selected, selectedFirstChild;
    673     if (aKeepSelected)
    674     {
    675         SnapshotWgtItem *cur = mTreeWidget->selectedItems().isEmpty() ? 0 :
    676             static_cast<SnapshotWgtItem*> (mTreeWidget->selectedItems() [0]);
    677         if (cur)
    678         {
    679             selected = cur->snapshotId();
    680             if (cur->child (0))
    681                 selectedFirstChild =
    682                     static_cast<SnapshotWgtItem*> (cur->child (0))->snapshotId();
    683         }
     607    if (mMachine.isNull())
     608    {
     609        onCurrentChanged();
     610        return;
     611    }
     612
     613    QString selectedItem, firstChildOfSelectedItem;
     614    SnapshotWgtItem *cur = !mTreeWidget->currentItem() ? 0 :
     615        static_cast <SnapshotWgtItem*> (mTreeWidget->currentItem());
     616    if (cur)
     617    {
     618        selectedItem = cur->snapshotId();
     619        if (cur->child (0))
     620            firstChildOfSelectedItem = static_cast <SnapshotWgtItem*> (cur->child (0))->snapshotId();
    684621    }
    685622
    686623    mTreeWidget->clear();
    687624
    688     if (mMachine.isNull())
    689     {
    690         onCurrentChanged (NULL);
    691         return;
    692     }
    693 
    694     /* get the first snapshot */
     625    /* Get the first snapshot */
    695626    if (mMachine.GetSnapshotCount() > 0)
    696627    {
     
    700631        Assert (mCurSnapshotItem);
    701632
    702         /* add the "current state" item */
     633        /* Add the "current state" item */
    703634        new SnapshotWgtItem (mCurSnapshotItem, mMachine);
    704635
    705         SnapshotWgtItem *cur = 0;
    706         if (aKeepSelected)
    707         {
    708             cur = findItem (selected);
    709             if (cur == 0)
    710                 cur = findItem (selectedFirstChild);
    711         }
     636        SnapshotWgtItem *cur = findItem (selectedItem);
     637        if (cur == 0)
     638            cur = findItem (firstChildOfSelectedItem);
    712639        if (cur == 0)
    713640            cur = curStateItem();
     641
    714642        mTreeWidget->scrollToItem (cur);
    715643        mTreeWidget->setCurrentItem (cur);
     
    720648        mCurSnapshotItem = 0;
    721649
    722         /* add the "current state" item */
     650        /* Add the "current state" item */
    723651        SnapshotWgtItem *csi = new SnapshotWgtItem (mTreeWidget, mMachine);
     652
    724653        mTreeWidget->setCurrentItem (csi);
    725654        onCurrentChanged (csi);
     
    734663    while (*it)
    735664    {
    736         SnapshotWgtItem *lvi = static_cast<SnapshotWgtItem*> (*it);
     665        SnapshotWgtItem *lvi = static_cast <SnapshotWgtItem*> (*it);
    737666        if (lvi->snapshotId() == aSnapshotId)
    738667            return lvi;
     
    745674SnapshotWgtItem *VBoxSnapshotsWgt::curStateItem()
    746675{
    747     QTreeWidgetItem *csi = mCurSnapshotItem ? mCurSnapshotItem->child (0)
    748                          : mTreeWidget->invisibleRootItem()->child (0);
     676    QTreeWidgetItem *csi = mCurSnapshotItem ?
     677                           mCurSnapshotItem->child (mCurSnapshotItem->childCount() - 1) :
     678                           mTreeWidget->invisibleRootItem()->child (0);
    749679    Assert (csi);
    750     return static_cast<SnapshotWgtItem*> (csi);
    751 }
    752 
    753 void VBoxSnapshotsWgt::populateSnapshots (const CSnapshot &aSnapshot, QTreeWidgetItem *item)
    754 {
    755     SnapshotWgtItem *si = 0;
    756     si = item ? new SnapshotWgtItem (item, aSnapshot) :
    757                 new SnapshotWgtItem (mTreeWidget, aSnapshot);
     680    return static_cast <SnapshotWgtItem*> (csi);
     681}
     682
     683void VBoxSnapshotsWgt::populateSnapshots (const CSnapshot &aSnapshot, QTreeWidgetItem *aItem)
     684{
     685    SnapshotWgtItem *item = aItem ? new SnapshotWgtItem (aItem, aSnapshot) :
     686                                    new SnapshotWgtItem (mTreeWidget, aSnapshot);
    758687
    759688    if (mMachine.GetCurrentSnapshot().GetId() == aSnapshot.GetId())
    760689    {
    761         si->setBold (true);
    762         mCurSnapshotItem = si;
    763     }
    764 
    765     CSnapshotVector snapvec = aSnapshot.GetChildren();
    766     for (int i = 0; i < snapvec.size(); ++i)
    767     {
    768         CSnapshot sn = snapvec[i];
    769         populateSnapshots (sn, si);
    770     }
    771 
    772     si->setExpanded (true);
    773     si->setFlags (si->flags() | Qt::ItemIsEditable);
    774 }
    775 
     690        item->setBold (true);
     691        mCurSnapshotItem = item;
     692    }
     693
     694    CSnapshotVector snapshots = aSnapshot.GetChildren();
     695    foreach (const CSnapshot &snapshot, snapshots)
     696        populateSnapshots (snapshot, item);
     697
     698    item->setExpanded (true);
     699    item->setFlags (item->flags() | Qt::ItemIsEditable);
     700}
     701
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette