VirtualBox

Ignore:
Timestamp:
Feb 4, 2009 5:54:21 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
42444
Message:

FE/Qt4: 3225: Disable ACPI actions if ACPI is not supported atm: remake for comment #25.

File:
1 edited

Legend:

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

    r16493 r16520  
    13491349
    13501350            /* make the Discard checkbox invisible if there are no snapshots */
    1351             bool isDiscardVisible = cmachine.GetSnapshotCount() > 0;
    1352             dlg.mCbDiscardCurState->setVisible (isDiscardVisible);
     1351            dlg.mCbDiscardCurState->setVisible (cmachine.GetSnapshotCount() > 0);
    13531352
    13541353            if (machine_state != KMachineState_Stuck)
     
    13571356                QStringList lastAction =
    13581357                    cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction).split (',');
    1359                 bool wasDiscardCurState = lastAction.count() > 1 &&
    1360                                           lastAction [1] == kDiscardCurState;
    13611358                AssertWrapperOk (cmachine);
    13621359                if (lastAction [0] == kSave)
     
    13651362                    dlg.mRbSave->setFocus();
    13661363                }
    1367                 else if ((wasDiscardCurState && isDiscardVisible) || !isACPIEnabled)
     1364                else if (lastAction [0] == kPowerOff || !isACPIEnabled)
    13681365                {
    13691366                    dlg.mRbShutdown->setEnabled (isACPIEnabled);
     
    13761373                    dlg.mRbShutdown->setFocus();
    13771374                }
    1378                 dlg.mCbDiscardCurState->setChecked (wasDiscardCurState);
     1375                dlg.mCbDiscardCurState->setChecked (lastAction.count() > 1 &&
     1376                                                    lastAction [1] == kDiscardCurState);
    13791377            }
    13801378            else
     
    14871485                if (success || wasShutdown)
    14881486                {
     1487                    /* read the last user's choice for the given VM */
     1488                    QStringList prevAction =
     1489                        cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction).split (',');
    14891490                    /* memorize the last user's choice for the given VM */
    14901491                    QString lastAction = kPowerOff;
    14911492                    if (dlg.mRbSave->isChecked())
    14921493                        lastAction = kSave;
    1493                     else if (dlg.mRbShutdown->isChecked())
     1494                    else if (dlg.mRbShutdown->isChecked() ||
     1495                             (dlg.mRbPowerOff->isChecked() &&
     1496                              prevAction [0] == kShutdown &&
     1497                              !isACPIEnabled))
    14941498                        lastAction = kShutdown;
    14951499                    else if (dlg.mRbPowerOff->isChecked())
Note: See TracChangeset for help on using the changeset viewer.

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