Changeset 16520 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 4, 2009 5:54:21 PM (16 years ago)
- svn:sync-xref-src-repo-rev:
- 42444
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/VBoxConsoleWnd.cpp
r16493 r16520 1349 1349 1350 1350 /* 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); 1353 1352 1354 1353 if (machine_state != KMachineState_Stuck) … … 1357 1356 QStringList lastAction = 1358 1357 cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction).split (','); 1359 bool wasDiscardCurState = lastAction.count() > 1 &&1360 lastAction [1] == kDiscardCurState;1361 1358 AssertWrapperOk (cmachine); 1362 1359 if (lastAction [0] == kSave) … … 1365 1362 dlg.mRbSave->setFocus(); 1366 1363 } 1367 else if ( (wasDiscardCurState && isDiscardVisible)|| !isACPIEnabled)1364 else if (lastAction [0] == kPowerOff || !isACPIEnabled) 1368 1365 { 1369 1366 dlg.mRbShutdown->setEnabled (isACPIEnabled); … … 1376 1373 dlg.mRbShutdown->setFocus(); 1377 1374 } 1378 dlg.mCbDiscardCurState->setChecked (wasDiscardCurState); 1375 dlg.mCbDiscardCurState->setChecked (lastAction.count() > 1 && 1376 lastAction [1] == kDiscardCurState); 1379 1377 } 1380 1378 else … … 1487 1485 if (success || wasShutdown) 1488 1486 { 1487 /* read the last user's choice for the given VM */ 1488 QStringList prevAction = 1489 cmachine.GetExtraData (VBoxDefs::GUI_LastCloseAction).split (','); 1489 1490 /* memorize the last user's choice for the given VM */ 1490 1491 QString lastAction = kPowerOff; 1491 1492 if (dlg.mRbSave->isChecked()) 1492 1493 lastAction = kSave; 1493 else if (dlg.mRbShutdown->isChecked()) 1494 else if (dlg.mRbShutdown->isChecked() || 1495 (dlg.mRbPowerOff->isChecked() && 1496 prevAction [0] == kShutdown && 1497 !isACPIEnabled)) 1494 1498 lastAction = kShutdown; 1495 1499 else if (dlg.mRbPowerOff->isChecked())
Note:
See TracChangeset
for help on using the changeset viewer.