VirtualBox

Ignore:
Timestamp:
Mar 6, 2007 12:37:24 PM (18 years ago)
Author:
vboxsync
Message:

FE/Qt: Fixed regressions that allowed to access the Settings dialog when a VM is in the Saved state.

File:
1 edited

Legend:

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

    r1255 r1265  
    219219    void goToSettings();
    220220    void sessionStateChanged (const VBoxSessionStateChangeEvent &aE);
     221    void machineStateChanged (const VBoxMachineStateChangeEvent &aE);
    221222
    222223private:
     
    268269
    269270    /* connect VirtualBox callback events */
     271    connect (&vboxGlobal(), SIGNAL (machineStateChanged (const VBoxMachineStateChangeEvent &)),
     272             this, SLOT (machineStateChanged (const VBoxSessionStateChangeEvent &)));
    270273    connect (&vboxGlobal(), SIGNAL (sessionStateChanged (const VBoxSessionStateChangeEvent &)),
    271274             this, SLOT (sessionStateChanged (const VBoxSessionStateChangeEvent &)));
     
    298301        mBrowser->setPaper (backgroundBrush());
    299302    }
     303
     304    /* check initial machine and session states */
     305    bool saved = aMachine.GetState() == CEnums::Saved;
     306    bool busy = aMachine.GetState() != CEnums::SessionClosed;
     307    mBtnEdit->setEnabled (!saved && !busy);
    300308}
    301309
     
    312320}
    313321
    314 void VBoxVMDescriptionPage::sessionStateChanged (const VBoxSessionStateChangeEvent &aE)
    315 {
     322void VBoxVMDescriptionPage::machineStateChanged (const VBoxMachineStateChangeEvent &aE)
     323{
     324    /// @todo this slot will not be necessary when we implement the selective
     325    /// VM Settings dialog, where only fields that can be changed in the
     326    /// saved state, can be changed.
     327
    316328    if (aE.id != mMachineId)
    317329        return; /* not interested in other machines */
    318330
     331    /* disable the edit button for a saved machine */
     332    bool saved = aE.state == CEnums::Saved;
     333    mBtnEdit->setEnabled (!saved);
     334}
     335
     336void VBoxVMDescriptionPage::sessionStateChanged (const VBoxSessionStateChangeEvent &aE)
     337{
     338    if (aE.id != mMachineId)
     339        return; /* not interested in other machines */
     340
    319341    /* whether another direct session is open or not */
    320342    bool busy = aE.state != CEnums::SessionClosed;
    321 
    322343    mBtnEdit->setEnabled (!busy);
    323344}
     
    10621083            vmDetailsView->setDetailsText (
    10631084                vboxGlobal().detailsReport (m, false /* isNewVM */,
    1064                                                !running /* withLinks */));
     1085                                               modifyEnabled /* withLinks */));
    10651086        }
    10661087        if (aRefreshSnapshots)
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