Changeset 85872 in vbox
- Timestamp:
- Aug 21, 2020 7:41:31 PM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/machine
- Files:
-
- 2 edited
-
UIMachineSettingsStorage.cpp (modified) (21 diffs)
-
UIMachineSettingsStorage.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r85827 r85872 2949 2949 , m_pActionAddAttachmentHD(0), m_pActionAddAttachmentCD(0), m_pActionAddAttachmentFD(0) 2950 2950 , m_pMediumIdHolder(new UIMediumIDHolder(this)) 2951 , m_fPolished(false)2952 2951 , m_fLoadingInProgress(0) 2953 2952 , m_pCache(0) 2953 , m_pSplitter(0) 2954 , m_pWidgetLeftPane(0) 2954 2955 , m_pLabelSeparatorLeftPane(0) 2956 , m_pLayoutTreeView(0) 2957 , m_pTreeStorage(0) 2958 , m_pLayoutToolBar(0) 2959 , m_pToolBar(0) 2960 , m_pStackRightPane(0) 2955 2961 , m_pLabelSeparatorEmpty(0) 2962 , m_pLabelInfo(0) 2956 2963 , m_pLabelSeparatorParameters(0) 2957 , m_pLabelSeparatorAttributes(0)2958 , m_pLabelSeparatorInformation(0)2959 , m_pLabelInfo(0)2960 2964 , m_pLabelName(0) 2965 , m_pEditorName(0) 2961 2966 , m_pLabelType(0) 2967 , m_pComboType(0) 2962 2968 , m_pLabelPortCount(0) 2963 , m_pLabelHDFormat(0)2964 , m_pLabelCDFDType(0)2965 , m_pLabelHDVirtualSize(0)2966 , m_pLabelHDActualSize(0)2967 , m_pLabelSize(0)2968 , m_pLabelHDDetails(0)2969 , m_pLabelLocation(0)2970 , m_pLabelUsage(0)2971 , m_pLabelEncryption(0)2972 , m_pLabelMedium(0)2973 , m_pLabelHDFormatValue(0)2974 , m_pLabelCDFDTypeValue(0)2975 , m_pLabelHDVirtualSizeValue(0)2976 , m_pLabelHDActualSizeValue(0)2977 , m_pLabelSizeValue(0)2978 , m_pLabelHDDetailsValue(0)2979 , m_pLabelLocationValue(0)2980 , m_pLabelUsageValue(0)2981 , m_pLabelEncryptionValue(0)2982 , m_pLineEditName(0)2983 , m_pComboBoxType(0)2984 , m_pComboBoxSlot(0)2985 2969 , m_pSpinBoxPortCount(0) 2986 2970 , m_pCheckBoxIoCache(0) 2971 , m_pLabelSeparatorAttributes(0) 2972 , m_pLabelMedium(0) 2973 , m_pComboSlot(0) 2974 , m_pToolButtonOpen(0) 2987 2975 , m_pCheckBoxPassthrough(0) 2988 2976 , m_pCheckBoxTempEject(0) 2989 2977 , m_pCheckBoxNonRotational(0) 2990 2978 , m_pCheckBoxHotPluggable(0) 2991 , m_pToolButtonOpen(0) 2992 , m_pToolBarStorageBar(0) 2993 , m_pLayoutController(0) 2994 , m_pLayoutEmpty(0) 2995 , m_pLayoutAttachment(0) 2996 , mSwRightPane(0) 2997 , m_pLayoutStorage(0) 2998 , m_pSplitter(0) 2979 , m_pLabelSeparatorInformation(0) 2980 , m_pLabelHDFormat(0) 2981 , m_pFieldHDFormat(0) 2982 , m_pLabelCDFDType(0) 2983 , m_pFieldCDFDType(0) 2984 , m_pLabelHDVirtualSize(0) 2985 , m_pFieldHDVirtualSize(0) 2986 , m_pLabelHDActualSize(0) 2987 , m_pFieldHDActualSize(0) 2988 , m_pLabelCDFDSize(0) 2989 , m_pFieldCDFDSize(0) 2990 , m_pLabelHDDetails(0) 2991 , m_pFieldHDDetails(0) 2992 , m_pLabelLocation(0) 2993 , m_pFieldLocation(0) 2994 , m_pLabelUsage(0) 2995 , m_pFieldUsage(0) 2996 , m_pLabelEncryption(0) 2997 , m_pFieldEncryption(0) 2999 2998 { 3000 2999 /* Prepare: */ … … 3353 3352 m_pLabelSeparatorParameters->setText(tr("Attributes")); 3354 3353 m_pLabelName->setText(tr("&Name:")); 3355 m_p LineEditName->setWhatsThis(tr("Holds the name of the storage controller currently selected in the Storage Tree."));3354 m_pEditorName->setWhatsThis(tr("Holds the name of the storage controller currently selected in the Storage Tree.")); 3356 3355 m_pLabelType->setText(tr("&Type:")); 3357 m_pCombo BoxType->setWhatsThis(tr("Selects the sub-type of the storage controller currently selected in the Storage Tree."));3356 m_pComboType->setWhatsThis(tr("Selects the sub-type of the storage controller currently selected in the Storage Tree.")); 3358 3357 m_pLabelPortCount->setText(tr("&Port Count:")); 3359 3358 m_pSpinBoxPortCount->setWhatsThis(tr("Selects the port count of the SATA storage controller currently selected in the" … … 3362 3361 m_pCheckBoxIoCache->setText(tr("Use Host I/O Cache")); 3363 3362 m_pLabelSeparatorAttributes->setText(tr("Attributes")); 3364 m_pCombo BoxSlot->setWhatsThis(tr("Selects the slot on the storage controller used by this attachment. The available slots depend"3363 m_pComboSlot->setWhatsThis(tr("Selects the slot on the storage controller used by this attachment. The available slots depend" 3365 3364 "on the type of the controller and other attachments on it.")); 3366 3365 m_pToolButtonOpen->setText(QString()); … … 3380 3379 m_pLabelHDVirtualSize->setText(tr("Virtual Size:")); 3381 3380 m_pLabelHDActualSize->setText(tr("Actual Size:")); 3382 m_pLabel Size->setText(tr("Size:"));3381 m_pLabelCDFDSize->setText(tr("Size:")); 3383 3382 m_pLabelHDDetails->setText(tr("Details:")); 3384 3383 m_pLabelLocation->setText(tr("Location:")); … … 3443 3442 m_pLabelSeparatorParameters->setEnabled(isMachineInValidMode()); 3444 3443 m_pLabelName->setEnabled(isMachineOffline()); 3445 m_p LineEditName->setEnabled(isMachineOffline());3444 m_pEditorName->setEnabled(isMachineOffline()); 3446 3445 m_pLabelType->setEnabled(isMachineOffline()); 3447 m_pCombo BoxType->setEnabled(isMachineOffline());3446 m_pComboType->setEnabled(isMachineOffline()); 3448 3447 m_pLabelPortCount->setEnabled(isMachineOffline()); 3449 3448 m_pSpinBoxPortCount->setEnabled(isMachineOffline()); … … 3453 3452 m_pLabelSeparatorAttributes->setEnabled(isMachineInValidMode()); 3454 3453 m_pLabelMedium->setEnabled(isMachineOffline() || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk)); 3455 m_pCombo BoxSlot->setEnabled(isMachineOffline());3454 m_pComboSlot->setEnabled(isMachineOffline()); 3456 3455 m_pToolButtonOpen->setEnabled(isMachineOffline() || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk)); 3457 3456 m_pCheckBoxPassthrough->setEnabled(isMachineOffline()); … … 3461 3460 m_pLabelSeparatorInformation->setEnabled(isMachineInValidMode()); 3462 3461 m_pLabelHDFormat->setEnabled(isMachineInValidMode()); 3463 m_p LabelHDFormatValue->setEnabled(isMachineInValidMode());3462 m_pFieldHDFormat->setEnabled(isMachineInValidMode()); 3464 3463 m_pLabelCDFDType->setEnabled(isMachineInValidMode()); 3465 m_p LabelCDFDTypeValue->setEnabled(isMachineInValidMode());3464 m_pFieldCDFDType->setEnabled(isMachineInValidMode()); 3466 3465 m_pLabelHDVirtualSize->setEnabled(isMachineInValidMode()); 3467 m_p LabelHDVirtualSizeValue->setEnabled(isMachineInValidMode());3466 m_pFieldHDVirtualSize->setEnabled(isMachineInValidMode()); 3468 3467 m_pLabelHDActualSize->setEnabled(isMachineInValidMode()); 3469 m_p LabelHDActualSizeValue->setEnabled(isMachineInValidMode());3470 m_pLabel Size->setEnabled(isMachineInValidMode());3471 m_p LabelSizeValue->setEnabled(isMachineInValidMode());3468 m_pFieldHDActualSize->setEnabled(isMachineInValidMode()); 3469 m_pLabelCDFDSize->setEnabled(isMachineInValidMode()); 3470 m_pFieldCDFDSize->setEnabled(isMachineInValidMode()); 3472 3471 m_pLabelHDDetails->setEnabled(isMachineInValidMode()); 3473 m_p LabelHDDetailsValue->setEnabled(isMachineInValidMode());3472 m_pFieldHDDetails->setEnabled(isMachineInValidMode()); 3474 3473 m_pLabelLocation->setEnabled(isMachineInValidMode()); 3475 m_p LabelLocationValue->setEnabled(isMachineInValidMode());3474 m_pFieldLocation->setEnabled(isMachineInValidMode()); 3476 3475 m_pLabelUsage->setEnabled(isMachineInValidMode()); 3477 m_p LabelUsageValue->setEnabled(isMachineInValidMode());3476 m_pFieldUsage->setEnabled(isMachineInValidMode()); 3478 3477 m_pLabelEncryption->setEnabled(isMachineInValidMode()); 3479 m_p LabelEncryptionValue->setEnabled(isMachineInValidMode());3478 m_pFieldEncryption->setEnabled(isMachineInValidMode()); 3480 3479 3481 3480 /* Update action states: */ 3482 3481 sltUpdateActionStates(); 3483 }3484 3485 void UIMachineSettingsStorage::showEvent(QShowEvent *pEvent)3486 {3487 if (!m_fPolished)3488 {3489 m_fPolished = true;3490 3491 /* First column indent: */3492 m_pLayoutEmpty->setColumnMinimumWidth(0, 10);3493 m_pLayoutController->setColumnMinimumWidth(0, 10);3494 m_pLayoutAttachment->setColumnMinimumWidth(0, 10);3495 #if 03496 /* Second column indent minimum width: */3497 QList <QLabel*> labelsList;3498 labelsList << m_pLabelMedium << m_pLabelHDFormat << m_pLabelCDFDType3499 << m_pLabelHDVirtualSize << m_pLabelHDActualSize << m_pLabelSize3500 << m_pLabelLocation << m_pLabelUsage;3501 int maxWidth = 0;3502 QFontMetrics metrics(font());3503 foreach (QLabel *label, labelsList)3504 {3505 int iWidth = metrics.width(label->text());3506 maxWidth = iWidth > maxWidth ? iWidth : maxWidth;3507 }3508 m_pLayoutAttachment->setColumnMinimumWidth(1, maxWidth);3509 #endif3510 }3511 3512 /* Call to base-class: */3513 UISettingsPageMachine::showEvent(pEvent);3514 3482 } 3515 3483 … … 3736 3704 { 3737 3705 /* Showing Initial Page: */ 3738 m SwRightPane->setCurrentIndex(0);3706 m_pStackRightPane->setCurrentIndex(0); 3739 3707 } 3740 3708 else … … 3746 3714 /* Getting Controller Name: */ 3747 3715 const QString strCtrName = m_pModelStorage->data(index, StorageModel::R_CtrName).toString(); 3748 if (m_p LineEditName->text() != strCtrName)3749 m_p LineEditName->setText(strCtrName);3716 if (m_pEditorName->text() != strCtrName) 3717 m_pEditorName->setText(strCtrName); 3750 3718 3751 3719 /* Rebuild type combo: */ 3752 m_pCombo BoxType->clear();3720 m_pComboType->clear(); 3753 3721 /* Getting controller buses: */ 3754 3722 const ControllerBusList controllerBusList(m_pModelStorage->data(index, StorageModel::R_CtrBusTypes).value<ControllerBusList>()); … … 3759 3727 foreach (const KStorageControllerType &enmCurrentType, controllerTypeList) 3760 3728 { 3761 m_pCombo BoxType->addItem(gpConverter->toString(enmCurrentType));3762 m_pCombo BoxType->setItemData(m_pComboBoxType->count() - 1, QVariant::fromValue(enmCurrentBus), StorageModel::R_CtrBusType);3763 m_pCombo BoxType->setItemData(m_pComboBoxType->count() - 1, QVariant::fromValue(enmCurrentType), StorageModel::R_CtrType);3729 m_pComboType->addItem(gpConverter->toString(enmCurrentType)); 3730 m_pComboType->setItemData(m_pComboType->count() - 1, QVariant::fromValue(enmCurrentBus), StorageModel::R_CtrBusType); 3731 m_pComboType->setItemData(m_pComboType->count() - 1, QVariant::fromValue(enmCurrentType), StorageModel::R_CtrType); 3764 3732 } 3765 3733 } 3766 3734 const KStorageControllerType enmType = m_pModelStorage->data(index, StorageModel::R_CtrType).value<KStorageControllerType>(); 3767 const int iCtrPos = m_pCombo BoxType->findData(enmType, StorageModel::R_CtrType);3768 m_pCombo BoxType->setCurrentIndex(iCtrPos == -1 ? 0 : iCtrPos);3735 const int iCtrPos = m_pComboType->findData(enmType, StorageModel::R_CtrType); 3736 m_pComboType->setCurrentIndex(iCtrPos == -1 ? 0 : iCtrPos); 3769 3737 3770 3738 const KStorageBus enmBus = m_pModelStorage->data(index, StorageModel::R_CtrBusType).value<KStorageBus>(); … … 3780 3748 3781 3749 /* Showing Controller Page: */ 3782 m SwRightPane->setCurrentIndex(1);3750 m_pStackRightPane->setCurrentIndex(1); 3783 3751 break; 3784 3752 } … … 3786 3754 { 3787 3755 /* Getting Attachment Slot: */ 3788 m_pCombo BoxSlot->clear();3756 m_pComboSlot->clear(); 3789 3757 const SlotsList slotsList(m_pModelStorage->data(index, StorageModel::R_AttSlots).value<SlotsList>()); 3790 3758 for (int i = 0; i < slotsList.size(); ++i) 3791 m_pCombo BoxSlot->insertItem(m_pComboBoxSlot->count(), gpConverter->toString(slotsList[i]));3759 m_pComboSlot->insertItem(m_pComboSlot->count(), gpConverter->toString(slotsList[i])); 3792 3760 const StorageSlot slt = m_pModelStorage->data(index, StorageModel::R_AttSlot).value<StorageSlot>(); 3793 const int iAttSlotPos = m_pCombo BoxSlot->findText(gpConverter->toString(slt));3794 m_pCombo BoxSlot->setCurrentIndex(iAttSlotPos == -1 ? 0 : iAttSlotPos);3795 m_pCombo BoxSlot->setToolTip(m_pComboBoxSlot->itemText(m_pComboBoxSlot->currentIndex()));3761 const int iAttSlotPos = m_pComboSlot->findText(gpConverter->toString(slt)); 3762 m_pComboSlot->setCurrentIndex(iAttSlotPos == -1 ? 0 : iAttSlotPos); 3763 m_pComboSlot->setToolTip(m_pComboSlot->itemText(m_pComboSlot->currentIndex())); 3796 3764 3797 3765 /* Getting Attachment Medium: */ … … 3858 3826 3859 3827 /* Getting Other Information: */ 3860 m_p LabelHDFormatValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString()));3861 m_p LabelCDFDTypeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString()));3862 m_p LabelHDVirtualSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLogicalSize).toString()));3863 m_p LabelHDActualSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString()));3864 m_p LabelSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString()));3865 m_p LabelHDDetailsValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttDetails).toString()));3866 m_p LabelLocationValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLocation).toString()));3867 m_p LabelUsageValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttUsage).toString()));3868 m_p LabelEncryptionValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttEncryptionPasswordID).toString()));3828 m_pFieldHDFormat->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString())); 3829 m_pFieldCDFDType->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString())); 3830 m_pFieldHDVirtualSize->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLogicalSize).toString())); 3831 m_pFieldHDActualSize->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString())); 3832 m_pFieldCDFDSize->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString())); 3833 m_pFieldHDDetails->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttDetails).toString())); 3834 m_pFieldLocation->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLocation).toString())); 3835 m_pFieldUsage->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttUsage).toString())); 3836 m_pFieldEncryption->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttEncryptionPasswordID).toString())); 3869 3837 3870 3838 /* Showing Attachment Page: */ 3871 m SwRightPane->setCurrentIndex(2);3839 m_pStackRightPane->setCurrentIndex(2); 3872 3840 break; 3873 3841 } … … 3895 3863 { 3896 3864 /* Setting Controller Name: */ 3897 if (pSender == m_p LineEditName)3898 m_pModelStorage->setData(index, m_p LineEditName->text(), StorageModel::R_CtrName);3865 if (pSender == m_pEditorName) 3866 m_pModelStorage->setData(index, m_pEditorName->text(), StorageModel::R_CtrName); 3899 3867 /* Setting Controller Sub-Type: */ 3900 else if (pSender == m_pCombo BoxType)3868 else if (pSender == m_pComboType) 3901 3869 { 3902 3870 const bool fResult = 3903 3871 m_pModelStorage->setData(index, 3904 QVariant::fromValue(m_pCombo BoxType->currentData(StorageModel::R_CtrBusType).value<KStorageBus>()),3872 QVariant::fromValue(m_pComboType->currentData(StorageModel::R_CtrBusType).value<KStorageBus>()), 3905 3873 StorageModel::R_CtrBusType); 3906 3874 if (fResult) 3907 3875 m_pModelStorage->setData(index, 3908 QVariant::fromValue(m_pCombo BoxType->currentData(StorageModel::R_CtrType).value<KStorageControllerType>()),3876 QVariant::fromValue(m_pComboType->currentData(StorageModel::R_CtrType).value<KStorageControllerType>()), 3909 3877 StorageModel::R_CtrType); 3910 3878 } … … 3918 3886 { 3919 3887 /* Setting Attachment Slot: */ 3920 if (pSender == m_pCombo BoxSlot)3888 if (pSender == m_pComboSlot) 3921 3889 { 3922 3890 QModelIndex controllerIndex = m_pModelStorage->parent(index); 3923 StorageSlot attachmentStorageSlot = gpConverter->fromString<StorageSlot>(m_pCombo BoxSlot->currentText());3891 StorageSlot attachmentStorageSlot = gpConverter->fromString<StorageSlot>(m_pComboSlot->currentText()); 3924 3892 m_pModelStorage->setData(index, QVariant::fromValue(attachmentStorageSlot), StorageModel::R_AttSlot); 3925 3893 QModelIndex theSameIndexAtNewPosition = m_pModelStorage->attachmentBySlot(controllerIndex, attachmentStorageSlot); … … 4511 4479 void UIMachineSettingsStorage::prepare() 4512 4480 { 4513 prepareWidgets();4514 4515 4481 /* Prepare cache: */ 4516 4482 m_pCache = new UISettingsCacheMachineStorage; … … 4524 4490 uiCommon().enumerateMedia(); 4525 4491 4526 AssertPtrReturnVoid(m_pLayoutStorage); 4527 { 4528 #ifdef VBOX_WS_MAC 4529 /* We need a little more space for the focus rect: */ 4530 m_pLayoutStorage->setContentsMargins(3, 0, 3, 0); 4531 m_pLayoutStorage->setSpacing(3); 4532 #else 4533 m_pLayoutStorage->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3); 4534 #endif 4535 4536 /* Prepare storage tree: */ 4537 prepareStorageTree(); 4538 /* Prepare storage toolbar: */ 4539 prepareStorageToolbar(); 4540 /* Prepare storage widgets: */ 4541 prepareStorageWidgets(); 4542 /* Prepare connections: */ 4543 prepareConnections(); 4544 } 4492 /* Prepare everything: */ 4493 prepareWidgets(); 4494 prepareConnections(); 4545 4495 4546 4496 /* Apply language settings: */ … … 4554 4504 void UIMachineSettingsStorage::prepareWidgets() 4555 4505 { 4556 QVBoxLayout *pLayoutMain; 4557 QWidget *pWidgetLeftPane; 4558 QVBoxLayout *pLayoutLeftPane; 4559 QHBoxLayout *pLayoutStorageBar; 4560 QSpacerItem *pSpacerItem1; 4561 QWidget *pWidgetEmpty; 4562 QSpacerItem *pSpacerItem2; 4563 QWidget *mWtController; 4564 QSpacerItem *pSpacerItem3; 4565 QWidget *pWidgetAttachment; 4566 QHBoxLayout *pLayoutContainer; 4567 QVBoxLayout *pLayoutAttachmentConfig; 4568 QSpacerItem *pSpacerItem6; 4569 4570 if (objectName().isEmpty()) 4571 setObjectName(QStringLiteral("UIMachineSettingsStorage")); 4572 resize(800, 700); 4573 pLayoutMain = new QVBoxLayout(this); 4574 pLayoutMain->setObjectName(QStringLiteral("pLayoutMain")); 4575 m_pSplitter = new QISplitter(this); 4576 m_pSplitter->setObjectName(QStringLiteral("m_pSplitter")); 4577 m_pSplitter->setOrientation(Qt::Horizontal); 4578 m_pSplitter->setHandleWidth(4); 4579 pWidgetLeftPane = new QWidget(m_pSplitter); 4580 pWidgetLeftPane->setObjectName(QStringLiteral("pWidgetLeftPane")); 4581 pLayoutLeftPane = new QVBoxLayout(pWidgetLeftPane); 4582 pLayoutLeftPane->setObjectName(QStringLiteral("pLayoutLeftPane")); 4583 pLayoutLeftPane->setContentsMargins(0, 0, 10, 0); 4584 m_pLabelSeparatorLeftPane = new QILabelSeparator(pWidgetLeftPane); 4585 m_pLabelSeparatorLeftPane->setObjectName(QStringLiteral("m_pLabelSeparatorLeftPane")); 4586 pLayoutLeftPane->addWidget(m_pLabelSeparatorLeftPane); 4587 4588 m_pLayoutStorage = new QVBoxLayout(); 4589 m_pLayoutStorage->setSpacing(3); 4590 m_pLayoutStorage->setContentsMargins(0, 0, 0, 0); 4591 m_pLayoutStorage->setObjectName(QStringLiteral("m_pLayoutStorage")); 4592 pLayoutStorageBar = new QHBoxLayout(); 4593 pLayoutStorageBar->setObjectName(QStringLiteral("pLayoutStorageBar")); 4594 pSpacerItem1 = new QSpacerItem(0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum); 4595 4596 pLayoutStorageBar->addItem(pSpacerItem1); 4597 4598 m_pToolBarStorageBar = new UIToolBar(pWidgetLeftPane); 4599 m_pToolBarStorageBar->setObjectName(QStringLiteral("m_pToolBarStorageBar")); 4600 pLayoutStorageBar->addWidget(m_pToolBarStorageBar); 4601 4602 m_pLayoutStorage->addLayout(pLayoutStorageBar); 4603 pLayoutLeftPane->addLayout(m_pLayoutStorage); 4604 4605 m_pSplitter->addWidget(pWidgetLeftPane); 4606 mSwRightPane = new QStackedWidget(m_pSplitter); 4607 mSwRightPane->setObjectName(QStringLiteral("mSwRightPane")); 4608 pWidgetEmpty = new QWidget(); 4609 pWidgetEmpty->setObjectName(QStringLiteral("pWidgetEmpty")); 4610 m_pLayoutEmpty = new QGridLayout(pWidgetEmpty); 4611 m_pLayoutEmpty->setObjectName(QStringLiteral("m_pLayoutEmpty")); 4612 m_pLayoutEmpty->setContentsMargins(10, 0, 0, 0); 4613 m_pLabelSeparatorEmpty = new QILabelSeparator(pWidgetEmpty); 4614 m_pLabelSeparatorEmpty->setObjectName(QStringLiteral("m_pLabelSeparatorEmpty")); 4615 m_pLayoutEmpty->addWidget(m_pLabelSeparatorEmpty, 0, 0, 1, 2); 4616 4617 m_pLabelInfo = new QLabel(pWidgetEmpty); 4618 m_pLabelInfo->setObjectName(QStringLiteral("m_pLabelInfo")); 4619 m_pLabelInfo->setWordWrap(true); 4620 m_pLayoutEmpty->addWidget(m_pLabelInfo, 1, 1, 1, 1); 4621 4622 pSpacerItem2 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 4623 m_pLayoutEmpty->addItem(pSpacerItem2, 2, 0, 1, 2); 4624 4625 mSwRightPane->addWidget(pWidgetEmpty); 4626 mWtController = new QWidget(); 4627 mWtController->setObjectName(QStringLiteral("mWtController")); 4628 m_pLayoutController = new QGridLayout(mWtController); 4629 m_pLayoutController->setObjectName(QStringLiteral("m_pLayoutController")); 4630 m_pLayoutController->setContentsMargins(10, 0, 0, 0); 4631 m_pLabelSeparatorParameters = new QILabelSeparator(mWtController); 4632 m_pLabelSeparatorParameters->setObjectName(QStringLiteral("m_pLabelSeparatorParameters")); 4633 m_pLayoutController->addWidget(m_pLabelSeparatorParameters, 0, 0, 1, 3); 4634 4635 m_pLabelName = new QLabel(mWtController); 4636 m_pLabelName->setObjectName(QStringLiteral("m_pLabelName")); 4637 m_pLabelName->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4638 m_pLayoutController->addWidget(m_pLabelName, 1, 1, 1, 1); 4639 4640 m_pLineEditName = new QLineEdit(mWtController); 4641 m_pLineEditName->setObjectName(QStringLiteral("m_pLineEditName")); 4642 m_pLayoutController->addWidget(m_pLineEditName, 1, 2, 1, 1); 4643 4644 m_pLabelType = new QLabel(mWtController); 4645 m_pLabelType->setObjectName(QStringLiteral("m_pLabelType")); 4646 m_pLabelType->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4647 m_pLayoutController->addWidget(m_pLabelType, 2, 1, 1, 1); 4648 4649 m_pComboBoxType = new QComboBox(mWtController); 4650 m_pComboBoxType->setObjectName(QStringLiteral("m_pComboBoxType")); 4651 QSizePolicy sizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); 4652 sizePolicy.setHorizontalStretch(0); 4653 sizePolicy.setVerticalStretch(0); 4654 sizePolicy.setHeightForWidth(m_pComboBoxType->sizePolicy().hasHeightForWidth()); 4655 m_pComboBoxType->setSizePolicy(sizePolicy); 4656 m_pLayoutController->addWidget(m_pComboBoxType, 2, 2, 1, 1); 4657 4658 m_pLabelPortCount = new QLabel(mWtController); 4659 m_pLabelPortCount->setObjectName(QStringLiteral("m_pLabelPortCount")); 4660 m_pLabelPortCount->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4661 m_pLayoutController->addWidget(m_pLabelPortCount, 3, 1, 1, 1); 4662 4663 m_pSpinBoxPortCount = new QSpinBox(mWtController); 4664 m_pSpinBoxPortCount->setObjectName(QStringLiteral("m_pSpinBoxPortCount")); 4665 sizePolicy.setHeightForWidth(m_pSpinBoxPortCount->sizePolicy().hasHeightForWidth()); 4666 m_pSpinBoxPortCount->setSizePolicy(sizePolicy); 4667 m_pLayoutController->addWidget(m_pSpinBoxPortCount, 3, 2, 1, 1); 4668 4669 m_pCheckBoxIoCache = new QCheckBox(mWtController); 4670 m_pCheckBoxIoCache->setObjectName(QStringLiteral("m_pCheckBoxIoCache")); 4671 m_pLayoutController->addWidget(m_pCheckBoxIoCache, 4, 2, 1, 1); 4672 4673 pSpacerItem3 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 4674 m_pLayoutController->addItem(pSpacerItem3, 5, 0, 1, 3); 4675 4676 mSwRightPane->addWidget(mWtController); 4677 pWidgetAttachment = new QWidget(); 4678 pWidgetAttachment->setObjectName(QStringLiteral("pWidgetAttachment")); 4679 m_pLayoutAttachment = new QGridLayout(pWidgetAttachment); 4680 m_pLayoutAttachment->setObjectName(QStringLiteral("m_pLayoutAttachment")); 4681 m_pLayoutAttachment->setContentsMargins(10, 0, 0, 0); 4682 m_pLabelSeparatorAttributes = new QILabelSeparator(pWidgetAttachment); 4683 m_pLabelSeparatorAttributes->setObjectName(QStringLiteral("m_pLabelSeparatorAttributes")); 4684 m_pLayoutAttachment->addWidget(m_pLabelSeparatorAttributes, 0, 0, 1, 3); 4685 4686 m_pLabelMedium = new QLabel(pWidgetAttachment); 4687 m_pLabelMedium->setObjectName(QStringLiteral("m_pLabelMedium")); 4688 m_pLabelMedium->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4689 m_pLayoutAttachment->addWidget(m_pLabelMedium, 1, 1, 1, 1); 4690 4691 pLayoutContainer = new QHBoxLayout(); 4692 pLayoutContainer->setSpacing(1); 4693 pLayoutContainer->setObjectName(QStringLiteral("pLayoutContainer")); 4694 pLayoutContainer->setContentsMargins(0, 0, 0, 0); 4695 m_pComboBoxSlot = new QComboBox(pWidgetAttachment); 4696 m_pComboBoxSlot->setObjectName(QStringLiteral("m_pComboBoxSlot")); 4697 sizePolicy.setHeightForWidth(m_pComboBoxSlot->sizePolicy().hasHeightForWidth()); 4698 m_pComboBoxSlot->setSizePolicy(sizePolicy); 4699 pLayoutContainer->addWidget(m_pComboBoxSlot); 4700 4701 m_pToolButtonOpen = new QIToolButton(pWidgetAttachment); 4702 m_pToolButtonOpen->setObjectName(QStringLiteral("m_pToolButtonOpen")); 4703 4704 pLayoutContainer->addWidget(m_pToolButtonOpen); 4705 m_pLayoutAttachment->addLayout(pLayoutContainer, 1, 2, 1, 1); 4706 4707 pLayoutAttachmentConfig = new QVBoxLayout(); 4708 pLayoutAttachmentConfig->setSpacing(0); 4709 pLayoutAttachmentConfig->setContentsMargins(0, 0, 0, 0); 4710 pLayoutAttachmentConfig->setObjectName(QStringLiteral("pLayoutAttachmentConfig")); 4711 m_pCheckBoxPassthrough = new QCheckBox(pWidgetAttachment); 4712 m_pCheckBoxPassthrough->setObjectName(QStringLiteral("m_pCheckBoxPassthrough")); 4713 QSizePolicy sizePolicy1(QSizePolicy::MinimumExpanding, QSizePolicy::Fixed); 4714 sizePolicy1.setHorizontalStretch(0); 4715 sizePolicy1.setVerticalStretch(0); 4716 sizePolicy1.setHeightForWidth(m_pCheckBoxPassthrough->sizePolicy().hasHeightForWidth()); 4717 m_pCheckBoxPassthrough->setSizePolicy(sizePolicy1); 4718 pLayoutAttachmentConfig->addWidget(m_pCheckBoxPassthrough); 4719 4720 m_pCheckBoxTempEject = new QCheckBox(pWidgetAttachment); 4721 m_pCheckBoxTempEject->setObjectName(QStringLiteral("m_pCheckBoxTempEject")); 4722 sizePolicy1.setHeightForWidth(m_pCheckBoxTempEject->sizePolicy().hasHeightForWidth()); 4723 m_pCheckBoxTempEject->setSizePolicy(sizePolicy1); 4724 pLayoutAttachmentConfig->addWidget(m_pCheckBoxTempEject); 4725 4726 m_pCheckBoxNonRotational = new QCheckBox(pWidgetAttachment); 4727 m_pCheckBoxNonRotational->setObjectName(QStringLiteral("m_pCheckBoxNonRotational")); 4728 sizePolicy1.setHeightForWidth(m_pCheckBoxNonRotational->sizePolicy().hasHeightForWidth()); 4729 m_pCheckBoxNonRotational->setSizePolicy(sizePolicy1); 4730 pLayoutAttachmentConfig->addWidget(m_pCheckBoxNonRotational); 4731 4732 m_pCheckBoxHotPluggable = new QCheckBox(pWidgetAttachment); 4733 m_pCheckBoxHotPluggable->setObjectName(QStringLiteral("m_pCheckBoxHotPluggable")); 4734 sizePolicy1.setHeightForWidth(m_pCheckBoxHotPluggable->sizePolicy().hasHeightForWidth()); 4735 m_pCheckBoxHotPluggable->setSizePolicy(sizePolicy1); 4736 4737 pLayoutAttachmentConfig->addWidget(m_pCheckBoxHotPluggable); 4738 m_pLayoutAttachment->addLayout(pLayoutAttachmentConfig, 2, 2, 1, 1); 4739 4740 m_pLabelSeparatorInformation = new QILabelSeparator(pWidgetAttachment); 4741 m_pLabelSeparatorInformation->setObjectName(QStringLiteral("m_pLabelSeparatorInformation")); 4742 m_pLayoutAttachment->addWidget(m_pLabelSeparatorInformation, 3, 0, 1, 3); 4743 4744 m_pLabelHDFormat = new QLabel(pWidgetAttachment); 4745 m_pLabelHDFormat->setObjectName(QStringLiteral("m_pLabelHDFormat")); 4746 m_pLabelHDFormat->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4747 m_pLayoutAttachment->addWidget(m_pLabelHDFormat, 4, 1, 1, 1); 4748 4749 m_pLabelHDFormatValue = new QILabel(pWidgetAttachment); 4750 m_pLabelHDFormatValue->setObjectName(QStringLiteral("m_pLabelHDFormatValue")); 4751 QSizePolicy sizePolicy2(QSizePolicy::Ignored, QSizePolicy::Preferred); 4752 sizePolicy2.setHorizontalStretch(0); 4753 sizePolicy2.setVerticalStretch(0); 4754 sizePolicy2.setHeightForWidth(m_pLabelHDFormatValue->sizePolicy().hasHeightForWidth()); 4755 m_pLabelHDFormatValue->setSizePolicy(sizePolicy2); 4756 m_pLayoutAttachment->addWidget(m_pLabelHDFormatValue, 4, 2, 1, 1); 4757 4758 m_pLabelCDFDType = new QLabel(pWidgetAttachment); 4759 m_pLabelCDFDType->setObjectName(QStringLiteral("m_pLabelCDFDType")); 4760 m_pLabelCDFDType->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4761 m_pLayoutAttachment->addWidget(m_pLabelCDFDType, 5, 1, 1, 1); 4762 4763 m_pLabelCDFDTypeValue = new QILabel(pWidgetAttachment); 4764 m_pLabelCDFDTypeValue->setObjectName(QStringLiteral("m_pLabelCDFDTypeValue")); 4765 sizePolicy2.setHeightForWidth(m_pLabelCDFDTypeValue->sizePolicy().hasHeightForWidth()); 4766 m_pLabelCDFDTypeValue->setSizePolicy(sizePolicy2); 4767 m_pLayoutAttachment->addWidget(m_pLabelCDFDTypeValue, 5, 2, 1, 1); 4768 4769 m_pLabelHDVirtualSize = new QLabel(pWidgetAttachment); 4770 m_pLabelHDVirtualSize->setObjectName(QStringLiteral("m_pLabelHDVirtualSize")); 4771 m_pLabelHDVirtualSize->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4772 4773 m_pLayoutAttachment->addWidget(m_pLabelHDVirtualSize, 6, 1, 1, 1); 4774 4775 m_pLabelHDVirtualSizeValue = new QILabel(pWidgetAttachment); 4776 m_pLabelHDVirtualSizeValue->setObjectName(QStringLiteral("m_pLabelHDVirtualSizeValue")); 4777 sizePolicy2.setHeightForWidth(m_pLabelHDVirtualSizeValue->sizePolicy().hasHeightForWidth()); 4778 m_pLabelHDVirtualSizeValue->setSizePolicy(sizePolicy2); 4779 m_pLayoutAttachment->addWidget(m_pLabelHDVirtualSizeValue, 6, 2, 1, 1); 4780 4781 m_pLabelHDActualSize = new QLabel(pWidgetAttachment); 4782 m_pLabelHDActualSize->setObjectName(QStringLiteral("m_pLabelHDActualSize")); 4783 m_pLabelHDActualSize->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4784 m_pLayoutAttachment->addWidget(m_pLabelHDActualSize, 7, 1, 1, 1); 4785 4786 m_pLabelHDActualSizeValue = new QILabel(pWidgetAttachment); 4787 m_pLabelHDActualSizeValue->setObjectName(QStringLiteral("m_pLabelHDActualSizeValue")); 4788 sizePolicy2.setHeightForWidth(m_pLabelHDActualSizeValue->sizePolicy().hasHeightForWidth()); 4789 m_pLabelHDActualSizeValue->setSizePolicy(sizePolicy2); 4790 m_pLayoutAttachment->addWidget(m_pLabelHDActualSizeValue, 7, 2, 1, 1); 4791 4792 m_pLabelSize = new QLabel(pWidgetAttachment); 4793 m_pLabelSize->setObjectName(QStringLiteral("m_pLabelSize")); 4794 m_pLabelSize->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4795 m_pLayoutAttachment->addWidget(m_pLabelSize, 8, 1, 1, 1); 4796 4797 m_pLabelSizeValue = new QILabel(pWidgetAttachment); 4798 m_pLabelSizeValue->setObjectName(QStringLiteral("m_pLabelSizeValue")); 4799 sizePolicy2.setHeightForWidth(m_pLabelSizeValue->sizePolicy().hasHeightForWidth()); 4800 m_pLabelSizeValue->setSizePolicy(sizePolicy2); 4801 m_pLayoutAttachment->addWidget(m_pLabelSizeValue, 8, 2, 1, 1); 4802 4803 m_pLabelHDDetails = new QLabel(pWidgetAttachment); 4804 m_pLabelHDDetails->setObjectName(QStringLiteral("m_pLabelHDDetails")); 4805 m_pLabelHDDetails->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4806 m_pLayoutAttachment->addWidget(m_pLabelHDDetails, 9, 1, 1, 1); 4807 4808 m_pLabelHDDetailsValue = new QILabel(pWidgetAttachment); 4809 m_pLabelHDDetailsValue->setObjectName(QStringLiteral("m_pLabelHDDetailsValue")); 4810 sizePolicy2.setHeightForWidth(m_pLabelHDDetailsValue->sizePolicy().hasHeightForWidth()); 4811 m_pLabelHDDetailsValue->setSizePolicy(sizePolicy2); 4812 m_pLayoutAttachment->addWidget(m_pLabelHDDetailsValue, 9, 2, 1, 1); 4813 4814 m_pLabelLocation = new QLabel(pWidgetAttachment); 4815 m_pLabelLocation->setObjectName(QStringLiteral("m_pLabelLocation")); 4816 m_pLabelLocation->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4817 m_pLayoutAttachment->addWidget(m_pLabelLocation, 10, 1, 1, 1); 4818 4819 m_pLabelLocationValue = new QILabel(pWidgetAttachment); 4820 m_pLabelLocationValue->setObjectName(QStringLiteral("m_pLabelLocationValue")); 4821 sizePolicy2.setHeightForWidth(m_pLabelLocationValue->sizePolicy().hasHeightForWidth()); 4822 m_pLabelLocationValue->setSizePolicy(sizePolicy2); 4823 m_pLayoutAttachment->addWidget(m_pLabelLocationValue, 10, 2, 1, 1); 4824 4825 m_pLabelUsage = new QLabel(pWidgetAttachment); 4826 m_pLabelUsage->setObjectName(QStringLiteral("m_pLabelUsage")); 4827 m_pLabelUsage->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4828 m_pLayoutAttachment->addWidget(m_pLabelUsage, 11, 1, 1, 1); 4829 4830 m_pLabelUsageValue = new QILabel(pWidgetAttachment); 4831 m_pLabelUsageValue->setObjectName(QStringLiteral("m_pLabelUsageValue")); 4832 sizePolicy2.setHeightForWidth(m_pLabelUsageValue->sizePolicy().hasHeightForWidth()); 4833 m_pLabelUsageValue->setSizePolicy(sizePolicy2); 4834 m_pLayoutAttachment->addWidget(m_pLabelUsageValue, 11, 2, 1, 1); 4835 4836 m_pLabelEncryption = new QLabel(pWidgetAttachment); 4837 m_pLabelEncryption->setObjectName(QStringLiteral("m_pLabelEncryption")); 4838 m_pLabelEncryption->setAlignment(Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter); 4839 m_pLayoutAttachment->addWidget(m_pLabelEncryption, 12, 1, 1, 1); 4840 4841 m_pLabelEncryptionValue = new QILabel(pWidgetAttachment); 4842 m_pLabelEncryptionValue->setObjectName(QStringLiteral("m_pLabelEncryptionValue")); 4843 sizePolicy2.setHeightForWidth(m_pLabelEncryptionValue->sizePolicy().hasHeightForWidth()); 4844 m_pLabelEncryptionValue->setSizePolicy(sizePolicy2); 4845 m_pLayoutAttachment->addWidget(m_pLabelEncryptionValue, 12, 2, 1, 1); 4846 4847 pSpacerItem6 = new QSpacerItem(0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); 4848 m_pLayoutAttachment->addItem(pSpacerItem6, 13, 0, 1, 3); 4849 4850 mSwRightPane->addWidget(pWidgetAttachment); 4851 m_pSplitter->addWidget(mSwRightPane); 4852 pLayoutMain->addWidget(m_pSplitter); 4853 4854 m_pLabelName->setBuddy(m_pLineEditName); 4855 m_pLabelType->setBuddy(m_pComboBoxType); 4856 m_pLabelPortCount->setBuddy(m_pSpinBoxPortCount); 4857 m_pLabelMedium->setBuddy(m_pToolButtonOpen); 4858 } 4859 4860 void UIMachineSettingsStorage::prepareStorageTree() 4861 { 4862 /* Create storage tree-view: */ 4506 /* Create main layout: */ 4507 QVBoxLayout *pLayoutMain = new QVBoxLayout(this); 4508 if (pLayoutMain) 4509 { 4510 /* Create splitter: */ 4511 m_pSplitter = new QISplitter(this); 4512 if (m_pSplitter) 4513 { 4514 m_pSplitter->setOrientation(Qt::Horizontal); 4515 m_pSplitter->setHandleWidth(4); 4516 4517 /* Prepare panes: */ 4518 prepareLeftPane(); 4519 prepareRightPane(); 4520 4521 pLayoutMain->addWidget(m_pSplitter); 4522 } 4523 } 4524 } 4525 4526 void UIMachineSettingsStorage::prepareLeftPane() 4527 { 4528 /* Prepare left pane: */ 4529 m_pWidgetLeftPane = new QWidget(m_pSplitter); 4530 if (m_pWidgetLeftPane) 4531 { 4532 /* Prepare left pane layout: */ 4533 QVBoxLayout *pLayoutLeftPane = new QVBoxLayout(m_pWidgetLeftPane); 4534 if (pLayoutLeftPane) 4535 { 4536 pLayoutLeftPane->setContentsMargins(0, 0, 10, 0); 4537 4538 /* Prepare left separator: */ 4539 m_pLabelSeparatorLeftPane = new QILabelSeparator(m_pWidgetLeftPane); 4540 if (m_pLabelSeparatorLeftPane) 4541 pLayoutLeftPane->addWidget(m_pLabelSeparatorLeftPane); 4542 4543 /* Prepare storage layout: */ 4544 m_pLayoutTreeView = new QVBoxLayout; 4545 if (m_pLayoutTreeView) 4546 { 4547 #ifdef VBOX_WS_MAC 4548 m_pLayoutTreeView->setContentsMargins(3, 0, 3, 0); 4549 m_pLayoutTreeView->setSpacing(3); 4550 #else 4551 m_pLayoutTreeView->setContentsMargins(0, 0, 0, 0); 4552 m_pLayoutTreeView->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3); 4553 #endif 4554 4555 /* Prepare tree-view: */ 4556 prepareTreeView(); 4557 4558 /* Prepare toolbar layout: */ 4559 m_pLayoutToolBar = new QHBoxLayout; 4560 if (m_pLayoutToolBar) 4561 { 4562 m_pLayoutToolBar->addStretch(); 4563 4564 /* Prepare toolbar: */ 4565 prepareToolBar(); 4566 4567 m_pLayoutTreeView->addLayout(m_pLayoutToolBar); 4568 } 4569 4570 pLayoutLeftPane->addLayout(m_pLayoutTreeView); 4571 } 4572 } 4573 4574 m_pSplitter->addWidget(m_pWidgetLeftPane); 4575 } 4576 } 4577 4578 void UIMachineSettingsStorage::prepareTreeView() 4579 { 4580 /* Prepare tree-view: */ 4863 4581 m_pTreeStorage = new QITreeView; 4864 AssertPtrReturnVoid(m_pTreeStorage); 4865 AssertPtrReturnVoid(m_pLabelSeparatorLeftPane); 4866 { 4867 /* Configure tree-view: */ 4868 m_pLabelSeparatorLeftPane->setBuddy(m_pTreeStorage); 4582 if (m_pTreeStorage) 4583 { 4584 if (m_pLabelSeparatorLeftPane) 4585 m_pLabelSeparatorLeftPane->setBuddy(m_pTreeStorage); 4869 4586 m_pTreeStorage->setMouseTracking(true); 4870 4587 m_pTreeStorage->setAcceptDrops(true); 4871 4588 m_pTreeStorage->setContextMenuPolicy(Qt::CustomContextMenu); 4872 4589 4873 /* Create storage model: */4590 /* Prepare storage model: */ 4874 4591 m_pModelStorage = new StorageModel(m_pTreeStorage); 4875 AssertPtrReturnVoid(m_pModelStorage); 4876 { 4877 /* Configure model: */ 4592 if (m_pModelStorage) 4593 { 4878 4594 m_pTreeStorage->setModel(m_pModelStorage); 4879 4595 m_pTreeStorage->setRootIndex(m_pModelStorage->root()); … … 4881 4597 } 4882 4598 4883 /* Create storage delegate: */4599 /* Prepare storage delegate: */ 4884 4600 StorageDelegate *pStorageDelegate = new StorageDelegate(m_pTreeStorage); 4885 AssertPtrReturnVoid(pStorageDelegate); 4886 { 4887 /* Configure delegate: */ 4601 if (pStorageDelegate) 4888 4602 m_pTreeStorage->setItemDelegate(pStorageDelegate); 4889 } 4890 4891 /* Insert tree-view into layout: */4892 m_pLayoutStorage->insertWidget(0, m_pTreeStorage); 4893 } 4894 } 4895 4896 void UIMachineSettingsStorage::prepareStorageToolbar() 4897 { 4898 AssertPtrReturnVoid(m_pToolBarStorageBar);4603 4604 m_pLayoutTreeView->addWidget(m_pTreeStorage); 4605 } 4606 } 4607 4608 void UIMachineSettingsStorage::prepareToolBar() 4609 { 4610 /* Prepare toolbar: */ 4611 m_pToolBar = new UIToolBar(m_pWidgetLeftPane); 4612 if (m_pToolBar) 4899 4613 { 4900 4614 /* Configure toolbar: */ 4901 4615 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 4902 m_pToolBar StorageBar->setIconSize(QSize(iIconMetric, iIconMetric));4903 4904 /* Create 'Add Controller' action: */4616 m_pToolBar->setIconSize(QSize(iIconMetric, iIconMetric)); 4617 4618 /* Prepare 'Add Controller' action: */ 4905 4619 m_pActionAddController = new QAction(this); 4906 AssertPtrReturnVoid(m_pActionAddController); 4907 { 4908 /* Configure action: */ 4620 if (m_pActionAddController) 4621 { 4909 4622 m_pActionAddController->setIcon(iconPool()->icon(ControllerAddEn, ControllerAddDis)); 4910 4911 /* Add action into toolbar: */ 4912 m_pToolBarStorageBar->addAction(m_pActionAddController); 4913 } 4914 4915 /* Create 'Add PIIX3 Controller' action: */ 4623 m_pToolBar->addAction(m_pActionAddController); 4624 } 4625 4626 /* Prepare 'Add PIIX3 Controller' action: */ 4916 4627 m_addControllerActions[KStorageControllerType_PIIX3] = new QAction(this); 4917 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_PIIX3)); 4918 { 4919 /* Configure action: */ 4628 if (m_addControllerActions.value(KStorageControllerType_PIIX3)) 4920 4629 m_addControllerActions.value(KStorageControllerType_PIIX3)->setIcon(iconPool()->icon(IDEControllerAddEn, IDEControllerAddDis)); 4921 } 4922 4923 /* Create 'Add PIIX4 Controller' action: */ 4630 /* Prepare 'Add PIIX4 Controller' action: */ 4924 4631 m_addControllerActions[KStorageControllerType_PIIX4] = new QAction(this); 4925 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_PIIX4)); 4926 { 4927 /* Configure action: */ 4632 if (m_addControllerActions.value(KStorageControllerType_PIIX4)) 4928 4633 m_addControllerActions.value(KStorageControllerType_PIIX4)->setIcon(iconPool()->icon(IDEControllerAddEn, IDEControllerAddDis)); 4929 } 4930 4931 /* Create 'Add ICH6 Controller' action: */ 4634 /* Prepare 'Add ICH6 Controller' action: */ 4932 4635 m_addControllerActions[KStorageControllerType_ICH6] = new QAction(this); 4933 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_ICH6)); 4934 { 4935 /* Configure action: */ 4636 if (m_addControllerActions.value(KStorageControllerType_ICH6)) 4936 4637 m_addControllerActions.value(KStorageControllerType_ICH6)->setIcon(iconPool()->icon(IDEControllerAddEn, IDEControllerAddDis)); 4937 } 4938 4939 /* Create 'Add AHCI Controller' action: */ 4638 /* Prepare 'Add AHCI Controller' action: */ 4940 4639 m_addControllerActions[KStorageControllerType_IntelAhci] = new QAction(this); 4941 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_IntelAhci)); 4942 { 4943 /* Configure action: */ 4640 if (m_addControllerActions.value(KStorageControllerType_IntelAhci)) 4944 4641 m_addControllerActions.value(KStorageControllerType_IntelAhci)->setIcon(iconPool()->icon(SATAControllerAddEn, SATAControllerAddDis)); 4945 } 4946 4947 /* Create 'Add LsiLogic Controller' action: */ 4642 /* Prepare 'Add LsiLogic Controller' action: */ 4948 4643 m_addControllerActions[KStorageControllerType_LsiLogic] = new QAction(this); 4949 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_LsiLogic)); 4950 { 4951 /* Configure action: */ 4644 if (m_addControllerActions.value(KStorageControllerType_LsiLogic)) 4952 4645 m_addControllerActions.value(KStorageControllerType_LsiLogic)->setIcon(iconPool()->icon(SCSIControllerAddEn, SCSIControllerAddDis)); 4953 } 4954 4955 /* Create 'Add BusLogic Controller' action: */ 4646 /* Prepare 'Add BusLogic Controller' action: */ 4956 4647 m_addControllerActions[KStorageControllerType_BusLogic] = new QAction(this); 4957 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_BusLogic)); 4958 { 4959 /* Configure action: */ 4648 if (m_addControllerActions.value(KStorageControllerType_BusLogic)) 4960 4649 m_addControllerActions.value(KStorageControllerType_BusLogic)->setIcon(iconPool()->icon(SCSIControllerAddEn, SCSIControllerAddDis)); 4961 } 4962 4963 /* Create 'Add Floppy Controller' action: */ 4650 /* Prepare 'Add Floppy Controller' action: */ 4964 4651 m_addControllerActions[KStorageControllerType_I82078] = new QAction(this); 4965 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_I82078)); 4966 { 4967 /* Configure action: */ 4652 if (m_addControllerActions.value(KStorageControllerType_I82078)) 4968 4653 m_addControllerActions.value(KStorageControllerType_I82078)->setIcon(iconPool()->icon(FloppyControllerAddEn, FloppyControllerAddDis)); 4969 } 4970 4971 /* Create 'Add LsiLogic SAS Controller' action: */ 4654 /* Prepare 'Add LsiLogic SAS Controller' action: */ 4972 4655 m_addControllerActions[KStorageControllerType_LsiLogicSas] = new QAction(this); 4973 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_LsiLogicSas)); 4974 { 4975 /* Configure action: */ 4656 if (m_addControllerActions.value(KStorageControllerType_LsiLogicSas)) 4976 4657 m_addControllerActions.value(KStorageControllerType_LsiLogicSas)->setIcon(iconPool()->icon(SASControllerAddEn, SASControllerAddDis)); 4977 } 4978 4979 /* Create 'Add USB Controller' action: */ 4658 /* Prepare 'Add USB Controller' action: */ 4980 4659 m_addControllerActions[KStorageControllerType_USB] = new QAction(this); 4981 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_USB)); 4982 { 4983 /* Configure action: */ 4660 if (m_addControllerActions.value(KStorageControllerType_USB)) 4984 4661 m_addControllerActions.value(KStorageControllerType_USB)->setIcon(iconPool()->icon(USBControllerAddEn, USBControllerAddDis)); 4985 } 4986 4987 /* Create 'Add NVMe Controller' action: */ 4662 /* Prepare 'Add NVMe Controller' action: */ 4988 4663 m_addControllerActions[KStorageControllerType_NVMe] = new QAction(this); 4989 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_NVMe)); 4990 { 4991 /* Configure action: */ 4664 if (m_addControllerActions.value(KStorageControllerType_NVMe)) 4992 4665 m_addControllerActions.value(KStorageControllerType_NVMe)->setIcon(iconPool()->icon(NVMeControllerAddEn, NVMeControllerAddDis)); 4993 } 4994 4995 /* Create 'Add virtio-scsi Controller' action: */ 4666 /* Prepare 'Add virtio-scsi Controller' action: */ 4996 4667 m_addControllerActions[KStorageControllerType_VirtioSCSI] = new QAction(this); 4997 AssertPtrReturnVoid(m_addControllerActions.value(KStorageControllerType_VirtioSCSI)); 4998 { 4999 /* Configure action: */ 4668 if (m_addControllerActions.value(KStorageControllerType_VirtioSCSI)) 5000 4669 m_addControllerActions.value(KStorageControllerType_VirtioSCSI)->setIcon(iconPool()->icon(VirtioSCSIControllerAddEn, VirtioSCSIControllerAddDis)); 5001 } 5002 5003 /* Create 'Remove Controller' action: */ 4670 4671 /* Prepare 'Remove Controller' action: */ 5004 4672 m_pActionRemoveController = new QAction(this); 5005 AssertPtrReturnVoid(m_pActionRemoveController); 5006 { 5007 /* Configure action: */ 4673 if (m_pActionRemoveController) 4674 { 5008 4675 m_pActionRemoveController->setIcon(iconPool()->icon(ControllerDelEn, ControllerDelDis)); 5009 5010 /* Add action into toolbar: */ 5011 m_pToolBarStorageBar->addAction(m_pActionRemoveController); 5012 } 5013 5014 /* Create 'Add Attachment' action: */ 4676 m_pToolBar->addAction(m_pActionRemoveController); 4677 } 4678 4679 /* Prepare 'Add Attachment' action: */ 5015 4680 m_pActionAddAttachment = new QAction(this); 5016 AssertPtrReturnVoid(m_pActionAddAttachment); 5017 { 5018 /* Configure action: */ 4681 if (m_pActionAddAttachment) 4682 { 5019 4683 m_pActionAddAttachment->setIcon(iconPool()->icon(AttachmentAddEn, AttachmentAddDis)); 5020 5021 /* Add action into toolbar: */ 5022 m_pToolBarStorageBar->addAction(m_pActionAddAttachment); 5023 } 5024 5025 /* Create 'Add HD Attachment' action: */ 4684 m_pToolBar->addAction(m_pActionAddAttachment); 4685 } 4686 4687 /* Prepare 'Add HD Attachment' action: */ 5026 4688 m_pActionAddAttachmentHD = new QAction(this); 5027 AssertPtrReturnVoid(m_pActionAddAttachmentHD); 5028 { 5029 /* Configure action: */ 4689 if (m_pActionAddAttachmentHD) 5030 4690 m_pActionAddAttachmentHD->setIcon(iconPool()->icon(HDAttachmentAddEn, HDAttachmentAddDis)); 5031 } 5032 5033 /* Create 'Add CD Attachment' action: */ 4691 /* Prepare 'Add CD Attachment' action: */ 5034 4692 m_pActionAddAttachmentCD = new QAction(this); 5035 AssertPtrReturnVoid(m_pActionAddAttachmentCD); 5036 { 5037 /* Configure action: */ 4693 if (m_pActionAddAttachmentCD) 5038 4694 m_pActionAddAttachmentCD->setIcon(iconPool()->icon(CDAttachmentAddEn, CDAttachmentAddDis)); 5039 } 5040 5041 /* Create 'Add FD Attachment' action: */ 4695 /* Prepare 'Add FD Attachment' action: */ 5042 4696 m_pActionAddAttachmentFD = new QAction(this); 5043 AssertPtrReturnVoid(m_pActionAddAttachmentFD); 5044 { 5045 /* Configure action: */ 4697 if (m_pActionAddAttachmentFD) 5046 4698 m_pActionAddAttachmentFD->setIcon(iconPool()->icon(FDAttachmentAddEn, FDAttachmentAddDis)); 5047 } 5048 5049 /* Create 'Remove Attachment' action: */ 4699 4700 /* Prepare 'Remove Attachment' action: */ 5050 4701 m_pActionRemoveAttachment = new QAction(this); 5051 AssertPtrReturnVoid(m_pActionRemoveAttachment); 5052 { 5053 /* Configure action: */ 4702 if (m_pActionRemoveAttachment) 4703 { 5054 4704 m_pActionRemoveAttachment->setIcon(iconPool()->icon(AttachmentDelEn, AttachmentDelDis)); 5055 5056 /* Add action into toolbar: */ 5057 m_pToolBarStorageBar->addAction(m_pActionRemoveAttachment); 5058 } 5059 } 5060 } 5061 5062 void UIMachineSettingsStorage::prepareStorageWidgets() 5063 { 5064 AssertPtrReturnVoid(m_pToolButtonOpen); 5065 { 5066 /* Create Open Medium menu: */ 5067 QMenu *pOpenMediumMenu = new QMenu(m_pToolButtonOpen); 5068 AssertPtrReturnVoid(pOpenMediumMenu); 5069 { 5070 /* Add menu into tool-button: */ 5071 m_pToolButtonOpen->setMenu(pOpenMediumMenu); 5072 } 5073 } 5074 5075 AssertPtrReturnVoid(m_pSpinBoxPortCount); 5076 AssertPtrReturnVoid(m_pLabelHDFormatValue); 5077 AssertPtrReturnVoid(m_pLabelCDFDTypeValue); 5078 AssertPtrReturnVoid(m_pLabelHDVirtualSizeValue); 5079 AssertPtrReturnVoid(m_pLabelHDActualSizeValue); 5080 AssertPtrReturnVoid(m_pLabelSizeValue); 5081 AssertPtrReturnVoid(m_pLabelHDDetailsValue); 5082 AssertPtrReturnVoid(m_pLabelLocationValue); 5083 AssertPtrReturnVoid(m_pLabelUsageValue); 5084 AssertPtrReturnVoid(m_pLabelEncryptionValue); 5085 { 5086 /* Configure widgets: */ 5087 m_pSpinBoxPortCount->setValue(0); 5088 m_pLabelHDFormatValue->setFullSizeSelection(true); 5089 m_pLabelCDFDTypeValue->setFullSizeSelection(true); 5090 m_pLabelHDVirtualSizeValue->setFullSizeSelection(true); 5091 m_pLabelHDActualSizeValue->setFullSizeSelection(true); 5092 m_pLabelSizeValue->setFullSizeSelection(true); 5093 m_pLabelHDDetailsValue->setFullSizeSelection(true); 5094 m_pLabelLocationValue->setFullSizeSelection(true); 5095 m_pLabelUsageValue->setFullSizeSelection(true); 5096 m_pLabelEncryptionValue->setFullSizeSelection(true); 4705 m_pToolBar->addAction(m_pActionRemoveAttachment); 4706 } 4707 4708 m_pLayoutToolBar->addWidget(m_pToolBar); 4709 } 4710 } 4711 4712 void UIMachineSettingsStorage::prepareRightPane() 4713 { 4714 /* Prepare right pane: */ 4715 m_pStackRightPane = new QStackedWidget(m_pSplitter); 4716 if (m_pStackRightPane) 4717 { 4718 /* Prepare stack contents: */ 4719 prepareEmptyWidget(); 4720 prepareControllerWidget(); 4721 prepareAttachmentWidget(); 4722 4723 m_pSplitter->addWidget(m_pStackRightPane); 4724 } 4725 } 4726 4727 void UIMachineSettingsStorage::prepareEmptyWidget() 4728 { 4729 /* Prepare widget for empty case: */ 4730 QWidget *pWidgetEmpty = new QWidget; 4731 if (pWidgetEmpty) 4732 { 4733 /* Create widget layout for empty case: */ 4734 QGridLayout *pLayoutEmpty = new QGridLayout(pWidgetEmpty); 4735 if (pLayoutEmpty) 4736 { 4737 pLayoutEmpty->setContentsMargins(10, 0, 0, 0); 4738 pLayoutEmpty->setRowStretch(2, 1); 4739 4740 /* Prepare separator for empty case: */ 4741 m_pLabelSeparatorEmpty = new QILabelSeparator(pWidgetEmpty); 4742 if (m_pLabelSeparatorEmpty) 4743 pLayoutEmpty->addWidget(m_pLabelSeparatorEmpty, 0, 0, 1, 2); 4744 4745 /* Prepare label for empty case: */ 4746 m_pLabelInfo = new QLabel(pWidgetEmpty); 4747 if (m_pLabelInfo) 4748 { 4749 m_pLabelInfo->setWordWrap(true); 4750 pLayoutEmpty->addWidget(m_pLabelInfo, 1, 1, 1, 1); 4751 } 4752 4753 pLayoutEmpty->setColumnMinimumWidth(0, 10); 4754 } 4755 4756 m_pStackRightPane->addWidget(pWidgetEmpty); 4757 } 4758 } 4759 4760 void UIMachineSettingsStorage::prepareControllerWidget() 4761 { 4762 /* Create widget for controller case: */ 4763 QWidget *pWidgetController = new QWidget; 4764 if (pWidgetController) 4765 { 4766 /* Create widget layout for controller case: */ 4767 QGridLayout *m_pLayoutController = new QGridLayout(pWidgetController); 4768 if (m_pLayoutController) 4769 { 4770 m_pLayoutController->setContentsMargins(10, 0, 0, 0); 4771 m_pLayoutController->setRowStretch(5, 1); 4772 4773 /* Prepare separator for controller case: */ 4774 m_pLabelSeparatorParameters = new QILabelSeparator(pWidgetController); 4775 if (m_pLabelSeparatorParameters) 4776 m_pLayoutController->addWidget(m_pLabelSeparatorParameters, 0, 0, 1, 3); 4777 4778 /* Prepare name label: */ 4779 m_pLabelName = new QLabel(pWidgetController); 4780 if (m_pLabelName) 4781 { 4782 m_pLabelName->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4783 m_pLayoutController->addWidget(m_pLabelName, 1, 1, 1, 1); 4784 } 4785 /* Prepare name editor: */ 4786 m_pEditorName = new QLineEdit(pWidgetController); 4787 if (m_pEditorName) 4788 { 4789 m_pLabelName->setBuddy(m_pEditorName); 4790 m_pLayoutController->addWidget(m_pEditorName, 1, 2, 1, 1); 4791 } 4792 4793 /* Prepare type label: */ 4794 m_pLabelType = new QLabel(pWidgetController); 4795 if (m_pLabelType) 4796 { 4797 m_pLabelType->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4798 m_pLayoutController->addWidget(m_pLabelType, 2, 1, 1, 1); 4799 } 4800 /* Prepare type combo: */ 4801 m_pComboType = new QComboBox(pWidgetController); 4802 if (m_pComboType) 4803 { 4804 m_pLabelType->setBuddy(m_pComboType); 4805 m_pComboType->setSizeAdjustPolicy(QComboBox::AdjustToContents); 4806 m_pLayoutController->addWidget(m_pComboType, 2, 2, 1, 1); 4807 } 4808 4809 /* Prepare port count label: */ 4810 m_pLabelPortCount = new QLabel(pWidgetController); 4811 if (m_pLabelPortCount) 4812 { 4813 m_pLabelPortCount->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4814 m_pLayoutController->addWidget(m_pLabelPortCount, 3, 1, 1, 1); 4815 } 4816 /* Prepare port count spinbox: */ 4817 m_pSpinBoxPortCount = new QSpinBox(pWidgetController); 4818 if (m_pSpinBoxPortCount) 4819 { 4820 m_pLabelPortCount->setBuddy(m_pSpinBoxPortCount); 4821 m_pLayoutController->addWidget(m_pSpinBoxPortCount, 3, 2, 1, 1); 4822 } 4823 4824 /* Prepare port count check-box: */ 4825 m_pCheckBoxIoCache = new QCheckBox(pWidgetController); 4826 if (m_pCheckBoxIoCache) 4827 m_pLayoutController->addWidget(m_pCheckBoxIoCache, 4, 2, 1, 1); 4828 4829 m_pLayoutController->setColumnMinimumWidth(0, 10); 4830 } 4831 4832 m_pStackRightPane->addWidget(pWidgetController); 4833 } 4834 } 4835 4836 void UIMachineSettingsStorage::prepareAttachmentWidget() 4837 { 4838 /* Create widget for attachment case: */ 4839 QWidget *pWidgetAttachment = new QWidget; 4840 if (pWidgetAttachment) 4841 { 4842 /* Create widget layout for attachment case: */ 4843 QGridLayout *m_pLayoutAttachment = new QGridLayout(pWidgetAttachment); 4844 if (m_pLayoutAttachment) 4845 { 4846 m_pLayoutAttachment->setContentsMargins(10, 0, 0, 0); 4847 m_pLayoutAttachment->setColumnStretch(2, 1); 4848 m_pLayoutAttachment->setRowStretch(13, 1); 4849 4850 /* Prepare separator for attachment case: */ 4851 m_pLabelSeparatorAttributes = new QILabelSeparator(pWidgetAttachment); 4852 if (m_pLabelSeparatorAttributes) 4853 m_pLayoutAttachment->addWidget(m_pLabelSeparatorAttributes, 0, 0, 1, 3); 4854 4855 /* Prepare medium label: */ 4856 m_pLabelMedium = new QLabel(pWidgetAttachment); 4857 if (m_pLabelMedium) 4858 { 4859 m_pLabelMedium->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4860 m_pLayoutAttachment->addWidget(m_pLabelMedium, 1, 1); 4861 } 4862 4863 /* Prepare slot layout: */ 4864 QHBoxLayout *pLayoutContainer = new QHBoxLayout; 4865 if (pLayoutContainer) 4866 { 4867 pLayoutContainer->setContentsMargins(0, 0, 0, 0); 4868 pLayoutContainer->setSpacing(1); 4869 4870 /* Prepare slot combo: */ 4871 m_pComboSlot = new QComboBox(pWidgetAttachment); 4872 if (m_pComboSlot) 4873 pLayoutContainer->addWidget(m_pComboSlot); 4874 4875 /* Prepare slot combo: */ 4876 m_pToolButtonOpen = new QIToolButton(pWidgetAttachment); 4877 if (m_pToolButtonOpen) 4878 { 4879 if (m_pLabelMedium) 4880 m_pLabelMedium->setBuddy(m_pToolButtonOpen); 4881 4882 /* Prepare open medium menu: */ 4883 QMenu *pOpenMediumMenu = new QMenu(m_pToolButtonOpen); 4884 if (pOpenMediumMenu) 4885 m_pToolButtonOpen->setMenu(pOpenMediumMenu); 4886 4887 pLayoutContainer->addWidget(m_pToolButtonOpen); 4888 } 4889 4890 m_pLayoutAttachment->addLayout(pLayoutContainer, 1, 2); 4891 } 4892 4893 /* Prepare attachment settings layout: */ 4894 QVBoxLayout *pLayoutAttachmentSettings = new QVBoxLayout; 4895 if (pLayoutAttachmentSettings) 4896 { 4897 pLayoutAttachmentSettings->setContentsMargins(0, 0, 0, 0); 4898 pLayoutAttachmentSettings->setSpacing(0); 4899 4900 /* Prepare attachment passthrough check-box: */ 4901 m_pCheckBoxPassthrough = new QCheckBox(pWidgetAttachment); 4902 if (m_pCheckBoxPassthrough) 4903 pLayoutAttachmentSettings->addWidget(m_pCheckBoxPassthrough); 4904 4905 /* Prepare attachment temporary eject check-box: */ 4906 m_pCheckBoxTempEject = new QCheckBox(pWidgetAttachment); 4907 if (m_pCheckBoxTempEject) 4908 pLayoutAttachmentSettings->addWidget(m_pCheckBoxTempEject); 4909 4910 /* Prepare attachment non rotational check-box: */ 4911 m_pCheckBoxNonRotational = new QCheckBox(pWidgetAttachment); 4912 if (m_pCheckBoxNonRotational) 4913 pLayoutAttachmentSettings->addWidget(m_pCheckBoxNonRotational); 4914 4915 /* Prepare attachment hot pluggable check-box: */ 4916 m_pCheckBoxHotPluggable = new QCheckBox(pWidgetAttachment); 4917 if (m_pCheckBoxHotPluggable) 4918 pLayoutAttachmentSettings->addWidget(m_pCheckBoxHotPluggable); 4919 4920 m_pLayoutAttachment->addLayout(pLayoutAttachmentSettings, 2, 2, 1, 1); 4921 } 4922 4923 /* Prepare separator for attachment case: */ 4924 m_pLabelSeparatorInformation = new QILabelSeparator(pWidgetAttachment); 4925 if (m_pLabelSeparatorInformation) 4926 m_pLayoutAttachment->addWidget(m_pLabelSeparatorInformation, 3, 0, 1, 3); 4927 4928 /* Prepare HD format label: */ 4929 m_pLabelHDFormat = new QLabel(pWidgetAttachment); 4930 if (m_pLabelHDFormat) 4931 { 4932 m_pLabelHDFormat->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4933 m_pLayoutAttachment->addWidget(m_pLabelHDFormat, 4, 1); 4934 } 4935 /* Prepare HD format field: */ 4936 m_pFieldHDFormat = new QILabel(pWidgetAttachment); 4937 if (m_pFieldHDFormat) 4938 { 4939 m_pFieldHDFormat->setFullSizeSelection(true); 4940 m_pLayoutAttachment->addWidget(m_pFieldHDFormat, 4, 2); 4941 } 4942 4943 /* Prepare CD/FD type label: */ 4944 m_pLabelCDFDType = new QLabel(pWidgetAttachment); 4945 if (m_pLabelCDFDType) 4946 { 4947 m_pLabelCDFDType->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4948 m_pLayoutAttachment->addWidget(m_pLabelCDFDType, 5, 1); 4949 } 4950 /* Prepare CD/FD type field: */ 4951 m_pFieldCDFDType = new QILabel(pWidgetAttachment); 4952 if (m_pFieldCDFDType) 4953 { 4954 m_pFieldCDFDType->setFullSizeSelection(true); 4955 m_pLayoutAttachment->addWidget(m_pFieldCDFDType, 5, 2); 4956 } 4957 4958 /* Prepare HD virtual size label: */ 4959 m_pLabelHDVirtualSize = new QLabel(pWidgetAttachment); 4960 if (m_pLabelHDVirtualSize) 4961 { 4962 m_pLabelHDVirtualSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4963 m_pLayoutAttachment->addWidget(m_pLabelHDVirtualSize, 6, 1); 4964 } 4965 /* Prepare HD virtual size field: */ 4966 m_pFieldHDVirtualSize = new QILabel(pWidgetAttachment); 4967 if (m_pFieldHDVirtualSize) 4968 { 4969 m_pFieldHDVirtualSize->setFullSizeSelection(true); 4970 m_pLayoutAttachment->addWidget(m_pFieldHDVirtualSize, 6, 2); 4971 } 4972 4973 /* Prepare HD actual size label: */ 4974 m_pLabelHDActualSize = new QLabel(pWidgetAttachment); 4975 if (m_pLabelHDActualSize) 4976 { 4977 m_pLabelHDActualSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4978 m_pLayoutAttachment->addWidget(m_pLabelHDActualSize, 7, 1); 4979 } 4980 /* Prepare HD actual size field: */ 4981 m_pFieldHDActualSize = new QILabel(pWidgetAttachment); 4982 if (m_pFieldHDActualSize) 4983 { 4984 m_pFieldHDActualSize->setFullSizeSelection(true); 4985 m_pLayoutAttachment->addWidget(m_pFieldHDActualSize, 7, 2); 4986 } 4987 4988 /* Prepare CD/FD size label: */ 4989 m_pLabelCDFDSize = new QLabel(pWidgetAttachment); 4990 if (m_pLabelCDFDSize) 4991 { 4992 m_pLabelCDFDSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4993 m_pLayoutAttachment->addWidget(m_pLabelCDFDSize, 8, 1); 4994 } 4995 /* Prepare CD/FD size field: */ 4996 m_pFieldCDFDSize = new QILabel(pWidgetAttachment); 4997 if (m_pFieldCDFDSize) 4998 { 4999 m_pFieldCDFDSize->setFullSizeSelection(true); 5000 m_pLayoutAttachment->addWidget(m_pFieldCDFDSize, 8, 2); 5001 } 5002 5003 /* Prepare HD details label: */ 5004 m_pLabelHDDetails = new QLabel(pWidgetAttachment); 5005 if (m_pLabelHDDetails) 5006 { 5007 m_pLabelHDDetails->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5008 m_pLayoutAttachment->addWidget(m_pLabelHDDetails, 9, 1); 5009 } 5010 /* Prepare HD details field: */ 5011 m_pFieldHDDetails = new QILabel(pWidgetAttachment); 5012 if (m_pFieldHDDetails) 5013 { 5014 m_pFieldHDDetails->setFullSizeSelection(true); 5015 m_pLayoutAttachment->addWidget(m_pFieldHDDetails, 9, 2); 5016 } 5017 5018 /* Prepare location label: */ 5019 m_pLabelLocation = new QLabel(pWidgetAttachment); 5020 if (m_pLabelLocation) 5021 { 5022 m_pLabelLocation->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5023 m_pLayoutAttachment->addWidget(m_pLabelLocation, 10, 1); 5024 } 5025 /* Prepare location field: */ 5026 m_pFieldLocation = new QILabel(pWidgetAttachment); 5027 if (m_pFieldLocation) 5028 { 5029 m_pFieldLocation->setFullSizeSelection(true); 5030 m_pLayoutAttachment->addWidget(m_pFieldLocation, 10, 2); 5031 } 5032 5033 /* Prepare usage label: */ 5034 m_pLabelUsage = new QLabel(pWidgetAttachment); 5035 if (m_pLabelUsage) 5036 { 5037 m_pLabelUsage->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5038 m_pLayoutAttachment->addWidget(m_pLabelUsage, 11, 1); 5039 } 5040 /* Prepare usage field: */ 5041 m_pFieldUsage = new QILabel(pWidgetAttachment); 5042 if (m_pFieldUsage) 5043 { 5044 m_pFieldUsage->setFullSizeSelection(true); 5045 m_pLayoutAttachment->addWidget(m_pFieldUsage, 11, 2); 5046 } 5047 5048 /* Prepare encryption label: */ 5049 m_pLabelEncryption = new QLabel(pWidgetAttachment); 5050 if (m_pLabelEncryption) 5051 { 5052 m_pLabelEncryption->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5053 m_pLayoutAttachment->addWidget(m_pLabelEncryption, 12, 1); 5054 } 5055 /* Prepare encryption field: */ 5056 m_pFieldEncryption = new QILabel(pWidgetAttachment); 5057 if (m_pFieldEncryption) 5058 { 5059 m_pFieldEncryption->setFullSizeSelection(true); 5060 m_pLayoutAttachment->addWidget(m_pFieldEncryption, 12, 2); 5061 } 5062 5063 m_pLayoutAttachment->setColumnMinimumWidth(0, 10); 5064 } 5065 5066 m_pStackRightPane->addWidget(pWidgetAttachment); 5097 5067 } 5098 5068 } … … 5164 5134 connect(m_pSpinBoxPortCount, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 5165 5135 this, &UIMachineSettingsStorage::sltSetInformation); 5166 connect(m_p LineEditName, &QLineEdit::textEdited,5136 connect(m_pEditorName, &QLineEdit::textEdited, 5167 5137 this, &UIMachineSettingsStorage::sltSetInformation); 5168 connect(m_pCombo BoxType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),5138 connect(m_pComboType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), 5169 5139 this, &UIMachineSettingsStorage::sltSetInformation); 5170 connect(m_pCombo BoxSlot, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),5140 connect(m_pComboSlot, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), 5171 5141 this, &UIMachineSettingsStorage::sltSetInformation); 5172 5142 connect(m_pCheckBoxIoCache, &QCheckBox::stateChanged, … … 5267 5237 { 5268 5238 m_pLabelHDFormat->setVisible(enmType == KDeviceType_HardDisk); 5269 m_p LabelHDFormatValue->setVisible(enmType == KDeviceType_HardDisk);5239 m_pFieldHDFormat->setVisible(enmType == KDeviceType_HardDisk); 5270 5240 5271 5241 m_pLabelCDFDType->setVisible(enmType != KDeviceType_HardDisk); 5272 m_p LabelCDFDTypeValue->setVisible(enmType != KDeviceType_HardDisk);5242 m_pFieldCDFDType->setVisible(enmType != KDeviceType_HardDisk); 5273 5243 5274 5244 m_pLabelHDVirtualSize->setVisible(enmType == KDeviceType_HardDisk); 5275 m_p LabelHDVirtualSizeValue->setVisible(enmType == KDeviceType_HardDisk);5245 m_pFieldHDVirtualSize->setVisible(enmType == KDeviceType_HardDisk); 5276 5246 5277 5247 m_pLabelHDActualSize->setVisible(enmType == KDeviceType_HardDisk); 5278 m_p LabelHDActualSizeValue->setVisible(enmType == KDeviceType_HardDisk);5279 5280 m_pLabel Size->setVisible(enmType != KDeviceType_HardDisk);5281 m_p LabelSizeValue->setVisible(enmType != KDeviceType_HardDisk);5248 m_pFieldHDActualSize->setVisible(enmType == KDeviceType_HardDisk); 5249 5250 m_pLabelCDFDSize->setVisible(enmType != KDeviceType_HardDisk); 5251 m_pFieldCDFDSize->setVisible(enmType != KDeviceType_HardDisk); 5282 5252 5283 5253 m_pLabelHDDetails->setVisible(enmType == KDeviceType_HardDisk); 5284 m_p LabelHDDetailsValue->setVisible(enmType == KDeviceType_HardDisk);5254 m_pFieldHDDetails->setVisible(enmType == KDeviceType_HardDisk); 5285 5255 5286 5256 m_pLabelEncryption->setVisible(enmType == KDeviceType_HardDisk); 5287 m_p LabelEncryptionValue->setVisible(enmType == KDeviceType_HardDisk);5257 m_pFieldEncryption->setVisible(enmType == KDeviceType_HardDisk); 5288 5258 } 5289 5259 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r85711 r85872 30 30 class QComboBox; 31 31 class QGridLayout; 32 class QHBoxLayout; 32 33 class QLabel; 33 34 class QSpinBox; … … 105 106 /** Performs final page polishing. */ 106 107 virtual void polishPage() /* override */; 107 108 /** Handles show @a pEvent. */109 virtual void showEvent(QShowEvent *pEvent) /* override */;110 108 111 109 private slots: … … 209 207 /** Prepares widgets. */ 210 208 void prepareWidgets(); 211 /** Prepares storage tree. */ 212 void prepareStorageTree(); 213 /** Prepares storage toolbar. */ 214 void prepareStorageToolbar(); 215 /** Prepares storage widgets. */ 216 void prepareStorageWidgets(); 209 /** Prepares left pane. */ 210 void prepareLeftPane(); 211 /** Prepares tree view. */ 212 void prepareTreeView(); 213 /** Prepares toolbar. */ 214 void prepareToolBar(); 215 /** Prepares right pane. */ 216 void prepareRightPane(); 217 /** Prepares empty widget. */ 218 void prepareEmptyWidget(); 219 /** Prepares controller widget. */ 220 void prepareControllerWidget(); 221 /** Prepares attachment widget. */ 222 void prepareAttachmentWidget(); 217 223 /** Prepares connections. */ 218 224 void prepareConnections(); … … 276 282 QString m_strMachineGuestOSTypeId; 277 283 278 /** Holds the storage-tree instance. */279 QITreeView *m_pTreeStorage;280 284 /** Holds the storage-model instance. */ 281 285 StorageModel *m_pModelStorage; … … 302 306 UIMediumIDHolder *m_pMediumIdHolder; 303 307 304 /** Holds whether the page is polished. */305 bool m_fPolished;306 308 /** Holds whether the loading is in progress. */ 307 309 bool m_fLoadingInProgress; … … 312 314 /** Holds the page data cache instance. */ 313 315 UISettingsCacheMachineStorage *m_pCache; 316 314 317 /** @name Widgets 315 318 * @{ */ 316 QILabelSeparator *m_pLabelSeparatorLeftPane; 317 QILabelSeparator *m_pLabelSeparatorEmpty; 318 QILabelSeparator *m_pLabelSeparatorParameters; 319 QILabelSeparator *m_pLabelSeparatorAttributes; 320 QILabelSeparator *m_pLabelSeparatorInformation; 321 QLabel *m_pLabelInfo; 322 QLabel *m_pLabelName; 323 QLabel *m_pLabelType; 324 QLabel *m_pLabelPortCount; 325 QLabel *m_pLabelHDFormat; 326 QLabel *m_pLabelCDFDType; 327 QLabel *m_pLabelHDVirtualSize; 328 QLabel *m_pLabelHDActualSize; 329 QLabel *m_pLabelSize; 330 QLabel *m_pLabelHDDetails; 331 QLabel *m_pLabelLocation; 332 QLabel *m_pLabelUsage; 333 QLabel *m_pLabelEncryption; 334 QLabel *m_pLabelMedium; 335 QILabel *m_pLabelHDFormatValue; 336 QILabel *m_pLabelCDFDTypeValue; 337 QILabel *m_pLabelHDVirtualSizeValue; 338 QILabel *m_pLabelHDActualSizeValue; 339 QILabel *m_pLabelSizeValue; 340 QILabel *m_pLabelHDDetailsValue; 341 QILabel *m_pLabelLocationValue; 342 QILabel *m_pLabelUsageValue; 343 QILabel *m_pLabelEncryptionValue; 344 QLineEdit *m_pLineEditName; 345 QComboBox *m_pComboBoxType; 346 QComboBox *m_pComboBoxSlot; 347 QSpinBox *m_pSpinBoxPortCount; 348 QCheckBox *m_pCheckBoxIoCache; 349 QCheckBox *m_pCheckBoxPassthrough; 350 QCheckBox *m_pCheckBoxTempEject; 351 QCheckBox *m_pCheckBoxNonRotational; 352 QCheckBox *m_pCheckBoxHotPluggable; 353 QIToolButton *m_pToolButtonOpen; 354 UIToolBar *m_pToolBarStorageBar; 355 QGridLayout *m_pLayoutController; 356 QGridLayout *m_pLayoutEmpty; 357 QGridLayout *m_pLayoutAttachment; 358 QStackedWidget *mSwRightPane; 359 QVBoxLayout *m_pLayoutStorage; 360 QISplitter *m_pSplitter; 319 /** Holds the splitter instance. */ 320 QISplitter *m_pSplitter; 321 /** Holds the left pane instance. */ 322 QWidget *m_pWidgetLeftPane; 323 /** Holds the left pane separator instance. */ 324 QILabelSeparator *m_pLabelSeparatorLeftPane; 325 /** Holds the tree-view layout instance. */ 326 QVBoxLayout *m_pLayoutTreeView; 327 /** Holds the tree-view instance. */ 328 QITreeView *m_pTreeStorage; 329 /** Holds the toolbar layout instance. */ 330 QHBoxLayout *m_pLayoutToolBar; 331 /** Holds the tree-view instance. */ 332 UIToolBar *m_pToolBar; 333 334 /** Holds the right pane instance. */ 335 QStackedWidget *m_pStackRightPane; 336 /** Holds the right pane empty widget separator instance. */ 337 QILabelSeparator *m_pLabelSeparatorEmpty; 338 /** Holds the info label instance. */ 339 QLabel *m_pLabelInfo; 340 /** Holds the right pane controller widget separator instance. */ 341 QILabelSeparator *m_pLabelSeparatorParameters; 342 /** Holds the name label instance. */ 343 QLabel *m_pLabelName; 344 /** Holds the name editor instance. */ 345 QLineEdit *m_pEditorName; 346 /** Holds the type label instance. */ 347 QLabel *m_pLabelType; 348 /** Holds the type combo instance. */ 349 QComboBox *m_pComboType; 350 /** Holds the port count label instance. */ 351 QLabel *m_pLabelPortCount; 352 /** Holds the port count spinbox instance. */ 353 QSpinBox *m_pSpinBoxPortCount; 354 /** Holds the IO cache check-box instance. */ 355 QCheckBox *m_pCheckBoxIoCache; 356 /** Holds the right pane attachment widget separator instance. */ 357 QILabelSeparator *m_pLabelSeparatorAttributes; 358 /** Holds the medium label instance. */ 359 QLabel *m_pLabelMedium; 360 /** Holds the slot combo instance. */ 361 QComboBox *m_pComboSlot; 362 /** Holds the open tool-button instance. */ 363 QIToolButton *m_pToolButtonOpen; 364 /** Holds the passthrough check-box instance. */ 365 QCheckBox *m_pCheckBoxPassthrough; 366 /** Holds the temporary eject check-box instance. */ 367 QCheckBox *m_pCheckBoxTempEject; 368 /** Holds the non-rotational check-box instance. */ 369 QCheckBox *m_pCheckBoxNonRotational; 370 /** Holds the hot-pluggable check-box instance. */ 371 QCheckBox *m_pCheckBoxHotPluggable; 372 /** Holds the right pane attachment widget separator instance. */ 373 QILabelSeparator *m_pLabelSeparatorInformation; 374 /** Holds the HD format label instance. */ 375 QLabel *m_pLabelHDFormat; 376 /** Holds the HD format field instance. */ 377 QILabel *m_pFieldHDFormat; 378 /** Holds the CD/FD type label instance. */ 379 QLabel *m_pLabelCDFDType; 380 /** Holds the CD/FD type field instance. */ 381 QILabel *m_pFieldCDFDType; 382 /** Holds the HD virtual size label instance. */ 383 QLabel *m_pLabelHDVirtualSize; 384 /** Holds the HD virtual size field instance. */ 385 QILabel *m_pFieldHDVirtualSize; 386 /** Holds the HD actual size label instance. */ 387 QLabel *m_pLabelHDActualSize; 388 /** Holds the HD actual size field instance. */ 389 QILabel *m_pFieldHDActualSize; 390 /** Holds the CD/FD size label instance. */ 391 QLabel *m_pLabelCDFDSize; 392 /** Holds the CD/FD size field instance. */ 393 QILabel *m_pFieldCDFDSize; 394 /** Holds the HD details label instance. */ 395 QLabel *m_pLabelHDDetails; 396 /** Holds the HD details field instance. */ 397 QILabel *m_pFieldHDDetails; 398 /** Holds the location label instance. */ 399 QLabel *m_pLabelLocation; 400 /** Holds the location field instance. */ 401 QILabel *m_pFieldLocation; 402 /** Holds the usage label instance. */ 403 QLabel *m_pLabelUsage; 404 /** Holds the usage field instance. */ 405 QILabel *m_pFieldUsage; 406 /** Holds the encryption label instance. */ 407 QLabel *m_pLabelEncryption; 408 /** Holds the encryption field instance. */ 409 QILabel *m_pFieldEncryption; 361 410 /** @} */ 362 411 };
Note:
See TracChangeset
for help on using the changeset viewer.

