- Timestamp:
- Apr 17, 2020 3:01:00 PM (5 years ago)
- svn:sync-xref-src-repo-rev:
- 137281
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r83198 r83760 94 94 #include "CAudioAdapter.h" 95 95 #include "CBIOSSettings.h" 96 #include "CCloudMachine.h" 96 97 #include "CConsole.h" 97 98 #include "CExtPack.h" … … 2452 2453 } 2453 2454 2455 bool UICommon::launchMachine(CCloudMachine &comMachine) 2456 { 2457 /* Acquire machine name: */ 2458 const QString strName = comMachine.GetName(); 2459 if (!comMachine.isOk()) 2460 { 2461 msgCenter().cannotAcquireMachineParameter(comMachine); 2462 return false; 2463 } 2464 2465 /* Prepare machine power up: */ 2466 CProgress comProgress = comMachine.PowerUp(); 2467 if (!comMachine.isOk()) 2468 { 2469 msgCenter().cannotPowerUpMachine(comMachine); 2470 return false; 2471 } 2472 2473 /* Show machine power up progress: */ 2474 msgCenter().showModalProgressDialog(comProgress, strName, ":/progress_start_90px.png"); 2475 if (!comProgress.isOk() || comProgress.GetResultCode() != 0) 2476 { 2477 msgCenter().cannotPowerUpMachine(comProgress, strName); 2478 return false; 2479 } 2480 2481 /* Success by default: */ 2482 return true; 2483 } 2484 2454 2485 CSession UICommon::openSession(const QUuid &uId, KLockType lockType /* = KLockType_Shared */) 2455 2486 { -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r83198 r83760 55 55 class QSpinBox; 56 56 class QToolButton; 57 class CCloudMachine; 57 58 class CHostVideoInputDevice; 58 59 class CMachine; … … 469 470 /** Launches certain @a comMachine in specified @a enmLaunchMode. */ 470 471 bool launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode = LaunchMode_Default); 472 /** Launches certain @a comMachine. */ 473 bool launchMachine(CCloudMachine &comMachine); 471 474 472 475 /** Opens session of certain @a enmLockType for VM with certain @a uId. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r83752 r83760 923 923 .arg(CConsole(console).GetMachine().GetName()), 924 924 UIErrorString::formatErrorInfo(console)); 925 } 926 927 void UIMessageCenter::cannotPowerUpMachine(const CCloudMachine &comMachine) const 928 { 929 error(0, MessageType_Error, 930 tr("Failed to start the virtual machine <b>%1</b>.") 931 .arg(CCloudMachine(comMachine).GetName()), 932 UIErrorString::formatErrorInfo(comMachine)); 933 } 934 935 void UIMessageCenter::cannotPowerUpMachine(const CProgress &comProgress, const QString &strMachineName) const 936 { 937 error(0, MessageType_Error, 938 tr("Failed to start the virtual machine <b>%1</b>.") 939 .arg(strMachineName), 940 UIErrorString::formatErrorInfo(comProgress)); 925 941 } 926 942 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r83752 r83760 294 294 void cannotSaveMachineState(const CProgress &progress, const QString &strMachineName); 295 295 void cannotACPIShutdownMachine(const CConsole &console) const; 296 void cannotPowerUpMachine(const CCloudMachine &comMachine) const; 297 void cannotPowerUpMachine(const CProgress &comProgress, const QString &strMachineName) const; 296 298 void cannotPowerDownMachine(const CConsole &console) const; 297 299 void cannotPowerDownMachine(const CCloudMachine &comMachine) const; -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r83755 r83760 1668 1668 && fStartConfirmed)) 1669 1669 { 1670 /* Make sure item is local one: */1670 /* For local machine: */ 1671 1671 if (pItem->itemType() == UIVirtualMachineItem::ItemType_Local) 1672 1672 { … … 1683 1683 CMachine machine = pItem->toLocal()->machine(); 1684 1684 uiCommon().launchMachine(machine, enmItemLaunchMode); 1685 } 1686 /* For real cloud machine: */ 1687 else if (pItem->itemType() == UIVirtualMachineItem::ItemType_CloudReal) 1688 { 1689 /* Acquire cloud machine: */ 1690 CCloudMachine comCloudMachine = pItem->toCloud()->machine(); 1691 /* Launch current VM: */ 1692 uiCommon().launchMachine(comCloudMachine); 1693 /* Update info in any case: */ 1694 pItem->toCloud()->updateInfoAsync(false /* delayed? */); 1685 1695 } 1686 1696 } … … 1974 1984 case UIActionIndexST_M_Group_M_StartOrShow: 1975 1985 case UIActionIndexST_M_Group_M_StartOrShow_S_StartNormal: 1986 case UIActionIndexST_M_Machine_M_StartOrShow: 1987 case UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal: 1988 { 1989 return !isGroupSavingInProgress() && 1990 isAtLeastOneItemCanBeStartedOrShown(items) && 1991 (m_pWidget->currentMachineTool() != UIToolType_Snapshots || 1992 m_pWidget->isCurrentStateItemSelected()); 1993 } 1976 1994 case UIActionIndexST_M_Group_M_StartOrShow_S_StartHeadless: 1977 1995 case UIActionIndexST_M_Group_M_StartOrShow_S_StartDetachable: 1978 case UIActionIndexST_M_Machine_M_StartOrShow:1979 case UIActionIndexST_M_Machine_M_StartOrShow_S_StartNormal:1980 1996 case UIActionIndexST_M_Machine_M_StartOrShow_S_StartHeadless: 1981 1997 case UIActionIndexST_M_Machine_M_StartOrShow_S_StartDetachable: 1982 1998 { 1983 1999 return !isGroupSavingInProgress() && 2000 isItemsLocal(items) && 1984 2001 isAtLeastOneItemCanBeStartedOrShown(items) && 1985 2002 (m_pWidget->currentMachineTool() != UIToolType_Snapshots || … … 2181 2198 foreach (UIVirtualMachineItem *pItem, items) 2182 2199 { 2183 if ( pItem->toLocal() 2184 && pItem->isItemStarted() 2200 if ( pItem->isItemStarted() 2185 2201 && pItem->isItemCanBeSwitchedTo()) 2186 2202 return true; … … 2194 2210 foreach (UIVirtualMachineItem *pItem, items) 2195 2211 { 2196 if ( pItem->toLocal() 2197 && ( ( pItem->isItemPoweredOff() 2198 && pItem->isItemEditable()) 2199 || ( pItem->isItemStarted() 2200 && pItem->isItemCanBeSwitchedTo()))) 2212 if ( ( pItem->isItemPoweredOff() 2213 && pItem->isItemEditable()) 2214 || ( pItem->isItemStarted() 2215 && pItem->isItemCanBeSwitchedTo())) 2201 2216 return true; 2202 2217 }
Note:
See TracChangeset
for help on using the changeset viewer.