Changeset 54149 in vbox
- Timestamp:
- Feb 11, 2015 4:32:45 PM (10 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r53450 r54149 414 414 } 415 415 416 void UIMessageCenter::cannotCreateVirtualBox (const CVirtualBox &vbox) const416 void UIMessageCenter::cannotCreateVirtualBoxClient(const CVirtualBoxClient &client) const 417 417 { 418 418 error(0, MessageType_Critical, 419 tr("<p>Failed to create the VirtualBox COM object.</p>"419 tr("<p>Failed to create the VirtualBoxClient COM object.</p>" 420 420 "<p>The application will now terminate.</p>"), 421 formatErrorInfo( vbox));421 formatErrorInfo(client)); 422 422 } 423 423 -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r53328 r54149 157 157 void cannotInitUserHome(const QString &strUserHome) const; 158 158 void cannotInitCOM(HRESULT rc) const; 159 void cannotCreateVirtualBox (const CVirtualBox &vbox) const;159 void cannotCreateVirtualBoxClient(const CVirtualBoxClient &client) const; 160 160 161 161 /* API: Global warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r54081 r54149 283 283 QString VBoxGlobal::vboxVersionString() const 284 284 { 285 return m VBox.GetVersion();285 return m_vbox.GetVersion(); 286 286 } 287 287 288 288 QString VBoxGlobal::vboxVersionStringNormalized() const 289 289 { 290 return m VBox.GetVersionNormalized();290 return m_vbox.GetVersionNormalized(); 291 291 } 292 292 293 293 bool VBoxGlobal::isBeta() const 294 294 { 295 return m VBox.GetVersion().contains("BETA", Qt::CaseInsensitive);295 return m_vbox.GetVersion().contains("BETA", Qt::CaseInsensitive); 296 296 } 297 297 … … 330 330 bool VBoxGlobal::setSettings (VBoxGlobalSettings &gs) 331 331 { 332 gs.save (mVBox);333 334 if (!m VBox.isOk())335 { 336 msgCenter().cannotSaveGlobalConfig (mVBox);332 gs.save(m_vbox); 333 334 if (!m_vbox.isOk()) 335 { 336 msgCenter().cannotSaveGlobalConfig(m_vbox); 337 337 return false; 338 338 } … … 995 995 /* Boot order */ 996 996 QString bootOrder; 997 for (ulong i = 1; i <= m VBox.GetSystemProperties().GetMaxBootPosition(); ++ i)997 for (ulong i = 1; i <= m_vbox.GetSystemProperties().GetMaxBootPosition(); ++ i) 998 998 { 999 999 KDeviceType device = aMachine.GetBootOrder (i); … … 1243 1243 QString item; 1244 1244 1245 ulong count = m VBox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3);1245 ulong count = m_vbox.GetSystemProperties().GetMaxNetworkAdapters(KChipsetType_PIIX3); 1246 1246 int rows = 2; /* including section header and footer */ 1247 1247 for (ulong slot = 0; slot < count; slot ++) … … 1300 1300 QString item; 1301 1301 1302 ulong count = m VBox.GetSystemProperties().GetSerialPortCount();1302 ulong count = m_vbox.GetSystemProperties().GetSerialPortCount(); 1303 1303 int rows = 2; /* including section header and footer */ 1304 1304 for (ulong slot = 0; slot < count; slot ++) … … 1345 1345 QString item; 1346 1346 1347 ulong count = m VBox.GetSystemProperties().GetParallelPortCount();1347 ulong count = m_vbox.GetSystemProperties().GetParallelPortCount(); 1348 1348 int rows = 2; /* including section header and footer */ 1349 1349 for (ulong slot = 0; slot < count; slot ++) … … 1458 1458 1459 1459 /* Search for the corresponding machine: */ 1460 CMachine machine = m VBox.FindMachine(strId);1460 CMachine machine = m_vbox.FindMachine(strId); 1461 1461 if (machine.isNull()) 1462 1462 { 1463 msgCenter().cannotFindMachineById(m VBox, strId);1463 msgCenter().cannotFindMachineById(m_vbox, strId); 1464 1464 break; 1465 1465 } … … 1635 1635 1636 1636 /* Initialize variables: */ 1637 CVirtualBox vbox = v boxGlobal().virtualBox();1637 CVirtualBox vbox = virtualBox(); 1638 1638 1639 1639 /* Remember the path of the last chosen medium: */ … … 3814 3814 if (VBoxGlobal::hasAllowedExtension(strFile, VBoxFileExts)) 3815 3815 { 3816 CVirtualBox vbox = v boxGlobal().virtualBox();3816 CVirtualBox vbox = virtualBox(); 3817 3817 CMachine machine = vbox.FindMachine(strFile); 3818 3818 if (!machine.isNull()) … … 3870 3870 } 3871 3871 3872 mVBox.createInstance (CLSID_VirtualBox); 3873 if (!mVBox.isOk()) 3874 { 3875 msgCenter().cannotCreateVirtualBox (mVBox); 3872 /* Create VirtualBox client instance: */ 3873 m_client.createInstance(CLSID_VirtualBoxClient); 3874 /* And make sure it was created: */ 3875 if (!m_client.isOk()) 3876 { 3877 msgCenter().cannotCreateVirtualBoxClient(m_client); 3876 3878 return; 3877 3879 } 3878 mHost = virtualBox().GetHost(); 3879 mHomeFolder = virtualBox().GetHomeFolder(); 3880 /* Fetch corresponding objects/values: */ 3881 m_vbox = virtualBoxClient().GetVirtualBox(); 3882 m_host = virtualBox().GetHost(); 3883 m_strHomeFolder = virtualBox().GetHomeFolder(); 3880 3884 3881 3885 /* create default non-null global settings */ … … 3883 3887 3884 3888 /* try to load global settings */ 3885 gset.load (mVBox);3886 if (!m VBox.isOk() || !gset)3887 { 3888 msgCenter().cannotLoadGlobalConfig (mVBox, gset.lastError());3889 gset.load(m_vbox); 3890 if (!m_vbox.isOk() || !gset) 3891 { 3892 msgCenter().cannotLoadGlobalConfig(m_vbox, gset.lastError()); 3889 3893 return; 3890 3894 } … … 3901 3905 3902 3906 /* Initialize guest OS Type list. */ 3903 CGuestOSTypeVector coll = m VBox.GetGuestOSTypes();3907 CGuestOSTypeVector coll = m_vbox.GetGuestOSTypes(); 3904 3908 int osTypeCount = coll.size(); 3905 3909 AssertMsg(osTypeCount > 0, ("Number of OS types must not be zero")); … … 4117 4121 /* Search for corresponding VM: */ 4118 4122 QUuid uuid = QUuid(vmNameOrUuid); 4119 const CMachine machine = m VBox.FindMachine(vmNameOrUuid);4123 const CMachine machine = m_vbox.FindMachine(vmNameOrUuid); 4120 4124 if (!uuid.isNull()) 4121 4125 { 4122 4126 if (machine.isNull() && showStartVMErrors()) 4123 return msgCenter().cannotFindMachineById(m VBox, vmNameOrUuid);4127 return msgCenter().cannotFindMachineById(m_vbox, vmNameOrUuid); 4124 4128 } 4125 4129 else 4126 4130 { 4127 4131 if (machine.isNull() && showStartVMErrors()) 4128 return msgCenter().cannotFindMachineByName(m VBox, vmNameOrUuid);4132 return msgCenter().cannotFindMachineByName(m_vbox, vmNameOrUuid); 4129 4133 } 4130 4134 vmUuid = machine.GetId(); … … 4157 4161 4158 4162 if (mSettingsPwSet) 4159 m VBox.SetSettingsSecret(mSettingsPw);4163 m_vbox.SetSettingsSecret(mSettingsPw); 4160 4164 4161 4165 if (visualStateType != UIVisualStateType_Invalid && !vmUuid.isEmpty()) … … 4275 4279 4276 4280 /* the last steps to ensure we don't use COM any more */ 4277 m Host.detach();4278 m VBox.detach();4281 m_host.detach(); 4282 m_vbox.detach(); 4279 4283 4280 4284 /* There may be UIMedium(s)EnumeratedEvent instances still in the message … … 4324 4328 strEnvValue = "veto"; 4325 4329 4326 QString strExtraValue = mVBox.GetExtraData(pszExtraDataName).toLower().trimmed();4330 QString strExtraValue = m_vbox.GetExtraData(pszExtraDataName).toLower().trimmed(); 4327 4331 if (strExtraValue.isEmpty()) 4328 4332 strExtraValue = QString(); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.h
r53449 r54149 38 38 #include "VBox/com/Guid.h" 39 39 #include "CHost.h" 40 #include "CVirtualBoxClient.h" 40 41 #include "CVirtualBox.h" 41 42 #include "CSession.h" … … 102 103 #endif /* Q_WS_MAC */ 103 104 104 CVirtualBox virtualBox() const { return mVBox; } 105 CHost host() const { return mHost; } 106 QString homeFolder() const { return mHomeFolder; } 105 /** Returns the copy of VirtualBox client wrapper. */ 106 CVirtualBoxClient virtualBoxClient() const { return m_client; } 107 /** Returns the copy of VirtualBox object wrapper. */ 108 CVirtualBox virtualBox() const { return m_vbox; } 109 /** Returns the copy of VirtualBox host-object wrapper. */ 110 CHost host() const { return m_host; } 111 /** Returns the symbolic VirtualBox home-folder representation. */ 112 QString homeFolder() const { return m_strHomeFolder; } 107 113 108 114 VBoxGlobalSettings &settings() { return gset; } … … 430 436 bool mValid; 431 437 432 CVirtualBox mVBox; 433 CHost mHost; 434 QString mHomeFolder; 438 /** Holds the instance of VirtualBox client wrapper. */ 439 CVirtualBoxClient m_client; 440 /** Holds the copy of VirtualBox object wrapper. */ 441 CVirtualBox m_vbox; 442 /** Holds the copy of VirtualBox host-object wrapper. */ 443 CHost m_host; 444 /** Holds the symbolic VirtualBox home-folder representation. */ 445 QString m_strHomeFolder; 435 446 436 447 VBoxGlobalSettings gset;
Note:
See TracChangeset
for help on using the changeset viewer.