Changeset 85711 in vbox for trunk/src/VBox/Frontends
- Timestamp:
- Aug 12, 2020 11:48:02 AM (4 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/VBoxUI.pro
r85710 r85711 34 34 src/settings/machine/UIMachineSettingsGeneral.ui \ 35 35 src/settings/machine/UIMachineSettingsSystem.ui \ 36 src/settings/machine/UIMachineSettingsStorage.ui \37 36 src/settings/machine/UIMachineSettingsNetwork.ui \ 38 37 src/settings/machine/UIMachineSettingsSerial.ui \ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/UISettingsDialogSpecific.cpp
r84790 r85711 15 15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind. 16 16 */ 17 18 /* Qt includes: */ 19 #include <QStackedWidget> 17 20 18 21 /* GUI includes: */ -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.cpp
r83371 r85711 17 17 18 18 /* Qt includes: */ 19 #include <QCheckBox> 20 #include <QComboBox> 19 21 #include <QCommonStyle> 20 22 #include <QDrag> 21 23 #include <QDragMoveEvent> 24 #include <QGridLayout> 22 25 #include <QItemDelegate> 26 #include <QLabel> 27 #include <QLineEdit> 23 28 #include <QMenu> 24 29 #include <QMimeData> 25 30 #include <QMouseEvent> 26 31 #include <QPainter> 32 #include <QSpinBox> 33 #include <QStackedWidget> 34 #include <QVBoxLayout> 27 35 28 36 /* GUI includes: */ 37 #include "QILabel.h" 38 #include "QILabelSeparator.h" 39 #include "QIToolButton.h" 29 40 #include "QITreeView.h" 41 #include "QISplitter.h" 30 42 #include "UICommon.h" 31 43 #include "UIConverter.h" … … 37 49 #include "UIMediumSelector.h" 38 50 #include "UIMessageCenter.h" 51 #include "UIToolBar.h" 39 52 40 53 /* COM includes: */ … … 2939 2952 , m_fLoadingInProgress(0) 2940 2953 , m_pCache(0) 2954 , m_pLabelSeparatorLeftPane(0) 2955 , m_pLabelSeparatorEmpty(0) 2956 , m_pLabelSeparatorParameters(0) 2957 , m_pLabelSeparatorAttributes(0) 2958 , m_pLabelSeparatorInformation(0) 2959 , m_pLabelInfo(0) 2960 , m_pLabelName(0) 2961 , m_pLabelType(0) 2962 , 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 , m_pSpinBoxPortCount(0) 2986 , m_pCheckBoxIoCache(0) 2987 , m_pCheckBoxPassthrough(0) 2988 , m_pCheckBoxTempEject(0) 2989 , m_pCheckBoxNonRotational(0) 2990 , 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) 2941 2999 { 2942 3000 /* Prepare: */ … … 3290 3348 void UIMachineSettingsStorage::retranslateUi() 3291 3349 { 3292 /* Translate uic generated strings: */ 3293 Ui::UIMachineSettingsStorage::retranslateUi(this); 3350 m_pLabelSeparatorLeftPane->setText(tr("&Storage Devices")); 3351 m_pLabelSeparatorEmpty->setText(tr("Information")); 3352 m_pLabelInfo->setText(tr("The Storage Tree can contain several controllers of different types. This machine currently has no controllers.")); 3353 m_pLabelSeparatorParameters->setText(tr("Attributes")); 3354 m_pLabelName->setText(tr("&Name:")); 3355 m_pLineEditName->setWhatsThis(tr("Holds the name of the storage controller currently selected in the Storage Tree.")); 3356 m_pLabelType->setText(tr("&Type:")); 3357 m_pComboBoxType->setWhatsThis(tr("Selects the sub-type of the storage controller currently selected in the Storage Tree.")); 3358 m_pLabelPortCount->setText(tr("&Port Count:")); 3359 m_pSpinBoxPortCount->setWhatsThis(tr("Selects the port count of the SATA storage controller currently selected in the" 3360 "Storage Tree. This must be at least one more than the highest port number you need to use.")); 3361 m_pCheckBoxIoCache->setWhatsThis(tr("When checked, allows to use host I/O caching capabilities.")); 3362 m_pCheckBoxIoCache->setText(tr("Use Host I/O Cache")); 3363 m_pLabelSeparatorAttributes->setText(tr("Attributes")); 3364 m_pComboBoxSlot->setWhatsThis(tr("Selects the slot on the storage controller used by this attachment. The available slots depend" 3365 "on the type of the controller and other attachments on it.")); 3366 m_pToolButtonOpen->setText(QString()); 3367 m_pCheckBoxPassthrough->setWhatsThis(tr("When checked, allows the guest to send ATAPI commands directly to the host-drive" 3368 "which makes it possible to use CD/DVD writers connected to the host inside the VM." 3369 "Note that writing audio CD inside the VM is not yet supported.")); 3370 m_pCheckBoxPassthrough->setText(tr("&Passthrough")); 3371 m_pCheckBoxTempEject->setWhatsThis(tr("When checked, the virtual disk will not be removed when the guest system ejects it.")); 3372 m_pCheckBoxTempEject->setText(tr("&Live CD/DVD")); 3373 m_pCheckBoxNonRotational->setWhatsThis(tr("When checked, the guest system will see the virtual disk as a solid-state device.")); 3374 m_pCheckBoxNonRotational->setText(tr("&Solid-state Drive")); 3375 m_pCheckBoxHotPluggable->setWhatsThis(tr("When checked, the guest system will see the virtual disk as a hot-pluggable device.")); 3376 m_pCheckBoxHotPluggable->setText(tr("&Hot-pluggable")); 3377 m_pLabelSeparatorInformation->setText(tr("Information")); 3378 m_pLabelHDFormat->setText(tr("Type (Format):")); 3379 m_pLabelCDFDType->setText(tr("Type:")); 3380 m_pLabelHDVirtualSize->setText(tr("Virtual Size:")); 3381 m_pLabelHDActualSize->setText(tr("Actual Size:")); 3382 m_pLabelSize->setText(tr("Size:")); 3383 m_pLabelHDDetails->setText(tr("Details:")); 3384 m_pLabelLocation->setText(tr("Location:")); 3385 m_pLabelUsage->setText(tr("Attached to:")); 3386 m_pLabelEncryption->setText(tr("Encrypted with key:")); 3294 3387 3295 3388 /* Translate storage-view: */ … … 3340 3433 3341 3434 /* Polish left pane availability: */ 3342 m LsLeftPane->setEnabled(isMachineInValidMode());3435 m_pLabelSeparatorLeftPane->setEnabled(isMachineInValidMode()); 3343 3436 m_pTreeStorage->setEnabled(isMachineInValidMode()); 3344 3437 3345 3438 /* Polish empty information pane availability: */ 3346 m LsEmpty->setEnabled(isMachineInValidMode());3347 m LbInfo->setEnabled(isMachineInValidMode());3439 m_pLabelSeparatorEmpty->setEnabled(isMachineInValidMode()); 3440 m_pLabelInfo->setEnabled(isMachineInValidMode()); 3348 3441 3349 3442 /* Polish controllers pane availability: */ 3350 m LsParameters->setEnabled(isMachineInValidMode());3351 m LbName->setEnabled(isMachineOffline());3352 m LeName->setEnabled(isMachineOffline());3353 m LbType->setEnabled(isMachineOffline());3354 m CbType->setEnabled(isMachineOffline());3355 m LbPortCount->setEnabled(isMachineOffline());3356 m SbPortCount->setEnabled(isMachineOffline());3357 m CbIoCache->setEnabled(isMachineOffline());3443 m_pLabelSeparatorParameters->setEnabled(isMachineInValidMode()); 3444 m_pLabelName->setEnabled(isMachineOffline()); 3445 m_pLineEditName->setEnabled(isMachineOffline()); 3446 m_pLabelType->setEnabled(isMachineOffline()); 3447 m_pComboBoxType->setEnabled(isMachineOffline()); 3448 m_pLabelPortCount->setEnabled(isMachineOffline()); 3449 m_pSpinBoxPortCount->setEnabled(isMachineOffline()); 3450 m_pCheckBoxIoCache->setEnabled(isMachineOffline()); 3358 3451 3359 3452 /* Polish attachments pane availability: */ 3360 m LsAttributes->setEnabled(isMachineInValidMode());3361 m LbMedium->setEnabled(isMachineOffline() || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk));3362 m CbSlot->setEnabled(isMachineOffline());3363 m TbOpen->setEnabled(isMachineOffline() || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk));3364 m CbPassthrough->setEnabled(isMachineOffline());3365 m CbTempEject->setEnabled(isMachineInValidMode());3366 m CbNonRotational->setEnabled(isMachineOffline());3453 m_pLabelSeparatorAttributes->setEnabled(isMachineInValidMode()); 3454 m_pLabelMedium->setEnabled(isMachineOffline() || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk)); 3455 m_pComboBoxSlot->setEnabled(isMachineOffline()); 3456 m_pToolButtonOpen->setEnabled(isMachineOffline() || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk)); 3457 m_pCheckBoxPassthrough->setEnabled(isMachineOffline()); 3458 m_pCheckBoxTempEject->setEnabled(isMachineInValidMode()); 3459 m_pCheckBoxNonRotational->setEnabled(isMachineOffline()); 3367 3460 m_pCheckBoxHotPluggable->setEnabled(isMachineOffline()); 3368 m LsInformation->setEnabled(isMachineInValidMode());3369 m LbHDFormat->setEnabled(isMachineInValidMode());3370 m LbHDFormatValue->setEnabled(isMachineInValidMode());3371 m LbCDFDType->setEnabled(isMachineInValidMode());3372 m LbCDFDTypeValue->setEnabled(isMachineInValidMode());3373 m LbHDVirtualSize->setEnabled(isMachineInValidMode());3374 m LbHDVirtualSizeValue->setEnabled(isMachineInValidMode());3375 m LbHDActualSize->setEnabled(isMachineInValidMode());3376 m LbHDActualSizeValue->setEnabled(isMachineInValidMode());3377 m LbSize->setEnabled(isMachineInValidMode());3378 m LbSizeValue->setEnabled(isMachineInValidMode());3379 m LbHDDetails->setEnabled(isMachineInValidMode());3380 m LbHDDetailsValue->setEnabled(isMachineInValidMode());3381 m LbLocation->setEnabled(isMachineInValidMode());3382 m LbLocationValue->setEnabled(isMachineInValidMode());3383 m LbUsage->setEnabled(isMachineInValidMode());3384 m LbUsageValue->setEnabled(isMachineInValidMode());3461 m_pLabelSeparatorInformation->setEnabled(isMachineInValidMode()); 3462 m_pLabelHDFormat->setEnabled(isMachineInValidMode()); 3463 m_pLabelHDFormatValue->setEnabled(isMachineInValidMode()); 3464 m_pLabelCDFDType->setEnabled(isMachineInValidMode()); 3465 m_pLabelCDFDTypeValue->setEnabled(isMachineInValidMode()); 3466 m_pLabelHDVirtualSize->setEnabled(isMachineInValidMode()); 3467 m_pLabelHDVirtualSizeValue->setEnabled(isMachineInValidMode()); 3468 m_pLabelHDActualSize->setEnabled(isMachineInValidMode()); 3469 m_pLabelHDActualSizeValue->setEnabled(isMachineInValidMode()); 3470 m_pLabelSize->setEnabled(isMachineInValidMode()); 3471 m_pLabelSizeValue->setEnabled(isMachineInValidMode()); 3472 m_pLabelHDDetails->setEnabled(isMachineInValidMode()); 3473 m_pLabelHDDetailsValue->setEnabled(isMachineInValidMode()); 3474 m_pLabelLocation->setEnabled(isMachineInValidMode()); 3475 m_pLabelLocationValue->setEnabled(isMachineInValidMode()); 3476 m_pLabelUsage->setEnabled(isMachineInValidMode()); 3477 m_pLabelUsageValue->setEnabled(isMachineInValidMode()); 3385 3478 m_pLabelEncryption->setEnabled(isMachineInValidMode()); 3386 3479 m_pLabelEncryptionValue->setEnabled(isMachineInValidMode()); … … 3397 3490 3398 3491 /* First column indent: */ 3399 m LtEmpty->setColumnMinimumWidth(0, 10);3400 m LtController->setColumnMinimumWidth(0, 10);3401 m LtAttachment->setColumnMinimumWidth(0, 10);3492 m_pLayoutEmpty->setColumnMinimumWidth(0, 10); 3493 m_pLayoutController->setColumnMinimumWidth(0, 10); 3494 m_pLayoutAttachment->setColumnMinimumWidth(0, 10); 3402 3495 #if 0 3403 3496 /* Second column indent minimum width: */ 3404 3497 QList <QLabel*> labelsList; 3405 labelsList << m LbMedium << mLbHDFormat << mLbCDFDType3406 << m LbHDVirtualSize << mLbHDActualSize << mLbSize3407 << m LbLocation << mLbUsage;3498 labelsList << m_pLabelMedium << m_pLabelHDFormat << m_pLabelCDFDType 3499 << m_pLabelHDVirtualSize << m_pLabelHDActualSize << m_pLabelSize 3500 << m_pLabelLocation << m_pLabelUsage; 3408 3501 int maxWidth = 0; 3409 3502 QFontMetrics metrics(font()); … … 3413 3506 maxWidth = iWidth > maxWidth ? iWidth : maxWidth; 3414 3507 } 3415 m LtAttachment->setColumnMinimumWidth(1, maxWidth);3508 m_pLayoutAttachment->setColumnMinimumWidth(1, maxWidth); 3416 3509 #endif 3417 3510 } … … 3653 3746 /* Getting Controller Name: */ 3654 3747 const QString strCtrName = m_pModelStorage->data(index, StorageModel::R_CtrName).toString(); 3655 if (m LeName->text() != strCtrName)3656 m LeName->setText(strCtrName);3748 if (m_pLineEditName->text() != strCtrName) 3749 m_pLineEditName->setText(strCtrName); 3657 3750 3658 3751 /* Rebuild type combo: */ 3659 m CbType->clear();3752 m_pComboBoxType->clear(); 3660 3753 /* Getting controller buses: */ 3661 3754 const ControllerBusList controllerBusList(m_pModelStorage->data(index, StorageModel::R_CtrBusTypes).value<ControllerBusList>()); … … 3666 3759 foreach (const KStorageControllerType &enmCurrentType, controllerTypeList) 3667 3760 { 3668 m CbType->addItem(gpConverter->toString(enmCurrentType));3669 m CbType->setItemData(mCbType->count() - 1, QVariant::fromValue(enmCurrentBus), StorageModel::R_CtrBusType);3670 m CbType->setItemData(mCbType->count() - 1, QVariant::fromValue(enmCurrentType), StorageModel::R_CtrType);3761 m_pComboBoxType->addItem(gpConverter->toString(enmCurrentType)); 3762 m_pComboBoxType->setItemData(m_pComboBoxType->count() - 1, QVariant::fromValue(enmCurrentBus), StorageModel::R_CtrBusType); 3763 m_pComboBoxType->setItemData(m_pComboBoxType->count() - 1, QVariant::fromValue(enmCurrentType), StorageModel::R_CtrType); 3671 3764 } 3672 3765 } 3673 3766 const KStorageControllerType enmType = m_pModelStorage->data(index, StorageModel::R_CtrType).value<KStorageControllerType>(); 3674 const int iCtrPos = m CbType->findData(enmType, StorageModel::R_CtrType);3675 m CbType->setCurrentIndex(iCtrPos == -1 ? 0 : iCtrPos);3767 const int iCtrPos = m_pComboBoxType->findData(enmType, StorageModel::R_CtrType); 3768 m_pComboBoxType->setCurrentIndex(iCtrPos == -1 ? 0 : iCtrPos); 3676 3769 3677 3770 const KStorageBus enmBus = m_pModelStorage->data(index, StorageModel::R_CtrBusType).value<KStorageBus>(); 3678 m LbPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS);3679 m SbPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS);3771 m_pLabelPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS); 3772 m_pSpinBoxPortCount->setVisible(enmBus == KStorageBus_SATA || enmBus == KStorageBus_SAS); 3680 3773 const uint uPortCount = m_pModelStorage->data(index, StorageModel::R_CtrPortCount).toUInt(); 3681 3774 const uint uMaxPortCount = m_pModelStorage->data(index, StorageModel::R_CtrMaxPortCount).toUInt(); 3682 m SbPortCount->setMaximum(uMaxPortCount);3683 m SbPortCount->setValue(uPortCount);3775 m_pSpinBoxPortCount->setMaximum(uMaxPortCount); 3776 m_pSpinBoxPortCount->setValue(uPortCount); 3684 3777 3685 3778 const bool fUseIoCache = m_pModelStorage->data(index, StorageModel::R_CtrIoCache).toBool(); 3686 m CbIoCache->setChecked(fUseIoCache);3779 m_pCheckBoxIoCache->setChecked(fUseIoCache); 3687 3780 3688 3781 /* Showing Controller Page: */ … … 3693 3786 { 3694 3787 /* Getting Attachment Slot: */ 3695 m CbSlot->clear();3788 m_pComboBoxSlot->clear(); 3696 3789 const SlotsList slotsList(m_pModelStorage->data(index, StorageModel::R_AttSlots).value<SlotsList>()); 3697 3790 for (int i = 0; i < slotsList.size(); ++i) 3698 m CbSlot->insertItem(mCbSlot->count(), gpConverter->toString(slotsList[i]));3791 m_pComboBoxSlot->insertItem(m_pComboBoxSlot->count(), gpConverter->toString(slotsList[i])); 3699 3792 const StorageSlot slt = m_pModelStorage->data(index, StorageModel::R_AttSlot).value<StorageSlot>(); 3700 const int iAttSlotPos = m CbSlot->findText(gpConverter->toString(slt));3701 m CbSlot->setCurrentIndex(iAttSlotPos == -1 ? 0 : iAttSlotPos);3702 m CbSlot->setToolTip(mCbSlot->itemText(mCbSlot->currentIndex()));3793 const int iAttSlotPos = m_pComboBoxSlot->findText(gpConverter->toString(slt)); 3794 m_pComboBoxSlot->setCurrentIndex(iAttSlotPos == -1 ? 0 : iAttSlotPos); 3795 m_pComboBoxSlot->setToolTip(m_pComboBoxSlot->itemText(m_pComboBoxSlot->currentIndex())); 3703 3796 3704 3797 /* Getting Attachment Medium: */ … … 3707 3800 { 3708 3801 case KDeviceType_HardDisk: 3709 m LbMedium->setText(tr("Hard &Disk:"));3710 m TbOpen->setIcon(iconPool()->icon(HDAttachmentNormal));3711 m TbOpen->setWhatsThis(tr("Choose or create a virtual hard disk file. The virtual machine will see "3802 m_pLabelMedium->setText(tr("Hard &Disk:")); 3803 m_pToolButtonOpen->setIcon(iconPool()->icon(HDAttachmentNormal)); 3804 m_pToolButtonOpen->setWhatsThis(tr("Choose or create a virtual hard disk file. The virtual machine will see " 3712 3805 "the data in the file as the contents of the virtual hard disk.")); 3713 3806 break; 3714 3807 case KDeviceType_DVD: 3715 m LbMedium->setText(tr("Optical &Drive:"));3716 m TbOpen->setIcon(iconPool()->icon(CDAttachmentNormal));3717 m TbOpen->setWhatsThis(tr("Choose a virtual optical disk or a physical drive to use with the virtual drive. "3808 m_pLabelMedium->setText(tr("Optical &Drive:")); 3809 m_pToolButtonOpen->setIcon(iconPool()->icon(CDAttachmentNormal)); 3810 m_pToolButtonOpen->setWhatsThis(tr("Choose a virtual optical disk or a physical drive to use with the virtual drive. " 3718 3811 "The virtual machine will see a disk inserted into the drive with the data " 3719 3812 "in the file or on the disk in the physical drive as its contents.")); 3720 3813 break; 3721 3814 case KDeviceType_Floppy: 3722 m LbMedium->setText(tr("Floppy &Drive:"));3723 m TbOpen->setIcon(iconPool()->icon(FDAttachmentNormal));3724 m TbOpen->setWhatsThis(tr("Choose a virtual floppy disk or a physical drive to use with the virtual drive. "3815 m_pLabelMedium->setText(tr("Floppy &Drive:")); 3816 m_pToolButtonOpen->setIcon(iconPool()->icon(FDAttachmentNormal)); 3817 m_pToolButtonOpen->setWhatsThis(tr("Choose a virtual floppy disk or a physical drive to use with the virtual drive. " 3725 3818 "The virtual machine will see a disk inserted into the drive with the data " 3726 3819 "in the file or on the disk in the physical drive as its contents.")); … … 3741 3834 || (isMachineOnline() && enmDeviceType != KDeviceType_HardDisk) 3742 3835 || (isMachineOnline() && enmDeviceType == KDeviceType_HardDisk && fIsHotPluggable); 3743 m LbMedium->setEnabled(fIsEditable);3744 m TbOpen->setEnabled(fIsEditable);3836 m_pLabelMedium->setEnabled(fIsEditable); 3837 m_pToolButtonOpen->setEnabled(fIsEditable); 3745 3838 3746 3839 /* Getting Passthrough state: */ 3747 3840 const bool fHostDrive = m_pModelStorage->data(index, StorageModel::R_AttIsHostDrive).toBool(); 3748 m CbPassthrough->setVisible(enmDeviceType == KDeviceType_DVD && fHostDrive);3749 m CbPassthrough->setChecked(fHostDrive && m_pModelStorage->data(index, StorageModel::R_AttIsPassthrough).toBool());3841 m_pCheckBoxPassthrough->setVisible(enmDeviceType == KDeviceType_DVD && fHostDrive); 3842 m_pCheckBoxPassthrough->setChecked(fHostDrive && m_pModelStorage->data(index, StorageModel::R_AttIsPassthrough).toBool()); 3750 3843 3751 3844 /* Getting TempEject state: */ 3752 m CbTempEject->setVisible(enmDeviceType == KDeviceType_DVD && !fHostDrive);3753 m CbTempEject->setChecked(!fHostDrive && m_pModelStorage->data(index, StorageModel::R_AttIsTempEject).toBool());3845 m_pCheckBoxTempEject->setVisible(enmDeviceType == KDeviceType_DVD && !fHostDrive); 3846 m_pCheckBoxTempEject->setChecked(!fHostDrive && m_pModelStorage->data(index, StorageModel::R_AttIsTempEject).toBool()); 3754 3847 3755 3848 /* Getting NonRotational state: */ 3756 m CbNonRotational->setVisible(enmDeviceType == KDeviceType_HardDisk);3757 m CbNonRotational->setChecked(m_pModelStorage->data(index, StorageModel::R_AttIsNonRotational).toBool());3849 m_pCheckBoxNonRotational->setVisible(enmDeviceType == KDeviceType_HardDisk); 3850 m_pCheckBoxNonRotational->setChecked(m_pModelStorage->data(index, StorageModel::R_AttIsNonRotational).toBool()); 3758 3851 3759 3852 /* Fetch hot-pluggable state: */ … … 3765 3858 3766 3859 /* Getting Other Information: */ 3767 m LbHDFormatValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString()));3768 m LbCDFDTypeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString()));3769 m LbHDVirtualSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLogicalSize).toString()));3770 m LbHDActualSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString()));3771 m LbSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString()));3772 m LbHDDetailsValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttDetails).toString()));3773 m LbLocationValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLocation).toString()));3774 m LbUsageValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttUsage).toString()));3860 m_pLabelHDFormatValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString())); 3861 m_pLabelCDFDTypeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttFormat).toString())); 3862 m_pLabelHDVirtualSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLogicalSize).toString())); 3863 m_pLabelHDActualSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString())); 3864 m_pLabelSizeValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttSize).toString())); 3865 m_pLabelHDDetailsValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttDetails).toString())); 3866 m_pLabelLocationValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttLocation).toString())); 3867 m_pLabelUsageValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttUsage).toString())); 3775 3868 m_pLabelEncryptionValue->setText(compressText(m_pModelStorage->data(index, StorageModel::R_AttEncryptionPasswordID).toString())); 3776 3869 … … 3802 3895 { 3803 3896 /* Setting Controller Name: */ 3804 if (pSender == m LeName)3805 m_pModelStorage->setData(index, m LeName->text(), StorageModel::R_CtrName);3897 if (pSender == m_pLineEditName) 3898 m_pModelStorage->setData(index, m_pLineEditName->text(), StorageModel::R_CtrName); 3806 3899 /* Setting Controller Sub-Type: */ 3807 else if (pSender == m CbType)3900 else if (pSender == m_pComboBoxType) 3808 3901 { 3809 3902 const bool fResult = 3810 3903 m_pModelStorage->setData(index, 3811 QVariant::fromValue(m CbType->currentData(StorageModel::R_CtrBusType).value<KStorageBus>()),3904 QVariant::fromValue(m_pComboBoxType->currentData(StorageModel::R_CtrBusType).value<KStorageBus>()), 3812 3905 StorageModel::R_CtrBusType); 3813 3906 if (fResult) 3814 3907 m_pModelStorage->setData(index, 3815 QVariant::fromValue(m CbType->currentData(StorageModel::R_CtrType).value<KStorageControllerType>()),3908 QVariant::fromValue(m_pComboBoxType->currentData(StorageModel::R_CtrType).value<KStorageControllerType>()), 3816 3909 StorageModel::R_CtrType); 3817 3910 } 3818 else if (pSender == m SbPortCount)3819 m_pModelStorage->setData(index, m SbPortCount->value(), StorageModel::R_CtrPortCount);3820 else if (pSender == m CbIoCache)3821 m_pModelStorage->setData(index, m CbIoCache->isChecked(), StorageModel::R_CtrIoCache);3911 else if (pSender == m_pSpinBoxPortCount) 3912 m_pModelStorage->setData(index, m_pSpinBoxPortCount->value(), StorageModel::R_CtrPortCount); 3913 else if (pSender == m_pCheckBoxIoCache) 3914 m_pModelStorage->setData(index, m_pCheckBoxIoCache->isChecked(), StorageModel::R_CtrIoCache); 3822 3915 break; 3823 3916 } … … 3825 3918 { 3826 3919 /* Setting Attachment Slot: */ 3827 if (pSender == m CbSlot)3920 if (pSender == m_pComboBoxSlot) 3828 3921 { 3829 3922 QModelIndex controllerIndex = m_pModelStorage->parent(index); 3830 StorageSlot attachmentStorageSlot = gpConverter->fromString<StorageSlot>(m CbSlot->currentText());3923 StorageSlot attachmentStorageSlot = gpConverter->fromString<StorageSlot>(m_pComboBoxSlot->currentText()); 3831 3924 m_pModelStorage->setData(index, QVariant::fromValue(attachmentStorageSlot), StorageModel::R_AttSlot); 3832 3925 QModelIndex theSameIndexAtNewPosition = m_pModelStorage->attachmentBySlot(controllerIndex, attachmentStorageSlot); … … 3837 3930 else if (pSender == m_pMediumIdHolder) 3838 3931 m_pModelStorage->setData(index, m_pMediumIdHolder->id(), StorageModel::R_AttMediumId); 3839 else if (pSender == m CbPassthrough)3932 else if (pSender == m_pCheckBoxPassthrough) 3840 3933 { 3841 3934 if (m_pModelStorage->data(index, StorageModel::R_AttIsHostDrive).toBool()) 3842 m_pModelStorage->setData(index, m CbPassthrough->isChecked(), StorageModel::R_AttIsPassthrough);3935 m_pModelStorage->setData(index, m_pCheckBoxPassthrough->isChecked(), StorageModel::R_AttIsPassthrough); 3843 3936 } 3844 else if (pSender == m CbTempEject)3937 else if (pSender == m_pCheckBoxTempEject) 3845 3938 { 3846 3939 if (!m_pModelStorage->data(index, StorageModel::R_AttIsHostDrive).toBool()) 3847 m_pModelStorage->setData(index, m CbTempEject->isChecked(), StorageModel::R_AttIsTempEject);3940 m_pModelStorage->setData(index, m_pCheckBoxTempEject->isChecked(), StorageModel::R_AttIsTempEject); 3848 3941 } 3849 else if (pSender == m CbNonRotational)3942 else if (pSender == m_pCheckBoxNonRotational) 3850 3943 { 3851 m_pModelStorage->setData(index, m CbNonRotational->isChecked(), StorageModel::R_AttIsNonRotational);3944 m_pModelStorage->setData(index, m_pCheckBoxNonRotational->isChecked(), StorageModel::R_AttIsNonRotational); 3852 3945 } 3853 3946 else if (pSender == m_pCheckBoxHotPluggable) … … 4418 4511 void UIMachineSettingsStorage::prepare() 4419 4512 { 4420 /* Apply UI decorations: */ 4421 Ui::UIMachineSettingsStorage::setupUi(this); 4513 prepareWidgets(); 4422 4514 4423 4515 /* Prepare cache: */ … … 4432 4524 uiCommon().enumerateMedia(); 4433 4525 4434 /* Layout created in the .ui file. */ 4435 AssertPtrReturnVoid(mLtStorage); 4526 AssertPtrReturnVoid(m_pLayoutStorage); 4436 4527 { 4437 4528 #ifdef VBOX_WS_MAC 4438 4529 /* We need a little more space for the focus rect: */ 4439 m LtStorage->setContentsMargins(3, 0, 3, 0);4440 m LtStorage->setSpacing(3);4530 m_pLayoutStorage->setContentsMargins(3, 0, 3, 0); 4531 m_pLayoutStorage->setSpacing(3); 4441 4532 #else 4442 m LtStorage->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3);4533 m_pLayoutStorage->setSpacing(qApp->style()->pixelMetric(QStyle::PM_LayoutVerticalSpacing) / 3); 4443 4534 #endif 4444 4535 … … 4458 4549 /* Initial setup (after first retranslateUi() call): */ 4459 4550 setMinimumWidth(500); 4460 mSplitter->setSizes(QList<int>() << (int)(0.45 * minimumWidth()) << (int)(0.55 * minimumWidth())); 4551 m_pSplitter->setSizes(QList<int>() << (int)(0.45 * minimumWidth()) << (int)(0.55 * minimumWidth())); 4552 } 4553 4554 void UIMachineSettingsStorage::prepareWidgets() 4555 { 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); 4461 4858 } 4462 4859 … … 4466 4863 m_pTreeStorage = new QITreeView; 4467 4864 AssertPtrReturnVoid(m_pTreeStorage); 4468 AssertPtrReturnVoid(m LsLeftPane);4865 AssertPtrReturnVoid(m_pLabelSeparatorLeftPane); 4469 4866 { 4470 4867 /* Configure tree-view: */ 4471 m LsLeftPane->setBuddy(m_pTreeStorage);4868 m_pLabelSeparatorLeftPane->setBuddy(m_pTreeStorage); 4472 4869 m_pTreeStorage->setMouseTracking(true); 4473 4870 m_pTreeStorage->setAcceptDrops(true); … … 4493 4890 4494 4891 /* Insert tree-view into layout: */ 4495 m LtStorage->insertWidget(0, m_pTreeStorage);4892 m_pLayoutStorage->insertWidget(0, m_pTreeStorage); 4496 4893 } 4497 4894 } … … 4499 4896 void UIMachineSettingsStorage::prepareStorageToolbar() 4500 4897 { 4501 /* Storage toolbar created in the .ui file. */ 4502 AssertPtrReturnVoid(mTbStorageBar); 4898 AssertPtrReturnVoid(m_pToolBarStorageBar); 4503 4899 { 4504 4900 /* Configure toolbar: */ 4505 4901 const int iIconMetric = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); 4506 m TbStorageBar->setIconSize(QSize(iIconMetric, iIconMetric));4902 m_pToolBarStorageBar->setIconSize(QSize(iIconMetric, iIconMetric)); 4507 4903 4508 4904 /* Create 'Add Controller' action: */ … … 4514 4910 4515 4911 /* Add action into toolbar: */ 4516 m TbStorageBar->addAction(m_pActionAddController);4912 m_pToolBarStorageBar->addAction(m_pActionAddController); 4517 4913 } 4518 4914 … … 4613 5009 4614 5010 /* Add action into toolbar: */ 4615 m TbStorageBar->addAction(m_pActionRemoveController);5011 m_pToolBarStorageBar->addAction(m_pActionRemoveController); 4616 5012 } 4617 5013 … … 4624 5020 4625 5021 /* Add action into toolbar: */ 4626 m TbStorageBar->addAction(m_pActionAddAttachment);5022 m_pToolBarStorageBar->addAction(m_pActionAddAttachment); 4627 5023 } 4628 5024 … … 4659 5055 4660 5056 /* Add action into toolbar: */ 4661 m TbStorageBar->addAction(m_pActionRemoveAttachment);5057 m_pToolBarStorageBar->addAction(m_pActionRemoveAttachment); 4662 5058 } 4663 5059 } … … 4666 5062 void UIMachineSettingsStorage::prepareStorageWidgets() 4667 5063 { 4668 /* Open Medium tool-button created in the .ui file. */ 4669 AssertPtrReturnVoid(mTbOpen); 5064 AssertPtrReturnVoid(m_pToolButtonOpen); 4670 5065 { 4671 5066 /* Create Open Medium menu: */ 4672 QMenu *pOpenMediumMenu = new QMenu(m TbOpen);5067 QMenu *pOpenMediumMenu = new QMenu(m_pToolButtonOpen); 4673 5068 AssertPtrReturnVoid(pOpenMediumMenu); 4674 5069 { 4675 5070 /* Add menu into tool-button: */ 4676 mTbOpen->setMenu(pOpenMediumMenu); 4677 } 4678 } 4679 4680 /* Other widgets created in the .ui file. */ 4681 AssertPtrReturnVoid(mSbPortCount); 4682 AssertPtrReturnVoid(mLbHDFormatValue); 4683 AssertPtrReturnVoid(mLbCDFDTypeValue); 4684 AssertPtrReturnVoid(mLbHDVirtualSizeValue); 4685 AssertPtrReturnVoid(mLbHDActualSizeValue); 4686 AssertPtrReturnVoid(mLbSizeValue); 4687 AssertPtrReturnVoid(mLbHDDetailsValue); 4688 AssertPtrReturnVoid(mLbLocationValue); 4689 AssertPtrReturnVoid(mLbUsageValue); 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); 4690 5084 AssertPtrReturnVoid(m_pLabelEncryptionValue); 4691 5085 { 4692 5086 /* Configure widgets: */ 4693 m SbPortCount->setValue(0);4694 m LbHDFormatValue->setFullSizeSelection(true);4695 m LbCDFDTypeValue->setFullSizeSelection(true);4696 m LbHDVirtualSizeValue->setFullSizeSelection(true);4697 m LbHDActualSizeValue->setFullSizeSelection(true);4698 m LbSizeValue->setFullSizeSelection(true);4699 m LbHDDetailsValue->setFullSizeSelection(true);4700 m LbLocationValue->setFullSizeSelection(true);4701 m LbUsageValue->setFullSizeSelection(true);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); 4702 5096 m_pLabelEncryptionValue->setFullSizeSelection(true); 4703 5097 } … … 4761 5155 4762 5156 /* Configure tool-button: */ 4763 connect(m TbOpen, &QIToolButton::clicked, mTbOpen, &QIToolButton::showMenu);5157 connect(m_pToolButtonOpen, &QIToolButton::clicked, m_pToolButtonOpen, &QIToolButton::showMenu); 4764 5158 /* Configure menu: */ 4765 connect(m TbOpen->menu(), &QMenu::aboutToShow, this, &UIMachineSettingsStorage::sltPrepareOpenMediumMenu);5159 connect(m_pToolButtonOpen->menu(), &QMenu::aboutToShow, this, &UIMachineSettingsStorage::sltPrepareOpenMediumMenu); 4766 5160 4767 5161 /* Configure widgets: */ 4768 5162 connect(m_pMediumIdHolder, &UIMediumIDHolder::sigChanged, 4769 5163 this, &UIMachineSettingsStorage::sltSetInformation); 4770 connect(m SbPortCount, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged),5164 connect(m_pSpinBoxPortCount, static_cast<void(QSpinBox::*)(int)>(&QSpinBox::valueChanged), 4771 5165 this, &UIMachineSettingsStorage::sltSetInformation); 4772 connect(m LeName, &QLineEdit::textEdited,5166 connect(m_pLineEditName, &QLineEdit::textEdited, 4773 5167 this, &UIMachineSettingsStorage::sltSetInformation); 4774 connect(m CbType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),5168 connect(m_pComboBoxType, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), 4775 5169 this, &UIMachineSettingsStorage::sltSetInformation); 4776 connect(m CbSlot, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated),5170 connect(m_pComboBoxSlot, static_cast<void(QComboBox::*)(int)>(&QComboBox::activated), 4777 5171 this, &UIMachineSettingsStorage::sltSetInformation); 4778 connect(m CbIoCache, &QCheckBox::stateChanged,5172 connect(m_pCheckBoxIoCache, &QCheckBox::stateChanged, 4779 5173 this, &UIMachineSettingsStorage::sltSetInformation); 4780 connect(m CbPassthrough, &QCheckBox::stateChanged,5174 connect(m_pCheckBoxPassthrough, &QCheckBox::stateChanged, 4781 5175 this, &UIMachineSettingsStorage::sltSetInformation); 4782 connect(m CbTempEject, &QCheckBox::stateChanged,5176 connect(m_pCheckBoxTempEject, &QCheckBox::stateChanged, 4783 5177 this, &UIMachineSettingsStorage::sltSetInformation); 4784 connect(m CbNonRotational, &QCheckBox::stateChanged,5178 connect(m_pCheckBoxNonRotational, &QCheckBox::stateChanged, 4785 5179 this, &UIMachineSettingsStorage::sltSetInformation); 4786 5180 connect(m_pCheckBoxHotPluggable, &QCheckBox::stateChanged, … … 4872 5266 void UIMachineSettingsStorage::updateAdditionalDetails(KDeviceType enmType) 4873 5267 { 4874 m LbHDFormat->setVisible(enmType == KDeviceType_HardDisk);4875 m LbHDFormatValue->setVisible(enmType == KDeviceType_HardDisk);4876 4877 m LbCDFDType->setVisible(enmType != KDeviceType_HardDisk);4878 m LbCDFDTypeValue->setVisible(enmType != KDeviceType_HardDisk);4879 4880 m LbHDVirtualSize->setVisible(enmType == KDeviceType_HardDisk);4881 m LbHDVirtualSizeValue->setVisible(enmType == KDeviceType_HardDisk);4882 4883 m LbHDActualSize->setVisible(enmType == KDeviceType_HardDisk);4884 m LbHDActualSizeValue->setVisible(enmType == KDeviceType_HardDisk);4885 4886 m LbSize->setVisible(enmType != KDeviceType_HardDisk);4887 m LbSizeValue->setVisible(enmType != KDeviceType_HardDisk);4888 4889 m LbHDDetails->setVisible(enmType == KDeviceType_HardDisk);4890 m LbHDDetailsValue->setVisible(enmType == KDeviceType_HardDisk);5268 m_pLabelHDFormat->setVisible(enmType == KDeviceType_HardDisk); 5269 m_pLabelHDFormatValue->setVisible(enmType == KDeviceType_HardDisk); 5270 5271 m_pLabelCDFDType->setVisible(enmType != KDeviceType_HardDisk); 5272 m_pLabelCDFDTypeValue->setVisible(enmType != KDeviceType_HardDisk); 5273 5274 m_pLabelHDVirtualSize->setVisible(enmType == KDeviceType_HardDisk); 5275 m_pLabelHDVirtualSizeValue->setVisible(enmType == KDeviceType_HardDisk); 5276 5277 m_pLabelHDActualSize->setVisible(enmType == KDeviceType_HardDisk); 5278 m_pLabelHDActualSizeValue->setVisible(enmType == KDeviceType_HardDisk); 5279 5280 m_pLabelSize->setVisible(enmType != KDeviceType_HardDisk); 5281 m_pLabelSizeValue->setVisible(enmType != KDeviceType_HardDisk); 5282 5283 m_pLabelHDDetails->setVisible(enmType == KDeviceType_HardDisk); 5284 m_pLabelHDDetailsValue->setVisible(enmType == KDeviceType_HardDisk); 4891 5285 4892 5286 m_pLabelEncryption->setVisible(enmType == KDeviceType_HardDisk); -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsStorage.h
r82968 r85711 23 23 24 24 /* GUI includes: */ 25 #include "UIMachineSettingsStorage.gen.h"26 25 #include "UIMediumDefs.h" 27 26 #include "UISettingsPage.h" 28 27 29 28 /* Forward declarations: */ 29 class QCheckBox; 30 class QComboBox; 31 class QGridLayout; 32 class QLabel; 33 class QSpinBox; 34 class QStackedWidget; 35 class QILabel; 36 class QLineEdit; 37 class QVBoxLayout; 38 class QILabelSeparator; 39 class QISplitter; 40 class QIToolButton; 30 41 class QITreeView; 31 42 class StorageModel; 32 43 class UIMediumIDHolder; 44 class UIToolBar; 33 45 struct UIDataSettingsMachineStorage; 34 46 struct UIDataSettingsMachineStorageController; … … 39 51 40 52 /** Machine settings: Storage page. */ 41 class SHARED_LIBRARY_STUFF UIMachineSettingsStorage : public UISettingsPageMachine, 42 public Ui::UIMachineSettingsStorage 53 class SHARED_LIBRARY_STUFF UIMachineSettingsStorage : public UISettingsPageMachine 43 54 { 44 55 Q_OBJECT; … … 196 207 /** Prepares all. */ 197 208 void prepare(); 209 /** Prepares widgets. */ 210 void prepareWidgets(); 198 211 /** Prepares storage tree. */ 199 212 void prepareStorageTree(); … … 299 312 /** Holds the page data cache instance. */ 300 313 UISettingsCacheMachineStorage *m_pCache; 314 /** @name Widgets 315 * @{ */ 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; 361 /** @} */ 301 362 }; 302 363
Note:
See TracChangeset
for help on using the changeset viewer.