- Timestamp:
- Apr 8, 2022 6:18:43 PM (3 years ago)
- Location:
- trunk/src/VBox/Frontends/VirtualBox/src/settings
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UIMachineNetworkFeaturesEditor.cpp
r94527 r94534 246 246 m_pComboAdapterType->setItemText(i, gpConverter->toString(enmType)); 247 247 } 248 m_pComboAdapterType->setToolTip(tr(" Selects the type of the virtual network adapter. Depending on this value, VirtualBox "248 m_pComboAdapterType->setToolTip(tr("Holds the type of the virtual network adapter. Depending on this value, VirtualBox " 249 249 "will provide different network hardware to the virtual machine.")); 250 250 } … … 259 259 m_pComboPromiscuousMode->setItemText(i, gpConverter->toString(enmType)); 260 260 } 261 m_pComboPromiscuousMode->setToolTip(tr(" Selects the promiscuous mode policy of the network adapter when attached to an "261 m_pComboPromiscuousMode->setToolTip(tr("Holds the promiscuous mode policy of the network adapter when attached to an " 262 262 "internal network, host only network or a bridge.")); 263 263 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINetworkAttachmentEditor.cpp
r94530 r94534 47 47 , m_enmRestrictedNetworkAttachmentTypes(UIExtraDataMetaDefs::DetailsElementOptionTypeNetwork_Invalid) 48 48 , m_enmType(KNetworkAttachmentType_Max) 49 , m_pLayout(0) 49 50 , m_pLabelType(0) 50 51 , m_pComboType(0) … … 100 101 { 101 102 return m_name.value(enmType); 103 } 104 105 int UINetworkAttachmentEditor::minimumLabelHorizontalHint() const 106 { 107 int iMinimumLabelHorizontalHint = 0; 108 if (m_pLabelType) 109 iMinimumLabelHorizontalHint = qMax(iMinimumLabelHorizontalHint, m_pLabelType->minimumSizeHint().width()); 110 if (m_pLabelName) 111 iMinimumLabelHorizontalHint = qMax(iMinimumLabelHorizontalHint, m_pLabelName->minimumSizeHint().width()); 112 return iMinimumLabelHorizontalHint; 113 } 114 115 void UINetworkAttachmentEditor::setMinimumLayoutIndent(int iIndent) 116 { 117 if (m_pLayout) 118 m_pLayout->setColumnMinimumWidth(0, iIndent); 102 119 } 103 120 … … 255 272 256 273 /* Create main layout: */ 257 QGridLayout *pMainLayout = new QGridLayout(this);258 if ( pMainLayout)259 { 260 pMainLayout->setContentsMargins(0, 0, 0, 0);274 m_pLayout = new QGridLayout(this); 275 if (m_pLayout) 276 { 277 m_pLayout->setContentsMargins(0, 0, 0, 0); 261 278 262 279 /* Create type label: */ … … 265 282 { 266 283 m_pLabelType->setAlignment(Qt::AlignVCenter | Qt::AlignRight); 267 pMainLayout->addWidget(m_pLabelType, 0, 0);284 m_pLayout->addWidget(m_pLabelType, 0, 0); 268 285 } 269 286 /* Create type combo layout: */ … … 286 303 287 304 /* Add combo-layout into main-layout: */ 288 pMainLayout->addLayout(pComboLayout, 0, 1);305 m_pLayout->addLayout(pComboLayout, 0, 1); 289 306 } 290 307 … … 293 310 m_pLabelName->setAlignment(Qt::AlignVCenter | Qt::AlignRight); 294 311 if (m_pLabelName) 295 pMainLayout->addWidget(m_pLabelName, 1, 0);312 m_pLayout->addWidget(m_pLabelName, 1, 0); 296 313 /* Create name combo: */ 297 314 m_pComboName = new QComboBox(this); … … 305 322 connect(m_pComboName, &QComboBox::editTextChanged, 306 323 this, &UINetworkAttachmentEditor::sltHandleCurrentNameChanged); 307 pMainLayout->addWidget(m_pComboName, 1, 1);324 m_pLayout->addWidget(m_pComboName, 1, 1); 308 325 } 309 326 } -
trunk/src/VBox/Frontends/VirtualBox/src/settings/editors/UINetworkAttachmentEditor.h
r94530 r94534 35 35 /* Forward declarations: */ 36 36 class QComboBox; 37 class QGridLayout; 37 38 class QLabel; 38 39 … … 68 69 /** Returns current name for specified @a enmType. */ 69 70 QString valueName(KNetworkAttachmentType enmType) const; 71 72 /** Returns minimum layout hint. */ 73 int minimumLabelHorizontalHint() const; 74 /** Defines minimum layout @a iIndent. */ 75 void setMinimumLayoutIndent(int iIndent); 70 76 71 77 /** Returns bridged adapter list. */ … … 132 138 KNetworkAttachmentType m_enmType; 133 139 140 /** Holds the main layout instance. */ 141 QGridLayout *m_pLayout; 134 142 /** Holds the type label instance. */ 135 QLabel *m_pLabelType;143 QLabel *m_pLabelType; 136 144 /** Holds the type combo instance. */ 137 QComboBox *m_pComboType;145 QComboBox *m_pComboType; 138 146 /** Holds the name label instance. */ 139 QLabel *m_pLabelName;147 QLabel *m_pLabelName; 140 148 /** Holds the name combo instance. */ 141 QComboBox *m_pComboName;149 QComboBox *m_pComboName; 142 150 }; 143 151 -
trunk/src/VBox/Frontends/VirtualBox/src/settings/machine/UIMachineSettingsNetwork.cpp
r94530 r94534 551 551 /* Reapply attachment info: */ 552 552 sltHandleAttachmentTypeChange(); 553 554 /* These editors have own labels, but we want them to be properly layouted according to each other: */ 555 int iMinimumLayoutHint = 0; 556 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorAttachmentType->minimumLabelHorizontalHint()); 557 iMinimumLayoutHint = qMax(iMinimumLayoutHint, m_pEditorNetworkFeatures->minimumLabelHorizontalHint()); 558 m_pEditorAttachmentType->setMinimumLayoutIndent(iMinimumLayoutHint); 559 m_pEditorNetworkFeatures->setMinimumLayoutIndent(iMinimumLayoutHint); 553 560 } 554 561
Note:
See TracChangeset
for help on using the changeset viewer.