Changeset 98335 in vbox
- Timestamp:
- Jan 27, 2023 2:28:05 PM (2 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackend.h
r98103 r98335 118 118 template<> SHARED_LIBRARY_STUFF bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription>(); 119 119 template<> SHARED_LIBRARY_STUFF bool canConvert<UIColorThemeType>(); 120 template<> SHARED_LIBRARY_STUFF bool canConvert<UILaunchMode>(); 120 121 template<> SHARED_LIBRARY_STUFF bool canConvert<UIToolType>(); 121 122 template<> SHARED_LIBRARY_STUFF bool canConvert<UIVisualStateType>(); … … 242 243 template<> SHARED_LIBRARY_STUFF QString toInternalString(const UIColorThemeType &colorThemeType); 243 244 template<> SHARED_LIBRARY_STUFF UIColorThemeType fromInternalString<UIColorThemeType>(const QString &strColorThemeType); 245 template<> SHARED_LIBRARY_STUFF UILaunchMode fromInternalString<UILaunchMode>(const QString &strDefaultFrontendType); 244 246 template<> SHARED_LIBRARY_STUFF QString toInternalString(const UIToolType &enmToolType); 245 247 template<> SHARED_LIBRARY_STUFF UIToolType fromInternalString<UIToolType>(const QString &strToolType); -
trunk/src/VBox/Frontends/VirtualBox/src/converter/UIConverterBackendGlobal.cpp
r98103 r98335 73 73 template<> bool canConvert<UIExtraDataMetaDefs::DetailsElementOptionTypeDescription>() { return true; } 74 74 template<> bool canConvert<UIColorThemeType>() { return true; } 75 template<> bool canConvert<UILaunchMode>() { return true; } 75 76 template<> bool canConvert<UIToolType>() { return true; } 76 77 template<> bool canConvert<UIVisualStateType>() { return true; } … … 1657 1658 } 1658 1659 1660 /* UILaunchMode <= QString: */ 1661 template<> UILaunchMode fromInternalString<UILaunchMode>(const QString &strDefaultFrontendType) 1662 { 1663 if (strDefaultFrontendType.compare("Default", Qt::CaseInsensitive) == 0) 1664 return UILaunchMode_Default; 1665 if (strDefaultFrontendType.compare("Headless", Qt::CaseInsensitive) == 0) 1666 return UILaunchMode_Headless; 1667 if (strDefaultFrontendType.compare("Separate", Qt::CaseInsensitive) == 0) 1668 return UILaunchMode_Separate; 1669 return UILaunchMode_Invalid; 1670 } 1671 1659 1672 /* QString <= UIToolType: */ 1660 1673 template<> QString toInternalString(const UIToolType &enmToolType) -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.cpp
r98103 r98335 1265 1265 1266 1266 /* static */ 1267 bool UICommon::launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode /* =LaunchMode_Default */)1267 bool UICommon::launchMachine(CMachine &comMachine, UILaunchMode enmLaunchMode /* = UILaunchMode_Default */) 1268 1268 { 1269 1269 /* Switch to machine window(s) if possible: */ … … 1291 1291 1292 1292 /* Not for separate UI (which can connect to machine in any state): */ 1293 if (enmLaunchMode != LaunchMode_Separate)1293 if (enmLaunchMode != UILaunchMode_Separate) 1294 1294 { 1295 1295 /* Make sure machine-state is one of required: */ … … 1331 1331 switch (enmLaunchMode) 1332 1332 { 1333 case LaunchMode_Default: strType = ""; break;1334 case LaunchMode_Separate: strType = uiCommon().isSeparateProcess() ? "headless" : "separate"; break;1335 case LaunchMode_Headless: strType = "headless"; break;1333 case UILaunchMode_Default: strType = ""; break; 1334 case UILaunchMode_Separate: strType = uiCommon().isSeparateProcess() ? "headless" : "separate"; break; 1335 case UILaunchMode_Headless: strType = "headless"; break; 1336 1336 default: AssertFailedReturn(false); 1337 1337 } … … 1342 1342 { 1343 1343 /* If the VM is started separately and the VM process is already running, then it is OK. */ 1344 if (enmLaunchMode == LaunchMode_Separate)1344 if (enmLaunchMode == UILaunchMode_Separate) 1345 1345 { 1346 1346 const KMachineState enmState = comMachine.GetState(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UICommon.h
r98103 r98335 144 144 }; 145 145 146 /** VM launch modes. */147 enum LaunchMode148 {149 LaunchMode_Invalid,150 LaunchMode_Default,151 LaunchMode_Headless,152 LaunchMode_Separate153 };154 155 146 /** VM launch running options. */ 156 147 enum LaunchRunning … … 349 340 static bool switchToMachine(CMachine &comMachine); 350 341 /** Launches certain @a comMachine in specified @a enmLaunchMode. */ 351 static bool launchMachine(CMachine &comMachine, LaunchMode enmLaunchMode =LaunchMode_Default);342 static bool launchMachine(CMachine &comMachine, UILaunchMode enmLaunchMode = UILaunchMode_Default); 352 343 353 344 /** Opens session of certain @a enmLockType for VM with certain @a uId. */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIDefs.h
r98103 r98335 127 127 128 128 129 /** VM launch modes. */ 130 enum UILaunchMode 131 { 132 UILaunchMode_Invalid, 133 UILaunchMode_Default, 134 UILaunchMode_Headless, 135 UILaunchMode_Separate 136 }; 137 138 129 139 /** Storage-slot struct. */ 130 140 struct StorageSlot -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.cpp
r98103 r98335 1233 1233 QList<UIVirtualMachineItem*> items = currentItems(); 1234 1234 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1235 performStartOrShowVirtualMachines(items, UI Common::LaunchMode_Invalid);1235 performStartOrShowVirtualMachines(items, UILaunchMode_Invalid); 1236 1236 } 1237 1237 … … 1241 1241 QList<UIVirtualMachineItem*> items = currentItems(); 1242 1242 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1243 performStartOrShowVirtualMachines(items, UI Common::LaunchMode_Default);1243 performStartOrShowVirtualMachines(items, UILaunchMode_Default); 1244 1244 } 1245 1245 … … 1249 1249 QList<UIVirtualMachineItem*> items = currentItems(); 1250 1250 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1251 performStartOrShowVirtualMachines(items, UI Common::LaunchMode_Headless);1251 performStartOrShowVirtualMachines(items, UILaunchMode_Headless); 1252 1252 } 1253 1253 … … 1257 1257 QList<UIVirtualMachineItem*> items = currentItems(); 1258 1258 AssertMsgReturnVoid(!items.isEmpty(), ("At least one item should be selected!\n")); 1259 performStartOrShowVirtualMachines(items, UI Common::LaunchMode_Separate);1259 performStartOrShowVirtualMachines(items, UILaunchMode_Separate); 1260 1260 } 1261 1261 … … 2657 2657 /* static */ 2658 2658 void UIVirtualBoxManager::launchMachine(CMachine &comMachine, 2659 UI Common::LaunchMode enmLaunchMode /* = UICommon::LaunchMode_Default */)2659 UILaunchMode enmLaunchMode /* = UILaunchMode_Default */) 2660 2660 { 2661 2661 /* Switch to machine window(s) if possible: */ … … 2668 2668 2669 2669 /* Not for separate UI (which can connect to machine in any state): */ 2670 if (enmLaunchMode != UI Common::LaunchMode_Separate)2670 if (enmLaunchMode != UILaunchMode_Separate) 2671 2671 { 2672 2672 /* Make sure machine-state is one of required: */ … … 2710 2710 AssertReturnVoid(checkUnattendedInstallError(comUnattendedInstaller)); 2711 2711 2712 launchMachine(comMachine, fStartHeadless ? UI Common::LaunchMode_Headless : UICommon::LaunchMode_Default);2713 } 2714 2715 void UIVirtualBoxManager::performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, UI Common::LaunchMode enmLaunchMode)2712 launchMachine(comMachine, fStartHeadless ? UILaunchMode_Headless : UILaunchMode_Default); 2713 } 2714 2715 void UIVirtualBoxManager::performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, UILaunchMode enmLaunchMode) 2716 2716 { 2717 2717 /* Do nothing while group saving is in progress: */ … … 2749 2749 { 2750 2750 /* Fetch item launch mode: */ 2751 UI Common::LaunchMode enmItemLaunchMode = enmLaunchMode;2752 if (enmItemLaunchMode == UI Common::LaunchMode_Invalid)2751 UILaunchMode enmItemLaunchMode = enmLaunchMode; 2752 if (enmItemLaunchMode == UILaunchMode_Invalid) 2753 2753 enmItemLaunchMode = pItem->isItemRunningHeadless() 2754 ? UI Common::LaunchMode_Separate2754 ? UILaunchMode_Separate 2755 2755 : qApp->keyboardModifiers() == Qt::ShiftModifier 2756 ? UI Common::LaunchMode_Headless2757 : UI Common::LaunchMode_Default;2756 ? UILaunchMode_Headless 2757 : UILaunchMode_Default; 2758 2758 /* Acquire local machine: */ 2759 2759 CMachine machine = pItem->toLocal()->machine(); -
trunk/src/VBox/Frontends/VirtualBox/src/manager/UIVirtualBoxManager.h
r98103 r98335 398 398 void openNewMachineWizard(const QString &strISOFilePath = QString()); 399 399 /** Launches certain @a comMachine in specified @a enmLaunchMode. */ 400 static void launchMachine(CMachine &comMachine, UI Common::LaunchMode enmLaunchMode = UICommon::LaunchMode_Default);400 static void launchMachine(CMachine &comMachine, UILaunchMode enmLaunchMode = UILaunchMode_Default); 401 401 /** Launches certain @a comMachine. */ 402 402 static void launchMachine(CCloudMachine &comMachine); … … 406 406 407 407 /** Launches or shows virtual machines represented by passed @a items in corresponding @a enmLaunchMode (for launch). */ 408 void performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, UI Common::LaunchMode enmLaunchMode);408 void performStartOrShowVirtualMachines(const QList<UIVirtualMachineItem*> &items, UILaunchMode enmLaunchMode); 409 409 410 410 #ifndef VBOX_WS_WIN -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.cpp
r98103 r98335 1964 1964 *********************************************************************************************************************************/ 1965 1965 1966 UINotificationProgressMachinePowerUp::UINotificationProgressMachinePowerUp(const CMachine &comMachine, UI Common::LaunchMode enmLaunchMode)1966 UINotificationProgressMachinePowerUp::UINotificationProgressMachinePowerUp(const CMachine &comMachine, UILaunchMode enmLaunchMode) 1967 1967 : m_comMachine(comMachine) 1968 1968 , m_enmLaunchMode(enmLaunchMode) … … 2019 2019 switch (m_enmLaunchMode) 2020 2020 { 2021 case UI Common::LaunchMode_Default: strType = ""; break;2022 case UI Common::LaunchMode_Separate: strType = "separate"; break;2023 case UI Common::LaunchMode_Headless: strType = "headless"; break;2021 case UILaunchMode_Default: strType = ""; break; 2022 case UILaunchMode_Separate: strType = "separate"; break; 2023 case UILaunchMode_Headless: strType = "headless"; break; 2024 2024 default: AssertFailedReturn(CProgress()); 2025 2025 } … … 2028 2028 CProgress comProgress = m_comMachine.LaunchVMProcess(m_comSession, strType, astrEnv); 2029 2029 // /* If the VM is started separately and the VM process is already running, then it is OK. */ 2030 // if (m_enmLaunchMode == UI Common::LaunchMode_Separate)2030 // if (m_enmLaunchMode == UILaunchMode_Separate) 2031 2031 // { 2032 2032 // const KMachineState enmState = comMachine.GetState(); -
trunk/src/VBox/Frontends/VirtualBox/src/notificationcenter/UINotificationObjects.h
r98103 r98335 983 983 /** Constructs machine power-up notification-progress. 984 984 * @param comMachine Brings the machine being powered-up. */ 985 UINotificationProgressMachinePowerUp(const CMachine &comMachine, UI Common::LaunchMode enmLaunchMode);985 UINotificationProgressMachinePowerUp(const CMachine &comMachine, UILaunchMode enmLaunchMode); 986 986 987 987 protected: … … 1002 1002 1003 1003 /** Holds the machine being powered-up. */ 1004 CMachine 1004 CMachine m_comMachine; 1005 1005 /** Holds the launch mode. */ 1006 UI Common::LaunchMode m_enmLaunchMode;1006 UILaunchMode m_enmLaunchMode; 1007 1007 /** Holds the session being opened. */ 1008 CSession 1008 CSession m_comSession; 1009 1009 /** Holds the machine name. */ 1010 QString 1010 QString m_strName; 1011 1011 }; 1012 1012 -
trunk/src/VBox/Frontends/VirtualBox/src/runtime/UIMachine.cpp
r98103 r98335 91 91 92 92 /* Try to launch corresponding machine: */ 93 if (!UICommon::launchMachine(machine, UI Common::LaunchMode_Separate))93 if (!UICommon::launchMachine(machine, UILaunchMode_Separate)) 94 94 return false; 95 95 }
Note:
See TracChangeset
for help on using the changeset viewer.