本文整理汇总了C++中CGuestOSType::isNull方法的典型用法代码示例。如果您正苦于以下问题:C++ CGuestOSType::isNull方法的具体用法?C++ CGuestOSType::isNull怎么用?C++ CGuestOSType::isNull使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CGuestOSType
的用法示例。
在下文中一共展示了CGuestOSType::isNull方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: vboxGlobal
bool UINewVMWzdPage5::constructMachine()
{
CVirtualBox vbox = vboxGlobal().virtualBox();
/* OS type */
CGuestOSType type = field("type").value<CGuestOSType>();
AssertMsg(!type.isNull(), ("GuestOSType must return non-null type"));
QString typeId = type.GetId();
/* Create a machine with the default settings file location */
if (m_Machine.isNull())
{
m_Machine = vbox.CreateMachine(QString::null, // auto-compose filename
field("name").toString(),
typeId,
QString::null, // machine ID
false); // forceOverwrite
if (!vbox.isOk())
{
msgCenter().cannotCreateMachine(vbox, this);
return false;
}
/* The FirstRun wizard is to be shown only when we don't attach any hard disk or attach a new (empty) one.
* Selecting an existing hard disk will cancel the wizard. */
if (field("hardDiskId").toString().isNull() || !field("hardDisk").value<CMedium>().isNull())
m_Machine.SetExtraData(VBoxDefs::GUI_FirstRun, "yes");
}
/* RAM size */
m_Machine.SetMemorySize(field("ram").toInt());
/* VRAM size - select maximum between recommended and minimum for fullscreen */
m_Machine.SetVRAMSize (qMax (type.GetRecommendedVRAM(),
(ULONG) (VBoxGlobal::requiredVideoMemory(typeId) / _1M)));
/* Selecting recommended chipset type */
m_Machine.SetChipsetType(type.GetRecommendedChipset());
/* Selecting recommended Audio Controller */
m_Machine.GetAudioAdapter().SetAudioController(type.GetRecommendedAudioController());
/* Enabling audio by default */
m_Machine.GetAudioAdapter().SetEnabled(true);
/* Enable the OHCI and EHCI controller by default for new VMs. (new in 2.2) */
CUSBController usbController = m_Machine.GetUSBController();
if ( !usbController.isNull()
&& usbController.GetProxyAvailable())
{
usbController.SetEnabled(true);
/*
* USB 2.0 is only available if the proper ExtPack is installed.
*
* Note. Configuring EHCI here and providing messages about
* the missing extpack isn't exactly clean, but it is a
* necessary evil to patch over legacy compatability issues
* introduced by the new distribution model.
*/
CExtPackManager manager = vboxGlobal().virtualBox().GetExtensionPackManager();
if (manager.IsExtPackUsable(UI_ExtPackName))
usbController.SetEnabledEhci(true);
}
/* Create recommended DVD storage controller */
KStorageBus ctrDvdBus = type.GetRecommendedDvdStorageBus();
QString ctrDvdName = getNextControllerName(ctrDvdBus);
m_Machine.AddStorageController(ctrDvdName, ctrDvdBus);
/* Set recommended DVD storage controller type */
CStorageController dvdCtr = m_Machine.GetStorageControllerByName(ctrDvdName);
KStorageControllerType dvdStorageControllerType = type.GetRecommendedDvdStorageController();
dvdCtr.SetControllerType(dvdStorageControllerType);
/* Create recommended HD storage controller if it's not the same as the DVD controller */
KStorageBus ctrHdBus = type.GetRecommendedHdStorageBus();
KStorageControllerType hdStorageControllerType = type.GetRecommendedHdStorageController();
CStorageController hdCtr;
QString ctrHdName;
if (ctrHdBus != ctrDvdBus || hdStorageControllerType != dvdStorageControllerType)
{
ctrHdName = getNextControllerName(ctrHdBus);
m_Machine.AddStorageController(ctrHdName, ctrHdBus);
hdCtr = m_Machine.GetStorageControllerByName(ctrHdName);
hdCtr.SetControllerType(hdStorageControllerType);
/* Set the port count to 1 if SATA is used. */
if (hdStorageControllerType == KStorageControllerType_IntelAhci)
hdCtr.SetPortCount(1);
}
else
{
/* The HD controller is the same as DVD */
hdCtr = dvdCtr;
ctrHdName = ctrDvdName;
}
/* Turn on PAE, if recommended */
m_Machine.SetCPUProperty(KCPUPropertyType_PAE, type.GetRecommendedPae());
//.........这里部分代码省略.........