Changeset 815 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Feb 9, 2007 4:21:36 PM (18 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h
r779 r815 102 102 void cannotSaveGlobalConfig (const CVirtualBox &vbox); 103 103 void cannotSetSystemProperties (const CSystemProperties &props); 104 void cannotAccessUSB (const COMBase &obj); 104 105 105 106 void cannotCreateMachine (const CVirtualBox &vbox, … … 113 114 bool strict = true, 114 115 QWidget *parent = 0); 115 void cannotGetUSBController (const CMachine &machine);116 116 117 117 void cannotStartMachine (const CConsole &console); -
trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp
r806 r815 491 491 } 492 492 493 void VBoxProblemReporter::cannotAccessUSB (const COMBase &obj) 494 { 495 /* if there is no error info available, it should mean that 496 * IMachine::GetUSBController(), IHost::GetUSBDevices() etc. just returned 497 * E_NOTIMPL, as for the OSE version. Don't show the error message in this 498 * case since it's normal. */ 499 COMErrorInfo errInfo = obj.errorInfo(); 500 if (obj.lastRC() == E_NOTIMPL && !errInfo.isBasicAvailable()) 501 return; 502 503 message (mainWindowShown(), Error, 504 tr ("Failed to access the USB subsystem."), 505 formatErrorInfo (errInfo), 506 "cannotAccessUSB"); 507 } 508 493 509 void VBoxProblemReporter::cannotCreateMachine (const CVirtualBox &vbox, 494 510 QWidget *parent /* = 0 */) … … 555 571 .arg (machine.GetName()), 556 572 formatErrorInfo (errInfo)); 557 }558 559 void VBoxProblemReporter::cannotGetUSBController (const CMachine &machine)560 {561 /* if there is no error info available, it should mean that562 * IMachine::GetUSBController returned just E_NOTIMPL, as for the OSE563 * version. Don't show the error message in this case since it's normal. */564 COMErrorInfo errInfo = machine.errorInfo();565 if (machine.lastRC() == E_NOTIMPL && !errInfo.isBasicAvailable())566 return;567 568 message (mainWindowShown(), Error,569 tr ("Failed to access the USB controller of the virtual "570 "machine <b>%1</b>.")571 .arg (machine.GetName()),572 formatErrorInfo (errInfo),573 "cannotGetUSBController");574 573 } 575 574 -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui
r711 r815 1022 1022 <include location="local" impldecl="in implementation">VBoxUtils.h</include> 1023 1023 <include location="local" impldecl="in implementation">VBoxGlobal.h</include> 1024 <include location="local" impldecl="in implementation">VBoxProblemReporter.h</include> 1024 1025 <include location="local" impldecl="in implementation">VBoxUSBFilterSettings.h</include> 1025 1026 </includes> -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxGlobalSettingsDlg.ui.h
r711 r815 126 126 6 /* seems that RichText adds some margin */ + 127 127 whatsThisLabel->fontMetrics().width ('m') * 40); 128 128 129 129 /* 130 130 * create and layout non-standard widgets … … 215 215 if (!object->isWidgetType()) 216 216 return QDialog::eventFilter (object, event); 217 217 218 218 QWidget *widget = static_cast <QWidget *> (object); 219 219 if (widget->topLevelWidget() != this) … … 332 332 333 333 CHost host = vboxGlobal().virtualBox().GetHost(); 334 CHostUSBDeviceFilterEnumerator en = host.GetUSBDeviceFilters().Enumerate(); 335 while (en.HasMore()) 336 { 337 CHostUSBDeviceFilter hostFilter = en.GetNext(); 338 CUSBDeviceFilter filter = CUnknown (hostFilter); 339 addUSBFilter (filter, false); 340 } 341 lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild()); 342 lvUSBFilters_currentChanged (lvUSBFilters->firstChild()); 343 344 // wvalXXXX->revalidate(); 334 CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters(); 335 if (coll.isNull()) 336 { 337 /* disable the USB host filters category if the USB is 338 * not available (i.e. in VirtualBox OSE) */ 339 340 QListViewItem *usbItem = listView->findItem ("#usb", listView_Link); 341 Assert (usbItem); 342 usbItem->setVisible (false); 343 344 /* disable validators if any */ 345 pageUSB->setEnabled (false); 346 347 /* Show an error message (if there is any). 348 * This message box may be suppressed if the user wishes so. */ 349 vboxProblem().cannotAccessUSB (host); 350 } 351 else 352 { 353 CHostUSBDeviceFilterEnumerator en = coll.Enumerate(); 354 while (en.HasMore()) 355 { 356 CHostUSBDeviceFilter hostFilter = en.GetNext(); 357 CUSBDeviceFilter filter = CUnknown (hostFilter); 358 addUSBFilter (filter, false); 359 } 360 lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild()); 361 lvUSBFilters_currentChanged (lvUSBFilters->firstChild()); 362 } 345 363 } 346 364 … … 440 458 if (!warning.isEmpty()) 441 459 warningString = QString ("<font color=red>%1</font>").arg (warning); 442 460 443 461 if (!warningString.isEmpty()) 444 462 whatsThisLabel->setText (warningString); -
trunk/src/VBox/Frontends/VirtualBox/ui/VBoxVMSettingsDlg.ui.h
r780 r815 1242 1242 pageUSB->setEnabled (false); 1243 1243 1244 /* If machine has something to say, show the message.1244 /* Show an error message (if there is any). 1245 1245 * Note that we don't use the generic cannotLoadMachineSettings() 1246 1246 * call here because we want this message to be suppressable. */ 1247 vboxProblem().cannot GetUSBController(machine);1247 vboxProblem().cannotAccessUSB (machine); 1248 1248 } 1249 1249 else
Note:
See TracChangeset
for help on using the changeset viewer.