Changeset 45736 in vbox
- Timestamp:
- Apr 25, 2013 3:59:59 PM (12 years ago)
- svn:sync-xref-src-repo-rev:
- 85294
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 15 edited
- 2 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VirtualBox1.qrc
r45605 r45736 245 245 <file alias="ok_16px.png">images/ok_16px.png</file> 246 246 <file alias="cancel_16px.png">images/cancel_16px.png</file> 247 <file alias="save_state_16px.png">images/save_state_16px.png</file> 248 <file alias="save_state_disabled_16px.png">images/save_state_disabled_16px.png</file> 247 249 </qresource> 248 250 </RCC> -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.cpp
r45402 r45736 64 64 const char* UIDefs::GUI_SaveMountedAtRuntime = "GUI/SaveMountedAtRuntime"; 65 65 const char* UIDefs::GUI_PassCAD = "GUI/PassCAD"; 66 const char* UIDefs::GUI_DefaultCloseAction = "GUI/DefaultCloseAction"; 66 67 67 68 /* Mini tool-bar definitions: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r45402 r45736 141 141 extern const char* GUI_SaveMountedAtRuntime; 142 142 extern const char* GUI_PassCAD; 143 extern const char* GUI_DefaultCloseAction; 143 144 144 145 /* Mini tool-bar declarations: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.cpp
r44448 r45736 343 343 }; 344 344 345 class UIActionSimplePerformSave : public UIActionSimple 346 { 347 Q_OBJECT; 348 349 public: 350 351 UIActionSimplePerformSave(UIActionPool *pParent) 352 : UIActionSimple(pParent, ":/save_state_16px.png", ":/save_state_disabled_16px.png") 353 { 354 retranslateUi(); 355 } 356 357 protected: 358 359 QString shortcutExtraDataID() const 360 { 361 return QString("Save"); 362 } 363 364 void retranslateUi() 365 { 366 setName(QApplication::translate("UIActionPool", "Save State")); 367 setStatusTip(QApplication::translate("UIActionPool", "Save the machine state of the virtual machine")); 368 } 369 }; 370 345 371 class UIActionSimplePerformShutdown : public UIActionSimple 346 372 { … … 375 401 setName(QApplication::translate("UIActionPool", "ACPI Sh&utdown")); 376 402 setStatusTip(QApplication::translate("UIActionPool", "Send the ACPI Power Button press event to the virtual machine")); 403 } 404 }; 405 406 class UIActionSimplePerformPowerOff : public UIActionSimple 407 { 408 Q_OBJECT; 409 410 public: 411 412 UIActionSimplePerformPowerOff(UIActionPool *pParent) 413 : UIActionSimple(pParent, ":/poweroff_16px.png", ":/poweroff_disabled_16px.png") 414 { 415 retranslateUi(); 416 } 417 418 protected: 419 420 QString shortcutExtraDataID() const 421 { 422 return QString("PowerOff"); 423 } 424 425 void retranslateUi() 426 { 427 setName(QApplication::translate("UIActionPool", "Po&wer Off")); 428 setStatusTip(QApplication::translate("UIActionPool", "Power off the virtual machine")); 377 429 } 378 430 }; … … 1077 1129 m_pool[UIActionIndexRuntime_Toggle_Pause] = new UIActionTogglePause(this); 1078 1130 m_pool[UIActionIndexRuntime_Simple_Reset] = new UIActionSimplePerformReset(this); 1131 m_pool[UIActionIndexRuntime_Simple_Save] = new UIActionSimplePerformSave(this); 1079 1132 m_pool[UIActionIndexRuntime_Simple_Shutdown] = new UIActionSimplePerformShutdown(this); 1133 m_pool[UIActionIndexRuntime_Simple_PowerOff] = new UIActionSimplePerformPowerOff(this); 1080 1134 m_pool[UIActionIndexRuntime_Simple_Close] = new UIActionSimplePerformClose(this); 1081 1135 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIActionPoolRuntime.h
r44448 r45736 40 40 UIActionIndexRuntime_Toggle_Pause, 41 41 UIActionIndexRuntime_Simple_Reset, 42 UIActionIndexRuntime_Simple_Save, 42 43 UIActionIndexRuntime_Simple_Shutdown, 44 UIActionIndexRuntime_Simple_PowerOff, 43 45 UIActionIndexRuntime_Simple_Close, 44 46 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.cpp
r45432 r45736 297 297 #endif /* Q_WS_MAC */ 298 298 299 void UIMachineLogic::saveState() 300 { 301 /* Prevent auto-closure: */ 302 setPreventAutoClose(true); 303 304 /* Was the step successful? */ 305 bool fSuccess = true; 306 /* If VM is not paused, we should pause it: */ 307 bool fWasPaused = uisession()->isPaused(); 308 if (fSuccess && !fWasPaused) 309 fSuccess = uisession()->pause(); 310 /* Save-state: */ 311 if (fSuccess) 312 fSuccess = uisession()->saveState(); 313 314 /* Allow auto-closure: */ 315 setPreventAutoClose(false); 316 317 /* Manually close Runtime UI: */ 318 if (fSuccess) 319 uisession()->closeRuntimeUI(); 320 } 321 322 void UIMachineLogic::shutdown() 323 { 324 /* Warn the user about ACPI is not available if so: */ 325 CConsole console = session().GetConsole(); 326 if (!console.GetGuestEnteredACPIMode()) 327 return msgCenter().cannotSendACPIToMachine(); 328 329 /* Shutdown: */ 330 uisession()->shutdown(); 331 } 332 333 void UIMachineLogic::powerOff(bool fDiscardingState) 334 { 335 /* Prevent auto-closure: */ 336 setPreventAutoClose(true); 337 338 /* Was the step successful? */ 339 bool fSuccess = true; 340 /* Power-off: */ 341 bool fServerCrashed = false; 342 fSuccess = uisession()->powerOff(fDiscardingState, fServerCrashed) || fServerCrashed; 343 344 /* Allow auto-closure: */ 345 setPreventAutoClose(false); 346 347 /* Manually close Runtime UI: */ 348 if (fSuccess) 349 uisession()->closeRuntimeUI(); 350 } 351 299 352 void UIMachineLogic::sltMachineStateChanged() 300 353 { … … 305 358 m_pRunningActions->setEnabled(uisession()->isRunning()); 306 359 m_pRunningOrPausedActions->setEnabled(uisession()->isRunning() || uisession()->isPaused()); 360 m_pRunningOrPausedOrStackedActions->setEnabled(uisession()->isRunning() || uisession()->isPaused() || uisession()->isStuck()); 307 361 308 362 switch (state) 309 363 { 310 case KMachineState_Stuck: // TODO: Test it!311 { 312 /* Prevent machine 364 case KMachineState_Stuck: 365 { 366 /* Prevent machine-view from resizing: */ 313 367 uisession()->setGuestResizeIgnored(true); 314 315 /* Get variables: */ 316 CConsole console = session().GetConsole(); 317 CMachine machine = console.GetMachine(); 318 QString strMachineName = machine.GetName(); 319 QString strLogFolder = machine.GetLogFolder(); 320 368 /* Get log-folder: */ 369 QString strLogFolder = session().GetMachine().GetLogFolder(); 321 370 /* Take the screenshot for debugging purposes: */ 322 371 takeScreenshot(strLogFolder + "/VBox.png", "png"); 323 324 372 /* Warn the user about GURU meditation: */ 325 373 if (msgCenter().remindAboutGuruMeditation(QDir::toNativeSeparators(strLogFolder))) 326 { 327 /* Prepare machine power down progress: */ 328 CProgress progress = console.PowerDown(); 329 if (console.isOk()) 330 { 331 /* Show machine power down progress: */ 332 msgCenter().showModalProgressDialog(progress, strMachineName, ":/progress_poweroff_90px.png"); 333 if (!progress.isOk() || progress.GetResultCode() != 0) 334 msgCenter().cannotPowerDownMachine(progress, strMachineName); 335 } 336 else 337 msgCenter().cannotPowerDownMachine(console); 338 } 374 powerOff(session().GetMachine().GetSnapshotCount() > 0); 339 375 break; 340 376 } … … 480 516 , m_pRunningActions(0) 481 517 , m_pRunningOrPausedActions(0) 518 , m_pRunningOrPausedOrStackedActions(0) 482 519 , m_pSharedClipboardActions(0) 483 520 , m_pDragAndDropActions(0) … … 631 668 m_pRunningOrPausedActions->setExclusive(false); 632 669 670 /* Create group for all actions that are enabled when the VM is running or paused or stucked. 671 * Note that only actions whose enabled state depends exclusively on the 672 * execution state of the VM are added to this group. */ 673 m_pRunningOrPausedOrStackedActions = new QActionGroup(this); 674 m_pRunningOrPausedOrStackedActions->setExclusive(false); 675 633 676 /* Move actions into running actions group: */ 634 677 m_pRunningActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_TypeCAD)); … … 645 688 646 689 /* Move actions into running-n-paused actions group: */ 690 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_Save)); 647 691 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_SettingsDialog)); 648 692 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_TakeSnapshot)); … … 663 707 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_VRDEServer)); 664 708 m_pRunningOrPausedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_InstallGuestTools)); 709 710 /* Move actions into running-n-paused-n-stucked actions group: */ 711 m_pRunningOrPausedOrStackedActions->addAction(gActionPool->action(UIActionIndexRuntime_Simple_PowerOff)); 665 712 } 666 713 … … 688 735 connect(gActionPool->action(UIActionIndexRuntime_Simple_Reset), SIGNAL(triggered()), 689 736 this, SLOT(sltReset())); 737 connect(gActionPool->action(UIActionIndexRuntime_Simple_Save), SIGNAL(triggered()), 738 this, SLOT(sltSaveState())); 690 739 connect(gActionPool->action(UIActionIndexRuntime_Simple_Shutdown), SIGNAL(triggered()), 691 this, SLOT(sltACPIShutdown())); 740 this, SLOT(sltShutdown())); 741 connect(gActionPool->action(UIActionIndexRuntime_Simple_PowerOff), SIGNAL(triggered()), 742 this, SLOT(sltPowerOff())); 692 743 connect(gActionPool->action(UIActionIndexRuntime_Simple_Close), SIGNAL(triggered()), 693 744 this, SLOT(sltClose())); … … 1151 1202 } 1152 1203 1153 void UIMachineLogic::sltACPIShutdown() 1154 { 1155 /* Get console: */ 1156 CConsole console = session().GetConsole(); 1157 1158 /* Warn the user about ACPI is not available if so: */ 1159 if (!console.GetGuestEnteredACPIMode()) 1160 return msgCenter().cannotSendACPIToMachine(); 1161 1162 /* Send ACPI shutdown signal, warn if failed: */ 1163 console.PowerButton(); 1164 if (!console.isOk()) 1165 msgCenter().cannotACPIShutdownMachine(console); 1204 void UIMachineLogic::sltSaveState() 1205 { 1206 /* Make sure machine is in one of the allowed states: */ 1207 if (!uisession()->isRunning() && !uisession()->isPaused()) 1208 { 1209 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); 1210 return; 1211 } 1212 1213 saveState(); 1214 } 1215 1216 void UIMachineLogic::sltShutdown() 1217 { 1218 /* Make sure machine is in one of the allowed states: */ 1219 if (!uisession()->isRunning()) 1220 { 1221 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); 1222 return; 1223 } 1224 1225 shutdown(); 1226 } 1227 1228 void UIMachineLogic::sltPowerOff() 1229 { 1230 /* Make sure machine is in one of the allowed states: */ 1231 if (!uisession()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck()) 1232 { 1233 AssertMsgFailed(("Invalid machine-state. Action should be prohibited!")); 1234 return; 1235 } 1236 1237 powerOff(session().GetMachine().GetSnapshotCount() > 0); 1166 1238 } 1167 1239 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineLogic.h
r44982 r45736 89 89 #endif /* Q_WS_MAC */ 90 90 91 /* API: Close actions: */ 92 void saveState(); 93 void shutdown(); 94 void powerOff(bool fDiscardingState); 95 91 96 protected slots: 92 97 … … 175 180 void sltReset(); 176 181 void sltPause(bool fOn); 177 void sltACPIShutdown(); 182 void sltSaveState(); 183 void sltShutdown(); 184 void sltPowerOff(); 178 185 void sltClose(); 179 186 … … 224 231 QActionGroup *m_pRunningActions; 225 232 QActionGroup *m_pRunningOrPausedActions; 233 QActionGroup *m_pRunningOrPausedOrStackedActions; 226 234 QActionGroup *m_pSharedClipboardActions; 227 235 QActionGroup *m_pDragAndDropActions; -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineMenuBar.cpp
r44529 r45736 208 208 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Toggle_Pause)); 209 209 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_Reset)); 210 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_Save)); 210 211 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_Shutdown)); 212 pMenu->addAction(gActionPool->action(UIActionIndexRuntime_Simple_PowerOff)); 211 213 #ifndef Q_WS_MAC 212 214 pMenu->addSeparator(); -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachineWindow.cpp
r45432 r45736 244 244 void UIMachineWindow::closeEvent(QCloseEvent *pEvent) 245 245 { 246 /* Always ignore close-event : */246 /* Always ignore close-event first: */ 247 247 pEvent->ignore(); 248 248 249 /* Should we close Runtime UI? */250 bool fCloseRuntimeUI = false;251 252 249 /* Make sure machine is in one of the allowed states: */ 253 KMachineState machineState = uisession()->machineState(); 254 if ( machineState != KMachineState_Running 255 && machineState != KMachineState_Paused 256 && machineState != KMachineState_Stuck 257 && machineState != KMachineState_LiveSnapshotting 258 && machineState != KMachineState_Teleporting 259 && machineState != KMachineState_TeleportingPausedVM) 250 if (!uisession()->isRunning() && !uisession()->isPaused() && !uisession()->isStuck()) 260 251 return; 261 252 262 /* Get the machine: */263 CMachine machineCopy = machine();264 265 253 /* If there is a close hook script defined: */ 266 const QString& strScript = machineCopy.GetExtraData(GUI_CloseActionHook);254 QString strScript = machine().GetExtraData(GUI_CloseActionHook); 267 255 if (!strScript.isEmpty()) 268 256 { 269 257 /* Execute asynchronously and leave: */ 270 QProcess::startDetached(strScript, QStringList() << machine Copy.GetId());258 QProcess::startDetached(strScript, QStringList() << machine().GetId()); 271 259 return; 272 260 } 273 261 274 /* Prepare close-dialog: */ 275 QWidget *pParentDlg = windowManager().realParentWindow(this); 276 QPointer<UIVMCloseDialog> pCloseDlg = new UIVMCloseDialog(pParentDlg, machineCopy, session()); 277 windowManager().registerNewParent(pCloseDlg, pParentDlg); 278 279 /* Makes sure the dialog is valid: */ 280 if (!pCloseDlg->isValid()) 281 { 282 /* Destroy and leave: */ 262 /* Choose the close action: */ 263 UIVMCloseDialog::ResultCode closeAction = UIVMCloseDialog::ResultCode_Cancel; 264 265 /* If there IS default close-action defined: */ 266 QString strDefaultAction = machine().GetExtraData(GUI_DefaultCloseAction); 267 if (!strDefaultAction.isEmpty()) 268 { 269 /* Parse the close-action which was defined: */ 270 closeAction = UIVMCloseDialog::parseResultCode(strDefaultAction); 271 /* If VM is stuck, and the default close-action is not 'power-off', 272 * we should ask the user about what to do: */ 273 if (uisession()->isStuck() && 274 closeAction != UIVMCloseDialog::ResultCode_PowerOff) 275 closeAction = UIVMCloseDialog::ResultCode_Cancel; 276 /* If the default-action is 'power-off', 277 * we should check if its possible to discard machine-state: */ 278 if (closeAction == UIVMCloseDialog::ResultCode_PowerOff && 279 machine().GetSnapshotCount() > 0) 280 closeAction = UIVMCloseDialog::ResultCode_PowerOff_With_Discarding; 281 } 282 283 /* If the close-action still undefined: */ 284 if (closeAction == UIVMCloseDialog::ResultCode_Cancel) 285 { 286 /* Prepare close-dialog: */ 287 QWidget *pParentDlg = windowManager().realParentWindow(this); 288 QPointer<UIVMCloseDialog> pCloseDlg = new UIVMCloseDialog(pParentDlg, machine(), session()); 289 290 /* Make sure close-dialog is valid: */ 291 if (pCloseDlg->isValid()) 292 { 293 /* If VM is not paused and not stuck, we should pause it first: */ 294 bool fWasPaused = uisession()->isPaused() || uisession()->isStuck(); 295 if (fWasPaused || uisession()->pause()) 296 { 297 /* Show close-dialog to let the user make the choice: */ 298 windowManager().registerNewParent(pCloseDlg, pParentDlg); 299 closeAction = (UIVMCloseDialog::ResultCode)pCloseDlg->exec(); 300 301 /* Make sure the dialog still valid: */ 302 if (!pCloseDlg) 303 return; 304 305 /* If VM was not paused before but paused now, 306 * we should resume it if user canceled dialog or chosen shutdown: */ 307 if (!fWasPaused && uisession()->isPaused() && 308 (closeAction == UIVMCloseDialog::ResultCode_Cancel || 309 closeAction == UIVMCloseDialog::ResultCode_Shutdown)) 310 { 311 /* If we unable to resume VM, cancel closing: */ 312 if (!uisession()->unpause()) 313 closeAction = UIVMCloseDialog::ResultCode_Cancel; 314 } 315 } 316 } 317 else 318 { 319 /* Else user misconfigured .vbox file, 'power-off' will be the action: */ 320 closeAction = UIVMCloseDialog::ResultCode_PowerOff; 321 } 322 323 /* Cleanup close-dialog: */ 283 324 delete pCloseDlg; 284 return; 285 } 286 287 /* This flag will keep the status of every further logical operation: */ 288 bool fSuccess = true; 289 /* This flag determines if VM was paused before we called for close-event: */ 290 bool fWasPaused = uisession()->isPaused(); 291 292 if (fSuccess) 293 { 294 /* Pause VM if necessary: */ 295 if (!fWasPaused) 296 fSuccess = uisession()->pause(); 297 } 298 299 if (fSuccess) 300 { 301 /* Preventing auto-closure: */ 302 machineLogic()->setPreventAutoClose(true); 303 304 /* Show the close-dialog: */ 305 UIVMCloseDialog::ResultCode dialogResult = (UIVMCloseDialog::ResultCode)pCloseDlg->exec(); 306 307 /* Destroy the dialog early: */ 308 delete pCloseDlg; 309 310 /* Was the dialog accepted? */ 311 if (dialogResult != UIVMCloseDialog::ResultCode_Cancel) 312 { 313 switch (dialogResult) 314 { 315 case UIVMCloseDialog::ResultCode_Save: 316 { 317 fSuccess = uisession()->saveState(); 318 fCloseRuntimeUI = fSuccess; 319 break; 320 } 321 case UIVMCloseDialog::ResultCode_Shutdown: 322 { 323 fSuccess = uisession()->shutDown(); 324 if (fSuccess) 325 fWasPaused = true; 326 break; 327 } 328 case UIVMCloseDialog::ResultCode_PowerOff: 329 case UIVMCloseDialog::ResultCode_PowerOff_With_Discarding: 330 { 331 bool fServerCrashed = false; 332 fSuccess = uisession()->powerOff(dialogResult == UIVMCloseDialog::ResultCode_PowerOff_With_Discarding, 333 fServerCrashed); 334 fCloseRuntimeUI = fSuccess || fServerCrashed; 335 break; 336 } 337 default: 338 break; 339 } 340 } 341 342 /* Restore the running state if needed: */ 343 if (fSuccess && !fCloseRuntimeUI && !fWasPaused && uisession()->machineState() == KMachineState_Paused) 344 uisession()->unpause(); 345 346 /* Allowing auto-closure: */ 347 machineLogic()->setPreventAutoClose(false); 348 } 349 350 /* We've received a request to close Runtime UI: */ 351 if (fCloseRuntimeUI) 352 uisession()->closeRuntimeUI(); 325 } 326 327 /* Depending on chosen result: */ 328 switch (closeAction) 329 { 330 case UIVMCloseDialog::ResultCode_Save: 331 { 332 /* Save VM state: */ 333 machineLogic()->saveState(); 334 break; 335 } 336 case UIVMCloseDialog::ResultCode_Shutdown: 337 { 338 /* Shutdown VM: */ 339 machineLogic()->shutdown(); 340 break; 341 } 342 case UIVMCloseDialog::ResultCode_PowerOff: 343 case UIVMCloseDialog::ResultCode_PowerOff_With_Discarding: 344 { 345 /* Power VM off: */ 346 machineLogic()->powerOff(closeAction == UIVMCloseDialog::ResultCode_PowerOff_With_Discarding); 347 break; 348 } 349 default: 350 break; 351 } 353 352 } 354 353 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.cpp
r45425 r45736 338 338 } 339 339 340 bool UISession::shutDown() 341 { 342 /* Resume VM to let it grab the ACPI shutdown signal: */ 343 if (!unpause()) 344 { 345 /* Failed in console: */ 346 return false; 347 } 340 bool UISession::shutdown() 341 { 348 342 /* Send ACPI shutdown signal if possible: */ 349 343 CConsole console = m_session.GetConsole(); … … 369 363 /* Show the power-off progress: */ 370 364 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_poweroff_90px.png"); 371 if (progress. GetResultCode() == 0)365 if (progress.isOk() && progress.GetResultCode() == 0) 372 366 { 373 367 /* Discard the current state if requested: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UISession.h
r45224 r45736 90 90 void powerUp(); 91 91 bool saveState(); 92 bool shut Down();92 bool shutdown(); 93 93 bool powerOff(bool fIncludingDiscard, bool &fServerCrashed); 94 94 void closeRuntimeUI(); … … 113 113 machineState() == KMachineState_Teleporting || 114 114 machineState() == KMachineState_LiveSnapshotting; } 115 bool isStuck() const { return machineState() == KMachineState_Stuck; } 115 116 bool isFirstTimeStarted() const { return m_fIsFirstTimeStarted; } 116 117 bool isIgnoreRuntimeMediumsChanging() const { return m_fIsIgnoreRuntimeMediumsChanging; } -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.cpp
r45226 r45736 62 62 /* Retranslate finally: */ 63 63 retranslateUi(); 64 } 65 66 /* static */ 67 UIVMCloseDialog::ResultCode UIVMCloseDialog::parseResultCode(const QString &strCloseAction) 68 { 69 ResultCode resultCode = ResultCode_Cancel; 70 if (!strCloseAction.compare("Save", Qt::CaseInsensitive)) 71 resultCode = ResultCode_Save; 72 else if (!strCloseAction.compare("Shutdown", Qt::CaseInsensitive)) 73 resultCode = ResultCode_Shutdown; 74 else if (!strCloseAction.compare("PowerOff", Qt::CaseInsensitive)) 75 resultCode = ResultCode_PowerOff; 76 return resultCode; 64 77 } 65 78 … … 210 223 /* Configure icon: */ 211 224 m_pSaveIcon->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); 212 m_pSaveIcon->setPixmap(QPixmap(":/s tate_saved_16px.png"));225 m_pSaveIcon->setPixmap(QPixmap(":/save_state_16px.png")); 213 226 } 214 227 /* Prepare 'save' radio-button: */ -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIVMCloseDialog.h
r45212 r45736 56 56 /* API: Validation stuff: */ 57 57 bool isValid() const { return m_fValid; } 58 59 /* Static API: Parse string containing result-code: */ 60 static ResultCode parseResultCode(const QString &strCloseAction); 58 61 59 62 private slots: -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UIActionPoolSelector.cpp
r44583 r45736 889 889 890 890 UIActionSimpleSave(UIActionPool *pParent) 891 : UIActionSimple(pParent, ":/s tate_saved_16px.png")891 : UIActionSimple(pParent, ":/save_state_16px.png", ":/save_state_disabled_16px.png") 892 892 { 893 893 retranslateUi(); -
trunk/src/VBox/Frontends/VirtualBox/src/selector/UISelectorWindow.cpp
r45377 r45736 603 603 /* Get session console: */ 604 604 CConsole console = session.GetConsole(); 605 /* P repare machine state saving: */606 CProgress progress = console.SaveState();605 /* Pause VM first: */ 606 console.Pause(); 607 607 if (console.isOk()) 608 608 { 609 /* Show machine state saving progress: */ 610 CMachine machine = session.GetMachine(); 611 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png"); 612 if (!progress.isOk() || progress.GetResultCode() != 0) 613 msgCenter().cannotSaveMachineState(progress, machine.GetName()); 609 /* Prepare machine state saving: */ 610 CProgress progress = console.SaveState(); 611 if (console.isOk()) 612 { 613 /* Show machine state saving progress: */ 614 CMachine machine = session.GetMachine(); 615 msgCenter().showModalProgressDialog(progress, machine.GetName(), ":/progress_state_save_90px.png"); 616 if (!progress.isOk() || progress.GetResultCode() != 0) 617 msgCenter().cannotSaveMachineState(progress, machine.GetName()); 618 } 619 else 620 msgCenter().cannotSaveMachineState(console); 614 621 } 615 622 else 616 msgCenter().cannot SaveMachineState(console);623 msgCenter().cannotPauseMachine(console); 617 624 618 625 /* Unlock machine finally: */
Note:
See TracChangeset
for help on using the changeset viewer.