VirtualBox

Ignore:
Timestamp:
Aug 17, 2020 7:15:50 AM (4 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9812. Removing UIMachineSettingsUSBFilterDetails.ui and UIMachineSettingsUSB.ui

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
2 deleted
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro

    r85764 r85791  
    3131    src/settings/global/UIGlobalSettingsNetworkDetailsNAT.ui \
    3232    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
    3734
    3835TRANSLATIONS = \
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp

    r85764 r85791  
    263263    , m_iSlot(-1)
    264264    , 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)
    265282{
    266283    prepareWidgets();
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.cpp

    r82968 r85791  
    1717
    1818/* Qt includes: */
     19#include <QCheckBox>
     20#include <QComboBox>
    1921#include <QHeaderView>
    2022#include <QHelpEvent>
     23#include <QLineEdit>
    2124#include <QMenu>
     25#include <QRadioButton>
     26#include <QSpacerItem>
    2227#include <QToolTip>
     28#include <QVBoxLayout>
    2329
    2430/* GUI includes: */
     31#include "QILabelSeparator.h"
     32#include "QITreeWidget.h"
    2533#include "QIWidgetValidator.h"
    2634#include "UIConverter.h"
     
    325333UIMachineSettingsUSB::UIMachineSettingsUSB()
    326334    : 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)
    329341    , m_pMenuUSBDevices(0)
    330342    , 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)
    331351{
    332352    /* Prepare: */
     
    342362bool UIMachineSettingsUSB::isUSBEnabled() const
    343363{
    344     return mGbUSB->isChecked();
     364    return m_pCheckBoxUSB->isChecked();
    345365}
    346366
     
    411431{
    412432    /* Clear list initially: */
    413     mTwFilters->clear();
     433    m_pTreeWidgetFilters->clear();
    414434
    415435    /* Get old USB data from the cache: */
     
    424444
    425445    /* Adjust radio-button visibility: */
    426     mRbUSB1->setVisible(supportedTypes.contains(KUSBControllerType_OHCI));
    427     mRbUSB2->setVisible(supportedTypes.contains(KUSBControllerType_EHCI));
    428     mRbUSB3->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));
    429449
    430450    /* Load old USB data from the cache: */
    431     mGbUSB->setChecked(oldUsbData.m_fUSBEnabled);
     451    m_pCheckBoxUSB->setChecked(oldUsbData.m_fUSBEnabled);
    432452    switch (oldUsbData.m_USBControllerType)
    433453    {
    434454        default:
    435         case KUSBControllerType_OHCI: mRbUSB1->setChecked(true); break;
    436         case KUSBControllerType_EHCI: mRbUSB2->setChecked(true); break;
    437         case KUSBControllerType_XHCI: mRbUSB3->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;
    438458    }
    439459
     
    443463
    444464    /* Choose first filter as current: */
    445     mTwFilters->setCurrentItem(mTwFilters->topLevelItem(0));
    446     sltHandleUsbAdapterToggle(mGbUSB->isChecked());
     465    m_pTreeWidgetFilters->setCurrentItem(m_pTreeWidgetFilters->topLevelItem(0));
     466    sltHandleUsbAdapterToggle(m_pCheckBoxUSB->isChecked());
    447467
    448468    /* Polish page finally: */
     
    459479
    460480    /* Gather new USB data: */
    461     newUsbData.m_fUSBEnabled = mGbUSB->isChecked();
     481    newUsbData.m_fUSBEnabled = m_pCheckBoxUSB->isChecked();
    462482    if (!newUsbData.m_fUSBEnabled)
    463483        newUsbData.m_USBControllerType = KUSBControllerType_Null;
    464484    else
    465485    {
    466         if (mRbUSB1->isChecked())
     486        if (m_pRadioButtonUSB1->isChecked())
    467487            newUsbData.m_USBControllerType = KUSBControllerType_OHCI;
    468         else if (mRbUSB2->isChecked())
     488        else if (m_pRadioButtonUSB2->isChecked())
    469489            newUsbData.m_USBControllerType = KUSBControllerType_EHCI;
    470         else if (mRbUSB3->isChecked())
     490        else if (m_pRadioButtonUSB3->isChecked())
    471491            newUsbData.m_USBControllerType = KUSBControllerType_XHCI;
    472492    }
    473493
    474494    /* For each filter: */
    475     QTreeWidgetItem *pMainRootItem = mTwFilters->invisibleRootItem();
     495    QTreeWidgetItem *pMainRootItem = m_pTreeWidgetFilters->invisibleRootItem();
    476496    for (int iFilterIndex = 0; iFilterIndex < pMainRootItem->childCount(); ++iFilterIndex)
    477497    {
     
    507527    /* USB 2.0/3.0 Extension Pack presence test: */
    508528    const CExtPack extPack = uiCommon().virtualBox().GetExtensionPackManager().Find(GUI_ExtPackName);
    509     if (   mGbUSB->isChecked()
    510         && (mRbUSB2->isChecked() || mRbUSB3->isChecked())
     529    if (   m_pCheckBoxUSB->isChecked()
     530        && (m_pRadioButtonUSB2->isChecked() || m_pRadioButtonUSB3->isChecked())
    511531        && (extPack.isNull() || !extPack.GetUsable()))
    512532    {
     
    530550void UIMachineSettingsUSB::setOrderAfter(QWidget *pWidget)
    531551{
    532     setTabOrder(pWidget, mGbUSB);
    533     setTabOrder(mGbUSB, mRbUSB1);
    534     setTabOrder(mRbUSB1, mRbUSB2);
    535     setTabOrder(mRbUSB2, mRbUSB3);
    536     setTabOrder(mRbUSB3, 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);
    537557}
    538558
    539559void UIMachineSettingsUSB::retranslateUi()
    540560{
    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."));
    543578
    544579    m_pActionNew->setText(tr("Add Empty Filter"));
     
    571606{
    572607    /* Polish USB page availability: */
    573     mGbUSB->setEnabled(isMachineOffline());
    574     mUSBChild->setEnabled(isMachineInValidMode() && mGbUSB->isChecked());
    575     mRbUSB1->setEnabled(isMachineOffline() && mGbUSB->isChecked());
    576     mRbUSB2->setEnabled(isMachineOffline() && mGbUSB->isChecked());
    577     mRbUSB3->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());
    578613}
    579614
     
    581616{
    582617    /* Enable/disable USB children: */
    583     mUSBChild->setEnabled(isMachineInValidMode() && fEnabled);
    584     mRbUSB1->setEnabled(isMachineOffline() && fEnabled);
    585     mRbUSB2->setEnabled(isMachineOffline() && fEnabled);
    586     mRbUSB3->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);
    587622    if (fEnabled)
    588623    {
    589624        /* If there is no chosen item but there is something to choose => choose it: */
    590         if (mTwFilters->currentItem() == 0 && mTwFilters->topLevelItemCount() != 0)
    591             mTwFilters->setCurrentItem(mTwFilters->topLevelItem(0));
     625        if (m_pTreeWidgetFilters->currentItem() == 0 && m_pTreeWidgetFilters->topLevelItemCount() != 0)
     626            m_pTreeWidgetFilters->setCurrentItem(m_pTreeWidgetFilters->topLevelItem(0));
    592627    }
    593628    /* Update current item: */
    594     sltHandleCurrentItemChange(mTwFilters->currentItem());
     629    sltHandleCurrentItemChange(m_pTreeWidgetFilters->currentItem());
    595630}
    596631
     
    598633{
    599634    /* Get selected items: */
    600     QList<QTreeWidgetItem*> selectedItems = mTwFilters->selectedItems();
     635    QList<QTreeWidgetItem*> selectedItems = m_pTreeWidgetFilters->selectedItems();
    601636    /* Deselect all selected items first: */
    602637    for (int iItemIndex = 0; iItemIndex < selectedItems.size(); ++iItemIndex)
     
    604639
    605640    /* If tree-widget is NOT enabled => we should NOT select anything: */
    606     if (!mTwFilters->isEnabled())
     641    if (!m_pTreeWidgetFilters->isEnabled())
    607642        return;
    608643
     
    614649    m_pActionEdit->setEnabled(pCurrentItem);
    615650    m_pActionRemove->setEnabled(pCurrentItem);
    616     m_pActionMoveUp->setEnabled(pCurrentItem && mTwFilters->itemAbove(pCurrentItem));
    617     m_pActionMoveDown->setEnabled(pCurrentItem && mTwFilters->itemBelow(pCurrentItem));
     651    m_pActionMoveUp->setEnabled(pCurrentItem && m_pTreeWidgetFilters->itemAbove(pCurrentItem));
     652    m_pActionMoveDown->setEnabled(pCurrentItem && m_pTreeWidgetFilters->itemBelow(pCurrentItem));
    618653}
    619654
     
    621656{
    622657    QMenu menu;
    623     if (mTwFilters->isEnabled())
     658    if (m_pTreeWidgetFilters->isEnabled())
    624659    {
    625660        menu.addAction(m_pActionNew);
     
    634669    }
    635670    if (!menu.isEmpty())
    636         menu.exec(mTwFilters->mapToGlobal(pos));
     671        menu.exec(m_pTreeWidgetFilters->mapToGlobal(pos));
    637672}
    638673
     
    652687    int iMaxFilterIndex = 0;
    653688    const QRegExp regExp(QString("^") + m_strTrUSBFilterName.arg("([0-9]+)") + QString("$"));
    654     QTreeWidgetItemIterator iterator(mTwFilters);
     689    QTreeWidgetItemIterator iterator(m_pTreeWidgetFilters);
    655690    while (*iterator)
    656691    {
     
    718753{
    719754    /* Check current USB filter item: */
    720     UIUSBFilterItem *pItem = static_cast<UIUSBFilterItem*>(mTwFilters->currentItem());
     755    UIUSBFilterItem *pItem = static_cast<UIUSBFilterItem*>(m_pTreeWidgetFilters->currentItem());
    721756    AssertPtrReturnVoid(pItem);
    722757
    723758    /* Configure USB filter details dialog: */
    724759    UIMachineSettingsUSBFilterDetails dlgFilterDetails(this);
    725     dlgFilterDetails.mLeName->setText(pItem->m_strName);
    726     dlgFilterDetails.mLeVendorID->setText(pItem->m_strVendorId);
    727     dlgFilterDetails.mLeProductID->setText(pItem->m_strProductId);
    728     dlgFilterDetails.mLeRevision->setText(pItem->m_strRevision);
    729     dlgFilterDetails.mLePort->setText(pItem->m_strPort);
    730     dlgFilterDetails.mLeManufacturer->setText(pItem->m_strManufacturer);
    731     dlgFilterDetails.mLeProduct->setText(pItem->m_strProduct);
    732     dlgFilterDetails.mLeSerialNo->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);
    733768    const QString strRemote = pItem->m_strRemote.toLower();
    734769    if (strRemote == "yes" || strRemote == "true" || strRemote == "1")
    735         dlgFilterDetails.mCbRemote->setCurrentIndex(ModeOn);
     770        dlgFilterDetails.m_pComboBoxRemote->setCurrentIndex(ModeOn);
    736771    else if (strRemote == "no" || strRemote == "false" || strRemote == "0")
    737         dlgFilterDetails.mCbRemote->setCurrentIndex(ModeOff);
     772        dlgFilterDetails.m_pComboBoxRemote->setCurrentIndex(ModeOff);
    738773    else
    739         dlgFilterDetails.mCbRemote->setCurrentIndex(ModeAny);
     774        dlgFilterDetails.m_pComboBoxRemote->setCurrentIndex(ModeAny);
    740775
    741776    /* Run USB filter details dialog: */
     
    743778    {
    744779        /* Update edited tree-widget item: */
    745         pItem->m_strName = dlgFilterDetails.mLeName->text().isEmpty() ? QString() : dlgFilterDetails.mLeName->text();
    746         pItem->m_strVendorId = dlgFilterDetails.mLeVendorID->text().isEmpty() ? QString() : dlgFilterDetails.mLeVendorID->text();
    747         pItem->m_strProductId = dlgFilterDetails.mLeProductID->text().isEmpty() ? QString() : dlgFilterDetails.mLeProductID->text();
    748         pItem->m_strRevision = dlgFilterDetails.mLeRevision->text().isEmpty() ? QString() : dlgFilterDetails.mLeRevision->text();
    749         pItem->m_strManufacturer = dlgFilterDetails.mLeManufacturer->text().isEmpty() ? QString() : dlgFilterDetails.mLeManufacturer->text();
    750         pItem->m_strProduct = dlgFilterDetails.mLeProduct->text().isEmpty() ? QString() : dlgFilterDetails.mLeProduct->text();
    751         pItem->m_strSerialNumber = dlgFilterDetails.mLeSerialNo->text().isEmpty() ? QString() : dlgFilterDetails.mLeSerialNo->text();
    752         pItem->m_strPort = dlgFilterDetails.mLePort->text().isEmpty() ? QString() : dlgFilterDetails.mLePort->text();
    753         switch (dlgFilterDetails.mCbRemote->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())
    754789        {
    755790            case ModeAny: pItem->m_strRemote = QString(); break;
     
    765800{
    766801    /* Check current USB filter item: */
    767     QTreeWidgetItem *pItem = mTwFilters->currentItem();
     802    QTreeWidgetItem *pItem = m_pTreeWidgetFilters->currentItem();
    768803    AssertPtrReturnVoid(pItem);
    769804
     
    772807
    773808    /* Update current item: */
    774     sltHandleCurrentItemChange(mTwFilters->currentItem());
     809    sltHandleCurrentItemChange(m_pTreeWidgetFilters->currentItem());
    775810
    776811    /* Revalidate: */
     
    781816{
    782817    /* Check current USB filter item: */
    783     QTreeWidgetItem *pItem = mTwFilters->currentItem();
     818    QTreeWidgetItem *pItem = m_pTreeWidgetFilters->currentItem();
    784819    AssertPtrReturnVoid(pItem);
    785820
    786821    /* Move the item up: */
    787     const int iIndex = mTwFilters->indexOfTopLevelItem(pItem);
    788     QTreeWidgetItem *pTakenItem = mTwFilters->takeTopLevelItem(iIndex);
     822    const int iIndex = m_pTreeWidgetFilters->indexOfTopLevelItem(pItem);
     823    QTreeWidgetItem *pTakenItem = m_pTreeWidgetFilters->takeTopLevelItem(iIndex);
    789824    Assert(pItem == pTakenItem);
    790     mTwFilters->insertTopLevelItem(iIndex - 1, pTakenItem);
     825    m_pTreeWidgetFilters->insertTopLevelItem(iIndex - 1, pTakenItem);
    791826
    792827    /* Make sure moved item still chosen: */
    793     mTwFilters->setCurrentItem(pTakenItem);
     828    m_pTreeWidgetFilters->setCurrentItem(pTakenItem);
    794829}
    795830
     
    797832{
    798833    /* Check current USB filter item: */
    799     QTreeWidgetItem *pItem = mTwFilters->currentItem();
     834    QTreeWidgetItem *pItem = m_pTreeWidgetFilters->currentItem();
    800835    AssertPtrReturnVoid(pItem);
    801836
    802837    /* Move the item down: */
    803     const int iIndex = mTwFilters->indexOfTopLevelItem(pItem);
    804     QTreeWidgetItem *pTakenItem = mTwFilters->takeTopLevelItem(iIndex);
     838    const int iIndex = m_pTreeWidgetFilters->indexOfTopLevelItem(pItem);
     839    QTreeWidgetItem *pTakenItem = m_pTreeWidgetFilters->takeTopLevelItem(iIndex);
    805840    Assert(pItem == pTakenItem);
    806     mTwFilters->insertTopLevelItem(iIndex + 1, pTakenItem);
     841    m_pTreeWidgetFilters->insertTopLevelItem(iIndex + 1, pTakenItem);
    807842
    808843    /* Make sure moved item still chosen: */
    809     mTwFilters->setCurrentItem(pTakenItem);
     844    m_pTreeWidgetFilters->setCurrentItem(pTakenItem);
    810845}
    811846
    812847void UIMachineSettingsUSB::prepare()
    813848{
    814     /* Apply UI decorations: */
    815     Ui::UIMachineSettingsUSB::setupUi(this);
     849    prepareWidgets();
    816850
    817851    /* Hide radio-button initially: */
    818     mRbUSB1->setVisible(false);
    819     mRbUSB2->setVisible(false);
    820     mRbUSB3->setVisible(false);
     852    m_pRadioButtonUSB1->setVisible(false);
     853    m_pRadioButtonUSB2->setVisible(false);
     854    m_pRadioButtonUSB3->setVisible(false);
    821855
    822856    /* Prepare cache: */
     
    838872}
    839873
     874void 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
    840943void UIMachineSettingsUSB::prepareFiltersTree()
    841944{
    842945    /* USB Filters tree-widget created in the .ui file. */
    843     AssertPtrReturnVoid(mTwFilters);
     946    AssertPtrReturnVoid(m_pTreeWidgetFilters);
    844947    {
    845948        /* Configure tree-widget: */
    846         mTwFilters->header()->hide();
     949        m_pTreeWidgetFilters->header()->hide();
    847950    }
    848951}
     
    9271030{
    9281031    /* Configure validation connections: */
    929     connect(mGbUSB, &QCheckBox::stateChanged, this, &UIMachineSettingsUSB::revalidate);
    930     connect(mRbUSB1, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate);
    931     connect(mRbUSB2, &QRadioButton::toggled, this, &UIMachineSettingsUSB::revalidate);
    932     connect(mRbUSB3, &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);
    9331036
    9341037    /* Configure widget connections: */
    935     connect(mGbUSB, &QCheckBox::toggled,
     1038    connect(m_pCheckBoxUSB, &QCheckBox::toggled,
    9361039            this, &UIMachineSettingsUSB::sltHandleUsbAdapterToggle);
    937     connect(mTwFilters, &QITreeWidget::currentItemChanged,
     1040    connect(m_pTreeWidgetFilters, &QITreeWidget::currentItemChanged,
    9381041            this, &UIMachineSettingsUSB::sltHandleCurrentItemChange);
    939     connect(mTwFilters, &QITreeWidget::customContextMenuRequested,
     1042    connect(m_pTreeWidgetFilters, &QITreeWidget::customContextMenuRequested,
    9401043            this, &UIMachineSettingsUSB::sltHandleContextMenuRequest);
    941     connect(mTwFilters, &QITreeWidget::itemDoubleClicked,
     1044    connect(m_pTreeWidgetFilters, &QITreeWidget::itemDoubleClicked,
    9421045            this, &UIMachineSettingsUSB::sltEditFilter);
    943     connect(mTwFilters, &QITreeWidget::itemChanged,
     1046    connect(m_pTreeWidgetFilters, &QITreeWidget::itemChanged,
    9441047            this, &UIMachineSettingsUSB::sltHandleActivityStateChange);
    9451048
     
    9631066{
    9641067    /* Create USB filter item: */
    965     UIUSBFilterItem *pItem = new UIUSBFilterItem(mTwFilters);
     1068    UIUSBFilterItem *pItem = new UIUSBFilterItem(m_pTreeWidgetFilters);
    9661069    AssertPtrReturnVoid(pItem);
    9671070    {
     
    9851088        if (fChoose)
    9861089        {
    987             mTwFilters->scrollToItem(pItem);
    988             mTwFilters->setCurrentItem(pItem);
     1090            m_pTreeWidgetFilters->scrollToItem(pItem);
     1091            m_pTreeWidgetFilters->setCurrentItem(pItem);
    9891092            sltHandleCurrentItemChange(pItem);
    9901093        }
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSB.h

    r82968 r85791  
    2424/* GUI includes: */
    2525#include "UISettingsPage.h"
    26 #include "UIMachineSettingsUSB.gen.h"
    2726
    2827/* Forward declarations: */
     28class QCheckBox;
     29class QRadioButton;
     30class QTreeWidgetItem;
     31class QILabelSeparator;
     32class QITreeWidget;
    2933class VBoxUSBMenu;
    3034class UIToolBar;
     
    3539
    3640/** Machine settings: USB page. */
    37 class SHARED_LIBRARY_STUFF UIMachineSettingsUSB : public UISettingsPageMachine,
    38                                                   public Ui::UIMachineSettingsUSB
     41class SHARED_LIBRARY_STUFF UIMachineSettingsUSB : public UISettingsPageMachine
    3942{
    4043    Q_OBJECT;
     
    115118    /** Prepares all. */
    116119    void prepare();
     120    /** Prepares widgets. */
     121    void prepareWidgets();
    117122    /** Prepares USB filters tree. */
    118123    void prepareFiltersTree();
     
    160165    /** Holds the page data cache instance. */
    161166    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    /** @} */
    162178};
    163179
  • trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsUSBFilterDetails.cpp

    r82968 r85791  
    1616 */
    1717
     18/* Qt includes: */
     19#include <QComboBox>
     20#include <QGridLayout>
     21#include <QLabel>
     22#include <QLineEdit>
     23
    1824/* GUI includes: */
     25#include "QIDialogButtonBox.h"
    1926#include "UIMachineSettingsUSBFilterDetails.h"
    2027#include "UIConverter.h"
     
    2330UIMachineSettingsUSBFilterDetails::UIMachineSettingsUSBFilterDetails(QWidget *pParent /* = 0 */)
    2431    : 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)
    2551{
    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));
    3863
    3964    /* Applying language settings */
     
    4671void UIMachineSettingsUSBFilterDetails::retranslateUi()
    4772{
    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"));
    54109}
    55110
     111
     112void 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  
    2222#endif
    2323
    24 #include "UIMachineSettingsUSBFilterDetails.gen.h"
    2524#include "QIWithRetranslateUI.h"
    2625#include "QIDialog.h"
    2726#include "UIMachineSettingsUSB.h"
    2827
    29 class SHARED_LIBRARY_STUFF UIMachineSettingsUSBFilterDetails : public QIWithRetranslateUI2<QIDialog>,
    30                                                                public Ui::UIMachineSettingsUSBFilterDetails
     28/* Forward declarations: */
     29class QComboBox;
     30class QGridLayout;
     31class QLabel;
     32class QLineEdit;
     33
     34class SHARED_LIBRARY_STUFF UIMachineSettingsUSBFilterDetails : public QIWithRetranslateUI2<QIDialog>
    3135{
    3236    Q_OBJECT;
     
    3842private:
    3943
     44    void prepareWidgets();
    4045    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;
    4171};
    4272
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette