Changeset 9827 in vbox
- Timestamp:
- Jun 19, 2008 4:25:58 PM (17 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox4
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox4/include/VBoxVMSettingsUSB.h
r9751 r9827 28 28 #include "COMDefs.h" 29 29 30 class VBoxGlobalSettingsDlg; 30 31 class VBoxVMSettingsDlg; 31 32 class QIWidgetValidator; … … 46 47 }; 47 48 48 VBoxVMSettingsUSB (QWidget *aParent, 49 FilterType aType, 50 VBoxVMSettingsDlg *aDlg, 51 const QString &aPath); 52 53 static void getFromMachine (const CMachine &aMachine, 54 QWidget *aPage, 55 VBoxVMSettingsDlg *aDlg, 56 const QString &aPath); 57 static void putBackToMachine(); 58 59 void getFrom (const CMachine &aMachine); 60 void putBackTo(); 49 static void getFrom (QWidget *aPage, 50 VBoxGlobalSettingsDlg *aDlg, 51 const QString &aPath); 52 static void getFrom (const CMachine &aMachine, 53 QWidget *aPage, 54 VBoxVMSettingsDlg *aDlg, 55 const QString &aPath); 56 static void putBackTo(); 61 57 62 58 protected: 63 59 60 VBoxVMSettingsUSB (QWidget *aParent, 61 FilterType aType, 62 QWidget *aDlg, 63 const QString &aPath); 64 65 void getFromHost(); 66 void putBackToHost(); 67 68 void getFromMachine (const CMachine &aMachine); 69 void putBackToMachine(); 70 64 71 void retranslateUi(); 72 73 FilterType mType; 65 74 66 75 private slots: … … 85 94 86 95 CMachine mMachine; 87 FilterType mType;88 96 QIWidgetValidator *mValidator; 89 97 QAction *mNewAction; -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxGlobalSettingsDlg.cpp
r9820 r9827 35 35 #include "VBoxGlobalSettingsGeneral.h" 36 36 #include "VBoxGlobalSettingsInput.h" 37 //#include "VBoxGlobalSettingsUSB.h"37 #include "VBoxVMSettingsUSB.h" 38 38 //#include "VBoxGlobalSettingsLanguage.h" 39 39 … … 370 370 const VBoxGlobalSettings &aGs) 371 371 { 372 // /* USB Page */373 // #ifdef DEBUG_dmik374 // CHost host = vboxGlobal().virtualBox().GetHost();375 // CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters();376 //377 // /* Show an error message (if there is any).378 // * This message box may be suppressed if the user wishes so. */379 // if (!host.isReallyOk())380 // vboxProblem().cannotAccessUSB (host);381 //382 // if (coll.isNull())383 // {384 // #endif385 // /* disable the USB host filters category if the USB is386 // * not available (i.e. in VirtualBox OSE) */387 //388 // Q3ListViewItem *usbItem = listView->findItem ("#usb", listView_Link);389 // Assert (usbItem);390 // usbItem->setVisible (false);391 //392 // /* disable validators if any */393 // pageUSB->setEnabled (false);394 //395 // #ifdef DEBUG_dmik396 // }397 // else398 // {399 // CHostUSBDeviceFilterEnumerator en = coll.Enumerate();400 // while (en.HasMore())401 // {402 // CHostUSBDeviceFilter hostFilter = en.GetNext();403 // CUSBDeviceFilter filter = CUnknown (hostFilter);404 // addUSBFilter (filter, false);405 // }406 // lvUSBFilters->setCurrentItem (lvUSBFilters->firstChild());407 // lvUSBFilters_currentChanged (lvUSBFilters->firstChild());408 // }409 // #endif410 411 372 // /* Language page */ 412 373 // QString langId = gs.languageId(); … … 432 393 433 394 /* USB Page */ 434 //VBoxVMSettingsUSB::getFrom (aProps, aGs, mPageUSB, 435 // this, pagePath (mPageUSB)); 395 VBoxVMSettingsUSB::getFrom (mPageUSB, this, pagePath (mPageUSB)); 436 396 437 397 /* Language Page */ … … 446 406 VBoxGlobalSettings &aGs) 447 407 { 448 // /* USB Page */449 // /*450 // * first, remove all old filters (only if the list is changed,451 // * not only individual properties of filters)452 // */453 // CHost host = vboxGlobal().virtualBox().GetHost();454 // if (mUSBFilterListModified)455 // for (ulong cnt = host.GetUSBDeviceFilters().GetCount(); cnt; -- cnt)456 // host.RemoveUSBDeviceFilter (0);457 //458 // /* then add all new filters */459 // for (Q3ListViewItem *item = lvUSBFilters->firstChild(); item;460 // item = item->nextSibling())461 // {462 // USBListItem *uli = static_cast<USBListItem*> (item);463 // /*464 // VBoxUSBFilterSettings *settings =465 // static_cast <VBoxUSBFilterSettings *>466 // (wstUSBFilters->widget (uli->mId));467 // Assert (settings);468 //469 // COMResult res = settings->putBackToFilter();470 // if (!res.isOk())471 // return;472 //473 // CUSBDeviceFilter filter = settings->filter();474 // filter.SetActive (uli->isOn());475 //476 // CHostUSBDeviceFilter insertedFilter = CUnknown (filter);477 // if (mUSBFilterListModified)478 // host.InsertUSBDeviceFilter (host.GetUSBDeviceFilters().GetCount(),479 // insertedFilter);480 // */481 // }482 // mUSBFilterListModified = false;483 484 408 // /* Language Page */ 485 409 // Q3ListViewItem *selItem = lvLanguages->selectedItem(); … … 498 422 499 423 /* USB Page */ 500 //VBoxVMSettingsUSB::putBackTo (aProps, aGs);424 VBoxVMSettingsUSB::putBackTo(); 501 425 502 426 /* Language Page */ … … 762 686 // */ 763 687 // } 764 //765 // void VBoxGlobalSettingsDlg::lvUSBFilters_currentChanged (Q3ListViewItem *item)766 // {767 // if (item && lvUSBFilters->selectedItem() != item)768 // lvUSBFilters->setSelected (item, true);769 //770 // tbRemoveUSBFilter->setEnabled (!!item);771 //772 // tbUSBFilterUp->setEnabled (!!item && item->itemAbove());773 // tbUSBFilterDown->setEnabled (!!item && item->itemBelow());774 //775 // if (item)776 // {777 // USBListItem *uli = static_cast <USBListItem *> (item);778 // wstUSBFilters->raiseWidget (uli->mId);779 // }780 // else781 // {782 // /* raise the disabled widget */783 // wstUSBFilters->raiseWidget (0);784 // }785 // }786 //787 // void VBoxGlobalSettingsDlg::lvUSBFilters_setCurrentText (const QString &aText)788 // {789 // Q3ListViewItem *item = lvUSBFilters->currentItem();790 // Assert (item);791 //792 // item->setText (lvUSBFilters_Name, aText);793 // }794 //795 // void VBoxGlobalSettingsDlg::tbAddUSBFilter_clicked()796 // {797 // /* search for the max available filter index */798 // int maxFilterIndex = 0;799 // QString usbFilterName = tr ("New Filter %1", "usb");800 // QRegExp regExp (QString ("^") + usbFilterName.arg ("([0-9]+)") + QString ("$"));801 // Q3ListViewItemIterator iterator (lvUSBFilters);802 // while (*iterator)803 // {804 // QString filterName = (*iterator)->text (lvUSBFilters_Name);805 // int pos = regExp.search (filterName);806 // if (pos != -1)807 // maxFilterIndex = regExp.cap (1).toInt() > maxFilterIndex ?808 // regExp.cap (1).toInt() : maxFilterIndex;809 // ++ iterator;810 // }811 //812 // /* create a new usb filter */813 // CHost host = vboxGlobal().virtualBox().GetHost();814 // CHostUSBDeviceFilter hostFilter = host815 // .CreateUSBDeviceFilter (usbFilterName.arg (maxFilterIndex + 1));816 // hostFilter.SetAction (KUSBDeviceFilterAction_Hold);817 //818 // CUSBDeviceFilter filter = CUnknown (hostFilter);819 // filter.SetActive (true);820 // addUSBFilter (filter, true);821 //822 // mUSBFilterListModified = true;823 // }824 //825 // void VBoxGlobalSettingsDlg::tbAddUSBFilterFrom_clicked()826 // {827 // usbDevicesMenu->exec (QCursor::pos());828 // }829 //830 // void VBoxGlobalSettingsDlg::menuAddUSBFilterFrom_activated (QAction *aAction)831 // {832 // CUSBDevice usb = usbDevicesMenu->getUSB (aAction);833 //834 // // if null then some other item but a USB device is selected835 // if (usb.isNull())836 // return;837 //838 // CHost host = vboxGlobal().virtualBox().GetHost();839 // CHostUSBDeviceFilter hostFilter = host840 // .CreateUSBDeviceFilter (vboxGlobal().details (usb));841 // hostFilter.SetAction (KUSBDeviceFilterAction_Hold);842 //843 // CUSBDeviceFilter filter = CUnknown (hostFilter);844 // filter.SetVendorId (QString().sprintf ("%04hX", usb.GetVendorId()));845 // filter.SetProductId (QString().sprintf ("%04hX", usb.GetProductId()));846 // filter.SetRevision (QString().sprintf ("%04hX", usb.GetRevision()));847 // /* The port property depends on the host computer rather than on the USB848 // * device itself; for this reason only a few people will want to use it in849 // * the filter since the same device plugged into a different socket will850 // * not match the filter in this case. */851 // #if 0852 // /// @todo set it anyway if Alt is currently pressed853 // filter.SetPort (QString().sprintf ("%04hX", usb.GetPort()));854 // #endif855 // filter.SetManufacturer (usb.GetManufacturer());856 // filter.SetProduct (usb.GetProduct());857 // filter.SetSerialNumber (usb.GetSerialNumber());858 // filter.SetRemote (usb.GetRemote() ? "yes" : "no");859 //860 // filter.SetActive (true);861 // addUSBFilter (filter, true);862 //863 // mUSBFilterListModified = true;864 // }865 //866 // void VBoxGlobalSettingsDlg::tbRemoveUSBFilter_clicked()867 // {868 // Q3ListViewItem *item = lvUSBFilters->currentItem();869 // Assert (item);870 //871 // USBListItem *uli = static_cast <USBListItem *> (item);872 // QWidget *settings = wstUSBFilters->widget (uli->mId);873 // Assert (settings);874 // wstUSBFilters->removeWidget (settings);875 // delete settings;876 //877 // delete item;878 //879 // lvUSBFilters->setSelected (lvUSBFilters->currentItem(), true);880 // mUSBFilterListModified = true;881 // }882 //883 // void VBoxGlobalSettingsDlg::tbUSBFilterUp_clicked()884 // {885 // Q3ListViewItem *item = lvUSBFilters->currentItem();886 // Assert (item);887 //888 // Q3ListViewItem *itemAbove = item->itemAbove();889 // Assert (itemAbove);890 // itemAbove = itemAbove->itemAbove();891 //892 // if (!itemAbove)893 // item->itemAbove()->moveItem (item);894 // else895 // item->moveItem (itemAbove);896 //897 // lvUSBFilters_currentChanged (item);898 // mUSBFilterListModified = true;899 // }900 //901 // void VBoxGlobalSettingsDlg::tbUSBFilterDown_clicked()902 // {903 // Q3ListViewItem *item = lvUSBFilters->currentItem();904 // Assert (item);905 //906 // Q3ListViewItem *itemBelow = item->itemBelow();907 // Assert (itemBelow);908 //909 // item->moveItem (itemBelow);910 //911 // lvUSBFilters_currentChanged (item);912 // mUSBFilterListModified = true;913 // }914 688 915 689 // /* Language Page */ -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsDlg.cpp
r9784 r9827 217 217 218 218 /* USB */ 219 VBoxVMSettingsUSB::getFrom Machine(aMachine, mPageUSB,220 219 VBoxVMSettingsUSB::getFrom (aMachine, mPageUSB, 220 this, pagePath (mPageUSB)); 221 221 222 222 /* Shared Folders */ … … 267 267 268 268 /* USB */ 269 VBoxVMSettingsUSB::putBackTo Machine();269 VBoxVMSettingsUSB::putBackTo(); 270 270 271 271 /* Shared folders */ -
trunk/src/VBox/Frontends/VirtualBox4/src/VBoxVMSettingsUSB.cpp
r9751 r9827 22 22 23 23 #include "VBoxVMSettingsUSB.h" 24 #include "VBoxGlobalSettingsDlg.h" 24 25 #include "VBoxVMSettingsDlg.h" 25 26 #include "VBoxVMSettingsUtils.h" … … 29 30 #include "VBoxProblemReporter.h" 30 31 32 //#define ENABLE_GLOBAL_USB 33 31 34 inline static QString emptyToNull (const QString &str) 32 35 { … … 35 38 36 39 VBoxVMSettingsUSB* VBoxVMSettingsUSB::mSettings = 0; 40 41 void VBoxVMSettingsUSB::getFrom (QWidget *aPage, 42 VBoxGlobalSettingsDlg *aDlg, 43 const QString &aPath) 44 { 45 /* USB Page */ 46 #ifdef ENABLE_GLOBAL_USB 47 CHost host = vboxGlobal().virtualBox().GetHost(); 48 CHostUSBDeviceFilterCollection coll = host.GetUSBDeviceFilters(); 49 50 /* Show an error message (if there is any). 51 * This message box may be suppressed if the user wishes so. */ 52 if (!host.isReallyOk()) 53 vboxProblem().cannotAccessUSB (host); 54 55 if (coll.isNull()) 56 { 57 #else 58 NOREF (aPage); 59 NOREF (aPath); 60 #endif 61 /* Disable the USB controller category if the USB controller is 62 * not available (i.e. in VirtualBox OSE) */ 63 QList<QTreeWidgetItem*> items = aDlg->mTwSelector->findItems ( 64 "#usb", Qt::MatchExactly, listView_Link); 65 QTreeWidgetItem *usbItem = items.count() ? items [0] : 0; 66 Assert (usbItem); 67 if (usbItem) 68 usbItem->setHidden (true); 69 return; 70 #ifdef ENABLE_GLOBAL_USB 71 } 72 73 mSettings = new VBoxVMSettingsUSB (aPage, HostType, aDlg, aPath); 74 QVBoxLayout *layout = new QVBoxLayout (aPage); 75 layout->setContentsMargins (0, 0, 0, 0); 76 layout->addWidget (mSettings); 77 78 mSettings->getFromHost(); 79 80 /* Fixing tab-order */ 81 setTabOrder (aDlg->mTwSelector, mSettings->mTwFilters); 82 setTabOrder (mSettings->mTwFilters, mSettings->mLeName); 83 setTabOrder (mSettings->mLeName, mSettings->mLeVendorID); 84 setTabOrder (mSettings->mLeVendorID, mSettings->mLeManufacturer); 85 setTabOrder (mSettings->mLeManufacturer, mSettings->mLeProductID); 86 setTabOrder (mSettings->mLeProductID, mSettings->mLeProduct); 87 setTabOrder (mSettings->mLeProduct, mSettings->mLeRevision); 88 setTabOrder (mSettings->mLeRevision, mSettings->mLeSerialNo); 89 setTabOrder (mSettings->mLeSerialNo, mSettings->mLePort); 90 setTabOrder (mSettings->mLePort, mSettings->mCbAction); 91 #endif 92 } 93 94 void VBoxVMSettingsUSB::getFrom (const CMachine &aMachine, 95 QWidget *aPage, 96 VBoxVMSettingsDlg *aDlg, 97 const QString &aPath) 98 { 99 CUSBController ctl = aMachine.GetUSBController(); 100 101 /* Show an error message (if there is any). 102 * Note that we don't use the generic cannotLoadMachineSettings() 103 * call here because we want this message to be suppressable. */ 104 if (!aMachine.isReallyOk()) 105 vboxProblem().cannotAccessUSB (aMachine); 106 107 if (ctl.isNull()) 108 { 109 /* Disable the USB controller category if the USB controller is 110 * not available (i.e. in VirtualBox OSE) */ 111 QList<QTreeWidgetItem*> items = aDlg->mTwSelector->findItems ( 112 "#usb", Qt::MatchExactly, listView_Link); 113 QTreeWidgetItem *usbItem = items.count() ? items [0] : 0; 114 Assert (usbItem); 115 if (usbItem) 116 usbItem->setHidden (true); 117 return; 118 } 119 120 mSettings = new VBoxVMSettingsUSB (aPage, MachineType, aDlg, aPath); 121 QVBoxLayout *layout = new QVBoxLayout (aPage); 122 layout->setContentsMargins (0, 0, 0, 0); 123 layout->addWidget (mSettings); 124 125 mSettings->getFromMachine (aMachine); 126 127 /* Fixing tab-order */ 128 setTabOrder (aDlg->mTwSelector, mSettings->mGbUSB); 129 setTabOrder (mSettings->mGbUSB, mSettings->mCbUSB2); 130 setTabOrder (mSettings->mCbUSB2, mSettings->mTwFilters); 131 setTabOrder (mSettings->mTwFilters, mSettings->mLeName); 132 setTabOrder (mSettings->mLeName, mSettings->mLeVendorID); 133 setTabOrder (mSettings->mLeVendorID, mSettings->mLeManufacturer); 134 setTabOrder (mSettings->mLeManufacturer, mSettings->mLeProductID); 135 setTabOrder (mSettings->mLeProductID, mSettings->mLeProduct); 136 setTabOrder (mSettings->mLeProduct, mSettings->mLeRevision); 137 setTabOrder (mSettings->mLeRevision, mSettings->mLeSerialNo); 138 setTabOrder (mSettings->mLeSerialNo, mSettings->mLePort); 139 setTabOrder (mSettings->mLePort, mSettings->mCbRemote); 140 } 141 142 void VBoxVMSettingsUSB::putBackTo() 143 { 144 if (mSettings) 145 mSettings->mType == MachineType ? mSettings->putBackToMachine() : 146 mSettings->putBackToHost(); 147 } 148 37 149 38 150 VBoxVMSettingsUSB::VBoxVMSettingsUSB (QWidget *aParent, 39 151 FilterType aType, 40 VBoxVMSettingsDlg*aDlg,152 QWidget *aDlg, 41 153 const QString &aPath) 42 154 : QIWithRetranslateUI<QWidget> (aParent) … … 95 207 toolBar->addAction (mMupAction); 96 208 toolBar->addAction (mMdnAction); 209 toolBar->setSizePolicy (QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); 97 210 mGbUSBFilters->layout()->addWidget (toolBar); 98 211 … … 154 267 mCbAction->setHidden (mType != HostType); 155 268 156 /* Fixing tab-order */157 setTabOrder (aDlg->mTwSelector, mGbUSB);158 setTabOrder (mGbUSB, mCbUSB2);159 setTabOrder (mCbUSB2, mTwFilters);160 setTabOrder (mTwFilters, mLeName);161 setTabOrder (mLeName, mLeVendorID);162 setTabOrder (mLeVendorID, mLeManufacturer);163 setTabOrder (mLeManufacturer, mLeProductID);164 setTabOrder (mLeProductID, mLeProduct);165 setTabOrder (mLeProduct, mLeRevision);166 setTabOrder (mLeRevision, mLeSerialNo);167 setTabOrder (mLeSerialNo, mLePort);168 setTabOrder (mLePort, mCbRemote);169 setTabOrder (mCbRemote, mCbAction);170 269 /* Applying language settings */ 171 270 retranslateUi(); 172 271 } 173 272 174 void VBoxVMSettingsUSB::getFromMachine (const CMachine &aMachine, 175 QWidget *aPage, 176 VBoxVMSettingsDlg *aDlg, 177 const QString &aPath) 178 { 179 CUSBController ctl = aMachine.GetUSBController(); 180 181 /* Show an error message (if there is any). 182 * Note that we don't use the generic cannotLoadMachineSettings() 183 * call here because we want this message to be suppressable. */ 184 if (!aMachine.isReallyOk()) 185 vboxProblem().cannotAccessUSB (aMachine); 186 187 if (ctl.isNull()) 188 { 189 /* Disable the USB controller category if the USB controller is 190 * not available (i.e. in VirtualBox OSE) */ 191 QList<QTreeWidgetItem*> items = aDlg->mTwSelector->findItems ( 192 "#usb", Qt::MatchExactly, listView_Link); 193 QTreeWidgetItem *usbItem = items.count() ? items [0] : 0; 194 Assert (usbItem); 195 if (usbItem) 196 usbItem->setHidden (true); 197 return; 198 } 199 200 mSettings = new VBoxVMSettingsUSB (aPage, MachineType, aDlg, aPath); 201 QVBoxLayout *layout = new QVBoxLayout (aPage); 202 layout->setContentsMargins (0, 0, 0, 0); 203 layout->addWidget (mSettings); 204 205 mSettings->getFrom (aMachine); 206 } 207 208 void VBoxVMSettingsUSB::putBackToMachine() 209 { 210 if (mSettings) 211 mSettings->putBackTo(); 212 } 213 214 void VBoxVMSettingsUSB::getFrom (const CMachine &aMachine) 273 void VBoxVMSettingsUSB::getFromHost() 274 { 275 mGbUSB->setVisible (false); 276 277 CHostUSBDeviceFilterEnumerator en = vboxGlobal().virtualBox().GetHost() 278 .GetUSBDeviceFilters().Enumerate(); 279 while (en.HasMore()) 280 { 281 CHostUSBDeviceFilter hostFilter = en.GetNext(); 282 CUSBDeviceFilter filter = CUnknown (hostFilter); 283 addUSBFilter (filter, false /* isNew */); 284 } 285 286 mTwFilters->setCurrentItem (mTwFilters->topLevelItem (0)); 287 currentChanged (mTwFilters->currentItem()); 288 } 289 290 void VBoxVMSettingsUSB::putBackToHost() 291 { 292 CHost host = vboxGlobal().virtualBox().GetHost(); 293 294 if (mUSBFilterListModified) 295 { 296 /* First, remove all old filters */ 297 for (ulong count = host.GetUSBDeviceFilters().GetCount(); count; -- count) 298 host.RemoveUSBDeviceFilter (0); 299 300 /* Then add all new filters */ 301 for (int i = 0; i < mFilters.size(); ++ i) 302 { 303 CUSBDeviceFilter filter = mFilters [i]; 304 filter.SetActive (mTwFilters->topLevelItem (i)-> 305 checkState (0) == Qt::Checked); 306 CHostUSBDeviceFilter insertedFilter = CUnknown (filter); 307 host.InsertUSBDeviceFilter (host.GetUSBDeviceFilters().GetCount(), 308 insertedFilter); 309 } 310 } 311 312 mUSBFilterListModified = false; 313 } 314 315 void VBoxVMSettingsUSB::getFromMachine (const CMachine &aMachine) 215 316 { 216 317 mMachine = aMachine; … … 229 330 } 230 331 231 void VBoxVMSettingsUSB::putBackTo ()332 void VBoxVMSettingsUSB::putBackToMachine() 232 333 { 233 334 CUSBController ctl = mMachine.GetUSBController(); … … 448 549 449 550 /* Creating new usb filter */ 450 CUSBDeviceFilter filter = mMachine.GetUSBController() 451 .CreateDeviceFilter (mUSBFilterName.arg (maxFilterIndex + 1)); 551 CUSBDeviceFilter filter; 552 553 if (mType == HostType) 554 { 555 CHost host = vboxGlobal().virtualBox().GetHost(); 556 CHostUSBDeviceFilter hostFilter = host 557 .CreateUSBDeviceFilter (mUSBFilterName.arg (maxFilterIndex + 1)); 558 hostFilter.SetAction (KUSBDeviceFilterAction_Hold); 559 filter = CUnknown (hostFilter); 560 } 561 else if (mType == MachineType) 562 { 563 filter = mMachine.GetUSBController() 564 .CreateDeviceFilter (mUSBFilterName.arg (maxFilterIndex + 1)); 565 } 566 else 567 { 568 AssertMsgFailed (("Invalid VBoxVMSettingsUSB type")); 569 } 452 570 453 571 filter.SetActive (true); … … 469 587 return; 470 588 471 CUSBDeviceFilter filter = mMachine.GetUSBController() 472 .CreateDeviceFilter (vboxGlobal().details (usb)); 589 /* Creating new usb filter */ 590 CUSBDeviceFilter filter; 591 592 if (mType == HostType) 593 { 594 CHost host = vboxGlobal().virtualBox().GetHost(); 595 CHostUSBDeviceFilter hostFilter = host 596 .CreateUSBDeviceFilter (vboxGlobal().details (usb)); 597 hostFilter.SetAction (KUSBDeviceFilterAction_Hold); 598 filter = CUnknown (hostFilter); 599 } 600 else if (mType == MachineType) 601 { 602 filter = mMachine.GetUSBController() 603 .CreateDeviceFilter (vboxGlobal().details (usb)); 604 } 605 else 606 { 607 AssertMsgFailed (("Invalid VBoxVMSettingsUSB type")); 608 } 473 609 474 610 filter.SetVendorId (QString().sprintf ("%04hX", usb.GetVendorId())); -
trunk/src/VBox/Frontends/VirtualBox4/ui/VBoxVMSettingsUSB.ui
r9654 r9827 259 259 </item> 260 260 <item row="3" column="2" > 261 <widget class="QLabel" name="mLbRemote" > 262 <property name="text" > 263 <string>R&emote</string> 264 </property> 265 <property name="buddy" > 266 <cstring>mCbRemote</cstring> 267 </property> 268 </widget> 261 <layout class="QVBoxLayout" > 262 <item> 263 <widget class="QLabel" name="mLbRemote" > 264 <property name="text" > 265 <string>R&emote</string> 266 </property> 267 <property name="buddy" > 268 <cstring>mCbRemote</cstring> 269 </property> 270 </widget> 271 </item> 272 <item> 273 <widget class="QLabel" name="mLbAction" > 274 <property name="text" > 275 <string>&Action</string> 276 </property> 277 <property name="buddy" > 278 <cstring>mCbAction</cstring> 279 </property> 280 </widget> 281 </item> 282 </layout> 269 283 </item> 270 284 <item row="3" column="3" > 271 <widget class="QComboBox" name="mCbRemote" > 272 <property name="sizePolicy" > 273 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 274 <horstretch>0</horstretch> 275 <verstretch>0</verstretch> 276 </sizepolicy> 277 </property> 278 <property name="whatsThis" > 279 <string>Defines whether this filter applies to USB devices attached locally to the host computer (<i>No</i>), to a VRDP client's computer (<i>Yes</i>), or both (<i>Any</i>).</string> 280 </property> 281 </widget> 282 </item> 283 <item row="4" column="2" > 284 <widget class="QLabel" name="mLbAction" > 285 <property name="text" > 286 <string>&Action</string> 287 </property> 288 <property name="buddy" > 289 <cstring>mCbAction</cstring> 290 </property> 291 </widget> 292 </item> 293 <item row="4" column="3" > 294 <widget class="QComboBox" name="mCbAction" > 295 <property name="sizePolicy" > 296 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 297 <horstretch>0</horstretch> 298 <verstretch>0</verstretch> 299 </sizepolicy> 300 </property> 301 <property name="whatsThis" > 302 <string>Defines an action performed by the host computer when a matching device is attached: give it up to the host OS (<i>Ignore</i>) or grab it for later usage by virtual machines (<i>Hold</i>).</string> 303 </property> 304 </widget> 285 <layout class="QVBoxLayout" > 286 <item> 287 <widget class="QComboBox" name="mCbRemote" > 288 <property name="sizePolicy" > 289 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 290 <horstretch>0</horstretch> 291 <verstretch>0</verstretch> 292 </sizepolicy> 293 </property> 294 <property name="whatsThis" > 295 <string>Defines whether this filter applies to USB devices attached locally to the host computer (<i>No</i>), to a VRDP client's computer (<i>Yes</i>), or both (<i>Any</i>).</string> 296 </property> 297 </widget> 298 </item> 299 <item> 300 <widget class="QComboBox" name="mCbAction" > 301 <property name="sizePolicy" > 302 <sizepolicy vsizetype="Fixed" hsizetype="Expanding" > 303 <horstretch>0</horstretch> 304 <verstretch>0</verstretch> 305 </sizepolicy> 306 </property> 307 <property name="whatsThis" > 308 <string>Defines an action performed by the host computer when a matching device is attached: give it up to the host OS (<i>Ignore</i>) or grab it for later usage by virtual machines (<i>Hold</i>).</string> 309 </property> 310 </widget> 311 </item> 312 </layout> 305 313 </item> 306 314 </layout>
Note:
See TracChangeset
for help on using the changeset viewer.