Changeset 60547 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Apr 18, 2016 5:12:52 PM (9 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/globals
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.cpp
r60362 r60547 435 435 error(0, MessageType_Critical, 436 436 tr("<p>Failed to create the VirtualBoxClient COM object.</p>" 437 "<p>The application will now terminate.</p>"), 438 formatErrorInfo(client)); 439 } 440 441 void UIMessageCenter::cannotAcquireVirtualBox(const CVirtualBoxClient &client) const 442 { 443 error(0, MessageType_Critical, 444 tr("<p>Failed to acquire the VirtualBox COM object.</p>" 437 445 "<p>The application will now terminate.</p>"), 438 446 formatErrorInfo(client)); -
trunk/src/VBox/Frontends/VirtualBox/src/globals/UIMessageCenter.h
r57714 r60547 160 160 void cannotInitCOM(HRESULT rc) const; 161 161 void cannotCreateVirtualBoxClient(const CVirtualBoxClient &client) const; 162 void cannotAcquireVirtualBox(const CVirtualBoxClient &client) const; 162 163 163 164 /* API: Global warnings: */ -
trunk/src/VBox/Frontends/VirtualBox/src/globals/VBoxGlobal.cpp
r60500 r60547 4016 4016 } 4017 4017 4018 /* Create VirtualBox client instance: */4018 /* Make sure VirtualBoxClient instance created: */ 4019 4019 m_client.createInstance(CLSID_VirtualBoxClient); 4020 /* And make sure it was created: */4021 4020 if (!m_client.isOk()) 4022 4021 { 4023 4022 msgCenter().cannotCreateVirtualBoxClient(m_client); 4023 return; 4024 } 4025 /* Make sure VirtualBox instance acquired: */ 4026 m_vbox = m_client.GetVirtualBox(); 4027 if (!m_client.isOk()) 4028 { 4029 msgCenter().cannotAcquireVirtualBox(m_client); 4024 4030 return; 4025 4031 } … … 4496 4502 m_fWrappersValid = false; 4497 4503 /* Re-fetch corresponding CVirtualBox to restart VBoxSVC: */ 4498 // CVirtualBox is still NULL in current Main implementation, 4499 // and this call do not restart anything, so we are waiting 4500 // for subsequent event about VBoxSVC is available again. 4501 m_vbox = virtualBoxClient().GetVirtualBox(); 4504 m_vbox = m_client.GetVirtualBox(); 4505 if (!m_client.isOk()) 4506 { 4507 // The proper behavior would be to show the message and to exit the app, e.g.: 4508 // msgCenter().cannotAcquireVirtualBox(m_client); 4509 // return QApplication::quit(); 4510 // But CVirtualBox is still NULL in current Main implementation, 4511 // and this call do not restart anything, so we are waiting 4512 // for subsequent event about VBoxSVC is available again. 4513 } 4502 4514 } 4503 4515 /* If VBoxSVC is available: */ … … 4506 4518 if (!m_fWrappersValid) 4507 4519 { 4520 /* Re-fetch corresponding CVirtualBox: */ 4521 m_vbox = m_client.GetVirtualBox(); 4522 if (!m_client.isOk()) 4523 { 4524 msgCenter().cannotAcquireVirtualBox(m_client); 4525 return QApplication::quit(); 4526 } 4508 4527 /* Re-init wrappers: */ 4509 4528 comWrappersReinit(); … … 4526 4545 { 4527 4546 /* Re-fetch corresponding objects/values: */ 4528 m_vbox = virtualBoxClient().GetVirtualBox();4529 4547 m_host = virtualBox().GetHost(); 4530 4548 m_strHomeFolder = virtualBox().GetHomeFolder();
Note:
See TracChangeset
for help on using the changeset viewer.