Changeset 106045 in vbox
- Timestamp:
- Sep 13, 2024 12:38:14 PM (7 months ago)
- svn:sync-xref-src-repo-rev:
- 164802
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings/editors
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.cpp
r105820 r106045 2957 2957 , m_pComboSlot(0) 2958 2958 , m_pToolButtonOpen(0) 2959 , m_pContainerForCheckBoxes1(0) 2960 , m_pContainerForCheckBoxes2(0) 2959 2961 , m_pCheckBoxPassthrough(0) 2960 2962 , m_pCheckBoxTempEject(0) … … 3688 3690 m_pToolButtonOpen->setEnabled(fIsEditable); 3689 3691 3692 /* Prepare setting #1 to show: */ 3693 int iIndexForSetting1 = 0; 3690 3694 /* Getting passthrough state: */ 3691 3695 const bool fHostDrive = pModel->data(index, StorageModel::R_AttIsHostDrive).toBool(); 3692 m_pCheckBoxPassthrough->setVisible(enmDeviceType == KDeviceType_DVD && fHostDrive); 3696 if (enmDeviceType == KDeviceType_DVD && fHostDrive) 3697 iIndexForSetting1 = 1; 3693 3698 m_pCheckBoxPassthrough->setChecked(fHostDrive && pModel->data(index, StorageModel::R_AttIsPassthrough).toBool()); 3694 3695 3699 /* Getting temp-eject state: */ 3696 m_pCheckBoxTempEject->setVisible(enmDeviceType == KDeviceType_DVD && !fHostDrive); 3700 if (enmDeviceType == KDeviceType_DVD && !fHostDrive) 3701 iIndexForSetting1 = 2; 3697 3702 m_pCheckBoxTempEject->setChecked(!fHostDrive && pModel->data(index, StorageModel::R_AttIsTempEject).toBool()); 3698 3699 3703 /* Getting non-rotational state: */ 3700 m_pCheckBoxNonRotational->setVisible(enmDeviceType == KDeviceType_HardDisk); 3704 if (enmDeviceType == KDeviceType_HardDisk) 3705 iIndexForSetting1 = 3; 3701 3706 m_pCheckBoxNonRotational->setChecked(pModel->data(index, StorageModel::R_AttIsNonRotational).toBool()); 3702 3707 /* Trigger setting #1 to show: */ 3708 m_pContainerForCheckBoxes1->setCurrentIndex(iIndexForSetting1); 3709 3710 /* Prepare setting #2 to show: */ 3711 int iIndexForSetting2 = 0; 3703 3712 /* Fetch hot-pluggable state: */ 3704 m_pCheckBoxHotPluggable->setVisible(slt.bus == KStorageBus_SATA); 3713 if (slt.bus == KStorageBus_SATA) 3714 iIndexForSetting2 = 1; 3705 3715 m_pCheckBoxHotPluggable->setChecked(fIsHotPluggable); 3716 /* Trigger setting #2 to show: */ 3717 m_pContainerForCheckBoxes2->setCurrentIndex(iIndexForSetting2); 3706 3718 3707 3719 /* Update optional widgets visibility: */ … … 4809 4821 m_pLayoutAttachment->setContentsMargins(10, 0, 0, 0); 4810 4822 m_pLayoutAttachment->setColumnStretch(2, 1); 4811 m_pLayoutAttachment->setRowStretch(1 3, 1);4823 m_pLayoutAttachment->setRowStretch(14, 1); 4812 4824 4813 4825 /* Prepare separator for attachment case: */ … … 4854 4866 } 4855 4867 4856 /* Prepare attachment settings layout: */ 4857 QVBoxLayout *pLayoutAttachmentSettings = new QVBoxLayout; 4858 if (pLayoutAttachmentSettings) 4859 { 4860 pLayoutAttachmentSettings->setContentsMargins(0, 0, 0, 0); 4868 /* Prepare attachment settings container #1: */ 4869 m_pContainerForCheckBoxes1 = new QStackedWidget(pWidgetAttachment); 4870 if (m_pContainerForCheckBoxes1) 4871 { 4872 /* Prepare placeholder: */ 4873 m_pContainerForCheckBoxes1->addWidget(new QWidget); 4861 4874 4862 4875 /* Prepare attachment passthrough check-box: */ 4863 m_pCheckBoxPassthrough = new QCheckBox( pWidgetAttachment);4876 m_pCheckBoxPassthrough = new QCheckBox(m_pContainerForCheckBoxes1); 4864 4877 if (m_pCheckBoxPassthrough) 4865 { 4866 m_pCheckBoxPassthrough->hide(); 4867 pLayoutAttachmentSettings->addWidget(m_pCheckBoxPassthrough); 4868 } 4878 m_pContainerForCheckBoxes1->addWidget(m_pCheckBoxPassthrough); 4869 4879 4870 4880 /* Prepare attachment temporary eject check-box: */ 4871 m_pCheckBoxTempEject = new QCheckBox( pWidgetAttachment);4881 m_pCheckBoxTempEject = new QCheckBox(m_pContainerForCheckBoxes1); 4872 4882 if (m_pCheckBoxTempEject) 4873 { 4874 m_pCheckBoxTempEject->hide(); 4875 pLayoutAttachmentSettings->addWidget(m_pCheckBoxTempEject); 4876 } 4883 m_pContainerForCheckBoxes1->addWidget(m_pCheckBoxTempEject); 4877 4884 4878 4885 /* Prepare attachment non rotational check-box: */ 4879 m_pCheckBoxNonRotational = new QCheckBox( pWidgetAttachment);4886 m_pCheckBoxNonRotational = new QCheckBox(m_pContainerForCheckBoxes1); 4880 4887 if (m_pCheckBoxNonRotational) 4881 { 4882 m_pCheckBoxNonRotational->hide(); 4883 pLayoutAttachmentSettings->addWidget(m_pCheckBoxNonRotational); 4884 } 4888 m_pContainerForCheckBoxes1->addWidget(m_pCheckBoxNonRotational); 4889 4890 m_pLayoutAttachment->addWidget(m_pContainerForCheckBoxes1, 2, 2); 4891 } 4892 4893 /* Prepare attachment settings container #2: */ 4894 m_pContainerForCheckBoxes2 = new QStackedWidget(pWidgetAttachment); 4895 if (m_pContainerForCheckBoxes2) 4896 { 4897 /* Prepare placeholder: */ 4898 m_pContainerForCheckBoxes2->addWidget(new QWidget); 4885 4899 4886 4900 /* Prepare attachment hot pluggable check-box: */ 4887 m_pCheckBoxHotPluggable = new QCheckBox( pWidgetAttachment);4901 m_pCheckBoxHotPluggable = new QCheckBox(m_pContainerForCheckBoxes2); 4888 4902 if (m_pCheckBoxHotPluggable) 4889 { 4890 m_pCheckBoxHotPluggable->hide(); 4891 pLayoutAttachmentSettings->addWidget(m_pCheckBoxHotPluggable); 4892 } 4893 4894 m_pLayoutAttachment->addLayout(pLayoutAttachmentSettings, 2, 2); 4903 m_pContainerForCheckBoxes2->addWidget(m_pCheckBoxHotPluggable); 4904 4905 m_pLayoutAttachment->addWidget(m_pContainerForCheckBoxes2, 3, 2); 4895 4906 } 4896 4907 … … 4898 4909 m_pLabelSeparatorInformation = new QILabelSeparator(pWidgetAttachment); 4899 4910 if (m_pLabelSeparatorInformation) 4900 m_pLayoutAttachment->addWidget(m_pLabelSeparatorInformation, 3, 0, 1, 3);4911 m_pLayoutAttachment->addWidget(m_pLabelSeparatorInformation, 4, 0, 1, 3); 4901 4912 4902 4913 /* Prepare HD format label: */ … … 4905 4916 { 4906 4917 m_pLabelHDFormat->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4907 m_pLayoutAttachment->addWidget(m_pLabelHDFormat, 4, 1);4918 m_pLayoutAttachment->addWidget(m_pLabelHDFormat, 5, 1); 4908 4919 } 4909 4920 /* Prepare HD format field: */ … … 4913 4924 m_pFieldHDFormat->setFullSizeSelection(true); 4914 4925 m_pFieldHDFormat->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 4915 m_pLayoutAttachment->addWidget(m_pFieldHDFormat, 4, 2);4926 m_pLayoutAttachment->addWidget(m_pFieldHDFormat, 5, 2); 4916 4927 } 4917 4928 … … 4921 4932 { 4922 4933 m_pLabelCDFDType->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4923 m_pLayoutAttachment->addWidget(m_pLabelCDFDType, 5, 1);4934 m_pLayoutAttachment->addWidget(m_pLabelCDFDType, 6, 1); 4924 4935 } 4925 4936 /* Prepare CD/FD type field: */ … … 4929 4940 m_pFieldCDFDType->setFullSizeSelection(true); 4930 4941 m_pFieldCDFDType->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 4931 m_pLayoutAttachment->addWidget(m_pFieldCDFDType, 5, 2);4942 m_pLayoutAttachment->addWidget(m_pFieldCDFDType, 6, 2); 4932 4943 } 4933 4944 … … 4937 4948 { 4938 4949 m_pLabelHDVirtualSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4939 m_pLayoutAttachment->addWidget(m_pLabelHDVirtualSize, 6, 1);4950 m_pLayoutAttachment->addWidget(m_pLabelHDVirtualSize, 7, 1); 4940 4951 } 4941 4952 /* Prepare HD virtual size field: */ … … 4945 4956 m_pFieldHDVirtualSize->setFullSizeSelection(true); 4946 4957 m_pFieldHDVirtualSize->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 4947 m_pLayoutAttachment->addWidget(m_pFieldHDVirtualSize, 6, 2);4958 m_pLayoutAttachment->addWidget(m_pFieldHDVirtualSize, 7, 2); 4948 4959 } 4949 4960 … … 4953 4964 { 4954 4965 m_pLabelHDActualSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4955 m_pLayoutAttachment->addWidget(m_pLabelHDActualSize, 7, 1);4966 m_pLayoutAttachment->addWidget(m_pLabelHDActualSize, 8, 1); 4956 4967 } 4957 4968 /* Prepare HD actual size field: */ … … 4961 4972 m_pFieldHDActualSize->setFullSizeSelection(true); 4962 4973 m_pFieldHDActualSize->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 4963 m_pLayoutAttachment->addWidget(m_pFieldHDActualSize, 7, 2);4974 m_pLayoutAttachment->addWidget(m_pFieldHDActualSize, 8, 2); 4964 4975 } 4965 4976 … … 4969 4980 { 4970 4981 m_pLabelCDFDSize->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4971 m_pLayoutAttachment->addWidget(m_pLabelCDFDSize, 8, 1);4982 m_pLayoutAttachment->addWidget(m_pLabelCDFDSize, 9, 1); 4972 4983 } 4973 4984 /* Prepare CD/FD size field: */ … … 4977 4988 m_pFieldCDFDSize->setFullSizeSelection(true); 4978 4989 m_pFieldCDFDSize->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 4979 m_pLayoutAttachment->addWidget(m_pFieldCDFDSize, 8, 2);4990 m_pLayoutAttachment->addWidget(m_pFieldCDFDSize, 9, 2); 4980 4991 } 4981 4992 … … 4985 4996 { 4986 4997 m_pLabelHDDetails->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 4987 m_pLayoutAttachment->addWidget(m_pLabelHDDetails, 9, 1);4998 m_pLayoutAttachment->addWidget(m_pLabelHDDetails, 10, 1); 4988 4999 } 4989 5000 /* Prepare HD details field: */ … … 4993 5004 m_pFieldHDDetails->setFullSizeSelection(true); 4994 5005 m_pFieldHDDetails->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 4995 m_pLayoutAttachment->addWidget(m_pFieldHDDetails, 9, 2);5006 m_pLayoutAttachment->addWidget(m_pFieldHDDetails, 10, 2); 4996 5007 } 4997 5008 … … 5001 5012 { 5002 5013 m_pLabelLocation->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5003 m_pLayoutAttachment->addWidget(m_pLabelLocation, 1 0, 1);5014 m_pLayoutAttachment->addWidget(m_pLabelLocation, 11, 1); 5004 5015 } 5005 5016 /* Prepare location field: */ … … 5009 5020 m_pFieldLocation->setFullSizeSelection(true); 5010 5021 m_pFieldLocation->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 5011 m_pLayoutAttachment->addWidget(m_pFieldLocation, 1 0, 2);5022 m_pLayoutAttachment->addWidget(m_pFieldLocation, 11, 2); 5012 5023 } 5013 5024 … … 5017 5028 { 5018 5029 m_pLabelUsage->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5019 m_pLayoutAttachment->addWidget(m_pLabelUsage, 1 1, 1);5030 m_pLayoutAttachment->addWidget(m_pLabelUsage, 12, 1); 5020 5031 } 5021 5032 /* Prepare usage field: */ … … 5025 5036 m_pFieldUsage->setFullSizeSelection(true); 5026 5037 m_pFieldUsage->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 5027 m_pLayoutAttachment->addWidget(m_pFieldUsage, 1 1, 2);5038 m_pLayoutAttachment->addWidget(m_pFieldUsage, 12, 2); 5028 5039 } 5029 5040 … … 5033 5044 { 5034 5045 m_pLabelEncryption->setAlignment(Qt::AlignRight | Qt::AlignVCenter); 5035 m_pLayoutAttachment->addWidget(m_pLabelEncryption, 1 2, 1);5046 m_pLayoutAttachment->addWidget(m_pLabelEncryption, 13, 1); 5036 5047 } 5037 5048 /* Prepare encryption field: */ … … 5041 5052 m_pFieldEncryption->setFullSizeSelection(true); 5042 5053 m_pFieldEncryption->setSizePolicy(QSizePolicy(QSizePolicy::Ignored, QSizePolicy::Minimum)); 5043 m_pLayoutAttachment->addWidget(m_pFieldEncryption, 1 2, 2);5054 m_pLayoutAttachment->addWidget(m_pFieldEncryption, 13, 2); 5044 5055 } 5045 5056 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIStorageSettingsEditor.h
r104371 r106045 483 483 /** Holds the open tool-button instance. */ 484 484 QIToolButton *m_pToolButtonOpen; 485 /** Holds the 1st check-box container instance. */ 486 QStackedWidget *m_pContainerForCheckBoxes1; 487 /** Holds the 2nd check-box container instance. */ 488 QStackedWidget *m_pContainerForCheckBoxes2; 485 489 /** Holds the passthrough check-box instance. */ 486 490 QCheckBox *m_pCheckBoxPassthrough;
Note:
See TracChangeset
for help on using the changeset viewer.