VirtualBox

Changeset 28937 in vbox


Ignore:
Timestamp:
Apr 30, 2010 1:22:46 PM (15 years ago)
Author:
vboxsync
Message:

Frontends/VirtualBox: allow taking snapshots from the selector window, and related small cleanups

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxSnapshotsWgt.cpp

    r28842 r28937  
    448448        s = curStateItem()->getCurrentState();
    449449
     450    /* Whether taking or deleting snapshots is possible right now */
     451    bool canTakeDeleteSnapshot =    !busy
     452                                 || s == KMachineState_PoweredOff
     453                                 || s == KMachineState_Saved
     454                                 || s == KMachineState_Aborted
     455                                 || s == KMachineState_Running
     456                                 || s == KMachineState_Paused;
     457
    450458    /* Enable/disable restoring snapshot */
    451459    mRestoreSnapshotAction->setEnabled (!busy && mCurSnapshotItem && item && !item->isCurrentStateItem());
    452460
    453461    /* Enable/disable deleting snapshot */
    454     mDeleteSnapshotAction->setEnabled (   (   !busy
    455                                            || s == KMachineState_PoweredOff
    456                                            || s == KMachineState_Saved
    457                                            || s == KMachineState_Aborted
    458                                            || s == KMachineState_Running
    459                                            || s == KMachineState_Paused)
     462    mDeleteSnapshotAction->setEnabled (   canTakeDeleteSnapshot
    460463                                       && mCurSnapshotItem && item && !item->isCurrentStateItem());
    461464
     
    463466    mShowSnapshotDetailsAction->setEnabled (mCurSnapshotItem && item && !item->isCurrentStateItem());
    464467
    465     /* Enable/disable current state actions */
    466     mCurStateActionGroup->setEnabled ((!busy && mCurSnapshotItem && item && item->isCurrentStateItem()) ||
    467                                       (item && !mCurSnapshotItem));
     468    /* Enable/disable taking snapshots */
     469    mTakeSnapshotAction->setEnabled (   canTakeDeleteSnapshot
     470                                     && mCurSnapshotItem && item && item->isCurrentStateItem());
    468471}
    469472
     
    561564        return;
    562565#endif
    563                                                          
     566
    564567
    565568    /* Open a direct session (this call will handle all errors) */
     
    634637    {
    635638        /* Open a direct session (this call will handle all errors) */
    636         CSession session = vboxGlobal().openSession (mMachineId);
     639        bool busy = mSessionState != KSessionState_Closed;
     640        CSession session = vboxGlobal().openSession (mMachineId, busy /* aExisting */);
    637641        if (session.isNull())
    638642            return;
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