Changeset 90920 in vbox
- Timestamp:
- Aug 26, 2021 4:10:52 PM (4 years ago)
- svn:sync-xref-src-repo-rev:
- 146557
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r90893 r90920 976 976 *********************************************************************************************************************************/ 977 977 978 UINotificationProgressMachinePowerOff::UINotificationProgressMachinePowerOff(const CMachine &comMachine) 978 UINotificationProgressMachinePowerOff::UINotificationProgressMachinePowerOff(const CMachine &comMachine, 979 const CConsole &comConsole /* = CConsole() */) 979 980 : m_comMachine(comMachine) 981 , m_comConsole(comConsole) 980 982 { 981 983 connect(this, &UINotificationProgress::sigProgressFinished, … … 983 985 } 984 986 985 UINotificationProgressMachinePowerOff::UINotificationProgressMachinePowerOff(const CConsole &comConsole)986 : m_comConsole(comConsole)987 {988 connect(this, &UINotificationProgress::sigProgressFinished,989 this, &UINotificationProgressMachinePowerOff::sltHandleProgressFinished);990 }991 992 987 QString UINotificationProgressMachinePowerOff::name() const 993 988 { … … 1004 999 /* Prepare machine to power off: */ 1005 1000 CMachine comMachine = m_comMachine; 1006 1007 /* For Runtime UI: */ 1001 /* Prepare console to power off: */ 1002 CConsole comConsole = m_comConsole; 1003 1004 /* For Manager UI: */ 1008 1005 switch (uiCommon().uiType()) 1009 1006 { 1010 case UICommon::UIType_ RuntimeUI:1007 case UICommon::UIType_SelectorUI: 1011 1008 { 1012 /* Acquire VM: */ 1013 AssertReturn(m_comConsole.isNotNull(), CProgress()); 1014 comMachine = m_comConsole.GetMachine(); 1015 if (!m_comConsole.isOk()) 1009 /* Acquire VM id: */ 1010 const QUuid uId = comMachine.GetId(); 1011 if (!comMachine.isOk()) 1016 1012 { 1017 comResult = m_comConsole;1013 comResult = comMachine; 1018 1014 return CProgress(); 1019 1015 } 1020 1016 1021 break;1022 }1023 default:1024 break;1025 }1026 1027 /* Acquire VM id: */1028 const QUuid uId = comMachine.GetId();1029 if (!comMachine.isOk())1030 {1031 comResult = comMachine;1032 return CProgress();1033 }1034 1035 /* Acquire VM name: */1036 m_strName = comMachine.GetName();1037 if (!comMachine.isOk())1038 {1039 comResult = comMachine;1040 return CProgress();1041 }1042 1043 /* Prepare console to power off: */1044 CConsole comConsole = m_comConsole;1045 1046 /* For Manager UI: */1047 switch (uiCommon().uiType())1048 {1049 case UICommon::UIType_SelectorUI:1050 {1051 1017 /* Open a session thru which we will modify the machine: */ 1052 1018 m_comSession = uiCommon().openExistingSession(uId); … … 1080 1046 /* Initialize progress-wrapper: */ 1081 1047 CProgress comProgress = comConsole.PowerDown(); 1048 1049 /* For Runtime UI: */ 1050 switch (uiCommon().uiType()) 1051 { 1052 case UICommon::UIType_RuntimeUI: 1053 { 1054 /* Check the console state, it might be already gone: */ 1055 if (!comConsole.isNull()) 1056 { 1057 /* This can happen if VBoxSVC is not running: */ 1058 COMResult res(comConsole); 1059 if (FAILED_DEAD_INTERFACE(res.rc())) 1060 return CProgress(); 1061 } 1062 1063 break; 1064 } 1065 default: 1066 break; 1067 } 1068 1082 1069 /* Store COM result: */ 1083 1070 comResult = comConsole; 1071 1072 /* Acquire VM name, no error checks, too late: */ 1073 m_strName = comMachine.GetName(); 1074 1084 1075 /* Return progress-wrapper: */ 1085 1076 return comProgress; -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r90893 r90920 567 567 568 568 /** Constructs machine power-off notification-progress. 569 * @param comMachine Brings the machine being powered off. */570 UINotificationProgressMachinePowerOff(const CMachine &comMachine);571 /** Constructs machine power-off notification-progress.572 * @param comConsole Brings the console of machine being powered off. */573 UINotificationProgressMachinePowerOff(const CConsole &comConsole);569 * @param comMachine Brings the machine being powered off. 570 * @param comConsole Brings the console of machine being powered off. 571 * @param fIncludingDiscard Brings whether machine state should be discarded. */ 572 UINotificationProgressMachinePowerOff(const CMachine &comMachine, 573 const CConsole &comConsole = CConsole()); 574 574 575 575 protected:
Note:
See TracChangeset
for help on using the changeset viewer.