Changeset 85791 in vbox for trunk/src/VBox/Frontends/VirtualBox
- Timestamp:
- Aug 17, 2020 7:15:50 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 2 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r85764 r85791 31 31 src/settings/global/UIGlobalSettingsNetworkDetailsNAT.ui \ 32 32 src/settings/global/UIGlobalSettingsExtension.ui \ 33 src/settings/global/UIGlobalSettingsProxy.ui \ 34 src/settings/machine/UIMachineSettingsUSB.ui \ 35 src/settings/machine/UIMachineSettingsUSBFilterDetails.ui 36 33 src/settings/global/UIGlobalSettingsProxy.ui 37 34 38 35 TRANSLATIONS = \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r85764 r85791 263 263 , m_iSlot(-1) 264 264 , m_enmAdapterType(KNetworkAdapterType_Null) 265 , m_pAttachmentTypeLabel(0) 266 , m_pAdapterNameLabel(0) 267 , m_pAdapterTypeLabel(0) 268 , m_pPromiscuousModeLabel(0) 269 , m_pMACLabel(0) 270 , m_pGenericPropertiesLabel(0) 271 , m_pAttachmentTypeEditor(0) 272 , m_pMACEditor(0) 273 , m_pMACButton(0) 274 , m_pAdvancedArrow(0) 275 , m_pEnableAdapterCheckBox(0) 276 , m_pCableConnectedCheckBox(0) 277 , m_pPortForwardingButton(0) 278 , m_pPromiscuousModeCombo(0) 279 , m_pAdapterTypeCombo(0) 280 , m_pGenericPropertiesTextEdit(0) 281 , m_pAdapterOptionsContainer(0) 265 282 { 266 283 prepareWidgets(); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp
r82968 r85791 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 20 #include <QComboBox> 19 21 #include <QHeaderView> 20 22 #include <QHelpEvent> 23 #include <QLineEdit> 21 24 #include <QMenu> 25 #include <QRadioButton> 26 #include <QSpacerItem> 22 27 #include <QToolTip> 28 #include <QVBoxLayout> 23 29 24 30 /* GUI includes: */ 31 #include "QILabelSeparator.h" 32 #include "QITreeWidget.h" 25 33 #include "QIWidgetValidator.h" 26 34 #include "UIConverter.h" … … 325 333 UIMachineSettingsUSB::UIMachineSettingsUSB() 326 334 : m_pToolBar(0) 327 , m_pActionNew(0), m_pActionAdd(0), m_pActionEdit(0), m_pActionRemove(0) 328 , m_pActionMoveUp(0), m_pActionMoveDown(0) 335 , m_pActionNew(0), 336 m_pActionAdd(0), 337 m_pActionEdit(0), 338 m_pActionRemove(0) 339 , m_pActionMoveUp(0), 340 m_pActionMoveDown(0) 329 341 , m_pMenuUSBDevices(0) 330 342 , m_pCache(0) 343 , m_pCheckBoxUSB(0) 344 , m_pTreeWidgetFilters(0) 345 , m_pRadioButtonUSB1(0) 346 , m_pRadioButtonUSB2(0) 347 , m_pRadioButtonUSB3(0) 348 , m_pCheckBoxUSBFilters(0) 349 , m_pUSBChild(0) 350 , m_pFiltersToolBar(0) 331 351 { 332 352 /* Prepare: */ … … 342 362 bool UIMachineSettingsUSB::isUSBEnabled() const 343 363 { 344 return m GbUSB->isChecked();364 return m_pCheckBoxUSB->isChecked(); 345 365 } 346 366 … … 411 431 { 412 432 /* Clear list initially: */ 413 m TwFilters->clear();433 m_pTreeWidgetFilters->clear(); 414 434 415 435 /* Get old USB data from the cache: */ … … 424 444 425 445 /* Adjust radio-button visibility: */ 426 m RbUSB1->setVisible(supportedTypes.contains(KUSBControllerType_OHCI));427 m RbUSB2->setVisible(supportedTypes.contains(KUSBControllerType_EHCI));428 m RbUSB3->setVisible(supportedTypes.contains(KUSBControllerType_XHCI));446 m_pRadioButtonUSB1->setVisible(supportedTypes.contains(KUSBControllerType_OHCI)); 447 m_pRadioButtonUSB2->setVisible(supportedTypes.contains(KUSBControllerType_EHCI)); 448 m_pRadioButtonUSB3->setVisible(supportedTypes.contains(KUSBControllerType_XHCI)); 429 449 430 450 /* Load old USB data from the cache: */ 431 m GbUSB->setChecked(oldUsbData.m_fUSBEnabled);451 m_pCheckBoxUSB->setChecked(oldUsbData.m_fUSBEnabled); 432 452 switch (oldUsbData.m_USBControllerType) 433 453 { 434 454 default: 435 case KUSBControllerType_OHCI: m RbUSB1->setChecked(true); break;436 case KUSBControllerType_EHCI: m RbUSB2->setChecked(true); break;437 case KUSBControllerType_XHCI: m RbUSB3->setChecked(true); break;455 case KUSBControllerType_OHCI: m_pRadioButtonUSB1->setChecked(true); break; 456 case KUSBControllerType_EHCI: m_pRadioButtonUSB2->setChecked(true); break; 457 case KUSBControllerType_XHCI: m_pRadioButtonUSB3->setChecked(true); break; 438 458 } 439 459 … … 443 463 444 464 /* Choose first filter as current: */ 445 m TwFilters->setCurrentItem(mTwFilters->topLevelItem(0));446 sltHandleUsbAdapterToggle(m GbUSB->isChecked());465 m_pTreeWidgetFilters->setCurrentItem(m_pTreeWidgetFilters->topLevelItem(0)); 466 sltHandleUsbAdapterToggle(m_pCheckBoxUSB->isChecked()); 447 467 448 468 /* Polish page finally: */ … … 459 479 460 480 /* Gather new USB data: */ 461 newUsbData.m_fUSBEnabled = m GbUSB->isChecked();481 newUsbData.m_fUSBEnabled = m_pCheckBoxUSB->isChecked(); 462 482 if (!newUsbData.m_fUSBEnabled) 463 483 newUsbData.m_USBControllerType = KUSBControllerType_Null; 464 484 else 465 485 { 466 if (m RbUSB1->isChecked())486 if (m_pRadioButtonUSB1->isChecked()) 467 487 newUsbData.m_USBControllerType = KUSBControllerType_OHCI; 468 else if (m RbUSB2->isChecked())488 else if (m_pRadioButtonUSB2->isChecked()) 469 489 newUsbData.m_USBControllerType = KUSBControllerType_EHCI; 470 else if (m RbUSB3->isChecked())490 else if (m_pRadioButtonUSB3->isChecked()) 471 491 newUsbData.m_USBControllerType = KUSBControllerType_XHCI; 472 492 } 473 493 474 494 /* For each filter: */ 475 QTreeWidgetItem *pMainRootItem = m TwFilters->invisibleRootItem();495 QTreeWidgetItem *pMainRootItem = m_pTreeWidgetFilters->invisibleRootItem(); 476 496 for (int iFilterIndex = 0; iFilterIndex < pMainRootItem->childCount(); ++iFilterIndex) 477 497 { … … 507 527 /* USB 2.0/3.0 Extension Pack presence test: */ 508 528 const CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName); 509 if ( m GbUSB->isChecked()510 && (m RbUSB2->isChecked() || mRbUSB3->isChecked())529 if ( m_pCheckBoxUSB->isChecked() 530 && (m_pRadioButtonUSB2->isChecked() || m_pRadioButtonUSB3->isChecked()) 511 531 && (extPack.isNull() || !extPack.GetUsable())) 512 532 { … … 530 550 void UIMachineSettingsUSB::setOrderAfter(QWidget *pWidget) 531 551 { 532 setTabOrder(pWidget, m GbUSB);533 setTabOrder(m GbUSB, mRbUSB1);534 setTabOrder(m RbUSB1, mRbUSB2);535 setTabOrder(m RbUSB2, mRbUSB3);536 setTabOrder(m RbUSB3, mTwFilters);552 setTabOrder(pWidget, m_pCheckBoxUSB); 553 setTabOrder(m_pCheckBoxUSB, m_pRadioButtonUSB1); 554 setTabOrder(m_pRadioButtonUSB1, m_pRadioButtonUSB2); 555 setTabOrder(m_pRadioButtonUSB2, m_pRadioButtonUSB3); 556 setTabOrder(m_pRadioButtonUSB3, m_pTreeWidgetFilters); 537 557 } 538 558 539 559 void UIMachineSettingsUSB::retranslateUi() 540 560 { 541 /* Translate uic generated strings: */ 542 Ui::UIMachineSettingsUSB::retranslateUi(this); 561 m_pCheckBoxUSB->setWhatsThis(QApplication::translate("UIMachineSettingsUSB", "When checked, enables the virtual USB controller of this machine.")); 562 m_pCheckBoxUSB->setText(QApplication::translate("UIMachineSettingsUSB", "Enable &USB Controller")); 563 m_pRadioButtonUSB1->setWhatsThis(QApplication::translate("UIMachineSettingsUSB", "When chosen, enables the virtual USB OHCI controller of " 564 "this machine. The USB OHCI controller provides USB 1.0 support.")); 565 m_pRadioButtonUSB1->setText(QApplication::translate("UIMachineSettingsUSB", "USB &1.1 (OHCI) Controller")); 566 m_pRadioButtonUSB2->setWhatsThis(QApplication::translate("UIMachineSettingsUSB", "When chosen, enables the virtual USB OHCI and EHCI " 567 "controllers of this machine. Together they provide USB 2.0 support.")); 568 m_pRadioButtonUSB2->setText(QApplication::translate("UIMachineSettingsUSB", "USB &2.0 (OHCI + EHCI) Controller")); 569 m_pRadioButtonUSB3->setWhatsThis(QApplication::translate("UIMachineSettingsUSB", "When chosen, enables the virtual USB xHCI controller of " 570 "this machine. The USB xHCI controller provides USB 3.0 support.")); 571 m_pRadioButtonUSB3->setText(QApplication::translate("UIMachineSettingsUSB", "USB &3.0 (xHCI) Controller")); 572 m_pCheckBoxUSBFilters->setText(QApplication::translate("UIMachineSettingsUSB", "USB Device &Filters")); 573 QTreeWidgetItem *pQtreewidgetitem = m_pTreeWidgetFilters->headerItem(); 574 pQtreewidgetitem->setText(0, QApplication::translate("UIMachineSettingsUSB", "[filter]")); 575 m_pTreeWidgetFilters->setWhatsThis(QApplication::translate("UIMachineSettingsUSB", "Lists all USB filters of this machine. The checkbox " 576 "to the left defines whether the particular filter is enabled or not. Use the " 577 "context menu or buttons to the right to add or remove USB filters.")); 543 578 544 579 m_pActionNew->setText(tr("Add Empty Filter")); … … 571 606 { 572 607 /* Polish USB page availability: */ 573 m GbUSB->setEnabled(isMachineOffline());574 m USBChild->setEnabled(isMachineInValidMode() && mGbUSB->isChecked());575 m RbUSB1->setEnabled(isMachineOffline() && mGbUSB->isChecked());576 m RbUSB2->setEnabled(isMachineOffline() && mGbUSB->isChecked());577 m RbUSB3->setEnabled(isMachineOffline() && mGbUSB->isChecked());608 m_pCheckBoxUSB->setEnabled(isMachineOffline()); 609 m_pUSBChild->setEnabled(isMachineInValidMode() && m_pCheckBoxUSB->isChecked()); 610 m_pRadioButtonUSB1->setEnabled(isMachineOffline() && m_pCheckBoxUSB->isChecked()); 611 m_pRadioButtonUSB2->setEnabled(isMachineOffline() && m_pCheckBoxUSB->isChecked()); 612 m_pRadioButtonUSB3->setEnabled(isMachineOffline() && m_pCheckBoxUSB->isChecked()); 578 613 } 579 614 … … 581 616 { 582 617 /* Enable/disable USB children: */ 583 m USBChild->setEnabled(isMachineInValidMode() && fEnabled);584 m RbUSB1->setEnabled(isMachineOffline() && fEnabled);585 m RbUSB2->setEnabled(isMachineOffline() && fEnabled);586 m RbUSB3->setEnabled(isMachineOffline() && fEnabled);618 m_pUSBChild->setEnabled(isMachineInValidMode() && fEnabled); 619 m_pRadioButtonUSB1->setEnabled(isMachineOffline() && fEnabled); 620 m_pRadioButtonUSB2->setEnabled(isMachineOffline() && fEnabled); 621 m_pRadioButtonUSB3->setEnabled(isMachineOffline() && fEnabled); 587 622 if (fEnabled) 588 623 { 589 624 /* If there is no chosen item but there is something to choose => choose it: */ 590 if (m TwFilters->currentItem() == 0 && mTwFilters->topLevelItemCount() != 0)591 m TwFilters->setCurrentItem(mTwFilters->topLevelItem(0));625 if (m_pTreeWidgetFilters->currentItem() == 0 && m_pTreeWidgetFilters->topLevelItemCount() != 0) 626 m_pTreeWidgetFilters->setCurrentItem(m_pTreeWidgetFilters->topLevelItem(0)); 592 627 } 593 628 /* Update current item: */ 594 sltHandleCurrentItemChange(m TwFilters->currentItem());629 sltHandleCurrentItemChange(m_pTreeWidgetFilters->currentItem()); 595 630 } 596 631 … … 598 633 { 599 634 /* Get selected items: */ 600 QList<QTreeWidgetItem*> selectedItems = m TwFilters->selectedItems();635 QList<QTreeWidgetItem*> selectedItems = m_pTreeWidgetFilters->selectedItems(); 601 636 /* Deselect all selected items first: */ 602 637 for (int iItemIndex = 0; iItemIndex < selectedItems.size(); ++iItemIndex) … … 604 639 605 640 /* If tree-widget is NOT enabled => we should NOT select anything: */ 606 if (!m TwFilters->isEnabled())641 if (!m_pTreeWidgetFilters->isEnabled()) 607 642 return; 608 643 … … 614 649 m_pActionEdit->setEnabled(pCurrentItem); 615 650 m_pActionRemove->setEnabled(pCurrentItem); 616 m_pActionMoveUp->setEnabled(pCurrentItem && m TwFilters->itemAbove(pCurrentItem));617 m_pActionMoveDown->setEnabled(pCurrentItem && m TwFilters->itemBelow(pCurrentItem));651 m_pActionMoveUp->setEnabled(pCurrentItem && m_pTreeWidgetFilters->itemAbove(pCurrentItem)); 652 m_pActionMoveDown->setEnabled(pCurrentItem && m_pTreeWidgetFilters->itemBelow(pCurrentItem)); 618 653 } 619 654 … … 621 656 { 622 657 QMenu menu; 623 if (m TwFilters->isEnabled())658 if (m_pTreeWidgetFilters->isEnabled()) 624 659 { 625 660 menu.addAction(m_pActionNew); … … 634 669 } 635 670 if (!menu.isEmpty()) 636 menu.exec(m TwFilters->mapToGlobal(pos));671 menu.exec(m_pTreeWidgetFilters->mapToGlobal(pos)); 637 672 } 638 673 … … 652 687 int iMaxFilterIndex = 0; 653 688 const QRegExp regExp(QString("^") + m_strTrUSBFilterName.arg("([0-9]+)") + QString("$")); 654 QTreeWidgetItemIterator iterator(m TwFilters);689 QTreeWidgetItemIterator iterator(m_pTreeWidgetFilters); 655 690 while (*iterator) 656 691 { … … 718 753 { 719 754 /* Check current USB filter item: */ 720 UIUSBFilterItem *pItem = static_cast<UIUSBFilterItem*>(m TwFilters->currentItem());755 UIUSBFilterItem *pItem = static_cast<UIUSBFilterItem*>(m_pTreeWidgetFilters->currentItem()); 721 756 AssertPtrReturnVoid(pItem); 722 757 723 758 /* Configure USB filter details dialog: */ 724 759 UIMachineSettingsUSBFilterDetails dlgFilterDetails(this); 725 dlgFilterDetails.m LeName->setText(pItem->m_strName);726 dlgFilterDetails.m LeVendorID->setText(pItem->m_strVendorId);727 dlgFilterDetails.m LeProductID->setText(pItem->m_strProductId);728 dlgFilterDetails.m LeRevision->setText(pItem->m_strRevision);729 dlgFilterDetails.m LePort->setText(pItem->m_strPort);730 dlgFilterDetails.m LeManufacturer->setText(pItem->m_strManufacturer);731 dlgFilterDetails.m LeProduct->setText(pItem->m_strProduct);732 dlgFilterDetails.m LeSerialNo->setText(pItem->m_strSerialNumber);760 dlgFilterDetails.m_pLineEditName->setText(pItem->m_strName); 761 dlgFilterDetails.m_pLineEditVendorID->setText(pItem->m_strVendorId); 762 dlgFilterDetails.m_pLineEditProductID->setText(pItem->m_strProductId); 763 dlgFilterDetails.m_pLineEditRevision->setText(pItem->m_strRevision); 764 dlgFilterDetails.m_pLineEditPort->setText(pItem->m_strPort); 765 dlgFilterDetails.m_pLineEditManufacturer->setText(pItem->m_strManufacturer); 766 dlgFilterDetails.m_pLineEditProduct->setText(pItem->m_strProduct); 767 dlgFilterDetails.m_pLineEditSerialNo->setText(pItem->m_strSerialNumber); 733 768 const QString strRemote = pItem->m_strRemote.toLower(); 734 769 if (strRemote == "yes" || strRemote == "true" || strRemote == "1") 735 dlgFilterDetails.m CbRemote->setCurrentIndex(ModeOn);770 dlgFilterDetails.m_pComboBoxRemote->setCurrentIndex(ModeOn); 736 771 else if (strRemote == "no" || strRemote == "false" || strRemote == "0") 737 dlgFilterDetails.m CbRemote->setCurrentIndex(ModeOff);772 dlgFilterDetails.m_pComboBoxRemote->setCurrentIndex(ModeOff); 738 773 else 739 dlgFilterDetails.m CbRemote->setCurrentIndex(ModeAny);774 dlgFilterDetails.m_pComboBoxRemote->setCurrentIndex(ModeAny); 740 775 741 776 /* Run USB filter details dialog: */ … … 743 778 { 744 779 /* Update edited tree-widget item: */ 745 pItem->m_strName = dlgFilterDetails.m LeName->text().isEmpty() ? QString() : dlgFilterDetails.mLeName->text();746 pItem->m_strVendorId = dlgFilterDetails.m LeVendorID->text().isEmpty() ? QString() : dlgFilterDetails.mLeVendorID->text();747 pItem->m_strProductId = dlgFilterDetails.m LeProductID->text().isEmpty() ? QString() : dlgFilterDetails.mLeProductID->text();748 pItem->m_strRevision = dlgFilterDetails.m LeRevision->text().isEmpty() ? QString() : dlgFilterDetails.mLeRevision->text();749 pItem->m_strManufacturer = dlgFilterDetails.m LeManufacturer->text().isEmpty() ? QString() : dlgFilterDetails.mLeManufacturer->text();750 pItem->m_strProduct = dlgFilterDetails.m LeProduct->text().isEmpty() ? QString() : dlgFilterDetails.mLeProduct->text();751 pItem->m_strSerialNumber = dlgFilterDetails.m LeSerialNo->text().isEmpty() ? QString() : dlgFilterDetails.mLeSerialNo->text();752 pItem->m_strPort = dlgFilterDetails.m LePort->text().isEmpty() ? QString() : dlgFilterDetails.mLePort->text();753 switch (dlgFilterDetails.m CbRemote->currentIndex())780 pItem->m_strName = dlgFilterDetails.m_pLineEditName->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditName->text(); 781 pItem->m_strVendorId = dlgFilterDetails.m_pLineEditVendorID->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditVendorID->text(); 782 pItem->m_strProductId = dlgFilterDetails.m_pLineEditProductID->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditProductID->text(); 783 pItem->m_strRevision = dlgFilterDetails.m_pLineEditRevision->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditRevision->text(); 784 pItem->m_strManufacturer = dlgFilterDetails.m_pLineEditManufacturer->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditManufacturer->text(); 785 pItem->m_strProduct = dlgFilterDetails.m_pLineEditProduct->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditProduct->text(); 786 pItem->m_strSerialNumber = dlgFilterDetails.m_pLineEditSerialNo->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditSerialNo->text(); 787 pItem->m_strPort = dlgFilterDetails.m_pLineEditPort->text().isEmpty() ? QString() : dlgFilterDetails.m_pLineEditPort->text(); 788 switch (dlgFilterDetails.m_pComboBoxRemote->currentIndex()) 754 789 { 755 790 case ModeAny: pItem->m_strRemote = QString(); break; … … 765 800 { 766 801 /* Check current USB filter item: */ 767 QTreeWidgetItem *pItem = m TwFilters->currentItem();802 QTreeWidgetItem *pItem = m_pTreeWidgetFilters->currentItem(); 768 803 AssertPtrReturnVoid(pItem); 769 804 … … 772 807 773 808 /* Update current item: */ 774 sltHandleCurrentItemChange(m TwFilters->currentItem());809 sltHandleCurrentItemChange(m_pTreeWidgetFilters->currentItem()); 775 810 776 811 /* Revalidate: */ … … 781 816 { 782 817 /* Check current USB filter item: */ 783 QTreeWidgetItem *pItem = m TwFilters->currentItem();818 QTreeWidgetItem *pItem = m_pTreeWidgetFilters->currentItem(); 784 819 AssertPtrReturnVoid(pItem); 785 820 786 821 /* Move the item up: */ 787 const int iIndex = m TwFilters->indexOfTopLevelItem(pItem);788 QTreeWidgetItem *pTakenItem = m TwFilters->takeTopLevelItem(iIndex);822 const int iIndex = m_pTreeWidgetFilters->indexOfTopLevelItem(pItem); 823 QTreeWidgetItem *pTakenItem = m_pTreeWidgetFilters->takeTopLevelItem(iIndex); 789 824 Assert(pItem == pTakenItem); 790 m TwFilters->insertTopLevelItem(iIndex - 1, pTakenItem);825 m_pTreeWidgetFilters->insertTopLevelItem(iIndex - 1, pTakenItem); 791 826 792 827 /* Make sure moved item still chosen: */ 793 m TwFilters->setCurrentItem(pTakenItem);828 m_pTreeWidgetFilters->setCurrentItem(pTakenItem); 794 829 } 795 830 … … 797 832 { 798 833 /* Check current USB filter item: */ 799 QTreeWidgetItem *pItem = m TwFilters->currentItem();834 QTreeWidgetItem *pItem = m_pTreeWidgetFilters->currentItem(); 800 835 AssertPtrReturnVoid(pItem); 801 836 802 837 /* Move the item down: */ 803 const int iIndex = m TwFilters->indexOfTopLevelItem(pItem);804 QTreeWidgetItem *pTakenItem = m TwFilters->takeTopLevelItem(iIndex);838 const int iIndex = m_pTreeWidgetFilters->indexOfTopLevelItem(pItem); 839 QTreeWidgetItem *pTakenItem = m_pTreeWidgetFilters->takeTopLevelItem(iIndex); 805 840 Assert(pItem == pTakenItem); 806 m TwFilters->insertTopLevelItem(iIndex + 1, pTakenItem);841 m_pTreeWidgetFilters->insertTopLevelItem(iIndex + 1, pTakenItem); 807 842 808 843 /* Make sure moved item still chosen: */ 809 m TwFilters->setCurrentItem(pTakenItem);844 m_pTreeWidgetFilters->setCurrentItem(pTakenItem); 810 845 } 811 846 812 847 void UIMachineSettingsUSB::prepare() 813 848 { 814 /* Apply UI decorations: */ 815 Ui::UIMachineSettingsUSB::setupUi(this); 849 prepareWidgets(); 816 850 817 851 /* Hide radio-button initially: */ 818 m RbUSB1->setVisible(false);819 m RbUSB2->setVisible(false);820 m RbUSB3->setVisible(false);852 m_pRadioButtonUSB1->setVisible(false); 853 m_pRadioButtonUSB2->setVisible(false); 854 m_pRadioButtonUSB3->setVisible(false); 821 855 822 856 /* Prepare cache: */ … … 838 872 } 839 873 874 void UIMachineSettingsUSB::prepareWidgets() 875 { 876 if (objectName().isEmpty()) 877 setObjectName(QStringLiteral("UIMachineSettingsUSB")); 878 resize(468, 328); 879 QGridLayout *pMainLayout = new QGridLayout(this); 880 pMainLayout->setObjectName(QStringLiteral("pMainLayout")); 881 m_pCheckBoxUSB = new QCheckBox(); 882 m_pCheckBoxUSB->setObjectName(QStringLiteral("m_pCheckBoxUSB")); 883 m_pCheckBoxUSB->setChecked(true); 884 pMainLayout->addWidget(m_pCheckBoxUSB, 0, 0, 1, 2); 885 QSpacerItem *pSpacerItem = new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum); 886 pMainLayout->addItem(pSpacerItem, 1, 0, 1, 1); 887 888 m_pUSBChild = new QWidget(); 889 m_pUSBChild->setObjectName(QStringLiteral("m_pUSBChild")); 890 QVBoxLayout *pVboxLayout = new QVBoxLayout(m_pUSBChild); 891 pVboxLayout->setObjectName(QStringLiteral("pVboxLayout")); 892 pVboxLayout->setContentsMargins(0, 0, 0, 0); 893 QWidget *pRadioButtonContainer = new QWidget(m_pUSBChild); 894 pRadioButtonContainer->setObjectName(QStringLiteral("pRadioButtonContainer")); 895 QVBoxLayout *vboxLayout1 = new QVBoxLayout(pRadioButtonContainer); 896 vboxLayout1->setObjectName(QStringLiteral("vboxLayout1")); 897 vboxLayout1->setContentsMargins(0, 0, 0, 0); 898 QRadioButton *pRadioButtonUSB1 = new QRadioButton(pRadioButtonContainer); 899 pRadioButtonUSB1->setObjectName(QStringLiteral("pRadioButtonUSB1")); 900 vboxLayout1->addWidget(pRadioButtonUSB1); 901 902 m_pRadioButtonUSB2 = new QRadioButton(pRadioButtonContainer); 903 m_pRadioButtonUSB2->setObjectName(QStringLiteral("m_pRadioButtonUSB2")); 904 vboxLayout1->addWidget(m_pRadioButtonUSB2); 905 906 m_pRadioButtonUSB3 = new QRadioButton(pRadioButtonContainer); 907 m_pRadioButtonUSB3->setObjectName(QStringLiteral("m_pRadioButtonUSB3")); 908 vboxLayout1->addWidget(m_pRadioButtonUSB3); 909 pVboxLayout->addWidget(pRadioButtonContainer); 910 911 m_pCheckBoxUSBFilters = new QILabelSeparator(m_pUSBChild); 912 m_pCheckBoxUSBFilters->setObjectName(QStringLiteral("m_pCheckBoxUSBFilters")); 913 pVboxLayout->addWidget(m_pCheckBoxUSBFilters); 914 915 QWidget *pFilterHandler = new QWidget(m_pUSBChild); 916 pFilterHandler->setObjectName(QStringLiteral("pFilterHandler")); 917 QHBoxLayout *pHBoxLayout = new QHBoxLayout(pFilterHandler); 918 pHBoxLayout->setSpacing(3); 919 pHBoxLayout->setObjectName(QStringLiteral("pHBoxLayout")); 920 pHBoxLayout->setContentsMargins(0, 0, 0, 0); 921 m_pTreeWidgetFilters = new QITreeWidget(pFilterHandler); 922 m_pTreeWidgetFilters->setObjectName(QStringLiteral("m_pTreeWidgetFilters")); 923 QSizePolicy sizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding); 924 sizePolicy.setHorizontalStretch(0); 925 sizePolicy.setVerticalStretch(0); 926 sizePolicy.setHeightForWidth(m_pTreeWidgetFilters->sizePolicy().hasHeightForWidth()); 927 m_pTreeWidgetFilters->setSizePolicy(sizePolicy); 928 m_pTreeWidgetFilters->setContextMenuPolicy(Qt::CustomContextMenu); 929 m_pTreeWidgetFilters->setRootIsDecorated(false); 930 pHBoxLayout->addWidget(m_pTreeWidgetFilters); 931 932 m_pFiltersToolBar = new UIToolBar(pFilterHandler); 933 m_pFiltersToolBar->setObjectName(QStringLiteral("m_pFiltersToolBar")); 934 pHBoxLayout->addWidget(m_pFiltersToolBar); 935 936 pVboxLayout->addWidget(pFilterHandler); 937 pMainLayout->addWidget(m_pUSBChild, 1, 1, 1, 2); 938 939 pMainLayout->setColumnStretch(1, 1); 940 m_pCheckBoxUSBFilters->setBuddy(m_pTreeWidgetFilters); 941 } 942 840 943 void UIMachineSettingsUSB::prepareFiltersTree() 841 944 { 842 945 /* USB Filters tree-widget created in the .ui file. */ 843 AssertPtrReturnVoid(m TwFilters);946 AssertPtrReturnVoid(m_pTreeWidgetFilters); 844 947 { 845 948 /* Configure tree-widget: */ 846 m TwFilters->header()->hide();949 m_pTreeWidgetFilters->header()->hide(); 847 950 } 848 951 } … … 927 1030 { 928 1031 /* Configure validation connections: */ 929 connect(m GbUSB, &QCheckBox::stateChanged, this, &UIMachineSettingsUSB::revalidate);930 connect(m RbUSB1, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate);931 connect(m RbUSB2, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate);932 connect(m RbUSB3, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate);1032 connect(m_pCheckBoxUSB, &QCheckBox::stateChanged, this, &UIMachineSettingsUSB::revalidate); 1033 connect(m_pRadioButtonUSB1, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate); 1034 connect(m_pRadioButtonUSB2, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate); 1035 connect(m_pRadioButtonUSB3, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate); 933 1036 934 1037 /* Configure widget connections: */ 935 connect(m GbUSB, &QCheckBox::toggled,1038 connect(m_pCheckBoxUSB, &QCheckBox::toggled, 936 1039 this, &UIMachineSettingsUSB::sltHandleUsbAdapterToggle); 937 connect(m TwFilters, &QITreeWidget::currentItemChanged,1040 connect(m_pTreeWidgetFilters, &QITreeWidget::currentItemChanged, 938 1041 this, &UIMachineSettingsUSB::sltHandleCurrentItemChange); 939 connect(m TwFilters, &QITreeWidget::customContextMenuRequested,1042 connect(m_pTreeWidgetFilters, &QITreeWidget::customContextMenuRequested, 940 1043 this, &UIMachineSettingsUSB::sltHandleContextMenuRequest); 941 connect(m TwFilters, &QITreeWidget::itemDoubleClicked,1044 connect(m_pTreeWidgetFilters, &QITreeWidget::itemDoubleClicked, 942 1045 this, &UIMachineSettingsUSB::sltEditFilter); 943 connect(m TwFilters, &QITreeWidget::itemChanged,1046 connect(m_pTreeWidgetFilters, &QITreeWidget::itemChanged, 944 1047 this, &UIMachineSettingsUSB::sltHandleActivityStateChange); 945 1048 … … 963 1066 { 964 1067 /* Create USB filter item: */ 965 UIUSBFilterItem *pItem = new UIUSBFilterItem(m TwFilters);1068 UIUSBFilterItem *pItem = new UIUSBFilterItem(m_pTreeWidgetFilters); 966 1069 AssertPtrReturnVoid(pItem); 967 1070 { … … 985 1088 if (fChoose) 986 1089 { 987 m TwFilters->scrollToItem(pItem);988 m TwFilters->setCurrentItem(pItem);1090 m_pTreeWidgetFilters->scrollToItem(pItem); 1091 m_pTreeWidgetFilters->setCurrentItem(pItem); 989 1092 sltHandleCurrentItemChange(pItem); 990 1093 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h
r82968 r85791 24 24 /* GUI includes: */ 25 25 #include "UISettingsPage.h" 26 #include "UIMachineSettingsUSB.gen.h"27 26 28 27 /* Forward declarations: */ 28 class QCheckBox; 29 class QRadioButton; 30 class QTreeWidgetItem; 31 class QILabelSeparator; 32 class QITreeWidget; 29 33 class VBoxUSBMenu; 30 34 class UIToolBar; … … 35 39 36 40 /** Machine settings: USB page. */ 37 class SHARED_LIBRARY_STUFF UIMachineSettingsUSB : public UISettingsPageMachine, 38 public Ui::UIMachineSettingsUSB 41 class SHARED_LIBRARY_STUFF UIMachineSettingsUSB : public UISettingsPageMachine 39 42 { 40 43 Q_OBJECT; … … 115 118 /** Prepares all. */ 116 119 void prepare(); 120 /** Prepares widgets. */ 121 void prepareWidgets(); 117 122 /** Prepares USB filters tree. */ 118 123 void prepareFiltersTree(); … … 160 165 /** Holds the page data cache instance. */ 161 166 UISettingsCacheMachineUSB *m_pCache; 167 /** @name Widgets 168 * @{ */ 169 QCheckBox *m_pCheckBoxUSB; 170 QITreeWidget *m_pTreeWidgetFilters; 171 QRadioButton *m_pRadioButtonUSB1; 172 QRadioButton *m_pRadioButtonUSB2; 173 QRadioButton *m_pRadioButtonUSB3; 174 QILabelSeparator *m_pCheckBoxUSBFilters; 175 QWidget *m_pUSBChild; 176 UIToolBar *m_pFiltersToolBar; 177 /** @} */ 162 178 }; 163 179 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp
r82968 r85791 16 16 */ 17 17 18 /* Qt includes: */ 19 #include <QComboBox> 20 #include <QGridLayout> 21 #include <QLabel> 22 #include <QLineEdit> 23 18 24 /* GUI includes: */ 25 #include "QIDialogButtonBox.h" 19 26 #include "UIMachineSettingsUSBFilterDetails.h" 20 27 #include "UIConverter.h" … … 23 30 UIMachineSettingsUSBFilterDetails::UIMachineSettingsUSBFilterDetails(QWidget *pParent /* = 0 */) 24 31 : QIWithRetranslateUI2<QIDialog>(pParent, Qt::Sheet) 32 , m_pComboBoxRemote(0) 33 , m_pLineEditName(0) 34 , m_pLineEditVendorID(0) 35 , m_pLineEditProductID(0) 36 , m_pLineEditRevision(0) 37 , m_pLineEditPort(0) 38 , m_pLineEditManufacturer(0) 39 , m_pLineEditProduct(0) 40 , m_pLineEditSerialNo(0) 41 , m_pLabelPort(0) 42 , m_pLabelRemote(0) 43 , m_pLabelProductID(0) 44 , m_pLabelName(0) 45 , m_pLabelVendorID(0) 46 , m_pLabelRevision(0) 47 , m_pLabelManufacturer(0) 48 , m_pLabelProduct(0) 49 , m_pLabelSerialNo(0) 50 , gridLayout(0) 25 51 { 26 /* Apply UI decorations */ 27 Ui::UIMachineSettingsUSBFilterDetails::setupUi (this); 28 29 mCbRemote->insertItem (UIMachineSettingsUSB::ModeAny, ""); /* Any */ 30 mCbRemote->insertItem (UIMachineSettingsUSB::ModeOn, ""); /* Yes */ 31 mCbRemote->insertItem (UIMachineSettingsUSB::ModeOff, ""); /* No */ 32 33 mLeName->setValidator (new QRegExpValidator (QRegExp (".+"), this)); 34 mLeVendorID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this)); 35 mLeProductID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this)); 36 mLeRevision->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this)); 37 mLePort->setValidator (new QRegExpValidator (QRegExp ("[0-9]*"), this)); 52 prepareWidgets(); 53 54 m_pComboBoxRemote->insertItem (UIMachineSettingsUSB::ModeAny, ""); /* Any */ 55 m_pComboBoxRemote->insertItem (UIMachineSettingsUSB::ModeOn, ""); /* Yes */ 56 m_pComboBoxRemote->insertItem (UIMachineSettingsUSB::ModeOff, ""); /* No */ 57 58 m_pLineEditName->setValidator (new QRegExpValidator (QRegExp (".+"), this)); 59 m_pLineEditVendorID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this)); 60 m_pLineEditProductID->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this)); 61 m_pLineEditRevision->setValidator (new QRegExpValidator (QRegExp ("[0-9a-fA-F]{0,4}"), this)); 62 m_pLineEditPort->setValidator (new QRegExpValidator (QRegExp ("[0-9]*"), this)); 38 63 39 64 /* Applying language settings */ … … 46 71 void UIMachineSettingsUSBFilterDetails::retranslateUi() 47 72 { 48 /* Translate uic generated strings */ 49 Ui::UIMachineSettingsUSBFilterDetails::retranslateUi (this); 50 51 mCbRemote->setItemText (UIMachineSettingsUSB::ModeAny, tr ("Any", "remote")); 52 mCbRemote->setItemText (UIMachineSettingsUSB::ModeOn, tr ("Yes", "remote")); 53 mCbRemote->setItemText (UIMachineSettingsUSB::ModeOff, tr ("No", "remote")); 73 setWindowTitle(QApplication::translate("UIMachineSettingsUSBFilterDetails", "USB Filter Details")); 74 m_pLabelName->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "&Name:")); 75 m_pLineEditName->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the filter name.")); 76 m_pLabelVendorID->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "&Vendor ID:")); 77 m_pLineEditVendorID->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the vendor ID filter. The " 78 "<i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a " 79 "hexadecimal digit. An empty string will match any value.")); 80 m_pLabelProductID->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "&Product ID:")); 81 m_pLineEditProductID->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the product ID filter. The " 82 "<i>exact match</i> string format is <tt>XXXX</tt> where <tt>X</tt> is a " 83 "hexadecimal digit. An empty string will match any value.")); 84 m_pLabelRevision->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "&Revision:")); 85 m_pLineEditRevision->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the revision number filter. The " 86 "<i>exact match</i> string format is <tt>IIFF</tt> where <tt>I</tt> is a decimal " 87 "digit of the integer part and <tt>F</tt> is a decimal digit of the fractional " 88 "part. An empty string will match any value.")); 89 m_pLabelManufacturer->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "&Manufacturer:")); 90 m_pLineEditManufacturer->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the manufacturer filter as an " 91 "<i>exact match</i> string. An empty string will match any value.")); 92 m_pLabelProduct->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Pro&duct:")); 93 m_pLineEditProduct->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the product name filter as an " 94 "<i>exact match</i> string. An empty string will match any value.")); 95 m_pLabelSerialNo->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "&Serial No.:")); 96 m_pLineEditSerialNo->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the serial number filter as an " 97 "<i>exact match</i> string. An empty string will match any value.")); 98 m_pLabelPort->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Por&t:")); 99 m_pLineEditPort->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds the host USB port filter as an " 100 "<i>exact match</i> string. An empty string will match any value.")); 101 m_pLabelRemote->setText(QApplication::translate("UIMachineSettingsUSBFilterDetails", "R&emote:")); 102 m_pComboBoxRemote->setToolTip(QApplication::translate("UIMachineSettingsUSBFilterDetails", "Holds whether this filter applies to USB " 103 "devices attached locally to the host computer (<i>No</i>), to a VRDP client's " 104 "computer (<i>Yes</i>), or both (<i>Any</i>).")); 105 106 m_pComboBoxRemote->setItemText (UIMachineSettingsUSB::ModeAny, tr ("Any", "remote")); 107 m_pComboBoxRemote->setItemText (UIMachineSettingsUSB::ModeOn, tr ("Yes", "remote")); 108 m_pComboBoxRemote->setItemText (UIMachineSettingsUSB::ModeOff, tr ("No", "remote")); 54 109 } 55 110 111 112 void UIMachineSettingsUSBFilterDetails::prepareWidgets() 113 { 114 if (objectName().isEmpty()) 115 setObjectName(QStringLiteral("UIMachineSettingsUSBFilterDetails")); 116 resize(350, 363); 117 setMinimumSize(QSize(350, 0)); 118 gridLayout = new QGridLayout(this); 119 gridLayout->setObjectName(QStringLiteral("gridLayout")); 120 m_pLabelName = new QLabel(); 121 m_pLabelName->setObjectName(QStringLiteral("m_pLabelName")); 122 m_pLabelName->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 123 gridLayout->addWidget(m_pLabelName, 0, 0, 1, 1); 124 125 m_pLineEditName = new QLineEdit(); 126 m_pLineEditName->setObjectName(QStringLiteral("m_pLineEditName")); 127 gridLayout->addWidget(m_pLineEditName, 0, 1, 1, 1); 128 129 m_pLabelVendorID = new QLabel(); 130 m_pLabelVendorID->setObjectName(QStringLiteral("m_pLabelVendorID")); 131 m_pLabelVendorID->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 132 gridLayout->addWidget(m_pLabelVendorID, 1, 0, 1, 1); 133 134 m_pLineEditVendorID = new QLineEdit(); 135 m_pLineEditVendorID->setObjectName(QStringLiteral("m_pLineEditVendorID")); 136 gridLayout->addWidget(m_pLineEditVendorID, 1, 1, 1, 1); 137 138 m_pLabelProductID = new QLabel(); 139 m_pLabelProductID->setObjectName(QStringLiteral("m_pLabelProductID")); 140 m_pLabelProductID->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 141 gridLayout->addWidget(m_pLabelProductID, 2, 0, 1, 1); 142 143 m_pLineEditProductID = new QLineEdit(); 144 m_pLineEditProductID->setObjectName(QStringLiteral("m_pLineEditProductID")); 145 gridLayout->addWidget(m_pLineEditProductID, 2, 1, 1, 1); 146 147 m_pLabelRevision = new QLabel(); 148 m_pLabelRevision->setObjectName(QStringLiteral("m_pLabelRevision")); 149 m_pLabelRevision->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 150 gridLayout->addWidget(m_pLabelRevision, 3, 0, 1, 1); 151 152 m_pLineEditRevision = new QLineEdit(); 153 m_pLineEditRevision->setObjectName(QStringLiteral("m_pLineEditRevision")); 154 gridLayout->addWidget(m_pLineEditRevision, 3, 1, 1, 1); 155 156 m_pLabelManufacturer = new QLabel(); 157 m_pLabelManufacturer->setObjectName(QStringLiteral("m_pLabelManufacturer")); 158 m_pLabelManufacturer->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 159 gridLayout->addWidget(m_pLabelManufacturer, 4, 0, 1, 1); 160 161 m_pLineEditManufacturer = new QLineEdit(); 162 m_pLineEditManufacturer->setObjectName(QStringLiteral("m_pLineEditManufacturer")); 163 gridLayout->addWidget(m_pLineEditManufacturer, 4, 1, 1, 1); 164 165 m_pLabelProduct = new QLabel(); 166 m_pLabelProduct->setObjectName(QStringLiteral("m_pLabelProduct")); 167 m_pLabelProduct->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 168 gridLayout->addWidget(m_pLabelProduct, 5, 0, 1, 1); 169 170 m_pLineEditProduct = new QLineEdit(); 171 m_pLineEditProduct->setObjectName(QStringLiteral("m_pLineEditProduct")); 172 gridLayout->addWidget(m_pLineEditProduct, 5, 1, 1, 1); 173 174 m_pLabelSerialNo = new QLabel(); 175 m_pLabelSerialNo->setObjectName(QStringLiteral("m_pLabelSerialNo")); 176 m_pLabelSerialNo->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 177 gridLayout->addWidget(m_pLabelSerialNo, 6, 0, 1, 1); 178 179 m_pLineEditSerialNo = new QLineEdit(); 180 m_pLineEditSerialNo->setObjectName(QStringLiteral("m_pLineEditSerialNo")); 181 gridLayout->addWidget(m_pLineEditSerialNo, 6, 1, 1, 1); 182 183 m_pLabelPort = new QLabel(); 184 m_pLabelPort->setObjectName(QStringLiteral("m_pLabelPort")); 185 m_pLabelPort->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 186 gridLayout->addWidget(m_pLabelPort, 7, 0, 1, 1); 187 188 m_pLineEditPort = new QLineEdit(); 189 m_pLineEditPort->setObjectName(QStringLiteral("m_pLineEditPort")); 190 gridLayout->addWidget(m_pLineEditPort, 7, 1, 1, 1); 191 192 m_pLabelRemote = new QLabel(); 193 m_pLabelRemote->setObjectName(QStringLiteral("m_pLabelRemote")); 194 m_pLabelRemote->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 195 gridLayout->addWidget(m_pLabelRemote, 8, 0, 1, 1); 196 197 m_pComboBoxRemote = new QComboBox(); 198 m_pComboBoxRemote->setObjectName(QStringLiteral("m_pComboBoxRemote")); 199 QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 200 sizePolicy.setHorizontalStretch(0); 201 sizePolicy.setVerticalStretch(0); 202 sizePolicy.setHeightForWidth(m_pComboBoxRemote->sizePolicy().hasHeightForWidth()); 203 m_pComboBoxRemote->setSizePolicy(sizePolicy); 204 gridLayout->addWidget(m_pComboBoxRemote, 8, 1, 1, 1); 205 206 QSpacerItem *pSpacerItem = new QSpacerItem(20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding); 207 gridLayout->addItem(pSpacerItem, 9, 1, 1, 1); 208 209 QIDialogButtonBox *pButtonBox = new QIDialogButtonBox(); 210 pButtonBox->setObjectName(QStringLiteral("pButtonBox")); 211 pButtonBox->setStandardButtons(QDialogButtonBox::Cancel|QDialogButtonBox::NoButton|QDialogButtonBox::Ok); 212 gridLayout->addWidget(pButtonBox, 10, 0, 1, 2); 213 214 m_pLabelName->setBuddy(m_pLineEditName); 215 m_pLabelVendorID->setBuddy(m_pLineEditVendorID); 216 m_pLabelProductID->setBuddy(m_pLineEditProductID); 217 m_pLabelRevision->setBuddy(m_pLineEditRevision); 218 m_pLabelManufacturer->setBuddy(m_pLineEditManufacturer); 219 m_pLabelProduct->setBuddy(m_pLineEditProduct); 220 m_pLabelSerialNo->setBuddy(m_pLineEditSerialNo); 221 m_pLabelPort->setBuddy(m_pLineEditPort); 222 m_pLabelRemote->setBuddy(m_pComboBoxRemote); 223 224 QObject::connect(pButtonBox, &QIDialogButtonBox::accepted, this, &UIMachineSettingsUSBFilterDetails::accept); 225 QObject::connect(pButtonBox, &QIDialogButtonBox::rejected, this, &UIMachineSettingsUSBFilterDetails::reject); 226 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.h
r82968 r85791 22 22 #endif 23 23 24 #include "UIMachineSettingsUSBFilterDetails.gen.h"25 24 #include "QIWithRetranslateUI.h" 26 25 #include "QIDialog.h" 27 26 #include "UIMachineSettingsUSB.h" 28 27 29 class SHARED_LIBRARY_STUFF UIMachineSettingsUSBFilterDetails : public QIWithRetranslateUI2<QIDialog>, 30 public Ui::UIMachineSettingsUSBFilterDetails 28 /* Forward declarations: */ 29 class QComboBox; 30 class QGridLayout; 31 class QLabel; 32 class QLineEdit; 33 34 class SHARED_LIBRARY_STUFF UIMachineSettingsUSBFilterDetails : public QIWithRetranslateUI2<QIDialog> 31 35 { 32 36 Q_OBJECT; … … 38 42 private: 39 43 44 void prepareWidgets(); 40 45 void retranslateUi(); 46 47 /** @name Widgets 48 * @{ */ 49 QComboBox *m_pComboBoxRemote; 50 QLineEdit *m_pLineEditName; 51 QLineEdit *m_pLineEditVendorID; 52 QLineEdit *m_pLineEditProductID; 53 QLineEdit *m_pLineEditRevision; 54 QLineEdit *m_pLineEditPort; 55 QLineEdit *m_pLineEditManufacturer; 56 QLineEdit *m_pLineEditProduct; 57 QLineEdit *m_pLineEditSerialNo; 58 QLabel *m_pLabelPort; 59 QLabel *m_pLabelRemote; 60 QLabel *m_pLabelProductID; 61 QLabel *m_pLabelName; 62 QLabel *m_pLabelVendorID; 63 QLabel *m_pLabelRevision; 64 QLabel *m_pLabelManufacturer; 65 QLabel *m_pLabelProduct; 66 QLabel *m_pLabelSerialNo; 67 QGridLayout *gridLayout; 68 /** @} */ 69 70 friend class UIMachineSettingsUSB; 41 71 }; 42 72
Note:
See TracChangeset
for help on using the changeset viewer.